Thread: [Tutorial] 1st Gen Hacking: Useful Links
View Single Post
  #36    
Old March 3rd, 2016 (4:33 AM). Edited March 3rd, 2016 by RaidenRaider.
RaidenRaider's Avatar
RaidenRaider RaidenRaider is offline
I WILL Catch'em ALL!!!!
     
    Join Date: Jan 2016
    Gender: Male
    Posts: 50
    Quote:
    Originally Posted by Lostelle View Post
    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 (this color)
        RGB 30,30,17 ; 240, 240, 136 (this color)
        RGB 17,23,10 ; 136, 184, 80 (this color)
        RGB 21,0,4 ; 168, 0, 32 (this 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.
    Reply With Quote