mirror of https://github.com/pret/pokecrystal.git
maskbits <count> +- 1
This commit is contained in:
parent
bc79f17b9d
commit
28d5169a11
|
@ -27,12 +27,12 @@ Function_LoadOpponentTrainerAndPokemons: ; 1f8000
|
||||||
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)
|
||||||
maskbits BATTLETOWER_NUM_UNIQUE_TRAINERS
|
maskbits BATTLETOWER_NUM_UNIQUE_TRAINERS +- 1
|
||||||
cp BATTLETOWER_NUM_UNIQUE_TRAINERS
|
cp BATTLETOWER_NUM_UNIQUE_TRAINERS
|
||||||
else
|
else
|
||||||
; Crystal 1.0 used the wrong constant here, so only the first 21
|
; Crystal 1.0 used the wrong constant here, so only the first 21
|
||||||
; trainers in BattleTowerTrainers can be sampled.
|
; trainers in BattleTowerTrainers can be sampled.
|
||||||
maskbits BATTLETOWER_NUM_UNIQUE_PKMN
|
maskbits BATTLETOWER_NUM_UNIQUE_PKMN +- 1
|
||||||
cp BATTLETOWER_NUM_UNIQUE_PKMN
|
cp BATTLETOWER_NUM_UNIQUE_PKMN
|
||||||
endc
|
endc
|
||||||
jr nc, .resample
|
jr nc, .resample
|
||||||
|
@ -115,7 +115,7 @@ Function_LoadRandomBattleTowerPkmn: ; 1f8081
|
||||||
ld a, [hRandomAdd]
|
ld a, [hRandomAdd]
|
||||||
add b
|
add b
|
||||||
ld b, a
|
ld b, a
|
||||||
maskbits BATTLETOWER_NUM_UNIQUE_PKMN
|
maskbits BATTLETOWER_NUM_UNIQUE_PKMN +- 1
|
||||||
cp BATTLETOWER_NUM_UNIQUE_PKMN
|
cp BATTLETOWER_NUM_UNIQUE_PKMN
|
||||||
jr nc, .resample
|
jr nc, .resample
|
||||||
; in register 'a' is the chosen Pkmn of the LevelGroup
|
; in register 'a' is the chosen Pkmn of the LevelGroup
|
||||||
|
|
|
@ -48,17 +48,17 @@ GetClock:: ; 5b7
|
||||||
|
|
||||||
ld [hl], RTC_S
|
ld [hl], RTC_S
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
maskbits 60
|
maskbits 60 - 1
|
||||||
ld [hRTCSeconds], a
|
ld [hRTCSeconds], a
|
||||||
|
|
||||||
ld [hl], RTC_M
|
ld [hl], RTC_M
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
maskbits 60
|
maskbits 60 - 1
|
||||||
ld [hRTCMinutes], a
|
ld [hRTCMinutes], a
|
||||||
|
|
||||||
ld [hl], RTC_H
|
ld [hl], RTC_H
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
maskbits 24
|
maskbits 24 - 1
|
||||||
ld [hRTCHours], a
|
ld [hRTCHours], a
|
||||||
|
|
||||||
ld [hl], RTC_DL
|
ld [hl], RTC_DL
|
||||||
|
|
Loading…
Reference in New Issue