• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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.

Hacking the Diploma Screen [FR]

5,256
Posts
16
Years

Hacking the Diploma Screen


You may (or may not) be familiar with the Diplomas in Pokémon awarded to you when you complete your regional and National Pokédexes and show them to the Professor.

This tutorial will be all about how to hack the text and the image displayed. This can allow the Diploma to be used for a variety of other things; a cutscene showing a landscape, perhaps a sacred tablet, or just an art poster? Whatever it is, this tutorial just about covers it all.

With this tutorial, you'll be able to go from this:
FRLG_Regional_Diploma.png

To this:
QhAJ1.png


Just so you know, this tutorial does include hex editing and a basic knowledge of how to use a Hex Editor, but I will explain things anyway for clarity's sake. Now, onto the tutorial!

You will need:


Before we start, backup your ROM.
Every time you do something relatively big to your ROM, make a copy.
I can't stress this enough.

Anyway, onto Step 1!

Step 1 - Finding our Data


Load up your ROM in Translhextion.
You'll see something like this:
ngw0n.png


Now, go to the Script tab, and click Open Thingy Table.
AYYZy.png

Select the firered.tbl you downloaded, and a pop-up box will appear. Click OK, and then check the "Thingy View Active" square in the new window that has appeared.

rpZhj.png


In order for us to edit the text that is displayed on the diploma, we first need to find the text itself. Using Translhextion, and a loaded Table file, we can search for text within the ROM.

In a FireRed ROM, the diploma says "PLAYER: [player]", and then "This document is issued". as the first few lines. Because it's less common in the ROM, we'll search for "This document is issued".

So, in Translhextion, do the shortcut Alt+F (Mac users, I don't know what the equivalent is, but go into the Search menu, and the click "Find using table") and in the dialogue box that appears, type in "This document is issued".

kxTPS.png


This will lead you to the offset 0x41b60e. Now, because I find Translhextion a rather...ugly Hex Editor, I'm going to switch to HxD for this part. The only reason why I use Translhextion is because of its Table file support. So if you want to, load your ROM in HxD.

Anyway, in HxD, we're going to need to find the part of the ROM that points to the text that is displayed. We know the text is stored at 0x41b60e, so we need to turn this into a pointer.

To make a pointer, you take the offset, 41b60e, and split it up into bytes (segments of two).

[41] [b6] [0e]

We then switch the first and last bytes.

[0e] [b6] [41]

And then add [08] to tell the game we're pointing to somewhere in the ROM, so our pointer is 0eb64108.

In HxD, we then do the shortcut Ctrl+F (or Search > Find) for 0e b6 41 08. Make sure you select Hex values where it says Text string and just in case, tick "All" for search direction.

Xz2Xu.png


This search should bring you to 0x000F50E4. At the beginning of this, at 0x000F50E0, is "98 B6 41 08", which is a pointer to the text "Kanto", as the text just uses either "National" or "Kanto", and special 0x108 uses Kanto. You can replace this pointer with "FF FF FF 08", which points to blank space, as otherwise the word "KANTO" will be plastered on top of your text. Trust me, it doesn't look nice.

Hit save, write down 0x000F50E4 somewhere and then close HxD.

Step 2 - Our own Text

Load your ROM in XSE. Make a script like the following, with the text you wish to display.

Code:
#dynamic 0x800000

#org @string1
Long ago, the titans of old waged war against each other...

The power of Earth clashed with the power of Neptune, leaving only wasteland...

Now, normally, you'd select the text and put it into XSE's Text Adjuster to make it fit perfectly, and not run off the screen, and that's it. We are going to use the Text Adjuster, but we'll have to make some adjustments ourselves afterwards.

So, select your text, cut it (Ctrl+X), open up the Text Adjuster (Ctrl+T), paste the text in the Text Adjuster (Ctrl+V), hit Convert, and then hit Insert.

Now, the Text Adjuster automatically adds "\l"s and "\p"s, however those notations only work on proper textboxes. It would look gltichy on our diploma, so we need to replace all the "\l"s with "\n"s, and all the "\p"s with two "\n"s. Your script should look like this now:

Code:
#dynamic 0x800000

#org @string1
= Long ago, the titans of old waged\nwar against each other...\n\nThe power of Earth clashed with\nthe power of Neptune, leaving\nonly wasteland...

Hit compile, and copy the offset XSE gives you, and paste it in Notepad.
Because I'm using an unedited FireRed ROM, the offset for my text is 0x800000.

Close XSE, and reopen HxD and load your ROM.

Go to the offset we found earlier, and replace the pointer "0E B6 41 08" to the pointer of your script. If you remember from before, we need to split our offset into bytes, switch the first and last, and then add 08. So my string's pointer is "00 00 80 08".

Copy your new pointer, select the "0E B6 41 08" data, right click and press Paste Write, NOT Paste Insert. Paste Insert will increase the size of your ROM and cause all sorts of damage.

B60x1.png


Hit save. There's one more piece of text you may want to remove, that is the GAME FREAK signature. If you want to remove it, simply replace the "84 B6 41 08" at 0x000F50F0 to "FF FF FF 08", or change it to a pointer of text if you want to add a signature of your own (you haven't got much space, though.).

Now, save once more and test your ROM. Obviously, you'll need to add a script that has "special 0x108" in it.

Step 3 - Tilemaps and Tilesets


So, we've edited the text, but what about the background? Who even likes Digletts anyway?

It's not like it suits ancient tablets, anyway. So let's change it!

I'm going to be changing it to a small screen I made using the Groudon and Kyogre sprites from Emerald. The image has to be 240 pixels wide by 160 pixels high, no larger. After you've got your image, select an 8x8 square in the top left corner of your canvas, and cut your selection and paste it somewhere else (on a duplicate tile, perhaps). The gap that you've made is going to be the "transparent" tile.

dM3bk.png
->
HTqsg.png

Of course, I could remove all the duplicate tiles, but I'm bad at constructing tilemaps, so I'm just going to leave it like this. You need to index your tileset. I'm not going to go in depth on how to index images, as PC is full of them, but basically you need to load your image in IrfanView and decrease the colour depth to 16 colours, with your transparent colour as the first colour in your palette.

Yz0wp.png


Load your ROM in unLZ GBA, and navigate to 258. You should see a miscoloured Torchic, Pikachu, Diglett, etc. This is the Tileset for the diploma background. We need to replace it, so click the Import button and import your new tileset.

Click Write to ROM, and check both Export Image and Automatically fix Pointers. You need to enter a new offset for the Image Offset - you can use FSF to find the exact space, or just use an offset you know is empty. In my case, that's 0x840000.

oUsvM.png


Click ok, and then ok on the dialogue box that appears. Click "Next" to go to 259, which looks like a garbled mess. It is, in fact, a .raw file, or a tilemap. Click "Raw Dump". Save the .raw with a name of your choice, and then minimize unLZ GBA.

Open up NTME. Go in the File Menu, then click "Open Tileset" and select the image you imported into unLZ GBA. Wait for it to load, and then go into the File Menu again, go to Open Tilemap and select the .raw file you dumped. Wait for it to load.

It will look quite glitchy, but this is normal. In the "Size (Keep Ratio):" dropdown box, select
32x64 and wait for it to load.

fa268.png


Now, the fun part! Reconstruct your tilemap so it looks how you want it to look.

6MacP.png


Go into the File Menu, go to Save Tilemap and save it as a .raw.

Reopen unLZ GBA. You should still be on 259, the garbled mess. Go to the File Menu, click "Load RAW..." and select the .raw you just constructed. It should load as a different looking garbled mess. Click Write to ROM, and again check Export Image and Automatically fix Pointers, and change the Image Offset again to an offset you know is empty, or find free space using FSF. I'm going to use the offset 850000. Click ok on the dialogues and close unLZ GBA. Test your ROM again!

hRoS6.png


Well...we need to do some Palette Editing!

Step 4- Palette Editing

In VBA, go into the Tools menu and open up the Palette Viewer. Open up Notepad next to VBA, and write down the numbers on the top row of colours in the left box in Notepad.

Spoiler:


Once you've got ah few of the number down, split them up into bytes and flip them around.

If the original order is
Code:
57 2F
7C 1F
47 9B
4F D9
53 7C
57 B8

Then it should become:
Code:
2F 57
1F 7C
9B 47 
D9 4F
7C 53
B8 57

Load your ROM in HxD and search for "2F 57 1F 7C 9B 47 D9 4F 7C 53 B8 57", remembering to check "Hex Values" and "All". This will bring you to the offset 0x415954.

Take note of that offset, close HxD, close the Palette Viewer in VBA, and open up APE.

Load your ROM in APE, and check "Load from offset". In the box with two greyed out arrows next to it, type in 00415954 and click "Load".

ExI5O.png


Now, manually edit the colours in the top section (Actual Palette) to what they're meant to be like (using VBA and the image of your finished image as a reference) and then hit replace.

Ptqx6.png


Close APE, and fire up VBA once more!

1cKJK.png


Almost perfect! Now, depending on your image, you may have a light background and so the text looks OK. If not, then you can remove that ugly shadow or change the text colour by going into HxD for one last time.

Go to 0x000f50e8, and you'll find the data "04 5A 41 08". As you can tell, this is a pointer. Reverse it, remove the 08, and we get 415A04. Go to that offset, and you'll see "00 02 03 00". You can change the second byte, "02", to "01" to make the text white, "00" to make it transparent (it looks ugly, trust me). Changing it to "03" will make the text the same colour as the shadow - a grey colour. "04" makes it red, "05" makes it orange, and so on. Experiment with that byte until you get a colour you like.

The third byte, "03", controls the shadow's colour. "00" gets rid of the shadow, and the colours pretty much apply the same as above.

You can always edit these colours, but remember that these are also the colours used by the text NPCs use when talking and such, so if you edit the red here it will edit the colour of girls, etc. The location of the palette is 00471DF0, so enter that in APE if you want to change some more stuff.

QhAJ1.png


And that's about it for this tutorial! I hope you've learned something at least. I'd love to see the creative applications of this.

I do have one question for the more advanced hackers out there: how would it be possible to remove the fanfare that plays when this diploma is displayed? It seems to be the only issue, but I assume ASM would be needed to edit the special's script.

Thanks to the amazing Haru~, it's now possible to have multiple "diplomas" - up to 255!

Click this text to read Haru's mini-tutorial.

Bear in mind that basic knowledge of ASM (inserting, compiling, etc.) is needed. If you're unsure, I recommend reading HackMew's Knowledge, a thread in this Tutorial section that explains compiling and inserting asm.
Some notes about the image you're inserting: it needs to be able to fit on a 240x160 area, as that's the size of the GBA's screen. It also has to be indexed, with no more than 16 colours, and be uncompressed. That's about it, really. Thanks for reading! :)
 
Last edited:

tajaros

Hi I'm dawg
855
Posts
11
Years
Great tut...

This would really help a lot of hackers!
Especially ones making remakes of the IV\V generations... :)
 
1,323
Posts
16
Years
  • Seen Dec 9, 2023
I just had an idea: Theoretically, can't we copy the data of the routine of the Pokedex diploma, insert it into free space, then change all the pointers within the data to new data (so that we can use different tilemaps/tilesets/palettes), then call the routine using the callasm command, thus creating extra diplomas? This would allow things like single-image cutscenes without breaking the original diplomas.

In fact, whenever I have time, I'm going to try this idea. It should be as simple as finding when the diploma routine starts and where it ends.
 

Haru~

Can't resist the chubbiness :3
16
Posts
12
Years
  • Seen Jul 15, 2012
How to add +255 diplomas without RAM pointing the whole thing.

Well it took me about 2 hours or so doing this and trying to perfect it.

So here it is! The thingy in the spoiler are routines that allow you to have up to 255 diplomas. That's enough maybe even too much in a hack!
Instructions are included in the spoiler.
Spoiler:
 
Last edited:
5,256
Posts
16
Years
...wow, I definitely didn't expect to see that.

This is so, so cool.

Just a question, would it be possible to remove the fanfare that is played upon activating the special?

In fact, is that even activated with these custom codes?

Regardless, I've linked your amazing work on the first post.

Thanks a load!
 
Last edited:

Rokou

» inactive
24
Posts
11
Years
  • Age 31
  • Seen Jul 21, 2014
This is pretty awesome. I'll definitely use that for my project, thanks for sharing!
 

Haru~

Can't resist the chubbiness :3
16
Posts
12
Years
  • Seen Jul 15, 2012
...wow, I definitely didn't expect to see that.

This is so, so cool.

Just a question, would it be possible to remove the fanfare that is played upon activating the special?

In fact, is that even activated with these custom codes?

Regardless, I've linked your amazing work on the first post.

Thanks a load!
Unfortunately, it still plays the fanfare as I only hacked the loader in the routines.
Well, if you're using the music loader hack (I think it was from Mastermind_X) you could do:
Code:
setvar 0x5000 0x104
setvar 0x5002 0x0
....
//specials here
....
setvar 0x5000 0x104
setvar 0x5002 0x104
That might do the trick. Let's just hope that the delay comes from the "waitfanfare" of the special.

That's the idea that I have right now. Though I might dig deeper into the code.

P.S. Does it fully work? Because I made the bug corrections on my testing ROM without updating the ones on my notepad so errors may happen. If there is, please tell me.

EDIT: It seems that I'm having trouble with the routines. I will fix it soon. Problem Fix'd!
 
Last edited:

Haru~

Can't resist the chubbiness :3
16
Posts
12
Years
  • Seen Jul 15, 2012
Yup, that's the one.

Though even if you mute the sound effect, it will still have that delay (waiting for the original song to finish). But it's a step forward.
 
5,256
Posts
16
Years
Well, I've tried inserting the custom diplomas using the .bin files you attached, and for some reason, the text displays properly, but for the image, it just displays a black screen. Also, after pressing A and "exiting" the diploma screen, the screen goes black, the music continues but nothing else can be done. I'm almost 100% sure I inserted it as you said, so I'm quite curious as to why this is happening.

The standard diploma works as usual.
 

Haru~

Can't resist the chubbiness :3
16
Posts
12
Years
  • Seen Jul 15, 2012
Well, I've tried inserting the custom diplomas using the .bin files you attached, and for some reason, the text displays properly, but for the image, it just displays a black screen. Also, after pressing A and "exiting" the diploma screen, the screen goes black, the music continues but nothing else can be done. I'm almost 100% sure I inserted it as you said, so I'm quite curious as to why this is happening.

The standard diploma works as usual.

Yes, I have encountered that problem when I'm trying to replicate it on another ROM. But I have already fixed those problems. (I found out that my tileset data and raw image data were swapped causing that black screen as you said and literally staying black). Well, can you try this patch of the hack? (On a clean Fire Red ROM. Just talk to the May sprite).

Spoiler:

EDIT: Oh, I forgot to tell you that the black screen is caused by the Tileset and RAW Image routines' positions getting swapped.
Wait! The names of the routines in the RAR file are wrong!
The "Diploma_Tilemap_Replacer.bin" is the RAW Image Replacer and the "Diploma_Raw_Replacer.bin" is the Tileset Image Replacer! <- RAR File has been fixed, see attachment.
 
Last edited:

Shiny Quagsire

I'm Still Alive, Elsewhere
697
Posts
14
Years
I can honestly say I've always wondered what that image in unLZ was. However, that's can be very useful if hooked into some assembly. It wouldn't be hard to make it load another text or image based on a variable or loadpointer command.
 

redriders180

Mastermind of Pokemon Glazed
314
Posts
13
Years
I think what would be the ultimate icing on the cake would be to figure out how to make this special not automatically end a script. There are plenty of times I want to display images, for whatever reason, and want a script to continue onwards. Does anyone have any idea how to make that work?
 

NarutoActor

The rocks cry out to me
1,974
Posts
15
Years
Um I haven't tried this before, but isn't callasm2 used for such a thing? Then you can place a return after the script. Not 100% sure, I herd this, but like I said, I could be wrong. (Please verify)
 
5
Posts
11
Years
  • Seen Aug 27, 2023
This is AMAZING. WAAAAAAAAAAAAAY AMAZING.

I want to play a song, not a fanfare during the "Diploma SlideShow". How can i do that?
 
5
Posts
11
Years
  • Seen Aug 27, 2023
I've actually posted a thread in R&D on the ability to change what music/fanfare is played when the diploma is shown.

Well, i didn't found that part you said, i'm sorry. Maybe deleting that fanfare, or moving it. I dunno.
 
Back
Top