Jump to content

Ocarina of Time: Extended Scene, Actor, Object and Exit tables


spinout
 Share

Recommended Posts

Hello! I haven't made a release (or let alone worked on Z64!) in a while. Today was different. I dropped into #z64 (on freenode, you should check it out!), and wareya was looking for some space to put his assembly. I told him to put it in code, over debug text, but he didn't like that answer. He wanted me to extend code. An hour or so more of research showed that loading anything more into code broke the game; the save file is loaded right after it and the rest of the game is coded around code and the save file being exactly where they are. So how do we fit more into code?

 

I went back to an old idea I had about adding more scenes: move the scene table outside of code. But why stop there? Might as well pull the other tables out too! A bunch of research finding all the pieces of code which reference all those tables, some good ol C and python, and the rest of the day later, I got the game to run using tables loaded via an alternate method.

 

What does this mean? It means:

 

Up to 819 scene files. MQ Debug, by default, only has 109.

Up to 1536 actor files. OoT, by default, only has 470 actors.

Up to 512 objects. OoT, by default, only has 401. Okay, I can up that if you really need more.

Up to 31,744 exits! OoT, by default, only has... 1556. (Note: Cendamos told me the engine rolls the number over after a certain point, if so, I will fix this in a future release.)

Up to 32.7kB (that's kilo-bytes) of whatever you want to always have loaded!

 

It also means that the tables for these can be modified as individual files, which will certainly make ROM hacking easier.

 

Willing to check it out? [EDIT: Release 2]

  • Like 9
Link to comment
Share on other sites

Quick suggestion: Haven't tried it yet, only read the readme and source, but is there any chance you could move the table at 0xBE80 elsewhere, so as to not overwrite the start of the filename table; preferably somewhere that's normally all zero, ex. 16 bytes after the end of the DMA table, 0x18F40?

 

Would make implementing support in editors for this easier, I think, while also keeping support for filenames - like, is there non-zero data after DMA table, if so use data as tablestruct, else scan for/read tables from code file.

 

Link to comment
Share on other sites

Thanks for the comments. xdaniel,in the next release I'm planning on moving the hack into 'code', where the now-unused tables are. I think that'll take care of CRC issues as well. EDIT: also, xdaniel, as far as hack presence or not, a quick and easy way to check is by checking the JAL to my code - will provide some more details in a bit.

Link to comment
Share on other sites

  • 1 month later...

The flags for each scene are stored right after the items/equipment/etc. in RAM for the file you're currently playing. I guess if you use a scene number that's higher than what was originally available then you'll start overwriting other things. However, the current scene's flags are always in the same location iirc so you could probably change the code that stores them to not store any flags for scenes over a certain number. I don't know whether there's free space in the game save or it can be expanded or whatever so it could be possible just to move it to unused RAM.

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.