Pokemon Yellow romhack - Problems with corrupted sprites
Posted by: Finish3r
Date: 2020-05-02 12:04:55
Hello! First of all, this is about a small romhack I'm making. I just got a random inspiration couple of days ago, and decided to add Gorochu (lost evolution of Pikachu and Raichu) back to the game. Since I've been having problems with it, I decided to post here, as I've been lurking here a long time, and you've probably reverse-engineered the game so well that you'd know what is wrong here.
First, I downloaded a Pokemon Yellow (US) ROM disassembly, and started looking how the game was made, and inserted Gorochu in accordingly. I have been building ROM's inbetween to check that everything is working, and happened to keep one where Gorochu itself is like a even more random and corrupting 4 4, and 4 4 itself is not harmful at all, haha!
So, I've gotten almost everything working to this point. I inserted Gorochu to hex $56 (former Missingno. and next slot after Pikachu and Raichu for convenience), and coded him to be Pokedex number #027, moving every other pokemon after that up one slot (Mew now being #152). Base stats, typing, cries, Pokedex entries and everything seems to be working fine. Only thing; Gorochu's sprite is corrupted
It seems like something is going wrong in sprite decompression (not sure, just guessing), the sprite just don't seem to load in properly, and with very wrong data. I've looked through the code many times and I can't find anything wrong, no typos, anything. Also every file where other Pokemons are mentioned, I've added Gorochu in the same way.
Could it be some pointers messed up or misaligned data otherwise?
EDIT 2: Attempted to use "Gorochu" in battle with partial success. The backsprite is extremely volatile, as it loads a very long time and when loaded, it instantly corrupts a varying amount of memory. Going through the source code yet again.
EDIT 3: Edited main.asm very slightly, as the sprite bank loading code seemed to skip Gorochu altogether. No effect.
EDIT 4: Massive breakthrough! Gorochu's sprite offset caused all other Pokemon after it to become corrupted. Adjusted the offset, and no more problems there. Gorochu's sprite still doesn't want to load, though. Also, added an custom attack just for Gorochu, called "Arc" which is Electric-type, with 170 base damage, 70 accuracy and 10 PP. That works fine, but it shows up as Thunder Wave.