shinyquagsire23 / FR-SkittyTitlescreen

A custom title screen for Fire Red written in C
1 stars 1 forks source link

How would one go about applying this patch? #2

Open trevor403 opened 10 years ago

trevor403 commented 10 years ago

I am familiar with the terms you are using, but i dont think i understand how to do this exactly, heres the process I think... First I compile, that part is easy. Then you go into Free Space Finder, and find an area the size of bootloader.bin and intro.bin together. Then you insert bootloader.bin into the offset at the start of that free space, next you insert intro.bin in the free space after it. Finally, you repoint 0x0800CC90 to wherever the offset for bootloader.bin is? I am confused about some parts of this. First of all is bootloader.bin needed or will intro.bin be fine alone, and second what tool should we use for repointing? I, like you am a pokemon hacking enthusiast who used linux, ubuntu to be specific. And I am guessing you, like me, use wine for all those pokemon hacking tools, so which tool does hex repointing? Thank you and I love your work, all of the FR projects you have made are amazing, just hope I can learn how to apply them! Thanks!

trevor403 commented 10 years ago

To answer myself on the repointing, there is a function that you made in a commit of GBAUtils that lets you repoint, https://github.com/shinyquagsire23/GBAUtils/commit/6165752bf6e176c70fb3a665b1da9f9e5891db9f But I was wondering what you use personally to repoint, I could always just build a frontend to your repoint function

trevor403 commented 9 years ago

I just spent my entire night, 4 hours, trying to figure out how to put the bootloader and intro into a rom and repoint. Could you please explain how to do this all better!? I am falling part!

shinyquagsire23 commented 9 years ago

@trevor403 The bootloader goes directly in front of the compiled C .bin, so in freespace you'd have [bootloader][compiled C], back to back.

trevor403 commented 9 years ago

Awesome I figured that out from the post on PHO, I made this code to repoint but it is not really working...

public class Main {
    public static void main(String[] arguments) {
        String location = "/Users/trevor/Desktop/title/FR-SkittyTitlescreen/fire.gba";
        int romID = ROMManager.getID(); 
        try
        {
            ROMManager.AddROM(romID, new GBARom(location));
        }
        catch (IOException e)
        {
            e.printStackTrace();
        }
        ROMManager.ChangeROM(romID);
        GBARom rom = ROMManager.getActiveROM();
        rom.repoint(0x0800CC90, 0x790000);
        System.out.println("Done");
    }
}

If I place the bootloader and intro in the default place you specified by running:

java -jar AddASM.jar fire.gba bootloader.bin 0x7C0000
java -jar AddASM.jar fire.gba toASM.bin 0x7C0058

Will that repoint work? Hope you can shed some light, thanks!

shinyquagsire23 commented 9 years ago

If it's at 0x7c0000, then you need to repoint at 0x0800CC90 to 0x7c0000. Also, 0x0800cc90 is a GBA address, if you're working in a hex editor or something then it would just be 0xCC90 there. Also, make sure to edit in the offset you're inserting the C at in linker.lsc.

trevor403 commented 9 years ago

I was just going to use your offset? I accidentally wrote 0x79... instead of 0x7C... Anyways could you tell me what my java -jar AddASM.jar arguments would be and what my rom.repoint(); arguments would be?

trevor403 commented 9 years ago

Sorry I'm not too good at Hex and ASM so I get lost when it comes to things this low level.