port from perforce

This commit is contained in:
2026-04-18 22:31:51 +02:00
commit 8d0ab5b7cc
8409 changed files with 3972376 additions and 0 deletions

View File

@@ -0,0 +1,121 @@
; cuda.inc - las/mercury
; nvcuda
extern _cuInit@4
extern _cuDeviceGet@8
extern _cuDeviceGetCount@4
extern _cuDeviceGetName@12
%define _cuDeviceTotalMem@8 _cuDeviceTotalMem_v2@8
extern _cuDeviceTotalMem@8
extern _cuDeviceComputeCapability@12
%define _cuCtxCreate@12 _cuCtxCreate_v2@12
extern _cuCtxCreate@12
extern _cuModuleGetFunction@12
%define _cuModuleGetGlobal@16 _cuModuleGetGlobal_v2@16
extern _cuModuleGetGlobal@16
extern _cuModuleGetSurfRef@12
extern _cuModuleGetTexRef@12
extern _cuModuleLoad@8
extern _cuModuleLoadData@8
extern _cuModuleLoadDataEx@20
extern _cuModuleUnload@4
%define _cuMemAlloc@8 _cuMemAlloc_v2@8
extern _cuMemAlloc@8
%define _cuMemcpyHtoD@12 _cuMemcpyHtoD_v2@12
extern _cuMemcpyHtoD@12
%define _cuMemcpyDtoH@12 _cuMemcpyDtoH_v2@12
extern _cuMemcpyDtoH@12
%define _cuMemFree@4 _cuMemFree_v2@4
extern _cuMemFree@4
extern _cuLaunchKernel@44
extern _cuSurfRefGetArray@8
extern _cuSurfRefSetArray@12
extern _cuGraphicsGLRegisterBuffer@12
extern _cuGraphicsGLRegisterImage@16
extern _cuGraphicsMapResources@12
extern _cuGraphicsResourceGetMappedMipmappedArray@8
%define _cuGraphicsResourceGetMappedPointer@12 _cuGraphicsResourceGetMappedPointer_v2@12
extern _cuGraphicsResourceGetMappedPointer@12
extern _cuGraphicsResourceSetMapFlags@8
extern _cuGraphicsSubResourceGetMappedArray@16
extern _cuGraphicsUnmapResources@12
extern _cuGraphicsUnregisterResource@4
%define CUDA_SUCCESS 0
%define CUDA_ERROR_INVALID_VALUE 1
%define CUDA_ERROR_OUT_OF_MEMORY 2
%define CUDA_ERROR_NOT_INITIALIZED 3
%define CUDA_ERROR_DEINITIALIZED 4
%define CUDA_ERROR_PROFILER_DISABLED 5
%define CUDA_ERROR_PROFILER_NOT_INITIALIZED 6
%define CUDA_ERROR_PROFILER_ALREADY_STARTED 7
%define CUDA_ERROR_PROFILER_ALREADY_STOPPED 8
%define CUDA_ERROR_NO_DEVICE 100
%define CUDA_ERROR_INVALID_DEVICE 101
%define CUDA_ERROR_INVALID_IMAGE 200
%define CUDA_ERROR_INVALID_CONTEXT 201
%define CUDA_ERROR_CONTEXT_ALREADY_CURRENT 202
%define CUDA_ERROR_MAP_FAILED 205
%define CUDA_ERROR_UNMAP_FAILED 206
%define CUDA_ERROR_ARRAY_IS_MAPPED 207
%define CUDA_ERROR_ALREADY_MAPPED 208
%define CUDA_ERROR_NO_BINARY_FOR_GPU 209
%define CUDA_ERROR_ALREADY_ACQUIRED 210
%define CUDA_ERROR_NOT_MAPPED 211
%define CUDA_ERROR_NOT_MAPPED_AS_ARRAY 212
%define CUDA_ERROR_NOT_MAPPED_AS_POINTER 213
%define CUDA_ERROR_ECC_UNCORRECTABLE 214
%define CUDA_ERROR_UNSUPPORTED_LIMIT 215
%define CUDA_ERROR_CONTEXT_ALREADY_IN_USE 216
%define CUDA_ERROR_PEER_ACCESS_UNSUPPORTED 217
%define CUDA_ERROR_INVALID_SOURCE 300
%define CUDA_ERROR_FILE_NOT_FOUND 301
%define CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND 302
%define CUDA_ERROR_SHARED_OBJECT_INIT_FAILED 303
%define CUDA_ERROR_OPERATING_SYSTEM 304
%define CUDA_ERROR_INVALID_HANDLE 400
%define CUDA_ERROR_NOT_FOUND 500
%define CUDA_ERROR_NOT_READY 600
%define CUDA_ERROR_LAUNCH_FAILED 700
%define CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES 701
%define CUDA_ERROR_LAUNCH_TIMEOUT 702
%define CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING 703
%define CUDA_ERROR_PEER_ACCESS_ALREADY_ENABLED 704
%define CUDA_ERROR_PEER_ACCESS_NOT_ENABLED 705
%define CUDA_ERROR_PRIMARY_CONTEXT_ACTIVE 708
%define CUDA_ERROR_CONTEXT_IS_DESTROYED 709
%define CUDA_ERROR_ASSERT 710
%define CUDA_ERROR_TOO_MANY_PEERS 711
%define CUDA_ERROR_HOST_MEMORY_ALREADY_REGISTERED 712
%define CUDA_ERROR_HOST_MEMORY_NOT_REGISTERED 713
%define CUDA_ERROR_NOT_PERMITTED 800
%define CUDA_ERROR_NOT_SUPPORTED 801
%define CUDA_ERROR_UNKNOWN 999
%define CU_GRAPHICS_REGISTER_FLAGS_NONE 0x00
%define CU_GRAPHICS_REGISTER_FLAGS_READ_ONLY 0x01
%define CU_GRAPHICS_REGISTER_FLAGS_WRITE_DISCARD 0x02
%define CU_GRAPHICS_REGISTER_FLAGS_SURFACE_LDST 0x04
%define CU_GRAPHICS_REGISTER_FLAGS_TEXTURE_GATHER 0x08
%define CU_GRAPHICS_MAP_RESOURCE_FLAGS_NONE 0x00
%define CU_GRAPHICS_MAP_RESOURCE_FLAGS_READ_ONLY 0x01
%define CU_GRAPHICS_MAP_RESOURCE_FLAGS_WRITE_DISCARD 0x02
%define CU_CUBEMAP_FACE_POSITIVE_X 0x00
%define CU_CUBEMAP_FACE_NEGATIVE_X 0x01
%define CU_CUBEMAP_FACE_POSITIVE_Y 0x02
%define CU_CUBEMAP_FACE_NEGATIVE_Y 0x03
%define CU_CUBEMAP_FACE_POSITIVE_Z 0x04
%define CU_CUBEMAP_FACE_NEGATIVE_Z 0x05

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
; d3dx11.inc - las/mercury

View File

@@ -0,0 +1,457 @@
; dxgi.inc by las/mercury
struc DXGI_SWAP_CHAIN_DESC
; DXGI_MODE_DESC BufferDesc
.Width: resd 1
.Height: resd 1
; DXGI_RATIONAL RefreshRate
.Numerator: resd 1
.Denominator: resd 1
.Format: resd 1
.ScanlineOrdering: resd 1
.Scaling: resd 1
; DXGI_SAMPLE_DESC SampleDesc
.Count: resd 1
.Quality: resd 1
.BufferUsage: resd 1
.BufferCount: resd 1
.OutputWindow: resd 1
.Windowed: resd 1
.SwapEffect: resd 1
.Flags: resd 1
endstruc
; DXGI_RESIDENCY
%define DXGI_RESIDENCY_FULLY_RESIDENT 1
%define DXGI_RESIDENCY_RESIDENT_IN_SHARED_MEMORY 2
%define DXGI_RESIDENCY_EVICTED_TO_DISK 3
; DXGI_SWAP_EFFECT
%define DXGI_SWAP_EFFECT_DISCARD 0
%define DXGI_SWAP_EFFECT_SEQUENTIAL 1
%define DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL 3
; DXGI_SWAP_CHAIN_FLAG
%define DXGI_SWAP_CHAIN_FLAG_NONPREROTATED 1
%define DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH 2
%define DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE 4
%define DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTENT 8
%define DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER 16
%define DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY 32
%define DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT 64
%define DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER 128
%define DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO 256
; DXGI_ADAPTER_FLAG
%define DXGI_ADAPTER_FLAG_NONE 0
%define DXGI_ADAPTER_FLAG_REMOTE 1
%define DXGI_ADAPTER_FLAG_SOFTWARE 2
%define DXGI_ADAPTER_FLAG_FORCE_DWORD 0xffffffff
; DXGI_FORMAT
%define DXGI_FORMAT_UNKNOWN 0
%define DXGI_FORMAT_R32G32B32A32_TYPELESS 1
%define DXGI_FORMAT_R32G32B32A32_FLOAT 2
%define DXGI_FORMAT_R32G32B32A32_UINT 3
%define DXGI_FORMAT_R32G32B32A32_SINT 4
%define DXGI_FORMAT_R32G32B32_TYPELESS 5
%define DXGI_FORMAT_R32G32B32_FLOAT 6
%define DXGI_FORMAT_R32G32B32_UINT 7
%define DXGI_FORMAT_R32G32B32_SINT 8
%define DXGI_FORMAT_R16G16B16A16_TYPELESS 9
%define DXGI_FORMAT_R16G16B16A16_FLOAT 10
%define DXGI_FORMAT_R16G16B16A16_UNORM 11
%define DXGI_FORMAT_R16G16B16A16_UINT 12
%define DXGI_FORMAT_R16G16B16A16_SNORM 13
%define DXGI_FORMAT_R16G16B16A16_SINT 14
%define DXGI_FORMAT_R32G32_TYPELESS 15
%define DXGI_FORMAT_R32G32_FLOAT 16
%define DXGI_FORMAT_R32G32_UINT 17
%define DXGI_FORMAT_R32G32_SINT 18
%define DXGI_FORMAT_R32G8X24_TYPELESS 19
%define DXGI_FORMAT_D32_FLOAT_S8X24_UINT 20
%define DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS 21
%define DXGI_FORMAT_X32_TYPELESS_G8X24_UINT 22
%define DXGI_FORMAT_R10G10B10A2_TYPELESS 23
%define DXGI_FORMAT_R10G10B10A2_UNORM 24
%define DXGI_FORMAT_R10G10B10A2_UINT 25
%define DXGI_FORMAT_R11G11B10_FLOAT 26
%define DXGI_FORMAT_R8G8B8A8_TYPELESS 27
%define DXGI_FORMAT_R8G8B8A8_UNORM 28
%define DXGI_FORMAT_R8G8B8A8_UNORM_SRGB 29
%define DXGI_FORMAT_R8G8B8A8_UINT 30
%define DXGI_FORMAT_R8G8B8A8_SNORM 31
%define DXGI_FORMAT_R8G8B8A8_SINT 32
%define DXGI_FORMAT_R16G16_TYPELESS 33
%define DXGI_FORMAT_R16G16_FLOAT 34
%define DXGI_FORMAT_R16G16_UNORM 35
%define DXGI_FORMAT_R16G16_UINT 36
%define DXGI_FORMAT_R16G16_SNORM 37
%define DXGI_FORMAT_R16G16_SINT 38
%define DXGI_FORMAT_R32_TYPELESS 39
%define DXGI_FORMAT_D32_FLOAT 40
%define DXGI_FORMAT_R32_FLOAT 41
%define DXGI_FORMAT_R32_UINT 42
%define DXGI_FORMAT_R32_SINT 43
%define DXGI_FORMAT_R24G8_TYPELESS 44
%define DXGI_FORMAT_D24_UNORM_S8_UINT 45
%define DXGI_FORMAT_R24_UNORM_X8_TYPELESS 46
%define DXGI_FORMAT_X24_TYPELESS_G8_UINT 47
%define DXGI_FORMAT_R8G8_TYPELESS 48
%define DXGI_FORMAT_R8G8_UNORM 49
%define DXGI_FORMAT_R8G8_UINT 50
%define DXGI_FORMAT_R8G8_SNORM 51
%define DXGI_FORMAT_R8G8_SINT 52
%define DXGI_FORMAT_R16_TYPELESS 53
%define DXGI_FORMAT_R16_FLOAT 54
%define DXGI_FORMAT_D16_UNORM 55
%define DXGI_FORMAT_R16_UNORM 56
%define DXGI_FORMAT_R16_UINT 57
%define DXGI_FORMAT_R16_SNORM 58
%define DXGI_FORMAT_R16_SINT 59
%define DXGI_FORMAT_R8_TYPELESS 60
%define DXGI_FORMAT_R8_UNORM 61
%define DXGI_FORMAT_R8_UINT 62
%define DXGI_FORMAT_R8_SNORM 63
%define DXGI_FORMAT_R8_SINT 64
%define DXGI_FORMAT_A8_UNORM 65
%define DXGI_FORMAT_R1_UNORM 66
%define DXGI_FORMAT_R9G9B9E5_SHAREDEXP 67
%define DXGI_FORMAT_R8G8_B8G8_UNORM 68
%define DXGI_FORMAT_G8R8_G8B8_UNORM 69
%define DXGI_FORMAT_BC1_TYPELESS 70
%define DXGI_FORMAT_BC1_UNORM 71
%define DXGI_FORMAT_BC1_UNORM_SRGB 72
%define DXGI_FORMAT_BC2_TYPELESS 73
%define DXGI_FORMAT_BC2_UNORM 74
%define DXGI_FORMAT_BC2_UNORM_SRGB 75
%define DXGI_FORMAT_BC3_TYPELESS 76
%define DXGI_FORMAT_BC3_UNORM 77
%define DXGI_FORMAT_BC3_UNORM_SRGB 78
%define DXGI_FORMAT_BC4_TYPELESS 79
%define DXGI_FORMAT_BC4_UNORM 80
%define DXGI_FORMAT_BC4_SNORM 81
%define DXGI_FORMAT_BC5_TYPELESS 82
%define DXGI_FORMAT_BC5_UNORM 83
%define DXGI_FORMAT_BC5_SNORM 84
%define DXGI_FORMAT_B5G6R5_UNORM 85
%define DXGI_FORMAT_B5G5R5A1_UNORM 86
%define DXGI_FORMAT_B8G8R8A8_UNORM 87
%define DXGI_FORMAT_B8G8R8X8_UNORM 88
%define DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM 89
%define DXGI_FORMAT_B8G8R8A8_TYPELESS 90
%define DXGI_FORMAT_B8G8R8A8_UNORM_SRGB 91
%define DXGI_FORMAT_B8G8R8X8_TYPELESS 92
%define DXGI_FORMAT_B8G8R8X8_UNORM_SRGB 93
%define DXGI_FORMAT_BC6H_TYPELESS 94
%define DXGI_FORMAT_BC6H_UF16 95
%define DXGI_FORMAT_BC6H_SF16 96
%define DXGI_FORMAT_BC7_TYPELESS 97
%define DXGI_FORMAT_BC7_UNORM 98
%define DXGI_FORMAT_BC7_UNORM_SRGB 99
%define DXGI_FORMAT_AYUV 100
%define DXGI_FORMAT_Y410 101
%define DXGI_FORMAT_Y416 102
%define DXGI_FORMAT_NV12 103
%define DXGI_FORMAT_P010 104
%define DXGI_FORMAT_P016 105
%define DXGI_FORMAT_420_OPAQUE 106
%define DXGI_FORMAT_YUY2 107
%define DXGI_FORMAT_Y210 108
%define DXGI_FORMAT_Y216 109
%define DXGI_FORMAT_NV11 110
%define DXGI_FORMAT_AI44 111
%define DXGI_FORMAT_IA44 112
%define DXGI_FORMAT_P8 113
%define DXGI_FORMAT_A8P8 114
%define DXGI_FORMAT_B4G4R4A4_UNORM 115
%define DXGI_FORMAT_FORCE_UINT 0xffffffff
; DXGI_MODE_SCANLINE_ORDER
%define DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED 0
%define DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE 1
%define DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST 2
%define DXGI_MODE_SCANLINE_ORDER_LOWER_FIELD_FIRST 3
; DXGI_MODE_SCALING
%define DXGI_MODE_SCALING_UNSPECIFIED 0
%define DXGI_MODE_SCALING_CENTERED 1
%define DXGI_MODE_SCALING_STRETCHED 2
; DXGI_MODE_ROTATION
%define DXGI_MODE_ROTATION_UNSPECIFIED 0
%define DXGI_MODE_ROTATION_IDENTITY 1
%define DXGI_MODE_ROTATION_ROTATE90 2
%define DXGI_MODE_ROTATION_ROTATE180 3
%define DXGI_MODE_ROTATION_ROTATE270 4
%define DXGI_CPU_ACCESS_NONE (0)
%define DXGI_CPU_ACCESS_DYNAMIC (1)
%define DXGI_CPU_ACCESS_READ_WRITE (2)
%define DXGI_CPU_ACCESS_SCRATCH (3)
%define DXGI_CPU_ACCESS_FIELD 15
%define DXGI_USAGE_SHADER_INPUT (1<<(0 + 4))
%define DXGI_USAGE_RENDER_TARGET_OUTPUT (1<<(1 + 4))
%define DXGI_USAGE_BACK_BUFFER (1<<(2 + 4))
%define DXGI_USAGE_SHARED (1<<(3 + 4))
%define DXGI_USAGE_READ_ONLY (1<<(4 + 4))
%define DXGI_USAGE_DISCARD_ON_PRESENT (1<<(5 + 4))
%define DXGI_USAGE_UNORDERED_ACCESS (1<<(6 + 4))
%define DXGI_RESOURCE_PRIORITY_MINIMUM (0x28000000)
%define DXGI_RESOURCE_PRIORITY_LOW (0x50000000)
%define DXGI_RESOURCE_PRIORITY_NORMAL (0x78000000)
%define DXGI_RESOURCE_PRIORITY_HIGH (0xa0000000)
%define DXGI_RESOURCE_PRIORITY_MAXIMUM (0xc8000000)
%define DXGI_MAP_READ (1)
%define DXGI_MAP_WRITE (2)
%define DXGI_MAP_DISCARD (4)
%define DXGI_ENUM_MODES_INTERLACED (1)
%define DXGI_ENUM_MODES_SCALING (2)
%define DXGI_MAX_SWAP_CHAIN_BUFFERS (16)
%define DXGI_PRESENT_TEST 0x00000001
%define DXGI_PRESENT_DO_NOT_SEQUENCE 0x00000002
%define DXGI_PRESENT_RESTART 0x00000004
%define DXGI_PRESENT_DO_NOT_WAIT 0x00000008
%define DXGI_PRESENT_STEREO_PREFER_RIGHT 0x00000010
%define DXGI_PRESENT_STEREO_TEMPORARY_MONO 0x00000020
%define DXGI_PRESENT_RESTRICT_TO_OUTPUT 0x00000040
%define DXGI_PRESENT_USE_DURATION 0x00000100
%define DXGI_MWA_NO_WINDOW_CHANGES (1<<0)
%define DXGI_MWA_NO_ALT_ENTER (1<<1)
%define DXGI_MWA_NO_PRINT_SCREEN (1<<2)
%define DXGI_MWA_VALID (0x7)
%define DXGI_FORMAT_DEFINED 1
%define _FACDXGI 0x87a
%define MAKE_DXGI_HRESULT(code) MAKE_HRESULT(1, _FACDXGI, code)
%define MAKE_DXGI_STATUS(code) MAKE_HRESULT(0, _FACDXGI, code)
%define DXGI_CPU_ACCESS_NONE (0)
%define DXGI_CPU_ACCESS_DYNAMIC (1)
%define DXGI_CPU_ACCESS_READ_WRITE (2)
%define DXGI_CPU_ACCESS_SCRATCH (3)
%define DXGI_CPU_ACCESS_FIELD 15
%define DXGI_USAGE_SHADER_INPUT (1<<(0 + 4))
%define DXGI_USAGE_RENDER_TARGET_OUTPUT (1<<(1 + 4))
%define DXGI_USAGE_BACK_BUFFER (1<<(2 + 4))
%define DXGI_USAGE_SHARED (1<<(3 + 4))
%define DXGI_USAGE_READ_ONLY (1<<(4 + 4))
%define DXGI_USAGE_DISCARD_ON_PRESENT (1<<(5 + 4))
%define DXGI_USAGE_UNORDERED_ACCESS (1<<(6 + 4))
struc IDXGIObject
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
endstruc
struc IDXGIDeviceSubObject
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
.GetDevice: resb 4
endstruc
struc IDXGIResource
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
.GetDevice: resb 4
.GetSharedHandle: resb 4
.GetUsage: resb 4
.SetEvictionPriority: resb 4
.GetEvictionPriority: resb 4
endstruc
struc IDXGIKeyedMutex
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
.GetDevice: resb 4
.AcquireSync: resb 4
.ReleaseSync: resb 4
endstruc
struc IDXGISurface
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
.GetDevice: resb 4
.GetDesc: resb 4
.Map: resb 4
.Unmap: resb 4
endstruc
struc IDXGISurface1
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
.GetDevice: resb 4
.GetDesc: resb 4
.Map: resb 4
.Unmap: resb 4
.GetDC: resb 4
.ReleaseDC: resb 4
endstruc
struc IDXGIAdapter
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
.EnumOutputs: resb 4
.GetDesc: resb 4
.CheckInterfaceSupport: resb 4
endstruc
struc IDXGIOutput
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
.GetDesc: resb 4
.GetDisplayModeList: resb 4
.FindClosestMatchingMode: resb 4
.WaitForVBlank: resb 4
.TakeOwnership: resb 4
.ReleaseOwnership: resb 4
.GetGammaControlCapabilities: resb 4
.SetGammaControl: resb 4
.GetGammaControl: resb 4
.SetDisplaySurface: resb 4
.GetDisplaySurfaceData: resb 4
.GetFrameStatistics: resb 4
endstruc
struc IDXGISwapChain
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
.GetDevice: resb 4
.Present: resb 4
.GetBuffer: resb 4
.SetFullscreenState: resb 4
.GetFullscreenState: resb 4
.GetDesc: resb 4
.ResizeBuffers: resb 4
.ResizeTarget: resb 4
.GetContainingOutput: resb 4
.GetFrameStatistics: resb 4
.GetLastPresentCount: resb 4
endstruc
struc IDXGIFactory
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
.EnumAdapters: resb 4
.MakeWindowAssociation: resb 4
.GetWindowAssociation: resb 4
.CreateSwapChain: resb 4
.CreateSoftwareAdapter: resb 4
endstruc
struc IDXGIDevice
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
.GetAdapter: resb 4
.CreateSurface: resb 4
.QueryResourceResidency: resb 4
.SetGPUThreadPriority: resb 4
.GetGPUThreadPriority: resb 4
endstruc
struc IDXGIFactory1
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
.EnumAdapters: resb 4
.MakeWindowAssociation: resb 4
.GetWindowAssociation: resb 4
.CreateSwapChain: resb 4
.CreateSoftwareAdapter: resb 4
.EnumAdapters1: resb 4
.IsCurrent: resb 4
endstruc
struc IDXGIAdapter1
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
.EnumOutputs: resb 4
.GetDesc: resb 4
.CheckInterfaceSupport: resb 4
.GetDesc1: resb 4
endstruc
struc IDXGIDevice1
.QueryInterface: resb 4
.AddRef: resb 4
.Release: resb 4
.SetPrivateData: resb 4
.SetPrivateDataInterface: resb 4
.GetPrivateData: resb 4
.GetParent: resb 4
.GetAdapter: resb 4
.CreateSurface: resb 4
.QueryResourceResidency: resb 4
.SetGPUThreadPriority: resb 4
.GetGPUThreadPriority: resb 4
.SetMaximumFrameLatency: resb 4
.GetMaximumFrameLatency: resb 4
endstruc

View File

@@ -0,0 +1,366 @@
; font.inc - las/mercury
; numbers 0-9
_0:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11011011b)
db REVERSEBITS(11011011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_1:
db REVERSEBITS(01111000b)
db REVERSEBITS(01111000b)
db REVERSEBITS(00011000b)
db REVERSEBITS(00011000b)
db REVERSEBITS(00011000b)
db REVERSEBITS(00011000b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_2:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(00000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_3:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(00000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(00000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_4:
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(00000011b)
db REVERSEBITS(00000011b)
db REVERSEBITS(00000011b)
_5:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(00000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_6:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_7:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(00000011b)
db REVERSEBITS(00000011b)
db REVERSEBITS(00000011b)
db REVERSEBITS(00000011b)
db REVERSEBITS(00000011b)
db REVERSEBITS(00000011b)
_8:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_9:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(00000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
; : ; < = > ? @
dq 0, 0, 0, 0, 0, 0, 0
; letters A-Z
_A:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
_B:
db REVERSEBITS(11111110b)
db REVERSEBITS(11111110b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_C:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_D:
db REVERSEBITS(11111100b)
db REVERSEBITS(11111100b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_E:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11111100b)
db REVERSEBITS(11111100b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_F:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11111100b)
db REVERSEBITS(11111100b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11000000b)
_G:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11001111b)
db REVERSEBITS(11001111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_H:
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
_I:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(00011000b)
db REVERSEBITS(00011000b)
db REVERSEBITS(00011000b)
db REVERSEBITS(00011000b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_J:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(00000011b)
db REVERSEBITS(00000011b)
db REVERSEBITS(00000011b)
db REVERSEBITS(00000011b)
db REVERSEBITS(11111100b)
db REVERSEBITS(11111100b)
_K:
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111100b)
db REVERSEBITS(11111100b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
_L:
db REVERSEBITS(11000000b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_M:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11011011b)
db REVERSEBITS(11011011b)
db REVERSEBITS(11011011b)
db REVERSEBITS(11011011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
_N:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
_O:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_P:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11000000b)
_Q:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11011011b)
db REVERSEBITS(11011011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_R:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111100b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
_S:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(00000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_T:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(00011000b)
db REVERSEBITS(00011000b)
db REVERSEBITS(00011000b)
db REVERSEBITS(00011000b)
db REVERSEBITS(00011000b)
db REVERSEBITS(00011000b)
_U:
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_V:
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(00111100b)
db REVERSEBITS(00111100b)
_W:
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11011011b)
db REVERSEBITS(11011011b)
db REVERSEBITS(11011011b)
db REVERSEBITS(11011011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
_X:
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(00111100b)
db REVERSEBITS(00111100b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
_Y:
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(00011000b)
db REVERSEBITS(00011000b)
db REVERSEBITS(00011000b)
_Z:
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(00000011b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11000000b)
db REVERSEBITS(11111111b)
db REVERSEBITS(11111111b)

View File

@@ -0,0 +1,200 @@
; macros.inc - las/mercury
%macro TEXT_SECTION 1
section %1 text align=1
%endmacro
%macro DATA_SECTION 1
section %1 data align=1
%endmacro
%macro BSS_SECTION 1
section %1 bss align=1
%endmacro
%define REVERSEBITS(b) (\
(b & 128) >> 7 |\
(b & 64) >> 5 |\
(b & 32) >> 3 |\
(b & 16) >> 1 |\
(b & 8) << 1 |\
(b & 4) << 3 |\
(b & 2) << 5 |\
(b & 1) << 7)
%macro com 2
push dword [%1]
push dword [%1]
pop eax
mov eax, [eax]
call [eax + %2]
%endmacro
%macro com 1
pop eax
mov eax, [eax]
call [eax + %2]
%endmacro
%ifdef IBH
%macro glext 1
call dword [%1]
%endmacro
%endif
%ifndef IBH
%macro glext 1
push dword %1
call _wglGetProcAddress@4
call eax
%endmacro
%endif
%macro DBG 1
%ifdef DEBUG
%define msg %1
%strlen msgLength msg
pushad
xor eax, eax
push eax
push eax
push dword STD_ERROR_HANDLE
call _GetStdHandle@4
push dword msgLength+2
call %%endOfMsg
db msg, 13, 10
%%endOfMsg:
push eax
call _WriteFile@20
popad
%undef msg
%undef msgLength
%endif
%endmacro
%macro DBG_BOX 2
%ifdef DEBUG
%define caption %2
%define text %1
pushad
xor eax, eax
push eax
call %%endCaption
db caption, 0
%%endCaption:
call %%endText
db text, 0
%%endText:
push eax
call _MessageBoxA@16
popad
%undef msg
%endif
%endmacro
%macro DBG_NO_NL 1
%ifdef DEBUG
%define msg %1
%strlen msgLength msg
pushad
xor eax, eax
push eax
push eax
push dword STD_ERROR_HANDLE
call _GetStdHandle@4
push dword msgLength
call %%endOfMsg
db msg
%%endOfMsg:
push eax
call _WriteFile@20
popad
%undef msg
%undef msgLength
%endif
%endmacro
%macro DBG_STR 0
pop eax
pushad
xchg eax, edx
mov edi, edx
xor eax, eax
xor ecx, ecx
not ecx
cld
repne scasb
not ecx
dec ecx
push eax
push eax
push ecx
push edx
push dword STD_ERROR_HANDLE
call _GetStdHandle@4
push eax
call _WriteFile@20
popad
%endmacro
%macro DBG_CHAR 0
mov eax, esp
pushad
mov ebx, eax
xor ecx, ecx
push ecx
push ecx
push dword STD_ERROR_HANDLE
call _GetStdHandle@4
push byte 1
push ebx
push eax
call _WriteFile@20
popad
pop eax
%endmacro
%macro DBG_NUM 0
pop eax
pushad
xor ebx, ebx
%%pushDigitLoop:
inc ebx
xor edx, edx
mov ecx, dword 10
div ecx
add edx, byte '0'
push edx
test eax, eax
jnz %%pushDigitLoop
mov ecx, ebx
%%printDigitLoop:
DBG_CHAR
loop %%printDigitLoop
popad
%endmacro
%macro DBG_EXIT_EAX_0 1
%ifdef DEBUG
test eax, eax
jnz short %%isNotZero
DBG %1
push byte 0
call _ExitProcess@4
%%isNotZero:
%endif
%endmacro
%macro DBG_EXIT_EAX_NOT_0 1
%ifdef DEBUG
test eax, eax
jz short %%isZero
DBG %1
push byte 0
call _ExitProcess@4
%%isZero:
%endif
%endmacro

View File

@@ -0,0 +1,95 @@
; opengl.inc - las/mercury
; opengl32
extern _wglCreateContext@4
extern _wglGetProcAddress@4
extern _wglMakeCurrent@8
extern _glClearColor@16
extern _glClear@4
extern _glColor4ubv@4
extern _glColor4f@16
extern _glRecti@16
extern _glRectf@16
extern _glGetString@4
extern _glTexParameteri@12
extern _glTexImage2D@36
extern _glBindTexture@8
extern _glGenTextures@8
extern _glGetIntegerv@8
extern _glViewport@16
%define GL_COMPUTE_SHADER 0x91b9
%define GL_FRAGMENT_SHADER 0x8b30
%define GL_VERSION 0x1F02
%define GL_DEPTH_BUFFER_BIT 0x00000100
%define GL_COLOR_BUFFER_BIT 0x00004000
%define GL_FRAMEBUFFER 0x8D40
%define GL_FRAMEBUFFER_COMPLETE 0x8CD5
%define GL_SHADER_STORAGE_BUFFER 0x90D2
%define GL_UNIFORM_BUFFER 0x8A11
%define GL_SHADER_STORAGE_BARRIER_BIT 0x00002000
%define GL_STREAM_DRAW 0x88E0
%define GL_STREAM_READ 0x88E1
%define GL_STREAM_COPY 0x88E2
%define GL_STATIC_DRAW 0x88E4
%define GL_STATIC_READ 0x88E5
%define GL_STATIC_COPY 0x88E6
%define GL_DYNAMIC_DRAW 0x88E8
%define GL_DYNAMIC_READ 0x88E9
%define GL_DYNAMIC_COPY 0x88EA
%define GL_TEXTURE0 0x84C0
%define GL_TEXTURE1 (GL_TEXTURE0+1)
%define GL_TEXTURE2 (GL_TEXTURE0+2)
%define GL_TEXTURE3 (GL_TEXTURE0+3)
%define GL_TEXTURE4 (GL_TEXTURE0+4)
%define GL_TEXTURE5 (GL_TEXTURE0+5)
%define GL_TEXTURE6 (GL_TEXTURE0+6)
%define GL_TEXTURE7 (GL_TEXTURE0+7)
%define GL_TEXTURE8 (GL_TEXTURE0+8)
%define GL_TEXTURE9 (GL_TEXTURE0+9)
%define GL_TEXTURE_2D 0x0DE1
%define GL_NEAREST 0x2600
%define GL_LINEAR 0x2601
%define GL_LINEAR_MIPMAP_LINEAR 0x2703
%define GL_TEXTURE_MAG_FILTER 0x2800
%define GL_TEXTURE_MIN_FILTER 0x2801
%define GL_CLAMP_TO_EDGE 0x812F
%define GL_CLAMP 0x2900
%define GL_REPEAT 0x2901
%define GL_TEXTURE_WRAP_R 0x8072
%define GL_TEXTURE_WRAP_S 0x2802
%define GL_TEXTURE_WRAP_T 0x2803
%define GL_BYTE 0x1400
%define GL_UNSIGNED_BYTE 0x1401
%define GL_SHORT 0x1402
%define GL_UNSIGNED_SHORT 0x1403
%define GL_INT 0x1404
%define GL_UNSIGNED_INT 0x1405
%define GL_FLOAT 0x1406
%define GL_HALF_FLOAT 0x140B
%define GL_RGBA 0x1908
%define GL_RGBA32F 0x8814
%define GL_RGB32F 0x8815
%define GL_RGBA16F 0x881A
%define GL_RGB16F 0x881B
%define GL_VIEWPORT 0x0BA2
%define GL_COLOR_ATTACHMENT0 0x8CE0

View File

@@ -0,0 +1,336 @@
; windows.inc - las/mercury
; ntdll
extern _LdrShutdownProcess@0
; kernel32
extern _GetTickCount@0
extern _ExitProcess@4
extern _Sleep@4
extern _OpenFile@12
extern __lread@12
extern _K32EnumProcessModules@16
extern _GetCurrentProcess@0
extern _OutputDebugStringA@4
extern _GetStdHandle@4
extern _WriteFile@20
extern _CreateThread@24
; user32
extern _ChangeDisplaySettingsA@8
extern _CreateWindowExA@48
extern _GetAsyncKeyState@4
extern _GetDC@4
extern _ShowCursor@4
extern _SetCursor@4
extern _SetCursorPos@8
extern _PeekMessageA@20
extern _PeekMessageW@20
extern _TranslateMessage@4
extern _DispatchMessageA@4
extern _MessageBoxA@16
; gdi32
extern _ChoosePixelFormat@8
extern _SetPixelFormat@12
extern _SwapBuffers@4
; winmm
extern _waveOutOpen@24
extern _waveOutPrepareHeader@12
extern _waveOutWrite@12
extern _waveOutGetPosition@12
%define ATOM_DIALOG 0x8002
%define ATOM_BUTTON 0xC017
%define ATOM_EDIT 0xC018
%define ATOM_STATIC 0xC019
%define ATOM_LISTBOX 0xC01A
%define ATOM_SCROLLBAR 0xC01B
%define ATOM_COMBOBOX 0xC01C
struc WAVEFORMATEX
.wFormatTag resw 1
.nChannels resw 1
.nSamplesPerSec resd 1
.nAvgBytesPerSec resd 1
.nBlockAlign resw 1
.wBitsPerSample resw 1
.cbSize resw 1
endstruc
struc WAVEHDR
.lpData resd 1
.dwBufferLength resd 1
.dwBytesRecorded resd 1
.dwUser resd 1
.dwFlags resd 1
.dwLoops resd 1
.lpNext resd 1
.reserved resd 1
endstruc
struc MMTIME
.wType resd 1
.data resd 1
.padding resd 1
endstruc
%define TIME_MS 1
%define TIME_SAMPLES 2
%define TIME_BYTES 4
%define TIME_SMPTE 8
%define TIME_MIDI 16
%define TIME_TICKS 32
%define WAVE_MAPPER -1
%define WAVE_FORMAT_PCM 1
%define WAVE_FORMAT_IEEE_FLOAT 3
%define WHDR_DONE 0x00000001
%define WHDR_PREPARED 0x00000002
%define WHDR_BEGINLOOP 0x00000004
%define WHDR_ENDLOOP 0x00000008
%define WHDR_INQUEUE 0x00000010
%define WAVERR_BASE (0x20)
%define WAVERR_BADFORMAT (WAVERR_BASE+0)
%define WAVERR_STILLPLAYING (WAVERR_BASE+1)
%define WAVERR_UNPREPARED (WAVERR_BASE+2)
%define WAVERR_SYNC (WAVERR_BASE+3)
%define WAVERR_LASTERROR (WAVERR_BASE+3)
struc CONTEXT
.ContextFlags resd 1
._dr0 resd 1
._dr1 resd 1
._dr2 resd 1
._dr3 resd 1
._dr6 resd 1
._dr7 resd 1
.FloatSave resb 32+80
._gs resd 1
._fs resd 1
._es resd 1
._ds resd 1
._edi resd 1
._esi resd 1
._ebx resd 1
._edx resd 1
._ecx resd 1
._eax resd 1
._ebp resd 1
._eip resd 1
._cs resd 1
._eflags resd 1
._esp resd 1
._ss resd 1
.ExtendedRegisters resb 512
endstruc
struc EXCEPTION_POINTERS
.pExceptionRecord resd 1
.pContextRecord resd 1
endstruc
struc MSG
.hwnd: resd 1
.msg: resd 1
.wParam: resd 1
.lParam: resd 1
.time: resd 1
.pt: resd 2
endstruc
%define OF_READ 0x00000000
%define DM_BITSPERPEL 0x00040000
%define DM_PELSWIDTH 0x00080000
%define DM_PELSHEIGHT 0x00100000
%define CDS_FULLSCREEN 0x00000004
%define PFD_SUPPORT_OPENGL 0x00000020
%define PFD_DOUBLEBUFFER 0x00000001
%define PFD_DRAW_TO_WINDOW 0x00000004
%define PFD_MAIN_PLANE 0x00000000
%define PFD_TYPE_RGBA 0x00000000
%define WM_QUIT 0x0012
%define WM_KEYDOWN 0x0100
%define WM_CHAR 0x0102
%define PM_NOREMOVE 0x0000
%define PM_REMOVE 0x0001
%define PM_NOYIELD 0x0002
%define VK_ESCAPE 0x1b
%define VK_R 0x52
%define STD_OUTPUT_HANDLE -11
%define STD_ERROR_HANDLE -12
%define WS_OVERLAPPED 0x00000000
%define WS_POPUP 0x80000000
%define WS_CHILD 0x40000000
%define WS_MINIMIZE 0x20000000
%define WS_VISIBLE 0x10000000
%define WS_DISABLED 0x08000000
%define WS_CLIPSIBLINGS 0x04000000
%define WS_CLIPCHILDREN 0x02000000
%define WS_MAXIMIZE 0x01000000
%define WS_CAPTION 0x00C00000
%define WS_BORDER 0x00800000
%define WS_DLGFRAME 0x00400000
%define WS_VSCROLL 0x00200000
%define WS_HSCROLL 0x00100000
%define WS_SYSMENU 0x00080000
%define WS_THICKFRAME 0x00040000
%define WS_GROUP 0x00020000
%define WS_TABSTOP 0x00010000
%define WS_MINIMIZEBOX 0x00020000
%define WS_MAXIMIZEBOX 0x00010000
%define WS_TILED WS_OVERLAPPED
%define WS_ICONIC WS_MINIMIZE
%define WS_SIZEBOX WS_THICKFRAME
%define WS_TILEDWINDOW WS_OVERLAPPEDWINDOW
%define WS_EX_DLGMODALFRAME 0x00000001
%define WS_EX_NOPARENTNOTIFY 0x00000004
%define WS_EX_TOPMOST 0x00000008
%define WS_EX_ACCEPTFILES 0x00000010
%define WS_EX_TRANSPARENT 0x00000020
%define WS_EX_MDICHILD 0x00000040
%define WS_EX_TOOLWINDOW 0x00000080
%define WS_EX_WINDOWEDGE 0x00000100
%define WS_EX_CLIENTEDGE 0x00000200
%define WS_EX_CONTEXTHELP 0x00000400
%define OUT_DEFAULT_PRECIS 0
%define OUT_STRING_PRECIS 1
%define OUT_CHARACTER_PRECIS 2
%define OUT_STROKE_PRECIS 3
%define OUT_TT_PRECIS 4
%define OUT_DEVICE_PRECIS 5
%define OUT_RASTER_PRECIS 6
%define OUT_TT_ONLY_PRECIS 7
%define OUT_OUTLINE_PRECIS 8
%define OUT_SCREEN_OUTLINE_PRECIS 9
%define OUT_PS_ONLY_PRECIS 10
%define MB_OK 0x00000000
%define MB_OKCANCEL 0x00000001
%define MB_ABORTRETRYIGNORE 0x00000002
%define MB_YESNOCANCEL 0x00000003
%define MB_YESNO 0x00000004
%define MB_RETRYCANCEL 0x00000005
%define MB_CANCELTRYCONTINUE 0x00000006
%define MB_ICONHAND 0x00000010
%define MB_ICONQUESTION 0x00000020
%define MB_ICONEXCLAMATION 0x00000030
%define MB_ICONASTERISK 0x00000040
%define MB_USERICON 0x00000080
%define MB_ICONWARNING MB_ICONEXCLAMATION
%define MB_ICONERROR MB_ICONHAND
%define MB_ICONINFORMATION MB_ICONASTERISK
%define MB_ICONSTOP MB_ICONHAND
%define DT_TOP 0x00000000
%define DT_LEFT 0x00000000
%define DT_CENTER 0x00000001
%define DT_RIGHT 0x00000002
%define DT_VCENTER 0x00000004
%define DT_BOTTOM 0x00000008
%define DT_WORDBREAK 0x00000010
%define DT_SINGLELINE 0x00000020
%define DT_EXPANDTABS 0x00000040
%define DT_TABSTOP 0x00000080
%define DT_NOCLIP 0x00000100
%define DT_EXTERNALLEADING 0x00000200
%define DT_CALCRECT 0x00000400
%define DT_NOPREFIX 0x00000800
%define DT_INTERNAL 0x00001000
%define DT_EDITCONTROL 0x00002000
%define DT_PATH_ELLIPSIS 0x00004000
%define DT_END_ELLIPSIS 0x00008000
%define DT_MODIFYSTRING 0x00010000
%define DT_RTLREADING 0x00020000
%define DT_WORD_ELLIPSIS 0x00040000
%define DT_NOFULLWIDTHCHARBREAK 0x00080000
%define DT_HIDEPREFIX 0x00100000
%define DT_PREFIXONLY 0x00200000
%define OPEN_EXISTING 3
%define FILE_SHARE_READ 1
%define FW_DONTCARE 0
%define FW_THIN 100
%define FW_EXTRALIGHT 200
%define FW_LIGHT 300
%define FW_NORMAL 400
%define FW_MEDIUM 500
%define FW_SEMIBOLD 600
%define FW_BOLD 700
%define FW_EXTRABOLD 800
%define FW_HEAVY 900
%define CLIP_DEFAULT_PRECIS 0
%define CLIP_CHARACTER_PRECIS 1
%define CLIP_STROKE_PRECIS 2
%define CLIP_MASK 15
%define CLIP_LH_ANGLES (1 << 4)
%define CLIP_TT_ALWAYS (2 << 4)
%define CLIP_EMBEDDED (8 << 4)
%define DEFAULT_QUALITY 0
%define DRAFT_QUALITY 1
%define PROOF_QUALITY 2
%define NONANTIALIASED_QUALITY 3
%define ANTIALIASED_QUALITY 4
%define DEFAULT_PITCH 0
%define FIXED_PITCH 1
%define VARIABLE_PITCH 2
%define MONO_FONT 8;
%define ANSI_CHARSET 0
%define DEFAULT_CHARSET 1
%define SYMBOL_CHARSET 2
%define SHIFTJIS_CHARSET 0x80
%define HANGEUL_CHARSET 129
%define GB2312_CHARSET 134
%define CHINESEBIG5_CHARSET 136
%define OEM_CHARSET 255
%define JOHAB_CHARSET 130
%define HEBREW_CHARSET 177
%define ARABIC_CHARSET 178
%define GREEK_CHARSET 161
%define TURKISH_CHARSET 162
%define VIETNAMESE_CHARSET 163
%define THAI_CHARSET 222
%define EASTEUROPE_CHARSET 238
%define RUSSIAN_CHARSET 204
%define MAC_CHARSET 77
%define BALTIC_CHARSET 186
%define FS_LATIN1 1
%define FS_LATIN2 2
%define FS_CYRILLIC 4
%define FS_GREEK 8
%define FS_TURKISH 0x10
%define FS_HEBREW 0x20
%define FS_ARABIC 0x40
%define FS_BALTIC 0x80
%define FS_VIETNAMESE 0x00000100
%define FS_THAI 0x10000
%define FS_JISJAPAN 0x20000
%define FS_CHINESESIMP 0x40000
%define FS_WANSUNG 0x80000
%define FS_CHINESETRAD 0x100000
%define FS_JOHAB 0x200000
%define FS_SYMBOL 0x80000000
%define FF_DONTCARE (0 << 4)
%define FF_ROMAN (1 << 4)
%define FF_SWISS (2 << 4)
%define FF_MODERN (3 << 4)
%define FF_SCRIPT (4 << 4)
%define FF_DECORATIVE (5 << 4)