Z64

Please login or register.

Login with username, password and session length
Advanced search  

News:

Check out and improve the wiki!

Pages: [1] 2

Author Topic: Star Fox 64 hacking thread  (Read 14957 times)

xdaniel

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 295
    • ICQ Messenger - 136250978
    • View Profile
Star Fox 64 hacking thread
« on: April 01, 2010, 12:26:16 AM »

...okay, so far not much hacking, but at least creating an expanded ROM that's free of those dreaded MIO0 blocks, ala Mario 64.

Star Fox 64 ROM Expander: http://magicstone.de/dzd/random/sf64exp_v1.rar (including C source code)

It's actually already outdated, as I'm working on an enhanced "Star Fox 64 Toolkit", which so far is able to list all files it found in the DMA table, extract all those - compressed ones in both compressed and uncompressed form - and of course create an expanded ROM, just like its predecessor.

As for the DMA table, it's similar to the Zelda's, but not identical. Starting at 0x0D9A90 in the ROM, you've got a table with the following layout:
[Virtual start offset (4 bytes)] [Physical start offset (4 bytes)] [Physical end offset (4 bytes)] [Compression flag (4 bytes)]

So, for example 008DD590 008A2E60 008A5700 00000001 means that the file is accessed from offset 0x008DD590 by the game, physically resides between 0x008A2E60 and 0x008A5700 in the ROM and is MIO0 compressed. Also, looking at the first three files in the table, they seem quite similar to the Zelda's makerom, boot and dmadata - makerom with the ROM header and such, boot with ex. debugging messages (the good old "TLB exception on load" and the like) and dmadata of course with the game's DMA table. Is this common across many N64 games, or at least first-party ones?

Other stuff, like level data, etc. is still unknown. Apparently Corneria's data is in the file from 0x008F04C0 to 0x0090D990 in a regular ROM (virtual start 0x0095D2F0), as it contains models and textures from the stage, and messing with the reference to its virtual start offset at 0x0C6C94 makes the level not load correctly in-game - no level models, no allied Arwing, no enemies, not even lighting as it seems, only a bad orange background and your Arwing's reflection in the non-existent water (plus some minute graphical glitching ex. when firing a charged shot).

Jul thread for ROM Expander: http://jul.rustedlogic.net/thread.php?id=8835
Logged
cu xdaniel

Nanami - Desktop:

Kazari - Notebook:

SirTopHat

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: Star Fox 64 hacking thread
« Reply #1 on: April 01, 2010, 07:16:58 PM »

Looks cool, man
Logged
fgsfds

xdaniel

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 295
    • ICQ Messenger - 136250978
    • View Profile
Re: Star Fox 64 hacking thread
« Reply #2 on: April 03, 2010, 07:12:46 PM »

The Toolkit can now reconstruct a ROM purely based on extracted files and a plain text file describing the file order. The only problem? The files must be of the same size as the originals. Even though I am modifying the virtual/physical offsets in the DMA table, as well as all instances of them in the boot file, to fit the changed offsets when using bigger or smaller files, the game keeps crashing when it tries to access one of the moved files! For example, if I add just 16 bytes to Corneria's file, the game dies when the Great Fox is supposed to appear in the intro and when it tries to show the stage intro dialog for Corneria ("Andross has declared war on the Lylat system!" or whatever). Also, the scrolling story text that normally appears before that doesn't show, but is still being spoken.

It's confusing, really, since I don't know what's wrong. Of course, the game appears to choke whenever it's trying to load a moved file, but I'm 99%+ sure that I've changed all instances of the old offsets... Oh well, more research to do.
Logged
cu xdaniel

Nanami - Desktop:

Kazari - Notebook:

Arcaith

  • Administrator
  • Full Member
  • *****
  • Posts: 152
  • Keeping it real. Or something.
    • MSN Messenger - henna.gaikokujin@gmail.com
    • View Profile
    • Email
Re: Star Fox 64 hacking thread
« Reply #3 on: April 04, 2010, 05:18:44 AM »

Still, that's a useful thing to be able to do, especially once custom content is introduced.
Logged
pantsu~

xdaniel

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 295
    • ICQ Messenger - 136250978
    • View Profile
Re: Star Fox 64 hacking thread
« Reply #4 on: April 06, 2010, 07:54:34 PM »

53_00B3F150-00B42F80_vs00DD7620.bin -> Training level data, apparently starting around 0x6AA4 is the level layout itself... clearing ~0x50 bytes to 0x00, starting at that offset, gave me an empty training level, besides ground plane and background. Hopefully more to come.

EDIT: Say hello to my little friend, the floating building!



EDIT 2:

[42C80000] [F448] [FB50] [FF38] [000000000000] [0085] [0000] =
- [Unknown, in-level position? (4 bytes)]
- [X coord (2 bytes)] [Y coord (2 bytes)] [Z coords (2 bytes)]
- [Unknown, always 00? (6 bytes)]
- [Object type (2 bytes)]
- [Unknown, always 00? (2 bytes)]


[42C80000] [F448] [FB50] [FF38] [0000] [0000] [0000] [0085] [0000] =
- [Ascending in-level position (4 bytes)]
- [X coord (2 bytes)] [Y coord (2 bytes)] [Z coords (2 bytes)]
- [X rot (2 bytes)] [Y rot (2 bytes)] [Z rot (2 bytes)]
- [Object type (2 bytes)]
- [Unknown, always 00? (2 bytes)]

EDIT 3:


« Last Edit: April 06, 2010, 08:58:00 PM by xdaniel »
Logged
cu xdaniel

Nanami - Desktop:

Kazari - Notebook:

Arcaith

  • Administrator
  • Full Member
  • *****
  • Posts: 152
  • Keeping it real. Or something.
    • MSN Messenger - henna.gaikokujin@gmail.com
    • View Profile
    • Email
Re: Star Fox 64 hacking thread
« Reply #5 on: April 07, 2010, 10:56:37 AM »

Nice :D That's some fast progress ^_^
Logged
pantsu~

xdaniel

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 295
    • ICQ Messenger - 136250978
    • View Profile
Re: Star Fox 64 hacking thread
« Reply #6 on: April 08, 2010, 09:04:47 PM »

Logged
cu xdaniel

Nanami - Desktop:

Kazari - Notebook:

xdaniel

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 295
    • ICQ Messenger - 136250978
    • View Profile
Re: Star Fox 64 hacking thread
« Reply #7 on: April 16, 2010, 02:36:54 PM »

Update on ROM reconstruction... Apparently, the game doesn't die whenever any file beyond an enlarged one is accessed, but rather it seems to die when it tries to load/display dialog text! And it doesn't do that in all situations, as the Training mode works either way, just without any dialog popping up!

If I change something inside the Ranking screen's file (#62/64, counting from 1), like the RANK and NAME text from the Top 10 table, and then enlarge ex. Corneria's file (#19/64) by 0x100 bytes, the game doesn't crash when I access the Ranking screen. It still crashes in the intro and when it tries to show Corneria's stage intro text, but not there - on the contrary, my modified RANK and NAME text shows up how it's supposed to.

Also, if I only enlarge files including and beyond a certain one (#55/64, right after the Training level), the game appears to be working perfectly at any time. And that file appears to contain - drum roll - the game's dialog text in some unknown encoding. Gotta try relative searching that file to confirm or dismiss my suspicion.

EDIT: I was right, the file does contain the dialog text:

« Last Edit: April 16, 2010, 03:06:11 PM by xdaniel »
Logged
cu xdaniel

Nanami - Desktop:

Kazari - Notebook:

Arcaith

  • Administrator
  • Full Member
  • *****
  • Posts: 152
  • Keeping it real. Or something.
    • MSN Messenger - henna.gaikokujin@gmail.com
    • View Profile
    • Email
Re: Star Fox 64 hacking thread
« Reply #8 on: April 16, 2010, 04:15:36 PM »

Good find :D

It'd be nice though if Nintendo had written their text engines to auto line-break as well as manually do so. Realigning text ingame can be a pain in the ass ^_^;
Logged
pantsu~

xdaniel

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 295
    • ICQ Messenger - 136250978
    • View Profile
Re: Star Fox 64 hacking thread
« Reply #9 on: April 17, 2010, 08:54:47 PM »

...okay, so, I'll probably just make it so that the dialog file cannot be moved. Unless I can magically figure out what's wrong, I guess that's the best solution for the moment. Thus, planned is that each entry in the Toolkit's layout file is going to have an optional parameter, specifying the exact virtual - and thus here also physical - start offset the file has to have in the created ROM. The dialog file's number will be part of the ROM recognition data, which means digging into the other ROM versions and checking which file (or files for the PAL versions?) contain the dialog.

Also, off-topic: http://i39.tinypic.com/bhx4yg.png - only planned to take a short look at it, taking a break from more recent projects, but ended up turning it into a simple editor. GUI is shit and buggy, but what the hell. Dunno if I'll do anything else with this, but I might. Damn you, my copy of SoulSilver, which I had even preordered, for bringing me back into the franchise (to an extend) :P
Logged
cu xdaniel

Nanami - Desktop:

Kazari - Notebook:

spinout

  • Administrator
  • Sr. Member
  • *****
  • Posts: 309
    • View Profile
    • Email
Re: Star Fox 64 hacking thread
« Reply #10 on: June 02, 2010, 11:58:31 PM »

http://code.google.com/p/ozmav/source/detail?r=112
I added 'fixcrc' and 'saverom' options.
Logged
biggrin.gif

xdaniel

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 295
    • ICQ Messenger - 136250978
    • View Profile
Re: Star Fox 64 hacking thread
« Reply #11 on: June 19, 2010, 07:21:13 PM »

If it wasn't for this post by VL-Tone at Jul, I would never have realized that our "ascending in-level position" is a IEEE 754-style float! With that in mind...

http://i45.tinypic.com/1eq2zd.png

Compare the bottom of the above image with the first one below, and the middle/top of the above image with the second below:

http://i48.tinypic.com/2a4xuhj.png
http://i47.tinypic.com/f3by9x.png

The actual level viewer thing is junk, tho, since it's badly patched together, riddled with bugs and non-working code, etc., and there's still much that I don't know about the level and object format - some confusion with the X/Y/Z coordinates, dunno about how to get DList offsets, and much more...

EDIT:

http://i47.tinypic.com/2n2eer.png

Needs more research... not to mention a better code framework.

EDIT 2:

http://i50.tinypic.com/2m7suc8.png

EDIT 3:



Now integrated into the Toolkit, using the OZ wrapper code and other stuff from OZMAV2, and still needing work ex. with SF64's F3DEX 1.xx. But for now, to bed! As it's past 5 am! And the sun's rising again! ...fuck.
« Last Edit: June 20, 2010, 03:11:56 AM by xdaniel »
Logged
cu xdaniel

Nanami - Desktop:

Kazari - Notebook:

xdaniel

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 295
    • ICQ Messenger - 136250978
    • View Profile
Re: Star Fox 64 hacking thread
« Reply #12 on: June 20, 2010, 08:17:36 PM »



r126 on SVN, see commit log message for some notes. Still needs work to be done on it, but from a bunch of cubes to this in roughly a day? Good enough for me.
Logged
cu xdaniel

Nanami - Desktop:

Kazari - Notebook:

spinout

  • Administrator
  • Sr. Member
  • *****
  • Posts: 309
    • View Profile
    • Email
Re: Star Fox 64 hacking thread
« Reply #13 on: June 21, 2010, 06:58:48 AM »

10/10
Logged
biggrin.gif

Mallos31

  • Full Member
  • ***
  • Posts: 233
    • View Profile
    • Email
Re: Star Fox 64 hacking thread
« Reply #14 on: June 22, 2010, 04:22:56 PM »

My god man! OZMAV AND this?! You're crazy! It looks amazing so far. Chances are, you could easily make a tool for any freakin' game we got! Can't wait to see this finished. :D
Logged
Pages: [1] 2