Register - Login
Views: 99793861
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 05:07:03 AM
Jul - General Game/ROM Hacking - Open-source N64 Display List viewer New poll - New thread - New reply
Next newer thread | Next older thread
messiaen
Catgirl
Level: 68


Posts: 418/1085
EXP: 2596316
For next: 132484

Since: 11-20-07


Since last post: 8.1 years
Last activity: 7.2 years

Posted on 12-02-08 03:04:29 PM Link | Quote
I was looking at some recent romhacking.net threads and found this very interesting project: OZMAV.

"OZMAV is an OpenGL-based map viewer for the The Legend of Zelda games on the N64, written in C, using the Windows API for its GUI. There is also an experimental branch called OZMAV-SF64 made for objects from Starfox 64."

I looked quickly at the code and it seems to have both Fast3D and F3DEX microcodes support, so if you are interested in N64 Hacking be sure to check it out.

The Google code page is http://code.google.com/p/ozmav/.

____________________
Mario 64 notes @ http://sites.google.com/site/messiaen64/
xdaniel
980
Level: 64


Posts: 2/982
EXP: 2153581
For next: 60516

Since: 12-04-08

Pronouns: he/they
From: Germany

Since last post: 25 days
Last activity: 32 min.

Posted on 12-04-08 01:09:27 PM (last edited by xdaniel at 12-04-08 10:11 AM) Link | Quote
Heh, I just posted a thread about yet another branch of OZMAV in the Mario 64 hacking forum, called MariOZMAV - a Mario 64 level viewer, as one might be able to guess. That one isn't at the Google Code SVN yet, but a Windows binary is available in said thread

Edit: Btw, as for Ucode support, there's one supported per branch (they just share the same n64.h definition file, which in turn comes mostly from glN64's source), but OZMAV supports F3DZEX, the Starfox branch F3DEX and MariOZMAV Fast3D.
Tanks

360? Yessum.
Level: 121


Posts: 1614/4170
EXP: 19808479
For next: 248217

Since: 07-10-07

From: VA

Since last post: 9.5 years
Last activity: 9.5 years

Posted on 12-06-08 01:10:58 PM Link | Quote

So after looking at this, will this method you people have been using work only with 1st party games? Like, what if I wanted to view Banjo-Kazooie? I recognize that it would require effort, but would the current method you use work?

____________________

messiaen
Catgirl
Level: 68


Posts: 423/1085
EXP: 2596316
For next: 132484

Since: 11-20-07


Since last post: 8.1 years
Last activity: 7.2 years

Posted on 12-06-08 04:45:05 PM Link | Quote
I haven't looked a lot on the source code of this, but it seems that the if the specific RSP microcode variation (there are many variations inside the F3DEX family) is covered, you would have to know some entry-point to render the DLists and a bit how RAM is segmented or where the textures come from.

But let xdaniel explain it !

____________________
Mario 64 notes @ http://sites.google.com/site/messiaen64/
xdaniel
980
Level: 64


Posts: 4/982
EXP: 2153581
For next: 60516

Since: 12-04-08

Pronouns: he/they
From: Germany

Since last post: 25 days
Last activity: 32 min.

Posted on 12-06-08 05:27:31 PM Link | Quote
First of all, this is going to be another wall of text!

Generally speaking, the same microcodes (Ucodes for short) are used across most N64 games, but, as messiaen said, there are variations as well as updated versions. The ones used in the majority of games are:

- Fast3D (or "RSP SW 2.0D"), for example in Mario 64 and Waverace 64
- F3DEX 1.xx, for example in Starfox, Mystical Ninja or Aerogauge
- F3DEX 2.xx, for example in Smash Bros., Evangelion or Sin & Punishment
- F3DZEX, a seemingly specialized version of the former used in the Zelda games and Animal Forest

Additionally, games are able to use multiple Ucodes at once (I seem to recall a LOADUCODE command or similar, I suppose that's used for switching), like ex. Evangelion, which also uses a 2D Ucode called S2DEX. That one is also used by Yoshi's Story and is the reason why both games weren't emulated for quite some time - emulators/video plugins didn't support that Ucode. There are a few more in Nintendo's official set of Ucodes, but those aren't used that often, or at least it appears so (ex. L3DEX). And finally, there are a few customized Ucodes made/modified by the game's developers themselfs, like those used in, if I recall, Star Wars Rouge Squadron and Indiana Jones.

So overall, once a basic RSP Display List interpreter is coded up, it should be rather easy to adapt it for different games as long as that use the same Ucode. That said, loading and finding Display Lists to render is a story in itself. I've used multiple methodes so far to get them:

One would be the way OZMAV does it with Zelda - it opens a pair of extracted files, in this case zmap and zscene files which contain geometry data in Display Lists, actor information (characters, signs, greenery, etc), collision data, different area configurations, etc. Then I scan those files for the Display List start command, 0xDE here (DE000000 xxyyyyyy, the xx/yy being the DList's RAM segment and offset), take note of their offsets and render them. Alternatively, if there aren't any such starting commands (like in zobj files, the actor models I've mentioned, and a few maps) you can check for 0xE7 which is some kinda synchronization command for the RSP which appears in every Display List, but that naturally gives you many, possibly incorrect, entry points for rendering.

Next up is loading, analyzing and rendering from a ROM. Unless there's already documentation about the game out, like luckily with Mario 64, you'll most likely need to tear the ROM open yourself to figure out where ex. level information is stored, which DLists are needed for each level and where they're stored, etc. There are projects for Zelda that read everything out of the ROM, also correctly rendering actors with their real models instead of ugly cubes like I'm doing it.

Finally, which was a wild but logical guess, you can try to use RAM dumps for rendering, like I'm doing it with the Evangelion branch (also works with other games, like I said above, but Eva looks best in it ). Many games have what I'm calling a "Master Display List", which sets up the RAM segments among other things, and then calls each "Geometry Display List", the ones that contain all the drawing commands themselfs, like VTX, TRI1, TRI2, etc. I don't know how to automatically detect that Master DList's offset, so you've got to manually check the RAM dump for a possible offset and try that out in the viewer.

In the end, taking Banjo-Kazooie as an example which is using a F3DEX 1.xx Ucode, after taking a compatible DList interpreter, determining the best method to use for DList finding - there's a file extractor for the game, and actually even a model viewer using them (Bottles' Glasses by cooliscool, also author of the Zelda editor Utility of Time), so I suppose that would be the easiest -, and adapting what might need adapting (file loading, RAM segment stuff), you've got yourself a working model viewer.

...and man, this has become really, really long. I apologize for this giant wall of text here, but I hope it was somewhat interesting and that I haven't forgot anything.


____________________
cu xdaniel
Tanks

360? Yessum.
Level: 121


Posts: 1615/4170
EXP: 19808479
For next: 248217

Since: 07-10-07

From: VA

Since last post: 9.5 years
Last activity: 9.5 years

Posted on 12-06-08 09:13:47 PM Link | Quote

Ahhh I understand now. So this is not a limited system and should, ultimately, work with all games. Correct?

____________________

xdaniel
980
Level: 64


Posts: 5/982
EXP: 2153581
For next: 60516

Since: 12-04-08

Pronouns: he/they
From: Germany

Since last post: 25 days
Last activity: 32 min.

Posted on 12-06-08 09:35:34 PM Link | Quote
Exactly. So theoretically, you could take the Display List interpreter from the Starfox branch, modify the file loading stuff, and have a viewer for ex. Banjo-Kazooie. And speaking of which, I'm gonna try that now just for fun and post the results here


____________________
cu xdaniel
Next newer thread | Next older thread
Jul - General Game/ROM Hacking - Open-source N64 Display List viewer New poll - New thread - New reply


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

29 database queries, 2 query cache hits.
Query execution time: 0.094219 seconds
Script execution time: 0.013446 seconds
Total render time: 0.107665 seconds