Pure dos fix

This commit is contained in:
zsknight
2001-05-17 00:09:23 +00:00
parent 8162db0aca
commit ff03b9eb61

View File

@@ -81,7 +81,6 @@ EXTSYM GUINetTextk2
SECTION .data SECTION .data
NEWSYM OSPort, db 0 ; 0 = DOS (C), 1 = DOS (ASM), 2 = Linux, 3 = Win95 NEWSYM OSPort, db 0 ; 0 = DOS (C), 1 = DOS (ASM), 2 = Linux, 3 = Win95
NEWSYM TextFile, db 0
SECTION .text SECTION .text
NEWSYM StartUp NEWSYM StartUp
@@ -250,13 +249,8 @@ NEWSYM MMXCheck
ret ret
NEWSYM Open_File NEWSYM Open_File
mov ax,3D00h
int 21h
; return ax = file handle, carry = error
ret
pushad pushad
mov dword[ZOpenMode],0 mov dword[ZOpenMode],0
mov byte[TextFile],1
mov dword[ZOpenFileName],edx mov dword[ZOpenFileName],edx
call ZOpenFile call ZOpenFile
cmp eax,0FFFFFFFFh cmp eax,0FFFFFFFFh
@@ -277,12 +271,12 @@ NEWSYM Open_File
popad popad
stc stc
ret ret
mov ax,3D00h
NEWSYM Open_File_Write
mov ax,3D01h
int 21h int 21h
; return ax = file handle, carry = error ; return ax = file handle, carry = error
ret ret
NEWSYM Open_File_Write
pushad pushad
mov dword[ZOpenMode],2 mov dword[ZOpenMode],2
mov dword[ZOpenFileName],edx mov dword[ZOpenFileName],edx
@@ -305,13 +299,12 @@ NEWSYM Open_File_Write
popad popad
stc stc
ret ret
mov ax,3D01h
int 21h
; return ax = file handle, carry = error
ret
NEWSYM Create_File NEWSYM Create_File
mov ah,3Ch
mov cx,0
int 21h
; return ax = file handle
ret
pushad pushad
mov dword[ZOpenMode],1 mov dword[ZOpenMode],1
mov dword[ZOpenFileName],edx mov dword[ZOpenFileName],edx
@@ -327,11 +320,13 @@ NEWSYM Create_File
popad popad
stc stc
ret ret
mov ah,3Ch
mov cx,0
int 21h
; return ax = file handle
ret
NEWSYM Write_File NEWSYM Write_File
mov ah,40h
int 21h
ret
mov dword[ZFileWriteHandle],0 mov dword[ZFileWriteHandle],0
mov [ZFileWriteHandle],bx mov [ZFileWriteHandle],bx
mov [ZFileWriteSize],ecx mov [ZFileWriteSize],ecx
@@ -349,11 +344,11 @@ NEWSYM Write_File
mov eax,0 mov eax,0
stc stc
ret ret
mov ah,40h
NEWSYM Read_File
mov ah,3Fh
int 21h int 21h
ret ret
NEWSYM Read_File
mov dword[ZFileReadHandle],0 mov dword[ZFileReadHandle],0
mov [ZFileReadHandle],bx mov [ZFileReadHandle],bx
mov [ZFileReadSize],ecx mov [ZFileReadSize],ecx
@@ -365,6 +360,9 @@ NEWSYM Read_File
mov eax,[TempVarSeek] mov eax,[TempVarSeek]
clc clc
ret ret
mov ah,3Fh
int 21h
ret
NEWSYM Delete_File NEWSYM Delete_File
mov [ZFileDelFName],edx mov [ZFileDelFName],edx
@@ -377,9 +375,6 @@ NEWSYM Delete_File
ret ret
NEWSYM Close_File NEWSYM Close_File
mov ah,3Eh
int 21h
ret
mov dword[ZCloseFileHandle],0 mov dword[ZCloseFileHandle],0
mov [ZCloseFileHandle],bx mov [ZCloseFileHandle],bx
pushad pushad
@@ -387,12 +382,11 @@ NEWSYM Close_File
popad popad
clc clc
ret ret
mov ah,3Eh
NEWSYM File_Seek
; seek to cx:dx from 0 position, return carry as error
mov ax,4200h
int 21h int 21h
ret ret
NEWSYM File_Seek
mov word[ZFileSeekPos+2],cx mov word[ZFileSeekPos+2],cx
mov word[ZFileSeekPos],dx mov word[ZFileSeekPos],dx
mov dword[ZFileSeekMode],0 mov dword[ZFileSeekMode],0
@@ -403,14 +397,13 @@ NEWSYM File_Seek
popad popad
mov ax,dx mov ax,dx
mov dx,cx mov dx,cx
clc ret
; seek to cx:dx from 0 position, return carry as error
mov ax,4200h
int 21h
ret ret
NEWSYM File_Seek_End NEWSYM File_Seek_End
; seek to cx:dx from end position, and return file location in dx:ax
mov ax,4202h
int 21h
ret
mov word[ZFileSeekPos+2],cx mov word[ZFileSeekPos+2],cx
mov word[ZFileSeekPos],dx mov word[ZFileSeekPos],dx
mov dword[ZFileSeekHandle],0 mov dword[ZFileSeekHandle],0
@@ -425,6 +418,11 @@ NEWSYM File_Seek_End
popad popad
mov ax,[TempVarSeek] mov ax,[TempVarSeek]
mov dx,[TempVarSeek+2] mov dx,[TempVarSeek+2]
clc
ret
; seek to cx:dx from end position, and return file location in dx:ax
mov ax,4202h
int 21h
ret ret
NEWSYM Get_Time NEWSYM Get_Time
@@ -1583,7 +1581,7 @@ NEWSYM StartSound
NEWSYM SoundProcess ; This function is called ~60 times/s at full speed NEWSYM SoundProcess ; This function is called ~60 times/s at full speed
; cmp byte[OSPort],1 ; Do not call in the dos port cmp byte[OSPort],1 ; Do not call in the dos port
; ja .notdos ; ja .notdos
.nosound .nosound
ret ret
@@ -1610,9 +1608,6 @@ NEWSYM Check60hz
; Call the timer update function here ; Call the timer update function here
ret ret
NEWSYM UpdateSoundAgain
ret
; **************************** ; ****************************
; TCP/IP Stuff ; TCP/IP Stuff
; **************************** ; ****************************