<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[skelux.root.sx - Resources]]></title>
		<link>https://skelux.root.sx/</link>
		<description><![CDATA[skelux.root.sx - https://skelux.root.sx]]></description>
		<pubDate>Sat, 18 Apr 2026 05:14:56 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[Castlevania 2,Luigi's Mansion,SMB3,SMS Music Files]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=885</link>
			<pubDate>Wed, 03 Jan 2018 10:55:13 +1100</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=885</guid>
			<description><![CDATA[<span style="font-weight: bold;">All Files are .m64</span><br />
<br />
<br />
<br />
<br />
Castlevania 2 Castlevania theme: <a href="https://mega.nz/#!Z6RFWSwb!8gjbqx_bmudChs8gJFMid0V3diREP5J3_5XSsNaMHrw" target="_blank">https://mega.nz/#!Z6RFWSwb!8gjbqx_bmudChs8gJFMid0V3diREP5J3_5XSsNaMHrw</a><br />
Castlevania 2 daytime theme: <a href="https://mega.nz/#!g7RjXTpQ!AhmIm6CWlGPjJG6KOBh-Q1UPIaOzRLDbGqXlOsNxmO8" target="_blank">https://mega.nz/#!g7RjXTpQ!AhmIm6CWlGPjJG6KOBh-Q1UPIaOzRLDbGqXlOsNxmO8</a><br />
<br />
Luigi's Mansion E gadds lab theme: <a href="https://mega.nz/#!tnIUQA4L!c42UCWuv_DNyINvhLfy82OeuYCi68ZD1XFqVzg9aDR8" target="_blank">https://mega.nz/#!tnIUQA4L!c42UCWuv_DNyINvhLfy82OeuYCi68ZD1XFqVzg9aDR8</a><br />
Luigi's Mansion GameBoy Horror theme: <a href="https://mega.nz/#!QmgGEYID!d9c3I0KjHD27SSxeayxjaKTvz6Z9x-IUjTj-oJdJlX4" target="_blank">https://mega.nz/#!QmgGEYID!d9c3I0KjHD27SSxeayxjaKTvz6Z9x-IUjTj-oJdJlX4</a><br />
Luigi's Mansion Mansion theme: <a href="https://mega.nz/#!YzRjnYxY!rsb9-cLFptHDGpoXI-qCbFItNcHidwd7PctkdnGwe7M" target="_blank">https://mega.nz/#!YzRjnYxY!rsb9-cLFptHDGpoXI-qCbFItNcHidwd7PctkdnGwe7M</a><br />
<br />
Super Mario Bros 3 World 1 : <a href="https://mega.nz/#!FnJlDCbR!StHeb-2qmH6T_11FGR_8lXharxAexvM_iy8LXuevKSo" target="_blank">https://mega.nz/#!FnJlDCbR!StHeb-2qmH6T_11FGR_8lXharxAexvM_iy8LXuevKSo</a><br />
<br />
Super Mario Sunshine Bianco Hills: <a href="https://mega.nz/#!AyQB2BDL!rNNNwTSBBvT9eHzhj_Ghjdqe2pmYDQvuQ28VrnRinm" target="_blank">https://mega.nz/#!AyQB2BDL!rNNNwTSBBvT9eHzhj_Ghjdqe2pmYDQvuQ28VrnRinm</a><br />
Super Mario Sunshine Delfino Plaza: <a href="https://mega.nz/#!MnIGRKqK!ivZbbXnUV1aHeTATU29qdcB_YIOR9AYPTPfyYkmkJNE" target="_blank">https://mega.nz/#!MnIGRKqK!ivZbbXnUV1aHeTATU29qdcB_YIOR9AYPTPfyYkmkJNE</a><br />
<hr />&#8203;<br />
More are going to be put up but this is it for now.]]></description>
			<content:encoded><![CDATA[<span style="font-weight: bold;">All Files are .m64</span><br />
<br />
<br />
<br />
<br />
Castlevania 2 Castlevania theme: <a href="https://mega.nz/#!Z6RFWSwb!8gjbqx_bmudChs8gJFMid0V3diREP5J3_5XSsNaMHrw" target="_blank">https://mega.nz/#!Z6RFWSwb!8gjbqx_bmudChs8gJFMid0V3diREP5J3_5XSsNaMHrw</a><br />
Castlevania 2 daytime theme: <a href="https://mega.nz/#!g7RjXTpQ!AhmIm6CWlGPjJG6KOBh-Q1UPIaOzRLDbGqXlOsNxmO8" target="_blank">https://mega.nz/#!g7RjXTpQ!AhmIm6CWlGPjJG6KOBh-Q1UPIaOzRLDbGqXlOsNxmO8</a><br />
<br />
Luigi's Mansion E gadds lab theme: <a href="https://mega.nz/#!tnIUQA4L!c42UCWuv_DNyINvhLfy82OeuYCi68ZD1XFqVzg9aDR8" target="_blank">https://mega.nz/#!tnIUQA4L!c42UCWuv_DNyINvhLfy82OeuYCi68ZD1XFqVzg9aDR8</a><br />
Luigi's Mansion GameBoy Horror theme: <a href="https://mega.nz/#!QmgGEYID!d9c3I0KjHD27SSxeayxjaKTvz6Z9x-IUjTj-oJdJlX4" target="_blank">https://mega.nz/#!QmgGEYID!d9c3I0KjHD27SSxeayxjaKTvz6Z9x-IUjTj-oJdJlX4</a><br />
Luigi's Mansion Mansion theme: <a href="https://mega.nz/#!YzRjnYxY!rsb9-cLFptHDGpoXI-qCbFItNcHidwd7PctkdnGwe7M" target="_blank">https://mega.nz/#!YzRjnYxY!rsb9-cLFptHDGpoXI-qCbFItNcHidwd7PctkdnGwe7M</a><br />
<br />
Super Mario Bros 3 World 1 : <a href="https://mega.nz/#!FnJlDCbR!StHeb-2qmH6T_11FGR_8lXharxAexvM_iy8LXuevKSo" target="_blank">https://mega.nz/#!FnJlDCbR!StHeb-2qmH6T_11FGR_8lXharxAexvM_iy8LXuevKSo</a><br />
<br />
Super Mario Sunshine Bianco Hills: <a href="https://mega.nz/#!AyQB2BDL!rNNNwTSBBvT9eHzhj_Ghjdqe2pmYDQvuQ28VrnRinm" target="_blank">https://mega.nz/#!AyQB2BDL!rNNNwTSBBvT9eHzhj_Ghjdqe2pmYDQvuQ28VrnRinm</a><br />
Super Mario Sunshine Delfino Plaza: <a href="https://mega.nz/#!MnIGRKqK!ivZbbXnUV1aHeTATU29qdcB_YIOR9AYPTPfyYkmkJNE" target="_blank">https://mega.nz/#!MnIGRKqK!ivZbbXnUV1aHeTATU29qdcB_YIOR9AYPTPfyYkmkJNE</a><br />
<hr />&#8203;<br />
More are going to be put up but this is it for now.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Models]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=857</link>
			<pubDate>Sat, 21 Oct 2017 10:15:59 +1100</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=857</guid>
			<description><![CDATA[I have compiled models from various games :<br />
<br />
<img src="http://nsa39.casimages.com/img/2017/10/21/171021013953732932.png" border="0" alt="[Image: 171021013953732932.png]" /> <img src="http://nsa39.casimages.com/img/2017/10/21/171021013953827999.png" border="0" alt="[Image: 171021013953827999.png]" /> <img src="http://nsa39.casimages.com/img/2017/10/21/171021013954106832.png" border="0" alt="[Image: 171021013954106832.png]" /> <br />
<br />
<br />
all from : <a href="https://www.models-resource.com/" target="_blank">https://www.models-resource.com/</a> <br />
<br />
in dae : <a href="https://www.mediafire.com/file/w3wq7yeccwtuq1s/misc.dae" target="_blank">https://www.mediafire.com/file/w3wq7yeccwtuq1s/misc.dae</a><br />
<br />
in skp (sketchup 8) : <a href="http://www.mediafire.com/file/pal85fbekmfjq84/misc.skp" target="_blank">http://www.mediafire.com/file/pal85fbekmfjq84/misc.skp</a><br />
<br />
I hope it will be useful <img src="https://skelux.root.sx/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" />]]></description>
			<content:encoded><![CDATA[I have compiled models from various games :<br />
<br />
<img src="http://nsa39.casimages.com/img/2017/10/21/171021013953732932.png" border="0" alt="[Image: 171021013953732932.png]" /> <img src="http://nsa39.casimages.com/img/2017/10/21/171021013953827999.png" border="0" alt="[Image: 171021013953827999.png]" /> <img src="http://nsa39.casimages.com/img/2017/10/21/171021013954106832.png" border="0" alt="[Image: 171021013954106832.png]" /> <br />
<br />
<br />
all from : <a href="https://www.models-resource.com/" target="_blank">https://www.models-resource.com/</a> <br />
<br />
in dae : <a href="https://www.mediafire.com/file/w3wq7yeccwtuq1s/misc.dae" target="_blank">https://www.mediafire.com/file/w3wq7yeccwtuq1s/misc.dae</a><br />
<br />
in skp (sketchup 8) : <a href="http://www.mediafire.com/file/pal85fbekmfjq84/misc.skp" target="_blank">http://www.mediafire.com/file/pal85fbekmfjq84/misc.skp</a><br />
<br />
I hope it will be useful <img src="https://skelux.root.sx/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[More Letters Patch]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=851</link>
			<pubDate>Sun, 01 Oct 2017 17:29:38 +1100</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=851</guid>
			<description><![CDATA[This patch imports the following missing characters from the Japanese ROM:<br />
<div class="codeblock">
<div class="title">Code:<br />
</div><div class="body" dir="ltr"><code>&#8203;[J] [Q] [V] [X] [Z] [!] [!!]<br />
[?]&#8203; [&amp;] [%] [Circle] [Key]</code></div></div>
<br />
armips source: <a href="https://bitbucket.org/shygoo/sm64-more-letters/downloads/sm64-more-letters-r0.zip" target="_blank">https://bitbucket.org/shygoo/sm64-more-letters/downloads/sm64-more-letters-r0.zip</a><br />
(Use Simple armips GUI to patch: <a href="http://origami64.net/showthread.php?tid=775" target="_blank">http://origami64.net/showthread.php?tid=775</a>)<br />
<br />
Compatible with SM64 (U) ROMs extended with VL-Tone's extender or equivalent.<br />
<br />
<span style="font-size: large;">&#8203;Summary</span><br />
<ul>
<li>&#8203;Appends image data from more-letters.bin to segment 02<br />
</li>
<li>&#8203;Updates segment-offset pointers in the character table<br />
</li>
<li>&#8203;Updates segment 02 loader addresses<br />
</li></ul>
<span style="font-size: large;">&#8203;Requirements</span><br />
<ul>
<li>&#8203;0x1800 bytes of free space at 0x0081D364 (or NUM_CHARS * 0x200)<br />
</li></ul>
<span style="font-size: large;">&#8203;Configuration</span><br />
<ul>
<li>&#8203;Reduce NUM_CHARS in more-letters.asm if SM64 crashes<br />
</li></ul>
By default the key character is excluded due to memory limitations but if anyone needs it I can add some better configuration options.]]></description>
			<content:encoded><![CDATA[This patch imports the following missing characters from the Japanese ROM:<br />
<div class="codeblock">
<div class="title">Code:<br />
</div><div class="body" dir="ltr"><code>&#8203;[J] [Q] [V] [X] [Z] [!] [!!]<br />
[?]&#8203; [&amp;] [%] [Circle] [Key]</code></div></div>
<br />
armips source: <a href="https://bitbucket.org/shygoo/sm64-more-letters/downloads/sm64-more-letters-r0.zip" target="_blank">https://bitbucket.org/shygoo/sm64-more-letters/downloads/sm64-more-letters-r0.zip</a><br />
(Use Simple armips GUI to patch: <a href="http://origami64.net/showthread.php?tid=775" target="_blank">http://origami64.net/showthread.php?tid=775</a>)<br />
<br />
Compatible with SM64 (U) ROMs extended with VL-Tone's extender or equivalent.<br />
<br />
<span style="font-size: large;">&#8203;Summary</span><br />
<ul>
<li>&#8203;Appends image data from more-letters.bin to segment 02<br />
</li>
<li>&#8203;Updates segment-offset pointers in the character table<br />
</li>
<li>&#8203;Updates segment 02 loader addresses<br />
</li></ul>
<span style="font-size: large;">&#8203;Requirements</span><br />
<ul>
<li>&#8203;0x1800 bytes of free space at 0x0081D364 (or NUM_CHARS * 0x200)<br />
</li></ul>
<span style="font-size: large;">&#8203;Configuration</span><br />
<ul>
<li>&#8203;Reduce NUM_CHARS in more-letters.asm if SM64 crashes<br />
</li></ul>
By default the key character is excluded due to memory limitations but if anyone needs it I can add some better configuration options.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[ASM Tutorial! (WIP)]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=845</link>
			<pubDate>Tue, 26 Sep 2017 07:20:41 +1000</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=845</guid>
			<description><![CDATA[Hello everyone, today I'd like to share an ASM tutorial I'm working on! I hope that this tutorial will contain everything that a hacker needs to start using ASM in their ROM hacks. (It's incomplete at the moment but more will be added later.)<br />
<br />
Part 1: Introduction to MIPS ASM - <a href="https://docs.google.com/presentation/d/1HjVlIPqFUtFN6cXGp5yh9HDhbrrs0nJW47Xaiyi-weA" target="_blank">https://docs.google.com/presentation/d/1HjVlIPqFUtFN6cXGp5yh9HDhbrrs0nJW47Xaiyi-weA</a><br />
<br />
Part 2: Registers - <a href="https://docs.google.com/presentation/d/1vPSHG8I2mNw7gQXcmCCGjKQOffFaFY1PLVBTt-ASJiw" target="_blank">https://docs.google.com/presentation/d/1vPSHG8I2mNw7gQXcmCCGjKQOffFaFY1PLVBTt-ASJiw</a><br />
<br />
Part 3: Common Commands - <a href="https://docs.google.com/presentation/d/1WkDbXtnaGTjFI570GW74YjK-uSkezAofXlMwxMic__I" target="_blank">https://docs.google.com/presentation/d/1WkDbXtnaGTjFI570GW74YjK-uSkezAofXlMwxMic__I</a><br />
<br />
Part 4: Jumps and Branches - <a href="https://docs.google.com/presentation/d/1b9HhwRZWQItpZRGnE62h4AKgAy82yMOb1h9Dk7j7lks" target="_blank">https://docs.google.com/presentation/d/1b9HhwRZWQItpZRGnE62h4AKgAy82yMOb1h9Dk7j7lks</a><br />
<br />
Part 4.5: Behaviour Scripts - <a href="https://docs.google.com/presentation/d/17oYiwFwYVBl1ATQR_zWBKMGNHPpC_RUtGuevZfWqT7g" target="_blank">https://docs.google.com/presentation/d/17oYiwFwYVBl1ATQR_zWBKMGNHPpC_RUtGuevZfWqT7g</a><br />
<br />
Part 5: Custom Objects - <a href="https://docs.google.com/document/d/1vLZ2liazKyjT90I1Y_R8amUVy9OEKccTvkVpnpGSBjw/edit?usp=sharing" target="_blank">https://docs.google.com/document/d/1vLZ2liazKyjT90I1Y_R8amUVy9OEKccTvkVpnpGSBjw/edit?usp=sharing</a><br />
<br />
Part 6: Object Structs - coming soon!<br />
<br />
<br />
<br />
If you have any questions, feel free to PM me or email me at arthurtilly413@gmail.com to tell me so I can answer.<br />
<br />
If you're good with ASM and spot a mistake in one of the tutorials, contact me through one of these so I can fix it ASAP.]]></description>
			<content:encoded><![CDATA[Hello everyone, today I'd like to share an ASM tutorial I'm working on! I hope that this tutorial will contain everything that a hacker needs to start using ASM in their ROM hacks. (It's incomplete at the moment but more will be added later.)<br />
<br />
Part 1: Introduction to MIPS ASM - <a href="https://docs.google.com/presentation/d/1HjVlIPqFUtFN6cXGp5yh9HDhbrrs0nJW47Xaiyi-weA" target="_blank">https://docs.google.com/presentation/d/1HjVlIPqFUtFN6cXGp5yh9HDhbrrs0nJW47Xaiyi-weA</a><br />
<br />
Part 2: Registers - <a href="https://docs.google.com/presentation/d/1vPSHG8I2mNw7gQXcmCCGjKQOffFaFY1PLVBTt-ASJiw" target="_blank">https://docs.google.com/presentation/d/1vPSHG8I2mNw7gQXcmCCGjKQOffFaFY1PLVBTt-ASJiw</a><br />
<br />
Part 3: Common Commands - <a href="https://docs.google.com/presentation/d/1WkDbXtnaGTjFI570GW74YjK-uSkezAofXlMwxMic__I" target="_blank">https://docs.google.com/presentation/d/1WkDbXtnaGTjFI570GW74YjK-uSkezAofXlMwxMic__I</a><br />
<br />
Part 4: Jumps and Branches - <a href="https://docs.google.com/presentation/d/1b9HhwRZWQItpZRGnE62h4AKgAy82yMOb1h9Dk7j7lks" target="_blank">https://docs.google.com/presentation/d/1b9HhwRZWQItpZRGnE62h4AKgAy82yMOb1h9Dk7j7lks</a><br />
<br />
Part 4.5: Behaviour Scripts - <a href="https://docs.google.com/presentation/d/17oYiwFwYVBl1ATQR_zWBKMGNHPpC_RUtGuevZfWqT7g" target="_blank">https://docs.google.com/presentation/d/17oYiwFwYVBl1ATQR_zWBKMGNHPpC_RUtGuevZfWqT7g</a><br />
<br />
Part 5: Custom Objects - <a href="https://docs.google.com/document/d/1vLZ2liazKyjT90I1Y_R8amUVy9OEKccTvkVpnpGSBjw/edit?usp=sharing" target="_blank">https://docs.google.com/document/d/1vLZ2liazKyjT90I1Y_R8amUVy9OEKccTvkVpnpGSBjw/edit?usp=sharing</a><br />
<br />
Part 6: Object Structs - coming soon!<br />
<br />
<br />
<br />
If you have any questions, feel free to PM me or email me at arthurtilly413@gmail.com to tell me so I can answer.<br />
<br />
If you're good with ASM and spot a mistake in one of the tutorials, contact me through one of these so I can fix it ASAP.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[ASM Tweak] Better parallel lakitu patch]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=838</link>
			<pubDate>Fri, 15 Sep 2017 17:07:40 +1000</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=838</guid>
			<description><![CDATA[I have made this tweak a very long time ago but I decided to finally share codes for it. What it does is basically fixing minor issues for parallel lakitu as well as adding better preciser controls for parallel lakitu.<br />
<br />
Changelog from original parallel lakitu:<ul>
<li>&#8203;Camera is not stuck in c-up camera with lakitu, camera in cannons is not broken<br />
</li>
<li>&#8203;All regular parallel lakitu controls are preserved (c-stick controls)<br />
</li>
<li>&#8203;L button switches lakitu between parallel mode and regular cam mode in water/flying (useful for levels like WDW where water/flying cam is screwed sometimes)<br />
</li>
<li>&#8203;In regular cam mode switching from mario->lakitu cam fixes parallel lakitu cam angle to closest 8-way aligned angle<br />
</li>
<li>&#8203;D-pad left/right changes parallel lakitu angle precisely allowing for easier wallkicks out of 45 degree walls for example<br />
</li>
<li>&#8203;D-pad up/down switches back to to closest 8-way aligned angle<br />
</li></ul>
<br />
I have made an ARMIPS ASM patch, use ARMIPS GUI to compile. This code overwrites unused lakitu cam presets so it can be used with any other non lakitu cam patch.<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: Code for camera <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<div class="codeblock">
<div class="title">Code:<br />
</div><div class="body" dir="ltr"><code>&#8203;<br />
; [ARMIPS 0.9+] Better parallel cam patch<br />
<br />
;is 0 when from mario cam, is not 0 if in lakitu<br />
.defineLabel RAM_STATE, 0x41D20<br />
.defineLabel RAM_STATE_HI, 0x8028<br />
.defineLabel RAM_STATE_LO, 0x6D20<br />
<br />
.defineLabel IS_PARALLEL, 0x41D24<br />
.defineLabel IS_PARALLEL_HI, 0x8028<br />
.defineLabel IS_PARALLEL_LO, 0x6D24<br />
<br />
.defineLabel MARIO_FACE_HI, 0x8033<br />
.defineLabel MARIO_FACE_LO, 0xDF60<br />
.defineLabel MARIO_FACE_OF, 0x0012<br />
<br />
.defineLabel LAKITU_ANGLE_HI, 0x8034<br />
.defineLabel LAKITU_ANGLE_LO, 0xC778<br />
<br />
.defineLabel INPUTS_HI, 0x8034<br />
.defineLabel INPUTS_LO1, 0xAFA0 ; hold<br />
.defineLabel INPUTS_LO2, 0xAFA0 ; press<br />
<br />
;============Hook mario and lakitu cam functions==============<br />
.orga 0x41BBC<br />
.area 0x8<br />
 B mariocamhook   ; original: BEQ T5, R0, 0x41C54 -- selector between mario and lakitu cam<br />
 NOP<br />
.endarea<br />
<br />
.orga 0x41C7C<br />
.area 0x8<br />
 B lakitucamhook  ; original: JR T9<br />
 NOP<br />
.endarea<br />
;=========================End Hooks===========================<br />
<br />
<br />
<br />
;Set mario cam hook onto place where bad lakitu cams live<br />
;restrict payload to fit before 41D20 which is RAM<br />
.orga 0x41CD4<br />
.area 0x4C<br />
mariocamhook:<br />
 BEQ T5, R0, 0x41C54<br />
 NOP<br />
 ;====================Mario hook code=====================<br />
 LUI AT, IS_PARALLEL_HI<br />
 LW T0, 0x6D24(AT)<br />
 BEQ T0, R0, mariocamhook_refixlakitu<br />
 NOP<br />
 B mariocamhook_endrefixlakitu<br />
 NOP<br />
<br />
mariocamhook_refixlakitu:<br />
 LUI AT, RAM_STATE_HI<br />
 SW R0, 0x6D20(AT)<br />
mariocamhook_endrefixlakitu:<br />
 ;====================Mario hook end======================<br />
<br />
 B 0x41BC4<br />
 NOP<br />
.endarea<br />
<br />
<br />
<br />
;============Initilize RAM data with zeroes==================<br />
.orga 0x41D20<br />
.area 0x8<br />
 NOP<br />
 NOP<br />
.endarea<br />
;============================================================<br />
 <br />
;Set lakitu cam hook onto place where bad lakitu cam code live<br />
.orga 0x3DC3C<br />
.area 0x134<br />
lakitucamhook:<br />
 ;====================Lakitu hook code====================<br />
 <br />
 ;<br />
 ;--------------------------------------------------------<br />
 ; Remove all low lakitu cam codes<br />
 ;--------------------------------------------------------<br />
 ;<br />
 LUI T0, 0x8028<br />
 ADDI T0, T0, 0x6CB4<br />
 SUB T0, T9, T0<br />
 BLEZ T0, lakitucamhook_nofixoverflow<br />
 NOP<br />
<br />
 LUI T9, 0x8028<br />
 ADDI T9, T9, 0x6CC4<br />
lakitucamhook_nofixoverflow:<br />
 <br />
 <br />
 ;<br />
 ;--------------------------------------------------------<br />
 ; Check for L button press to switch modes<br />
 ;--------------------------------------------------------<br />
 ;<br />
 LUI AT, INPUTS_HI<br />
 LH T0, 0xAFA2(AT)<br />
 <br />
 ANDI T0, T0, 0x0020<br />
 BEQ T0, R0, lakitucamhook_nolpress<br />
 NOP<br />
 <br />
 LUI AT, IS_PARALLEL_HI<br />
 LW T0, 0x6D24(AT)<br />
 ADDI AT, R0, 0x0001<br />
 SUB T0, AT, T0<br />
 LUI AT, IS_PARALLEL_HI<br />
 SW T0, 0x6D24(AT)<br />
lakitucamhook_nolpress:<br />
<br />
<br />
 ;<br />
 ;--------------------------------------------------------<br />
 ;           Use parallel lakitu if L was pressed<br />
 ;--------------------------------------------------------<br />
 ;<br />
 LUI AT, IS_PARALLEL_HI<br />
 LW T0, 0x6D24(AT)<br />
 BEQ T0, R0, lakitucamhook_nobeparallel<br />
 NOP<br />
 <br />
 ;flying check<br />
 LUI T0, 0x8028<br />
 ADDI T0, T0, 0x6C84<br />
 SUB T0, T9, T0<br />
 BEQ T0, R0, lakitucamhook_beparallel<br />
 NOP<br />
 <br />
 ;water check<br />
 LUI T0, 0x8028<br />
 ADDI T0, T0, 0x6CA4<br />
 SUB T0, T9, T0<br />
 BEQ T0, R0, lakitucamhook_beparallel<br />
 NOP<br />
 B lakitucamhook_nobeparallel<br />
 NOP<br />
lakitucamhook_beparallel:<br />
 LUI T9, 0x8028<br />
 ADDI T9, T9, 0x6CC4<br />
lakitucamhook_nobeparallel:<br />
 <br />
 <br />
 ;<br />
 ;--------------------------------------------------------<br />
 ; Rotate lakitu cam on dpad presses<br />
 ;--------------------------------------------------------<br />
 ;<br />
 LUI AT, INPUTS_HI<br />
 LH T0, 0xAFA0(AT)<br />
 LUI AT, LAKITU_ANGLE_HI<br />
 LH A0, 0xC778(AT)<br />
 <br />
 ANDI AT, T0, 0x0200<br />
 BEQ AT, R0, lakitucamhook_noleft<br />
 NOP<br />
 ADDI A0, A0, 0xFFD0<br />
 B lakitucamhook_minirotateend<br />
 <br />
lakitucamhook_noleft:<br />
 ANDI AT, T0, 0x0100<br />
 BEQ AT, R0, lakitucamhook_noright<br />
 NOP<br />
 ADDI A0, A0, 0x0030<br />
 B lakitucamhook_minirotateend<br />
 <br />
lakitucamhook_noright:<br />
 LUI AT, INPUTS_HI<br />
 LH T0, 0xAFA2(AT) ;using press<br />
 ANDI AT, T0, 0x0C00<br />
 BEQ AT, R0, lakitucamhook_minirotateend<br />
 NOP <br />
 ADDI A0, A0, 0x1000<br />
 ANDI A0, A0, 0xE000<br />
 <br />
lakitucamhook_minirotateend:<br />
 LUI AT, LAKITU_ANGLE_HI<br />
 SH A0, 0xC778(AT)<br />
<br />
<br />
 ;<br />
 ;--------------------------------------------------------<br />
 ; Get last state of lakitu cam and line it if needed<br />
 ;--------------------------------------------------------<br />
 ;<br />
 LUI AT, RAM_STATE_HI<br />
 LW T0, 0x6D20(AT)<br />
 <br />
 BEQ T0, T9, lakitucamhook_fixangleend ;no fix required<br />
 NOP<br />
 <br />
 LUI AT, MARIO_FACE_HI<br />
 LW T0, 0xDF60 (AT)<br />
 LH T0, 0x0012 (T0)<br />
<br />
 ;Rotate camera to be behind mario and make it 8-way<br />
 ADDI T0, T0, 0x9000<br />
 ANDI T0, T0, 0xE000<br />
<br />
 LUI AT, LAKITU_ANGLE_HI<br />
 SH T0, 0xC778(AT)<br />
 <br />
 ;Store new mode of camera<br />
 LUI AT, RAM_STATE_HI<br />
 SW T9, 0x6D20 (AT)<br />
lakitucamhook_fixangleend:<br />
 ;====================Lakitu hook end=====================<br />
<br />
 JR T9<br />
 NOP<br />
.endarea</code></div></div>
&#8203;<br />
</div></div></div></tag><br />
Another way of applying patch to your ROM is using <a href="http://www.mediafire.com/file/2kbqywbxeobxer4/ParallelLakituPatcher.zip" target="_blank">my patcher</a>. Just drag'n'drop your ROM on exe inside archive to apply parallel lakitu patch.]]></description>
			<content:encoded><![CDATA[I have made this tweak a very long time ago but I decided to finally share codes for it. What it does is basically fixing minor issues for parallel lakitu as well as adding better preciser controls for parallel lakitu.<br />
<br />
Changelog from original parallel lakitu:<ul>
<li>&#8203;Camera is not stuck in c-up camera with lakitu, camera in cannons is not broken<br />
</li>
<li>&#8203;All regular parallel lakitu controls are preserved (c-stick controls)<br />
</li>
<li>&#8203;L button switches lakitu between parallel mode and regular cam mode in water/flying (useful for levels like WDW where water/flying cam is screwed sometimes)<br />
</li>
<li>&#8203;In regular cam mode switching from mario->lakitu cam fixes parallel lakitu cam angle to closest 8-way aligned angle<br />
</li>
<li>&#8203;D-pad left/right changes parallel lakitu angle precisely allowing for easier wallkicks out of 45 degree walls for example<br />
</li>
<li>&#8203;D-pad up/down switches back to to closest 8-way aligned angle<br />
</li></ul>
<br />
I have made an ARMIPS ASM patch, use ARMIPS GUI to compile. This code overwrites unused lakitu cam presets so it can be used with any other non lakitu cam patch.<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: Code for camera <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<div class="codeblock">
<div class="title">Code:<br />
</div><div class="body" dir="ltr"><code>&#8203;<br />
; [ARMIPS 0.9+] Better parallel cam patch<br />
<br />
;is 0 when from mario cam, is not 0 if in lakitu<br />
.defineLabel RAM_STATE, 0x41D20<br />
.defineLabel RAM_STATE_HI, 0x8028<br />
.defineLabel RAM_STATE_LO, 0x6D20<br />
<br />
.defineLabel IS_PARALLEL, 0x41D24<br />
.defineLabel IS_PARALLEL_HI, 0x8028<br />
.defineLabel IS_PARALLEL_LO, 0x6D24<br />
<br />
.defineLabel MARIO_FACE_HI, 0x8033<br />
.defineLabel MARIO_FACE_LO, 0xDF60<br />
.defineLabel MARIO_FACE_OF, 0x0012<br />
<br />
.defineLabel LAKITU_ANGLE_HI, 0x8034<br />
.defineLabel LAKITU_ANGLE_LO, 0xC778<br />
<br />
.defineLabel INPUTS_HI, 0x8034<br />
.defineLabel INPUTS_LO1, 0xAFA0 ; hold<br />
.defineLabel INPUTS_LO2, 0xAFA0 ; press<br />
<br />
;============Hook mario and lakitu cam functions==============<br />
.orga 0x41BBC<br />
.area 0x8<br />
 B mariocamhook   ; original: BEQ T5, R0, 0x41C54 -- selector between mario and lakitu cam<br />
 NOP<br />
.endarea<br />
<br />
.orga 0x41C7C<br />
.area 0x8<br />
 B lakitucamhook  ; original: JR T9<br />
 NOP<br />
.endarea<br />
;=========================End Hooks===========================<br />
<br />
<br />
<br />
;Set mario cam hook onto place where bad lakitu cams live<br />
;restrict payload to fit before 41D20 which is RAM<br />
.orga 0x41CD4<br />
.area 0x4C<br />
mariocamhook:<br />
 BEQ T5, R0, 0x41C54<br />
 NOP<br />
 ;====================Mario hook code=====================<br />
 LUI AT, IS_PARALLEL_HI<br />
 LW T0, 0x6D24(AT)<br />
 BEQ T0, R0, mariocamhook_refixlakitu<br />
 NOP<br />
 B mariocamhook_endrefixlakitu<br />
 NOP<br />
<br />
mariocamhook_refixlakitu:<br />
 LUI AT, RAM_STATE_HI<br />
 SW R0, 0x6D20(AT)<br />
mariocamhook_endrefixlakitu:<br />
 ;====================Mario hook end======================<br />
<br />
 B 0x41BC4<br />
 NOP<br />
.endarea<br />
<br />
<br />
<br />
;============Initilize RAM data with zeroes==================<br />
.orga 0x41D20<br />
.area 0x8<br />
 NOP<br />
 NOP<br />
.endarea<br />
;============================================================<br />
 <br />
;Set lakitu cam hook onto place where bad lakitu cam code live<br />
.orga 0x3DC3C<br />
.area 0x134<br />
lakitucamhook:<br />
 ;====================Lakitu hook code====================<br />
 <br />
 ;<br />
 ;--------------------------------------------------------<br />
 ; Remove all low lakitu cam codes<br />
 ;--------------------------------------------------------<br />
 ;<br />
 LUI T0, 0x8028<br />
 ADDI T0, T0, 0x6CB4<br />
 SUB T0, T9, T0<br />
 BLEZ T0, lakitucamhook_nofixoverflow<br />
 NOP<br />
<br />
 LUI T9, 0x8028<br />
 ADDI T9, T9, 0x6CC4<br />
lakitucamhook_nofixoverflow:<br />
 <br />
 <br />
 ;<br />
 ;--------------------------------------------------------<br />
 ; Check for L button press to switch modes<br />
 ;--------------------------------------------------------<br />
 ;<br />
 LUI AT, INPUTS_HI<br />
 LH T0, 0xAFA2(AT)<br />
 <br />
 ANDI T0, T0, 0x0020<br />
 BEQ T0, R0, lakitucamhook_nolpress<br />
 NOP<br />
 <br />
 LUI AT, IS_PARALLEL_HI<br />
 LW T0, 0x6D24(AT)<br />
 ADDI AT, R0, 0x0001<br />
 SUB T0, AT, T0<br />
 LUI AT, IS_PARALLEL_HI<br />
 SW T0, 0x6D24(AT)<br />
lakitucamhook_nolpress:<br />
<br />
<br />
 ;<br />
 ;--------------------------------------------------------<br />
 ;           Use parallel lakitu if L was pressed<br />
 ;--------------------------------------------------------<br />
 ;<br />
 LUI AT, IS_PARALLEL_HI<br />
 LW T0, 0x6D24(AT)<br />
 BEQ T0, R0, lakitucamhook_nobeparallel<br />
 NOP<br />
 <br />
 ;flying check<br />
 LUI T0, 0x8028<br />
 ADDI T0, T0, 0x6C84<br />
 SUB T0, T9, T0<br />
 BEQ T0, R0, lakitucamhook_beparallel<br />
 NOP<br />
 <br />
 ;water check<br />
 LUI T0, 0x8028<br />
 ADDI T0, T0, 0x6CA4<br />
 SUB T0, T9, T0<br />
 BEQ T0, R0, lakitucamhook_beparallel<br />
 NOP<br />
 B lakitucamhook_nobeparallel<br />
 NOP<br />
lakitucamhook_beparallel:<br />
 LUI T9, 0x8028<br />
 ADDI T9, T9, 0x6CC4<br />
lakitucamhook_nobeparallel:<br />
 <br />
 <br />
 ;<br />
 ;--------------------------------------------------------<br />
 ; Rotate lakitu cam on dpad presses<br />
 ;--------------------------------------------------------<br />
 ;<br />
 LUI AT, INPUTS_HI<br />
 LH T0, 0xAFA0(AT)<br />
 LUI AT, LAKITU_ANGLE_HI<br />
 LH A0, 0xC778(AT)<br />
 <br />
 ANDI AT, T0, 0x0200<br />
 BEQ AT, R0, lakitucamhook_noleft<br />
 NOP<br />
 ADDI A0, A0, 0xFFD0<br />
 B lakitucamhook_minirotateend<br />
 <br />
lakitucamhook_noleft:<br />
 ANDI AT, T0, 0x0100<br />
 BEQ AT, R0, lakitucamhook_noright<br />
 NOP<br />
 ADDI A0, A0, 0x0030<br />
 B lakitucamhook_minirotateend<br />
 <br />
lakitucamhook_noright:<br />
 LUI AT, INPUTS_HI<br />
 LH T0, 0xAFA2(AT) ;using press<br />
 ANDI AT, T0, 0x0C00<br />
 BEQ AT, R0, lakitucamhook_minirotateend<br />
 NOP <br />
 ADDI A0, A0, 0x1000<br />
 ANDI A0, A0, 0xE000<br />
 <br />
lakitucamhook_minirotateend:<br />
 LUI AT, LAKITU_ANGLE_HI<br />
 SH A0, 0xC778(AT)<br />
<br />
<br />
 ;<br />
 ;--------------------------------------------------------<br />
 ; Get last state of lakitu cam and line it if needed<br />
 ;--------------------------------------------------------<br />
 ;<br />
 LUI AT, RAM_STATE_HI<br />
 LW T0, 0x6D20(AT)<br />
 <br />
 BEQ T0, T9, lakitucamhook_fixangleend ;no fix required<br />
 NOP<br />
 <br />
 LUI AT, MARIO_FACE_HI<br />
 LW T0, 0xDF60 (AT)<br />
 LH T0, 0x0012 (T0)<br />
<br />
 ;Rotate camera to be behind mario and make it 8-way<br />
 ADDI T0, T0, 0x9000<br />
 ANDI T0, T0, 0xE000<br />
<br />
 LUI AT, LAKITU_ANGLE_HI<br />
 SH T0, 0xC778(AT)<br />
 <br />
 ;Store new mode of camera<br />
 LUI AT, RAM_STATE_HI<br />
 SW T9, 0x6D20 (AT)<br />
lakitucamhook_fixangleend:<br />
 ;====================Lakitu hook end=====================<br />
<br />
 JR T9<br />
 NOP<br />
.endarea</code></div></div>
&#8203;<br />
</div></div></div></tag><br />
Another way of applying patch to your ROM is using <a href="http://www.mediafire.com/file/2kbqywbxeobxer4/ParallelLakituPatcher.zip" target="_blank">my patcher</a>. Just drag'n'drop your ROM on exe inside archive to apply parallel lakitu patch.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[SimpleCOLLADA v0.1.1 (C++)]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=754</link>
			<pubDate>Tue, 25 Apr 2017 03:33:43 +1000</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=754</guid>
			<description><![CDATA[The COLLADA model format allows for much more flexibility over the .obj format. This includes vertex colors and animations, which can't currently be imported easily using our current tools. While this parser cannot do animations yet, it can read vertex colors.<br />
<br />
SimpleCOLLADA v0.1.1 parses:<ul>
<li>&#8203;<span style="font-size: small;"><span style="font-family: Courier New;">Vertices</span></span><br />
</li>
<li>&#8203;<span style="font-size: small;"><span style="font-family: Courier New;">Triangle indices</span></span><br />
</li>
<li>&#8203;<span style="font-size: small;"><span style="font-family: Courier New;">Texture coordinates</span></span><br />
</li>
<li>&#8203;<span style="font-size: small;"><span style="font-family: Courier New;">Normals</span></span><br />
</li>
<li>&#8203;<span style="font-size: small;"><span style="font-family: Courier New;">Vertex colors</span></span><br />
</li>
<li>&#8203;<span style="font-size: small;"><span style="font-family: Courier New;">Material data (file path for textures, diffuse color, and transparency)</span></span><br />
</li></ul>
and puts this data into a single object for easy access, then importing tools can use this data to build the models and put it into the ROM file. You can find out more on how to use this code over on the Github page.<br />
<br />
<span style="font-weight: bold;">&#8203;Github:</span> <a href="https://github.com/DavidSM64/SimpleCOLLADA" target="_blank">https://github.com/DavidSM64/SimpleCOLLADA</a><br />
<br />
<img src="http://i.imgur.com/PiS3jap.png" width="360" height="240" border="0" alt="[Image: PiS3jap.png]" /><img src="http://i.imgur.com/k1EE06S.png" width="360" height="240" border="0" alt="[Image: k1EE06S.png]" /><br />
<span style="font-style: italic;">&#8203;<span style="font-size: small;">Example of vertex colors created in blender</span></span>]]></description>
			<content:encoded><![CDATA[The COLLADA model format allows for much more flexibility over the .obj format. This includes vertex colors and animations, which can't currently be imported easily using our current tools. While this parser cannot do animations yet, it can read vertex colors.<br />
<br />
SimpleCOLLADA v0.1.1 parses:<ul>
<li>&#8203;<span style="font-size: small;"><span style="font-family: Courier New;">Vertices</span></span><br />
</li>
<li>&#8203;<span style="font-size: small;"><span style="font-family: Courier New;">Triangle indices</span></span><br />
</li>
<li>&#8203;<span style="font-size: small;"><span style="font-family: Courier New;">Texture coordinates</span></span><br />
</li>
<li>&#8203;<span style="font-size: small;"><span style="font-family: Courier New;">Normals</span></span><br />
</li>
<li>&#8203;<span style="font-size: small;"><span style="font-family: Courier New;">Vertex colors</span></span><br />
</li>
<li>&#8203;<span style="font-size: small;"><span style="font-family: Courier New;">Material data (file path for textures, diffuse color, and transparency)</span></span><br />
</li></ul>
and puts this data into a single object for easy access, then importing tools can use this data to build the models and put it into the ROM file. You can find out more on how to use this code over on the Github page.<br />
<br />
<span style="font-weight: bold;">&#8203;Github:</span> <a href="https://github.com/DavidSM64/SimpleCOLLADA" target="_blank">https://github.com/DavidSM64/SimpleCOLLADA</a><br />
<br />
<img src="http://i.imgur.com/PiS3jap.png" width="360" height="240" border="0" alt="[Image: PiS3jap.png]" /><img src="http://i.imgur.com/k1EE06S.png" width="360" height="240" border="0" alt="[Image: k1EE06S.png]" /><br />
<span style="font-style: italic;">&#8203;<span style="font-size: small;">Example of vertex colors created in blender</span></span>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[N64 Custom Levels!]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=730</link>
			<pubDate>Mon, 20 Mar 2017 05:47:44 +1100</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=730</guid>
			<description><![CDATA[For anyone to use for their games! Or machinimas or whatever.<br />
<br />
For now, I only made one.<br />
<img src="http://orig03.deviantart.net/70ea/f/2017/078/c/9/ruins_by_mrpr1993-db2uuih.png" border="0" alt="[Image: ruins_by_mrpr1993-db2uuih.png]" /><br />
<br />
<a href="http://sta.sh/0em4i4eqcnj" target="_blank">&#8203;DOWNLOAD (Sketchup 8)</a><br />
<br />
MODEL SCALE: 15]]></description>
			<content:encoded><![CDATA[For anyone to use for their games! Or machinimas or whatever.<br />
<br />
For now, I only made one.<br />
<img src="http://orig03.deviantart.net/70ea/f/2017/078/c/9/ruins_by_mrpr1993-db2uuih.png" border="0" alt="[Image: ruins_by_mrpr1993-db2uuih.png]" /><br />
<br />
<a href="http://sta.sh/0em4i4eqcnj" target="_blank">&#8203;DOWNLOAD (Sketchup 8)</a><br />
<br />
MODEL SCALE: 15]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[N64 Custom Models!]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=703</link>
			<pubDate>Sat, 11 Feb 2017 08:55:20 +1100</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=703</guid>
			<description><![CDATA[<img src="http://orig10.deviantart.net/d85c/f/2017/041/1/b/egaddmodel_by_mrpr1993-dayklee.png" border="0" alt="[Image: egaddmodel_by_mrpr1993-dayklee.png]" /><br />
<br />
I used up a GameCube model of Professor E. Gadd's and remove as many polygons as I could til' it matched Mario's N64 one.<br />
<br />
So here we have: A N64 Professor Elvin Gadd!<br />
<br />
<a href="http://sta.sh/01f9fe86yv31" target="_blank">&#8203;DOWNLOAD LINK</a><br />
<br />
If anyone's interested on downloading this, be my guest!]]></description>
			<content:encoded><![CDATA[<img src="http://orig10.deviantart.net/d85c/f/2017/041/1/b/egaddmodel_by_mrpr1993-dayklee.png" border="0" alt="[Image: egaddmodel_by_mrpr1993-dayklee.png]" /><br />
<br />
I used up a GameCube model of Professor E. Gadd's and remove as many polygons as I could til' it matched Mario's N64 one.<br />
<br />
So here we have: A N64 Professor Elvin Gadd!<br />
<br />
<a href="http://sta.sh/01f9fe86yv31" target="_blank">&#8203;DOWNLOAD LINK</a><br />
<br />
If anyone's interested on downloading this, be my guest!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Goldeneye 007-esque Head - Downloadable]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=664</link>
			<pubDate>Thu, 08 Dec 2016 06:54:57 +1100</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=664</guid>
			<description><![CDATA[<div style="text-align: center;"><img src="http://orig08.deviantart.net/1cd6/f/2016/342/3/2/machinimarealisticheads_by_mrpr1993-daqyu7d.png" border="0" alt="[Image: machinimarealisticheads_by_mrpr1993-daqyu7d.png]" /></div>&#8203;<br />
For anyone wants to use these creepy heads for things like, let's just say, Machinima videos!<br />
<br />
<span style="font-weight: bold;">&#8203;Features:</span><br />
-2 Textures Head Model<br />
-1 Template<br />
-1 Example<br />
-1 Ready Head (I credit Master M for coordinates)<br />
<br />
<span style="font-style: italic;">&#8203;Importer Coordinates:</span> <span style="font-weight: bold;">Centered:</span> No -<span style="font-weight: bold;"> Model Scale:</span> 10<br />
<br />
<span style="font-weight: bold;">&#8203;<a href="http://sta.sh/01pmr46jckyb" target="_blank">DOWNLOAD</a></span><br />
<br />
<span style="font-weight: bold;">&#8203;<a href="http://sta.sh/09qdpfig7jh" target="_blank">OBJ VERSION</a></span>]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;"><img src="http://orig08.deviantart.net/1cd6/f/2016/342/3/2/machinimarealisticheads_by_mrpr1993-daqyu7d.png" border="0" alt="[Image: machinimarealisticheads_by_mrpr1993-daqyu7d.png]" /></div>&#8203;<br />
For anyone wants to use these creepy heads for things like, let's just say, Machinima videos!<br />
<br />
<span style="font-weight: bold;">&#8203;Features:</span><br />
-2 Textures Head Model<br />
-1 Template<br />
-1 Example<br />
-1 Ready Head (I credit Master M for coordinates)<br />
<br />
<span style="font-style: italic;">&#8203;Importer Coordinates:</span> <span style="font-weight: bold;">Centered:</span> No -<span style="font-weight: bold;"> Model Scale:</span> 10<br />
<br />
<span style="font-weight: bold;">&#8203;<a href="http://sta.sh/01pmr46jckyb" target="_blank">DOWNLOAD</a></span><br />
<br />
<span style="font-weight: bold;">&#8203;<a href="http://sta.sh/09qdpfig7jh" target="_blank">OBJ VERSION</a></span>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[SM64 Models]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=652</link>
			<pubDate>Sun, 27 Nov 2016 00:45:13 +1100</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=652</guid>
			<description><![CDATA[Here you all can post SM64 Models (Since I couldn't find anywhere else)<br />
<br />
To start off, I'll post a link to some SM64 models  <img src="https://skelux.root.sx/images/smilies/wink.png" alt="Wink" title="Wink" class="smilie smilie_2" /><br />
<br />
<a href="https://www.models-resource.com/nintendo_64/supermario64/" target="_blank">&#8203;https://www.models-resource.com/nintendo_64/supermario64/</a>]]></description>
			<content:encoded><![CDATA[Here you all can post SM64 Models (Since I couldn't find anywhere else)<br />
<br />
To start off, I'll post a link to some SM64 models  <img src="https://skelux.root.sx/images/smilies/wink.png" alt="Wink" title="Wink" class="smilie smilie_2" /><br />
<br />
<a href="https://www.models-resource.com/nintendo_64/supermario64/" target="_blank">&#8203;https://www.models-resource.com/nintendo_64/supermario64/</a>]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[HUD Sprites From MrPr1993]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=590</link>
			<pubDate>Fri, 28 Oct 2016 03:47:19 +1100</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=590</guid>
			<description><![CDATA[Wasn't sure where to put this, so...<br />
<br />
If anyone's interested in one, PM me!<br />
<br />
Here are few examples I made:<br />
<br />
<img src="http://orig01.deviantart.net/ba38/f/2016/299/7/4/marioficon_by_mrpr1993-dambvxs.png" border="0" alt="[Image: marioficon_by_mrpr1993-dambvxs.png]" /><img src="http://orig01.deviantart.net/5d88/f/2016/300/a/e/weegee_by_mrpr1993-damdrpl.png" border="0" alt="[Image: weegee_by_mrpr1993-damdrpl.png]" /><img src="http://orig02.deviantart.net/47ad/f/2016/299/2/8/lllll_by_mrpr1993-dambosq.png" border="0" alt="[Image: lllll_by_mrpr1993-dambosq.png]" /><img src="http://orig07.deviantart.net/3439/f/2016/299/d/2/smgcoin_by_mrpr1993-dambvy3.png" border="0" alt="[Image: smgcoin_by_mrpr1993-dambvy3.png]" /><img src="http://orig15.deviantart.net/3f2f/f/2016/299/c/0/marioxstar_by_mrpr1993-dambvxz.png" border="0" alt="[Image: marioxstar_by_mrpr1993-dambvxz.png]" /><br />
<br />
<img src="http://orig10.deviantart.net/b2ae/f/2016/299/b/a/hp_by_mrpr1993-dambzyb.png" border="0" alt="[Image: hp_by_mrpr1993-dambzyb.png]" /><img src="http://orig03.deviantart.net/c691/f/2016/051/1/e/hpmake_by_mrpr1993-d9sgarg.png" border="0" alt="[Image: hpmake_by_mrpr1993-d9sgarg.png]" /><br />
<br />
<img src="http://orig14.deviantart.net/7a15/f/2016/135/0/0/mariobeegauge_by_mrpr1993-da2kw2w.png" border="0" alt="[Image: mariobeegauge_by_mrpr1993-da2kw2w.png]" /><br />
(In case anyone wanna know what dis is, this is from Kaze's Last Impact bee powerup HUD thing)<br />
<br />
<img src="http://orig06.deviantart.net/0d02/f/2016/138/1/c/marionewfont_by_mrpr1993-da2y0i7.png" border="0" alt="[Image: marionewfont_by_mrpr1993-da2y0i7.png]" /><br />
<br />
As for Power Meter, be specific on how the meter should look like!]]></description>
			<content:encoded><![CDATA[Wasn't sure where to put this, so...<br />
<br />
If anyone's interested in one, PM me!<br />
<br />
Here are few examples I made:<br />
<br />
<img src="http://orig01.deviantart.net/ba38/f/2016/299/7/4/marioficon_by_mrpr1993-dambvxs.png" border="0" alt="[Image: marioficon_by_mrpr1993-dambvxs.png]" /><img src="http://orig01.deviantart.net/5d88/f/2016/300/a/e/weegee_by_mrpr1993-damdrpl.png" border="0" alt="[Image: weegee_by_mrpr1993-damdrpl.png]" /><img src="http://orig02.deviantart.net/47ad/f/2016/299/2/8/lllll_by_mrpr1993-dambosq.png" border="0" alt="[Image: lllll_by_mrpr1993-dambosq.png]" /><img src="http://orig07.deviantart.net/3439/f/2016/299/d/2/smgcoin_by_mrpr1993-dambvy3.png" border="0" alt="[Image: smgcoin_by_mrpr1993-dambvy3.png]" /><img src="http://orig15.deviantart.net/3f2f/f/2016/299/c/0/marioxstar_by_mrpr1993-dambvxz.png" border="0" alt="[Image: marioxstar_by_mrpr1993-dambvxz.png]" /><br />
<br />
<img src="http://orig10.deviantart.net/b2ae/f/2016/299/b/a/hp_by_mrpr1993-dambzyb.png" border="0" alt="[Image: hp_by_mrpr1993-dambzyb.png]" /><img src="http://orig03.deviantart.net/c691/f/2016/051/1/e/hpmake_by_mrpr1993-d9sgarg.png" border="0" alt="[Image: hpmake_by_mrpr1993-d9sgarg.png]" /><br />
<br />
<img src="http://orig14.deviantart.net/7a15/f/2016/135/0/0/mariobeegauge_by_mrpr1993-da2kw2w.png" border="0" alt="[Image: mariobeegauge_by_mrpr1993-da2kw2w.png]" /><br />
(In case anyone wanna know what dis is, this is from Kaze's Last Impact bee powerup HUD thing)<br />
<br />
<img src="http://orig06.deviantart.net/0d02/f/2016/138/1/c/marionewfont_by_mrpr1993-da2y0i7.png" border="0" alt="[Image: marionewfont_by_mrpr1993-da2y0i7.png]" /><br />
<br />
As for Power Meter, be specific on how the meter should look like!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[ASM Tutorial] Tarek701's MIPS Tutorial]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=574</link>
			<pubDate>Tue, 11 Oct 2016 18:15:12 +1100</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=574</guid>
			<description><![CDATA[Hello, people!<br />
This is the latest revision of my MIPS Tutorial (from end 2015) and should cover the most basics of MIPS ASM. Floating-point operations and other stuff was not finished, but isn't required if you're still a beginner in MIPS ASM.<br />
<br />
Have fun, coding.<br /><!-- start: postbit_attachments_attachment -->
<div><span class="float_right">Size: <u>347.05 KB</u> / Downloads: <u>681</u></span>
<span class="float_left"><!-- start: attachment_icon -->
<img src="images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" style="vertical-align: middle;" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=485" class="attachment_" target="_blank" title="">mips3.zip</a> </span></div>
<br class="clear"/>
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[Hello, people!<br />
This is the latest revision of my MIPS Tutorial (from end 2015) and should cover the most basics of MIPS ASM. Floating-point operations and other stuff was not finished, but isn't required if you're still a beginner in MIPS ASM.<br />
<br />
Have fun, coding.<br /><!-- start: postbit_attachments_attachment -->
<div><span class="float_right">Size: <u>347.05 KB</u> / Downloads: <u>681</u></span>
<span class="float_left"><!-- start: attachment_icon -->
<img src="images/attachtypes/zip.png" title="ZIP File" border="0" alt=".zip" style="vertical-align: middle;" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=485" class="attachment_" target="_blank" title="">mips3.zip</a> </span></div>
<br class="clear"/>
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Blank Level Base]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=523</link>
			<pubDate>Fri, 19 Aug 2016 10:33:19 +1000</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=523</guid>
			<description><![CDATA[Might as well put this blank: <br />
<br />
<img src="http://orig15.deviantart.net/01de/f/2016/231/1/8/area_by_mrpr1993-daek131.png" border="0" alt="[Image: area_by_mrpr1993-daek131.png]" /><br />
<br />
DOWNLOAD: <a href="http://sta.sh/04es2g3pi0n" target="_blank">http://sta.sh/04es2g3pi0n</a><br />
<br />
If anyone wants to make a new level, use this to get started!<br />
<br />
Model Scale Size: 15]]></description>
			<content:encoded><![CDATA[Might as well put this blank: <br />
<br />
<img src="http://orig15.deviantart.net/01de/f/2016/231/1/8/area_by_mrpr1993-daek131.png" border="0" alt="[Image: area_by_mrpr1993-daek131.png]" /><br />
<br />
DOWNLOAD: <a href="http://sta.sh/04es2g3pi0n" target="_blank">http://sta.sh/04es2g3pi0n</a><br />
<br />
If anyone wants to make a new level, use this to get started!<br />
<br />
Model Scale Size: 15]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[SM64 Editor v2.0 Refraction Textures]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=462</link>
			<pubDate>Mon, 04 Jul 2016 18:11:51 +1000</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=462</guid>
			<description><![CDATA[<span style="font-size: xx-small;">There's a small possibility I've created this thread in the wrong place. If so, please move it and notify me afterwards.<br />
</span>&#8203;Skelux' <del>OBJ Importer</del> SM64 Editor 2.0 included a nice feature, that is the creation of refractive materials.<br />
The refractions are the same effects the crystals in the <span style="font-style: italic;">Cavern of the Metal Cap course</span> (Metal Cap) have.<br />
<br />
People could do it before already by editing the display lists, but since SM64E2.0 you can now add your own to any material you desire just by adding "_ref" to the texture name to make it refractive.<br />
<br />
<img src="http://prntscr.com/bojhya/direct" border="0" alt="[Image: direct]" /><br />
(These are the textures that currently have the refraction indicator.)<br />
<br />
This is easy enough, however without a quick explanation on how to customize the glow and ETC, many people that are new might just get lost (<span style="font-size: x-small;">I did, I had to ask Skelux for a quick tip</span>) so I'm here to share the results of the experiments I've done with the refractive materials after I got a quick introduction to them in some sort of tutorial/what to-not to do.<br />
<br />
Starting by some clarifications:<br />
<br />
1. Mid-alpha textures<br />
<br />
<div style="text-align: center;">&#8203;<img src="http://i.imgur.com/E5PxFcf.png" width="100" height="100" border="0" alt="[Image: E5PxFcf.png]" /></div>
Yes, the other feature the SM64 Editor contained aside from the refractive material option (and some others) was the inclusion of the (LONG AWAITED) Alpha value for the textures. If you don't know what that is (what), it's the transparency value for the texture. 0 is totally transparent and 255 is completely opaque. Everything inbetween can be considered translucent. The thing is, the refraction is NOT compatible with the midway-alpha textures. So if you want that shine you'll have to refrain from a transparent texture and vice-versa.<br />
<br />
<br />
2. THE TEXTURE ITSELF<br />
<br />
<div style="text-align: center;">&#8203;<img src="http://i.imgur.com/5j2fjMT.png" width="100" height="100" border="0" alt="[Image: 5j2fjMT.png]" /></div>
Yes, you will use a material with texture to make it glow, but here's one thing you should know: if you make, by example, a grass texture, and make it refractive, it won't show the grass texture, more like it will be reduced to opaque colors and will use the texture to display the refractions (from what I've tested, keep reading) in the face. So if you want something to be refractive you must agree that you will lose the actual textured attribute of the material.<br />
<br />
This is what happened when i first imported without the methods I used below:<br />
<br />
TEXTURE USED:<br />
<img src="http://prntscr.com/bojita/direct" width="300" height="300" border="0" alt="[Image: direct]" /><br />
<br />
<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: GIF <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<img src="https://i.gyazo.com/d0b434b10e665a0f9df1bcf12d783978.gif" width="320" height="240" border="0" alt="[Image: d0b434b10e665a0f9df1bcf12d783978.gif]" /><br />
You can see the glow isn't as strong as one would expect.</div></div></div></tag><br />
<br />
<br />
3. <del>CLICK THE </del> Circles (NOTE: This might be updated.)<br />
<br />
<div style="text-align: center;">&#8203;<img src="http://i.imgur.com/nwlAcHB.png" width="100" height="100" border="0" alt="[Image: nwlAcHB.png]" /></div>
Well I've got to say that the refractions have a weird behavior when coming to softened surfaces (Softened from Sketchup). So it's not recommended to make a super hi-poly sphere with refractions everywhere unless you want something like this: <br />
<br />
SKETCHUP:<br />
<img src="http://prntscr.com/bojjyl/direct" border="0" alt="[Image: direct]" /><br />
<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: GIF <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<img src="https://i.gyazo.com/f3169b033e2952b569d3fdee074ec1a2.gif" width="320" height="240" border="0" alt="[Image: f3169b033e2952b569d3fdee074ec1a2.gif]" /></div></div></div></tag><br />
<br />
Now that I've said that, I think I covered enough (In case not, I'll update) so now I will explain (from what I've tested) how the glow works using the texture with the "_ref" in its name.<br />
<br />
Since I already said the texture in the face will become one single color to be able to refract, it means it has to take the colors from somewhere in the texture. <br />
<br />
So for example we're using this texture I made.<br />
<img src="http://prntscr.com/boja76/direct" width="300" height="300" border="0" alt="[Image: direct]" /><br />
Notice it's a gradient. Now, you see that arrow I drew in the border? (From my experiments) I noticed the pixel rows are the colors the refraction uses.<br />
They scroll from top to bottom and repeat depending on the camera's angle (While moving).<br />
Here's how it looks in Sketchup.<br />
<br />
<img src="http://prntscr.com/bojeo2/direct" border="0" alt="[Image: direct]" /><br />
Here's how it looks ingame.<br />
<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: GIF <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<img src="https://i.gyazo.com/2611b946e7f6dfda991c87821f3c2bbd.gif" width="320" height="240" border="0" alt="[Image: 2611b946e7f6dfda991c87821f3c2bbd.gif]" /><br />
They're the same textures, just that I changed the hue to display different colors, don't worry. Notice how the glow is subtle.</div></div></div></tag><br />
Now let's try with another one.<br />
<br />
<img src="http://prntscr.com/bojd1l/direct" width="300" height="300" border="0" alt="[Image: direct]" /><br />
<br />
Notice how the gradient ends in white and doesn't come back to the color.<br />
This is the result.<br />
<br />
<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: GIF <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<img src="https://i.gyazo.com/ef1ebb4232f2ef7cb4cd7a814983cd7e.gif" width="320" height="240" border="0" alt="[Image: ef1ebb4232f2ef7cb4cd7a814983cd7e.gif]" /><br />
Notice how the gradient scrolls from color to white then just suddenly goes from white to color. When it reached the bottom pixel, it just went back to the first one, and viceversa (Since apparently depending on the camera angle the refraction starts at a different point per face.)</div></div></div></tag><br />
So that's a start for the normal glow, but we don't end there. I experimented with another "glow map" of a different nature. Instead of making it glow, I purposely made it to <span style="font-weight: bold;">alternate between two colors on scroll.</span><br />
I don't know why but I wanna call it <span style="font-style: italic;">stroboskop glowmap.</span><br />
<br />
TEXTURE USED:<br />
<img src="http://prntscr.com/bojfpl/direct" width="300" height="300" border="0" alt="[Image: direct]" /><br />
<del>&#8203;The year is 20XX</del><br />
<del>&#8203;Everybody uses paint.net at TAS levels of pixelfection.</del><br />
You can see it DOES NOT use a gradient, but it alternates between colors each two pixel rows.<br />
<br />
SKETCHUP:<br />
<img src="http://prntscr.com/bojg8x/direct" border="0" alt="[Image: direct]" /><br />
<br />
INGAME (GIF):<br />
<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: GIF <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<img src="https://i.gyazo.com/6f90b037f11f6f31f1dce6c8a6066d31.gif" width="320" height="240" border="0" alt="[Image: 6f90b037f11f6f31f1dce6c8a6066d31.gif]" /><br />
See how the big one's glow is very choppy.</div></div></div></tag><br />
So far, that's everything I've experimented with.<br />
If there is anything else, tell me and I'll add it here.<br />
If you want, I'll upload a small pack with some sample glowey textures.]]></description>
			<content:encoded><![CDATA[<span style="font-size: xx-small;">There's a small possibility I've created this thread in the wrong place. If so, please move it and notify me afterwards.<br />
</span>&#8203;Skelux' <del>OBJ Importer</del> SM64 Editor 2.0 included a nice feature, that is the creation of refractive materials.<br />
The refractions are the same effects the crystals in the <span style="font-style: italic;">Cavern of the Metal Cap course</span> (Metal Cap) have.<br />
<br />
People could do it before already by editing the display lists, but since SM64E2.0 you can now add your own to any material you desire just by adding "_ref" to the texture name to make it refractive.<br />
<br />
<img src="http://prntscr.com/bojhya/direct" border="0" alt="[Image: direct]" /><br />
(These are the textures that currently have the refraction indicator.)<br />
<br />
This is easy enough, however without a quick explanation on how to customize the glow and ETC, many people that are new might just get lost (<span style="font-size: x-small;">I did, I had to ask Skelux for a quick tip</span>) so I'm here to share the results of the experiments I've done with the refractive materials after I got a quick introduction to them in some sort of tutorial/what to-not to do.<br />
<br />
Starting by some clarifications:<br />
<br />
1. Mid-alpha textures<br />
<br />
<div style="text-align: center;">&#8203;<img src="http://i.imgur.com/E5PxFcf.png" width="100" height="100" border="0" alt="[Image: E5PxFcf.png]" /></div>
Yes, the other feature the SM64 Editor contained aside from the refractive material option (and some others) was the inclusion of the (LONG AWAITED) Alpha value for the textures. If you don't know what that is (what), it's the transparency value for the texture. 0 is totally transparent and 255 is completely opaque. Everything inbetween can be considered translucent. The thing is, the refraction is NOT compatible with the midway-alpha textures. So if you want that shine you'll have to refrain from a transparent texture and vice-versa.<br />
<br />
<br />
2. THE TEXTURE ITSELF<br />
<br />
<div style="text-align: center;">&#8203;<img src="http://i.imgur.com/5j2fjMT.png" width="100" height="100" border="0" alt="[Image: 5j2fjMT.png]" /></div>
Yes, you will use a material with texture to make it glow, but here's one thing you should know: if you make, by example, a grass texture, and make it refractive, it won't show the grass texture, more like it will be reduced to opaque colors and will use the texture to display the refractions (from what I've tested, keep reading) in the face. So if you want something to be refractive you must agree that you will lose the actual textured attribute of the material.<br />
<br />
This is what happened when i first imported without the methods I used below:<br />
<br />
TEXTURE USED:<br />
<img src="http://prntscr.com/bojita/direct" width="300" height="300" border="0" alt="[Image: direct]" /><br />
<br />
<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: GIF <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<img src="https://i.gyazo.com/d0b434b10e665a0f9df1bcf12d783978.gif" width="320" height="240" border="0" alt="[Image: d0b434b10e665a0f9df1bcf12d783978.gif]" /><br />
You can see the glow isn't as strong as one would expect.</div></div></div></tag><br />
<br />
<br />
3. <del>CLICK THE </del> Circles (NOTE: This might be updated.)<br />
<br />
<div style="text-align: center;">&#8203;<img src="http://i.imgur.com/nwlAcHB.png" width="100" height="100" border="0" alt="[Image: nwlAcHB.png]" /></div>
Well I've got to say that the refractions have a weird behavior when coming to softened surfaces (Softened from Sketchup). So it's not recommended to make a super hi-poly sphere with refractions everywhere unless you want something like this: <br />
<br />
SKETCHUP:<br />
<img src="http://prntscr.com/bojjyl/direct" border="0" alt="[Image: direct]" /><br />
<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: GIF <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<img src="https://i.gyazo.com/f3169b033e2952b569d3fdee074ec1a2.gif" width="320" height="240" border="0" alt="[Image: f3169b033e2952b569d3fdee074ec1a2.gif]" /></div></div></div></tag><br />
<br />
Now that I've said that, I think I covered enough (In case not, I'll update) so now I will explain (from what I've tested) how the glow works using the texture with the "_ref" in its name.<br />
<br />
Since I already said the texture in the face will become one single color to be able to refract, it means it has to take the colors from somewhere in the texture. <br />
<br />
So for example we're using this texture I made.<br />
<img src="http://prntscr.com/boja76/direct" width="300" height="300" border="0" alt="[Image: direct]" /><br />
Notice it's a gradient. Now, you see that arrow I drew in the border? (From my experiments) I noticed the pixel rows are the colors the refraction uses.<br />
They scroll from top to bottom and repeat depending on the camera's angle (While moving).<br />
Here's how it looks in Sketchup.<br />
<br />
<img src="http://prntscr.com/bojeo2/direct" border="0" alt="[Image: direct]" /><br />
Here's how it looks ingame.<br />
<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: GIF <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<img src="https://i.gyazo.com/2611b946e7f6dfda991c87821f3c2bbd.gif" width="320" height="240" border="0" alt="[Image: 2611b946e7f6dfda991c87821f3c2bbd.gif]" /><br />
They're the same textures, just that I changed the hue to display different colors, don't worry. Notice how the glow is subtle.</div></div></div></tag><br />
Now let's try with another one.<br />
<br />
<img src="http://prntscr.com/bojd1l/direct" width="300" height="300" border="0" alt="[Image: direct]" /><br />
<br />
Notice how the gradient ends in white and doesn't come back to the color.<br />
This is the result.<br />
<br />
<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: GIF <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<img src="https://i.gyazo.com/ef1ebb4232f2ef7cb4cd7a814983cd7e.gif" width="320" height="240" border="0" alt="[Image: ef1ebb4232f2ef7cb4cd7a814983cd7e.gif]" /><br />
Notice how the gradient scrolls from color to white then just suddenly goes from white to color. When it reached the bottom pixel, it just went back to the first one, and viceversa (Since apparently depending on the camera angle the refraction starts at a different point per face.)</div></div></div></tag><br />
So that's a start for the normal glow, but we don't end there. I experimented with another "glow map" of a different nature. Instead of making it glow, I purposely made it to <span style="font-weight: bold;">alternate between two colors on scroll.</span><br />
I don't know why but I wanna call it <span style="font-style: italic;">stroboskop glowmap.</span><br />
<br />
TEXTURE USED:<br />
<img src="http://prntscr.com/bojfpl/direct" width="300" height="300" border="0" alt="[Image: direct]" /><br />
<del>&#8203;The year is 20XX</del><br />
<del>&#8203;Everybody uses paint.net at TAS levels of pixelfection.</del><br />
You can see it DOES NOT use a gradient, but it alternates between colors each two pixel rows.<br />
<br />
SKETCHUP:<br />
<img src="http://prntscr.com/bojg8x/direct" border="0" alt="[Image: direct]" /><br />
<br />
INGAME (GIF):<br />
<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: GIF <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<img src="https://i.gyazo.com/6f90b037f11f6f31f1dce6c8a6066d31.gif" width="320" height="240" border="0" alt="[Image: 6f90b037f11f6f31f1dce6c8a6066d31.gif]" /><br />
See how the big one's glow is very choppy.</div></div></div></tag><br />
So far, that's everything I've experimented with.<br />
If there is anything else, tell me and I'll add it here.<br />
If you want, I'll upload a small pack with some sample glowey textures.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[SM64 Custom Music Discussion/Requests]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=66</link>
			<pubDate>Mon, 20 Jun 2016 04:31:55 +1000</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=66</guid>
			<description><![CDATA[In this thread you may discuss, request, or post .m64 imports.<br />
If you are submitting finished .m64 files, you should post them on the <span style="font-weight: bold;"><a href="http://origami64.net/downloads.php?category=8" target="_blank">downloads page</a></span> instead.]]></description>
			<content:encoded><![CDATA[In this thread you may discuss, request, or post .m64 imports.<br />
If you are submitting finished .m64 files, you should post them on the <span style="font-weight: bold;"><a href="http://origami64.net/downloads.php?category=8" target="_blank">downloads page</a></span> instead.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[ASM Tweak] Eyerok boss fixed for custom levels]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=420</link>
			<pubDate>Tue, 24 May 2016 17:36:18 +1000</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=420</guid>
			<description><![CDATA[<!-- start: video_youtube_embed --><br />
<iframe width="560" height="315" src="https://www.youtube.com/embed/Dc7XCX3X3mk" frameborder="0" allowfullscreen></iframe><br />
<!-- end: video_youtube_embed --><br />
Here is a tweak that will let you use the Eyerok boss in any custom level. Eyerok crashed in custom levels because the game was trying to process his collision data which didn't exist. The actual collision data is located with the SSL level geometry data in segment 0x07. I fixed the crash by optimizing eyerok's ASM code to free up enough data to make Eyerok's collision data become global, so now he should work in any level you put him in. All of the changes I made are self-contained, so this should not interfere with any other code in the game. This patch works with the 8MB ROM, though I haven't tested it on console.<br />
<br />
You can apply this code by either using the .xml tweak for the level importer, or the ASM source code with CajeASM v7.24.<br />
<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: How to apply the tweak (Level Importer) <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">1.) Put the .xml file within the Tweaks folder:</span></span><br />
<img src="http://i.imgur.com/7gwVNZ1.png" border="0" alt="[Image: 7gwVNZ1.png]" /><br />
<br />
<span style="font-size: medium;">&#8203;<span style="font-weight: bold;">2.) Open the Tweak Manager in the Level Importer:</span></span><br />
<img src="http://i.imgur.com/Vj7gCx1.png" border="0" alt="[Image: Vj7gCx1.png]" /><br />
<br />
<span style="font-size: medium;">&#8203;<span style="font-weight: bold;">3.) Select the tweak and hit the apply button:</span></span><br />
<img src="http://i.imgur.com/A6Gemp6.png" border="0" alt="[Image: A6Gemp6.png]" /></div></div></div></tag><tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: Assembling the source code (CajeASM) <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<span style="font-size: medium;">&#8203;<span style="font-weight: bold;">Just select your ROM file and the "EyerokBossFix_ASM.txt" source file, then click "Assemble!". That's all there is to it. How easy was that?</span></span><br />
<img src="http://i.imgur.com/IAxCXm6.png" border="0" alt="[Image: IAxCXm6.png]" /></div></div></div></tag><br /><!-- start: postbit_attachments_attachment -->
<div><span class="float_right">Size: <u>15.49 KB</u> / Downloads: <u>169</u></span>
<span class="float_left"><!-- start: attachment_icon -->
<img src="images/attachtypes/xls.png" title="XML File" border="0" alt=".xml" style="vertical-align: middle;" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=369" class="attachment_" target="_blank" title="">EyerokBossFix.xml</a> </span></div>
<br class="clear"/>
<!-- end: postbit_attachments_attachment --><br /><!-- start: postbit_attachments_attachment -->
<div><span class="float_right">Size: <u>24.81 KB</u> / Downloads: <u>140</u></span>
<span class="float_left"><!-- start: attachment_icon -->
<img src="images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" style="vertical-align: middle;" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=370" class="attachment_" target="_blank" title="">EyerokBossFix_ASM.txt</a> </span></div>
<br class="clear"/>
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[<!-- start: video_youtube_embed --><br />
<iframe width="560" height="315" src="https://www.youtube.com/embed/Dc7XCX3X3mk" frameborder="0" allowfullscreen></iframe><br />
<!-- end: video_youtube_embed --><br />
Here is a tweak that will let you use the Eyerok boss in any custom level. Eyerok crashed in custom levels because the game was trying to process his collision data which didn't exist. The actual collision data is located with the SSL level geometry data in segment 0x07. I fixed the crash by optimizing eyerok's ASM code to free up enough data to make Eyerok's collision data become global, so now he should work in any level you put him in. All of the changes I made are self-contained, so this should not interfere with any other code in the game. This patch works with the 8MB ROM, though I haven't tested it on console.<br />
<br />
You can apply this code by either using the .xml tweak for the level importer, or the ASM source code with CajeASM v7.24.<br />
<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: How to apply the tweak (Level Importer) <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">1.) Put the .xml file within the Tweaks folder:</span></span><br />
<img src="http://i.imgur.com/7gwVNZ1.png" border="0" alt="[Image: 7gwVNZ1.png]" /><br />
<br />
<span style="font-size: medium;">&#8203;<span style="font-weight: bold;">2.) Open the Tweak Manager in the Level Importer:</span></span><br />
<img src="http://i.imgur.com/Vj7gCx1.png" border="0" alt="[Image: Vj7gCx1.png]" /><br />
<br />
<span style="font-size: medium;">&#8203;<span style="font-weight: bold;">3.) Select the tweak and hit the apply button:</span></span><br />
<img src="http://i.imgur.com/A6Gemp6.png" border="0" alt="[Image: A6Gemp6.png]" /></div></div></div></tag><tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: Assembling the source code (CajeASM) <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<span style="font-size: medium;">&#8203;<span style="font-weight: bold;">Just select your ROM file and the "EyerokBossFix_ASM.txt" source file, then click "Assemble!". That's all there is to it. How easy was that?</span></span><br />
<img src="http://i.imgur.com/IAxCXm6.png" border="0" alt="[Image: IAxCXm6.png]" /></div></div></div></tag><br /><!-- start: postbit_attachments_attachment -->
<div><span class="float_right">Size: <u>15.49 KB</u> / Downloads: <u>169</u></span>
<span class="float_left"><!-- start: attachment_icon -->
<img src="images/attachtypes/xls.png" title="XML File" border="0" alt=".xml" style="vertical-align: middle;" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=369" class="attachment_" target="_blank" title="">EyerokBossFix.xml</a> </span></div>
<br class="clear"/>
<!-- end: postbit_attachments_attachment --><br /><!-- start: postbit_attachments_attachment -->
<div><span class="float_right">Size: <u>24.81 KB</u> / Downloads: <u>140</u></span>
<span class="float_left"><!-- start: attachment_icon -->
<img src="images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" style="vertical-align: middle;" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=370" class="attachment_" target="_blank" title="">EyerokBossFix_ASM.txt</a> </span></div>
<br class="clear"/>
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA["Openable Grills" object ASM fix for custom levels]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=417</link>
			<pubDate>Sat, 21 May 2016 14:04:47 +1000</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=417</guid>
			<description><![CDATA[So I was helping <span style="color: #CC00CC;">MrGreenThunder </span>out on IRC because he was having some issues with the openable grills object crashing his custom level when he got near it. The crash was caused by the game trying to process collision data that didn't exist. The grills collision data was stored with the level data of BBB and HMC. So to fix this issue, I created my own custom collision data that the object will use. You do need to know how to hex edit and have a basic understanding of <a href="https://wiki.origami64.net/super_mario_64/level_commands" target="_blank">level scripts</a> to modify the position of the doors. The 0x24 command you're looking for should end with [ 13 00 25 E0 ].<br />
<br />
Once you found it, make the following changes to the code (colored parts):<br />
24 18 1F 00 02 66 ED AE 09 1A 00 00 01 0E 00 00 00 <span style="color: #336699;">3C</span> <span style="color: #cc3333;">01 90</span> 13 00 25 E0<br />
<br />
The <span style="color: #336699;">0x3C </span>value is the model ID your going to use for the doors. The <span style="color: #cc3333;">0x190</span> value is the spacing along the X-axis between the doors. Unfortunately, you have to use a hex editor as TT64 can't modify that <span style="color: #cc3333;">0x190</span> value. If you don't modify that value, then it will be set to 0x190 by default.<br />
<br />
Pros:<br />
* Works with custom levels<br />
* Works with the 8 MB ROM<br />
Cons:<br />
* Only 1 fixed collision box for all doors (based on the HMC grill doors)<br />
* Requires a little bit of hex editing to change the x-position offsets of the doors<br />
<br />
You will have to use the latest version of <a href="http://origami64.net/showthread.php?tid=30" target="_blank">CajeASM (v7.24</a>) to import the ASM code into the ROM. ASM Code download is in the attachments.<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: ASM Code <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="color: #008000;">// BehBobHmcCageDoorLoop: begin 802C263C (07D63C)</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x07D63C</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x10</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">LUI</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x8036</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x1160</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T7</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">BNEZ</span> <span style="color: #800000;">T7</span>, GrillDoorLoop_state1<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T9</span>, <span style="color: #0000FF;">0x68</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x88</span><span style="color: #ACACAC;">(t9)</span> </span><span style="color: #008000;">// t0 == 1 if the switch has been activated</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">T0</span>, GrillDoorLoop_end<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">R0</span>, GrillDoorLoop_increment<br />
 <span style="color: #FF8000;">NOP</span><br />
GrillDoorLoop_state1: </span><span style="color: #008000;">// 802C2684</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x1</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T5</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">BNE</span> <span style="color: #800000;">T5</span>, <span style="color: #800000;">AT</span>, GrillDoorLoop_end<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T7</span>, <span style="color: #0000FF;">0x154</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// door->0x154 = timer</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">SLTI</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">T7</span>, <span style="color: #0000FF;">0x40</span> </span><span style="color: #008000;">// if (timer < 0x40) then at = 1</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">AT</span>, GrillDoorLoop_increment<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x144</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T9</span>, <span style="color: #0000FF;">0xc8</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">SLL</span> <span style="color: #800000;">T2</span>, <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8</span><br />
 <span style="color: #FF8000;">SUBU</span> <span style="color: #800000;">T3</span>, <span style="color: #800000;">T9</span>, <span style="color: #800000;">T2</span> </span><span style="color: #008000;">// Rotate cage door by (door->0x144) * 256</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">R0</span>, GrillDoorLoop_end<br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0xc8</span><span style="color: #ACACAC;">(s0)</span><br />
GrillDoorLoop_increment: </span><span style="color: #008000;">// 802C26D4</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">T5</span>, <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x1</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T5</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
GrillDoorLoop_end: </span><span style="color: #008000;">// 802C26E8</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x10</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">JR</span> <span style="color: #800000;">RA</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span><br />
</span>&#8203;<span style="color: #008000;">// end BehBobHmcCageDoorLoop</span><br />
<br />
<span style="color: #008000;">&#8203;// New behavior for doors, seg address: 002C26C0</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x07D6C0</span><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{<br />
<span style="display:inline-block;width: 20px;"></span>00 09 00 00<br />
<span style="display:inline-block;width: 20px;"></span>11 01 00 09<br />
<span style="display:inline-block;width: 20px;"></span>2A 00 00 00 00 2C 28 98<br />
<span style="display:inline-block;width: 20px;"></span>08 00 00 00<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 2C 26 3C<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 38 39 CC<br />
<span style="display:inline-block;width: 20px;"></span>09 00 00 00 <br />
}</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x405A90</span> </span><span style="color: #008000;">// Fix gate in Bob-omb Battlefield</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{ <br />
<span style="display:inline-block;width: 20px;"></span>24 18 1F 00 F7 FE 00 00 F4 03 00 00 00 19 00 00 00 38 01 40 13 00 25 E0<br />
}</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x3E6C44</span> </span><span style="color: #008000;">// Fix gate in Hazy Maze Cave</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{ <br />
<span style="display:inline-block;width: 20px;"></span>24 18 1F 00 02 66 ED AE 09 1A 00 00 01 0E 00 00 00 3C 01 90 13 00 25 E0<br />
}</span><br />
<br />
<span style="color: #008000;">&#8203;// BehOpenableGrillLoop: begin 802C26F8 (07D6F8)</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x07D6F8</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFC0</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x2c</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x28</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">LUI</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x8036</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x1160</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// s0 = pointer to current object</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// object->0x14C = current state</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">T0</span>, OpenableGrillLoop_init<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x1</span><br />
 <span style="color: #FF8000;">BEQ</span> <span style="color: #800000;">T0</span>, <span style="color: #800000;">AT</span>, OpenableGrillLoop_check<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x2</span><br />
 <span style="color: #FF8000;">BEQ</span> <span style="color: #800000;">T0</span>, <span style="color: #800000;">AT</span>, OpenableGrillLoop_open<br />
 <span style="color: #FF8000;">NOP</span><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">R0</span>, OpenableGrillLoop_end<br />
 <span style="color: #FF8000;">NOP</span> <br />
OpenableGrillLoop_init: </span><span style="color: #008000;">// state 0, initizalize</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x144</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x14</span><span style="color: #ACACAC;">(sp)</span> </span><span style="color: #008000;">// Model ID</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">A1</span>, <span style="color: #0000FF;">0x188</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// X-offset</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">ANDI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">A1</span>, <span style="color: #0000FF;">0xFFFF</span><br />
 <span style="color: #FF8000;">BNEZ</span> <span style="color: #800000;">A1</span>, OpenableGrillLoop_skipXFix </span><span style="color: #008000;">// branch if X-offset does not equal zero.</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">NOP</span><br />
 <span style="color: #FF8000;">ORI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x190</span><br />
 <span style="color: #FF8000;">SH</span> <span style="color: #800000;">A1</span>, <span style="color: #0000FF;">0x18A</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// Fixes X-offset, if it equals zero.</span><span style="font-weight: bold;"><br />
 OpenableGrillLoop_skipXFix:<br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x10</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">LUI</span> <span style="color: #800000;">T5</span>, <span style="color: #0000FF;">0x002C</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">T5</span>, <span style="color: #800000;">T5</span>, <span style="color: #0000FF;">0x26c0</span> </span><span style="color: #008000;">//002C26C0</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T5</span>, <span style="color: #0000FF;">0x18</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0xFFFF</span><br />
 <span style="color: #FF8000;">MOV</span> <span style="color: #800000;">A2</span>, <span style="color: #800000;">R0</span><br />
 <span style="color: #FF8000;">JAL</span> <span style="color: #0000FF;">0x8029EF64</span> </span><span style="color: #008000;">// SpawnObjAdv(-1, obj->0x188, 0, 0, obj, obj->0x144, 0x130025C0);</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">MOV</span> <span style="color: #800000;">A3</span>, <span style="color: #800000;">R0</span><br />
 <span style="color: #FF8000;">ORI</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x8000</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T7</span>, <span style="color: #0000FF;">0xc8</span><span style="color: #ACACAC;">(v0)</span><br />
 <span style="color: #FF8000;">ADDU</span> <span style="color: #800000;">T8</span>, <span style="color: #800000;">T7</span>, <span style="color: #800000;">AT</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T8</span>, <span style="color: #0000FF;">0xc8</span><span style="color: #ACACAC;">(v0)</span> </span><span style="color: #008000;">// Rotate first gate 180 degrees</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x144</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x14</span><span style="color: #ACACAC;">(sp)</span> </span><span style="color: #008000;">// Model ID</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">A1</span>, <span style="color: #0000FF;">0x188</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// X-offset</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">ANDI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">A1</span>, <span style="color: #0000FF;">0xFFFF</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x10</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">LUI</span> <span style="color: #800000;">T8</span>, <span style="color: #0000FF;">0x002C</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">T8</span>, <span style="color: #800000;">T8</span>, <span style="color: #0000FF;">0x26c0</span> </span><span style="color: #008000;">//002C26C0</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T8</span>, <span style="color: #0000FF;">0x18</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x1</span><br />
 <span style="color: #FF8000;">MOV</span> <span style="color: #800000;">A2</span>, <span style="color: #800000;">R0</span><br />
 <span style="color: #FF8000;">SUBU</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">R0</span>, <span style="color: #800000;">A1</span><br />
 <span style="color: #FF8000;">JAL</span> <span style="color: #0000FF;">0x8029EF64</span> </span><span style="color: #008000;">// SpawnObjAdv(1, -obj->0x188, 0, 0, obj, obj->0x144, 0x130025C0);</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">MOV</span> <span style="color: #800000;">A3</span>, <span style="color: #800000;">R0</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">T3</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x1</span><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">R0</span>, OpenableGrillLoop_end<br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// increment state value</span><span style="font-weight: bold;"><br />
OpenableGrillLoop_check: </span><span style="color: #008000;">// state 1, check for floor switch press.</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LUI</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x1300</span> <br />
 <span style="color: #FF8000;">JAL</span> <span style="color: #0000FF;">0x8029F95C</span> <br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x1478</span> </span><span style="color: #008000;">// a0 = 0x13001478 = beh_floor_switch_grills</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">V0</span>, OpenableGrillLoop_end<br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">V0</span>, <span style="color: #0000FF;">0xf4</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// increment state value</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">T7</span>, <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x1</span><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">R0</span>, OpenableGrillLoop_end<br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T7</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
OpenableGrillLoop_open: </span><span style="color: #008000;">// state 2, open doors</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T6</span>, <span style="color: #0000FF;">0xf4</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x2</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(t6)</span><br />
 <span style="color: #FF8000;">BNE</span> <span style="color: #800000;">T1</span>, <span style="color: #800000;">AT</span>, OpenableGrillLoop_end<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x88</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// Store 0x2 to (object->0x88)</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LUI</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x303f</span><br />
 <span style="color: #FF8000;">JAL</span> <span style="color: #0000FF;">0x802CA1E0</span> </span><span style="color: #008000;">// PlaySound2</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">ORI</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0xa081</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">T7</span>, <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x1</span> </span><span style="color: #008000;">// increment state value</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T7</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T8</span>, <span style="color: #0000FF;">0x144</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">ORI</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x3C</span><br />
 <span style="color: #FF8000;">BNE</span> <span style="color: #800000;">T8</span>, <span style="color: #800000;">AT</span>, OpenableGrillLoop_end<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">JAL</span> <span style="color: #0000FF;">0x803220F0</span> </span><span style="color: #008000;">// Sets fanfare music for HMC.</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">NOP</span> <br />
OpenableGrillLoop_end: </span><span style="color: #008000;">// end of function</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x2c</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x28</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x40</span><br />
 <span style="color: #FF8000;">JR</span> <span style="color: #800000;">RA</span><br />
 <span style="color: #FF8000;">NOP</span> <br />
<br />
 </span><span style="color: #008000;">// Collision Data (0x84 bytes long), seg address: 002C2898</span><span style="font-weight: bold;"><br />
 <span style="color: #64B3D0;">.org</span> <span style="color: #0000FF;">0x7D898</span><br />
 <span style="color: #64B3D0;">hex</span> </span><span style="color: #004080;">{<br />
<span style="display:inline-block;width: 20px;"></span> 0040 0008<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 019A 0000 0033<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 019A 02CF FFCE<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 019A 02CF 0033<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0000 02CF 0033<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0000 0000 0033<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0000 02CF FFCE<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 019A 0000 FFCE<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0000 0000 FFCE<br />
<span style="display:inline-block;width: 20px;"></span> 0000 000C<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0000 0001 0002<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0002 0003 0004<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0002 0004 0000<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0002 0001 0005<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0002 0005 0003<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0006 0005 0001<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0000 0006 0001<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0006 0007 0005<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0003 0005 0007<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0003 0007 0004<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0004 0007 0006<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0004 0006 0000<br />
<span style="display:inline-block;width: 20px;"></span> 0041 0042<br />
 }<br />
</span>&#8203;</span></span></span></code></div></div></div></tag>Once your import the source code, the object should now work with custom levels  <img src="https://skelux.root.sx/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" /><br />
<br />
<img src="http://i.imgur.com/KcwPeNS.png" border="0" alt="[Image: KcwPeNS.png]" /><br /><!-- start: postbit_attachments_attachment -->
<div><span class="float_right">Size: <u>4.39 KB</u> / Downloads: <u>279</u></span>
<span class="float_left"><!-- start: attachment_icon -->
<img src="images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" style="vertical-align: middle;" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=365" class="attachment_" target="_blank" title="">OpenableGrillsFix.txt</a> </span></div>
<br class="clear"/>
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[So I was helping <span style="color: #CC00CC;">MrGreenThunder </span>out on IRC because he was having some issues with the openable grills object crashing his custom level when he got near it. The crash was caused by the game trying to process collision data that didn't exist. The grills collision data was stored with the level data of BBB and HMC. So to fix this issue, I created my own custom collision data that the object will use. You do need to know how to hex edit and have a basic understanding of <a href="https://wiki.origami64.net/super_mario_64/level_commands" target="_blank">level scripts</a> to modify the position of the doors. The 0x24 command you're looking for should end with [ 13 00 25 E0 ].<br />
<br />
Once you found it, make the following changes to the code (colored parts):<br />
24 18 1F 00 02 66 ED AE 09 1A 00 00 01 0E 00 00 00 <span style="color: #336699;">3C</span> <span style="color: #cc3333;">01 90</span> 13 00 25 E0<br />
<br />
The <span style="color: #336699;">0x3C </span>value is the model ID your going to use for the doors. The <span style="color: #cc3333;">0x190</span> value is the spacing along the X-axis between the doors. Unfortunately, you have to use a hex editor as TT64 can't modify that <span style="color: #cc3333;">0x190</span> value. If you don't modify that value, then it will be set to 0x190 by default.<br />
<br />
Pros:<br />
* Works with custom levels<br />
* Works with the 8 MB ROM<br />
Cons:<br />
* Only 1 fixed collision box for all doors (based on the HMC grill doors)<br />
* Requires a little bit of hex editing to change the x-position offsets of the doors<br />
<br />
You will have to use the latest version of <a href="http://origami64.net/showthread.php?tid=30" target="_blank">CajeASM (v7.24</a>) to import the ASM code into the ROM. ASM Code download is in the attachments.<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: ASM Code <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="color: #008000;">// BehBobHmcCageDoorLoop: begin 802C263C (07D63C)</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x07D63C</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x10</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">LUI</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x8036</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x1160</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T7</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">BNEZ</span> <span style="color: #800000;">T7</span>, GrillDoorLoop_state1<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T9</span>, <span style="color: #0000FF;">0x68</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x88</span><span style="color: #ACACAC;">(t9)</span> </span><span style="color: #008000;">// t0 == 1 if the switch has been activated</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">T0</span>, GrillDoorLoop_end<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">R0</span>, GrillDoorLoop_increment<br />
 <span style="color: #FF8000;">NOP</span><br />
GrillDoorLoop_state1: </span><span style="color: #008000;">// 802C2684</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x1</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T5</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">BNE</span> <span style="color: #800000;">T5</span>, <span style="color: #800000;">AT</span>, GrillDoorLoop_end<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T7</span>, <span style="color: #0000FF;">0x154</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// door->0x154 = timer</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">SLTI</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">T7</span>, <span style="color: #0000FF;">0x40</span> </span><span style="color: #008000;">// if (timer < 0x40) then at = 1</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">AT</span>, GrillDoorLoop_increment<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x144</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T9</span>, <span style="color: #0000FF;">0xc8</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">SLL</span> <span style="color: #800000;">T2</span>, <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8</span><br />
 <span style="color: #FF8000;">SUBU</span> <span style="color: #800000;">T3</span>, <span style="color: #800000;">T9</span>, <span style="color: #800000;">T2</span> </span><span style="color: #008000;">// Rotate cage door by (door->0x144) * 256</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">R0</span>, GrillDoorLoop_end<br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0xc8</span><span style="color: #ACACAC;">(s0)</span><br />
GrillDoorLoop_increment: </span><span style="color: #008000;">// 802C26D4</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">T5</span>, <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x1</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T5</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
GrillDoorLoop_end: </span><span style="color: #008000;">// 802C26E8</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x10</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">JR</span> <span style="color: #800000;">RA</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span><br />
</span>&#8203;<span style="color: #008000;">// end BehBobHmcCageDoorLoop</span><br />
<br />
<span style="color: #008000;">&#8203;// New behavior for doors, seg address: 002C26C0</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x07D6C0</span><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{<br />
<span style="display:inline-block;width: 20px;"></span>00 09 00 00<br />
<span style="display:inline-block;width: 20px;"></span>11 01 00 09<br />
<span style="display:inline-block;width: 20px;"></span>2A 00 00 00 00 2C 28 98<br />
<span style="display:inline-block;width: 20px;"></span>08 00 00 00<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 2C 26 3C<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 38 39 CC<br />
<span style="display:inline-block;width: 20px;"></span>09 00 00 00 <br />
}</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x405A90</span> </span><span style="color: #008000;">// Fix gate in Bob-omb Battlefield</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{ <br />
<span style="display:inline-block;width: 20px;"></span>24 18 1F 00 F7 FE 00 00 F4 03 00 00 00 19 00 00 00 38 01 40 13 00 25 E0<br />
}</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x3E6C44</span> </span><span style="color: #008000;">// Fix gate in Hazy Maze Cave</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{ <br />
<span style="display:inline-block;width: 20px;"></span>24 18 1F 00 02 66 ED AE 09 1A 00 00 01 0E 00 00 00 3C 01 90 13 00 25 E0<br />
}</span><br />
<br />
<span style="color: #008000;">&#8203;// BehOpenableGrillLoop: begin 802C26F8 (07D6F8)</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x07D6F8</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFC0</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x2c</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x28</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">LUI</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x8036</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x1160</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// s0 = pointer to current object</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// object->0x14C = current state</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">T0</span>, OpenableGrillLoop_init<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x1</span><br />
 <span style="color: #FF8000;">BEQ</span> <span style="color: #800000;">T0</span>, <span style="color: #800000;">AT</span>, OpenableGrillLoop_check<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x2</span><br />
 <span style="color: #FF8000;">BEQ</span> <span style="color: #800000;">T0</span>, <span style="color: #800000;">AT</span>, OpenableGrillLoop_open<br />
 <span style="color: #FF8000;">NOP</span><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">R0</span>, OpenableGrillLoop_end<br />
 <span style="color: #FF8000;">NOP</span> <br />
OpenableGrillLoop_init: </span><span style="color: #008000;">// state 0, initizalize</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x144</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x14</span><span style="color: #ACACAC;">(sp)</span> </span><span style="color: #008000;">// Model ID</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">A1</span>, <span style="color: #0000FF;">0x188</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// X-offset</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">ANDI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">A1</span>, <span style="color: #0000FF;">0xFFFF</span><br />
 <span style="color: #FF8000;">BNEZ</span> <span style="color: #800000;">A1</span>, OpenableGrillLoop_skipXFix </span><span style="color: #008000;">// branch if X-offset does not equal zero.</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">NOP</span><br />
 <span style="color: #FF8000;">ORI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x190</span><br />
 <span style="color: #FF8000;">SH</span> <span style="color: #800000;">A1</span>, <span style="color: #0000FF;">0x18A</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// Fixes X-offset, if it equals zero.</span><span style="font-weight: bold;"><br />
 OpenableGrillLoop_skipXFix:<br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x10</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">LUI</span> <span style="color: #800000;">T5</span>, <span style="color: #0000FF;">0x002C</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">T5</span>, <span style="color: #800000;">T5</span>, <span style="color: #0000FF;">0x26c0</span> </span><span style="color: #008000;">//002C26C0</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T5</span>, <span style="color: #0000FF;">0x18</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0xFFFF</span><br />
 <span style="color: #FF8000;">MOV</span> <span style="color: #800000;">A2</span>, <span style="color: #800000;">R0</span><br />
 <span style="color: #FF8000;">JAL</span> <span style="color: #0000FF;">0x8029EF64</span> </span><span style="color: #008000;">// SpawnObjAdv(-1, obj->0x188, 0, 0, obj, obj->0x144, 0x130025C0);</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">MOV</span> <span style="color: #800000;">A3</span>, <span style="color: #800000;">R0</span><br />
 <span style="color: #FF8000;">ORI</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x8000</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T7</span>, <span style="color: #0000FF;">0xc8</span><span style="color: #ACACAC;">(v0)</span><br />
 <span style="color: #FF8000;">ADDU</span> <span style="color: #800000;">T8</span>, <span style="color: #800000;">T7</span>, <span style="color: #800000;">AT</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T8</span>, <span style="color: #0000FF;">0xc8</span><span style="color: #ACACAC;">(v0)</span> </span><span style="color: #008000;">// Rotate first gate 180 degrees</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x144</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x14</span><span style="color: #ACACAC;">(sp)</span> </span><span style="color: #008000;">// Model ID</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">A1</span>, <span style="color: #0000FF;">0x188</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// X-offset</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">ANDI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">A1</span>, <span style="color: #0000FF;">0xFFFF</span><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x10</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">LUI</span> <span style="color: #800000;">T8</span>, <span style="color: #0000FF;">0x002C</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">T8</span>, <span style="color: #800000;">T8</span>, <span style="color: #0000FF;">0x26c0</span> </span><span style="color: #008000;">//002C26C0</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T8</span>, <span style="color: #0000FF;">0x18</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x1</span><br />
 <span style="color: #FF8000;">MOV</span> <span style="color: #800000;">A2</span>, <span style="color: #800000;">R0</span><br />
 <span style="color: #FF8000;">SUBU</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">R0</span>, <span style="color: #800000;">A1</span><br />
 <span style="color: #FF8000;">JAL</span> <span style="color: #0000FF;">0x8029EF64</span> </span><span style="color: #008000;">// SpawnObjAdv(1, -obj->0x188, 0, 0, obj, obj->0x144, 0x130025C0);</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">MOV</span> <span style="color: #800000;">A3</span>, <span style="color: #800000;">R0</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">T3</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x1</span><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">R0</span>, OpenableGrillLoop_end<br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// increment state value</span><span style="font-weight: bold;"><br />
OpenableGrillLoop_check: </span><span style="color: #008000;">// state 1, check for floor switch press.</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LUI</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x1300</span> <br />
 <span style="color: #FF8000;">JAL</span> <span style="color: #0000FF;">0x8029F95C</span> <br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x1478</span> </span><span style="color: #008000;">// a0 = 0x13001478 = beh_floor_switch_grills</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">V0</span>, OpenableGrillLoop_end<br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">V0</span>, <span style="color: #0000FF;">0xf4</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// increment state value</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">T7</span>, <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x1</span><br />
 <span style="color: #FF8000;">BEQZ</span> <span style="color: #800000;">R0</span>, OpenableGrillLoop_end<br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T7</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
OpenableGrillLoop_open: </span><span style="color: #008000;">// state 2, open doors</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T6</span>, <span style="color: #0000FF;">0xf4</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x2</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(t6)</span><br />
 <span style="color: #FF8000;">BNE</span> <span style="color: #800000;">T1</span>, <span style="color: #800000;">AT</span>, OpenableGrillLoop_end<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x88</span><span style="color: #ACACAC;">(s0)</span> </span><span style="color: #008000;">// Store 0x2 to (object->0x88)</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LUI</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x303f</span><br />
 <span style="color: #FF8000;">JAL</span> <span style="color: #0000FF;">0x802CA1E0</span> </span><span style="color: #008000;">// PlaySound2</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">ORI</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0xa081</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">T7</span>, <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x1</span> </span><span style="color: #008000;">// increment state value</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">SW</span> <span style="color: #800000;">T7</span>, <span style="color: #0000FF;">0x14c</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">T8</span>, <span style="color: #0000FF;">0x144</span><span style="color: #ACACAC;">(s0)</span><br />
 <span style="color: #FF8000;">ORI</span> <span style="color: #800000;">AT</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x3C</span><br />
 <span style="color: #FF8000;">BNE</span> <span style="color: #800000;">T8</span>, <span style="color: #800000;">AT</span>, OpenableGrillLoop_end<br />
 <span style="color: #FF8000;">NOP</span> <br />
 <span style="color: #FF8000;">JAL</span> <span style="color: #0000FF;">0x803220F0</span> </span><span style="color: #008000;">// Sets fanfare music for HMC.</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">NOP</span> <br />
OpenableGrillLoop_end: </span><span style="color: #008000;">// end of function</span><span style="font-weight: bold;"><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x2c</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">LW</span> <span style="color: #800000;">S0</span>, <span style="color: #0000FF;">0x28</span><span style="color: #ACACAC;">(sp)</span><br />
 <span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x40</span><br />
 <span style="color: #FF8000;">JR</span> <span style="color: #800000;">RA</span><br />
 <span style="color: #FF8000;">NOP</span> <br />
<br />
 </span><span style="color: #008000;">// Collision Data (0x84 bytes long), seg address: 002C2898</span><span style="font-weight: bold;"><br />
 <span style="color: #64B3D0;">.org</span> <span style="color: #0000FF;">0x7D898</span><br />
 <span style="color: #64B3D0;">hex</span> </span><span style="color: #004080;">{<br />
<span style="display:inline-block;width: 20px;"></span> 0040 0008<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 019A 0000 0033<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 019A 02CF FFCE<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 019A 02CF 0033<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0000 02CF 0033<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0000 0000 0033<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0000 02CF FFCE<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 019A 0000 FFCE<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0000 0000 FFCE<br />
<span style="display:inline-block;width: 20px;"></span> 0000 000C<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0000 0001 0002<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0002 0003 0004<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0002 0004 0000<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0002 0001 0005<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0002 0005 0003<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0006 0005 0001<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0000 0006 0001<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0006 0007 0005<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0003 0005 0007<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0003 0007 0004<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0004 0007 0006<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span> 0004 0006 0000<br />
<span style="display:inline-block;width: 20px;"></span> 0041 0042<br />
 }<br />
</span>&#8203;</span></span></span></code></div></div></div></tag>Once your import the source code, the object should now work with custom levels  <img src="https://skelux.root.sx/images/smilies/smile.png" alt="Smile" title="Smile" class="smilie smilie_1" /><br />
<br />
<img src="http://i.imgur.com/KcwPeNS.png" border="0" alt="[Image: KcwPeNS.png]" /><br /><!-- start: postbit_attachments_attachment -->
<div><span class="float_right">Size: <u>4.39 KB</u> / Downloads: <u>279</u></span>
<span class="float_left"><!-- start: attachment_icon -->
<img src="images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" style="vertical-align: middle;" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=365" class="attachment_" target="_blank" title="">OpenableGrillsFix.txt</a> </span></div>
<br class="clear"/>
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[ASM] Sweet Dreams (Spawn a 1-UP mushroom while Mario is sleeping)]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=413</link>
			<pubDate>Sun, 15 May 2016 09:17:42 +1000</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=413</guid>
			<description><![CDATA[This tutorial will cover how to run code while Mario is doing a specific action (like sleeping). <br />
<br />
<img src="http://i.imgur.com/6JTG6P7.png" border="0" alt="[Image: 6JTG6P7.png]" /><br />
<br />
You will need the following:<ul>
<li>&#8203;An assembler program. (<a href="http://origami64.net/showthread.php?tid=30" target="_blank">CajeASM v7.24</a>)<br />
</li>
<li>&#8203;A text editor. (<a href="https://notepad-plus-plus.org/" target="_blank">notepad++</a>)<br />
</li>
<li>&#8203;A N64 emulator (<a href="http://www.emulator-zone.com/doc.php/n64/project64.html" target="_blank">Project64</a>)<br />
</li>
<li>&#8203;A fresh SM64 ROM (An 8MB ROM will work just fine)<br />
</li>
<li>&#8203;Copy of the source code (See attachement below)<br />
</li>
<li>&#8203<img src="https://skelux.root.sx/images/smilies/cry.png" alt="Cry" title="Cry" class="smilie smilie_21" />optional*) <a href="http://origami64.net/showthread.php?tid=359" target="_blank">SM64Functions.txt</a><br />
</li></ul>
* You don't need this file to run the code, but I find it to be more convenient as it allows you to write function names instead of addresses. I'll write out the address in a comment to the side for those who don't want to use it.<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: ASM Source Code <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #64B3D0;">.include</span> <span style="color: #ACACAC;">"SM64Functions.txt"</span><br />
</span>&#8203;<span style="color: #008000;"><br />
// Custom loop function 0x802CB1C0, 0x2C bytes (11 instructions) of free data left.</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x861C0</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">T2</span>, <span style="color: #0000FF;">0xB17C</span><span style="color: #ACACAC;">(T0)</span> </span><span style="color: #008000;">// T2 = current action</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x0C00</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">T1</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x0203</span> </span><span style="color: #008000;">// T1 = 0x0C000203, Sleeping action value</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;BNE</span> <span style="color: #800000;">T2</span>, <span style="color: #800000;">T1</span>, 802CB1C0_end </span><span style="color: #008000;">// Branch to end if Mario is not sleeping.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;NOP</span><br />
<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0xB1D0</span><span style="color: #ACACAC;">(T0)</span> </span><span style="color: #008000;">// Load word at 0x8033B1D0 (For this example it's a timer)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">T4</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x20</span><br />
<span style="color: #FF8000;">&#8203;BNE</span> <span style="color: #800000;">T3</span>, <span style="color: #800000;">T4</span>, 802CB1C0_incrementTimer<br />
<span style="color: #FF8000;">&#8203;NOP</span><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x8036</span><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x1158</span><span style="color: #ACACAC;">(A0)</span> </span><span style="color: #008000;">// A0 = Pointer to Mario object.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">A2</span>, <span style="color: #0000FF;">0x1300</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A2</span>, <span style="color: #800000;">A2</span>, <span style="color: #0000FF;">0x40EC</span> </span><span style="color: #008000;">// A2 = 0x130040EC, 1-UP behavior.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;JAL</span> <span style="color: #8080FF;">@SpawnObj </span></span><span style="color: #008000;">// 0x8029EDCC</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0xD4</span> </span><span style="color: #008000;">// 1-UP Model ID.</span><br />
<span style="color: #008000;">&#8203;// V0 = pointer to newly spawned 1-UP object.</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x41A0</span> </span><span style="color: #008000;">// 0x41A00000 = (float) 20.0</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;MTC1</span> <span style="color: #800000;">T4</span>, <span style="color: #800000;">F0</span> </span><span style="color: #008000;">// Move value at T4 to float register F0</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LWC1</span> <span style="color: #800000;">F2</span>, <span style="color: #0000FF;">0xA4</span><span style="color: #ACACAC;">(V0)</span> </span><span style="color: #008000;">// Get Y position of 1-UP</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ADD.S</span> <span style="color: #800000;">F2</span>, <span style="color: #800000;">F2</span>, <span style="color: #800000;">F0</span> </span><span style="color: #008000;">// Add 20.0 to Y position</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;SWC1</span> <span style="color: #800000;">F2</span>, <span style="color: #0000FF;">0xA4</span><span style="color: #ACACAC;">(V0)</span> </span><span style="color: #008000;">// Store new Y position</span><span style="font-weight: bold;"><br />
<br />
802CB1C0_incrementTimer:<br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">T3</span>, <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0x01</span><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0xB1D0</span><span style="color: #ACACAC;">(T0)</span><br />
<br />
802CB1C0_end:<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span> </span></span></span></span></code></div></div></div></tag><span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Mario's Actions</span></span><br />
<br />
We all know that Mario can do a lot of different moves within Super Mario 64. He can run, jump, side-flip, swim, swing Bowser's tail, grab boxes, and many different other things. All of these different actions that Mario can do have a corresponding u32 word value to them. Mario's current action is stored at 0x8033B17C (Mario→0x0C), while his previous action is stored at 0x8033B180 (Mario→0x10). For this tutorial we only want to know if Mario is currently sleeping, so we need to check if the value at 0x8033B17C equals 0x0C000203. <br />
<a href="https://wiki.origami64.net/super_mario_64/actions" target="_blank">&#8203;See this wiki page for the list of Mario's actions.</a><br />
<br />
<table border=1>
<tr><th> Action </th><th> Description </th></tr>
<tr><td> 0x04000440 </td><td> Moving around </td></tr>
<tr><td> 0x03000880 </td><td> Jump </td></tr>
<tr><td> 0x03000881 </td><td> Double-jump </td></tr>
<tr><td> 0x03000882 </td><td> Triple-jump </td></tr>
<tr><td> 0x008008A9 </td><td> Ground-pounding </td></tr>
<tr><td> 0x0C008220 </td><td> Crouching </td></tr>
<tr><td> 0x0C400201 </td><td> Idle </td></tr>
<tr><td> 0x0C400202 </td><td> Yawning </td></tr>
<tr><td> 0x0C000203 </td><td> Sleeping </td></tr>
</table>
<br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Hooking the code (Function 0x802CB1C0)</span></span><br />
<br />
Most ASM tutorials overwrite the 0x802CB1C0 function to get custom code to run. Here are 3 specific reasons to why we use this function.<br />
<ol type="1">
<li>&#8203;The function calls on a useless debug menu <a href="http://smwc.me/1070677" target="_blank">(according to Kaze)</a>, meaning we can change it without affecting the game in any way<br />
</li>
<li>&#8203;It is called within Mario's behavior loop, so we know that it will be called every frame. We can change Mario's behavior script if we only want the function to run once.<br />
</li>
<li>&#8203;The function is 0xA4 bytes long, which gives us 41 ASM instructions to play around with. This is more than enough space for most basic tutorials. If more space is needed, then we can turn this function into one that can call the dmaCopy function.<br />
</li></ol>
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Checking the current action</span></span><br />
<br />
First we must check if the current action (value at 0x8033B17C) equals 0x0C000203. To do this we first load the word at 0x8033B17C into register T2, then set the value of register T1 to 0x0C000203. Once we do that, we can compare the two values using the BNE (Branch Not Equal) OpCode. If the two values are not equal, then the game logic will move down to the "802CB1C0_end" label I set near the end of the function.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #64B3D0;">.org</span> <span style="color: #0000FF;">0x861C0</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">T2</span>, <span style="color: #0000FF;">0xB17C</span><span style="color: #ACACAC;">(T0)</span> </span><span style="color: #008000;">// T2 = current action</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x0C00</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">T1</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x0203</span> </span><span style="color: #008000;">// T1 = 0x0C000203, Sleeping action value</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;BNE</span> <span style="color: #800000;">T2</span>, <span style="color: #800000;">T1</span>, 802CB1C0_end </span><span style="color: #008000;">// Branch to end if Mario is not sleeping.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;NOP</span><br />
</span>&#8203;</span></span></span></code><br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Setting up a delay</span></span><br />
<br />
We don't want to spawn the 1-UP as soon as Mario falls asleep, because that doesn't look very good. Mario needs to sleep for a little bit before he gets a mushroom, so we want to setup a little delay for when Mario goes to sleep and when the 1-UP mushroom spawns. While Mario is running around or Idle the value at the address 0x8033B1D0 is set to zero, but not when he is sleeping. This means we can change that value while Mario is sleeping, and it will reset when Mario wakes up. The delay time will be 32 frames (0x20), which is just a little over a second. If the timer does not equal 0x20, then the value will increment by 1. If both values are equal, then the 1-up mushroom will spawn above Mario's head.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #FF8000;">LW</span> <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0xB1D0</span><span style="color: #ACACAC;">(T0)</span> </span><span style="color: #008000;">// Load word at 0x8033B1D0 (For this example it's a delay timer)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">T4</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x20</span> </span><span style="color: #008000;">// T4 = 0x20 (Decimal value 32)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;BNE</span> <span style="color: #800000;">T3</span>, <span style="color: #800000;">T4</span>, 802CB1C0_incrementTimer </span><span style="color: #008000;">// Branch if T3 != T4</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;NOP</span></span></span></span></span></code><br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Spawning the 1-UP mushroom</span></span><br />
<br />
To spawn the 1-UP we must use the @SpawnObj (0x8029EDCC) function which we will use to spawn it at Mario's location. It takes 3 arguments: A0 = Object to spawn to, A1 = Model ID, A2 = Behavior segmented address. Mario's object pointer to located at 0x80361158, so we will load the word at that address for A0. The model ID for the 1-up mushroom is 0xD4. There are a few different behaviors for the 1-UP mushroom, but the one we want is 0x130040EC which will spin around above Mario's head before landing on Mario.<br />
<br />
After we spawned the 1-UP mushroom we need to move it's Y-position up so that it can appear above Mario's head. The @SpawnObj function returns a pointer to the 1-UP object in register V0. So we are going to add to the value of offset 0xA4 (y-position) of the 1-UP object. Now every object's XYZ position are stored as floating point numbers, which are different values than regular integers. You can use this helpful webpage to convert decimal to a floating point hex value: <a href="http://www.h-schmidt.net/FloatConverter/IEEE754.html" target="_blank">http://www.h-schmidt.net/FloatConverter/IEEE754.html</a><br />
<br />
<span style="color: #cc3333;">&#8203;Note: </span>It's good practice to only use the even-numbered floating point registers (F0, F2, F4, etc). Using odd-numbered FP registers in Wii VC will crash the game, so keep this in mind when creating ROM hacks.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #FF8000;">LUI</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x8036</span><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x1158</span><span style="color: #ACACAC;">(A0)</span> </span><span style="color: #008000;">// A0 = Pointer to Mario object.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">A2</span>, <span style="color: #0000FF;">0x1300</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A2</span>, <span style="color: #800000;">A2</span>, <span style="color: #0000FF;">0x40EC</span> </span><span style="color: #008000;">// A2 = 0x130040EC, 1-UP behavior.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;JAL</span> <span style="color: #8080FF;">@SpawnObj </span></span><span style="color: #008000;">// 0x8029EDCC</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0xD4</span> </span><span style="color: #008000;">// 1-UP Model ID.</span><br />
<span style="color: #008000;">&#8203;// V0 = pointer to newly spawned 1-UP object.</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x41A0</span> </span><span style="color: #008000;">// 0x41A00000 = (float) 20.0</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;MTC1</span> <span style="color: #800000;">T4</span>, <span style="color: #800000;">F0</span> </span><span style="color: #008000;">// Move value at T4 to float register F0</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LWC1</span> <span style="color: #800000;">F2</span>, <span style="color: #0000FF;">0xA4</span><span style="color: #ACACAC;">(V0)</span> </span><span style="color: #008000;">// Get Y position of 1-UP</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ADD.S</span> <span style="color: #800000;">F2</span>, <span style="color: #800000;">F2</span>, <span style="color: #800000;">F0</span> </span><span style="color: #008000;">// Add 20.0 to Y position</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;SWC1</span> <span style="color: #800000;">F2</span>, <span style="color: #0000FF;">0xA4</span><span style="color: #ACACAC;">(V0)</span> </span><span style="color: #008000;">// Store new Y position</span></span></span></span></code><br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Finishing up the code</span></span><br />
<br />
To finish up the code we have our 2 branch labels. The incrementTimer label will increase the value at 0x8033B1D0 by 1, and the end label will jump back to where the function was called from.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;">802CB1C0_incrementTimer:<br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">T3</span>, <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0x01</span><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0xB1D0</span><span style="color: #ACACAC;">(T0)</span><br />
<br />
802CB1C0_end:<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span> </span></span></span></span></code><br />
Now assemble the code and a 1-UP mushroom should appear when Mario falls asleep. If you have any questions, please leave a reply below and I'll try to answer it the best I can.<br /><!-- start: postbit_attachments_attachment -->
<div><span class="float_right">Size: <u>1.1 KB</u> / Downloads: <u>158</u></span>
<span class="float_left"><!-- start: attachment_icon -->
<img src="images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" style="vertical-align: middle;" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=359" class="attachment_" target="_blank" title="">SleepTest.txt</a> </span></div>
<br class="clear"/>
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[This tutorial will cover how to run code while Mario is doing a specific action (like sleeping). <br />
<br />
<img src="http://i.imgur.com/6JTG6P7.png" border="0" alt="[Image: 6JTG6P7.png]" /><br />
<br />
You will need the following:<ul>
<li>&#8203;An assembler program. (<a href="http://origami64.net/showthread.php?tid=30" target="_blank">CajeASM v7.24</a>)<br />
</li>
<li>&#8203;A text editor. (<a href="https://notepad-plus-plus.org/" target="_blank">notepad++</a>)<br />
</li>
<li>&#8203;A N64 emulator (<a href="http://www.emulator-zone.com/doc.php/n64/project64.html" target="_blank">Project64</a>)<br />
</li>
<li>&#8203;A fresh SM64 ROM (An 8MB ROM will work just fine)<br />
</li>
<li>&#8203;Copy of the source code (See attachement below)<br />
</li>
<li>&#8203<img src="https://skelux.root.sx/images/smilies/cry.png" alt="Cry" title="Cry" class="smilie smilie_21" />optional*) <a href="http://origami64.net/showthread.php?tid=359" target="_blank">SM64Functions.txt</a><br />
</li></ul>
* You don't need this file to run the code, but I find it to be more convenient as it allows you to write function names instead of addresses. I'll write out the address in a comment to the side for those who don't want to use it.<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: ASM Source Code <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #64B3D0;">.include</span> <span style="color: #ACACAC;">"SM64Functions.txt"</span><br />
</span>&#8203;<span style="color: #008000;"><br />
// Custom loop function 0x802CB1C0, 0x2C bytes (11 instructions) of free data left.</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x861C0</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">T2</span>, <span style="color: #0000FF;">0xB17C</span><span style="color: #ACACAC;">(T0)</span> </span><span style="color: #008000;">// T2 = current action</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x0C00</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">T1</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x0203</span> </span><span style="color: #008000;">// T1 = 0x0C000203, Sleeping action value</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;BNE</span> <span style="color: #800000;">T2</span>, <span style="color: #800000;">T1</span>, 802CB1C0_end </span><span style="color: #008000;">// Branch to end if Mario is not sleeping.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;NOP</span><br />
<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0xB1D0</span><span style="color: #ACACAC;">(T0)</span> </span><span style="color: #008000;">// Load word at 0x8033B1D0 (For this example it's a timer)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">T4</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x20</span><br />
<span style="color: #FF8000;">&#8203;BNE</span> <span style="color: #800000;">T3</span>, <span style="color: #800000;">T4</span>, 802CB1C0_incrementTimer<br />
<span style="color: #FF8000;">&#8203;NOP</span><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x8036</span><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x1158</span><span style="color: #ACACAC;">(A0)</span> </span><span style="color: #008000;">// A0 = Pointer to Mario object.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">A2</span>, <span style="color: #0000FF;">0x1300</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A2</span>, <span style="color: #800000;">A2</span>, <span style="color: #0000FF;">0x40EC</span> </span><span style="color: #008000;">// A2 = 0x130040EC, 1-UP behavior.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;JAL</span> <span style="color: #8080FF;">@SpawnObj </span></span><span style="color: #008000;">// 0x8029EDCC</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0xD4</span> </span><span style="color: #008000;">// 1-UP Model ID.</span><br />
<span style="color: #008000;">&#8203;// V0 = pointer to newly spawned 1-UP object.</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x41A0</span> </span><span style="color: #008000;">// 0x41A00000 = (float) 20.0</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;MTC1</span> <span style="color: #800000;">T4</span>, <span style="color: #800000;">F0</span> </span><span style="color: #008000;">// Move value at T4 to float register F0</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LWC1</span> <span style="color: #800000;">F2</span>, <span style="color: #0000FF;">0xA4</span><span style="color: #ACACAC;">(V0)</span> </span><span style="color: #008000;">// Get Y position of 1-UP</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ADD.S</span> <span style="color: #800000;">F2</span>, <span style="color: #800000;">F2</span>, <span style="color: #800000;">F0</span> </span><span style="color: #008000;">// Add 20.0 to Y position</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;SWC1</span> <span style="color: #800000;">F2</span>, <span style="color: #0000FF;">0xA4</span><span style="color: #ACACAC;">(V0)</span> </span><span style="color: #008000;">// Store new Y position</span><span style="font-weight: bold;"><br />
<br />
802CB1C0_incrementTimer:<br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">T3</span>, <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0x01</span><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0xB1D0</span><span style="color: #ACACAC;">(T0)</span><br />
<br />
802CB1C0_end:<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span> </span></span></span></span></code></div></div></div></tag><span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Mario's Actions</span></span><br />
<br />
We all know that Mario can do a lot of different moves within Super Mario 64. He can run, jump, side-flip, swim, swing Bowser's tail, grab boxes, and many different other things. All of these different actions that Mario can do have a corresponding u32 word value to them. Mario's current action is stored at 0x8033B17C (Mario→0x0C), while his previous action is stored at 0x8033B180 (Mario→0x10). For this tutorial we only want to know if Mario is currently sleeping, so we need to check if the value at 0x8033B17C equals 0x0C000203. <br />
<a href="https://wiki.origami64.net/super_mario_64/actions" target="_blank">&#8203;See this wiki page for the list of Mario's actions.</a><br />
<br />
<table border=1>
<tr><th> Action </th><th> Description </th></tr>
<tr><td> 0x04000440 </td><td> Moving around </td></tr>
<tr><td> 0x03000880 </td><td> Jump </td></tr>
<tr><td> 0x03000881 </td><td> Double-jump </td></tr>
<tr><td> 0x03000882 </td><td> Triple-jump </td></tr>
<tr><td> 0x008008A9 </td><td> Ground-pounding </td></tr>
<tr><td> 0x0C008220 </td><td> Crouching </td></tr>
<tr><td> 0x0C400201 </td><td> Idle </td></tr>
<tr><td> 0x0C400202 </td><td> Yawning </td></tr>
<tr><td> 0x0C000203 </td><td> Sleeping </td></tr>
</table>
<br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Hooking the code (Function 0x802CB1C0)</span></span><br />
<br />
Most ASM tutorials overwrite the 0x802CB1C0 function to get custom code to run. Here are 3 specific reasons to why we use this function.<br />
<ol type="1">
<li>&#8203;The function calls on a useless debug menu <a href="http://smwc.me/1070677" target="_blank">(according to Kaze)</a>, meaning we can change it without affecting the game in any way<br />
</li>
<li>&#8203;It is called within Mario's behavior loop, so we know that it will be called every frame. We can change Mario's behavior script if we only want the function to run once.<br />
</li>
<li>&#8203;The function is 0xA4 bytes long, which gives us 41 ASM instructions to play around with. This is more than enough space for most basic tutorials. If more space is needed, then we can turn this function into one that can call the dmaCopy function.<br />
</li></ol>
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Checking the current action</span></span><br />
<br />
First we must check if the current action (value at 0x8033B17C) equals 0x0C000203. To do this we first load the word at 0x8033B17C into register T2, then set the value of register T1 to 0x0C000203. Once we do that, we can compare the two values using the BNE (Branch Not Equal) OpCode. If the two values are not equal, then the game logic will move down to the "802CB1C0_end" label I set near the end of the function.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #64B3D0;">.org</span> <span style="color: #0000FF;">0x861C0</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">T2</span>, <span style="color: #0000FF;">0xB17C</span><span style="color: #ACACAC;">(T0)</span> </span><span style="color: #008000;">// T2 = current action</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x0C00</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">T1</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x0203</span> </span><span style="color: #008000;">// T1 = 0x0C000203, Sleeping action value</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;BNE</span> <span style="color: #800000;">T2</span>, <span style="color: #800000;">T1</span>, 802CB1C0_end </span><span style="color: #008000;">// Branch to end if Mario is not sleeping.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;NOP</span><br />
</span>&#8203;</span></span></span></code><br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Setting up a delay</span></span><br />
<br />
We don't want to spawn the 1-UP as soon as Mario falls asleep, because that doesn't look very good. Mario needs to sleep for a little bit before he gets a mushroom, so we want to setup a little delay for when Mario goes to sleep and when the 1-UP mushroom spawns. While Mario is running around or Idle the value at the address 0x8033B1D0 is set to zero, but not when he is sleeping. This means we can change that value while Mario is sleeping, and it will reset when Mario wakes up. The delay time will be 32 frames (0x20), which is just a little over a second. If the timer does not equal 0x20, then the value will increment by 1. If both values are equal, then the 1-up mushroom will spawn above Mario's head.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #FF8000;">LW</span> <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0xB1D0</span><span style="color: #ACACAC;">(T0)</span> </span><span style="color: #008000;">// Load word at 0x8033B1D0 (For this example it's a delay timer)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">T4</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0x20</span> </span><span style="color: #008000;">// T4 = 0x20 (Decimal value 32)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;BNE</span> <span style="color: #800000;">T3</span>, <span style="color: #800000;">T4</span>, 802CB1C0_incrementTimer </span><span style="color: #008000;">// Branch if T3 != T4</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;NOP</span></span></span></span></span></code><br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Spawning the 1-UP mushroom</span></span><br />
<br />
To spawn the 1-UP we must use the @SpawnObj (0x8029EDCC) function which we will use to spawn it at Mario's location. It takes 3 arguments: A0 = Object to spawn to, A1 = Model ID, A2 = Behavior segmented address. Mario's object pointer to located at 0x80361158, so we will load the word at that address for A0. The model ID for the 1-up mushroom is 0xD4. There are a few different behaviors for the 1-UP mushroom, but the one we want is 0x130040EC which will spin around above Mario's head before landing on Mario.<br />
<br />
After we spawned the 1-UP mushroom we need to move it's Y-position up so that it can appear above Mario's head. The @SpawnObj function returns a pointer to the 1-UP object in register V0. So we are going to add to the value of offset 0xA4 (y-position) of the 1-UP object. Now every object's XYZ position are stored as floating point numbers, which are different values than regular integers. You can use this helpful webpage to convert decimal to a floating point hex value: <a href="http://www.h-schmidt.net/FloatConverter/IEEE754.html" target="_blank">http://www.h-schmidt.net/FloatConverter/IEEE754.html</a><br />
<br />
<span style="color: #cc3333;">&#8203;Note: </span>It's good practice to only use the even-numbered floating point registers (F0, F2, F4, etc). Using odd-numbered FP registers in Wii VC will crash the game, so keep this in mind when creating ROM hacks.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #FF8000;">LUI</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x8036</span><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x1158</span><span style="color: #ACACAC;">(A0)</span> </span><span style="color: #008000;">// A0 = Pointer to Mario object.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">A2</span>, <span style="color: #0000FF;">0x1300</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A2</span>, <span style="color: #800000;">A2</span>, <span style="color: #0000FF;">0x40EC</span> </span><span style="color: #008000;">// A2 = 0x130040EC, 1-UP behavior.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;JAL</span> <span style="color: #8080FF;">@SpawnObj </span></span><span style="color: #008000;">// 0x8029EDCC</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0xD4</span> </span><span style="color: #008000;">// 1-UP Model ID.</span><br />
<span style="color: #008000;">&#8203;// V0 = pointer to newly spawned 1-UP object.</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T4</span>, <span style="color: #0000FF;">0x41A0</span> </span><span style="color: #008000;">// 0x41A00000 = (float) 20.0</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;MTC1</span> <span style="color: #800000;">T4</span>, <span style="color: #800000;">F0</span> </span><span style="color: #008000;">// Move value at T4 to float register F0</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LWC1</span> <span style="color: #800000;">F2</span>, <span style="color: #0000FF;">0xA4</span><span style="color: #ACACAC;">(V0)</span> </span><span style="color: #008000;">// Get Y position of 1-UP</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ADD.S</span> <span style="color: #800000;">F2</span>, <span style="color: #800000;">F2</span>, <span style="color: #800000;">F0</span> </span><span style="color: #008000;">// Add 20.0 to Y position</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;SWC1</span> <span style="color: #800000;">F2</span>, <span style="color: #0000FF;">0xA4</span><span style="color: #ACACAC;">(V0)</span> </span><span style="color: #008000;">// Store new Y position</span></span></span></span></code><br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Finishing up the code</span></span><br />
<br />
To finish up the code we have our 2 branch labels. The incrementTimer label will increase the value at 0x8033B1D0 by 1, and the end label will jump back to where the function was called from.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;">802CB1C0_incrementTimer:<br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">T3</span>, <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0x01</span><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">T3</span>, <span style="color: #0000FF;">0xB1D0</span><span style="color: #ACACAC;">(T0)</span><br />
<br />
802CB1C0_end:<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span> </span></span></span></span></code><br />
Now assemble the code and a 1-UP mushroom should appear when Mario falls asleep. If you have any questions, please leave a reply below and I'll try to answer it the best I can.<br /><!-- start: postbit_attachments_attachment -->
<div><span class="float_right">Size: <u>1.1 KB</u> / Downloads: <u>158</u></span>
<span class="float_left"><!-- start: attachment_icon -->
<img src="images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" style="vertical-align: middle;" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=359" class="attachment_" target="_blank" title="">SleepTest.txt</a> </span></div>
<br class="clear"/>
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[[ASM] Writing a custom switch function for the 0x0E Geo Layout cmd]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=408</link>
			<pubDate>Wed, 04 May 2016 15:45:19 +1000</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=408</guid>
			<description><![CDATA[In this post I will show you how to write an ASM function that will let you control the geo layout switch command (0x0E). In this example, you will be able to switch between the high-poly and low-poly Mario models by pressing the L button.<br />
<br />
<img src="http://i.imgur.com/6HTrHUq.png" border="0" alt="[Image: 6HTrHUq.png]" /><br />
<br />
You will need the following:<ul>
<li>&#8203;An assembler program. (<a href="http://origami64.net/showthread.php?tid=30" target="_blank">CajeASM v7.24</a>)<br />
</li>
<li>&#8203;A text editor. (<a href="https://notepad-plus-plus.org/" target="_blank">notepad++</a>)<br />
</li>
<li>&#8203;A N64 emulator (<a href="http://www.emulator-zone.com/doc.php/n64/project64.html" target="_blank">Project64</a>)<br />
</li>
<li>&#8203;An extended SM64 ROM (At least 24MB)<br />
</li>
<li>&#8203;Copy of the source code (See attachement below)<br />
</li>
<li>&#8203<img src="https://skelux.root.sx/images/smilies/cry.png" alt="Cry" title="Cry" class="smilie smilie_21" />optional*) <a href="http://origami64.net/showthread.php?tid=359" target="_blank">SM64Functions.txt</a><br />
</li></ul>
* You don't need this file to run the code, but I find it to be more convenient as it allows you to write function names instead of addresses. I'll write out the address in a comment to the side for those who don't want to use it.<br />
<br />
Here is the full ASM code in its entirety. I will be explaining what each section does throughout this post.<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: ASM Code <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #64B3D0;">.include</span> <span style="color: #ACACAC;">"SM64Functions.txt"</span><br />
<br />
</span>&#8203;<span style="color: #008000;">// Re-organize Mario's behavior</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x21CCC0</span> <br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{ <br />
<span style="display:inline-block;width: 20px;"></span>00 00 00 00 <br />
<span style="display:inline-block;width: 20px;"></span>10 05 00 00 <br />
<span style="display:inline-block;width: 20px;"></span>11 01 01 00 <br />
<span style="display:inline-block;width: 20px;"></span>11 03 00 01 <br />
<span style="display:inline-block;width: 20px;"></span>23 00 00 00 00 25 00 A0 <br />
<span style="display:inline-block;width: 20px;"></span>08 00 00 00 <br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 29 CA 58 <br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 2C B2 64 <br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 3F 00 00 <br />
<span style="display:inline-block;width: 20px;"></span>09 00 00 00 <br />
}</span><br />
<br />
<span style="color: #008000;">&#8203;// Overwriting part of the top levelscript.</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x108A18</span><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{<br />
<span style="display:inline-block;width: 20px;"></span>11 08 00 00 80 2C B1 C0 <br />
}</span><br />
<br />
<span style="color: #008000;">&#8203;// Function that will copy data from the ROM to the RAM</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x861C0</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">&#36;FFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">&#36;0014</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">&#36;0010</span> <span style="color: #ACACAC;">(SP)</span> </span><span style="color: #008000;">// lvl cmd 0x11 safeguard</span><br />
<br />
<span style="color: #008000;">&#8203;// Do not remove these following 4 instructions</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;JAL</span> <span style="color: #8080FF;">@osViBlack </span></span><span style="color: #008000;">// 0x80323340</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;MOV</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">R0</span><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8039</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0xBE24</span><span style="color: #ACACAC;">(T0)</span> </span><span style="color: #008000;">// Set level accumulator to 0</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x803F</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x0000</span> </span><span style="color: #008000;">// Writing to RAM address 0x803F0000</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x011F</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x0000</span> </span><span style="color: #008000;">// Start copying from ROM address at 0x11F0000</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;JAL</span> <span style="color: #8080FF;">@DmaCopy </span></span><span style="color: #008000;">// 0x80278504</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A2</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x1000</span> </span><span style="color: #008000;">// Stop copying from ROM address at 0x11F1000</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">V0</span>, <span style="color: #0000FF;">&#36;0010</span> <span style="color: #ACACAC;">(SP)</span> </span><span style="color: #008000;">// lvl cmd 0x11 safeguard</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">&#36;0014</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">&#36;0018</span> <br />
<br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x11F0000</span> </span><span style="color: #008000;">// Custom Mario loop function (0x803F0000)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0xAFA0</span><span style="color: #ACACAC;">(A0)</span><br />
<span style="color: #FF8000;">&#8203;ANDI</span> AT, <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x20</span><br />
<span style="color: #FF8000;">&#8203;BEQZ</span> AT, 803F0000_END </span><span style="color: #008000;">// Check L button, and branch if false</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;NOP</span><br />
<br />
<span style="color: #FF8000;">&#8203;LB</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0xFFFF</span><span style="color: #ACACAC;">(A0)</span> </span><span style="color: #008000;">// Load byte at 0x8033FFFFF</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;XORI</span> <span style="color: #800000;">T1</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x01</span> </span><span style="color: #008000;">// Switch byte (either 0 or 1)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;SB</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0xFFFF</span><span style="color: #ACACAC;">(A0)</span> </span><span style="color: #008000;">// Store new value</span><span style="font-weight: bold;"><br />
<br />
803F0000_END:<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span> <br />
<br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x11F0800</span> </span><span style="color: #008000;">// Custom switch function (0x803F0800)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">A2</span>, <span style="color: #0000FF;">0x20</span> <span style="color: #ACACAC;">(SP)</span> </span><span style="color: #008000;">// You want to store A2 0x8 bytes above the stack pointer.</span><br />
<br />
<span style="color: #008000;">&#8203;//A1 = pointer to geo node. You must store the switch value to offset 0x1E</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;LB</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0xFFFF</span><span style="color: #ACACAC;">(T0)</span><br />
<span style="color: #FF8000;">&#8203;SH</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x1E</span><span style="color: #ACACAC;">(A1)</span> </span><span style="color: #008000;">// Store our byte at 0x8033FFFFF as the switch value.</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;MOV</span> <span style="color: #800000;">V0</span>, <span style="color: #800000;">R0</span> </span><span style="color: #008000;">// put return value at zero.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span> <br />
<br />
</span>&#8203;<span style="color: #008000;">/* <br />
Note: You cannot add any more bytes here without breaking Mario's geo layout.<br />
If you want more than 2 options, then you will need to move some of the geo layout code elsewhere.<br />
*/</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x12A7AC</span><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{<br />
<span style="display:inline-block;width: 20px;"></span>0E 00 00 00 80 3F 08 00<br />
<span style="display:inline-block;width: 20px;"></span>04 00 00 00<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>02 01 00 00 17 00 2C E0<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>02 01 00 00 17 00 2D 48<br />
<span style="display:inline-block;width: 20px;"></span>05 00 00 00<br />
}</span><br />
<br />
</span>&#8203;</span></span></code></div></div></div></tag><span style="font-size: large;">&#8203;<span style="font-weight: bold;">Hooking the code (Top level-script method)</span></span><br />
<br />
Before we can get any of our code to run, we must first get the data from the ROM cartridge into the N64's memory (RAM). To do this we must use a function called <span style="font-weight: bold;">@DmaCopy</span>, which transfers data from ROM to RAM (convenient right?) . What most ROM hackers do is take the useless debug function 0x802CB1C0 in Mario's behavior loop and rewrite it to call the DmaCopy function. However the problem with this method is that it will only run once Mario is active, which means you could not get data into memory before that.<br />
<br />
So I took that old method and made an addition to it. Basically, were call that 0x802CB1C0 function from the top-most levelscript and have a DmaCopy function call even before the title screen shows up. The 0x11 level script cmd is used to call an ASM function and takes up 8 bytes of data, so we need to remove 8 bytes from that top-level script to make room for our function call. There happens to be just a place at the ROM address 0x108A18. We can remove the 0x34 & 0x13 cmds that were there and convert them into ASM code.<br />
<br />
<img src="http://i.imgur.com/PgOWVyg.png" border="0" alt="[Image: PgOWVyg.png]" /><br />
<img src="http://i.imgur.com/1mg5UUe.png" border="0" alt="[Image: 1mg5UUe.png]" /><br />
<br />
We now overwrite those bytes with the 0x11 CMD and reorganize Mario's behavior so that it won't call the 0x802CB1C0 function anymore. Instead, we want it to call a custom function that will be at 0x803F0000<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="color: #008000;">// Re-organize Mario's behavior</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x21CCC0</span> <br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{ <br />
<span style="display:inline-block;width: 20px;"></span>00 00 00 00 <br />
<span style="display:inline-block;width: 20px;"></span>10 05 00 00 <br />
<span style="display:inline-block;width: 20px;"></span>11 01 01 00 <br />
<span style="display:inline-block;width: 20px;"></span>11 03 00 01 <br />
<span style="display:inline-block;width: 20px;"></span>23 00 00 00 00 25 00 A0 <br />
<span style="display:inline-block;width: 20px;"></span>08 00 00 00 <br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 29 CA 58 <br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 2C B2 64 <br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 3F 00 00 <br />
<span style="display:inline-block;width: 20px;"></span>09 00 00 00 <br />
}</span><br />
<br />
<span style="color: #008000;">&#8203;// Overwriting part of the top levelscript.</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x108A18</span><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{<br />
<span style="display:inline-block;width: 20px;"></span>11 08 00 00 80 2C B1 C0 <br />
}</span></span></span></span></code><br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Loading our functions into memory</span></span><br />
<br />
Now the 0x11 cmd is used to modify the level accumulator value (0x8038BE24), so it expects a return value V0. What we can do is place a couple safeguards to guarantee that the function will work without any problems.<br />
 <code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="color: #008000;">// Function that will copy data from the ROM to the RAM</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x861C0</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">&#36;FFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">&#36;0014</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">&#36;0010</span> <span style="color: #ACACAC;">(SP)</span> </span><span style="color: #008000;">// lvl cmd 0x11 safeguard</span><br />
<br />
<span style="color: #008000;">&#8203;// Do not remove these following 4 instructions</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;JAL</span> <span style="color: #8080FF;">@osViBlack </span></span><span style="color: #008000;">// 0x80323340</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;MOV</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">R0</span><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8039</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0xBE24</span><span style="color: #ACACAC;">(T0)</span> </span><span style="color: #008000;">// Set level accumulator to 0</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x803F</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x0000</span> </span><span style="color: #008000;">// Writing to RAM address 0x803F0000</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x011F</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x0000</span> </span><span style="color: #008000;">// Start copying from ROM address at 0x11F0000</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;JAL</span> <span style="color: #8080FF;">@DmaCopy </span></span><span style="color: #008000;">// 0x80278504</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A2</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x1000</span> </span><span style="color: #008000;">// Stop copying from ROM address at 0x11F1000</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">V0</span>, <span style="color: #0000FF;">&#36;0010</span> <span style="color: #ACACAC;">(SP)</span> </span><span style="color: #008000;">// lvl cmd 0x11 safeguard</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">&#36;0014</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">&#36;0018</span> </span></span></span></span></code><br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Checking for input</span></span><br />
<br />
Now that we have our code within memory, we can now write our custom functions. First is the 0x803F00000 function that will check when the player presses the L Button, and toggle the byte at 0x8033FFFF (which is normally empty) to either 0 (high poly Mario) or 1 (low poly Mario).<br />
<br />
The button input from controller 1 is located at the address 0x8033AFA0 (u16). To single out an input, we must use the ANDI op code with a certain flag value. Here is a table of the button flags<br />
<br />
<table border=1>
<tr><th> Flag </th><th> Button </th></tr>
<tr><td> 0x0001 </td><td> C-Right </td></tr>
<tr><td> 0x0002 </td><td> C-Left </td></tr>
<tr><td> 0x0004 </td><td> C-Down </td></tr>
<tr><td> 0x0008 </td><td> C-Up </td></tr>
<tr><td> 0x0010 </td><td> R </td></tr>
<tr><td> 0x0020 </td><td> L </td></tr>
<tr><td> 0x0100 </td><td> D-Pad Right </td></tr>
<tr><td> 0x0200 </td><td> D-Pad Left </td></tr>
<tr><td> 0x0400 </td><td> D-Pad Down </td></tr>
<tr><td> 0x0800 </td><td> D-Pad Up </td></tr>
<tr><td> 0x1000 </td><td> Start </td></tr>
<tr><td> 0x2000 </td><td> Z </td></tr>
<tr><td> 0x4000 </td><td> B </td></tr>
<tr><td> 0x8000 </td><td> A </td></tr></table>
<br />
As you can see on the table, we are going to use the flag 0x20 to check for the L button. If the player did press down the L button, then we will swap the byte at 0x8033FFFF using the XORI opcode.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #64B3D0;">.org</span> <span style="color: #0000FF;">0x11F0000</span> </span><span style="color: #008000;">// Custom Mario loop function (0x803F0000)</span></span></span></span><br />
<span style="font-size: small;">&#8203;<span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0xAFA0</span><span style="color: #ACACAC;">(A0)</span><br />
<span style="color: #FF8000;">&#8203;ANDI</span> AT, <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x20</span><br />
<span style="color: #FF8000;">&#8203;BEQZ</span> AT, 803F0000_END </span><span style="color: #008000;">// Check L button, and branch if false</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;NOP</span><br />
<br />
<span style="color: #FF8000;">&#8203;LB</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0xFFFF</span><span style="color: #ACACAC;">(A0)</span> </span><span style="color: #008000;">// Load byte at 0x8033FFFFF</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;XORI</span> <span style="color: #800000;">T1</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x01</span> </span><span style="color: #008000;">// Switch byte (either 0 or 1)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;SB</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0xFFFF</span><span style="color: #ACACAC;">(A0)</span> </span><span style="color: #008000;">// Store new value</span><span style="font-weight: bold;"><br />
<br />
803F0000_END:<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span> <br />
</span>&#8203;</span></span></span></code><br />
<span style="font-style: italic;">&#8203;Little important note:</span><br />
There is a subtle difference to loading 0x8033AFA0 as a word vs a half-word. If you use "LH T0, 0xAFA0", then the game will running the swap code over and over until you let go of the button. But if we instead load it as a full word, then it will only run once until we let go of the button. This happens because your previous button press is stored at 0x8033AFA2, which is right next to the current button press. When you load 0x8033AFA0 as a word, your really checking the previous button press instead of the current one which causes the code to run only one time.<br />
<br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">The switch function</span></span><br />
<br />
The <a href="https://wiki.origami64.net/super_mario_64/geometry_layout_commands#eswitch_case" target="_blank">Geo Layout command 0x0E</a> is used to change the look of a model by checking a value with an ASM function. Our custom ASM function 0x803F0800 will look at the byte we set at 0x8033FFFF to determine if Mario will use his high-poly model(0) or his low-poly model(1). Our function is simple because all we have to do is store that byte to the switch value. The argument register A1 contains a pointer to the graph node that contains the switch value at the offset 0x1E.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #64B3D0;">.org</span> <span style="color: #0000FF;">0x11F0800</span> </span><span style="color: #008000;">// Custom switch function (0x803F0800)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">A2</span>, <span style="color: #0000FF;">0x20</span> <span style="color: #ACACAC;">(SP)</span> </span><span style="color: #008000;">// You want to store A2 0x8 bytes above the stack pointer.</span><br />
<br />
<span style="color: #008000;">&#8203;//A1 = pointer to node. You must store the switch value to offset 0x1E</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;LB</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0xFFFF</span><span style="color: #ACACAC;">(T0)</span><br />
<span style="color: #FF8000;">&#8203;SH</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x1E</span><span style="color: #ACACAC;">(A1)</span> </span><span style="color: #008000;">// Store our byte at 0x8033FFFFF as the switch value.</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;MOV</span> <span style="color: #800000;">V0</span>, <span style="color: #800000;">R0</span> </span><span style="color: #008000;">// put return value as zero.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span> </span></span></span></span></code><br />
Now that we have our function ready, the last thing we need to do is to modify part of Mario's geo layout. The high-poly model is stored at the segmented address 0x17002CE0, while the low-poly model is stored at 0x17002D48.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="color: #008000;">/* <br />
Note: You cannot add any more bytes here without breaking Mario's geo layout.<br />
If you want more than 2 options, then you will need to move some of the geo layout code elsewhere.<br />
*/</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x12A7AC</span><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{<br />
<span style="display:inline-block;width: 20px;"></span>0E 00 00 00 80 3F 08 00<br />
<span style="display:inline-block;width: 20px;"></span>04 00 00 00<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>02 01 00 00 17 00 2C E0<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>02 01 00 00 17 00 2D 48<br />
<span style="display:inline-block;width: 20px;"></span>05 00 00 00<br />
}</span></span></span></span></code><br />
Now assemble the code and you should be able to freely switch models whenever you want to. If you have any questions, please leave a reply below and I'll try to answer it the best I can.<br /><!-- start: postbit_attachments_attachment -->
<div><span class="float_right">Size: <u>2.2 KB</u> / Downloads: <u>110</u></span>
<span class="float_left"><!-- start: attachment_icon -->
<img src="images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" style="vertical-align: middle;" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=356" class="attachment_" target="_blank" title="">SwitchTest.txt</a> </span></div>
<br class="clear"/>
<!-- end: postbit_attachments_attachment -->]]></description>
			<content:encoded><![CDATA[In this post I will show you how to write an ASM function that will let you control the geo layout switch command (0x0E). In this example, you will be able to switch between the high-poly and low-poly Mario models by pressing the L button.<br />
<br />
<img src="http://i.imgur.com/6HTrHUq.png" border="0" alt="[Image: 6HTrHUq.png]" /><br />
<br />
You will need the following:<ul>
<li>&#8203;An assembler program. (<a href="http://origami64.net/showthread.php?tid=30" target="_blank">CajeASM v7.24</a>)<br />
</li>
<li>&#8203;A text editor. (<a href="https://notepad-plus-plus.org/" target="_blank">notepad++</a>)<br />
</li>
<li>&#8203;A N64 emulator (<a href="http://www.emulator-zone.com/doc.php/n64/project64.html" target="_blank">Project64</a>)<br />
</li>
<li>&#8203;An extended SM64 ROM (At least 24MB)<br />
</li>
<li>&#8203;Copy of the source code (See attachement below)<br />
</li>
<li>&#8203<img src="https://skelux.root.sx/images/smilies/cry.png" alt="Cry" title="Cry" class="smilie smilie_21" />optional*) <a href="http://origami64.net/showthread.php?tid=359" target="_blank">SM64Functions.txt</a><br />
</li></ul>
* You don't need this file to run the code, but I find it to be more convenient as it allows you to write function names instead of addresses. I'll write out the address in a comment to the side for those who don't want to use it.<br />
<br />
Here is the full ASM code in its entirety. I will be explaining what each section does throughout this post.<br />
<tag><div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px"><b>Spoiler</b>: ASM Code <input type="button" value="Show" style="width:45px;font-size:10px;margin:0px;padding:0px;" onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = 'Hide'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = 'Show'; }"></div><div class="alt2" style="margin: 0px; padding: 6px; border-top: 1px solid #999; border-left: 1px solid #999; border-right: 1px solid #ccc; border-bottom: 1px solid #ccc; "><div style="display: none;">
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #64B3D0;">.include</span> <span style="color: #ACACAC;">"SM64Functions.txt"</span><br />
<br />
</span>&#8203;<span style="color: #008000;">// Re-organize Mario's behavior</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x21CCC0</span> <br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{ <br />
<span style="display:inline-block;width: 20px;"></span>00 00 00 00 <br />
<span style="display:inline-block;width: 20px;"></span>10 05 00 00 <br />
<span style="display:inline-block;width: 20px;"></span>11 01 01 00 <br />
<span style="display:inline-block;width: 20px;"></span>11 03 00 01 <br />
<span style="display:inline-block;width: 20px;"></span>23 00 00 00 00 25 00 A0 <br />
<span style="display:inline-block;width: 20px;"></span>08 00 00 00 <br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 29 CA 58 <br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 2C B2 64 <br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 3F 00 00 <br />
<span style="display:inline-block;width: 20px;"></span>09 00 00 00 <br />
}</span><br />
<br />
<span style="color: #008000;">&#8203;// Overwriting part of the top levelscript.</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x108A18</span><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{<br />
<span style="display:inline-block;width: 20px;"></span>11 08 00 00 80 2C B1 C0 <br />
}</span><br />
<br />
<span style="color: #008000;">&#8203;// Function that will copy data from the ROM to the RAM</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x861C0</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">&#36;FFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">&#36;0014</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">&#36;0010</span> <span style="color: #ACACAC;">(SP)</span> </span><span style="color: #008000;">// lvl cmd 0x11 safeguard</span><br />
<br />
<span style="color: #008000;">&#8203;// Do not remove these following 4 instructions</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;JAL</span> <span style="color: #8080FF;">@osViBlack </span></span><span style="color: #008000;">// 0x80323340</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;MOV</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">R0</span><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8039</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0xBE24</span><span style="color: #ACACAC;">(T0)</span> </span><span style="color: #008000;">// Set level accumulator to 0</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x803F</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x0000</span> </span><span style="color: #008000;">// Writing to RAM address 0x803F0000</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x011F</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x0000</span> </span><span style="color: #008000;">// Start copying from ROM address at 0x11F0000</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;JAL</span> <span style="color: #8080FF;">@DmaCopy </span></span><span style="color: #008000;">// 0x80278504</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A2</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x1000</span> </span><span style="color: #008000;">// Stop copying from ROM address at 0x11F1000</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">V0</span>, <span style="color: #0000FF;">&#36;0010</span> <span style="color: #ACACAC;">(SP)</span> </span><span style="color: #008000;">// lvl cmd 0x11 safeguard</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">&#36;0014</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">&#36;0018</span> <br />
<br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x11F0000</span> </span><span style="color: #008000;">// Custom Mario loop function (0x803F0000)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0xAFA0</span><span style="color: #ACACAC;">(A0)</span><br />
<span style="color: #FF8000;">&#8203;ANDI</span> AT, <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x20</span><br />
<span style="color: #FF8000;">&#8203;BEQZ</span> AT, 803F0000_END </span><span style="color: #008000;">// Check L button, and branch if false</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;NOP</span><br />
<br />
<span style="color: #FF8000;">&#8203;LB</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0xFFFF</span><span style="color: #ACACAC;">(A0)</span> </span><span style="color: #008000;">// Load byte at 0x8033FFFFF</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;XORI</span> <span style="color: #800000;">T1</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x01</span> </span><span style="color: #008000;">// Switch byte (either 0 or 1)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;SB</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0xFFFF</span><span style="color: #ACACAC;">(A0)</span> </span><span style="color: #008000;">// Store new value</span><span style="font-weight: bold;"><br />
<br />
803F0000_END:<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span> <br />
<br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x11F0800</span> </span><span style="color: #008000;">// Custom switch function (0x803F0800)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">A2</span>, <span style="color: #0000FF;">0x20</span> <span style="color: #ACACAC;">(SP)</span> </span><span style="color: #008000;">// You want to store A2 0x8 bytes above the stack pointer.</span><br />
<br />
<span style="color: #008000;">&#8203;//A1 = pointer to geo node. You must store the switch value to offset 0x1E</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;LB</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0xFFFF</span><span style="color: #ACACAC;">(T0)</span><br />
<span style="color: #FF8000;">&#8203;SH</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x1E</span><span style="color: #ACACAC;">(A1)</span> </span><span style="color: #008000;">// Store our byte at 0x8033FFFFF as the switch value.</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;MOV</span> <span style="color: #800000;">V0</span>, <span style="color: #800000;">R0</span> </span><span style="color: #008000;">// put return value at zero.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span> <br />
<br />
</span>&#8203;<span style="color: #008000;">/* <br />
Note: You cannot add any more bytes here without breaking Mario's geo layout.<br />
If you want more than 2 options, then you will need to move some of the geo layout code elsewhere.<br />
*/</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x12A7AC</span><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{<br />
<span style="display:inline-block;width: 20px;"></span>0E 00 00 00 80 3F 08 00<br />
<span style="display:inline-block;width: 20px;"></span>04 00 00 00<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>02 01 00 00 17 00 2C E0<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>02 01 00 00 17 00 2D 48<br />
<span style="display:inline-block;width: 20px;"></span>05 00 00 00<br />
}</span><br />
<br />
</span>&#8203;</span></span></code></div></div></div></tag><span style="font-size: large;">&#8203;<span style="font-weight: bold;">Hooking the code (Top level-script method)</span></span><br />
<br />
Before we can get any of our code to run, we must first get the data from the ROM cartridge into the N64's memory (RAM). To do this we must use a function called <span style="font-weight: bold;">@DmaCopy</span>, which transfers data from ROM to RAM (convenient right?) . What most ROM hackers do is take the useless debug function 0x802CB1C0 in Mario's behavior loop and rewrite it to call the DmaCopy function. However the problem with this method is that it will only run once Mario is active, which means you could not get data into memory before that.<br />
<br />
So I took that old method and made an addition to it. Basically, were call that 0x802CB1C0 function from the top-most levelscript and have a DmaCopy function call even before the title screen shows up. The 0x11 level script cmd is used to call an ASM function and takes up 8 bytes of data, so we need to remove 8 bytes from that top-level script to make room for our function call. There happens to be just a place at the ROM address 0x108A18. We can remove the 0x34 & 0x13 cmds that were there and convert them into ASM code.<br />
<br />
<img src="http://i.imgur.com/PgOWVyg.png" border="0" alt="[Image: PgOWVyg.png]" /><br />
<img src="http://i.imgur.com/1mg5UUe.png" border="0" alt="[Image: 1mg5UUe.png]" /><br />
<br />
We now overwrite those bytes with the 0x11 CMD and reorganize Mario's behavior so that it won't call the 0x802CB1C0 function anymore. Instead, we want it to call a custom function that will be at 0x803F0000<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="color: #008000;">// Re-organize Mario's behavior</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x21CCC0</span> <br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{ <br />
<span style="display:inline-block;width: 20px;"></span>00 00 00 00 <br />
<span style="display:inline-block;width: 20px;"></span>10 05 00 00 <br />
<span style="display:inline-block;width: 20px;"></span>11 01 01 00 <br />
<span style="display:inline-block;width: 20px;"></span>11 03 00 01 <br />
<span style="display:inline-block;width: 20px;"></span>23 00 00 00 00 25 00 A0 <br />
<span style="display:inline-block;width: 20px;"></span>08 00 00 00 <br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 29 CA 58 <br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 2C B2 64 <br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>0C 00 00 00 80 3F 00 00 <br />
<span style="display:inline-block;width: 20px;"></span>09 00 00 00 <br />
}</span><br />
<br />
<span style="color: #008000;">&#8203;// Overwriting part of the top levelscript.</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x108A18</span><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{<br />
<span style="display:inline-block;width: 20px;"></span>11 08 00 00 80 2C B1 C0 <br />
}</span></span></span></span></code><br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Loading our functions into memory</span></span><br />
<br />
Now the 0x11 cmd is used to modify the level accumulator value (0x8038BE24), so it expects a return value V0. What we can do is place a couple safeguards to guarantee that the function will work without any problems.<br />
 <code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="color: #008000;">// Function that will copy data from the ROM to the RAM</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x861C0</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">&#36;FFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">&#36;0014</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">&#36;0010</span> <span style="color: #ACACAC;">(SP)</span> </span><span style="color: #008000;">// lvl cmd 0x11 safeguard</span><br />
<br />
<span style="color: #008000;">&#8203;// Do not remove these following 4 instructions</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;JAL</span> <span style="color: #8080FF;">@osViBlack </span></span><span style="color: #008000;">// 0x80323340</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;MOV</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">R0</span><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8039</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">R0</span>, <span style="color: #0000FF;">0xBE24</span><span style="color: #ACACAC;">(T0)</span> </span><span style="color: #008000;">// Set level accumulator to 0</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x803F</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A0</span>, <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x0000</span> </span><span style="color: #008000;">// Writing to RAM address 0x803F0000</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x011F</span><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A1</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x0000</span> </span><span style="color: #008000;">// Start copying from ROM address at 0x11F0000</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;JAL</span> <span style="color: #8080FF;">@DmaCopy </span></span><span style="color: #008000;">// 0x80278504</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ORI</span> <span style="color: #800000;">A2</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x1000</span> </span><span style="color: #008000;">// Stop copying from ROM address at 0x11F1000</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">V0</span>, <span style="color: #0000FF;">&#36;0010</span> <span style="color: #ACACAC;">(SP)</span> </span><span style="color: #008000;">// lvl cmd 0x11 safeguard</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">&#36;0014</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">&#36;0018</span> </span></span></span></span></code><br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">Checking for input</span></span><br />
<br />
Now that we have our code within memory, we can now write our custom functions. First is the 0x803F00000 function that will check when the player presses the L Button, and toggle the byte at 0x8033FFFF (which is normally empty) to either 0 (high poly Mario) or 1 (low poly Mario).<br />
<br />
The button input from controller 1 is located at the address 0x8033AFA0 (u16). To single out an input, we must use the ANDI op code with a certain flag value. Here is a table of the button flags<br />
<br />
<table border=1>
<tr><th> Flag </th><th> Button </th></tr>
<tr><td> 0x0001 </td><td> C-Right </td></tr>
<tr><td> 0x0002 </td><td> C-Left </td></tr>
<tr><td> 0x0004 </td><td> C-Down </td></tr>
<tr><td> 0x0008 </td><td> C-Up </td></tr>
<tr><td> 0x0010 </td><td> R </td></tr>
<tr><td> 0x0020 </td><td> L </td></tr>
<tr><td> 0x0100 </td><td> D-Pad Right </td></tr>
<tr><td> 0x0200 </td><td> D-Pad Left </td></tr>
<tr><td> 0x0400 </td><td> D-Pad Down </td></tr>
<tr><td> 0x0800 </td><td> D-Pad Up </td></tr>
<tr><td> 0x1000 </td><td> Start </td></tr>
<tr><td> 0x2000 </td><td> Z </td></tr>
<tr><td> 0x4000 </td><td> B </td></tr>
<tr><td> 0x8000 </td><td> A </td></tr></table>
<br />
As you can see on the table, we are going to use the flag 0x20 to check for the L button. If the player did press down the L button, then we will swap the byte at 0x8033FFFF using the XORI opcode.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #64B3D0;">.org</span> <span style="color: #0000FF;">0x11F0000</span> </span><span style="color: #008000;">// Custom Mario loop function (0x803F0000)</span></span></span></span><br />
<span style="font-size: small;">&#8203;<span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #FF8000;">ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">A0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0xAFA0</span><span style="color: #ACACAC;">(A0)</span><br />
<span style="color: #FF8000;">&#8203;ANDI</span> AT, <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x20</span><br />
<span style="color: #FF8000;">&#8203;BEQZ</span> AT, 803F0000_END </span><span style="color: #008000;">// Check L button, and branch if false</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;NOP</span><br />
<br />
<span style="color: #FF8000;">&#8203;LB</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0xFFFF</span><span style="color: #ACACAC;">(A0)</span> </span><span style="color: #008000;">// Load byte at 0x8033FFFFF</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;XORI</span> <span style="color: #800000;">T1</span>, <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0x01</span> </span><span style="color: #008000;">// Switch byte (either 0 or 1)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;SB</span> <span style="color: #800000;">T1</span>, <span style="color: #0000FF;">0xFFFF</span><span style="color: #ACACAC;">(A0)</span> </span><span style="color: #008000;">// Store new value</span><span style="font-weight: bold;"><br />
<br />
803F0000_END:<br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span> <br />
</span>&#8203;</span></span></span></code><br />
<span style="font-style: italic;">&#8203;Little important note:</span><br />
There is a subtle difference to loading 0x8033AFA0 as a word vs a half-word. If you use "LH T0, 0xAFA0", then the game will running the swap code over and over until you let go of the button. But if we instead load it as a full word, then it will only run once until we let go of the button. This happens because your previous button press is stored at 0x8033AFA2, which is right next to the current button press. When you load 0x8033AFA0 as a word, your really checking the previous button press instead of the current one which causes the code to run only one time.<br />
<br />
<span style="font-weight: bold;">&#8203;<span style="font-size: medium;">The switch function</span></span><br />
<br />
The <a href="https://wiki.origami64.net/super_mario_64/geometry_layout_commands#eswitch_case" target="_blank">Geo Layout command 0x0E</a> is used to change the look of a model by checking a value with an ASM function. Our custom ASM function 0x803F0800 will look at the byte we set at 0x8033FFFF to determine if Mario will use his high-poly model(0) or his low-poly model(1). Our function is simple because all we have to do is store that byte to the switch value. The argument register A1 contains a pointer to the graph node that contains the switch value at the offset 0x1E.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="font-weight: bold;"><span style="color: #64B3D0;">.org</span> <span style="color: #0000FF;">0x11F0800</span> </span><span style="color: #008000;">// Custom switch function (0x803F0800)</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0xFFE8</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;SW</span> <span style="color: #800000;">A2</span>, <span style="color: #0000FF;">0x20</span> <span style="color: #ACACAC;">(SP)</span> </span><span style="color: #008000;">// You want to store A2 0x8 bytes above the stack pointer.</span><br />
<br />
<span style="color: #008000;">&#8203;//A1 = pointer to node. You must store the switch value to offset 0x1E</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LUI</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x8034</span><br />
<span style="color: #FF8000;">&#8203;LB</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0xFFFF</span><span style="color: #ACACAC;">(T0)</span><br />
<span style="color: #FF8000;">&#8203;SH</span> <span style="color: #800000;">T0</span>, <span style="color: #0000FF;">0x1E</span><span style="color: #ACACAC;">(A1)</span> </span><span style="color: #008000;">// Store our byte at 0x8033FFFFF as the switch value.</span><span style="font-weight: bold;"><br />
<br />
<span style="color: #FF8000;">&#8203;MOV</span> <span style="color: #800000;">V0</span>, <span style="color: #800000;">R0</span> </span><span style="color: #008000;">// put return value as zero.</span><span style="font-weight: bold;"><br />
<span style="color: #FF8000;">&#8203;LW</span> <span style="color: #800000;">RA</span>, <span style="color: #0000FF;">0x14</span> <span style="color: #ACACAC;">(SP)</span><br />
<span style="color: #FF8000;">&#8203;JR</span> <span style="color: #800000;">RA</span><br />
<span style="color: #FF8000;">&#8203;ADDIU</span> <span style="color: #800000;">SP</span>, <span style="color: #800000;">SP</span>, <span style="color: #0000FF;">0x18</span> </span></span></span></span></code><br />
Now that we have our function ready, the last thing we need to do is to modify part of Mario's geo layout. The high-poly model is stored at the segmented address 0x17002CE0, while the low-poly model is stored at 0x17002D48.<br />
<br />
<code class="codeblock" style="max-height: none; display:block;"><span style="font-size: small;"><span style="font-family: Courier New;"><span style="color: #804000;"><span style="color: #008000;">/* <br />
Note: You cannot add any more bytes here without breaking Mario's geo layout.<br />
If you want more than 2 options, then you will need to move some of the geo layout code elsewhere.<br />
*/</span><span style="font-weight: bold;"><br />
<span style="color: #64B3D0;">&#8203;.org</span> <span style="color: #0000FF;">0x12A7AC</span><br />
<span style="color: #64B3D0;">&#8203;hex</span> </span><span style="color: #004080;">{<br />
<span style="display:inline-block;width: 20px;"></span>0E 00 00 00 80 3F 08 00<br />
<span style="display:inline-block;width: 20px;"></span>04 00 00 00<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>02 01 00 00 17 00 2C E0<br />
<span style="display:inline-block;width: 20px;"></span><span style="display:inline-block;width: 20px;"></span>02 01 00 00 17 00 2D 48<br />
<span style="display:inline-block;width: 20px;"></span>05 00 00 00<br />
}</span></span></span></span></code><br />
Now assemble the code and you should be able to freely switch models whenever you want to. If you have any questions, please leave a reply below and I'll try to answer it the best I can.<br /><!-- start: postbit_attachments_attachment -->
<div><span class="float_right">Size: <u>2.2 KB</u> / Downloads: <u>110</u></span>
<span class="float_left"><!-- start: attachment_icon -->
<img src="images/attachtypes/txt.png" title="Text Document" border="0" alt=".txt" style="vertical-align: middle;" />
<!-- end: attachment_icon -->&nbsp;&nbsp;<a href="attachment.php?aid=356" class="attachment_" target="_blank" title="">SwitchTest.txt</a> </span></div>
<br class="clear"/>
<!-- end: postbit_attachments_attachment -->]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[3D Coin Model?]]></title>
			<link>https://skelux.root.sx/showthread.php?tid=407</link>
			<pubDate>Sun, 01 May 2016 12:09:59 +1000</pubDate>
			<guid isPermaLink="false">https://skelux.root.sx/showthread.php?tid=407</guid>
			<description><![CDATA[Does anyone have a good 3D coin model I can use in Kaze's video?<br />
<a href="https://www.youtube.com/watch?v=cNRmbXJbh1E" target="_blank">https://www.youtube.com/watch?v=cNRmbXJbh1E</a><br />
<br />
Not the butt ugly one in the video, but just a generic coin.]]></description>
			<content:encoded><![CDATA[Does anyone have a good 3D coin model I can use in Kaze's video?<br />
<a href="https://www.youtube.com/watch?v=cNRmbXJbh1E" target="_blank">https://www.youtube.com/watch?v=cNRmbXJbh1E</a><br />
<br />
Not the butt ugly one in the video, but just a generic coin.]]></content:encoded>
		</item>
	</channel>
</rss>