summaryrefslogtreecommitdiff
path: root/engine/menus
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2020-07-01 13:13:49 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2020-07-01 13:13:49 -0400
commitfce6243b432d1df1b4ab244023be738a54dbe8f3 (patch)
treec93b0989254b15e86aa0ae07ab255d5bb5fd0afb /engine/menus
parente171c84c2990df2c1a3773885297089869a0fd58 (diff)
Identify more labels, and use the jumptable macro when possible
Diffstat (limited to 'engine/menus')
-rw-r--r--engine/menus/debug.asm11
-rw-r--r--engine/menus/naming_screen.asm22
-rw-r--r--engine/menus/options_menu.asm11
3 files changed, 4 insertions, 40 deletions
diff --git a/engine/menus/debug.asm b/engine/menus/debug.asm
index 24bd75fb8..6062e71aa 100644
--- a/engine/menus/debug.asm
+++ b/engine/menus/debug.asm
@@ -230,16 +230,7 @@ Function81a74:
jr nz, .asm_81aab
.asm_81a8b
- ld a, [wJumptableIndex]
- ld e, a
- ld d, 0
- ld hl, Jumptable_81acf
- add hl, de
- add hl, de
- ld a, [hli]
- ld h, [hl]
- ld l, a
- jp hl
+ jumptable Jumptable_81acf, wJumptableIndex
.asm_81a9a
call Function81eca
diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm
index 791ae5e02..f9413a6ee 100644
--- a/engine/menus/naming_screen.asm
+++ b/engine/menus/naming_screen.asm
@@ -363,16 +363,7 @@ NamingScreenJoypadLoop:
ret
.RunJumptable:
- ld a, [wJumptableIndex]
- ld e, a
- ld d, $0
- ld hl, .Jumptable
- add hl, de
- add hl, de
- ld a, [hli]
- ld h, [hl]
- ld l, a
- jp hl
+ jumptable .Jumptable, wJumptableIndex
.Jumptable:
dw .InitCursor
@@ -1050,16 +1041,7 @@ INCBIN "gfx/icons/mail_big.2bpp"
ret
.DoJumptable:
- ld a, [wJumptableIndex]
- ld e, a
- ld d, 0
- ld hl, .Jumptable
- add hl, de
- add hl, de
- ld a, [hli]
- ld h, [hl]
- ld l, a
- jp hl
+ jumptable .Jumptable, wJumptableIndex
.Jumptable:
dw .init_blinking_cursor
diff --git a/engine/menus/options_menu.asm b/engine/menus/options_menu.asm
index 7ac305bd9..4ceb24a24 100644
--- a/engine/menus/options_menu.asm
+++ b/engine/menus/options_menu.asm
@@ -91,16 +91,7 @@ StringOptions:
db "CANCEL@"
GetOptionPointer:
- ld a, [wJumptableIndex]
- ld e, a
- ld d, 0
- ld hl, .Pointers
- add hl, de
- add hl, de
- ld a, [hli]
- ld h, [hl]
- ld l, a
- jp hl
+ jumptable .Pointers, wJumptableIndex
.Pointers:
; entries correspond to OPT_* constants