You've already forked pokecrystal-board
mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2025-09-08 08:13:02 -07:00
Avoid "+- 1" at every maskbits
This commit is contained in:
@@ -27,12 +27,12 @@ Function_LoadOpponentTrainerAndPokemons: ; 1f8000
|
||||
add b
|
||||
ld b, a ; b contains the nr of the trainer
|
||||
if DEF(_CRYSTAL11)
|
||||
maskbits BATTLETOWER_NUM_UNIQUE_TRAINERS +- 1
|
||||
maskbits BATTLETOWER_NUM_UNIQUE_TRAINERS
|
||||
cp BATTLETOWER_NUM_UNIQUE_TRAINERS
|
||||
else
|
||||
; Crystal 1.0 used the wrong constant here, so only the first 21
|
||||
; trainers in BattleTowerTrainers can be sampled.
|
||||
maskbits BATTLETOWER_NUM_UNIQUE_PKMN +- 1
|
||||
maskbits BATTLETOWER_NUM_UNIQUE_PKMN
|
||||
cp BATTLETOWER_NUM_UNIQUE_PKMN
|
||||
endc
|
||||
jr nc, .resample
|
||||
@@ -115,7 +115,7 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
|
||||
ld a, [hRandomAdd]
|
||||
add b
|
||||
ld b, a
|
||||
maskbits BATTLETOWER_NUM_UNIQUE_PKMN +- 1
|
||||
maskbits BATTLETOWER_NUM_UNIQUE_PKMN
|
||||
cp BATTLETOWER_NUM_UNIQUE_PKMN
|
||||
jr nc, .resample
|
||||
; in register 'a' is the chosen Pkmn of the LevelGroup
|
||||
|
||||
@@ -17,7 +17,7 @@ Special_BuenasPassword: ; 8af6b
|
||||
ld a, [MenuSelection]
|
||||
ld c, a
|
||||
ld a, [wBuenasPassword]
|
||||
maskbits NUM_PASSWORDS_PER_CATEGORY +- 1
|
||||
maskbits NUM_PASSWORDS_PER_CATEGORY
|
||||
cp c
|
||||
jr nz, .wrong
|
||||
ld b, $1
|
||||
|
||||
@@ -80,7 +80,7 @@ rept 4
|
||||
endr
|
||||
|
||||
ld a, [TimeOfDay]
|
||||
maskbits NUM_DAYTIMES +- 1
|
||||
maskbits NUM_DAYTIMES
|
||||
cp NITE_F
|
||||
jr c, .time_species
|
||||
inc hl
|
||||
|
||||
@@ -435,7 +435,7 @@ MagnetTrain_Jumptable_FirstRunThrough: ; 8ceae
|
||||
ld a, [wEnvironment]
|
||||
push af
|
||||
ld a, [TimeOfDay]
|
||||
maskbits NUM_DAYTIMES +- 1
|
||||
maskbits NUM_DAYTIMES
|
||||
ld [TimeOfDayPal], a
|
||||
ld a, $1
|
||||
ld [wEnvironment], a
|
||||
|
||||
@@ -10,7 +10,7 @@ LoadPoisonBGPals: ; cbcdd
|
||||
and a
|
||||
jr nz, .cgb
|
||||
ld a, [TimeOfDayPal]
|
||||
maskbits NUM_DAYTIMES +- 1
|
||||
maskbits NUM_DAYTIMES
|
||||
cp DARKNESS_F
|
||||
ld a, %00000000
|
||||
jr z, .convert_pals
|
||||
|
||||
Reference in New Issue
Block a user