mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-01-23 09:16:20 -08:00
Consistent if/else/endc (matches rept/endr) and DEF (matches BANK/HIGH/LOW)
This commit is contained in:
parent
4c35f3ac85
commit
b9a68fec25
@ -1442,9 +1442,9 @@ copy_box_data: MACRO
|
|||||||
jr .loop\@
|
jr .loop\@
|
||||||
|
|
||||||
.done\@
|
.done\@
|
||||||
IF \1
|
if \1
|
||||||
call CloseSRAM
|
call CloseSRAM
|
||||||
ENDC
|
endc
|
||||||
ld a, -1
|
ld a, -1
|
||||||
ld [de], a
|
ld [de], a
|
||||||
ld a, [wd004]
|
ld a, [wd004]
|
||||||
|
@ -26,13 +26,13 @@ Function_LoadOpponentTrainerAndPokemons: ; 1f8000
|
|||||||
ld a, [hRandomAdd]
|
ld a, [hRandomAdd]
|
||||||
add b
|
add b
|
||||||
ld b, a ; b contains the nr of the trainer
|
ld b, a ; b contains the nr of the trainer
|
||||||
IF DEF(CRYSTAL11)
|
if DEF(CRYSTAL11)
|
||||||
and (1 << 7) - 1
|
and (1 << 7) - 1
|
||||||
cp 70
|
cp 70
|
||||||
ELSE
|
else
|
||||||
and (1 << 5) - 1
|
and (1 << 5) - 1
|
||||||
cp 21
|
cp 21
|
||||||
ENDC
|
endc
|
||||||
jr nc, .resample
|
jr nc, .resample
|
||||||
ld b, a
|
ld b, a
|
||||||
|
|
||||||
|
@ -199,9 +199,9 @@ _ResetWRAM: ; 5bae
|
|||||||
ld [Coins], a
|
ld [Coins], a
|
||||||
ld [Coins + 1], a
|
ld [Coins + 1], a
|
||||||
|
|
||||||
IF START_MONEY >= $10000
|
if START_MONEY >= $10000
|
||||||
ld a, HIGH(START_MONEY >> 8)
|
ld a, HIGH(START_MONEY >> 8)
|
||||||
ENDC
|
endc
|
||||||
ld [Money], a
|
ld [Money], a
|
||||||
ld a, HIGH(START_MONEY) ; mid
|
ld a, HIGH(START_MONEY) ; mid
|
||||||
ld [Money + 1], a
|
ld [Money + 1], a
|
||||||
@ -646,11 +646,11 @@ Continue_DisplayPokedexNumCaught: ; 5f6b
|
|||||||
ret z
|
ret z
|
||||||
push hl
|
push hl
|
||||||
ld hl, PokedexCaught
|
ld hl, PokedexCaught
|
||||||
IF NUM_POKEMON % 8
|
if NUM_POKEMON % 8
|
||||||
ld b, NUM_POKEMON / 8 + 1
|
ld b, NUM_POKEMON / 8 + 1
|
||||||
ELSE
|
else
|
||||||
ld b, NUM_POKEMON / 8
|
ld b, NUM_POKEMON / 8
|
||||||
ENDC
|
endc
|
||||||
call CountSetBits
|
call CountSetBits
|
||||||
pop hl
|
pop hl
|
||||||
ld de, wd265
|
ld de, wd265
|
||||||
|
@ -55,7 +55,7 @@ AnimateMon_Unused: ; d003a
|
|||||||
pokeanim: MACRO
|
pokeanim: MACRO
|
||||||
rept _NARG
|
rept _NARG
|
||||||
; Workaround for a bug where macro args can't come after the start of a symbol
|
; 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_"
|
\1_POKEANIM EQUS "PokeAnim_\1_"
|
||||||
endc
|
endc
|
||||||
db (\1_POKEANIM - PokeAnim_SetupCommands) / 2
|
db (\1_POKEANIM - PokeAnim_SetupCommands) / 2
|
||||||
|
@ -147,9 +147,9 @@ ScriptCommandTable:
|
|||||||
dw Script_loadmenudata ; 4f
|
dw Script_loadmenudata ; 4f
|
||||||
dw Script_closewindow ; 50
|
dw Script_closewindow ; 50
|
||||||
dw Script_jumptextfaceplayer ; 51
|
dw Script_jumptextfaceplayer ; 51
|
||||||
IF _CRYSTAL
|
if _CRYSTAL
|
||||||
dw Script_farjumptext ; 52
|
dw Script_farjumptext ; 52
|
||||||
ENDC
|
endc
|
||||||
dw Script_jumptext ; 53
|
dw Script_jumptext ; 53
|
||||||
dw Script_waitbutton ; 54
|
dw Script_waitbutton ; 54
|
||||||
dw Script_buttonsound ; 55
|
dw Script_buttonsound ; 55
|
||||||
@ -338,7 +338,7 @@ JumpTextScript:
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
IF _CRYSTAL
|
if _CRYSTAL
|
||||||
|
|
||||||
Script_farjumptext:
|
Script_farjumptext:
|
||||||
; script command 0x52
|
; script command 0x52
|
||||||
@ -355,7 +355,7 @@ Script_farjumptext:
|
|||||||
ld hl, JumpTextScript
|
ld hl, JumpTextScript
|
||||||
jp ScriptJump
|
jp ScriptJump
|
||||||
|
|
||||||
ENDC
|
endc
|
||||||
|
|
||||||
|
|
||||||
Script_writetext:
|
Script_writetext:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
; Used in data/pokemon/base_stats/*.asm
|
; Used in data/pokemon/base_stats/*.asm
|
||||||
|
|
||||||
define: MACRO
|
define: MACRO
|
||||||
if !def(\1)
|
if !DEF(\1)
|
||||||
\1 EQUS \2
|
\1 EQUS \2
|
||||||
endc
|
endc
|
||||||
ENDM
|
ENDM
|
||||||
@ -9,7 +9,7 @@ ENDM
|
|||||||
const_value = 0
|
const_value = 0
|
||||||
|
|
||||||
add_tm: MACRO
|
add_tm: MACRO
|
||||||
if !def(TM01)
|
if !DEF(TM01)
|
||||||
TM01 = const_value
|
TM01 = const_value
|
||||||
enum_start 1
|
enum_start 1
|
||||||
endc
|
endc
|
||||||
@ -19,7 +19,7 @@ endc
|
|||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
add_hm: MACRO
|
add_hm: MACRO
|
||||||
if !def(HM01)
|
if !DEF(HM01)
|
||||||
HM01 = const_value
|
HM01 = const_value
|
||||||
endc
|
endc
|
||||||
define _\@_1, "HM_\1"
|
define _\@_1, "HM_\1"
|
||||||
@ -38,7 +38,7 @@ tms1 = 0
|
|||||||
tms2 = 0
|
tms2 = 0
|
||||||
tms3 = 0
|
tms3 = 0
|
||||||
rept _NARG
|
rept _NARG
|
||||||
if def(\1_TMNUM)
|
if DEF(\1_TMNUM)
|
||||||
if \1_TMNUM < 24 + 1
|
if \1_TMNUM < 24 + 1
|
||||||
tms1 = tms1 | (1 << ((\1_TMNUM) - 1))
|
tms1 = tms1 | (1 << ((\1_TMNUM) - 1))
|
||||||
elif \1_TMNUM < 48 + 1
|
elif \1_TMNUM < 48 + 1
|
||||||
|
@ -43,9 +43,9 @@ debgcoord EQUS "bgcoord de,"
|
|||||||
bcbgcoord EQUS "bgcoord bc,"
|
bcbgcoord EQUS "bgcoord bc,"
|
||||||
|
|
||||||
bgcoord: MACRO
|
bgcoord: MACRO
|
||||||
IF _NARG >= 4
|
if _NARG >= 4
|
||||||
ld \1, \3 bgrows + \2 + \4
|
ld \1, \3 bgrows + \2 + \4
|
||||||
ELSE
|
else
|
||||||
ld \1, \3 bgrows + \2 + vBGMap0
|
ld \1, \3 bgrows + \2 + vBGMap0
|
||||||
ENDC
|
endc
|
||||||
ENDM
|
ENDM
|
||||||
|
@ -538,13 +538,13 @@ jumptextfaceplayer: MACRO
|
|||||||
dw \1 ; text_pointer
|
dw \1 ; text_pointer
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
; IF _CRYSTAL
|
; if _CRYSTAL
|
||||||
enum farjumptext_command ; $52
|
enum farjumptext_command ; $52
|
||||||
farjumptext: MACRO
|
farjumptext: MACRO
|
||||||
db farjumptext_command
|
db farjumptext_command
|
||||||
dba \1
|
dba \1
|
||||||
ENDM
|
ENDM
|
||||||
; ENDC
|
; endc
|
||||||
|
|
||||||
enum jumptext_command ; $53
|
enum jumptext_command ; $53
|
||||||
jumptext: MACRO
|
jumptext: MACRO
|
||||||
|
6
main.asm
6
main.asm
@ -645,8 +645,8 @@ INCLUDE "engine/events/odd_egg.asm"
|
|||||||
|
|
||||||
SECTION "Mobile Stadium 2", ROMX
|
SECTION "Mobile Stadium 2", ROMX
|
||||||
|
|
||||||
IF DEF(CRYSTAL11)
|
if DEF(CRYSTAL11)
|
||||||
INCBIN "mobile/stadium/stadium2_2.bin"
|
INCBIN "mobile/stadium/stadium2_2.bin"
|
||||||
ELSE
|
else
|
||||||
INCBIN "mobile/stadium/stadium2_1.bin"
|
INCBIN "mobile/stadium/stadium2_1.bin"
|
||||||
ENDC
|
endc
|
||||||
|
@ -5,19 +5,19 @@ BattleTowerText:: ; 11c000
|
|||||||
; 3: Player won
|
; 3: Player won
|
||||||
ld a, [rSVBK]
|
ld a, [rSVBK]
|
||||||
push af
|
push af
|
||||||
ld a, 3 ; BANK(BT_OTTrainerClass)
|
ld a, BANK(BT_OTTrainerClass)
|
||||||
ld [rSVBK], a
|
ld [rSVBK], a
|
||||||
IF DEF(CRYSTAL11)
|
if DEF(CRYSTAL11)
|
||||||
ld hl, BT_OTTrainerClass
|
ld hl, BT_OTTrainerClass
|
||||||
ELSE
|
else
|
||||||
ld hl, BT_OTName + 5
|
|
||||||
; BUG ALERT
|
; BUG ALERT
|
||||||
; Instead of loading the Trainer Class, this routine
|
; Instead of loading the Trainer Class, this routine
|
||||||
; loads the 6th character in the Trainer's name, then
|
; loads the 6th character in the Trainer's name, then
|
||||||
; uses it to get the gender of the trainer.
|
; uses it to get the gender of the trainer.
|
||||||
; As a consequence, the enemy trainer's dialog will
|
; As a consequence, the enemy trainer's dialog will
|
||||||
; always be sampled from the female array.
|
; always be sampled from the female array.
|
||||||
ENDC
|
ld hl, BT_OTName + 5
|
||||||
|
endc
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
dec a
|
dec a
|
||||||
ld e, a
|
ld e, a
|
||||||
|
@ -936,11 +936,11 @@ GameBoyN64GFX:
|
|||||||
INCBIN "gfx/trade/game_boy_n64.2bpp"
|
INCBIN "gfx/trade/game_boy_n64.2bpp"
|
||||||
|
|
||||||
Tilemap_1733af:
|
Tilemap_1733af:
|
||||||
IF DEF(CRYSTAL11)
|
if DEF(CRYSTAL11)
|
||||||
INCBIN "gfx/unknown/1733af_corrupt.tilemap"
|
INCBIN "gfx/unknown/1733af_corrupt.tilemap"
|
||||||
ELSE
|
else
|
||||||
INCBIN "gfx/unknown/1733af.tilemap"
|
INCBIN "gfx/unknown/1733af.tilemap"
|
||||||
ENDC
|
endc
|
||||||
|
|
||||||
Attrmap_173517:
|
Attrmap_173517:
|
||||||
INCBIN "gfx/unknown/173517.attrmap"
|
INCBIN "gfx/unknown/173517.attrmap"
|
||||||
|
10
wram.asm
10
wram.asm
@ -827,12 +827,12 @@ wDexListingCursorBackup:: db
|
|||||||
wBackupDexListingCursor:: db
|
wBackupDexListingCursor:: db
|
||||||
wBackupDexListingPage:: db
|
wBackupDexListingPage:: db
|
||||||
wDexCurrentLocation:: db
|
wDexCurrentLocation:: db
|
||||||
IF DEF(CRYSTAL11)
|
if DEF(CRYSTAL11)
|
||||||
wPokedexStatus:: db
|
wPokedexStatus:: db
|
||||||
wPokedexDataEnd::
|
wPokedexDataEnd::
|
||||||
ELSE
|
else
|
||||||
wPokedexDataEnd:: ds 1
|
wPokedexDataEnd:: ds 1
|
||||||
ENDC
|
endc
|
||||||
ds 2
|
ds 2
|
||||||
|
|
||||||
NEXTU ; c6d0
|
NEXTU ; c6d0
|
||||||
@ -1312,9 +1312,9 @@ wCardFlipWhichCard:: db
|
|||||||
NEXTU ; cf64
|
NEXTU ; cf64
|
||||||
; pokedex
|
; pokedex
|
||||||
wDexEntryPrevJumptableIndex:: db
|
wDexEntryPrevJumptableIndex:: db
|
||||||
IF !DEF(CRYSTAL11)
|
if !DEF(CRYSTAL11)
|
||||||
wPokedexStatus:: db
|
wPokedexStatus:: db
|
||||||
ENDC
|
endc
|
||||||
|
|
||||||
NEXTU ; cf64
|
NEXTU ; cf64
|
||||||
; miscellaneous
|
; miscellaneous
|
||||||
|
Loading…
x
Reference in New Issue
Block a user