ref: 28d5169a119ece438cc39b442adaa018b9a376e3
parent: bc79f17b9dff053ce5613e4008596a55a6110d66
author: Remy Oukaour <remy.oukaour@gmail.com>
date: Wed Jan 10 09:03:11 EST 2018
maskbits <count> +- 1
--- a/engine/events/battle_tower/load_trainer.asm
+++ b/engine/events/battle_tower/load_trainer.asm
@@ -27,12 +27,12 @@
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 @@
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
--- a/home/time.asm
+++ b/home/time.asm
@@ -48,17 +48,17 @@
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