/programs/games/nsider/kolibrisys/_ksys_files_acces.asm |
---|
0,0 → 1,119 |
format COFF |
section '.text' code |
include '../../../proc32.inc' |
public __ksys_get_filesize |
public __ksys_readfile |
public __ksys_rewritefile |
public __ksys_appendtofile |
align 4 |
proc __ksys_get_filesize stdcall, filename:dword |
xor eax,eax |
mov ebx,[filename] |
mov [fileinfo.subproc],dword 5 |
mov [fileinfo.offset_l],eax |
mov [fileinfo.offset_h],eax |
mov [fileinfo.size],eax |
mov [fileinfo.data],dword buffer_for_info |
mov [fileinfo.letter],al |
mov [fileinfo.filename],ebx |
mov eax,70 |
mov ebx,fileinfo |
int 0x40 |
test eax,eax |
jnz error_for_file_size |
mov eax,[buffer_for_info+32] ;file size |
error_for_file_size: |
ret |
endp |
align 4 |
proc __ksys_readfile stdcall,filename:dword,position:dword,sizeblock:dword,buffer:dword |
xor eax,eax |
mov ebx,[position] |
mov ecx,[sizeblock] |
mov edx,[buffer] |
mov esi,[filename] |
mov [fileinfo.subproc],eax |
mov [fileinfo.offset_l],ebx |
mov [fileinfo.offset_h],eax |
mov [fileinfo.size],ecx |
mov [fileinfo.data],edx |
mov [fileinfo.letter],al |
mov [fileinfo.filename],esi |
mov eax,70 |
mov ebx,fileinfo |
int 0x40 |
ret |
endp |
align 4 |
proc __ksys_rewritefile stdcall,filename:dword,sizeblock:dword,data_write:dword |
xor eax,eax |
mov ebx,[sizeblock] |
mov ecx,[data_write] |
mov edx,[filename] |
mov [fileinfo.subproc],dword 2 |
mov [fileinfo.offset_l],eax |
mov [fileinfo.offset_h],eax |
mov [fileinfo.size],ebx |
mov [fileinfo.data],ecx |
mov [fileinfo.letter],al |
mov [fileinfo.filename],edx |
mov eax,70 |
mov ebx,fileinfo |
int 0x40 |
ret |
endp |
align 4 |
proc __ksys_appendtofile stdcall,filename:dword,pos:dword,sizeblock:dword,data_append:dword |
xor eax,eax |
mov ebx,[pos] |
mov ecx,[sizeblock] |
mov edx,[data_append] |
mov esi,[filename] |
mov [fileinfo.subproc],dword 3 |
mov [fileinfo.offset_l],ebx |
mov [fileinfo.offset_h],eax |
mov [fileinfo.size],ecx |
mov [fileinfo.data],edx |
mov [fileinfo.letter],al |
mov [fileinfo.filename],esi |
mov eax,70 |
mov ebx,fileinfo |
int 0x40 |
ret |
endp |
struc FILEIO |
{ |
.subproc rd 1 |
.offset_l rd 1 |
.offset_h rd 1 |
.size rd 1 |
.data rd 1 |
.letter rb 1 |
.filename rd 1 |
} |
fileinfo FILEIO |
buffer_for_info rd 11 |
/programs/games/nsider/kolibrisys/clock.asm |
---|
0,0 → 1,15 |
format COFF |
include "../../../proc32.inc" |
section '.text' code |
public __ksys_get_system_clock |
align 4 |
proc __ksys_get_system_clock stdcall |
mov eax,3 |
int 0x40 |
ret |
endp |
/programs/games/nsider/kolibrisys/delay.asm |
---|
0,0 → 1,11 |
format COFF |
include "public_stdcall.inc" |
section '.text' code |
public_stdcall __ksys_delay,4 |
;arg1 - time |
mov edx,ebx |
mov eax,5 |
mov ebx,[esp+4] |
int 0x40 |
mov ebx,edx |
ret 4 |
/programs/games/nsider/kolibrisys/draw_bar.asm |
---|
0,0 → 1,21 |
format COFF |
include "public_stdcall.inc" |
section '.text' code |
public_stdcall __ksys_draw_bar,20 |
;arg1 - x |
;arg2 - y |
;arg3 - xsize |
;arg4 - ysize |
;arg5 - color |
push ebx |
mov eax,13 |
mov ebx,[esp+8] |
shl ebx,16 |
mov bx,[esp+16] |
mov ecx,[esp+12] |
shl ecx,16 |
mov cx,[esp+20] |
mov edx,[esp+24] |
int 0x40 |
pop ebx |
ret 20 |
/programs/games/nsider/kolibrisys/draw_window.asm |
---|
0,0 → 1,34 |
format COFF |
include "public_stdcall.inc" |
section '.text' code |
public_stdcall __ksys_draw_window,36 |
;arg1 - xcoord |
;arg2 - ycoord |
;arg3 - xsize |
;arg4 - ysize |
;arg5 - workcolor |
;arg6 - type |
;arg7 - captioncolor |
;arg8 - windowtype |
;arg9 - bordercolor |
push ebp |
mov ebp,esp |
push ebx esi edi |
mov ebx,[ebp+8] |
shl ebx,16 |
mov bx,[ebp+16] |
mov ecx,[ebp+12] |
shl ecx,16 |
mov cx,[ebp+20] |
mov edx,[ebp+28] |
shl edx,24 |
add edx,[ebp+24] |
mov esi,[ebp+36] |
shl esi,24 |
add esi,[ebp+32] |
mov edi,[ebp+40] |
xor eax,eax |
int 0x40 |
pop edi esi ebx |
pop ebp |
ret 36 |
/programs/games/nsider/kolibrisys/keyboard.asm |
---|
0,0 → 1,29 |
format COFF |
include "../../../proc32.inc" |
section '.text' code |
public __ksys_get_key |
public __ksys_set_keyboard_mode |
align 4 |
proc __ksys_get_key stdcall |
mov eax,2 |
int 0x40 |
ret |
endp |
align 4 |
proc __ksys_set_keyboard_mode stdcall, mode:dword |
mov edx,ebx |
mov eax,66 |
xor ebx,ebx |
inc ebx |
mov ecx,[mode] |
mov ebx,edx |
ret |
endp |
/programs/games/nsider/kolibrisys/line.asm |
---|
0,0 → 1,21 |
format COFF |
include "public_stdcall.inc" |
section '.text' code |
public_stdcall __ksys_line,20 |
;arg1 - x1 |
;arg2 - y1 |
;arg3 - x2 |
;arg4 - y2 |
;arg5 - color |
push ebx |
mov ebx,[esp+8] |
shl ebx,16 |
mov bx,[esp+16] |
mov ecx,[esp+12] |
shl ecx,16 |
mov cx,[esp+20] |
mov edx,[esp+24] |
mov eax,38 |
int 0x40 |
pop ebx |
ret 20 |
/programs/games/nsider/kolibrisys/memalloc.asm |
---|
0,0 → 1,38 |
format COFF |
;include "proc32.inc" |
section '.text' code |
public _malloc |
public _free |
public _realloc |
align 4 |
_malloc: |
mov eax,68 |
mov ebx,12 |
mov ecx,[esp+4] ;size |
int 0x40 |
ret 4 |
align 4 |
_free: |
mov eax,68 |
mov ebx,13 |
mov ecx,[esp+4] |
int 0x40 |
ret 4 |
align 4 |
_realloc: |
mov ebx,20 |
mov eax,68 |
mov ecx,[esp+4] |
mov edx,[esp+8] |
int 0x40 |
ret 8 |
/programs/games/nsider/kolibrisys/public_stdcall.inc |
---|
0,0 → 1,7 |
macro public_stdcall name,size |
{ |
public name |
public name#@#size |
name: |
name#@#size: |
} |
/programs/games/nsider/kolibrisys/screen.asm |
---|
0,0 → 1,15 |
format COFF |
include "public_stdcall.inc" |
section '.text' code |
public_stdcall __ksys_get_screen_size,8 |
;arg1 - x |
;arg2 - y |
mov eax,14 |
int 0x40 |
mov ecx,[esp+8] |
mov [ecx],ax |
mov word [ecx+2],0 |
shr eax,16 |
mov ecx,[esp+4] |
mov [ecx],eax |
ret 8 |
/programs/games/nsider/kolibrisys/window_redraw.asm |
---|
0,0 → 1,11 |
format COFF |
include "public_stdcall.inc" |
section '.text' code |
public_stdcall __ksys_window_redraw,4 |
;arg1 - status |
mov edx,ebx |
mov eax,12 |
mov ebx,[esp+4] |
int 0x40 |
mov ebx,edx |
ret 4 |