| |||
Views: 88,431,377 |
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search | 04-18-24 12:08 AM |
|
Guest: Register | Login |
0 users currently in ROM Hacking | 1 guest |
Main - ROM Hacking - Pokemon Red disassembly | New thread | New reply |
stag019 |
| ||
Snifit Level: 40 Posts: 283/299 EXP: 409320 Next: 31989 Since: 02-19-07 Last post: 4271 days Last view: 2158 days |
A while back, IIMarckus started disassembling Pokémon Red, and storing the results in a Mercurial repository. The purpose is both to document code and data formats, and to make them easier to edit. (Though truly easy editing is still a ways off, repointing with an assembler is still much easier than in a hex editor.)
Currently, we have 3 main workers, one new one, and me (I'm off on my own separate world trying to get it to compile either Blue or Red version). But we could still use lots more help! Lots of discussion goes on in the IRC channel. |
blackhole89 |
| ||
The Guardian Moloch whose eyes are a thousand blind windows! Level: 124 Posts: 3896/4196 EXP: 21518444 Next: 318157 Since: 02-19-07 From: Ithaca, NY, US Last post: 463 days Last view: 75 days |
|
stag019 |
| ||
Snifit Level: 40 Posts: 284/299 EXP: 409320 Next: 31989 Since: 02-19-07 Last post: 4271 days Last view: 2158 days |
[20:05:44] kanzure wait, there's gameboy plugins for ida pro?
[20:05:45] kanzure shit man [20:06:09] kanzure has been meaning to use his copy of ida pro for a while now.. Also here's a link to the progress we've made so far. (Warning: 1,678.06 KB) Everything that's in Red is currently just copied directly from the ROM. What's in black is what's either disassembled, or included as data. |
blackhole89 |
| ||
The Guardian Moloch whose eyes are a thousand blind windows! Level: 124 Posts: 3897/4196 EXP: 21518444 Next: 318157 Since: 02-19-07 From: Ithaca, NY, US Last post: 463 days Last view: 75 days |
|
smkdan |
| ||
Ninji Level: 36 Posts: 234/238 EXP: 288451 Next: 19659 Since: 05-26-07 Last post: 4054 days Last view: 4003 days |
I had a look and that's some pretty good progress. I'm surprised at how much you guys already figured out. It's nice to see the older versions getting some attention. I know this game has a bad reputation for being horrible on the inside but I haven't really dug into the actual code myself.
I have some old snippets of code from when I was helping someone else figure out a few things in the Red ROM. I didn't see them on the Mercurial page so I'll pastebin them for reference. The comments are probably inaccurate and I'm missing huge chunks of info so double check everything in a debugger if you plan on using anything here. It might save you guys some time atleast. critical hit probability some attack/defense/critical hit manipulation, setting up for damage calculator damage calculator main part - should be consistent with the damage formulas floating around, covers some special effects like the suicide moves cutting enemy defense in half. Missing lots of comments. some code for fixed damage moves I know I have more than that but it's probably on my other PC. I'll have a look later on. @blackhole: I heard IDA has issues dealing with the 65816 8bit/16bit variable length oddness but I don't know if it's been fixed in a recent version. |
blackhole89 |
| ||
The Guardian Moloch whose eyes are a thousand blind windows! Level: 124 Posts: 3899/4196 EXP: 21518444 Next: 318157 Since: 02-19-07 From: Ithaca, NY, US Last post: 463 days Last view: 75 days |
|
smkdan |
| ||
Ninji Level: 36 Posts: 236/238 EXP: 288451 Next: 19659 Since: 05-26-07 Last post: 4054 days Last view: 4003 days |
I don't know if it's the heuristics as much as the dynamic instruction length. This here is one of the few posts I can google on the topic but it refers to really old versions. I found another module here but it recommends you turn off the autoanalysis when using it. Looks like a really recent version added a 65816 module.
I'm still stuck on 5.2 and the other module I linked doesn't seem to work with it. I'm guessing the new versions have added flexibility that make 65816 more practical though. |
stag019 |
| ||
Snifit Level: 40 Posts: 285/299 EXP: 409320 Next: 31989 Since: 02-19-07 Last post: 4271 days Last view: 2158 days |
Posted by smkdan Thank you. We have or are shortly going to turn those into issues and then work on them when we get the chance. Currently there's more info known than there is people to start tearing the info apart though. If you get the chance, maybe you could test some of it out, fork the repo, and then work on adding it yourself. Posted by smkdan That would be great. |
stag019 |
| ||
Snifit Level: 40 Posts: 286/299 EXP: 409320 Next: 31989 Since: 02-19-07 Last post: 4271 days Last view: 2158 days |
Never really explained this so:
Currently the way it works is this: data we understand is either disassembled, or included in separate files (like graphics) with "incbin". The rest of the data we have yet to get to is "incbin"ed from a base ROM of Pokemon Red. When the disassembly is finished, the base ROM will no longer be necessary. But in the mean time it serves as a way to prove the newly assembled ROM is a 1:1 copy of the original ROM. Want to see just how much progress we've made? Here is a viewer that shows (randomly selected, but in order) commits. The data in black is either empty or disassembled. The data in red is what is "incbin"ed from the base ROM. The further we move along in the project, the less red. (Some of you may notice the image is not a full 1024x1024 to represent 1MB, this is because everything after and including bank 2D is completely whitespace. I trimmed the images so that the page will fit perfectly in full screen mode with a resolution of 1024x768. Also, this page will not stay at this url forever and I will update the post when the change occurs.) |
smkdan |
| ||
Ninji Level: 36 Posts: 237/238 EXP: 288451 Next: 19659 Since: 05-26-07 Last post: 4054 days Last view: 4003 days |
If I want something different to do when I'm taking a break from other projects, I'll get an account there and commit a few comments. Until then, here's what I have left in terms of commented code. I have most of the damage calculator figured out but I saw a table with type effectiveness that makes it look like you already have that stuff sorted. When you say you have plenty of info but few people to work with it, do you mean info in terms of commented disassembly like this or does it mean info that needs to be tied to something in the disassembly? Are you guys sitting on a lot of code that hasn't been committed yet?
Move effect jump table code. Knowing that would make it easy to trace any move effects that you guys don't already know. Freeze/burn/paralyse effect handler. Called from the above jump table code for moves that possibly have any of those effects. Substitute effect handler. Also called from the jump table code. Note the 0HP bug. Code that checks target for substitute. Just a random helper routine. A few flags in RAM that I didn't spot in constants.asm. The last critical hit code looked pretty awful so I got the debugger out and confirmed a few things. This copies base stat data of the current monster to D0B8 in RAM which is then used for the critical hit stuff (for base speed) and whatever else happens to use it. Here is the critical hit code with less terrible commenting. Focus energy is used there with the bug that cripples your chances at scoring a critical hit by quartering the speed used in the probability check. |
Main - ROM Hacking - Pokemon Red disassembly | New thread | New reply |
© 2005-2023 Acmlm, blackhole89, Xkeeper et al. |
MySQL - queries: 67, rows: 96/97, time: 0.016 seconds. |