various fixes, the most significant being that saving state now works.

This commit is contained in:
theoddone33
2001-04-15 01:23:24 +00:00
parent 3d00b7f21a
commit 918f4b7048
5 changed files with 47 additions and 40 deletions

View File

@@ -3237,7 +3237,11 @@ OpenCombFile:
je .found2 je .found2
jmp .found jmp .found
.found2 .found2
%ifdef __LINUX__
mov dword[edx],'.cmb'
%else
mov dword[edx],'.CMB' mov dword[edx],'.CMB'
%endif
push edx push edx
mov dword[NumComboLocl],0 mov dword[NumComboLocl],0
mov edx,fnames+1 mov edx,fnames+1
@@ -3262,7 +3266,11 @@ OpenCombFile:
call Close_File call Close_File
.failb .failb
pop edx pop edx
%ifdef __LINUX__
mov dword[edx],'.srm'
%else
mov dword[edx],'.SRM' mov dword[edx],'.SRM'
%endif
ret ret
NEWSYM SaveCombFile NEWSYM SaveCombFile
@@ -3303,7 +3311,11 @@ NEWSYM SaveCombFile
call Close_File call Close_File
.failb .failb
pop edx pop edx
%ifdef __LINUX__
mov dword[edx],'.srm'
%else
mov dword[edx],'.SRM' mov dword[edx],'.SRM'
%endif
.notfound .notfound
ret ret

View File

@@ -335,7 +335,7 @@ NEWSYM WaitForKey ; Wait for a key to be pressed
NEWSYM OsExit NEWSYM OsExit
NEWSYM OSExit NEWSYM OSExit
call exit call exit
int 3h ;int 3h
jmp DosExit jmp DosExit
NEWSYM MMXCheck NEWSYM MMXCheck
@@ -403,8 +403,8 @@ NEWSYM Open_File
popad popad
stc stc
ret ret
mov ax,3D00h ;mov ax,3D00h
int 21h ;int 21h
; return bx = file handle, carry = error ; return bx = file handle, carry = error
ret ret
@@ -428,8 +428,8 @@ NEWSYM Open_File_Write
popad popad
stc stc
ret ret
mov ax,3D01h ;mov ax,3D01h
int 21h ;int 21h
; return bx = file handle, carry = error ; return bx = file handle, carry = error
ret ret
@@ -449,9 +449,9 @@ NEWSYM Create_File
popad popad
stc stc
ret ret
mov ah,3Ch ;mov ah,3Ch
mov cx,0 ;mov cx,0
int 21h ;int 21h
; return bx = file handle ; return bx = file handle
ret ret
@@ -473,8 +473,8 @@ NEWSYM Write_File
mov eax,0 mov eax,0
stc stc
ret ret
mov ah,40h ;mov ah,40h
int 21h ;int 21h
ret ret
NEWSYM Read_File NEWSYM Read_File
@@ -489,8 +489,8 @@ NEWSYM Read_File
mov eax,[TempVarSeek] mov eax,[TempVarSeek]
clc clc
ret ret
mov ah,3Fh ;mov ah,3Fh
int 21h ;int 21h
ret ret
NEWSYM Delete_File NEWSYM Delete_File
@@ -499,8 +499,8 @@ NEWSYM Delete_File
call ZFileDelete call ZFileDelete
popad popad
ret ret
mov ah,41h ;mov ah,41h
int 21h ;int 21h
ret ret
NEWSYM Close_File NEWSYM Close_File
@@ -511,8 +511,8 @@ NEWSYM Close_File
popad popad
clc clc
ret ret
mov ah,3Eh ;mov ah,3Eh
int 21h ;int 21h
ret ret
NEWSYM File_Seek NEWSYM File_Seek
@@ -528,8 +528,8 @@ NEWSYM File_Seek
mov dx,cx mov dx,cx
ret ret
; seek to cx:dx from 0 position, return carry as error ; seek to cx:dx from 0 position, return carry as error
mov ax,4200h ;mov ax,4200h
int 21h ;int 21h
ret ret
NEWSYM File_Seek_End NEWSYM File_Seek_End
@@ -549,8 +549,8 @@ NEWSYM File_Seek_End
mov dx,[TempVarSeek+2] mov dx,[TempVarSeek+2]
ret ret
; seek to cx:dx from end position, and return file location in dx:ax ; seek to cx:dx from end position, and return file location in dx:ax
mov ax,4202h ;mov ax,4202h
int 21h ;int 21h
ret ret
NEWSYM Get_Time NEWSYM Get_Time
@@ -585,9 +585,9 @@ NEWSYM Get_File_Date
mov cx,[ZFTime] mov cx,[ZFTime]
ret ret
; return packed date in dx:cx ; return packed date in dx:cx
mov ah,57h ;mov ah,57h
mov al,00h ;mov al,00h
int 21h ;int 21h
ret ret
@@ -802,8 +802,8 @@ NEWSYM Change_Single_Dir
stc stc
ret ret
; Dir in edx, return error in carry flag ; Dir in edx, return error in carry flag
mov ah,3Bh ;mov ah,3Bh
int 21h ;int 21h
ret ret
NEWSYM Create_Dir NEWSYM Create_Dir
@@ -820,8 +820,8 @@ NEWSYM Create_Dir
popad popad
stc stc
ret ret
mov ah,39h ;mov ah,39h
int 21h ;int 21h
ret ret
NEWSYM Remove_Dir NEWSYM Remove_Dir
@@ -838,8 +838,8 @@ NEWSYM Remove_Dir
popad popad
stc stc
ret ret
mov ah,3Ah ;mov ah,3Ah
int 21h ;int 21h
ret ret
; mov dl,[LoadDrive] ; mov dl,[LoadDrive]
@@ -908,7 +908,7 @@ NEWSYM Get_Dir
mov dl,[eax+3] mov dl,[eax+3]
cmp dl,'/' cmp dl,'/'
jne .noslash jne .noslash
mov dl,'\' ;mov dl,'\'
.noslash .noslash
mov [eax],dl mov [eax],dl
inc eax inc eax

View File

@@ -32,12 +32,11 @@
#ifdef __LINUX__ #ifdef __LINUX__
#define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid()) #define STUB_FUNCTION fprintf(stderr,"STUB: %s at " __FILE__ ", line %d, thread %d\n",__FUNCTION__,__LINE__,getpid())
#endif #endif
#include <errno.h>
FILE *FILEHANDLE[16]; FILE *FILEHANDLE[16];
DWORD CurrentHandle=0; DWORD CurrentHandle=0;
// ZFileSystemInit // ZFileSystemInit
// return 0 // return 0
@@ -315,14 +314,10 @@ DWORD GetDate()
#ifdef __LINUX__ #ifdef __LINUX__
int _chdrive( int drive ) int _chdrive( int drive )
{ {
STUB_FUNCTION; // STUB_FUNCTION;
} }
int _getdrive( void ) int _getdrive( void )
{ {
STUB_FUNCTION; // STUB_FUNCTION;
}
void _splitpath( const char *path, char *drive, char *dir, char *fname, char *ext )
{
STUB_FUNCTION;
} }
#endif #endif

View File

@@ -336,7 +336,7 @@ int main (int argc, char *argv[]) {
#endif #endif
{ {
fvar=&fname; fvar=&fname;
fvar[0] = 10; fvar[0] = strlen(argv[optind]);
strncpy(&fvar[1], argv[optind],127); strncpy(&fvar[1], argv[optind],127);
makeextension(); makeextension();
} }

View File

@@ -494,7 +494,7 @@ NEWSYM getcmdline
SECTION .data SECTION .data
.string2s db 'CMDLINE',0 .string2s db 'CMDLINE',0
.stringnf db 'SET CMDLINE LINE NOT FOUND!',0 .stringnf db 'SET CMDLINE LINE NOT FOUND!',13,10,0
NEWSYM CMDLineStr, times 256 db 0 NEWSYM CMDLineStr, times 256 db 0
NEWSYM GUIFName, times 256 db 0 NEWSYM GUIFName, times 256 db 0