Permalink
Browse files

Initial commit, test program

  • Loading branch information...
InvisibleUp committed Jun 16, 2018
0 parents commit 8c0a4ea36fc481656a9d64d7d4c7b3f02243b96f
@@ -0,0 +1,13 @@
@echo off
for %%f in (gfx/*.png) do rgbds\rgbgfx -o gfx/bin/%%f.bin gfx/%%f
if %errorlevel% neq 0 call :exit 1
rgbds\rgbasm -ogame.obj .\src\main.z80
if %errorlevel% neq 0 call :exit 1
rgbds\rgblink -mgame.map -ngame.sym -ogame.gb game.obj
if %errorlevel% neq 0 call :exit 1
rgbds\rgbfix -p0 -v game.gb
if %errorlevel% neq 0 call :exit 1
call :exit 0

:exit
exit
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
No changes.
@@ -0,0 +1,31 @@
;; Macros
WaitForVBlank: MACRO
ld hl,GB_INTERRUPT_FLAG ; Load interrupt flag byte into HL
.wait halt ; suspend CPU - wait for ANY interrupt
bit GB_INTERRUPT_VBLANK_BIT, [hl] ; VBlank interrupt flag on?
jr z, .wait ; wait more if zero
res GB_INTERRUPT_VBLANK_BIT, [hl] ; set vblank_flag back to zero
ENDM

;; Functions

; Uses a, b
DisableLCD: ; $0061
WaitForVBlank
ld a,[GB_LCD_CTRL]
res GB_LCD_CTRL_BIT_ENABLE,a
ld [GB_LCD_CTRL],a
ret

; Uses a
EnableLCD:
ld a,[GB_LCD_CTRL]
set GB_LCD_CTRL_BIT_ENABLE,a
ld [GB_LCD_CTRL],a
ret

InitDisplay:
ld a, GB_LCD_CTRL_ON | GB_LCD_CTRL_BG_ON | GB_LCD_CTRL_OBJ_ON | \
GB_LCD_CTRL_OBJ_8x8 | GB_LCD_CTRL_BG_MAP1 | GB_LCD_CTRL_TILESET1
ld [GB_LCD_CTRL],a
ret
Oops, something went wrong.

0 comments on commit 8c0a4ea

Please sign in to comment.