ASM to Sega Genesis Platform

All about assembly programming in the Sega Genesis console.


    Homing Attack in Sonic 1 - Step 7 - Sound and Uncontrolled Jump

    Share

    OuricoDoido
    Admin

    Mensagens : 46
    Data de inscrição : 2011-01-09
    Current Project : Sonic Open Source Project

    Homing Attack in Sonic 1 - Step 7 - Sound and Uncontrolled Jump

    Post  OuricoDoido on Tue Jan 25, 2011 7:43 pm

    How to: Add a Sound

    below these lines:
    Code:
    HA_calcdistance2:      ; continuation of distance calculator
          muls.w  d1,d1   ; horizontal distance squared
          muls.w  d2,d2   ; vertical distance squared
          add.l  d2,d1   ; add vertical distance to horizontal distance
          cmp.l  #16384,d1      ; is distance of Sonic, greater than or equal 128 pixels of the object? (128^2=16384 // $80^2=$4000)
          bge.s  HA_nextobject   ; if yes, don't execute the homing attack
    add this:
    Code:
          move.w   #$BC,d0            ; set homing attack sound
          jsr   (PlaySound).l         ; play homing attack sound
    BC is the sound will be played.


    Jump Uncontrolled

    When rolling, if you make a jump, your jump will be "uncontrolled". This condition is bad after the Homing Attack, because you can't move the Sonic after the bounce.

    To correct this, go below these lines:
    Code:
          move.w   #$BC,d0            ; set homing attack sound
          jsr   (PlaySound).l         ; play homing attack sound
    and add this:
    Code:
          bclr   #4,$22(a0)         ; clear "uncontrolled jump" flag
    avatar
    calebjhuhlu

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

    Re: Homing Attack in Sonic 1 - Step 7 - Sound and Uncontrolled Jump

    Post  calebjhuhlu on Mon Jul 11, 2011 7:54 am

    Can i use this code (all steps) in sonic 2 as well?
    avatar
    TheRetroGuy

    Mensagens : 21
    Data de inscrição : 2012-10-21

    Re: Homing Attack in Sonic 1 - Step 7 - Sound and Uncontrolled Jump

    Post  TheRetroGuy on Sun Nov 25, 2012 3:04 pm

    Yes.
    avatar
    hacker___

    Mensagens : 1967
    Data de inscrição : 2013-05-06
    Localização : Antarctica
    Current Project : Sonic Random Hax

    Re: Homing Attack in Sonic 1 - Step 7 - Sound and Uncontrolled Jump

    Post  hacker___ on Sun May 12, 2013 7:59 pm

    .
    avatar
    Green Snake

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

    [flash(9999,9999)]http://www.youtube.com/v/qVCFV7jT9ho[/flash][flash(9999,9999)]http://www.youtube.com/v/qVCFV7jT9ho[/flash][flash(9999,9999)]http://www.youtube.com/v/qVCFV7jT9ho[/flash][flash(9999,9999)]http://www.youtube.com/v/qVCFV7jT9ho[/flash][flash(

    Post  Green Snake on Sun May 19, 2013 11:29 am

    v

    Sponsored content

    Re: Homing Attack in Sonic 1 - Step 7 - Sound and Uncontrolled Jump

    Post  Sponsored content


      Current date/time is Wed Aug 23, 2017 12:10 am