Punkline
Dr. Frankenstack
- Joined
- May 15, 2015
- Messages
- 423
Mytoc provides up to 0xCD0 bytes of space in the rtoc region of start.dol to be used 8 bytes at a time -- creating 410 partitioned blocks.
Note that this is an exceptionally special region of RAM, because it can be accessed from dedicated GPR r2 (rtoc) -- meaning it can be loaded from and written to at ANY point in the game program; and by using only a single instruction.
The codes provide the space as a set of “mastercodes” that come in the form of togglable static overwrites for Melee Code Manager (MCM.)
See this post for some examples of how the code is used.
---
Download Mytoc for MCM here -- put the text file in your Mods Library folder, and check the new Mytoc tab to see the list of Mytoc blocks available to enable as codes. Toggling these will simply free up the described rtoc space for you to use in your own codes.
http://i.imgur.com/dahNvYD.png
It works by exploiting the fact that rtoc redundantly stores many double precision floating point constants used in the same floating point algorithms throughout multiple functions. The redundancy becomes a waste of space once all of the thousands of references (instructions) are reduced down to a common 2 rtoc offsets for doubles:
Of the 410 doubles left behind, I’ve made 100 individually available by default -- creating your personal “mytoc” to use for experiments and complex dol-modding. Enable each block as needed, and use the -0xNNNN(rtoc) offset in your code to access the space.
The other 310 are disabled by default, and can be enabled by deleting the ‘!’ mark at the beginning of each disabled mod. If you want to distribute a code that uses mytoc, you may use one of these disabled regions in your code to prevent conflicts with the mytoc tab in MCM. Just include the static overwrites with your mod!
All 410 are essentially the same, so use them as you see fit. The disabled index is just a guide.
---
As DOL mods (MCM static overwrites) these codes are written entirely in-place and take up absolutely no code space. This is crucial to the scalability of this code, and is reason for why it has so much space available.
As gecko codes, these take up a ridiculous amount of space in the code handler (in the form of 04 codes), and are not recommended. Gecko codes can still use these global rtoc regions with the blocks installed through MCM or hex editor. Doing so will give C2 codes the power to reference common data, which can include other C2 code locations for creating branch tables and calls to functions written as gecko codes.
---
The main purpose of this mod is to appeal to those constructing their own full-game mods, as it will provide a means of organizing large globally-based structures in a very efficient and accessible manner through the rtoc register. It also serves as a true alternative to static data tables constructed for gecko codes that can't reliably reference each other in hacked code handlers.
DRGN
@Achilles1515
UnclePunch
@rmn @Zadamanim @MeleeModder
The Cape
Note that this is an exceptionally special region of RAM, because it can be accessed from dedicated GPR r2 (rtoc) -- meaning it can be loaded from and written to at ANY point in the game program; and by using only a single instruction.
The codes provide the space as a set of “mastercodes” that come in the form of togglable static overwrites for Melee Code Manager (MCM.)
See this post for some examples of how the code is used.
---
Download Mytoc for MCM here -- put the text file in your Mods Library folder, and check the new Mytoc tab to see the list of Mytoc blocks available to enable as codes. Toggling these will simply free up the described rtoc space for you to use in your own codes.
http://i.imgur.com/dahNvYD.png

It works by exploiting the fact that rtoc redundantly stores many double precision floating point constants used in the same floating point algorithms throughout multiple functions. The redundancy becomes a waste of space once all of the thousands of references (instructions) are reduced down to a common 2 rtoc offsets for doubles:
- -0x8000(rtoc) = 0x4330000000000000
- 113 redundancies used for unsigned int conversion
- -0x7F60(rtoc) = 0x4330000080000000
- 297 redundancies used for signed int conversion
Of the 410 doubles left behind, I’ve made 100 individually available by default -- creating your personal “mytoc” to use for experiments and complex dol-modding. Enable each block as needed, and use the -0xNNNN(rtoc) offset in your code to access the space.
The other 310 are disabled by default, and can be enabled by deleting the ‘!’ mark at the beginning of each disabled mod. If you want to distribute a code that uses mytoc, you may use one of these disabled regions in your code to prevent conflicts with the mytoc tab in MCM. Just include the static overwrites with your mod!
All 410 are essentially the same, so use them as you see fit. The disabled index is just a guide.
---
As DOL mods (MCM static overwrites) these codes are written entirely in-place and take up absolutely no code space. This is crucial to the scalability of this code, and is reason for why it has so much space available.
As gecko codes, these take up a ridiculous amount of space in the code handler (in the form of 04 codes), and are not recommended. Gecko codes can still use these global rtoc regions with the blocks installed through MCM or hex editor. Doing so will give C2 codes the power to reference common data, which can include other C2 code locations for creating branch tables and calls to functions written as gecko codes.
---
The main purpose of this mod is to appeal to those constructing their own full-game mods, as it will provide a means of organizing large globally-based structures in a very efficient and accessible manner through the rtoc register. It also serves as a true alternative to static data tables constructed for gecko codes that can't reliably reference each other in hacked code handlers.



Last edited: