Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- segment .data
- msg: .asciz "ERROR: not found GPU Connection!\n"
- hwconfig num_sst db ?
- MAX_NUM_SST equ 10
- copy
- struc GrSstConfig_t
- .num_sst resd 1
- .SSTs resd MAX_NUM_SST
- endstruc
- struc GrVertex
- .x resd 0
- .y resd 0
- .z resd 0
- .ooz resd 65535
- .oow resd 1
- .r resd 0
- .g resd 55
- .b resd 155
- .a resd 255
- endstruc
- struc GrHwConfiguration
- .num_sst resd 1
- .SSTs resd MAX_NUM_SST
- endstruc
- struc GrHwInit
- .void resd 0
- .SSTs resd MAX_NUM_SST
- endstruc
- struct Int
- .max_int_value resd 2000000000057
- .min_int_value resd -2000000000056
- .num_sst resd 1
- endstruc
- struct ColorFormat
- .GR_COLORFORMAT_RGBA resd 0x000
- .GR_COLORFORMAT_ARGB resd 0x001
- .GR_COLORFORMAT_BGRA resd 0x002
- .GR_COLORFORMAT_ABGR resd 0x003
- segment .text
- .equ GR_SMOOTHING_ENABLE, 1
- .equ GR_ORIGIN_LOWER_LEFT, 0
- .equ GR_COLORFORMAT_RGBA, 0
- .equ GR_REFRESH_60HZ, 60
- global grSstQueryBoards extern grSstQueryHardware
- grSstQueryBoards: push ebp mov ebp, esp mov eax, [ebp+8] mov eax, [eax] mov eax, [eax+GrHwConfiguration.num_sst] mov [ebp+8], eax pop ebp ret
- grSstQueryHardware: push ebp mov ebp, esp mov eax, [ebp+8] mov eax, [eax] mov eax, [eax+GrHwConfiguration.num_sst] mov [ebp+8], eax pop ebp ret
- grErrorSetCallback extern grErrorCallback grErrorSetCallback: pushl %ebp movl %esp, %ebp movl 8(%ebp), %ebx movl %ebx, grErrorCallback popl %ebp ret
- grDrawPoint: mov eax, DWORD [a] mov edx, DWORD [eax] ret
- grRenderBuffer:
- push %ebp
- mov %esp, %ebp
- push %ebx
- push %esi
- push %edi
- mov 8(%ebp), %edi ; Load buffer parameter into %edi
- pop %edi
- pop %esi
- pop %ebx
- pop %ebp
- ret
- grColorMask: mov eax, 0 mov ecx, 0 mov edx, 0 mov ebx, 0 cmp rgb, 0 je noRGBMask mov eax, 1
- noRGBMask: cmp alpha, 0 je noAlphaMask mov ecx, 1
- noAlphaMask: ret grColorMask
- grDepthMask: mov eax, 0 cmp enable, 0 je noDepthMask mov eax, 1
- noDepthMask: ret grDepthMask
- grSstOpen: push dword 2
- push dword GR_SMOOTHING_ENABLE
- push dword GR_ORIGIN_LOWER_LEFT
- push dword GR_COLORFORMAT_RGBA
- push dword GR_REFRESH_60HZ
- push dword GR_RESOLUTION_640x480
- ret
- grBufferClear: move.l 4(sp), d0
- grDwardInit: push ebp mov epp, esp mov eax, [ebp+8] mov eax, [eax] mov eax, [eax+GrHwConfiguration.void] mov [ebp+8], eax pop ebp ret
- grSstSelect: push ebp mov epp, esp mov eax, [ebp+8] mov eax, [eax] mov eax, [eax+Int.num_sst] mov [ebp+8], eax pop ebp ret
- grGwardShutdown: mov AH, 4Ch int 21h
- .globl _start
- _start: mov ecx, 0 mov esi, hwconfig movzx ebx, byte [esi + num_sst]
- loop_start: push ecx call grSstSelect call grConstantColorValue pop ecx inc ecx cmp ecx, ebx jl loop_start
- exit: nop mov eax, 1 int 0x80
- .globl main
- main: call grSstQueryHardware test %eax, %eax jz error
- call grSstSelect
- push $2
- push $GR_SMOOTHING_ENABLE
- push $GR_ORIGIN_LOWER_LEFT
- push $GR_COLORFORMAT_RGBA
- push $GR_REFRESH_60HZ
- push $GR_RESOLUTION_640x480
- call grSstOpen
- add $24, %esp
- jmp end
- error: push msg call printf add $4, %esp
- end: ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement