mirror of
https://github.com/thornAvery/jep-hack.git
synced 2026-02-22 15:32:16 +13:00
First Commit
Upload literally everything from the pokecrystal16 expand-move-ID branch
This commit is contained in:
commit
2f8a41f833
4618 changed files with 480386 additions and 0 deletions
30
home/sram.asm
Normal file
30
home/sram.asm
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
OpenSRAM::
|
||||
; if invalid bank, sram is disabled
|
||||
cp NUM_SRAM_BANKS
|
||||
jr nc, CloseSRAM
|
||||
|
||||
; switch to sram bank a
|
||||
push af
|
||||
; latch clock data
|
||||
ld a, 1
|
||||
ld [MBC3LatchClock], a
|
||||
; enable sram/clock write
|
||||
ld a, SRAM_ENABLE
|
||||
ld [MBC3SRamEnable], a
|
||||
; select sram bank
|
||||
pop af
|
||||
ldh [hSRAMBank], a
|
||||
ld [MBC3SRamBank], a
|
||||
ret
|
||||
|
||||
CloseSRAM::
|
||||
push af
|
||||
ld a, -1
|
||||
ldh [hSRAMBank], a
|
||||
ld a, SRAM_DISABLE
|
||||
; reset clock latch for next time
|
||||
ld [MBC3LatchClock], a
|
||||
; disable sram/clock write
|
||||
ld [MBC3SRamEnable], a
|
||||
pop af
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue