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.

840 lines
23 KiB

  1. ifndef _MINIVDD_H_
  2. _MINIVDD_H_ EQU 1
  3. ifndef Not_VxD
  4. ifdef MINIVDD
  5. ifdef NEC_98
  6. Begin_Service_Table VDD
  7. VDD_Service VDD_Get_Version
  8. VDD_Service VDD_PIF_State
  9. VDD_Service VDD_Get_GrabRtn
  10. VDD_Service VDD_Hide_Cursor
  11. VDD_Service VDD_Set_VMType
  12. VDD_Service VDD_Get_ModTime
  13. VDD_Service VDD_Set_HCurTrk
  14. VDD_Service VDD_Msg_ClrScrn
  15. VDD_Service VDD_Msg_ForColor
  16. VDD_Service VDD_Msg_BakColor
  17. VDD_Service VDD_Msg_TextOut
  18. VDD_Service VDD_Msg_SetCursPos
  19. VDD_Service VDD_Query_Access
  20. VDD_Service VDD_Check_Update_Soon
  21. VDD_Service VDD_Get_Mini_Dispatch_Table
  22. VDD_Service VDD_Register_Virtual_Port
  23. VDD_Service VDD_Get_VM_Info
  24. VDD_Service VDD_Get_Special_VM_IDs
  25. VDD_Service VDD_Register_Extra_Screen_Selector
  26. VDD_Service VDD_Takeover_VGA_Port
  27. VDD_Service VDD_Get_DISPLAYINFO
  28. VDD_Service VDD_Do_Physical_IO
  29. VDD_Service VDD_Register_Mini_VDD
  30. VDD_Service VDD_Install_IO_Handler
  31. VDD_Service VDD_Install_Mult_IO_Handlers
  32. VDD_Service VDD_Enable_Local_Trapping
  33. VDD_Service VDD_Disable_Local_Trapping
  34. VDD_Service VDD_Trap_Suspend
  35. VDD_Service Test_Vid_VM_Handle
  36. VDD_Service VDD_Set_Core_Graphics
  37. VDD_Service VDD_Load_AccBIOS
  38. VDD_Service VDD_Map_AccBIOS
  39. VDD_Service VDD_Map_VRAM
  40. VDD_Service VDD_EnableDevice
  41. End_Service_Table VDD
  42. else
  43. Begin_Service_Table VDD
  44. VDD_Service VDD_Get_Version
  45. VDD_Service VDD_PIF_State
  46. VDD_Service VDD_Get_GrabRtn
  47. VDD_Service VDD_Hide_Cursor
  48. VDD_Service VDD_Set_VMType
  49. VDD_Service VDD_Get_ModTime
  50. VDD_Service VDD_Set_HCurTrk
  51. VDD_Service VDD_Msg_ClrScrn
  52. VDD_Service VDD_Msg_ForColor
  53. VDD_Service VDD_Msg_BakColor
  54. VDD_Service VDD_Msg_TextOut
  55. VDD_Service VDD_Msg_SetCursPos
  56. VDD_Service VDD_Query_Access
  57. VDD_Service VDD_Check_Update_Soon
  58. VDD_Service VDD_Get_Mini_Dispatch_Table
  59. VDD_Service VDD_Register_Virtual_Port
  60. VDD_Service VDD_Get_VM_Info
  61. VDD_Service VDD_Get_Special_VM_IDs
  62. VDD_Service VDD_Register_Extra_Screen_Selector
  63. VDD_Service VDD_Takeover_VGA_Port
  64. VDD_Service VDD_Get_DISPLAYINFO
  65. VDD_Service VDD_Do_Physical_IO
  66. VDD_Service VDD_Set_Sleep_Flag_Addr
  67. VDD_Service VDD_EnableDevice
  68. End_Service_Table VDD
  69. endif
  70. endif
  71. VDD_VerNum EQU 0400H
  72. VDD_MinVerNum EQU 030AH
  73. ifdef NEC_98
  74. bVidTextMd EQU 4
  75. fVidTextMd EQU (1 SHL 4)
  76. bVidNTModeFF EQU 0
  77. fVidNTModeFF EQU (1 SHL 0)
  78. bVidNTModeFFC16 EQU 1
  79. fVidNTModeFFC16 EQU (1 SHL 1)
  80. bVidNTDispRW EQU 2
  81. fVidNTDispRW EQU (1 SHL 2)
  82. bVidNTPal EQU 3
  83. fVidNTPal EQU (1 SHL 3)
  84. bVidNTGDC EQU 5
  85. fVidNTGDC EQU (1 SHL 5)
  86. bVidNTGDCTON EQU 6
  87. fVidNTGDCTON EQU (1 SHL 6)
  88. bVidNTGDCGON EQU 7
  89. fVidNTGDCGON EQU (1 SHL 7)
  90. bVidNTFont EQU 8
  91. fVidNTFont EQU (1 SHL 8)
  92. bVidCRTC EQU 9
  93. fVidCRTC EQU (1 SHL 9)
  94. bVidDispDataXfer EQU 10
  95. fVidDispDataXfer EQU (1 SHL 10)
  96. bVidXFERPlane0 EQU 11
  97. fVidXFERPlane0 EQU (1 SHL 11)
  98. bVidXFERPlane1 EQU 12
  99. fVidXFERPlane1 EQU (1 SHL 12)
  100. bVidXFERPlane2 EQU 13
  101. fVidXFERPlane2 EQU (1 SHL 13)
  102. bVidXFERPlane3 EQU 14
  103. fVidXFERPlane3 EQU (1 SHL 14)
  104. mVidXFERPlane EQU (fVidXFERPlane0+fVidXFERPlane1+fVidXFERPlane2+fVidXFERPlane3)
  105. mVidNTH98 EQU (fVidNTModeFF+fVidNTModeFFC16+fVidNTDispRW+fVidNTPal+fVidNTGDC+fVidNTGDCTON+fVidNTGDCGON)
  106. else
  107. fVidTxtEmulate EQU 0001H
  108. fVidNoTrpTxt EQU 0002H
  109. fVidNoTrpLRGrfx EQU 0004H
  110. fVidNoTrpHRGrfx EQU 0008H
  111. fVidTextMd EQU 0010H
  112. fVidLowRsGrfxMd EQU 0020H
  113. fVidHghRsGrfxMd EQU 0040H
  114. fVidRetainAllo EQU 0080H
  115. endif
  116. ifdef NEC_98
  117. REGISTER_DISPLAY_DRIVER EQU 0
  118. PRE_HIRES_TO_VGA EQU 1
  119. SAVE_REGISTERS EQU 2
  120. RESTORE_REGISTERS EQU 3
  121. ENABLE_TRAPS EQU 4
  122. DISABLE_TRAPS EQU 5
  123. DISPLAY_DRIVER_DISABLING EQU 6
  124. ENABLE_ACCELERATER EQU 7
  125. DISABLE_ACCELERATER EQU 8
  126. CHECK_UPDATE EQU 9
  127. CHECK_WINDOWED EQU 10
  128. ACC_VBE_PM EQU 11
  129. ACC_VBE_DDC EQU 12
  130. ACC_INT_10 EQU 13
  131. ACC_GET_CAPABILITIES EQU 14
  132. ACC_GET_EXT_MODE_INFO EQU 15
  133. ACC_GET_FLAT_SELECTOR EQU 16
  134. ACC_ENABLE_BIOS EQU 17
  135. ACC_DISABLE_BIOS EQU 18
  136. ACC_SET_PALETTE EQU 19
  137. ACC_GET_PALETTE EQU 20
  138. ACC_SET_CURSOR EQU 21
  139. ACC_SHOW_CURSOR EQU 22
  140. ACC_HIDE_CURSOR EQU 23
  141. ACC_SET_CURSOR_POS EQU 24
  142. ACC_GET_CURSOR_POS EQU 25
  143. CM_POWERSTATE_HIBERNATE EQU 00000010H
  144. CM_POWERSTATE_VDD_VALID EQU <(CM_POWERSTATE_BITS OR CM_POWERSTATE_HIBERNATE)>
  145. NBR_MINI_VDD_FUNCTIONS_40 EQU 26
  146. GET_NUM_UNITS EQU 26
  147. SET_ADAPTER_POWER_STATE EQU 27
  148. GET_ADAPTER_POWER_STATE_CAPS EQU 28
  149. SET_MONITOR_POWER_STATE EQU 29
  150. GET_MONITOR_POWER_STATE_CAPS EQU 30
  151. GET_MONITOR_INFO EQU 31
  152. I2C_OPEN EQU 32
  153. I2C_ACCESS EQU 33
  154. GPIO_OPEN EQU 34
  155. GPIO_ACCESS EQU 35
  156. COPYPROTECTION_ACCESS EQU 36
  157. NBR_MINI_VDD_FUNCTIONS_41 EQU 37
  158. ifdef MAINVDD
  159. NBR_MINI_VDD_FUNCTIONS EQU NBR_MINI_VDD_FUNCTIONS_41
  160. else
  161. NBR_MINI_VDD_FUNCTIONS EQU NBR_MINI_VDD_FUNCTIONS_40
  162. endif
  163. else
  164. REGISTER_DISPLAY_DRIVER EQU 0
  165. GET_VDD_BANK EQU 1
  166. SET_VDD_BANK EQU 2
  167. RESET_BANK EQU 3
  168. PRE_HIRES_TO_VGA EQU 4
  169. POST_HIRES_TO_VGA EQU 5
  170. PRE_VGA_TO_HIRES EQU 6
  171. POST_VGA_TO_HIRES EQU 7
  172. SAVE_REGISTERS EQU 8
  173. RESTORE_REGISTERS EQU 9
  174. MODIFY_REGISTER_STATE EQU 10
  175. ACCESS_VGA_MEMORY_MODE EQU 11
  176. ACCESS_LINEAR_MEMORY_MODE EQU 12
  177. ENABLE_TRAPS EQU 13
  178. DISABLE_TRAPS EQU 14
  179. MAKE_HARDWARE_NOT_BUSY EQU 15
  180. VIRTUALIZE_CRTC_IN EQU 16
  181. VIRTUALIZE_CRTC_OUT EQU 17
  182. VIRTUALIZE_SEQUENCER_IN EQU 18
  183. VIRTUALIZE_SEQUENCER_OUT EQU 19
  184. VIRTUALIZE_GCR_IN EQU 20
  185. VIRTUALIZE_GCR_OUT EQU 21
  186. SET_LATCH_BANK EQU 22
  187. RESET_LATCH_BANK EQU 23
  188. SAVE_LATCHES EQU 24
  189. RESTORE_LATCHES EQU 25
  190. DISPLAY_DRIVER_DISABLING EQU 26
  191. SELECT_PLANE EQU 27
  192. PRE_CRTC_MODE_CHANGE EQU 28
  193. POST_CRTC_MODE_CHANGE EQU 29
  194. VIRTUALIZE_DAC_OUT EQU 30
  195. VIRTUALIZE_DAC_IN EQU 31
  196. GET_CURRENT_BANK_WRITE EQU 32
  197. GET_CURRENT_BANK_READ EQU 33
  198. SET_BANK EQU 34
  199. CHECK_HIRES_MODE EQU 35
  200. GET_TOTAL_VRAM_SIZE EQU 36
  201. GET_BANK_SIZE EQU 37
  202. SET_HIRES_MODE EQU 38
  203. PRE_HIRES_SAVE_RESTORE EQU 39
  204. POST_HIRES_SAVE_RESTORE EQU 40
  205. VESA_SUPPORT EQU 41
  206. GET_CHIP_ID EQU 42
  207. CHECK_SCREEN_SWITCH_OK EQU 43
  208. VIRTUALIZE_BLTER_IO EQU 44
  209. SAVE_MESSAGE_MODE_STATE EQU 45
  210. SAVE_FORCED_PLANAR_STATE EQU 46
  211. VESA_CALL_POST_PROCESSING EQU 47
  212. PRE_INT_10_MODE_SET EQU 48
  213. NBR_MINI_VDD_FUNCTIONS_40 EQU 49
  214. CM_POWERSTATE_HIBERNATE EQU 00000010H
  215. CM_POWERSTATE_VDD_VALID EQU <(CM_POWERSTATE_BITS OR CM_POWERSTATE_HIBERNATE)>
  216. GET_NUM_UNITS EQU 49
  217. TURN_VGA_OFF EQU 50
  218. TURN_VGA_ON EQU 51
  219. SET_ADAPTER_POWER_STATE EQU 52
  220. GET_ADAPTER_POWER_STATE_CAPS EQU 53
  221. SET_MONITOR_POWER_STATE EQU 54
  222. GET_MONITOR_POWER_STATE_CAPS EQU 55
  223. GET_MONITOR_INFO EQU 56
  224. I2C_OPEN EQU 57
  225. I2C_ACCESS EQU 58
  226. GPIO_OPEN EQU 59
  227. GPIO_ACCESS EQU 60
  228. COPYPROTECTION_ACCESS EQU 61
  229. NBR_MINI_VDD_FUNCTIONS_41 EQU 62
  230. ifdef MAINVDD
  231. NBR_MINI_VDD_FUNCTIONS EQU NBR_MINI_VDD_FUNCTIONS_41
  232. else
  233. NBR_MINI_VDD_FUNCTIONS EQU NBR_MINI_VDD_FUNCTIONS_40
  234. endif
  235. endif
  236. endif
  237. VDD_QUERY_VERSION EQU 0
  238. MINIVDD_SVC_BASE_OFFSET EQU 80H
  239. VDD_DRIVER_REGISTER EQU (0+MINIVDD_SVC_BASE_OFFSET)
  240. VDD_DRIVER_UNREGISTER EQU (1+MINIVDD_SVC_BASE_OFFSET)
  241. VDD_SAVE_DRIVER_STATE EQU (2+MINIVDD_SVC_BASE_OFFSET)
  242. VDD_REGISTER_DISPLAY_DRIVER_INFO EQU (3+MINIVDD_SVC_BASE_OFFSET)
  243. VDD_REGISTER_SSB_FLAGS EQU (4+MINIVDD_SVC_BASE_OFFSET)
  244. VDD_GET_DISPLAY_CONFIG EQU (5+MINIVDD_SVC_BASE_OFFSET)
  245. VDD_PRE_MODE_CHANGE EQU (6+MINIVDD_SVC_BASE_OFFSET)
  246. VDD_POST_MODE_CHANGE EQU (7+MINIVDD_SVC_BASE_OFFSET)
  247. VDD_SET_USER_FLAGS EQU (8+MINIVDD_SVC_BASE_OFFSET)
  248. VDD_SET_BUSY_FLAG_ADDR EQU (9+MINIVDD_SVC_BASE_OFFSET)
  249. VDD_PC98_RESERVED EQU (10+MINIVDD_SVC_BASE_OFFSET)
  250. VDD_VBE_PM EQU (10+MINIVDD_SVC_BASE_OFFSET)
  251. VDD_ENABLE EQU (11+MINIVDD_SVC_BASE_OFFSET)
  252. VDD_GETMEMBASE EQU (12+MINIVDD_SVC_BASE_OFFSET)
  253. VDD_OPEN EQU (13+MINIVDD_SVC_BASE_OFFSET)
  254. VDD_CLOSE EQU (14+MINIVDD_SVC_BASE_OFFSET)
  255. VDD_OPEN_KEY EQU (15+MINIVDD_SVC_BASE_OFFSET)
  256. VDD_SET_POWER_STATE EQU (16+MINIVDD_SVC_BASE_OFFSET)
  257. VDD_GET_POWER_STATE_CAPS EQU (17+MINIVDD_SVC_BASE_OFFSET)
  258. VDD_GET_DISPLAY_CONFIG2 EQU 8085H
  259. ENABLE_IO EQU 00000001H
  260. ENABLE_MEM EQU 00000002H
  261. ENABLE_VGA EQU 00000030H
  262. ENABLE_ROM EQU 00000080H
  263. ENABLE_ALL EQU 000000FFH
  264. ENABLE_NONE EQU 00000000H
  265. ENABLE_VALID EQU 000000FFH
  266. ENABLE_ERROR EQU 0FFFFFFFFH
  267. VDD_OPEN_EXIST EQU 00000001H
  268. VDD_OPEN_ENUM EQU 00000002H
  269. VDD_OPEN_LOCK EQU 00000000H
  270. VDD_OPEN_TEST EQU VDD_OPEN_EXIST
  271. VDD_OPEN_KEY_WRITE EQU 00000001H
  272. VDD_OPEN_KEY_READ EQU 00000002H
  273. VDD_OPEN_KEY_USER EQU 00000010H
  274. VDD_OPEN_KEY_GLOBAL EQU 00000020H
  275. VDD_IOCTL_SET_NOTIFY EQU 10000001H
  276. VDD_IOCTL_GET_DDHAL EQU 10000002H
  277. VDD_IOCTL_COPY_PROTECTION EQU 10000003H
  278. VDD_IOCTL_I2C_OPEN EQU 10000004H
  279. VDD_IOCTL_I2C_ACCESS EQU 10000005H
  280. tagVDD_IOCTL_SET_NOTIFY_INPUT STRUC
  281. NotifyMask DD ?
  282. NotifyType DD ?
  283. NotifyProc DD ?
  284. NotifyData DD ?
  285. tagVDD_IOCTL_SET_NOTIFY_INPUT ENDS
  286. VDD_NOTIFY_START_MODE_CHANGE EQU 00000001H
  287. VDD_NOTIFY_END_MODE_CHANGE EQU 00000002H
  288. VDD_NOTIFY_ENABLE EQU 00000004H
  289. VDD_NOTIFY_DISABLE EQU 00000008H
  290. VDD_NOTIFY_TYPE_CALLBACK EQU 1
  291. BYTE_LENGTHED EQU 1
  292. WORD_LENGTHED EQU 2
  293. GOING_TO_WINDOWS_MODE EQU 1
  294. GOING_TO_VGA_MODE EQU 2
  295. DISPLAY_DRIVER_DISABLED EQU 4
  296. IN_WINDOWS_HIRES_MODE EQU 8
  297. BLOCK_INT10 EQU 16
  298. DISPLAYINFO STRUC
  299. diHdrSize DW ?
  300. diInfoFlags DW ?
  301. diDevNodeHandle DD ?
  302. diDriverName DB 16 DUP (?)
  303. diXRes DW ?
  304. diYRes DW ?
  305. diDPI DW ?
  306. diPlanes DB ?
  307. diBpp DB ?
  308. diRefreshRateMax DW ?
  309. diRefreshRateMin DW ?
  310. diLowHorz DW ?
  311. diHighHorz DW ?
  312. diLowVert DW ?
  313. diHighVert DW ?
  314. diMonitorDevNodeHandle DD ?
  315. diHorzSyncPolarity DB ?
  316. diVertSyncPolarity DB ?
  317. diUnitNumber DD ?
  318. diDisplayFlags DD ?
  319. diXDesktopPos DD ?
  320. diYDesktopPos DD ?
  321. diXDesktopSize DD ?
  322. diYDesktopSize DD ?
  323. DISPLAYINFO ENDS
  324. DISPLAYINFO_SIZE equ diRefreshRateMax+2-diHdrSize
  325. DISPLAYINFO_SIZE1 equ diBpp+1-diHdrSize
  326. DISPLAYINFO_SIZE2 equ diVertSyncPolarity+1-diHdrSize
  327. DISPLAYINFO_SIZE3 equ diMemorySize+4-diHdrSize
  328. RETURNED_DATA_IS_STALE EQU 0001H
  329. MINIVDD_FAILED_TO_LOAD EQU 0002H
  330. MINIVDD_CHIP_ID_DIDNT_MATCH EQU 0004H
  331. REGISTRY_BPP_NOT_VALID EQU 0008H
  332. REGISTRY_RESOLUTION_NOT_VALID EQU 0010H
  333. REGISTRY_DPI_NOT_VALID EQU 0020H
  334. MONITOR_DEVNODE_NOT_ACTIVE EQU 0040H
  335. MONITOR_INFO_NOT_VALID EQU 0080H
  336. MONITOR_INFO_DISABLED_BY_USER EQU 0100H
  337. REFRESH_RATE_MAX_ONLY EQU 0200H
  338. CARD_VDD_LOADED_OK EQU 0400H
  339. DEVICE_IS_NOT_VGA EQU 0800H
  340. NoTrace_VIRTUALIZE_CRTC_IN EQU 1
  341. NoTrace_VIRTUALIZE_CRTC_OUT EQU 1
  342. NoTrace_VIRTUALIZE_SEQUENCER_IN EQU 1
  343. NoTrace_VIRTUALIZE_SEQUENCER_OUT EQU 1
  344. NoTrace_VIRTUALIZE_GCR_IN EQU 1
  345. NoTrace_VIRTUALIZE_GCR_OUT EQU 1
  346. NoTrace_VIRTUALIZE_DAC_OUT EQU 1
  347. NoTrace_VIRTUALIZE_DAC_IN EQU 1
  348. NoTrace_CHECK_HIRES_MODE EQU 1
  349. ifdef NEC_98
  350. vFlg_Machine_Std equ 00000001b
  351. vFlg_Machine_Multi equ 00000010b
  352. vFlg_Machine_Mate equ 00000100b
  353. vFlg_Machine_H98 equ 00001000b
  354. vFlg_CRT_New equ 00010000b
  355. vFlg_CRT_NonInter equ 00100000b
  356. vFlg_GDC_5MHz equ 01000000b
  357. vFlg_GDC_Emulate equ 10000000b
  358. vFlg_Acc_Internal equ 0000000100000000b
  359. vFlg_Acc_External equ 0000001000000000b
  360. vFlg_Acc_PCI equ 0000010000000000b
  361. vFlg_Acc_ML equ 0000100000000000b
  362. vFlg_Acc_PVD equ 0001000000000000b
  363. vFlg_Mode_NH equ 0010000000000000b
  364. vFlg_Mode_H equ 0100000000000000b
  365. vFlg_Initialized equ 1000000000000000b
  366. vFlg_Opt_MFR equ 000000010000000000000000b
  367. vFlg_Opt_NewMFR equ 000000100000000000000000b
  368. vFlg_Opt_VDP equ 000001000000000000000000b
  369. vFlg_Opt_NewVDP equ 000010000000000000000000b
  370. vFlg_Local equ 000000000100000010000000b
  371. MaxMiniVDD equ 16
  372. MaxMiniTrap equ 32
  373. MaxMultiTrap equ 3
  374. MaxMultiFunc equ MaxMiniVDD
  375. LT_Enable equ 00000001b
  376. LT_Enable_bit equ 0
  377. LT_Initialized equ 10000000b
  378. LT_Initialized_bit equ 7
  379. Vids_struct struc
  380. Vids_SFlags dd ?
  381. Vids_CB_Offset dd ?
  382. Vids_Msg_Pseudo_VM dd ?
  383. VDD_TGDC_Draw_Off dd ?
  384. VDD_TGDC_Sync_Off dd ?
  385. VDD_TGDC_Sync_On dd ?
  386. VDD_TGDC_FIFO_Empty dd ?
  387. VDD_GGDC_Draw_Off dd ?
  388. VDD_GGDC_Sync_Off dd ?
  389. VDD_GGDC_Sync_On dd ?
  390. VDD_GGDC_FIFO_Empty dd ?
  391. VDD_GGDC_MOD_Emulate dd ?
  392. H98_FLORA_Change dd ?
  393. H98_Clear_Text dd ?
  394. H98_Rest_GCs dd ?
  395. H98_Rest_etc dd ?
  396. H98_Save_ModeFF dd ?
  397. Vids_struct ends
  398. Vid_SFlags equ <Vids.Vids_SFlags>
  399. VDD_CB_Offset equ <Vids.Vids_CB_Offset>
  400. VDD_Msg_Pseudo_VM equ <Vids.Vids_Msg_Pseudo_VM>
  401. TGDC_Draw_Off equ <Vids.VDD_TGDC_Draw_Off>
  402. GGDC_Draw_Off equ <Vids.VDD_GGDC_Draw_Off>
  403. TGDC_Sync_On equ <Vids.VDD_TGDC_Sync_On>
  404. TGDC_Sync_Off equ <Vids.VDD_TGDC_Sync_Off>
  405. TGDC_FIFO_Empty equ <Vids.VDD_TGDC_FIFO_Empty>
  406. GGDC_FIFO_Empty equ <Vids.VDD_GGDC_FIFO_Empty>
  407. MiniFuncStruct STRUC
  408. MF_ProcAddr dd ?
  409. MiniFuncStruct ENDS
  410. MiniVDD_Proc_Struct STRUC
  411. Proc_Address dd ?
  412. Proc_Order dw ?
  413. Proc_MiniID db ?
  414. Proc_Flags db ?
  415. MiniVDD_Proc_Struct ENDS
  416. .errnz (size MiniVDD_Proc_Struct) mod 4
  417. MiniVDD_GTrap_Struct STRUC
  418. GTrap_ProcAddr dd ?
  419. GTrap_PortAddr dw ?
  420. GTrap_NumMini dw ?
  421. GTrap_ProcTable db ((size MiniVDD_Proc_Struct) * MaxMultiTrap) dup (?)
  422. MiniVDD_GTrap_Struct ENDS
  423. MiniVDD_LTrap_Struct STRUC
  424. LTrap_ProcAddr dd ?
  425. LTrap_Status db ?
  426. LTrap_Flags db MaxMultiTrap dup (?)
  427. MiniVDD_LTrap_Struct ENDS
  428. EndMiniFunc_ MACRO n
  429. ifdef MiniFunc&n
  430. dd OFFSET32 MiniFunc&n
  431. else
  432. dd 0
  433. endif
  434. ENDM
  435. MiniFunc_ MACRO FuncID, FuncName
  436. MiniFunc&FuncID equ <FuncName>
  437. ENDM
  438. BeginMiniFunc MACRO TableName
  439. public TableName
  440. TableName label near
  441. ENDM
  442. if 1
  443. EndMiniFunc MACRO TableName
  444. x = 0
  445. REPT NBR_MINI_VDD_FUNCTIONS_41
  446. EndMiniFunc_ %x
  447. x = x + 1
  448. ENDM
  449. ENDM
  450. else
  451. EndMiniFunc MACRO TableName
  452. x = 0
  453. REPT NBR_MINI_VDD_FUNCTIONS
  454. EndMiniFunc_ %x
  455. x = x + 1
  456. ENDM
  457. ENDM
  458. endif
  459. MiniFunc MACRO FuncID, FuncName
  460. MiniFunc_ %(FuncID), <FuncName>
  461. ENDM
  462. MiniVDDCall MACRO FuncID, SetCarry
  463. local MiniCall_Loop
  464. local MiniCall_Exit
  465. push ecx
  466. push esi
  467. lea esi, [MiniVDD_Func_Table][(size MiniVDD_Proc_Struct) * MaxMultiFunc * FuncID]
  468. mov ecx, [MiniVDD_NumMini]
  469. MiniCall_Loop:
  470. cmp dword ptr [esi.Proc_Address], 0
  471. jz MiniCall_Exit
  472. pushad
  473. ifnb <SetCarry>
  474. stc
  475. endif
  476. call dword ptr [esi.Proc_Address]
  477. popad
  478. jc MiniCall_Exit
  479. add esi, size MiniVDD_Proc_Struct
  480. loop MiniCall_Loop
  481. MiniCall_Exit:
  482. pop esi
  483. pop ecx
  484. ENDM
  485. MiniVDDCall2 MACRO FuncID, SetCarry
  486. local MiniCall_Exit
  487. local MiniCall_Proc
  488. push ecx
  489. push esi
  490. lea esi, [MiniVDD_Func_Table][(size MiniVDD_Proc_Struct) * MaxMultiFunc * FuncID]
  491. MiniCall_Proc:
  492. cmp dword ptr [esi.Proc_Address], 0
  493. jz MiniCall_Exit
  494. pushad
  495. ifnb <SetCarry>
  496. stc
  497. endif
  498. call dword ptr [esi.Proc_Address]
  499. popad
  500. MiniCall_Exit:
  501. pop esi
  502. pop ecx
  503. ENDM
  504. MiniVDDCall3 MACRO FuncID, MiniID, SetCarry
  505. local MiniCall_Exit
  506. local MiniCall_Loop
  507. local MiniCall_Proc
  508. push ecx
  509. push esi
  510. lea esi, [MiniVDD_Func_Table][(size MiniVDD_Proc_Struct) * MaxMultiFunc * FuncID]
  511. movzx ecx, MiniID
  512. MiniCall_Loop:
  513. cmp ecx, 0
  514. jz MiniCall_Proc
  515. add esi, size MiniVDD_Proc_Struct
  516. dec ecx
  517. jmp MiniCall_Loop
  518. MiniCall_Proc:
  519. cmp dword ptr [esi.Proc_Address], 0
  520. jz MiniCall_Exit
  521. pushad
  522. ifnb <SetCarry>
  523. stc
  524. endif
  525. call dword ptr [esi.Proc_Address]
  526. popad
  527. MiniCall_Exit:
  528. pop esi
  529. pop ecx
  530. ENDM
  531. MiniVDDFunc MACRO TmpReg, FuncID
  532. mov TmpReg, [MiniVDD_Func_Table.Proc_Address][(size MiniVDD_Proc_Struct) * MaxMultiFunc * FuncID]
  533. ENDM
  534. ExecModeLL macro Num
  535. ExecMode_L&Num:
  536. endm
  537. ExecModeLE macro Num
  538. ExecMode_E&Num:
  539. endm
  540. ExecModeJE macro Num
  541. jmp ExecMode_E&Num
  542. endm
  543. ExecModeJZ macro Num
  544. jz ExecMode_L&Num
  545. endm
  546. ExecModeJNZ macro Num
  547. jnz ExecMode_L&Num
  548. endm
  549. ExecModeJEZ macro Num
  550. jz ExecMode_E&Num
  551. endm
  552. ExecModeJENZ macro Num
  553. jnz ExecMode_E&Num
  554. endm
  555. ExecModeTest macro ModeFlag, CB_Reg
  556. if ModeFlag and vFlg_Local
  557. ifidni <CB_Reg>, <Vid>
  558. push ebx
  559. mov ebx, [Vid_VM_Handle]
  560. add ebx, [VDD_CB_Offset]
  561. test [ebx.VDD_SFlags], ModeFlag
  562. pop ebx
  563. else
  564. ifidni <CB_Reg>, <Cur>
  565. push ebx
  566. VMMCall Get_Cur_VM_Handle
  567. add ebx, [VDD_CB_Offset]
  568. test [ebx.VDD_SFlags], ModeFlag
  569. pop ebx
  570. else
  571. ifb <CB_Reg>
  572. push ebx
  573. add ebx, [VDD_CB_Offset]
  574. test [ebx.VDD_SFlags], ModeFlag
  575. pop ebx
  576. else
  577. test [CB_Reg.VDD_SFlags], ModeFlag
  578. endif
  579. endif
  580. endif
  581. else
  582. test [Vid_SFlags], ModeFlag
  583. endif
  584. endm
  585. ExecModeChk macro HdrFlag, JmpFlag, JmpLabel, ModeFlag, CB_Reg
  586. ifidni <HdrFlag>, <Jmp>
  587. .erre FlgExecMode
  588. ExecModeJE %EndExecMode
  589. endif
  590. ExecModeLL %NumExecMode
  591. NumExecMode = NumExecMode + 1
  592. FlgExecMode = 1
  593. ifnb <ModeFlag>
  594. ExecModeTest <ModeFlag>, <CB_Reg>
  595. ifidni <JmpLabel>, <End>
  596. ifidni <JmpFlag>, <Not>
  597. ExecModeJENZ %EndExecMode
  598. else
  599. ExecModeJEZ %EndExecMode
  600. endif
  601. else
  602. ifidni <JmpFlag>, <Not>
  603. ExecModeJNZ %NumExecMode
  604. else
  605. ExecModeJZ %NumExecMode
  606. endif
  607. endif
  608. endif
  609. endm
  610. ExecModeEnd macro
  611. ExecModeLL %NumExecMode
  612. ExecModeLE %EndExecMode
  613. NumExecMode = NumExecMode + 1
  614. EndExecMode = EndExecMode + 1
  615. FlgExecMode = 0
  616. endm
  617. ExecModeJmp macro JmpLabel, ModeFlag, CB_Reg
  618. ExecModeTest %ModeFlag, <CB_Reg>
  619. jnz JmpLabel
  620. endm
  621. ExecModeJmpNot macro JmpLabel, ModeFlag, CB_Reg
  622. ExecModeTest %ModeFlag, <CB_Reg>
  623. jz JmpLabel
  624. endm
  625. ExecMode macro ModeFlag, CB_Reg
  626. ExecModeChk Top, Equ, Next, %ModeFlag, CB_Reg
  627. endm
  628. ExecModeNot macro ModeFlag, CB_Reg
  629. ExecModeChk Top, Not, Next, %ModeFlag, CB_Reg
  630. endm
  631. ExecModeOnly macro ModeFlag, CB_Reg
  632. ExecModeChk Top, Equ, End, %ModeFlag, CB_Reg
  633. endm
  634. ExecModeOnlyNot macro ModeFlag, CB_Reg
  635. ExecModeChk Top, Not, End, %ModeFlag, CB_Reg
  636. endm
  637. ExecModeElse macro ModeFlag, CB_Reg
  638. ExecModeChk Jmp, Equ, Next, %ModeFlag, CB_Reg
  639. endm
  640. ExecModeElseNot macro ModeFlag, CB_Reg
  641. ExecModeChk Jmp, Not, Next, %ModeFlag, CB_Reg
  642. endm
  643. ExecModeThru macro ModeFlag, CB_Reg
  644. ExecModeChk Thru, Equ, Next, %ModeFlag, CB_Reg
  645. endm
  646. ExecModeThruNot macro ModeFlag, CB_Reg
  647. ExecModeChk Thru, Not, Next, %ModeFlag, CB_Reg
  648. endm
  649. NumExecMode = 1
  650. EndExecMode = 1
  651. FlgExecMode = 0
  652. else
  653. ifdef MAINVDD
  654. externdef MiniVDDDispatchTable:dword
  655. endif
  656. MiniVDDDispatch macro FunctionCode, HandlerAddr
  657. mov [edi+(FunctionCode*4)],OFFSET32 MiniVDD_&HandlerAddr
  658. endm
  659. CardVDDDispatch macro FunctionCode, HandlerAddr
  660. mov [edi+(FunctionCode*4)],OFFSET32 CardVDD_&HandlerAddr
  661. endm
  662. MiniVDDCall macro FunctionCode, SaveFlags
  663. local MiniVDDCallExit, MiniVDDCallLeave
  664. ifdef MAXDEBUG
  665. ifndef NoTrace_&FunctionCode&
  666. Trace_Out "MiniVDDCall: &FunctionCode&"
  667. endif
  668. endif
  669. push edi
  670. ifnb <SaveFlags>
  671. pushfd
  672. endif
  673. mov edi,OFFSET32 MiniVDDDispatchTable
  674. cmp dword ptr [edi+(FunctionCode*4)],0
  675. je MiniVDDCallLeave
  676. ifnb <SaveFlags>
  677. popfd
  678. endif
  679. call dword ptr [edi+(FunctionCode*4)]
  680. ifnb <SaveFlags>
  681. jmp MiniVDDCallExit
  682. endif
  683. MiniVDDCallLeave:
  684. ifnb <SaveFlags>
  685. popfd
  686. endif
  687. MiniVDDCallExit:
  688. pop edi
  689. endm
  690. endif
  691. endif