gb_test2

diff test.asm @ 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
line diff
     1.1 --- a/test.asm	Thu Jan 10 06:05:21 2019 +0200
     1.2 +++ b/test.asm	Thu Jan 10 06:38:13 2019 +0200
     1.3 @@ -1,4 +1,11 @@
     1.4  ; vi:ft=rgbasm:
     1.5 +; -------- build options ----------
     1.6 +BUILD_CHESS equ 1
     1.7 +BUILD_LOGO equ 2
     1.8 +
     1.9 +BUILD = BUILD_LOGO
    1.10 +; ---------------------------------
    1.11 +
    1.12  include "hw.inc"
    1.13  
    1.14  xoffs_center equ 4
    1.15 @@ -177,7 +184,8 @@
    1.16  	or c
    1.17  	jp nz, .copytiles
    1.18  
    1.19 -	; copy tilemap
    1.20 +IF BUILD == BUILD_LOGO
    1.21 +	; copy logo tilemap
    1.22  	ld hl, $9800
    1.23  	ld de, tilemap
    1.24  	ld b, 21
    1.25 @@ -197,6 +205,24 @@
    1.26  
    1.27  	dec b
    1.28  	jr nz, .copymap
    1.29 +ELSE
    1.30 +	; generate chessboard tilemap
    1.31 +	ld hl, $9800
    1.32 +	ld b, 32
    1.33 +.fillscr:
    1.34 +	ld c, 32
    1.35 +.fillrow:
    1.36 +	ld a, b
    1.37 +	add a, c
    1.38 +	and a, 1
    1.39 +
    1.40 +	ld [hl+], a
    1.41 +	dec c
    1.42 +	jr nz, .fillrow
    1.43 +
    1.44 +	dec b
    1.45 +	jr nz, .fillscr
    1.46 +ENDC
    1.47  
    1.48  	; center viewport
    1.49  	ld a, yoffs_center
    1.50 @@ -253,9 +279,33 @@
    1.51  sintab:
    1.52  include "sin.inc"
    1.53  
    1.54 +IF BUILD == BUILD_LOGO
    1.55  tiles:
    1.56  incbin "logo.tiles"
    1.57  tiles_end:
    1.58  tilemap:
    1.59  incbin "logo.tilemap"
    1.60  tilemap_end:
    1.61 +
    1.62 +ELSE
    1.63 +; chessboard tiles
    1.64 +tiles:
    1.65 +	db $55,$00
    1.66 +	db $aa,$00
    1.67 +	db $55,$00
    1.68 +	db $aa,$00
    1.69 +	db $55,$00
    1.70 +	db $aa,$00
    1.71 +	db $55,$00
    1.72 +	db $aa,$00
    1.73 +
    1.74 +	db $ff,$aa
    1.75 +	db $ff,$55
    1.76 +	db $ff,$aa
    1.77 +	db $ff,$55
    1.78 +	db $ff,$aa
    1.79 +	db $ff,$55
    1.80 +	db $ff,$aa
    1.81 +	db $ff,$55
    1.82 +tiles_end:
    1.83 +ENDC