Actions

SCHG How-to

Toggle the 2 Player VS Countdown

From Sonic Retro

(Original guide by E-122-Psi) (coding help provided by MoDule and Nineko.)

Anyone wanna edit the 2 player VS countdown? Has some interesting nuances.

There are five different entries for the countdown, two in the HUD routine, three in the signpost routine. Curiously there are THREE ways to activate it. One by deactivate Sonic's timer by crossing the signpost, one by deactivating Tails' the same way, and another that activates purely by you loading the signpost art. (You ever stepped close to the finish line only to mess around or go back for some items or points, only to randomly hear the countdown theme play? This is that check, and was likely added to put a stop to your antics.)

loc_1922C:
    addq.b    #2,routine(a0) ; => Obj0D_Main
    bsr.w    Adjust2PArtPointer
    move.b    #4,render_flags(a0)
    move.b    #$18,width_pixels(a0)
    move.b    #4,priority(a0)
    move.w    #$3C3C,(Loser_Time_Left).w ;signpost load counter

......

loc_192BC:
    tst.w    (Two_player_mode).w
    beq.w    loc_19350
    move.w    #$3C3C,(Loser_Time_Left).w ;Tails' counter
    move.w    #$D3,d0        ; play different spinning sound
    jsr    (PlaySound).l
    bra.s    loc_19350

......

loc_1932E:
    tst.b    obj0D_finalanim(a0)
    bne.s    loc_19350
    move.b    #4,obj0D_finalanim(a0)
    tst.w    (Two_player_mode).w
    beq.s    loc_19350
    move.w    #$3C3C,(Loser_Time_Left).w ;Sonic's counter
    move.w    #$D3,d0
    jsr    (PlaySound).l

All three activation checks are separate and can be given different timer settings ($3C3C represents the frames and seconds, 60). You could even add a handicap for one player, giving Sonic, say $1E3C (30 seconds) and Tails $5A3C (90 seconds). It's quite flexible, but remember it can only go up to double digits, so the timer won't display correctly past 99 seconds ($633C).

VS Countdown 02.png

If you wanna turn the timer off completely, just comment out all three Loser_Time_Left entries, leaving it inactive and at 00.

VS Countdown 01.png

If you wanna get rid of the display as well, go to the HUD routine and add a jump branch over each entry where it checks for Sonic and Tails' timers deactivating:

loc_4088C:

    move.w    #$90,d3
    move.w    #$188,d2
    lea    (HUD_MapUnc_40BEA).l,a1
    movea.w    #$8365,a3
    add.w    d1,d1
    adda.w    (a1,d1.w),a1
    move.w    (a1)+,d1
    subq.w    #1,d1
    bsr.w    JmpTo_loc_16DC6
    move.w    #$B8,d3
    move.w    #$108,d2
    movea.w    #$8371,a3
    moveq    #0,d7
    move.b    (Timer_minute).w,d7
    bsr.w    sub_4092E
    bsr.w    sub_4096A
    moveq    #0,d7
    move.b    (Timer_second).w,d7
    bsr.w    loc_40938
    move.w    #$C0,d3
    move.w    #$118,d2
    movea.w    #$8371,a3
    moveq    #0,d7
    move.w    (Ring_count).w,d7
    bsr.w    sub_40984
    tst.b    (Update_HUD_timer_2P).w
    bne.s    loc_40908
    tst.b    (Update_HUD_timer).w
    beq.s    loc_40908
    jmp    loc_40908    ;skip Sonic's countdown art
    move.w    #$110,d3
    move.w    #$1B8,d2
    movea.w    #$8371,a3
    moveq    #0,d7
    move.b    (Loser_Time_Left).w,d7
    bsr.w    loc_40938

loc_40908:

    moveq    #4,d1
    move.w    #$90,d3
    move.w    #$188,d2
    lea    (HUD_MapUnc_40BEA).l,a1
    movea.w    #$8365,a3
    add.w    d1,d1
    adda.w    (a1,d1.w),a1
    move.w    (a1)+,d1
    subq.w    #1,d1
    bsr.w    JmpTo_loc_16DC6
    moveq    #0,d4
    rts

......

loc_409F8:

    move.w    #$90,d3
    move.w    #$268,d2
    lea    (HUD_MapUnc_40BEA).l,a1
    movea.w    #$8365,a3
    add.w    d1,d1
    adda.w    (a1,d1.w),a1
    move.w    (a1)+,d1
    subq.w    #1,d1
    bsr.w    JmpTo_loc_16DC6
    move.w    #$B8,d3
    move.w    #$1E8,d2
    movea.w    #$8371,a3
    moveq    #0,d7
    move.b    (Timer_minute_2P).w,d7
    bsr.w    sub_4092E
    bsr.w    sub_4096A
    moveq    #0,d7
    move.b    (Timer_second_2P).w,d7
    bsr.w    loc_40938
    move.w    #$C0,d3
    move.w    #$1F8,d2
    movea.w    #$8371,a3
    moveq    #0,d7
    move.w    (Ring_count_2P).w,d7
    bsr.w    sub_40984
    tst.b    (Update_HUD_timer).w
    bne.s    loc_40A74
    tst.b    (Update_HUD_timer_2P).w
    beq.s    loc_40A74
    jmp    loc_40A74    ;skip Tails' countdown art
    move.w    #$110,d3
    move.w    #$298,d2
    movea.w    #$8371,a3
    moveq    #0,d7
    move.b    (Loser_Time_Left).w,d7
    bsr.w    loc_40938

loc_40A74:

    moveq    #5,d1
    move.w    #$90,d3
    move.w    #$268,d2
    lea    (HUD_MapUnc_40BEA).l,a1
    movea.w    #$8340,a3
    add.w    d1,d1
    adda.w    (a1,d1.w),a1
    move.w    (a1)+,d1
    subq.w    #1,d1
    bsr.w    JmpTo_loc_16DC6
    moveq    #0,d4
    rts