add flat assembler toolchain
This commit is contained in:
326
toolchain/fasmw17332/EXAMPLES/DDRAW/DDRAW.ASM
Normal file
326
toolchain/fasmw17332/EXAMPLES/DDRAW/DDRAW.ASM
Normal file
@ -0,0 +1,326 @@
|
||||
|
||||
; DirectDraw programming example
|
||||
|
||||
format PE GUI 4.0
|
||||
entry start
|
||||
|
||||
include 'win32a.inc'
|
||||
|
||||
include 'ddraw.inc'
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
|
||||
and [DDraw],0
|
||||
and [DDSPrimary],0
|
||||
and [DDSBack],0
|
||||
and [DDPalette],0
|
||||
and [DDSPicture],0
|
||||
|
||||
invoke GetModuleHandleA,NULL
|
||||
mov [hinstance],eax
|
||||
|
||||
invoke LoadIconA,NULL,IDI_APPLICATION
|
||||
mov [wc.hIcon],eax
|
||||
|
||||
invoke LoadCursorA,NULL,IDC_ARROW
|
||||
mov [wc.hCursor],eax
|
||||
|
||||
mov [wc.style],0
|
||||
mov [wc.lpfnWndProc],WindowProc
|
||||
mov [wc.cbClsExtra],0
|
||||
mov [wc.cbWndExtra],0
|
||||
mov eax,[hinstance]
|
||||
mov [wc.hInstance],eax
|
||||
mov [wc.hbrBackground],0
|
||||
mov dword [wc.lpszMenuName],NULL
|
||||
mov dword [wc.lpszClassName],_class
|
||||
invoke RegisterClassA,wc
|
||||
test eax,eax
|
||||
jz startup_error
|
||||
|
||||
invoke CreateWindowExA,\
|
||||
0,_class,_title,WS_POPUP+WS_VISIBLE,0,0,0,0,NULL,NULL,[hinstance],NULL
|
||||
test eax,eax
|
||||
jz startup_error
|
||||
mov [hwnd],eax
|
||||
|
||||
invoke DirectDrawCreate,NULL,DDraw,NULL
|
||||
or eax,eax
|
||||
jnz ddraw_error
|
||||
|
||||
cominvk DDraw,SetCooperativeLevel,\
|
||||
[hwnd],DDSCL_EXCLUSIVE+DDSCL_FULLSCREEN
|
||||
or eax,eax
|
||||
jnz ddraw_error
|
||||
|
||||
cominvk DDraw,SetDisplayMode,\
|
||||
640,480,8
|
||||
or eax,eax
|
||||
jnz ddraw_error
|
||||
|
||||
mov [ddsd.dwSize],sizeof.DDSURFACEDESC
|
||||
mov [ddsd.dwFlags],DDSD_CAPS+DDSD_BACKBUFFERCOUNT
|
||||
mov [ddsd.ddsCaps.dwCaps],DDSCAPS_PRIMARYSURFACE+DDSCAPS_FLIP+DDSCAPS_COMPLEX
|
||||
mov [ddsd.dwBackBufferCount],1
|
||||
cominvk DDraw,CreateSurface,\
|
||||
ddsd,DDSPrimary,NULL
|
||||
or eax,eax
|
||||
jnz ddraw_error
|
||||
|
||||
mov [ddscaps.dwCaps],DDSCAPS_BACKBUFFER
|
||||
cominvk DDSPrimary,GetAttachedSurface,\
|
||||
ddscaps,DDSBack
|
||||
or eax,eax
|
||||
jnz ddraw_error
|
||||
|
||||
mov esi,picture
|
||||
call load_picture
|
||||
jc open_error
|
||||
|
||||
mov esi,picture
|
||||
call load_palette
|
||||
jc open_error
|
||||
|
||||
invoke GetTickCount
|
||||
mov [last_tick],eax
|
||||
|
||||
jmp paint
|
||||
|
||||
main_loop:
|
||||
|
||||
invoke PeekMessageA,msg,NULL,0,0,PM_NOREMOVE
|
||||
or eax,eax
|
||||
jz no_message
|
||||
invoke GetMessageA,msg,NULL,0,0
|
||||
or eax,eax
|
||||
jz end_loop
|
||||
invoke TranslateMessage,msg
|
||||
invoke DispatchMessageA,msg
|
||||
|
||||
jmp main_loop
|
||||
|
||||
no_message:
|
||||
cmp [active],0
|
||||
je sleep
|
||||
|
||||
cominvk DDSPrimary,IsLost
|
||||
or eax,eax
|
||||
jz paint
|
||||
cmp eax,DDERR_SURFACELOST
|
||||
jne end_loop
|
||||
|
||||
cominvk DDSPrimary,Restore
|
||||
|
||||
paint:
|
||||
|
||||
mov [rect.top],0
|
||||
mov [rect.bottom],480
|
||||
mov [rect.left],0
|
||||
mov [rect.right],640
|
||||
|
||||
cominvk DDSBack,BltFast,\
|
||||
0,0,[DDSPicture],rect,DDBLTFAST_SRCCOLORKEY
|
||||
or eax,eax
|
||||
jnz paint_done
|
||||
|
||||
movzx eax,[frame]
|
||||
xor edx,edx
|
||||
mov ebx,10
|
||||
div ebx
|
||||
|
||||
sal eax,6
|
||||
add eax,480
|
||||
mov [rect.top],eax
|
||||
add eax,64
|
||||
mov [rect.bottom],eax
|
||||
sal edx,6
|
||||
mov [rect.left],edx
|
||||
add edx,64
|
||||
mov [rect.right],edx
|
||||
|
||||
cominvk DDSBack,BltFast,\
|
||||
[x],[y],[DDSPicture],rect,DDBLTFAST_SRCCOLORKEY
|
||||
|
||||
cominvk DDSPrimary,SetPalette,[DDPalette]
|
||||
|
||||
cominvk DDSPrimary,Flip,0,0
|
||||
|
||||
paint_done:
|
||||
|
||||
invoke GetTickCount
|
||||
mov ebx,eax
|
||||
sub ebx,[last_tick]
|
||||
cmp ebx,20
|
||||
jb main_loop
|
||||
add [last_tick],20
|
||||
|
||||
inc [frame]
|
||||
cmp [frame],60
|
||||
jb main_loop
|
||||
mov [frame],0
|
||||
jmp main_loop
|
||||
|
||||
sleep:
|
||||
invoke WaitMessage
|
||||
jmp main_loop
|
||||
|
||||
ddraw_error:
|
||||
mov eax,_ddraw_error
|
||||
jmp error
|
||||
open_error:
|
||||
mov eax,_open_error
|
||||
error:
|
||||
invoke MessageBoxA,[hwnd],eax,_error,MB_OK+MB_ICONERROR
|
||||
invoke DestroyWindow,[hwnd]
|
||||
invoke PostQuitMessage,1
|
||||
jmp main_loop
|
||||
startup_error:
|
||||
invoke MessageBoxA,[hwnd],_startup_error,_error,MB_OK+MB_ICONERROR
|
||||
end_loop:
|
||||
|
||||
cmp [DDSPicture],0
|
||||
je picture_released
|
||||
cominvk DDSPicture,Release
|
||||
picture_released:
|
||||
cmp [DDPalette],0
|
||||
je palette_released
|
||||
cominvk DDPalette,Release
|
||||
palette_released:
|
||||
cmp [DDSBack],0
|
||||
je back_surface_released
|
||||
cominvk DDSPrimary,DeleteAttachedSurface,0,DDSBack
|
||||
back_surface_released:
|
||||
cmp [DDSPrimary],0
|
||||
je primary_surface_released
|
||||
cominvk DDSPrimary,Release
|
||||
primary_surface_released:
|
||||
cmp [DDraw],0
|
||||
je ddraw_released
|
||||
cominvk DDraw,Release
|
||||
ddraw_released:
|
||||
|
||||
invoke ExitProcess,[msg.wParam]
|
||||
|
||||
include 'gif87a.inc'
|
||||
|
||||
proc WindowProc hwnd,wmsg,wparam,lparam
|
||||
push ebx esi edi
|
||||
mov eax,[wmsg]
|
||||
cmp eax,WM_CREATE
|
||||
je .wmcreate
|
||||
cmp eax,WM_DESTROY
|
||||
je .wmdestroy
|
||||
cmp eax,WM_ACTIVATE
|
||||
je .wmactivate
|
||||
cmp eax,WM_SETCURSOR
|
||||
je .wmsetcursor
|
||||
cmp eax,WM_MOUSEMOVE
|
||||
je .wmmousemove
|
||||
cmp eax,WM_KEYDOWN
|
||||
je .wmkeydown
|
||||
.defwindowproc:
|
||||
invoke DefWindowProcA,[hwnd],[wmsg],[wparam],[lparam]
|
||||
jmp .finish
|
||||
.wmcreate:
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wmkeydown:
|
||||
cmp [wparam],VK_ESCAPE
|
||||
jne .finish
|
||||
.wmdestroy:
|
||||
cominvk DDraw,RestoreDisplayMode
|
||||
invoke PostQuitMessage,0
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wmactivate:
|
||||
mov eax,[wparam]
|
||||
mov [active],al
|
||||
jmp .finish
|
||||
.wmsetcursor:
|
||||
invoke SetCursor,0
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wmmousemove:
|
||||
movsx eax,word [lparam]
|
||||
mov [x],eax
|
||||
movsx eax,word [lparam+2]
|
||||
mov [y],eax
|
||||
.finish:
|
||||
pop edi esi ebx
|
||||
ret
|
||||
endp
|
||||
|
||||
section '.data' data readable writeable
|
||||
|
||||
_title db 'flat assembler DirectDraw application',0
|
||||
_class db 'FDDRAW32',0
|
||||
|
||||
_error db 'Error',0
|
||||
_startup_error db 'Startup failed.',0
|
||||
_ddraw_error db 'Direct Draw initialization failed.',0
|
||||
_open_error db 'Failed opening data file.',0
|
||||
|
||||
picture db 'DDRAW.GIF',0
|
||||
|
||||
section '.bss' readable writeable
|
||||
|
||||
hinstance dd ?
|
||||
hwnd dd ?
|
||||
wc WNDCLASS
|
||||
msg MSG
|
||||
|
||||
ddsd DDSURFACEDESC
|
||||
ddscaps DDSCAPS
|
||||
|
||||
DDraw DirectDraw
|
||||
DDSPrimary DirectDrawSurface
|
||||
DDSBack DirectDrawSurface
|
||||
|
||||
DDSPicture DirectDrawSurface
|
||||
DDPalette DirectDrawPalette
|
||||
|
||||
bytes_count dd ?
|
||||
last_tick dd ?
|
||||
frame db ?
|
||||
active db ?
|
||||
LZW_bits db ?
|
||||
LZW_table rd (0F00h-2)*2
|
||||
buffer rb 40000h
|
||||
rect RECT
|
||||
x dd ?
|
||||
y dd ?
|
||||
|
||||
section '.idata' import data readable
|
||||
|
||||
library kernel,'KERNEL32.DLL',\
|
||||
user,'USER32.DLL',\
|
||||
ddraw,'DDRAW.DLL'
|
||||
|
||||
import kernel,\
|
||||
GetModuleHandleA,'GetModuleHandleA',\
|
||||
CreateFileA,'CreateFileA',\
|
||||
ReadFile,'ReadFile',\
|
||||
CloseHandle,'CloseHandle',\
|
||||
GetTickCount,'GetTickCount',\
|
||||
ExitProcess,'ExitProcess'
|
||||
|
||||
import user,\
|
||||
RegisterClassA,'RegisterClassA',\
|
||||
CreateWindowExA,'CreateWindowExA',\
|
||||
DestroyWindow,'DestroyWindow',\
|
||||
DefWindowProcA,'DefWindowProcA',\
|
||||
GetMessageA,'GetMessageA',\
|
||||
PeekMessageA,'PeekMessageA',\
|
||||
TranslateMessage,'TranslateMessage',\
|
||||
DispatchMessageA,'DispatchMessageA',\
|
||||
LoadCursorA,'LoadCursorA',\
|
||||
LoadIconA,'LoadIconA',\
|
||||
SetCursor,'SetCursor',\
|
||||
MessageBoxA,'MessageBoxA',\
|
||||
PostQuitMessage,'PostQuitMessage',\
|
||||
WaitMessage,'WaitMessage'
|
||||
|
||||
import ddraw,\
|
||||
DirectDrawCreate,'DirectDrawCreate'
|
BIN
toolchain/fasmw17332/EXAMPLES/DDRAW/DDRAW.GIF
Normal file
BIN
toolchain/fasmw17332/EXAMPLES/DDRAW/DDRAW.GIF
Normal file
Binary file not shown.
After Width: | Height: | Size: 57 KiB |
424
toolchain/fasmw17332/EXAMPLES/DDRAW/DDRAW.INC
Normal file
424
toolchain/fasmw17332/EXAMPLES/DDRAW/DDRAW.INC
Normal file
@ -0,0 +1,424 @@
|
||||
|
||||
; DirectDraw interface
|
||||
|
||||
interface DirectDraw,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
Compact,\
|
||||
CreateClipper,\
|
||||
CreatePalette,\
|
||||
CreateSurface,\
|
||||
DuplicateSurface,\
|
||||
EnumDisplayModes,\
|
||||
EnumSurfaces,\
|
||||
FlipToGDISurface,\
|
||||
GetCaps,\
|
||||
GetDisplayMode,\
|
||||
GetFourCCCodes,\
|
||||
GetGDISurface,\
|
||||
GetMonitorFrequency,\
|
||||
GetScanLine,\
|
||||
GetVerticalBlankStatus,\
|
||||
Initialize,\
|
||||
RestoreDisplayMode,\
|
||||
SetCooperativeLevel,\
|
||||
SetDisplayMode,\
|
||||
WaitForVerticalBlank,\
|
||||
GetAvailableVidMem,\
|
||||
GetSurfaceFromDC,\
|
||||
RestoreAllSurfaces,\
|
||||
TestCooperativeLevel,\
|
||||
GetDeviceIdentifier,\
|
||||
StartModeTest,\
|
||||
EvaluateMode
|
||||
|
||||
interface DirectDrawSurface,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
AddAttachedSurface,\
|
||||
AddOverlayDirtyRect,\
|
||||
Blt,\
|
||||
BltBatch,\
|
||||
BltFast,\
|
||||
DeleteAttachedSurface,\
|
||||
EnumAttachedSurfaces,\
|
||||
EnumOverlayZOrders,\
|
||||
Flip,\
|
||||
GetAttachedSurface,\
|
||||
GetBltStatus,\
|
||||
GetCaps,\
|
||||
GetClipper,\
|
||||
GetColorKey,\
|
||||
GetDC,\
|
||||
GetFlipStatus,\
|
||||
GetOverlayPosition,\
|
||||
GetPalette,\
|
||||
GetPixelFormat,\
|
||||
GetSurfaceDesc,\
|
||||
Initialize,\
|
||||
IsLost,\
|
||||
Lock,\
|
||||
ReleaseDC,\
|
||||
Restore,\
|
||||
SetClipper,\
|
||||
SetColorKey,\
|
||||
SetOverlayPosition,\
|
||||
SetPalette,\
|
||||
Unlock,\
|
||||
UpdateOverlay,\
|
||||
UpdateOverlayDisplay,\
|
||||
UpdateOverlayZOrder,\
|
||||
GetDDInterface,\
|
||||
PageLock,\
|
||||
PageUnlock,\
|
||||
SetSurfaceDesc,\
|
||||
SetPrivateData,\
|
||||
GetPrivateData,\
|
||||
FreePrivateData,\
|
||||
GetUniquenessValue,\
|
||||
ChangeUniquenessValue,\
|
||||
SetPriority,\
|
||||
GetPriority,\
|
||||
SetLOD,\
|
||||
GetLOD
|
||||
|
||||
interface DirectDrawPalette,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
GetCaps,\
|
||||
GetEntries,\
|
||||
Initialize,\
|
||||
SetEntries
|
||||
|
||||
interface DirectDrawClipper,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
GetClipList,\
|
||||
GetHWnd,\
|
||||
Initialize,\
|
||||
IsClipListChanged,\
|
||||
SetClipList,\
|
||||
SetHWnd
|
||||
|
||||
interface DirectDrawColorControl,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
GetColorControls,\
|
||||
SetColorControls
|
||||
|
||||
interface DirectDrawGammaControl,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
GetGammaRamp,\
|
||||
SetGammaRamp
|
||||
|
||||
struct DDCOLORKEY
|
||||
dwColorSpaceLowValue dd ?
|
||||
dwColorSpaceHighValue dd ?
|
||||
ends
|
||||
|
||||
struct DDPIXELFORMAT
|
||||
dwSize dd ?
|
||||
dwFlags dd ?
|
||||
dwFourCC dd ?
|
||||
union
|
||||
dwRGBBitCount dd ?
|
||||
dwYUVBitCount dd ?
|
||||
dwZBufferBitDepth dd ?
|
||||
dwAlphaBitDepth dd ?
|
||||
dwLuminanceBitCount dd ?
|
||||
dwBumpBitCount dd ?
|
||||
ends
|
||||
union
|
||||
dwRBitMask dd ?
|
||||
dwYBitMask dd ?
|
||||
dwStencilBitDepth dd ?
|
||||
dwLuminanceBitMask dd ?
|
||||
dwBumpDuBitMask dd ?
|
||||
ends
|
||||
union
|
||||
dwGBitMask dd ?
|
||||
dwUBitMask dd ?
|
||||
dwZBitMask dd ?
|
||||
dwBumpDvBitMask dd ?
|
||||
ends
|
||||
union
|
||||
dwBBitMask dd ?
|
||||
dwVBitMask dd ?
|
||||
dwStencilBitMask dd ?
|
||||
dwBumpLuminanceBitMask dd ?
|
||||
ends
|
||||
union
|
||||
dwRGBAlphaBitMask dd ?
|
||||
dwYUVAlphaBitMask dd ?
|
||||
dwLuminanceAlphaBitMask dd ?
|
||||
dwRGBZBitMask dd ?
|
||||
dwYUVZBitMask dd ?
|
||||
ends
|
||||
ends
|
||||
|
||||
struct DDSCAPS
|
||||
dwCaps dd ?
|
||||
ends
|
||||
|
||||
struct DDSURFACEDESC
|
||||
dwSize dd ?
|
||||
dwFlags dd ?
|
||||
dwHeight dd ?
|
||||
dwWidth dd ?
|
||||
union
|
||||
lPitch dd ?
|
||||
dwLinearSize dd ?
|
||||
ends
|
||||
dwBackBufferCount dd ?
|
||||
union
|
||||
dwMipMapCount dd ?
|
||||
dwZBufferBitDepth dd ?
|
||||
dwRefreshRate dd ?
|
||||
ends
|
||||
dwAlphaBitDepth dd ?
|
||||
dwReserved dd ?
|
||||
lpSurface dd ?
|
||||
ddckCKDestOverlay DDCOLORKEY
|
||||
ddckCKDestBlt DDCOLORKEY
|
||||
ddckCKSrcOverlay DDCOLORKEY
|
||||
ddckCKSrcBlt DDCOLORKEY
|
||||
ddpfPixelFormat DDPIXELFORMAT
|
||||
ddsCaps DDSCAPS
|
||||
ends
|
||||
|
||||
; SetCooperativeLevel flags
|
||||
|
||||
DDSCL_FULLSCREEN = 000000001h
|
||||
DDSCL_ALLOWREBOOT = 000000002h
|
||||
DDSCL_NOWINDOWCHANGES = 000000004h
|
||||
DDSCL_NORMAL = 000000008h
|
||||
DDSCL_EXCLUSIVE = 000000010h
|
||||
DDSCL_ALLOWMODEX = 000000040h
|
||||
|
||||
; Blt flags
|
||||
|
||||
DDBLT_ALPHADEST = 000000001h
|
||||
DDBLT_ALPHADESTCONSTOVERRIDE = 000000002h
|
||||
DDBLT_ALPHADESTNEG = 000000004h
|
||||
DDBLT_ALPHADESTSURFACEOVERRIDE = 000000008h
|
||||
DDBLT_ALPHAEDGEBLEND = 000000010h
|
||||
DDBLT_ALPHASRC = 000000020h
|
||||
DDBLT_ALPHASRCCONSTOVERRIDE = 000000040h
|
||||
DDBLT_ALPHASRCNEG = 000000080h
|
||||
DDBLT_ALPHASRCSURFACEOVERRIDE = 000000100h
|
||||
DDBLT_ASYNC = 000000200h
|
||||
DDBLT_COLORFILL = 000000400h
|
||||
DDBLT_DDFX = 000000800h
|
||||
DDBLT_DDROPS = 000001000h
|
||||
DDBLT_KEYDEST = 000002000h
|
||||
DDBLT_KEYDESTOVERRIDE = 000004000h
|
||||
DDBLT_KEYSRC = 000008000h
|
||||
DDBLT_KEYSRCOVERRIDE = 000010000h
|
||||
DDBLT_ROP = 000020000h
|
||||
DDBLT_ROTATIONANGLE = 000040000h
|
||||
DDBLT_ZBUFFER = 000080000h
|
||||
DDBLT_ZBUFFERDESTCONSTOVERRIDE = 000100000h
|
||||
DDBLT_ZBUFFERDESTOVERRIDE = 000200000h
|
||||
DDBLT_ZBUFFERSRCCONSTOVERRIDE = 000400000h
|
||||
DDBLT_ZBUFFERSRCOVERRIDE = 000800000h
|
||||
DDBLT_WAIT = 001000000h
|
||||
DDBLT_DEPTHFILL = 002000000h
|
||||
|
||||
; BltFast flags
|
||||
|
||||
DDBLTFAST_NOCOLORKEY = 000000000h
|
||||
DDBLTFAST_SRCCOLORKEY = 000000001h
|
||||
DDBLTFAST_DESTCOLORKEY = 000000002h
|
||||
DDBLTFAST_WAIT = 000000010h
|
||||
|
||||
; Flip flags
|
||||
|
||||
DDFLIP_WAIT = 000000001h
|
||||
DDFLIP_EVEN = 000000002h
|
||||
DDFLIP_ODD = 000000004h
|
||||
|
||||
; DDSURFACEDESC field flags
|
||||
|
||||
DDSD_CAPS = 000000001h
|
||||
DDSD_HEIGHT = 000000002h
|
||||
DDSD_WIDTH = 000000004h
|
||||
DDSD_PITCH = 000000008h
|
||||
DDSD_BACKBUFFERCOUNT = 000000020h
|
||||
DDSD_ZBUFFERBITDEPTH = 000000040h
|
||||
DDSD_ALPHABITDEPTH = 000000080h
|
||||
DDSD_LPSURFACE = 000000800h
|
||||
DDSD_PIXELFORMAT = 000001000h
|
||||
DDSD_CKDESTOVERLAY = 000002000h
|
||||
DDSD_CKDESTBLT = 000004000h
|
||||
DDSD_CKSRCOVERLAY = 000008000h
|
||||
DDSD_CKSRCBLT = 000010000h
|
||||
DDSD_MIPMAPCOUNT = 000020000h
|
||||
DDSD_REFRESHRATE = 000040000h
|
||||
DDSD_LINEARSIZE = 000080000h
|
||||
DDSD_ALL = 0000FF9EEh
|
||||
|
||||
; DirectDrawSurface capability flags
|
||||
|
||||
DDSCAPS_RESERVED1 = 000000001h
|
||||
DDSCAPS_ALPHA = 000000002h
|
||||
DDSCAPS_BACKBUFFER = 000000004h
|
||||
DDSCAPS_COMPLEX = 000000008h
|
||||
DDSCAPS_FLIP = 000000010h
|
||||
DDSCAPS_FRONTBUFFER = 000000020h
|
||||
DDSCAPS_OFFSCREENPLAIN = 000000040h
|
||||
DDSCAPS_OVERLAY = 000000080h
|
||||
DDSCAPS_PALETTE = 000000100h
|
||||
DDSCAPS_PRIMARYSURFACE = 000000200h
|
||||
DDSCAPS_PRIMARYSURFACELEFT = 000000400h
|
||||
DDSCAPS_SYSTEMMEMORY = 000000800h
|
||||
DDSCAPS_TEXTURE = 000001000h
|
||||
DDSCAPS_3DDEVICE = 000002000h
|
||||
DDSCAPS_VIDEOMEMORY = 000004000h
|
||||
DDSCAPS_VISIBLE = 000008000h
|
||||
DDSCAPS_WRITEONLY = 000010000h
|
||||
DDSCAPS_ZBUFFER = 000020000h
|
||||
DDSCAPS_OWNDC = 000040000h
|
||||
DDSCAPS_LIVEVIDEO = 000080000h
|
||||
DDSCAPS_HWCODEC = 000100000h
|
||||
DDSCAPS_MODEX = 000200000h
|
||||
DDSCAPS_MIPMAP = 000400000h
|
||||
DDSCAPS_RESERVED2 = 000800000h
|
||||
DDSCAPS_ALLOCONLOAD = 004000000h
|
||||
DDSCAPS_VIDEOPORT = 008000000h
|
||||
DDSCAPS_LOCALVIDMEM = 010000000h
|
||||
DDSCAPS_NONLOCALVIDMEM = 020000000h
|
||||
DDSCAPS_STANDARDVGAMODE = 040000000h
|
||||
DDSCAPS_OPTIMIZED = 080000000h
|
||||
|
||||
; DirectDrawSurface lock flags
|
||||
|
||||
DDLOCK_SURFACEMEMORYPTR = 000000000h
|
||||
DDLOCK_WAIT = 000000001h
|
||||
DDLOCK_EVENT = 000000002h
|
||||
DDLOCK_READONLY = 000000010h
|
||||
DDLOCK_WRITEONLY = 000000020h
|
||||
DDLOCK_NOSYSLOCK = 000000800h
|
||||
|
||||
; DirectDrawPalette capabilities
|
||||
|
||||
DDPCAPS_4BIT = 000000001h
|
||||
DDPCAPS_8BITENTRIES = 000000002h
|
||||
DDPCAPS_8BIT = 000000004h
|
||||
DDPCAPS_INITIALIZE = 000000008h
|
||||
DDPCAPS_PRIMARYSURFACE = 000000010h
|
||||
DDPCAPS_PRIMARYSURFACELEFT = 000000020h
|
||||
DDPCAPS_ALLOW256 = 000000040h
|
||||
DDPCAPS_VSYNC = 000000080h
|
||||
DDPCAPS_1BIT = 000000100h
|
||||
DDPCAPS_2BIT = 000000200h
|
||||
|
||||
; DirectDraw errors
|
||||
|
||||
DDERR_ALREADYINITIALIZED = 088760000h+5
|
||||
DDERR_CANNOTATTACHSURFACE = 088760000h+10
|
||||
DDERR_CANNOTDETACHSURFACE = 088760000h+20
|
||||
DDERR_CURRENTLYNOTAVAIL = 088760000h+40
|
||||
DDERR_EXCEPTION = 088760000h+55
|
||||
DDERR_HEIGHTALIGN = 088760000h+90
|
||||
DDERR_INCOMPATIBLEPRIMARY = 088760000h+95
|
||||
DDERR_INVALIDCAPS = 088760000h+100
|
||||
DDERR_INVALIDCLIPLIST = 088760000h+110
|
||||
DDERR_INVALIDMODE = 088760000h+120
|
||||
DDERR_INVALIDOBJECT = 088760000h+130
|
||||
DDERR_INVALIDPIXELFORMAT = 088760000h+145
|
||||
DDERR_INVALIDRECT = 088760000h+150
|
||||
DDERR_LOCKEDSURFACES = 088760000h+160
|
||||
DDERR_NO3D = 088760000h+170
|
||||
DDERR_NOALPHAHW = 088760000h+180
|
||||
DDERR_NOCLIPLIST = 088760000h+205
|
||||
DDERR_NOCOLORCONVHW = 088760000h+210
|
||||
DDERR_NOCOOPERATIVELEVELSET = 088760000h+212
|
||||
DDERR_NOCOLORKEY = 088760000h+215
|
||||
DDERR_NOCOLORKEYHW = 088760000h+220
|
||||
DDERR_NODIRECTDRAWSUPPORT = 088760000h+222
|
||||
DDERR_NOEXCLUSIVEMODE = 088760000h+225
|
||||
DDERR_NOFLIPHW = 088760000h+230
|
||||
DDERR_NOGDI = 088760000h+240
|
||||
DDERR_NOMIRRORHW = 088760000h+250
|
||||
DDERR_NOTFOUND = 088760000h+255
|
||||
DDERR_NOOVERLAYHW = 088760000h+260
|
||||
DDERR_NORASTEROPHW = 088760000h+280
|
||||
DDERR_NOROTATIONHW = 088760000h+290
|
||||
DDERR_NOSTRETCHHW = 088760000h+310
|
||||
DDERR_NOT4BITCOLOR = 088760000h+316
|
||||
DDERR_NOT4BITCOLORINDEX = 088760000h+317
|
||||
DDERR_NOT8BITCOLOR = 088760000h+320
|
||||
DDERR_NOTEXTUREHW = 088760000h+330
|
||||
DDERR_NOVSYNCHW = 088760000h+335
|
||||
DDERR_NOZBUFFERHW = 088760000h+340
|
||||
DDERR_NOZOVERLAYHW = 088760000h+350
|
||||
DDERR_OUTOFCAPS = 088760000h+360
|
||||
DDERR_OUTOFVIDEOMEMORY = 088760000h+380
|
||||
DDERR_OVERLAYCANTCLIP = 088760000h+382
|
||||
DDERR_OVERLAYCOLORKEYONLYONEACTI = 088760000h+384
|
||||
DDERR_PALETTEBUSY = 088760000h+387
|
||||
DDERR_COLORKEYNOTSET = 088760000h+400
|
||||
DDERR_SURFACEALREADYATTACHED = 088760000h+410
|
||||
DDERR_SURFACEALREADYDEPENDENT = 088760000h+420
|
||||
DDERR_SURFACEBUSY = 088760000h+430
|
||||
DDERR_CANTLOCKSURFACE = 088760000h+435
|
||||
DDERR_SURFACEISOBSCURED = 088760000h+440
|
||||
DDERR_SURFACELOST = 088760000h+450
|
||||
DDERR_SURFACENOTATTACHED = 088760000h+460
|
||||
DDERR_TOOBIGHEIGHT = 088760000h+470
|
||||
DDERR_TOOBIGSIZE = 088760000h+480
|
||||
DDERR_TOOBIGWIDTH = 088760000h+490
|
||||
DDERR_UNSUPPORTEDFORMAT = 088760000h+510
|
||||
DDERR_UNSUPPORTEDMASK = 088760000h+520
|
||||
DDERR_VERTICALBLANKINPROGRESS = 088760000h+537
|
||||
DDERR_WASSTILLDRAWING = 088760000h+540
|
||||
DDERR_XALIGN = 088760000h+560
|
||||
DDERR_INVALIDDIRECTDRAWGUID = 088760000h+561
|
||||
DDERR_DIRECTDRAWALREADYCREATED = 088760000h+562
|
||||
DDERR_NODIRECTDRAWHW = 088760000h+563
|
||||
DDERR_PRIMARYSURFACEALREADYEXIST = 088760000h+564
|
||||
DDERR_NOEMULATION = 088760000h+565
|
||||
DDERR_REGIONTOOSMALL = 088760000h+566
|
||||
DDERR_CLIPPERISUSINGHWND = 088760000h+567
|
||||
DDERR_NOCLIPPERATTACHED = 088760000h+568
|
||||
DDERR_NOHWND = 088760000h+569
|
||||
DDERR_HWNDSUBCLASSED = 088760000h+570
|
||||
DDERR_HWNDALREADYSET = 088760000h+571
|
||||
DDERR_NOPALETTEATTACHED = 088760000h+572
|
||||
DDERR_NOPALETTEHW = 088760000h+573
|
||||
DDERR_BLTFASTCANTCLIP = 088760000h+574
|
||||
DDERR_NOBLTHW = 088760000h+575
|
||||
DDERR_NODDROPSHW = 088760000h+576
|
||||
DDERR_OVERLAYNOTVISIBLE = 088760000h+577
|
||||
DDERR_NOOVERLAYDEST = 088760000h+578
|
||||
DDERR_INVALIDPOSITION = 088760000h+579
|
||||
DDERR_NOTAOVERLAYSURFACE = 088760000h+580
|
||||
DDERR_EXCLUSIVEMODEALREADYSET = 088760000h+581
|
||||
DDERR_NOTFLIPPABLE = 088760000h+582
|
||||
DDERR_CANTDUPLICATE = 088760000h+583
|
||||
DDERR_NOTLOCKED = 088760000h+584
|
||||
DDERR_CANTCREATEDC = 088760000h+585
|
||||
DDERR_NODC = 088760000h+586
|
||||
DDERR_WRONGMODE = 088760000h+587
|
||||
DDERR_IMPLICITLYCREATED = 088760000h+588
|
||||
DDERR_NOTPALETTIZED = 088760000h+589
|
||||
DDERR_UNSUPPORTEDMODE = 088760000h+590
|
||||
DDERR_NOMIPMAPHW = 088760000h+591
|
||||
DDERR_INVALIDSURFACETYPE = 088760000h+592
|
||||
DDERR_NOOPTIMIZEHW = 088760000h+600
|
||||
DDERR_NOTLOADED = 088760000h+601
|
||||
DDERR_DCALREADYCREATED = 088760000h+620
|
||||
DDERR_NONONLOCALVIDMEM = 088760000h+630
|
||||
DDERR_CANTPAGELOCK = 088760000h+640
|
||||
DDERR_CANTPAGEUNLOCK = 088760000h+660
|
||||
DDERR_NOTPAGELOCKED = 088760000h+680
|
||||
DDERR_MOREDATA = 088760000h+690
|
||||
DDERR_VIDEONOTACTIVE = 088760000h+695
|
||||
DDERR_DEVICEDOESNTOWNSURFACE = 088760000h+699
|
196
toolchain/fasmw17332/EXAMPLES/DDRAW/GIF87A.INC
Normal file
196
toolchain/fasmw17332/EXAMPLES/DDRAW/GIF87A.INC
Normal file
@ -0,0 +1,196 @@
|
||||
|
||||
virtual at buffer
|
||||
GIFHEADER:
|
||||
.ID dd ?
|
||||
.ver dw ?
|
||||
.width dw ?
|
||||
.height dw ?
|
||||
.bits db ?
|
||||
.background db ?
|
||||
.reserved db ?
|
||||
.length = $ - GIFHEADER
|
||||
end virtual
|
||||
|
||||
load_picture:
|
||||
|
||||
invoke CreateFileA,esi,GENERIC_READ,0,0,OPEN_EXISTING,0,0
|
||||
mov edi,eax
|
||||
invoke ReadFile,edi,GIFHEADER,40000h,bytes_count,0
|
||||
invoke CloseHandle,edi
|
||||
|
||||
cmp [GIFHEADER.ID],'GIF8'
|
||||
jne picture_error
|
||||
cmp [GIFHEADER.ver],'7a'
|
||||
jne picture_error
|
||||
|
||||
mov al,[GIFHEADER.bits]
|
||||
and al,10000111b
|
||||
cmp al,10000111b
|
||||
jne picture_error
|
||||
|
||||
add [bytes_count],buffer
|
||||
|
||||
mov esi,buffer+GIFHEADER.length+256*3
|
||||
mov edi,esi
|
||||
|
||||
xor eax,eax
|
||||
find_image:
|
||||
cmp esi,[bytes_count]
|
||||
jae picture_error
|
||||
lodsb
|
||||
cmp al,','
|
||||
je image_found
|
||||
cmp al,'!'
|
||||
jne picture_error
|
||||
inc esi
|
||||
skip_application_data:
|
||||
lodsb
|
||||
add esi,eax
|
||||
or al,al
|
||||
jnz skip_application_data
|
||||
jmp find_image
|
||||
image_found:
|
||||
add esi,4
|
||||
xor eax,eax
|
||||
lodsw
|
||||
mov ebx,eax
|
||||
lodsw
|
||||
inc esi
|
||||
cmp byte [esi],8
|
||||
jne picture_error
|
||||
inc esi
|
||||
|
||||
mov [ddsd.dwSize],sizeof.DDSURFACEDESC
|
||||
mov [ddsd.dwFlags],DDSD_CAPS+DDSD_WIDTH+DDSD_HEIGHT+DDSD_CKSRCBLT
|
||||
mov [ddsd.ddsCaps.dwCaps],DDSCAPS_OFFSCREENPLAIN+DDSCAPS_SYSTEMMEMORY
|
||||
mov [ddsd.dwWidth],ebx
|
||||
mov [ddsd.dwHeight],eax
|
||||
movzx eax,[GIFHEADER.background]
|
||||
mov [ddsd.ddckCKSrcBlt.dwColorSpaceLowValue],eax
|
||||
mov [ddsd.ddckCKSrcBlt.dwColorSpaceHighValue],eax
|
||||
cominvk DDraw,CreateSurface,\
|
||||
ddsd,DDSPicture,0
|
||||
or eax,eax
|
||||
jnz picture_error
|
||||
cominvk DDSPicture,Lock,\
|
||||
0,ddsd,DDLOCK_WAIT,0
|
||||
|
||||
mov edi,[ddsd.lpSurface]
|
||||
mov ebx,esi
|
||||
movzx ebp,byte [ebx]
|
||||
inc ebx
|
||||
add ebp,ebx
|
||||
mov [LZW_bits],0
|
||||
LZW_clear:
|
||||
xor edx,edx
|
||||
LZW_decompress_loop:
|
||||
mov ch,9
|
||||
cmp edx,(100h-2)*8
|
||||
jbe LZW_read_bits
|
||||
mov ch,10
|
||||
cmp edx,(300h-2)*8
|
||||
jbe LZW_read_bits
|
||||
mov ch,11
|
||||
cmp edx,(700h-2)*8
|
||||
jbe LZW_read_bits
|
||||
mov ch,12
|
||||
LZW_read_bits:
|
||||
mov cl,8
|
||||
sub cl,[LZW_bits]
|
||||
LZW_byte_from_stream:
|
||||
mov al,[ebx]
|
||||
cmp ebx,ebp
|
||||
jne LZW_bits_from_byte
|
||||
movzx ebp,al
|
||||
inc ebx
|
||||
mov al,[ebx]
|
||||
add ebp,ebx
|
||||
LZW_bits_from_byte:
|
||||
inc ebx
|
||||
ror eax,8
|
||||
sub cl,ch
|
||||
jz LZW_bits_ready
|
||||
ja LZW_bits_with_tail
|
||||
add cl,ch
|
||||
add cl,8
|
||||
jmp LZW_byte_from_stream
|
||||
LZW_bits_with_tail:
|
||||
dec ebx
|
||||
shl eax,cl
|
||||
LZW_bits_ready:
|
||||
neg cl
|
||||
and cl,7
|
||||
mov [LZW_bits],cl
|
||||
mov cl,ch
|
||||
rol eax,cl
|
||||
and eax,0FFFh
|
||||
cmp eax,100h
|
||||
jb LZW_single_byte
|
||||
je LZW_clear
|
||||
sub eax,102h
|
||||
jc LZW_end
|
||||
shl eax,3
|
||||
cmp eax,edx
|
||||
ja picture_error
|
||||
mov ecx,[LZW_table+eax]
|
||||
mov esi,[LZW_table+eax+4]
|
||||
mov [LZW_table+edx+4],edi
|
||||
rep movsb
|
||||
mov eax,[LZW_table+eax]
|
||||
inc eax
|
||||
mov [LZW_table+edx],eax
|
||||
jmp LZW_decompress_next
|
||||
LZW_single_byte:
|
||||
mov [LZW_table+edx],2
|
||||
mov [LZW_table+edx+4],edi
|
||||
stosb
|
||||
LZW_decompress_next:
|
||||
add edx,8
|
||||
jmp LZW_decompress_loop
|
||||
LZW_end:
|
||||
|
||||
cominvk DDSPicture,Unlock,0
|
||||
|
||||
mov eax,[DDSPicture]
|
||||
clc
|
||||
ret
|
||||
|
||||
picture_error:
|
||||
stc
|
||||
ret
|
||||
|
||||
load_palette:
|
||||
|
||||
invoke CreateFileA,esi,GENERIC_READ,0,0,OPEN_EXISTING,0,0
|
||||
mov edi,eax
|
||||
invoke ReadFile,edi,buffer,GIFHEADER.length+256*3,bytes_count,0
|
||||
cmp [bytes_count],GIFHEADER.length+256*3
|
||||
jne picture_error
|
||||
invoke CloseHandle,edi
|
||||
|
||||
cmp [GIFHEADER.ID],'GIF8'
|
||||
jne picture_error
|
||||
cmp [GIFHEADER.ver],'7a'
|
||||
jne picture_error
|
||||
mov al,[GIFHEADER.bits]
|
||||
and al,111b
|
||||
cmp al,111b
|
||||
jne picture_error
|
||||
|
||||
mov esi,buffer+GIFHEADER.length
|
||||
mov edi,buffer+400h
|
||||
mov ecx,256
|
||||
convert_palette:
|
||||
movsw
|
||||
movsb
|
||||
xor al,al
|
||||
stosb
|
||||
loop convert_palette
|
||||
|
||||
cominvk DDraw,CreatePalette,\
|
||||
DDPCAPS_8BIT+DDPCAPS_ALLOW256,buffer+400h,DDPalette,0
|
||||
or eax,eax
|
||||
jnz picture_error
|
||||
|
||||
clc
|
||||
ret
|
130
toolchain/fasmw17332/EXAMPLES/DIALOG/DIALOG.ASM
Normal file
130
toolchain/fasmw17332/EXAMPLES/DIALOG/DIALOG.ASM
Normal file
@ -0,0 +1,130 @@
|
||||
|
||||
; DialogBox example
|
||||
|
||||
format PE GUI 4.0
|
||||
entry start
|
||||
|
||||
include 'win32a.inc'
|
||||
|
||||
ID_CAPTION = 101
|
||||
ID_MESSAGE = 102
|
||||
ID_ICONERROR = 201
|
||||
ID_ICONINFORMATION = 202
|
||||
ID_ICONQUESTION = 203
|
||||
ID_ICONWARNING = 204
|
||||
ID_TOPMOST = 301
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
|
||||
invoke GetModuleHandle,0
|
||||
invoke DialogBoxParam,eax,37,HWND_DESKTOP,DialogProc,0
|
||||
or eax,eax
|
||||
jz exit
|
||||
invoke MessageBox,HWND_DESKTOP,message,caption,[flags]
|
||||
exit:
|
||||
invoke ExitProcess,0
|
||||
|
||||
proc DialogProc hwnddlg,msg,wparam,lparam
|
||||
push ebx esi edi
|
||||
cmp [msg],WM_INITDIALOG
|
||||
je .wminitdialog
|
||||
cmp [msg],WM_COMMAND
|
||||
je .wmcommand
|
||||
cmp [msg],WM_CLOSE
|
||||
je .wmclose
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wminitdialog:
|
||||
invoke CheckRadioButton,[hwnddlg],ID_ICONERROR,ID_ICONWARNING,ID_ICONINFORMATION
|
||||
jmp .processed
|
||||
.wmcommand:
|
||||
cmp [wparam],BN_CLICKED shl 16 + IDCANCEL
|
||||
je .wmclose
|
||||
cmp [wparam],BN_CLICKED shl 16 + IDOK
|
||||
jne .processed
|
||||
invoke GetDlgItemText,[hwnddlg],ID_CAPTION,caption,40h
|
||||
invoke GetDlgItemText,[hwnddlg],ID_MESSAGE,message,100h
|
||||
mov [flags],MB_OK
|
||||
invoke IsDlgButtonChecked,[hwnddlg],ID_ICONERROR
|
||||
cmp eax,BST_CHECKED
|
||||
jne .iconerror_ok
|
||||
or [flags],MB_ICONERROR
|
||||
.iconerror_ok:
|
||||
invoke IsDlgButtonChecked,[hwnddlg],ID_ICONINFORMATION
|
||||
cmp eax,BST_CHECKED
|
||||
jne .iconinformation_ok
|
||||
or [flags],MB_ICONINFORMATION
|
||||
.iconinformation_ok:
|
||||
invoke IsDlgButtonChecked,[hwnddlg],ID_ICONQUESTION
|
||||
cmp eax,BST_CHECKED
|
||||
jne .iconquestion_ok
|
||||
or [flags],MB_ICONQUESTION
|
||||
.iconquestion_ok:
|
||||
invoke IsDlgButtonChecked,[hwnddlg],ID_ICONWARNING
|
||||
cmp eax,BST_CHECKED
|
||||
jne .iconwarning_ok
|
||||
or [flags],MB_ICONWARNING
|
||||
.iconwarning_ok:
|
||||
invoke IsDlgButtonChecked,[hwnddlg],ID_TOPMOST
|
||||
cmp eax,BST_CHECKED
|
||||
jne .topmost_ok
|
||||
or [flags],MB_TOPMOST
|
||||
.topmost_ok:
|
||||
invoke EndDialog,[hwnddlg],1
|
||||
jmp .processed
|
||||
.wmclose:
|
||||
invoke EndDialog,[hwnddlg],0
|
||||
.processed:
|
||||
mov eax,1
|
||||
.finish:
|
||||
pop edi esi ebx
|
||||
ret
|
||||
endp
|
||||
|
||||
section '.bss' readable writeable
|
||||
|
||||
flags dd ?
|
||||
caption rb 40h
|
||||
message rb 100h
|
||||
|
||||
section '.idata' import data readable writeable
|
||||
|
||||
library kernel,'KERNEL32.DLL',\
|
||||
user,'USER32.DLL'
|
||||
|
||||
import kernel,\
|
||||
GetModuleHandle,'GetModuleHandleA',\
|
||||
ExitProcess,'ExitProcess'
|
||||
|
||||
import user,\
|
||||
DialogBoxParam,'DialogBoxParamA',\
|
||||
CheckRadioButton,'CheckRadioButton',\
|
||||
GetDlgItemText,'GetDlgItemTextA',\
|
||||
IsDlgButtonChecked,'IsDlgButtonChecked',\
|
||||
MessageBox,'MessageBoxA',\
|
||||
EndDialog,'EndDialog'
|
||||
|
||||
section '.rsrc' resource data readable
|
||||
|
||||
directory RT_DIALOG,dialogs
|
||||
|
||||
resource dialogs,\
|
||||
37,LANG_ENGLISH+SUBLANG_DEFAULT,demonstration
|
||||
|
||||
dialog demonstration,'Create message box',70,70,190,175,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME
|
||||
dialogitem 'STATIC','&Caption:',-1,10,10,70,8,WS_VISIBLE
|
||||
dialogitem 'EDIT','',ID_CAPTION,10,20,170,13,WS_VISIBLE+WS_BORDER+WS_TABSTOP
|
||||
dialogitem 'STATIC','&Message:',-1,10,40,70,8,WS_VISIBLE
|
||||
dialogitem 'EDIT','',ID_MESSAGE,10,50,170,13,WS_VISIBLE+WS_BORDER+WS_TABSTOP+ES_AUTOHSCROLL
|
||||
dialogitem 'BUTTON','&Icon',-1,10,70,80,70,WS_VISIBLE+BS_GROUPBOX
|
||||
dialogitem 'BUTTON','&Error',ID_ICONERROR,20,82,60,13,WS_VISIBLE+BS_AUTORADIOBUTTON+WS_TABSTOP+WS_GROUP
|
||||
dialogitem 'BUTTON','I&nformation',ID_ICONINFORMATION,20,95,60,13,WS_VISIBLE+BS_AUTORADIOBUTTON
|
||||
dialogitem 'BUTTON','&Question',ID_ICONQUESTION,20,108,60,13,WS_VISIBLE+BS_AUTORADIOBUTTON
|
||||
dialogitem 'BUTTON','&Warning',ID_ICONWARNING,20,121,60,13,WS_VISIBLE+BS_AUTORADIOBUTTON
|
||||
dialogitem 'BUTTON','&Style',-1,100,70,80,70,WS_VISIBLE+BS_GROUPBOX
|
||||
dialogitem 'BUTTON','&Top most',ID_TOPMOST,110,82,60,13,WS_VISIBLE+WS_TABSTOP+BS_AUTOCHECKBOX
|
||||
dialogitem 'BUTTON','OK',IDOK,85,150,45,15,WS_VISIBLE+WS_TABSTOP+BS_DEFPUSHBUTTON
|
||||
dialogitem 'BUTTON','C&ancel',IDCANCEL,135,150,45,15,WS_VISIBLE+WS_TABSTOP+BS_PUSHBUTTON
|
||||
enddialog
|
59
toolchain/fasmw17332/EXAMPLES/DLL/ERRORMSG.ASM
Normal file
59
toolchain/fasmw17332/EXAMPLES/DLL/ERRORMSG.ASM
Normal file
@ -0,0 +1,59 @@
|
||||
|
||||
; DLL creation example
|
||||
|
||||
format PE GUI 4.0 DLL
|
||||
entry DllEntryPoint
|
||||
|
||||
include 'win32a.inc'
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
proc DllEntryPoint hinstDLL,fdwReason,lpvReserved
|
||||
mov eax,TRUE
|
||||
ret
|
||||
endp
|
||||
|
||||
; VOID ShowErrorMessage(HWND hWnd,DWORD dwError);
|
||||
|
||||
proc ShowErrorMessage hWnd,dwError
|
||||
local lpBuffer:DWORD
|
||||
lea eax,[lpBuffer]
|
||||
invoke FormatMessage,FORMAT_MESSAGE_ALLOCATE_BUFFER+FORMAT_MESSAGE_FROM_SYSTEM,0,[dwError],LANG_NEUTRAL,eax,0,0
|
||||
invoke MessageBox,[hWnd],[lpBuffer],NULL,MB_ICONERROR+MB_OK
|
||||
invoke LocalFree,[lpBuffer]
|
||||
ret
|
||||
endp
|
||||
|
||||
; VOID ShowLastError(HWND hWnd);
|
||||
|
||||
proc ShowLastError hWnd
|
||||
invoke GetLastError
|
||||
stdcall ShowErrorMessage,[hWnd],eax
|
||||
ret
|
||||
endp
|
||||
|
||||
section '.idata' import data readable writeable
|
||||
|
||||
library kernel,'KERNEL32.DLL',\
|
||||
user,'USER32.DLL'
|
||||
|
||||
import kernel,\
|
||||
GetLastError,'GetLastError',\
|
||||
SetLastError,'SetLastError',\
|
||||
FormatMessage,'FormatMessageA',\
|
||||
LocalFree,'LocalFree'
|
||||
|
||||
import user,\
|
||||
MessageBox,'MessageBoxA'
|
||||
|
||||
section '.edata' export data readable
|
||||
|
||||
export 'ERRORMSG.DLL',\
|
||||
ShowErrorMessage,'ShowErrorMessage',\
|
||||
ShowLastError,'ShowLastError'
|
||||
|
||||
section '.reloc' fixups data readable discardable
|
||||
|
||||
if $=$$
|
||||
dd 0,8 ; if there are no fixups, generate dummy entry
|
||||
end if
|
24
toolchain/fasmw17332/EXAMPLES/DLL/LASTERR.ASM
Normal file
24
toolchain/fasmw17332/EXAMPLES/DLL/LASTERR.ASM
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
format PE GUI 4.0
|
||||
entry start
|
||||
|
||||
include 'win32a.inc'
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
invoke SetLastError,0
|
||||
invoke ShowLastError,HWND_DESKTOP
|
||||
invoke ExitProcess,0
|
||||
|
||||
section '.idata' import data readable writeable
|
||||
|
||||
library kernel,'KERNEL32.DLL',\
|
||||
errormsg,'ERRORMSG.DLL'
|
||||
|
||||
import kernel,\
|
||||
SetLastError,'SetLastError',\
|
||||
ExitProcess,'ExitProcess'
|
||||
|
||||
import errormsg,\
|
||||
ShowLastError,'ShowLastError'
|
18
toolchain/fasmw17332/EXAMPLES/HELLO/HELLO.ASM
Normal file
18
toolchain/fasmw17332/EXAMPLES/HELLO/HELLO.ASM
Normal file
@ -0,0 +1,18 @@
|
||||
|
||||
; example of simplified Windows programming using complex macro features
|
||||
|
||||
include 'win32ax.inc' ; you can simply switch between win32ax, win32wx, win64ax and win64wx here
|
||||
|
||||
.code
|
||||
|
||||
start:
|
||||
|
||||
invoke MessageBox,HWND_DESKTOP,"May I introduce myself?",invoke GetCommandLine,MB_YESNO
|
||||
|
||||
.if eax = IDYES
|
||||
invoke MessageBox,HWND_DESKTOP,"Hi! I'm the example program!","Hello!",MB_OK
|
||||
.endif
|
||||
|
||||
invoke ExitProcess,0
|
||||
|
||||
.end start
|
206
toolchain/fasmw17332/EXAMPLES/MINIPAD/MINIPAD.ASM
Normal file
206
toolchain/fasmw17332/EXAMPLES/MINIPAD/MINIPAD.ASM
Normal file
@ -0,0 +1,206 @@
|
||||
|
||||
; Simple text editor - fasm example program
|
||||
|
||||
format PE GUI 4.0
|
||||
entry start
|
||||
|
||||
include 'win32a.inc'
|
||||
|
||||
IDR_ICON = 17
|
||||
IDR_MENU = 37
|
||||
|
||||
IDM_NEW = 101
|
||||
IDM_EXIT = 102
|
||||
IDM_ABOUT = 901
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
|
||||
invoke GetModuleHandle,0
|
||||
mov [wc.hInstance],eax
|
||||
|
||||
invoke LoadIcon,eax,IDR_ICON
|
||||
mov [wc.hIcon],eax
|
||||
invoke LoadCursor,0,IDC_ARROW
|
||||
mov [wc.hCursor],eax
|
||||
invoke RegisterClass,wc
|
||||
test eax,eax
|
||||
jz error
|
||||
|
||||
invoke LoadMenu,[wc.hInstance],IDR_MENU
|
||||
invoke CreateWindowEx,0,_class,_title,WS_VISIBLE+WS_OVERLAPPEDWINDOW,144,128,256,256,NULL,eax,[wc.hInstance],NULL
|
||||
test eax,eax
|
||||
jz error
|
||||
|
||||
msg_loop:
|
||||
invoke GetMessage,msg,NULL,0,0
|
||||
cmp eax,1
|
||||
jb end_loop
|
||||
jne msg_loop
|
||||
invoke TranslateMessage,msg
|
||||
invoke DispatchMessage,msg
|
||||
jmp msg_loop
|
||||
|
||||
error:
|
||||
invoke MessageBox,NULL,_error,NULL,MB_ICONERROR+MB_OK
|
||||
|
||||
end_loop:
|
||||
invoke ExitProcess,[msg.wParam]
|
||||
|
||||
proc WindowProc hwnd,wmsg,wparam,lparam
|
||||
push ebx esi edi
|
||||
mov eax,[wmsg]
|
||||
cmp eax,WM_CREATE
|
||||
je .wmcreate
|
||||
cmp eax,WM_SIZE
|
||||
je .wmsize
|
||||
cmp eax,WM_SETFOCUS
|
||||
je .wmsetfocus
|
||||
cmp eax,WM_COMMAND
|
||||
je .wmcommand
|
||||
cmp eax,WM_DESTROY
|
||||
je .wmdestroy
|
||||
.defwndproc:
|
||||
invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam]
|
||||
jmp .finish
|
||||
.wmcreate:
|
||||
invoke GetClientRect,[hwnd],client
|
||||
invoke CreateWindowEx,WS_EX_CLIENTEDGE,_edit,0,WS_VISIBLE+WS_CHILD+WS_HSCROLL+WS_VSCROLL+ES_AUTOHSCROLL+ES_AUTOVSCROLL+ES_MULTILINE,[client.left],[client.top],[client.right],[client.bottom],[hwnd],0,[wc.hInstance],NULL
|
||||
or eax,eax
|
||||
jz .failed
|
||||
mov [edithwnd],eax
|
||||
invoke CreateFont,16,0,0,0,0,FALSE,FALSE,FALSE,ANSI_CHARSET,OUT_RASTER_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,FIXED_PITCH+FF_DONTCARE,NULL
|
||||
or eax,eax
|
||||
jz .failed
|
||||
mov [editfont],eax
|
||||
invoke SendMessage,[edithwnd],WM_SETFONT,eax,FALSE
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.failed:
|
||||
or eax,-1
|
||||
jmp .finish
|
||||
.wmsize:
|
||||
invoke GetClientRect,[hwnd],client
|
||||
invoke MoveWindow,[edithwnd],[client.left],[client.top],[client.right],[client.bottom],TRUE
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wmsetfocus:
|
||||
invoke SetFocus,[edithwnd]
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wmcommand:
|
||||
mov eax,[wparam]
|
||||
and eax,0FFFFh
|
||||
cmp eax,IDM_NEW
|
||||
je .new
|
||||
cmp eax,IDM_ABOUT
|
||||
je .about
|
||||
cmp eax,IDM_EXIT
|
||||
je .wmdestroy
|
||||
jmp .defwndproc
|
||||
.new:
|
||||
invoke SendMessage,[edithwnd],WM_SETTEXT,0,0
|
||||
jmp .finish
|
||||
.about:
|
||||
invoke MessageBox,[hwnd],_about_text,_about_title,MB_OK
|
||||
jmp .finish
|
||||
.wmdestroy:
|
||||
invoke DeleteObject,[editfont]
|
||||
invoke PostQuitMessage,0
|
||||
xor eax,eax
|
||||
.finish:
|
||||
pop edi esi ebx
|
||||
ret
|
||||
endp
|
||||
|
||||
section '.data' data readable writeable
|
||||
|
||||
_title TCHAR 'MiniPad',0
|
||||
_about_title TCHAR 'About MiniPad',0
|
||||
_about_text TCHAR 'This is Win32 example program created with flat assembler.',0
|
||||
_error TCHAR 'Startup failed.',0
|
||||
|
||||
_class TCHAR 'MINIPAD32',0
|
||||
_edit TCHAR 'EDIT',0
|
||||
|
||||
wc WNDCLASS 0,WindowProc,0,0,NULL,NULL,NULL,COLOR_BTNFACE+1,NULL,_class
|
||||
|
||||
edithwnd dd ?
|
||||
editfont dd ?
|
||||
|
||||
msg MSG
|
||||
client RECT
|
||||
|
||||
section '.idata' import data readable writeable
|
||||
|
||||
library kernel,'KERNEL32.DLL',\
|
||||
user,'USER32.DLL',\
|
||||
gdi,'GDI32.DLL'
|
||||
|
||||
import kernel,\
|
||||
GetModuleHandle,'GetModuleHandleA',\
|
||||
ExitProcess,'ExitProcess'
|
||||
|
||||
import user,\
|
||||
RegisterClass,'RegisterClassA',\
|
||||
CreateWindowEx,'CreateWindowExA',\
|
||||
DefWindowProc,'DefWindowProcA',\
|
||||
SetWindowLong,'SetWindowLongA',\
|
||||
RedrawWindow,'RedrawWindow',\
|
||||
GetMessage,'GetMessageA',\
|
||||
TranslateMessage,'TranslateMessage',\
|
||||
DispatchMessage,'DispatchMessageA',\
|
||||
SendMessage,'SendMessageA',\
|
||||
LoadCursor,'LoadCursorA',\
|
||||
LoadIcon,'LoadIconA',\
|
||||
LoadMenu,'LoadMenuA',\
|
||||
GetClientRect,'GetClientRect',\
|
||||
MoveWindow,'MoveWindow',\
|
||||
SetFocus,'SetFocus',\
|
||||
MessageBox,'MessageBoxA',\
|
||||
PostQuitMessage,'PostQuitMessage'
|
||||
|
||||
import gdi,\
|
||||
CreateFont,'CreateFontA',\
|
||||
DeleteObject,'DeleteObject'
|
||||
|
||||
section '.rsrc' resource data readable
|
||||
|
||||
; resource directory
|
||||
|
||||
directory RT_MENU,menus,\
|
||||
RT_ICON,icons,\
|
||||
RT_GROUP_ICON,group_icons,\
|
||||
RT_VERSION,versions
|
||||
|
||||
; resource subdirectories
|
||||
|
||||
resource menus,\
|
||||
IDR_MENU,LANG_ENGLISH+SUBLANG_DEFAULT,main_menu
|
||||
|
||||
resource icons,\
|
||||
1,LANG_NEUTRAL,icon_data
|
||||
|
||||
resource group_icons,\
|
||||
IDR_ICON,LANG_NEUTRAL,main_icon
|
||||
|
||||
resource versions,\
|
||||
1,LANG_NEUTRAL,version
|
||||
|
||||
menu main_menu
|
||||
menuitem '&File',0,MFR_POPUP
|
||||
menuitem '&New',IDM_NEW
|
||||
menuseparator
|
||||
menuitem 'E&xit',IDM_EXIT,MFR_END
|
||||
menuitem '&Help',0,MFR_POPUP + MFR_END
|
||||
menuitem '&About...',IDM_ABOUT,MFR_END
|
||||
|
||||
icon main_icon,icon_data,'minipad.ico'
|
||||
|
||||
versioninfo version,VOS__WINDOWS32,VFT_APP,VFT2_UNKNOWN,LANG_ENGLISH+SUBLANG_DEFAULT,0,\
|
||||
'FileDescription','MiniPad - example program',\
|
||||
'LegalCopyright','No rights reserved.',\
|
||||
'FileVersion','1.0',\
|
||||
'ProductVersion','1.0',\
|
||||
'OriginalFilename','MINIPAD.EXE'
|
BIN
toolchain/fasmw17332/EXAMPLES/MINIPAD/MINIPAD.ICO
Normal file
BIN
toolchain/fasmw17332/EXAMPLES/MINIPAD/MINIPAD.ICO
Normal file
Binary file not shown.
After Width: | Height: | Size: 766 B |
23
toolchain/fasmw17332/EXAMPLES/MSCOFF/MSCOFF.ASM
Normal file
23
toolchain/fasmw17332/EXAMPLES/MSCOFF/MSCOFF.ASM
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
; example of making Win32 COFF object file
|
||||
|
||||
format MS COFF
|
||||
|
||||
extrn '__imp__MessageBoxA@16' as MessageBox:dword
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
public _demo
|
||||
|
||||
_demo:
|
||||
push 0
|
||||
push _caption
|
||||
push _message
|
||||
push 0
|
||||
call [MessageBox]
|
||||
ret
|
||||
|
||||
section '.data' data readable writeable
|
||||
|
||||
_caption db 'Win32 assembly',0
|
||||
_message db 'Coffee time!',0
|
614
toolchain/fasmw17332/EXAMPLES/OPENGL/OPENGL.ASM
Normal file
614
toolchain/fasmw17332/EXAMPLES/OPENGL/OPENGL.ASM
Normal file
@ -0,0 +1,614 @@
|
||||
|
||||
; OpenGL programming example
|
||||
|
||||
format PE GUI 4.0
|
||||
entry start
|
||||
|
||||
include 'win32a.inc'
|
||||
|
||||
include 'opengl.inc'
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
|
||||
invoke GetModuleHandle,0
|
||||
mov [wc.hInstance],eax
|
||||
invoke LoadIcon,0,IDI_APPLICATION
|
||||
mov [wc.hIcon],eax
|
||||
invoke LoadCursor,0,IDC_ARROW
|
||||
mov [wc.hCursor],eax
|
||||
invoke RegisterClass,wc
|
||||
invoke CreateWindowEx,0,_class,_title,WS_VISIBLE+WS_OVERLAPPEDWINDOW+WS_CLIPCHILDREN+WS_CLIPSIBLINGS,16,16,432,432,NULL,NULL,[wc.hInstance],NULL
|
||||
mov [hwnd],eax
|
||||
|
||||
msg_loop:
|
||||
invoke GetMessage,msg,NULL,0,0
|
||||
or eax,eax
|
||||
jz end_loop
|
||||
invoke TranslateMessage,msg
|
||||
invoke DispatchMessage,msg
|
||||
jmp msg_loop
|
||||
|
||||
end_loop:
|
||||
invoke ExitProcess,[msg.wParam]
|
||||
|
||||
proc WindowProc hwnd,wmsg,wparam,lparam
|
||||
push ebx esi edi
|
||||
cmp [wmsg],WM_CREATE
|
||||
je .wmcreate
|
||||
cmp [wmsg],WM_SIZE
|
||||
je .wmsize
|
||||
cmp [wmsg],WM_PAINT
|
||||
je .wmpaint
|
||||
cmp [wmsg],WM_KEYDOWN
|
||||
je .wmkeydown
|
||||
cmp [wmsg],WM_DESTROY
|
||||
je .wmdestroy
|
||||
.defwndproc:
|
||||
invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam]
|
||||
jmp .finish
|
||||
.wmcreate:
|
||||
invoke GetDC,[hwnd]
|
||||
mov [hdc],eax
|
||||
mov edi,pfd
|
||||
mov ecx,sizeof.PIXELFORMATDESCRIPTOR shr 2
|
||||
xor eax,eax
|
||||
rep stosd
|
||||
mov [pfd.nSize],sizeof.PIXELFORMATDESCRIPTOR
|
||||
mov [pfd.nVersion],1
|
||||
mov [pfd.dwFlags],PFD_SUPPORT_OPENGL+PFD_DOUBLEBUFFER+PFD_DRAW_TO_WINDOW
|
||||
mov [pfd.iLayerType],PFD_MAIN_PLANE
|
||||
mov [pfd.iPixelType],PFD_TYPE_RGBA
|
||||
mov [pfd.cColorBits],16
|
||||
mov [pfd.cDepthBits],16
|
||||
mov [pfd.cAccumBits],0
|
||||
mov [pfd.cStencilBits],0
|
||||
invoke ChoosePixelFormat,[hdc],pfd
|
||||
invoke SetPixelFormat,[hdc],eax,pfd
|
||||
invoke wglCreateContext,[hdc]
|
||||
mov [hrc],eax
|
||||
invoke wglMakeCurrent,[hdc],[hrc]
|
||||
invoke GetClientRect,[hwnd],rc
|
||||
invoke glViewport,0,0,[rc.right],[rc.bottom]
|
||||
invoke GetTickCount
|
||||
mov [clock],eax
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wmsize:
|
||||
invoke GetClientRect,[hwnd],rc
|
||||
invoke glViewport,0,0,[rc.right],[rc.bottom]
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wmpaint:
|
||||
invoke GetTickCount
|
||||
sub eax,[clock]
|
||||
cmp eax,10
|
||||
jb .animation_ok
|
||||
add [clock],eax
|
||||
invoke glRotatef,[theta],0.0,0.0,1.0
|
||||
.animation_ok:
|
||||
invoke glClear,GL_COLOR_BUFFER_BIT
|
||||
invoke glBegin,GL_QUADS
|
||||
invoke glColor3f,1.0,0.1,0.1
|
||||
invoke glVertex3f,-0.6,-0.6,0.0
|
||||
invoke glColor3f,0.1,0.1,0.1
|
||||
invoke glVertex3f,0.6,-0.6,0.0
|
||||
invoke glColor3f,0.1,0.1,1.0
|
||||
invoke glVertex3f,0.6,0.6,0.0
|
||||
invoke glColor3f,1.0,0.1,1.0
|
||||
invoke glVertex3f,-0.6,0.6,0.0
|
||||
invoke glEnd
|
||||
invoke SwapBuffers,[hdc]
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wmkeydown:
|
||||
cmp [wparam],VK_ESCAPE
|
||||
jne .defwndproc
|
||||
.wmdestroy:
|
||||
invoke wglMakeCurrent,0,0
|
||||
invoke wglDeleteContext,[hrc]
|
||||
invoke ReleaseDC,[hwnd],[hdc]
|
||||
invoke PostQuitMessage,0
|
||||
xor eax,eax
|
||||
.finish:
|
||||
pop edi esi ebx
|
||||
ret
|
||||
endp
|
||||
|
||||
section '.data' data readable writeable
|
||||
|
||||
_title db 'OpenGL example',0
|
||||
_class db 'FASMOPENGL32',0
|
||||
|
||||
theta GLfloat 0.6
|
||||
|
||||
wc WNDCLASS 0,WindowProc,0,0,NULL,NULL,NULL,NULL,NULL,_class
|
||||
|
||||
hwnd dd ?
|
||||
hdc dd ?
|
||||
hrc dd ?
|
||||
|
||||
msg MSG
|
||||
rc RECT
|
||||
pfd PIXELFORMATDESCRIPTOR
|
||||
|
||||
clock dd ?
|
||||
|
||||
section '.idata' import data readable writeable
|
||||
|
||||
library kernel,'KERNEL32.DLL',\
|
||||
user,'USER32.DLL',\
|
||||
gdi,'GDI32.DLL',\
|
||||
opengl,'OPENGL32.DLL',\
|
||||
glu,'GLU32.DLL'
|
||||
|
||||
import kernel,\
|
||||
GetModuleHandle,'GetModuleHandleA',\
|
||||
GetTickCount,'GetTickCount',\
|
||||
ExitProcess,'ExitProcess'
|
||||
|
||||
import user,\
|
||||
RegisterClass,'RegisterClassA',\
|
||||
CreateWindowEx,'CreateWindowExA',\
|
||||
DefWindowProc,'DefWindowProcA',\
|
||||
GetMessage,'GetMessageA',\
|
||||
TranslateMessage,'TranslateMessage',\
|
||||
DispatchMessage,'DispatchMessageA',\
|
||||
LoadCursor,'LoadCursorA',\
|
||||
LoadIcon,'LoadIconA',\
|
||||
GetClientRect,'GetClientRect',\
|
||||
GetDC,'GetDC',\
|
||||
ReleaseDC,'ReleaseDC',\
|
||||
PostQuitMessage,'PostQuitMessage'
|
||||
|
||||
import gdi,\
|
||||
ChoosePixelFormat,'ChoosePixelFormat',\
|
||||
SetPixelFormat,'SetPixelFormat',\
|
||||
SwapBuffers,'SwapBuffers'
|
||||
|
||||
import opengl,\
|
||||
glAccum,'glAccum',\
|
||||
glAlphaFunc,'glAlphaFunc',\
|
||||
glAreTexturesResident,'glAreTexturesResident',\
|
||||
glArrayElement,'glArrayElement',\
|
||||
glBegin,'glBegin',\
|
||||
glBindTexture,'glBindTexture',\
|
||||
glBitmap,'glBitmap',\
|
||||
glBlendFunc,'glBlendFunc',\
|
||||
glCallList,'glCallList',\
|
||||
glCallLists,'glCallLists',\
|
||||
glClear,'glClear',\
|
||||
glClearAccum,'glClearAccum',\
|
||||
glClearColor,'glClearColor',\
|
||||
glClearDepth,'glClearDepth',\
|
||||
glClearIndex,'glClearIndex',\
|
||||
glClearStencil,'glClearStencil',\
|
||||
glClipPlane,'glClipPlane',\
|
||||
glColor3b,'glColor3b',\
|
||||
glColor3bv,'glColor3bv',\
|
||||
glColor3d,'glColor3d',\
|
||||
glColor3dv,'glColor3dv',\
|
||||
glColor3f,'glColor3f',\
|
||||
glColor3fv,'glColor3fv',\
|
||||
glColor3i,'glColor3i',\
|
||||
glColor3iv,'glColor3iv',\
|
||||
glColor3s,'glColor3s',\
|
||||
glColor3sv,'glColor3sv',\
|
||||
glColor3ub,'glColor3ub',\
|
||||
glColor3ubv,'glColor3ubv',\
|
||||
glColor3ui,'glColor3ui',\
|
||||
glColor3uiv,'glColor3uiv',\
|
||||
glColor3us,'glColor3us',\
|
||||
glColor3usv,'glColor3usv',\
|
||||
glColor4b,'glColor4b',\
|
||||
glColor4bv,'glColor4bv',\
|
||||
glColor4d,'glColor4d',\
|
||||
glColor4dv,'glColor4dv',\
|
||||
glColor4f,'glColor4f',\
|
||||
glColor4fv,'glColor4fv',\
|
||||
glColor4i,'glColor4i',\
|
||||
glColor4iv,'glColor4iv',\
|
||||
glColor4s,'glColor4s',\
|
||||
glColor4sv,'glColor4sv',\
|
||||
glColor4ub,'glColor4ub',\
|
||||
glColor4ubv,'glColor4ubv',\
|
||||
glColor4ui,'glColor4ui',\
|
||||
glColor4uiv,'glColor4uiv',\
|
||||
glColor4us,'glColor4us',\
|
||||
glColor4usv,'glColor4usv',\
|
||||
glColorMask,'glColorMask',\
|
||||
glColorMaterial,'glColorMaterial',\
|
||||
glColorPointer,'glColorPointer',\
|
||||
glCopyPixels,'glCopyPixels',\
|
||||
glCopyTexImage1D,'glCopyTexImage1D',\
|
||||
glCopyTexImage2D,'glCopyTexImage2D',\
|
||||
glCopyTexSubImage1D,'glCopyTexSubImage1D',\
|
||||
glCopyTexSubImage2D,'glCopyTexSubImage2D',\
|
||||
glCullFace,'glCullFace',\
|
||||
glDeleteLists,'glDeleteLists',\
|
||||
glDeleteTextures,'glDeleteTextures',\
|
||||
glDepthFunc,'glDepthFunc',\
|
||||
glDepthMask,'glDepthMask',\
|
||||
glDepthRange,'glDepthRange',\
|
||||
glDisable,'glDisable',\
|
||||
glDisableClientState,'glDisableClientState',\
|
||||
glDrawArrays,'glDrawArrays',\
|
||||
glDrawBuffer,'glDrawBuffer',\
|
||||
glDrawElements,'glDrawElements',\
|
||||
glDrawPixels,'glDrawPixels',\
|
||||
glEdgeFlag,'glEdgeFlag',\
|
||||
glEdgeFlagPointer,'glEdgeFlagPointer',\
|
||||
glEdgeFlagv,'glEdgeFlagv',\
|
||||
glEnable,'glEnable',\
|
||||
glEnableClientState,'glEnableClientState',\
|
||||
glEnd,'glEnd',\
|
||||
glEndList,'glEndList',\
|
||||
glEvalCoord1d,'glEvalCoord1d',\
|
||||
glEvalCoord1dv,'glEvalCoord1dv',\
|
||||
glEvalCoord1f,'glEvalCoord1f',\
|
||||
glEvalCoord1fv,'glEvalCoord1fv',\
|
||||
glEvalCoord2d,'glEvalCoord2d',\
|
||||
glEvalCoord2dv,'glEvalCoord2dv',\
|
||||
glEvalCoord2f,'glEvalCoord2f',\
|
||||
glEvalCoord2fv,'glEvalCoord2fv',\
|
||||
glEvalMesh1,'glEvalMesh1',\
|
||||
glEvalMesh2,'glEvalMesh2',\
|
||||
glEvalPoint1,'glEvalPoint1',\
|
||||
glEvalPoint2,'glEvalPoint2',\
|
||||
glFeedbackBuffer,'glFeedbackBuffer',\
|
||||
glFinish,'glFinish',\
|
||||
glFlush,'glFlush',\
|
||||
glFogf,'glFogf',\
|
||||
glFogfv,'glFogfv',\
|
||||
glFogi,'glFogi',\
|
||||
glFogiv,'glFogiv',\
|
||||
glFrontFace,'glFrontFace',\
|
||||
glFrustum,'glFrustum',\
|
||||
glGenLists,'glGenLists',\
|
||||
glGenTextures,'glGenTextures',\
|
||||
glGetBooleanv,'glGetBooleanv',\
|
||||
glGetClipPlane,'glGetClipPlane',\
|
||||
glGetDoublev,'glGetDoublev',\
|
||||
glGetError,'glGetError',\
|
||||
glGetFloatv,'glGetFloatv',\
|
||||
glGetIntegerv,'glGetIntegerv',\
|
||||
glGetLightfv,'glGetLightfv',\
|
||||
glGetLightiv,'glGetLightiv',\
|
||||
glGetMapdv,'glGetMapdv',\
|
||||
glGetMapfv,'glGetMapfv',\
|
||||
glGetMapiv,'glGetMapiv',\
|
||||
glGetMaterialfv,'glGetMaterialfv',\
|
||||
glGetMaterialiv,'glGetMaterialiv',\
|
||||
glGetPixelMapfv,'glGetPixelMapfv',\
|
||||
glGetPixelMapuiv,'glGetPixelMapuiv',\
|
||||
glGetPixelMapusv,'glGetPixelMapusv',\
|
||||
glGetPointerv,'glGetPointerv',\
|
||||
glGetPolygonStipple,'glGetPolygonStipple',\
|
||||
glGetString,'glGetString',\
|
||||
glGetTexEnvfv,'glGetTexEnvfv',\
|
||||
glGetTexEnviv,'glGetTexEnviv',\
|
||||
glGetTexGendv,'glGetTexGendv',\
|
||||
glGetTexGenfv,'glGetTexGenfv',\
|
||||
glGetTexGeniv,'glGetTexGeniv',\
|
||||
glGetTexImage,'glGetTexImage',\
|
||||
glGetTexLevelParameterfv,'glGetTexLevelParameterfv',\
|
||||
glGetTexLevelParameteriv,'glGetTexLevelParameteriv',\
|
||||
glGetTexParameterfv,'glGetTexParameterfv',\
|
||||
glGetTexParameteriv,'glGetTexParameteriv',\
|
||||
glHint,'glHint',\
|
||||
glIndexMask,'glIndexMask',\
|
||||
glIndexPointer,'glIndexPointer',\
|
||||
glIndexd,'glIndexd',\
|
||||
glIndexdv,'glIndexdv',\
|
||||
glIndexf,'glIndexf',\
|
||||
glIndexfv,'glIndexfv',\
|
||||
glIndexi,'glIndexi',\
|
||||
glIndexiv,'glIndexiv',\
|
||||
glIndexs,'glIndexs',\
|
||||
glIndexsv,'glIndexsv',\
|
||||
glIndexub,'glIndexub',\
|
||||
glIndexubv,'glIndexubv',\
|
||||
glInitNames,'glInitNames',\
|
||||
glInterleavedArrays,'glInterleavedArrays',\
|
||||
glIsEnabled,'glIsEnabled',\
|
||||
glIsList,'glIsList',\
|
||||
glIsTexture,'glIsTexture',\
|
||||
glLightModelf,'glLightModelf',\
|
||||
glLightModelfv,'glLightModelfv',\
|
||||
glLightModeli,'glLightModeli',\
|
||||
glLightModeliv,'glLightModeliv',\
|
||||
glLightf,'glLightf',\
|
||||
glLightfv,'glLightfv',\
|
||||
glLighti,'glLighti',\
|
||||
glLightiv,'glLightiv',\
|
||||
glLineStipple,'glLineStipple',\
|
||||
glLineWidth,'glLineWidth',\
|
||||
glListBase,'glListBase',\
|
||||
glLoadIdentity,'glLoadIdentity',\
|
||||
glLoadMatrixd,'glLoadMatrixd',\
|
||||
glLoadMatrixf,'glLoadMatrixf',\
|
||||
glLoadName,'glLoadName',\
|
||||
glLogicOp,'glLogicOp',\
|
||||
glMap1d,'glMap1d',\
|
||||
glMap1f,'glMap1f',\
|
||||
glMap2d,'glMap2d',\
|
||||
glMap2f,'glMap2f',\
|
||||
glMapGrid1d,'glMapGrid1d',\
|
||||
glMapGrid1f,'glMapGrid1f',\
|
||||
glMapGrid2d,'glMapGrid2d',\
|
||||
glMapGrid2f,'glMapGrid2f',\
|
||||
glMaterialf,'glMaterialf',\
|
||||
glMaterialfv,'glMaterialfv',\
|
||||
glMateriali,'glMateriali',\
|
||||
glMaterialiv,'glMaterialiv',\
|
||||
glMatrixMode,'glMatrixMode',\
|
||||
glMultMatrixd,'glMultMatrixd',\
|
||||
glMultMatrixf,'glMultMatrixf',\
|
||||
glNewList,'glNewList',\
|
||||
glNormal3b,'glNormal3b',\
|
||||
glNormal3bv,'glNormal3bv',\
|
||||
glNormal3d,'glNormal3d',\
|
||||
glNormal3dv,'glNormal3dv',\
|
||||
glNormal3f,'glNormal3f',\
|
||||
glNormal3fv,'glNormal3fv',\
|
||||
glNormal3i,'glNormal3i',\
|
||||
glNormal3iv,'glNormal3iv',\
|
||||
glNormal3s,'glNormal3s',\
|
||||
glNormal3sv,'glNormal3sv',\
|
||||
glNormalPointer,'glNormalPointer',\
|
||||
glOrtho,'glOrtho',\
|
||||
glPassThrough,'glPassThrough',\
|
||||
glPixelMapfv,'glPixelMapfv',\
|
||||
glPixelMapuiv,'glPixelMapuiv',\
|
||||
glPixelMapusv,'glPixelMapusv',\
|
||||
glPixelStoref,'glPixelStoref',\
|
||||
glPixelStorei,'glPixelStorei',\
|
||||
glPixelTransferf,'glPixelTransferf',\
|
||||
glPixelTransferi,'glPixelTransferi',\
|
||||
glPixelZoom,'glPixelZoom',\
|
||||
glPointSize,'glPointSize',\
|
||||
glPolygonMode,'glPolygonMode',\
|
||||
glPolygonOffset,'glPolygonOffset',\
|
||||
glPolygonStipple,'glPolygonStipple',\
|
||||
glPopAttrib,'glPopAttrib',\
|
||||
glPopClientAttrib,'glPopClientAttrib',\
|
||||
glPopMatrix,'glPopMatrix',\
|
||||
glPopName,'glPopName',\
|
||||
glPrioritizeTextures,'glPrioritizeTextures',\
|
||||
glPushAttrib,'glPushAttrib',\
|
||||
glPushClientAttrib,'glPushClientAttrib',\
|
||||
glPushMatrix,'glPushMatrix',\
|
||||
glPushName,'glPushName',\
|
||||
glRasterPos2d,'glRasterPos2d',\
|
||||
glRasterPos2dv,'glRasterPos2dv',\
|
||||
glRasterPos2f,'glRasterPos2f',\
|
||||
glRasterPos2fv,'glRasterPos2fv',\
|
||||
glRasterPos2i,'glRasterPos2i',\
|
||||
glRasterPos2iv,'glRasterPos2iv',\
|
||||
glRasterPos2s,'glRasterPos2s',\
|
||||
glRasterPos2sv,'glRasterPos2sv',\
|
||||
glRasterPos3d,'glRasterPos3d',\
|
||||
glRasterPos3dv,'glRasterPos3dv',\
|
||||
glRasterPos3f,'glRasterPos3f',\
|
||||
glRasterPos3fv,'glRasterPos3fv',\
|
||||
glRasterPos3i,'glRasterPos3i',\
|
||||
glRasterPos3iv,'glRasterPos3iv',\
|
||||
glRasterPos3s,'glRasterPos3s',\
|
||||
glRasterPos3sv,'glRasterPos3sv',\
|
||||
glRasterPos4d,'glRasterPos4d',\
|
||||
glRasterPos4dv,'glRasterPos4dv',\
|
||||
glRasterPos4f,'glRasterPos4f',\
|
||||
glRasterPos4fv,'glRasterPos4fv',\
|
||||
glRasterPos4i,'glRasterPos4i',\
|
||||
glRasterPos4iv,'glRasterPos4iv',\
|
||||
glRasterPos4s,'glRasterPos4s',\
|
||||
glRasterPos4sv,'glRasterPos4sv',\
|
||||
glReadBuffer,'glReadBuffer',\
|
||||
glReadPixels,'glReadPixels',\
|
||||
glRectd,'glRectd',\
|
||||
glRectdv,'glRectdv',\
|
||||
glRectf,'glRectf',\
|
||||
glRectfv,'glRectfv',\
|
||||
glRecti,'glRecti',\
|
||||
glRectiv,'glRectiv',\
|
||||
glRects,'glRects',\
|
||||
glRectsv,'glRectsv',\
|
||||
glRenderMode,'glRenderMode',\
|
||||
glRotated,'glRotated',\
|
||||
glRotatef,'glRotatef',\
|
||||
glScaled,'glScaled',\
|
||||
glScalef,'glScalef',\
|
||||
glScissor,'glScissor',\
|
||||
glSelectBuffer,'glSelectBuffer',\
|
||||
glShadeModel,'glShadeModel',\
|
||||
glStencilFunc,'glStencilFunc',\
|
||||
glStencilMask,'glStencilMask',\
|
||||
glStencilOp,'glStencilOp',\
|
||||
glTexCoord1d,'glTexCoord1d',\
|
||||
glTexCoord1dv,'glTexCoord1dv',\
|
||||
glTexCoord1f,'glTexCoord1f',\
|
||||
glTexCoord1fv,'glTexCoord1fv',\
|
||||
glTexCoord1i,'glTexCoord1i',\
|
||||
glTexCoord1iv,'glTexCoord1iv',\
|
||||
glTexCoord1s,'glTexCoord1s',\
|
||||
glTexCoord1sv,'glTexCoord1sv',\
|
||||
glTexCoord2d,'glTexCoord2d',\
|
||||
glTexCoord2dv,'glTexCoord2dv',\
|
||||
glTexCoord2f,'glTexCoord2f',\
|
||||
glTexCoord2fv,'glTexCoord2fv',\
|
||||
glTexCoord2i,'glTexCoord2i',\
|
||||
glTexCoord2iv,'glTexCoord2iv',\
|
||||
glTexCoord2s,'glTexCoord2s',\
|
||||
glTexCoord2sv,'glTexCoord2sv',\
|
||||
glTexCoord3d,'glTexCoord3d',\
|
||||
glTexCoord3dv,'glTexCoord3dv',\
|
||||
glTexCoord3f,'glTexCoord3f',\
|
||||
glTexCoord3fv,'glTexCoord3fv',\
|
||||
glTexCoord3i,'glTexCoord3i',\
|
||||
glTexCoord3iv,'glTexCoord3iv',\
|
||||
glTexCoord3s,'glTexCoord3s',\
|
||||
glTexCoord3sv,'glTexCoord3sv',\
|
||||
glTexCoord4d,'glTexCoord4d',\
|
||||
glTexCoord4dv,'glTexCoord4dv',\
|
||||
glTexCoord4f,'glTexCoord4f',\
|
||||
glTexCoord4fv,'glTexCoord4fv',\
|
||||
glTexCoord4i,'glTexCoord4i',\
|
||||
glTexCoord4iv,'glTexCoord4iv',\
|
||||
glTexCoord4s,'glTexCoord4s',\
|
||||
glTexCoord4sv,'glTexCoord4sv',\
|
||||
glTexCoordPointer,'glTexCoordPointer',\
|
||||
glTexEnvf,'glTexEnvf',\
|
||||
glTexEnvfv,'glTexEnvfv',\
|
||||
glTexEnvi,'glTexEnvi',\
|
||||
glTexEnviv,'glTexEnviv',\
|
||||
glTexGend,'glTexGend',\
|
||||
glTexGendv,'glTexGendv',\
|
||||
glTexGenf,'glTexGenf',\
|
||||
glTexGenfv,'glTexGenfv',\
|
||||
glTexGeni,'glTexGeni',\
|
||||
glTexGeniv,'glTexGeniv',\
|
||||
glTexImage1D,'glTexImage1D',\
|
||||
glTexImage2D,'glTexImage2D',\
|
||||
glTexParameterf,'glTexParameterf',\
|
||||
glTexParameterfv,'glTexParameterfv',\
|
||||
glTexParameteri,'glTexParameteri',\
|
||||
glTexParameteriv,'glTexParameteriv',\
|
||||
glTexSubImage1D,'glTexSubImage1D',\
|
||||
glTexSubImage2D,'glTexSubImage2D',\
|
||||
glTranslated,'glTranslated',\
|
||||
glTranslatef,'glTranslatef',\
|
||||
glVertex2d,'glVertex2d',\
|
||||
glVertex2dv,'glVertex2dv',\
|
||||
glVertex2f,'glVertex2f',\
|
||||
glVertex2fv,'glVertex2fv',\
|
||||
glVertex2i,'glVertex2i',\
|
||||
glVertex2iv,'glVertex2iv',\
|
||||
glVertex2s,'glVertex2s',\
|
||||
glVertex2sv,'glVertex2sv',\
|
||||
glVertex3d,'glVertex3d',\
|
||||
glVertex3dv,'glVertex3dv',\
|
||||
glVertex3f,'glVertex3f',\
|
||||
glVertex3fv,'glVertex3fv',\
|
||||
glVertex3i,'glVertex3i',\
|
||||
glVertex3iv,'glVertex3iv',\
|
||||
glVertex3s,'glVertex3s',\
|
||||
glVertex3sv,'glVertex3sv',\
|
||||
glVertex4d,'glVertex4d',\
|
||||
glVertex4dv,'glVertex4dv',\
|
||||
glVertex4f,'glVertex4f',\
|
||||
glVertex4fv,'glVertex4fv',\
|
||||
glVertex4i,'glVertex4i',\
|
||||
glVertex4iv,'glVertex4iv',\
|
||||
glVertex4s,'glVertex4s',\
|
||||
glVertex4sv,'glVertex4sv',\
|
||||
glVertexPointer,'glVertexPointer',\
|
||||
glViewport,'glViewport',\
|
||||
wglGetProcAddress,'wglGetProcAddress',\
|
||||
wglCopyContext,'wglCopyContext',\
|
||||
wglCreateContext,'wglCreateContext',\
|
||||
wglCreateLayerContext,'wglCreateLayerContext',\
|
||||
wglDeleteContext,'wglDeleteContext',\
|
||||
wglDescribeLayerPlane,'wglDescribeLayerPlane',\
|
||||
wglGetCurrentContext,'wglGetCurrentContext',\
|
||||
wglGetCurrentDC,'wglGetCurrentDC',\
|
||||
wglGetLayerPaletteEntries,'wglGetLayerPaletteEntries',\
|
||||
wglMakeCurrent,'wglMakeCurrent',\
|
||||
wglRealizeLayerPalette,'wglRealizeLayerPalette',\
|
||||
wglSetLayerPaletteEntries,'wglSetLayerPaletteEntries',\
|
||||
wglShareLists,'wglShareLists',\
|
||||
wglSwapLayerBuffers,'wglSwapLayerBuffers',\
|
||||
wglSwapMultipleBuffers,'wglSwapMultipleBuffers',\
|
||||
wglUseFontBitmapsA,'wglUseFontBitmapsA',\
|
||||
wglUseFontOutlinesA,'wglUseFontOutlinesA',\
|
||||
wglUseFontBitmapsW,'wglUseFontBitmapsW',\
|
||||
wglUseFontOutlinesW,'wglUseFontOutlinesW',\
|
||||
glDrawRangeElements,'glDrawRangeElements',\
|
||||
glTexImage3D,'glTexImage3D',\
|
||||
glBlendColor,'glBlendColor',\
|
||||
glBlendEquation,'glBlendEquation',\
|
||||
glColorSubTable,'glColorSubTable',\
|
||||
glCopyColorSubTable,'glCopyColorSubTable',\
|
||||
glColorTable,'glColorTable',\
|
||||
glCopyColorTable,'glCopyColorTable',\
|
||||
glColorTableParameteriv,'glColorTableParameteriv',\
|
||||
glColorTableParameterfv,'glColorTableParameterfv',\
|
||||
glGetColorTable,'glGetColorTable',\
|
||||
glGetColorTableParameteriv,'glGetColorTableParameteriv',\
|
||||
glGetColorTableParameterfv,'glGetColorTableParameterfv',\
|
||||
glConvolutionFilter1D,'glConvolutionFilter1D',\
|
||||
glConvolutionFilter2D,'glConvolutionFilter2D',\
|
||||
glCopyConvolutionFilter1D,'glCopyConvolutionFilter1D',\
|
||||
glCopyConvolutionFilter2D,'glCopyConvolutionFilter2D',\
|
||||
glGetConvolutionFilter,'glGetConvolutionFilter',\
|
||||
glSeparableFilter2D,'glSeparableFilter2D',\
|
||||
glGetSeparableFilter,'glGetSeparableFilter',\
|
||||
glConvolutionParameteri,'glConvolutionParameteri',\
|
||||
glConvolutionParameteriv,'glConvolutionParameteriv',\
|
||||
glConvolutionParameterf,'glConvolutionParameterf',\
|
||||
glConvolutionParameterfv,'glConvolutionParameterfv',\
|
||||
glGetConvolutionParameteriv,'glGetConvolutionParameteriv',\
|
||||
glGetConvolutionParameterfv,'glGetConvolutionParameterfv',\
|
||||
glHistogram,'glHistogram',\
|
||||
glResetHistogram,'glResetHistogram',\
|
||||
glGetHistogram,'glGetHistogram',\
|
||||
glGetHistogramParameteriv,'glGetHistogramParameteriv',\
|
||||
glGetHistogramParameterfv,'glGetHistogramParameterfv',\
|
||||
glMinmax,'glMinmax',\
|
||||
glResetMinmax,'glResetMinmax',\
|
||||
glGetMinmax,'glGetMinmax',\
|
||||
glGetMinmaxParameteriv,'glGetMinmaxParameteriv',\
|
||||
glGetMinmaxParameterfv,'glGetMinmaxParameterfv'
|
||||
|
||||
import glu,\
|
||||
gluBeginCurve,'gluBeginCurve',\
|
||||
gluBeginPolygon,'gluBeginPolygon',\
|
||||
gluBeginSurface,'gluBeginSurface',\
|
||||
gluBeginTrim,'gluBeginTrim',\
|
||||
gluBuild1DMipmaps,'gluBuild1DMipmaps',\
|
||||
gluBuild2DMipmaps,'gluBuild2DMipmaps',\
|
||||
gluCylinder,'gluCylinder',\
|
||||
gluDeleteNurbsRenderer,'gluDeleteNurbsRenderer',\
|
||||
gluDeleteQuadric,'gluDeleteQuadric',\
|
||||
gluDeleteTess,'gluDeleteTess',\
|
||||
gluDisk,'gluDisk',\
|
||||
gluEndCurve,'gluEndCurve',\
|
||||
gluEndPolygon,'gluEndPolygon',\
|
||||
gluEndSurface,'gluEndSurface',\
|
||||
gluEndTrim,'gluEndTrim',\
|
||||
gluErrorString,'gluErrorString',\
|
||||
gluGetNurbsProperty,'gluGetNurbsProperty',\
|
||||
gluGetString,'gluGetString',\
|
||||
gluGetTessProperty,'gluGetTessProperty',\
|
||||
gluLoadSamplingMatrices,'gluLoadSamplingMatrices',\
|
||||
gluLookAt,'gluLookAt',\
|
||||
gluNewNurbsRenderer,'gluNewNurbsRenderer',\
|
||||
gluNewQuadric,'gluNewQuadric',\
|
||||
gluNewTess,'gluNewTess',\
|
||||
gluNextContour,'gluNextContour',\
|
||||
gluNurbsCallback,'gluNurbsCallback',\
|
||||
gluNurbsCurve,'gluNurbsCurve',\
|
||||
gluNurbsProperty,'gluNurbsProperty',\
|
||||
gluNurbsSurface,'gluNurbsSurface',\
|
||||
gluOrtho2D,'gluOrtho2D',\
|
||||
gluPartialDisk,'gluPartialDisk',\
|
||||
gluPerspective,'gluPerspective',\
|
||||
gluPickMatrix,'gluPickMatrix',\
|
||||
gluProject,'gluProject',\
|
||||
gluPwlCurve,'gluPwlCurve',\
|
||||
gluQuadricCallback,'gluQuadricCallback',\
|
||||
gluQuadricDrawStyle,'gluQuadricDrawStyle',\
|
||||
gluQuadricNormals,'gluQuadricNormals',\
|
||||
gluQuadricOrientation,'gluQuadricOrientation',\
|
||||
gluQuadricTexture,'gluQuadricTexture',\
|
||||
gluScaleImage,'gluScaleImage',\
|
||||
gluSphere,'gluSphere',\
|
||||
gluTessBeginContour,'gluTessBeginContour',\
|
||||
gluTessBeginPolygon,'gluTessBeginPolygon',\
|
||||
gluTessCallback,'gluTessCallback',\
|
||||
gluTessEndContour,'gluTessEndContour',\
|
||||
gluTessEndPolygon,'gluTessEndPolygon',\
|
||||
gluTessNormal,'gluTessNormal',\
|
||||
gluTessProperty,'gluTessProperty',\
|
||||
gluTessVertex,'gluTessVertex',\
|
||||
gluUnProject,'gluUnProject'
|
2337
toolchain/fasmw17332/EXAMPLES/OPENGL/OPENGL.INC
Normal file
2337
toolchain/fasmw17332/EXAMPLES/OPENGL/OPENGL.INC
Normal file
File diff suppressed because it is too large
Load Diff
46
toolchain/fasmw17332/EXAMPLES/PEDEMO/PEDEMO.ASM
Normal file
46
toolchain/fasmw17332/EXAMPLES/PEDEMO/PEDEMO.ASM
Normal file
@ -0,0 +1,46 @@
|
||||
|
||||
; Example of making 32-bit PE program as raw code and data
|
||||
|
||||
format PE GUI
|
||||
entry start
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
|
||||
push 0
|
||||
push _caption
|
||||
push _message
|
||||
push 0
|
||||
call [MessageBoxA]
|
||||
|
||||
push 0
|
||||
call [ExitProcess]
|
||||
|
||||
section '.data' data readable writeable
|
||||
|
||||
_caption db 'Win32 assembly program',0
|
||||
_message db 'Hello World!',0
|
||||
|
||||
section '.idata' import data readable writeable
|
||||
|
||||
dd 0,0,0,RVA kernel_name,RVA kernel_table
|
||||
dd 0,0,0,RVA user_name,RVA user_table
|
||||
dd 0,0,0,0,0
|
||||
|
||||
kernel_table:
|
||||
ExitProcess dd RVA _ExitProcess
|
||||
dd 0
|
||||
user_table:
|
||||
MessageBoxA dd RVA _MessageBoxA
|
||||
dd 0
|
||||
|
||||
kernel_name db 'KERNEL32.DLL',0
|
||||
user_name db 'USER32.DLL',0
|
||||
|
||||
_ExitProcess dw 0
|
||||
db 'ExitProcess',0
|
||||
_MessageBoxA dw 0
|
||||
db 'MessageBoxA',0
|
||||
|
||||
section '.reloc' fixups data readable discardable ; needed for Win32s
|
71
toolchain/fasmw17332/EXAMPLES/TEMPLATE/TEMPLATE.ASM
Normal file
71
toolchain/fasmw17332/EXAMPLES/TEMPLATE/TEMPLATE.ASM
Normal file
@ -0,0 +1,71 @@
|
||||
|
||||
; Template for program using standard Win32 headers
|
||||
|
||||
format PE GUI 4.0
|
||||
entry start
|
||||
|
||||
include 'win32w.inc'
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
|
||||
invoke GetModuleHandle,0
|
||||
mov [wc.hInstance],eax
|
||||
invoke LoadIcon,0,IDI_APPLICATION
|
||||
mov [wc.hIcon],eax
|
||||
invoke LoadCursor,0,IDC_ARROW
|
||||
mov [wc.hCursor],eax
|
||||
invoke RegisterClass,wc
|
||||
test eax,eax
|
||||
jz error
|
||||
|
||||
invoke CreateWindowEx,0,_class,_title,WS_VISIBLE+WS_DLGFRAME+WS_SYSMENU,128,128,256,192,NULL,NULL,[wc.hInstance],NULL
|
||||
test eax,eax
|
||||
jz error
|
||||
|
||||
msg_loop:
|
||||
invoke GetMessage,msg,NULL,0,0
|
||||
cmp eax,1
|
||||
jb end_loop
|
||||
jne msg_loop
|
||||
invoke TranslateMessage,msg
|
||||
invoke DispatchMessage,msg
|
||||
jmp msg_loop
|
||||
|
||||
error:
|
||||
invoke MessageBox,NULL,_error,NULL,MB_ICONERROR+MB_OK
|
||||
|
||||
end_loop:
|
||||
invoke ExitProcess,[msg.wParam]
|
||||
|
||||
proc WindowProc uses ebx esi edi, hwnd,wmsg,wparam,lparam
|
||||
cmp [wmsg],WM_DESTROY
|
||||
je .wmdestroy
|
||||
.defwndproc:
|
||||
invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam]
|
||||
jmp .finish
|
||||
.wmdestroy:
|
||||
invoke PostQuitMessage,0
|
||||
xor eax,eax
|
||||
.finish:
|
||||
ret
|
||||
endp
|
||||
|
||||
section '.data' data readable writeable
|
||||
|
||||
_class TCHAR 'FASMWIN32',0
|
||||
_title TCHAR 'Win32 program template',0
|
||||
_error TCHAR 'Startup failed.',0
|
||||
|
||||
wc WNDCLASS 0,WindowProc,0,0,NULL,NULL,NULL,COLOR_BTNFACE+1,NULL,_class
|
||||
|
||||
msg MSG
|
||||
|
||||
section '.idata' import data readable writeable
|
||||
|
||||
library kernel32,'KERNEL32.DLL',\
|
||||
user32,'USER32.DLL'
|
||||
|
||||
include 'api\kernel32.inc'
|
||||
include 'api\user32.inc'
|
142
toolchain/fasmw17332/EXAMPLES/USECOM/USECOM.ASM
Normal file
142
toolchain/fasmw17332/EXAMPLES/USECOM/USECOM.ASM
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
; Component Object Model usage demonstration
|
||||
|
||||
format PE GUI 4.0
|
||||
entry start
|
||||
|
||||
include 'win32a.inc'
|
||||
|
||||
struc GUID def
|
||||
{
|
||||
match d1-d2-d3-d4-d5, def
|
||||
\{
|
||||
.Data1 dd 0x\#d1
|
||||
.Data2 dw 0x\#d2
|
||||
.Data3 dw 0x\#d3
|
||||
.Data4 db 0x\#d4 shr 8,0x\#d4 and 0FFh
|
||||
.Data5 db 0x\#d5 shr 40,0x\#d5 shr 32 and 0FFh,0x\#d5 shr 24 and 0FFh,0x\#d5 shr 16 and 0FFh,0x\#d5 shr 8 and 0FFh,0x\#d5 and 0FFh
|
||||
\}
|
||||
}
|
||||
|
||||
interface ITaskBarList,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
HrInit,\
|
||||
AddTab,\
|
||||
DeleteTab,\
|
||||
ActivateTab,\
|
||||
SetActiveAlt
|
||||
|
||||
CLSCTX_INPROC_SERVER = 0x1
|
||||
CLSCTX_INPROC_HANDLER = 0x2
|
||||
CLSCTX_LOCAL_SERVER = 0x4
|
||||
CLSCTX_INPROC_SERVER16 = 0x8
|
||||
CLSCTX_REMOTE_SERVER = 0x10
|
||||
CLSCTX_INPROC_HANDLER16 = 0x20
|
||||
CLSCTX_INPROC_SERVERX86 = 0x40
|
||||
CLSCTX_INPROC_HANDLERX86 = 0x80
|
||||
CLSCTX_ESERVER_HANDLER = 0x100
|
||||
CLSCTX_NO_CODE_DOWNLOAD = 0x400
|
||||
CLSCTX_NO_CUSTOM_MARSHAL = 0x1000
|
||||
CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000
|
||||
CLSCTX_NO_FAILURE_LOG = 0x4000
|
||||
CLSCTX_DISABLE_AAA = 0x8000
|
||||
CLSCTX_ENABLE_AAA = 0x10000
|
||||
CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000
|
||||
|
||||
ID_EXIT = IDCANCEL
|
||||
ID_SHOW = 100
|
||||
ID_HIDE = 101
|
||||
|
||||
IDD_COMDEMO = 1
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
|
||||
invoke CoInitialize,NULL
|
||||
invoke CoCreateInstance,CLSID_TaskbarList,NULL,CLSCTX_INPROC_SERVER,IID_ITaskbarList,ShellTaskBar
|
||||
|
||||
invoke GetModuleHandle,0
|
||||
invoke DialogBoxParam,eax,IDD_COMDEMO,HWND_DESKTOP,COMDemo,0
|
||||
|
||||
cominvk ShellTaskBar,Release
|
||||
|
||||
invoke ExitProcess,0
|
||||
|
||||
proc COMDemo hwnd,msg,wparam,lparam
|
||||
push ebx esi edi
|
||||
cmp [msg],WM_INITDIALOG
|
||||
je .wminitdialog
|
||||
cmp [msg],WM_COMMAND
|
||||
je .wmcommand
|
||||
cmp [msg],WM_CLOSE
|
||||
je .wmclose
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wminitdialog:
|
||||
jmp .processed
|
||||
.wmcommand:
|
||||
cmp [wparam],BN_CLICKED shl 16 + ID_EXIT
|
||||
je .wmclose
|
||||
cmp [wparam],BN_CLICKED shl 16 + ID_SHOW
|
||||
je .show
|
||||
cmp [wparam],BN_CLICKED shl 16 + ID_HIDE
|
||||
jne .processed
|
||||
.hide:
|
||||
cominvk ShellTaskBar,HrInit
|
||||
cominvk ShellTaskBar,DeleteTab,[hwnd]
|
||||
jmp .processed
|
||||
.show:
|
||||
mov ebx,[ShellTaskBar]
|
||||
comcall ebx,ITaskBarList,HrInit
|
||||
comcall ebx,ITaskBarList,AddTab,[hwnd]
|
||||
comcall ebx,ITaskBarList,ActivateTab,[hwnd]
|
||||
jmp .processed
|
||||
.wmclose:
|
||||
invoke EndDialog,[hwnd],0
|
||||
.processed:
|
||||
mov eax,1
|
||||
.finish:
|
||||
pop edi esi ebx
|
||||
ret
|
||||
endp
|
||||
|
||||
section '.data' data readable writeable
|
||||
|
||||
CLSID_TaskbarList GUID 56FDF344-FD6D-11D0-958A-006097C9A090
|
||||
IID_ITaskbarList GUID 56FDF342-FD6D-11D0-958A-006097C9A090
|
||||
|
||||
ShellTaskBar ITaskBarList
|
||||
|
||||
section '.idata' import data readable
|
||||
|
||||
library kernel,'KERNEL32.DLL',\
|
||||
user,'USER32.DLL',\
|
||||
ole,'OLE32.DLL'
|
||||
|
||||
import kernel,\
|
||||
GetModuleHandle,'GetModuleHandleA',\
|
||||
ExitProcess,'ExitProcess'
|
||||
|
||||
import user,\
|
||||
DialogBoxParam,'DialogBoxParamA',\
|
||||
EndDialog,'EndDialog'
|
||||
|
||||
import ole,\
|
||||
CoInitialize,'CoInitialize',\
|
||||
CoCreateInstance,'CoCreateInstance'
|
||||
|
||||
section '.rsrc' resource data readable
|
||||
|
||||
directory RT_DIALOG,dialogs
|
||||
|
||||
resource dialogs,\
|
||||
IDD_COMDEMO,LANG_ENGLISH+SUBLANG_DEFAULT,comdemo
|
||||
|
||||
dialog comdemo,'Taskbar item control',70,70,170,24,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME
|
||||
dialogitem 'BUTTON','Show',ID_SHOW,4,4,45,15,WS_VISIBLE+WS_TABSTOP
|
||||
dialogitem 'BUTTON','Hide',ID_HIDE,54,4,45,15,WS_VISIBLE+WS_TABSTOP
|
||||
dialogitem 'BUTTON','Exit',ID_EXIT,120,4,45,15,WS_VISIBLE+WS_TABSTOP
|
||||
enddialog
|
27
toolchain/fasmw17332/EXAMPLES/WIN64/DLL/MSGDEMO.ASM
Normal file
27
toolchain/fasmw17332/EXAMPLES/WIN64/DLL/MSGDEMO.ASM
Normal file
@ -0,0 +1,27 @@
|
||||
format PE64 console
|
||||
entry start
|
||||
|
||||
include 'win64a.inc'
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
sub rsp,8
|
||||
|
||||
invoke WriteMessage,message
|
||||
|
||||
invoke ExitProcess,0
|
||||
|
||||
section '.data' data readable
|
||||
|
||||
message db "Hi! I'm the example program!",0
|
||||
|
||||
section '.idata' import data readable writeable
|
||||
|
||||
library kernel32,'KERNEL32.DLL',\
|
||||
writemsg,'WRITEMSG.DLL'
|
||||
|
||||
include 'api/kernel32.inc'
|
||||
|
||||
import writemsg,\
|
||||
WriteMessage,'WriteMessage'
|
47
toolchain/fasmw17332/EXAMPLES/WIN64/DLL/WRITEMSG.ASM
Normal file
47
toolchain/fasmw17332/EXAMPLES/WIN64/DLL/WRITEMSG.ASM
Normal file
@ -0,0 +1,47 @@
|
||||
format PE64 console DLL
|
||||
entry DllEntryPoint
|
||||
|
||||
include 'win64a.inc'
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
proc DllEntryPoint hinstDLL,fdwReason,lpvReserved
|
||||
mov eax,TRUE
|
||||
ret
|
||||
endp
|
||||
|
||||
proc WriteMessage uses rbx rsi rdi, message
|
||||
mov rdi,rcx ; first parameter passed in RCX
|
||||
invoke GetStdHandle,STD_OUTPUT_HANDLE
|
||||
mov rbx,rax
|
||||
xor al,al
|
||||
or rcx,-1
|
||||
repne scasb
|
||||
dec rdi
|
||||
mov r8,-2
|
||||
sub r8,rcx
|
||||
sub rdi,r8
|
||||
invoke WriteFile,rbx,rdi,r8,bytes_count,0
|
||||
ret
|
||||
endp
|
||||
|
||||
section '.bss' data readable writeable
|
||||
|
||||
bytes_count dd ?
|
||||
|
||||
section '.edata' export data readable
|
||||
|
||||
export 'WRITEMSG.DLL',\
|
||||
WriteMessage,'WriteMessage'
|
||||
|
||||
section '.reloc' fixups data readable discardable
|
||||
|
||||
if $=$$
|
||||
dd 0,8 ; if there are no fixups, generate dummy entry
|
||||
end if
|
||||
|
||||
section '.idata' import data readable writeable
|
||||
|
||||
library kernel32,'KERNEL32.DLL'
|
||||
|
||||
include 'api/kernel32.inc'
|
425
toolchain/fasmw17332/EXAMPLES/WIN64/MANDEL/DDRAW64.INC
Normal file
425
toolchain/fasmw17332/EXAMPLES/WIN64/MANDEL/DDRAW64.INC
Normal file
@ -0,0 +1,425 @@
|
||||
|
||||
; DirectDraw interface
|
||||
|
||||
interface DirectDraw,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
Compact,\
|
||||
CreateClipper,\
|
||||
CreatePalette,\
|
||||
CreateSurface,\
|
||||
DuplicateSurface,\
|
||||
EnumDisplayModes,\
|
||||
EnumSurfaces,\
|
||||
FlipToGDISurface,\
|
||||
GetCaps,\
|
||||
GetDisplayMode,\
|
||||
GetFourCCCodes,\
|
||||
GetGDISurface,\
|
||||
GetMonitorFrequency,\
|
||||
GetScanLine,\
|
||||
GetVerticalBlankStatus,\
|
||||
Initialize,\
|
||||
RestoreDisplayMode,\
|
||||
SetCooperativeLevel,\
|
||||
SetDisplayMode,\
|
||||
WaitForVerticalBlank,\
|
||||
GetAvailableVidMem,\
|
||||
GetSurfaceFromDC,\
|
||||
RestoreAllSurfaces,\
|
||||
TestCooperativeLevel,\
|
||||
GetDeviceIdentifier,\
|
||||
StartModeTest,\
|
||||
EvaluateMode
|
||||
|
||||
interface DirectDrawSurface,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
AddAttachedSurface,\
|
||||
AddOverlayDirtyRect,\
|
||||
Blt,\
|
||||
BltBatch,\
|
||||
BltFast,\
|
||||
DeleteAttachedSurface,\
|
||||
EnumAttachedSurfaces,\
|
||||
EnumOverlayZOrders,\
|
||||
Flip,\
|
||||
GetAttachedSurface,\
|
||||
GetBltStatus,\
|
||||
GetCaps,\
|
||||
GetClipper,\
|
||||
GetColorKey,\
|
||||
GetDC,\
|
||||
GetFlipStatus,\
|
||||
GetOverlayPosition,\
|
||||
GetPalette,\
|
||||
GetPixelFormat,\
|
||||
GetSurfaceDesc,\
|
||||
Initialize,\
|
||||
IsLost,\
|
||||
Lock,\
|
||||
ReleaseDC,\
|
||||
Restore,\
|
||||
SetClipper,\
|
||||
SetColorKey,\
|
||||
SetOverlayPosition,\
|
||||
SetPalette,\
|
||||
Unlock,\
|
||||
UpdateOverlay,\
|
||||
UpdateOverlayDisplay,\
|
||||
UpdateOverlayZOrder,\
|
||||
GetDDInterface,\
|
||||
PageLock,\
|
||||
PageUnlock,\
|
||||
SetSurfaceDesc,\
|
||||
SetPrivateData,\
|
||||
GetPrivateData,\
|
||||
FreePrivateData,\
|
||||
GetUniquenessValue,\
|
||||
ChangeUniquenessValue,\
|
||||
SetPriority,\
|
||||
GetPriority,\
|
||||
SetLOD,\
|
||||
GetLOD
|
||||
|
||||
interface DirectDrawPalette,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
GetCaps,\
|
||||
GetEntries,\
|
||||
Initialize,\
|
||||
SetEntries
|
||||
|
||||
interface DirectDrawClipper,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
GetClipList,\
|
||||
GetHWnd,\
|
||||
Initialize,\
|
||||
IsClipListChanged,\
|
||||
SetClipList,\
|
||||
SetHWnd
|
||||
|
||||
interface DirectDrawColorControl,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
GetColorControls,\
|
||||
SetColorControls
|
||||
|
||||
interface DirectDrawGammaControl,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
GetGammaRamp,\
|
||||
SetGammaRamp
|
||||
|
||||
struct DDCOLORKEY
|
||||
dwColorSpaceLowValue dd ?
|
||||
dwColorSpaceHighValue dd ?
|
||||
ends
|
||||
|
||||
struct DDPIXELFORMAT
|
||||
dwSize dd ?
|
||||
dwFlags dd ?
|
||||
dwFourCC dd ?
|
||||
union
|
||||
dwRGBBitCount dd ?
|
||||
dwYUVBitCount dd ?
|
||||
dwZBufferBitDepth dd ?
|
||||
dwAlphaBitDepth dd ?
|
||||
dwLuminanceBitCount dd ?
|
||||
dwBumpBitCount dd ?
|
||||
ends
|
||||
union
|
||||
dwRBitMask dd ?
|
||||
dwYBitMask dd ?
|
||||
dwStencilBitDepth dd ?
|
||||
dwLuminanceBitMask dd ?
|
||||
dwBumpDuBitMask dd ?
|
||||
ends
|
||||
union
|
||||
dwGBitMask dd ?
|
||||
dwUBitMask dd ?
|
||||
dwZBitMask dd ?
|
||||
dwBumpDvBitMask dd ?
|
||||
ends
|
||||
union
|
||||
dwBBitMask dd ?
|
||||
dwVBitMask dd ?
|
||||
dwStencilBitMask dd ?
|
||||
dwBumpLuminanceBitMask dd ?
|
||||
ends
|
||||
union
|
||||
dwRGBAlphaBitMask dd ?
|
||||
dwYUVAlphaBitMask dd ?
|
||||
dwLuminanceAlphaBitMask dd ?
|
||||
dwRGBZBitMask dd ?
|
||||
dwYUVZBitMask dd ?
|
||||
ends
|
||||
ends
|
||||
|
||||
struct DDSCAPS
|
||||
dwCaps dd ?
|
||||
ends
|
||||
|
||||
struct DDSURFACEDESC
|
||||
dwSize dd ?
|
||||
dwFlags dd ?
|
||||
dwHeight dd ?
|
||||
dwWidth dd ?
|
||||
union
|
||||
lPitch dd ?
|
||||
dwLinearSize dd ?
|
||||
ends
|
||||
dwBackBufferCount dd ?
|
||||
union
|
||||
dwMipMapCount dd ?
|
||||
dwZBufferBitDepth dd ?
|
||||
dwRefreshRate dd ?
|
||||
ends
|
||||
dwAlphaBitDepth dd ?
|
||||
dwReserved dd ?,?
|
||||
lpSurface dq ?
|
||||
ddckCKDestOverlay DDCOLORKEY
|
||||
ddckCKDestBlt DDCOLORKEY
|
||||
ddckCKSrcOverlay DDCOLORKEY
|
||||
ddckCKSrcBlt DDCOLORKEY
|
||||
ddpfPixelFormat DDPIXELFORMAT
|
||||
ddsCaps DDSCAPS
|
||||
dd ?
|
||||
ends
|
||||
|
||||
; SetCooperativeLevel flags
|
||||
|
||||
DDSCL_FULLSCREEN = 000000001h
|
||||
DDSCL_ALLOWREBOOT = 000000002h
|
||||
DDSCL_NOWINDOWCHANGES = 000000004h
|
||||
DDSCL_NORMAL = 000000008h
|
||||
DDSCL_EXCLUSIVE = 000000010h
|
||||
DDSCL_ALLOWMODEX = 000000040h
|
||||
|
||||
; Blt flags
|
||||
|
||||
DDBLT_ALPHADEST = 000000001h
|
||||
DDBLT_ALPHADESTCONSTOVERRIDE = 000000002h
|
||||
DDBLT_ALPHADESTNEG = 000000004h
|
||||
DDBLT_ALPHADESTSURFACEOVERRIDE = 000000008h
|
||||
DDBLT_ALPHAEDGEBLEND = 000000010h
|
||||
DDBLT_ALPHASRC = 000000020h
|
||||
DDBLT_ALPHASRCCONSTOVERRIDE = 000000040h
|
||||
DDBLT_ALPHASRCNEG = 000000080h
|
||||
DDBLT_ALPHASRCSURFACEOVERRIDE = 000000100h
|
||||
DDBLT_ASYNC = 000000200h
|
||||
DDBLT_COLORFILL = 000000400h
|
||||
DDBLT_DDFX = 000000800h
|
||||
DDBLT_DDROPS = 000001000h
|
||||
DDBLT_KEYDEST = 000002000h
|
||||
DDBLT_KEYDESTOVERRIDE = 000004000h
|
||||
DDBLT_KEYSRC = 000008000h
|
||||
DDBLT_KEYSRCOVERRIDE = 000010000h
|
||||
DDBLT_ROP = 000020000h
|
||||
DDBLT_ROTATIONANGLE = 000040000h
|
||||
DDBLT_ZBUFFER = 000080000h
|
||||
DDBLT_ZBUFFERDESTCONSTOVERRIDE = 000100000h
|
||||
DDBLT_ZBUFFERDESTOVERRIDE = 000200000h
|
||||
DDBLT_ZBUFFERSRCCONSTOVERRIDE = 000400000h
|
||||
DDBLT_ZBUFFERSRCOVERRIDE = 000800000h
|
||||
DDBLT_WAIT = 001000000h
|
||||
DDBLT_DEPTHFILL = 002000000h
|
||||
|
||||
; BltFast flags
|
||||
|
||||
DDBLTFAST_NOCOLORKEY = 000000000h
|
||||
DDBLTFAST_SRCCOLORKEY = 000000001h
|
||||
DDBLTFAST_DESTCOLORKEY = 000000002h
|
||||
DDBLTFAST_WAIT = 000000010h
|
||||
|
||||
; Flip flags
|
||||
|
||||
DDFLIP_WAIT = 000000001h
|
||||
DDFLIP_EVEN = 000000002h
|
||||
DDFLIP_ODD = 000000004h
|
||||
|
||||
; DDSURFACEDESC field flags
|
||||
|
||||
DDSD_CAPS = 000000001h
|
||||
DDSD_HEIGHT = 000000002h
|
||||
DDSD_WIDTH = 000000004h
|
||||
DDSD_PITCH = 000000008h
|
||||
DDSD_BACKBUFFERCOUNT = 000000020h
|
||||
DDSD_ZBUFFERBITDEPTH = 000000040h
|
||||
DDSD_ALPHABITDEPTH = 000000080h
|
||||
DDSD_LPSURFACE = 000000800h
|
||||
DDSD_PIXELFORMAT = 000001000h
|
||||
DDSD_CKDESTOVERLAY = 000002000h
|
||||
DDSD_CKDESTBLT = 000004000h
|
||||
DDSD_CKSRCOVERLAY = 000008000h
|
||||
DDSD_CKSRCBLT = 000010000h
|
||||
DDSD_MIPMAPCOUNT = 000020000h
|
||||
DDSD_REFRESHRATE = 000040000h
|
||||
DDSD_LINEARSIZE = 000080000h
|
||||
DDSD_ALL = 0000FF9EEh
|
||||
|
||||
; DirectDrawSurface capability flags
|
||||
|
||||
DDSCAPS_RESERVED1 = 000000001h
|
||||
DDSCAPS_ALPHA = 000000002h
|
||||
DDSCAPS_BACKBUFFER = 000000004h
|
||||
DDSCAPS_COMPLEX = 000000008h
|
||||
DDSCAPS_FLIP = 000000010h
|
||||
DDSCAPS_FRONTBUFFER = 000000020h
|
||||
DDSCAPS_OFFSCREENPLAIN = 000000040h
|
||||
DDSCAPS_OVERLAY = 000000080h
|
||||
DDSCAPS_PALETTE = 000000100h
|
||||
DDSCAPS_PRIMARYSURFACE = 000000200h
|
||||
DDSCAPS_PRIMARYSURFACELEFT = 000000400h
|
||||
DDSCAPS_SYSTEMMEMORY = 000000800h
|
||||
DDSCAPS_TEXTURE = 000001000h
|
||||
DDSCAPS_3DDEVICE = 000002000h
|
||||
DDSCAPS_VIDEOMEMORY = 000004000h
|
||||
DDSCAPS_VISIBLE = 000008000h
|
||||
DDSCAPS_WRITEONLY = 000010000h
|
||||
DDSCAPS_ZBUFFER = 000020000h
|
||||
DDSCAPS_OWNDC = 000040000h
|
||||
DDSCAPS_LIVEVIDEO = 000080000h
|
||||
DDSCAPS_HWCODEC = 000100000h
|
||||
DDSCAPS_MODEX = 000200000h
|
||||
DDSCAPS_MIPMAP = 000400000h
|
||||
DDSCAPS_RESERVED2 = 000800000h
|
||||
DDSCAPS_ALLOCONLOAD = 004000000h
|
||||
DDSCAPS_VIDEOPORT = 008000000h
|
||||
DDSCAPS_LOCALVIDMEM = 010000000h
|
||||
DDSCAPS_NONLOCALVIDMEM = 020000000h
|
||||
DDSCAPS_STANDARDVGAMODE = 040000000h
|
||||
DDSCAPS_OPTIMIZED = 080000000h
|
||||
|
||||
; DirectDrawSurface lock flags
|
||||
|
||||
DDLOCK_SURFACEMEMORYPTR = 000000000h
|
||||
DDLOCK_WAIT = 000000001h
|
||||
DDLOCK_EVENT = 000000002h
|
||||
DDLOCK_READONLY = 000000010h
|
||||
DDLOCK_WRITEONLY = 000000020h
|
||||
DDLOCK_NOSYSLOCK = 000000800h
|
||||
|
||||
; DirectDrawPalette capabilities
|
||||
|
||||
DDPCAPS_4BIT = 000000001h
|
||||
DDPCAPS_8BITENTRIES = 000000002h
|
||||
DDPCAPS_8BIT = 000000004h
|
||||
DDPCAPS_INITIALIZE = 000000008h
|
||||
DDPCAPS_PRIMARYSURFACE = 000000010h
|
||||
DDPCAPS_PRIMARYSURFACELEFT = 000000020h
|
||||
DDPCAPS_ALLOW256 = 000000040h
|
||||
DDPCAPS_VSYNC = 000000080h
|
||||
DDPCAPS_1BIT = 000000100h
|
||||
DDPCAPS_2BIT = 000000200h
|
||||
|
||||
; DirectDraw errors
|
||||
|
||||
DDERR_ALREADYINITIALIZED = 088760000h+5
|
||||
DDERR_CANNOTATTACHSURFACE = 088760000h+10
|
||||
DDERR_CANNOTDETACHSURFACE = 088760000h+20
|
||||
DDERR_CURRENTLYNOTAVAIL = 088760000h+40
|
||||
DDERR_EXCEPTION = 088760000h+55
|
||||
DDERR_HEIGHTALIGN = 088760000h+90
|
||||
DDERR_INCOMPATIBLEPRIMARY = 088760000h+95
|
||||
DDERR_INVALIDCAPS = 088760000h+100
|
||||
DDERR_INVALIDCLIPLIST = 088760000h+110
|
||||
DDERR_INVALIDMODE = 088760000h+120
|
||||
DDERR_INVALIDOBJECT = 088760000h+130
|
||||
DDERR_INVALIDPIXELFORMAT = 088760000h+145
|
||||
DDERR_INVALIDRECT = 088760000h+150
|
||||
DDERR_LOCKEDSURFACES = 088760000h+160
|
||||
DDERR_NO3D = 088760000h+170
|
||||
DDERR_NOALPHAHW = 088760000h+180
|
||||
DDERR_NOCLIPLIST = 088760000h+205
|
||||
DDERR_NOCOLORCONVHW = 088760000h+210
|
||||
DDERR_NOCOOPERATIVELEVELSET = 088760000h+212
|
||||
DDERR_NOCOLORKEY = 088760000h+215
|
||||
DDERR_NOCOLORKEYHW = 088760000h+220
|
||||
DDERR_NODIRECTDRAWSUPPORT = 088760000h+222
|
||||
DDERR_NOEXCLUSIVEMODE = 088760000h+225
|
||||
DDERR_NOFLIPHW = 088760000h+230
|
||||
DDERR_NOGDI = 088760000h+240
|
||||
DDERR_NOMIRRORHW = 088760000h+250
|
||||
DDERR_NOTFOUND = 088760000h+255
|
||||
DDERR_NOOVERLAYHW = 088760000h+260
|
||||
DDERR_NORASTEROPHW = 088760000h+280
|
||||
DDERR_NOROTATIONHW = 088760000h+290
|
||||
DDERR_NOSTRETCHHW = 088760000h+310
|
||||
DDERR_NOT4BITCOLOR = 088760000h+316
|
||||
DDERR_NOT4BITCOLORINDEX = 088760000h+317
|
||||
DDERR_NOT8BITCOLOR = 088760000h+320
|
||||
DDERR_NOTEXTUREHW = 088760000h+330
|
||||
DDERR_NOVSYNCHW = 088760000h+335
|
||||
DDERR_NOZBUFFERHW = 088760000h+340
|
||||
DDERR_NOZOVERLAYHW = 088760000h+350
|
||||
DDERR_OUTOFCAPS = 088760000h+360
|
||||
DDERR_OUTOFVIDEOMEMORY = 088760000h+380
|
||||
DDERR_OVERLAYCANTCLIP = 088760000h+382
|
||||
DDERR_OVERLAYCOLORKEYONLYONEACTI = 088760000h+384
|
||||
DDERR_PALETTEBUSY = 088760000h+387
|
||||
DDERR_COLORKEYNOTSET = 088760000h+400
|
||||
DDERR_SURFACEALREADYATTACHED = 088760000h+410
|
||||
DDERR_SURFACEALREADYDEPENDENT = 088760000h+420
|
||||
DDERR_SURFACEBUSY = 088760000h+430
|
||||
DDERR_CANTLOCKSURFACE = 088760000h+435
|
||||
DDERR_SURFACEISOBSCURED = 088760000h+440
|
||||
DDERR_SURFACELOST = 088760000h+450
|
||||
DDERR_SURFACENOTATTACHED = 088760000h+460
|
||||
DDERR_TOOBIGHEIGHT = 088760000h+470
|
||||
DDERR_TOOBIGSIZE = 088760000h+480
|
||||
DDERR_TOOBIGWIDTH = 088760000h+490
|
||||
DDERR_UNSUPPORTEDFORMAT = 088760000h+510
|
||||
DDERR_UNSUPPORTEDMASK = 088760000h+520
|
||||
DDERR_VERTICALBLANKINPROGRESS = 088760000h+537
|
||||
DDERR_WASSTILLDRAWING = 088760000h+540
|
||||
DDERR_XALIGN = 088760000h+560
|
||||
DDERR_INVALIDDIRECTDRAWGUID = 088760000h+561
|
||||
DDERR_DIRECTDRAWALREADYCREATED = 088760000h+562
|
||||
DDERR_NODIRECTDRAWHW = 088760000h+563
|
||||
DDERR_PRIMARYSURFACEALREADYEXIST = 088760000h+564
|
||||
DDERR_NOEMULATION = 088760000h+565
|
||||
DDERR_REGIONTOOSMALL = 088760000h+566
|
||||
DDERR_CLIPPERISUSINGHWND = 088760000h+567
|
||||
DDERR_NOCLIPPERATTACHED = 088760000h+568
|
||||
DDERR_NOHWND = 088760000h+569
|
||||
DDERR_HWNDSUBCLASSED = 088760000h+570
|
||||
DDERR_HWNDALREADYSET = 088760000h+571
|
||||
DDERR_NOPALETTEATTACHED = 088760000h+572
|
||||
DDERR_NOPALETTEHW = 088760000h+573
|
||||
DDERR_BLTFASTCANTCLIP = 088760000h+574
|
||||
DDERR_NOBLTHW = 088760000h+575
|
||||
DDERR_NODDROPSHW = 088760000h+576
|
||||
DDERR_OVERLAYNOTVISIBLE = 088760000h+577
|
||||
DDERR_NOOVERLAYDEST = 088760000h+578
|
||||
DDERR_INVALIDPOSITION = 088760000h+579
|
||||
DDERR_NOTAOVERLAYSURFACE = 088760000h+580
|
||||
DDERR_EXCLUSIVEMODEALREADYSET = 088760000h+581
|
||||
DDERR_NOTFLIPPABLE = 088760000h+582
|
||||
DDERR_CANTDUPLICATE = 088760000h+583
|
||||
DDERR_NOTLOCKED = 088760000h+584
|
||||
DDERR_CANTCREATEDC = 088760000h+585
|
||||
DDERR_NODC = 088760000h+586
|
||||
DDERR_WRONGMODE = 088760000h+587
|
||||
DDERR_IMPLICITLYCREATED = 088760000h+588
|
||||
DDERR_NOTPALETTIZED = 088760000h+589
|
||||
DDERR_UNSUPPORTEDMODE = 088760000h+590
|
||||
DDERR_NOMIPMAPHW = 088760000h+591
|
||||
DDERR_INVALIDSURFACETYPE = 088760000h+592
|
||||
DDERR_NOOPTIMIZEHW = 088760000h+600
|
||||
DDERR_NOTLOADED = 088760000h+601
|
||||
DDERR_DCALREADYCREATED = 088760000h+620
|
||||
DDERR_NONONLOCALVIDMEM = 088760000h+630
|
||||
DDERR_CANTPAGELOCK = 088760000h+640
|
||||
DDERR_CANTPAGEUNLOCK = 088760000h+660
|
||||
DDERR_NOTPAGELOCKED = 088760000h+680
|
||||
DDERR_MOREDATA = 088760000h+690
|
||||
DDERR_VIDEONOTACTIVE = 088760000h+695
|
||||
DDERR_DEVICEDOESNTOWNSURFACE = 088760000h+699
|
319
toolchain/fasmw17332/EXAMPLES/WIN64/MANDEL/MANDEL.ASM
Normal file
319
toolchain/fasmw17332/EXAMPLES/WIN64/MANDEL/MANDEL.ASM
Normal file
@ -0,0 +1,319 @@
|
||||
|
||||
format PE64 GUI 5.0
|
||||
entry start
|
||||
|
||||
include 'win64a.inc'
|
||||
include 'ddraw64.inc'
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
|
||||
sub rsp,8
|
||||
|
||||
and [DDraw],0
|
||||
and [DDSPrimary],0
|
||||
and [DDSBack],0
|
||||
|
||||
invoke GetModuleHandle,NULL
|
||||
mov [hinstance],rax
|
||||
mov [wc.hInstance],rax
|
||||
|
||||
invoke LoadIcon,NULL,IDI_APPLICATION
|
||||
mov [wc.hIcon],rax
|
||||
invoke LoadCursor,NULL,IDC_ARROW
|
||||
mov [wc.hCursor],rax
|
||||
invoke RegisterClassEx,wc
|
||||
test rax,rax
|
||||
jz startup_error
|
||||
|
||||
invoke CreateWindowEx,\
|
||||
0,_class,_title,WS_POPUP+WS_VISIBLE,0,0,0,0,NULL,NULL,[hinstance],NULL
|
||||
test rax,rax
|
||||
jz startup_error
|
||||
mov [hwnd],rax
|
||||
|
||||
invoke DirectDrawCreate,NULL,DDraw,NULL
|
||||
test rax,rax
|
||||
jnz ddraw_error
|
||||
|
||||
cominvk DDraw,SetCooperativeLevel,\
|
||||
[hwnd],DDSCL_EXCLUSIVE+DDSCL_FULLSCREEN
|
||||
test rax,rax
|
||||
jnz ddraw_error
|
||||
|
||||
cominvk DDraw,SetDisplayMode,\
|
||||
640,480,32
|
||||
test rax,rax
|
||||
jnz ddraw_error
|
||||
|
||||
mov [ddsd.dwSize],sizeof.DDSURFACEDESC
|
||||
mov [ddsd.dwFlags],DDSD_CAPS+DDSD_BACKBUFFERCOUNT
|
||||
mov [ddsd.ddsCaps.dwCaps],DDSCAPS_PRIMARYSURFACE+DDSCAPS_FLIP+DDSCAPS_COMPLEX
|
||||
mov [ddsd.dwBackBufferCount],1
|
||||
cominvk DDraw,CreateSurface,\
|
||||
ddsd,DDSPrimary,NULL
|
||||
or eax,eax
|
||||
jnz ddraw_error
|
||||
|
||||
mov [ddscaps.dwCaps],DDSCAPS_BACKBUFFER
|
||||
cominvk DDSPrimary,GetAttachedSurface,\
|
||||
ddscaps,DDSBack
|
||||
or eax,eax
|
||||
jnz ddraw_error
|
||||
|
||||
refresh:
|
||||
|
||||
cominvk DDSPrimary,IsLost
|
||||
test rax,rax
|
||||
jz paint
|
||||
cmp eax,DDERR_SURFACELOST
|
||||
jne end_loop
|
||||
cominvk DDSPrimary,Restore
|
||||
|
||||
paint:
|
||||
mov [ddsd.dwSize],sizeof.DDSURFACEDESC
|
||||
mov [ddsd.dwFlags],0
|
||||
cominvk DDSBack,Lock,NULL,ddsd,DDLOCK_SURFACEMEMORYPTR+DDLOCK_WAIT,NULL
|
||||
test rax,rax
|
||||
jnz main_loop
|
||||
mov rdi,[ddsd.lpSurface]
|
||||
mov r10d,[ddsd.lPitch]
|
||||
xor edx,edx
|
||||
movsd xmm8,[y_top]
|
||||
screen:
|
||||
xor ebx,ebx
|
||||
movsd xmm7,[x_left]
|
||||
unpcklpd xmm7,xmm8
|
||||
row:
|
||||
mov rcx,255
|
||||
xorpd xmm1,xmm1
|
||||
iterate:
|
||||
|
||||
movapd xmm3,xmm1
|
||||
unpckhpd xmm3,xmm3
|
||||
mulsd xmm3,xmm1
|
||||
addsd xmm3,xmm3
|
||||
|
||||
mulpd xmm1,xmm1
|
||||
movapd xmm2,xmm1 ; for SSE3-capable processor
|
||||
unpckhpd xmm2,xmm2 ; these three instructions can be
|
||||
subsd xmm1,xmm2 ; replaced with HSUBPD XMM1,XMM1
|
||||
unpcklpd xmm1,xmm3
|
||||
addpd xmm1,xmm7
|
||||
|
||||
movapd xmm0,xmm1
|
||||
mulpd xmm0,xmm0
|
||||
movapd xmm2,xmm0 ; for SSE3-capable processor
|
||||
shufpd xmm2,xmm2,1 ; these three instructions can be
|
||||
addsd xmm0,xmm2 ; replaced with HADDPD XMM0,XMM0
|
||||
sqrtpd xmm0,xmm0
|
||||
comisd xmm0,[limit]
|
||||
ja over
|
||||
|
||||
loop iterate
|
||||
over:
|
||||
xor al,al
|
||||
stosb
|
||||
mov al,cl
|
||||
stosb
|
||||
ror al,3
|
||||
stosb
|
||||
stosb
|
||||
|
||||
movsd xmm0,[x_step]
|
||||
addpd xmm7,xmm0
|
||||
inc ebx
|
||||
cmp ebx,640
|
||||
jb row
|
||||
sub rdi,640*4
|
||||
add rdi,r10
|
||||
subsd xmm8,[y_step]
|
||||
inc edx
|
||||
cmp edx,480
|
||||
jb screen
|
||||
|
||||
mov [refresh_needed],0
|
||||
cominvk DDSBack,Unlock,NULL
|
||||
cominvk DDSPrimary,Flip,0,0
|
||||
|
||||
main_loop:
|
||||
|
||||
invoke PeekMessage,msg,NULL,0,0,PM_NOREMOVE
|
||||
or eax,eax
|
||||
jz no_message
|
||||
invoke GetMessage,msg,NULL,0,0
|
||||
cmp eax,1
|
||||
jb end_loop
|
||||
jne no_message
|
||||
invoke TranslateMessage,msg
|
||||
invoke DispatchMessage,msg
|
||||
|
||||
cmp [refresh_needed],0
|
||||
jne refresh
|
||||
|
||||
jmp main_loop
|
||||
|
||||
no_message:
|
||||
invoke WaitMessage
|
||||
jmp main_loop
|
||||
|
||||
ddraw_error:
|
||||
invoke wsprintf,buffer,_ddraw_error,rax
|
||||
invoke MessageBox,[hwnd],buffer,_error,MB_OK+MB_ICONERROR
|
||||
invoke DestroyWindow,[hwnd]
|
||||
invoke PostQuitMessage,2
|
||||
jmp main_loop
|
||||
|
||||
startup_error:
|
||||
invoke MessageBox,[hwnd],_startup_error,_error,MB_OK+MB_ICONERROR
|
||||
invoke ExitProcess,1
|
||||
|
||||
end_loop:
|
||||
cominvk DDraw,RestoreDisplayMode
|
||||
|
||||
cmp [DDSBack],0
|
||||
je back_surface_released
|
||||
cominvk DDSPrimary,DeleteAttachedSurface,0,DDSBack
|
||||
back_surface_released:
|
||||
cmp [DDSPrimary],0
|
||||
je primary_surface_released
|
||||
cominvk DDSPrimary,Release
|
||||
primary_surface_released:
|
||||
cmp [DDraw],0
|
||||
je ddraw_released
|
||||
cominvk DDraw,Release
|
||||
ddraw_released:
|
||||
|
||||
invoke ExitProcess,[msg.wParam]
|
||||
|
||||
proc WindowProc uses rbx rsi rdi, hwnd,wmsg,wparam,lparam
|
||||
cmp edx,WM_CREATE
|
||||
je .wmcreate
|
||||
cmp edx,WM_DESTROY
|
||||
je .wmdestroy
|
||||
cmp edx,WM_LBUTTONDOWN
|
||||
je .wmlbuttondown
|
||||
cmp edx,WM_RBUTTONDOWN
|
||||
je .wmrbuttondown
|
||||
cmp edx,WM_KEYDOWN
|
||||
je .wmkeydown
|
||||
cmp edx,WM_ACTIVATE
|
||||
je .wmactivate
|
||||
.defwindowproc:
|
||||
invoke DefWindowProc,rcx,rdx,r8,r9
|
||||
jmp .finish
|
||||
.wmcreate:
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wmactivate:
|
||||
test r8,r8
|
||||
jz .finish
|
||||
or [refresh_needed],1
|
||||
jmp .finish
|
||||
.wmlbuttondown:
|
||||
movapd xmm0,[step]
|
||||
divpd xmm0,[zoom]
|
||||
movapd xmm1,xmm0
|
||||
subpd xmm1,[step]
|
||||
movapd [step],xmm0
|
||||
movzx eax,r9w
|
||||
cvtsi2sd xmm3,eax
|
||||
shr r9,16
|
||||
movzx eax,r9w
|
||||
cvtsi2sd xmm4,eax
|
||||
unpcklpd xmm3,xmm4
|
||||
mulpd xmm1,xmm3
|
||||
xorpd xmm1,[negate]
|
||||
addpd xmm1,[origin]
|
||||
movapd [origin],xmm1
|
||||
or [refresh_needed],1
|
||||
jmp .finish
|
||||
.wmrbuttondown:
|
||||
movapd xmm0,[step]
|
||||
mulpd xmm0,[zoom]
|
||||
movapd xmm1,xmm0
|
||||
subpd xmm1,[step]
|
||||
movapd [step],xmm0
|
||||
movzx eax,r9w
|
||||
cvtsi2sd xmm3,eax
|
||||
shr r9,16
|
||||
movzx eax,r9w
|
||||
cvtsi2sd xmm4,eax
|
||||
unpcklpd xmm3,xmm4
|
||||
mulpd xmm1,xmm3
|
||||
xorpd xmm1,[negate]
|
||||
addpd xmm1,[origin]
|
||||
movapd [origin],xmm1
|
||||
or [refresh_needed],1
|
||||
jmp .finish
|
||||
.wmkeydown:
|
||||
cmp r8d,VK_ESCAPE
|
||||
jne .finish
|
||||
.wmdestroy:
|
||||
invoke PostQuitMessage,0
|
||||
xor eax,eax
|
||||
.finish:
|
||||
ret
|
||||
endp
|
||||
|
||||
section '.data' data readable writeable
|
||||
|
||||
wc WNDCLASSEX sizeof.WNDCLASSEX,0,WindowProc,0,0,NULL,NULL,NULL,NULL,NULL,_class,NULL
|
||||
|
||||
_title db 'flat assembler DirectDraw application',0
|
||||
_class db 'FDDRAW64',0
|
||||
|
||||
_error db 'Error',0
|
||||
_startup_error db 'Startup failed',0
|
||||
_ddraw_error db 'Direct Draw initialization failed (error code 0x%x).',0
|
||||
|
||||
align 16 ; SSE data follows
|
||||
|
||||
label origin dqword
|
||||
x_left dq -2.2
|
||||
y_top dq 1.25
|
||||
|
||||
label step dqword
|
||||
x_step dq 0.0045
|
||||
y_step dq 0.0052
|
||||
|
||||
label zoom dqword
|
||||
dq 1.2,1.2
|
||||
|
||||
label negate dqword
|
||||
dq 8000000000000000h,0
|
||||
|
||||
limit dq 2.5
|
||||
|
||||
section '.bss' readable writeable
|
||||
|
||||
hinstance dq ?
|
||||
hwnd dq ?
|
||||
msg MSG
|
||||
|
||||
ddsd DDSURFACEDESC
|
||||
ddscaps DDSCAPS
|
||||
|
||||
DDraw DirectDraw
|
||||
DDSPrimary DirectDrawSurface
|
||||
DDSBack DirectDrawSurface
|
||||
|
||||
rect RECT
|
||||
|
||||
refresh_needed dd ?
|
||||
|
||||
buffer rb 100h
|
||||
|
||||
|
||||
section '.idata' import data readable
|
||||
|
||||
library kernel32,'KERNEL32.DLL',\
|
||||
user32,'USER32.DLL',\
|
||||
ddraw,'DDRAW.DLL'
|
||||
|
||||
include 'api\kernel32.inc'
|
||||
include 'api\user32.inc'
|
||||
|
||||
import ddraw,\
|
||||
DirectDrawCreate,'DirectDrawCreate'
|
615
toolchain/fasmw17332/EXAMPLES/WIN64/OPENGL/OPENGL.ASM
Normal file
615
toolchain/fasmw17332/EXAMPLES/WIN64/OPENGL/OPENGL.ASM
Normal file
@ -0,0 +1,615 @@
|
||||
|
||||
; OpenGL programming example
|
||||
|
||||
format PE64 GUI 5.0
|
||||
entry start
|
||||
|
||||
include 'win64a.inc'
|
||||
|
||||
include '..\..\opengl\opengl.inc'
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
sub rsp,8 ; Make stack dqword aligned
|
||||
|
||||
invoke GetModuleHandle,0
|
||||
mov [wc.hInstance],rax
|
||||
invoke LoadIcon,0,IDI_APPLICATION
|
||||
mov [wc.hIcon],rax
|
||||
invoke LoadCursor,0,IDC_ARROW
|
||||
mov [wc.hCursor],rax
|
||||
invoke RegisterClass,wc
|
||||
invoke CreateWindowEx,0,_class,_title,WS_VISIBLE+WS_OVERLAPPEDWINDOW+WS_CLIPCHILDREN+WS_CLIPSIBLINGS,16,16,432,432,NULL,NULL,[wc.hInstance],NULL
|
||||
|
||||
msg_loop:
|
||||
invoke GetMessage,addr msg,NULL,0,0
|
||||
cmp eax,1
|
||||
jb end_loop
|
||||
jne msg_loop
|
||||
invoke TranslateMessage,addr msg
|
||||
invoke DispatchMessage,addr msg
|
||||
jmp msg_loop
|
||||
|
||||
end_loop:
|
||||
invoke ExitProcess,[msg.wParam]
|
||||
|
||||
proc WindowProc uses rbx rsi rdi, hwnd,wmsg,wparam,lparam
|
||||
mov [hwnd],rcx
|
||||
frame
|
||||
cmp edx,WM_CREATE
|
||||
je .wmcreate
|
||||
cmp edx,WM_SIZE
|
||||
je .wmsize
|
||||
cmp edx,WM_PAINT
|
||||
je .wmpaint
|
||||
cmp edx,WM_KEYDOWN
|
||||
je .wmkeydown
|
||||
cmp edx,WM_DESTROY
|
||||
je .wmdestroy
|
||||
.defwndproc:
|
||||
invoke DefWindowProc,rcx,rdx,r8,r9
|
||||
jmp .finish
|
||||
.wmcreate:
|
||||
invoke GetDC,rcx
|
||||
mov [hdc],rax
|
||||
lea rdi,[pfd]
|
||||
mov rcx,sizeof.PIXELFORMATDESCRIPTOR shr 3
|
||||
xor eax,eax
|
||||
rep stosq
|
||||
mov [pfd.nSize],sizeof.PIXELFORMATDESCRIPTOR
|
||||
mov [pfd.nVersion],1
|
||||
mov [pfd.dwFlags],PFD_SUPPORT_OPENGL+PFD_DOUBLEBUFFER+PFD_DRAW_TO_WINDOW
|
||||
mov [pfd.iLayerType],PFD_MAIN_PLANE
|
||||
mov [pfd.iPixelType],PFD_TYPE_RGBA
|
||||
mov [pfd.cColorBits],16
|
||||
mov [pfd.cDepthBits],16
|
||||
mov [pfd.cAccumBits],0
|
||||
mov [pfd.cStencilBits],0
|
||||
invoke ChoosePixelFormat,[hdc],addr pfd
|
||||
invoke SetPixelFormat,[hdc],eax,addr pfd
|
||||
invoke wglCreateContext,[hdc]
|
||||
mov [hrc],rax
|
||||
invoke wglMakeCurrent,[hdc],[hrc]
|
||||
invoke GetClientRect,[hwnd],addr rc
|
||||
invoke glViewport,0,0,[rc.right],[rc.bottom]
|
||||
invoke GetTickCount
|
||||
mov [clock],eax
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wmsize:
|
||||
invoke GetClientRect,[hwnd],addr rc
|
||||
invoke glViewport,0,0,[rc.right],[rc.bottom]
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wmpaint:
|
||||
invoke GetTickCount
|
||||
sub eax,[clock]
|
||||
cmp eax,10
|
||||
jb .animation_ok
|
||||
add [clock],eax
|
||||
invoke glRotatef,float [theta],float dword 0.0,float dword 0.0,float dword 1.0
|
||||
.animation_ok:
|
||||
invoke glClear,GL_COLOR_BUFFER_BIT
|
||||
invoke glBegin,GL_QUADS
|
||||
invoke glColor3f,float dword 1.0,float dword 0.1,float dword 0.1
|
||||
invoke glVertex3d,float -0.6,float -0.6,float 0.0
|
||||
invoke glColor3f,float dword 0.1,float dword 0.1,float dword 0.1
|
||||
invoke glVertex3d,float 0.6,float -0.6,float 0.0
|
||||
invoke glColor3f,float dword 0.1,float dword 0.1,float dword 1.0
|
||||
invoke glVertex3d,float 0.6,float 0.6,float 0.0
|
||||
invoke glColor3f,float dword 1.0,float dword 0.1,float dword 1.0
|
||||
invoke glVertex3d,float -0.6,float 0.6,float 0.0
|
||||
invoke glEnd
|
||||
invoke SwapBuffers,[hdc]
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wmkeydown:
|
||||
cmp r8d,VK_ESCAPE
|
||||
jne .defwndproc
|
||||
.wmdestroy:
|
||||
invoke wglMakeCurrent,0,0
|
||||
invoke wglDeleteContext,[hrc]
|
||||
invoke ReleaseDC,[hwnd],[hdc]
|
||||
invoke PostQuitMessage,0
|
||||
xor eax,eax
|
||||
.finish:
|
||||
endf
|
||||
ret
|
||||
endp
|
||||
|
||||
section '.data' data readable writeable
|
||||
|
||||
_title db 'OpenGL example',0
|
||||
_class db 'FASMOPENGL32',0
|
||||
|
||||
theta GLfloat 0.6
|
||||
|
||||
wc WNDCLASS 0,WindowProc,0,0,NULL,NULL,NULL,NULL,NULL,_class
|
||||
|
||||
hdc dq ?
|
||||
hrc dq ?
|
||||
|
||||
msg MSG
|
||||
rc RECT
|
||||
pfd PIXELFORMATDESCRIPTOR
|
||||
|
||||
clock dd ?
|
||||
|
||||
section '.idata' import data readable writeable
|
||||
|
||||
library kernel,'KERNEL32.DLL',\
|
||||
user,'USER32.DLL',\
|
||||
gdi,'GDI32.DLL',\
|
||||
opengl,'OPENGL32.DLL',\
|
||||
glu,'GLU32.DLL'
|
||||
|
||||
import kernel,\
|
||||
GetModuleHandle,'GetModuleHandleA',\
|
||||
GetTickCount,'GetTickCount',\
|
||||
ExitProcess,'ExitProcess'
|
||||
|
||||
import user,\
|
||||
RegisterClass,'RegisterClassA',\
|
||||
CreateWindowEx,'CreateWindowExA',\
|
||||
DefWindowProc,'DefWindowProcA',\
|
||||
GetMessage,'GetMessageA',\
|
||||
TranslateMessage,'TranslateMessage',\
|
||||
DispatchMessage,'DispatchMessageA',\
|
||||
LoadCursor,'LoadCursorA',\
|
||||
LoadIcon,'LoadIconA',\
|
||||
GetClientRect,'GetClientRect',\
|
||||
GetDC,'GetDC',\
|
||||
ReleaseDC,'ReleaseDC',\
|
||||
PostQuitMessage,'PostQuitMessage'
|
||||
|
||||
import gdi,\
|
||||
ChoosePixelFormat,'ChoosePixelFormat',\
|
||||
SetPixelFormat,'SetPixelFormat',\
|
||||
SwapBuffers,'SwapBuffers'
|
||||
|
||||
import opengl,\
|
||||
glAccum,'glAccum',\
|
||||
glAlphaFunc,'glAlphaFunc',\
|
||||
glAreTexturesResident,'glAreTexturesResident',\
|
||||
glArrayElement,'glArrayElement',\
|
||||
glBegin,'glBegin',\
|
||||
glBindTexture,'glBindTexture',\
|
||||
glBitmap,'glBitmap',\
|
||||
glBlendFunc,'glBlendFunc',\
|
||||
glCallList,'glCallList',\
|
||||
glCallLists,'glCallLists',\
|
||||
glClear,'glClear',\
|
||||
glClearAccum,'glClearAccum',\
|
||||
glClearColor,'glClearColor',\
|
||||
glClearDepth,'glClearDepth',\
|
||||
glClearIndex,'glClearIndex',\
|
||||
glClearStencil,'glClearStencil',\
|
||||
glClipPlane,'glClipPlane',\
|
||||
glColor3b,'glColor3b',\
|
||||
glColor3bv,'glColor3bv',\
|
||||
glColor3d,'glColor3d',\
|
||||
glColor3dv,'glColor3dv',\
|
||||
glColor3f,'glColor3f',\
|
||||
glColor3fv,'glColor3fv',\
|
||||
glColor3i,'glColor3i',\
|
||||
glColor3iv,'glColor3iv',\
|
||||
glColor3s,'glColor3s',\
|
||||
glColor3sv,'glColor3sv',\
|
||||
glColor3ub,'glColor3ub',\
|
||||
glColor3ubv,'glColor3ubv',\
|
||||
glColor3ui,'glColor3ui',\
|
||||
glColor3uiv,'glColor3uiv',\
|
||||
glColor3us,'glColor3us',\
|
||||
glColor3usv,'glColor3usv',\
|
||||
glColor4b,'glColor4b',\
|
||||
glColor4bv,'glColor4bv',\
|
||||
glColor4d,'glColor4d',\
|
||||
glColor4dv,'glColor4dv',\
|
||||
glColor4f,'glColor4f',\
|
||||
glColor4fv,'glColor4fv',\
|
||||
glColor4i,'glColor4i',\
|
||||
glColor4iv,'glColor4iv',\
|
||||
glColor4s,'glColor4s',\
|
||||
glColor4sv,'glColor4sv',\
|
||||
glColor4ub,'glColor4ub',\
|
||||
glColor4ubv,'glColor4ubv',\
|
||||
glColor4ui,'glColor4ui',\
|
||||
glColor4uiv,'glColor4uiv',\
|
||||
glColor4us,'glColor4us',\
|
||||
glColor4usv,'glColor4usv',\
|
||||
glColorMask,'glColorMask',\
|
||||
glColorMaterial,'glColorMaterial',\
|
||||
glColorPointer,'glColorPointer',\
|
||||
glCopyPixels,'glCopyPixels',\
|
||||
glCopyTexImage1D,'glCopyTexImage1D',\
|
||||
glCopyTexImage2D,'glCopyTexImage2D',\
|
||||
glCopyTexSubImage1D,'glCopyTexSubImage1D',\
|
||||
glCopyTexSubImage2D,'glCopyTexSubImage2D',\
|
||||
glCullFace,'glCullFace',\
|
||||
glDeleteLists,'glDeleteLists',\
|
||||
glDeleteTextures,'glDeleteTextures',\
|
||||
glDepthFunc,'glDepthFunc',\
|
||||
glDepthMask,'glDepthMask',\
|
||||
glDepthRange,'glDepthRange',\
|
||||
glDisable,'glDisable',\
|
||||
glDisableClientState,'glDisableClientState',\
|
||||
glDrawArrays,'glDrawArrays',\
|
||||
glDrawBuffer,'glDrawBuffer',\
|
||||
glDrawElements,'glDrawElements',\
|
||||
glDrawPixels,'glDrawPixels',\
|
||||
glEdgeFlag,'glEdgeFlag',\
|
||||
glEdgeFlagPointer,'glEdgeFlagPointer',\
|
||||
glEdgeFlagv,'glEdgeFlagv',\
|
||||
glEnable,'glEnable',\
|
||||
glEnableClientState,'glEnableClientState',\
|
||||
glEnd,'glEnd',\
|
||||
glEndList,'glEndList',\
|
||||
glEvalCoord1d,'glEvalCoord1d',\
|
||||
glEvalCoord1dv,'glEvalCoord1dv',\
|
||||
glEvalCoord1f,'glEvalCoord1f',\
|
||||
glEvalCoord1fv,'glEvalCoord1fv',\
|
||||
glEvalCoord2d,'glEvalCoord2d',\
|
||||
glEvalCoord2dv,'glEvalCoord2dv',\
|
||||
glEvalCoord2f,'glEvalCoord2f',\
|
||||
glEvalCoord2fv,'glEvalCoord2fv',\
|
||||
glEvalMesh1,'glEvalMesh1',\
|
||||
glEvalMesh2,'glEvalMesh2',\
|
||||
glEvalPoint1,'glEvalPoint1',\
|
||||
glEvalPoint2,'glEvalPoint2',\
|
||||
glFeedbackBuffer,'glFeedbackBuffer',\
|
||||
glFinish,'glFinish',\
|
||||
glFlush,'glFlush',\
|
||||
glFogf,'glFogf',\
|
||||
glFogfv,'glFogfv',\
|
||||
glFogi,'glFogi',\
|
||||
glFogiv,'glFogiv',\
|
||||
glFrontFace,'glFrontFace',\
|
||||
glFrustum,'glFrustum',\
|
||||
glGenLists,'glGenLists',\
|
||||
glGenTextures,'glGenTextures',\
|
||||
glGetBooleanv,'glGetBooleanv',\
|
||||
glGetClipPlane,'glGetClipPlane',\
|
||||
glGetDoublev,'glGetDoublev',\
|
||||
glGetError,'glGetError',\
|
||||
glGetFloatv,'glGetFloatv',\
|
||||
glGetIntegerv,'glGetIntegerv',\
|
||||
glGetLightfv,'glGetLightfv',\
|
||||
glGetLightiv,'glGetLightiv',\
|
||||
glGetMapdv,'glGetMapdv',\
|
||||
glGetMapfv,'glGetMapfv',\
|
||||
glGetMapiv,'glGetMapiv',\
|
||||
glGetMaterialfv,'glGetMaterialfv',\
|
||||
glGetMaterialiv,'glGetMaterialiv',\
|
||||
glGetPixelMapfv,'glGetPixelMapfv',\
|
||||
glGetPixelMapuiv,'glGetPixelMapuiv',\
|
||||
glGetPixelMapusv,'glGetPixelMapusv',\
|
||||
glGetPointerv,'glGetPointerv',\
|
||||
glGetPolygonStipple,'glGetPolygonStipple',\
|
||||
glGetString,'glGetString',\
|
||||
glGetTexEnvfv,'glGetTexEnvfv',\
|
||||
glGetTexEnviv,'glGetTexEnviv',\
|
||||
glGetTexGendv,'glGetTexGendv',\
|
||||
glGetTexGenfv,'glGetTexGenfv',\
|
||||
glGetTexGeniv,'glGetTexGeniv',\
|
||||
glGetTexImage,'glGetTexImage',\
|
||||
glGetTexLevelParameterfv,'glGetTexLevelParameterfv',\
|
||||
glGetTexLevelParameteriv,'glGetTexLevelParameteriv',\
|
||||
glGetTexParameterfv,'glGetTexParameterfv',\
|
||||
glGetTexParameteriv,'glGetTexParameteriv',\
|
||||
glHint,'glHint',\
|
||||
glIndexMask,'glIndexMask',\
|
||||
glIndexPointer,'glIndexPointer',\
|
||||
glIndexd,'glIndexd',\
|
||||
glIndexdv,'glIndexdv',\
|
||||
glIndexf,'glIndexf',\
|
||||
glIndexfv,'glIndexfv',\
|
||||
glIndexi,'glIndexi',\
|
||||
glIndexiv,'glIndexiv',\
|
||||
glIndexs,'glIndexs',\
|
||||
glIndexsv,'glIndexsv',\
|
||||
glIndexub,'glIndexub',\
|
||||
glIndexubv,'glIndexubv',\
|
||||
glInitNames,'glInitNames',\
|
||||
glInterleavedArrays,'glInterleavedArrays',\
|
||||
glIsEnabled,'glIsEnabled',\
|
||||
glIsList,'glIsList',\
|
||||
glIsTexture,'glIsTexture',\
|
||||
glLightModelf,'glLightModelf',\
|
||||
glLightModelfv,'glLightModelfv',\
|
||||
glLightModeli,'glLightModeli',\
|
||||
glLightModeliv,'glLightModeliv',\
|
||||
glLightf,'glLightf',\
|
||||
glLightfv,'glLightfv',\
|
||||
glLighti,'glLighti',\
|
||||
glLightiv,'glLightiv',\
|
||||
glLineStipple,'glLineStipple',\
|
||||
glLineWidth,'glLineWidth',\
|
||||
glListBase,'glListBase',\
|
||||
glLoadIdentity,'glLoadIdentity',\
|
||||
glLoadMatrixd,'glLoadMatrixd',\
|
||||
glLoadMatrixf,'glLoadMatrixf',\
|
||||
glLoadName,'glLoadName',\
|
||||
glLogicOp,'glLogicOp',\
|
||||
glMap1d,'glMap1d',\
|
||||
glMap1f,'glMap1f',\
|
||||
glMap2d,'glMap2d',\
|
||||
glMap2f,'glMap2f',\
|
||||
glMapGrid1d,'glMapGrid1d',\
|
||||
glMapGrid1f,'glMapGrid1f',\
|
||||
glMapGrid2d,'glMapGrid2d',\
|
||||
glMapGrid2f,'glMapGrid2f',\
|
||||
glMaterialf,'glMaterialf',\
|
||||
glMaterialfv,'glMaterialfv',\
|
||||
glMateriali,'glMateriali',\
|
||||
glMaterialiv,'glMaterialiv',\
|
||||
glMatrixMode,'glMatrixMode',\
|
||||
glMultMatrixd,'glMultMatrixd',\
|
||||
glMultMatrixf,'glMultMatrixf',\
|
||||
glNewList,'glNewList',\
|
||||
glNormal3b,'glNormal3b',\
|
||||
glNormal3bv,'glNormal3bv',\
|
||||
glNormal3d,'glNormal3d',\
|
||||
glNormal3dv,'glNormal3dv',\
|
||||
glNormal3f,'glNormal3f',\
|
||||
glNormal3fv,'glNormal3fv',\
|
||||
glNormal3i,'glNormal3i',\
|
||||
glNormal3iv,'glNormal3iv',\
|
||||
glNormal3s,'glNormal3s',\
|
||||
glNormal3sv,'glNormal3sv',\
|
||||
glNormalPointer,'glNormalPointer',\
|
||||
glOrtho,'glOrtho',\
|
||||
glPassThrough,'glPassThrough',\
|
||||
glPixelMapfv,'glPixelMapfv',\
|
||||
glPixelMapuiv,'glPixelMapuiv',\
|
||||
glPixelMapusv,'glPixelMapusv',\
|
||||
glPixelStoref,'glPixelStoref',\
|
||||
glPixelStorei,'glPixelStorei',\
|
||||
glPixelTransferf,'glPixelTransferf',\
|
||||
glPixelTransferi,'glPixelTransferi',\
|
||||
glPixelZoom,'glPixelZoom',\
|
||||
glPointSize,'glPointSize',\
|
||||
glPolygonMode,'glPolygonMode',\
|
||||
glPolygonOffset,'glPolygonOffset',\
|
||||
glPolygonStipple,'glPolygonStipple',\
|
||||
glPopAttrib,'glPopAttrib',\
|
||||
glPopClientAttrib,'glPopClientAttrib',\
|
||||
glPopMatrix,'glPopMatrix',\
|
||||
glPopName,'glPopName',\
|
||||
glPrioritizeTextures,'glPrioritizeTextures',\
|
||||
glPushAttrib,'glPushAttrib',\
|
||||
glPushClientAttrib,'glPushClientAttrib',\
|
||||
glPushMatrix,'glPushMatrix',\
|
||||
glPushName,'glPushName',\
|
||||
glRasterPos2d,'glRasterPos2d',\
|
||||
glRasterPos2dv,'glRasterPos2dv',\
|
||||
glRasterPos2f,'glRasterPos2f',\
|
||||
glRasterPos2fv,'glRasterPos2fv',\
|
||||
glRasterPos2i,'glRasterPos2i',\
|
||||
glRasterPos2iv,'glRasterPos2iv',\
|
||||
glRasterPos2s,'glRasterPos2s',\
|
||||
glRasterPos2sv,'glRasterPos2sv',\
|
||||
glRasterPos3d,'glRasterPos3d',\
|
||||
glRasterPos3dv,'glRasterPos3dv',\
|
||||
glRasterPos3f,'glRasterPos3f',\
|
||||
glRasterPos3fv,'glRasterPos3fv',\
|
||||
glRasterPos3i,'glRasterPos3i',\
|
||||
glRasterPos3iv,'glRasterPos3iv',\
|
||||
glRasterPos3s,'glRasterPos3s',\
|
||||
glRasterPos3sv,'glRasterPos3sv',\
|
||||
glRasterPos4d,'glRasterPos4d',\
|
||||
glRasterPos4dv,'glRasterPos4dv',\
|
||||
glRasterPos4f,'glRasterPos4f',\
|
||||
glRasterPos4fv,'glRasterPos4fv',\
|
||||
glRasterPos4i,'glRasterPos4i',\
|
||||
glRasterPos4iv,'glRasterPos4iv',\
|
||||
glRasterPos4s,'glRasterPos4s',\
|
||||
glRasterPos4sv,'glRasterPos4sv',\
|
||||
glReadBuffer,'glReadBuffer',\
|
||||
glReadPixels,'glReadPixels',\
|
||||
glRectd,'glRectd',\
|
||||
glRectdv,'glRectdv',\
|
||||
glRectf,'glRectf',\
|
||||
glRectfv,'glRectfv',\
|
||||
glRecti,'glRecti',\
|
||||
glRectiv,'glRectiv',\
|
||||
glRects,'glRects',\
|
||||
glRectsv,'glRectsv',\
|
||||
glRenderMode,'glRenderMode',\
|
||||
glRotated,'glRotated',\
|
||||
glRotatef,'glRotatef',\
|
||||
glScaled,'glScaled',\
|
||||
glScalef,'glScalef',\
|
||||
glScissor,'glScissor',\
|
||||
glSelectBuffer,'glSelectBuffer',\
|
||||
glShadeModel,'glShadeModel',\
|
||||
glStencilFunc,'glStencilFunc',\
|
||||
glStencilMask,'glStencilMask',\
|
||||
glStencilOp,'glStencilOp',\
|
||||
glTexCoord1d,'glTexCoord1d',\
|
||||
glTexCoord1dv,'glTexCoord1dv',\
|
||||
glTexCoord1f,'glTexCoord1f',\
|
||||
glTexCoord1fv,'glTexCoord1fv',\
|
||||
glTexCoord1i,'glTexCoord1i',\
|
||||
glTexCoord1iv,'glTexCoord1iv',\
|
||||
glTexCoord1s,'glTexCoord1s',\
|
||||
glTexCoord1sv,'glTexCoord1sv',\
|
||||
glTexCoord2d,'glTexCoord2d',\
|
||||
glTexCoord2dv,'glTexCoord2dv',\
|
||||
glTexCoord2f,'glTexCoord2f',\
|
||||
glTexCoord2fv,'glTexCoord2fv',\
|
||||
glTexCoord2i,'glTexCoord2i',\
|
||||
glTexCoord2iv,'glTexCoord2iv',\
|
||||
glTexCoord2s,'glTexCoord2s',\
|
||||
glTexCoord2sv,'glTexCoord2sv',\
|
||||
glTexCoord3d,'glTexCoord3d',\
|
||||
glTexCoord3dv,'glTexCoord3dv',\
|
||||
glTexCoord3f,'glTexCoord3f',\
|
||||
glTexCoord3fv,'glTexCoord3fv',\
|
||||
glTexCoord3i,'glTexCoord3i',\
|
||||
glTexCoord3iv,'glTexCoord3iv',\
|
||||
glTexCoord3s,'glTexCoord3s',\
|
||||
glTexCoord3sv,'glTexCoord3sv',\
|
||||
glTexCoord4d,'glTexCoord4d',\
|
||||
glTexCoord4dv,'glTexCoord4dv',\
|
||||
glTexCoord4f,'glTexCoord4f',\
|
||||
glTexCoord4fv,'glTexCoord4fv',\
|
||||
glTexCoord4i,'glTexCoord4i',\
|
||||
glTexCoord4iv,'glTexCoord4iv',\
|
||||
glTexCoord4s,'glTexCoord4s',\
|
||||
glTexCoord4sv,'glTexCoord4sv',\
|
||||
glTexCoordPointer,'glTexCoordPointer',\
|
||||
glTexEnvf,'glTexEnvf',\
|
||||
glTexEnvfv,'glTexEnvfv',\
|
||||
glTexEnvi,'glTexEnvi',\
|
||||
glTexEnviv,'glTexEnviv',\
|
||||
glTexGend,'glTexGend',\
|
||||
glTexGendv,'glTexGendv',\
|
||||
glTexGenf,'glTexGenf',\
|
||||
glTexGenfv,'glTexGenfv',\
|
||||
glTexGeni,'glTexGeni',\
|
||||
glTexGeniv,'glTexGeniv',\
|
||||
glTexImage1D,'glTexImage1D',\
|
||||
glTexImage2D,'glTexImage2D',\
|
||||
glTexParameterf,'glTexParameterf',\
|
||||
glTexParameterfv,'glTexParameterfv',\
|
||||
glTexParameteri,'glTexParameteri',\
|
||||
glTexParameteriv,'glTexParameteriv',\
|
||||
glTexSubImage1D,'glTexSubImage1D',\
|
||||
glTexSubImage2D,'glTexSubImage2D',\
|
||||
glTranslated,'glTranslated',\
|
||||
glTranslatef,'glTranslatef',\
|
||||
glVertex2d,'glVertex2d',\
|
||||
glVertex2dv,'glVertex2dv',\
|
||||
glVertex2f,'glVertex2f',\
|
||||
glVertex2fv,'glVertex2fv',\
|
||||
glVertex2i,'glVertex2i',\
|
||||
glVertex2iv,'glVertex2iv',\
|
||||
glVertex2s,'glVertex2s',\
|
||||
glVertex2sv,'glVertex2sv',\
|
||||
glVertex3d,'glVertex3d',\
|
||||
glVertex3dv,'glVertex3dv',\
|
||||
glVertex3f,'glVertex3f',\
|
||||
glVertex3fv,'glVertex3fv',\
|
||||
glVertex3i,'glVertex3i',\
|
||||
glVertex3iv,'glVertex3iv',\
|
||||
glVertex3s,'glVertex3s',\
|
||||
glVertex3sv,'glVertex3sv',\
|
||||
glVertex4d,'glVertex4d',\
|
||||
glVertex4dv,'glVertex4dv',\
|
||||
glVertex4f,'glVertex4f',\
|
||||
glVertex4fv,'glVertex4fv',\
|
||||
glVertex4i,'glVertex4i',\
|
||||
glVertex4iv,'glVertex4iv',\
|
||||
glVertex4s,'glVertex4s',\
|
||||
glVertex4sv,'glVertex4sv',\
|
||||
glVertexPointer,'glVertexPointer',\
|
||||
glViewport,'glViewport',\
|
||||
wglGetProcAddress,'wglGetProcAddress',\
|
||||
wglCopyContext,'wglCopyContext',\
|
||||
wglCreateContext,'wglCreateContext',\
|
||||
wglCreateLayerContext,'wglCreateLayerContext',\
|
||||
wglDeleteContext,'wglDeleteContext',\
|
||||
wglDescribeLayerPlane,'wglDescribeLayerPlane',\
|
||||
wglGetCurrentContext,'wglGetCurrentContext',\
|
||||
wglGetCurrentDC,'wglGetCurrentDC',\
|
||||
wglGetLayerPaletteEntries,'wglGetLayerPaletteEntries',\
|
||||
wglMakeCurrent,'wglMakeCurrent',\
|
||||
wglRealizeLayerPalette,'wglRealizeLayerPalette',\
|
||||
wglSetLayerPaletteEntries,'wglSetLayerPaletteEntries',\
|
||||
wglShareLists,'wglShareLists',\
|
||||
wglSwapLayerBuffers,'wglSwapLayerBuffers',\
|
||||
wglSwapMultipleBuffers,'wglSwapMultipleBuffers',\
|
||||
wglUseFontBitmapsA,'wglUseFontBitmapsA',\
|
||||
wglUseFontOutlinesA,'wglUseFontOutlinesA',\
|
||||
wglUseFontBitmapsW,'wglUseFontBitmapsW',\
|
||||
wglUseFontOutlinesW,'wglUseFontOutlinesW',\
|
||||
glDrawRangeElements,'glDrawRangeElements',\
|
||||
glTexImage3D,'glTexImage3D',\
|
||||
glBlendColor,'glBlendColor',\
|
||||
glBlendEquation,'glBlendEquation',\
|
||||
glColorSubTable,'glColorSubTable',\
|
||||
glCopyColorSubTable,'glCopyColorSubTable',\
|
||||
glColorTable,'glColorTable',\
|
||||
glCopyColorTable,'glCopyColorTable',\
|
||||
glColorTableParameteriv,'glColorTableParameteriv',\
|
||||
glColorTableParameterfv,'glColorTableParameterfv',\
|
||||
glGetColorTable,'glGetColorTable',\
|
||||
glGetColorTableParameteriv,'glGetColorTableParameteriv',\
|
||||
glGetColorTableParameterfv,'glGetColorTableParameterfv',\
|
||||
glConvolutionFilter1D,'glConvolutionFilter1D',\
|
||||
glConvolutionFilter2D,'glConvolutionFilter2D',\
|
||||
glCopyConvolutionFilter1D,'glCopyConvolutionFilter1D',\
|
||||
glCopyConvolutionFilter2D,'glCopyConvolutionFilter2D',\
|
||||
glGetConvolutionFilter,'glGetConvolutionFilter',\
|
||||
glSeparableFilter2D,'glSeparableFilter2D',\
|
||||
glGetSeparableFilter,'glGetSeparableFilter',\
|
||||
glConvolutionParameteri,'glConvolutionParameteri',\
|
||||
glConvolutionParameteriv,'glConvolutionParameteriv',\
|
||||
glConvolutionParameterf,'glConvolutionParameterf',\
|
||||
glConvolutionParameterfv,'glConvolutionParameterfv',\
|
||||
glGetConvolutionParameteriv,'glGetConvolutionParameteriv',\
|
||||
glGetConvolutionParameterfv,'glGetConvolutionParameterfv',\
|
||||
glHistogram,'glHistogram',\
|
||||
glResetHistogram,'glResetHistogram',\
|
||||
glGetHistogram,'glGetHistogram',\
|
||||
glGetHistogramParameteriv,'glGetHistogramParameteriv',\
|
||||
glGetHistogramParameterfv,'glGetHistogramParameterfv',\
|
||||
glMinmax,'glMinmax',\
|
||||
glResetMinmax,'glResetMinmax',\
|
||||
glGetMinmax,'glGetMinmax',\
|
||||
glGetMinmaxParameteriv,'glGetMinmaxParameteriv',\
|
||||
glGetMinmaxParameterfv,'glGetMinmaxParameterfv'
|
||||
|
||||
import glu,\
|
||||
gluBeginCurve,'gluBeginCurve',\
|
||||
gluBeginPolygon,'gluBeginPolygon',\
|
||||
gluBeginSurface,'gluBeginSurface',\
|
||||
gluBeginTrim,'gluBeginTrim',\
|
||||
gluBuild1DMipmaps,'gluBuild1DMipmaps',\
|
||||
gluBuild2DMipmaps,'gluBuild2DMipmaps',\
|
||||
gluCylinder,'gluCylinder',\
|
||||
gluDeleteNurbsRenderer,'gluDeleteNurbsRenderer',\
|
||||
gluDeleteQuadric,'gluDeleteQuadric',\
|
||||
gluDeleteTess,'gluDeleteTess',\
|
||||
gluDisk,'gluDisk',\
|
||||
gluEndCurve,'gluEndCurve',\
|
||||
gluEndPolygon,'gluEndPolygon',\
|
||||
gluEndSurface,'gluEndSurface',\
|
||||
gluEndTrim,'gluEndTrim',\
|
||||
gluErrorString,'gluErrorString',\
|
||||
gluGetNurbsProperty,'gluGetNurbsProperty',\
|
||||
gluGetString,'gluGetString',\
|
||||
gluGetTessProperty,'gluGetTessProperty',\
|
||||
gluLoadSamplingMatrices,'gluLoadSamplingMatrices',\
|
||||
gluLookAt,'gluLookAt',\
|
||||
gluNewNurbsRenderer,'gluNewNurbsRenderer',\
|
||||
gluNewQuadric,'gluNewQuadric',\
|
||||
gluNewTess,'gluNewTess',\
|
||||
gluNextContour,'gluNextContour',\
|
||||
gluNurbsCallback,'gluNurbsCallback',\
|
||||
gluNurbsCurve,'gluNurbsCurve',\
|
||||
gluNurbsProperty,'gluNurbsProperty',\
|
||||
gluNurbsSurface,'gluNurbsSurface',\
|
||||
gluOrtho2D,'gluOrtho2D',\
|
||||
gluPartialDisk,'gluPartialDisk',\
|
||||
gluPerspective,'gluPerspective',\
|
||||
gluPickMatrix,'gluPickMatrix',\
|
||||
gluProject,'gluProject',\
|
||||
gluPwlCurve,'gluPwlCurve',\
|
||||
gluQuadricCallback,'gluQuadricCallback',\
|
||||
gluQuadricDrawStyle,'gluQuadricDrawStyle',\
|
||||
gluQuadricNormals,'gluQuadricNormals',\
|
||||
gluQuadricOrientation,'gluQuadricOrientation',\
|
||||
gluQuadricTexture,'gluQuadricTexture',\
|
||||
gluScaleImage,'gluScaleImage',\
|
||||
gluSphere,'gluSphere',\
|
||||
gluTessBeginContour,'gluTessBeginContour',\
|
||||
gluTessBeginPolygon,'gluTessBeginPolygon',\
|
||||
gluTessCallback,'gluTessCallback',\
|
||||
gluTessEndContour,'gluTessEndContour',\
|
||||
gluTessEndPolygon,'gluTessEndPolygon',\
|
||||
gluTessNormal,'gluTessNormal',\
|
||||
gluTessProperty,'gluTessProperty',\
|
||||
gluTessVertex,'gluTessVertex',\
|
||||
gluUnProject,'gluUnProject'
|
45
toolchain/fasmw17332/EXAMPLES/WIN64/PE64DEMO/PE64DEMO.ASM
Normal file
45
toolchain/fasmw17332/EXAMPLES/WIN64/PE64DEMO/PE64DEMO.ASM
Normal file
@ -0,0 +1,45 @@
|
||||
|
||||
; Example of 64-bit PE program
|
||||
|
||||
format PE64 GUI
|
||||
entry start
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
sub rsp,8*5 ; reserve stack for API use and make stack dqword aligned
|
||||
|
||||
mov r9d,0
|
||||
lea r8,[_caption]
|
||||
lea rdx,[_message]
|
||||
mov rcx,0
|
||||
call [MessageBoxA]
|
||||
|
||||
mov ecx,eax
|
||||
call [ExitProcess]
|
||||
|
||||
section '.data' data readable writeable
|
||||
|
||||
_caption db 'Win64 assembly program',0
|
||||
_message db 'Hello World!',0
|
||||
|
||||
section '.idata' import data readable writeable
|
||||
|
||||
dd 0,0,0,RVA kernel_name,RVA kernel_table
|
||||
dd 0,0,0,RVA user_name,RVA user_table
|
||||
dd 0,0,0,0,0
|
||||
|
||||
kernel_table:
|
||||
ExitProcess dq RVA _ExitProcess
|
||||
dq 0
|
||||
user_table:
|
||||
MessageBoxA dq RVA _MessageBoxA
|
||||
dq 0
|
||||
|
||||
kernel_name db 'KERNEL32.DLL',0
|
||||
user_name db 'USER32.DLL',0
|
||||
|
||||
_ExitProcess dw 0
|
||||
db 'ExitProcess',0
|
||||
_MessageBoxA dw 0
|
||||
db 'MessageBoxA',0
|
82
toolchain/fasmw17332/EXAMPLES/WIN64/TEMPLATE/TEMPLATE.ASM
Normal file
82
toolchain/fasmw17332/EXAMPLES/WIN64/TEMPLATE/TEMPLATE.ASM
Normal file
@ -0,0 +1,82 @@
|
||||
|
||||
format PE64 GUI 5.0
|
||||
entry start
|
||||
|
||||
include 'win64a.inc'
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
sub rsp,8 ; Make stack dqword aligned
|
||||
|
||||
invoke GetModuleHandle,0
|
||||
mov [wc.hInstance],rax
|
||||
invoke LoadIcon,0,IDI_APPLICATION
|
||||
mov [wc.hIcon],rax
|
||||
mov [wc.hIconSm],rax
|
||||
invoke LoadCursor,0,IDC_ARROW
|
||||
mov [wc.hCursor],rax
|
||||
invoke RegisterClassEx,wc
|
||||
test rax,rax
|
||||
jz error
|
||||
|
||||
invoke CreateWindowEx,0,_class,_title,WS_VISIBLE+WS_DLGFRAME+WS_SYSMENU,128,128,256,192,NULL,NULL,[wc.hInstance],NULL
|
||||
test rax,rax
|
||||
jz error
|
||||
|
||||
msg_loop:
|
||||
invoke GetMessage,msg,NULL,0,0
|
||||
cmp eax,1
|
||||
jb end_loop
|
||||
jne msg_loop
|
||||
invoke TranslateMessage,msg
|
||||
invoke DispatchMessage,msg
|
||||
jmp msg_loop
|
||||
|
||||
error:
|
||||
invoke MessageBox,NULL,_error,NULL,MB_ICONERROR+MB_OK
|
||||
|
||||
end_loop:
|
||||
invoke ExitProcess,[msg.wParam]
|
||||
|
||||
proc WindowProc uses rbx rsi rdi, hwnd,wmsg,wparam,lparam
|
||||
|
||||
; Note that first four parameters are passed in registers,
|
||||
; while names given in the declaration of procedure refer to the stack
|
||||
; space reserved for them - you may store them there to be later accessible
|
||||
; if the contents of registers gets destroyed. This may look like:
|
||||
; mov [hwnd],rcx
|
||||
; mov [wmsg],edx
|
||||
; mov [wparam],r8
|
||||
; mov [lparam],r9
|
||||
|
||||
cmp edx,WM_DESTROY
|
||||
je .wmdestroy
|
||||
.defwndproc:
|
||||
invoke DefWindowProc,rcx,rdx,r8,r9
|
||||
jmp .finish
|
||||
.wmdestroy:
|
||||
invoke PostQuitMessage,0
|
||||
xor eax,eax
|
||||
.finish:
|
||||
ret
|
||||
|
||||
endp
|
||||
|
||||
section '.data' data readable writeable
|
||||
|
||||
_title TCHAR 'Win64 program template',0
|
||||
_class TCHAR 'FASMWIN64',0
|
||||
_error TCHAR 'Startup failed.',0
|
||||
|
||||
wc WNDCLASSEX sizeof.WNDCLASSEX,0,WindowProc,0,0,NULL,NULL,NULL,COLOR_BTNFACE+1,NULL,_class,NULL
|
||||
|
||||
msg MSG
|
||||
|
||||
section '.idata' import data readable writeable
|
||||
|
||||
library kernel32,'KERNEL32.DLL',\
|
||||
user32,'USER32.DLL'
|
||||
|
||||
include 'api\kernel32.inc'
|
||||
include 'api\user32.inc'
|
142
toolchain/fasmw17332/EXAMPLES/WIN64/USECOM/USECOM.ASM
Normal file
142
toolchain/fasmw17332/EXAMPLES/WIN64/USECOM/USECOM.ASM
Normal file
@ -0,0 +1,142 @@
|
||||
|
||||
; Component Object Model usage demonstration
|
||||
|
||||
format PE64 GUI 5.0
|
||||
entry start
|
||||
|
||||
include 'win64a.inc'
|
||||
|
||||
struc GUID def
|
||||
{
|
||||
match d1-d2-d3-d4-d5, def
|
||||
\{
|
||||
.Data1 dd 0x\#d1
|
||||
.Data2 dw 0x\#d2
|
||||
.Data3 dw 0x\#d3
|
||||
.Data4 db 0x\#d4 shr 8,0x\#d4 and 0FFh
|
||||
.Data5 db 0x\#d5 shr 40,0x\#d5 shr 32 and 0FFh,0x\#d5 shr 24 and 0FFh,0x\#d5 shr 16 and 0FFh,0x\#d5 shr 8 and 0FFh,0x\#d5 and 0FFh
|
||||
\}
|
||||
}
|
||||
|
||||
interface ITaskBarList,\
|
||||
QueryInterface,\
|
||||
AddRef,\
|
||||
Release,\
|
||||
HrInit,\
|
||||
AddTab,\
|
||||
DeleteTab,\
|
||||
ActivateTab,\
|
||||
SetActiveAlt
|
||||
|
||||
CLSCTX_INPROC_SERVER = 0x1
|
||||
CLSCTX_INPROC_HANDLER = 0x2
|
||||
CLSCTX_LOCAL_SERVER = 0x4
|
||||
CLSCTX_INPROC_SERVER16 = 0x8
|
||||
CLSCTX_REMOTE_SERVER = 0x10
|
||||
CLSCTX_INPROC_HANDLER16 = 0x20
|
||||
CLSCTX_INPROC_SERVERX86 = 0x40
|
||||
CLSCTX_INPROC_HANDLERX86 = 0x80
|
||||
CLSCTX_ESERVER_HANDLER = 0x100
|
||||
CLSCTX_NO_CODE_DOWNLOAD = 0x400
|
||||
CLSCTX_NO_CUSTOM_MARSHAL = 0x1000
|
||||
CLSCTX_ENABLE_CODE_DOWNLOAD = 0x2000
|
||||
CLSCTX_NO_FAILURE_LOG = 0x4000
|
||||
CLSCTX_DISABLE_AAA = 0x8000
|
||||
CLSCTX_ENABLE_AAA = 0x10000
|
||||
CLSCTX_FROM_DEFAULT_CONTEXT = 0x20000
|
||||
|
||||
ID_EXIT = IDCANCEL
|
||||
ID_SHOW = 100
|
||||
ID_HIDE = 101
|
||||
|
||||
IDD_COMDEMO = 1
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
sub rsp,8 ; Make stack dqword aligned
|
||||
|
||||
invoke CoInitialize,NULL
|
||||
invoke CoCreateInstance,CLSID_TaskbarList,NULL,CLSCTX_INPROC_SERVER,IID_ITaskbarList,ShellTaskBar
|
||||
|
||||
invoke GetModuleHandle,0
|
||||
invoke DialogBoxParam,rax,IDD_COMDEMO,HWND_DESKTOP,COMDemo,0
|
||||
|
||||
cominvk ShellTaskBar,Release
|
||||
|
||||
invoke ExitProcess,0
|
||||
|
||||
proc COMDemo uses rbx, hwnd,msg,wparam,lparam
|
||||
mov [hwnd],rcx
|
||||
cmp edx,WM_INITDIALOG
|
||||
je .wminitdialog
|
||||
cmp edx,WM_COMMAND
|
||||
je .wmcommand
|
||||
cmp edx,WM_CLOSE
|
||||
je .wmclose
|
||||
xor eax,eax
|
||||
jmp .finish
|
||||
.wminitdialog:
|
||||
jmp .processed
|
||||
.wmcommand:
|
||||
cmp r8,BN_CLICKED shl 16 + ID_EXIT
|
||||
je .wmclose
|
||||
cmp r8,BN_CLICKED shl 16 + ID_SHOW
|
||||
je .show
|
||||
cmp r8,BN_CLICKED shl 16 + ID_HIDE
|
||||
jne .processed
|
||||
.hide:
|
||||
cominvk ShellTaskBar,HrInit
|
||||
cominvk ShellTaskBar,DeleteTab,[hwnd]
|
||||
jmp .processed
|
||||
.show:
|
||||
mov rbx,[ShellTaskBar]
|
||||
comcall rbx,ITaskBarList,HrInit
|
||||
comcall rbx,ITaskBarList,AddTab,[hwnd]
|
||||
comcall rbx,ITaskBarList,ActivateTab,[hwnd]
|
||||
jmp .processed
|
||||
.wmclose:
|
||||
invoke EndDialog,[hwnd],0
|
||||
.processed:
|
||||
mov eax,1
|
||||
.finish:
|
||||
ret
|
||||
endp
|
||||
|
||||
section '.data' data readable writeable
|
||||
|
||||
CLSID_TaskbarList GUID 56FDF344-FD6D-11D0-958A-006097C9A090
|
||||
IID_ITaskbarList GUID 56FDF342-FD6D-11D0-958A-006097C9A090
|
||||
|
||||
ShellTaskBar ITaskBarList
|
||||
|
||||
section '.idata' import data readable
|
||||
|
||||
library kernel,'KERNEL32.DLL',\
|
||||
user,'USER32.DLL',\
|
||||
ole,'OLE32.DLL'
|
||||
|
||||
import kernel,\
|
||||
GetModuleHandle,'GetModuleHandleA',\
|
||||
ExitProcess,'ExitProcess'
|
||||
|
||||
import user,\
|
||||
DialogBoxParam,'DialogBoxParamA',\
|
||||
EndDialog,'EndDialog'
|
||||
|
||||
import ole,\
|
||||
CoInitialize,'CoInitialize',\
|
||||
CoCreateInstance,'CoCreateInstance'
|
||||
|
||||
section '.rsrc' resource data readable
|
||||
|
||||
directory RT_DIALOG,dialogs
|
||||
|
||||
resource dialogs,\
|
||||
IDD_COMDEMO,LANG_ENGLISH+SUBLANG_DEFAULT,comdemo
|
||||
|
||||
dialog comdemo,'Taskbar item control',70,70,170,24,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME
|
||||
dialogitem 'BUTTON','Show',ID_SHOW,4,4,45,15,WS_VISIBLE+WS_TABSTOP
|
||||
dialogitem 'BUTTON','Hide',ID_HIDE,54,4,45,15,WS_VISIBLE+WS_TABSTOP
|
||||
dialogitem 'BUTTON','Exit',ID_EXIT,120,4,45,15,WS_VISIBLE+WS_TABSTOP
|
||||
enddialog
|
98
toolchain/fasmw17332/EXAMPLES/WIN64/WIN64AVX/WIN64AVX.ASM
Normal file
98
toolchain/fasmw17332/EXAMPLES/WIN64/WIN64AVX/WIN64AVX.ASM
Normal file
@ -0,0 +1,98 @@
|
||||
|
||||
format PE64 NX GUI 6.0
|
||||
entry start
|
||||
|
||||
include 'win64a.inc'
|
||||
|
||||
section '.data' data readable writeable
|
||||
|
||||
_title db 'AVX playground',0
|
||||
_error db 'AVX instructions are not supported.',0
|
||||
|
||||
x dq 3.14159265389
|
||||
|
||||
vector_output:
|
||||
rept 16 i:0
|
||||
{
|
||||
db 'ymm',`i,': %f,%f,%f,%f',13,10
|
||||
}
|
||||
db 0
|
||||
|
||||
buffer db 1000h dup ?
|
||||
|
||||
section '.text' code readable executable
|
||||
|
||||
start:
|
||||
|
||||
mov eax,1
|
||||
cpuid
|
||||
and ecx,18000000h
|
||||
cmp ecx,18000000h
|
||||
jne no_AVX
|
||||
xor ecx,ecx
|
||||
xgetbv
|
||||
and eax,110b
|
||||
cmp eax,110b
|
||||
jne no_AVX
|
||||
|
||||
vbroadcastsd ymm0, [x]
|
||||
vsqrtpd ymm1, ymm0
|
||||
|
||||
vsubpd ymm2, ymm0, ymm1
|
||||
vsubpd ymm3, ymm1, ymm2
|
||||
|
||||
vaddpd xmm4, xmm2, xmm3
|
||||
vaddpd ymm5, ymm4, ymm0
|
||||
|
||||
vperm2f128 ymm6, ymm4, ymm5, 03h
|
||||
vshufpd ymm7, ymm6, ymm5, 10010011b
|
||||
|
||||
vroundpd ymm8, ymm7, 0011b
|
||||
vroundpd ymm9, ymm7, 0
|
||||
|
||||
sub rsp,418h
|
||||
|
||||
rept 16 i:0
|
||||
{
|
||||
vmovups [rsp+10h+i*32],ymm#i
|
||||
}
|
||||
|
||||
mov r8,[rsp+10h]
|
||||
mov r9,[rsp+18h]
|
||||
lea rdx,[vector_output]
|
||||
lea rcx,[buffer]
|
||||
call [sprintf]
|
||||
|
||||
xor ecx,ecx
|
||||
lea rdx,[buffer]
|
||||
lea r8,[_title]
|
||||
xor r9d,r9d
|
||||
call [MessageBoxA]
|
||||
|
||||
xor ecx,ecx
|
||||
call [ExitProcess]
|
||||
|
||||
no_AVX:
|
||||
|
||||
sub rsp,28h
|
||||
|
||||
xor ecx,ecx
|
||||
lea rdx,[_error]
|
||||
lea r8,[_title]
|
||||
mov r9d,10h
|
||||
call [MessageBoxA]
|
||||
|
||||
mov ecx,1
|
||||
call [ExitProcess]
|
||||
|
||||
section '.idata' import data readable writeable
|
||||
|
||||
library kernel32,'KERNEL32.DLL',\
|
||||
user32,'USER32.DLL',\
|
||||
msvcrt,'MSVCRT.DLL'
|
||||
|
||||
include 'api\kernel32.inc'
|
||||
include 'api\user32.inc'
|
||||
|
||||
import msvcrt,\
|
||||
sprintf,'sprintf'
|
Reference in New Issue
Block a user