Author
|
Topic: Famicom Disk System Info (Read 1 times)
|
Goveynetcom
Guest
|
|
« on: August 10, 2010, 06:24:51 pm » |
|
Hello all . Currently hard at work on a project with someone, but I have run into much trouble. Well, the translation part has been mostly done and I am doing the hacking. But I have realized, that I have a lot of work to do. So, I realized that I will need to expand a text box and such (currently investigating on how to do that), but I want to play with some of the text a bit more first. I don't know much about pointer table hacking, which is why I am asking here. Reading a couple tutorials, and one of them said this: To find a pointer table for the text in your rom, it is nessessary that you know where the text is in the rom, what hex signifies the end of a line, and by knowing these you can then find the beginning of the text block. Once you find the beginning of the text block the pointer table should be IMMEDIATELY before the text! It will look like it has a pattern to it. Figuring out the pattern is mostly up to you, but here is pretty much how you figure out how it works. Take an address from the beginning of a line. (An example would be 012D63) and knock off the all extra letters except for the last 4 digits making it 2D63. Pointer tables store addresses in pairs so 2 hex values are needed... break up 2D63 into pairs and you got 2 hex values.. 2D, and 63! Now before you break up the hex values, you gotta subtract the header from the address. Since the NES header is 10 hex bytes, subtract 2D63 by 10 making it 2D53. Now break this up into pairs making it 2D 53, and then re-arrange it backwards! (thats how roms store addresses. so 2D 53, becomes 53 2D. This will tell you one of the hex values in each pointer in the pointer tables. You should be able to find 53 in there, but 2D might be something else.. So you're actually looking for 53xx (where xx is unknown). That's up to you to figure out!
An example of a pointer table followed by text in an NES rom:
019D30: 4D76 00F8 349D 3B9D 419D 449D 499D 4D9D 019D40: 529D 569D E5E3 F6CD 4ADA 70F8 F9FA FBF0 019D50: 704C FE70 4BDD CEF3 705C F64D 704C F6CF 019D60: CE70 F5DD CB70 4BF0 DDF1 F2DD F370 83B7
I understand most of it, but here is the thing I am unsure of. I know the NES header is 10 hex bytes, but how long is the FDS header? I know the two systems are very similar, but not entirely. And it's not nearly as well documented. And I was wondering if a veteran hacker could tell me. I suppose I'll try to figure it out by comparing roms, but I'm looking for any information. Thanks, Govey
|
|
|
|
KingMike
Guest
|
|
« Reply #1 on: August 10, 2010, 10:02:00 pm » |
|
To be able to calculate a pointer for FDS, you have to know where it is relative to the start of the file on the disk. If you use a program that splits a FDS "ROM" into separate files (and hopefully tells you the information from the file header, most importantly, the RAM offset its loaded into), it's pretty easy: file offset + RAM address. If you're hacking the .fds file directly, then it's a pain in the ass. The only way you can tell where the file starts is by finding the file name (I believe there's always 8 bytes and in my experience has always been ASCII text. Immediately preceeding the file name is 3 bytes: a byte with a value of 3, and two bytes indicating the file number. I believe the header size is about 17 bytes, followed by a byte with a value of 4 and then the file data. I forget exact which of the 2-byte values in the file header is the RAM offset, but it should probably be the only value from $6000-DFFF (which it needs to be because that is the CPU address of the FDS' RAM).
|
|
|
|
Goveynetcom
Guest
|
|
« Reply #2 on: August 10, 2010, 10:28:38 pm » |
|
Right now I am hacking the rom directly. I forgot FDS is like an archive though. I still remember there was your tool (I think) and another tool that did the same thing. I used them when I hacked Family Composer (which got lost after my format ) But you provided a lot of other useful info. I just wish I knew more about pointer tables :/. But that's what tutorials are for I guess. I'll post again if I run into trouble or if I have more questions. Thanks King Mike.
|
|
|
|
Spinner 8
Guest
|
|
« Reply #3 on: August 11, 2010, 07:36:46 am » |
|
To clarify, the .FDS file format has a 16-byte header (just like NES), but since none of the data is actually necessary, I don't know of any emulators that actually require it. So any ROM you find may or may not have it. If the first three bytes are "FDS", then it has a header.
Like KingMike said, though, if you can break the ROM up into its separate files, it'll be a lot easier to find the pointer that way.
|
|
|
|
Gil Galad
Guest
|
|
« Reply #4 on: August 11, 2010, 06:34:06 pm » |
|
I would most always use FDS-Builder, FDSExplorer while having the nice GUI has a few bugs. I always split the disk when editing, not only is each file easier to edit but you can also expand a file in some cases. Just be careful though.
|
|
|
|
KingMike
Guest
|
|
« Reply #5 on: August 11, 2010, 10:23:08 pm » |
|
I also recommend splitting.
If you're not aware, using savestates with FDS hacks can be tricky. You'll need to use an emu that will allow you to write save data to the same FDS file you loaded (some will only save to an auto-created backup copy). But even then, you're going to want to be careful about savestates. Loading a savestate will undo the changes made to the FDS, so you would need to be able to restart from an ingame save function. If it doesn't have one, you have to start over each time you want to test out a hack. If I had been modifying the FDS file directly, I'd have lost at least a week's progress in Sword of Kalin at one point, with a single errant press of the load savestate key. Hacking a split archive, it was a simple matter of running the recompile program (I probably lost some gameplay progress, but that's generally less of a disaster).
|
|
|
|
Goveynetcom
Guest
|
|
« Reply #6 on: August 12, 2010, 01:37:48 pm » |
|
I was not aware of that all, thanks for that :thumbsup:. But Since I only have the first few screens hacked (it's a long game), I can just abuse the fast forward button. It's funny, but even though all the text is garbled since the english font is in, I can memorize exactly how you're supposed to do things. But I keep a guide for the game as well. Just to test things you're not supposed to do. Anyways, this game apparently has a lot of weird effects it uses for the blocks, it has one for end of the screen, one that puts three dots at the end of things (it glitches a lot though, so I just used the periods I made), and luckily there is one that indents the text. It works great to my advantage, because I can have longer sentences on screen now when I delete the effect. This is one hell of a project though, when (if) I ever finish this I deserve a beer :laugh: :beer:. Plus, this is my first ever major hack, nothing short of a miracle is needed to get this to work well. Think I'll work on it a bit, while I am at this hotel...
|
|
|
|
Bregalad
Guest
|
|
« Reply #7 on: August 13, 2010, 06:04:32 am » |
|
I'd like to point a few things : - FDS disk images are NOT ROMs. They are disk images. - The FDS header has info about the # of disk sides. You shouldn't touch this. - Each sides is a precise # of bytes in the .fds file. This should change. - Each side have a file system on it, you should be able to extract files and modify whathever you want in them and insert them back. You can in theory even expend the files, as long as you don't exceed the RAM reserved for them (i.e. a file will overwrite another important part of memory when being loaded and will crash the game) or the disk side size. - You can find pretty detailed information about the FDS and .fds format here
|
|
|
|
KingMike
Guest
|
|
« Reply #8 on: August 13, 2010, 10:04:44 am » |
|
The .fds header ("FDS",number of sides) can safely be deleted. The disk header (1,*NINTENDO-HVC*), however, should be left alone. I know disk image is technically the correct term, but very few people use that term (possibly because few people hack magnetic-disk-based games, just cartridge or CD/DVD games)
|
|
|
|
Goveynetcom
Guest
|
|
« Reply #9 on: August 13, 2010, 05:33:51 pm » |
|
That's good to know in case I did it on accident . That link was a great one, I love nesdev now. It has so much information, I feel like a kid in a candy store :thumbsup:. I also have been discussing R4300i and MIPS assembly with a good friend of mine. Not on subject, but it's interesting none the less .
|
|
|
|
Bregalad
Guest
|
|
« Reply #10 on: August 14, 2010, 03:42:19 am » |
|
I didn't know the FDS header could be removed, but I guess the emulators can easily guess the # of sides form the file's size.
However, if you plan to distribute your hack as a .ips file you probably don't want to remove the header nor to expand any files in the disk, else the file will be enormous and will contain basically the whole disk image (because bytes will be offset'ed).
|
|
|
|
KingMike
Guest
|
|
« Reply #11 on: August 14, 2010, 11:14:50 am » |
|
I made a FDS file expansion utility. I included it with my Deep Dungeon 1 translation, but I guess I never bothered to release it stand-alone. Here it is.I'll submit it to the site right away. You can use an IPS with expanded files, if you use it to expand the original game files to the same size as your translated files. Just tell the user to expand their original FDS file before applying the patch.
|
|
|
|
Goveynetcom
Guest
|
|
« Reply #12 on: August 14, 2010, 11:33:19 am » |
|
I made a FDS file expansion utility. I included it with my Deep Dungeon 1 translation, but I guess I never bothered to release it stand-alone. Here it is.I'll submit it to the site right away. You can use an IPS with expanded files, if you use it to expand the original game files to the same size as your translated files. Just tell the user to expand their original FDS file before applying the patch. Sounds good . That might just work fantastically! I will play with it now :laugh:. Edit: King Mike, I thought I would be nice and post this. I modified your source code slightly, I added my line of text and fixed the dependencies, and compiled it under my Linux Distro. Here is the download: http://www.mediafire.com/?ztap8yliayrwj54Just thought I would post it for the sake of other Romhackers who use Linux, and have to use Wine religiously just to do any hacking.
|
|
« Last Edit: August 14, 2010, 11:51:44 am by Goveynetcom »
|
|
|
|
|