Actions

SCHG How-to

Difference between revisions of "Add New Monitors"

From Sonic Retro

m (Fixed grammar and spelling errors.)
(Added Step 6: Misc Errors)
Line 219: Line 219:
  
 
==Step 6: Misc Errors==
 
==Step 6: Misc Errors==
Again, I really can't tell you how to fix the errors in the unrelated files without redoing on a clean copy. Sorry.
+
 
 +
By Bombchu link~
 +
 
 +
First of all assemble the code and... oh noes! The code doesn't work and the ROM refuses to assemble.
 +
 
 +
It's because of the added code. Now Some branches are now to far away to work.
 +
 
 +
Never fear, open up ''Sub SolidObject'' in the _incObj folder and change
 +
 
 +
<asm>brs.w MvSonicOnPtfm</asm>
 +
to
 +
<asm>jsr    MvSonicOnPtfm</asm>
 +
 
 +
 
 +
Then open up ''89 Ending Sequence STH'' in the same folder and change
 +
<asm>bra.w    DisplaySprite</asm>
 +
to
 +
<asm>jmp    DisplaySprite</asm>
 +
 
 +
This happens at both line 37 and 58 (If My memory is any good)
 +
 
 +
have fun with your new monitors !
 +
 
  
 
[[Category:SCHG How-tos|{{PAGENAME}}]]
 
[[Category:SCHG How-tos|{{PAGENAME}}]]

Revision as of 16:53, 21 January 2014

IMPORTANT NOTE: THIS GUIDE IS UNDER CONSTRUCTION! IT DOES NOT WORK PERFECTLY YET!

Let's say you want another monitor. I've given the monitor files a once-over, and found an easy way to free up 10 monitors, the 'S', the Goggles, the Blank, and 7 "invalid" monitors. 2 notes before we begin: This uses the SVN build, and there may be errors in unrelated files. If there are, then it's probably the amount of branches you have. I used a copy of the DisASM that wasn't clean, so I might tell you to do stupid things that break your own build if I tried to give instructions on how to fix the unrelated errors. If someone could do this tutorial on a fresh build and post fixes for those errors at the end of the guide, I'd be very thankful.

Step 1: _incObj\2E Monitor Content Power-Up.asm

Find the following code: <asm>Pow_ChkS: cmpi.b #7,d0 ; does monitor contain 'S'? bne.s Pow_ChkEnd nop

Pow_ChkEnd: rts ; 'S' and goggles monitors do nothing</asm>

Replace it with this template: <asm>Pow_ChkS: cmpi.b #7,d0 ; does monitor contain 'S'? bne.s Pow_ChkGoggles

nop ;Insert code here.

===========================================================================

Pow_ChkGoggles: ;The Goggles monitor still does nothing. cmpi.b #8,d0 ; does monitor contain goggles? bne.s Pow_ChkInvalid1

nop ;Insert code here.

==========================================================================

Pow_ChkInvalid1: cmpi.b #9,d0 ; Is this the 1st invalid monitor? bne.s Pow_ChkInvalid2

nop ;Insert code here.

==========================================================================

Pow_ChkInvalid2: cmpi.b #$A,d0 ; Is this the 2nd invalid monitor? bne.s Pow_ChkInvalid3

nop ;Insert code here.

==========================================================================

Pow_ChkInvalid3: cmpi.b #$B,d0 ; Is this the 3rd invalid monitor? bne.s Pow_ChkInvalid4

nop ;Insert code here.

==========================================================================

Pow_ChkInvalid4: cmpi.b #$C,d0 ; Is this the 4th invalid monitor? bne.s Pow_ChkInvalid5

nop ;Insert code here.

==========================================================================

Pow_ChkInvalid5: cmpi.b #$D,d0 ; Is this the 5th invalid monitor? bne.s Pow_ChkInvalid6

nop ;Insert code here.

==========================================================================

Pow_ChkInvalid6: cmpi.b #$E,d0 ; Is this the 6th invalid monitor? bne.s Pow_ChkInvalid7

nop ;Insert code here.

==========================================================================

Pow_ChkInvalid7: cmpi.b #$F,d0 ; Is this the 7th invalid monitor? bne.s Pow_ChkBlank

nop ;Insert code here.

==========================================================================

Pow_ChkBlank: cmpi.b #0,d0 ; Is this the blank monitor? bne.s Pow_ChkEnd

nop ;Insert code here.

==========================================================================

Pow_ChkEnd: rts

===========================================================================</asm>

Now you can use the Eggman monitor (before the rest of the monitors in the code), the 'S' monitor, the Goggles monitor, the 7 invalid monitors, and the Blank monitor. There's just one problem: the invalid monitors have glitchy graphics.

Step 2: _maps\Monitor.asm

Delete everything in the file and paste this in: <asm>; ---------------------------------------------------------------------------

Sprite mappings - monitors
---------------------------------------------------------------------------

Map_Monitor: dc.w @static0-Map_Monitor, @static1-Map_Monitor dc.w @static2-Map_Monitor, @eggman-Map_Monitor dc.w @sonic-Map_Monitor, @shoes-Map_Monitor dc.w @shield-Map_Monitor, @invincible-Map_Monitor dc.w @rings-Map_Monitor, @s-Map_Monitor dc.w @goggles-Map_Monitor, @s2-Map_Monitor dc.w @s3-Map_Monitor, @s4-Map_Monitor dc.w @s5-Map_Monitor, @s6-Map_Monitor dc.w @s7-Map_Monitor, @s8-Map_Monitor dc.w @broken-Map_Monitor @static0: dc.b 1 ; static monitor dc.b $EF, $F, 0, 0, $F0 @static1: dc.b 2 ; static monitor dc.b $F5, 5, 0, $10, $F8 dc.b $EF, $F, 0, 0, $F0 @static2: dc.b 2 ; static monitor dc.b $F5, 5, 0, $14, $F8 dc.b $EF, $F, 0, 0, $F0 @eggman: dc.b 2 ; Eggman monitor dc.b $F5, 5, 0, $18, $F8 dc.b $EF, $F, 0, 0, $F0 @sonic: dc.b 2 ; Sonic monitor dc.b $F5, 5, 0, $1C, $F8 dc.b $EF, $F, 0, 0, $F0 @shoes: dc.b 2 ; speed shoes monitor dc.b $F5, 5, 0, $24, $F8 dc.b $EF, $F, 0, 0, $F0 @shield: dc.b 2 ; shield monitor dc.b $F5, 5, 0, $28, $F8 dc.b $EF, $F, 0, 0, $F0 @invincible: dc.b 2 ; invincibility monitor dc.b $F5, 5, 0, $2C, $F8 dc.b $EF, $F, 0, 0, $F0 @rings: dc.b 2 ; 10 rings monitor dc.b $F5, 5, 0, $30, $F8 dc.b $EF, $F, 0, 0, $F0 @s: dc.b 2 ; 'S' monitor dc.b $F5, 5, 0, $34, $F8 dc.b $EF, $F, 0, 0, $F0 @goggles: dc.b 2 ; goggles monitor dc.b $F5, 5, 0, $20, $F8 dc.b $EF, $F, 0, 0, $F0 @s2: dc.b 2 ; 'S' monitor (2) dc.b $F5, 5, 0, $34, $F8 dc.b $EF, $F, 0, 0, $F0 @s3: dc.b 2 ; 'S' monitor (3) dc.b $F5, 5, 0, $34, $F8 dc.b $EF, $F, 0, 0, $F0 @s4: dc.b 2 ; 'S' monitor (4) dc.b $F5, 5, 0, $34, $F8 dc.b $EF, $F, 0, 0, $F0 @s5: dc.b 2 ; 'S' monitor (5) dc.b $F5, 5, 0, $34, $F8 dc.b $EF, $F, 0, 0, $F0 @s6: dc.b 2 ; 'S' monitor (6) dc.b $F5, 5, 0, $34, $F8 dc.b $EF, $F, 0, 0, $F0 @s7: dc.b 2 ; 'S' monitor (7) dc.b $F5, 5, 0, $34, $F8 dc.b $EF, $F, 0, 0, $F0 @s8: dc.b 2 ; 'S' monitor (8) dc.b $F5, 5, 0, $34, $F8 dc.b $EF, $F, 0, 0, $F0 @broken: dc.b 1 ; broken monitor dc.b $FF, $D, 0, $38, $F0 even</asm>

These will be used when the monitor explodes, so that's why the animations file can't just link the the 'S' image. Speaking of the animations file...

Step 3: _anim\Monitor.asm

Delete everything and paste this in: <asm>; ---------------------------------------------------------------------------

Animation script - monitors
---------------------------------------------------------------------------

Ani_Monitor: dc.w @static-Ani_Monitor, @eggman-Ani_Monitor, @sonic-Ani_Monitor dc.w @shoes-Ani_Monitor, @shield-Ani_Monitor, @invincible-Ani_Monitor dc.w @rings-Ani_Monitor, @s-Ani_Monitor, @goggles-Ani_Monitor dc.w @s2-Ani_Monitor, @s3-Ani_Monitor, @s4-Ani_Monitor dc.w @s5-Ani_Monitor, @s6-Ani_Monitor, @s7-Ani_Monitor dc.w @s8-Ani_Monitor, @breaking-Ani_Monitor @static: dc.b 1, 0, 1, 2, afEnd even @eggman: dc.b 1, 0, 3, 3, 1, 3, 3, 2, 3, 3, afEnd even @sonic: dc.b 1, 0, 4, 4, 1, 4, 4, 2, 4, 4, afEnd even @shoes: dc.b 1, 0, 5, 5, 1, 5, 5, 2, 5, 5, afEnd even @shield: dc.b 1, 0, 6, 6, 1, 6, 6, 2, 6, 6, afEnd even @invincible: dc.b 1, 0, 7, 7, 1, 7, 7, 2, 7, 7, afEnd even @rings: dc.b 1, 0, 8, 8, 1, 8, 8, 2, 8, 8, afEnd even @s: dc.b 1, 0, 9, 9, 1, 9, 9, 2, 9, 9, afEnd even @goggles: dc.b 1, 0, $A, $A, 1, $A, $A, 2, $A, $A, afEnd even @s2: dc.b 1, 0, $B, $B, 1, $B, $B, 2, $B, $B, afEnd even @s3: dc.b 1, 0, $C, $C, 1, $C, $C, 2, $C, $C, afEnd even @s4: dc.b 1, 0, $D, $D, 1, $D, $D, 2, $D, $D, afEnd even @s5: dc.b 1, 0, $E, $E, 1, $E, $E, 2, $E, $E, afEnd even @s6: dc.b 1, 0, $F, $F, 1, $F, $F, 2, $F, $F, afEnd even @s7: dc.b 1, 0, 10, 10, 1, 10, 10, 2, 10, 10, afEnd even @s8: dc.b 1, 0, 11, 11, 1, 11, 11, 2, 11, 11, afEnd even @breaking: dc.b 2, 0, 1, 2, $D, afBack, 1 even</asm> And now your monitors should all work right! Except they look like 'S' monitors when destroyed...

Step 4: _incObj\26 Monitor.asm

Now for a final tweak. Search for "move.b #9,obAnim(a0)" and replace it with "move.b #12,obAnim(a0)". Now your monitors will display the correct mappings after being destroyed.

NOTE: It always displays the 'S' monitor instead of the broken monitor. I have 12 above because it worked before I added 3-7, but now it doesn't and I can't find the right value.

Step 5: SonED2 Projects\objdef\s1obj.lst

You now have 10 new monitors. But when you try and place them in SonED 2, you notice that all the "invalid" monitors are labeled "Invalid". How do you know which one's which? You could remember how many times you've pressed the 1 key, or or could have it tell you.Search for " Description: Monitor". Now scroll down until you see " Desc 9: Invalid". Now change that to Invalid 1, the one below to Invalid 2, etc... Now you can tell which monitor is which. Of course, if you have a function for that monitor, you can actually just type it's function, such as "Infinte Speed Shoes" or "50 Rings".

Step 6: Misc Errors

By Bombchu link~

First of all assemble the code and... oh noes! The code doesn't work and the ROM refuses to assemble.

It's because of the added code. Now Some branches are now to far away to work.

Never fear, open up Sub SolidObject in the _incObj folder and change

<asm>brs.w MvSonicOnPtfm</asm> to <asm>jsr MvSonicOnPtfm</asm>


Then open up 89 Ending Sequence STH in the same folder and change <asm>bra.w DisplaySprite</asm> to <asm>jmp DisplaySprite</asm>

This happens at both line 37 and 58 (If My memory is any good)

have fun with your new monitors !