gb_test2

changeset 4:216bdbc75cf4

optionally use the generated chessboard instead of the logo to fit in my 2k test ROM
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 10 Jan 2019 06:38:13 +0200
parents d7c6e1165028
children be6f719279b6
files Makefile test.asm
diffstat 2 files changed, 58 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/Makefile	Thu Jan 10 06:05:21 2019 +0200
     1.2 +++ b/Makefile	Thu Jan 10 06:38:13 2019 +0200
     1.3 @@ -28,3 +28,10 @@
     1.4  
     1.5  sin.inc: gensine
     1.6  	./gensine >$@
     1.7 +
     1.8 +test2k.rom: $(img)
     1.9 +	dd if=$< of=$@ bs=1 count=2048
    1.10 +
    1.11 +.PHONY: program
    1.12 +program: test2k.rom
    1.13 +	minipro -p 'AT28C16E @DIP24' -w $<
     2.1 --- a/test.asm	Thu Jan 10 06:05:21 2019 +0200
     2.2 +++ b/test.asm	Thu Jan 10 06:38:13 2019 +0200
     2.3 @@ -1,4 +1,11 @@
     2.4  ; vi:ft=rgbasm:
     2.5 +; -------- build options ----------
     2.6 +BUILD_CHESS equ 1
     2.7 +BUILD_LOGO equ 2
     2.8 +
     2.9 +BUILD = BUILD_LOGO
    2.10 +; ---------------------------------
    2.11 +
    2.12  include "hw.inc"
    2.13  
    2.14  xoffs_center equ 4
    2.15 @@ -177,7 +184,8 @@
    2.16  	or c
    2.17  	jp nz, .copytiles
    2.18  
    2.19 -	; copy tilemap
    2.20 +IF BUILD == BUILD_LOGO
    2.21 +	; copy logo tilemap
    2.22  	ld hl, $9800
    2.23  	ld de, tilemap
    2.24  	ld b, 21
    2.25 @@ -197,6 +205,24 @@
    2.26  
    2.27  	dec b
    2.28  	jr nz, .copymap
    2.29 +ELSE
    2.30 +	; generate chessboard tilemap
    2.31 +	ld hl, $9800
    2.32 +	ld b, 32
    2.33 +.fillscr:
    2.34 +	ld c, 32
    2.35 +.fillrow:
    2.36 +	ld a, b
    2.37 +	add a, c
    2.38 +	and a, 1
    2.39 +
    2.40 +	ld [hl+], a
    2.41 +	dec c
    2.42 +	jr nz, .fillrow
    2.43 +
    2.44 +	dec b
    2.45 +	jr nz, .fillscr
    2.46 +ENDC
    2.47  
    2.48  	; center viewport
    2.49  	ld a, yoffs_center
    2.50 @@ -253,9 +279,33 @@
    2.51  sintab:
    2.52  include "sin.inc"
    2.53  
    2.54 +IF BUILD == BUILD_LOGO
    2.55  tiles:
    2.56  incbin "logo.tiles"
    2.57  tiles_end:
    2.58  tilemap:
    2.59  incbin "logo.tilemap"
    2.60  tilemap_end:
    2.61 +
    2.62 +ELSE
    2.63 +; chessboard tiles
    2.64 +tiles:
    2.65 +	db $55,$00
    2.66 +	db $aa,$00
    2.67 +	db $55,$00
    2.68 +	db $aa,$00
    2.69 +	db $55,$00
    2.70 +	db $aa,$00
    2.71 +	db $55,$00
    2.72 +	db $aa,$00
    2.73 +
    2.74 +	db $ff,$aa
    2.75 +	db $ff,$55
    2.76 +	db $ff,$aa
    2.77 +	db $ff,$55
    2.78 +	db $ff,$aa
    2.79 +	db $ff,$55
    2.80 +	db $ff,$aa
    2.81 +	db $ff,$55
    2.82 +tiles_end:
    2.83 +ENDC