Load dialog fixed up, big thanks to relnev
Remaining keys fixed in dialog
This commit is contained in:
@@ -1076,13 +1076,21 @@ Win95Failed db 0
|
|||||||
|
|
||||||
NEWSYM GetCurDir
|
NEWSYM GetCurDir
|
||||||
; get Drive/Dir
|
; get Drive/Dir
|
||||||
|
%ifndef __LINUX__
|
||||||
mov ebx,GUIcurrentdir+3
|
mov ebx,GUIcurrentdir+3
|
||||||
|
%else
|
||||||
|
mov ebx,GUIcurrentdir
|
||||||
|
%endif
|
||||||
mov edx,GUIcurrentdir
|
mov edx,GUIcurrentdir
|
||||||
call Get_Dir
|
call Get_Dir
|
||||||
|
|
||||||
|
%ifndef __LINUX__
|
||||||
add byte[GUIcurrentdir],65
|
add byte[GUIcurrentdir],65
|
||||||
|
|
||||||
mov byte[GUIcurrentdir+1],':'
|
mov byte[GUIcurrentdir+1],':'
|
||||||
mov byte[GUIcurrentdir+2],'\'
|
mov byte[GUIcurrentdir+2],'\'
|
||||||
|
%endif
|
||||||
|
|
||||||
cmp byte[GUIcurrentdir+35],0
|
cmp byte[GUIcurrentdir+35],0
|
||||||
je .nodotend
|
je .nodotend
|
||||||
mov byte[GUIcurrentdir+35],'.'
|
mov byte[GUIcurrentdir+35],'.'
|
||||||
@@ -1341,6 +1349,7 @@ GUIGetDirs:
|
|||||||
je near .sortagain
|
je near .sortagain
|
||||||
pop edi
|
pop edi
|
||||||
.nodirs
|
.nodirs
|
||||||
|
%ifndef __LINUX__
|
||||||
cmp byte[GUIloadfntype],0
|
cmp byte[GUIloadfntype],0
|
||||||
je near .drive2
|
je near .drive2
|
||||||
mov esi,[GUInumentries]
|
mov esi,[GUInumentries]
|
||||||
@@ -1368,6 +1377,7 @@ GUIGetDirs:
|
|||||||
dec ecx
|
dec ecx
|
||||||
jnz .nextdriveb
|
jnz .nextdriveb
|
||||||
.nodrive
|
.nodrive
|
||||||
|
%endif
|
||||||
ret
|
ret
|
||||||
|
|
||||||
BubbleSorted db 0
|
BubbleSorted db 0
|
||||||
|
|||||||
@@ -280,15 +280,15 @@ void ProcessKeyBuf(int scancode)
|
|||||||
} else {
|
} else {
|
||||||
switch (scancode) {
|
switch (scancode) {
|
||||||
// Fix these for proper SDL usage - DDOI
|
// Fix these for proper SDL usage - DDOI
|
||||||
case SDLK_UNDERSCORE: vkeyval='_'; accept=true; break;
|
case SDLK_MINUS: vkeyval='_'; accept=true; break;
|
||||||
case SDLK_PLUS: vkeyval='+'; accept=true; break;
|
case SDLK_EQUALS: vkeyval='+'; accept=true; break;
|
||||||
case SDLK_LEFTBRACKET: vkeyval='{'; accept=true; break;
|
case SDLK_LEFTBRACKET: vkeyval='{'; accept=true; break;
|
||||||
case SDLK_RIGHTBRACKET: vkeyval='}'; accept=true; break;
|
case SDLK_RIGHTBRACKET: vkeyval='}'; accept=true; break;
|
||||||
case SDLK_COLON: vkeyval=':'; accept=true; break;
|
case SDLK_SEMICOLON: vkeyval=':'; accept=true; break;
|
||||||
case SDLK_QUOTEDBL: vkeyval='"'; accept=true; break;
|
case SDLK_QUOTE: vkeyval='"'; accept=true; break;
|
||||||
case SDLK_LESS: vkeyval='<'; accept=true; break;
|
case SDLK_COMMA: vkeyval='<'; accept=true; break;
|
||||||
case SDLK_GREATER: vkeyval='>'; accept=true; break;
|
case SDLK_PERIOD: vkeyval='>'; accept=true; break;
|
||||||
case SDLK_QUESTION: vkeyval='?'; accept=true; break;
|
case SDLK_SLASH: vkeyval='?'; accept=true; break;
|
||||||
case SDLK_BACKQUOTE: vkeyval='~'; accept=true; break;
|
case SDLK_BACKQUOTE: vkeyval='~'; accept=true; break;
|
||||||
case SDLK_BACKSLASH: vkeyval='|'; accept=true; break;
|
case SDLK_BACKSLASH: vkeyval='|'; accept=true; break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -846,22 +846,23 @@ NEWSYM Remove_Dir
|
|||||||
; mov ebx,LoadDir
|
; mov ebx,LoadDir
|
||||||
; call Change_Dir
|
; call Change_Dir
|
||||||
NEWSYM Change_Dir
|
NEWSYM Change_Dir
|
||||||
pushad
|
;pushad
|
||||||
|
|
||||||
and edx,0FFh
|
; Not needed for Linux - DDOI
|
||||||
add edx,1
|
;and edx,0FFh
|
||||||
push edx
|
;add edx,1
|
||||||
call _chdrive
|
;push edx
|
||||||
pop edx
|
;call _chdrive
|
||||||
|
;pop edx
|
||||||
|
|
||||||
; mov ah,0Eh
|
; mov ah,0Eh
|
||||||
; int 21h
|
; int 21h
|
||||||
; jc .fail
|
; jc .fail
|
||||||
mov dword[CHPath],gotoroot
|
;mov dword[CHPath],gotoroot
|
||||||
call ZFileCHDir
|
;call ZFileCHDir
|
||||||
or eax,eax
|
;or eax,eax
|
||||||
jnz .fail
|
;jnz .fail
|
||||||
popad
|
;popad
|
||||||
mov [CHPath],ebx
|
mov [CHPath],ebx
|
||||||
cmp byte[ebx],0
|
cmp byte[ebx],0
|
||||||
je .nocdir
|
je .nocdir
|
||||||
@@ -903,9 +904,9 @@ NEWSYM Get_Dir
|
|||||||
call ZFileGetDir
|
call ZFileGetDir
|
||||||
mov eax,[DirName]
|
mov eax,[DirName]
|
||||||
mov ebx,eax
|
mov ebx,eax
|
||||||
mov ecx,125
|
mov ecx,128
|
||||||
.loop
|
.loop
|
||||||
mov dl,[eax+3]
|
mov dl,[eax]
|
||||||
cmp dl,'/'
|
cmp dl,'/'
|
||||||
jne .noslash
|
jne .noslash
|
||||||
;mov dl,'\'
|
;mov dl,'\'
|
||||||
@@ -914,13 +915,13 @@ NEWSYM Get_Dir
|
|||||||
inc eax
|
inc eax
|
||||||
loop .loop
|
loop .loop
|
||||||
popad
|
popad
|
||||||
push edx
|
; push edx
|
||||||
call _getdrive
|
; call _getdrive
|
||||||
; mov ah,19h
|
; mov ah,19h
|
||||||
; int 21h
|
; int 21h
|
||||||
sub al,1
|
; sub al,1
|
||||||
pop edx
|
; pop edx
|
||||||
mov [edx],al
|
; mov [edx],al
|
||||||
ret
|
ret
|
||||||
|
|
||||||
push edx
|
push edx
|
||||||
@@ -1459,7 +1460,7 @@ cpuidtext db 'NOTE: If ZSNES crashes here, then please re-run. ',0
|
|||||||
cpuidtext2 db 13,' ',13,0
|
cpuidtext2 db 13,' ',13,0
|
||||||
YesMMX db 'MMX support enabled.',13,10,13,10,0
|
YesMMX db 'MMX support enabled.',13,10,13,10,0
|
||||||
TempVarSeek dd 0
|
TempVarSeek dd 0
|
||||||
gotoroot db '\',0
|
gotoroot db '/',0
|
||||||
SECTION .text
|
SECTION .text
|
||||||
|
|
||||||
; ****************************
|
; ****************************
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <glob.h>
|
||||||
#else
|
#else
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
@@ -226,9 +227,9 @@ int TempFind;
|
|||||||
int FindFirstHandle;
|
int FindFirstHandle;
|
||||||
struct _finddata_t FindDataStruct;
|
struct _finddata_t FindDataStruct;
|
||||||
#else
|
#else
|
||||||
struct dirent *next;
|
|
||||||
DIR *FindFirstHandle;
|
|
||||||
int ignoredirs=0;
|
int ignoredirs=0;
|
||||||
|
glob_t globbuf;
|
||||||
|
int globcur;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DWORD ZFileFindNext()
|
DWORD ZFileFindNext()
|
||||||
@@ -237,17 +238,32 @@ DWORD ZFileFindNext()
|
|||||||
//STUB_FUNCTION;
|
//STUB_FUNCTION;
|
||||||
struct stat filetype;
|
struct stat filetype;
|
||||||
|
|
||||||
next = readdir (FindFirstHandle );
|
if (globcur == -1)
|
||||||
if ( next == NULL ) return -1;
|
return -1;
|
||||||
|
|
||||||
|
globcur++;
|
||||||
|
if (globcur > globbuf.gl_pathc) /* >= */
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (globcur == globbuf.gl_pathc) {
|
||||||
|
/* this is the end, so just add it ourselves */
|
||||||
|
*(char *)(DTALocPos + 0x15) = 0x10;
|
||||||
|
strcpy((char *)DTALocPos + 0x1E, "..");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
*(char *)(DTALocPos + 0x15) = 0;
|
*(char *)(DTALocPos + 0x15) = 0;
|
||||||
|
|
||||||
stat ( next->d_name, &filetype );
|
stat ( globbuf.gl_pathv[globcur], &filetype );
|
||||||
|
|
||||||
if(ZFileFindATTRIB&0x10 && !S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
if(ZFileFindATTRIB&0x10 && !S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
||||||
if((ZFileFindATTRIB&0x10==0) && S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
if((ZFileFindATTRIB&0x10==0) && S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
||||||
|
|
||||||
if ( S_ISDIR ( filetype.st_mode ))
|
if ( S_ISDIR ( filetype.st_mode ))
|
||||||
*(char *)(DTALocPos + 0x15) = 0x10;
|
*(char *)(DTALocPos + 0x15) = 0x10;
|
||||||
strcpy((char *)DTALocPos + 0x1E, next->d_name);
|
|
||||||
|
strcpy((char *)DTALocPos + 0x1E, globbuf.gl_pathv[globcur]);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
TempFind=_findnext(FindFirstHandle,&FindDataStruct);
|
TempFind=_findnext(FindFirstHandle,&FindDataStruct);
|
||||||
if(TempFind==-1) return(-1);
|
if(TempFind==-1) return(-1);
|
||||||
@@ -270,18 +286,18 @@ DWORD ZFileFindFirst()
|
|||||||
//STUB_FUNCTION;
|
//STUB_FUNCTION;
|
||||||
struct stat filetype;
|
struct stat filetype;
|
||||||
|
|
||||||
FindFirstHandle = opendir ( ZFileFindPATH );
|
if (globcur != -1) {
|
||||||
|
globfree(&globbuf);
|
||||||
|
globcur = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (glob(ZFileFindPATH, 0, NULL, &globbuf))
|
||||||
|
return -1;
|
||||||
|
globcur = 0;
|
||||||
|
|
||||||
*(char *)(DTALocPos + 0x15) = 0;
|
*(char *)(DTALocPos + 0x15) = 0;
|
||||||
|
|
||||||
TempFind = 0;
|
stat ( globbuf.gl_pathv[globcur], &filetype );
|
||||||
|
|
||||||
if ( FindFirstHandle==NULL ) return -1;
|
|
||||||
|
|
||||||
next = readdir ( FindFirstHandle );
|
|
||||||
if (next == NULL) return -1;
|
|
||||||
|
|
||||||
stat ( next->d_name, &filetype );
|
|
||||||
|
|
||||||
if(ZFileFindATTRIB&0x10 && !S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
if(ZFileFindATTRIB&0x10 && !S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
||||||
if((ZFileFindATTRIB&0x10==0) && S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
if((ZFileFindATTRIB&0x10==0) && S_ISDIR ( filetype.st_mode )) return(ZFileFindNext());
|
||||||
@@ -289,7 +305,7 @@ DWORD ZFileFindFirst()
|
|||||||
if ( S_ISDIR ( filetype.st_mode ))
|
if ( S_ISDIR ( filetype.st_mode ))
|
||||||
*(char *)(DTALocPos + 0x15) = 0x10;
|
*(char *)(DTALocPos + 0x15) = 0x10;
|
||||||
|
|
||||||
strcpy ((char *) DTALocPos + 0x1E, next->d_name);
|
strcpy((char *)DTALocPos + 0x1E, globbuf.gl_pathv[globcur]);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
FindFirstHandle=_findfirst(ZFileFindPATH,&FindDataStruct);
|
FindFirstHandle=_findfirst(ZFileFindPATH,&FindDataStruct);
|
||||||
@@ -311,7 +327,10 @@ DWORD ZFileFindEnd() // for compatibility with windows later
|
|||||||
{
|
{
|
||||||
#ifdef __LINUX__
|
#ifdef __LINUX__
|
||||||
//STUB_FUNCTION;
|
//STUB_FUNCTION;
|
||||||
closedir(FindFirstHandle);
|
if (globcur != -1) {
|
||||||
|
globfree(&globbuf);
|
||||||
|
globcur = -1;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
_findclose(FindFirstHandle);
|
_findclose(FindFirstHandle);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -341,8 +341,12 @@ NEWSYM getcmdline
|
|||||||
.next2
|
.next2
|
||||||
cmp eax,edi
|
cmp eax,edi
|
||||||
je .nomore
|
je .nomore
|
||||||
|
%ifdef __LINUX__
|
||||||
|
cmp byte[eax],'/'
|
||||||
|
%else
|
||||||
cmp byte[eax],'\'
|
cmp byte[eax],'\'
|
||||||
je .found
|
je .found
|
||||||
|
%endif
|
||||||
cmp byte[eax],':'
|
cmp byte[eax],':'
|
||||||
jne .next
|
jne .next
|
||||||
.found
|
.found
|
||||||
@@ -493,7 +497,7 @@ NEWSYM getcmdline
|
|||||||
|
|
||||||
SECTION .data
|
SECTION .data
|
||||||
.string2s db 'CMDLINE',0
|
.string2s db 'CMDLINE',0
|
||||||
.stringnf db 'SET CMDLINE LINE NOT FOUND!',13,10,0
|
.stringnf db 'SET CMDLINE LINE NOT FOUND!',13,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
|
||||||
|
|||||||
Reference in New Issue
Block a user