Skip to content

Commit 9e10b04

Browse files
committed
[xaudio] Remove writes to the .CODE section
1 parent 8ab3612 commit 9e10b04

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

xaudio/src/replay_audio.s

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ FALSE EQU 0
181181
ULONG r_TimerFreq ; -- " --
182182
ULONG r_TimerCalibrate ; -- " --
183183

184+
ULONG r_ProcessTimeSum ; Calc process time avg
185+
ULONG r_ProcessTimeCounter
186+
184187
LABEL replay_SIZEOF
185188

186189
Start:
@@ -2787,7 +2790,8 @@ ec_init:
27872790
move.l rb_TimerLib(a5),a6
27882791
jsr _LVOReadEClock(a6)
27892792

2790-
lea ec_tmp(pc),a0
2793+
lea -EV_SIZE(sp),sp
2794+
movea.l sp,a0
27912795
moveq.l #(1<<5)-1,d7
27922796
.calibrate jsr _LVOReadEClock(a6)
27932797
dbf d7,.calibrate
@@ -2800,6 +2804,7 @@ ec_init:
28002804
lsr.l #5,d0
28012805
move.l d0,r_TimerCalibrate(a3)
28022806

2807+
lea EV_SIZE(sp),sp
28032808
movem.l (sp)+,d0/d7/a0/a6
28042809
bra.b ec_reset
28052810

@@ -2816,7 +2821,8 @@ ec_readconv_us: ; ( returns microseconds d0:d1 )
28162821
*d2 eclock frequency
28172822
ec_read:
28182823
movem.l a0/a6,-(sp)
2819-
lea ec_tmp(pc),a0
2824+
lea -EV_SIZE(sp),sp
2825+
movea.l sp,a0
28202826
move.l rb_TimerLib(a5),a6
28212827
jsr _LVOReadEClock(a6)
28222828
move.l (a0)+,d0
@@ -2834,6 +2840,7 @@ ec_read:
28342840
moveq.l #1,d1
28352841

28362842
.done move.l r_TimerFreq(a3),d2
2843+
lea EV_SIZE(sp),sp
28372844
movem.l (sp)+,a0/a6
28382845
bra.b ec_reset
28392846

@@ -2855,8 +2862,6 @@ ec_reset
28552862
movem.l (sp)+,d0-d2/a0/a6
28562863
rts
28572864

2858-
ec_tmp ds.l 2
2859-
28602865
*************************************************************************
28612866

28622867
PlayerFunc:
@@ -2915,15 +2920,15 @@ PlayerFunc:
29152920
bsr.b FillOutputBuffer_entry
29162921

29172922
bsr.w ec_readconv_us
2918-
add.l d1,.processTimeSum
2919-
add.l #1,.processTimeCnt
2920-
cmp.l #50,.processTimeCnt
2923+
add.l d1,r_ProcessTimeSum(a3)
2924+
add.l #1,r_ProcessTimeCounter(a3)
2925+
cmp.l #50,r_ProcessTimeCounter(a3)
29212926
bne.b .notyet
2922-
move.l .processTimeSum(pc),d0
2927+
move.l r_ProcessTimeSum(a3),d0
29232928
divu.l #50,d0
29242929
kprintf "Average process time = %ld us",d0
2925-
clr.l .processTimeSum
2926-
clr.l .processTimeCnt
2930+
clr.l r_ProcessTimeSum(a3)
2931+
clr.l r_ProcessTimeCounter(a3)
29272932
.notyet
29282933

29292934
.exit
@@ -2932,9 +2937,6 @@ PlayerFunc:
29322937
.exitxx rts
29332938

29342939

2935-
.processTimeSum dc.l 0
2936-
.processTimeCnt dc.l 0
2937-
29382940

29392941
FillOutputBuffer_entry:
29402942
movem.l d0-a6,-(sp)

0 commit comments

Comments
 (0)