Basic Questions and Answers Thread

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

  1. Animemaster

    Animemaster Lets get to work! Member

    Joined:
    Mar 20, 2009
    Messages:
    1,229
    Location:
    UK
    Try this:




    Obj21_Move:


    addq.w #$01,$08(a0)


    cmpi.w #$XX,$08(a0) ; has item rechead the value XX?


    bne.s KeepMoving ; if not, branch


    addq.b #2,$24(a0) ; this will go the to next rouine in order


    jmp DisplaySprite ; Display object


    KeepMoving:


    rts



    Also looking at it, my mistake it should of been move.w not move.b so that maybe why its not stopping so I apologise for that.
     
    Last edited by a moderator: Apr 29, 2012
  2. Guest

    Yayz it worked! Thanks so much for this, though I didn't want you to resort into actually giving this out to the public but i suppose it's not so bad (at least thats what i think). anywho again thanks for the help as always MJ, and same to you Animemaster.
     
    Last edited: Apr 29, 2012
  3. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    The important thing is that you understand WHY it works, and that you use what you learn from this to help you work around other (similar) issues, you may very well not be as lucky next time to recieve help as great as this, so I strongly suggest making alterations, testing them to see the effects, and learning exactly how it does what it does.
     
    Last edited by a moderator: Apr 29, 2012
  4. M.N.K.

    M.N.K. In the River of Darkness... Member

    Joined:
    Feb 22, 2009
    Messages:
    506
    Location:
    Earth...
    Oh I will alright, count on it. plus this can help me out more by experimenting with it and seeing how it works as you said and modify it. also my opinion but if I were you, I would remove that code. just saying because then everyone will see it (as if anyone didn't see it already) and then overuse it in their hacks. again just my own little opinion here.
     
    Last edited by a moderator: Apr 29, 2012
  5. DarkLeach

    DarkLeach Well-Known Member Member

    Joined:
    Jul 3, 2011
    Messages:
    193
    Location:
    In the middle of desert heat
    I'm sure this is minor so I'll ask here. As well all know in Sonic 1 "Sound" E2 makes the music go faster, but this is something I saw (well heard rather) . Some tracks aren't effected by E2 at all! (The 1-Up Music, Game Over, The Credits, and a few of my S&K ported tracks (because that's all I could figure out how to do) did not speed up at all. Furthermore one track actually SLOWED down (My ported S&K Mini-boss Music), and because one of the things my boost does is that it speeds up the music. I would like to fix this (my ported tracks not the existing music), and any help will be GREATLY appreciated! :D
     
    Last edited by a moderator: Apr 29, 2012
  6. TheJeli

    TheJeli Umm... Member

    Joined:
    Jun 20, 2011
    Messages:
    245
    Location:
    West London
    Im not an expert but I remember reading somewhere that you need the tempo as a certain value, can't remember what that is though, try looking at the other songs.


    My Question:


    What is the easiest way to port a background from, say, Sonic CD in my level?


    I know its a vague question but I suck at SonED2.


    EDIT: Spelling
     
    Last edited by a moderator: May 28, 2012
  7. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Does anybody know what makes the whole "sonic has passed" object move at the beginning of the cutscene in SBz2?


    I just noticed only one of my lines was moving (everything else stays there), and I can't find what triggers it. :/


    Or maybe I'm just totally rusted...


    Haha forget this, I find it, since I have one less object in my title card, it wasn't checking the right address for the end of the "total" object.
     
    Last edited by a moderator: May 29, 2012
  8. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Routine "Obj3A_ChkBonus:"



    Code:
            cmpi.w    #$501,($FFFFFE10).w
    
            bne.s    Obj3A_SetDelay
    
            addq.b    #4,$24(a0)

    If the level is Scrap Brain Zone Act 2, it'll increase the routine counter of the object by an additional 4 (i.e. advancing 6), instead of running "Obj3A_Wait" then "Obj3A_NextLevel", it'll run "Obj3A_Wait" then "Obj3A_ChkPos2".


    Edit: inb4 me...
     
    Last edited by a moderator: May 29, 2012
  9. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Thank you. :)


    If I understood correctly, that happens only in the "total" object, the game checks if that one has reached its final state in all other title card objects, so the check at the beginning of loc_C61A has to point to the "total" object, which is what was wrong.
     
  10. Psycho RFG

    Psycho RFG Well-Known Member Member

    Joined:
    Feb 22, 2011
    Messages:
    234
    Good to see you fixed it SpirituInsanum! Now I will ask for my bug in that specific part of the game too. I have coded the electrostatic shield to be removed when Sonic goes into the water (and a white flash will appear on the screen), and, by other way, my shields are keept beetween stages. Here is the bug: If I end SBz2 with the electrostatic shield, when Robotnik makes Sonic to fall down to the next stage, I can see the white flash and, of course, I start SBz3 without that shield... What could I try to fix this?


    Other note is that I have applied the vladikcomper's fix for the level transitions that makes load the new level later and not as soon as it's done in the original game...
     
  11. Bluesfire

    Bluesfire Will Hack For Food. Member

    Joined:
    May 29, 2012
    Messages:
    23
    Location:
    Arizona.
    So I am using SonLVL to edit Sonic 1. After I edit the level, the title screen looks..weird. Any idea of why, and how to fix it? Pic below.


    EDIT: My apologies, it was due to an incorrectly placed Chunk.Fixed now. I am new here, so I don't know if I can delete my own posts, but if not please delete this.

    /monthly_06_2012/post-1979-0-14769400-1338513903_thumb.png
     

    Attached Files:

    Last edited by a moderator: Jun 1, 2012
  12. vladikcomper

    vladikcomper Well-Known Member Member

    Joined:
    Dec 2, 2009
    Messages:
    415
    It happens because you've changed Sonic's start position in GHZ1. Restore at least Y-coordinate to the original and the bug will go.


    C/P from my old post on Retro:


    "Title screen uses layout engine like all normal levels do, it calls a subroutine that loads level stuff for GHZ1, including Sonic's start pos etc. It also calls level deformation subroutines to scroll BG with deformation like in normal level. Those routines work with camera, which is affected by Sonic's coordinates, that's why camera is a bit bottomer than it supposed to be, so deformation routines scroll BG and FG upper. But sprites on the title screen have on-screen coordinates system, I.e. their coordinates are not depending on camera positions, so they stay at their places."


    There should be a fix for this though, but I can't check it out right now.
     
  13. Bluesfire

    Bluesfire Will Hack For Food. Member

    Joined:
    May 29, 2012
    Messages:
    23
    Location:
    Arizona.
    Hey! I am modifying Sonic The Hedgehog's GHZ. I am making an "ice" pallet, but have run into an issue. As it seems, the rings share the same pallet as the yellow flowers. So I either have to have yellow rings, or blue flowers. Is there anyway I can separate the ring from that pallet, and instead attach it to the HUD's or something like that? Thanks!


    EDIT: I am also trying to make the Eggman Monitor work, I found it's line of code,


    Obj2E_ChkEggman: ; XREF: Obj2E_Move


    addq.b #2,$24(a0)


    move.w #29,$1E(a0)


    move.b $1C(a0),d0


    cmpi.b #1,d0 ; does monitor contain Eggman?


    bne.s Obj2E_ChkSonic


    rts ; Eggman monitor does nothing


    How do I change that "Eggman Monitor Does Nothing"? I want to make it hurt sonic like if he hit a badnik or landed on spikes.
     
    Last edited by a moderator: Jun 1, 2012
  14. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    The HUD has one yellow on Sonic's palette line, the rings need three yellows.


    You could try recoloring the flowers in some tile editor, but you may not have any colors that match what you want in that palette.
     
  15. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England


    In Sonic 2, it's simply:



    robotnik_monitor:
    addq.w #1,(a2)


    bra.w Touch_ChkHurt2



    Maybe that will help? Just replace this code with another monitor code that you're not going to use. "Touch_ChkHurt2" is more than likely named different in Sonic 1 though.


    EDIT: Spellings
     
    Last edited by a moderator: Jun 1, 2012
  16. Bluesfire

    Bluesfire Will Hack For Food. Member

    Joined:
    May 29, 2012
    Messages:
    23
    Location:
    Arizona.
    I added that code, Now the game won't boot. I think I need a different code, Maybe if I added something from an object that does hurt Sonic?


    I'm sorry, I'm not quite sure what you mean. Do you mean to replace some code in the Robotnik Monitor object (Code I posted), Or find a monitor I am not using in Sonic 1?


    EDIT: Here is the code for hurting Sonic by means of spikes. Maybe I could use this to my advantage?


    Obj36_Hurt: ; XREF: Obj36_SideWays; Obj36_Upright


    tst.b ($FFFFFE2D).w ; is Sonic invincible?


    bne.s Obj36_Display ; if yes, branch


    move.l a0,-(sp)


    movea.l a0,a2


    lea ($FFFFD000).w,a0


    cmpi.b #4,$24(a0)


    bcc.s loc_CF20


    move.l $C(a0),d3


    move.w $12(a0),d0


    ext.l d0


    asl.l #8,d0


    sub.l d0,d3


    move.l d3,$C(a0)


    jsr HurtSonic


    Edit: Scrolling through the ASM, I found an instance "Obj2E_NoMusic" and it's contents are blank. Can I tell the Eggman object to ridirect there and put a code that would hurt Sonic?
     
    Last edited by a moderator: Jun 1, 2012
  17. Tongara

    Tongara Well-Known Member Exiled

    Joined:
    Feb 10, 2009
    Messages:
    353
    Location:
    Birmingham, UK
    vladikcomper is 100% right. It is de to Sonic being moved from his regular start position in Green Hill act 1. They made the title screen use GHZ's properties, which also includes Sonic on the title... they obviously never thought that people would go ahead and start hacking their games. :p
     
    Last edited by a moderator: Jun 1, 2012
  18. Kensou

    Kensou Well-Known Member Member

    Joined:
    Aug 19, 2010
    Messages:
    59
    I didn't experimented this because I keep the Sonic position from the original but shouldn't this be fixed with the mappings of Sonic in the logo?
     
  19. Kensou

    Kensou Well-Known Member Member

    Joined:
    Aug 19, 2010
    Messages:
    59
    No... if I remember well, that routine have an rts to terminate the invincibillity monitor routine without changing music when you are fighting with a boss... There is an Eggman monitor routine that is empty with an rts, that is the place.


    You are asking even without testing your own thoughts and I think that is not the way, try your own stuff and study how asm works before asking for people to make the code for you.
     
  20. Bluesfire

    Bluesfire Will Hack For Food. Member

    Joined:
    May 29, 2012
    Messages:
    23
    Location:
    Arizona.
    MainMemory, I can't find a tile editor tat can edit the flower. SonLVL doesn't show the flower in it's tile list, and I don't have mappings for it to load into SonMapED. Could you recommend a tile editor?


    Edit: I got my robotnik monitor working, and added a spindash. :)
     
    Last edited by a moderator: Jun 1, 2012