• 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 Conquest 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.

[SOLVED] [pokeemerald] Blank/Black Screen after Changing Bag Menu Sprites

  • 3
    Posts
    185
    Days
    • Seen Nov 14, 2024
    Hi everyone! I'm brand new to rom hacking so I need a little help here. I'm working on the pret/pokeemerald and I recently finished adding 4x more bag pockets. I successfully did that & it works great!

    So my next step was to change the bag sprite in the menu to that of Diamond/Pearl to better reflect the additional pockets. I never found a tutorial for changing the bag sprite (except for old binary guides), but I found a few things about changing sprites in general.

    With that, I found the sprites for the different pockets and resized them to 64x64 and merged them into a vertical sprite sheet just like the bag_female.png & bag_male.png. I opened them in graphicsgale to change color depth to 4bpp, changed their background/transparent color to the same as the original sprites, saved & exported the new files to replace _female.png & _male.png.

    I also exported the palettes of each as bag_female.pal & bag_male.pal to replace bag.pal as they had slightly different palettes. I also edited every reference to BagPalette to BagMalePalette and added a BagFemalePallete counterpart in those locations. I finally edited case 4 in src/item_menu.c. I mirrored case 3 with the if (IsWallysBag() = TRUE…) to load the male bag palette else load the female bag palette.

    I noticed in src/item_menu_icons.c that the ANIMCMD_FRAME increased by +64 for each bag pocket after the closed bag at the top of _male.png & _female.png; so I replicated those values & calculated the frames for the new pockets. I also noticed further down the file that the const struct for each of their sprite sheets had a 0x3000 which is 12 kB (2 kB for each 64x64 pocket on the sprite). My new sprites needed 18 kB (2 kB x 9 (8 pockets + closed bag)). So I changed 0x3000 to 0x47FF.

    Everything seemed in order, so I manually deleted the old .4bpp and .lz files and did a "make clean" to be safe. I then did a fresh "make". I didn't receive any errors this time so I thought I did everything correctly. Booted up the rom and made a male character, went through the intro, & opened the bag…blank/black screen with no change no matter which buttons I pressed. Rebooted the rom and chose a female character, and when I finally opened the bag…same thing happened.

    I don't know what else to do from here! Any help would be appreciated! Thanks in advance!
     
    UPDATE: So I downloaded the bags and .pal file from pret's pokediamond decomp. Had to resize the male bag png first, and replaced bag_male, bag_female, and bag.pal (which now had the same palette for both bags). Adjusted the animcmd frames and reverted the 0x47FF to 0x3000 because I'm pretty sure i definitely misunderstood what I thought that was. I reverted case 4 in src/item_menu.c to what it was.

    Now the female bag loads fine except for two pockets, the first is a jumbled mess and the other is blank, both of which are later (lower) in the bag_female.png. The same thing happens in the male bag, but the colors are reversed as well (brown spots are red and red spots are brown). I think I can fix that part, but I'm still stuck on the jumbled and missing frames.
     
    UPDATE/SOLVED: So I figured out the reversed color in the male bag. The palette colors were reversed, so I swapped them to the correct order matching the female bag and the bag.pal. Bot bag colors are accurate now. I then changed the 0x3000 to 0x3FFF as I did understand that part correctly. Both bags now work perfectly.

    I'm still not sure exactly what caused the problem, only that it is now solved. My guess is something with the palette, but I don't know for sure.
     
    Back
    Top