Skip to content
This repository has been archived by the owner on Jun 5, 2022. It is now read-only.

Commit

Permalink
Initial commit, test program
Browse files Browse the repository at this point in the history
  • Loading branch information
InvisibleUp committed Jun 16, 2018
0 parents commit 8c0a4ea
Show file tree
Hide file tree
Showing 12 changed files with 636 additions and 0 deletions.
13 changes: 13 additions & 0 deletions build.bat
@@ -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 added gfx/src/articfox-standing.gal
Binary file not shown.
Binary file added gfx/src/articfox-thinking.gal
Binary file not shown.
Binary file added gfx/src/gecko-standing.gal
Binary file not shown.
Binary file added gfx/src/gecko-thinking.gal
Binary file not shown.
Empty file added src/constants.z80
Empty file.
31 changes: 31 additions & 0 deletions src/display.z80
@@ -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

0 comments on commit 8c0a4ea

Please sign in to comment.