SSRG Forums > Sonic Specific Modification > Submissions > Sourcecode Exchange |
![]() ![]() |
|
Sunday 22nd March 2009, 7:48 pm
Post
#1
|
|
Keep on rockin' Group: Projects Supervisor Posts: 1,152 Joined: 20th July 2008 From: Lueneburg, Germany Member No.: 469 Points: 45 |
Jumpdash for Sonic 1 I removed the Jumpdash from SSRG a long time ago. However, now it's back. It was hosted on Sofia for a while If you want to read the story, click me! ========Starts here======= Before you start read this: This code was made by me (Selbi). Everyone may use it, modify it etc. However, you ARE FORCED credit me when using it. Ok, you want the Jumpdash, but you have absolutly no ASM skils? No problem! Here I will give you my Jumpdash code, which has been updated a lot since the first release. Please don't argue about "hacks will get boring", because I'm pissed off with such stuff. However, here it is: 1. Open your sonic1.asm and go to Obj01_MdJump2:. This is the Routine for Sonic's move methods when he is in the Air. Because we want to branch to our (not yet existing) Jumpdash code, add this line after the label: bsr.w Sonic_JumpDash 2. Next go to Sonic_Roll:. After this Routine we have to place the Jumpdash code (don't ask why, just do it). I know it's just copy/paste, but most of you would rip off the code anyway, so I don't need a step-by-step guide only (scroll down a bit for a better explained split of that code). The Jumpdash code was 3 times rewritten and millions of times overwritten. But if you still find something, you think I can do better (code, comments etc.) please mention it here! Here it is: ; --------------------------------------------------------------------------- And here with explaination for every single code block: ; --------------------------------------------------------------------------- Sonic_JumpDash: move.b ($FFFFF603).w,d0 ; is ABC pressed? (part 1) tst.b ($FFFFFFEB).w ; was jumpdash flag set? move.w #$BC,d0 ; set jumpdash sound bclr #4,$22(a0) ; clear double jump flag move.w #$A00,d0 ; set normal jumpdash speed clr.w $12(a0) ; clear Y-velocity to move sonic directly down JD_End: 3. Ok, if you looked at the code, you've maybe sawn this flag $FFFFFFEB. To create a clearing code, we need to go to the routine Sonic_ResetOnFloor:L. This is the code when Sonic touches the ground again. Add this right after the label: clr.b ($FFFFFFEB).w ; clear jumpdash flag 4. Step 4 is not necesary but very highly recomended: Remove the Speedcap. Just trust me. You will see why if you compare the Jumpdash with and without Speedcap. Ok, now you should have a Jumpdash. It works fine, but it's a little bit lame. So you should add: Some Extra features We know, your current Jumpdash is very lame. So how about adding some extras? Here is the code for those things: Stop Sonic, up bouncing and Jumpdashing again after destroying an enemy or a monitor. 1. Interested? Ok, then open your sonic1.asm. We need to branch to a specific code if you destroyed a monitor with the Jumpdash. So go to loc_1AF1E: and before locret_1AF2E: add this: tst.b ($FFFFFFEB).w ; was the monitor destroyed with a jumpdash? 2. Now we have to do the same for Enemies. Go to loc_1AF9C: and replace it with this: loc_1AF9C: 3. And now we need to add this BounceJD: Routine (yes, it's of course not in the ASM yet). Go to loc_1AFDA: and add this Routine before it: ; ------------------------------------------------------------------------- And here with descriptions (even though it's nearly working the same as the main code): ; ------------------------------------------------------------------------- BounceJD: tst.b ($FFFFFFEB).w ; was jumpdash flag set? clr.w $10(a0) ; clear X-velocity (stop sonic) move.w #-$5F0,$12(a0) ; use -$5F0 for Y-velocity (move sonic upwards) BounceJD_End: After doing this, you should have a perfect Jumpdash. Give credits! Credits: Me (Selbi) for everything (Guide, Code) Note: The code also works for Sonic 2! However, you will have to modify it a bit at first. But it won't be be so hard though, I guess you can do that. =P (And if not, PM me) Version: v3.3 (Third rewritten Version of the original guide/code - Added the descriptions for the main code and the extra code - Did some epic fixcrap after 4 months - Overwritten since the release of v3.0: 4 times) Last update: 5th March 2010 This post has been edited by Selbi: Friday 5th March 2010, 9:56 pm -------------------- |
|
|
|
Sunday 22nd March 2009, 8:29 pm
Post
#2
|
|
Gee, this pose makes me look ol' school... Group: Member Posts: 423 Joined: 24th February 2008 From: Belfast Member No.: 317 Points: 10 |
I must say, your ASM is improving. Keep it up!
-------------------- ![]() ![]() Stuff to check out My website | My YouTube Profile | My 8bit Collective profile | bullshit.mp4 | My Worms Armageddon Replays |
|
|
|
Sunday 22nd March 2009, 9:09 pm
Post
#3
|
|
Group: Member Posts: 347 Joined: 12th September 2008 From: Germany, Cologne Member No.: 542 Points: 2 |
I must say, your ASM is improving. Keep it up! But somehow it makes me sad. It'll get overrated and yeah, hacks get more boring. -------------------- |
|
|
|
Sunday 22nd March 2009, 9:15 pm
Post
#4
|
|
"Which Groove, Do You Like?" Group: Member Posts: 305 Joined: 13th December 2008 From: Winnetka, California Member No.: 598 Points: 1 |
|
|
|
|
Sunday 22nd March 2009, 10:41 pm
Post
#5
|
|
I'm Legend Group: Member Posts: 286 Joined: 5th January 2009 From: Good 'ol USA. Member No.: 620 |
I must say, your ASM is improving. Keep it up! But somehow it makes me sad. It'll get overrated and yeah, hacks get more boring. My thought exactly... I'm so glad someone finally put this up. -------------------- You can send me a friend request at any time. |
|
|
|
Monday 23rd March 2009, 12:36 am
Post
#6
|
|
I'm Legend Group: Member Posts: 286 Joined: 5th January 2009 From: Good 'ol USA. Member No.: 620 |
Sorry for the double post but does this Jumpdash guide work with the Sonic 1 (Split and Text by Hivebrain) (ASM68K) disassembly?
-------------------- You can send me a friend request at any time. |
|
|
|
Monday 23rd March 2009, 3:24 pm
Post
#7
|
|
Group: Member Posts: 263 Joined: 3rd August 2008 From: Israel Member No.: 488 Points: 5 |
There are no things like ASM68K/SNASM68K limitions. Every guide works for every compiler.
-------------------- |
|
|
|
Monday 23rd March 2009, 3:56 pm
Post
#8
|
|
I can has super speed? Group: Member Posts: 103 Joined: 13th August 2007 Member No.: 60 Points: 2 |
This topic fails. With some digging, people would find I posted a superior code for jumpdash a week or so ago.
-------------------- |
|
|
|
Monday 23rd March 2009, 4:07 pm
Post
#9
|
|
Group: Member Posts: 263 Joined: 3rd August 2008 From: Israel Member No.: 488 Points: 5 |
Actually, I think the best version is mine. It just tests for double jump flag ($21, using sst rather than spending a ram byte) and if there is 1 in it, it ends. Then it will check for pressing C if I am, go to jumpdash. And then testing for double jump flag in jumpdash code (again) and then setting the x velocity, clearing the y velocity setting the flag and playing the sound. Test for left/right facing and negate the x speed. Not that difficult and doesn't take as much space as this code does. Also, put the button and flag tests at locret_134C2.
-------------------- |
|
|
|
Monday 23rd March 2009, 4:32 pm
Post
#10
|
|
I can has super speed? Group: Member Posts: 103 Joined: 13th August 2007 Member No.: 60 Points: 2 |
Sure, but mine checks for the underwater flag, and sets the jumpdash to be slower if you are underwater, thus being more accurate.
Edit: Removed, since the OP is making some step-by-step guide. This post has been edited by hitaxas: Saturday 28th March 2009, 7:15 pm -------------------- |
|
|
|
Monday 23rd March 2009, 6:27 pm
Post
#11
|
|
Keep on rockin' Group: Projects Supervisor Posts: 1,152 Joined: 20th July 2008 From: Lueneburg, Germany Member No.: 469 Points: 45 |
To all of you, read the Title!
This post has been edited by Selbi: Monday 23rd March 2009, 8:57 pm -------------------- |
|
|
|
Monday 23rd March 2009, 7:15 pm
Post
#12
|
|
Gee, this pose makes me look ol' school... Group: Member Posts: 423 Joined: 24th February 2008 From: Belfast Member No.: 317 Points: 10 |
He also has that over at RH, and there's no problem at all.
Shadowbeasts: Acknolege temporary symbols like + and @cont can only be used in ASM68k and incbin, and even are illegal commands in AS. Instead, use binclude and align 2 (Yes I do use the AS version thank you) -------------------- ![]() ![]() Stuff to check out My website | My YouTube Profile | My 8bit Collective profile | bullshit.mp4 | My Worms Armageddon Replays |
|
|
|
Monday 23rd March 2009, 9:00 pm
Post
#13
|
|
Keep on rockin' Group: Projects Supervisor Posts: 1,152 Joined: 20th July 2008 From: Lueneburg, Germany Member No.: 469 Points: 45 |
@hitaxas: Do you mind it when I use your underwater code in my Jumpdash (this guide)?
-------------------- |
|
|
|
Monday 23rd March 2009, 11:04 pm
Post
#14
|
|
A thrilling mystery! Group: Member Posts: 335 Joined: 10th August 2007 From: Pinellas Park, FL Member No.: 27 |
To all of you, read the Title! What? There's only one kind of jump dash--one that sends you in a direction at any given speed. How the hell can you make anything but a simple jump dash? -------------------- Check Out: [ Twitter | Facebook | FurAffinity | YouTube ] Sonic Retro | Daizenshuu EX | Something Awful | Hidden Palace | Jul |
|
|
|
Tuesday 24th March 2009, 1:00 am
Post
#15
|
|
FUCK Group: Member Posts: 33 Joined: 10th August 2007 Member No.: 29 |
|
|
|
|
Tuesday 24th March 2009, 1:38 am
Post
#16
|
|
I can has super speed? Group: Member Posts: 103 Joined: 13th August 2007 Member No.: 60 Points: 2 |
@hitaxas: Do you mind it when I use your underwater code in my Jumpdash (this guide)? Sure, whatever. -------------------- |
|
|
|
Tuesday 24th March 2009, 2:47 pm
Post
#17
|
|
Keep on rockin' Group: Projects Supervisor Posts: 1,152 Joined: 20th July 2008 From: Lueneburg, Germany Member No.: 469 Points: 45 |
To all of you, read the Title! What? There's only one kind of jump dash--one that sends you in a direction at any given speed. How the hell can you make anything but a simple jump dash? Partly agreed. But what I mean is, my Jumpdash @hitaxas: Do you mind it when I use your underwater code in my Jumpdash (this guide)? Sure, whatever. Ok, done. The code is way longer now. This post has been edited by Selbi: Tuesday 24th March 2009, 3:51 pm -------------------- |
|
|
|
Tuesday 24th March 2009, 8:16 pm
Post
#18
|
|
Keep on rockin' Group: Projects Supervisor Posts: 1,152 Joined: 20th July 2008 From: Lueneburg, Germany Member No.: 469 Points: 45 |
Sorry for double post, but I added a new feature: Bouncing up and jumpdashing again after destroying an enemy or a monitor.
-------------------- |
|
|
|
![]() ![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
|
Lo-Fi Version | Time is now: 3rd September 2010 - 4:58 am |



Sunday 22nd March 2009, 7:48 pm
















