Sonic and Sega Retro Message Board: Tamkis' advanced questions topic - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Loading News Feed...
 

Tamkis' advanced questions topic formerly "Help on making new S2 Monitors"

#1 User is offline Tamkis 

Posted 28 November 2010 - 09:00 PM

  • Posts: 116
  • Joined: 19-November 10
  • Gender:Male
  • Location:Pennsylvania
  • Project:Megaman 2: The Robotnik Wars, Unnamed S3&K hack
  • Wiki edits:16
Yay, my first post specialed.png ! So, I am making my own Sonic hack for Sonic 2, called S2: Age of Aquarias, which will have water in ALL levels. Anyways, I plan on making two new monitors, a tweaked robotnik mointor that will always kill you, and a monitor that will give Sonic super jump for some time. I tried to make both, but failed. Could anybody help me? I've checked everywhere on these forums on how to make new S2 monitors but have found nothing. The only two hacks that I have ever seen with new monitors is (excuse my french) "Sonic the stupid f*ing b*ch" and Sonic 2 Retro Remix. I am using the S2 Xenowhirl 2007 disasm. I know very little asm, except some basic x86 asm sad.png, so this is slightly new to me. Otherwize, I am very good at programming, but not necessarily at hacking.

Below is my attempts:

Insta-kill® Robotnik monitor:
CODE
; badnik_monitor:
robotnik_monitor:;**
    addq.w    #1,(a2)
    jmp    KillCharacter; **



Hi-jump monitor:
[/code]

CODE
tails_1up:    ;**
    addq.w    #1,(a2)
    bset    #2,status_secondary(a1)
    move.w    #$4B0,speedshoes_time(a1)
;cmpi.w    #2,(Player_mode).w; Not having 2p VS. in my hack...
;beq.s    loc_12A10
    move.w    #-$200,y_vel(a0)
    rts    rts

What I tried to do for this monitor is use (for now) the Tail 1-up monitor for this one. I also copied, pasted, and modified the Speedy shoes monitor code, so that I could try to use the speed shoes process to time the hi-jump effect. Nothing really happens when I hit this monitor. I have a feeling I'm doing it completly wrong...

It's late, so I will add my other problems tomorrow (I only have 20 posts as a trial member!).
This post has been edited by Tamkis: 21 March 2011 - 06:39 PM

#2 User is offline SegaLoco 

Posted 28 November 2010 - 09:45 PM

  • Gotta go dash!
  • Posts: 988
  • Joined: 16-August 06
  • Gender:Male
  • Location:Corpus Christi, TX
  • Wiki edits:79
Well, to suggest something to you, have you tried using the debugger in Gens/GS. It's excellent and could probably at least tell you where the first one is going wrong. The debugger controls escape me atm, but you can do all the normal debugger things. It features a 68k, z80, and vdp debugger (among a few other misc things) so yeah, try that to see where your code is going wrong. Excellent first post btw, I wouldn't have had the balls to jump right into E&RE back in the day specialed.png

#3 User is offline Super Egg 

Posted 28 November 2010 - 11:44 PM

  • Master of MS Paint.
  • Posts: 60
  • Joined: 01-July 10
  • Gender:Male
  • Location:Tomball, TEXAS
  • Project:Sonic 2 beta 3 hoax, SONIC X ABRIDGED BITCH!!!
  • Wiki edits:46
Ok, well Tamkis, welcome to Sonic retro. Now, lets get serious. Ok,

1st question. For the hijump monitor, have you set it up to work underwater? If memory serves correctly you have to add that in or otherwise your monitor will never work.

I think that is your only problem. I'll get back to you on the autokill.


This post has been edited by Super Egg: 29 November 2010 - 12:07 AM

#4 User is offline Hayate 

Posted 29 November 2010 - 07:23 AM

  • Posts: 2355
  • Joined: 01-February 04
  • Gender:Male
  • Location:Torquay, England
  • Wiki edits:70
QUOTE (Tamkis @ Nov 29 2010, 02:00 AM)
Insta-kill® Robotnik monitor:
CODE
; badnik_monitor:
robotnik_monitor:;**
    addq.w    #1,(a2)
    jmp    KillCharacter; **


That isn't going to work because KillCharacter needs the character in a0 - essentially you have it so that breaking the monitor kills the monitor.

Try this:

CODE
    addq.w    #1,(a2)
    movea.l    a0,a1
    lea    ($FFFFB000).w,a0
    jsr    (KillCharacter).l
    movea.l    a1,a0
    rts


(If that doesn't work, change a1 to a3 because whatever's calling it might be using a1 for something.)

#5 User is offline Tamkis 

Posted 29 November 2010 - 10:06 AM

  • Posts: 116
  • Joined: 19-November 10
  • Gender:Male
  • Location:Pennsylvania
  • Project:Megaman 2: The Robotnik Wars, Unnamed S3&K hack
  • Wiki edits:16
Hey thanks, it works! Wow, that is one evil monitor I just made smile.png. Before I post anymore, does my post count keep track of how many new topics I make or replies, because I heard quoting for no reason doesn't increment the count? Just wondering so I don't waste my posts as a trial member.

Anyways, the next problem I have is addind water to each level. I followed the guide at SCHG to extend the water tables, but whenever I place obj_04 in SonED2 in my levels (water surface), and change the water height in the water tables, my water still floats to the top of the level and has no interaction with players. I think this has something to do with some code that I can't find that enables water_flag or water_on whenever you are in certain zones. Either that, or I need to port obj_04 to each level, because the graphics of the surface are glitchy and don't interact, but still float to the top of the level. Or maybe I need to play around with the Dynamaic water tables to first initialize the water? I don't know.

One more question, how do I port objects from different levels? For example, I want to allow the rotating ring thing and air bubbles from MCZ to be in some levels, but because those objects don't belong outside of their native levels, the graphics glitch up or the object doesn't work properly after placing some with SonED2. I extended the debug lists for each level so that all levels have those two objects which work properly, but the SonED2 placed ones still glitch up.

Any ideas?

#6 User is offline Hitaxas 

Posted 29 November 2010 - 12:50 PM

  • SEGA: Sorry Classic Sonic, we are sending you back to 1994
  • Posts: 1352
  • Joined: 30-September 07
  • Gender:Male
  • Location:Litchfield, CT
  • Project:Sonic: Super Deformed (head director) - Slowly working on it.
  • Wiki edits:196
QUOTE
and change the water height in the water tables, my water still floats to the top of the level and has no interaction with players.


In order to add water to a level, you need to add a check for the zone and act like so:

Syntax Highlighted Code: ASM
Level_ClrRam:
clearRAM Sprite_Table_Input,$400
clearRAM Object_RAM,$2400 ; clear object RAM
clearRAM $FFFFF628,$58
clearRAM Misc_Variables,$100
clearRAM $FFFFFE60,$50
clearRAM $FFFFE700,$100
; Loads water in levels
cmpi.w #$D01,(Current_ZoneAndAct).w ; CPZ 2
beq.s Level_InitWater
cmpi.w #$D00,(Current_ZoneAndAct).w ; CPZ 1 ; adds water to CPZ act 1
beq.s Level_InitWater
cmpi.b #$F,(Current_Zone).w ; ARZ
beq.s Level_InitWater
cmpi.b #8,(Current_Zone).w ; HPZ
bne.s +


That is a bit from my S2 hack. The object you keep trying to load should load on it's own.

QUOTE
because the graphics of the surface are glitchy


You probably have to change the pattern load queue setup to accommodate the levels in specific.

For example:
Syntax Highlighted Code: ASM
;---------------------------------------------------------------------------------------
; Pattern load queue
; CPZ Primary
; plc for Chemical Plant zone
;---------------------------------------------------------------------------------------
PLC_16: plrlistheader
plreq $8000, ArtNem_WaterSurface2
plreq $8400, ArtNem_WaterSurface


You will have to add a PLC for the WaterSurfaces in every zone.

QUOTE
Or maybe I need to play around with the Dynamaic water tables to first initialize the water? I don't know


Yes, you will have to work with DynamicWater: in order to allow the water to rise and lower in certain areas throughout the level.

This is a small example from my hack to give you a slight idea on what to do:

Syntax Highlighted Code: ASM
DynamicWaterTTZ1:                           ; 1st change in the water height on TTZ act 1
cmpi.w #$D01,(Current_ZoneAndAct).w ; Is the level/act TTZ 2?
beq DynamicWaterTTZ2 ; if yes, branch to TTZ 2's code
cmpi.w #$516,(Camera_Y_pos).w ; only first one seems to be able to use this, makes water load at a very specific point.
bcs.s WaterHeight_Change2 ; if the camera is not at a y pos of 516, branch to the second routine
cmpi.w #$1DE0,(Camera_X_pos).w ; checks if the camera is at an x position that is greater than 1DE0
bcs.s WaterHeight_Change2 ; if it "isnt" branch
move.w #$510,(Water_Level_3).w ; raise the water to 510
rts ; don't go directly to the second change


Basically it is explained with comments. What it does is checks for the zone and act, and branches to another level's code if it is not. Then it checks for X and Y camera positions. When the camera hits that specific position in the level, the water will rise.



QUOTE
One more question, how do I port objects from different levels? For example, I want to allow the rotating ring thing and air bubbles from MCZ to be in some levels, but because those objects don't belong outside of their native levels, the graphics glitch up or the object doesn't work properly after placing some with SonED2. I extended the debug lists for each level so that all levels have those two objects which work properly, but the SonED2 placed ones still glitch up.


The above mention of PLCs can also be used to bring objects over from different levels.


----
I wish you luck in further endeavors, that hi-jump monitor sounds like it will be interesting
This post has been edited by Hitaxas: 29 November 2010 - 12:53 PM

#7 User is offline Hayate 

Posted 29 November 2010 - 02:44 PM

  • Posts: 2355
  • Joined: 01-February 04
  • Gender:Male
  • Location:Torquay, England
  • Wiki edits:70
What Hitaxas said, but I should point out...

QUOTE (Tamkis @ Nov 29 2010, 03:06 PM)
whenever I place obj_04 in SonED2 in my levels (water surface)


AFAIK you're not supposed to place the water surface object with SonED2 - let the game load it.

(Reminds me of when I placed Obj01 Sonic in Metropolis Zone by accident, and after running left and right through the area several times I ended up with a dozen copies of Sonic running around at once.)
This post has been edited by Hayate: 29 November 2010 - 02:45 PM

#8 User is offline Shadow Fire 

Posted 29 November 2010 - 05:51 PM

  • Ultimate victory!
  • Posts: 1518
  • Joined: 05-February 05
  • Gender:Male
  • Location:The Land of Darkness
  • Project:Sonic: The Lost Land (Series), The GCN (site)
  • Wiki edits:60
IIRC (and this is going back aaaaaaaaaages), you will need to extend the Pattern Load Cues and find a free space of VRAM to allow the water's surface to load. In the copy of Sonic: The Lost Land 2 that I last worked on (pre-ASM), I had water in MCZ (Sunken Subway), and the cues were sharing with the vine-switches and collapsible bridges.

SMTP once told me that the water's surface could also be removed, so you could have it looking similar to Sonic 3.

I have the notes he sent me when I was playing around with water, but they're back when Sonic 2 disassembly was still kinda nonexistant. All to be done in hex.

#9 User is offline Hitaxas 

Posted 29 November 2010 - 06:25 PM

  • SEGA: Sorry Classic Sonic, we are sending you back to 1994
  • Posts: 1352
  • Joined: 30-September 07
  • Gender:Male
  • Location:Litchfield, CT
  • Project:Sonic: Super Deformed (head director) - Slowly working on it.
  • Wiki edits:196
QUOTE (Shadow Fire @ Nov 29 2010, 05:51 PM)
SMTP once told me that the water's surface could also be removed, so you could have it looking similar to Sonic 3.


That can be done in the S2 disassembly by going to Level_ChkWater: and removing or commenting out these 4 lines:


Syntax Highlighted Code: ASM
	move.b	#4,(Object_RAM+$380).w ; load Obj04 (water surface) at $FFFFB380
move.w #$60,(Object_RAM+$380+x_pos).w ; set horizontal offset
move.b #4,(Object_RAM+$3C0).w ; load Obj04 (water surface) at $FFFFB3C0
move.w #$120,(Object_RAM+$3C0+x_pos).w ; set different horizontal offset


#10 User is offline Alriightyman 

Posted 29 November 2010 - 10:59 PM

  • !!!!!!!!!!!!!!!!!
  • Posts: 318
  • Joined: 27-November 07
  • Gender:Male
  • Location:Largo, Fl
  • Project:Hmmmmmmmmmmmmm......
  • Wiki edits:5
QUOTE (Hitaxas @ Nov 29 2010, 06:25 PM)
QUOTE (Shadow Fire @ Nov 29 2010, 05:51 PM)
SMTP once told me that the water's surface could also be removed, so you could have it looking similar to Sonic 3.


That can be done in the S2 disassembly by going to Level_ChkWater: and removing or commenting out these 4 lines:


Syntax Highlighted Code: ASM
	move.b	#4,(Object_RAM+$380).w ; load Obj04 (water surface) at $FFFFB380
move.w #$60,(Object_RAM+$380+x_pos).w ; set horizontal offset
move.b #4,(Object_RAM+$3C0).w ; load Obj04 (water surface) at $FFFFB3C0
move.w #$120,(Object_RAM+$3C0+x_pos).w ; set different horizontal offset


Or you could test level ids and decide which levels will have water surface and which do not.
Example:
Syntax Highlighted Code: ASM
 
cmp.w #$D00,(Current_ZoneandAct).w ; are we in CPZ?
beq.s GiveMeWaterSurface ; if so, Then branch
cmp.w #$000,(Current_ZoneAndAct).w ; are we in EHZ?
bne.s NoWaterSurface ; if not, branch
GiveMeWaterSurface:
move.b #4,(Object_RAM+$380).w ; load Obj04 (water surface) at $FFFFB380
move.w #$60,(Object_RAM+$380+x_pos).w ; set horizontal offset
move.b #4,(Object_RAM+$3C0).w ; load Obj04 (water surface) at $FFFFB3C0
move.w #$120,(Object_RAM+$3C0+x_pos).w ; set different horizontal offset
NoWaterSurface:
... code...
 


#11 User is offline Tamkis 

Posted 03 December 2010 - 05:21 PM

  • Posts: 116
  • Joined: 19-November 10
  • Gender:Male
  • Location:Pennsylvania
  • Project:Megaman 2: The Robotnik Wars, Unnamed S3&K hack
  • Wiki edits:16
Thanks for all your help so far; iHaz water now! I think I'm done for modifying the game engine for this hack. I'm going to go with removing the water surface (like in S3, S&K, or S3&K), since it is the easiest way to fix the graphics. If I ever need more help, I will ask the forums. I hope none of you (e.g. Andlabs) mind if I update the SCHG how-to on how to extend the water tables for S2 with some of this info on getting water to work sometime?

QUOTE (Hayate @ Nov 29 2010, 02:44 PM)
What Hitaxas said, but I should point out...

QUOTE (Tamkis @ Nov 29 2010, 03:06 PM)
whenever I place obj_04 in SonED2 in my levels (water surface)


AFAIK you're not supposed to place the water surface object with SonED2 - let the game load it.

(Reminds me of when I placed Obj01 Sonic in Metropolis Zone by accident, and after running left and right through the area several times I ended up with a dozen copies of Sonic running around at once.)


o_O, I think I completly know how snkjoi made S2Quantum, which will be the basis of my plan's for my 2nd hack, S2: Attack of the Clones. When the times come to make it, I'll ask for help with the community (some of the programming will be a doozy).

#12 User is offline Tamkis 

Posted 22 December 2010 - 10:51 AM

  • Posts: 116
  • Joined: 19-November 10
  • Gender:Male
  • Location:Pennsylvania
  • Project:Megaman 2: The Robotnik Wars, Unnamed S3&K hack
  • Wiki edits:16
Well, I hate to double post, but I have a few more questions. First of all, I almost got the hijump monitor working. The only problem is, for now, this hijump effect is attributed to the speedshoes_time variable. This means that, not only will the Tails monitor will cause hijumping, but the speedshoes monitor will too sad.png. How can I make a separate flag to handle the hijump, when only the Tails monitor is hit?

Here's the modified code:

Syntax Highlighted Code: ASM
 
tails_1up: ;**
addq.w #1,(a2)
bset #2,status_secondary(a1)
move.w #$4B0,hijump_time(a1)
 


Tails_1up is based upon the super_shoes monitor:

Syntax Highlighted Code: ASM
 
super_shoes:
[b] addq.w #1,(a2)
bset #2,status_secondary(a1)
move.w #$4B0,speedshoes_time(a1)[/b]
 


The code that actually enables the hi_jump:
Syntax Highlighted Code: ASM
 
Sonic_Jump:
move.b (Ctrl_1_Press_Logical).w,d0
andi.b #$70,d0 ; is A, B or C pressed?
beq.w return_1AAE6 ; if not, return
moveq #0,d0
move.b angle(a0),d0
addi.b #$80,d0
bsr.w CalcRoomOverHead
cmpi.w #6,d1 ; does Sonic have enough room to jump?
blt.w return_1AAE6 ; if not, branch
move.w #$680,d2 ;***
tst.b (Super_Sonic_flag).w ;***
beq.s + ;***
move.w #$800,d2 ; set higher jump speed if super
+
btst #6,status(a0) ; Test if underwater
beq.s +
move.w #$380,d2 ; set lower jump speed if under
+
btst #2,status_secondary(a0) ;**test if high jump monitor was hit
beq.s + ;**
move.w #$1000,d2 ;sethigher jump speed if hit
 

______________


Another question: Is it possible to modify the underwater palletes without having to make a separate pallette file for each level? Right now, the underwater palletes for all levels except CPZ & ARZ look pretty ugly. And if I have to make separate pallete files, how do I make them with Tribeam's real-time palette editor and insert them into the rom?

http://tamkis.tripod.com/blog/upalete.png

One final question: one of you mentioned that you made "evil" water that, reduced your rings instead of oxygen time. How can I make that effect? I don't want to make my hack too easy by disabling drowning, but neither do I want to make it too hard by putting tons of air bubble objects in every level. Going the ring method would be best. This link will probably be best in making the code: http://forums.sonicretro.org/index.php?sho...c=12207&hl=. The only prob is that the link to the source code is dead sad.png.
This post has been edited by Tamkis: 22 December 2010 - 10:57 AM

#13 User is offline Hitaxas 

Posted 22 December 2010 - 03:12 PM

  • SEGA: Sorry Classic Sonic, we are sending you back to 1994
  • Posts: 1352
  • Joined: 30-September 07
  • Gender:Male
  • Location:Litchfield, CT
  • Project:Sonic: Super Deformed (head director) - Slowly working on it.
  • Wiki edits:196
One thing I see with the code you have posted, Sonic_Jump changes Sonic's jump height if he has #2,status_secondary(a0) set.

Your issue is that both the high jump and speed shoes monitor boxes set status_secondary to 2. Instead of using 2 for the high jump monitor, try 3 and check for that in sonic's jump routine.

Syntax Highlighted Code: ASM
tails_1up:				;**
addq.w #1,(a2)
bset #3,status_secondary(a1)
move.w #$4B0,hijump_time(a1)
 


Syntax Highlighted Code: ASM
Sonic_Jump:
move.b (Ctrl_1_Press_Logical).w,d0
andi.b #$70,d0 ; is A, B or C pressed?
beq.w return_1AAE6 ; if not, return
moveq #0,d0
move.b angle(a0),d0
addi.b #$80,d0
bsr.w CalcRoomOverHead
cmpi.w #6,d1 ; does Sonic have enough room to jump?
blt.w return_1AAE6 ; if not, branch
move.w #$680,d2 ;***
tst.b (Super_Sonic_flag).w ;***
beq.s + ;***
move.w #$800,d2 ; set higher jump speed if super
+
btst #6,status(a0) ; Test if underwater
beq.s +
move.w #$380,d2 ; set lower jump speed if under
+
btst #3,status_secondary(a0) ;**test if high jump monitor was hit
beq.s + ;**
move.w #$1000,d2 ;sethigher jump speed if hit


That should do the trick.

#14 User is offline Tamkis 

  Posted 21 March 2011 - 07:14 PM

  • Posts: 116
  • Joined: 19-November 10
  • Gender:Male
  • Location:Pennsylvania
  • Project:Megaman 2: The Robotnik Wars, Unnamed S3&K hack
  • Wiki edits:16
Well, after many months of keeping the Sonic 2 Engine the same for my (notorious?) Sonic 2 hack, Sonic Loco 2, I have decided to modify the engine a little bit again. This time, instead of focusing solely on making new monitors, I am working on porting some graphics and giving Sonic & Tails some new moves. I have many questions, making this post quite wordy, but here goes (mini 68k warning):


The first set of sprites I have ported is that air-hang graphic from Sonic CD, which is seen when Sonic hits a spring or when he is teleporting to another Time Zone. (You know, that twirling-in-the-air animation). I used SonMapED to port the graphics, and replaced the normal non-twirl spring sprites and death/drowning sprites with them. (I plan on moving the pointer for the death sprite to the end of the sprites mappings list, and I removed the drowning sprites because I don't plan on having water, since my poorly ported sound driver messed up underwater palletes) The only problem is, when a spring is hit (which doesn't have that "sonic twirls" param), Sonic does his SCD twirling animation too slowly. Is there anyway that I can speed it up to the speed in SCD?

The other set of sprites that I ported are the peelout sprites from SCD. These sprites are at the end of the mappings list. The peelout fully functions, and is even enabled when running at fast speeds, like in SCD. All is working well, except that, for some reason, the SEGA screen crashes at a white screen. Could this be because the running sonic sprite on that screen wants to peelout at its high speed? Because of this error, currently, I am only able to test my hack by using savestates to access the level select and title screen. For the end-user, the hack is essentially broken (luckily, I regualry backup my work!)

Also, for some reason, after adding those peelout sprites, some other graphics in EHZ have messed up (the platforms and the rotating pallette in the BG of the cave areas). What could be the cause of their corruption, and how can I fix it?


I just had a great idea on how to modify my clone monitor, which adds another interactive Tails object to the level. When the clone monitor is hit, another Tails object either falls/flies down from the sky. Instead of that happening, I had a great idea of making the monitor enable a flag for the rest of the level. Upon pressing the A button, this flag will make Sonic run the ported, unused whislte sprites from S3/S&K/S3&K, and make another Tails object appear! Each time Sonic calls for another Tails partner, 25 rings will be used up. How can I program this, and make the opposite work for Tails? For Tails, hitting the clone monitor should allow Tails to call a Sonic partner.

One last question, how can I get S2TCG working on the .svn Sonic 2 disasm? And most importantly, how do I attach things to posts?


Thank you for your help!

#15 User is offline Tamkis 

  Posted 25 March 2011 - 04:43 PM

  • Posts: 116
  • Joined: 19-November 10
  • Gender:Male
  • Location:Pennsylvania
  • Project:Megaman 2: The Robotnik Wars, Unnamed S3&K hack
  • Wiki edits:16
Can't anybody answer any of the above questions? I'm sure there is some tech member who can help me out here. All I need is the question below answered, and how to make Sonic 2 Text Code Generator working with the .svn disasm before I post the latest version of Sonic 2 Loco.

QUOTE
I just had a great idea on how to modify my clone monitor, which adds another interactive Tails object to the level. When the clone monitor is hit, another Tails object either falls/flies down from the sky. Instead of that happening, I had a great idea of making the monitor enable a flag for the rest of the level. Upon pressing the A button, this flag will make Sonic run the ported, unused whislte sprites from S3/S&K/S3&K, and make another Tails object appear! Each time Sonic calls for another Tails partner, 25 rings will be used up. How can I program this, and make the opposite work for Tails? For Tails, hitting the clone monitor should allow Tails to call a Sonic partner.


Well, anyways, I almost coded the new whistle flag from above, but for some reason, I can't get the flag to be enabled. Moreover, the whistle sprites runs way to fast to be even seen, about a microsecond. How can I slow down/display these whistle sprites, and get the flag to enable? I have tried everything. Here is the code:

excerpt from s2.constants.asm:
Syntax Highlighted Code: ASM
 
; conventions specific to sonic/tails (Obj01, Obj02, and ObjDB):
; note: $1F, $20, and $21 are unused and available
; conventions specific to sonic/tails (Obj01, Obj02, and ObjDB):
; note: $1F, $20, and $21 are unused and available
inertia = $14 ; and $15 ; directionless representation of speed... not updated in the air
peelout_flag = $1F ;**
peelout_counter = $20;word ;**
clone_flag = $21 ;**
 
; Animation IDs
offset := SonicAniData
ptrsize := 2
idstart := 0
 
AniIDSonAni_Lying = id(SonAni_Lying_ptr) ; 32 ; $20
AniIDSonAni_LieDown = id(SonAni_LieDown_ptr) ; 33 ; $21
AniIDSonAni_Haulass = id(SonAni_Haulass_ptr) ; 34 ; $22**
AniIDSonAni_Whistle = id(SonAni_Whistle_ptr) ; 35 ; $23**
 


s2.asm
Syntax Highlighted Code: ASM
 
Obj2E_Types: offsetTable
offsetTableEntry.w evil_monitor ;** 0 - Random Evil
offsetTableEntry.w sonic_1up ; 1 - Sonic 1-up
offsetTableEntry.w tails_1up ; 2 - Tails 1-up
offsetTableEntry.w robotnik_monitor ;** 3 - Insta Kill
offsetTableEntry.w super_ring ; 4 - Super Ring
offsetTableEntry.w super_shoes ; 5 - Speed Shoes
offsetTableEntry.w shield_monitor ; 6 - Shield
offsetTableEntry.w invincible_monitor ; 7 - Invincibility
offsetTableEntry.w teleport_monitor ;**8 - SS monitor
offsetTableEntry.w qmark_monitor ;**9 - Clone Monitor
 
 
qmark_monitor:
move.b #1,(clone_flag).w
move.w #MusID_ExtraLife,d0
jmp (PlayMusic).l
 
Obj01_MdNormal:
 
btst #button_A,(Ctrl_1_Press).w ;** is A being pressed for whistle?
bne.w Sonic_Whistle ;** if so, whistle
 
bsr.w Sonic_CheckSpindash
bsr.w Sonic_CheckPeelout
bsr.w Sonic_Jump
bsr.w Sonic_SlopeResist
bsr.w Sonic_Move
bsr.w Sonic_Roll
bsr.w Sonic_LevelBound
jsr (ObjectMove).l
bsr.w AnglePos
bsr.w Sonic_SlopeRepel
 
return_1A2DE:
rts
 
Sonic_whistle: ;**
tst.b (clone_flag).w ; is clone flag enabled?
beq.s + ; if not, branch
 
move.b #AniIDSonAni_Whistle,anim(a0)
 
move.b #2,(Tails_Shield+id).w ; load Obj02 (Tails) at $FFFFD1C0
move.w a1,(Tails_Shield+parent).w
move.w #SndID_Sparkle,d0
jsr (PlaySound).l
rts
+
move.w #SndID_Error,d0
jsr (PlaySound).l
rts
; End of subroutine Obj01_MdNormal
 
 
; ---------------------------------------------------------------------------
; Animation script - Sonic
; ---------------------------------------------------------------------------
; off_1B618:
SonicAniData: offsetTable
 
SonAni_Lying_ptr: offsetTableEntry.w SonAni_Lying ; 32 ; $20
SonAni_LieDown_ptr: offsetTableEntry.w SonAni_LieDown ; 33 ; $21
SonAni_HaulAss_ptr: offsetTableEntry.w SonAni_HaulAss ; 34 ; $22**
SonAni_Whistle_ptr: offsetTableEntry.w SonAni_Whistle ; 35 ; $23**
 
SonAni_Whistle: dc.b $FD,$E5,$E6,$E7,$FF,$FF ;**
 


  • 2 Pages +
  • 1
  • 2
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users