GBATemp ROM hacking documentation project (new 2016 edition out)

Discussion in 'NDS - ROM Hacking and Translations' started by FAST6191, Jan 28, 2008.

  1. FAST6191
    OP

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    22,349
    Country:
    United Kingdom
    Yeah I am not sure what happened there, lyx is usually pretty reliable in making pdfs that are worth having. I would never really have searched it either as I have the base document here and otherwise know where most things in it are/have the contents page.

    Anyway that version copies and searches so there is that for now. I am probably going to return to it soon and fiddle with some stuff, maybe even finally finish the bit on GBA audio, so I will update things on the main page/download then.
     
    I pwned U! likes this.


  2. Bad Bunny

    Member Bad Bunny Boy from Japan

    Joined:
    Feb 27, 2016
    Messages:
    110
    Location:
    Great Bunnyland Emperor Castle
    Country:
    Japan
    Sir, can you teach me how to add more space for text edit on nds and PSP game. Because I have this problem when I try translate some game with limited font problem with no space....
     
  3. FAST6191
    OP

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    22,349
    Country:
    United Kingdom
    Assuming you don't face scripting or memory issues (both things on many platforms, the latter especially on the systems like the DS and PSP which do not have things able to be mapped to memory) then it is usually pointers you want to play with. I am not sure of the specific forms PSP pointers take (I have seen a few, they are fairly obvious and nothing too strange there) but DS ones I cover a few examples of in the docs. In the case of the DS you might also have to alter file size indicators or section size indicators (seen both in text files and in countless other files on the DS) but it is still going to be pointers and size values much like the pointers for the text itself.
    The short version is pointers are lists of numbers, usually early in the file, which say how long or where each line/section/whatever is within the file.You make one longer and the pointers after it are out by however much longer you made it so you need to change that pointer and all of them after it, same again for the next line and the next line and the next line... so most redo pointers once they have finished editing. If you are lucky each section will end or start with something you can search for, copy the search results and then manipulate numbers with a spreadsheet or program or something before putting it back in.
    There are other things some games use but it is not very common and hopefully you do not face it here.

    Fonts can come into it, especially if you are doing a 16 bit to 8 bit conversion, but for the most part are separate concepts.
     
  4. Bad Bunny

    Member Bad Bunny Boy from Japan

    Joined:
    Feb 27, 2016
    Messages:
    110
    Location:
    Great Bunnyland Emperor Castle
    Country:
    Japan
    Sorry sir I still lost at here because
    I don't know what pointer is???
    Can you show the pic of pointer. It's easy explanation for me to understand sir :)
     
  5. FAST6191
    OP

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    22,349
    Country:
    United Kingdom
    It is all in the guide in far more detail than I can reasonably do here.

    Equally they can take many forms, a picture of one might well have no real bearing on another type unless you already understand the concept.

    Generally though they are long lists of numbers somewhere in the ROM or in the file or in a similarly named file, if they are in the file it is usually at the start of the file before the text/pictures/sound/whatever starts. They are a thing which tells you (points if you will) to the location within the ROM/file/memory that houses the piece of data you need. They are what the game uses so when you make things longer or shorter it then when it tries to load from the location the pointers say it gets something else and you get garbled text, crashing and such.
    The pointers can take several forms, the big three main ones being standard (the pointers point directly to the location in the file), offset (they start counting somewhere else than the start of the file) or relative (you take the position of the pointer and add the value of the data the pointer location holds to the location of the pointer and get where you are going, this is annoying but does make some things slightly quicker).

    I usually describe pointers like being the contents page of a book, if you imagine inserting 10 extra pages somewhere in the middle then everything else will be shifted by 10 pages, take out 4 pages a bit later after that and then some things are 10 pages out, some are 6 pages out and you have to redo everything. Back in games you are probably not going to be changing just two lines but all of them.

    There are other options, including scripting based text systems (I have an example from the wizard of oz game in the docs) and fixed length systems (common in older games in menus), but you are probably not going to be facing them.
     
    Anjiera and Bad Bunny like this.
  6. Bad Bunny

    Member Bad Bunny Boy from Japan

    Joined:
    Feb 27, 2016
    Messages:
    110
    Location:
    Great Bunnyland Emperor Castle
    Country:
    Japan
    O
    OK I got it and thanks sir:)
     
  7. kprovost7314

    Member kprovost7314 I AM 14, NOT 25!

    Joined:
    Dec 24, 2014
    Messages:
    1,376
    Location:
    In that bara manga ( ͡° ͜ʖ ͡°)
    Country:
    United States
    Sorry to bump, but can this help with reverse engineering file formats on current systems and games too?
     
  8. FAST6191
    OP

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    22,349
    Country:
    United Kingdom
    It is not aimed at it, and a lot of the examples are specific and kind of tailored to what is on the GBA and DS, but I doubt it will hurt. It does not cover some of the things seen in the latest and greatest formats (I barely touch floating point for instance, and going from there I do even less with some of the crazy 3d maths that some modern formats are based around), however throughout all of it I hoped to show that understanding the concepts underpinning it all (learning that the pointers for a file are 2 bytes per entry is one thing, learning what pointers are and why you need to know them is another and what I aimed to cover more) is what you want. Equally I have wandered into new systems I have no idea about prior to wandering in ( http://gbatemp.net/threads/a-little-bit-of-3ds-rom-hacking.333348/ being one such example), in such cases what I learned from the GBA and DS helped, and combined with some hardware documentation for that system I was able to make some headway.
    I don't know if I have something else I can link that will be more general, most of the time I would go in for programming and hardware so I don't know what else is really out there. That said I did a quick search using "guide to reversing formats" as the term and it brought back some good stuff.
     

Share This Page