From ff03b9eb6177c7fbdcc19f2a5e15fd507e0c27da Mon Sep 17 00:00:00 2001 From: zsknight <> Date: Thu, 17 May 2001 00:09:23 +0000 Subject: [PATCH] Pure dos fix --- zsnes/src/dos/dosintrf.asm | 67 ++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 36 deletions(-) diff --git a/zsnes/src/dos/dosintrf.asm b/zsnes/src/dos/dosintrf.asm index 637968da..27e6903c 100644 --- a/zsnes/src/dos/dosintrf.asm +++ b/zsnes/src/dos/dosintrf.asm @@ -81,7 +81,6 @@ EXTSYM GUINetTextk2 SECTION .data NEWSYM OSPort, db 0 ; 0 = DOS (C), 1 = DOS (ASM), 2 = Linux, 3 = Win95 -NEWSYM TextFile, db 0 SECTION .text NEWSYM StartUp @@ -250,13 +249,8 @@ NEWSYM MMXCheck ret NEWSYM Open_File - mov ax,3D00h - int 21h - ; return ax = file handle, carry = error - ret pushad mov dword[ZOpenMode],0 - mov byte[TextFile],1 mov dword[ZOpenFileName],edx call ZOpenFile cmp eax,0FFFFFFFFh @@ -277,12 +271,12 @@ NEWSYM Open_File popad stc ret - -NEWSYM Open_File_Write - mov ax,3D01h + mov ax,3D00h int 21h ; return ax = file handle, carry = error ret + +NEWSYM Open_File_Write pushad mov dword[ZOpenMode],2 mov dword[ZOpenFileName],edx @@ -305,13 +299,12 @@ NEWSYM Open_File_Write popad stc ret + mov ax,3D01h + int 21h + ; return ax = file handle, carry = error + ret NEWSYM Create_File - mov ah,3Ch - mov cx,0 - int 21h - ; return ax = file handle - ret pushad mov dword[ZOpenMode],1 mov dword[ZOpenFileName],edx @@ -327,11 +320,13 @@ NEWSYM Create_File popad stc ret + mov ah,3Ch + mov cx,0 + int 21h + ; return ax = file handle + ret NEWSYM Write_File - mov ah,40h - int 21h - ret mov dword[ZFileWriteHandle],0 mov [ZFileWriteHandle],bx mov [ZFileWriteSize],ecx @@ -349,11 +344,11 @@ NEWSYM Write_File mov eax,0 stc ret - -NEWSYM Read_File - mov ah,3Fh + mov ah,40h int 21h ret + +NEWSYM Read_File mov dword[ZFileReadHandle],0 mov [ZFileReadHandle],bx mov [ZFileReadSize],ecx @@ -365,6 +360,9 @@ NEWSYM Read_File mov eax,[TempVarSeek] clc ret + mov ah,3Fh + int 21h + ret NEWSYM Delete_File mov [ZFileDelFName],edx @@ -377,9 +375,6 @@ NEWSYM Delete_File ret NEWSYM Close_File - mov ah,3Eh - int 21h - ret mov dword[ZCloseFileHandle],0 mov [ZCloseFileHandle],bx pushad @@ -387,12 +382,11 @@ NEWSYM Close_File popad clc ret - -NEWSYM File_Seek - ; seek to cx:dx from 0 position, return carry as error - mov ax,4200h + mov ah,3Eh int 21h ret + +NEWSYM File_Seek mov word[ZFileSeekPos+2],cx mov word[ZFileSeekPos],dx mov dword[ZFileSeekMode],0 @@ -403,14 +397,13 @@ NEWSYM File_Seek popad mov ax,dx mov dx,cx - clc + ret + ; seek to cx:dx from 0 position, return carry as error + mov ax,4200h + int 21h ret 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],dx mov dword[ZFileSeekHandle],0 @@ -425,6 +418,11 @@ NEWSYM File_Seek_End popad mov ax,[TempVarSeek] 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 NEWSYM Get_Time @@ -1583,7 +1581,7 @@ NEWSYM StartSound 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 .nosound ret @@ -1610,9 +1608,6 @@ NEWSYM Check60hz ; Call the timer update function here ret -NEWSYM UpdateSoundAgain - ret - ; **************************** ; TCP/IP Stuff ; ****************************