# HG changeset patch # User John Tsiombikas # Date 1547095093 -7200 # Node ID 216bdbc75cf489560706ee34c34fd610e510f39e # Parent d7c6e1165028bf64afb2a0e4c3e4aeca99194496 optionally use the generated chessboard instead of the logo to fit in my 2k test ROM diff -r d7c6e1165028 -r 216bdbc75cf4 Makefile --- a/Makefile Thu Jan 10 06:05:21 2019 +0200 +++ b/Makefile Thu Jan 10 06:38:13 2019 +0200 @@ -28,3 +28,10 @@ sin.inc: gensine ./gensine >$@ + +test2k.rom: $(img) + dd if=$< of=$@ bs=1 count=2048 + +.PHONY: program +program: test2k.rom + minipro -p 'AT28C16E @DIP24' -w $< diff -r d7c6e1165028 -r 216bdbc75cf4 test.asm --- a/test.asm Thu Jan 10 06:05:21 2019 +0200 +++ b/test.asm Thu Jan 10 06:38:13 2019 +0200 @@ -1,4 +1,11 @@ ; vi:ft=rgbasm: +; -------- build options ---------- +BUILD_CHESS equ 1 +BUILD_LOGO equ 2 + +BUILD = BUILD_LOGO +; --------------------------------- + include "hw.inc" xoffs_center equ 4 @@ -177,7 +184,8 @@ or c jp nz, .copytiles - ; copy tilemap +IF BUILD == BUILD_LOGO + ; copy logo tilemap ld hl, $9800 ld de, tilemap ld b, 21 @@ -197,6 +205,24 @@ dec b jr nz, .copymap +ELSE + ; generate chessboard tilemap + ld hl, $9800 + ld b, 32 +.fillscr: + ld c, 32 +.fillrow: + ld a, b + add a, c + and a, 1 + + ld [hl+], a + dec c + jr nz, .fillrow + + dec b + jr nz, .fillscr +ENDC ; center viewport ld a, yoffs_center @@ -253,9 +279,33 @@ sintab: include "sin.inc" +IF BUILD == BUILD_LOGO tiles: incbin "logo.tiles" tiles_end: tilemap: incbin "logo.tilemap" tilemap_end: + +ELSE +; chessboard tiles +tiles: + db $55,$00 + db $aa,$00 + db $55,$00 + db $aa,$00 + db $55,$00 + db $aa,$00 + db $55,$00 + db $aa,$00 + + db $ff,$aa + db $ff,$55 + db $ff,$aa + db $ff,$55 + db $ff,$aa + db $ff,$55 + db $ff,$aa + db $ff,$55 +tiles_end: +ENDC