• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Trading Card Game 2 protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Graphics] [pokeemerald] Editing the summary (status) screen

  • 119
    Posts
    15
    Years
    In my attempt to change the Pokémon summary (or status) screen (PSS) I've run into some difficulties I can't seem to solve myself.

    When replacing the tilemaps for the respective pages of the screen, it only changes those pages partially. Some parts of the screen are changed within the code of the game, most likely in src/pokemon_summary_screen.c.

    Now there are different things the code changes, which include (1) pagination at the top of the screen; (2) showing/hiding the power/accuracy window when selecting a move; (3) changing the tiles in the moves list to accommodate for "cancel" when selecting a move, and after having selected a move; (4) various tiles in the bottom left corner of the screen on some pages (where the power/accuracy window is supposed to appear).

    Now, I do not mind the pagination as is, and I will leave what happens when selecting a move for now. What bothers me most of all is nr. 4: the bottom left corner of the tilemap is not loaded into the screen. My question therefore is: Where in the code is this triggered, and how do I disable it? I would like the entire tilemap as shown in Tilemap studio to display for each page of the PSS. This would allow me then to replace it with a graphic of my own design.

    In order to show what is happening, I replaced the original tilemaps for the PSS pages "Info", "Skills" and "Battle Moves" with fully colored pages. This is how they look like in Tilemap Studio:
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen

    And this is how they are displayed in-game:

    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen


    As you can see, for page "Info", it loads a number of specific tiles in the bottom left corner. Page "Skills" is loaded in its entirety, so that's good. This is the way I would like it to be. Page "Battle Moves" however turns the bottom left corner into transparent tiles.

    Of course, I've made an attempt at identifying the functions at work here. Here are some candidates, but in no case have I managed to turn off the abovementioned changes...

    Spoiler:

    So I hope someone has already tried to edit the summary screen and can point me in the right direction. Many thanks in advance.
     
    Update:

    By commenting out the functions ChangeTilemap and TilemapFiveMovesDisplay in pokemon_summary_screen.c as follows, I managed to turn off most of the tilemap changes that are triggered within the code: (There is a more elegant way to rewrite the code, but I'm taking the path of least resistance.)

    Spoiler:

    ChangeTilemap is called in various functions shown in the first post, which all have to do with displaying and hiding the power/accuracy window. So through those functions, the game fills the window with transparent tiles or with the actual tiles of the window. By commenting this out, the game simply displays the tilemap of the respective page, and the entire process of showing and hiding the power/accuracy window is ommitted. The PSS now looks as follows:

    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen


    However, two small artefacts remain: (1) a small tile in the bottom left corner of the first ("Info") page; (2) the blue bars at the top right corner of the battle moves screen.

    I suspected nr. 2 is not a tile change (there does not seem to be any other tilemap changing code in pokemon_summary_screen.c except for the pagination icons) but rather a palette change. Indeed, opening the respective tilemap in tilemap studio shows that region uses a different palette.
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen


    Changing all of these tiles to the primary palette resolves the blue bar issue:

    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen


    The only artefact remaining is the little green line on the first ("Info") page (nr. 1 mentioned above). It seems to have something to do with the PokeRus cured symbol (which appears at that very spot). This can be mended by commenting out the following lines in the function DrawPokerusCuredSymbol:

    Spoiler:

    Before / After:
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen


    So that's it for, this resolves my question for now and hopefully allows for a new tilemap/tileset to be inserted without the code changing how it looks like. I'm leaving this post up as documentation for other people. Of course, in some way, it's a loss to simply remove all of these animations -- it might be worth it to rework them somehow. But that's perhaps for another time.

    Second update:

    I am just going to use this thread to document my findings about the status screen. While some may know this already, it is not found anywhere online, hence me writing it down. I might turn it into a Wiki page for pokeemerald at some point.

    The PSS uses one palette file, namely graphics/interface/status_screen.pal (which is called in src/graphics.c in case you want to use a different file).

    The individual screens use 16 colors each...
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen


    ...but status_screen.pal itself actually contains 128 colors -- 8 rows of 16 colors each. Basically, its 8 palettes combined into one file. The game then toggles through the larger palette to load 16-color wide subsets. Which row is used in determined in the tilemap. If you open the tilemap in Tilemap Studio, on the left-hand side you have a tab for Palettes. Selecting that will reveal which palette each tile is assigned to.
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen


    Each row is used for a different part of the PSS. I will go through them here. If you want to change the palette(s) of the PSS, you can replace specific parts of status_screen.pal and/or change some of the code in pokemon_summary_screen.c.
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen


    Row 0:
    Used for the page 1 of the PSS, "Pokémon Info".
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen

    Spoiler:


    Row 1:
    Used for page 4 of the PSS, "Contest Moves".
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen

    Spoiler:


    Row 2:
    Used for page 2 of the PSS, "Pokémon Skills".
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen

    Spoiler:


    Row 3:
    Used for page 3 of the PSS, "Battle Moves".
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen

    Spoiler:


    Row 4:
    Used for the pagination markers at the top of the screen. Appears on all pages. The tilemap for page 1 assigns a different palette to those tiles (with palette 4 and the rest of the tilemap with palette 0) so take note of that when editing the tilemap.
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen

    Spoiler:


    Row 5:
    ???
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen


    Row 6:
    The first four colors (index 1 to 4 - index 0 is for transparency) are used for the text in the PSS. You can see some words are in black with a light gray outline, and some are in white with a dark gray outline. These correspond to index 1+2 and index 3+4 respectively.
    The red and orange (index 5 and 6) are probably used for the red text on page 1 of the PSS (nature, level met, etc.). Maybe the red is also used for the "select move" marker (red) and/or the "A" and "B" button sprites (also red).
    The light blue and darker blue (index 7 and 8) are probably used for the OT name if the OT is male and the pink and dark pink (index 9 and 10) if the OT is female ("May" in screenshot below).
    The subsequent four colors (index 11 to 14) are probably used for the gender markers (male and female respectively). It could also be that these are for the OT name and the previous four were used for the gender markers. This should be easy to check by inspecting the screenshot below in detail.
    The last color (index 15, black) is probably a filler.
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen


    Row 7:
    The first 7 colors are the same as above, i.e. all used for text. The subsequent tan and dark tan (index 7 and 8) are actually used for the Pokémon (nick-) name in case the Pokémon is shiny (see example below). The reds and the white at the end, I'm not sure about.
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
    [PokeCommunity.com] [pokeemerald] Editing the summary (status) screen
     
    Last edited:
    Code:
    static void ChangeTilemap(const struct TilemapCtrl *unkStruct, u16 *dest, u8 c, bool8 d)
    {
        u16 i;
        u16 *alloced = Alloc(unkStruct->field_6 * 2 * unkStruct->field_7);
        CpuFill16(unkStruct->field_4, alloced, unkStruct->field_6 * 2 * unkStruct->field_7);
        // if (unkStruct->field_6 != c)
        // {
            // if (!d)
            // {
                // for (i = 0; i < unkStruct->field_7; i++)
                    // CpuCopy16(&unkStruct->gfx[c + unkStruct->field_6 * i], &alloced[unkStruct->field_6 * i], (unkStruct->field_6 - c) * 2);
            // }
            // else
            // {
                // for (i = 0; i < unkStruct->field_7; i++)
                    // CpuCopy16(&unkStruct->gfx[unkStruct->field_6 * i], &alloced[c + unkStruct->field_6 * i], (unkStruct->field_6 - c) * 2);
            // }
        // }
    
        // for (i = 0; i < unkStruct->field_7; i++)
            // CpuCopy16(&alloced[unkStruct->field_6 * i], &dest[(unkStruct->field_9 + i) * 32 + unkStruct->field_8], unkStruct->field_6 * 2);
    
        // Free(alloced);
    }

    You might want to get rid of the rest of this function too. Currently it's allocating memory but not freeing it which could cause problems.
     
    Hi,

    These informations are really interesting, thank you! I have been trying to modify the summary screen (add more, editing bg of old ones), but i got stucked with all of that functions and these is the best information i got until now. Did you get your summary screen done?
     
    This is really great info, I've been digging into various pieces in a similar way! I noticed you have the P/S Split Icons; did you add those yourself or are you using one of the battle engine upgrades? I've implemented a P/S split but would also love to get the icons showing.
     
    This is really great info, I've been digging into various pieces in a similar way! I noticed you have the P/S Split Icons; did you add those yourself or are you using one of the battle engine upgrades? I've implemented a P/S split but would also love to get the icons showing.
    They do seem to be using the battle_engine, which includes the icons for the split.
    You could clone it and git grep B_SHOW_SPLIT_ICON to find out how they're implemented.
     
    They do seem to be using the battle_engine, which includes the icons for the split.
    You could clone it and git grep B_SHOW_SPLIT_ICON to find out how they're implemented.

    Didn't realize I forgot to respond to this, but thanks! I did just that and was able to implement PS/S icons into the system that's used in the standard version of the PS/S tutorial.
     
    Back
    Top