<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.sizecoding.org/index.php?action=history&amp;feed=atom&amp;title=Atari_Lynx</id>
		<title>Atari Lynx - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.sizecoding.org/index.php?action=history&amp;feed=atom&amp;title=Atari_Lynx"/>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Atari_Lynx&amp;action=history"/>
		<updated>2026-04-22T23:24:59Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.0</generator>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=Atari_Lynx&amp;diff=1110&amp;oldid=prev</id>
		<title>Superogue: Created page with &quot;== Atari Lynx == The Atari Lynx consists of the 65C02 with custom hardware for graphics and sound.&lt;br&gt; If you come from Atari 8bit or Apple, there are no illegal opcodes anymo...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=Atari_Lynx&amp;diff=1110&amp;oldid=prev"/>
				<updated>2022-03-10T13:15:09Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== Atari Lynx == The Atari Lynx consists of the 65C02 with custom hardware for graphics and sound.&amp;lt;br&amp;gt; If you come from Atari 8bit or Apple, there are no illegal opcodes anymo...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Atari Lynx ==&lt;br /&gt;
The Atari Lynx consists of the 65C02 with custom hardware for graphics and sound.&amp;lt;br&amp;gt;&lt;br /&gt;
If you come from Atari 8bit or Apple, there are no illegal opcodes anymore like &amp;lt;b&amp;gt;lax&amp;lt;/b&amp;gt;, but a lot new nice opcodes like &amp;lt;b&amp;gt;stz&amp;lt;/b&amp;gt;. :-)&lt;br /&gt;
&lt;br /&gt;
=== Setting up ===&lt;br /&gt;
Setting up your development platform for the Atari Lynx:&lt;br /&gt;
&lt;br /&gt;
* Assembler:&lt;br /&gt;
Below size coding examples use [https://github.com/42Bastian/lyxass Lyxass] as assembler and are using the in-official DevKit [https://github.com/42Bastian/new_bll new_bll].&amp;lt;br&amp;gt;&lt;br /&gt;
But any other 6502 assembler is suitable. Best if it can assemble the extra opcodes of the 65C02 (like &amp;lt;b&amp;gt;BBRx&amp;lt;/b&amp;gt; or &amp;lt;b&amp;gt;RMBx&amp;lt;/b&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
* Encryption&lt;br /&gt;
The Lynx boot ROM will decrypt the &amp;quot;boot sector&amp;quot; of a Lynx card image. It is done in chunks of 50bytes. Maximum are 5 chunks, hence the limit of a &amp;quot;boot sector&amp;quot; is 250 bytes, but the last byte &amp;lt;b&amp;gt;must&amp;lt;/b&amp;gt; be zero.&lt;br /&gt;
&lt;br /&gt;
* Emulator(s): &lt;br /&gt;
Currently Felix is the most accurate Emulator, though only running yet on Windows platform.&amp;lt;br&amp;gt;&lt;br /&gt;
It is currently available via [https://github.com/laoo/Felix GitHub].&lt;br /&gt;
&lt;br /&gt;
* Hardware:&lt;br /&gt;
If you want to run the code on a real Lynx, you should have a SD card for the Lynx (AgaCard, LynxGD) and also a USB&amp;lt;-&amp;gt;Serial adapter.&lt;br /&gt;
&lt;br /&gt;
=== Initial values ===&lt;br /&gt;
After the boot-rom has decrypted the boot-sector, some things are pre-defined:&lt;br /&gt;
* CPU Registers:&lt;br /&gt;
  A = 0&lt;br /&gt;
  X = 0&lt;br /&gt;
  Y = 2&lt;br /&gt;
  P = undefined&lt;br /&gt;
  S = undefined&lt;br /&gt;
&lt;br /&gt;
* Zero page&lt;br /&gt;
&lt;br /&gt;
 $00 - 0&lt;br /&gt;
 $01 - 0&lt;br /&gt;
 $02 - 0&lt;br /&gt;
&lt;br /&gt;
* Main&lt;br /&gt;
&lt;br /&gt;
Main memory is cleared to zero despite a $5000..%$50aa where decryption code is placed.&lt;br /&gt;
&lt;br /&gt;
* Bank switching&lt;br /&gt;
&lt;br /&gt;
ROM, Mikey and Suzy are mapped, Vector table is ROM.&lt;br /&gt;
&lt;br /&gt;
* Suzy&lt;br /&gt;
The sprite engine is &amp;lt;b&amp;gt;not&amp;lt;/b&amp;gt; setup.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
The Lynx display is 160x102 pixels which are linear organized as 4 bit per pixel. Hence the screen is little less than 8K.&lt;br /&gt;
The pixel value is a pointer to the color look up table.&lt;br /&gt;
The Lynx can display black and 4095 colors. The color table is split up into a green and an blue-red part (so not RGB but GBR).&lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
After the ROM has deciphered the boot sector the display memory is at $2000, background color (that is pen 0) is black, all other entries are $f despite entry 14 which is also 0.&lt;br /&gt;
&lt;br /&gt;
So to fill the screen simply do:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
lda #$ff&lt;br /&gt;
ldx #0&lt;br /&gt;
ldy #$20   ; round(160*102/2/256)&lt;br /&gt;
loop:&lt;br /&gt;
    sta $2000,x&lt;br /&gt;
    inx&lt;br /&gt;
  bne loop&lt;br /&gt;
  inc loop+2 ; Self modify&lt;br /&gt;
  dey&lt;br /&gt;
bne loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Tips 'n' tricks ===&lt;br /&gt;
A nice trick with the new opcodes to limit a counter:&lt;br /&gt;
* 6502&lt;br /&gt;
  lda counter  ; 2&lt;br /&gt;
  inc          ; 1&lt;br /&gt;
  and #3       ; 2&lt;br /&gt;
  sta counter  ; 2 = 7 bytes&lt;br /&gt;
&lt;br /&gt;
* 65C02&lt;br /&gt;
  inc counter ; 2&lt;br /&gt;
  rmb2 counter ; 2 =&amp;gt; 4 bytes&lt;br /&gt;
&lt;br /&gt;
Set a counter (previously 0) to a power-of-two (here 32)&lt;br /&gt;
&lt;br /&gt;
* 6502&lt;br /&gt;
  lda #32     ; 2&lt;br /&gt;
  sta counter ; 2 =&amp;gt; 4&lt;br /&gt;
&lt;br /&gt;
* 65C02&lt;br /&gt;
  smb5 counter ; 2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
To be added soon.&lt;br /&gt;
&lt;br /&gt;
==== Make some noise ====&lt;br /&gt;
To be added soon.&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
*[https://www.monlynx.de/lynx/lynxdoc.html Hardware documentation]&lt;br /&gt;
*[https://github.com/42Bastian/lynx_hacking/tree/master/248b Size coding examples.]&lt;br /&gt;
*[https://github.com/42Bastian/lynx-encryption-tools Lynx encryption-tools]&lt;/div&gt;</summary>
		<author><name>Superogue</name></author>	</entry>

	</feed>