Jump to content
  • 0

Would it be possible to...


SanguinettiMods
 Share

Question

This is just an Idea that crossed my mind. I know it would probably take an assembly hack, but would it be possible to create a custom bank?

 

For example, 06 bank means inline obj, 04 means in gameplay keep, and so on.

 

I know there is a bank 02-06.

 

There are certain textures and such in gameplay keep, so if you had a DE or an FD command with the 04 bank, it would load a model or a tetxure in gameplay_keep.

 

Lets say I wanted to create, oh, bank 07.

 

It would just be a bunch of different Sword models.

 

Would anyone be willing to look into this for me?

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Yes, very possible. Just use some display list commands:

DB0600xx pppppppp E7000000 00000000

x = bank * 4

p = RAM address of bank

 

I did a hack called z64-tex-ext which used this to

.

 

So using this (Bank 07 as an example)

 

It would look like:

 

DB06001C [Address in RAM to load bank] E7000000 00000000

?

I'm not completely sure how doing something like this would specify the Length of this bank, or where I would find a suitable RAM address to use for this bank. If you could, maybe provide a longer example, unless I'm missing something huge.

Link to comment
Share on other sites

  • 0

The length does not matter. As for the RAM address, that is for you to figure out. You would have to do some sort of ASM hacking to get the RAM address - maybe code that DMAs the data from ROM -> RAM. Therefore, the command would have to be written directly to the main display list. From my experience, there are actually two main display lists. Given the global context, writing a display list command in form word0,word1 to it is implemented as such:

void

dl_write( void *z_ctxt, uint32_t w0, uint32_t w1)

{

uint32_t *dl_ptr;

 

/* The game seems to use multiple main display lists.. */

dl_ptr = (uint32_t*)*(uint32_t*)(*(uint32_t*)(z_ctxt) + 0x2C0);

*(dl_ptr++) = w0;

*(dl_ptr++) = w1;

/* Update the pointer or the changes will not be saved! */

*(uint32_t*)(*(uint32_t*)(z_ctxt) + 0x2C0) = (uint32_t)dl_ptr;

/* The other display list */

dl_ptr = (uint32_t*)*(uint32_t*)(*(uint32_t*)(z_ctxt) + 0x2D0);

*(dl_ptr++) = w0;

*(dl_ptr++) = w1;

*(uint32_t*)(*(uint32_t*)(z_ctxt) + 0x2D0) = (uint32_t)dl_ptr;

}

 

In other words:

 

Get the pointer at (global context + 0x2C0). Write the display list command at that address. Increase the pointer at (global context + 0x2C0) by 8. Do the same at the pointer at (global context + 0x2D0).

 

I will attempt to implement a hack which creates bank 0x0F which would be full of weapons.

Link to comment
Share on other sites

  • 0

I personally wouldn't know how to approach this myself, Sanguinetti, but you should try looking at the RAM map; there many references to the global context there:

 

http://wiki.spinout182.com/w/Debug_ROM:_RAM_Map

 

Global Context

 

80212020 is a very important address, it seems to be argument 0 for many functions, is the 'base' for many variables. Also known as 'ctxt'.

 

80212020        (*(void*)(ctxt+0) + 0x2C0) = Current end position of top level display list.
Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

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