
	.title Sean Riddle's Williams Emulation Test Suite - blitter validation
	;www.seanriddle.com
	;assembled with as6809
		;del willyblittestdump.bin
		;del willyblittestdump.rel
		;del willyblitttestdump.s19
		;as6809 -l -o -s willyblittestdump.asm
		;aslink -s -m -u -b _CODEF000=0xF000 -b _VECTORS=0xfff0 willyblittestdump.rel
		;srec_cat willyblittestdump.s19 -o willyblittestdump.bin -binary

	;1/24/2013 - split from willyblittest2.asm, some cleanup

;PIC connected to 6809 address/data lines and *E/*W 
;writes to $EB79 sent to PC via serial port

	;game hardware
	screen_end = 0x9800				;screen memory from $0000-$97FF

	ram_end = 0xc000				;RAM from $0000-$BFFF

	color_registers = 0xC000

	widget_pia_dataa = 0xC804		;control panel
	widget_pia_ctrla = 0xC805
	widget_pia_datab = 0xC806
	widget_pia_ctrlb = 0xC807

	rom_pia_dataa = 0xC80C			;coin door and sound board
	rom_pia_ctrla = 0xC80D
	rom_pia_datab = 0xC80E
	rom_pia_ctrlb = 0xC80F

	rom_enable_scr_ctrl = 0xC900	;when D0=1, reads come from ROM, not RAM

	start_blitter = 0xCA00			;special chip registers
	blitter_mask = 0xCA01
	blitter_source = 0xCA02
	blitter_dest = 0xCA04
	blitter_w_h = 0xCA06

	vidctrs = 0xcb00				;beam vertical position (6-bit)
	
	watchdog = 0xCBFF

	stack = 0xbf00					;stack pointer

	outport = 0xEB79				;HW to PC looks for writes to this address

	;constants
	watchdog_data = 0x39

	;colors are BB GGG RRR
	COLOR_WHITE = 0xff
	COLOR_GRAY =  0xa4
	COLOR_BLUE =  0xc0
	COLOR_GREEN = 0x38
	COLOR_RED =   0x07
	
	;variables
	curpos = 0xb000				;cursor position for PSTRNG 2 bytes
	
	tmp = 0xb00b				;1 byte

	.area	_CODEF000			;this area will link at $F000
	
reset:
	orcc	#0xff
	lds		#stack				;set up stack pointer
	ldb		#watchdog_data
	stb		watchdog

	clr		rom_pia_ctrla		;setup ROM PIA
	clr		rom_pia_dataa
	lda		#0x3c
	sta		rom_pia_ctrla
	clr		rom_pia_ctrlb
	lda		#0xff
	sta		rom_pia_datab
	lda		#0x35
	sta		rom_pia_ctrlb
	lda		#0x3f
	sta		rom_pia_datab

	clr		widget_pia_ctrla	;setup widget PIA
	clr		widget_pia_ctrlb
	clr		widget_pia_dataa
	clr		widget_pia_datab
	lda		#0x34
	sta		widget_pia_ctrla
	lda		#0x3c				;select B controls for joystick
	sta		widget_pia_ctrlb

	lda		#0x00				;enable RAM
	sta		rom_enable_scr_ctrl

	jsr		clear_screen
	jsr		load_mypalette

	ldx		#0x1c88
	stx		curpos
	LDX		#BLITM1
	JSR		PSTRNG
	ldb		#watchdog_data
	jsr		delay_ffff

;sync w/PC program
	ldx		#HDRSTR
hdrloop:
	lda		,x+
	sta		outport
	bne		hdrloop

	ldy		#blit_test_start

blittest:

	lda		#COLOR_BLUE
	sta		color_registers
	ldb		#watchdog_data
	
;first, prefill all of memory so we can check for bad blits
;no subroutine calls from here to end of dump routine so stack won't change memory contents

	lda		#0x00			;first 1/4 of RAM to 00
	ldx		#0x0000
1$:
	sta		,x+
	stb		watchdog
	cmpx	#0x3000
	bne		1$

	lda		#0xFF			;second 1/4 of RAM to FF
	ldx		#0x3000
2$:
	sta		,x+
	stb		watchdog
	cmpx	#0x6000
	bne		2$

	lda		#0xA5			;third 1/4 of RAM to A5
	ldx		#0x6000
3$:
	sta		,x+
	stb		watchdog
	cmpx	#0x9000
	bne		3$

	lda		#0x5A			;fourth 1/4 of RAM to 5A
	ldx		#0x9000
4$:
	sta		,x+
	stb		watchdog
	cmpx	#ram_end
	bne		4$

	lda		#COLOR_WHITE
	sta		color_registers

	tfr		y,u			;use this y for each blit

;send blit params out to PC
	lda		,y
	sta		outport

	tfr		y,d
	leay	1,y
	sta		outport
	stb		outport

	ldx		,y++
	tfr		x,d
	sta		outport
	stb		outport

	lda		,y+
	sta		outport

	ldx		,y++
	tfr		x,d
	sta		outport
	stb		outport

	ldx		,y++
	tfr		x,d
	sta		outport
	stb		outport

	lda		,y+
	sta		outport
	
	lda		#0x00		;pad out to 16 bytes
	sta		outport
	sta		outport
	sta		outport
	sta		outport
	sta		outport

	lds		#1000			;this many blits to measure time
	
	blitloop:				;set blit params
	ldb		#watchdog_data
	stb		watchdog
	tfr		u,y

	lda		,y+
	sta		rom_enable_scr_ctrl

	ldx		,y++
	tfr		x,d
	stx		blitter_source

	lda		,y+
	sta		blitter_mask

	ldx		,y++
	tfr		x,d
	stx		blitter_dest

	ldx		,y++
	tfr		x,d
	stx		blitter_w_h

	lda		-8,y			;if ROMRAM is -1, don't do the blit, but compensate for timing
	bmi		skipblit
	lda		,y+
	sta		start_blitter	;5c
	bra		skipskip		;3c
	
skipblit:
	lda		,y+
	nop						;2c
	nop						;2c
	nop						;2c
	nop						;2c
	
skipskip:
	leas	-1,s
	cmps	#0
	lbne	blitloop
	
;dump RAM here
	lda		#0x00					;enable RAM
	sta		rom_enable_scr_ctrl

	ldb		#watchdog_data
	ldx		#0x0000
dumploop:
	stb		watchdog
	lda		,x+
	sta		outport
	
;kill some time between bytes so we don't overrun serial buffer
	lds		#4
delay_s:
	stb		watchdog
	leas	-1,s
	cmps	#0
	bne		delay_s
	lds		#stack

	cmpx	#ram_end
	bne		dumploop

	cmpy	#blit_test_end
	lblt	blittest				;more to do

;finish up	
	lda		#0x01					;enable ROM
	sta		rom_enable_scr_ctrl

	jsr		clear_screen
	jsr		load_mypalette

	ldx		#0x1c88
	stx		curpos
	LDX		#BLITM2
	JSR		PSTRNG

spin:								;sit here forever
	ldb		#watchdog_data
	stb		watchdog
	bra		spin


;blitter modes
	;Bit 0 =linear/screen source	1
	;Bit 1 =linear/screen dest		2
	;Bit 2 sync for blits from RAM, slowing 	4
	;Bit 3 tells the blitter only to blit the foreground	8
	;Bit 4 is 'solid' mode.	10
	;Bit 5 shifts the image one pixel to the right	20
	;Bit 6 says even only, bit 7 says odd only	40/80

;blitter validation parameters

blit_test_start:

	.byte	0xff,0,0,0,0,0,0,0,0	;sync
	;dest 0x0000 pre-filled with 00
	;		1=ROM	source				mask	dest		w/h			flags
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x00,0x00,	0x14,0x14,	0x00	;various w/h, all 256 bytes
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x01,0x00,	0x24,0x0c,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x02,0x00,	0x44,0x00,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x03,0x00,	0x84,0x06,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x04,0x00,	0x0c,0x24,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x05,0x00,	0x00,0x44,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x06,0x00,	0x06,0x84,	0x00
	
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x07,0x00,	0x14,0x14,	0x08	;various flags
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x08,0x00,	0x14,0x14,	0x10

	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x09,0x00,	0x14,0x14,	0x20

	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x0a,0x00,	0x14,0x14,	0x40
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x0b,0x00,	0x14,0x14,	0x80
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x0c,0x00,	0x14,0x14,	0xb8
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x0d,0x00,	0x14,0x14,	0x78
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x0e,0x00,	0x14,0x14,	0x04
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x0f,0x00,	0x14,0x14,	0x88

	.byte	1,	>#blitdata, <#blitdata,	0x0e,	0x10,0x00,	0x14,0x14,	0x10	;various masks
	.byte	1,	>#blitdata, <#blitdata,	0x1c,	0x11,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x2a,	0x12,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x38,	0x13,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x46,	0x14,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x54,	0x15,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x62,	0x16,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x70,	0x17,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x8f,	0x18,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x9d,	0x19,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xab,	0x1a,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xb9,	0x1b,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xc7,	0x1c,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xd5,	0x1d,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xe3,	0x1e,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xf1,	0x1f,0x00,	0x14,0x14,	0x10

	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x20,0x00,	0x04,0x04,	0x08	;various w/h, different sizes
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x21,0x00,	0x04,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x22,0x00,	0x04,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x23,0x00,	0x04,0x07,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x24,0x00,	0x05,0x04,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x25,0x00,	0x05,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x26,0x00,	0x05,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x27,0x00,	0x05,0x07,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x28,0x00,	0x06,0x04,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x29,0x00,	0x06,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x2a,0x00,	0x06,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x2b,0x00,	0x06,0x07,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x2c,0x00,	0x07,0x04,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x2d,0x00,	0x07,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x2e,0x00,	0x07,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x2f,0x00,	0x07,0x07,	0x08


	;dest 0x3000 pre-filled with ff
	;		1=ROM	source				mask	dest		w/h			flags
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x30,0x00,	0x14,0x14,	0x00	;various w/h, all 256 bytes
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x31,0x00,	0x24,0x0c,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x32,0x00,	0x44,0x00,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x33,0x00,	0x84,0x06,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x34,0x00,	0x0c,0x24,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x35,0x00,	0x00,0x44,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x36,0x00,	0x06,0x84,	0x00
	
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x37,0x00,	0x14,0x14,	0x08	;various flags
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x38,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x39,0x00,	0x14,0x14,	0x20
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x3a,0x00,	0x14,0x14,	0x40
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x3b,0x00,	0x14,0x14,	0x80

	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x3c,0x00,	0x14,0x14,	0xb8
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x3d,0x00,	0x14,0x14,	0x78

	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x3e,0x00,	0x14,0x14,	0x04
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x3f,0x00,	0x14,0x14,	0x88

	.byte	1,	>#blitdata, <#blitdata,	0x0f,	0x40,0x00,	0x14,0x14,	0x10	;various masks
	.byte	1,	>#blitdata, <#blitdata,	0x1d,	0x41,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x2b,	0x42,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x39,	0x43,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x47,	0x44,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x55,	0x45,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x63,	0x46,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x71,	0x47,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x8e,	0x48,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x9c,	0x49,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xaa,	0x4a,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xb8,	0x4b,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xc6,	0x4c,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xd4,	0x4d,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xe2,	0x4e,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xf0,	0x4f,0x00,	0x14,0x14,	0x10
	
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x50,0x00,	0x04,0x04,	0x08	;various w/h, different sizes
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x51,0x00,	0x04,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x52,0x00,	0x04,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x53,0x00,	0x04,0x07,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x54,0x00,	0x05,0x04,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x55,0x00,	0x05,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x56,0x00,	0x05,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x57,0x00,	0x05,0x07,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x58,0x00,	0x06,0x04,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x59,0x00,	0x06,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x5a,0x00,	0x06,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x5b,0x00,	0x06,0x07,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x5c,0x00,	0x07,0x04,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x5d,0x00,	0x07,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x5e,0x00,	0x07,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x5f,0x00,	0x07,0x07,	0x08

	;dest 0x6000 pre-filled with A5
	;	1=ROM	source			mask	dest		w/h		flags
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x60,0x00,	0x14,0x14,	0x00	;various w/h, all 256 bytes
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x61,0x00,	0x24,0x0c,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x62,0x00,	0x44,0x00,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x63,0x00,	0x84,0x06,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x64,0x00,	0x0c,0x24,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x65,0x00,	0x00,0x44,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x66,0x00,	0x06,0x84,	0x00
	
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x67,0x00,	0x14,0x14,	0x08	;various flags
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x68,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x69,0x00,	0x14,0x14,	0x20
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x6a,0x00,	0x14,0x14,	0x40
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x6b,0x00,	0x14,0x14,	0x80
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x6c,0x00,	0x14,0x14,	0xb8
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x6d,0x00,	0x14,0x14,	0x78
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x6e,0x00,	0x14,0x14,	0x04
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x6f,0x00,	0x14,0x14,	0x88

	.byte	1,	>#blitdata, <#blitdata,	0x0f,	0x70,0x00,	0x14,0x14,	0x10	;various masks
	.byte	1,	>#blitdata, <#blitdata,	0x1e,	0x71,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x2d,	0x72,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x73,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x4b,	0x74,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x5a,	0x75,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x69,	0x76,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x78,	0x77,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x87,	0x78,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x96,	0x79,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xa5,	0x7a,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xb4,	0x7b,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xc3,	0x7c,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xd2,	0x7d,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xe1,	0x7e,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xf0,	0x7f,0x00,	0x14,0x14,	0x10

	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x80,0x00,	0x04,0x04,	0x08	;various w/h, different sizes
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x81,0x00,	0x04,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x82,0x00,	0x04,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x83,0x00,	0x04,0x07,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x84,0x00,	0x05,0x04,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x85,0x00,	0x05,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x86,0x00,	0x05,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x87,0x00,	0x05,0x07,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x88,0x00,	0x06,0x04,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x89,0x00,	0x06,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x8a,0x00,	0x06,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x8b,0x00,	0x06,0x07,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x8c,0x00,	0x07,0x04,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x8d,0x00,	0x07,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x8e,0x00,	0x07,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x8f,0x00,	0x07,0x07,	0x08

	;dest 0x9000 pre-filled with 5A
	;	1=ROM	source			mask	dest		w/h		flags
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x90,0x00,	0x14,0x14,	0x00	;various w/h, all 256 bytes
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x91,0x00,	0x24,0x0c,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x92,0x00,	0x44,0x00,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x93,0x00,	0x84,0x06,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x94,0x00,	0x0c,0x24,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x95,0x00,	0x00,0x44,	0x00
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x96,0x00,	0x06,0x84,	0x00
	
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x97,0x00,	0x14,0x14,	0x08	;various flags
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x98,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x99,0x00,	0x14,0x14,	0x20
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x9a,0x00,	0x14,0x14,	0x40
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x9b,0x00,	0x14,0x14,	0x80
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x9c,0x00,	0x14,0x14,	0xb8
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x9d,0x00,	0x14,0x14,	0x78
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x9e,0x00,	0x14,0x14,	0x04
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x9f,0x00,	0x14,0x14,	0x88

	.byte	1,	>#blitdata, <#blitdata,	0x02,	0xa0,0x00,	0x14,0x14,	0x10	;various masks
	.byte	1,	>#blitdata, <#blitdata,	0x14,	0xa1,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x26,	0xa2,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x38,	0xa3,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x4a,	0xa4,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x5c,	0xa5,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x6e,	0xa6,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x70,	0xa7,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x81,	0xa8,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0x93,	0xa9,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xa5,	0xaa,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xb7,	0xab,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xc9,	0xac,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xdb,	0xad,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xed,	0xae,0x00,	0x14,0x14,	0x10
	.byte	1,	>#blitdata, <#blitdata,	0xff,	0xaf,0x00,	0x14,0x14,	0x10

	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xb0,0x00,	0x04,0x04,	0x08	;various w/h, different sizes
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xb1,0x00,	0x04,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xb2,0x00,	0x04,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xb3,0x00,	0x04,0x07,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xb4,0x00,	0x05,0x04,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xb5,0x00,	0x05,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xb6,0x00,	0x05,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xb7,0x00,	0x05,0x07,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xb8,0x00,	0x06,0x04,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xb9,0x00,	0x06,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xba,0x00,	0x06,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xbb,0x00,	0x06,0x07,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xbc,0x00,	0x07,0x04,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xbd,0x00,	0x07,0x05,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xbe,0x00,	0x07,0x06,	0x08
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xbf,0x00,	0x07,0x07,	0x08


	;pass 2
	;		1=ROM	source				mask	dest		w/h			flags
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xff,0xf0,	0x14,0x14,	0x00	;wraps FFF0-00EF
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x01,0x01,	0x14,0x14,	0x00	;odd dest address
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x03,0x00,	0x0b,0x0b,	0x00	;odd w/h
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x04,0x00,	0x14,0x14,	0x00	;normal
	.byte	0,	0x04,0x00,				0x3c,	0x04,0x80,	0x14,0x14,	0x04	;sync overlapping source/dest
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x06,0x00,	0x14,0x14,	0x00	;normal
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x07,0x00,	0x14,0x14,	0x00	;normal
	.byte	0,	0x2f,0x80,				0x3c,	0x2f,0x00,	0x14,0x14,	0x04	;sync overlapping source/dest, wrapping 00 area to FF area
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x08,0x00,	0xfb,0x04,	0x00	;256x1

	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x08,0x00,	0xfb,0x05,	0x00	;256x1
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x08,0x00,	0xf05,0xfb,	0x00	;256x1

	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x09,0x00,	0x04,0xfb,	0x00	;1x256
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x10,0x00,	0x14,0x14,	0x02	;screen dest
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x20,0x00,	0x14,0x14,	0x1a	;solid FG screen dest
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x30,0x00,	0x14,0x14,	0x0a	;FG screen dest
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x40,0x00,	0x14,0x14,	0x2a	;shifted FG screen dest
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x50,0x00,	0x14,0x14,	0x56	;even solid sync screen dest
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x60,0x00,	0x14,0x14,	0x46	;even sync screen dest
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x70,0x00,	0x14,0x14,	0x02	;screen dest
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x80,0x00,	0x14,0x14,	0x1a	;solid FG screen dest
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0x90,0x00,	0x14,0x14,	0x0a	;FG screen dest
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xa0,0x00,	0x14,0x14,	0x2a	;shifted FG screen dest
	.byte	1,	>#blitdata, <#blitdata,	0x3c,	0xb0,0x00,	0x14,0x14,	0x56	;even solid sync screen dest	

	;pass 3
	;		1=ROM			source		mask	dest		w/h			flags

	.byte	1,	0x00, 		0x00,		0x00,	0x00,0x00,	0x00,0x00,	0x00	;	all zeroes

	.byte	1,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x04,0x04,	0x00	;	
	
	.byte	1,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x04,0x05,	0x00	;	
	.byte	1,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x04,0x06,	0x00	;	
	.byte	1,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x04,0x07,	0x00	;	
	.byte	1,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x04,0x08,	0x00	;	

	.byte	1,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x05,0x04,	0x00	;	
	.byte	1,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x06,0x04,	0x00	;	
	.byte	1,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x07,0x04,	0x00	;	
	.byte	1,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x08,0x04,	0x00	;	

	.byte	1,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x05,0x05,	0x00	;	
	.byte	1,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x06,0x06,	0x00	;	
	.byte	1,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x07,0x07,	0x00	;	
	.byte	1,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x08,0x08,	0x00	;	


	.byte	0,	0x00, 		0x00,		0x3c,	0x40,0x00,	0x74,0x74,	0x04	;	large (12K) slow
	.byte	0,	0x00, 		0x00,		0x3c,	0x40,0x00,	0x74,0x74,	0xd4	;	large (12K) slow
	.byte	0,	0x00, 		0x00,		0x3c,	0x40,0x00,	0x74,0x74,	0xdc	;	large (12K) slow+
	.byte	0,	0x00, 		0x00,		0x3c,	0x40,0x00,	0x74,0x74,	0xcc	;	large (12K) slow
	.byte	0,	0x00, 		0x00,		0x3c,	0x40,0x00,	0x74,0x74,	0x94	;	large (12K) slow
	.byte	0,	0x00, 		0x00,		0x3c,	0x40,0x00,	0x74,0x74,	0x9c	;	large (12K) slow+
	.byte	0,	0x00, 		0x00,		0x3c,	0x40,0x00,	0x74,0x74,	0x54	;	large (12K) slow
	.byte	0,	0x00, 		0x00,		0x3c,	0x40,0x00,	0x74,0x74,	0x5c	;	large (12K) slow+
	.byte	0,	0x00, 		0x00,		0x3c,	0x40,0x00,	0x74,0x74,	0xC4	;	large no odd, no even slow
	.byte	0,	0x00, 		0x00,		0x3c,	0x40,0x00,	0x74,0x74,	0x14	;	large solid slow
	.byte	0,	0x00, 		0x00,		0x3c,	0x40,0x00,	0x74,0x74,	0x24	;	large shift slow
	.byte	0,	0x00, 		0x00,		0x3c,	0x40,0x00,	0x74,0x74,	0xfc	;	large mode fc+
	.byte	0,	0x00, 		0x00,		0x3c,	0x40,0x00,	0x74,0x74,	0xff	;	large mode ff+

	.byte	0,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x98,0x98,	0x04	;	larger (24K) normal slow
	.byte	0,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x98,0x98,	0xC4	;	larger no odd, no even slow
	.byte	0,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x98,0x98,	0x14	;	larger solid slow
	.byte	0,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x98,0x98,	0x24	;	larger shift slow
	.byte	0,	0x00, 		0x00,		0x3c,	0x60,0x00,	0x98,0x98,	0xfc	;	larger mode fc
	.byte	0,	0x00, 		0x00,		0x3c,	0x20,0x00,	0x98,0x98,	0xff	;	larger mode ff

	.byte	0,	0x00, 		0x00,		0x3c,	0x00,0x00,	0xba,0xba,	0x04	;	larger (36K) normal
	.byte	0,	0x00, 		0x00,		0x3c,	0x00,0x00,	0xba,0xba,	0xC4	;	larger no odd, no even slow
	.byte	0,	0x00, 		0x00,		0x3c,	0x00,0x00,	0xba,0xba,	0x14	;	larger solid slow
blit_test_start2:
	.byte	0,	0x00, 		0x00,		0x3c,	0x00,0x00,	0xba,0xba,	0x24	;	larger shift slow
blit_test_end2:
	.byte	0,	0x00, 		0x00,		0x3c,	0x00,0x00,	0xba,0xba,	0xfc	;	larger mode fc
	.byte	0,	0x00, 		0x00,		0x3c,	0x00,0x00,	0xba,0xba,	0xff	;	larger mode ff
	
	.byte	0,	0x00, 		0x00,		0x3c,	0x01,0x01,	0xd9,0xd9,	0x04	;	RAM big blit 48841 bytes

blit_test_end:


;blitter modes
	;Bit 0 =linear/screen source	1
	;Bit 1 =linear/screen dest		2
	;Bit 2 sync for blits from RAM, slowing 	4
	;Bit 3 tells the blitter only to blit the foreground	8
	;Bit 4 is 'solid' mode.	10
	;Bit 5 shifts the image one pixel to the right	20
	;Bit 6 says even only, bit 7 says odd only	40/80


	;subroutines
load_mypalette:
	ldy		#mypalette
load_palette:						;load palette from y
	ldx		#color_registers
2$:
	lda		vidctrs
	anda	#0xfc
	bne		2$
1$:
	lda		,y+
	sta		,x+
	cmpx	#color_registers+0x10
	bne		1$
	rts
			

;delays - must ldb #watchdog_data before calling
delay_ffff:
	ldx		#0xffff
delay_x:
	stb		watchdog
	leax	-1,x
	bne		delay_x
	rts
	
	
;write 0x00 to 0x0000-0x97ff
clear_screen:
	lda		#0x00
fill_screen:
	ldx		#0x0000
1$:
	sta		,x+
	stb		watchdog
	cmpx	#screen_end
	bne		1$
	rts


;print string in X terminated with null
PSTRNG:
	lda		,x+
	beq		$pexit
	pshs 	x
	jsr		pchar
	puls	x
	bra		PSTRNG
$pexit:
	rts


;print value in A in hex
PHEX:
	sta		tmp
	rora		
	rora		
	rora		
	rora		
	anda	#0x0f
	cmpa	#0x0a
	blt		$1a
	adda	#0x07
$1a:
	adda	#0x30
	jsr		pchar
	
	lda		tmp
	anda	#0x0f
	cmpa	#0x0a
	blt		$2a
	adda	#0x07
$2a:
	adda	#0x30
	jmp		pchar


pchar:								;a=ascii char to print, from 0 (0x30) to Z (0x5a)
	ldx		#badchar
	cmpa	#0x30
	blt		blitchar
	cmpa	#0x5A
	bge		blitchar
	
	ldx		#font
	suba	#0x30					;0 is first char
	ldb		#0x0a
	mul								;index into font table; 2 bytes wide, 5 bytes tall = 10 bytes per char
	leax	d,x
	
blitchar:
	stx		blitter_source
	lda		#0xff					;replace the current contents
	sta		blitter_mask
	ldx		curpos
	stx		blitter_dest
	ldx		#0x0601					;width and height XOR 0x04 - 2 x 5 bytes = 4 x 5 pixels, 3x5 active w/spaces
	stx		blitter_w_h
	lda		#0x1a					;start blit solid, foreground, linear to screen layout
	sta		start_blitter
	ldx 	curpos
	leax	0x0300,x				;move cursor right 1 char
	stx		curpos
	rts


;simple monospace 4x5 font
font:

	.byte 0x11,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x11,0x10	;0
	.byte 0x01,0x00,0x11,0x00,0x01,0x00,0x01,0x00,0x11,0x10
	.byte 0x11,0x10,0x00,0x10,0x11,0x10,0x10,0x00,0x11,0x10
	.byte 0x11,0x10,0x00,0x10,0x11,0x10,0x00,0x10,0x11,0x10 
	.byte 0x10,0x10,0x10,0x10,0x11,0x10,0x00,0x10,0x00,0x10
	.byte 0x11,0x10,0x10,0x00,0x11,0x10,0x00,0x10,0x11,0x10	;5
	.byte 0x11,0x10,0x10,0x00,0x11,0x10,0x10,0x10,0x11,0x10
	.byte 0x11,0x10,0x00,0x10,0x01,0x00,0x01,0x00,0x01,0x00 
	.byte 0x11,0x10,0x10,0x10,0x11,0x10,0x10,0x10,0x11,0x10
	.byte 0x11,0x10,0x10,0x10,0x11,0x10,0x00,0x10,0x00,0x10	;9
	
	.byte 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00	;:
	.byte 0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x10,0x00	;;
	.byte 0x00,0x10,0x01,0x00,0x10,0x00,0x01,0x00,0x00,0x10	;<
	.byte 0x00,0x00,0x11,0x10,0x00,0x00,0x11,0x10,0x00,0x00	;=
	.byte 0x10,0x00,0x01,0x00,0x00,0x10,0x01,0x00,0x10,0x00	;>
	.byte 0x01,0x00,0x10,0x10,0x00,0x10,0x01,0x00,0x01,0x00	;?
	.byte 0x01,0x00,0x10,0x10,0x11,0x00,0x10,0x00,0x01,0x10	;@
	
	.byte 0x11,0x10,0x10,0x10,0x11,0x10,0x10,0x10,0x10,0x10 ;A
	.byte 0x11,0x10,0x10,0x10,0x11,0x00,0x10,0x10,0x11,0x10
	.byte 0x11,0x10,0x10,0x00,0x10,0x00,0x10,0x00,0x11,0x10
	.byte 0x11,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x11,0x00
	.byte 0x11,0x10,0x10,0x00,0x11,0x00,0x10,0x00,0x11,0x10 
	.byte 0x11,0x10,0x10,0x00,0x11,0x00,0x10,0x00,0x10,0x00 
	.byte 0x11,0x10,0x10,0x00,0x10,0x10,0x10,0x10,0x11,0x10
	.byte 0x10,0x10,0x10,0x10,0x11,0x10,0x10,0x10,0x10,0x10
	.byte 0x11,0x10,0x01,0x00,0x01,0x00,0x01,0x00,0x11,0x10
	.byte 0x00,0x10,0x00,0x10,0x00,0x10,0x10,0x10,0x11,0x10
	.byte 0x10,0x10,0x10,0x10,0x11,0x00,0x10,0x10,0x10,0x10
	.byte 0x10,0x00,0x10,0x00,0x10,0x00,0x10,0x00,0x11,0x10	;L
	.byte 0x11,0x10,0x11,0x10,0x11,0x10,0x10,0x10,0x10,0x10	;my skinny M
	.byte 0x11,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10
	.byte 0x11,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x11,0x10	;O same as 0
	.byte 0x11,0x10,0x10,0x10,0x11,0x10,0x10,0x00,0x10,0x00
	.byte 0x11,0x10,0x10,0x10,0x10,0x10,0x01,0x00,0x00,0x10
	.byte 0x11,0x10,0x10,0x10,0x11,0x00,0x10,0x10,0x10,0x10
	.byte 0x11,0x10,0x10,0x00,0x11,0x10,0x00,0x10,0x11,0x10	;S same as 5
	.byte 0x11,0x10,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00
	.byte 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x11,0x10
	.byte 0x10,0x10,0x10,0x10,0x10,0x10,0x01,0x00,0x01,0x00 
	.byte 0x10,0x10,0x10,0x10,0x11,0x10,0x11,0x10,0x11,0x10 ;my skinny W	 
	.byte 0x10,0x10,0x10,0x10,0x01,0x00,0x10,0x10,0x10,0x10
	.byte 0x10,0x10,0x10,0x10,0x11,0x10,0x01,0x00,0x01,0x00
	.byte 0x11,0x10,0x00,0x10,0x01,0x00,0x10,0x00,0x11,0x10	;Z
	
badchar:
	.byte 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00	;space
		

mypalette:							;normal palette
	.byte 0x00,0xff,0x07,0x05,0x38,0xc7,0xc0,0x80,0xa4,0xe8,0x14,0x90,0x3f,0x51,0x0a,0x67
	;		k	w	R	 dk.r   G  purp blue dkbl gray skbl brn  slt   yel dkslt dkbrn salmon

blitdata:
	.byte 150,151,152,153,154,155,156,157,158,159
	.byte 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175
	.byte 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
	.byte 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207
	.byte 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223
	.byte 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239
	.byte 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
	.byte 00,01,02,03,04,05,06,07,08,09,10,11,12,13,14,15
	.byte 16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31
	.byte 32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47
	.byte 48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63
	.byte 64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79
	.byte 80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95
	.byte 96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111
	.byte 112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127
	.byte 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143
	.byte 144,145,146,147,148,149
	
BLITM1:	.FCC	'        BLITTER VALIDATION'
        .byte	0
BLITM2:	.FCC	'              DONE        '
        .byte	0
HDRSTR: .FCC	'   WILLYDUMP   '
		.byte	0

;unused space from end of code to FFEF

	.area	_VECTORS				;CPU vectors at FFF0

	.word	#reset,#reset,#reset,#reset,#reset,#reset,#reset,#reset	;point them all to start of code

	.end
