Files
pokegold-spaceworld/home/sram.asm
luckytyphlosion e1659ecd41 Introduce linkerscript.
Addresses of sections will now be added to the linkerscript via `org`, and the section name will be the path/to/file. If there is more than one section in the file, then add a @SectionName after the path/to/file to describe the section.
2018-07-03 17:07:05 -04:00

25 lines
368 B
NASM

INCLUDE "constants.asm"
; if DEBUG
SECTION "home/sram.asm", ROM0
; else
; SECTION "SRAM functions", ROM0[$326B]
; endc
OpenSRAM:: ; 32a7
push af
ld a, 1
ld [MBC3LatchClock], a
ld a, SRAM_ENABLE
ld [MBC3SRamEnable], a
pop af
ld [MBC3SRamBank], a
ret
CloseSRAM:: ; 32b7
push af
ld a, SRAM_DISABLE
ld [MBC3LatchClock], a
ld [MBC3SRamEnable], a
pop af
ret