<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.sizecoding.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ivop</id>
		<title>SizeCoding - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://www.sizecoding.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ivop"/>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/wiki/Special:Contributions/Ivop"/>
		<updated>2026-05-02T03:09:08Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.0</generator>

	<entry>
		<id>http://www.sizecoding.org/index.php?title=6502&amp;diff=818</id>
		<title>6502</title>
		<link rel="alternate" type="text/html" href="http://www.sizecoding.org/index.php?title=6502&amp;diff=818"/>
				<updated>2021-02-14T19:33:49Z</updated>
		
		<summary type="html">&lt;p&gt;Ivop: /* Sync with frame */ Alternative wait for vblank&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
Wanting to start sizecoding on a 6502 platform in this day and age can be tough. &lt;br /&gt;
&lt;br /&gt;
[[File:6502.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
So here is a bit of help to get you started:&lt;br /&gt;
&lt;br /&gt;
=== The 6502 processor  ===&lt;br /&gt;
The 6502 processor can be seen as the 8-bit micro ARM chip. &lt;br /&gt;
It has only has 3 registers (Accumulator, X and Y registers) and a handful of instructions to work with.&lt;br /&gt;
&lt;br /&gt;
=== Adressing modes ===&lt;br /&gt;
To be added.&lt;br /&gt;
&lt;br /&gt;
=== Zero page ===&lt;br /&gt;
When using the 6502 for sizecoding, you'll mostly be working from zeropage&lt;br /&gt;
&lt;br /&gt;
=== General 6502 Resources ===&lt;br /&gt;
* 6502.org http://www.6502.org/&lt;br /&gt;
* 6502 instruction reference http://www.6502.org/tutorials/6502opcodes.html&lt;br /&gt;
* 6502 books http://retro.hansotten.nl/6502-sbc/&lt;br /&gt;
* 6502 Assembler tutorial https://dwheeler.com/6502/oneelkruns/asm1step.html&lt;br /&gt;
* Easy 6502 code tester https://skilldrick.github.io/easy6502/&lt;br /&gt;
* Synthetic instructions https://wiki.nesdev.com/w/index.php/Synthetic_instructions#8-bit_rotate&lt;br /&gt;
&lt;br /&gt;
== Atari 8-bit family ==&lt;br /&gt;
The systems in this family are: Atari 400, 800, 5200, 1200XL, 600XL, 800XL, 130XE, 65XE, 800XE and XEGS.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Atari 8-bit systems consists of the 6502 with custom hardware for graphics and sound.&lt;br /&gt;
&lt;br /&gt;
=== Setting up ===&lt;br /&gt;
Setting up your development platform for the Atari 8bit systems is quite easy, first get the following tools:&lt;br /&gt;
&lt;br /&gt;
* Assembler: MADS Assembler - This assembler has nice macros for creating Binaries and SNA snapshot files out of the box. You can download it at https://mads.atari8.info/&lt;br /&gt;
* Emulator(s): I Found Altirra to work best for my usecase. Make sure to use the original Rev2 rom for best compatibility.&lt;br /&gt;
&lt;br /&gt;
==== Special Memory Adresses ====&lt;br /&gt;
* FRAMECOUNTER_HIGH = 19&lt;br /&gt;
* FRAMECOUNTER_LOW  = 20&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
Video display on the Atari 8bit systems use the ANTIC and GTIA chips. Information can be found here:&lt;br /&gt;
* https://en.wikipedia.org/wiki/ANTIC&lt;br /&gt;
* https://www.atariarchives.org/agagd/chapter1.php&lt;br /&gt;
&lt;br /&gt;
==== Sync with frame  ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
RTCLOK      equ $0012&lt;br /&gt;
      lda RTCLOK+2&lt;br /&gt;
waits&lt;br /&gt;
      cmp RTCLOK+2&lt;br /&gt;
      beq waits&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Or if you don't mind trashing RTCLOK&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
RTCLOK      equ $0012&lt;br /&gt;
waits&lt;br /&gt;
      lsr RTCLOK+2&lt;br /&gt;
      bcc waits&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Which is two bytes shorter.&lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
;fill screen with charset,(88,89)=an address&lt;br /&gt;
 org $600; free 6th page:600-6ff&lt;br /&gt;
 ldy #0&lt;br /&gt;
fl: tya&lt;br /&gt;
 sta(88),y&lt;br /&gt;
 iny&lt;br /&gt;
 bne fl&lt;br /&gt;
 jmp *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To be added soon.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
SDMCTL	= $022f&lt;br /&gt;
HPOSP0  = $d000&lt;br /&gt;
SIZEP0  = $d008&lt;br /&gt;
GRAFP0  = $d00d&lt;br /&gt;
COLPM0  = $d012&lt;br /&gt;
&lt;br /&gt;
FRAMECOUNTER_HIGH = 19&lt;br /&gt;
FRAMECOUNTER = 20&lt;br /&gt;
WSYNC	= $d40a&lt;br /&gt;
VCOUNT	= $d40b&lt;br /&gt;
&lt;br /&gt;
sinewave	= $0600		; to $06ff&lt;br /&gt;
&lt;br /&gt;
		org $80&lt;br /&gt;
&lt;br /&gt;
main	&lt;br /&gt;
	; disable all graphics/colors&lt;br /&gt;
	ldx #0&lt;br /&gt;
	stx SDMCTL	&lt;br /&gt;
&lt;br /&gt;
	ldy #$7f&lt;br /&gt;
	sty SIZEP0	; size p0=127&lt;br /&gt;
		&lt;br /&gt;
	ldx #0&lt;br /&gt;
	ldy #$3f&lt;br /&gt;
make_sine:&lt;br /&gt;
value_lo&lt;br /&gt;
			lda #0&lt;br /&gt;
			clc&lt;br /&gt;
delta_lo&lt;br /&gt;
			adc #0&lt;br /&gt;
			sta value_lo+1&lt;br /&gt;
value_hi&lt;br /&gt;
			lda #0&lt;br /&gt;
delta_hi&lt;br /&gt;
			adc #0&lt;br /&gt;
			sta value_hi+1&lt;br /&gt;
 &lt;br /&gt;
			sta sinewave+$c0,x&lt;br /&gt;
			sta sinewave+$80,y&lt;br /&gt;
			eor #$7f&lt;br /&gt;
			sta sinewave+$40,x&lt;br /&gt;
			sta sinewave+$00,y&lt;br /&gt;
 &lt;br /&gt;
			lda delta_lo+1&lt;br /&gt;
			adc #8&lt;br /&gt;
			sta delta_lo+1&lt;br /&gt;
			bcc nothing&lt;br /&gt;
			inc delta_hi+1&lt;br /&gt;
nothing&lt;br /&gt;
			inx&lt;br /&gt;
			dey&lt;br /&gt;
			bpl make_sine&lt;br /&gt;
&lt;br /&gt;
updateloop:&lt;br /&gt;
		; vblank&lt;br /&gt;
		lda VCOUNT&lt;br /&gt;
		bne updateloop&lt;br /&gt;
&lt;br /&gt;
		; clear graphics&lt;br /&gt;
		sta HPOSP0&lt;br /&gt;
		sta GRAFP0&lt;br /&gt;
&lt;br /&gt;
		ldy #0&lt;br /&gt;
		lda #47&lt;br /&gt;
		sta COLPM0&lt;br /&gt;
yloop:&lt;br /&gt;
		tya           ; graphics shape = y&lt;br /&gt;
		sta WSYNC&lt;br /&gt;
		sta GRAFP0&lt;br /&gt;
&lt;br /&gt;
		; a = sin(frame+y)+48&lt;br /&gt;
		tya	&lt;br /&gt;
		adc FRAMECOUNTER&lt;br /&gt;
		tax&lt;br /&gt;
		lda sinewave,x&lt;br /&gt;
		adc #48&lt;br /&gt;
		sta HPOSP0&lt;br /&gt;
                &lt;br /&gt;
                iny&lt;br /&gt;
                bne yloop&lt;br /&gt;
		jmp updateloop&lt;br /&gt;
&lt;br /&gt;
		run main&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
The Atari 8-bit use the POKEY chip to generate sound.&lt;br /&gt;
* https://en.wikipedia.org/wiki/POKEY&lt;br /&gt;
&lt;br /&gt;
==== BASIC ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
; from Analog, 1985-09,pp.25-32&lt;br /&gt;
*=$2000&lt;br /&gt;
AUDF1=$D200&lt;br /&gt;
AUDC1=$D201&lt;br /&gt;
AUDCTL=$D208&lt;br /&gt;
SKCTL=$D20F&lt;br /&gt;
&lt;br /&gt;
.MACRO SOUND ; voice,pitch,dist,vol;,dur&lt;br /&gt;
	lda #%2&lt;br /&gt;
	sta AUDF1+2*%1&lt;br /&gt;
    lda #[[%3 * 16] | %4] ;lda #[[%3 shl 4] or %4]&lt;br /&gt;
    sta AUDC1+2*%1&lt;br /&gt;
.ENDM&lt;br /&gt;
&lt;br /&gt;
 lda #0&lt;br /&gt;
 sta AUDCTL&lt;br /&gt;
 lda #3&lt;br /&gt;
 sta SKCTL&lt;br /&gt;
&lt;br /&gt;
 SOUND 0,121,10,8&lt;br /&gt;
&lt;br /&gt;
 jmp *&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;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;
Sizecoding resource for the Atari 8bit are:&lt;br /&gt;
* Mapping the Atari https://www.atariarchives.org/mapping/&lt;br /&gt;
* Atari 8bit Memory map https://www.atariarchives.org/mapping/memorymap.php&lt;br /&gt;
* Fready's undocumented 6502 opcodes https://github.com/FreddyOffenga/6502&lt;br /&gt;
* Atari OS Rev2 disassembly for MADS assembler https://github.com/ilmenit/A800-OS-XL-Rev2&lt;br /&gt;
* Fready's github https://github.com/FreddyOffenga/&lt;br /&gt;
&lt;br /&gt;
== Commodore 64 ==&lt;br /&gt;
The Commodore systems consists of the 6502 with custom hardware for graphics and sound.&lt;br /&gt;
&lt;br /&gt;
=== Setting up ===&lt;br /&gt;
Setting up your development platform for the Commodore systems is quite easy, first get the following tools:&lt;br /&gt;
&lt;br /&gt;
* Assembler: To be added&lt;br /&gt;
* Emulator(s): VICE is the way to go&lt;br /&gt;
&lt;br /&gt;
=== Autoboot ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
*=$0326&lt;br /&gt;
        .word start              &lt;br /&gt;
        .byte $ed,$f6&lt;br /&gt;
start&lt;br /&gt;
; rest of code&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Will give you autoboot and more space directly. (though writing through to $0400 will load it onto the screen unless you move the pointers)&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
Video display on the Commodore, it has the following video modes:&lt;br /&gt;
&lt;br /&gt;
To be added soon.&lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
To be added soon.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Sound ===&lt;br /&gt;
The Commodore 64 uses the famous SID chip to generate 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;
* Codebase 64 https://codebase64.org/doku.php?id=base:start&lt;br /&gt;
&lt;br /&gt;
== Apple II ==&lt;br /&gt;
The Apple II is an 8-bit home computer and one of the world's first highly successful mass-produced microcomputer products. It was designed primarily by Steve Wozniak.&lt;br /&gt;
&lt;br /&gt;
=== Setting up ===&lt;br /&gt;
* ACME 6502 cross-assembler(https://sourceforge.net/projects/acme-crossass/)&lt;br /&gt;
* Apple Commander (http://applecommander.sourceforge.net) for batch compilation&lt;br /&gt;
* AppleWin emulator (https://github.com/AppleWin/AppleWin/releases). Supports Mockingboard card(AY-8910+speech synthesier), HDD, Z80 card(for CP/M), mouse etc.&lt;br /&gt;
* CiderPress(https://a2ciderpress.com)&lt;br /&gt;
&lt;br /&gt;
Compilation can be done as follows (master.dsk can be found with applewin) &lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
acme hl.asm&lt;br /&gt;
java -jar AppleCommander-1.3.5.jar -d master.dsk hl&lt;br /&gt;
java -jar AppleCommander-1.3.5.jar -p master.dsk hl B 24576 &amp;lt; hl.bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Memory Map ===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
   0-255	 $0-$FF     ZERO-PAGE SYSTEM STORAGE&lt;br /&gt;
  256-511      $100-$1FF    SYSTEM STACK&lt;br /&gt;
  512-767      $200-$2FF    KEYBOARD CHARACTER BUFFER&lt;br /&gt;
  768-975      $300-$3CF    OFTEN AVAILABLE AS FREE SPACE FOR USER PROGRAMS&lt;br /&gt;
  976-1023     $3D0-3FF     SYSTEM VECTORS&lt;br /&gt;
 1024-2047     $400-$7FF    TEXT AND LO-RES GRAPHICS PAGE 1 &amp;lt;--- !!!&lt;br /&gt;
 2048-LOMEM    $800-LOMEM   PROGRAM STORAGE&lt;br /&gt;
 2048-3071     $800-$BFF    TEXT AND LO-RES GRAPHICS PAGE 2 OR FREE SPACE&lt;br /&gt;
 3072-8191     $C00-$1FFF   FREE SPACE UNLESS RAM APPLESOFT IS IN USE&lt;br /&gt;
 8192-16383   $2000-$3FFF   HI-RES PAGE 1 OR FREE SPACE &amp;lt;--- !!!&lt;br /&gt;
16384-24575   $4000-$5FFF   HI-RES PAGE 2 OR FREE SPACE&lt;br /&gt;
24576-38999   $6000-$95FF   FREE SPACE AND STRING STORAGE&lt;br /&gt;
38400-49151   $9600-$BFFF   DOS&lt;br /&gt;
49152-53247   $C000-$CFFF   I/O HARDWARE (RESERVED)&lt;br /&gt;
53248-57343   $D000-$DFFF   APPLESOFT IN LANGUAGE CARD OR ROM&lt;br /&gt;
57344-63487   $E000-$F7FF   APPLESOFT OR INTEGER BASIC IN LANGUAGE CARD OR ROM&lt;br /&gt;
63488-65535   $F800-$FFFF   SYSTEM MONITOR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Display ===&lt;br /&gt;
&lt;br /&gt;
=== Graphics Modes ===&lt;br /&gt;
: Text Mode 40x24, for Apple IIe available 80x25 - use PR#3 for switch mode, or hardware switch&lt;br /&gt;
: LowRes 40x48, 16 colors: https://en.wikipedia.org/wiki/Apple_II_graphics &lt;br /&gt;
: Hires mode 280x192,6 colors: https://www.xtof.info/blog/?p=768&lt;br /&gt;
https://mrob.com/pub/xapple2/colors.html&lt;br /&gt;
https://archive.org/details/HiRes_Color_Graphics_on_the_Apple_II_Computer_by_Wozniak&lt;br /&gt;
&lt;br /&gt;
However for sizecoding, you almost never want to do direct-access to graphics for Apple II in size-coding because the Apple II graphics modes are horrible.  The only fast way to do things is with large lookup tables.  To do hires you need to divide by 7 which as you can imagine is a bit difficult to do compactly on 6502. Double-hires is even crazier on top of that.  Deater did manage a color-bar style effect in double-hires in 128B but that was doing some crazy tricks with the firmware BASIC routines, definitely not direct-access.&lt;br /&gt;
&lt;br /&gt;
Lores and Hires can be mixed modes and full-graphics&lt;br /&gt;
The screen structure is called memory holes(https://retrocomputing.stackexchange.com/questions/2534/what-are-the-screen-holes-in-apple-ii-graphics). The GBASCALC($F847) procedure is used to calculate the address of the horizontal line : IN:reg.A=Y, out : GBASL/GBASH($26/$27)=address. See also https://www.callapple.org/uncategorized/use-of-apple-ii-color-graphics-in-assembly-language/&lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
Here is an example of a XOR texture, created by g0blinish&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
 *=$6000&lt;br /&gt;
 !to &amp;quot;HL.bin&amp;quot;, plain	; set output file and format&lt;br /&gt;
 !cpu 6502		; set processor type&lt;br /&gt;
&lt;br /&gt;
GBASL	=	$26&lt;br /&gt;
GBASH	=	$27&lt;br /&gt;
SETGR    =     $FB40 ; setup LoRes&lt;br /&gt;
GBASCALC = $F847 ; calc Address&lt;br /&gt;
&lt;br /&gt;
CLRTEXT =  $C050 ;display graphics &lt;br /&gt;
SETTEXT =  $C051 ;display text &lt;br /&gt;
&lt;br /&gt;
CLRMIXED = $C052 ;clear mixed mode- enable full graphics &lt;br /&gt;
SETMIXED = $C053 ;enable graphics/text mixed mode &lt;br /&gt;
&lt;br /&gt;
PAGE1 =    $C054 ;select text/graphics page1 &lt;br /&gt;
PAGE2 =    $C055 ;select text/graphics page2 &lt;br /&gt;
&lt;br /&gt;
CLRHIRES = $C056 ;select Lo-res &lt;br /&gt;
SETHIRES = $C057 ;select Hi-res &lt;br /&gt;
&lt;br /&gt;
TMP= $FA&lt;br /&gt;
&lt;br /&gt;
	JSR   SETGR      ;GR&lt;br /&gt;
	BIT CLRMIXED ; full screen&lt;br /&gt;
&lt;br /&gt;
	LDA #0 ; A=0&lt;br /&gt;
	STA TMP ; POKE $FA,A&lt;br /&gt;
&lt;br /&gt;
YLP ;&lt;br /&gt;
	LDA TMP ; A=PEEK($FA)&lt;br /&gt;
;	LSR ; A=A/2&lt;br /&gt;
	JSR GBASCALC&lt;br /&gt;
	LDY #0;Y=0&lt;br /&gt;
&lt;br /&gt;
XLP TYA ; A=Y&lt;br /&gt;
	EOR TMP ; A=A xor PEEK($FA)&lt;br /&gt;
	and #$0F ; A=A and 15&lt;br /&gt;
	TAX ; X=A&lt;br /&gt;
	LDA COLORS,X ;A=PEEK(COLORS+X)&lt;br /&gt;
	STA(GBASL),Y ; POKE PEEK($26)+256*PEEK($27)+Y,A&lt;br /&gt;
	INY ; Y=Y+1&lt;br /&gt;
	CPY #40 ; Y=40?&lt;br /&gt;
	BNE XLP&lt;br /&gt;
	INC TMP ; POKE $FA,PEEK($FA)+1&lt;br /&gt;
	LDA TMP ; A=PEEK($FA)&lt;br /&gt;
	CMP #24 ; A=24?&lt;br /&gt;
	BNE YLP&lt;br /&gt;
	&lt;br /&gt;
M1 JMP M1 ; replace to RTS&lt;br /&gt;
&lt;br /&gt;
COLORS ;N*17, pixel format is AAAABBBB, AAAA - upper dot, BBBB - lower dot&lt;br /&gt;
!byte $00,$11,$22,$33,$44,$55,$66,$77&lt;br /&gt;
!byte $88,$99,$AA,$BB,$CC,$DD,$EE,$FF&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Sound  ====&lt;br /&gt;
Here is an example for using the speaker, based onthe following basic program:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
; 50  POKE 768,V: POKE 769,P - 255 *  INT (P / 256): POKE 800,1 + P / 256&lt;br /&gt;
; 60  CALL 770: RETURN &lt;br /&gt;
; 95  FOR K = 1 TO N: READ V(K),P(K): NEXT K&lt;br /&gt;
; 100  FOR K = 1 TO N:V = V(K):P = P(K)&lt;br /&gt;
; 110  GOSUB 50&lt;br /&gt;
;!byte 173,48,192,136,208,5,206,1,3,240,9,202,208,245,174,0,3,76,2,3,206,32,3,208,240,96&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;6502&amp;quot;&amp;gt;&lt;br /&gt;
 *=$6000&lt;br /&gt;
 !to &amp;quot;HL.bin&amp;quot;, plain	; set output file and format&lt;br /&gt;
 !cpu 6502		; set processor type&lt;br /&gt;
&lt;br /&gt;
;start&lt;br /&gt;
; 95  FOR K = 1 TO N: READ V(K),P(K): NEXT K&lt;br /&gt;
; 100  FOR K = 1 TO N:V = V(K):P = P(K)&lt;br /&gt;
ini:&lt;br /&gt;
	lda #70&lt;br /&gt;
	sta cnt+1&lt;br /&gt;
	lda #music&amp;amp;255&lt;br /&gt;
	sta gotbyte+1&lt;br /&gt;
	lda #music/256&lt;br /&gt;
	sta gotbyte+2&lt;br /&gt;
&lt;br /&gt;
lop:&lt;br /&gt;
;V&lt;br /&gt;
	jsr gotbyte&lt;br /&gt;
	sta L300&lt;br /&gt;
	jsr gotbyte&lt;br /&gt;
;P&lt;br /&gt;
	jsr gotbyte&lt;br /&gt;
	sta L301&lt;br /&gt;
	jsr gotbyte&lt;br /&gt;
	clc&lt;br /&gt;
	adc #1&lt;br /&gt;
	sta L320&lt;br /&gt;
	jsr beep&lt;br /&gt;
	&lt;br /&gt;
	dec cnt+1&lt;br /&gt;
cnt lda #70&lt;br /&gt;
	bne lop&lt;br /&gt;
; 110  GOSUB 50&lt;br /&gt;
; 50  POKE 768,V: POKE 769,P - 255 *  INT (P / 256): POKE 800,1 + P / 256&lt;br /&gt;
; 60  CALL 770: RETURN &lt;br /&gt;
	jmp ini&lt;br /&gt;
gotbyte&lt;br /&gt;
	lda music&lt;br /&gt;
	inc gotbyte+1&lt;br /&gt;
	bne noinch&lt;br /&gt;
	inc gotbyte+2&lt;br /&gt;
noinch&lt;br /&gt;
	rts&lt;br /&gt;
;!byte 173,48,192,136,208,5,206,1,3,240,9,202,208,245,174,0,3,76,2,3,206,32,3,208,240,96&lt;br /&gt;
beep:&lt;br /&gt;
	ldy #1&lt;br /&gt;
	ldx #1&lt;br /&gt;
loc_302:&lt;br /&gt;
		LDA	$C030&lt;br /&gt;
&lt;br /&gt;
loc_305:&lt;br /&gt;
		DEY&lt;br /&gt;
		BNE	loc_30D&lt;br /&gt;
		DEC	L301&lt;br /&gt;
loc_30B:&lt;br /&gt;
		BEQ	loc_316&lt;br /&gt;
&lt;br /&gt;
loc_30D:&lt;br /&gt;
		DEX&lt;br /&gt;
		BNE	loc_305&lt;br /&gt;
		LDX	L300&lt;br /&gt;
		JMP	loc_302&lt;br /&gt;
loc_316:&lt;br /&gt;
		DEC	L320&lt;br /&gt;
		BNE	loc_30B&lt;br /&gt;
		RTS&lt;br /&gt;
L301 !byte 0&lt;br /&gt;
L300 !byte 0&lt;br /&gt;
L320 !byte 0&lt;br /&gt;
music&lt;br /&gt;
 !word 76,192,85,64,96,64,102,64,114,128,114,64,96,64,102,64,114,64,128,64&lt;br /&gt;
 !word 114,64,152,64,171,64,152,512,76,192,85,64,96,64,102,64,114,128,114,64&lt;br /&gt;
 !word 96,64,102,64,114,64,128,64,114,64,152,64,171,64,152,512,85,64,85,64&lt;br /&gt;
 !word 85,64,96,64,144,128,144,64,128,64,76,128,85,64,96,64,144,128,114,64&lt;br /&gt;
 !word 96,64,102,128,114,64,128,64,128,128,114,64,128,64,114,512,85,64,85,64&lt;br /&gt;
 !word 85,64,96,64,144,128,144,64,128,64,76,128,85,64,96,64,144,128,114,64&lt;br /&gt;
 !word 96,64,102,128,114,64,128,64,128,64,128,128,96,64,85,64,96,64,102,64,114,64,114,64&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Additional Resources ===&lt;br /&gt;
* Deater's page on Apple II sizecoding http://www.deater.net/weave/vmwprod/demos/sizecoding.html&lt;br /&gt;
* Article on double hi-res http://www.battlestations.zone/2017/04/apple-ii-double-hi-res-from-ground-up.html&lt;br /&gt;
* Applesoft Hi-Res Subroutines : http://hackzapple.org/scripts_php/index.php?menu=5&amp;amp;mod=ASM&amp;amp;sub=AAL&amp;amp;sub2=8112&amp;amp;PHPSESSID=f65fabfd0cdbf56b6bdc0ddac25117c6#a2&lt;br /&gt;
&lt;br /&gt;
== Atari Lynx ==&lt;br /&gt;
The Atari Lynx consists of the 6502 with custom hardware for graphics and sound.&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;
* Emulator(s): -&lt;br /&gt;
&lt;br /&gt;
=== Video display ===&lt;br /&gt;
To be added soon.&lt;br /&gt;
&lt;br /&gt;
==== Getting something on screen ====&lt;br /&gt;
To be added soon.&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;
Sizecoding resource for the Atari Lynx are sparse&lt;br /&gt;
* 42Bastian's website (link to be added)&lt;/div&gt;</summary>
		<author><name>Ivop</name></author>	</entry>

	</feed>