r_surf8.asm 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772
  1. .386P
  2. .model FLAT
  3. ;
  4. ; surf8.s
  5. ; x86 assembly-language 8 bpp surface block drawing code.
  6. ;
  7. include qasm.inc
  8. if id386
  9. _DATA SEGMENT
  10. sb_v dd 0
  11. _DATA ENDS
  12. _TEXT SEGMENT
  13. align 4
  14. public _R_Surf8Start
  15. _R_Surf8Start:
  16. ;----------------------------------------------------------------------
  17. ; Surface block drawer for mip level 0
  18. ;----------------------------------------------------------------------
  19. align 4
  20. public _R_DrawSurfaceBlock8_mip0
  21. _R_DrawSurfaceBlock8_mip0:
  22. push ebp ; preserve caller's stack frame
  23. push edi
  24. push esi ; preserve register variables
  25. push ebx
  26. ; for (v=0 ; v<numvblocks ; v++)
  27. ; {
  28. mov ebx,ds:dword ptr[_r_lightptr]
  29. mov eax,ds:dword ptr[_r_numvblocks]
  30. mov ds:dword ptr[sb_v],eax
  31. mov edi,ds:dword ptr[_prowdestbase]
  32. mov esi,ds:dword ptr[_pbasesource]
  33. Lv_loop_mip0:
  34. ; lightleft = lightptr[0];
  35. ; lightright = lightptr[1];
  36. ; lightdelta = (lightleft - lightright) & 0xFFFFF;
  37. mov eax,ds:dword ptr[ebx] ; lightleft
  38. mov edx,ds:dword ptr[4+ebx] ; lightright
  39. mov ebp,eax
  40. mov ecx,ds:dword ptr[_r_lightwidth]
  41. mov ds:dword ptr[_lightright],edx
  42. sub ebp,edx
  43. and ebp,0FFFFFh
  44. lea ebx,ds:dword ptr[ebx+ecx*4]
  45. ; lightptr += lightwidth;
  46. mov ds:dword ptr[_r_lightptr],ebx
  47. ; lightleftstep = (lightptr[0] - lightleft) >> blockdivshift;
  48. ; lightrightstep = (lightptr[1] - lightright) >> blockdivshift;
  49. ; lightdeltastep = ((lightleftstep - lightrightstep) & 0xFFFFF) |
  50. ; 0xF0000000;
  51. mov ecx,ds:dword ptr[4+ebx] ; lightptr[1]
  52. mov ebx,ds:dword ptr[ebx] ; lightptr[0]
  53. sub ebx,eax
  54. sub ecx,edx
  55. sar ecx,4
  56. or ebp,0F0000000h
  57. sar ebx,4
  58. mov ds:dword ptr[_lightrightstep],ecx
  59. sub ebx,ecx
  60. and ebx,0FFFFFh
  61. or ebx,0F0000000h
  62. sub ecx,ecx ; high word must be 0 in loop for addressing
  63. mov ds:dword ptr[_lightdeltastep],ebx
  64. sub ebx,ebx ; high word must be 0 in loop for addressing
  65. Lblockloop8_mip0:
  66. mov ds:dword ptr[_lightdelta],ebp
  67. mov cl,ds:byte ptr[14+esi]
  68. sar ebp,4
  69. mov bh,dh
  70. mov bl,ds:byte ptr[15+esi]
  71. add edx,ebp
  72. mov ch,dh
  73. add edx,ebp
  74. mov ah,ds:byte ptr[12345678h+ebx]
  75. LBPatch0:
  76. mov bl,ds:byte ptr[13+esi]
  77. mov al,ds:byte ptr[12345678h+ecx]
  78. LBPatch1:
  79. mov cl,ds:byte ptr[12+esi]
  80. mov bh,dh
  81. add edx,ebp
  82. ror eax,16
  83. mov ch,dh
  84. add edx,ebp
  85. mov ah,ds:byte ptr[12345678h+ebx]
  86. LBPatch2:
  87. mov bl,ds:byte ptr[11+esi]
  88. mov al,ds:byte ptr[12345678h+ecx]
  89. LBPatch3:
  90. mov cl,ds:byte ptr[10+esi]
  91. mov ds:dword ptr[12+edi],eax
  92. mov bh,dh
  93. add edx,ebp
  94. mov ch,dh
  95. add edx,ebp
  96. mov ah,ds:byte ptr[12345678h+ebx]
  97. LBPatch4:
  98. mov bl,ds:byte ptr[9+esi]
  99. mov al,ds:byte ptr[12345678h+ecx]
  100. LBPatch5:
  101. mov cl,ds:byte ptr[8+esi]
  102. mov bh,dh
  103. add edx,ebp
  104. ror eax,16
  105. mov ch,dh
  106. add edx,ebp
  107. mov ah,ds:byte ptr[12345678h+ebx]
  108. LBPatch6:
  109. mov bl,ds:byte ptr[7+esi]
  110. mov al,ds:byte ptr[12345678h+ecx]
  111. LBPatch7:
  112. mov cl,ds:byte ptr[6+esi]
  113. mov ds:dword ptr[8+edi],eax
  114. mov bh,dh
  115. add edx,ebp
  116. mov ch,dh
  117. add edx,ebp
  118. mov ah,ds:byte ptr[12345678h+ebx]
  119. LBPatch8:
  120. mov bl,ds:byte ptr[5+esi]
  121. mov al,ds:byte ptr[12345678h+ecx]
  122. LBPatch9:
  123. mov cl,ds:byte ptr[4+esi]
  124. mov bh,dh
  125. add edx,ebp
  126. ror eax,16
  127. mov ch,dh
  128. add edx,ebp
  129. mov ah,ds:byte ptr[12345678h+ebx]
  130. LBPatch10:
  131. mov bl,ds:byte ptr[3+esi]
  132. mov al,ds:byte ptr[12345678h+ecx]
  133. LBPatch11:
  134. mov cl,ds:byte ptr[2+esi]
  135. mov ds:dword ptr[4+edi],eax
  136. mov bh,dh
  137. add edx,ebp
  138. mov ch,dh
  139. add edx,ebp
  140. mov ah,ds:byte ptr[12345678h+ebx]
  141. LBPatch12:
  142. mov bl,ds:byte ptr[1+esi]
  143. mov al,ds:byte ptr[12345678h+ecx]
  144. LBPatch13:
  145. mov cl,ds:byte ptr[esi]
  146. mov bh,dh
  147. add edx,ebp
  148. ror eax,16
  149. mov ch,dh
  150. mov ah,ds:byte ptr[12345678h+ebx]
  151. LBPatch14:
  152. mov edx,ds:dword ptr[_lightright]
  153. mov al,ds:byte ptr[12345678h+ecx]
  154. LBPatch15:
  155. mov ebp,ds:dword ptr[_lightdelta]
  156. mov ds:dword ptr[edi],eax
  157. add esi,ds:dword ptr[_sourcetstep]
  158. add edi,ds:dword ptr[_surfrowbytes]
  159. add edx,ds:dword ptr[_lightrightstep]
  160. add ebp,ds:dword ptr[_lightdeltastep]
  161. mov ds:dword ptr[_lightright],edx
  162. jc Lblockloop8_mip0
  163. ; if (pbasesource >= r_sourcemax)
  164. ; pbasesource -= stepback;
  165. cmp esi,ds:dword ptr[_r_sourcemax]
  166. jb LSkip_mip0
  167. sub esi,ds:dword ptr[_r_stepback]
  168. LSkip_mip0:
  169. mov ebx,ds:dword ptr[_r_lightptr]
  170. dec ds:dword ptr[sb_v]
  171. jnz Lv_loop_mip0
  172. pop ebx ; restore register variables
  173. pop esi
  174. pop edi
  175. pop ebp ; restore the caller's stack frame
  176. ret
  177. ;----------------------------------------------------------------------
  178. ; Surface block drawer for mip level 1
  179. ;----------------------------------------------------------------------
  180. align 4
  181. public _R_DrawSurfaceBlock8_mip1
  182. _R_DrawSurfaceBlock8_mip1:
  183. push ebp ; preserve caller's stack frame
  184. push edi
  185. push esi ; preserve register variables
  186. push ebx
  187. ; for (v=0 ; v<numvblocks ; v++)
  188. ; {
  189. mov ebx,ds:dword ptr[_r_lightptr]
  190. mov eax,ds:dword ptr[_r_numvblocks]
  191. mov ds:dword ptr[sb_v],eax
  192. mov edi,ds:dword ptr[_prowdestbase]
  193. mov esi,ds:dword ptr[_pbasesource]
  194. Lv_loop_mip1:
  195. ; lightleft = lightptr[0];
  196. ; lightright = lightptr[1];
  197. ; lightdelta = (lightleft - lightright) & 0xFFFFF;
  198. mov eax,ds:dword ptr[ebx] ; lightleft
  199. mov edx,ds:dword ptr[4+ebx] ; lightright
  200. mov ebp,eax
  201. mov ecx,ds:dword ptr[_r_lightwidth]
  202. mov ds:dword ptr[_lightright],edx
  203. sub ebp,edx
  204. and ebp,0FFFFFh
  205. lea ebx,ds:dword ptr[ebx+ecx*4]
  206. ; lightptr += lightwidth;
  207. mov ds:dword ptr[_r_lightptr],ebx
  208. ; lightleftstep = (lightptr[0] - lightleft) >> blockdivshift;
  209. ; lightrightstep = (lightptr[1] - lightright) >> blockdivshift;
  210. ; lightdeltastep = ((lightleftstep - lightrightstep) & 0xFFFFF) |
  211. ; 0xF0000000;
  212. mov ecx,ds:dword ptr[4+ebx] ; lightptr[1]
  213. mov ebx,ds:dword ptr[ebx] ; lightptr[0]
  214. sub ebx,eax
  215. sub ecx,edx
  216. sar ecx,3
  217. or ebp,070000000h
  218. sar ebx,3
  219. mov ds:dword ptr[_lightrightstep],ecx
  220. sub ebx,ecx
  221. and ebx,0FFFFFh
  222. or ebx,0F0000000h
  223. sub ecx,ecx ; high word must be 0 in loop for addressing
  224. mov ds:dword ptr[_lightdeltastep],ebx
  225. sub ebx,ebx ; high word must be 0 in loop for addressing
  226. Lblockloop8_mip1:
  227. mov ds:dword ptr[_lightdelta],ebp
  228. mov cl,ds:byte ptr[6+esi]
  229. sar ebp,3
  230. mov bh,dh
  231. mov bl,ds:byte ptr[7+esi]
  232. add edx,ebp
  233. mov ch,dh
  234. add edx,ebp
  235. mov ah,ds:byte ptr[12345678h+ebx]
  236. LBPatch22:
  237. mov bl,ds:byte ptr[5+esi]
  238. mov al,ds:byte ptr[12345678h+ecx]
  239. LBPatch23:
  240. mov cl,ds:byte ptr[4+esi]
  241. mov bh,dh
  242. add edx,ebp
  243. ror eax,16
  244. mov ch,dh
  245. add edx,ebp
  246. mov ah,ds:byte ptr[12345678h+ebx]
  247. LBPatch24:
  248. mov bl,ds:byte ptr[3+esi]
  249. mov al,ds:byte ptr[12345678h+ecx]
  250. LBPatch25:
  251. mov cl,ds:byte ptr[2+esi]
  252. mov ds:dword ptr[4+edi],eax
  253. mov bh,dh
  254. add edx,ebp
  255. mov ch,dh
  256. add edx,ebp
  257. mov ah,ds:byte ptr[12345678h+ebx]
  258. LBPatch26:
  259. mov bl,ds:byte ptr[1+esi]
  260. mov al,ds:byte ptr[12345678h+ecx]
  261. LBPatch27:
  262. mov cl,ds:byte ptr[esi]
  263. mov bh,dh
  264. add edx,ebp
  265. ror eax,16
  266. mov ch,dh
  267. mov ah,ds:byte ptr[12345678h+ebx]
  268. LBPatch28:
  269. mov edx,ds:dword ptr[_lightright]
  270. mov al,ds:byte ptr[12345678h+ecx]
  271. LBPatch29:
  272. mov ebp,ds:dword ptr[_lightdelta]
  273. mov ds:dword ptr[edi],eax
  274. mov eax,ds:dword ptr[_sourcetstep]
  275. add esi,eax
  276. mov eax,ds:dword ptr[_surfrowbytes]
  277. add edi,eax
  278. mov eax,ds:dword ptr[_lightrightstep]
  279. add edx,eax
  280. mov eax,ds:dword ptr[_lightdeltastep]
  281. add ebp,eax
  282. mov ds:dword ptr[_lightright],edx
  283. jc Lblockloop8_mip1
  284. ; if (pbasesource >= r_sourcemax)
  285. ; pbasesource -= stepback;
  286. cmp esi,ds:dword ptr[_r_sourcemax]
  287. jb LSkip_mip1
  288. sub esi,ds:dword ptr[_r_stepback]
  289. LSkip_mip1:
  290. mov ebx,ds:dword ptr[_r_lightptr]
  291. dec ds:dword ptr[sb_v]
  292. jnz Lv_loop_mip1
  293. pop ebx ; restore register variables
  294. pop esi
  295. pop edi
  296. pop ebp ; restore the caller's stack frame
  297. ret
  298. ;----------------------------------------------------------------------
  299. ; Surface block drawer for mip level 2
  300. ;----------------------------------------------------------------------
  301. align 4
  302. public _R_DrawSurfaceBlock8_mip2
  303. _R_DrawSurfaceBlock8_mip2:
  304. push ebp ; preserve caller's stack frame
  305. push edi
  306. push esi ; preserve register variables
  307. push ebx
  308. ; for (v=0 ; v<numvblocks ; v++)
  309. ; {
  310. mov ebx,ds:dword ptr[_r_lightptr]
  311. mov eax,ds:dword ptr[_r_numvblocks]
  312. mov ds:dword ptr[sb_v],eax
  313. mov edi,ds:dword ptr[_prowdestbase]
  314. mov esi,ds:dword ptr[_pbasesource]
  315. Lv_loop_mip2:
  316. ; lightleft = lightptr[0];
  317. ; lightright = lightptr[1];
  318. ; lightdelta = (lightleft - lightright) & 0xFFFFF;
  319. mov eax,ds:dword ptr[ebx] ; lightleft
  320. mov edx,ds:dword ptr[4+ebx] ; lightright
  321. mov ebp,eax
  322. mov ecx,ds:dword ptr[_r_lightwidth]
  323. mov ds:dword ptr[_lightright],edx
  324. sub ebp,edx
  325. and ebp,0FFFFFh
  326. lea ebx,ds:dword ptr[ebx+ecx*4]
  327. ; lightptr += lightwidth;
  328. mov ds:dword ptr[_r_lightptr],ebx
  329. ; lightleftstep = (lightptr[0] - lightleft) >> blockdivshift;
  330. ; lightrightstep = (lightptr[1] - lightright) >> blockdivshift;
  331. ; lightdeltastep = ((lightleftstep - lightrightstep) & 0xFFFFF) |
  332. ; 0xF0000000;
  333. mov ecx,ds:dword ptr[4+ebx] ; lightptr[1]
  334. mov ebx,ds:dword ptr[ebx] ; lightptr[0]
  335. sub ebx,eax
  336. sub ecx,edx
  337. sar ecx,2
  338. or ebp,030000000h
  339. sar ebx,2
  340. mov ds:dword ptr[_lightrightstep],ecx
  341. sub ebx,ecx
  342. and ebx,0FFFFFh
  343. or ebx,0F0000000h
  344. sub ecx,ecx ; high word must be 0 in loop for addressing
  345. mov ds:dword ptr[_lightdeltastep],ebx
  346. sub ebx,ebx ; high word must be 0 in loop for addressing
  347. Lblockloop8_mip2:
  348. mov ds:dword ptr[_lightdelta],ebp
  349. mov cl,ds:byte ptr[2+esi]
  350. sar ebp,2
  351. mov bh,dh
  352. mov bl,ds:byte ptr[3+esi]
  353. add edx,ebp
  354. mov ch,dh
  355. add edx,ebp
  356. mov ah,ds:byte ptr[12345678h+ebx]
  357. LBPatch18:
  358. mov bl,ds:byte ptr[1+esi]
  359. mov al,ds:byte ptr[12345678h+ecx]
  360. LBPatch19:
  361. mov cl,ds:byte ptr[esi]
  362. mov bh,dh
  363. add edx,ebp
  364. ror eax,16
  365. mov ch,dh
  366. mov ah,ds:byte ptr[12345678h+ebx]
  367. LBPatch20:
  368. mov edx,ds:dword ptr[_lightright]
  369. mov al,ds:byte ptr[12345678h+ecx]
  370. LBPatch21:
  371. mov ebp,ds:dword ptr[_lightdelta]
  372. mov ds:dword ptr[edi],eax
  373. mov eax,ds:dword ptr[_sourcetstep]
  374. add esi,eax
  375. mov eax,ds:dword ptr[_surfrowbytes]
  376. add edi,eax
  377. mov eax,ds:dword ptr[_lightrightstep]
  378. add edx,eax
  379. mov eax,ds:dword ptr[_lightdeltastep]
  380. add ebp,eax
  381. mov ds:dword ptr[_lightright],edx
  382. jc Lblockloop8_mip2
  383. ; if (pbasesource >= r_sourcemax)
  384. ; pbasesource -= stepback;
  385. cmp esi,ds:dword ptr[_r_sourcemax]
  386. jb LSkip_mip2
  387. sub esi,ds:dword ptr[_r_stepback]
  388. LSkip_mip2:
  389. mov ebx,ds:dword ptr[_r_lightptr]
  390. dec ds:dword ptr[sb_v]
  391. jnz Lv_loop_mip2
  392. pop ebx ; restore register variables
  393. pop esi
  394. pop edi
  395. pop ebp ; restore the caller's stack frame
  396. ret
  397. ;----------------------------------------------------------------------
  398. ; Surface block drawer for mip level 3
  399. ;----------------------------------------------------------------------
  400. align 4
  401. public _R_DrawSurfaceBlock8_mip3
  402. _R_DrawSurfaceBlock8_mip3:
  403. push ebp ; preserve caller's stack frame
  404. push edi
  405. push esi ; preserve register variables
  406. push ebx
  407. ; for (v=0 ; v<numvblocks ; v++)
  408. ; {
  409. mov ebx,ds:dword ptr[_r_lightptr]
  410. mov eax,ds:dword ptr[_r_numvblocks]
  411. mov ds:dword ptr[sb_v],eax
  412. mov edi,ds:dword ptr[_prowdestbase]
  413. mov esi,ds:dword ptr[_pbasesource]
  414. Lv_loop_mip3:
  415. ; lightleft = lightptr[0];
  416. ; lightright = lightptr[1];
  417. ; lightdelta = (lightleft - lightright) & 0xFFFFF;
  418. mov eax,ds:dword ptr[ebx] ; lightleft
  419. mov edx,ds:dword ptr[4+ebx] ; lightright
  420. mov ebp,eax
  421. mov ecx,ds:dword ptr[_r_lightwidth]
  422. mov ds:dword ptr[_lightright],edx
  423. sub ebp,edx
  424. and ebp,0FFFFFh
  425. lea ebx,ds:dword ptr[ebx+ecx*4]
  426. mov ds:dword ptr[_lightdelta],ebp
  427. ; lightptr += lightwidth;
  428. mov ds:dword ptr[_r_lightptr],ebx
  429. ; lightleftstep = (lightptr[0] - lightleft) >> blockdivshift;
  430. ; lightrightstep = (lightptr[1] - lightright) >> blockdivshift;
  431. ; lightdeltastep = ((lightleftstep - lightrightstep) & 0xFFFFF) |
  432. ; 0xF0000000;
  433. mov ecx,ds:dword ptr[4+ebx] ; lightptr[1]
  434. mov ebx,ds:dword ptr[ebx] ; lightptr[0]
  435. sub ebx,eax
  436. sub ecx,edx
  437. sar ecx,1
  438. sar ebx,1
  439. mov ds:dword ptr[_lightrightstep],ecx
  440. sub ebx,ecx
  441. and ebx,0FFFFFh
  442. sar ebp,1
  443. or ebx,0F0000000h
  444. mov ds:dword ptr[_lightdeltastep],ebx
  445. sub ebx,ebx ; high word must be 0 in loop for addressing
  446. mov bl,ds:byte ptr[1+esi]
  447. sub ecx,ecx ; high word must be 0 in loop for addressing
  448. mov bh,dh
  449. mov cl,ds:byte ptr[esi]
  450. add edx,ebp
  451. mov ch,dh
  452. mov al,ds:byte ptr[12345678h+ebx]
  453. LBPatch16:
  454. mov edx,ds:dword ptr[_lightright]
  455. mov ds:byte ptr[1+edi],al
  456. mov al,ds:byte ptr[12345678h+ecx]
  457. LBPatch17:
  458. mov ds:byte ptr[edi],al
  459. mov eax,ds:dword ptr[_sourcetstep]
  460. add esi,eax
  461. mov eax,ds:dword ptr[_surfrowbytes]
  462. add edi,eax
  463. mov eax,ds:dword ptr[_lightdeltastep]
  464. mov ebp,ds:dword ptr[_lightdelta]
  465. mov cl,ds:byte ptr[esi]
  466. add ebp,eax
  467. mov eax,ds:dword ptr[_lightrightstep]
  468. sar ebp,1
  469. add edx,eax
  470. mov bh,dh
  471. mov bl,ds:byte ptr[1+esi]
  472. add edx,ebp
  473. mov ch,dh
  474. mov al,ds:byte ptr[12345678h+ebx]
  475. LBPatch30:
  476. mov edx,ds:dword ptr[_sourcetstep]
  477. mov ds:byte ptr[1+edi],al
  478. mov al,ds:byte ptr[12345678h+ecx]
  479. LBPatch31:
  480. mov ds:byte ptr[edi],al
  481. mov ebp,ds:dword ptr[_surfrowbytes]
  482. add esi,edx
  483. add edi,ebp
  484. ; if (pbasesource >= r_sourcemax)
  485. ; pbasesource -= stepback;
  486. cmp esi,ds:dword ptr[_r_sourcemax]
  487. jb LSkip_mip3
  488. sub esi,ds:dword ptr[_r_stepback]
  489. LSkip_mip3:
  490. mov ebx,ds:dword ptr[_r_lightptr]
  491. dec ds:dword ptr[sb_v]
  492. jnz Lv_loop_mip3
  493. pop ebx ; restore register variables
  494. pop esi
  495. pop edi
  496. pop ebp ; restore the caller's stack frame
  497. ret
  498. public _R_Surf8End
  499. _R_Surf8End:
  500. ;----------------------------------------------------------------------
  501. ; Code patching routines
  502. ;----------------------------------------------------------------------
  503. _TEXT ENDS
  504. _DATA SEGMENT
  505. align 4
  506. LPatchTable8:
  507. dd LBPatch0-4
  508. dd LBPatch1-4
  509. dd LBPatch2-4
  510. dd LBPatch3-4
  511. dd LBPatch4-4
  512. dd LBPatch5-4
  513. dd LBPatch6-4
  514. dd LBPatch7-4
  515. dd LBPatch8-4
  516. dd LBPatch9-4
  517. dd LBPatch10-4
  518. dd LBPatch11-4
  519. dd LBPatch12-4
  520. dd LBPatch13-4
  521. dd LBPatch14-4
  522. dd LBPatch15-4
  523. dd LBPatch16-4
  524. dd LBPatch17-4
  525. dd LBPatch18-4
  526. dd LBPatch19-4
  527. dd LBPatch20-4
  528. dd LBPatch21-4
  529. dd LBPatch22-4
  530. dd LBPatch23-4
  531. dd LBPatch24-4
  532. dd LBPatch25-4
  533. dd LBPatch26-4
  534. dd LBPatch27-4
  535. dd LBPatch28-4
  536. dd LBPatch29-4
  537. dd LBPatch30-4
  538. dd LBPatch31-4
  539. _DATA ENDS
  540. _TEXT SEGMENT
  541. align 4
  542. public _R_Surf8Patch
  543. _R_Surf8Patch:
  544. push ebx
  545. mov eax,ds:dword ptr[_colormap]
  546. mov ebx,offset LPatchTable8
  547. mov ecx,32
  548. LPatchLoop8:
  549. mov edx,ds:dword ptr[ebx]
  550. add ebx,4
  551. mov ds:dword ptr[edx],eax
  552. dec ecx
  553. jnz LPatchLoop8
  554. pop ebx
  555. ret
  556. _TEXT ENDS
  557. endif ;id386
  558. END