mads 2.1.6 build 9 (30 Aug 22)
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
     1
     2 						icl '..\maria.h'
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\..\maria.h
     1
     2 				//*****************************************************************************
     3 				//
     4 				//	MEMORY MAP USAGE OF THE 7800
     5 				//
     6 				//	00-1F		TIA REGISTERS
     7 				//	20-3F		MARIA REGISTERS
     8 				//	40-FF		ZERO PAGE RAM		<-----------------------\
     9 				//	100-13F		SHADOW OF TIA AND MARIA REGISTERS -- USED FOR	|
    10 				//			PUSHING ACCUMULATOR ONTO REGISTERS		|
    11 				//	140-1FF		RAM (STACK)	<----------\			|
    12 				//	200-27F		NOT USED		   |			|
    13 				//	280-2FF		PIA PORTS AND TIMERS	   |			|
    14 				//	300-17FF	NOT USED		   |			|
    15 				//	1800-203F	RAM			   |			|
    16 				//	2040-20FF	SHADOW OF ZERO PAGE RAM	   |	<---------------/
    17 				//	2100-213F	RAM			   |
    18 				//	2140-21FF	SHADOW OF STACK RAM	<--/
    19 				//	2200-27FF	RAM
    20 				//	2800-3FFF	DUPLICATION OF ADDRESS SPACE 2000-27FF
    21 				//	4000-FF7F	UNUSED ADDRESS SPACE
    22 				//	FF80-FFF9	RESERVED FOR ENCRYPTION
    23 				//	FFFA-FFFF	6502 VECTORS
    24 				//
    25
    26 = 0001			INPTCTRL	=	$01	;INPUT PORT CONTROL ("VBLANK" IN TIA )
    27
    28 				//
    29 				//	AFTER INITIALIZING SWCHB AS FOLLOWS:
    30 				//
    31 				//	LDA  #$14
    32 				//	STA  CTLSWB
    33 				//	LDA  #0
    34 				//	STA  SWCHB
    35 				//
    36
    37 				//	...LEFT AND RIGHT FIRE BUTTONS CAN BE READ FROM THE FOLLOWING 4 LOCATIONS:
    38 				//
    39 				//			THESE ARE ALSO USED FOR PADDLE INPUT
    40 = 0008			INPT0		=	$08	;PLAYER 0, RIGHT FIRE BUTTON (D7=1 WHEN PUSHED)
    41 = 0009			INPT1		=	$09	;PLAYER 0, LEFT FIRE BUTTON  (D7=1 WHEN PUSHED)
    42 = 000A			INPT2		=	$0A	;PLAYER 1, RIGHT FIRE BUTTON (D7=1 WHEN PUSHED)
    43 = 000B			INPT3		=	$0B	;PLAYER 1, LEFT FIRE BUTTON  (D7=1 WHEN PUSHED)
    44
    45 				//
    46 				//	LEFT OR RIGHT FIRE BUTTONS READ FROM THESE LOCATIONS:
    47 				//
    48 = 000C			INPT4		=	$0C	;PLAYER 0 FIRE BUTTON INPUT (D7=0 WHEN PUSHED)
    49 = 000D			INPT5		=	$0D	;PLAYER 1 FIRE BUTTON INPUT (D7=0 WHEN PUSHED)
    50
    51 				//
    52 = 0015			AUDC0		=	$15	;AUDIO CONTROL CHANNEL 0
    53 = 0016			AUDC1		=	$16	;AUDIO CONTROL CHANNEL 1
    54 = 0017			AUDF0		=	$17	;AUDIO FR=ENCY CHANNEL 0
    55 = 0018			AUDF1		=	$18	;AUDIO FR=ENCY CHANNEL 1
    56 = 0019			AUDV0		=	$19	;AUDIO VOLUME CHANNEL 0
    57 = 001A			AUDV1		=	$1A	;AUDIO VOLUME CHANNEL 1
    58
    59 				//*****************************************************************************
    60
    61 = 0020			BACKGRND	=	$20	;BACKGROUND COLOR
    62 = 0021			P0C1		=	$21	;PALETTE 0 - COLOR 1
    63 = 0022			P0C2		=	$22	;	   - COLOR 2
    64 = 0023			P0C3		=	$23	;	   - COLOR 3
    65 = 0024			WSYNC		=	$24	;WAIT FOR SYNC
    66 = 0025			P1C1		=	$25	;PALETTE 1 - COLOR 1
    67 = 0026			P1C2		=	$26	;	   - COLOR 2
    68 = 0027			P1C3		=	$27	;	   - COLOR 3
    69 = 0028			MSTAT		=	$28	;MARIA STATUS
    70 = 0029			P2C1		=	$29	;PALETTE 2 - COLOR 1
    71 = 002A			P2C2		=	$2A	;	   - COLOR 2
    72 = 002B			P2C3		=	$2B	;	   - COLOR 3
    73 = 002C			DPPH		=	$2C	;DISPLAY LIST LIST POINT HIGH BYTE
    74 = 002D			P3C1		=	$2D	;PALETTE 3 - COLOR 1
    75 = 002E			P3C2		=	$2E	;	   - COLOR 2
    76 = 002F			P3C3		=	$2F	;	   - COLOR 3
    77 = 0030			DPPL		=	$30	;DISPLAY LIST LIST POINT LOW BYTE
    78 = 0031			P4C1		=	$31	;PALETTE 4 - COLOR 1
    79 = 0032			P4C2		=	$32	;	   - COLOR 2
    80 = 0033			P4C3		=	$33	;	   - COLOR 3
    81 = 0034			CHBASE		=	$34	;CHARACTER BASE ADDRESS
    82 = 0035			P5C1		=	$35	;PALETTE 5 - COLOR 1
    83 = 0036			P5C2		=	$36	;	   - COLOR 2
    84 = 0037			P5C3		=	$37	;	   - COLOR 3
    85 = 0038			OFFSET		=	$38	;FOR FUTURE EXPANSION - STORE ZER0 HERE
    86 = 0039			P6C1		=	$39	;PALETTE 6 - COLOR 1
    87 = 003A			P6C2		=	$3A	;	   - COLOR 2
    88 = 003B			P6C3		=	$3B	;	   - COLOR 3
    89 = 003C			CTRL		=	$3C	;MARIA CONTROL REGISTER
    90 = 003D			P7C1		=	$3D	;PALETTE 7 - COLOR 1
    91 = 003E			P7C2		=	$3E	;	   - COLOR 2
    92 = 003F			P7C3		=	$3F	;	   - COLOR 3
    93
    94 				//
    95 				//	PIA AND TIMER (6532) LOCATIONS
    96 				//
    97 = 0280			SWCHA		=	$280	;LEFT & RIGHT JOYSTICKS
    98 				//
    99 				//	LEFT RITE
   100 				//	7654 3210	;BIT POSITION (=0 IF SWITCH IS CLOSED)
   101 				//	---- ----
   102 				//	RLDU RLDU	;RIGHT/LEFT/DOWN/UP
   103 				//
   104 = 0281			CTLSWA		=	$281	;SWCHA DATA DIRECTION (0=INPUT)
   105 = 0281			SWACNT		=	$281	;synonym for CTLSWA
   106
   107 = 0282			SWCHB		=	$282    ;CONSOLE SWITCHES
   108 				//
   109 				//	D7-RITE DIFFICULTY
   110 				//	D6-LEFT DIFFICULTY
   111 				//	D5/D4 NOT USED
   112 				//	D3-PAUSE
   113 				//	D2-NOT USED
   114 				//	D1-GAME SELECT
   115 				//	D0-GAME RESET
   116 				//
   117 = 0283			CTLSWB		=	$283	;SWCHB DATA DIRECTION (0=INPUT)
   118 = 0283			SWBCNT		=	$283	;synonym for CTLSWB
   119
   120 = 0284			INTIM		=	$284	;INTERVAL TIMER READ
   121 = 0294			TIM1T		=	$294	;SET 1    CLK INTERVAL (838   NSEC/INTERVAL)
   122 = 0295			TIM8T		=	$295	;SET 8    CLK INTERVAL (6.7   USEC/INTERVAL)
   123 = 0296			TIM64T		=	$296	;SET 64   CLK INTERVAL (53.6  USEC/INTERVAL)
   124 = 0297			T1024T		=	$297	;SET 1024 CLK INTERVAL (858.2 USEC/INTERVAL)
   125 				//
   126 				//
   127 				//
   128 				//
   129 = 0001			RESET		=	$01	;bits for consle switches
   130 = 0002			SELECT		=	$02
   131 = 0008			PAUSE		=	$08
     3
     4 						opt f+h-
     5
     6 						org $40
     7 = 0040			dest 	.ds 2 		;2 bytes
     8 = 0042			sour	.ds 2
     9 = 0044			temp	.ds 2
    10 = 0046			adc_temp .ds 1
    11 = 0047			reg_x	.ds 1
    12 = 0048			reg_y	.ds 1
    13 = 0049			reg_a	.ds 1
    14 = 004A			sin_count	.ds 2
    15 = 400A			Random	equ $400A
    16 				;
    17 = 2600			tabstart	equ $2600
    18 = 2600			tab_en		equ tabstart 		;16 bytes
    19 = 2610			x_en		equ tabstart+16
    20 = 2620			y_en		equ tabstart+32
    21 = 2630			spr_count 	equ tabstart+48	 ;16*2bytes
    22 = 2640			spr_color 	equ tabstart+64
    23 = 2650			spr_faz		equ tabstart+80
    24
    25 				          ORG     $8000-128
    26 7F80 01			HEADER       .byte    1  			; 0   Header version     - 1 byte
    27 7F81 41 54 41 52 49 37 +         .by    "ATARI7800       "	; 1..16  "ATARI7800   "  - 16 bytes
    28 7F91 53 63 72 6F 6C 6C +         .by    "Scroll & Sprites"	; 17..48 Cart title      - 32 bytes
    29 7FA1 20 20 62 79 20 45 +         .by    "  by EAGLE 2022 "	; 2 line
    30 7FB1 00 00 80 00		        DTA r	($8000)				; 49..52 data length      - 4 bytes (Big-endian format)
    31 7FB5 00 01		        .byte    $00,$01  			; 53..54 cart type      - 2 bytes
    32 				    ;    bit 0 - pokey at $4000
    33 				    ;    bit 1 - supergame bank switched
    34 				    ;    bit 2 - supergame ram at $4000
    35 				    ;    bit 3 - rom at $4000
    36 				    ;    bit 4 - bank 6 at $4000
    37 				    ;    bit 5 - supergame banked ram
    38 				    ;    bit 6 - pokey at $450
    39 				    ;    bit 7 - mirror ram at $4000
    40 				    ;    bit 8-15 - Special
    41 				    ;   0 = Normal cart
    42 7FB7 01			        .byte     1  ; 55   controller 1 type  - 1 byte
    43 7FB8 00			        .byte     0  ; 56   controller 2 type  - 1 byte
    44 				    ;    0 = None
    45 				    ;    1 = Joystick
    46 				    ;    2 = Light Gun
    47 7FB9 00			        .byte    0  ; 57 0 = NTSC 1 = PAL
    48 7FBA 00			        .byte    0  ; 58   Save data peripheral - 1 byte (version 2)
    49 				    ;    0 = None / unknown (default)
    50 				    ;    1 = High Score Cart (HSC)
    51 				    ;    2 = SaveKey
    52 7FBB 00 00 00 00		        .byte 0,0,0,0	;ORG     HEADER+63
    53 7FBF 00			        .byte    0  ; 63   Expansion module
    54 				    ;    0 = No expansion module (default on all currently released games)
    55 				    ;    1 = Expansion module required
    56 7FC0 00 00 00 00 00 00 + 	.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    57 7FD2 00 00 00 00 00 00 + 	.byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    58 				     ;   ORG     HEADER+100      ; 100..127 "ACTUAL CART DATA STARTS HERE" - 28 bytes
    59 7FE4 41 43 54 55 41 4C +         .by    "ACTUAL CART DATA STARTS HERE"
    60
    61 					.macro clear_ram
    62 					ldy #$00
    63 					mwa #:1 dest
    64 				@	lda #$00
    65 					sta (dest),y
    66 					inw dest
    67 					lda dest+1
    68 					cmp #>[:2+1]
    69 					bne @-
    70 					.endm
    71
    72
    73 8000			            org $8000
    74 				;MADS 256 bytes sinus table
    75 				/*********************************************************
    76 				SIN(centre,amp,size[,first,last])
    77 				where:
    78
    79 				centre     is a number which is added to every sine value
    80 				amp        is the sine amplitude
    81 				size       is the sine period
    82 				first,last define range of values in the table. They are optional.
    83 				           Default are 0,size-1.
    84
    85 				Example: dta a(sin(0,1000,256,0,63))
    86 				         defines table of 64 words representing a quarter of sine with
    87 				         amplitude of 1000.
    88 				*********************************************************/
    88
    89 8000			sinus
    90 8000 36 39 3B 3E 41 43 + 	dta b(sin(54,54,128))
    91 8080 36 39 3B 3E 41 43 + 	dta b(sin(54,54,128))
    92
    93 8100				.use DLLs
    94 8100			START
    95 8100 78					sei					;Disable interrupts
    96 8101 D8					cld					;Clear decimal mode
    97 8102 A9 07 85 01				mva #$07 INPTCTRL
    98 8106 A9 7F 85 3C				mva	#$7F CTRL
    99 810A A9 00 85 38				mva	#$00 OFFSET
   100 810E A9 00 85 01				mva #$00 INPTCTRL
   101 8112 A2 FF				ldx	#$FF			;Reset stack pointer
   102 8114 9A					txs
   103 				;Clear zeropage,stack,RAM
   104 8115					clear_ram $42,$FF	;skip $40&$41 (dest)
Macro: CLEAR_RAM [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 8115 A0 00			ldy #$00
     2 8117 A9 42 85 40 A9 00 + 	mwa #$42 dest
     3 811F A9 00		@	lda #$00
     4 8121 91 40			sta (dest),y
     5 8123 E6 40 D0 02 E6 41		inw dest
     6 8129 A5 41			lda dest+1
     7 812B C9 01			cmp #>[$FF+1]
     8 812D D0 F0			bne @-
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   105 812F					clear_ram $140,$1FF
Macro: CLEAR_RAM [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 812F A0 00			ldy #$00
     2 8131 A9 40 85 40 A9 01 + 	mwa #$140 dest
     3 8139 A9 00		@	lda #$00
     4 813B 91 40			sta (dest),y
     5 813D E6 40 D0 02 E6 41		inw dest
     6 8143 A5 41			lda dest+1
     7 8145 C9 02			cmp #>[$1FF+1]
     8 8147 D0 F0			bne @-
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   106 8149					clear_ram $1800,$1FFF
Macro: CLEAR_RAM [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 8149 A0 00			ldy #$00
     2 814B A9 00 85 40 A9 18 + 	mwa #$1800 dest
     3 8153 A9 00		@	lda #$00
     4 8155 91 40			sta (dest),y
     5 8157 E6 40 D0 02 E6 41		inw dest
     6 815D A5 41			lda dest+1
     7 815F C9 20			cmp #>[$1FFF+1]
     8 8161 D0 F0			bne @-
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   107 8163					clear_ram $2200,$27FF
Macro: CLEAR_RAM [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 8163 A0 00			ldy #$00
     2 8165 A9 00 85 40 A9 22 + 	mwa #$2200 dest
     3 816D A9 00		@	lda #$00
     4 816F 91 40			sta (dest),y
     5 8171 E6 40 D0 02 E6 41		inw dest
     6 8177 A5 41			lda dest+1
     7 8179 C9 28			cmp #>[$27FF+1]
     8 817B D0 F0			bne @-
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   108 817D					clear_ram $4000,$7FFF
Macro: CLEAR_RAM [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 817D A0 00			ldy #$00
     2 817F A9 00 85 40 A9 40 + 	mwa #$4000 dest
     3 8187 A9 00		@	lda #$00
     4 8189 91 40			sta (dest),y
     5 818B E6 40 D0 02 E6 41		inw dest
     6 8191 A5 41			lda dest+1
     7 8193 C9 80			cmp #>[$7FFF+1]
     8 8195 D0 F0			bne @-
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   109
   110 				;Init Pokey - we need Random numbers!
   111 8197 A9 03				lda #$03
   112 8199 8D 0F 40				sta $400F
   113
   114 				; copy Display List List To RAM
   115 819C A2 00				ldx	#$00
   116 819E			CopyLoop:
   117 819E BD 00 F0				lda	.adr DLLs,x
   118 81A1 9D 00 18				sta	$1800,x
   119 81A4 BD 00 F1				lda	.adr DLLs+$100,x
   120 81A7 9D 00 19				sta	$1900,x
   121 81AA BD 00 F2				lda	.adr DLLs+$200,x
   122 81AD 9D 00 1A				sta	$1A00,x
   123 81B0 BD 00 F3				lda	.adr DLLs+$300,x
   124 81B3 9D 00 1B				sta	$1B00,x
   125 81B6 BD 00 F4				lda	.adr DLLs+$400,x
   126 81B9 9D 00 1C				sta	$1C00,x
   127 81BC BD 00 F5				lda	.adr DLLs+$500,x
   128 81BF 9D 00 1D				sta	$1D00,x
   129 81C2 E8					inx
   130 81C3 D0 D9				bne	CopyLoop
   131
   132 						mva #<DLLs DPPL\ mva #>DLLs DPPH	;set display list list address
   132 81C5 A9 00 85 30				MVA #<DLLS DPPL
   132 81C9 A9 18 85 2C		 MVA #>DLLS DPPH	
   133 81CD 20 4F 8A				jsr	WaitVBLANK						;wait until no DMA would happen
   134
   135 81D0 A9 40 85 3C				mva	#$40	CTRL
   136 				;set colors
   137 						mva	#$00 BACKGRND\ mva #$08 P0C1\ mva #$14 P0C2\ mva #$0c P0C3
   137 81D4 A9 00 85 20				MVA	#$00 BACKGRND
   137 81D8 A9 08 85 21		 MVA #$08 P0C1
   137 81DC A9 14 85 22		 MVA #$14 P0C2
   137 81E0 A9 0C 85 23		 MVA #$0C P0C3
   138 						mva	#$00 BACKGRND\ mva #$28 P1C1\ mva #$24 P1C2\ mva #$2c P1C3
   138 81E4 A9 00 85 20				MVA	#$00 BACKGRND
   138 81E8 A9 28 85 25		 MVA #$28 P1C1
   138 81EC A9 24 85 26		 MVA #$24 P1C2
   138 81F0 A9 2C 85 27		 MVA #$2C P1C3
   139 						mva	#$00 BACKGRND\ mva #$48 P2C1\ mva #$44 P2C2\ mva #$4c P2C3
   139 81F4 A9 00 85 20				MVA	#$00 BACKGRND
   139 81F8 A9 48 85 29		 MVA #$48 P2C1
   139 81FC A9 44 85 2A		 MVA #$44 P2C2
   139 8200 A9 4C 85 2B		 MVA #$4C P2C3
   140 						mva	#$00 BACKGRND\ mva #$68 P3C1\ mva #$64 P3C2\ mva #$6c P3C3
   140 8204 A9 00 85 20				MVA	#$00 BACKGRND
   140 8208 A9 68 85 2D		 MVA #$68 P3C1
   140 820C A9 64 85 2E		 MVA #$64 P3C2
   140 8210 A9 6C 85 2F		 MVA #$6C P3C3
   141 						mva	#$00 BACKGRND\ mva #$88 P4C1\ mva #$84 P4C2\ mva #$8c P4C3
   141 8214 A9 00 85 20				MVA	#$00 BACKGRND
   141 8218 A9 88 85 31		 MVA #$88 P4C1
   141 821C A9 84 85 32		 MVA #$84 P4C2
   141 8220 A9 8C 85 33		 MVA #$8C P4C3
   142 						mva	#$00 BACKGRND\ mva #$a8 P5C1\ mva #$a4 P5C2\ mva #$ac P5C3
   142 8224 A9 00 85 20				MVA	#$00 BACKGRND
   142 8228 A9 A8 85 35		 MVA #$A8 P5C1
   142 822C A9 A4 85 36		 MVA #$A4 P5C2
   142 8230 A9 AC 85 37		 MVA #$AC P5C3
   143 						mva	#$00 BACKGRND\ mva #$c8 P6C1\ mva #$c4 P6C2\ mva #$cc P6C3
   143 8234 A9 00 85 20				MVA	#$00 BACKGRND
   143 8238 A9 C8 85 39		 MVA #$C8 P6C1
   143 823C A9 C4 85 3A		 MVA #$C4 P6C2
   143 8240 A9 CC 85 3B		 MVA #$CC P6C3
   144 						mva	#$00 BACKGRND\ mva #$e8 P7C1\ mva #$e4 P7C2\ mva #$ec P7C3
   144 8244 A9 00 85 20				MVA	#$00 BACKGRND
   144 8248 A9 E8 85 3D		 MVA #$E8 P7C1
   144 824C A9 E4 85 3E		 MVA #$E4 P7C2
   144 8250 A9 EC 85 3F		 MVA #$EC P7C3
   145 				;
   146 				;Init sprites - 1 in Tab_en (short from tab_enemy) = sprite ON
   147 8254 A9 01				lda #$01
   148 8256 A2 0F				ldx #$0F
   149 				@
   150 8258 9D 00 26				sta tab_en,x
   151 825B CA					dex
   152 825C 10 FA				bpl @-
   153 				; assign random pallets for 16 sprites
   154 825E A2 0F				ldx #$0F
   155 				@
   156 8260 AD 0A 40				lda Random
   157 8263 29 E0				and #$E0	;choose random pallet
   158 8265 09 1D				ora #$1D	;width = 3bytes (you can change to make smaller or bigger) warrning: wider sprite can crash Maria DMA timing
   159 8267 9D 40 26				sta spr_color,x
   160 826A CA					dex
   161 826B 10 F3				bpl @-
   162
   163
   164
   165 826D A9 0A 8D 10 26		mva	#10	x_en
   166 8272 A9 14 8D 11 26		mva	#20	x_en+1
   167 8277 A9 1E 8D 12 26		mva	#30	x_en+2
   168 827C A9 28 8D 13 26		mva	#40	x_en+3
   169 8281 A9 32 8D 14 26		mva	#50	x_en+4
   170 8286 A9 3C 8D 15 26		mva	#60	x_en+5
   171 828B A9 46 8D 16 26		mva	#70	x_en+6
   172 8290 A9 50 8D 17 26		mva	#80	x_en+7
   173 8295 A9 5A 8D 18 26		mva	#90	x_en+8
   174 829A A9 64 8D 19 26		mva	#100	x_en+9
   175 829F A9 6E 8D 1A 26		mva	#110	x_en+10
   176 82A4 A9 78 8D 1B 26		mva	#120	x_en+11
   177 82A9 A9 82 8D 1C 26		mva	#130	x_en+12
   178 82AE A9 8C 8D 1D 26		mva	#140	x_en+13
   179 82B3 A9 96 8D 1E 26		mva	#150	x_en+14
   180 82B8 A9 A0 8D 1F 26		mva	#160	x_en+15
   181
   182 82BD			main
   183 82BD 20 4F 8A				jsr WaitVBLANK
   184 82C0 A9 0A 85 20				mva #$0a BACKGRND	;show CPU usage
   185
   186 82C4 20 12 83				jsr update_scroll
   187 82C7 20 F3 84				jsr reset_row
   188 82CA 20 05 88				jsr Clear_all_sprites		;delete all srites from previous Vblank (put $00 in second byte after scroll/background data)
   189 82CD 20 DA 82				jsr	put_sprites_on_screen
   190 82D0 20 EE 82				jsr Sinus_path
   191 82D3 A9 00 85 20				mva #$00 BACKGRND
   192 82D7 4C BD 82				jmp main
   193
   194
   195 82DA			put_sprites_on_screen
   196 82DA A2 00			ldx #$00
   197
   198 82DC			loop_put_sprites_on_screen
   199 82DC BD 00 26			lda tab_en,x
   200 82DF 86 47			stx reg_x
   201 82E1 F0 03			beq skip_put_sprite
   202 82E3 20 30 88			jsr put_sprite
   203 82E6			skip_put_sprite
   204 82E6 A6 47			ldx reg_x
   205 82E8 E8				inx
   206 82E9 E0 10			cpx #16
   207 82EB D0 EF			bne loop_put_sprites_on_screen
   208 82ED 60				rts
   209
   210
   211 82EE			Sinus_path
   212 82EE E6 4A			inc sin_count
   213
   214 82F0 A5 4A			lda	sin_count
   215 82F2 AA				tax
   216 82F3 A0 0F			ldy #$0f
   217 82F5			loop_sinus
   218 82F5 BD 00 80			lda	sinus,x
   219 82F8 18				clc
   220 82F9 69 14			adc #20		;center sprites
   221 82FB 99 10 26			sta x_en,y
   222 82FE 8A				txa
   223 82FF 18				clc
   224 8300 69 19			adc #25
   225 8302 AA				tax
   226 8303 BD 00 80			lda	sinus,x
   227 8306 99 20 26			sta	y_en,y
   228 8309 8A				txa
   229 830A 18				clc
   230 830B 69 0F			adc #15
   231 830D AA				tax
   232 830E 88				dey
   233 830F 10 E4			bpl loop_sinus
   234 8311 60				rts
   235
   236 				;This time we update only DL for scrolling parts
   237 8312			update_scroll
   238 8312 CE 40 18 CE 44 18 + 		:16 change_x Line1,#
   239 8342 CE C4 18 CE C8 18 + 		:16 change_x Line2,#
   240 8372 CE 48 19 CE 4C 19 + 		:16 change_x Line3,#
   241 83A2 CE CC 19 CE D0 19 + 		:16 change_x Line4,#
   242 83D2 CE 50 1A CE 54 1A + 		:16 change_x Line5,#
   243 8402 CE D4 1A CE D8 1A + 		:16 change_x Line6,#
   244 8432 CE 58 1B CE 5C 1B + 		:16 change_x Line7,#
   245 8462 CE DC 1B CE E0 1B + 		:16 change_x Line8,#
   246 8492 CE 60 1C CE 64 1C + 		:16 change_x Line9,#
   247 84C2 CE E4 1C CE E8 1C + 		:16 change_x Line10,#
   248 84F2 60					rts
   249
   250 84F3			reset_row
   251 84F3 A9 3D 85 42 A9 18 + 		mwa #line1 sour
   252 84FB A0 03				ldy #$03	;+3 - xpos in DL
   253 84FD A2 00				ldx #$00
   254 				@
   255 84FF B1 42				lda (sour),y
   256 8501 C9 F4				cmp #$F4
   257 8503 F0 11				beq @+
   258 8505 18 A5 42 69 04 85 + 		adw sour #$04
   259 8510 E8					inx
   260 8511 E0 10				cpx #16
   261 8513 D0 EA				bne @-
   262 8515 60					rts
   263
   264 8516 A9 B4 A0 03 91 42 + @	:10	write_row 	;write 10 times
   265 86C4 60					rts
   266
   267 					;parametr :1 - address DL line, +3 (xpos in DL)
   268 					;parametr :2 - #*4 (# - loop counter) skip 4 bytes to next DL
   269 					;to make ?easier? for this example, DL_End is !!!4 bytes!!! instead of 2 bytes (sorry)
   270
   271 						.macro change_x
   272 						dec :1+3+[:2*4]
   273 						.endm
   274
   275 						.macro write_row
   276 						lda #180		;xpos = 180 after tile is disappear on left side
   277 						ldy #$03		;xpos in DL
   278 						sta (sour),y
   279 				
   280 				;don't look down :)
   281 				;this is only for draw new tiles
   282 				;
   283 				;choose random Tile
   284 						lda Random
   285 						and #$0F		;from 0-15
   286 				;multiply x3 because Tiles are 3 bytes width
   287 						sta temp		;=*1
   288 						asl @			;=*2
   289 						clc
   290 						adc temp		;=*3
   291 				;
   292 						ldy #$00		;update LSB
   293 						sta (sour),y
   294 				;get random pallet for Tile
   295 						lda Random
   296 						and #$E0		;we use only highest 3 bits for pallet
   297 						ora #$1D		;ora width of tile (3 bytes)
   298 						ldy #$01		;update pallet
   299 						sta (sour),y
   300 						adw sour #[33*4]	;16 DL*4bytes in one DL line +16 DL*4bytes for sprites + 2 zero ending DL + 2 extra zero to simplify math
   301 						.endm
   302
   303 					.macro	tablica_line
   304 					.word [:1],[:1+4],[:1+8],[:1+12],[:1+16],[:1+20],[:1+24],[:1+28],[:1+32],[:1+36],[:1+40],[:1+44],[:1+48],[:1+52],[:1+56],[:1+60]
   305 					.endm
   306
   307 				;Sprite addreses in DL line after scroll DL
   308 86C5			tab_line
   309 86C5				tablica_line line1+64
Macro: TABLICA_LINE [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 86C5 7D 18 81 18 85 18 + 	.word [LINE1+64],[LINE1+64+4],[LINE1+64+8],[LINE1+64+12],[LINE1+64+16],[LINE1+64+20],[LINE1+64+24],[LINE1+64+28],[LINE1+64+32],[LINE1+64+36],[LINE1+64+40],[LINE1+64+44],[LINE1+64+48],[LINE1+64+52],[LINE1+64+56],[LINE1+64+60]
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   310 86E5				tablica_line line2+64
Macro: TABLICA_LINE [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 86E5 01 19 05 19 09 19 + 	.word [LINE2+64],[LINE2+64+4],[LINE2+64+8],[LINE2+64+12],[LINE2+64+16],[LINE2+64+20],[LINE2+64+24],[LINE2+64+28],[LINE2+64+32],[LINE2+64+36],[LINE2+64+40],[LINE2+64+44],[LINE2+64+48],[LINE2+64+52],[LINE2+64+56],[LINE2+64+60]
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   311 8705				tablica_line line3+64
Macro: TABLICA_LINE [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 8705 85 19 89 19 8D 19 + 	.word [LINE3+64],[LINE3+64+4],[LINE3+64+8],[LINE3+64+12],[LINE3+64+16],[LINE3+64+20],[LINE3+64+24],[LINE3+64+28],[LINE3+64+32],[LINE3+64+36],[LINE3+64+40],[LINE3+64+44],[LINE3+64+48],[LINE3+64+52],[LINE3+64+56],[LINE3+64+60]
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   312 8725				tablica_line line4+64
Macro: TABLICA_LINE [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 8725 09 1A 0D 1A 11 1A + 	.word [LINE4+64],[LINE4+64+4],[LINE4+64+8],[LINE4+64+12],[LINE4+64+16],[LINE4+64+20],[LINE4+64+24],[LINE4+64+28],[LINE4+64+32],[LINE4+64+36],[LINE4+64+40],[LINE4+64+44],[LINE4+64+48],[LINE4+64+52],[LINE4+64+56],[LINE4+64+60]
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   313 8745				tablica_line line5+64
Macro: TABLICA_LINE [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 8745 8D 1A 91 1A 95 1A + 	.word [LINE5+64],[LINE5+64+4],[LINE5+64+8],[LINE5+64+12],[LINE5+64+16],[LINE5+64+20],[LINE5+64+24],[LINE5+64+28],[LINE5+64+32],[LINE5+64+36],[LINE5+64+40],[LINE5+64+44],[LINE5+64+48],[LINE5+64+52],[LINE5+64+56],[LINE5+64+60]
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   314 8765				tablica_line line6+64
Macro: TABLICA_LINE [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 8765 11 1B 15 1B 19 1B + 	.word [LINE6+64],[LINE6+64+4],[LINE6+64+8],[LINE6+64+12],[LINE6+64+16],[LINE6+64+20],[LINE6+64+24],[LINE6+64+28],[LINE6+64+32],[LINE6+64+36],[LINE6+64+40],[LINE6+64+44],[LINE6+64+48],[LINE6+64+52],[LINE6+64+56],[LINE6+64+60]
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   315 8785				tablica_line line7+64
Macro: TABLICA_LINE [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 8785 95 1B 99 1B 9D 1B + 	.word [LINE7+64],[LINE7+64+4],[LINE7+64+8],[LINE7+64+12],[LINE7+64+16],[LINE7+64+20],[LINE7+64+24],[LINE7+64+28],[LINE7+64+32],[LINE7+64+36],[LINE7+64+40],[LINE7+64+44],[LINE7+64+48],[LINE7+64+52],[LINE7+64+56],[LINE7+64+60]
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   316 87A5				tablica_line line8+64
Macro: TABLICA_LINE [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 87A5 19 1C 1D 1C 21 1C + 	.word [LINE8+64],[LINE8+64+4],[LINE8+64+8],[LINE8+64+12],[LINE8+64+16],[LINE8+64+20],[LINE8+64+24],[LINE8+64+28],[LINE8+64+32],[LINE8+64+36],[LINE8+64+40],[LINE8+64+44],[LINE8+64+48],[LINE8+64+52],[LINE8+64+56],[LINE8+64+60]
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   317 87C5				tablica_line line9+64
Macro: TABLICA_LINE [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 87C5 9D 1C A1 1C A5 1C + 	.word [LINE9+64],[LINE9+64+4],[LINE9+64+8],[LINE9+64+12],[LINE9+64+16],[LINE9+64+20],[LINE9+64+24],[LINE9+64+28],[LINE9+64+32],[LINE9+64+36],[LINE9+64+40],[LINE9+64+44],[LINE9+64+48],[LINE9+64+52],[LINE9+64+56],[LINE9+64+60]
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   318 87E5				tablica_line line10+64
Macro: TABLICA_LINE [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 87E5 21 1D 25 1D 29 1D + 	.word [LINE10+64],[LINE10+64+4],[LINE10+64+8],[LINE10+64+12],[LINE10+64+16],[LINE10+64+20],[LINE10+64+24],[LINE10+64+28],[LINE10+64+32],[LINE10+64+36],[LINE10+64+40],[LINE10+64+44],[LINE10+64+48],[LINE10+64+52],[LINE10+64+56],[LINE10+64+60]
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   319
   320
   321 				;put $00 in second byte (dl end)
   322 8805			Clear_all_sprites
   323 8805 A9 00			lda #$00
   324 8807 8D 7E 18			sta Line1+1+64
   325 880A 8D 02 19			sta Line2+1+64
   326 880D 8D 86 19			sta Line3+1+64
   327 8810 8D 0A 1A			sta Line4+1+64
   328 8813 8D 8E 1A			sta Line5+1+64
   329 8816 8D 12 1B			sta Line6+1+64
   330 8819 8D 96 1B			sta Line7+1+64
   331 881C 8D 1A 1C			sta Line8+1+64
   332 881F 8D 9E 1C			sta Line9+1+64
   333 8822 8D 22 1D			sta Line10+1+64
   334
   335 8825 A2 0F			ldx #$0F
   336 8827 A9 00			lda #$00
   337 8829			loop_spr_count
   338 8829 9D 30 26			sta spr_count,x
   339 882C CA				dex
   340 882D 10 FA			bpl loop_spr_count
   341 882F 60				rts
   342
   343
   344 8830			put_sprite
   345 				; I have no idea how this work :) I did this long time ago and now merge with scroll and it's working
   346 				; I translate some comments from Ponglish to English :D Enjoy
   347 				;
   348 8830 BC 20 26			ldy y_en,x		;Y position
   349 8833 84 46			sty adc_temp	;copy
   350 8835 B9 C5 88			lda tab_y,y 	;address dll
   351 8838 85 49			sta reg_a
   352 883A BE 45 89			ldx tab_spr_count,y
   353 883D BD 30 26			lda spr_count,x
   354 8840 FE 30 26			inc spr_count,x
   355 8843 0A				asl @
   356 8844 18				clc
   357 8845 65 49			adc reg_a
   358 8847 A8				tay
   359
   360 8848 B9 C5 86			lda tab_line,y
   361 884B 85 40			sta dest
   362 884D B9 C6 86			lda tab_line+1,y
   363 8850 85 41			sta dest+1
   364
   365 8852 A0 00			ldy #$00
   366 8854 A6 47			ldx reg_x
   367 8856 BD 3D 8A			lda tab_faz,x 	;sprite address (you can use for sprite animation)
   368 8859 91 40			sta (dest),y
   369 885B C8				iny
   370 885C BD 40 26			lda spr_color,x	;pallet number and width sprite
   371 885F 91 40			sta (dest),y
   372 8861 C8				iny
   373
   374 8862 A5 46			lda adc_temp
   375 8864 29 0F			and #$0f
   376 8866 18				clc
   377 8867 69 E0			adc #>[sprite_data]
   378 8869 91 40			sta (dest),y
   379 886B C8				iny
   380 886C BD 10 26			lda x_en,x		;x sprite
   381 886F 91 40			sta (dest),y
   382 8871 C8				iny
   383 8872 C8				iny
   384 8873 A9 00			lda #$00		;write $00 to mark end DL
   385 8875 91 40			sta (dest),y
   386
   387 8877 A5 46			lda adc_temp
   388 8879 18				clc
   389 887A 69 10			adc #16
   390 887C 85 46			sta adc_temp
   391 887E A8				tay
   392
   393 887F B9 C5 88			lda tab_y,y ;adres dll
   394 8882 85 49			sta reg_a
   395 8884 BE 45 89			ldx tab_spr_count,y
   396 8887 BD 30 26			lda spr_count,x
   397 888A FE 30 26			inc spr_count,x
   398 888D 0A				asl @
   399 888E 18				clc
   400 888F 65 49			adc reg_a
   401 8891 A8				tay
   402
   403 8892 B9 C5 86			lda tab_line,y
   404 8895 85 40			sta dest
   405 8897 B9 C6 86			lda tab_line+1,y
   406 889A 85 41			sta dest+1
   407 889C A0 00			ldy #$00
   408 889E A6 47			ldx reg_x
   409 88A0 BD 3D 8A			lda tab_faz,x		;sprite address (you can use for sprite animation)
   410 88A3 91 40			sta (dest),y
   411 88A5 C8				iny
   412 88A6 BD 40 26			lda spr_color,x		;pallet number and width sprite
   413 88A9 91 40			sta (dest),y
   414 88AB C8				iny
   415 88AC A5 46			lda adc_temp
   416 88AE 29 0F			and #$0f
   417 88B0 38				sec
   418 88B1 E9 10			sbc #$10
   419 88B3 18				clc
   420 88B4 69 E0			adc #>[sprite_data]
   421 88B6 91 40			sta (dest),y
   422 88B8 C8				iny
   423 88B9 BD 10 26			lda x_en,x		;x sprite
   424 88BC 91 40			sta (dest),y
   425 88BE C8				iny
   426 88BF C8				iny
   427 88C0 A9 00			lda #$00	;write $00 to mark end DL
   428 88C2 91 40			sta (dest),y
   429 88C4 60				rts
   430
   431 88C5			tab_y
   432 88C5 00 00 00 00 00 00 + 	:16 .byte 0
   433 88D5 20 20 20 20 20 20 + 	:16 .byte $20
   434 88E5 40 40 40 40 40 40 + 	:16 .byte $40
   435 88F5 60 60 60 60 60 60 + 	:16 .byte $60
   436 8905 80 80 80 80 80 80 + 	:16 .byte $80
   437 8915 A0 A0 A0 A0 A0 A0 + 	:16 .byte $a0
   438 8925 C0 C0 C0 C0 C0 C0 + 	:16 .byte $c0
   439 8935 E0 E0 E0 E0 E0 E0 + 	:16 .byte $e0
   440 8945			tab_spr_count
   441 8945 00 00 00 00 00 00 + 	:16 .byte 0
   442 8955 01 01 01 01 01 01 + 	:16 .byte 1
   443 8965 02 02 02 02 02 02 + 	:16 .byte 2
   444 8975 03 03 03 03 03 03 + 	:16 .byte 3
   445 8985 04 04 04 04 04 04 + 	:16 .byte 4
   446 8995 05 05 05 05 05 05 + 	:16 .byte 5
   447 89A5 06 06 06 06 06 06 + 	:16 .byte 6
   448 89B5 07 07 07 07 07 07 + 	:16 .byte 7
   449 89C5			tab_msb
   450 89C5 00 00 00 00 00 00 + 	:8	.byte 0
   451 89CD 01 01 01 01 01 01 + 	:8	.byte 1
   452 89D5 02 02 02 02 02 02 + 	:8	.byte 2
   453 89DD 03 03 03 03 03 03 + 	:8	.byte 3
   454 89E5 04 04 04 04 04 04 + 	:8	.byte 4
   455 89ED 05 05 05 05 05 05 + 	:8	.byte 5
   456 89F5 06 06 06 06 06 06 + 	:8	.byte 6
   457 89FD 07 07 07 07 07 07 + 	:8	.byte 7
   458 8A05 08 08 08 08 08 08 + 	:8	.byte 8
   459 8A0D 09 09 09 09 09 09 + 	:8	.byte 9
   460 8A15 0A 0A 0A 0A 0A 0A + 	:8	.byte 10
   461 8A1D 0B 0B 0B 0B 0B 0B + 	:8	.byte 11
   462 8A25 0C 0C 0C 0C 0C 0C + 	:8	.byte 12
   463 8A2D 0E 0E 0E 0E 0E 0E + 	:8	.byte 14
   464 8A35 0F 0F 0F 0F 0F 0F + 	:8	.byte 15
   465
   466 				;address of sprites from 0 to 15 in sprite_bank
   467 8A3D			tab_faz
   468 8A3D 00 03 06 09 0C 0F + 	.byte 0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45
   469
   470 8A4D 40			NMI		RTI
   471 8A4E 40			IRQ		RTI
   472
   473 8A4F			WaitVBLANK:
   474 8A4F			WaitVBoff:
   475 8A4F 24 28				bit		MSTAT
   476 8A51 30 FC				bmi		WaitVBoff
   477 8A53			WaitVBon:
   478 8A53 24 28				bit		MSTAT
   479 8A55 10 FC				bpl		WaitVBon
   480 8A57 60					rts
   481
   482 				;**************************************************
   483 				;Maria bank $E000
   484 				;**************************************************
   485 				;tiles and sprites
   486 8A58					org $E000
   487 				;
   488 E000			sprite_data
   489 E000 00 00 00 55 55 55 + 		ins 'tiles16Maria.raw'
   490
   491
   492 				;**************************************************
   493 				; RAM
   494 				;**************************************************
   495 F000					ORG	$1800,*
   496 1800			.local DLLs
   497 1800 0F 1D 65 0F 1D 65 + 	:3	.byte	$0F,>emptyline,<emptyline	;3 empty DLL
   498
   499 1809 4F 18 3D				.byte	$4F,>line1,<line1
   500 180C 4F 18 C1				.byte	$4F,>line2,<line2
   501 180F 4F 19 45				.byte	$4F,>line3,<line3
   502 1812 4F 19 C9				.byte	$4F,>line4,<line4
   503 1815 4F 1A 4D				.byte	$4F,>line5,<line5
   504 1818 4F 1A D1				.byte	$4F,>line6,<line6
   505 181B 4F 1B 55				.byte	$4F,>line7,<line7
   506 181E 4F 1B D9				.byte	$4F,>line8,<line8
   507 1821 4F 1C 5D				.byte	$4F,>line9,<line9
   508 1824 4F 1C E1				.byte	$4F,>line10,<line10
   509
   510 1827 0F 1D 65 0F 1D 65 + 	:7	.byte	$0F,>emptyline,<emptyline	;7 empty DLL
   511
   512 183C 00				.byte 0
   513
   514 					.macro DL_4byte
   515 				;		  LSB,palette+width,MSB,Xpos
   516 					.byte <$E000,$1d,>$E000,:1*12
   517 					.endm
   518
   519 					.macro Dl_End
   520 					.byte $00,$00
   521 					.byte $00,$00	;extra two zero to simplify program (or not? :D )
   522 					.endm
   523
   524 					.macro Sprites
   525 					.byte $00,$00,$00,$00
   526 					.endm
   527
   528 183D 00 1D E0 00 00 1D + line1		:16 DL_4byte #
   529 187D 00 00 00 00 00 00 + 			:16 Sprites
   530 18BD						DL_End
Macro: DLLS.DL_END [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 18BD 00 00			.byte $00,$00
     2 18BF 00 00			.byte $00,$00	;extra two zero to simplify program (or not? :D )
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   531 18C1 00 1D E0 00 00 1D + line2		:16 DL_4byte #
   532 1901 00 00 00 00 00 00 + 			:16 Sprites
   533 1941						DL_End
Macro: DLLS.DL_END [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 1941 00 00			.byte $00,$00
     2 1943 00 00			.byte $00,$00	;extra two zero to simplify program (or not? :D )
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   534 1945 00 1D E0 00 00 1D + line3		:16 DL_4byte #
   535 1985 00 00 00 00 00 00 + 			:16 Sprites
   536 19C5						DL_End
Macro: DLLS.DL_END [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 19C5 00 00			.byte $00,$00
     2 19C7 00 00			.byte $00,$00	;extra two zero to simplify program (or not? :D )
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   537 19C9 00 1D E0 00 00 1D + line4		:16 DL_4byte #
   538 1A09 00 00 00 00 00 00 + 			:16 Sprites
   539 1A49						DL_End
Macro: DLLS.DL_END [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 1A49 00 00			.byte $00,$00
     2 1A4B 00 00			.byte $00,$00	;extra two zero to simplify program (or not? :D )
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   540 1A4D 00 1D E0 00 00 1D + line5		:16 DL_4byte #
   541 1A8D 00 00 00 00 00 00 + 			:16 Sprites
   542 1ACD						DL_End
Macro: DLLS.DL_END [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 1ACD 00 00			.byte $00,$00
     2 1ACF 00 00			.byte $00,$00	;extra two zero to simplify program (or not? :D )
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   543 1AD1 00 1D E0 00 00 1D + line6		:16 DL_4byte #
   544 1B11 00 00 00 00 00 00 + 			:16 Sprites
   545 1B51						DL_End
Macro: DLLS.DL_END [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 1B51 00 00			.byte $00,$00
     2 1B53 00 00			.byte $00,$00	;extra two zero to simplify program (or not? :D )
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   546 1B55 00 1D E0 00 00 1D + line7		:16 DL_4byte #
   547 1B95 00 00 00 00 00 00 + 			:16 Sprites
   548 1BD5						DL_End
Macro: DLLS.DL_END [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 1BD5 00 00			.byte $00,$00
     2 1BD7 00 00			.byte $00,$00	;extra two zero to simplify program (or not? :D )
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   549 1BD9 00 1D E0 00 00 1D + line8		:16 DL_4byte #
   550 1C19 00 00 00 00 00 00 + 			:16 Sprites
   551 1C59						DL_End
Macro: DLLS.DL_END [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 1C59 00 00			.byte $00,$00
     2 1C5B 00 00			.byte $00,$00	;extra two zero to simplify program (or not? :D )
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   552 1C5D 00 1D E0 00 00 1D + line9		:16 DL_4byte #
   553 1C9D 00 00 00 00 00 00 + 			:16 Sprites
   554 1CDD						DL_End
Macro: DLLS.DL_END [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 1CDD 00 00			.byte $00,$00
     2 1CDF 00 00			.byte $00,$00	;extra two zero to simplify program (or not? :D )
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   555 1CE1 00 1D E0 00 00 1D + line10		:16 DL_4byte #
   556 1D21 00 00 00 00 00 00 + 			:16 Sprites
   557 1D61						DL_End
Macro: DLLS.DL_END [Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm]
     1 1D61 00 00			.byte $00,$00
     2 1D63 00 00			.byte $00,$00	;extra two zero to simplify program (or not? :D )
Source: D:\!Delphi\mads\examples\ATARI7800\directmodescroll\directmodescroll.asm
   558
   559
   560 1D65 00 00		emptyline	.byte $00,$00
   561
   562 					.endl
   563
   564 				;************** Cart reset vector **************************
   565
   566 1D67				 ORG	$fff8
   567 FFF8 FF				.byte	$FF		;Region verification
   568 FFF9 87				.byte	$87		;ROM start $8000
   569 FFFA 4D 8A			.word	NMI
   570 FFFC 00 81			.word	START
   571 FFFE 4E 8A			.word	IRQ
   572
