Add files
This commit is contained in:
85
src/memory/hram.asm
Normal file
85
src/memory/hram.asm
Normal file
@@ -0,0 +1,85 @@
|
||||
|
||||
SECTION "HRAM", HRAM
|
||||
|
||||
; The OAM DMA routine
|
||||
hOAMDMA::
|
||||
ds 8 ; OAMDMAEnd - OAMDMA
|
||||
|
||||
|
||||
; Currently-loaded ROM bank, useful to save back (eg. during ints)
|
||||
hCurROMBank::
|
||||
db
|
||||
|
||||
|
||||
; Used by the PB16 decompressor
|
||||
pb16_byte0::
|
||||
db
|
||||
|
||||
|
||||
; Place variables that need to be zero-cleared on init (and soft-reset) below
|
||||
hClearStart::
|
||||
|
||||
|
||||
; Used to let VBlank know it need to ACK
|
||||
; NOTE: VBlank doesn't preserve AF **on purpose** when this is set
|
||||
; Thus, make sure to wait for Z set before continuing
|
||||
hVBlankFlag::
|
||||
db
|
||||
|
||||
; Values transferred to hw regs on VBlank
|
||||
hLCDC::
|
||||
db
|
||||
hSCY::
|
||||
db
|
||||
hSCX::
|
||||
db
|
||||
hWY::
|
||||
db
|
||||
hWX::
|
||||
db
|
||||
hBGP::
|
||||
db
|
||||
hOBP0::
|
||||
db
|
||||
hOBP1::
|
||||
db
|
||||
|
||||
|
||||
; Low byte of the current scanline buffer
|
||||
; Permits double-buffering
|
||||
hWhichScanlineBuffer::
|
||||
db
|
||||
; Low byte of byte read by STAT handler
|
||||
; NO TOUCHY
|
||||
hScanlineFXIndex::
|
||||
db
|
||||
|
||||
; Scanline FX buffers (scanline, addr, value)
|
||||
; Double-buffering used to prevent ract conditions
|
||||
hScanlineFXBuffer1::
|
||||
ds 3 * 5 + 1
|
||||
hScanlineFXBuffer2::
|
||||
ds 3 * 5 + 1
|
||||
|
||||
; Addr/value pair to allow writing to 2 regs in the same scanline
|
||||
hSecondFXAddr::
|
||||
db
|
||||
hSecondFXValue::
|
||||
db
|
||||
|
||||
hIsTextboxActive::
|
||||
db
|
||||
hBackupScanlineFXBuffer::
|
||||
ds 3 * 5 + 1
|
||||
|
||||
|
||||
; Joypad regs
|
||||
hHeldButtons::
|
||||
db
|
||||
hPressedButtons::
|
||||
db
|
||||
|
||||
; High byte of the shadow OAM buffer to be transferred
|
||||
; Reset by the VBlank handler to signal transfer completion
|
||||
hOAMBufferHigh::
|
||||
db
|
||||
0
src/memory/sram.asm
Normal file
0
src/memory/sram.asm
Normal file
20
src/memory/vram.asm
Normal file
20
src/memory/vram.asm
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
SECTION "VRAM", VRAM[$8000]
|
||||
|
||||
|
||||
ds $1000
|
||||
|
||||
; $9000
|
||||
|
||||
vBlankTile::
|
||||
ds $10
|
||||
|
||||
ds $7F0
|
||||
|
||||
; $9800
|
||||
|
||||
ds SCRN_VX_B * SCRN_VY_B ; $400
|
||||
|
||||
; $9C00
|
||||
|
||||
ds SCRN_VX_B * SCRN_VY_B ; $400
|
||||
40
src/memory/wram.asm
Normal file
40
src/memory/wram.asm
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
SECTION "Error handler memory", WRAM0
|
||||
|
||||
; ID of the error that occurred
|
||||
wErrorType::
|
||||
; Once the ID has been used, this is re-used as a status, to route calls because stack space is available
|
||||
wErrorDrawStatus::
|
||||
; The status is also used to determine which dump to print
|
||||
wErrorWhichDump::
|
||||
db
|
||||
|
||||
wErrorRegs::
|
||||
; Value of A when the handler is called
|
||||
; Re-used as part of the reg dump
|
||||
wErrorA::
|
||||
; Re-used to hold last frame's keys
|
||||
wErrorHeldButtons::
|
||||
db ; a
|
||||
; Re-used to hold the number of frames till the debugger is unlocked
|
||||
wErrorFramesTillUnlock::
|
||||
db ; f
|
||||
dw ; bc
|
||||
dw ; de
|
||||
wErrorHL::
|
||||
dw
|
||||
wErrorSP::
|
||||
dw
|
||||
|
||||
|
||||
SECTION "Shadow OAM", WRAM0,ALIGN[8]
|
||||
|
||||
wShadowOAM::
|
||||
ds $A0
|
||||
|
||||
|
||||
SECTION "Stack", WRAM0[$E000 - STACK_SIZE]
|
||||
|
||||
wStackTop::
|
||||
ds STACK_SIZE
|
||||
wStackBottom::
|
||||
Reference in New Issue
Block a user