MV_MIX6.ASM 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684
  1. IDEAL
  2. p386
  3. MODEL flat
  4. dataseg
  5. CODESEG
  6. MASM
  7. ALIGN 4
  8. EXTRN _MV_HarshClipTable:DWORD
  9. EXTRN _MV_MixDestination:DWORD
  10. EXTRN _MV_MixPosition:DWORD
  11. EXTRN _MV_LeftVolume:DWORD
  12. EXTRN _MV_RightVolume:DWORD
  13. ;================
  14. ;
  15. ; MV_Mix8BitMonoFast
  16. ;
  17. ;================
  18. ; eax - position
  19. ; edx - rate
  20. ; ebx - start
  21. ; ecx - number of samples to mix
  22. MixBufferSize equ 256
  23. PROC MV_Mix8BitMonoFast_
  24. PUBLIC MV_Mix8BitMonoFast_
  25. ; Two at once
  26. pushad
  27. mov ebp, eax
  28. mov esi, ebx ; Source pointer
  29. ; Volume table ptr
  30. mov ebx, _MV_LeftVolume ; Since we're mono, use left volume
  31. mov eax,OFFSET apatch1+4 ; convice tasm to modify code...
  32. mov [eax],ebx
  33. mov eax,OFFSET apatch2+4 ; convice tasm to modify code...
  34. mov [eax],ebx
  35. ; Harsh Clip table ptr
  36. mov ebx, _MV_HarshClipTable
  37. add ebx, 128
  38. mov eax,OFFSET apatch3+2 ; convice tasm to modify code...
  39. mov [eax],ebx
  40. mov eax,OFFSET apatch4+2 ; convice tasm to modify code...
  41. mov [eax],ebx
  42. ; Rate scale ptr
  43. mov eax,OFFSET apatch5+2 ; convice tasm to modify code...
  44. mov [eax],edx
  45. mov eax,OFFSET apatch6+2 ; convice tasm to modify code...
  46. mov [eax],edx
  47. mov edi, _MV_MixDestination ; Get the position to write to
  48. ; Number of samples to mix
  49. shr ecx, 1 ; double sample count
  50. cmp ecx, 0
  51. je short exit8m
  52. ; eax - scratch
  53. ; ebx - scratch
  54. ; edx - scratch
  55. ; ecx - count
  56. ; edi - destination
  57. ; esi - source
  58. ; ebp - frac pointer
  59. ; apatch1 - volume table
  60. ; apatch2 - volume table
  61. ; apatch3 - harsh clip table
  62. ; apatch4 - harsh clip table
  63. ; apatch5 - sample rate
  64. ; apatch6 - sample rate
  65. mov eax,ebp ; begin calculating first sample
  66. add ebp,edx ; advance frac pointer
  67. shr eax,16 ; finish calculation for first sample
  68. mov ebx,ebp ; begin calculating second sample
  69. add ebp,edx ; advance frac pointer
  70. shr ebx,16 ; finish calculation for second sample
  71. movzx eax, byte ptr [esi+eax] ; get first sample
  72. movzx ebx, byte ptr [esi+ebx] ; get second sample
  73. ALIGN 4
  74. mix8Mloop:
  75. movzx edx, byte ptr [edi] ; get current sample from destination
  76. apatch1:
  77. movsx eax, byte ptr [2*eax+12345678h] ; volume translate first sample
  78. apatch2:
  79. movsx ebx, byte ptr [2*ebx+12345678h] ; volume translate second sample
  80. add eax, edx ; mix first sample
  81. movzx edx, byte ptr [edi + 1] ; get current sample from destination
  82. apatch3:
  83. mov eax, [eax + 12345678h] ; harsh clip new sample
  84. add ebx, edx ; mix second sample
  85. mov [edi], al ; write new sample to destination
  86. mov edx, ebp ; begin calculating third sample
  87. apatch4:
  88. mov ebx, [ebx + 12345678h] ; harsh clip new sample
  89. apatch5:
  90. add ebp,12345678h ; advance frac pointer
  91. shr edx, 16 ; finish calculation for third sample
  92. mov eax, ebp ; begin calculating fourth sample
  93. inc edi ; move destination to second sample
  94. shr eax, 16 ; finish calculation for fourth sample
  95. mov [edi], bl ; write new sample to destination
  96. apatch6:
  97. add ebp,12345678h ; advance frac pointer
  98. movzx ebx, byte ptr [esi+eax] ; get fourth sample
  99. movzx eax, byte ptr [esi+edx] ; get third sample
  100. inc edi ; move destination to third sample
  101. dec ecx ; decrement count
  102. jnz mix8Mloop ; loop
  103. mov _MV_MixDestination, edi ; Store the current write position
  104. mov _MV_MixPosition, ebp ; return position
  105. exit8m:
  106. popad
  107. ret
  108. ENDP MV_Mix8BitMonoFast_
  109. ;================
  110. ;
  111. ; MV_Mix8BitStereoFast
  112. ;
  113. ;================
  114. ; eax - position
  115. ; edx - rate
  116. ; ebx - start
  117. ; ecx - number of samples to mix
  118. PROC MV_Mix8BitStereoFast_
  119. PUBLIC MV_Mix8BitStereoFast_
  120. pushad
  121. mov ebp, eax
  122. mov esi, ebx ; Source pointer
  123. ; Volume table ptr
  124. mov ebx, _MV_LeftVolume
  125. mov eax,OFFSET bpatch1+4 ; convice tasm to modify code...
  126. mov [eax],ebx
  127. mov ebx, _MV_RightVolume
  128. mov eax,OFFSET bpatch2+4 ; convice tasm to modify code...
  129. mov [eax],ebx
  130. ; Rate scale ptr
  131. mov eax,OFFSET bpatch3+2 ; convice tasm to modify code...
  132. mov [eax],edx
  133. ; Harsh Clip table ptr
  134. mov ebx, _MV_HarshClipTable
  135. add ebx,128
  136. mov eax,OFFSET bpatch4+2 ; convice tasm to modify code...
  137. mov [eax],ebx
  138. mov eax,OFFSET bpatch5+2 ; convice tasm to modify code...
  139. mov [eax],ebx
  140. mov edi, _MV_MixDestination ; Get the position to write to
  141. ; Number of samples to mix
  142. cmp ecx, 0
  143. je short exit8S
  144. ; eax - scratch
  145. ; ebx - scratch
  146. ; edx - scratch
  147. ; ecx - count
  148. ; edi - destination
  149. ; esi - source
  150. ; ebp - frac pointer
  151. ; bpatch1 - left volume table
  152. ; bpatch2 - right volume table
  153. ; bpatch3 - sample rate
  154. ; bpatch4 - harsh clip table
  155. ; bpatch5 - harsh clip table
  156. mov eax,ebp ; begin calculating first sample
  157. shr eax,16 ; finish calculation for first sample
  158. movzx ebx, byte ptr [esi+eax] ; get first sample
  159. ALIGN 4
  160. mix8Sloop:
  161. bpatch1:
  162. movsx eax, byte ptr [2*ebx+12345678h] ; volume translate left sample
  163. movzx edx, byte ptr [edi] ; get current sample from destination
  164. bpatch2:
  165. movsx ebx, byte ptr [2*ebx+12345678h] ; volume translate right sample
  166. add eax, edx ; mix left sample
  167. bpatch3:
  168. add ebp,12345678h ; advance frac pointer
  169. movzx edx, byte ptr [edi+1] ; get current sample from destination
  170. bpatch4:
  171. mov eax, [eax + 12345678h] ; harsh clip left sample
  172. add ebx, edx ; mix right sample
  173. mov [edi], al ; write left sample to destination
  174. bpatch5:
  175. mov ebx, [ebx + 12345678h] ; harsh clip right sample
  176. inc edi ; move destination to second sample
  177. mov edx, ebp ; begin calculating second sample
  178. mov [edi], bl ; write right sample to destination
  179. shr edx, 16 ; finish calculation for second sample
  180. inc edi ; move destination to second sample
  181. movzx ebx, byte ptr [esi+edx] ; get second sample
  182. dec ecx ; decrement count
  183. jnz mix8Sloop ; loop
  184. mov _MV_MixDestination, edi ; Store the current write position
  185. mov _MV_MixPosition, ebp ; return position
  186. EXIT8S:
  187. popad
  188. ret
  189. ENDP MV_Mix8BitStereoFast_
  190. ;================
  191. ;
  192. ; MV_Mix8Bit1ChannelFast
  193. ;
  194. ;================
  195. ; eax - position
  196. ; edx - rate
  197. ; ebx - start
  198. ; ecx - number of samples to mix
  199. PROC MV_Mix8Bit1ChannelFast_
  200. PUBLIC MV_Mix8Bit1ChannelFast_
  201. ; Two at once
  202. pushad
  203. mov ebp, eax
  204. mov esi, ebx ; Source pointer
  205. ; Volume table ptr
  206. mov ebx, _MV_LeftVolume
  207. mov eax,OFFSET epatch1+4 ; convice tasm to modify code...
  208. mov [eax],ebx
  209. mov eax,OFFSET epatch2+4 ; convice tasm to modify code...
  210. mov [eax],ebx
  211. ; Harsh Clip table ptr
  212. mov ebx, _MV_HarshClipTable
  213. add ebx,128
  214. mov eax,OFFSET epatch3+2 ; convice tasm to modify code...
  215. mov [eax],ebx
  216. mov eax,OFFSET epatch4+2 ; convice tasm to modify code...
  217. mov [eax],ebx
  218. ; Rate scale ptr
  219. mov eax,OFFSET epatch5+2 ; convice tasm to modify code...
  220. mov [eax],edx
  221. mov eax,OFFSET epatch6+2 ; convice tasm to modify code...
  222. mov [eax],edx
  223. mov edi, _MV_MixDestination ; Get the position to write to
  224. ; Number of samples to mix
  225. shr ecx, 1 ; double sample count
  226. cmp ecx, 0
  227. je short exit81C
  228. ; eax - scratch
  229. ; ebx - scratch
  230. ; edx - scratch
  231. ; ecx - count
  232. ; edi - destination
  233. ; esi - source
  234. ; ebp - frac pointer
  235. ; apatch1 - volume table
  236. ; apatch2 - volume table
  237. ; apatch3 - harsh clip table
  238. ; apatch4 - harsh clip table
  239. ; apatch5 - sample rate
  240. ; apatch6 - sample rate
  241. mov eax,ebp ; begin calculating first sample
  242. add ebp,edx ; advance frac pointer
  243. shr eax,16 ; finish calculation for first sample
  244. mov ebx,ebp ; begin calculating second sample
  245. add ebp,edx ; advance frac pointer
  246. shr ebx,16 ; finish calculation for second sample
  247. movzx eax, byte ptr [esi+eax] ; get first sample
  248. movzx ebx, byte ptr [esi+ebx] ; get second sample
  249. ALIGN 4
  250. mix81Cloop:
  251. movzx edx, byte ptr [edi] ; get current sample from destination
  252. epatch1:
  253. movsx eax, byte ptr [2*eax+12345678h] ; volume translate first sample
  254. epatch2:
  255. movsx ebx, byte ptr [2*ebx+12345678h] ; volume translate second sample
  256. add eax, edx ; mix first sample
  257. movzx edx, byte ptr [edi + 2] ; get current sample from destination
  258. epatch3:
  259. mov eax, [eax + 12345678h] ; harsh clip new sample
  260. add ebx, edx ; mix second sample
  261. mov [edi], al ; write new sample to destination
  262. mov edx, ebp ; begin calculating third sample
  263. epatch4:
  264. mov ebx, [ebx + 12345678h] ; harsh clip new sample
  265. epatch5:
  266. add ebp,12345678h ; advance frac pointer
  267. shr edx, 16 ; finish calculation for third sample
  268. mov eax, ebp ; begin calculating fourth sample
  269. add edi, 2 ; move destination to second sample
  270. shr eax, 16 ; finish calculation for fourth sample
  271. mov [edi], bl ; write new sample to destination
  272. epatch6:
  273. add ebp,12345678h ; advance frac pointer
  274. movzx ebx, byte ptr [esi+eax] ; get fourth sample
  275. movzx eax, byte ptr [esi+edx] ; get third sample
  276. add edi, 2 ; move destination to third sample
  277. dec ecx ; decrement count
  278. jnz mix81Cloop ; loop
  279. mov _MV_MixDestination, edi ; Store the current write position
  280. mov _MV_MixPosition, ebp ; return position
  281. EXIT81C:
  282. popad
  283. ret
  284. ENDP MV_Mix8Bit1ChannelFast_
  285. ;================
  286. ;
  287. ; MV_Mix16BitMonoFast
  288. ;
  289. ;================
  290. ; eax - position
  291. ; edx - rate
  292. ; ebx - start
  293. ; ecx - number of samples to mix
  294. MixBufferSize equ 256
  295. PROC MV_Mix16BitMonoFast_
  296. PUBLIC MV_Mix16BitMonoFast_
  297. ; Two at once
  298. pushad
  299. mov ebp, eax
  300. mov esi, ebx ; Source pointer
  301. ; Volume table ptr
  302. mov ebx, _MV_LeftVolume
  303. mov eax,OFFSET cpatch1+4 ; convice tasm to modify code...
  304. mov [eax],ebx
  305. mov eax,OFFSET cpatch2+4 ; convice tasm to modify code...
  306. mov [eax],ebx
  307. ; Rate scale ptr
  308. mov eax,OFFSET cpatch3+2 ; convice tasm to modify code...
  309. mov [eax],edx
  310. mov eax,OFFSET cpatch4+2 ; convice tasm to modify code...
  311. mov [eax],edx
  312. mov edi, _MV_MixDestination ; Get the position to write to
  313. ; Number of samples to mix
  314. shr ecx, 1 ; double sample count
  315. cmp ecx, 0
  316. je exit16M
  317. ; eax - scratch
  318. ; ebx - scratch
  319. ; edx - scratch
  320. ; ecx - count
  321. ; edi - destination
  322. ; esi - source
  323. ; ebp - frac pointer
  324. ; cpatch1 - volume table
  325. ; cpatch2 - volume table
  326. ; cpatch3 - sample rate
  327. ; cpatch4 - sample rate
  328. mov eax,ebp ; begin calculating first sample
  329. add ebp,edx ; advance frac pointer
  330. shr eax,16 ; finish calculation for first sample
  331. mov ebx,ebp ; begin calculating second sample
  332. add ebp,edx ; advance frac pointer
  333. shr ebx,16 ; finish calculation for second sample
  334. movzx eax, byte ptr [esi+eax] ; get first sample
  335. movzx ebx, byte ptr [esi+ebx] ; get second sample
  336. ALIGN 4
  337. mix16Mloop:
  338. movsx edx, word ptr [edi] ; get current sample from destination
  339. cpatch1:
  340. movsx eax, word ptr [2*eax+12345678h] ; volume translate first sample
  341. cpatch2:
  342. movsx ebx, word ptr [2*ebx+12345678h] ; volume translate second sample
  343. add eax, edx ; mix first sample
  344. movsx edx, word ptr [edi + 2] ; get current sample from destination
  345. cmp eax, -32768 ; Harsh clip sample
  346. jge short m16skip1
  347. mov eax, -32768
  348. jmp short m16skip2
  349. m16skip1:
  350. cmp eax, 32767
  351. jle short m16skip2
  352. mov eax, 32767
  353. m16skip2:
  354. add ebx, edx ; mix second sample
  355. mov [edi], ax ; write new sample to destination
  356. mov edx, ebp ; begin calculating third sample
  357. cmp ebx, -32768 ; Harsh clip sample
  358. jge short m16skip3
  359. mov ebx, -32768
  360. jmp short m16skip4
  361. m16skip3:
  362. cmp ebx, 32767
  363. jle short m16skip4
  364. mov ebx, 32767
  365. m16skip4:
  366. cpatch3:
  367. add ebp,12345678h ; advance frac pointer
  368. shr edx, 16 ; finish calculation for third sample
  369. mov eax, ebp ; begin calculating fourth sample
  370. mov [edi + 2], bx ; write new sample to destination
  371. shr eax, 16 ; finish calculation for fourth sample
  372. cpatch4:
  373. add ebp,12345678h ; advance frac pointer
  374. movzx ebx, byte ptr [esi+eax] ; get fourth sample
  375. add edi, 4 ; move destination to third sample
  376. movzx eax, byte ptr [esi+edx] ; get third sample
  377. dec ecx ; decrement count
  378. jnz mix16Mloop ; loop
  379. mov _MV_MixDestination, edi ; Store the current write position
  380. mov _MV_MixPosition, ebp ; return position
  381. EXIT16M:
  382. popad
  383. ret
  384. ENDP MV_Mix16BitMonoFast_
  385. ;================
  386. ;
  387. ; MV_Mix16BitStereoFast
  388. ;
  389. ;================
  390. ; eax - position
  391. ; edx - rate
  392. ; ebx - start
  393. ; ecx - number of samples to mix
  394. PROC MV_Mix16BitStereoFast_
  395. PUBLIC MV_Mix16BitStereoFast_
  396. pushad
  397. mov ebp, eax
  398. mov esi, ebx ; Source pointer
  399. ; Volume table ptr
  400. mov ebx, _MV_LeftVolume
  401. mov eax,OFFSET dpatch1+4 ; convice tasm to modify code...
  402. mov [eax],ebx
  403. mov ebx, _MV_RightVolume
  404. mov eax,OFFSET dpatch2+4 ; convice tasm to modify code...
  405. mov [eax],ebx
  406. ; Rate scale ptr
  407. mov eax,OFFSET dpatch3+2 ; convice tasm to modify code...
  408. mov [eax],edx
  409. mov edi, _MV_MixDestination ; Get the position to write to
  410. ; Number of samples to mix
  411. cmp ecx, 0
  412. je exit16S
  413. ; eax - scratch
  414. ; ebx - scratch
  415. ; edx - scratch
  416. ; ecx - count
  417. ; edi - destination
  418. ; esi - source
  419. ; ebp - frac pointer
  420. ; dpatch1 - left volume table
  421. ; dpatch2 - right volume table
  422. ; dpatch3 - sample rate
  423. mov eax,ebp ; begin calculating first sample
  424. shr eax,16 ; finish calculation for first sample
  425. movzx ebx, byte ptr [esi+eax] ; get first sample
  426. ALIGN 4
  427. mix16Sloop:
  428. dpatch1:
  429. movsx eax, word ptr [2*ebx+12345678h] ; volume translate left sample
  430. movsx edx, word ptr [edi] ; get current sample from destination
  431. dpatch2:
  432. movsx ebx, word ptr [2*ebx+12345678h] ; volume translate right sample
  433. add eax, edx ; mix left sample
  434. dpatch3:
  435. add ebp,12345678h ; advance frac pointer
  436. movsx edx, word ptr [edi+2] ; get current sample from destination
  437. cmp eax, -32768 ; Harsh clip sample
  438. jge short s16skip1
  439. mov eax, -32768
  440. jmp short s16skip2
  441. s16skip1:
  442. cmp eax, 32767
  443. jle short s16skip2
  444. mov eax, 32767
  445. s16skip2:
  446. add ebx, edx ; mix right sample
  447. mov [edi], ax ; write left sample to destination
  448. cmp ebx, -32768 ; Harsh clip sample
  449. jge short s16skip3
  450. mov ebx, -32768
  451. jmp short s16skip4
  452. s16skip3:
  453. cmp ebx, 32767
  454. jle short s16skip4
  455. mov ebx, 32767
  456. s16skip4:
  457. mov edx, ebp ; begin calculating second sample
  458. mov [edi+2], bx ; write right sample to destination
  459. shr edx, 16 ; finish calculation for second sample
  460. add edi, 4 ; move destination to second sample
  461. movzx ebx, byte ptr [esi+edx] ; get second sample
  462. dec ecx ; decrement count
  463. jnz mix16Sloop ; loop
  464. mov _MV_MixDestination, edi ; Store the current write position
  465. mov _MV_MixPosition, ebp ; return position
  466. exit16S:
  467. popad
  468. ret
  469. ENDP MV_Mix16BitStereoFast_
  470. ;================
  471. ;
  472. ; MV_Mix16Bit1ChannelFast
  473. ;
  474. ;================
  475. ; eax - position
  476. ; edx - rate
  477. ; ebx - start
  478. ; ecx - number of samples to mix
  479. MixBufferSize equ 256
  480. PROC MV_Mix16Bit1ChannelFast_
  481. PUBLIC MV_Mix16Bit1ChannelFast_
  482. ; Two at once
  483. pushad
  484. mov ebp, eax
  485. mov esi, ebx ; Source pointer
  486. ; Volume table ptr
  487. mov ebx, _MV_LeftVolume
  488. mov eax,OFFSET fpatch1+4 ; convice tasm to modify code...
  489. mov [eax],ebx
  490. mov eax,OFFSET fpatch2+4 ; convice tasm to modify code...
  491. mov [eax],ebx
  492. ; Rate scale ptr
  493. mov eax,OFFSET fpatch3+2 ; convice tasm to modify code...
  494. mov [eax],edx
  495. mov eax,OFFSET fpatch4+2 ; convice tasm to modify code...
  496. mov [eax],edx
  497. mov edi, _MV_MixDestination ; Get the position to write to
  498. ; Number of samples to mix
  499. shr ecx, 1 ; double sample count
  500. cmp ecx, 0
  501. je exit161C
  502. ; eax - scratch
  503. ; ebx - scratch
  504. ; edx - scratch
  505. ; ecx - count
  506. ; edi - destination
  507. ; esi - source
  508. ; ebp - frac pointer
  509. ; cpatch1 - volume table
  510. ; cpatch2 - volume table
  511. ; cpatch3 - sample rate
  512. ; cpatch4 - sample rate
  513. mov eax,ebp ; begin calculating first sample
  514. add ebp,edx ; advance frac pointer
  515. shr eax,16 ; finish calculation for first sample
  516. mov ebx,ebp ; begin calculating second sample
  517. add ebp,edx ; advance frac pointer
  518. shr ebx,16 ; finish calculation for second sample
  519. movzx eax, byte ptr [esi+eax] ; get first sample
  520. movzx ebx, byte ptr [esi+ebx] ; get second sample
  521. ALIGN 4
  522. mix161Cloop:
  523. movsx edx, word ptr [edi] ; get current sample from destination
  524. fpatch1:
  525. movsx eax, word ptr [2*eax+12345678h] ; volume translate first sample
  526. fpatch2:
  527. movsx ebx, word ptr [2*ebx+12345678h] ; volume translate second sample
  528. add eax, edx ; mix first sample
  529. movsx edx, word ptr [edi + 4] ; get current sample from destination
  530. cmp eax, -32768 ; Harsh clip sample
  531. jge short m16c1skip1
  532. mov eax, -32768
  533. jmp short m16c1skip2
  534. m16c1skip1:
  535. cmp eax, 32767
  536. jle short m16c1skip2
  537. mov eax, 32767
  538. m16c1skip2:
  539. add ebx, edx ; mix second sample
  540. mov [edi], ax ; write new sample to destination
  541. mov edx, ebp ; begin calculating third sample
  542. cmp ebx, -32768 ; Harsh clip sample
  543. jge short m16c1skip3
  544. mov ebx, -32768
  545. jmp short m16c1skip4
  546. m16c1skip3:
  547. cmp ebx, 32767
  548. jle short m16c1skip4
  549. mov ebx, 32767
  550. m16c1skip4:
  551. fpatch3:
  552. add ebp,12345678h ; advance frac pointer
  553. shr edx, 16 ; finish calculation for third sample
  554. mov eax, ebp ; begin calculating fourth sample
  555. mov [edi + 4], bx ; write new sample to destination
  556. shr eax, 16 ; finish calculation for fourth sample
  557. fpatch4:
  558. add ebp,12345678h ; advance frac pointer
  559. movzx ebx, byte ptr [esi+eax] ; get fourth sample
  560. add edi, 8 ; move destination to third sample
  561. movzx eax, byte ptr [esi+edx] ; get third sample
  562. dec ecx ; decrement count
  563. jnz mix161Cloop ; loop
  564. mov _MV_MixDestination, edi ; Store the current write position
  565. mov _MV_MixPosition, ebp ; return position
  566. exit161C:
  567. popad
  568. ret
  569. ENDP MV_Mix16Bit1ChannelFast_
  570. ENDS
  571. END