HGSS Summary Screen + How to Make a Summary Screen

Started by Z-nogyroP December 1st, 2020 8:08 PM
  • 11013 views
  • 15 replies
Age 22
Female
Seen 2 Weeks Ago
Posted July 26th, 2023
106 posts
9.4 Years



So right now, if you want a summary screen that's not the default FR one, you have to use the BW-styled one. But that's closed source, and has painfully little documentation; if it's not already compatible with your hack, you're out of luck. And thus I bring this. And also an extensive, painful documentation of every change you'll need in order to make your own, or to successfully install this.

To add this to your hack without using the patch, you'll need UNLZ-GBA, APE, and a hex editor. For as much as I like HMA, I only used it to insert the EXP and HP bars; while its image insertion techniques are convenient, they're a bit incompatible with what you need to do for this. I used HxD. If you want to make your own summary screen or edit the graphics of this one, you'll also need Sphere Editor, TileMapStudio, and an indexer like IrfanView.

How to insert:
Spoiler:
The file I link below contains an indexed tileset, seven tilemaps, and a tileset maker, plus the HP and EXP bar graphics. First, crack open UNLZ, and go to the image at 0x08E9A460, somewhere in the neighbourhood of image 1970. This is the original tileset for the summary screen. Import this tileset into UNLZ, hit Write to ROM, and ONLY check off "Export Image." This specific tileset is smaller than the original, so you can safely overwrite the original, but if you feel like putting it somewhere else, that's okay too. Just remember to repoint everything to the new location.

The palette for the summary screen is at 0x08E9B310. Open up APE and import the palette file included in the download at that location. Again, no need to repoint.

Next, the seven tilemaps. You'll need to insert each of these into free space using UNLZ's Load RAW function (again, only keep Export Image checked off!). Each of these corresponds to a tilemap of the original. Here are the original offsets of the original tilemaps:
Background: 0x08463B88
Move Desc. Background: 0x08463C80
Main: 0x08E9B598
Stats: 0x08E9B750
Moves: 0x08E9B950
Move Desc. Window: 0x08E9BA9C
Egg: 0x08E9BBCC
Keep the offsets for where you've inserted each of the tilemaps, and repoint the offsets to the originals. hgssbackground.raw corresponds to Background, hgssaltbackground.raw corresponds to Move Desc. Background, hgssmovedesc.raw corresponds to Move Desc. Window. The others should be self-explanatory.

If you want to make your own summary screen graphics, edit the tilesetmaker image included, so you have a reference for every screen you'll need to include. Then convert it into a tileset with Sphere, index with Irfanview, and make the tilemaps with TileMapStudio. Yes, this is going to be a pain. Sorry. Note: keep the button graphics in the same place as they are in the tileset included; otherwise you'll need to mess with some of the code.


Here's some documentation of various changes the patch makes - majority of these are in the place of the original summary screen and should thus be relatively compatible with hacks that have not already changed the summary screen. Most of the other changes are documented in BluRose's brilliant post here.

Spoiler:
Start offset - End offset if applicable - Reason for the change
0x0804623E - changes the level at which eggs hatch
0x08046CBE - changes the level at which eggs hatch
0x08134D9C - 0x081352C8 - not sure; within the original summary screen routines
0x0813549E - 0x0813549F - X-offset of the HP bar on page 2
0x081354F2 - 0x081354F3 - X-offset of the HP bar on page 2; this is where it's loaded when switching from page 1 to page 2, no I don't understand why it's a different value than the first one
0x08135B20 - pointer
0x08135B34 - pointer
0x08135B54 - pointer
0x08135B6C - pointer
0x08135B8C - pointer
0x08135BF0 - pointer
0x08135C08 - pointer
0x08135C1C - pointer
0x08135C30 - pointer
0x08135CDA - 0x08135CE0 - not sure; within the original summary screen routines
0x08135D14 - pointer
0x08135D2C - pointer
0x08135D50 - pointer
0x08135D88 - pointer
0x08135D8C - pointer
0x08135DBC - pointer
0x08135DC0 - pointer
0x081372C8 - value for the move selection window corresponding to how many pixels down it should increment each time - not as simple as just changing it to 28 or whatever if you need a new value
0x081372F6 - 0x08137D13 - all of this got shifted over and modified a bit in order to allow for the changed value to the move selection window. this also means that some of the offsets from blurose's post (the ones between these offsets) no longer correspond exactly, though they're usually just shifted over a few bytes.
0x08137FBA - X-offset for the HP bar, again
0x08139016 - 0x0813901A - not sure; within the original summary screen routines
0x0813960A - 0x0813960E -  not sure; within the original summary screen routines
0x08139A24 - 0x08139AA3 - flips the pokemon sprite so they're (usually) facing the left instead of the right (an inversion of the flipsprite value so you don't have to manually change every sprite to be flipped or not)
0x0813A12F - 0x0813A162 - further handling of the move selection window's increment change
0x0813A44C - X-offset for the icon that shows up when you're statused
0x0813A452 - Y-offset for the icon that shows up when you're statused
0x0813A574 - another X-offset for the HP bar
0x0813A57E - Y-offset for the HP bar
0x0813AD7E - X-offset for the "cured of pokerus" indicator (little black box) when on the move selection screen
0x0813AD84 - Y-offset for the "cured of pokerus" indicator (little black box) when on the move selection screen
0x0813AD98 - X-offset for the "cured of pokerus" indicator (little black box) when not on the move selection screen
0x0813AD9E - Y-offset for the "cured of pokerus" indicator (little black box) when not on the move selection screen
0x0813AE20 - X-offset for the shiny star on initial load
0x0813AE22 - Y-offset for the shiny star on initial load
0x0813B5B0 - pointer
0x0813B5B4 - pointer
0x0813B5EC - pointer
0x0813B5F0 - pointer
0x0813B63C - 0x0813B640 - not sure; within the original summary screen routines
0x0841982D - 0x041985E - strings, specifically the "[x] nature. [location]. Met at Lv. [x]." which i changed to fit into the smaller area allotted and also match with how those messages are in HGSS
0x0846370E - 0x08463711 - palette values to make the text for the move window less ugly
0x08463AAC - 0x08463AEB - palettes for the HP bar at varying HP amounts, first at medium (yellow), then low (red) - if you're using your own HP bar graphics, copy the palette for the original HP bar and only modify the green hues
0x08463F1D - 0x08463F95 - these are edited windows. If you try to just change the straight X and Y values for a lot of the offsets in blurose's post, they'll get cut off, because they're printed within a specific window. Reference the decomp if you need help editing these.
0x08720000 - Background
0x08720140 - Alt Background
0x08720280 - Main Menu
0x08720450 - Stats Menu
0x08720670 - Moves Menu
0x08720800 - Move Desc. Window
0x08720980 - Egg Menu
0x08E95DCF - 0x08E95DD1 - palette values to get rid of that hideous off-beige colour used to shade the text

My recommendation is to crawl through these locations in your hack and file-compare them with a vanilla FR ROM. If nothing conflicts, you're golden. If something does conflict, figure out what you've changed, note it down, then go back after patching and make the necessary changes.

Notes:
- 16-character item and ability names will not show up as cramped, unless they're in all-caps, and in that case why are you still having them be all-caps? It's almost 2021. Pull up your socks.

Things you'll have to do yourself:
- A lot of strings have been left unedited, which means they'll be cut off. Ability descriptions are the big one; egg states are also spaced weirdly.
- If you have a thing that puts the little physical/special/status icon on the move description window, you'll need to figure out where the offsets of those are and modify them.
- This is, as far as I'm aware, NOT COMPATIBLE with the IV display routine or the nature-coloured stats routine; I haven't tested them myself but it's probably safe to assume they aren't. It probably wouldn't be too much work to make them compatible, but I'm not good at ASM lol.

Things that could stand to be improved:
- The screens still scroll in from the right as you advance instead of from the left. I haven't looked into how to resolve this yet; if someone else would like to, search around in pokemon_summary_screen.c for the value 240 to orient yourself.
- The egg menu is kind of ugly because it prints "EGG" as the species name directly in the middle of the screen. If someone wants to figure out how to just make it not display, I'll update things.

Download it here.

Gavoca

Age 16
He/Him
Seen October 7th, 2022
Posted June 1st, 2022
361 posts
3.2 Years
OOOOOO i love it!!!!!
Seen April 25th, 2022
Posted January 22nd, 2021
1 posts
3.7 Years
This is great, thank you!

After a bit of playing around, I've got both the nature coloured stats and IV rating working.

Coloured stats works just fine when inserted after this patch (didn't test inserting it before patching, so can't comment on whether it'll still work or not).

IV rating requires some of the offsets in the scripts, and the offsets you insert it to be adjusted (anything in the 0x137XXX range needs to be increased by 4); as well as the x,y coordinates to be adjusted for the new layout.

Modified version of DoesntKnowHowToPlay's code below
Spoiler:

cmp r0, #0x0
beq Abort
cmp r0, #0x3
bgt Abort
cmp r0, #0x1
bne StandardAbort
b Start

Abort:
ldr r1, .AbortAddr
bx r1

StandardAbort:
ldr r1, .StandardAbortAddr
bx r1

.align 2
.AbortAddr: .word 0x08137c01
.StandardAbortAddr: .word 0x08137bfd

Start:
ldr r0, .ActiveMonPtr
ldr r1, .ActiveOffset
ldr r0, [r0, #0x0]
add r6, r0, r1

add sp, #-0x18

HPIV:
mov r0, r6
mov r1, #0x27
bl Decrypter

mov r5, r0
lsr r5, r5, #0x1
mov r0, #0x40
mul r5, r0, r5

mov r1, #0x80
str r1, [sp, #0x0]
str r1, [sp, #0x4]

#x, y position
mov r2, #0x2
str r2, [sp, #0x8]
mov r1, #0x6
str r1, [sp, #0xc]

#x, y size
mov r2, #0x10
str r2, [sp, #0x10]
mov r1, #0x8
str r1, [sp, #0x14]

mov r0, #0x3
ldr r1, .GraphicAddr
add r1, r5
mov r2, #0x0
mov r3, #0x0
bl GraphicHandler



AtkIV:
mov r0, r6
mov r1, #0x28
bl Decrypter

mov r5, r0
lsr r5, r5, #0x1
mov r0, #0x40
mul r5, r0, r5

mov r1, #0x80
str r1, [sp, #0x0]
str r1, [sp, #0x4]

#x, y position
mov r2, #0x2
str r2, [sp, #0x8]
mov r1, #0x19
str r1, [sp, #0xc]

#x, y size
mov r2, #0x10
str r2, [sp, #0x10]
mov r1, #0x8
str r1, [sp, #0x14]

mov r0, #0x3
ldr r1, .GraphicAddr
add r1, r5
mov r2, #0x0
mov r3, #0x0
bl GraphicHandler



DefIV:
mov r0, r6
mov r1, #0x29
bl Decrypter

mov r5, r0
lsr r5, r5, #0x1
mov r0, #0x40
mul r5, r0, r5

mov r1, #0x80
str r1, [sp, #0x0]
str r1, [sp, #0x4]

#x, y position
mov r2, #0x2
str r2, [sp, #0x8]
mov r1, #0x26
str r1, [sp, #0xc]

#x, y size
mov r2, #0x10
str r2, [sp, #0x10]
mov r1, #0x8
str r1, [sp, #0x14]

mov r0, #0x3
ldr r1, .GraphicAddr
add r1, r5
mov r2, #0x0
mov r3, #0x0
bl GraphicHandler


SAtkIV:
mov r0, r6
mov r1, #0x2B
bl Decrypter

mov r5, r0
lsr r5, r5, #0x1
mov r0, #0x40
mul r5, r0, r5

mov r1, #0x80
str r1, [sp, #0x0]
str r1, [sp, #0x4]

#x, y position
mov r2, #0x2
str r2, [sp, #0x8]
mov r1, #0x33
str r1, [sp, #0xc]

#x, y size
mov r2, #0x10
str r2, [sp, #0x10]
mov r1, #0x8
str r1, [sp, #0x14]

mov r0, #0x3
ldr r1, .GraphicAddr
add r1, r5
mov r2, #0x0
mov r3, #0x0
bl GraphicHandler



SDefIV:
mov r0, r6
mov r1, #0x2C
bl Decrypter

mov r5, r0
lsr r5, r5, #0x1
mov r0, #0x40
mul r5, r0, r5

mov r1, #0x80
str r1, [sp, #0x0]
str r1, [sp, #0x4]

#x, y position
mov r2, #0x2
str r2, [sp, #0x8]
mov r1, #0x40
str r1, [sp, #0xc]

#x, y size
mov r2, #0x10
str r2, [sp, #0x10]
mov r1, #0x8
str r1, [sp, #0x14]

mov r0, #0x3
ldr r1, .GraphicAddr
add r1, r5
mov r2, #0x0
mov r3, #0x0
bl GraphicHandler



SpeedIV:
mov r0, r6
mov r1, #0x2A
bl Decrypter

mov r5, r0
lsr r5, r5, #0x1
mov r0, #0x40
mul r5, r0, r5

mov r1, #0x80
str r1, [sp, #0x0]
str r1, [sp, #0x4]

#x, y position
mov r2, #0x2
str r2, [sp, #0x8]
mov r1, #0x4D
str r1, [sp, #0xc]

#x, y size
mov r2, #0x10
str r2, [sp, #0x10]
mov r1, #0x8
str r1, [sp, #0x14]

mov r0, #0x3
ldr r1, .GraphicAddr
add r1, r5
mov r2, #0x0
mov r3, #0x0
bl GraphicHandler



add sp, #0x18
b Abort


GraphicHandler:
ldr r4, .HandlerAddr
bx r4

Decrypter:
ldr r2, .DecrypterAddr
bx r2

.align 2
.GraphicAddr: .word 0x08XXXXXX
.HandlerAddr: .word 0x080041f1
.ActiveMonPtr: .word 0x0203b140
.ActiveOffset: .word 0x00003290
.MonIndex: .word 0x0203b16c
.DecrypterAddr: .word 0x0803FBE9


Spoiler:

Insert this image, or a nicer version, into your rom. It uses the same palette as the type chart, which is located at 0xE95DBC by default


Replace 0x08XXXXXX with the pointer to the image

At 0x137BF4, place 00 49 08 47 followed by a reversed pointer to the code above plus one.
At 0x137BE8, place 01 20 03 E0.
Male
Seen 1 Hour Ago
Posted 4 Weeks Ago
81 posts
6.7 Years
Update patch:

https://mega.nz/file/4bIBHB4D#nfVGfsgfuKliOcM1DAsY4HQ_T3Id7eO2B-gJ5ChiPss

Change the address to 0xF50000 and modify a few things to make the icon pss split routine compatible

Update Routine icon spli:

@0813A130: 0x2F
@0813A17B: 0x47
@0813A1A0: [Pointer to Routine, plus 1 (one).]
Spoiler:
.align 2
.thumb
Start:
push {r0-r4}
ldr r0, .CurMoveIndex
ldrb r1, [r0]
lsl r1, r1, #1
ldr r0, .Move_List
add r0, r0, r1
ldrh r3, [r0]
lsl r0, r3, #1
add r0, r0, r3
lsl r0, r0, #2
ldr r1, .MoveBase
add r0, r0, r1
ldrb r4, [r0, #10]
lsl r0, r4, #1
add r4, r4, r0
lsl r4, r4, #6

ldr r0, .SplitImages
add r0, r4
ldr r1, .VRAM
mov r2, #0x30
swi #0xB

ldr r0, .SplitImages
add r0, r4
add r0, #0x60
ldr r1, .VRAM
mov r2, #0x1E
lsl r2, #0x04
add r1, r1, r2
mov r2, #0x30
swi #0xB

Finish:
pop {r0-r4}
ldr r4, .Some_Offset
ldr r0, [r4]
ldr r1, .Return_Addr
bx r1

.align 2
.MoveBase: .word 0x08250C04
.CurMoveIndex: .word 0x0203B16D
.Move_List: .word 0x02003268
.VRAM: .word 0x060017E0
.SplitImages: .word 0xYYYYYYYY
.Some_Offset: .word 0x0203B148
.Return_Addr: .word 0x0813A17C+1