maskbits <count> +- 1

This commit is contained in:
Remy Oukaour 2018-01-10 14:03:11 -05:00
parent bc79f17b9d
commit 28d5169a11
2 changed files with 6 additions and 6 deletions

View File

@ -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
maskbits BATTLETOWER_NUM_UNIQUE_TRAINERS +- 1
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
maskbits BATTLETOWER_NUM_UNIQUE_PKMN +- 1
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
maskbits BATTLETOWER_NUM_UNIQUE_PKMN +- 1
cp BATTLETOWER_NUM_UNIQUE_PKMN
jr nc, .resample
; in register 'a' is the chosen Pkmn of the LevelGroup

View File

@ -48,17 +48,17 @@ GetClock:: ; 5b7
ld [hl], RTC_S
ld a, [de]
maskbits 60
maskbits 60 - 1
ld [hRTCSeconds], a
ld [hl], RTC_M
ld a, [de]
maskbits 60
maskbits 60 - 1
ld [hRTCMinutes], a
ld [hl], RTC_H
ld a, [de]
maskbits 24
maskbits 24 - 1
ld [hRTCHours], a
ld [hl], RTC_DL