From b464fdbbde0ef50e816d203252ecb1f4d76189d4 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 13 Feb 2025 15:13:04 -0500 Subject: [PATCH 1/5] Fix collision comparison in PlayerNotOnBikeMoving --- src/field_player_avatar.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 1f0708af22..6a1df01b47 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -620,9 +620,27 @@ static void PlayerNotOnBikeMoving(u8 direction, u16 heldKeys) } else { - u8 adjustedCollision = collision - COLLISION_STOP_SURFING; - if (adjustedCollision > 3) + // Player collided with something. Certain collisions have special handling that precludes the normal collision effect. + // COLLISION_STOP_SURFING and COLLISION_PUSHED_BOULDER's effects are started by CheckForObjectEventCollision. + // COLLISION_LEDGE_JUMP's effect is handled further up in this function, so it will never reach this point. + // COLLISION_ROTATING_GATE is unusual however, this was probably included by mistake. When the player walks into a + // rotating gate that cannot rotate there is no additional handling, it's just a regular collision. Its exclusion here + // means that the player avatar won't update if they encounter this kind of collision. This has two noticeable effects: + // - Colliding with it head-on stops the player dead, rather than playing the walking animation and playing a bump sound effect + // - Colliding with it by changing direction won't turn the player avatar, their walking animation will just speed up. +#ifdef BUGFIX + if (collision != COLLISION_STOP_SURFING + && collision != COLLISION_LEDGE_JUMP + && collision != COLLISION_PUSHED_BOULDER) +#else + if (collision != COLLISION_STOP_SURFING + && collision != COLLISION_LEDGE_JUMP + && collision != COLLISION_PUSHED_BOULDER + && collision != COLLISION_ROTATING_GATE) +#endif + { PlayerNotOnBikeCollide(direction); + } return; } } From e2e3438674f1c12df631ba13c9df05ddc83653d0 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Fri, 20 Jun 2025 15:33:12 -0400 Subject: [PATCH 2/5] Add missing uses of LOCALID_NONE for trainerbattle --- asm/macros/event.inc | 18 +++++++++--------- .../scripts.inc | 2 +- .../MossdeepCity_SpaceCenter_2F/scripts.inc | 4 ++-- data/scripts/trainer_hill.inc | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/asm/macros/event.inc b/asm/macros/event.inc index 6f17460d43..797d549dc9 100644 --- a/asm/macros/event.inc +++ b/asm/macros/event.inc @@ -747,11 +747,11 @@ @ When used with an event script, you can also pass in an optional flag to disable music .macro trainerbattle_single trainer:req, intro_text:req, lose_text:req, event_script=FALSE, music=TRUE .if \event_script == FALSE - trainerbattle TRAINER_BATTLE_SINGLE, \trainer, 0, \intro_text, \lose_text + trainerbattle TRAINER_BATTLE_SINGLE, \trainer, LOCALID_NONE, \intro_text, \lose_text .elseif \music == TRUE - trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, \trainer, 0, \intro_text, \lose_text, \event_script + trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT, \trainer, LOCALID_NONE, \intro_text, \lose_text, \event_script .else - trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC, \trainer, 0, \intro_text, \lose_text, \event_script + trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT_NO_MUSIC, \trainer, LOCALID_NONE, \intro_text, \lose_text, \event_script .endif .endm @@ -759,27 +759,27 @@ @ and an optional event script. When used with an event script you can pass in an optional flag to disable music .macro trainerbattle_double trainer:req, intro_text:req, lose_text:req, not_enough_pkmn_text:req, event_script=FALSE, music=TRUE .if \event_script == FALSE - trainerbattle TRAINER_BATTLE_DOUBLE, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text + trainerbattle TRAINER_BATTLE_DOUBLE, \trainer, LOCALID_NONE, \intro_text, \lose_text, \not_enough_pkmn_text .elseif \music == TRUE - trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text, \event_script + trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE, \trainer, LOCALID_NONE, \intro_text, \lose_text, \not_enough_pkmn_text, \event_script .else - trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text, \event_script + trainerbattle TRAINER_BATTLE_CONTINUE_SCRIPT_DOUBLE_NO_MUSIC, \trainer, LOCALID_NONE, \intro_text, \lose_text, \not_enough_pkmn_text, \event_script .endif .endm @ Starts a rematch battle. Takes a trainer, intro text and loss text .macro trainerbattle_rematch trainer:req, intro_text:req, lose_text:req - trainerbattle TRAINER_BATTLE_REMATCH, \trainer, 0, \intro_text, \lose_text + trainerbattle TRAINER_BATTLE_REMATCH, \trainer, LOCALID_NONE, \intro_text, \lose_text .endm @ Starts a rematch double battle. Takes a trainer, intro text, loss text, and text for when you have too few pokemon .macro trainerbattle_rematch_double trainer:req, intro_text:req, lose_text:req, not_enough_pkmn_text:req - trainerbattle TRAINER_BATTLE_REMATCH_DOUBLE, \trainer, 0, \intro_text, \lose_text, \not_enough_pkmn_text + trainerbattle TRAINER_BATTLE_REMATCH_DOUBLE, \trainer, LOCALID_NONE, \intro_text, \lose_text, \not_enough_pkmn_text .endm @ Starts a trainer battle, skipping intro text. Takes a trainer and loss text .macro trainerbattle_no_intro trainer:req, lose_text:req - trainerbattle TRAINER_BATTLE_SINGLE_NO_INTRO_TEXT, \trainer, 0, \lose_text + trainerbattle TRAINER_BATTLE_SINGLE_NO_INTRO_TEXT, \trainer, LOCALID_NONE, \lose_text .endm diff --git a/data/maps/BattleFrontier_BattlePyramidFloor/scripts.inc b/data/maps/BattleFrontier_BattlePyramidFloor/scripts.inc index ba9d996706..021f373be2 100644 --- a/data/maps/BattleFrontier_BattlePyramidFloor/scripts.inc +++ b/data/maps/BattleFrontier_BattlePyramidFloor/scripts.inc @@ -105,7 +105,7 @@ BattlePyramid_WarpToTop:: @ TRAINER_PHILLIP is used as a placeholder BattlePyramid_TrainerBattle:: - trainerbattle TRAINER_BATTLE_PYRAMID, TRAINER_PHILLIP, 0, BattleFacility_TrainerBattle_PlaceholderText, BattleFacility_TrainerBattle_PlaceholderText + trainerbattle TRAINER_BATTLE_PYRAMID, TRAINER_PHILLIP, LOCALID_NONE, BattleFacility_TrainerBattle_PlaceholderText, BattleFacility_TrainerBattle_PlaceholderText pyramid_showhint waitmessage waitbuttonpress diff --git a/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc b/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc index cbb9cba9af..81ae88e42f 100644 --- a/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc +++ b/data/maps/MossdeepCity_SpaceCenter_2F/scripts.inc @@ -329,11 +329,11 @@ MossdeepCity_SpaceCenter_2F_EventScript_StevenFacePlayerWest:: return MossdeepCity_SpaceCenter_2F_EventScript_MaxieTrainer:: - trainerbattle TRAINER_BATTLE_SET_TRAINER_A, TRAINER_MAXIE_MOSSDEEP, 0, MossdeepCity_SpaceCenter_2F_Text_JustWantToExpandLand, MossdeepCity_SpaceCenter_2F_Text_JustWantToExpandLand + trainerbattle TRAINER_BATTLE_SET_TRAINER_A, TRAINER_MAXIE_MOSSDEEP, LOCALID_NONE, MossdeepCity_SpaceCenter_2F_Text_JustWantToExpandLand, MossdeepCity_SpaceCenter_2F_Text_JustWantToExpandLand end MossdeepCity_SpaceCenter_2F_EventScript_TabithaTrainer:: - trainerbattle TRAINER_BATTLE_SET_TRAINER_B, TRAINER_TABITHA_MOSSDEEP, 0, MossdeepCity_SpaceCenter_Text_TabithaDefeat, MossdeepCity_SpaceCenter_Text_TabithaDefeat + trainerbattle TRAINER_BATTLE_SET_TRAINER_B, TRAINER_TABITHA_MOSSDEEP, LOCALID_NONE, MossdeepCity_SpaceCenter_Text_TabithaDefeat, MossdeepCity_SpaceCenter_Text_TabithaDefeat end MossdeepCity_SpaceCenter_2F_EventScript_RivalRayquazaCall:: diff --git a/data/scripts/trainer_hill.inc b/data/scripts/trainer_hill.inc index 04bbe05e5a..d51d1f5098 100644 --- a/data/scripts/trainer_hill.inc +++ b/data/scripts/trainer_hill.inc @@ -60,7 +60,7 @@ TrainerHill_1F_Movement_SetInvisible:: @ TRAINER_PHILLIP is an actual Trainer on the SS Tidal, but is used as a placeholder here TrainerHill_EventScript_TrainerBattle:: - trainerbattle TRAINER_BATTLE_HILL, TRAINER_PHILLIP, 0, BattleFacility_TrainerBattle_PlaceholderText, BattleFacility_TrainerBattle_PlaceholderText + trainerbattle TRAINER_BATTLE_HILL, TRAINER_PHILLIP, LOCALID_NONE, BattleFacility_TrainerBattle_PlaceholderText, BattleFacility_TrainerBattle_PlaceholderText trainerhill_postbattletext waitmessage waitbuttonpress From 01fc7e76efc6c8e6790e9585fa6e7056a8841478 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sun, 22 Jun 2025 11:26:31 +0200 Subject: [PATCH 3/5] Fix wrong keep temps files directory in makefile --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index f4aecdc77b..354c335235 100644 --- a/Makefile +++ b/Makefile @@ -313,10 +313,10 @@ ifneq ($(KEEP_TEMPS),1) @echo "$(CC1) -o $@ $<" @$(CPP) $(CPPFLAGS) $< | $(PREPROC) -i $< charmap.txt | $(CC1) $(CFLAGS) -o - - | cat - <(echo -e ".text\n\t.align\t2, 0") | $(AS) $(ASFLAGS) -o $@ - else - @$(CPP) $(CPPFLAGS) $< -o $*.i - @$(PREPROC) $*.i charmap.txt | $(CC1) $(CFLAGS) -o $*.s - @echo -e ".text\n\t.align\t2, 0\n" >> $*.s - $(AS) $(ASFLAGS) -o $@ $*.s + @$(CPP) $(CPPFLAGS) $< -o $(C_BUILDDIR)/$*.i + @$(PREPROC) $(C_BUILDDIR)/$*.i charmap.txt | $(CC1) $(CFLAGS) -o $(C_BUILDDIR)/$*.s + @echo -e ".text\n\t.align\t2, 0\n" >> $(C_BUILDDIR)/$*.s + $(AS) $(ASFLAGS) -o $@ $(C_BUILDDIR)/$*.s endif $(C_BUILDDIR)/%.d: $(C_SUBDIR)/%.c From 53f8ae11ff3ccc5333cc70d581b2ac5fd4853883 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 23 Jun 2025 01:48:37 +0200 Subject: [PATCH 4/5] Move gTradePlatform_Tilemap to header (#2088) --- include/trade.h | 1 + src/egg_hatch.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/trade.h b/include/trade.h index 33191f0ac6..24de69b036 100644 --- a/include/trade.h +++ b/include/trade.h @@ -7,6 +7,7 @@ extern struct Mail gTradeMail[PARTY_SIZE]; extern u8 gSelectedTradeMonPositions[2]; +extern const u16 gTradePlatform_Tilemap[]; extern const struct WindowTemplate gTradeEvolutionSceneYesNoWindowTemplate; s32 GetGameProgressForLinkTrade(void); diff --git a/src/egg_hatch.c b/src/egg_hatch.c index abf1aff841..5aa955d7e9 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -33,6 +33,7 @@ #include "naming_screen.h" #include "pokemon_storage_system.h" #include "field_screen_effect.h" +#include "trade.h" #include "data.h" #include "battle.h" // to get rid of later #include "constants/rgb.h" @@ -62,7 +63,6 @@ struct EggHatchData u8 textColor[3]; }; -extern const u32 gTradePlatform_Tilemap[]; extern const u8 gText_HatchedFromEgg[]; extern const u8 gText_NicknameHatchPrompt[]; From e1b83d605698f22bee4ebcb1717378a1a10f3717 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 23 Jun 2025 21:31:18 +0200 Subject: [PATCH 5/5] Match graphics declarations with externs (#2089) --- include/graphics.h | 88 ++++++++++++++++----------------- src/data/graphics/intro_scene.h | 2 +- src/graphics.c | 11 +++-- src/intro.c | 29 ++++++----- src/mail.c | 4 +- src/naming_screen.c | 2 +- 6 files changed, 70 insertions(+), 66 deletions(-) diff --git a/include/graphics.h b/include/graphics.h index 7f0eb7bda5..14f2f5e744 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -2,7 +2,7 @@ #define GUARD_GRAPHICS_H // overworld -extern const u32 gMessageBox_Gfx[]; +extern const u8 gMessageBox_Gfx[]; extern const u16 gMessageBox_Pal[]; // pokeballs @@ -3286,17 +3286,17 @@ extern const u32 gBattleEnvironmentPalette_StadiumWallace[]; extern const u32 gPokedexInterface_Gfx[]; extern const u16 gPokedexBgHoenn_Pal[]; extern const u32 gPokedexMenu_Gfx[]; -extern const u8 gPokedexList_Tilemap[]; -extern const u8 gPokedexListUnderlay_Tilemap[]; -extern const u8 gPokedexStartMenuMain_Tilemap[]; -extern const u8 gPokedexStartMenuSearchResults_Tilemap[]; +extern const u32 gPokedexList_Tilemap[]; +extern const u32 gPokedexListUnderlay_Tilemap[]; +extern const u32 gPokedexStartMenuMain_Tilemap[]; +extern const u32 gPokedexStartMenuSearchResults_Tilemap[]; extern const u16 gPokedexSearchResults_Pal[]; extern const u16 gPokedexBgNational_Pal[]; -extern const u8 gPokedexInfoScreen_Tilemap[]; -extern const u8 gPokedexCryScreen_Tilemap[]; -extern const u8 gPokedexSizeScreen_Tilemap[]; -extern const u8 gPokedexScreenSelectBarMain_Tilemap[]; -extern const u8 gPokedexScreenSelectBarSubmenu_Tilemap[]; +extern const u32 gPokedexInfoScreen_Tilemap[]; +extern const u32 gPokedexCryScreen_Tilemap[]; +extern const u32 gPokedexSizeScreen_Tilemap[]; +extern const u32 gPokedexScreenSelectBarMain_Tilemap[]; +extern const u32 gPokedexScreenSelectBarSubmenu_Tilemap[]; extern const u16 gPokedexCaughtScreen_Pal[]; extern const u32 gPokedexSearchMenu_Gfx[]; extern const u32 gPokedexSearchMenuHoenn_Tilemap[]; @@ -3893,7 +3893,7 @@ extern const u32 gIntroGroudon_Gfx[]; extern const u32 gIntroGroudon_Tilemap[]; extern const u32 gIntroLegendBg_Gfx[]; extern const u32 gIntroGroudonBg_Tilemap[]; -extern const u8 ALIGNED(2) gIntro3Bg_Pal[0x200]; +extern const u16 gIntro3Bg_Pal[16][16]; extern const u32 gIntroKyogre_Gfx[]; extern const u32 gIntroKyogre_Tilemap[]; extern const u32 gIntroKyogreBg_Tilemap[]; @@ -4066,9 +4066,9 @@ extern const u8 gHealthboxElementsGfxTable[][32]; extern const u16 gNamingScreenMenu_Pal[6][16]; extern const u32 gNamingScreenMenu_Gfx[]; extern const u32 gNamingScreenBackground_Tilemap[]; -extern const u8 gNamingScreenKeyboardUpper_Tilemap[]; -extern const u8 gNamingScreenKeyboardLower_Tilemap[]; -extern const u8 gNamingScreenKeyboardSymbols_Tilemap[]; +extern const u32 gNamingScreenKeyboardUpper_Tilemap[]; +extern const u32 gNamingScreenKeyboardLower_Tilemap[]; +extern const u32 gNamingScreenKeyboardSymbols_Tilemap[]; extern const u32 gNamingScreenPageSwapFrame_Gfx[]; extern const u32 gNamingScreenBackButton_Gfx[]; extern const u32 gNamingScreenOKButton_Gfx[]; @@ -4791,7 +4791,7 @@ extern const u32 gContestAudienceTilemap[]; extern const u32 gContestInterfaceAudiencePalette[]; extern const u32 gContestInterfaceTilemap[]; extern const u32 gContestCurtainTilemap[]; -extern const u32 gContestSliderHeart_Gfx[]; +extern const u8 gContestSliderHeart_Gfx[]; extern const u32 gContestNextTurnGfx[]; extern const u16 gContestPal[]; extern const u32 gContestFaces_Gfx[]; @@ -4817,11 +4817,11 @@ extern const u16 gUsePokeblockGraph_Pal[]; extern const u16 gUsePokeblockNatureWin_Pal[]; // Berry blender -extern const u32 gBerryBlenderPlayerArrow_Gfx[]; -extern const u32 gBerryBlenderStart_Gfx[]; -extern const u32 gBerryBlenderScoreSymbols_Gfx[]; -extern const u32 gBerryBlenderParticles_Gfx[]; -extern const u32 gBerryBlenderCountdownNumbers_Gfx[]; +extern const u8 gBerryBlenderPlayerArrow_Gfx[]; +extern const u8 gBerryBlenderStart_Gfx[]; +extern const u8 gBerryBlenderScoreSymbols_Gfx[]; +extern const u8 gBerryBlenderParticles_Gfx[]; +extern const u8 gBerryBlenderCountdownNumbers_Gfx[]; extern const u16 gBerryBlenderMiscPalette[]; extern const u16 gBerryBlenderArrowPalette[]; extern const u32 gBerryBlenderCenter_Gfx[]; @@ -5042,30 +5042,30 @@ extern const u16 gMailPalette_Tropic[]; extern const u16 gMailPalette_Dream[]; extern const u16 gMailPalette_Fab[]; extern const u16 gMailPalette_Retro[]; -extern const u8 gMailTiles_Orange[]; -extern const u8 gMailTilemap_Orange[]; -extern const u8 gMailTiles_Harbor[]; -extern const u8 gMailTilemap_Harbor[]; -extern const u8 gMailTiles_Glitter[]; -extern const u8 gMailTilemap_Glitter[]; -extern const u8 gMailTiles_Mech[]; -extern const u8 gMailTilemap_Mech[]; -extern const u8 gMailTiles_Wood[]; -extern const u8 gMailTilemap_Wood[]; -extern const u8 gMailTiles_Wave[]; -extern const u8 gMailTilemap_Wave[]; -extern const u8 gMailTiles_Bead[]; -extern const u8 gMailTilemap_Bead[]; -extern const u8 gMailTiles_Shadow[]; -extern const u8 gMailTilemap_Shadow[]; -extern const u8 gMailTiles_Tropic[]; -extern const u8 gMailTilemap_Tropic[]; -extern const u8 gMailTiles_Dream[]; -extern const u8 gMailTilemap_Dream[]; -extern const u8 gMailTiles_Fab[]; -extern const u8 gMailTilemap_Fab[]; -extern const u8 gMailTiles_Retro[]; -extern const u8 gMailTilemap_Retro[]; +extern const u32 gMailTiles_Orange[]; +extern const u32 gMailTilemap_Orange[]; +extern const u32 gMailTiles_Harbor[]; +extern const u32 gMailTilemap_Harbor[]; +extern const u32 gMailTiles_Glitter[]; +extern const u32 gMailTilemap_Glitter[]; +extern const u32 gMailTiles_Mech[]; +extern const u32 gMailTilemap_Mech[]; +extern const u32 gMailTiles_Wood[]; +extern const u32 gMailTilemap_Wood[]; +extern const u32 gMailTiles_Wave[]; +extern const u32 gMailTilemap_Wave[]; +extern const u32 gMailTiles_Bead[]; +extern const u32 gMailTilemap_Bead[]; +extern const u32 gMailTiles_Shadow[]; +extern const u32 gMailTilemap_Shadow[]; +extern const u32 gMailTiles_Tropic[]; +extern const u32 gMailTilemap_Tropic[]; +extern const u32 gMailTiles_Dream[]; +extern const u32 gMailTilemap_Dream[]; +extern const u32 gMailTiles_Fab[]; +extern const u32 gMailTilemap_Fab[]; +extern const u32 gMailTiles_Retro[]; +extern const u32 gMailTilemap_Retro[]; extern const u8 gMonMarkingsMenu_Gfx[]; extern const u16 gMonMarkingsMenu_Pal[]; diff --git a/src/data/graphics/intro_scene.h b/src/data/graphics/intro_scene.h index cb7706c9a3..8b17b00346 100644 --- a/src/data/graphics/intro_scene.h +++ b/src/data/graphics/intro_scene.h @@ -1,6 +1,6 @@ const u16 gIntroGameFreakTextFade_Pal[] = INCBIN_U16("graphics/intro/scene_1/text.gbapal"); // game freak text blue fade const u16 gIntroPlayer_Pal[] = INCBIN_U16("graphics/intro/scene_2/player.gbapal"); -const u16 gIntro3Bg_Pal[] = INCBIN_U16("graphics/intro/scene_3/bg.gbapal"); +const u16 gIntro3Bg_Pal[16][16] = INCBIN_U16("graphics/intro/scene_3/bg.gbapal"); const u16 gIntroVolbeat_Pal[] = INCBIN_U16("graphics/intro/scene_2/volbeat.gbapal"); const u16 gIntroTorchic_Pal[] = INCBIN_U16("graphics/intro/scene_2/torchic.gbapal"); const u16 gIntroManectric_Pal[] = INCBIN_U16("graphics/intro/scene_2/manectric.gbapal"); diff --git a/src/graphics.c b/src/graphics.c index 9179b0fd7d..3d7f2fa08b 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1,4 +1,5 @@ #include "global.h" +#include "graphics.h" const u32 gBattleTextboxTiles[] = INCBIN_U32("graphics/battle_interface/textbox.4bpp.lz"); const u32 gBattleTextboxPalette[] = INCBIN_U32("graphics/battle_interface/textbox.gbapal.lz"); @@ -354,7 +355,7 @@ const u16 gBattleInterface_BallStatusBarPal[] = INCBIN_U16("graphics/battle_inte const u16 gBattleInterface_BallDisplayPal[] = INCBIN_U16("graphics/battle_interface/ball_display.gbapal"); -const u8 gHealthboxElementsGfxTable[] = INCBIN_U8("graphics/battle_interface/hpbar.4bpp", +const u8 gHealthboxElementsGfxTable[][32] = INCBIN_U8("graphics/battle_interface/hpbar.4bpp", "graphics/battle_interface/expbar.4bpp", "graphics/battle_interface/status.4bpp", "graphics/battle_interface/misc.4bpp", @@ -971,7 +972,7 @@ const u16 gTilesetAnims_BattleDomePals0_3[] = INCBIN_U16("graphics/battle_fronti static const u16 sUnused0[] = {0x13F, 0x119, 0x113, 0x10E}; -const u16 gBattlePyramidFloor_Pal[] = INCBIN_U16("graphics/battle_frontier/pyramid_floor.gbapal"); +const u16 gBattlePyramidFloor_Pal[][16] = INCBIN_U16("graphics/battle_frontier/pyramid_floor.gbapal"); const u32 gMultiBattleIntroBg_Opponent_Tilemap[] = INCBIN_U32("graphics/battle_frontier/multi_battle_intro_bg_opponent.bin.lz"); const u32 gMultiBattleIntroBg_Player_Tilemap[] = INCBIN_U32("graphics/battle_frontier/multi_battle_intro_bg_player.bin.lz"); @@ -1514,12 +1515,12 @@ const u16 gTitleScreenPressStartPal[] = INCBIN_U16("graphics/title_screen/p const u32 gTitleScreenPressStartGfx[] = INCBIN_U32("graphics/title_screen/press_start.4bpp.lz"); const u32 gTitleScreenPokemonLogoTilemap[] = INCBIN_U32("graphics/title_screen/pokemon_logo.bin.lz"); -const u16 gFrontierPassBg_Pal[] = INCBIN_U16("graphics/frontier_pass/bg.gbapal"); // 8 x 16 +const u16 gFrontierPassBg_Pal[][16] = INCBIN_U16("graphics/frontier_pass/bg.gbapal"); // 8 x 16 const u32 gFrontierPassBg_Gfx[] = INCBIN_U32("graphics/frontier_pass/bg.4bpp.lz"); const u32 gFrontierPassMapAndCard_Gfx[] = INCBIN_U32("graphics/frontier_pass/map_and_card.8bpp.lz"); const u32 gFrontierPassBg_Tilemap[] = INCBIN_U32("graphics/frontier_pass/bg.bin.lz"); -const u16 gFrontierPassCancelButton_Tilemap[] = INCBIN_U16("graphics/frontier_pass/cancel.bin"); -const u16 gFrontierPassCancelButtonHighlighted_Tilemap[] = INCBIN_U16("graphics/frontier_pass/cancel_highlighted.bin"); +const u32 gFrontierPassCancelButton_Tilemap[] = INCBIN_U32("graphics/frontier_pass/cancel.bin"); +const u32 gFrontierPassCancelButtonHighlighted_Tilemap[] = INCBIN_U32("graphics/frontier_pass/cancel_highlighted.bin"); // Berry Crush const u16 gBerryCrush_Crusher_Pal[] = INCBIN_U16("graphics/berry_crush/crusher.gbapal"); diff --git a/src/intro.c b/src/intro.c index 549acc4b7d..169ef002a6 100644 --- a/src/intro.c +++ b/src/intro.c @@ -1866,12 +1866,15 @@ static void Task_Scene3_StartGroudon(u8 taskId) #define tTrigIdx data[6] // Re-used #define tPalIdx data[7] +// Treats gIntro3Bg_Pal as u8* and iterates by 1 +#define INTRO3_RAW_PTR(palId)(((void *) &gIntro3Bg_Pal) + palId) + static void Task_Scene3_Groudon(u8 taskId) { s16 *data = gTasks[taskId].data; tTimer++; - if ((u16)(tState - 1) < 7 && tTimer % 2 == 0) + if ((tState >= 1 && tState <= 7) && tTimer % 2 == 0) tYShake ^= 3; PanFadeAndZoomScreen(tScreenX, tScreenY + tYShake, tZoom, 0); switch (tState) @@ -1890,7 +1893,7 @@ static void Task_Scene3_Groudon(u8 taskId) if (--tDelay == 0) { tDelay = 2; - CpuCopy16(&gIntro3Bg_Pal[tPalIdx], &gPlttBufferFaded[BG_PLTT_ID(1) + 15], PLTT_SIZEOF(1)); + CpuCopy16(INTRO3_RAW_PTR(tPalIdx), &gPlttBufferFaded[BG_PLTT_ID(1) + 15], PLTT_SIZEOF(1)); tPalIdx += 2; if (tPalIdx == 0x1EC) tState++; @@ -1907,7 +1910,7 @@ static void Task_Scene3_Groudon(u8 taskId) if (--tDelay == 0) { tDelay = 2; - CpuCopy16(&gIntro3Bg_Pal[tPalIdx], &gPlttBufferFaded[BG_PLTT_ID(1) + 15], PLTT_SIZEOF(1)); + CpuCopy16(INTRO3_RAW_PTR(tPalIdx), &gPlttBufferFaded[BG_PLTT_ID(1) + 15], PLTT_SIZEOF(1)); tPalIdx -= 2; if (tPalIdx == 0x1E0) { @@ -2149,7 +2152,7 @@ static void Task_Scene3_Kyogre(u8 taskId) if (--tDelay == 0) { tDelay = 4; - CpuCopy16(&gIntro3Bg_Pal[tPalIdx], &gPlttBufferFaded[BG_PLTT_ID(2) + 15], PLTT_SIZEOF(1)); + CpuCopy16(INTRO3_RAW_PTR(tPalIdx), &gPlttBufferFaded[BG_PLTT_ID(2) + 15], PLTT_SIZEOF(1)); tPalIdx -= 2; if (tPalIdx == 0x1E0) tState++; @@ -2167,7 +2170,7 @@ static void Task_Scene3_Kyogre(u8 taskId) if (--tDelay == 0) { tDelay = 4; - CpuCopy16(&gIntro3Bg_Pal[tPalIdx], &gPlttBufferFaded[BG_PLTT_ID(2) + 15], PLTT_SIZEOF(1)); + CpuCopy16(INTRO3_RAW_PTR(tPalIdx), &gPlttBufferFaded[BG_PLTT_ID(2) + 15], PLTT_SIZEOF(1)); tPalIdx += 2; if (tPalIdx == 0x1EE) { @@ -2498,7 +2501,7 @@ static void SpriteCB_Lightning(struct Sprite *sprite) sprite->sPalIdx = 0x1C2; sprite->sState++; case 1: - CpuCopy16(&gIntro3Bg_Pal[sprite->sPalIdx], &gPlttBufferFaded[BG_PLTT_ID(5) + 13], PLTT_SIZEOF(1)); + CpuCopy16(INTRO3_RAW_PTR(sprite->sPalIdx), &gPlttBufferFaded[BG_PLTT_ID(5) + 13], PLTT_SIZEOF(1)); sprite->sPalIdx += 2; if (sprite->sPalIdx != 0x1CE) break; @@ -2509,7 +2512,7 @@ static void SpriteCB_Lightning(struct Sprite *sprite) if (--sprite->sDelay == 0) { sprite->sDelay = 4; - CpuCopy16(&gIntro3Bg_Pal[sprite->sPalIdx], &gPlttBufferFaded[BG_PLTT_ID(5) + 13], PLTT_SIZEOF(1)); + CpuCopy16(INTRO3_RAW_PTR(sprite->sPalIdx), &gPlttBufferFaded[BG_PLTT_ID(5) + 13], PLTT_SIZEOF(1)); sprite->sPalIdx -= 2; if (sprite->sPalIdx == 0x1C0) DestroySprite(sprite); @@ -2612,7 +2615,7 @@ static void Task_RayquazaAttack(u8 taskId) case 0: if ((data[2] & 1) != 0) { - CpuCopy16(&gIntro3Bg_Pal[0x1A2 + data[1] * 2], &gPlttBufferFaded[BG_PLTT_ID(5) + 14], PLTT_SIZEOF(1)); + CpuCopy16(INTRO3_RAW_PTR(0x1A2 + data[1] * 2), &gPlttBufferFaded[BG_PLTT_ID(5) + 14], PLTT_SIZEOF(1)); data[1]++; } if (data[1] == 6) @@ -2627,7 +2630,7 @@ static void Task_RayquazaAttack(u8 taskId) { if ((data[2] & 1) != 0) { - CpuCopy16(&gIntro3Bg_Pal[0x1A2 + data[1] * 2], &gPlttBufferFaded[BG_PLTT_ID(5) + 8], PLTT_SIZEOF(1)); + CpuCopy16(INTRO3_RAW_PTR(0x1A2 + data[1] * 2), &gPlttBufferFaded[BG_PLTT_ID(5) + 8], PLTT_SIZEOF(1)); data[1]++; } if (data[1] == 6) @@ -2646,7 +2649,7 @@ static void Task_RayquazaAttack(u8 taskId) { if ((data[2] & 1) != 0) { - CpuCopy16(&gIntro3Bg_Pal[0x182 + data[1] * 2], &gPlttBufferFaded[BG_PLTT_ID(5) + 12], PLTT_SIZEOF(1)); + CpuCopy16(INTRO3_RAW_PTR(0x182 + data[1] * 2), &gPlttBufferFaded[BG_PLTT_ID(5) + 12], PLTT_SIZEOF(1)); data[1]++; } if (data[1] == 6) @@ -2670,9 +2673,9 @@ static void Task_RayquazaAttack(u8 taskId) if (--data[3] != 0) { BlendPalette(BG_PLTT_ID(5), 16, data[3], RGB(9, 10, 10)); - CpuCopy16(&gIntro3Bg_Pal[428], &gPlttBufferFaded[BG_PLTT_ID(5) + 14], PLTT_SIZEOF(1)); - CpuCopy16(&gIntro3Bg_Pal[428], &gPlttBufferFaded[BG_PLTT_ID(5) + 8], PLTT_SIZEOF(1)); - CpuCopy16(&gIntro3Bg_Pal[396], &gPlttBufferFaded[BG_PLTT_ID(5) + 12], PLTT_SIZEOF(1)); + CpuCopy16(INTRO3_RAW_PTR(428), &gPlttBufferFaded[BG_PLTT_ID(5) + 14], PLTT_SIZEOF(1)); + CpuCopy16(INTRO3_RAW_PTR(428), &gPlttBufferFaded[BG_PLTT_ID(5) + 8], PLTT_SIZEOF(1)); + CpuCopy16(INTRO3_RAW_PTR(396), &gPlttBufferFaded[BG_PLTT_ID(5) + 12], PLTT_SIZEOF(1)); } else { diff --git a/src/mail.c b/src/mail.c index 424a286f3f..e1aaa66873 100644 --- a/src/mail.c +++ b/src/mail.c @@ -48,8 +48,8 @@ struct MailLayout struct MailGraphics { const u16 *palette; - const u8 *tiles; - const u8 *tileMap; + const u32 *tiles; + const u32 *tileMap; u32 unused; u16 textColor; u16 textShadow; diff --git a/src/naming_screen.c b/src/naming_screen.c index d8ae7ccd4d..f7f599f5b9 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1959,7 +1959,7 @@ static void PrintKeyboardKeys(u8 window, u8 page) PutWindowTilemap(window); } -static const u8 *const sNextKeyboardPageTilemaps[] = +static const u32 *const sNextKeyboardPageTilemaps[] = { [KBPAGE_SYMBOLS] = gNamingScreenKeyboardUpper_Tilemap, [KBPAGE_LETTERS_UPPER] = gNamingScreenKeyboardLower_Tilemap, // lower