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.


+5
HackedSonic
TheBityBity
Scott4
Karate Cat
OuricoDoido
9 posters

    Centiseconds in Sonic 1

    avatar
    OuricoDoido
    Admin


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

    Centiseconds in Sonic 1 Empty Centiseconds in Sonic 1

    Post  OuricoDoido Wed Jun 01, 2011 11:33 pm

    Centiseconds in Sonic 1 Centiseconds%252520in%252520Sonic%2525201

    To download the Source Code and the compiled ROM, click here:
    http://goo.gl/bphDe

    If you want add the Centiseconds in Sonic 1, follow the step below.


    In sonic1.asm, go to Hud_ChkLives and add this line:
    Code:
          bsr.s   CentiSecond


    Now below this code:
    Code:
    Hud_End:
          rts

    Add these lines:
    Code:
    CentiSecond:
          move.l   #$75400003,d0
          moveq   #0,d1
          move.b   ($FFFFFE25).w,d1 ; load   frames
          mulu.w   #$1AA,d1
          lsr.l   #8,d1
          jsr   Hud_Secs
          rts


    In \_maps\obj21.asm, change all the code by this code fully commented:
    Code:
    ; ---------------------------------------------------------------------------
    ; Sprite mappings - SCORE, TIME, RINGS
    ; ---------------------------------------------------------------------------
          dc.w byte_1C5BC-Map_obj21, byte_1C5F0-Map_obj21
          dc.w byte_1C624-Map_obj21, byte_1C658-Map_obj21
          
          ; Y-Pos, layout, VDP (2bytes - plane, pallet line (2bits), flip, mirror, first tile (11bits) - ), X-Pos
    byte_1C5BC:   dc.b $C
          dc.b $80, $D, $80, 0, 0      ; SCOR
          dc.b $80, $D, $80, $18,   $20   ; E + score left numbers
          dc.b $80, $D, $80, $20,   $40   ; score right numbers
          dc.b $90, $D, $80, $10,   0   ; TIME
          dc.b $90, $D, $80, $28,   $28   ; minutes : seconds
          dc.b $90, 1, $80, $2A, $48   ; :
          dc.b $90, 5, $80, $E0, $50   ; centiseconds
          dc.b $A0, $D, $80, 8, 0      ; RING
          dc.b $A0, 1, $80, 0, $20   ; S
          dc.b $A0, 9, $80, $30, $30   ; number of rings
          dc.b $40, 5, $81, $A, 0      ; lives icon
          dc.b $40, $D, $81, $E, $10   ; lives counter
          dc.b 0
    byte_1C5F0:   dc.b $C
          dc.b $80, $D, $80, 0, 0      ; SCOR
          dc.b $80, $D, $80, $18,   $20   ; E + score left numbers
          dc.b $80, $D, $80, $20,   $40   ; score right numbers
          dc.b $90, $D, $80, $10,   0   ; TIME
          dc.b $90, $D, $80, $28,   $28   ; minutes : seconds
          dc.b $90, 1, $80, $2A, $48   ; :
          dc.b $90, 5, $80, $E0, $50   ; centiseconds
          dc.b $A0, $D, $A0, 8, 0      ; RING
          dc.b $A0, 1, $A0, 0, $20   ; S
          dc.b $A0, 9, $80, $30, $30   ; number of rings
          dc.b $40, 5, $81, $A, 0      ; lives icon
          dc.b $40, $D, $81, $E, $10   ; lives counter
          dc.b 0
    byte_1C624:   dc.b $C
          dc.b $80, $D, $80, 0, 0      ; SCOR
          dc.b $80, $D, $80, $18,   $20   ; E + score left numbers
          dc.b $80, $D, $80, $20,   $40   ; score right numbers
          dc.b $90, $D, $A0, $10,   0   ; TIME
          dc.b $90, $D, $80, $28,   $28   ; minutes : seconds
          dc.b $90, 1, $80, $2A, $48   ; :
          dc.b $90, 5, $80, $E0, $50   ; centiseconds
          dc.b $A0, $D, $80, 8, 0      ; RING
          dc.b $A0, 1, $80, 0, $20   ; S
          dc.b $A0, 9, $80, $30, $30   ; number of rings
          dc.b $40, 5, $81, $A, 0      ; lives icon
          dc.b $40, $D, $81, $E, $10   ; lives counter
          dc.b 0
    byte_1C658:   dc.b $C
          dc.b $80, $D, $80, 0, 0      ; SCOR
          dc.b $80, $D, $80, $18,   $20   ; E + score left numbers
          dc.b $80, $D, $80, $20,   $40   ; score right numbers
          dc.b $90, $D, $A0, $10,   0   ; TIME
          dc.b $90, $D, $80, $28,   $28   ; minutes : seconds
          dc.b $90, 1, $80, $2A, $48   ; :
          dc.b $90, 5, $80, $E0, $50   ; centiseconds
          dc.b $A0, $D, $A0, 8, 0      ; RING
          dc.b $A0, 1, $A0, 0, $20   ; S
          dc.b $A0, 9, $80, $30, $30   ; number of rings
          dc.b $40, 5, $81, $A, 0      ; lives icon
          dc.b $40, $D, $81, $E, $10   ; lives counter
          even
    Was added the ":" and the "centiseconds" in each of 4 maps.
    Karate Cat
    Karate Cat


    Mensagens : 83
    Data de inscrição : 2011-04-22

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  Karate Cat Thu Jun 02, 2011 5:36 am

    Very Nice!
    avatar
    OuricoDoido
    Admin


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

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  OuricoDoido Thu Jun 02, 2011 1:05 pm

    To Fix the Frame Counter Bug, that because this tutorial is shown in start of each level, use this guide.
    How to Fix the Frame Counter Bug

    This bug is from ORIGINAL SONIC 1, and adding the Centiseconds you can see it in start of all levels.
    avatar
    OuricoDoido
    Admin


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

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  OuricoDoido Mon Jun 06, 2011 10:35 pm

    After apply this guide How to Fix the Frame Counter Bug, we need correct the centiseconds when start from a lamppost.

    Go to LevSz_ChkLamp, and between these two lines:
    Code:
          jsr   Hud_Secs
          movem.l   (sp)+,d0-a6
    Add this code:
    Code:
          move.l   #$75400003,d0
          moveq   #0,d1
          move.b   ($FFFFFE25).w,d1 ; load   frames
          mulu.w   #$1AA,d1
          lsr.l   #8,d1
          jsr   Hud_Secs

    To get a better effect when starting from a lamppost, to not always show the same time, go to Obj79_LoadInfo and comment or delete these lines:
    Code:
          move.b   #59,($FFFFFE25).w
          subq.b   #1,($FFFFFE24).w
    These lines say that the frame counter need be set to 59 and subtract 1 from seconds counter.


    How work the centiseconds counter?

    It work like the minutes counter and seconds counter, but have a difference, need convert the number of frames in number of centiseconds.

    First a number is loaded, in this case the number of frames, after is converted to centiseconds (59 frames -> 99 centiseconds).

    Second, the game get the correct art based on this number (centiseconds) and put it in VRAM, our case in F5C0 or tile number 7AE.

    Third, the map use these tiles to show the centiseconds on screen, in this method is not being necessary decompress all the art in VRAM.
    avatar
    OuricoDoido
    Admin


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

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  OuricoDoido Tue Jun 07, 2011 6:23 pm

    How the How to Fix the Frame Counter Bug was fixed, now this code is fixed too.

    To download the ROM and the Source Code with these fixes, click here:
    http://goo.gl/mpmgw
    avatar
    Scott4


    Mensagens : 1
    Data de inscrição : 2012-01-20

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  Scott4 Fri Jan 20, 2012 3:49 pm

    I know it's been forever since anybody's posted in this topic, but when I added the CentiSecond lines in sonic1.asm, it kept telling me "Error (1-- bytes) out of range". What am I doing wrong? Sad
    avatar
    TheBityBity


    Mensagens : 15
    Data de inscrição : 2011-12-09

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  TheBityBity Sat Jan 21, 2012 7:43 pm

    OMG! U SUX!!!
    avatar
    TheBityBity


    Mensagens : 15
    Data de inscrição : 2011-12-09

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  TheBityBity Sat Jan 21, 2012 7:44 pm

    Just a joke.

    What you could do, is open the main ASM file with E.N.A.E., and delete the two symbols that appear at the start.
    avatar
    HackedSonic


    Mensagens : 1
    Data de inscrição : 2012-12-01

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  HackedSonic Mon Dec 03, 2012 6:45 pm

    Scott4 wrote:I know it's been forever since anybody's posted in this topic, but when I added the CentiSecond lines in sonic1.asm, it kept telling me "Error (1-- bytes) out of range". What am I doing wrong? Sad

    I think once you added this, you got that error.

    Code:

    CentiSecond:
          move.l  #$75400003,d0
          moveq  #0,d1
          move.b  ($FFFFFE25).w,d1 ; load  frames
          mulu.w  #$1AA,d1
          lsr.l  #8,d1
          jsr  Hud_Secs
          rts

    It happened because of the TimeOver branch. In the branch where it said TimeOver, replace the command that's there with
    jsr (Jump to SubRoutine) or jmp (JuMP). Either way, it should work, but if it doesn't work-- I can't help.
    Green Snake
    Green Snake


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

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  Green Snake Sat Dec 08, 2012 3:30 am

    HackedSonic wrote:
    Scott4 wrote:I know it's been forever since anybody's posted in this topic, but when I added the CentiSecond lines in sonic1.asm, it kept telling me "Error (1-- bytes) out of range". What am I doing wrong? Sad

    I think once you added this, you got that error.

    Code:

    CentiSecond:
          move.l  #$75400003,d0
          moveq  #0,d1
          move.b  ($FFFFFE25).w,d1 ; load  frames
          mulu.w  #$1AA,d1
          lsr.l  #8,d1
          jsr  Hud_Secs
          rts

    It happened because of the TimeOver branch. In the branch where it said TimeOver, replace the command that's there with
    jsr (Jump to SubRoutine) or jmp (JuMP). Either way, it should work, but if it doesn't work-- I can't help.

    You know, this is Megamix stolen content. I mean this guide, and all guides by Ouricodoido.
    TheRetroGuy
    TheRetroGuy


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

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  TheRetroGuy Fri May 03, 2013 1:17 pm

    Green Snake wrote:
    HackedSonic wrote:
    Scott4 wrote:I know it's been forever since anybody's posted in this topic, but when I added the CentiSecond lines in sonic1.asm, it kept telling me "Error (1-- bytes) out of range". What am I doing wrong? Sad

    I think once you added this, you got that error.

    Code:

    CentiSecond:
          move.l  #$75400003,d0
          moveq  #0,d1
          move.b  ($FFFFFE25).w,d1 ; load  frames
          mulu.w  #$1AA,d1
          lsr.l  #8,d1
          jsr  Hud_Secs
          rts

    It happened because of the TimeOver branch. In the branch where it said TimeOver, replace the command that's there with
    jsr (Jump to SubRoutine) or jmp (JuMP). Either way, it should work, but if it doesn't work-- I can't help.

    You know, this is Megamix stolen content. I mean this guide, and all guides by Ouricodoido.

    I checked the code from Megamix and it's different from this.
    Green Snake
    Green Snake


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

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  Green Snake Fri May 03, 2013 4:48 pm

    Compare homing attack codes. I see barely any difference
    Green Snake
    Green Snake


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

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  Green Snake Sun May 19, 2013 11:45 am

    avatar
    JoshDP


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

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  JoshDP Thu Dec 27, 2018 10:51 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

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

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

    Jdpense
    Jdpense


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

    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  Jdpense Sun Jun 14, 2020 1:57 pm


    Sponsored content


    Centiseconds in Sonic 1 Empty Re: Centiseconds in Sonic 1

    Post  Sponsored content


      Current date/time is Fri Apr 19, 2024 6:23 am