Skip to content

Commit

Permalink
identified some lap count addresses used in competition mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vinegar97 authored and flamewing committed May 29, 2021
1 parent 4ae20b5 commit 2b03313
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Lockon S3/Screen Events.asm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ CGZ_BackgroundInit:
move.w d0,(Events_bg+$04).w
move.w d0,(Events_bg+$06).w
moveq #0,d0
move.b (_unkFEDA).w,d0
move.b (Competition_total_laps).w,d0
addq.w #1,d0
lsl.w #8,d0
subi.w #$70,d0
Expand Down
46 changes: 23 additions & 23 deletions sonic3k.asm
Original file line number Diff line number Diff line change
Expand Up @@ -73982,8 +73982,8 @@ Obj_2PGoalMarker:
lsl.w #3,d0
subi.w #$14,d0
move.w d0,$38(a0)
move.b #5,(_unkFEDA).w
clr.w (_unkFEDC).w
move.b #5,(Competition_total_laps).w
clr.w (Competition_lap_count).w
clr.w (Events_bg+$14).w
clr.b (Update_HUD_timer).w
clr.l (Timer).w
Expand Down Expand Up @@ -74028,13 +74028,13 @@ loc_36CEA:
move.w $10(a0),d1
lea $34(a0),a2
lea (Player_1).w,a1
lea (_unkFEDC).w,a3
lea (Competition_lap_count).w,a3
lea (_unkF74A).w,a4
lea (Timer).w,a5
lea ($FF7828).l,a6
bsr.w sub_36DFC
lea (Player_2).w,a1
lea (_unkFEDD).w,a3
lea (Competition_lap_count_2P).w,a3
lea (_unkF74B).w,a4
lea (Timer_P2).w,a5
lea ($FF7840).l,a6
Expand Down Expand Up @@ -74072,7 +74072,7 @@ loc_36D3E:
move.w #0,$32(a1)

loc_36DC0:
clr.w (_unkFEDC).w
clr.w (Competition_lap_count).w
clr.b (Update_HUD_timer).w
clr.l (Timer).w
clr.b (_unkFEC7).w
Expand Down Expand Up @@ -74336,10 +74336,10 @@ loc_37086:
move.l #loc_37092,(a0)

loc_37092:
move.b (_unkFEDC).w,d0
cmp.b (_unkFEDA).w,d0
move.b (Competition_lap_count).w,d0
cmp.b (Competition_total_laps).w,d0
ble.s loc_370A0
move.b (_unkFEDA).w,d0
move.b (Competition_total_laps).w,d0

loc_370A0:
subi.b #$A,d0
Expand All @@ -74350,10 +74350,10 @@ loc_370A0:
; ---------------------------------------------------------------------------

loc_370B4:
move.b (_unkFEDD).w,d0
cmp.b (_unkFEDA).w,d0
move.b (Competition_lap_count_2P).w,d0
cmp.b (Competition_total_laps).w,d0
ble.s loc_370C2
move.b (_unkFEDA).w,d0
move.b (Competition_total_laps).w,d0

loc_370C2:
subi.b #$A,d0
Expand Down Expand Up @@ -74447,8 +74447,8 @@ loc_3720C:
move.w #$78,(Events_bg+$16).w

loc_37218:
move.b (_unkFEDA).w,d0
cmp.b (_unkFEDC).w,d0
move.b (Competition_total_laps).w,d0
cmp.b (Competition_lap_count).w,d0
bhs.s loc_37292
move.b #3,$20(a0)
tst.b (Not_ghost_flag).w
Expand All @@ -74470,8 +74470,8 @@ loc_37256:
jsr sub_37430(pc)
moveq #sfx_Goal,d0
jsr (Play_Sound_2).l
move.b (_unkFEDA).w,d0
cmp.b (_unkFEDD).w,d0
move.b (Competition_total_laps).w,d0
cmp.b (Competition_lap_count_2P).w,d0
bhs.s loc_3728C
move.b #6,$20(a0)
bclr #3,4(a0)
Expand All @@ -74486,7 +74486,7 @@ loc_3728C:
; ---------------------------------------------------------------------------

loc_37292:
cmp.b (_unkFEDD).w,d0
cmp.b (Competition_lap_count_2P).w,d0
bhs.s locret_372CE
move.b #4,$20(a0)
bset #4,4(a0)
Expand Down Expand Up @@ -74531,15 +74531,15 @@ locret_37306:
; ---------------------------------------------------------------------------

loc_37308:
move.b (_unkFEDC).w,d0
move.b (Competition_lap_count).w,d0
tst.b (Update_HUD_timer).w
bpl.s loc_3731C
move.b (_unkFEDD).w,d0
move.b (Competition_lap_count_2P).w,d0
tst.b (Update_HUD_timer).w
bmi.s loc_37322

loc_3731C:
cmp.b (_unkFEDA).w,d0
cmp.b (Competition_total_laps).w,d0
beq.s loc_37328

loc_37322:
Expand Down Expand Up @@ -74598,8 +74598,8 @@ byte_3739F: dc.b 0
; ---------------------------------------------------------------------------

loc_373A4:
move.b (_unkFEDA).w,d0
cmp.b (_unkFEDC).w,d0
move.b (Competition_total_laps).w,d0
cmp.b (Competition_lap_count).w,d0
bhs.s loc_373D4
tst.b (Update_HUD_timer).w
bmi.s loc_373D4
Expand All @@ -74611,8 +74611,8 @@ loc_373A4:
jsr (Play_Sound_2).l

loc_373D4:
move.b (_unkFEDA).w,d0
cmp.b (_unkFEDD).w,d0
move.b (Competition_total_laps).w,d0
cmp.b (Competition_lap_count_2P).w,d0
bhs.s locret_37404
tst.b (_unkFEC7).w
bmi.s locret_37404
Expand Down
6 changes: 3 additions & 3 deletions sonic3k.constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -820,10 +820,10 @@ Ring_count_P2 ds.w 1 ; left over from Sonic 2
Timer_P2 ds.l 1 ; left over from Sonic 2
Timer_minute_P2 = Timer_P2+1 ; left over from Sonic 2
Score_P2 ds.l 1 ; left over from Sonic 2
_unkFEDA ds.b 1
Competition_total_laps ds.b 1 ;total number of laps in comeptition mode (typically 5)
ds.b 1 ; unused
_unkFEDC ds.b 1
_unkFEDD ds.b 1
Competition_lap_count ds.b 1 ;current lap number for player 1 in competition mode
Competition_lap_count_2P ds.b 1 ;current lap number for player 2 in competition mode
_unkFEDE ds.b 1 ; unused
ds.b $23 ; unused
Results_screen_2P ds.w 1 ; left over from Sonic 2
Expand Down

0 comments on commit 2b03313

Please sign in to comment.