Splitting Assets from Code: Difference between revisions

m
Fixed pointer types
m (Fixed spelling mistake)
m (Fixed pointer types)
Line 45:
Do this for all the assets, and you're almost done. The next step is to open a C header file (or better yet, create a new one) and to create some <code>extern</code> calls for your new segments:
<syntaxhighlight lang="c">
extern u32u8 _spr_bearSegmentRomStart[];
extern u32u8 _spr_bearSegmentRomEnd[];
</syntaxhighlight>
Remember that segment name I told you that was important and had to be unique? Whatever you set your segment name to, it needs to match the <code>extern</code>'s. Meaning, if you called your segment <code>NAME</code>, then you would need to define the <code>extern</code>'s as <code>_NAMESegmentRomStart</code> and <code>_NAMESegmentRomEnd</code> respectively.
Line 79:
 
// Start the DMA
osPiStartDma(&dmaIoMesgBuf, OS_MESG_PRI_NORMAL, OS_READ, (u32)_spr_bearSegmentRomStart, buffer, size, &dmaMesgQ);
 
// Wait for the DMA to finish
Line 120:
A useful trick, you can <code>extern</code> the codesegment as well:
<syntaxhighlight lang="c">
extern u32u8 _codeSegmentRomStart[];
extern u32u8 _codeSegmentRomEnd[];
</syntaxhighlight>