Super Sonic in Sonic 1. . . Again

Discussion in 'Discussion and Q&A Archive' started by Roxurface, Oct 19, 2014.

Thread Status:
Not open for further replies.
  1. Roxurface

    Roxurface Well-Known Member Member

    Joined:
    Oct 5, 2014
    Messages:
    69
    I was really hoping I could get this done all by me-self, but it seems I've hit a brick wall.  I need some help with my port of Super Sonic.

    I've used a lot of information circulating with other question topics of the same subject, and this is the result: (using the current Github Sonic 1 Disassem.(This is the "Sonic JumpHeight.ASM" File))

    CODE REMOVED

    Most of the work was getting the thing to assemble. I finally got rid of all the errors and I got a rom to assemble, but nothing happens. (And by nothing happens I mean it's as if the code wasn't there--sonic doesn't even attempt to transform in any way)  It is worth noting that I set the Emerald requirement to 1 for testing reasons. 

    Thanks in advance for the help- this is probably not a question you guys have liked answering a thousand times over.  And, since this is something you guys don't want copypasta-ers knowing how to do, I'll take this code out once my problem is fixed.

    EDIT: Thanks for all the help, but I've given up for now. Perhaps when I'm better at ASM I'll do it in my next hack.
     
    Last edited by a moderator: Nov 21, 2014
  2. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    Code:
    		tst.b	$12(a0)		; is Sonic exactly at the height of his jump?
    		beq.s	Sonic_CheckGoSuper	; if yes, test for turning into Super Sonic
    
    Move this part of code under the "locret_134C2:".
     
    Last edited by a moderator: Oct 19, 2014
  3. Roxurface

    Roxurface Well-Known Member Member

    Joined:
    Oct 5, 2014
    Messages:
    69
    Ok, thanks dude, this is good, he now successfully transforms. . .

    He performs the transformation animation (I set as the unused get-emerald super-mario-jump-looking animation), His speed and acceleration increase and he becomes invincible.  The music does not change and the invincibility stars do not show up as I intended.  Sonic's Ring count does not go down. After a short time, the music resets, and sonic is no longer invincible, but he retains his speed. (EDIT: Also, after I complete an act, I can no longer go super.  I believe I can fix this myself by adding Super flag reset when sonic passes the goal . . . )

    dafuq?
     
    Last edited by a moderator: Oct 19, 2014
  4. DanielHall

    DanielHall Well-Known Member Member

    Joined:
    Jan 18, 2010
    Messages:
    860
    Location:
    North Wales
    Assuming you haven't changed anything in Sonic_JumpHeight, then the first two lines need to be moved down to locret_134C2. May I suggest that if you want to test it, that you comment out the emerald check? It'll save you having to go through the Special Stage every time you want to make a change.

    Secondly, just to check, did you add Sonic_Super to loc_12C7E, like:




        bsr.s    Sonic_Display
        bsr.w    Sonic_Super
        bsr.w    Sonic_RecordPos
        bsr.w    Sonic_Water



    The ring-decrement code won't run otherwise.

    EDIT: Beaten to the punch. Disregard.
     
    Last edited by a moderator: Oct 19, 2014
  5. Roxurface

    Roxurface Well-Known Member Member

    Joined:
    Oct 5, 2014
    Messages:
    69
    Where would loc_12C7E be located in the GitHub Disassem? Most subroutines are split into seperate files, make it hard to find unlabeled stuff like that.

    EDIT: Nevermind, I'm a dummy and it's in the main sonic.asm file.

    EDIT2: After adding in bsr.w    Sonic_Super, I get an error saying branch is out of range.
     
    Last edited by a moderator: Oct 19, 2014
  6. DumbLemon

    DumbLemon am back Member

    Joined:
    Aug 19, 2014
    Messages:
    115
    Use the find in files feature to find it.

    Edit: It's in line 6809 of sonic.asm.
     
    Last edited by a moderator: Oct 19, 2014
  7. DanielHall

    DanielHall Well-Known Member Member

    Joined:
    Jan 18, 2010
    Messages:
    860
    Location:
    North Wales
    It resets because of this:

    move.w    #$4B0,(v_player+$32).w

    That's an invincibility timer that's subtracted every frame if Sonic is invincible, which he is in this instance. The music and invincibility is removed when the counter hits 0. Remove that line.

    If the bsr.w is out of range, use jsr.
     
    Last edited by a moderator: Oct 19, 2014
  8. Roxurface

    Roxurface Well-Known Member Member

    Joined:
    Oct 5, 2014
    Messages:
    69
    The code pretty much works correctly! Thanks everyone. All I need is a test for Super on the invincibility monitor code and I should be good.


    There's only one problem. . . Sonic looks the same.  How do I even begin importing the pallette, the art. . . ?
     
  9. DanielHall

    DanielHall Well-Known Member Member

    Joined:
    Jan 18, 2010
    Messages:
    860
    Location:
    North Wales
    Last edited by a moderator: Oct 19, 2014
  10. Roxurface

    Roxurface Well-Known Member Member

    Joined:
    Oct 5, 2014
    Messages:
    69
    Even with those programs, I'm not sure how I would go about getting the art to load in the code.  This is where I fall short in ASM, you see.
     
  11. Pokepunch

    Pokepunch That guy who posts on occasion Member

    Joined:
    Aug 7, 2009
    Messages:
    270
    Location:
    UK
    See how Sonic 2 does it. Hint: Search for "Sonic_Animate". It's in the top few lines, you will also have to add stuff further down. Just look for places in the Sonic_Animate routine where it tests for the Super Sonic Flag.
     
    Last edited by a moderator: Oct 19, 2014
  12. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    As for the art itself - that's how I did it in my hack. I know that this isn't the best option, but it works for me.

    So, you need to open SonMapEd, set Game format to Sonic 2, then import S2' Sonic art, mappings and DPLC. When all are loaded, change game format to Sonic 1 (for palette) and export the SS frames. Tip: Set a transparent color other than black.

    Next, open S1's Sonic art, mappings and DPLC and use method from this guide for each frame. Note that there can be identical tiles in frames, so if you notice them - use them instead of creting new ones, for space save. Tip: Use the same mappings as in S2, it will help with optimisation.

    After this, save art, mappings and DPLC. Sorry if I explained bad, but I suck at writing guides :/
     
  13. Roxurface

    Roxurface Well-Known Member Member

    Joined:
    Oct 5, 2014
    Messages:
    69
    OK, let me start from the beginning.  How would I go about creating a "Cycling" pallette for the transformation, and will the code I have just run it if I name is correctly and include it?

    Forgive me for my lack of knowledge.  I didn't think I could make it this far on Super Sonic, so now that I'm fully invested and put a few hours of work into it I don't want to turn back, even though this section of the hacking is almost completely out of my knowledge.
     
  14. Painto

    Painto Arthurus Paintus Erinaceus Member

    Joined:
    Mar 24, 2014
    Messages:
    321
    Location:
    Lublin, Poland
    Search for PalCycle_SuperSonic: in Sonic 2 disassembly.
     
Thread Status:
Not open for further replies.