Zipped ROM support
This commit is contained in:
@@ -83,9 +83,9 @@ EXTSYM pal16bxcl,ram7fa,regptra,regptwa,srama,vidmemch2,vidmemch4
|
||||
EXTSYM vidmemch8,vcache2b,vcache4b,vcache8b,vram,wramdata
|
||||
EXTSYM wramdataa
|
||||
EXTSYM fname,fnames,GetCurDir
|
||||
;EXTSYM GUIcurrentdir,extractzip,PrintStr
|
||||
EXTSYM GUIcurrentdir,extractzip,PrintStr
|
||||
;STUB DDOI
|
||||
EXTSYM GUIcurrentdir, PrintStr
|
||||
;EXTSYM GUIcurrentdir, PrintStr
|
||||
EXTSYM GUIsmcfind,GUIsfcfind,GUIswcfind,GUIfigfind,GUIfind058,GUIfind078,GUIfindBIN
|
||||
;EXTSYM GUIfindUSA,GUIfindJAP,GUIfindZIP,GUIfind1,DTALoc,GUIfindall,ZipError
|
||||
EXTSYM GUIfindUSA,GUIfindJAP,GUIfindZIP,GUIfind1,DTALoc,GUIfindall
|
||||
@@ -3562,9 +3562,6 @@ InvalidZip db 'ZSNES Version A does not support .ZIP files.',13,10,'Please use V
|
||||
|
||||
ZipError db 0
|
||||
|
||||
extractzip:
|
||||
ret
|
||||
|
||||
UnZipFile:
|
||||
cmp byte[OSPort],1
|
||||
jne .noasm
|
||||
@@ -3575,14 +3572,24 @@ UnZipFile:
|
||||
jmp DosExit
|
||||
.noasm
|
||||
; get Drive/Dir
|
||||
%ifdef __LINUX__
|
||||
mov ebx,GUIcurrentdir
|
||||
%else
|
||||
mov ebx,GUIcurrentdir+3
|
||||
%endif
|
||||
mov edx,GUIcurrentdir
|
||||
call Get_Dir
|
||||
%ifndef __LINUX__
|
||||
add byte[GUIcurrentdir],65
|
||||
%endif
|
||||
cmp byte[InGUI],0
|
||||
je near .nochange
|
||||
; locate end of string & append filename
|
||||
%ifdef __LINUX__
|
||||
mov eax,GUIcurrentdir
|
||||
%else
|
||||
mov eax,GUIcurrentdir+3
|
||||
%endif
|
||||
.loop
|
||||
cmp byte[eax],0
|
||||
je .endfound
|
||||
@@ -3591,7 +3598,11 @@ UnZipFile:
|
||||
.endfound
|
||||
cmp byte[eax-2],':'
|
||||
je .noaddslash
|
||||
%ifdef __LINUX__
|
||||
mov byte[eax],'/'
|
||||
%else
|
||||
mov byte[eax],'\'
|
||||
%endif
|
||||
inc eax
|
||||
.noaddslash
|
||||
mov ebx,fname+1
|
||||
|
||||
@@ -187,7 +187,7 @@ DWORD ZFileGetFTime()
|
||||
DWORD ZFileMKDir()
|
||||
{
|
||||
#ifdef __LINUX__
|
||||
return(mkdir(MKPath, 0xff));
|
||||
return(mkdir(MKPath, (S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH)));
|
||||
#else
|
||||
return(mkdir(MKPath));
|
||||
#endif
|
||||
|
||||
@@ -22,6 +22,7 @@ GUIDIR=gui
|
||||
VIDEODIR=video
|
||||
WINDIR=linux
|
||||
OBJDIR=obj
|
||||
ZIPDIR=zip
|
||||
|
||||
CHIPSOBJ=${CHIPDIR}/sfxproc.o ${CHIPDIR}/fxemu2.o ${CHIPDIR}/dsp1proc.o\
|
||||
${CHIPDIR}/fxemu2b.o ${CHIPDIR}/fxemu2c.o ${CHIPDIR}/fxtable.o\
|
||||
@@ -51,10 +52,12 @@ WINDOSOBJ=${DOSDIR}/debug.o ${DOSDIR}/joy.o ${DOSDIR}/modemrtn.o ${DOSDIR}/vesa2
|
||||
|
||||
#PREOBJ=${OBJDIR}/unzip.o ${OBJDIR}/zzip.o ${DOSDIR}/zsipx.o
|
||||
|
||||
ZIPOBJ=${ZIPDIR}/zzip.o ${ZIPDIR}/unzip.o
|
||||
|
||||
MAINOBJ=cfgload.o endmem.o fixsin.o init.o ui.o vcache.o water.o
|
||||
|
||||
OBJS=${CHIPSOBJ} ${CPUOBJ} ${WINOBJ} ${WINDOSOBJ} ${GUIOBJ} ${VIDEOBJ} ${PREOBJ} ${MAINOBJ}
|
||||
LIBS=`sdl-config --libs`
|
||||
OBJS=${CHIPSOBJ} ${CPUOBJ} ${WINOBJ} ${WINDOSOBJ} ${GUIOBJ} ${VIDEOBJ} ${ZIPOBJ} ${MAINOBJ}
|
||||
LIBS=`sdl-config --libs` -lz
|
||||
CFLAGS=-g -D__LINUX__ `sdl-config --cflags`
|
||||
ASM=nasm
|
||||
ASMFLAGS=-f elf -D__LINUX__ -g
|
||||
@@ -63,7 +66,7 @@ PP=g++
|
||||
|
||||
|
||||
.SUFFIXES: .c .cpp .asm
|
||||
|
||||
|
||||
%.o: %.c
|
||||
${CC} ${CFLAGS} -o $@ -c $<
|
||||
|
||||
@@ -72,13 +75,15 @@ PP=g++
|
||||
|
||||
%.o: %.asm
|
||||
${ASM} ${ASMFLAGS} -o $@ $<
|
||||
|
||||
|
||||
|
||||
ALL: zsnes
|
||||
|
||||
zsnes: ${OBJS}
|
||||
${CC} -o zsnes ${OBJS} ${LIBS}
|
||||
|
||||
${ZIPDIR}/unzip.o: ${ZIPDIR}/unzip.c ${ZIPDIR}/unzip.h
|
||||
${ZIPDIR}/zzip.o: ${ZIPDIR}/zzip.c ${ZIPDIR}/unzip.h
|
||||
${DOSDIR}/zloader.o: ${DOSDIR}/zloader.c
|
||||
fixsin.o: fixsin.c
|
||||
water.o: water.c
|
||||
|
||||
Reference in New Issue
Block a user