Basic Questions and Answers Thread

Discussion in 'Discussion & Q&A' started by Malevolence, Jul 7, 2009.

  1. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    It may not be related, but in the first code, cmpi.w #0,($FFFFF614).w should not be necessary. subq will set the Z bit of the condition code register as soon as the result is equal to zero, and beq/bne will branch depending on that Z bit (set if =0, clear otherwise).
     
  2. Hanoch

    Hanoch Well-Known Member Member

    Joined:
    Aug 3, 2008
    Messages:
    312
    Location:
    Israel
    Also super_sonic_frame_count should be an even byte. And update_hud_rings is the same from sonic 1 and sonic 2.
     
  3. PsychoSk8r

    PsychoSk8r HighKnights Member

    Joined:
    Aug 9, 2007
    Messages:
    271
    Location:
    Birmingham, UK
    Yeah, the frame count is pointed at $FFFFFF98, and I'm aware the addresses are the same =P
     
  4. Hanoch

    Hanoch Well-Known Member Member

    Joined:
    Aug 3, 2008
    Messages:
    312
    Location:
    Israel
    Oh now I remember, you need to put a




    bsr.w Obj01_Super



    In obj01_control.
     
  5. PsychoSk8r

    PsychoSk8r HighKnights Member

    Joined:
    Aug 9, 2007
    Messages:
    271
    Location:
    Birmingham, UK
    CopyPasta, as I got it working a while back, but one slight thing:

     
  6. DanielHall

    DanielHall Well-Known Member Member

    Joined:
    Jan 18, 2010
    Messages:
    860
    Location:
    North Wales
    I don't think it has to be hex.


    change it to 50.
     
  7. PsychoSk8r

    PsychoSk8r HighKnights Member

    Joined:
    Aug 9, 2007
    Messages:
    271
    Location:
    Birmingham, UK
    Tried that before it was hex. =P
     
  8. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    blt (branch if less than) is a pretty complex function and checks only the V and N bits (overflow and negative) of the condition code register, you should try bls (lower or same) which only checks whether the z bit (=0) or the carry bit (carry or borrow bit actually, so result >255 or <0 ) is set. Can't swear it would work, but worth trying.


    (edit: 255 for a byte, of course.)


    edit2: btw, are you sure the code doesn't continue to the transformation code? I mean, either it jumps to it, or it simply continues processing the code which is under it, which could be your transformation code. Not sure I'm clear :/
     
    Last edited by a moderator: Sep 19, 2010
  9. PsychoSk8r

    PsychoSk8r HighKnights Member

    Joined:
    Aug 9, 2007
    Messages:
    271
    Location:
    Birmingham, UK
    Sorry for the late update, but this was solved a while back. For some reason, equates (pointed to the exact same address in RAM) seemed to do nothing, replacing them with the RAM address solved the problem.
     
  10. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    New question: How to move the HUD? I want to move the HUD to the left, when Sonic complete a act
     
  11. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    I am currently considering using the highlight & shadow options. I read many things about it, but there's one big question floating around that I can't find answered anywhere: what are the bits I have to set to choose between the default shadowing settings?


    I read all the tiles would have to be set up correctly in order to show the default brightness in game, but I couldn't find what needs to be done (ie the bits to set).


    Or is that setting not available on the tiles in s1?


    edit: btw, if the only way to use it is the high/low priority bit, that'd be terribly bad news but I could limit the effect to only one level and design it accordingly, I'd only like to know what's possible for sure before making plans.
     
    Last edited by a moderator: Sep 26, 2010
  12. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    415
    HUD is Obj21 and it has on-screen coordinate system. Moving it is rather easy - just decrease X-coordinate value (for moving to the left) which is 8(a0).
     
  13. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Looks like my previous question isn't really popular, well I'll work with the priority flag then, if there's no other way... :/


    Anyway, new question. Actually it's an old problem I've been trying to solve several times in the past months, and I never managed to find what is wrong.


    Does anyone know what can prevent Sonic from bouncing on the ground in s1?


    I'm trying (again) to finish the water shield, and it still won't bounce properly on the ground, when it's perfect on platforms and other solid objects. It looks like something processed after the "sonic_resetonfloor" routine will just cancel it, but only on the ground, and the other calls for that routine aren't responsible either.


    The bounce routine itself is almost a copy-paste of the jump routine, and since it works on platforms it can't be the problem.


    Any idea?


    Tell me if you need to see it.
     
  14. theocas

    theocas #! Member

    Joined:
    Apr 10, 2010
    Messages:
    375
    I'd be very interested in that too.

    That sounds real weird. How do you actually do the bouncing? Simply increasing the Y value or something? Go look at the original S3K code and maybe that'll help you.
     
  15. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Found the solution, it seems sonic_floor branches to sonic_resetonfloor too early, moving it to its next branches the way it's done in s3k solved the problem.
     
  16. DeoxysKyogre

    DeoxysKyogre No idea what to put here .-. Member

    Joined:
    Jan 31, 2009
    Messages:
    298
    A really small question: What's the art compression format of Socket's levels? I'm attempting to port one.
     
  17. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    I cracked this before, and wrote a decompressor for it.


    It uses a custom RLE format, with a 400 byte sized header for decopression, the format isn't the best with one of those reasons being the decompression algorithm in the game itself, could've been written far more better....
     
  18. Hitaxas

    Hitaxas Retro 80's themed Paladins Twich streamer Member

    Joined:
    Aug 13, 2007
    Messages:
    167
    I have been looking for a way to attach a character to a wall, much like Knuckles. However I cannot seem to find a way to lock to them to the wall without locking controls, leaving them stuck there. Can anybody show me how Knuckles does this and explain how it works? :p
     
  19. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    I absolutely don't know how it's done for Knuckles, but for my walljump in S1, I created a new "objectfall"-like routine (named it SonicFall, unexpected, isn't it?), and made that routine check whether the walljump flags were set or not, and modify the vertical speed accordingly.


    I know I also have another bit check somewhere to lock the player horizontally, but I can't remember where it is (nor how it's done actually ^^' ), though that wasn't difficult at all either.


    There may be other ways though, especially if you want the character to be able to climb (though further modifications of that same routine could probably allow it easily, you'd only need to check whether up and down are being pressed or not).
     
  20. Hitaxas

    Hitaxas Retro 80's themed Paladins Twich streamer Member

    Joined:
    Aug 13, 2007
    Messages:
    167

    Well, through further testing, I am able to lock him in place using



    Code:
    move.b	#1,obj_control&#40;a0&#41;

    However, this locks him in place, disallowing any further control.


    How would I be able to clear this without making him simply fall off the wall? =/


    I am guessing checking for button presses before the lock, and if a button is pressed, clear obj_control(a1)? Bah, I'll try it now.


    Edit: Still no luck.
     
    Last edited by a moderator: Nov 14, 2010