diff options
author | Eldred Habert <eldredhabert0@gmail.com> | 2018-06-03 20:32:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-03 20:32:40 +0200 |
commit | 63ee9c801200b64108dbfcfbc31fe2f5eda975c9 (patch) | |
tree | c9b94852c7bb0d7e107b6b84c3c7103e08e5efb0 /home/util.asm | |
parent | 3a7ac51071ad9f3ae277046c29d7482b56754d1d (diff) | |
parent | 02051b9e0e213fb7d2e349e3cce220bb7a983472 (diff) |
Merge pull request #2 from PikalaxALT/build_more_roms
Build all four ROMs in the dump
Diffstat (limited to 'home/util.asm')
-rw-r--r-- | home/util.asm | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/home/util.asm b/home/util.asm index bfc4ce4..6591da2 100644 --- a/home/util.asm +++ b/home/util.asm @@ -1,6 +1,21 @@ INCLUDE "constants.asm" -SECTION "Misc Utility Functions", ROM0[$3429] +if DEBUG +SECTION "Misc Utility Functions", ROM0[$341F] +else +SECTION "Misc Utility Functions", ROM0[$33E3] +endc + +_341F:: ; 341f +; Returns hl + a * 6 + and a + ret z + ld bc, 6 +.loop: + add hl, bc + dec a + jr nz, .loop + ret AddNTimes:: ; 3429 (0:3429) and a @@ -10,4 +25,17 @@ AddNTimes:: ; 3429 (0:3429) dec a jr nz, .asm_342b ret -; 0x3430
\ No newline at end of file +; 0x3430 + +memcmp:: ; 3430 +; Compare c bytes at hl and de +; Returns z if all equal, nz otherwise. +.loop: + ld a, [de] + cp [hl] + ret nz + inc de + inc hl + dec c + jr nz, .loop + ret |