Splitting Assets from Code: Difference between revisions

Jump to navigation Jump to search
Content added Content deleted
(Another name correction)
m (Clarified the use of buffer)
Line 146: Line 146:
</syntaxhighlight>
</syntaxhighlight>


You can use this, for instance, to load your assets right after the code segment by loading them into the address at <code>_codeSegmentRomEnd</code>. You don't ''need'' to create an object file with your buffer as you can just write to any RAM address you seem fit (for instance, you can just define <code>u8* buffer = 0x80000400</code> globally, and then treat it as a buffer) but it sure helps as the compiler/linker can potentially catch buffer overflows and/or segment overlapping.
You can use this, for instance, to load your assets right after the code segment by loading them into the address at <code>_codeSegmentRomEnd</code>. You don't ''need'' to create an object file with your buffer as you can just write to any RAM address you seem fit (for instance, you can just define <code>u8* buffer = 0x80000400</code> globally, and then treat it as a array/buffer) but it sure helps as the compiler/linker can potentially catch buffer overflows and/or segment overlapping.


You can see an implementation of the buffer method described in this section [https://github.com/n64brew/N64-Codesplit-Tutorial/tree/main/splitdata-binram here].
You can see an implementation of the buffer method described in this section [https://github.com/n64brew/N64-Codesplit-Tutorial/tree/main/splitdata-binram here].