Skip to content

Commit 34012fd

Browse files
committed
[xaudio] be explicit about immediate opcodes
1 parent 3090382 commit 34012fd

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

xaudio/Devs/AudioModes/replay

0 Bytes
Binary file not shown.

xaudio/src/replay_audio.s

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ FindFreq:
12221222
.1 subq.l #4,a0
12231223
.2 move.l (a0),d0
12241224
move.l a0,d1
1225-
sub.l #Replay_FreqList,d1
1225+
subi.l #Replay_FreqList,d1
12261226
lsr.l #2,d1
12271227
rts
12281228

@@ -1615,9 +1615,9 @@ AHIsub_Start:
16151615
; Don't trust BuffSize - compare against the max samples copied
16161616
move.l ahiac_MaxBuffSamples(a2),d1
16171617
move.l ahiac_Flags(a2),d2
1618-
and.l #AHIACF_STEREO,d2
1618+
andi.l #AHIACF_STEREO,d2
16191619
lsr.w #AHIACB_STEREO,d2
1620-
add.w #1,d2
1620+
addi.w #1,d2
16211621
lsl.l d2,d1
16221622

16231623
cmp.l d1,d0
@@ -1643,7 +1643,7 @@ AHIsub_Start:
16431643

16441644
move.l ahiac_MixFreq(a2),d0
16451645
move.l ahiac_PlayerFreq(a2),d1
1646-
cmp.l #$10000,d1 ; freq can be both 16.16 fixed point or not ?!
1646+
cmpi.l #$10000,d1 ; freq can be both 16.16 fixed point or not ?!
16471647
blo.b .valok
16481648
clr.w d1
16491649
swap d1
@@ -1655,26 +1655,26 @@ AHIsub_Start:
16551655
; move.l ahiac_MaxBuffSamples(a2),d0
16561656
; add.l d0,d0 ; buffer 2x sample speed
16571657
lsl.l #2,d0 ; multiply by 4 because output is always 16 bit stereo
1658-
add.l #15,d0 ; need 16byte alignment size
1659-
and.l #~15,d0
1658+
addi.l #15,d0 ; need 16byte alignment size
1659+
andi.l #~15,d0
16601660
move.l d0,r_OutputBufferSize(a3)
1661-
add.l #15,d0 ; need 16byte alignment ptr
1661+
addi.l #15,d0 ; need 16byte alignment ptr
16621662
move.l #MEMF_PUBLIC|MEMF_CLEAR|MEMF_REPLAY,d1
16631663
CALLLIB _LVOAllocVec
16641664
move.l d0,r_OutputBuffer(a3)
16651665
bne.b .memory_ok
16661666

16671667
kprintf "WARNING : unable to allocate REPLAY memory"
16681668
move.l r_OutputBufferSize(a3),d0
1669-
add.l #15,d0 ; need 16byte alignment ptr
1669+
addi.l #15,d0 ; need 16byte alignment ptr
16701670
move.l #MEMF_PUBLIC|MEMF_CLEAR|MEMF_24BITDMA,d1
16711671
CALLLIB _LVOAllocVec
16721672
move.l d0,r_OutputBuffer(a3)
16731673
beq .error_nomem
16741674

16751675
.memory_ok:
1676-
add.l #15,d0
1677-
and.l #~15,d0
1676+
addi.l #15,d0
1677+
andi.l #~15,d0
16781678
move.l d0,r_OutputBufferAligned(a3)
16791679

16801680

@@ -1807,7 +1807,7 @@ AHIsub_Update:
18071807
move.l ahiac_PlayerFunc(a2),r_PlayerHook(a3)
18081808

18091809
move.l ahiac_PlayerFreq(a2),d0
1810-
cmp.l #$10000,d0
1810+
cmpi.l #$10000,d0
18111811
bge.b .valok
18121812
swap d0
18131813
.valok lsr.l #8,d0
@@ -2033,7 +2033,7 @@ AHIsub_Stop:
20332033
AHIsub_GetAttr:
20342034
move.l d3,-(sp)
20352035
move.l d0,d3
2036-
sub.l #$80000064,d3
2036+
subi.l #$80000064,d3
20372037
kprintf "AHIsub_GetAttr(%lx = %ld) arg = %lx; defalt = %lx]",d0,d3,d1,d2
20382038
move.l (sp)+,d3
20392039
movem.l d2-d7/a2-a6,-(sp)
@@ -2055,10 +2055,10 @@ AHIsub_GetAttr:
20552055

20562056
movem.l (sp)+,d0-d1
20572057

2058-
and.l #~(AHI_TagBaseR),d0
2059-
cmp.l #AHIDB_Data&~(AHI_TagBaseR),d0
2058+
andi.l #~(AHI_TagBaseR),d0
2059+
cmpi.l #AHIDB_Data&~(AHI_TagBaseR),d0
20602060
bhi.b .default
2061-
sub.w #100,d0
2061+
subi.w #100,d0
20622062
lsl.w #1,d0
20632063
move.w .jt(pc,d0.w),d0
20642064
beq.b .default
@@ -2316,13 +2316,13 @@ ga_Output:
23162316

23172317
AHIsub_HardwareControl:
23182318
kprintf "AHIsub_HardwareControl() [%lx, %lx] / [%lx]",d0,d1,a0
2319-
cmp.l #AHIC_OutputVolume,d0
2319+
cmpi.l #AHIC_OutputVolume,d0
23202320
bne.b .dontsetoutvol
23212321
move.l ahiac_DriverData(a2),a1
23222322
move.l d1,r_OutputVolume(a1)
23232323
bra.b .exit
23242324
.dontsetoutvol
2325-
cmp.l #AHIC_OutputVolume_Query,d0
2325+
cmpi.l #AHIC_OutputVolume_Query,d0
23262326
bne.b .dontgetoutvol
23272327
move.l ahiac_DriverData(a2),a1
23282328
move.l r_OutputVolume(a1),d0
@@ -2531,7 +2531,7 @@ ec_init:
25312531

25322532
move.l EV_LO(a0),d0
25332533
sub.l EV_LO+r_TimerVal(a3),d0
2534-
add.l #1<<4,d0
2534+
addi.l #1<<4,d0
25352535
lsr.l #5,d0
25362536
move.l d0,r_TimerCalibrate(a3)
25372537

@@ -2805,11 +2805,11 @@ CopySamples
28052805

28062806
; convert num bytes to num samples (depending on stereo/hifi)
28072807
move.l ahiac_Flags(a6),d4
2808-
and.l #AHIACF_STEREO,d4
2808+
andi.l #AHIACF_STEREO,d4
28092809
lsr.w #AHIACB_STEREO,d4
28102810
move.w .copyLoops(pc,d4.w*2),d5
28112811
lea .copyLoops(pc,d5.w),a5
2812-
add.w #1,d4
2812+
addi.w #1,d4
28132813
lsr.l d4,d3 ; input is 16 bit stereo
28142814

28152815
; d2 = num out samples
@@ -2855,12 +2855,12 @@ CopySamples
28552855

28562856

28572857
move.l d7,d6
2858-
and.l #$f,d6
2859-
add.l #$f,d7
2858+
andi.l #$f,d6
2859+
addi.l #$f,d7
28602860
lsr.l #4,d7
28612861

28622862
neg d6
2863-
and.w #$f,d6
2863+
andi.w #$f,d6
28642864
jmp .copyLoopM16(pc,d6.w*4)
28652865

28662866
.copyLoopM16
@@ -2876,12 +2876,12 @@ CopySamples
28762876
.copyS16 ;kprintf "Innerloop Copy %ld samples",d7
28772877

28782878
move.l d7,d6
2879-
and.l #$f,d6
2880-
add.l #$f,d7
2879+
andi.l #$f,d6
2880+
addi.l #$f,d7
28812881
lsr.l #4,d7
28822882

28832883
neg d6
2884-
and.w #$f,d6
2884+
andi.w #$f,d6
28852885
jmp .copyLoopS16(pc,d6.w*2)
28862886

28872887
.copyLoopS16
@@ -2945,9 +2945,9 @@ RefillBuffer:
29452945

29462946
move.l ahiac_BuffSamples(a6),d4
29472947
move.l ahiac_Flags(a6),d5
2948-
and.l #AHIACF_STEREO,d5
2948+
andi.l #AHIACF_STEREO,d5
29492949
lsr.w #AHIACB_STEREO,d5
2950-
add.w #1,d5
2950+
addi.w #1,d5
29512951
lsl.l d5,d4
29522952
add.l d4,a4
29532953

0 commit comments

Comments
 (0)