ASM to Sega Genesis Platform

Would you like to react to this message? Create an account in a few clicks or log in to continue.
ASM to Sega Genesis Platform

All about assembly programming in the Sega Genesis console.


    Tutorial: Rings Required to Preform Action

    SuperSonicX
    SuperSonicX

    Mensagens : 40
    Data de inscrição : 2011-06-30
    Current Project : The Gamer's Smorgas-Board

    Tutorial: Rings Required to Preform Action Empty Tutorial: Rings Required to Preform Action

    Post  SuperSonicX Mon Jul 11, 2011 2:47 pm

    This is a tutorial to add ring requirements to certain actions. Here is a standard check for rings:
    Code:
    cmpi.w   #20,($FFFFFE20).w ; do you have   at least 20 rings?
    bcc.s   Code_Okay   ; if yes, branch
    Notice the code "cpmi.w #20($FFFFFE20).w". This calls to check your rings and see how many you have. bcc.s Code_Okay says to branch if you have enough. For example, put this at the beginning of any Sonic Routine (I'm showing the spindash here.) replacing the X with your number of rings.
    Code:
            cmpi.w   #X,($FFFFFE20).w ; do you have   at least X rings?
            bcc.s   SonicSD_Okay   ; if yes, branch
            rts
    SonicSD_Okay:
    This will require X amount of rings to do the spindash. If you don't, the code will end without doing anything.

    Subtracting Rings if has required amount:

    Look at this code:
    Code:

          sub.w   #20,($FFFFFE20).w ; minus 20 rings
          move.b   #$80,($FFFFFE1D).w   ; update ring counter
    This says to subtract rings. So add this at the beginning of the SonicSD_Okay code you just added, changing X to the number you used above.
    Code:

          sub.w   #X,($FFFFFE20).w ; minus X rings
          move.b   #$80,($FFFFFE1D).w   ; update ring counter
    So this will take away X rings when you attempt a spindash with more than X rings.


    This is it for the Tutorial: No credit required.
    calebjhuhlu
    calebjhuhlu

    Mensagens : 55
    Data de inscrição : 2011-06-16

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  calebjhuhlu Wed Jul 20, 2011 7:34 am

    Thanks! But when i applied it, when i got to five rings (i edited the 20 to 5 rings, Using Selbi's Jumpdash Code) It Started Over, back at 0 rings. Can you help me fix that?
    SuperSonicX
    SuperSonicX

    Mensagens : 40
    Data de inscrição : 2011-06-30
    Current Project : The Gamer's Smorgas-Board

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  SuperSonicX Thu Jul 21, 2011 12:02 pm

    calebjhuhlu wrote:Thanks! But when i applied it, when i got to five rings (i edited the 20 to 5 rings, Using Selbi's Jumpdash Code) It Started Over, back at 0 rings. Can you help me fix that?

    If you want it not to subtract rings, revove that block of code that tells is to subtract 5 rings and update the ring counter. Also make sure both 20's were changed to 5.
    calebjhuhlu
    calebjhuhlu

    Mensagens : 55
    Data de inscrição : 2011-06-16

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  calebjhuhlu Thu Jul 21, 2011 12:53 pm

    not sure what you mean, but i found this: The first part works fine. it wont jumpdash unless i have 5 rings. Then, i applied the second part (minus 5 rings) every time i got 5 rings (without jumpdashing) it went back to zero. it stayed the same i added the last part of the code.
    SuperSonicX
    SuperSonicX

    Mensagens : 40
    Data de inscrição : 2011-06-30
    Current Project : The Gamer's Smorgas-Board

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  SuperSonicX Thu Jul 21, 2011 4:00 pm

    calebjhuhlu wrote:not sure what you mean, but i found this: The first part works fine. it wont jumpdash unless i have 5 rings. Then, i applied the second part (minus 5 rings) every time i got 5 rings (without jumpdashing) it went back to zero. it stayed the same i added the last part of the code.
    Move that code to subtract 5 rings right after the line
    that plays the jumpdash sound. It should work then.
    calebjhuhlu
    calebjhuhlu

    Mensagens : 55
    Data de inscrição : 2011-06-16

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  calebjhuhlu Thu Jul 21, 2011 6:55 pm

    Thank you! Its working perfectly now!
    drumberboy1122
    drumberboy1122

    Mensagens : 20
    Data de inscrição : 2012-05-20

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  drumberboy1122 Mon May 21, 2012 8:59 am

    awesome tutorial but where it says code okay, how do you replace that? Do you leave the okay and just put in the routine?
    Green Snake
    Green Snake

    Mensagens : 2185
    Data de inscrição : 2012-04-07
    Localização : I do not even know
    Current Project : nope

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  Green Snake Tue May 22, 2012 5:07 am

    drumberboy1122 wrote:awesome tutorial but where it says code okay, how do you replace that? Do you leave the okay and just put in the routine?

    Rename ''SonicSD_okay'' To name fitting with your things, like:
    [code]Objxx:
    ; do you have at least x ring?
    ; if yes, branch to Objxx_okay
    Objxx:
    ;your code here
    drumberboy1122
    drumberboy1122

    Mensagens : 20
    Data de inscrição : 2012-05-20

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  drumberboy1122 Tue May 22, 2012 1:03 pm

    Green Snake wrote:
    drumberboy1122 wrote:awesome tutorial but where it says code okay, how do you replace that? Do you leave the okay and just put in the routine?

    Rename ''SonicSD_okay'' To name fitting with your things, like:
    [code]Objxx:
    ; do you have at least x ring?
    ; if yes, branch to Objxx_okay
    Objxx:
    ;your code here

    So if I was trying to add this to the double jump move and I named the double jump sub routine to Sonic_DoubleJump, Would I just replace SonicSD_okay with Sonic_DoubleJump?
    Green Snake
    Green Snake

    Mensagens : 2185
    Data de inscrição : 2012-04-07
    Localização : I do not even know
    Current Project : nope

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  Green Snake Wed May 23, 2012 3:05 am

    drumberboy1122 wrote:

    So if I was trying to add this to the double jump move and I named the double jump sub routine to Sonic_DoubleJump, Would I just replace SonicSD_okay with Sonic_DoubleJump?

    No, Sonic_DJ_okay.
    drumberboy1122
    drumberboy1122

    Mensagens : 20
    Data de inscrição : 2012-05-20

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  drumberboy1122 Wed May 23, 2012 12:45 pm

    Green Snake wrote:
    drumberboy1122 wrote:

    So if I was trying to add this to the double jump move and I named the double jump sub routine to Sonic_DoubleJump, Would I just replace SonicSD_okay with Sonic_DoubleJump?

    No, Sonic_DJ_okay.

    And do I keep my subroutine name the same?
    Green Snake
    Green Snake

    Mensagens : 2185
    Data de inscrição : 2012-04-07
    Localização : I do not even know
    Current Project : nope

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  Green Snake Thu May 24, 2012 2:06 am

    drumberboy1122 wrote:
    And do I keep my subroutine name the same?
    On the main routine where you put your check on, could be Sonic_DoubleJump.
    drumberboy1122
    drumberboy1122

    Mensagens : 20
    Data de inscrição : 2012-05-20

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  drumberboy1122 Thu May 24, 2012 4:55 am

    Green Snake wrote:
    drumberboy1122 wrote:
    And do I keep my subroutine name the same?
    On the main routine where you put your check on, could be Sonic_DoubleJump.

    So it would look like this

    cmpi.w #X,($FFFFFE20).w ; do you have at least X rings?
    bcc.s SonicDJ_Okay ; if yes, branch
    rts
    Sonic_DoubleJump:
    Green Snake
    Green Snake

    Mensagens : 2185
    Data de inscrição : 2012-04-07
    Localização : I do not even know
    Current Project : nope

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  Green Snake Fri May 25, 2012 5:25 am

    drumberboy1122 wrote:
    So it would look like this

    cmpi.w #X,($FFFFFE20).w ; do you have at least X rings?
    bcc.s SonicDJ_Okay ; if yes, branch
    rts
    Sonic_DoubleJump:

    You are not understanding this at all.
    it would look like:

    Sonic_DoubleJump:
    cmpi.w #X,($FFFFFE20).w ; do you have at least X rings?
    bcc.s SonicDJ_Okay ; if yes, branch
    rts
    SonicDJ_Okay:
    drumberboy1122
    drumberboy1122

    Mensagens : 20
    Data de inscrição : 2012-05-20

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  drumberboy1122 Fri May 25, 2012 12:27 pm

    Green Snake wrote:
    drumberboy1122 wrote:
    So it would look like this

    cmpi.w #X,($FFFFFE20).w ; do you have at least X rings?
    bcc.s SonicDJ_Okay ; if yes, branch
    rts
    Sonic_DoubleJump:

    You are not understanding this at all.
    it would look like:

    Sonic_DoubleJump:
    cmpi.w #X,($FFFFFE20).w ; do you have at least X rings?
    bcc.s SonicDJ_Okay ; if yes, branch
    rts
    SonicDJ_Okay:

    Ok I am so sorry. I thought you put it above the subroutine. I am really sorry.
    avatar
    josephAndSonicTeam

    Mensagens : 7
    Data de inscrição : 2013-08-02

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  josephAndSonicTeam Fri Aug 02, 2013 8:43 am

    clown clown clown 
    hacker___
    hacker___

    Mensagens : 1974
    Data de inscrição : 2013-05-06
    Localização : 41.383863, 108.866009
    Current Project : Breathing nitrogen

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  hacker___ Thu Aug 08, 2013 7:59 am

    josephAndSonicTeam wrote:clown clown clown 

    XD
    SESIN KOLIN
    SESIN KOLIN

    Mensagens : 108
    Data de inscrição : 2013-07-30
    Localização : yes
    Current Project : Sonic the Hedgehog 2 Loco Remasterde SHC2014 coming soon betatestigova

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  SESIN KOLIN Thu Aug 15, 2013 9:14 pm

    hacker___ wrote:
    josephAndSonicTeam wrote:clown clown clown 
    XD
    Yes.
    hacker___
    hacker___

    Mensagens : 1974
    Data de inscrição : 2013-05-06
    Localização : 41.383863, 108.866009
    Current Project : Breathing nitrogen

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  hacker___ Thu Aug 15, 2013 9:22 pm

    SESIN KOLIN wrote:
    hacker___ wrote:
    josephAndSonicTeam wrote:clown clown clown 
    XD
    Yes.
    Tutorial: Rings Required to Preform Action 1857694-803205_holy_facepalm_super
    SESIN KOLIN
    SESIN KOLIN

    Mensagens : 108
    Data de inscrição : 2013-07-30
    Localização : yes
    Current Project : Sonic the Hedgehog 2 Loco Remasterde SHC2014 coming soon betatestigova

    Tutorial: Rings Required to Preform Action Empty lol?

    Post  SESIN KOLIN Thu Aug 15, 2013 9:24 pm

    hacker___ wrote:
    SESIN KOLIN wrote:
    hacker___ wrote:
    josephAndSonicTeam wrote:clown clown clown 
    XD
    Yes.
    Tutorial: Rings Required to Preform Action 1857694-803205_holy_facepalm_super
    wat rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer
    hacker___
    hacker___

    Mensagens : 1974
    Data de inscrição : 2013-05-06
    Localização : 41.383863, 108.866009
    Current Project : Breathing nitrogen

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  hacker___ Thu Aug 15, 2013 9:25 pm

    SESIN KOLIN wrote:
    hacker___ wrote:
    SESIN KOLIN wrote:
    hacker___ wrote:
    josephAndSonicTeam wrote:clown clown clown 
    XD
    Yes.
    Tutorial: Rings Required to Preform Action 1857694-803205_holy_facepalm_super
    wat rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer
    -_-''
    avatar
    JoshDP

    Mensagens : 1682
    Data de inscrição : 2014-10-05

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  JoshDP Tue Jul 19, 2016 2:15 pm

    hacker___ wrote:
    SESIN KOLIN wrote:
    hacker___ wrote:
    SESIN KOLIN wrote:
    hacker___ wrote:
    josephAndSonicTeam wrote:clown clown clown 
    XD
    Yes.
    Tutorial: Rings Required to Preform Action 1857694-803205_holy_facepalm_super
    wat rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer rendeer
    -_-''
    6" penis
    Jdpense
    Jdpense

    Mensagens : 2355
    Data de inscrição : 2014-08-21

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  Jdpense Thu Dec 27, 2018 10:30 am

    Just an annual year bump! Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy Very Happy bounce bounce bounce bounce bounce affraid Basketball cheers bom drunken Basketball cheers bom drunken cherry sunny Sleep

    Sponsored content

    Tutorial: Rings Required to Preform Action Empty Re: Tutorial: Rings Required to Preform Action

    Post  Sponsored content


      Current date/time is Tue Apr 13, 2021 1:16 am