summaryrefslogtreecommitdiff
path: root/main.asm
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2013-09-08 02:50:06 -0400
committeryenatch <yenatch@gmail.com>2013-09-08 02:50:06 -0400
commit844546f8495030b66e79aa30d96405065e2019dd (patch)
treea9dd1069a9415cb7ce561e373cc515b177a70ed6 /main.asm
parentedf939a07be9e0553a3ef91dd66291806dd3ad50 (diff)
split sram access asm into common/sram.asm
Diffstat (limited to 'main.asm')
-rw-r--r--main.asm36
1 files changed, 1 insertions, 35 deletions
diff --git a/main.asm b/main.asm
index 1d57996ea..a8660f1a6 100644
--- a/main.asm
+++ b/main.asm
@@ -812,41 +812,7 @@ INCLUDE "common/item.asm"
INCLUDE "common/random.asm"
-
-GetSRAMBank: ; 2fcb
-; load sram bank a
-; if invalid bank, sram is disabled
- cp NUM_SRAM_BANKS
- jr c, OpenSRAM
- jr CloseSRAM
-; 2fd1
-
-OpenSRAM: ; 2fd1
-; 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
- ld [MBC3SRamBank], a
- ret
-; 2fe1
-
-CloseSRAM: ; 2fe1
-; preserve a
- push af
- ld a, SRAM_DISABLE
-; reset clock latch for next time
- ld [MBC3LatchClock], a
-; disable sram/clock write
- ld [MBC3SRamEnable], a
- pop af
- ret
-; 2fec
+INCLUDE "common/sram.asm"
; Register aliases