From 18d04a44db28ff0a970e05ed350801dd39e7e570 Mon Sep 17 00:00:00 2001 From: SonikkuA-DatH <58025603+SonikkuA-DatH@users.noreply.github.com> Date: Sat, 16 Oct 2021 21:14:15 -0700 Subject: [PATCH] Fixes --- ...space-for-EWRAM-Data-for-Summary-screen.md | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/Make-space-for-EWRAM-Data-for-Summary-screen.md b/Make-space-for-EWRAM-Data-for-Summary-screen.md index 1b37d04..d9bbbfd 100644 --- a/Make-space-for-EWRAM-Data-for-Summary-screen.md +++ b/Make-space-for-EWRAM-Data-for-Summary-screen.md @@ -2,7 +2,13 @@ The summary screen in RSE is surprisingly wasteful, which for Castform in partic Thanks to ShinyDragonHunter for this -First, we'll set up **InitMonSpritesGfx_Battle** (or **static void sub_806F160** if your pret version is old) function in [src/pokemon.c](../blob/master/src/pokemon.c) to do the following +First, we'll set up this struct in [src/pokemon.c](../blob/master/src/pokemon.c) +```diff +- EWRAM_DATA static struct MonSpritesGfxManager *sMonSpritesGfxManagers[MON_SPR_GFX_MANAGERS_COUNT] = {NULL}; ++ EWRAM_DATA static struct MonSpritesGfxManager *sMonSpritesGfxManager = NULL; +``` + +Then, we'll set up **InitMonSpritesGfx_Battle** function near bottom to do the following Change this @@ -392,4 +398,27 @@ And in **static u8 LoadMonGfxAndSprite** + MonSpritesGfxManager_GetSpritePtr(B_POSITION_OPPONENT_LEFT), summary->species2, summary->pid); -``` \ No newline at end of file +``` + +With all this set, you can edit the frames used on the summary screen to whatever you want + +Going back to [src/pokemon.c](../blob/master/src/pokemon.c) + +``` +#define ALLOC_FAIL_BUFFER (1 << 0) +#define ALLOC_FAIL_STRUCT (1 << 1) +#define GFX_MANAGER_ACTIVE 0xA3 // Arbitrary value +#define GFX_MANAGER_SPR_SIZE (MON_PIC_SIZE * 4) // * 4 is unnecessary, MON_PIC_SIZE is sufficient +#define GFX_MANAGER_NUM_FRAMES 4 // Only 2 frames are needed +``` + +Change ``#define GFX_MANAGER_NUM_FRAMES 4`` to whatever value you want. 2 is typically preferred, but if you're crazy enough to add more Castform forms later, this will need to be increased to compensate added forms + +Otherwise + +```diff +- #define GFX_MANAGER_NUM_FRAMES 4 ++ #define GFX_MANAGER_NUM_FRAMES 2 +``` + +And you're done \ No newline at end of file