New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doubts about the reverse engineering process #31

Closed
raphaklaus opened this Issue Feb 13, 2018 · 11 comments

Comments

Projects
None yet
4 participants
@raphaklaus

raphaklaus commented Feb 13, 2018

Hi! First, great job on this!

I have some questions about the process:

  1. How did you manage to rip all text dialogues?

  2. I know some Game Boy ROMs that have compressed graphics. How do you guarantee that only converting ROM banks will give you all graphics data from the game?

  3. Is there any plan on music and SFX? Maybe a tool or technique to rip that?

Cheers!

@kemenaran

This comment has been minimized.

Collaborator

kemenaran commented Feb 13, 2018

Hello!

  1. How did you manage to rip all text dialogues?

Well, @Sanqui did that, and is much more skilled than me, so maybe they can explain better how they did :)

I think he got the data format from the ROM hacking community (there are some documentation about how LADX stores various data, like dialogs, maps or dungeons, used for level editors). He then used a python script to read the dialogs.

I guess the same thing could be done for maps, for instance: the data format is pretty well documented, and could be turned into an asm source file with a python script.

  1. I know some Game Boy ROMs that have compressed graphics. How do you guarantee that only converting ROM banks will give you all graphics data from the game?

Very few graphics are compressed in LADX – and the one that are (like photo pictures) are using a very basic compression scheme.

That said, I can be sure the disassembly produces the exact original ROM because every time it is build the digest is compared to the one of the original one – and they have to match. So we are sure the exact same binary is produced.

  1. Is there any plan on music and SFX? Maybe a tool or technique to rip that?

There are no tools for now, but that could be interesting! If you are interested, I would go to see how the pokered project disassembled the musics of Pokemon Red and Blue. Same thing, they have some python scripts to turn the data into assembly. Of course the data format is probably not the same, but it could be figured out.

@Drenn1

This comment has been minimized.

Drenn1 commented Feb 13, 2018

About music: I've dumped music from Oracle of Ages/Seasons, though the formatting is pretty rough compared to the pokemon projects. Need to polish that a bit.

Dumper: https://github.com/Drenn1/ages-disasm/blob/master/tools/dumpMusic.py
Ages music: https://github.com/Drenn1/ages-disasm/blob/master/audio/soundChannelData.s

I'm pretty sure Link's Awakening uses a different format, though I haven't looked very far into it.

@kemenaran

This comment has been minimized.

Collaborator

kemenaran commented Feb 13, 2018

@Drenn1 oh, neat. How did you figure out the format? By disassembling the sound routines, I guess?

@Sanqui

This comment has been minimized.

Sanqui commented Feb 13, 2018

What @kemenaran said is mostly right. Actually, I didn't even look up any documentation. I found the text in the intro ("What a relief!"), set a breakpoint on it, and traced back the relevant code to figure out where the pointer table is. From there I was ready to write a script to dump all the text. :)

@raphaklaus

This comment has been minimized.

raphaklaus commented Feb 13, 2018

@kemenaran thank you for pointing that out! I'm interested in contributing to music, but I know it's hard to track this.

@Drenn1 interesting. Do you know if this sound format is somehow related to GBS (Gabe Boy Sound System)? I know that every Game Boy game has its own sound driver. Making things hard to understand. Can you explain how was the process of disassembly the music/sound a bit?

@Sanqui that's cool! So you made a dynamic analyze. I've checked your script. I'm not so good with Python (I'm JS guy) but it gives me many insights :)

@Sanqui

This comment has been minimized.

Sanqui commented Feb 13, 2018

@raphaklaus GBS is not a format per se, it's essentially a stripped down ROM with only the sound driver and music.

The text.py script isn't particularly good code. It's a one-off written to serve a purpose ("write once, read never"). Don't try to learn from it, really :)

@kemenaran

This comment has been minimized.

Collaborator

kemenaran commented Feb 13, 2018

@raphaklaus you could have a look at pokemon red music disassembling script (in Python also) and the resulting output. (I'm not vouching for the quality of the Python code though)

@kemenaran

This comment has been minimized.

Collaborator

kemenaran commented Feb 13, 2018

(@raphaklaus and here are the macros defined to make the audio files readable)

@raphaklaus

This comment has been minimized.

raphaklaus commented Feb 13, 2018

@Sanqui You're right. GBS is more a GB Program than a format. Thanks for the clarification! About text.py too late! 😂 I really don't care about beauty code, but what the logic can teach me :)

@kemenaran I'm kind familiar with PokeRed Disasm, but I didn't know about the macros! That's really good to make files readable and make sure it will compile back to binary format with the same SHA signature. Is there a Slack channel or something like that so we can chat about this project's contributions? I'd love to make some contributions in sound/music area.

Maybe I can write some tools to help the disassembly process. I wrote two in the past but it's in NodeJS. Is there a problem to be in this language or do you prefer Python only?

@kemenaran

This comment has been minimized.

Collaborator

kemenaran commented Feb 14, 2018

@raphaklaus for me the tools language is secondary; it's more about the output anyway, so Node would be fine 👍

I just created a Discord chat for LADX; you can join here if you wish! https://discord.gg/sSHrwdB

@kemenaran

This comment has been minimized.

Collaborator

kemenaran commented Mar 13, 2018

(The discussion has been inactive for a month; closing this issue.)

@kemenaran kemenaran closed this Mar 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment