Skip to content

Commit 7ffcd5a

Browse files
committed
[mmu/rtg/xaudio] correct calculation of the minimum page set
1 parent 50bd233 commit 7ffcd5a

File tree

2 files changed

+38
-22
lines changed

2 files changed

+38
-22
lines changed

rtg/replay.card.asm

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,18 +1839,25 @@ _LVORebuildTreesA EQU -360
18391839

18401840
BUG "Requested region = %lx,%lx",d1,d0
18411841

1842+
subq.l #1,d7
18421843
move.l d7,d6
1843-
subq.l #1,d6
18441844
not.l d6
1845-
move.l d1,d2
1845+
add.l d1,d0
1846+
add.l d7,d1
18461847
and.l d6,d1
1847-
sub.l d1,d2
1848-
add.l d2,d0
1849-
add.l d7,d0
18501848
and.l d6,d0
1849+
sub.l d1,d0
18511850

18521851
BUG "Aligned region = %lx,%lx",d1,d0
18531852

1853+
tst.l d0
1854+
bne.b .sizeok
1855+
1856+
BUG "Size is 0!"
1857+
pea .nommu(pc)
1858+
bra .failed
1859+
1860+
.sizeok
18541861
movem.l d0/d1,(sp) ; (sp),4(sp) = adjusted size/addr
18551862

18561863
; Lock contexts

xaudio/src/replay_audio.s

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
;
1212
;
1313

14-
; REPLAY XAUDIO AHI DRIVER - RELEASE 0.
14+
; REPLAY XAUDIO AHI DRIVER - RELEASE 0.3�
1515
;------------
1616

1717
; General register allocation :
@@ -956,18 +956,27 @@ _LVORebuildTreesA EQU -360
956956
; adjust address and size to match page size
957957
movem.l (sp),d0/d1
958958

959+
kprintf "Requested region = %lx,%lx",d1,d0
960+
961+
subq.l #1,d7
959962
move.l d7,d6
960-
subq.l #1,d6
961963
not.l d6
962-
move.l d1,d2
964+
add.l d1,d0
965+
add.l d7,d1
963966
and.l d6,d1
964-
sub.l d1,d2
965-
add.l d2,d0
966-
add.l d7,d0
967967
and.l d6,d0
968+
sub.l d1,d0
969+
970+
kprintf "Aligned region = %lx,%lx",d1,d0
968971

969-
kprintf "Lower / Size = %lx,%lx",d1,d0
972+
tst.l d0
973+
bne.b .sizeok
974+
975+
kprintf "Size is 0!"
976+
pea .nommu(pc)
977+
bra .failed
970978

979+
.sizeok
971980
movem.l d0/d1,(sp) ; (sp),4(sp) = adjusted size/addr
972981

973982
; Lock contexts
@@ -1213,10 +1222,10 @@ PrintAudioCtrl:
12131222

12141223
.AHIST_M8S dc.b "AHIST_M8S = Mono, 8 bit signed (BYTE)",0
12151224
.AHIST_M16S dc.b "AHIST_M16S = Mono, 16 bit signed (WORD)",0
1216-
.AHIST_S8S dc.b "AHIST_S8S = Stereo, 8 bit signed (2×BYTE)",0
1217-
.AHIST_S16S dc.b "AHIST_S16S = Stereo, 16 bit signed (2×WORD)",0
1225+
.AHIST_S8S dc.b "AHIST_S8S = Stereo, 8 bit signed (2BYTE)",0
1226+
.AHIST_S16S dc.b "AHIST_S16S = Stereo, 16 bit signed (2WORD)",0
12181227
.AHIST_M32S dc.b "AHIST_M32S = Mono, 32 bit signed (LONG)",0
1219-
.AHIST_S32S dc.b "AHIST_S32S = Stereo, 32 bit signed (2×LONG)",0
1228+
.AHIST_S32S dc.b "AHIST_S32S = Stereo, 32 bit signed (2LONG)",0
12201229
.AHIST_UNK dc.b "Unknown",0
12211230
even
12221231
ELSE
@@ -1298,19 +1307,19 @@ PrintAudioCtrl:
12981307
* 1) Use mixing routines with timing:
12991308
* You will need to be able to play any number of samples from
13001309
* about 80 up to 65535 with low overhead.
1301-
* · Update AudioCtrl->ahiac_MixFreq to nearest value that your
1310+
* Update AudioCtrl->ahiac_MixFreq to nearest value that your
13021311
* hardware supports.
1303-
* · Return AHISF_MIXING|AHISF_TIMING.
1312+
* Return AHISF_MIXING|AHISF_TIMING.
13041313
*
13051314
* 2) Use mixing routines without timing:
13061315
* If the hardware can't play samples with any length, use this
13071316
* alternative and provide timing yourself. The buffer must
13081317
* take less than about 20 ms to play, preferable less than 10!
1309-
* · Update AudioCtrl->ahiac_MixFreq to nearest value that your
1318+
* Update AudioCtrl->ahiac_MixFreq to nearest value that your
13101319
* hardware supports.
1311-
* · Store the number of samples to mix each pass in
1320+
* Store the number of samples to mix each pass in
13121321
* AudioCtrl->ahiac_BuffSamples.
1313-
* · Return AHISF_MIXING
1322+
* Return AHISF_MIXING
13141323
* Alternatively, you can use the first method and call the
13151324
* mixing hook several times in a row to fill up a buffer.
13161325
* In that case, AHIsub_GetAttr(AHIDB_MaxPlaySamples) should
@@ -2220,7 +2229,7 @@ AHIsub_Stop:
22202229
* "Martin 'Leviticus' Blom"
22212230
*
22222231
* AHIDB_Copyright - Return pointer to copyright notice, including
2223-
* the '©' character: "© 1996 Martin Blom" or "Public Domain"
2232+
* the '' character: " 1996 Martin Blom" or "Public Domain"
22242233
*
22252234
* AHIDB_Version - Return pointer version string, normal Amiga
22262235
* format: "paula 1.5 (18.2.96)\r\n"
@@ -2432,7 +2441,7 @@ ga_Copyright:
24322441
lea .copyright(pc),a0
24332442
move.l a0,d0
24342443
rts
2435-
.copyright dc.b "© 2017 All rights reserved",0
2444+
.copyright dc.b " 2017 All rights reserved",0
24362445
even
24372446

24382447
ga_Version:

0 commit comments

Comments
 (0)