The Mega Drive's processor doesn't support floating point operations as far as I'm aware, so the Sonic games use 16.8 fixed point to represent non-integral values. What this means in simple terms is that Sonic's speed and acceleration aren't in pixels/second or pixels/second², respectively, but in 1/256 pixels per second or 1/256 pixels per second², respectively, instead. So when you see the line Code (ASM): move.w #$C,($FFFFF762).w ; Sonic's acceleration $C in hex is the same thing as 12 in decimal, so this sets Sonic's acceleration to 12/256 = 0.046875 pixels per second² (which is where the number in the physics guide comes from).
How would I set Sonic's yspeed to -7? I can't find another peice of code to edit. Also, where is the Jump height set? Thanks people
His Y speed? I'm not sure what you mean, but the vertical velocity for an object is $12(a0) (negative value for going upwards, positive for going downwards). As for the jump height, at the routine Sonic_Jump you have this code (added the comments myself): Code (ASM): move.w #$680,d2 ; set normal jump height btst #6,$22(a0) ; is Sonic underwater? beq.s loc_1341C ; if not, branch move.w #$380,d2 ; if he is underwater, set smaller jump height At Sonic_JumpHeight (which is just a few lines below) you have a code which sets a minimum jump height (a height you will pass, even if you release the jump button before reaching that height): Code (ASM): move.w #-$400,d1 ; set normal minimum jump height btst #6,$22(a0) ; is Sonic underwater? beq.s loc_134AE ; if not, branch move.w #-$200,d1 ; if he is underwater, set smaller minimum jump height
Code (ASM): move.w #$100,$12(a0) Note that the $100 is just an example. Replace it with the number you want. And also, if you want to move Sonic upwards, make it look like this: Code (ASM): move.w #-$100,$12(a0) (In other words, make sure where you place the - char.)
So, I have some palettes that are in ASM form, is there any way to convert them into .bin files? Reason I need this is so I can load them in SonED2, etc.
Open the mappings file in SonMapEd and save as .bin again. You could also use a hex editor and CP the stuff, but that feature isn't supported for every hex editor.
I said palette not mappings. I can't open the .asm palette in anything—SonED, sonmaped, they all load it incorrectly, in game though, It loads fine.
I seem to have created quite an odd bug.... I attempted to implement a Heathsystem so that pikachu has 3 hits before he does reguardless of wether he has rings or not, I havent implemented it into the HUD yet.The problems are that when pikachu dies, the object that kills him dissappears for some reason, and when pikachu is killed through crushing or on spikes something strange happens. I have included a link to the current build so you can have a look. http://www.box.net/shared/5k5j6k8hlp This is the code I modified for the hit's system, the only other entries are at the start of a level and when starting from a signpost to set the hits back to 3. Code (Text): HurtSonic: tst.b ($FFFFFE2C).w ; does Sonic have a shield? bne.s Hurt_Shield; if yes, branch tst.w ($FFFFFE20).w ; does Sonic have any rings? beq.w Hurt_NoRings ; if not, branch tst.w ($FFFFFEAA).w ; does Pikachu have any hits? beq.w Killsonic ; if not, branch subq.b #1,($FFFFFEAA).w;-1 from hits jsr SingleObjLoad bne.s Hurt_Shield move.b #$37,0(a1) ; load bouncing multi rings object move.w 8(a0),8(a1) move.w $C(a0),$C(a1) Hurt_Shield: move.b #0,($FFFFFE2C).w; remove shield move.b #4,$24(a0) bsr.w Sonic_ResetOnFloor bset #1,$22(a0) move.w #-$400,$12(a0); make Sonic bounce away from the object move.w #-$200,$10(a0) btst #6,$22(a0) beq.s Hurt_Reverse move.w #-$200,$12(a0) move.w #-$100,$10(a0) Hurt_Reverse: move.w 8(a0),d0 cmp.w 8(a2),d0 bcs.s Hurt_ChkSpikes; if Sonic is left of the object, branch neg.w $10(a0) ; if Sonic is right of the object, reverse Hurt_ChkSpikes: move.b #0,$39(a0) move.w #0,$14(a0) move.b #$1A,$1C(a0) move.w #$78,$30(a0) move.w #$A3,d0 ; load normal damage sound cmpi.b #$36,(a2) ; was damage caused by spikes? bne.s Hurt_Sound ; if not, branch cmpi.b #$16,(a2) ; was damage caused by LZ harpoon? bne.s Hurt_Sound ; if not, branch move.w #$A6,d0 ; load spikes damage sound Hurt_Sound: jsr (PlaySound_Special).l moveq #-1,d0 rts ; =========================================================================== Hurt_NoRings: tst.w ($FFFFFEAA).w ; does Pikachu have any hits? beq.w Killsonic ; if not, branch subq.b #1,($FFFFFEAA).w;-1 from hits bra Hurt_Shield; else,branch I really have no idea what is causing the bugs
@Irixion: You can also load stuff as uncompressed tiles, seems like anything can be opened using this way (and also saved of course). @Hodgy: Byte and word issue, the usual thing. To fix up your code as well, do this: Go to a point that is only being loaded once (like Level_WaterPal) and put this line there: Code (ASM): move.b #3,($FFFFFEAA).w ; reset number of hits Then just go to HurtSonic and put those lines there: Code (ASM): subq.b #1,($FFFFFEAA).w ; -1 from hits beq.w Hurt_NoRings ; if not, branch We don't need to do a test and then substract it, because HurtSonic only takes place when you actually got hurt.
If the asm file only contains the palette, you could as well just build it using the assembler so it outputs a binary...
Does anyone know where the mappings are for Sonic and Tails animations in the Sonic 2 title screen? I can't find them listed in the ASM.
They're in the mappings folder—iirc in the misc folder I'm confused >_> I basically want to turn this: dc.w 0, 0, $206, $20C, $80, $64E, $EEE, $AAA, $888, $444, $8AE, $46A, $E, 8, $AE, $8E; 0 ; ... dc.w $C20, 0, $E62, $A86, $E86, $44, $EEE, $AAA, $888, $444, $666, $E86, $EE, $88, $EA8, $ECA; 16 Into a binary file that I can open with SonED, SonMapEd, etc. If I force it to load, it doesn't load correctly, if I use 'include blah.asm' then it doesn't load in rom. If I say have it: palptr Palette: <What I just pasted> Then it looks fine.
That's... pretty easy. Just open a new file in a hex editor and write down in the file what you see, but adding 0s too the data where needed. Example: $EEE = 0EEE, $80 = 0080, etc. If that doesn't work, reconstructing the palette in SonEd shouldn't be that hard either.
Code (Text): asm68k /p palette.asm, palette.bin Or whatever applies to your assembler. Basically I just told you to assemble that file like any other ASM file =P
That worked! Thanks, just thought there were a simpler quicker way to do it. I'm using S2, so how would that command look like for S2's assembler? iirc it doesn't use ASM86K. Problem's solved though, thanks!
I'm having trouble figuring out which animation is Sonic's running animation in Sonic 3K. And I've been trying many different values, but obviously no luck. (But I managed to figure out that $A is the unused whistling animation. :v
Is there a simple way to disable channels on SMPS music (and I mean like just not making the channel play if reason XY is true)?