fixed bug ir raw_read

git-svn-id: svn://kolibrios.org@799 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Sergey Semyonov (Serge) 2008-05-30 13:35:07 +00:00
parent 8322617480
commit ba3e90bdec
4 changed files with 41 additions and 23 deletions

View File

@ -227,16 +227,24 @@
>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
Optimization="3"
InlineFunctionExpansion="0"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
FavorSizeOrSpeed="0"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\crt.c"
>
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AssemblerOutput="1"
/>
</FileConfiguration>
</File>
<File
RelativePath=".\k_lib.asm"

View File

@ -429,7 +429,7 @@ void _stdcall thread_proc(void *param)
int pos;
int key;
DWORD offset;
_asm
{
mov eax, 66
@ -550,7 +550,8 @@ void _stdcall thread_proc(void *param)
void delay (int val)
{
_asm
{ mov eax,5
{
mov eax,5
mov ebx, [val]
int 0x40
};
@ -559,7 +560,8 @@ void delay (int val)
int wait_for_event(int time)
{ int retval;
_asm
{ mov eax,23
{
mov eax,23
mov ebx,[time]
int 0x40
mov [retval], eax
@ -570,7 +572,8 @@ int wait_for_event(int time)
int wait_for_event_infinite()
{ int retval;
_asm
{ mov eax,10
{
mov eax,10
int 0x40
mov [retval], eax
};
@ -579,7 +582,8 @@ int wait_for_event_infinite()
void BeginDraw()
{_asm
{ mov eax,12
{
mov eax,12
mov ebx, 1
int 0x40
};
@ -587,7 +591,8 @@ void BeginDraw()
void EndDraw()
{ _asm
{ mov eax,12
{
mov eax,12
mov ebx, 2
int 0x40
};

View File

@ -33,7 +33,7 @@ public _debug_out_hex@4
public _create_thread@12
;public _memset
public _memset
struc FILEIO
{ .cmd dd ?
@ -81,10 +81,12 @@ _GetScreenSize@8:
align 4
_create_thread@12:
.thr_proc equ esp+4
.param equ esp+8
.stack_size equ esp+12
.thr_proc equ esp+8
.param equ esp+12
.stack_size equ esp+16
push ebx
mov eax, 68
mov ebx, 12
mov ecx, [.stack_size]
@ -104,9 +106,11 @@ _create_thread@12:
mov ebx, 1
mov ecx, [.thr_proc]
int 0x40
pop ebx
ret 12
.fail:
not eax
pop ebx
ret 12
align 4
.exit_point:
@ -418,13 +422,13 @@ _draw_bar@20:
;arg5 - color
push ebx ecx
mov eax,13
mov ebx,[esp+8]
mov ebx,[esp+12]
shl ebx,16
mov bx,[esp+16]
mov ecx,[esp+12]
mov bx,[esp+20]
mov ecx,[esp+16]
shl ecx,16
mov cx,[esp+20]
mov edx,[esp+24]
mov cx,[esp+24]
mov edx,[esp+28]
int 0x40
pop ecx ebx
ret 20
@ -437,12 +441,12 @@ _write_text@20:
;arg5 - len
push ebx ecx esi
mov eax,4
mov ebx,[esp+12]
mov ebx,[esp+16]
shl ebx,16
mov bx,[esp+16]
mov ecx,[esp+20]
mov edx,[esp+24]
mov esi,[esp+28]
mov bx,[esp+20]
mov ecx,[esp+24]
mov edx,[esp+28]
mov esi,[esp+32]
int 0x40
pop esi ecx ebx
ret 20

View File

@ -97,6 +97,7 @@ static int fill_reader(struct reader *rd)
mem_cpy(rd->buffer,rd->stream,rd->strremain);
rd->stream = rd->buffer;
bytes= 0;
retval=read_file (rd->hFile,rd->buffer+rd->strremain,rd->filepos,
0x10000-rd->strremain,&bytes);
if( (retval==0)||(retval==6))
@ -106,7 +107,7 @@ static int fill_reader(struct reader *rd)
rd->strpos = 0;
return bytes;
};
return 0;
return bytes;
};
int __stdcall set_reader(struct reader *rd, unsigned int filepos)