-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
138 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
ClearSprites:: | ||
xor a | ||
ld hl, wOAMBuffer | ||
ld b, 40 * 4 | ||
.loop | ||
ld [hli], a | ||
dec b | ||
jr nz, .loop | ||
ret | ||
|
||
HideSprites:: | ||
ld a, 160 | ||
ld hl, wOAMBuffer | ||
ld de, 4 | ||
ld b, 40 | ||
.loop | ||
ld [hl], a | ||
add hl, de | ||
dec b | ||
jr nz, .loop | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
; rst vectors (unused) | ||
|
||
SECTION "rst0", ROM0[$0000] | ||
rst $38 | ||
|
||
SECTION "rst8", ROM0[$0008] | ||
rst $38 | ||
|
||
SECTION "rst10", ROM0[$0010] | ||
rst $38 | ||
|
||
SECTION "rst18", ROM0[$0018] | ||
rst $38 | ||
|
||
SECTION "rst20", ROM0[$0020] | ||
rst $38 | ||
|
||
SECTION "rst28", ROM0[$0028] | ||
rst $38 | ||
|
||
SECTION "rst30", ROM0[$0030] | ||
rst $38 | ||
|
||
SECTION "rst38", ROM0[$0038] | ||
rst $38 | ||
|
||
|
||
; Game Boy hardware interrupts | ||
|
||
SECTION "vblank", ROM0[$0040] | ||
jp VBlank | ||
|
||
SECTION "lcd", ROM0[$0048] | ||
rst $38 | ||
|
||
SECTION "timer", ROM0[$0050] | ||
jp Timer | ||
|
||
SECTION "serial", ROM0[$0058] | ||
jp Serial | ||
|
||
SECTION "joypad", ROM0[$0060] | ||
reti | ||
|
||
|
||
SECTION "Header", ROM0[$0100] | ||
|
||
Start:: | ||
; Nintendo requires all Game Boy ROMs to begin with a nop ($00) and a jp ($C3) | ||
; to the starting address. | ||
nop | ||
jp _Start | ||
|
||
; The Game Boy cartridge header data is patched over by rgbfix. | ||
; This makes sure it doesn't get used for anything else. | ||
|
||
ds $0150 - @, $00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
DisableLCD:: | ||
xor a | ||
ld [rIF], a | ||
ld a, [rIE] | ||
ld b, a | ||
res 0, a | ||
ld [rIE], a | ||
|
||
.wait | ||
ld a, [rLY] | ||
cp LY_VBLANK | ||
jr nz, .wait | ||
|
||
ld a, [rLCDC] | ||
and $ff ^ rLCDC_ENABLE_MASK | ||
ld [rLCDC], a | ||
ld a, b | ||
ld [rIE], a | ||
ret | ||
|
||
EnableLCD:: | ||
ld a, [rLCDC] | ||
set rLCDC_ENABLE, a | ||
ld [rLCDC], a | ||
ret |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
_Start:: | ||
cp GBC | ||
jr z, .gbc | ||
xor a | ||
jr .ok | ||
.gbc | ||
ld a, 0 | ||
.ok | ||
ld [wGBC], a | ||
jp Init |
Oops, something went wrong.