From f030315b1fd797aa6765ac8cd8c35c0cd9b600a0 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 26 Dec 2015 21:59:03 -0500 Subject: jumptable macro repurposed --- predef/cgb.asm | 19 +++++++------------ predef/crystal.asm | 12 ++++++------ 2 files changed, 13 insertions(+), 18 deletions(-) (limited to 'predef') diff --git a/predef/cgb.asm b/predef/cgb.asm index c929c975c..61be93ad4 100644 --- a/predef/cgb.asm +++ b/predef/cgb.asm @@ -18,7 +18,7 @@ Predef_LoadSGBLayoutCGB: ; 8d59 ld l, a ld h, 0 add hl, hl - ld de, .jumptable + ld de, .dw add hl, de ld a, [hli] ld h, [hl] @@ -32,7 +32,7 @@ Predef_LoadSGBLayoutCGB: ; 8d59 ret ; 8d7a -.jumptable: ; 8d7a +.dw: ; 8d7a dw _CGB00 dw _CGB01 dw _CGB02 @@ -92,18 +92,16 @@ _CGB01: ; 8ddb ld a, [EnemyHPPal] ld l, a ld h, $0 -rept 2 add hl, hl -endr + add hl, hl ld bc, Palettes_a8be add hl, bc call LoadPalette_White_Col1_Col2_Black ld a, [PlayerHPPal] ld l, a ld h, $0 -rept 2 add hl, hl -endr + add hl, hl ld bc, Palettes_a8be add hl, bc call LoadPalette_White_Col1_Col2_Black @@ -209,9 +207,8 @@ _CGB03: ; 8edb ld a, [wcda1] ld l, a ld h, $0 -rept 2 add hl, hl -endr + add hl, hl ld bc, Palettes_a8be add hl, bc call LoadPalette_White_Col1_Col2_Black @@ -489,9 +486,8 @@ _CGB06: ; 90f8 _CGB07: ; 9122 ld b, 0 ld hl, Jumptable_912d -rept 2 add hl, bc -endr + add hl, bc ld a, [hli] ld h, [hl] ld l, a @@ -797,9 +793,8 @@ _CGB0e: ; 9373 ld a, [PlayerHPPal] ld l, a ld h, 0 -rept 2 add hl, hl -endr + add hl, hl ld bc, Palettes_a8be add hl, bc call LoadPalette_White_Col1_Col2_Black diff --git a/predef/crystal.asm b/predef/crystal.asm index eea3c3cec..083a5a522 100755 --- a/predef/crystal.asm +++ b/predef/crystal.asm @@ -10,7 +10,7 @@ GetMysteryGift_MobileAdapterLayout: ; 4930f (mobile) ld l, a ld h, 0 add hl, hl - ld de, .jumptable + ld de, .dw add hl, de ld a, [hli] ld h, [hl] @@ -22,11 +22,11 @@ GetMysteryGift_MobileAdapterLayout: ; 4930f (mobile) ret ; 49330 (12:5330) -.jumptable: ; 49330 - jumptable_start - jumptable MG_Mobile_Layout00 - jumptable MG_Mobile_Layout01 - jumptable MG_Mobile_Layout02 +.dw: ; 49330 + + dw MG_Mobile_Layout00 + dw MG_Mobile_Layout01 + dw MG_Mobile_Layout02 ; 49336 MG_Mobile_Layout_FillBox: ; 49336 -- cgit v1.2.3