diff options
author | Remy Oukaour <remy.oukaour@gmail.com> | 2017-12-28 21:22:35 -0500 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2017-12-28 22:13:39 -0500 |
commit | b9a68fec2589eb6969be63e6ed1eb3fca312c307 (patch) | |
tree | 59b5db70690a9f9041e4964adae1722b4d178a1b | |
parent | 4c35f3ac8506e5f326658bbab91c257584f7b716 (diff) |
Consistent if/else/endc (matches rept/endr) and DEF (matches BANK/HIGH/LOW)
-rwxr-xr-x | engine/billspc.asm | 4 | ||||
-rw-r--r-- | engine/events/battle_tower.asm | 6 | ||||
-rwxr-xr-x | engine/intro_menu.asm | 10 | ||||
-rw-r--r-- | engine/pic_animation.asm | 2 | ||||
-rw-r--r-- | engine/scripting.asm | 8 | ||||
-rw-r--r-- | macros/base_stats.asm | 8 | ||||
-rw-r--r-- | macros/coords.asm | 6 | ||||
-rw-r--r-- | macros/scripts/events.asm | 4 | ||||
-rw-r--r-- | main.asm | 6 | ||||
-rwxr-xr-x | mobile/battle_tower_47.asm | 10 | ||||
-rwxr-xr-x | mobile/mobile_5c.asm | 6 | ||||
-rw-r--r-- | wram.asm | 10 |
12 files changed, 40 insertions, 40 deletions
diff --git a/engine/billspc.asm b/engine/billspc.asm index 554fb6bf1..8fe578a07 100755 --- a/engine/billspc.asm +++ b/engine/billspc.asm @@ -1442,9 +1442,9 @@ copy_box_data: MACRO jr .loop\@ .done\@ -IF \1 +if \1 call CloseSRAM -ENDC +endc ld a, -1 ld [de], a ld a, [wd004] diff --git a/engine/events/battle_tower.asm b/engine/events/battle_tower.asm index b880a099b..a0de6ee84 100644 --- a/engine/events/battle_tower.asm +++ b/engine/events/battle_tower.asm @@ -26,13 +26,13 @@ Function_LoadOpponentTrainerAndPokemons: ; 1f8000 ld a, [hRandomAdd] add b ld b, a ; b contains the nr of the trainer -IF DEF(CRYSTAL11) +if DEF(CRYSTAL11) and (1 << 7) - 1 cp 70 -ELSE +else and (1 << 5) - 1 cp 21 -ENDC +endc jr nc, .resample ld b, a diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm index 5e38589aa..faa5748dd 100755 --- a/engine/intro_menu.asm +++ b/engine/intro_menu.asm @@ -199,9 +199,9 @@ _ResetWRAM: ; 5bae ld [Coins], a ld [Coins + 1], a -IF START_MONEY >= $10000 +if START_MONEY >= $10000 ld a, HIGH(START_MONEY >> 8) -ENDC +endc ld [Money], a ld a, HIGH(START_MONEY) ; mid ld [Money + 1], a @@ -646,11 +646,11 @@ Continue_DisplayPokedexNumCaught: ; 5f6b ret z push hl ld hl, PokedexCaught -IF NUM_POKEMON % 8 +if NUM_POKEMON % 8 ld b, NUM_POKEMON / 8 + 1 -ELSE +else ld b, NUM_POKEMON / 8 -ENDC +endc call CountSetBits pop hl ld de, wd265 diff --git a/engine/pic_animation.asm b/engine/pic_animation.asm index 3c826b8b7..33b770b14 100644 --- a/engine/pic_animation.asm +++ b/engine/pic_animation.asm @@ -55,7 +55,7 @@ AnimateMon_Unused: ; d003a pokeanim: MACRO rept _NARG ; Workaround for a bug where macro args can't come after the start of a symbol -if !def(\1_POKEANIM) +if !DEF(\1_POKEANIM) \1_POKEANIM EQUS "PokeAnim_\1_" endc db (\1_POKEANIM - PokeAnim_SetupCommands) / 2 diff --git a/engine/scripting.asm b/engine/scripting.asm index 7512bdc06..9a89c375a 100644 --- a/engine/scripting.asm +++ b/engine/scripting.asm @@ -147,9 +147,9 @@ ScriptCommandTable: dw Script_loadmenudata ; 4f dw Script_closewindow ; 50 dw Script_jumptextfaceplayer ; 51 -IF _CRYSTAL +if _CRYSTAL dw Script_farjumptext ; 52 -ENDC +endc dw Script_jumptext ; 53 dw Script_waitbutton ; 54 dw Script_buttonsound ; 55 @@ -338,7 +338,7 @@ JumpTextScript: end -IF _CRYSTAL +if _CRYSTAL Script_farjumptext: ; script command 0x52 @@ -355,7 +355,7 @@ Script_farjumptext: ld hl, JumpTextScript jp ScriptJump -ENDC +endc Script_writetext: diff --git a/macros/base_stats.asm b/macros/base_stats.asm index f260e35d9..1a2ce8529 100644 --- a/macros/base_stats.asm +++ b/macros/base_stats.asm @@ -1,7 +1,7 @@ ; Used in data/pokemon/base_stats/*.asm define: MACRO -if !def(\1) +if !DEF(\1) \1 EQUS \2 endc ENDM @@ -9,7 +9,7 @@ ENDM const_value = 0 add_tm: MACRO -if !def(TM01) +if !DEF(TM01) TM01 = const_value enum_start 1 endc @@ -19,7 +19,7 @@ endc ENDM add_hm: MACRO -if !def(HM01) +if !DEF(HM01) HM01 = const_value endc define _\@_1, "HM_\1" @@ -38,7 +38,7 @@ tms1 = 0 tms2 = 0 tms3 = 0 rept _NARG - if def(\1_TMNUM) + if DEF(\1_TMNUM) if \1_TMNUM < 24 + 1 tms1 = tms1 | (1 << ((\1_TMNUM) - 1)) elif \1_TMNUM < 48 + 1 diff --git a/macros/coords.asm b/macros/coords.asm index a8e64c0c9..b889be765 100644 --- a/macros/coords.asm +++ b/macros/coords.asm @@ -43,9 +43,9 @@ debgcoord EQUS "bgcoord de," bcbgcoord EQUS "bgcoord bc," bgcoord: MACRO -IF _NARG >= 4 + if _NARG >= 4 ld \1, \3 bgrows + \2 + \4 -ELSE + else ld \1, \3 bgrows + \2 + vBGMap0 -ENDC + endc ENDM diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm index a494a33af..694a7cd12 100644 --- a/macros/scripts/events.asm +++ b/macros/scripts/events.asm @@ -538,13 +538,13 @@ jumptextfaceplayer: MACRO dw \1 ; text_pointer ENDM -; IF _CRYSTAL +; if _CRYSTAL enum farjumptext_command ; $52 farjumptext: MACRO db farjumptext_command dba \1 ENDM -; ENDC +; endc enum jumptext_command ; $53 jumptext: MACRO @@ -645,8 +645,8 @@ INCLUDE "engine/events/odd_egg.asm" SECTION "Mobile Stadium 2", ROMX -IF DEF(CRYSTAL11) +if DEF(CRYSTAL11) INCBIN "mobile/stadium/stadium2_2.bin" -ELSE +else INCBIN "mobile/stadium/stadium2_1.bin" -ENDC +endc diff --git a/mobile/battle_tower_47.asm b/mobile/battle_tower_47.asm index d0ca6edd8..14f69d654 100755 --- a/mobile/battle_tower_47.asm +++ b/mobile/battle_tower_47.asm @@ -5,19 +5,19 @@ BattleTowerText:: ; 11c000 ; 3: Player won ld a, [rSVBK] push af - ld a, 3 ; BANK(BT_OTTrainerClass) + ld a, BANK(BT_OTTrainerClass) ld [rSVBK], a -IF DEF(CRYSTAL11) +if DEF(CRYSTAL11) ld hl, BT_OTTrainerClass -ELSE - ld hl, BT_OTName + 5 +else ; BUG ALERT ; Instead of loading the Trainer Class, this routine ; loads the 6th character in the Trainer's name, then ; uses it to get the gender of the trainer. ; As a consequence, the enemy trainer's dialog will ; always be sampled from the female array. -ENDC + ld hl, BT_OTName + 5 +endc ld a, [hl] dec a ld e, a diff --git a/mobile/mobile_5c.asm b/mobile/mobile_5c.asm index f6d6cdf3f..18ae114cc 100755 --- a/mobile/mobile_5c.asm +++ b/mobile/mobile_5c.asm @@ -936,11 +936,11 @@ GameBoyN64GFX: INCBIN "gfx/trade/game_boy_n64.2bpp" Tilemap_1733af: -IF DEF(CRYSTAL11) +if DEF(CRYSTAL11) INCBIN "gfx/unknown/1733af_corrupt.tilemap" -ELSE +else INCBIN "gfx/unknown/1733af.tilemap" -ENDC +endc Attrmap_173517: INCBIN "gfx/unknown/173517.attrmap" @@ -827,12 +827,12 @@ wDexListingCursorBackup:: db wBackupDexListingCursor:: db wBackupDexListingPage:: db wDexCurrentLocation:: db -IF DEF(CRYSTAL11) +if DEF(CRYSTAL11) wPokedexStatus:: db wPokedexDataEnd:: -ELSE +else wPokedexDataEnd:: ds 1 -ENDC +endc ds 2 NEXTU ; c6d0 @@ -1312,9 +1312,9 @@ wCardFlipWhichCard:: db NEXTU ; cf64 ; pokedex wDexEntryPrevJumptableIndex:: db -IF !DEF(CRYSTAL11) +if !DEF(CRYSTAL11) wPokedexStatus:: db -ENDC +endc NEXTU ; cf64 ; miscellaneous |