• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

1st Gen Hacking: Useful Links

5
Posts
13
Years
  • Seen Aug 16, 2018
While I do like your thought process there, keep this is mind:
"If Tauwasser documents the decompression routine, maybe someone else will create a tool to recompress graphics for him ;)"

He posted the documentation on the wiki in German on March 25th, 2006. He did a rough English translation on June 12th, 2010. It's September 7th, 2011, and only now are we getting close to a compression tool.

Because I already know what I'm doing (for the most part), I feel obligated, I feel it's my duty to finish this out.

...hopefully before Christmas.
 

Sawakita

Not Invented Here
181
Posts
13
Years
  • Age 34
  • Seen Nov 17, 2019
I've added the link to my sprite compression tool (see first post).
 
5
Posts
13
Years
  • Seen Aug 16, 2018
Okay good then. Then I don't feel obligated to show my tool, since this works almost the exact same way mine does.
 

IIMarckus

J946@5488AA97464
402
Posts
16
Years
  • Seen Feb 21, 2024
While I do like your thought process there, keep this is mind:
"If Tauwasser documents the decompression routine, maybe someone else will create a tool to recompress graphics for him ;)"
And sure enough, it is happening. Barely a year after he translated it, too. Can you imagine how long it would have taken if he hadn't released his doc?

My hacking time has been epsilon for many months now, but since I released much of my work while I was working on it, it has been able to help others (and get improved by others), and will continue to do so long after I stop hacking completely. I heartily encourage this practice wherever possible.
Because I already know what I'm doing (for the most part), I feel obligated, I feel it's my duty to finish this out.

...hopefully before Christmas.
This is exactly what I'm talking about!
 

Sawakita

Not Invented Here
181
Posts
13
Years
  • Age 34
  • Seen Nov 17, 2019
Okay good then. Then I don't feel obligated to show my tool, since this works almost the exact same way mine does.
Why not? If yours is multiplatform and performs interpretations 2 and 3 too, it's certainly more efficient than the one I posted. Feel free to post it so people can have a better choice, if you want.
 
Last edited:
5
Posts
13
Years
  • Seen Aug 16, 2018
Why not? If yours is multiplatform and performs interpretations 2 and 3 too, it's certainly more efficient than the one I posted. Feel free to post it so people can have a better choice, if you want.
Well, it didn't perform interpretations 2 and 3 correctly until about 5 minutes ago.

And I guess you could call it multiplatform. It'll work on anything that can connect to the internet, parses basic HTML, and allows you to upload files and save downloadable files.

I'd post it here, but again, "[I am] only allowed to post URLs to other sites after have made 15 posts or more." I will post it at Skeetendo though.
 

Sawakita

Not Invented Here
181
Posts
13
Years
  • Age 34
  • Seen Nov 17, 2019
Well, it didn't perform interpretations 2 and 3 correctly until about 5 minutes ago.

And I guess you could call it multiplatform. It'll work on anything that can connect to the internet, parses basic HTML, and allows you to upload files and save downloadable files.

I'd post it here, but again, "[I am] only allowed to post URLs to other sites after have made 15 posts or more." I will post it at Skeetendo though.

I'm glad you got it sorted. I'll add the link in the first post.
 
25
Posts
9
Years
  • Age 34
  • Seen Jul 26, 2015
man I wish we had more info on hacking pokemon yellow version..... im working on a yellow hack now and im so lost lol it seems to be the most difficult of all pokemon games to hack (ranging from gen1-gen3 is what my experience is lol) if you have any additional info on hacking yellow, please update this for me man. I know a lot of us are in the dark about yellow version hacking lol




thanks waffa




ps
great post!!!!! almost makes me wanna do a red or blue hack hahahahahaha I just love the fact in yellow a poke follows lol that's why im hell bent on hacking yellow version hahahahaha
 

RaidenRaider

I WILL Catch'em ALL!!!!
21
Posts
8
Years
  • Age 38
  • Seen Apr 15, 2020
I'm trying to edit the title screen on Red/Blue using the disassembly, so that when the game starts it says "Red 251 Version", "Blue 251 Version" and "Green 251 Version", but it's not working for me. Pleas help me someone.

Thisis what I've put at the bottom of engine/titlescreen.asm.

VersionOnTitleScreenText: ; 45a1 (1:45a1)
IF DEF(_RED)
db $60,$61,$7F,$65,$66,$67,$68,$69,"@" ; "Red Version"
ENDC
IF DEF(_GREEN)
db $62,$63,$64,$7F,$65,$66,$67,$68,$69,$70,"@" ; "Green Version"
ENDC
IF DEF(_BLUE)
db $61,$62,$63,$64,$65,$66,$67,$68,"@" ; "Blue Version"
ENDC
 
3,830
Posts
14
Years
  • Age 26
  • OH
  • Seen Feb 26, 2024
I'm trying to edit the title screen on Red/Blue using the disassembly, so that when the game starts it says "Red 251 Version", "Blue 251 Version" and "Green 251 Version", but it's not working for me. Pleas help me someone.

Thisis what I've put at the bottom of engine/titlescreen.asm.

VersionOnTitleScreenText: ; 45a1 (1:45a1)
IF DEF(_RED)
db $60,$61,$7F,$65,$66,$67,$68,$69,"@" ; "Red Version"
ENDC
IF DEF(_GREEN)
db $62,$63,$64,$7F,$65,$66,$67,$68,$69,$70,"@" ; "Green Version"
ENDC
IF DEF(_BLUE)
db $61,$62,$63,$64,$65,$66,$67,$68,"@" ; "Blue Version"
ENDC

If you read through the comment above that bit, it says this:
Code:
; these point to special tiles specifically loaded for that purpose and are not usual text

This means that you have to edit a special image file first which contains a tileset for the text. In this case, the image you'll want to edit is found at "gfx/red/redgreenversion.png" (there is also "gfx/blue/blueversion.png"). Once you've done that you can edit the data to display the desired text based on the tileset.
 

RaidenRaider

I WILL Catch'em ALL!!!!
21
Posts
8
Years
  • Age 38
  • Seen Apr 15, 2020
If you read through the comment above that bit, it says this:
Code:
; these point to special tiles specifically loaded for that purpose and are not usual text
This means that you have to edit a special image file first which contains a tileset for the text. In this case, the image you'll want to edit is found at "gfx/red/redgreenversion.png" (there is also "gfx/blue/blueversion.png"). Once you've done that you can edit the data to display the desired text based on the tileset.

Okay, the first part I can do, I can edit the specific .png files to say "Red 251 Version", "Blue 251 Version" and "Green 251 Version, but the numbers 251 don't display at all in-game because I think the font is wrong, and secondly, I don't know how to edit the data to display the desired text based on the tileset in engine/titlescreen.asm.

The text is either flowing offscreen on the left or right, the 251 doesn't show up instead being replaced by big blocks of red/blue/green, depending on the version, or even see's the whole text being severly centered to the right of the screen.
 
3,830
Posts
14
Years
  • Age 26
  • OH
  • Seen Feb 26, 2024
Okay, the first part I can do, I can edit the specific .png files to say "Red 251 Version", "Blue 251 Version" and "Green 251 Version, but the numbers 251 don't display at all in-game because I think the font is wrong, and secondly, I don't know how to edit the data to display the desired text based on the tileset in engine/titlescreen.asm.

The text is either flowing offscreen on the left or right, the 251 doesn't show up instead being replaced by big blocks of red/blue/green, depending on the version, or even see's the whole text being severly centered to the right of the screen.

(before you read this, know this is mostly what I'm figuring out as I go... RBY hacking is not my forte)

So when you edit a tileset like this, you need to find the code where it is loaded and ensure that the entire size of the image is loaded into memory. In this case, in engine/titlescreen.asm you'll want to find this code (I found it at line 59):
Code:
...
ld hl, Version_GFX ; $402f
IF DEF(_RED)
	ld de,vChars2 + $600
	ld bc,$50
ENDC
IF DEF(_BLUE)
	ld de,vChars2 + $600 + $10
	ld bc,$50 - $10
ENDC
ld a, BANK(Version_GFX)
...

This code is interesting because of the value being loaded into bc in the instruction "ld bc,$50" and "ld bc,$50-$10" because $50 is 80 in decimal while $50 - $10 = $40 which is 64 in decimal, which you might realize is the size of our version text in pixels. So in order to load a larger image, we want to change this value. Say for example I ended up expanding the new text for Red version to 96 pixels in width, then I would it like so:
Code:
IF DEF(_RED)
	ld de,vChars2 + $600
	ld bc,$60 ; note here that $60 is 96 in hexadecimal
ENDC

By doing this we should hopefully be allocating 96 pixels of space for our image instead of the original 80 that was there.

As for editing data, well, what we do is break our logo into small squares ("tiles") that are 8 pixels by 8 pixels in size, like so:
w4sdCpk.png


Now, based on this line of data and our image, we can figure out how this tilemap is laid out:
Code:
db $60,$61,$7F,$65,$66,$67,$68,$69,"@" ; "Red Version"

As we can see, $60 corresponds to the first block in the image (which shows "Re"). Knowing this, the rest of the layout becomes clear, and we can map the blocks of the tileset as follows:
YRQeN2E.png

Where $60 is the first tile, and every subsequent tile increases by one. It is important to note that this is in hexadecimal, so a tile to the right of $69 would be $6A. Also, you'll see that $7F is not present on our tileset. This is OK! Because it simply maps to a part of the memory that would essentially be $16 tiles beyond our image, which would be "blank" data because no other images were loaded in that spot. Because it's blank, it will display as all white on the titlescreen and is used as a space character here. Finally, we can assume that "@" refers to an "end of tilemap" character or something similar.

So when you make your new tileset, break it apart into 8x8 tiles and map as I have done here. You can even fit multiple logos onto one image, as has been done with the original "RedGreenVersion" image and through clever use of the data you can only display the specific parts you want the player to see for a specific version. The important part in this specific case is that your tile starts at $60 instead of $0 like we might normally think when programming. If you look at the code for the Copyright string tilemap, you'll see it follows this same convention.

I hope this works for you, as I am partially guessing on the code editing part. :)
 

RaidenRaider

I WILL Catch'em ALL!!!!
21
Posts
8
Years
  • Age 38
  • Seen Apr 15, 2020
(before you read this, know this is mostly what I'm figuring out as I go... RBY hacking is not my forte)

So when you edit a tileset like this, you need to find the code where it is loaded and ensure that the entire size of the image is loaded into memory. In this case, in engine/titlescreen.asm you'll want to find this code (I found it at line 59):
Code:
...
ld hl, Version_GFX ; $402f
IF DEF(_RED)
    ld de,vChars2 + $600
    ld bc,$50
ENDC
IF DEF(_BLUE)
    ld de,vChars2 + $600 + $10
    ld bc,$50 - $10
ENDC
ld a, BANK(Version_GFX)
...
This code is interesting because of the value being loaded into bc in the instruction "ld bc,$50" and "ld bc,$50-$10" because $50 is 80 in decimal while $50 - $10 = $40 which is 64 in decimal, which you might realize is the size of our version text in pixels. So in order to load a larger image, we want to change this value. Say for example I ended up expanding the new text for Red version to 96 pixels in width, then I would it like so:
Code:
IF DEF(_RED)
    ld de,vChars2 + $600
    ld bc,$60 ; note here that $60 is 96 in hexadecimal
ENDC
By doing this we should hopefully be allocating 96 pixels of space for our image instead of the original 80 that was there.

As for editing data, well, what we do is break our logo into small squares ("tiles") that are 8 pixels by 8 pixels in size, like so:
w4sdCpk.png


Now, based on this line of data and our image, we can figure out how this tilemap is laid out:
Code:
db $60,$61,$7F,$65,$66,$67,$68,$69,"@" ; "Red Version"
As we can see, $60 corresponds to the first block in the image (which shows "Re"). Knowing this, the rest of the layout becomes clear, and we can map the blocks of the tileset as follows:
YRQeN2E.png

Where $60 is the first tile, and every subsequent tile increases by one. It is important to note that this is in hexadecimal, so a tile to the right of $69 would be $6A. Also, you'll see that $7F is not present on our tileset. This is OK! Because it simply maps to a part of the memory that would essentially be $16 tiles beyond our image, which would be "blank" data because no other images were loaded in that spot. Because it's blank, it will display as all white on the titlescreen and is used as a space character here. Finally, we can assume that "@" refers to an "end of tilemap" character or something similar.

So when you make your new tileset, break it apart into 8x8 tiles and map as I have done here. You can even fit multiple logos onto one image, as has been done with the original "RedGreenVersion" image and through clever use of the data you can only display the specific parts you want the player to see for a specific version. The important part in this specific case is that your tile starts at $60 instead of $0 like we might normally think when programming. If you look at the code for the Copyright string tilemap, you'll see it follows this same convention.

I hope this works for you, as I am partially guessing on the code editing part. :)

Okay thank you so much. That was a very detailed and helpful tutorial. I have now got a Red version, Green version and Blue version on the titlescreen, with each in their respective colours. It looks amazing. Thank you very much. It's greatly appreciated. I do have one more favour/request if you're willing to help me out further? I'll even list you as one of my Special Thanks credits when this ROM Hack goes live, alongside Mateo, to show my appreciation for your help.

On the titlescreen, you get a selection of Pokemon that scrolls across the screen, in the respective Red and Blue versions, with each of the Pokemon having respective Red and Blue colour palettes, but I was wondering how I create a green palette for each of the Pokemon on the titlescreen in my Green version. I know the answer is in data/super_palettes.asm somewhere.
 
Last edited:
3,830
Posts
14
Years
  • Age 26
  • OH
  • Seen Feb 26, 2024
Okay thank you so much. That was a very detailed and helpful tutorial. I have now got a Red version, Green version and Blue version on the titlescreen, with each in their respective colours. It looks amazing. Thank you very much. It's greatly appreciated. I do have one more favour/request if you're willing to help me out further? I'll even list you as one of my Special Thanks credits when this ROM Hack goes live, alongside Mateo, to show my appreciation for your help.

On the titlescreen, you get a selection of Pokemon that scrolls across the screen, in the respective Red and Blue versions, with each of the Pokemon having respective Red and Blue colour palettes, but I was wondering how I create a green palette for each of the Pokemon on the titlescreen in my Green version. I know the answer is in data/super_palettes.asm somewhere.

I'm glad I was able to help! Now for your next question, I took a peek in data/super_palettes.asm and found this code at line 55:
Code:
IF DEF(_RED)
	RGB 31,29,31 ; PAL_LOGO1
	RGB 30,30,17
	RGB 17,23,10
	RGB 21,0,4
ENDC
IF DEF(_BLUE)
	RGB 31,29,31 ; PAL_LOGO1
	RGB 30,30,17
	RGB 21,0,4
	RGB 14,19,29
ENDC

I have a hunch that these are the palettes we want to edit for the title screen (the comment of "PAL_LOGO1" makes it stand out to me). On the GameBoy, colors are stored in a 16 bit word, using 5 bits for each color with 1 extra left over in this order: [extra (1)][blue (5)][green (5)][red (5)]. This is simply called 15-bit RGB and Nintendo loves this format, as it is also used on the GBC, GBA and NDS. Since each color is only allowed 5 bits per color, this means that each color component will have a value between 0 and 31. To turn this into a normal color value, which ranges from 0 to 255, the value is multiplied by 8.

Here, the "RGB #,#,#" format refers to a macro, which is a piece of code defined in macros.asm that makes it easier for a programmer to write specialized code while the assembler will translate it into a more specific format (in this case the word holding color data).

This is what the values of the RED palette would thus be:
Code:
IF DEF(_RED)
	RGB 31,29,31 ; 248, 232, 248 ([COLOR="#F8E8F8"]this color[/COLOR])
	RGB 30,30,17 ; 240, 240, 136 ([COLOR="#F0F088"]this color[/COLOR])
	RGB 17,23,10 ; 136, 184, 80 ([COLOR="#88B850"]this color[/COLOR])
	RGB 21,0,4 ; 168, 0, 32 ([COLOR="#A80020"]this color[/COLOR])
ENDC

Looks strange, right? I was a bit worried I had gone the wrong way. So just to make sure, I dug a bit deeper. First, I found the code that handles sending palette data when the titlescreen is loaded. It is found on line 113 of engine/palettes.asm (labeled "SenPalPacket_Titlescreen"). From there, I found the palette "packet" sent to the titlescreen in data/sgb_packets.asm, specificially at line 208, which shows:
Code:
PalPacket_Titlescreen:    PAL_SET PAL_LOGO2, PAL_LOGO1, PAL_MEWMON, PAL_PURPLEMON

What this tells us is that in the data/super_palettes.asm file, the palettes labeled as PAL_LOGO2, PAL_LOGO1, PAL_MEWMON, and PAL_PURPLEMON are all sent to the titlescreen when it loads its palettes. So we are on the right track!

For this, look for the comments denoting those palettes and mess around with the values. It'll take some trial and error but it should work out. You can even try adding some of your own IF DEF sections for custom palettes depending on game version.
 

RaidenRaider

I WILL Catch'em ALL!!!!
21
Posts
8
Years
  • Age 38
  • Seen Apr 15, 2020
I'm glad I was able to help! Now for your next question, I took a peek in data/super_palettes.asm and found this code at line 55:
Code:
IF DEF(_RED)
    RGB 31,29,31 ; PAL_LOGO1
    RGB 30,30,17
    RGB 17,23,10
    RGB 21,0,4
ENDC
IF DEF(_BLUE)
    RGB 31,29,31 ; PAL_LOGO1
    RGB 30,30,17
    RGB 21,0,4
    RGB 14,19,29
ENDC
I have a hunch that these are the palettes we want to edit for the title screen (the comment of "PAL_LOGO1" makes it stand out to me). On the GameBoy, colors are stored in a 16 bit word, using 5 bits for each color with 1 extra left over in this order: [extra (1)][blue (5)][green (5)][red (5)]. This is simply called 15-bit RGB and Nintendo loves this format, as it is also used on the GBC, GBA and NDS. Since each color is only allowed 5 bits per color, this means that each color component will have a value between 0 and 31. To turn this into a normal color value, which ranges from 0 to 255, the value is multiplied by 8.

Here, the "RGB #,#,#" format refers to a macro, which is a piece of code defined in macros.asm that makes it easier for a programmer to write specialized code while the assembler will translate it into a more specific format (in this case the word holding color data).

This is what the values of the RED palette would thus be:
Code:
IF DEF(_RED)
    RGB 31,29,31 ; 248, 232, 248 ([COLOR=#F8E8F8]this color[/COLOR])
    RGB 30,30,17 ; 240, 240, 136 ([COLOR=#F0F088]this color[/COLOR])
    RGB 17,23,10 ; 136, 184, 80 ([COLOR=#88B850]this color[/COLOR])
    RGB 21,0,4 ; 168, 0, 32 ([COLOR=#A80020]this color[/COLOR])
ENDC
Looks strange, right? I was a bit worried I had gone the wrong way. So just to make sure, I dug a bit deeper. First, I found the code that handles sending palette data when the titlescreen is loaded. It is found on line 113 of engine/palettes.asm (labeled "SenPalPacket_Titlescreen"). From there, I found the palette "packet" sent to the titlescreen in data/sgb_packets.asm, specificially at line 208, which shows:
Code:
PalPacket_Titlescreen:    PAL_SET PAL_LOGO2, PAL_LOGO1, PAL_MEWMON, PAL_PURPLEMON
What this tells us is that in the data/super_palettes.asm file, the palettes labeled as PAL_LOGO2, PAL_LOGO1, PAL_MEWMON, and PAL_PURPLEMON are all sent to the titlescreen when it loads its palettes. So we are on the right track!

For this, look for the comments denoting those palettes and mess around with the values. It'll take some trial and error but it should work out. You can even try adding some of your own IF DEF sections for custom palettes depending on game version.

Wow, this is so detailed. You really know what you're talking about. Your help it so appreciated on this. I'm definitely putting you down on my Special Thanks section as a contributor to my hack once I launch it, because you've been so incredibly helpful to me. It's taught me some new things that I never knew before as I'm new to ASM editing.

I've actually been working with Mateo on a version on his Red++ ROM Hack, but instead of his extra Pokemon (from 152 to 205), I've added all of the monsters from Gen II (Chikorita to Celebi), on top of the original 151 (Bulbasaur to Mew). When I launch it, I plan to have a Normal version (Red 251), a Hard version (Blue 251) and an Extreme version (Green 251), with each one having an increased level curve in Trainer and Gym battles, as well as Wild encounters).

All I need to do now is edit some of the splashscreens that Mateo put in place (he's going to help me with that), add the four new maps for Raikou, Entei, Suicune and Unown (so that there is only one of each in the game), add the Shiny versions of all 251 Pokemon (I have a few ideas on how to add them thanks to studying the Red/Blue Deluxe Disassembly on Github), and then when Mateo adds the Battle Tower, the Pokegear Pouches, the TM Cases, Dive Areas, Move Tutors/Deleters/Relearners, Special Attack/Special Defense split into two stats, and other content to Red++, then I'll be adding them to my hack too.

Would you like to see the titlescreens I've edited? I can even give you the link to the Github source (that I'm updating later on today), so that you can test it out yourself.
 
Last edited:
4
Posts
9
Years
  • Age 31
  • Seen Feb 24, 2024
Anyone know how to change level-up moves in Pokemon Red? I can't find any tool, maybe u can explain me how to edit those moves with the hexadecimal.

Thanks in advance
 
Back
Top