diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-07-01 13:13:49 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-07-01 13:13:49 -0400 |
commit | fce6243b432d1df1b4ab244023be738a54dbe8f3 (patch) | |
tree | c93b0989254b15e86aa0ae07ab255d5bb5fd0afb /engine/pokegear | |
parent | e171c84c2990df2c1a3773885297089869a0fd58 (diff) |
Identify more labels, and use the jumptable macro when possible
Diffstat (limited to 'engine/pokegear')
-rw-r--r-- | engine/pokegear/pokegear.asm | 11 | ||||
-rw-r--r-- | engine/pokegear/radio.asm | 11 |
2 files changed, 2 insertions, 20 deletions
diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index 05700fa2d..4dd5b2660 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -432,16 +432,7 @@ Pokegear_FinishTilemap: ret PokegearJumptable: - 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: ; entries correspond to POKEGEARSTATE_* constants diff --git a/engine/pokegear/radio.asm b/engine/pokegear/radio.asm index d92bc02fa..c5961bea8 100644 --- a/engine/pokegear/radio.asm +++ b/engine/pokegear/radio.asm @@ -16,16 +16,7 @@ PlayRadioShow: ld [wCurRadioLine], a .ok ; Jump to the currently loaded station. The index to which we need to jump is in wCurRadioLine. - ld a, [wCurRadioLine] - ld e, a - ld d, 0 - ld hl, RadioJumptable - add hl, de - add hl, de - ld a, [hli] - ld h, [hl] - ld l, a - jp hl + jumptable RadioJumptable, wCurRadioLine RadioJumptable: ; entries correspond to constants/radio_constants.asm |