aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/main.yml1
-rw-r--r--constants/move_effect_constants.asm4
-rw-r--r--constants/palette_constants.asm2
-rw-r--r--data/moves/effects_pointers.asm4
-rw-r--r--data/moves/moves.asm6
-rw-r--r--data/pokemon/palettes.asm48
-rw-r--r--data/sgb/sgb_palettes.asm4
-rw-r--r--engine/battle/animations.asm2
-rw-r--r--engine/battle/core.asm4
-rw-r--r--engine/battle/effects.asm16
-rw-r--r--engine/battle/ghost_marowak_anim.asm2
-rw-r--r--engine/events/poison.asm6
-rw-r--r--engine/events/prize_menu.asm6
-rw-r--r--engine/gfx/palettes.asm8
-rw-r--r--engine/items/town_map.asm2
-rw-r--r--engine/link/cable_club.asm2
-rw-r--r--engine/overworld/map_sprites.asm2
-rw-r--r--home/serial.asm6
-rw-r--r--home/vcopy.asm4
-rw-r--r--macros/data.asm2
-rw-r--r--macros/scripts/events.asm6
-rw-r--r--scripts/MtMoonB2F.asm3
22 files changed, 73 insertions, 67 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 0a0da0f3..06a99324 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -22,6 +22,7 @@ jobs:
- name: Install rgbds
working-directory: rgbds
run: |
+ sudo apt-get install -yq libpng-dev
sudo make install
- name: Remove rgbds
diff --git a/constants/move_effect_constants.asm b/constants/move_effect_constants.asm
index 0727f41e..6914fafd 100644
--- a/constants/move_effect_constants.asm
+++ b/constants/move_effect_constants.asm
@@ -9,7 +9,7 @@
const POISON_SIDE_EFFECT1 ; $02
const DRAIN_HP_EFFECT ; $03
const BURN_SIDE_EFFECT1 ; $04
- const FREEZE_SIDE_EFFECT ; $05
+ const FREEZE_SIDE_EFFECT1 ; $05
const PARALYZE_SIDE_EFFECT1 ; $06
const EXPLODE_EFFECT ; $07 Explosion, Self Destruct
const DREAM_EATER_EFFECT ; $08
@@ -39,7 +39,7 @@
const SLEEP_EFFECT ; $20
const POISON_SIDE_EFFECT2 ; $21
const BURN_SIDE_EFFECT2 ; $22
- const UNUSED_EFFECT_23 ; $23
+ const FREEZE_SIDE_EFFECT2 ; $23 unused (Blizzard in JP Red/Green)
const PARALYZE_SIDE_EFFECT2 ; $24
const FLINCH_SIDE_EFFECT2 ; $25
const OHKO_EFFECT ; $26 moves like Horn Drill
diff --git a/constants/palette_constants.asm b/constants/palette_constants.asm
index 8d54e84e..58b2201e 100644
--- a/constants/palette_constants.asm
+++ b/constants/palette_constants.asm
@@ -62,7 +62,7 @@ DEF SET_PAL_DEFAULT EQU $ff
const PAL_GREENMON ; $16
const PAL_PINKMON ; $17
const PAL_YELLOWMON ; $18
- const PAL_GREYMON ; $19
+ const PAL_GRAYMON ; $19
const PAL_SLOTS1 ; $1A
const PAL_SLOTS2 ; $1B
const PAL_SLOTS3 ; $1C
diff --git a/data/moves/effects_pointers.asm b/data/moves/effects_pointers.asm
index c33a5fd6..63350efc 100644
--- a/data/moves/effects_pointers.asm
+++ b/data/moves/effects_pointers.asm
@@ -5,7 +5,7 @@ MoveEffectPointerTable:
dw PoisonEffect ; POISON_SIDE_EFFECT1
dw DrainHPEffect ; DRAIN_HP_EFFECT
dw FreezeBurnParalyzeEffect ; BURN_SIDE_EFFECT1
- dw FreezeBurnParalyzeEffect ; FREEZE_SIDE_EFFECT
+ dw FreezeBurnParalyzeEffect ; FREEZE_SIDE_EFFECT1
dw FreezeBurnParalyzeEffect ; PARALYZE_SIDE_EFFECT1
dw ExplodeEffect ; EXPLODE_EFFECT
dw DrainHPEffect ; DREAM_EATER_EFFECT
@@ -35,7 +35,7 @@ MoveEffectPointerTable:
dw SleepEffect ; SLEEP_EFFECT
dw PoisonEffect ; POISON_SIDE_EFFECT2
dw FreezeBurnParalyzeEffect ; BURN_SIDE_EFFECT2
- dw FreezeBurnParalyzeEffect ; unused effect
+ dw FreezeBurnParalyzeEffect ; FREEZE_SIDE_EFFECT2
dw FreezeBurnParalyzeEffect ; PARALYZE_SIDE_EFFECT2
dw FlinchSideEffect ; FLINCH_SIDE_EFFECT2
dw OneHitKOEffect ; OHKO_EFFECT
diff --git a/data/moves/moves.asm b/data/moves/moves.asm
index c32a89cb..e59ed007 100644
--- a/data/moves/moves.asm
+++ b/data/moves/moves.asm
@@ -18,7 +18,7 @@ Moves:
move MEGA_PUNCH, NO_ADDITIONAL_EFFECT, 80, NORMAL, 85, 20
move PAY_DAY, PAY_DAY_EFFECT, 40, NORMAL, 100, 20
move FIRE_PUNCH, BURN_SIDE_EFFECT1, 75, FIRE, 100, 15
- move ICE_PUNCH, FREEZE_SIDE_EFFECT, 75, ICE, 100, 15
+ move ICE_PUNCH, FREEZE_SIDE_EFFECT1, 75, ICE, 100, 15
move THUNDERPUNCH, PARALYZE_SIDE_EFFECT1, 75, ELECTRIC, 100, 15
move SCRATCH, NO_ADDITIONAL_EFFECT, 40, NORMAL, 100, 35
move VICEGRIP, NO_ADDITIONAL_EFFECT, 55, NORMAL, 100, 30
@@ -68,8 +68,8 @@ Moves:
move WATER_GUN, NO_ADDITIONAL_EFFECT, 40, WATER, 100, 25
move HYDRO_PUMP, NO_ADDITIONAL_EFFECT, 120, WATER, 80, 5
move SURF, NO_ADDITIONAL_EFFECT, 95, WATER, 100, 15
- move ICE_BEAM, FREEZE_SIDE_EFFECT, 95, ICE, 100, 10
- move BLIZZARD, FREEZE_SIDE_EFFECT, 120, ICE, 90, 5
+ move ICE_BEAM, FREEZE_SIDE_EFFECT1, 95, ICE, 100, 10
+ move BLIZZARD, FREEZE_SIDE_EFFECT1, 120, ICE, 90, 5
move PSYBEAM, CONFUSION_SIDE_EFFECT, 65, PSYCHIC_TYPE, 100, 20
move BUBBLEBEAM, SPEED_DOWN_SIDE_EFFECT, 65, WATER, 100, 20
move AURORA_BEAM, ATTACK_DOWN_SIDE_EFFECT, 65, ICE, 100, 20
diff --git a/data/pokemon/palettes.asm b/data/pokemon/palettes.asm
index 2ce500aa..4aec84ea 100644
--- a/data/pokemon/palettes.asm
+++ b/data/pokemon/palettes.asm
@@ -19,8 +19,8 @@ MonsterPalettes:
db PAL_BROWNMON ; PIDGEY
db PAL_BROWNMON ; PIDGEOTTO
db PAL_BROWNMON ; PIDGEOT
- db PAL_GREYMON ; RATTATA
- db PAL_GREYMON ; RATICATE
+ db PAL_GRAYMON ; RATTATA
+ db PAL_GRAYMON ; RATICATE
db PAL_BROWNMON ; SPEAROW
db PAL_BROWNMON ; FEAROW
db PAL_PURPLEMON ; EKANS
@@ -66,23 +66,23 @@ MonsterPalettes:
db PAL_YELLOWMON ; ABRA
db PAL_YELLOWMON ; KADABRA
db PAL_YELLOWMON ; ALAKAZAM
- db PAL_GREYMON ; MACHOP
- db PAL_GREYMON ; MACHOKE
- db PAL_GREYMON ; MACHAMP
+ db PAL_GRAYMON ; MACHOP
+ db PAL_GRAYMON ; MACHOKE
+ db PAL_GRAYMON ; MACHAMP
db PAL_GREENMON ; BELLSPROUT
db PAL_GREENMON ; WEEPINBELL
db PAL_GREENMON ; VICTREEBEL
db PAL_CYANMON ; TENTACOOL
db PAL_CYANMON ; TENTACRUEL
- db PAL_GREYMON ; GEODUDE
- db PAL_GREYMON ; GRAVELER
- db PAL_GREYMON ; GOLEM
+ db PAL_GRAYMON ; GEODUDE
+ db PAL_GRAYMON ; GRAVELER
+ db PAL_GRAYMON ; GOLEM
db PAL_REDMON ; PONYTA
db PAL_REDMON ; RAPIDASH
db PAL_PINKMON ; SLOWPOKE
db PAL_PINKMON ; SLOWBRO
- db PAL_GREYMON ; MAGNEMITE
- db PAL_GREYMON ; MAGNETON
+ db PAL_GRAYMON ; MAGNEMITE
+ db PAL_GRAYMON ; MAGNETON
db PAL_BROWNMON ; FARFETCHD
db PAL_BROWNMON ; DODUO
db PAL_BROWNMON ; DODRIO
@@ -90,12 +90,12 @@ MonsterPalettes:
db PAL_BLUEMON ; DEWGONG
db PAL_PURPLEMON ; GRIMER
db PAL_PURPLEMON ; MUK
- db PAL_GREYMON ; SHELLDER
- db PAL_GREYMON ; CLOYSTER
+ db PAL_GRAYMON ; SHELLDER
+ db PAL_GRAYMON ; CLOYSTER
db PAL_PURPLEMON ; GASTLY
db PAL_PURPLEMON ; HAUNTER
db PAL_PURPLEMON ; GENGAR
- db PAL_GREYMON ; ONIX
+ db PAL_GRAYMON ; ONIX
db PAL_YELLOWMON ; DROWZEE
db PAL_YELLOWMON ; HYPNO
db PAL_REDMON ; KRABBY
@@ -104,15 +104,15 @@ MonsterPalettes:
db PAL_YELLOWMON ; ELECTRODE
db PAL_PINKMON ; EXEGGCUTE
db PAL_GREENMON ; EXEGGUTOR
- db PAL_GREYMON ; CUBONE
- db PAL_GREYMON ; MAROWAK
+ db PAL_GRAYMON ; CUBONE
+ db PAL_GRAYMON ; MAROWAK
db PAL_BROWNMON ; HITMONLEE
db PAL_BROWNMON ; HITMONCHAN
db PAL_PINKMON ; LICKITUNG
db PAL_PURPLEMON ; KOFFING
db PAL_PURPLEMON ; WEEZING
- db PAL_GREYMON ; RHYHORN
- db PAL_GREYMON ; RHYDON
+ db PAL_GRAYMON ; RHYHORN
+ db PAL_GRAYMON ; RHYDON
db PAL_PINKMON ; CHANSEY
db PAL_BLUEMON ; TANGELA
db PAL_BROWNMON ; KANGASKHAN
@@ -121,33 +121,33 @@ MonsterPalettes:
db PAL_REDMON ; GOLDEEN
db PAL_REDMON ; SEAKING
db PAL_REDMON ; STARYU
- db PAL_GREYMON ; STARMIE
+ db PAL_GRAYMON ; STARMIE
db PAL_PINKMON ; MR_MIME
db PAL_GREENMON ; SCYTHER
db PAL_MEWMON ; JYNX
db PAL_YELLOWMON ; ELECTABUZZ
db PAL_REDMON ; MAGMAR
db PAL_BROWNMON ; PINSIR
- db PAL_GREYMON ; TAUROS
+ db PAL_GRAYMON ; TAUROS
db PAL_REDMON ; MAGIKARP
db PAL_BLUEMON ; GYARADOS
db PAL_CYANMON ; LAPRAS
- db PAL_GREYMON ; DITTO
- db PAL_GREYMON ; EEVEE
+ db PAL_GRAYMON ; DITTO
+ db PAL_GRAYMON ; EEVEE
db PAL_CYANMON ; VAPOREON
db PAL_YELLOWMON ; JOLTEON
db PAL_REDMON ; FLAREON
- db PAL_GREYMON ; PORYGON
+ db PAL_GRAYMON ; PORYGON
db PAL_BLUEMON ; OMANYTE
db PAL_BLUEMON ; OMASTAR
db PAL_BROWNMON ; KABUTO
db PAL_BROWNMON ; KABUTOPS
- db PAL_GREYMON ; AERODACTYL
+ db PAL_GRAYMON ; AERODACTYL
db PAL_PINKMON ; SNORLAX
db PAL_BLUEMON ; ARTICUNO
db PAL_YELLOWMON ; ZAPDOS
db PAL_REDMON ; MOLTRES
- db PAL_GREYMON ; DRATINI
+ db PAL_GRAYMON ; DRATINI
db PAL_BLUEMON ; DRAGONAIR
db PAL_BROWNMON ; DRAGONITE
db PAL_MEWMON ; MEWTWO
diff --git a/data/sgb/sgb_palettes.asm b/data/sgb/sgb_palettes.asm
index 2e0b74bf..b9a4e95c 100644
--- a/data/sgb/sgb_palettes.asm
+++ b/data/sgb/sgb_palettes.asm
@@ -26,7 +26,7 @@ SuperPalettes:
RGB 31,31,30, 24,28,18, 13,21,15, 06,06,06 ; PAL_GREENMON
RGB 31,31,30, 31,24,26, 31,18,21, 06,06,06 ; PAL_PINKMON
RGB 31,31,30, 31,31,19, 28,23,09, 06,06,06 ; PAL_YELLOWMON
- RGB 31,31,30, 25,25,18, 16,16,14, 06,06,06 ; PAL_GREYMON
+ RGB 31,31,30, 25,25,18, 16,16,14, 06,06,06 ; PAL_GRAYMON
RGB 31,31,30, 27,22,30, 26,09,06, 06,06,06 ; PAL_SLOTS1
RGB 31,31,30, 31,23,26, 29,29,08, 06,06,06 ; PAL_SLOTS2
RGB 31,31,30, 23,31,20, 29,29,08, 06,06,06 ; PAL_SLOTS3
@@ -71,7 +71,7 @@ GBCBasePalettes:
RGB 31,31,31, 17,31,11, 01,22,06, 03,03,03 ; PAL_GREENMON
RGB 31,31,31, 31,15,18, 31,00,06, 03,03,03 ; PAL_PINKMON
RGB 31,31,31, 31,31,00, 28,14,00, 03,03,03 ; PAL_YELLOWMON
- RGB 31,31,31, 20,23,10, 11,11,05, 03,03,03 ; PAL_GREYMON
+ RGB 31,31,31, 20,23,10, 11,11,05, 03,03,03 ; PAL_GRAYMON
RGB 31,31,31, 25,01,31, 31,00,00, 03,03,03 ; PAL_SLOTS1
RGB 31,31,31, 31,04,19, 31,31,00, 03,03,03 ; PAL_SLOTS2
RGB 31,31,31, 08,31,00, 31,31,00, 03,03,03 ; PAL_SLOTS3
diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm
index 42603824..f9608fdb 100644
--- a/engine/battle/animations.asm
+++ b/engine/battle/animations.asm
@@ -2589,7 +2589,7 @@ FallingObjects_UpdateOAMEntry:
ld [wdef4], a
.asm_79e5c
inc hl
- ld a, (1 << OAM_X_FLIP)
+ ld a, 1 << OAM_X_FLIP
.next2
ld b, a
ld a, [wdef4]
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 919de01c..d6ce6557 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -6867,7 +6867,7 @@ BattleRandom:
add hl, bc
inc a
ld [wLinkBattleRandomNumberListIndex], a
- cp 9
+ cp SERIAL_RNS_LENGTH - 1
ld a, [hl]
pop bc
pop hl
@@ -6890,7 +6890,7 @@ ENDC
ld [wLinkBattleRandomNumberListIndex], a
ld hl, wLinkBattleRandomNumberList
- ld b, 9
+ ld b, SERIAL_RNS_LENGTH - 1
.loop
ld a, [hl]
ld c, a
diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm
index 1feebb21..a78de9ca 100644
--- a/engine/battle/effects.asm
+++ b/engine/battle/effects.asm
@@ -221,11 +221,11 @@ FreezeBurnParalyzeEffect:
cp b ; do target type 2 and move type match?
ret z ; return if they match
ld a, [wPlayerMoveEffect]
- cp UNUSED_EFFECT_23 ; more stadium stuff
+ cp FREEZE_SIDE_EFFECT2 ; more stadium stuff
jr nz, .asm_3f2c7
ld a, [wUnknownSerialFlag_d499]
and a
- ld a, FREEZE_SIDE_EFFECT
+ ld a, FREEZE_SIDE_EFFECT1
ld b, 30 percent + 1
jr z, .regular_effectiveness
ld b, 10 percent + 1
@@ -236,7 +236,9 @@ FreezeBurnParalyzeEffect:
jr c, .regular_effectiveness
; extra effectiveness
ld b, 30 percent + 1
- sub BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1 ; treat extra effective as regular from now on
+ assert PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == BURN_SIDE_EFFECT2 - BURN_SIDE_EFFECT1
+ assert PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 == FREEZE_SIDE_EFFECT2 - FREEZE_SIDE_EFFECT1
+ sub PARALYZE_SIDE_EFFECT2 - PARALYZE_SIDE_EFFECT1 ; treat extra effective as regular from now on
.regular_effectiveness
push af
call BattleRandom ; get random 8bit value for probability test
@@ -246,7 +248,7 @@ FreezeBurnParalyzeEffect:
ld a, b ; what type of effect is this?
cp BURN_SIDE_EFFECT1
jr z, .burn1
- cp FREEZE_SIDE_EFFECT
+ cp FREEZE_SIDE_EFFECT1
jr z, .freeze1
; .paralyze1
ld a, 1 << PAR
@@ -284,11 +286,11 @@ FreezeBurnParalyzeEffect:
cp b
ret z
ld a, [wEnemyMoveEffect]
- cp UNUSED_EFFECT_23 ; more stadium stuff
+ cp FREEZE_SIDE_EFFECT2 ; more stadium stuff
jr nz, .asm_3f341
ld a, [wUnknownSerialFlag_d499]
and a
- ld a, FREEZE_SIDE_EFFECT
+ ld a, FREEZE_SIDE_EFFECT1
ld b, 30 percent + 1
jr z, .regular_effectiveness2
ld b, 10 percent + 1
@@ -309,7 +311,7 @@ FreezeBurnParalyzeEffect:
ld a, b
cp BURN_SIDE_EFFECT1
jr z, .burn2
- cp FREEZE_SIDE_EFFECT
+ cp FREEZE_SIDE_EFFECT1
jr z, .freeze2
; .paralyze2
ld a, 1 << PAR
diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm
index 7fe42121..5b14f6df 100644
--- a/engine/battle/ghost_marowak_anim.asm
+++ b/engine/battle/ghost_marowak_anim.asm
@@ -17,7 +17,7 @@ MarowakAnim:
ld a, $1
ldh [hWhoseTurn], a
callfar ChangeMonPic
- ; alternate between black and light grey 8 times.
+ ; alternate between black and light gray 8 times.
; this makes the ghost's body appear to flash
ld d, $80
call FlashSprite8Times
diff --git a/engine/events/poison.asm b/engine/events/poison.asm
index 467d1a5f..18546254 100644
--- a/engine/events/poison.asm
+++ b/engine/events/poison.asm
@@ -22,7 +22,7 @@ ApplyOutOfBattlePoisonDamage:
ld de, wPartySpecies
.applyDamageLoop
ld a, [hl]
- and (1 << PSN)
+ and 1 << PSN
jr z, .nextMon2 ; not poisoned
dec hl
dec hl
@@ -92,7 +92,7 @@ ApplyOutOfBattlePoisonDamage:
ld e, 0
.countPoisonedLoop
ld a, [hl]
- and (1 << PSN)
+ and 1 << PSN
or e
ld e, a
ld bc, wPartyMon2 - wPartyMon1
@@ -103,7 +103,7 @@ ApplyOutOfBattlePoisonDamage:
and a ; are any party members poisoned?
jr z, .skipPoisonEffectAndSound
ld b, $2
- predef ChangeBGPalColor0_4Frames ; change BG white to dark grey for 4 frames
+ predef ChangeBGPalColor0_4Frames ; change BG white to dark gray for 4 frames
ld a, SFX_POISONED
call PlaySound
.skipPoisonEffectAndSound
diff --git a/engine/events/prize_menu.asm b/engine/events/prize_menu.asm
index a365f45f..4b2121f5 100644
--- a/engine/events/prize_menu.asm
+++ b/engine/events/prize_menu.asm
@@ -128,15 +128,15 @@ GetPrizeMenuId:
; reg. c:
; [low nybble] number of bytes
; [bits 765 = %100] space-padding (not zero-padding)
- ld c, (1 << 7 | 2)
+ ld c, (1 << 7) | 2
call PrintBCDNumber
ld de, wPrize2Price
hlcoord 13, 7
- ld c, (1 << 7 | 2)
+ ld c, (1 << 7) | 2
call PrintBCDNumber
ld de, wPrize3Price
hlcoord 13, 9
- ld c, (1 << 7 | 2)
+ ld c, (1 << 7) | 2
jp PrintBCDNumber
NoThanksText:
diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm
index d9ae4369..428a6998 100644
--- a/engine/gfx/palettes.asm
+++ b/engine/gfx/palettes.asm
@@ -180,7 +180,7 @@ SetPal_Overworld:
ld [wDefaultPaletteCommand], a
ret
.PokemonTowerOrAgatha
- ld a, PAL_GREYMON - 1
+ ld a, PAL_GRAYMON - 1
jr .town
.caveOrBruno
ld a, PAL_CAVE - 1
@@ -189,7 +189,7 @@ SetPal_Overworld:
xor a
jr .town
.trade_center_colosseum
- ld a, PAL_GREYMON - 1
+ ld a, PAL_GRAYMON - 1
jr .town
; used when a Pokemon is the only thing on the screen
@@ -423,7 +423,7 @@ GetPal_Pikachu::
ret
.PokemonTowerOrAgatha
- ld a, PAL_GREYMON - 1
+ ld a, PAL_GRAYMON - 1
jr .town
.caveOrBruno
@@ -435,7 +435,7 @@ GetPal_Pikachu::
jr .town
.battleOrTradeCenter
- ld a, PAL_GREYMON - 1
+ ld a, PAL_GRAYMON - 1
jr .town
InitPartyMenuBlkPacket:
diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm
index a49e751e..abd3b13f 100644
--- a/engine/items/town_map.asm
+++ b/engine/items/town_map.asm
@@ -520,7 +520,7 @@ WriteSymmetricMonPartySpriteOAM:
ld [hli], a ; tile
ld a, [wSymmetricSpriteOAMAttributes]
ld [hli], a ; attributes
- xor (1 << OAM_X_FLIP)
+ xor 1 << OAM_X_FLIP
ld [wSymmetricSpriteOAMAttributes], a
inc d
ld a, 8
diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm
index f2b651fe..26845d2e 100644
--- a/engine/link/cable_club.asm
+++ b/engine/link/cable_club.asm
@@ -119,7 +119,7 @@ CableClub_DoBattleOrTradeAgain:
.skipSendingTwoZeroBytes
call Delay3
call StopAllMusic
- ld a, (1 << SERIAL)
+ ld a, 1 << SERIAL
ldh [rIE], a
ld hl, wSerialRandomNumberListBlock
ld de, wSerialOtherGameboyRandomNumberListBlock
diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm
index 5d25b6d0..b6ce4229 100644
--- a/engine/overworld/map_sprites.asm
+++ b/engine/overworld/map_sprites.asm
@@ -59,7 +59,7 @@ LoadSpriteSetFromMapHeader:
; (since the Red sprite always has the first VRAM tile pattern slot and the
; Pikachu sprite reserves the second slot) is the VRAM tile pattern slot.
ld hl, wSpriteSet
- ld bc, (wSpriteSetID - wSpriteSet)
+ ld bc, wSpriteSetID - wSpriteSet
xor a
call FillMemory
ld a, SPRITE_PIKACHU ; load Pikachu separately
diff --git a/home/serial.asm b/home/serial.asm
index 7edba241..258651a5 100644
--- a/home/serial.asm
+++ b/home/serial.asm
@@ -121,7 +121,7 @@ Serial_ExchangeByte::
.doNotIncrementUnknownCounter
ldh a, [rIE]
and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK)
- cp (1 << SERIAL)
+ cp 1 << SERIAL
jr nz, .loop
ld a, [wUnknownSerialCounter2]
dec a
@@ -143,7 +143,7 @@ Serial_ExchangeByte::
ldh [hSerialReceivedNewData], a
ldh a, [rIE]
and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK)
- sub (1 << SERIAL)
+ sub 1 << SERIAL
jr nz, .skipReloadingUnknownCounter2
ld [wUnknownSerialCounter2], a
ld a, $50
@@ -169,7 +169,7 @@ Serial_ExchangeByte::
.done
ldh a, [rIE]
and (1 << SERIAL) | (1 << TIMER) | (1 << LCD_STAT) | (1 << VBLANK)
- cp (1 << SERIAL)
+ cp 1 << SERIAL
ld a, SERIAL_NO_DATA_BYTE
ret z
ld a, [hl]
diff --git a/home/vcopy.asm b/home/vcopy.asm
index 3b26cf1d..904383ac 100644
--- a/home/vcopy.asm
+++ b/home/vcopy.asm
@@ -136,7 +136,7 @@ AutoBgMapTransfer::
ld h, a
ldh a, [hAutoBGTransferDest]
ld l, a
- ld de, (12 * 32)
+ ld de, 12 * 32
add hl, de
xor a ; TRANSFERTOP
jr .doTransfer
@@ -156,7 +156,7 @@ AutoBgMapTransfer::
ld h, a
ldh a, [hAutoBGTransferDest]
ld l, a
- ld de, (6 * 32)
+ ld de, 6 * 32
add hl, de
ld a, TRANSFERBOTTOM
.doTransfer
diff --git a/macros/data.asm b/macros/data.asm
index eeb3a2fd..808e920b 100644
--- a/macros/data.asm
+++ b/macros/data.asm
@@ -15,7 +15,7 @@ ENDM
; used in data/pokemon/base_stats/*.asm
MACRO tmhm
-; initialize bytes to 0
+ ; initialize bytes to 0
FOR n, (NUM_TM_HM + 7) / 8
DEF _tm{d:n} = 0
ENDR
diff --git a/macros/scripts/events.asm b/macros/scripts/events.asm
index ea67cd0a..c5b494dd 100644
--- a/macros/scripts/events.asm
+++ b/macros/scripts/events.asm
@@ -442,9 +442,13 @@ ENDM
; returns the complement of whether either event is set in Z flag
;\1 = event index 1
;\2 = event index 2
+;\3 = try to reuse a (optional)
MACRO CheckEitherEventSet
IF ((\1) / 8) == ((\2) / 8)
- ld a, [wEventFlags + ((\1) / 8)]
+ IF (_NARG < 3) || (((\1) / 8) != event_byte)
+ DEF event_byte = ((\1) / 8)
+ ld a, [wEventFlags + ((\1) / 8)]
+ ENDC
and (1 << ((\1) % 8)) | (1 << ((\2) % 8))
ELSE
; This case doesn't happen in the original ROM.
diff --git a/scripts/MtMoonB2F.asm b/scripts/MtMoonB2F.asm
index a110d877..89873526 100644
--- a/scripts/MtMoonB2F.asm
+++ b/scripts/MtMoonB2F.asm
@@ -478,8 +478,7 @@ MtMoonB2FSuperNerdText:
text_asm
CheckEvent EVENT_BEAT_MT_MOON_EXIT_SUPER_NERD
jr z, .beat_super_nerd
- ; CheckEitherEventSetReuseA EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL
- and (1 << (EVENT_GOT_DOME_FOSSIL % 8)) | (1 << (EVENT_GOT_HELIX_FOSSIL % 8))
+ CheckEitherEventSet EVENT_GOT_DOME_FOSSIL, EVENT_GOT_HELIX_FOSSIL, 1
jr nz, .got_a_fossil
ld hl, MtMoonB2fSuperNerdEachTakeOneText
call PrintText