d_draw16.asm 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925
  1. .386P
  2. .model FLAT
  3. externdef _d_zistepu:dword
  4. externdef _d_pzbuffer:dword
  5. externdef _d_zistepv:dword
  6. externdef _d_zrowbytes:dword
  7. externdef _d_ziorigin:dword
  8. externdef _r_turb_s:dword
  9. externdef _r_turb_t:dword
  10. externdef _r_turb_pdest:dword
  11. externdef _r_turb_spancount:dword
  12. externdef _r_turb_turb:dword
  13. externdef _r_turb_pbase:dword
  14. externdef _r_turb_sstep:dword
  15. externdef _r_turb_tstep:dword
  16. externdef _r_bmodelactive:dword
  17. externdef _d_sdivzstepu:dword
  18. externdef _d_tdivzstepu:dword
  19. externdef _d_sdivzstepv:dword
  20. externdef _d_tdivzstepv:dword
  21. externdef _d_sdivzorigin:dword
  22. externdef _d_tdivzorigin:dword
  23. externdef _sadjust:dword
  24. externdef _tadjust:dword
  25. externdef _bbextents:dword
  26. externdef _bbextentt:dword
  27. externdef _cacheblock:dword
  28. externdef _d_viewbuffer:dword
  29. externdef _cachewidth:dword
  30. externdef _d_pzbuffer:dword
  31. externdef _d_zrowbytes:dword
  32. externdef _d_zwidth:dword
  33. externdef _d_scantable:dword
  34. externdef _r_lightptr:dword
  35. externdef _r_numvblocks:dword
  36. externdef _prowdestbase:dword
  37. externdef _pbasesource:dword
  38. externdef _r_lightwidth:dword
  39. externdef _lightright:dword
  40. externdef _lightrightstep:dword
  41. externdef _lightdeltastep:dword
  42. externdef _lightdelta:dword
  43. externdef _lightright:dword
  44. externdef _lightdelta:dword
  45. externdef _sourcetstep:dword
  46. externdef _surfrowbytes:dword
  47. externdef _lightrightstep:dword
  48. externdef _lightdeltastep:dword
  49. externdef _r_sourcemax:dword
  50. externdef _r_stepback:dword
  51. externdef _colormap:dword
  52. externdef _blocksize:dword
  53. externdef _sourcesstep:dword
  54. externdef _lightleft:dword
  55. externdef _blockdivshift:dword
  56. externdef _blockdivmask:dword
  57. externdef _lightleftstep:dword
  58. externdef _r_origin:dword
  59. externdef _r_ppn:dword
  60. externdef _r_pup:dword
  61. externdef _r_pright:dword
  62. externdef _ycenter:dword
  63. externdef _xcenter:dword
  64. externdef _d_vrectbottom_particle:dword
  65. externdef _d_vrectright_particle:dword
  66. externdef _d_vrecty:dword
  67. externdef _d_vrectx:dword
  68. externdef _d_pix_shift:dword
  69. externdef _d_pix_min:dword
  70. externdef _d_pix_max:dword
  71. externdef _d_y_aspect_shift:dword
  72. externdef _screenwidth:dword
  73. externdef _vright:dword
  74. externdef _vup:dword
  75. externdef _vpn:dword
  76. externdef _BOPS_Error:dword
  77. externdef _snd_scaletable:dword
  78. externdef _paintbuffer:dword
  79. externdef _snd_linear_count:dword
  80. externdef _snd_p:dword
  81. externdef _snd_vol:dword
  82. externdef _snd_out:dword
  83. externdef _r_leftclipped:dword
  84. externdef _r_leftenter:dword
  85. externdef _r_rightclipped:dword
  86. externdef _r_rightenter:dword
  87. externdef _modelorg:dword
  88. externdef _xscale:dword
  89. externdef _r_refdef:dword
  90. externdef _yscale:dword
  91. externdef _r_leftexit:dword
  92. externdef _r_rightexit:dword
  93. externdef _r_lastvertvalid:dword
  94. externdef _cacheoffset:dword
  95. externdef _newedges:dword
  96. externdef _removeedges:dword
  97. externdef _r_pedge:dword
  98. externdef _r_framecount:dword
  99. externdef _r_u1:dword
  100. externdef _r_emitted:dword
  101. externdef _edge_p:dword
  102. externdef _surface_p:dword
  103. externdef _surfaces:dword
  104. externdef _r_lzi1:dword
  105. externdef _r_v1:dword
  106. externdef _r_ceilv1:dword
  107. externdef _r_nearzi:dword
  108. externdef _r_nearzionly:dword
  109. externdef _edge_aftertail:dword
  110. externdef _edge_tail:dword
  111. externdef _current_iv:dword
  112. externdef _edge_head_u_shift20:dword
  113. externdef _span_p:dword
  114. externdef _edge_head:dword
  115. externdef _fv:dword
  116. externdef _edge_tail_u_shift20:dword
  117. externdef _r_apverts:dword
  118. externdef _r_anumverts:dword
  119. externdef _aliastransform:dword
  120. externdef _r_avertexnormals:dword
  121. externdef _r_plightvec:dword
  122. externdef _r_ambientlight:dword
  123. externdef _r_shadelight:dword
  124. externdef _aliasxcenter:dword
  125. externdef _aliasycenter:dword
  126. externdef _a_sstepxfrac:dword
  127. externdef _r_affinetridesc:dword
  128. externdef _acolormap:dword
  129. externdef _d_pcolormap:dword
  130. externdef _r_affinetridesc:dword
  131. externdef _d_sfrac:dword
  132. externdef _d_ptex:dword
  133. externdef _d_pedgespanpackage:dword
  134. externdef _d_tfrac:dword
  135. externdef _d_light:dword
  136. externdef _d_zi:dword
  137. externdef _d_pdest:dword
  138. externdef _d_pz:dword
  139. externdef _d_aspancount:dword
  140. externdef _erroradjustup:dword
  141. externdef _errorterm:dword
  142. externdef _d_xdenom:dword
  143. externdef _r_p0:dword
  144. externdef _r_p1:dword
  145. externdef _r_p2:dword
  146. externdef _a_tstepxfrac:dword
  147. externdef _r_sstepx:dword
  148. externdef _r_tstepx:dword
  149. externdef _a_ststepxwhole:dword
  150. externdef _zspantable:dword
  151. externdef _skintable:dword
  152. externdef _r_zistepx:dword
  153. externdef _erroradjustdown:dword
  154. externdef _d_countextrastep:dword
  155. externdef _ubasestep:dword
  156. externdef _a_ststepxwhole:dword
  157. externdef _a_tstepxfrac:dword
  158. externdef _r_lstepx:dword
  159. externdef _a_spans:dword
  160. externdef _erroradjustdown:dword
  161. externdef _d_pdestextrastep:dword
  162. externdef _d_pzextrastep:dword
  163. externdef _d_sfracextrastep:dword
  164. externdef _d_ptexextrastep:dword
  165. externdef _d_countextrastep:dword
  166. externdef _d_tfracextrastep:dword
  167. externdef _d_lightextrastep:dword
  168. externdef _d_ziextrastep:dword
  169. externdef _d_pdestbasestep:dword
  170. externdef _d_pzbasestep:dword
  171. externdef _d_sfracbasestep:dword
  172. externdef _d_ptexbasestep:dword
  173. externdef _ubasestep:dword
  174. externdef _d_tfracbasestep:dword
  175. externdef _d_lightbasestep:dword
  176. externdef _d_zibasestep:dword
  177. externdef _zspantable:dword
  178. externdef _r_lstepy:dword
  179. externdef _r_sstepy:dword
  180. externdef _r_tstepy:dword
  181. externdef _r_zistepy:dword
  182. externdef _D_PolysetSetEdgeTable:dword
  183. externdef _D_RasterizeAliasPolySmooth:dword
  184. externdef float_point5:dword
  185. externdef Float2ToThe31nd:dword
  186. externdef izistep:dword
  187. externdef izi:dword
  188. externdef FloatMinus2ToThe31nd:dword
  189. externdef float_1:dword
  190. externdef float_particle_z_clip:dword
  191. externdef float_minus_1:dword
  192. externdef float_0:dword
  193. externdef fp_16:dword
  194. externdef fp_64k:dword
  195. externdef fp_1m:dword
  196. externdef fp_1m_minus_1:dword
  197. externdef fp_8:dword
  198. externdef entryvec_table:dword
  199. externdef advancetable:dword
  200. externdef sstep:dword
  201. externdef tstep:dword
  202. externdef pspantemp:dword
  203. externdef counttemp:dword
  204. externdef jumptemp:dword
  205. externdef reciprocal_table:dword
  206. externdef DP_Count:dword
  207. externdef DP_u:dword
  208. externdef DP_v:dword
  209. externdef DP_32768:dword
  210. externdef DP_Color:dword
  211. externdef DP_Pix:dword
  212. externdef DP_EntryTable:dword
  213. externdef pbase:dword
  214. externdef s:dword
  215. externdef t:dword
  216. externdef sfracf:dword
  217. externdef tfracf:dword
  218. externdef snext:dword
  219. externdef tnext:dword
  220. externdef spancountminus1:dword
  221. externdef zi16stepu:dword
  222. externdef sdivz16stepu:dword
  223. externdef tdivz16stepu:dword
  224. externdef zi8stepu:dword
  225. externdef sdivz8stepu:dword
  226. externdef tdivz8stepu:dword
  227. externdef reciprocal_table_16:dword
  228. externdef entryvec_table_16:dword
  229. externdef ceil_cw:dword
  230. externdef single_cw:dword
  231. externdef fp_64kx64k:dword
  232. externdef pz:dword
  233. externdef spr8entryvec_table:dword
  234. _DATA SEGMENT
  235. _DATA ENDS
  236. _TEXT SEGMENT
  237. LClampHigh0:
  238. mov esi,ds:dword ptr[_bbextents]
  239. jmp LClampReentry0
  240. LClampHighOrLow0:
  241. jg LClampHigh0
  242. xor esi,esi
  243. jmp LClampReentry0
  244. LClampHigh1:
  245. mov edx,ds:dword ptr[_bbextentt]
  246. jmp LClampReentry1
  247. LClampHighOrLow1:
  248. jg LClampHigh1
  249. xor edx,edx
  250. jmp LClampReentry1
  251. LClampLow2:
  252. mov ebp,4096
  253. jmp LClampReentry2
  254. LClampHigh2:
  255. mov ebp,ds:dword ptr[_bbextents]
  256. jmp LClampReentry2
  257. LClampLow3:
  258. mov ecx,4096
  259. jmp LClampReentry3
  260. LClampHigh3:
  261. mov ecx,ds:dword ptr[_bbextentt]
  262. jmp LClampReentry3
  263. LClampLow4:
  264. mov eax,4096
  265. jmp LClampReentry4
  266. LClampHigh4:
  267. mov eax,ds:dword ptr[_bbextents]
  268. jmp LClampReentry4
  269. LClampLow5:
  270. mov ebx,4096
  271. jmp LClampReentry5
  272. LClampHigh5:
  273. mov ebx,ds:dword ptr[_bbextentt]
  274. jmp LClampReentry5
  275. align 4
  276. public _D_DrawSpans16
  277. _D_DrawSpans16:
  278. push ebp
  279. push edi
  280. push esi
  281. push ebx
  282. fld ds:dword ptr[_d_sdivzstepu]
  283. fmul ds:dword ptr[fp_16]
  284. mov edx,ds:dword ptr[_cacheblock]
  285. fld ds:dword ptr[_d_tdivzstepu]
  286. fmul ds:dword ptr[fp_16]
  287. mov ebx,ds:dword ptr[4+16+esp]
  288. fld ds:dword ptr[_d_zistepu]
  289. fmul ds:dword ptr[fp_16]
  290. mov ds:dword ptr[pbase],edx
  291. fstp ds:dword ptr[zi16stepu]
  292. fstp ds:dword ptr[tdivz16stepu]
  293. fstp ds:dword ptr[sdivz16stepu]
  294. LSpanLoop:
  295. fild ds:dword ptr[4+ebx]
  296. fild ds:dword ptr[0+ebx]
  297. fld st(1)
  298. fmul ds:dword ptr[_d_sdivzstepv]
  299. fld st(1)
  300. fmul ds:dword ptr[_d_sdivzstepu]
  301. fld st(2)
  302. fmul ds:dword ptr[_d_tdivzstepu]
  303. fxch st(1)
  304. faddp st(2),st(0)
  305. fxch st(1)
  306. fld st(3)
  307. fmul ds:dword ptr[_d_tdivzstepv]
  308. fxch st(1)
  309. fadd ds:dword ptr[_d_sdivzorigin]
  310. fxch st(4)
  311. fmul ds:dword ptr[_d_zistepv]
  312. fxch st(1)
  313. faddp st(2),st(0)
  314. fxch st(2)
  315. fmul ds:dword ptr[_d_zistepu]
  316. fxch st(1)
  317. fadd ds:dword ptr[_d_tdivzorigin]
  318. fxch st(2)
  319. faddp st(1),st(0)
  320. fld ds:dword ptr[fp_64k]
  321. fxch st(1)
  322. fadd ds:dword ptr[_d_ziorigin]
  323. fdiv st(1),st(0)
  324. mov ecx,ds:dword ptr[_d_viewbuffer]
  325. mov eax,ds:dword ptr[4+ebx]
  326. mov ds:dword ptr[pspantemp],ebx
  327. mov edx,ds:dword ptr[_tadjust]
  328. mov esi,ds:dword ptr[_sadjust]
  329. mov edi,ds:dword ptr[_d_scantable+eax*4]
  330. add edi,ecx
  331. mov ecx,ds:dword ptr[0+ebx]
  332. add edi,ecx
  333. mov ecx,ds:dword ptr[8+ebx]
  334. cmp ecx,16
  335. ja LSetupNotLast1
  336. dec ecx
  337. jz LCleanup1
  338. mov ds:dword ptr[spancountminus1],ecx
  339. fxch st(1)
  340. fld st(0)
  341. fmul st(0),st(4)
  342. fxch st(1)
  343. fmul st(0),st(3)
  344. fxch st(1)
  345. fistp ds:dword ptr[s]
  346. fistp ds:dword ptr[t]
  347. fild ds:dword ptr[spancountminus1]
  348. fld ds:dword ptr[_d_tdivzstepu]
  349. fld ds:dword ptr[_d_zistepu]
  350. fmul st(0),st(2)
  351. fxch st(1)
  352. fmul st(0),st(2)
  353. fxch st(2)
  354. fmul ds:dword ptr[_d_sdivzstepu]
  355. fxch st(1)
  356. faddp st(3),st(0)
  357. fxch st(1)
  358. faddp st(3),st(0)
  359. faddp st(3),st(0)
  360. fld ds:dword ptr[fp_64k]
  361. fdiv st(0),st(1)
  362. jmp LFDIVInFlight1
  363. LCleanup1:
  364. fxch st(1)
  365. fld st(0)
  366. fmul st(0),st(4)
  367. fxch st(1)
  368. fmul st(0),st(3)
  369. fxch st(1)
  370. fistp ds:dword ptr[s]
  371. fistp ds:dword ptr[t]
  372. jmp LFDIVInFlight1
  373. align 4
  374. LSetupNotLast1:
  375. fxch st(1)
  376. fld st(0)
  377. fmul st(0),st(4)
  378. fxch st(1)
  379. fmul st(0),st(3)
  380. fxch st(1)
  381. fistp ds:dword ptr[s]
  382. fistp ds:dword ptr[t]
  383. fadd ds:dword ptr[zi16stepu]
  384. fxch st(2)
  385. fadd ds:dword ptr[sdivz16stepu]
  386. fxch st(2)
  387. fld ds:dword ptr[tdivz16stepu]
  388. faddp st(2),st(0)
  389. fld ds:dword ptr[fp_64k]
  390. fdiv st(0),st(1)
  391. LFDIVInFlight1:
  392. add esi,ds:dword ptr[s]
  393. add edx,ds:dword ptr[t]
  394. mov ebx,ds:dword ptr[_bbextents]
  395. mov ebp,ds:dword ptr[_bbextentt]
  396. cmp esi,ebx
  397. ja LClampHighOrLow0
  398. LClampReentry0:
  399. mov ds:dword ptr[s],esi
  400. mov ebx,ds:dword ptr[pbase]
  401. shl esi,16
  402. cmp edx,ebp
  403. mov ds:dword ptr[sfracf],esi
  404. ja LClampHighOrLow1
  405. LClampReentry1:
  406. mov ds:dword ptr[t],edx
  407. mov esi,ds:dword ptr[s]
  408. shl edx,16
  409. mov eax,ds:dword ptr[t]
  410. sar esi,16
  411. mov ds:dword ptr[tfracf],edx
  412. sar eax,16
  413. mov edx,ds:dword ptr[_cachewidth]
  414. imul eax,edx
  415. add esi,ebx
  416. add esi,eax
  417. cmp ecx,16
  418. jna LLastSegment
  419. LNotLastSegment:
  420. fld st(0)
  421. fmul st(0),st(4)
  422. fxch st(1)
  423. fmul st(0),st(3)
  424. fxch st(1)
  425. fistp ds:dword ptr[snext]
  426. fistp ds:dword ptr[tnext]
  427. mov eax,ds:dword ptr[snext]
  428. mov edx,ds:dword ptr[tnext]
  429. mov bl,ds:byte ptr[esi]
  430. sub ecx,16
  431. mov ebp,ds:dword ptr[_sadjust]
  432. mov ds:dword ptr[counttemp],ecx
  433. mov ecx,ds:dword ptr[_tadjust]
  434. mov ds:byte ptr[edi],bl
  435. add ebp,eax
  436. add ecx,edx
  437. mov eax,ds:dword ptr[_bbextents]
  438. mov edx,ds:dword ptr[_bbextentt]
  439. cmp ebp,4096
  440. jl LClampLow2
  441. cmp ebp,eax
  442. ja LClampHigh2
  443. LClampReentry2:
  444. cmp ecx,4096
  445. jl LClampLow3
  446. cmp ecx,edx
  447. ja LClampHigh3
  448. LClampReentry3:
  449. mov ds:dword ptr[snext],ebp
  450. mov ds:dword ptr[tnext],ecx
  451. sub ebp,ds:dword ptr[s]
  452. sub ecx,ds:dword ptr[t]
  453. mov eax,ecx
  454. mov edx,ebp
  455. sar eax,20
  456. jz LZero
  457. sar edx,20
  458. mov ebx,ds:dword ptr[_cachewidth]
  459. imul eax,ebx
  460. jmp LSetUp1
  461. LZero:
  462. sar edx,20
  463. mov ebx,ds:dword ptr[_cachewidth]
  464. LSetUp1:
  465. add eax,edx
  466. mov edx,ds:dword ptr[tfracf]
  467. mov ds:dword ptr[advancetable+4],eax
  468. add eax,ebx
  469. shl ebp,12
  470. mov ebx,ds:dword ptr[sfracf]
  471. shl ecx,12
  472. mov ds:dword ptr[advancetable],eax
  473. mov ds:dword ptr[tstep],ecx
  474. add edx,ecx
  475. sbb ecx,ecx
  476. add ebx,ebp
  477. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  478. add edx,ds:dword ptr[tstep]
  479. sbb ecx,ecx
  480. mov al,ds:byte ptr[esi]
  481. add ebx,ebp
  482. mov ds:byte ptr[1+edi],al
  483. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  484. add edx,ds:dword ptr[tstep]
  485. sbb ecx,ecx
  486. add ebx,ebp
  487. mov al,ds:byte ptr[esi]
  488. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  489. add edx,ds:dword ptr[tstep]
  490. sbb ecx,ecx
  491. mov ds:byte ptr[2+edi],al
  492. add ebx,ebp
  493. mov al,ds:byte ptr[esi]
  494. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  495. add edx,ds:dword ptr[tstep]
  496. sbb ecx,ecx
  497. mov ds:byte ptr[3+edi],al
  498. add ebx,ebp
  499. mov al,ds:byte ptr[esi]
  500. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  501. add edx,ds:dword ptr[tstep]
  502. sbb ecx,ecx
  503. mov ds:byte ptr[4+edi],al
  504. add ebx,ebp
  505. mov al,ds:byte ptr[esi]
  506. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  507. add edx,ds:dword ptr[tstep]
  508. sbb ecx,ecx
  509. mov ds:byte ptr[5+edi],al
  510. add ebx,ebp
  511. mov al,ds:byte ptr[esi]
  512. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  513. add edx,ds:dword ptr[tstep]
  514. sbb ecx,ecx
  515. mov ds:byte ptr[6+edi],al
  516. add ebx,ebp
  517. mov al,ds:byte ptr[esi]
  518. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  519. add edx,ds:dword ptr[tstep]
  520. sbb ecx,ecx
  521. mov ds:byte ptr[7+edi],al
  522. add ebx,ebp
  523. mov al,ds:byte ptr[esi]
  524. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  525. mov ecx,ds:dword ptr[counttemp]
  526. cmp ecx,16
  527. ja LSetupNotLast2
  528. dec ecx
  529. jz LFDIVInFlight2
  530. mov ds:dword ptr[spancountminus1],ecx
  531. fild ds:dword ptr[spancountminus1]
  532. fld ds:dword ptr[_d_zistepu]
  533. fmul st(0),st(1)
  534. fld ds:dword ptr[_d_tdivzstepu]
  535. fmul st(0),st(2)
  536. fxch st(1)
  537. faddp st(3),st(0)
  538. fxch st(1)
  539. fmul ds:dword ptr[_d_sdivzstepu]
  540. fxch st(1)
  541. faddp st(3),st(0)
  542. fld ds:dword ptr[fp_64k]
  543. fxch st(1)
  544. faddp st(4),st(0)
  545. fdiv st(0),st(1)
  546. jmp LFDIVInFlight2
  547. align 4
  548. LSetupNotLast2:
  549. fadd ds:dword ptr[zi16stepu]
  550. fxch st(2)
  551. fadd ds:dword ptr[sdivz16stepu]
  552. fxch st(2)
  553. fld ds:dword ptr[tdivz16stepu]
  554. faddp st(2),st(0)
  555. fld ds:dword ptr[fp_64k]
  556. fdiv st(0),st(1)
  557. LFDIVInFlight2:
  558. mov ds:dword ptr[counttemp],ecx
  559. add edx,ds:dword ptr[tstep]
  560. sbb ecx,ecx
  561. mov ds:byte ptr[8+edi],al
  562. add ebx,ebp
  563. mov al,ds:byte ptr[esi]
  564. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  565. add edx,ds:dword ptr[tstep]
  566. sbb ecx,ecx
  567. mov ds:byte ptr[9+edi],al
  568. add ebx,ebp
  569. mov al,ds:byte ptr[esi]
  570. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  571. add edx,ds:dword ptr[tstep]
  572. sbb ecx,ecx
  573. mov ds:byte ptr[10+edi],al
  574. add ebx,ebp
  575. mov al,ds:byte ptr[esi]
  576. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  577. add edx,ds:dword ptr[tstep]
  578. sbb ecx,ecx
  579. mov ds:byte ptr[11+edi],al
  580. add ebx,ebp
  581. mov al,ds:byte ptr[esi]
  582. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  583. add edx,ds:dword ptr[tstep]
  584. sbb ecx,ecx
  585. mov ds:byte ptr[12+edi],al
  586. add ebx,ebp
  587. mov al,ds:byte ptr[esi]
  588. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  589. add edx,ds:dword ptr[tstep]
  590. sbb ecx,ecx
  591. mov ds:byte ptr[13+edi],al
  592. add ebx,ebp
  593. mov al,ds:byte ptr[esi]
  594. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  595. add edx,ds:dword ptr[tstep]
  596. sbb ecx,ecx
  597. mov ds:byte ptr[14+edi],al
  598. add ebx,ebp
  599. mov al,ds:byte ptr[esi]
  600. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  601. add edi,16
  602. mov ds:dword ptr[tfracf],edx
  603. mov edx,ds:dword ptr[snext]
  604. mov ds:dword ptr[sfracf],ebx
  605. mov ebx,ds:dword ptr[tnext]
  606. mov ds:dword ptr[s],edx
  607. mov ds:dword ptr[t],ebx
  608. mov ecx,ds:dword ptr[counttemp]
  609. cmp ecx,16
  610. mov ds:byte ptr[-1+edi],al
  611. ja LNotLastSegment
  612. LLastSegment:
  613. test ecx,ecx
  614. jz LNoSteps
  615. fld st(0)
  616. fmul st(0),st(4)
  617. fxch st(1)
  618. fmul st(0),st(3)
  619. fxch st(1)
  620. fistp ds:dword ptr[snext]
  621. fistp ds:dword ptr[tnext]
  622. mov al,ds:byte ptr[esi]
  623. mov ebx,ds:dword ptr[_tadjust]
  624. mov ds:byte ptr[edi],al
  625. mov eax,ds:dword ptr[_sadjust]
  626. add eax,ds:dword ptr[snext]
  627. add ebx,ds:dword ptr[tnext]
  628. mov ebp,ds:dword ptr[_bbextents]
  629. mov edx,ds:dword ptr[_bbextentt]
  630. cmp eax,4096
  631. jl LClampLow4
  632. cmp eax,ebp
  633. ja LClampHigh4
  634. LClampReentry4:
  635. mov ds:dword ptr[snext],eax
  636. cmp ebx,4096
  637. jl LClampLow5
  638. cmp ebx,edx
  639. ja LClampHigh5
  640. LClampReentry5:
  641. cmp ecx,1
  642. je LOnlyOneStep
  643. sub eax,ds:dword ptr[s]
  644. sub ebx,ds:dword ptr[t]
  645. add eax,eax
  646. add ebx,ebx
  647. imul ds:dword ptr[reciprocal_table_16-8+ecx*4]
  648. mov ebp,edx
  649. mov eax,ebx
  650. imul ds:dword ptr[reciprocal_table_16-8+ecx*4]
  651. LSetEntryvec:
  652. mov ebx,ds:dword ptr[entryvec_table_16+ecx*4]
  653. mov eax,edx
  654. mov ds:dword ptr[jumptemp],ebx
  655. mov ecx,ebp
  656. sar edx,16
  657. mov ebx,ds:dword ptr[_cachewidth]
  658. sar ecx,16
  659. imul edx,ebx
  660. add edx,ecx
  661. mov ecx,ds:dword ptr[tfracf]
  662. mov ds:dword ptr[advancetable+4],edx
  663. add edx,ebx
  664. shl ebp,16
  665. mov ebx,ds:dword ptr[sfracf]
  666. shl eax,16
  667. mov ds:dword ptr[advancetable],edx
  668. mov ds:dword ptr[tstep],eax
  669. mov edx,ecx
  670. add edx,eax
  671. sbb ecx,ecx
  672. add ebx,ebp
  673. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  674. jmp dword ptr[jumptemp]
  675. LNoSteps:
  676. mov al,ds:byte ptr[esi]
  677. sub edi,15
  678. jmp LEndSpan
  679. LOnlyOneStep:
  680. sub eax,ds:dword ptr[s]
  681. sub ebx,ds:dword ptr[t]
  682. mov ebp,eax
  683. mov edx,ebx
  684. jmp LSetEntryvec
  685. public Entry2_16, Entry3_16, Entry4_16, Entry5_16
  686. public Entry6_16, Entry7_16, Entry8_16, Entry9_16
  687. public Entry10_16, Entry11_16, Entry12_16, Entry13_16
  688. public Entry14_16, Entry15_16, Entry16_16
  689. Entry2_16:
  690. sub edi,14
  691. mov al,ds:byte ptr[esi]
  692. jmp LEntry2_16
  693. Entry3_16:
  694. sub edi,13
  695. add edx,eax
  696. mov al,ds:byte ptr[esi]
  697. sbb ecx,ecx
  698. add ebx,ebp
  699. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  700. jmp LEntry3_16
  701. Entry4_16:
  702. sub edi,12
  703. add edx,eax
  704. mov al,ds:byte ptr[esi]
  705. sbb ecx,ecx
  706. add ebx,ebp
  707. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  708. add edx,ds:dword ptr[tstep]
  709. jmp LEntry4_16
  710. Entry5_16:
  711. sub edi,11
  712. add edx,eax
  713. mov al,ds:byte ptr[esi]
  714. sbb ecx,ecx
  715. add ebx,ebp
  716. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  717. add edx,ds:dword ptr[tstep]
  718. jmp LEntry5_16
  719. Entry6_16:
  720. sub edi,10
  721. add edx,eax
  722. mov al,ds:byte ptr[esi]
  723. sbb ecx,ecx
  724. add ebx,ebp
  725. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  726. add edx,ds:dword ptr[tstep]
  727. jmp LEntry6_16
  728. Entry7_16:
  729. sub edi,9
  730. add edx,eax
  731. mov al,ds:byte ptr[esi]
  732. sbb ecx,ecx
  733. add ebx,ebp
  734. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  735. add edx,ds:dword ptr[tstep]
  736. jmp LEntry7_16
  737. Entry8_16:
  738. sub edi,8
  739. add edx,eax
  740. mov al,ds:byte ptr[esi]
  741. sbb ecx,ecx
  742. add ebx,ebp
  743. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  744. add edx,ds:dword ptr[tstep]
  745. jmp LEntry8_16
  746. Entry9_16:
  747. sub edi,7
  748. add edx,eax
  749. mov al,ds:byte ptr[esi]
  750. sbb ecx,ecx
  751. add ebx,ebp
  752. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  753. add edx,ds:dword ptr[tstep]
  754. jmp LEntry9_16
  755. Entry10_16:
  756. sub edi,6
  757. add edx,eax
  758. mov al,ds:byte ptr[esi]
  759. sbb ecx,ecx
  760. add ebx,ebp
  761. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  762. add edx,ds:dword ptr[tstep]
  763. jmp LEntry10_16
  764. Entry11_16:
  765. sub edi,5
  766. add edx,eax
  767. mov al,ds:byte ptr[esi]
  768. sbb ecx,ecx
  769. add ebx,ebp
  770. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  771. add edx,ds:dword ptr[tstep]
  772. jmp LEntry11_16
  773. Entry12_16:
  774. sub edi,4
  775. add edx,eax
  776. mov al,ds:byte ptr[esi]
  777. sbb ecx,ecx
  778. add ebx,ebp
  779. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  780. add edx,ds:dword ptr[tstep]
  781. jmp LEntry12_16
  782. Entry13_16:
  783. sub edi,3
  784. add edx,eax
  785. mov al,ds:byte ptr[esi]
  786. sbb ecx,ecx
  787. add ebx,ebp
  788. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  789. add edx,ds:dword ptr[tstep]
  790. jmp LEntry13_16
  791. Entry14_16:
  792. sub edi,2
  793. add edx,eax
  794. mov al,ds:byte ptr[esi]
  795. sbb ecx,ecx
  796. add ebx,ebp
  797. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  798. add edx,ds:dword ptr[tstep]
  799. jmp LEntry14_16
  800. Entry15_16:
  801. dec edi
  802. add edx,eax
  803. mov al,ds:byte ptr[esi]
  804. sbb ecx,ecx
  805. add ebx,ebp
  806. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  807. add edx,ds:dword ptr[tstep]
  808. jmp LEntry15_16
  809. Entry16_16:
  810. add edx,eax
  811. mov al,ds:byte ptr[esi]
  812. sbb ecx,ecx
  813. add ebx,ebp
  814. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  815. add edx,ds:dword ptr[tstep]
  816. sbb ecx,ecx
  817. mov ds:byte ptr[1+edi],al
  818. add ebx,ebp
  819. mov al,ds:byte ptr[esi]
  820. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  821. add edx,ds:dword ptr[tstep]
  822. LEntry15_16:
  823. sbb ecx,ecx
  824. mov ds:byte ptr[2+edi],al
  825. add ebx,ebp
  826. mov al,ds:byte ptr[esi]
  827. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  828. add edx,ds:dword ptr[tstep]
  829. LEntry14_16:
  830. sbb ecx,ecx
  831. mov ds:byte ptr[3+edi],al
  832. add ebx,ebp
  833. mov al,ds:byte ptr[esi]
  834. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  835. add edx,ds:dword ptr[tstep]
  836. LEntry13_16:
  837. sbb ecx,ecx
  838. mov ds:byte ptr[4+edi],al
  839. add ebx,ebp
  840. mov al,ds:byte ptr[esi]
  841. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  842. add edx,ds:dword ptr[tstep]
  843. LEntry12_16:
  844. sbb ecx,ecx
  845. mov ds:byte ptr[5+edi],al
  846. add ebx,ebp
  847. mov al,ds:byte ptr[esi]
  848. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  849. add edx,ds:dword ptr[tstep]
  850. LEntry11_16:
  851. sbb ecx,ecx
  852. mov ds:byte ptr[6+edi],al
  853. add ebx,ebp
  854. mov al,ds:byte ptr[esi]
  855. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  856. add edx,ds:dword ptr[tstep]
  857. LEntry10_16:
  858. sbb ecx,ecx
  859. mov ds:byte ptr[7+edi],al
  860. add ebx,ebp
  861. mov al,ds:byte ptr[esi]
  862. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  863. add edx,ds:dword ptr[tstep]
  864. LEntry9_16:
  865. sbb ecx,ecx
  866. mov ds:byte ptr[8+edi],al
  867. add ebx,ebp
  868. mov al,ds:byte ptr[esi]
  869. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  870. add edx,ds:dword ptr[tstep]
  871. LEntry8_16:
  872. sbb ecx,ecx
  873. mov ds:byte ptr[9+edi],al
  874. add ebx,ebp
  875. mov al,ds:byte ptr[esi]
  876. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  877. add edx,ds:dword ptr[tstep]
  878. LEntry7_16:
  879. sbb ecx,ecx
  880. mov ds:byte ptr[10+edi],al
  881. add ebx,ebp
  882. mov al,ds:byte ptr[esi]
  883. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  884. add edx,ds:dword ptr[tstep]
  885. LEntry6_16:
  886. sbb ecx,ecx
  887. mov ds:byte ptr[11+edi],al
  888. add ebx,ebp
  889. mov al,ds:byte ptr[esi]
  890. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  891. add edx,ds:dword ptr[tstep]
  892. LEntry5_16:
  893. sbb ecx,ecx
  894. mov ds:byte ptr[12+edi],al
  895. add ebx,ebp
  896. mov al,ds:byte ptr[esi]
  897. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  898. add edx,ds:dword ptr[tstep]
  899. LEntry4_16:
  900. sbb ecx,ecx
  901. mov ds:byte ptr[13+edi],al
  902. add ebx,ebp
  903. mov al,ds:byte ptr[esi]
  904. adc esi,ds:dword ptr[advancetable+4+ecx*4]
  905. LEntry3_16:
  906. mov ds:byte ptr[14+edi],al
  907. mov al,ds:byte ptr[esi]
  908. LEntry2_16:
  909. LEndSpan:
  910. fstp st(0)
  911. fstp st(0)
  912. fstp st(0)
  913. mov ebx,ds:dword ptr[pspantemp]
  914. mov ebx,ds:dword ptr[12+ebx]
  915. test ebx,ebx
  916. mov ds:byte ptr[15+edi],al
  917. jnz LSpanLoop
  918. pop ebx
  919. pop esi
  920. pop edi
  921. pop ebp
  922. ret
  923. _TEXT ENDS
  924. END