summaryrefslogtreecommitdiff
path: root/mobile
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 /mobile
parente171c84c2990df2c1a3773885297089869a0fd58 (diff)
Identify more labels, and use the jumptable macro when possible
Diffstat (limited to 'mobile')
-rw-r--r--mobile/fixed_words.asm11
-rw-r--r--mobile/mobile_42.asm11
-rw-r--r--mobile/mobile_45_sprite_engine.asm11
-rw-r--r--mobile/mobile_45_stadium.asm22
-rw-r--r--mobile/mobile_5c.asm11
5 files changed, 6 insertions, 60 deletions
diff --git a/mobile/fixed_words.asm b/mobile/fixed_words.asm
index 3b4c0878d..5394b6b4e 100644
--- a/mobile/fixed_words.asm
+++ b/mobile/fixed_words.asm
@@ -2455,16 +2455,7 @@ Function11d035:
AnimateEZChatCursor:
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
- ld a, [hl]
- 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, hl
.Jumptable:
dw .zero
diff --git a/mobile/mobile_42.asm b/mobile/mobile_42.asm
index 3a00dd591..c4a0a450e 100644
--- a/mobile/mobile_42.asm
+++ b/mobile/mobile_42.asm
@@ -351,16 +351,7 @@ MobileTradeAnim_JumptableLoop:
ret
.ExecuteMobileTradeAnimCommand:
- 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 GetMobileTradeAnimByte ; 00
diff --git a/mobile/mobile_45_sprite_engine.asm b/mobile/mobile_45_sprite_engine.asm
index 28b5b611b..54ecede02 100644
--- a/mobile/mobile_45_sprite_engine.asm
+++ b/mobile/mobile_45_sprite_engine.asm
@@ -354,16 +354,7 @@ Function11619d:
ret
Function1161b8:
- ld a, [wc319]
- 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, wc319
.Jumptable:
dw Function1161d5
diff --git a/mobile/mobile_45_stadium.asm b/mobile/mobile_45_stadium.asm
index 860984aea..a2760c10a 100644
--- a/mobile/mobile_45_stadium.asm
+++ b/mobile/mobile_45_stadium.asm
@@ -81,16 +81,7 @@ Function1176ee:
ret
Function117719:
- ld a, [wcd49]
- ld e, a
- ld d, 0
- ld hl, Jumptable_117728
- add hl, de
- add hl, de
- ld a, [hli]
- ld h, [hl]
- ld l, a
- jp hl
+ jumptable Jumptable_117728, wcd49
Jumptable_117728:
dw Function117738
@@ -553,16 +544,7 @@ Function117acd:
ret
Function117ae9:
- 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 Function117b06
diff --git a/mobile/mobile_5c.asm b/mobile/mobile_5c.asm
index ea43accc8..ae2ce1b11 100644
--- a/mobile/mobile_5c.asm
+++ b/mobile/mobile_5c.asm
@@ -346,16 +346,7 @@ Function171a11:
ret
Function171a36:
- ld a, [wcd49]
- ld e, a
- ld d, 0
- ld hl, Jumptable_171a45
- add hl, de
- add hl, de
- ld a, [hli]
- ld h, [hl]
- ld l, a
- jp hl
+ jumptable Jumptable_171a45, wcd49
Jumptable_171a45:
dw Function171a95