|
GuyPerfect Catgirl Level: 68 Posts: 86/1096 EXP: 2665801 For next: 62999 Since: 07-23-07 Since last post: 1.7 years Last activity: 220 days |
| |||||||||||||||
| DISCLAIMER:
Do not, in any way, attempt to distribute ROMs or offer to give ROMs to other people. This board does not endorse illegal activity, and it is expressly forbidden to you to partake in it. Make your own backup ROMs using your own, legaly purchased game cartridge. Don't steal from someone else. Disclaimer out of the way, there's a number of different F-Zero X ROMs out there, many of them hacked versions like most N64 games. You'll often find one ending with a [!] which is a de facto symbol representing "good dump." This level editor will support [!] ROMs and nothing else, so make sure you have an appropriate version. There are currently seven ROMs for F-Zero X defined by the emulation community. They are as follows: * F-Zero_X_(J)_[!].z64 - The original Japanese version * F-Zero_X_(U)_[!].z64 - The North American version * F-Zero_X_(E)_[!].z64 - The PAL edition; given E for "European" * F-Zero_X_(J)_[!].v64, F-Zero_X_(U)_[!].v64, F-Zero_X_(E)_[!].v64 - As above, but in V64 format. * F-Zero_X_Expansion_Kit_(J)_[!].ndd - The Expansoin Kit disk. We'll be using this, but not right now. The Dr. V64 backup devices for Nintendo 64 have a known quirk in that every pair of bytes is reversed in ROM files made with that technology. That is to say, if normal byte ordering is ABCD, then a V64 ROM would show BADC. This is known as "byte swapping," and is important to take into account when working with N64 games. __________ If you were to write a program to determine which version of the ROM is being loaded, this is what you'd do: * F-Zero X is a 16MB ROM. That means that any valid F-Zero X ROM file must be exactly 16,777,216 bytes in length. If it is not, well... it's either not F-Zero X or some modified variant of the ROM that you shouldn't be expected to support. * Every N64 ROM has an internal name set by, I believe, Nintendo themselves when a game was published. The name is located at byte 0x20 in the ROM and is 20 bytes long. Now, that first one's a hexadecimal 20 and the second one's a decimal 20. Don't get them confused. F-Zero X's internal name is "F-ZERO X" padded with 12 spaces at the end. If that's the string you found in the ROM, it's Z64 format. If it shows up as "-FEZORX ", then it's V64 format and every two bytes swap position with each other. * At offset 0x3E in the ROM for Z64, and 0x3F for V64, is a single byte specifying which region the game was targeted to. It's a single, ASCII character to make life easier. Technically, it's part of the game's identifier code, but that one character is all we need to determine version. "J" is Japan, "E" is North America (English), and "P" is PAL. This may seem like a trivial piece of information, but each version of the ROM has data in different spots, so it's a crucial bit of knowledge if you want to get anywhere. __________ What we'll need to do first thing before we can do anything else is to have a function that can load a ROM file into memory. If anyone has experience in programming, this is what I want, programmed in C. Keep in mind that it must be your own work and will be licensed under the project's license. Since I botched up the code request by not thinking it through well enough, I'll give you guys a freebie and post a definition of that function right now: --Code moved to later post-- So then... Next, we'll need a function that can identify the ROM version. It should check file size, ROM name string, ID region character and byte ordering (V64 or otherwise) as described earlier in this post. Function prototype: char fzxROMVersion(unsigned char *ROMData, unsigned long ROMSize) ROMData - Pointer to the ROM data in memory. ROMSize - Size of the ROM file in bytes. Description: Checks ROM data to determine version and format of F-Zero X, if any. Return value: Returns a pre-defined code designating the detected version of F-Zero X. J, U and P specify Japanese, North American and PAL versions, respectively. Z and V specify normal byte ordering (Z64) and byte-swapped (V64) respectively.
|





