- Tech Member: Tech Members
- Active Posts:
- 969 (0.32 per day)
- Most Active In:
- Engineering & Reverse Engineering (515 posts)
- 31-January 05
- Profile Views:
- Last Active:
- Today, 10:38 AM
- Member Title:
- Also known as RHS
- 24 years old
- January 25, 1989
- United Kingdom
- Other Contact Info:
- Sonic 2 Recreation
- National Flag:
- Wiki edits:
Posts I've Made
Yesterday, 07:12 PMNext, you can get away with a smaller data table without the blank words. Just multiply d0 with 6 instead of 8. Adding to that, I think you can save a few cycles by multiplying the bit-values themselves with 6, instead of doing it at the end. You'll need to change the second and third addq.w to addi.w, but the cycles those two changes add (4 each) are mitigated by not having to do three add.w's at the end (12 cycles, saving 4 cycles total). Admittedly, not much, and this isn't exactly a routine where optimization is very important, but you'll at least save some ROM space while you're at it.
Thanks for the tip, but it's not much point changing it. My maths isn't too great and that's why I came up with the longword routine. But you can change it this way by all means in your hack
Finally, I think you're going to have to make the routine character-specific, or else Tails is going to use the wrong values when Sonic turns super.
...shit. Didn't think of that. Never crossed my mind. Anyway, simple fix. Under the label "ApplySpeedSettings:", just before "tst.b (Super_Sonic_flag).w", add this:
cmpa.w #MainCharacter,a0 ; Is it Tails currently following this code? bne.s + ; If so, branch and ignore next question
So you end up with this:
ApplySpeedSettings: moveq #0,d0 ; Quickly clear d0 tst.w speedshoes_time(a0) ; Does character have speedshoes? beq.s + ; If not, branch addq.b #1,d0 ; Quickly add 1 to d0 + btst #6,status(a0) ; Is the character underwater? beq.s + ; If not, branch addq.b #2,d0 ; Quickly add 2 to d0 + cmpa.w #MainCharacter,a0 ; Is it Tails currently following this code? bne.s + ; If so, branch and ignore next question tst.b (Super_Sonic_flag).w ; Is the character Super? beq.s + ; If not, branch addq.b #4,d0 ; Quickly add 4 to d0 + add.b d0,d0 ; Multiply itself add.b d0,d0 ; And again add.b d0,d0 ; And again lea Speedsettings(pc,d0.w),a1 ; Load correct speed settings into a1 addq.l #2,a1 ; Increment a1 by 2 quickly move.l (a1)+,(a2)+ ; Set character's new top speed and acceleration move.w (a1),(a2) ; Set character's deceleration rts ; Finish subroutine
Fixed in first post. Thanks for pointing that bug out.
15 May 2013 - 05:34 PMWouldn't it of made more sense posting this in the topic where you were talking about it? =P
15 May 2013 - 05:31 PMAh I see, that's probably why he moves by some certain pixels due to the slope. If I get time this weekend, I'll have a look into it (and try to pull the bug off myself =P)
15 May 2013 - 02:02 PMSorry if I am misunderstanding here, but if in the normal Sonic 2, it doesn't use it's "normal" form, why not just use it as they're are in all other Sonic 2 levels?
And what do you mean by "normal" form?
14 May 2013 - 05:04 PM3) I can't see this bug. Where abouts did you notice this?