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 <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="2" Optimization="3"
InlineFunctionExpansion="0" InlineFunctionExpansion="0"
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="0"
/> />
</FileConfiguration> </FileConfiguration>
</File> </File>
<File <File
RelativePath=".\crt.c" RelativePath=".\crt.c"
> >
<FileConfiguration
Name="Debug|Win32"
>
<Tool
Name="VCCLCompilerTool"
AssemblerOutput="1"
/>
</FileConfiguration>
</File> </File>
<File <File
RelativePath=".\k_lib.asm" RelativePath=".\k_lib.asm"

View File

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

View File

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

View File

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