MV_MIX5.ASM 24 KB

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