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.


    Homing Attack - Variant 4 - Intercept Theorem Method

    avatar
    OuricoDoido
    Admin

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

    Homing Attack - Variant 4 - Intercept Theorem Method  Empty Homing Attack - Variant 4 - Intercept Theorem Method

    Post  OuricoDoido Thu Feb 10, 2011 10:17 pm

    In this method we will use the Intercept theorem to execute the Homing Attack. For more information about the Intercept theorem visit: http://en.wikipedia.org/wiki/Intercept_theorem#Similarity_and_similar_Triangles

    This method don't use CalcAngle and CalcSine, and the effect is exactly the same.

    Homing Attack - Variant 4 - Intercept Theorem Method  Intercepttheoremmethod

    If you want download the compiled ROM, download here: http://goo.gl/lOJLM

    To apply this, you need first apply the Homing Attack in Sonic 1.
    And implement in your code the square root subroutine.


    In HA_Move, modify this:
    Code:
          jsr      (CalcAngle).l   ; calculates the angle
          jsr      (CalcSine).l   ; calculates the sine and the cosine
          muls.w  #$C,d1         ; multiply cosine by $C
          move.w  d1,$10(a0)      ; move d1 to X-velocity
          muls.w  #$C,d0         ; multiply sine by $C
          move.w  d0,$12(a0)      ; move d0 to Y-velocity
    To this:
    Code:
          move.w  d1,d0   ; copy x-distance to d0
          move.w  d2,d3   ; copy y-distance to d3
          muls.w  d0,d0   ; x-distance^2
          muls.w  d3,d3   ; y-distance^2
          add.l  d3,d0   ; x^2 + y^2 = H^2
          jsr   SquareRoot   ; square root of H^2

          ; 255 = Real Speed // 12 = Sonic's Speed Constant
          muls.w   #255*12,d1   ; X*delta
          muls.w   #255*12,d2   ; Y*delta

          ; divide to fix the problem of "speed by distance" (near = slow, far = fast)
          divs.w   d0,d1      ; X'/H
          divs.w   d0,d2      ; Y'/H

          ; the gravity can make changes (+5 or -5) in Real Speed
          move.w  d1,$10(a0)      ; move d1 to X-velocity
          move.w  d2,$12(a0)      ; move d0 to Y-velocity
    Electroball_
    Electroball_

    Mensagens : 2127
    Data de inscrição : 2013-11-26
    Current Project : who cares

    Homing Attack - Variant 4 - Intercept Theorem Method  Empty Re: Homing Attack - Variant 4 - Intercept Theorem Method

    Post  Electroball_ Sun Dec 22, 2013 9:11 pm

    omg stoelooeneoen content
    Jdpense
    Jdpense

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

    Homing Attack - Variant 4 - Intercept Theorem Method  Empty Re: Homing Attack - Variant 4 - Intercept Theorem Method

    Post  Jdpense Thu Dec 27, 2018 10:39 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
    Green Snake
    Green Snake

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

    Homing Attack - Variant 4 - Intercept Theorem Method  Empty Re: Homing Attack - Variant 4 - Intercept Theorem Method

    Post  Green Snake Wed Sep 04, 2019 2:05 pm

    Jdpense
    Jdpense

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

    Homing Attack - Variant 4 - Intercept Theorem Method  Empty Re: Homing Attack - Variant 4 - Intercept Theorem Method

    Post  Jdpense Sun Jun 14, 2020 1:51 pm


    Delete this plz
    Jdpense
    Jdpense

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

    Homing Attack - Variant 4 - Intercept Theorem Method  Empty Re: Homing Attack - Variant 4 - Intercept Theorem Method

    Post  Jdpense Sun Jun 14, 2020 1:53 pm


    Better than GS with deleting the stolen content Smile
    Jdpense
    Jdpense

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

    Homing Attack - Variant 4 - Intercept Theorem Method  Empty Re: Homing Attack - Variant 4 - Intercept Theorem Method

    Post  Jdpense Tue Jul 07, 2020 12:00 pm


    Jdpense
    Jdpense

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

    Homing Attack - Variant 4 - Intercept Theorem Method  Empty Re: Homing Attack - Variant 4 - Intercept Theorem Method

    Post  Jdpense Tue Jul 07, 2020 12:02 pm


    Jdpense
    Jdpense

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

    Homing Attack - Variant 4 - Intercept Theorem Method  Empty Re: Homing Attack - Variant 4 - Intercept Theorem Method

    Post  Jdpense Tue Jul 07, 2020 12:04 pm

    OuricoDoido wrote:I aM MotHeR FucKeR Me OuRiCoDoIdO LiEk StoLeN cOnTeNt aNd LiEk tO SuX oN BaLlZ bCuz I Am GaY
    affraid affraid affraid affraid affraid affraid affraid affraid affraid affraid affraid affraid affraid affraid affraid affraid affraid

    SonicVaan likes this post

    Jdpense
    Jdpense

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

    Homing Attack - Variant 4 - Intercept Theorem Method  Empty Re: Homing Attack - Variant 4 - Intercept Theorem Method

    Post  Jdpense Tue Jul 07, 2020 12:23 pm



    Sponsored content

    Homing Attack - Variant 4 - Intercept Theorem Method  Empty Re: Homing Attack - Variant 4 - Intercept Theorem Method

    Post  Sponsored content


      Current date/time is Tue Apr 13, 2021 12:29 am