Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1230 lines
24 KiB

  1. page ,132
  2. ;Thunk Compiler Version 1.8 Dec 14 1994 14:53:05
  3. ;File Compiled Fri Jun 20 10:27:33 1997
  4. ;Command Line: thunk -P2 -NC ddraw -t thk3216 ..\32to16.thk -o 32to16.asm
  5. TITLE $32to16.asm
  6. .386
  7. OPTION READONLY
  8. OPTION OLDSTRUCTS
  9. IFNDEF IS_16
  10. IFNDEF IS_32
  11. %out command line error: specify one of -DIS_16, -DIS_32
  12. .err
  13. ENDIF ;IS_32
  14. ENDIF ;IS_16
  15. IFDEF IS_32
  16. IFDEF IS_16
  17. %out command line error: you can't specify both -DIS_16 and -DIS_32
  18. .err
  19. ENDIF ;IS_16
  20. ;************************* START OF 32-BIT CODE *************************
  21. .model FLAT,STDCALL
  22. ;-- Import common flat thunk routines (in k32)
  23. externDef MapHInstLS :near32
  24. externDef MapHInstLS_PN :near32
  25. externDef MapHInstSL :near32
  26. externDef MapHInstSL_PN :near32
  27. externDef FT_Prolog :near32
  28. externDef FT_Thunk :near32
  29. externDef QT_Thunk :near32
  30. externDef FT_Exit0 :near32
  31. externDef FT_Exit4 :near32
  32. externDef FT_Exit8 :near32
  33. externDef FT_Exit12 :near32
  34. externDef FT_Exit16 :near32
  35. externDef FT_Exit20 :near32
  36. externDef FT_Exit24 :near32
  37. externDef FT_Exit28 :near32
  38. externDef FT_Exit32 :near32
  39. externDef FT_Exit36 :near32
  40. externDef FT_Exit40 :near32
  41. externDef FT_Exit44 :near32
  42. externDef FT_Exit48 :near32
  43. externDef FT_Exit52 :near32
  44. externDef FT_Exit56 :near32
  45. externDef SMapLS :near32
  46. externDef SUnMapLS :near32
  47. externDef SMapLS_IP_EBP_8 :near32
  48. externDef SUnMapLS_IP_EBP_8 :near32
  49. externDef SMapLS_IP_EBP_12 :near32
  50. externDef SUnMapLS_IP_EBP_12 :near32
  51. externDef SMapLS_IP_EBP_16 :near32
  52. externDef SUnMapLS_IP_EBP_16 :near32
  53. externDef SMapLS_IP_EBP_20 :near32
  54. externDef SUnMapLS_IP_EBP_20 :near32
  55. externDef SMapLS_IP_EBP_24 :near32
  56. externDef SUnMapLS_IP_EBP_24 :near32
  57. externDef SMapLS_IP_EBP_28 :near32
  58. externDef SUnMapLS_IP_EBP_28 :near32
  59. externDef SMapLS_IP_EBP_32 :near32
  60. externDef SUnMapLS_IP_EBP_32 :near32
  61. externDef SMapLS_IP_EBP_36 :near32
  62. externDef SUnMapLS_IP_EBP_36 :near32
  63. externDef SMapLS_IP_EBP_40 :near32
  64. externDef SUnMapLS_IP_EBP_40 :near32
  65. MapSL PROTO NEAR STDCALL p32:DWORD
  66. .code
  67. ;************************* COMMON PER-MODULE ROUTINES *************************
  68. .data
  69. public thk3216_ThunkData32 ;This symbol must be exported.
  70. thk3216_ThunkData32 label dword
  71. dd 3130534ch ;Protocol 'LS01'
  72. dd 0210141h ;Checksum
  73. dd 0 ;Jump table address.
  74. dd 3130424ch ;'LB01'
  75. dd 0 ;Flags
  76. dd 0 ;Reserved (MUST BE 0)
  77. dd 0 ;Reserved (MUST BE 0)
  78. dd offset QT_Thunk_thk3216 - offset thk3216_ThunkData32
  79. dd offset FT_Prolog_thk3216 - offset thk3216_ThunkData32
  80. .code
  81. externDef ThunkConnect32@24:near32
  82. public thk3216_ThunkConnect32@16
  83. thk3216_ThunkConnect32@16:
  84. pop edx
  85. push offset thk3216_ThkData16
  86. push offset thk3216_ThunkData32
  87. push edx
  88. jmp ThunkConnect32@24
  89. thk3216_ThkData16 label byte
  90. db "thk3216_ThunkData16",0
  91. pfnQT_Thunk_thk3216 dd offset QT_Thunk_thk3216
  92. pfnFT_Prolog_thk3216 dd offset FT_Prolog_thk3216
  93. .data
  94. QT_Thunk_thk3216 label byte
  95. db 32 dup(0cch) ;Patch space.
  96. FT_Prolog_thk3216 label byte
  97. db 32 dup(0cch) ;Patch space.
  98. .code
  99. ;************************ START OF THUNK BODIES************************
  100. ;
  101. public DD16_GetMonitorMaxSize@4
  102. DD16_GetMonitorMaxSize@4:
  103. mov cl,54
  104. ; DD16_GetMonitorMaxSize(16) = DD16_GetMonitorMaxSize(32) {}
  105. ;
  106. ; dword ptr [ebp+8]: dev
  107. ;
  108. public IIDD16_GetMonitorMaxSize@4
  109. IIDD16_GetMonitorMaxSize@4:
  110. push ebp
  111. mov ebp,esp
  112. push ecx
  113. sub esp,60
  114. push dword ptr [ebp+8] ;dev: dword->dword
  115. call dword ptr [pfnQT_Thunk_thk3216]
  116. cwde
  117. leave
  118. retn 4
  119. ;
  120. public DD16_GetMonitorRefreshRateRanges@20
  121. DD16_GetMonitorRefreshRateRanges@20:
  122. mov cx, (5 SHL 10) + (0 SHL 8) + 53
  123. ; DD16_GetMonitorRefreshRateRanges(16) = DD16_GetMonitorRefreshRateRanges(32) {}
  124. ;
  125. ; dword ptr [ebp+8]: dev
  126. ; dword ptr [ebp+12]: xres
  127. ; dword ptr [ebp+16]: yres
  128. ; dword ptr [ebp+20]: pmin
  129. ; dword ptr [ebp+24]: pmax
  130. ;
  131. public IIDD16_GetMonitorRefreshRateRanges@20
  132. IIDD16_GetMonitorRefreshRateRanges@20:
  133. call dword ptr [pfnFT_Prolog_thk3216]
  134. xor eax,eax
  135. push eax
  136. push eax
  137. mov edx, dword ptr [ebp+20]
  138. or edx,edx
  139. jz @F
  140. or dword ptr [edx], 0
  141. @@:
  142. mov edx, dword ptr [ebp+24]
  143. or edx,edx
  144. jz @F
  145. or dword ptr [edx], 0
  146. @@:
  147. push dword ptr [ebp+8] ;dev: dword->dword
  148. push word ptr [ebp+12] ;xres: dword->word
  149. push word ptr [ebp+16] ;yres: dword->word
  150. mov eax, dword ptr [ebp+20]
  151. call SMapLS
  152. mov [ebp-68],edx
  153. push eax
  154. mov eax, dword ptr [ebp+24]
  155. call SMapLS
  156. mov [ebp-72],edx
  157. push eax
  158. call FT_Thunk
  159. movsx ebx,ax
  160. mov edx, dword ptr [ebp+20]
  161. or edx,edx
  162. jz L0
  163. movsx ecx, word ptr [edx]
  164. mov dword ptr [edx], ecx
  165. L0:
  166. mov ecx, dword ptr [ebp-68]
  167. call SUnMapLS
  168. mov edx, dword ptr [ebp+24]
  169. or edx,edx
  170. jz L1
  171. movsx ecx, word ptr [edx]
  172. mov dword ptr [edx], ecx
  173. L1:
  174. mov ecx, dword ptr [ebp-72]
  175. call SUnMapLS
  176. jmp FT_Exit20
  177. ;
  178. public DD16_IsWin95MiniDriver@0
  179. DD16_IsWin95MiniDriver@0:
  180. mov cl,51
  181. ; DD16_IsWin95MiniDriver(16) = DD16_IsWin95MiniDriver(32) {}
  182. ;
  183. ;
  184. public IIDD16_IsWin95MiniDriver@0
  185. IIDD16_IsWin95MiniDriver@0:
  186. push ebp
  187. mov ebp,esp
  188. push ecx
  189. sub esp,60
  190. call dword ptr [pfnQT_Thunk_thk3216]
  191. cwde
  192. leave
  193. retn
  194. ;
  195. public ModeX_SetPaletteEntries@12
  196. ModeX_SetPaletteEntries@12:
  197. mov cl,50
  198. ; ModeX_SetPaletteEntries(16) = ModeX_SetPaletteEntries(32) {}
  199. ;
  200. ; dword ptr [ebp+8]: wBase
  201. ; dword ptr [ebp+12]: wNum
  202. ; dword ptr [ebp+16]: lpPaletteEntries
  203. ;
  204. public IIModeX_SetPaletteEntries@12
  205. IIModeX_SetPaletteEntries@12:
  206. push ebp
  207. mov ebp,esp
  208. push ecx
  209. sub esp,60
  210. push word ptr [ebp+8] ;wBase: dword->word
  211. push word ptr [ebp+12] ;wNum: dword->word
  212. call SMapLS_IP_EBP_16
  213. push eax
  214. call dword ptr [pfnQT_Thunk_thk3216]
  215. shl eax,16
  216. shrd eax,edx,16
  217. call SUnMapLS_IP_EBP_16
  218. leave
  219. retn 12
  220. ;
  221. public ModeX_SetMode@8
  222. ModeX_SetMode@8:
  223. mov cl,49
  224. ; ModeX_SetMode(16) = ModeX_SetMode(32) {}
  225. ;
  226. ; dword ptr [ebp+8]: wWidth
  227. ; dword ptr [ebp+12]: wHeight
  228. ;
  229. public IIModeX_SetMode@8
  230. IIModeX_SetMode@8:
  231. push ebp
  232. mov ebp,esp
  233. push ecx
  234. sub esp,60
  235. push word ptr [ebp+8] ;wWidth: dword->word
  236. push word ptr [ebp+12] ;wHeight: dword->word
  237. call dword ptr [pfnQT_Thunk_thk3216]
  238. shl eax,16
  239. shrd eax,edx,16
  240. leave
  241. retn 8
  242. ;
  243. public ModeX_RestoreMode@0
  244. ModeX_RestoreMode@0:
  245. mov cl,48
  246. ; ModeX_RestoreMode(16) = ModeX_RestoreMode(32) {}
  247. ;
  248. ;
  249. public IIModeX_RestoreMode@0
  250. IIModeX_RestoreMode@0:
  251. push ebp
  252. mov ebp,esp
  253. push ecx
  254. sub esp,60
  255. call dword ptr [pfnQT_Thunk_thk3216]
  256. shl eax,16
  257. shrd eax,edx,16
  258. leave
  259. retn
  260. ;
  261. public ModeX_Flip@4
  262. ModeX_Flip@4:
  263. mov cl,47
  264. ; ModeX_Flip(16) = ModeX_Flip(32) {}
  265. ;
  266. ; dword ptr [ebp+8]: lpBackBuffer
  267. ;
  268. public IIModeX_Flip@4
  269. IIModeX_Flip@4:
  270. push ebp
  271. mov ebp,esp
  272. push ecx
  273. sub esp,60
  274. push dword ptr [ebp+8] ;lpBackBuffer: dword->dword
  275. call dword ptr [pfnQT_Thunk_thk3216]
  276. shl eax,16
  277. shrd eax,edx,16
  278. leave
  279. retn 4
  280. ;
  281. public DD16_SetEventHandle@8
  282. DD16_SetEventHandle@8:
  283. mov cl,46
  284. ; DD16_SetEventHandle(16) = DD16_SetEventHandle(32) {}
  285. ;
  286. ; dword ptr [ebp+8]: hInstance
  287. ; dword ptr [ebp+12]: dwEvent
  288. ;
  289. public IIDD16_SetEventHandle@8
  290. IIDD16_SetEventHandle@8:
  291. push ebp
  292. mov ebp,esp
  293. push ecx
  294. sub esp,60
  295. push dword ptr [ebp+8] ;hInstance: dword->dword
  296. push dword ptr [ebp+12] ;dwEvent: dword->dword
  297. call dword ptr [pfnQT_Thunk_thk3216]
  298. leave
  299. retn 8
  300. ;
  301. public DD16_ChangeDisplaySettings@8
  302. DD16_ChangeDisplaySettings@8:
  303. mov cl,42
  304. ; DD16_ChangeDisplaySettings(16) = DD16_ChangeDisplaySettings(32) {}
  305. ;
  306. ; dword ptr [ebp+8]: pdm
  307. ; dword ptr [ebp+12]: flags
  308. ;
  309. public IIDD16_ChangeDisplaySettings@8
  310. IIDD16_ChangeDisplaySettings@8:
  311. push ebp
  312. mov ebp,esp
  313. push ecx
  314. sub esp,60
  315. call SMapLS_IP_EBP_8
  316. push eax
  317. push dword ptr [ebp+12] ;flags: dword->dword
  318. call dword ptr [pfnQT_Thunk_thk3216]
  319. shl eax,16
  320. shrd eax,edx,16
  321. call SUnMapLS_IP_EBP_8
  322. leave
  323. retn 8
  324. ;
  325. public DD16_SafeMode@8
  326. DD16_SafeMode@8:
  327. mov cl,41
  328. ; DD16_SafeMode(16) = DD16_SafeMode(32) {}
  329. ;
  330. ; dword ptr [ebp+8]: hdc
  331. ; dword ptr [ebp+12]: fSafeMode
  332. ;
  333. public IIDD16_SafeMode@8
  334. IIDD16_SafeMode@8:
  335. push ebp
  336. mov ebp,esp
  337. push ecx
  338. sub esp,60
  339. push word ptr [ebp+8] ;hdc: dword->word
  340. push word ptr [ebp+12] ;fSafeMode: dword->word
  341. call dword ptr [pfnQT_Thunk_thk3216]
  342. cwde
  343. leave
  344. retn 8
  345. ;
  346. public DD16_GetDC@4
  347. DD16_GetDC@4:
  348. mov cl,40
  349. ; DD16_GetDC(16) = DD16_GetDC(32) {}
  350. ;
  351. ; dword ptr [ebp+8]: pddsd
  352. ;
  353. public IIDD16_GetDC@4
  354. IIDD16_GetDC@4:
  355. push ebp
  356. mov ebp,esp
  357. push ecx
  358. sub esp,60
  359. call SMapLS_IP_EBP_8
  360. push eax
  361. call dword ptr [pfnQT_Thunk_thk3216]
  362. movzx eax,ax
  363. call SUnMapLS_IP_EBP_8
  364. leave
  365. retn 4
  366. ;
  367. public DD16_Exclude@8
  368. DD16_Exclude@8:
  369. mov cl,38
  370. ; DD16_Exclude(16) = DD16_Exclude(32) {}
  371. ;
  372. ; dword ptr [ebp+8]: dwPDevice
  373. ; dword ptr [ebp+12]: prcl
  374. ;
  375. public IIDD16_Exclude@8
  376. IIDD16_Exclude@8:
  377. push ebp
  378. mov ebp,esp
  379. push ecx
  380. sub esp,60
  381. push dword ptr [ebp+8] ;dwPDevice: dword->dword
  382. call SMapLS_IP_EBP_12
  383. push eax
  384. call dword ptr [pfnQT_Thunk_thk3216]
  385. call SUnMapLS_IP_EBP_12
  386. leave
  387. retn 8
  388. ;
  389. public DD16_Unexclude@4
  390. DD16_Unexclude@4:
  391. mov cl,37
  392. jmp IIDD16_Unexclude@4
  393. public DD16_DoneDriver@4
  394. DD16_DoneDriver@4:
  395. mov cl,45
  396. ; DD16_Unexclude(16) = DD16_Unexclude(32) {}
  397. ;
  398. ; dword ptr [ebp+8]: dwPDevice
  399. ;
  400. public IIDD16_Unexclude@4
  401. IIDD16_Unexclude@4:
  402. push ebp
  403. mov ebp,esp
  404. push ecx
  405. sub esp,60
  406. push dword ptr [ebp+8] ;dwPDevice: dword->dword
  407. call dword ptr [pfnQT_Thunk_thk3216]
  408. leave
  409. retn 4
  410. ;
  411. public DD16_Stretch@56
  412. DD16_Stretch@56:
  413. mov cl,36
  414. ; DD16_Stretch(16) = DD16_Stretch(32) {}
  415. ;
  416. ; dword ptr [ebp+8]: DstPtr
  417. ; dword ptr [ebp+12]: DstPitch
  418. ; dword ptr [ebp+16]: DstBPP
  419. ; dword ptr [ebp+20]: DstX
  420. ; dword ptr [ebp+24]: DstY
  421. ; dword ptr [ebp+28]: DstDX
  422. ; dword ptr [ebp+32]: DstDY
  423. ; dword ptr [ebp+36]: SrcPtr
  424. ; dword ptr [ebp+40]: SrcPitch
  425. ; dword ptr [ebp+44]: SrcBPP
  426. ; dword ptr [ebp+48]: SrcX
  427. ; dword ptr [ebp+52]: SrcY
  428. ; dword ptr [ebp+56]: SrcDX
  429. ; dword ptr [ebp+60]: SrcDY
  430. ;
  431. public IIDD16_Stretch@56
  432. IIDD16_Stretch@56:
  433. push ebp
  434. mov ebp,esp
  435. push ecx
  436. sub esp,60
  437. push dword ptr [ebp+8] ;DstPtr: dword->dword
  438. push word ptr [ebp+12] ;DstPitch: dword->word
  439. push word ptr [ebp+16] ;DstBPP: dword->word
  440. push word ptr [ebp+20] ;DstX: dword->word
  441. push word ptr [ebp+24] ;DstY: dword->word
  442. push word ptr [ebp+28] ;DstDX: dword->word
  443. push word ptr [ebp+32] ;DstDY: dword->word
  444. push dword ptr [ebp+36] ;SrcPtr: dword->dword
  445. push word ptr [ebp+40] ;SrcPitch: dword->word
  446. push word ptr [ebp+44] ;SrcBPP: dword->word
  447. push word ptr [ebp+48] ;SrcX: dword->word
  448. push word ptr [ebp+52] ;SrcY: dword->word
  449. push word ptr [ebp+56] ;SrcDX: dword->word
  450. push word ptr [ebp+60] ;SrcDY: dword->word
  451. call dword ptr [pfnQT_Thunk_thk3216]
  452. cwde
  453. leave
  454. retn 56
  455. ;
  456. public DD16_SelectPalette@12
  457. DD16_SelectPalette@12:
  458. mov cl,35
  459. ; DD16_SelectPalette(16) = DD16_SelectPalette(32) {}
  460. ;
  461. ; dword ptr [ebp+8]: hDC
  462. ; dword ptr [ebp+12]: hPalette
  463. ; dword ptr [ebp+16]: f
  464. ;
  465. public IIDD16_SelectPalette@12
  466. IIDD16_SelectPalette@12:
  467. push ebp
  468. mov ebp,esp
  469. push ecx
  470. sub esp,60
  471. push word ptr [ebp+8] ;hDC: dword->word
  472. push word ptr [ebp+12] ;hPalette: dword->word
  473. push word ptr [ebp+16] ;f: dword->word
  474. call dword ptr [pfnQT_Thunk_thk3216]
  475. leave
  476. retn 12
  477. ;
  478. public DD16_InquireVisRgn@4
  479. DD16_InquireVisRgn@4:
  480. mov cl,34
  481. ; DD16_InquireVisRgn(16) = DD16_InquireVisRgn(32) {}
  482. ;
  483. ; dword ptr [ebp+8]: hDC
  484. ;
  485. public IIDD16_InquireVisRgn@4
  486. IIDD16_InquireVisRgn@4:
  487. push ebp
  488. mov ebp,esp
  489. push ecx
  490. sub esp,60
  491. push word ptr [ebp+8] ;hDC: dword->word
  492. call dword ptr [pfnQT_Thunk_thk3216]
  493. movzx eax,ax
  494. leave
  495. retn 4
  496. ;
  497. public DD16_GetPaletteEntries@12
  498. DD16_GetPaletteEntries@12:
  499. mov cl,31
  500. jmp IIDD16_GetPaletteEntries@12
  501. public DD16_SetPaletteEntries@12
  502. DD16_SetPaletteEntries@12:
  503. mov cl,32
  504. ; DD16_GetPaletteEntries(16) = DD16_GetPaletteEntries(32) {}
  505. ;
  506. ; dword ptr [ebp+8]: dwBase
  507. ; dword ptr [ebp+12]: dwNum
  508. ; dword ptr [ebp+16]: lpPaletteEntries
  509. ;
  510. public IIDD16_GetPaletteEntries@12
  511. IIDD16_GetPaletteEntries@12:
  512. push ebp
  513. mov ebp,esp
  514. push ecx
  515. sub esp,60
  516. push dword ptr [ebp+8] ;dwBase: dword->dword
  517. push dword ptr [ebp+12] ;dwNum: dword->dword
  518. call SMapLS_IP_EBP_16
  519. push eax
  520. call dword ptr [pfnQT_Thunk_thk3216]
  521. cwde
  522. call SUnMapLS_IP_EBP_16
  523. leave
  524. retn 12
  525. ;
  526. public DDThunk16_SetEntries@4
  527. DDThunk16_SetEntries@4:
  528. mov cx, (1 SHL 10) + (0 SHL 8) + 20
  529. ; DDThunk16_SetEntries(16) = DDThunk16_SetEntries(32) {}
  530. ;
  531. ; dword ptr [ebp+8]: lpSetEntriesData
  532. ;
  533. public IIDDThunk16_SetEntries@4
  534. IIDDThunk16_SetEntries@4:
  535. call dword ptr [pfnFT_Prolog_thk3216]
  536. xor eax,eax
  537. push eax
  538. sub esp,28
  539. mov esi,[ebp+8]
  540. or esi,esi
  541. jz @F
  542. or byte ptr [esi], 0
  543. or byte ptr [esi + 27], 0
  544. @@:
  545. mov esi,[ebp+8]
  546. or esi,esi
  547. jnz L2
  548. push esi
  549. jmp L3
  550. L2:
  551. lea edi,[ebp-96]
  552. push edi ;lpSetEntriesData: lpstruct32->lpstruct16
  553. or dword ptr [ebp-20],01h ;Set flag to fixup ESP-rel argument.
  554. mov ecx,4
  555. rep movsd
  556. lodsd ;lpEntries near32->far16
  557. call SMapLS
  558. mov [ebp-68],edx
  559. stosd
  560. movsd
  561. movsd
  562. L3:
  563. call FT_Thunk
  564. shrd ebx,edx,16
  565. mov bx,ax
  566. mov edi,[ebp+8]
  567. or edi,edi
  568. jz L4
  569. lea esi,[ebp-96] ;lpSetEntriesData Struct16->Struct32
  570. mov ecx,4
  571. rep movsd
  572. lodsd ;lpEntries far16->near32
  573. push eax
  574. call MapSL
  575. stosd
  576. movsd
  577. movsd
  578. L4:
  579. mov ecx, [ebp-68] ;lpEntries
  580. call SUnMapLS
  581. jmp FT_Exit4
  582. ;
  583. public DDThunk16_GetFlipStatus@4
  584. DDThunk16_GetFlipStatus@4:
  585. mov cl,7
  586. jmp IIDDThunk16_GetFlipStatus@4
  587. public DDThunk16_CreatePalette@4
  588. DDThunk16_CreatePalette@4:
  589. mov cl,30
  590. jmp IIDDThunk16_GetFlipStatus@4
  591. public DDThunk16_CreateSurface@4
  592. DDThunk16_CreateSurface@4:
  593. mov cl,29
  594. jmp IIDDThunk16_GetFlipStatus@4
  595. public DDThunk16_CanCreateSurface@4
  596. DDThunk16_CanCreateSurface@4:
  597. mov cl,28
  598. jmp IIDDThunk16_GetFlipStatus@4
  599. public DDThunk16_WaitForVerticalBlank@4
  600. DDThunk16_WaitForVerticalBlank@4:
  601. mov cl,27
  602. jmp IIDDThunk16_GetFlipStatus@4
  603. public DDThunk16_DestroyDriver@4
  604. DDThunk16_DestroyDriver@4:
  605. mov cl,26
  606. jmp IIDDThunk16_GetFlipStatus@4
  607. public DDThunk16_SetMode@4
  608. DDThunk16_SetMode@4:
  609. mov cl,25
  610. jmp IIDDThunk16_GetFlipStatus@4
  611. public DDThunk16_GetScanLine@4
  612. DDThunk16_GetScanLine@4:
  613. mov cl,24
  614. jmp IIDDThunk16_GetFlipStatus@4
  615. public DDThunk16_SetExclusiveMode@4
  616. DDThunk16_SetExclusiveMode@4:
  617. mov cl,23
  618. jmp IIDDThunk16_GetFlipStatus@4
  619. public DDThunk16_FlipToGDISurface@4
  620. DDThunk16_FlipToGDISurface@4:
  621. mov cl,22
  622. jmp IIDDThunk16_GetFlipStatus@4
  623. public DDThunk16_DestroyPalette@4
  624. DDThunk16_DestroyPalette@4:
  625. mov cl,21
  626. jmp IIDDThunk16_GetFlipStatus@4
  627. public DDThunk16_DestroySurface@4
  628. DDThunk16_DestroySurface@4:
  629. mov cl,19
  630. jmp IIDDThunk16_GetFlipStatus@4
  631. public DDThunk16_Flip@4
  632. DDThunk16_Flip@4:
  633. mov cl,18
  634. jmp IIDDThunk16_GetFlipStatus@4
  635. public DDThunk16_Blt@4
  636. DDThunk16_Blt@4:
  637. mov cl,17
  638. jmp IIDDThunk16_GetFlipStatus@4
  639. public DDThunk16_Lock@4
  640. DDThunk16_Lock@4:
  641. mov cl,16
  642. jmp IIDDThunk16_GetFlipStatus@4
  643. public DDThunk16_Unlock@4
  644. DDThunk16_Unlock@4:
  645. mov cl,15
  646. jmp IIDDThunk16_GetFlipStatus@4
  647. public DDThunk16_AddAttachedSurface@4
  648. DDThunk16_AddAttachedSurface@4:
  649. mov cl,14
  650. jmp IIDDThunk16_GetFlipStatus@4
  651. public DDThunk16_SetColorKey@4
  652. DDThunk16_SetColorKey@4:
  653. mov cl,13
  654. jmp IIDDThunk16_GetFlipStatus@4
  655. public DDThunk16_SetClipList@4
  656. DDThunk16_SetClipList@4:
  657. mov cl,12
  658. jmp IIDDThunk16_GetFlipStatus@4
  659. public DDThunk16_UpdateOverlay@4
  660. DDThunk16_UpdateOverlay@4:
  661. mov cl,11
  662. jmp IIDDThunk16_GetFlipStatus@4
  663. public DDThunk16_SetOverlayPosition@4
  664. DDThunk16_SetOverlayPosition@4:
  665. mov cl,10
  666. jmp IIDDThunk16_GetFlipStatus@4
  667. public DDThunk16_SetPalette@4
  668. DDThunk16_SetPalette@4:
  669. mov cl,9
  670. jmp IIDDThunk16_GetFlipStatus@4
  671. public DDThunk16_GetBltStatus@4
  672. DDThunk16_GetBltStatus@4:
  673. mov cl,8
  674. ; DDThunk16_GetFlipStatus(16) = DDThunk16_GetFlipStatus(32) {}
  675. ;
  676. ; dword ptr [ebp+8]: lpGetFlipStatusData
  677. ;
  678. public IIDDThunk16_GetFlipStatus@4
  679. IIDDThunk16_GetFlipStatus@4:
  680. push ebp
  681. mov ebp,esp
  682. push ecx
  683. sub esp,60
  684. call SMapLS_IP_EBP_8
  685. push eax
  686. call dword ptr [pfnQT_Thunk_thk3216]
  687. shl eax,16
  688. shrd eax,edx,16
  689. call SUnMapLS_IP_EBP_8
  690. leave
  691. retn 4
  692. ;
  693. public DCIIsBanked@4
  694. DCIIsBanked@4:
  695. mov cl,6
  696. ; DCIIsBanked(16) = DCIIsBanked(32) {}
  697. ;
  698. ; dword ptr [ebp+8]: hdc
  699. ;
  700. public IIDCIIsBanked@4
  701. IIDCIIsBanked@4:
  702. push ebp
  703. mov ebp,esp
  704. push ecx
  705. sub esp,60
  706. push word ptr [ebp+8] ;hdc: dword->word
  707. call dword ptr [pfnQT_Thunk_thk3216]
  708. cwde
  709. leave
  710. retn 4
  711. ;
  712. public DCIOpenProvider@0
  713. DCIOpenProvider@0:
  714. mov cl,5
  715. ; DCIOpenProvider(16) = DCIOpenProvider(32) {}
  716. ;
  717. ;
  718. public IIDCIOpenProvider@0
  719. IIDCIOpenProvider@0:
  720. push ebp
  721. mov ebp,esp
  722. push ecx
  723. sub esp,60
  724. call dword ptr [pfnQT_Thunk_thk3216]
  725. movzx eax,ax
  726. leave
  727. retn
  728. ;
  729. public DCICloseProvider@4
  730. DCICloseProvider@4:
  731. mov cl,4
  732. jmp IIDCICloseProvider@4
  733. public DD16_SetCertified@4
  734. DD16_SetCertified@4:
  735. mov cl,52
  736. jmp IIDCICloseProvider@4
  737. public DD16_ReleaseDC@4
  738. DD16_ReleaseDC@4:
  739. mov cl,39
  740. jmp IIDCICloseProvider@4
  741. public DD16_EnableReboot@4
  742. DD16_EnableReboot@4:
  743. mov cl,33
  744. ; DCICloseProvider(16) = DCICloseProvider(32) {}
  745. ;
  746. ; dword ptr [ebp+8]: hdc
  747. ;
  748. public IIDCICloseProvider@4
  749. IIDCICloseProvider@4:
  750. push ebp
  751. mov ebp,esp
  752. push ecx
  753. sub esp,60
  754. push word ptr [ebp+8] ;hdc: dword->word
  755. call dword ptr [pfnQT_Thunk_thk3216]
  756. leave
  757. retn 4
  758. ;
  759. public DCICreatePrimary32@8
  760. DCICreatePrimary32@8:
  761. mov cl,3
  762. ; DCICreatePrimary32(16) = DCICreatePrimary32(32) {}
  763. ;
  764. ; dword ptr [ebp+8]: hdc
  765. ; dword ptr [ebp+12]: lpSurface
  766. ;
  767. public IIDCICreatePrimary32@8
  768. IIDCICreatePrimary32@8:
  769. push ebp
  770. mov ebp,esp
  771. push ecx
  772. sub esp,60
  773. push word ptr [ebp+8] ;hdc: dword->word
  774. call SMapLS_IP_EBP_12
  775. push eax
  776. call dword ptr [pfnQT_Thunk_thk3216]
  777. cwde
  778. call SUnMapLS_IP_EBP_12
  779. leave
  780. retn 8
  781. ;
  782. public DCIEndAccess@4
  783. DCIEndAccess@4:
  784. mov cl,1
  785. jmp IIDCIEndAccess@4
  786. public DD16_GetDriverFns@4
  787. DD16_GetDriverFns@4:
  788. mov cl,44
  789. jmp IIDCIEndAccess@4
  790. public DD16_GetHALInfo@4
  791. DD16_GetHALInfo@4:
  792. mov cl,43
  793. jmp IIDCIEndAccess@4
  794. public DCIDestroy32@4
  795. DCIDestroy32@4:
  796. mov cl,2
  797. ; DCIEndAccess(16) = DCIEndAccess(32) {}
  798. ;
  799. ; dword ptr [ebp+8]: pdci
  800. ;
  801. public IIDCIEndAccess@4
  802. IIDCIEndAccess@4:
  803. push ebp
  804. mov ebp,esp
  805. push ecx
  806. sub esp,60
  807. call SMapLS_IP_EBP_8
  808. push eax
  809. call dword ptr [pfnQT_Thunk_thk3216]
  810. call SUnMapLS_IP_EBP_8
  811. leave
  812. retn 4
  813. ;
  814. public DCIBeginAccess@20
  815. DCIBeginAccess@20:
  816. mov cl,0
  817. ; DCIBeginAccess(16) = DCIBeginAccess(32) {}
  818. ;
  819. ; dword ptr [ebp+8]: pdci
  820. ; dword ptr [ebp+12]: x
  821. ; dword ptr [ebp+16]: y
  822. ; dword ptr [ebp+20]: dx
  823. ; dword ptr [ebp+24]: dy
  824. ;
  825. public IIDCIBeginAccess@20
  826. IIDCIBeginAccess@20:
  827. push ebp
  828. mov ebp,esp
  829. push ecx
  830. sub esp,60
  831. call SMapLS_IP_EBP_8
  832. push eax
  833. push word ptr [ebp+12] ;x: dword->word
  834. push word ptr [ebp+16] ;y: dword->word
  835. push word ptr [ebp+20] ;dx: dword->word
  836. push word ptr [ebp+24] ;dy: dword->word
  837. call dword ptr [pfnQT_Thunk_thk3216]
  838. cwde
  839. call SUnMapLS_IP_EBP_8
  840. leave
  841. retn 20
  842. ELSE
  843. ;************************* START OF 16-BIT CODE *************************
  844. OPTION SEGMENT:USE16
  845. .model LARGE,PASCAL
  846. .code ddraw
  847. externDef DCIBeginAccess:far16
  848. externDef DCIEndAccess:far16
  849. externDef DCIDestroy:far16
  850. externDef DCICreatePrimary32:far16
  851. externDef DCICloseProvider:far16
  852. externDef DCIOpenProvider:far16
  853. externDef DCIIsBanked:far16
  854. externDef DDThunk16_GetFlipStatus:far16
  855. externDef DDThunk16_GetBltStatus:far16
  856. externDef DDThunk16_SetPalette:far16
  857. externDef DDThunk16_SetOverlayPosition:far16
  858. externDef DDThunk16_UpdateOverlay:far16
  859. externDef DDThunk16_SetClipList:far16
  860. externDef DDThunk16_SetColorKey:far16
  861. externDef DDThunk16_AddAttachedSurface:far16
  862. externDef DDThunk16_Unlock:far16
  863. externDef DDThunk16_Lock:far16
  864. externDef DDThunk16_Blt:far16
  865. externDef DDThunk16_Flip:far16
  866. externDef DDThunk16_DestroySurface:far16
  867. externDef DDThunk16_SetEntries:far16
  868. externDef DDThunk16_DestroyPalette:far16
  869. externDef DDThunk16_FlipToGDISurface:far16
  870. externDef DDThunk16_SetExclusiveMode:far16
  871. externDef DDThunk16_GetScanLine:far16
  872. externDef DDThunk16_SetMode:far16
  873. externDef DDThunk16_DestroyDriver:far16
  874. externDef DDThunk16_WaitForVerticalBlank:far16
  875. externDef DDThunk16_CanCreateSurface:far16
  876. externDef DDThunk16_CreateSurface:far16
  877. externDef DDThunk16_CreatePalette:far16
  878. externDef DD16_GetPaletteEntries:far16
  879. externDef DD16_SetPaletteEntries:far16
  880. externDef DD16_EnableReboot:far16
  881. externDef DD16_InquireVisRgn:far16
  882. externDef DD16_SelectPalette:far16
  883. externDef DD16_Stretch:far16
  884. externDef DD16_Unexclude:far16
  885. externDef DD16_Exclude:far16
  886. externDef DD16_ReleaseDC:far16
  887. externDef DD16_GetDC:far16
  888. externDef DD16_SafeMode:far16
  889. externDef DD16_ChangeDisplaySettings:far16
  890. externDef DD16_GetHALInfo:far16
  891. externDef DD16_GetDriverFns:far16
  892. externDef DD16_DoneDriver:far16
  893. externDef DD16_SetEventHandle:far16
  894. externDef ModeX_Flip:far16
  895. externDef ModeX_RestoreMode:far16
  896. externDef ModeX_SetMode:far16
  897. externDef ModeX_SetPaletteEntries:far16
  898. externDef DD16_IsWin95MiniDriver:far16
  899. externDef DD16_SetCertified:far16
  900. externDef DD16_GetMonitorRefreshRateRanges:far16
  901. externDef DD16_GetMonitorMaxSize:far16
  902. FT_thk3216TargetTable label word
  903. dw offset DCIBeginAccess
  904. dw seg DCIBeginAccess
  905. dw offset DCIEndAccess
  906. dw seg DCIEndAccess
  907. dw offset DCIDestroy
  908. dw seg DCIDestroy
  909. dw offset DCICreatePrimary32
  910. dw seg DCICreatePrimary32
  911. dw offset DCICloseProvider
  912. dw seg DCICloseProvider
  913. dw offset DCIOpenProvider
  914. dw seg DCIOpenProvider
  915. dw offset DCIIsBanked
  916. dw seg DCIIsBanked
  917. dw offset DDThunk16_GetFlipStatus
  918. dw seg DDThunk16_GetFlipStatus
  919. dw offset DDThunk16_GetBltStatus
  920. dw seg DDThunk16_GetBltStatus
  921. dw offset DDThunk16_SetPalette
  922. dw seg DDThunk16_SetPalette
  923. dw offset DDThunk16_SetOverlayPosition
  924. dw seg DDThunk16_SetOverlayPosition
  925. dw offset DDThunk16_UpdateOverlay
  926. dw seg DDThunk16_UpdateOverlay
  927. dw offset DDThunk16_SetClipList
  928. dw seg DDThunk16_SetClipList
  929. dw offset DDThunk16_SetColorKey
  930. dw seg DDThunk16_SetColorKey
  931. dw offset DDThunk16_AddAttachedSurface
  932. dw seg DDThunk16_AddAttachedSurface
  933. dw offset DDThunk16_Unlock
  934. dw seg DDThunk16_Unlock
  935. dw offset DDThunk16_Lock
  936. dw seg DDThunk16_Lock
  937. dw offset DDThunk16_Blt
  938. dw seg DDThunk16_Blt
  939. dw offset DDThunk16_Flip
  940. dw seg DDThunk16_Flip
  941. dw offset DDThunk16_DestroySurface
  942. dw seg DDThunk16_DestroySurface
  943. dw offset DDThunk16_SetEntries
  944. dw seg DDThunk16_SetEntries
  945. dw offset DDThunk16_DestroyPalette
  946. dw seg DDThunk16_DestroyPalette
  947. dw offset DDThunk16_FlipToGDISurface
  948. dw seg DDThunk16_FlipToGDISurface
  949. dw offset DDThunk16_SetExclusiveMode
  950. dw seg DDThunk16_SetExclusiveMode
  951. dw offset DDThunk16_GetScanLine
  952. dw seg DDThunk16_GetScanLine
  953. dw offset DDThunk16_SetMode
  954. dw seg DDThunk16_SetMode
  955. dw offset DDThunk16_DestroyDriver
  956. dw seg DDThunk16_DestroyDriver
  957. dw offset DDThunk16_WaitForVerticalBlank
  958. dw seg DDThunk16_WaitForVerticalBlank
  959. dw offset DDThunk16_CanCreateSurface
  960. dw seg DDThunk16_CanCreateSurface
  961. dw offset DDThunk16_CreateSurface
  962. dw seg DDThunk16_CreateSurface
  963. dw offset DDThunk16_CreatePalette
  964. dw seg DDThunk16_CreatePalette
  965. dw offset DD16_GetPaletteEntries
  966. dw seg DD16_GetPaletteEntries
  967. dw offset DD16_SetPaletteEntries
  968. dw seg DD16_SetPaletteEntries
  969. dw offset DD16_EnableReboot
  970. dw seg DD16_EnableReboot
  971. dw offset DD16_InquireVisRgn
  972. dw seg DD16_InquireVisRgn
  973. dw offset DD16_SelectPalette
  974. dw seg DD16_SelectPalette
  975. dw offset DD16_Stretch
  976. dw seg DD16_Stretch
  977. dw offset DD16_Unexclude
  978. dw seg DD16_Unexclude
  979. dw offset DD16_Exclude
  980. dw seg DD16_Exclude
  981. dw offset DD16_ReleaseDC
  982. dw seg DD16_ReleaseDC
  983. dw offset DD16_GetDC
  984. dw seg DD16_GetDC
  985. dw offset DD16_SafeMode
  986. dw seg DD16_SafeMode
  987. dw offset DD16_ChangeDisplaySettings
  988. dw seg DD16_ChangeDisplaySettings
  989. dw offset DD16_GetHALInfo
  990. dw seg DD16_GetHALInfo
  991. dw offset DD16_GetDriverFns
  992. dw seg DD16_GetDriverFns
  993. dw offset DD16_DoneDriver
  994. dw seg DD16_DoneDriver
  995. dw offset DD16_SetEventHandle
  996. dw seg DD16_SetEventHandle
  997. dw offset ModeX_Flip
  998. dw seg ModeX_Flip
  999. dw offset ModeX_RestoreMode
  1000. dw seg ModeX_RestoreMode
  1001. dw offset ModeX_SetMode
  1002. dw seg ModeX_SetMode
  1003. dw offset ModeX_SetPaletteEntries
  1004. dw seg ModeX_SetPaletteEntries
  1005. dw offset DD16_IsWin95MiniDriver
  1006. dw seg DD16_IsWin95MiniDriver
  1007. dw offset DD16_SetCertified
  1008. dw seg DD16_SetCertified
  1009. dw offset DD16_GetMonitorRefreshRateRanges
  1010. dw seg DD16_GetMonitorRefreshRateRanges
  1011. dw offset DD16_GetMonitorMaxSize
  1012. dw seg DD16_GetMonitorMaxSize
  1013. .data
  1014. public thk3216_ThunkData16 ;This symbol must be exported.
  1015. thk3216_ThunkData16 dd 3130534ch ;Protocol 'LS01'
  1016. dd 0210141h ;Checksum
  1017. dw offset FT_thk3216TargetTable
  1018. dw seg FT_thk3216TargetTable
  1019. dd 0 ;First-time flag.
  1020. .code ddraw
  1021. externDef ThunkConnect16:far16
  1022. public thk3216_ThunkConnect16
  1023. thk3216_ThunkConnect16:
  1024. pop ax
  1025. pop dx
  1026. push seg thk3216_ThunkData16
  1027. push offset thk3216_ThunkData16
  1028. push seg thk3216_ThkData32
  1029. push offset thk3216_ThkData32
  1030. push cs
  1031. push dx
  1032. push ax
  1033. jmp ThunkConnect16
  1034. thk3216_ThkData32 label byte
  1035. db "thk3216_ThunkData32",0
  1036. ENDIF
  1037. END