mirror of
https://github.com/libretro/PUAE.git
synced 2024-11-24 00:09:54 +00:00
syncing 2.3.0
This commit is contained in:
parent
d3f9e986a6
commit
bfe77db81e
@ -1718,7 +1718,6 @@ AC_CONFIG_LINKS(src/guidep:src/$GUI_DEP)
|
||||
AC_CONFIG_FILES([Makefile
|
||||
src/Makefile
|
||||
src/archivers/dms/Makefile
|
||||
src/archivers/lha/Makefile
|
||||
src/archivers/zip/Makefile
|
||||
src/caps/Makefile
|
||||
src/md-generic/Makefile
|
||||
|
@ -4,7 +4,7 @@ AM_CPPFLAGS += -I$(top_srcdir)/src/include -I$(top_builddir)/src -I$(top_srcdir)
|
||||
|
||||
SUBDIRS = \
|
||||
tools @MACHDEP@ @THREADDEP@ @GFX_DEP@ @SND_DEP@ @JOY_DEP@ @GUI_DEP@ \
|
||||
@OSDEP@ keymap archivers/dms archivers/lha archivers/zip caps
|
||||
@OSDEP@ keymap archivers/dms archivers/zip caps
|
||||
|
||||
DIST_SUBDIRS = \
|
||||
md-generic md-68k md-i386-gcc md-ppc md-ppc-gcc md-amd64-gcc \
|
||||
@ -14,7 +14,7 @@ DIST_SUBDIRS = \
|
||||
gui-none gui-beos gui-cocoa gui-gtk gui-muirexx \
|
||||
od-generic od-amiga od-beos od-linux od-macosx od-win32 \
|
||||
td-none td-amigaos td-beos td-posix td-sdl td-win32 \
|
||||
keymap caps archivers/dms archivers/lha archivers/zip
|
||||
keymap caps archivers/dms archivers/zip
|
||||
|
||||
BUILT_SOURCES = \
|
||||
blit.h blitfunc.h blitfunc.c blittable.c \
|
||||
@ -158,7 +158,6 @@ uae_DEPENDENCIES = \
|
||||
@GUI_DEP@/libguidep.a \
|
||||
keymap/libkeymap.a \
|
||||
archivers/dms/libdms.a \
|
||||
archivers/lha/liblha.a \
|
||||
archivers/zip/libzip.a \
|
||||
caps/libcaps.a \
|
||||
blitfunc.o blittable.o \
|
||||
@ -182,7 +181,6 @@ uae_LDADD = \
|
||||
@GUI_DEP@/libguidep.a \
|
||||
keymap/libkeymap.a \
|
||||
archivers/dms/libdms.a \
|
||||
archivers/lha/liblha.a \
|
||||
archivers/zip/libzip.a \
|
||||
caps/libcaps.a \
|
||||
blitfunc.o blittable.o \
|
||||
|
@ -309,7 +309,7 @@ AM_CPPFLAGS = @UAE_CPPFLAGS@ -I$(top_srcdir)/src/include \
|
||||
-I$(top_builddir)/src -I$(top_srcdir)/src -I$(top_srcdir)
|
||||
SUBDIRS = \
|
||||
tools @MACHDEP@ @THREADDEP@ @GFX_DEP@ @SND_DEP@ @JOY_DEP@ @GUI_DEP@ \
|
||||
@OSDEP@ keymap archivers/dms archivers/lha archivers/zip caps
|
||||
@OSDEP@ keymap archivers/dms archivers/zip caps
|
||||
|
||||
DIST_SUBDIRS = \
|
||||
md-generic md-68k md-i386-gcc md-ppc md-ppc-gcc md-amd64-gcc \
|
||||
@ -319,7 +319,7 @@ DIST_SUBDIRS = \
|
||||
gui-none gui-beos gui-cocoa gui-gtk gui-muirexx \
|
||||
od-generic od-amiga od-beos od-linux od-macosx od-win32 \
|
||||
td-none td-amigaos td-beos td-posix td-sdl td-win32 \
|
||||
keymap caps archivers/dms archivers/lha archivers/zip
|
||||
keymap caps archivers/dms archivers/zip
|
||||
|
||||
BUILT_SOURCES = \
|
||||
blit.h blitfunc.h blitfunc.c blittable.c \
|
||||
@ -437,7 +437,6 @@ uae_DEPENDENCIES = \
|
||||
@GUI_DEP@/libguidep.a \
|
||||
keymap/libkeymap.a \
|
||||
archivers/dms/libdms.a \
|
||||
archivers/lha/liblha.a \
|
||||
archivers/zip/libzip.a \
|
||||
caps/libcaps.a \
|
||||
blitfunc.o blittable.o \
|
||||
@ -456,12 +455,11 @@ uae_DEPENDENCIES = \
|
||||
uae_LDADD = @MACHDEP@/libmachdep.a @JOY_DEP@/libjoydep.a \
|
||||
@SND_DEP@/libsnddep.a @GFX_DEP@/libgfxdep.a \
|
||||
@GUI_DEP@/libguidep.a keymap/libkeymap.a \
|
||||
archivers/dms/libdms.a archivers/lha/liblha.a \
|
||||
archivers/zip/libzip.a caps/libcaps.a blitfunc.o blittable.o \
|
||||
cpustbl.o cpudefs.o libcpuemu.a @EXTRAOBJS@ @FILESYSOBJS@ \
|
||||
@BSDSOCKOBJS@ @SCSIOBJS@ @CDOBJS@ @DEBUGOBJS@ @ASMOBJS@ \
|
||||
@THREADDEP@/libthreaddep.a @OSDEP@/libosdep.a @UAE_LIBS@ \
|
||||
@MATHLIB@ $(am__empty)
|
||||
archivers/dms/libdms.a archivers/zip/libzip.a caps/libcaps.a \
|
||||
blitfunc.o blittable.o cpustbl.o cpudefs.o libcpuemu.a \
|
||||
@EXTRAOBJS@ @FILESYSOBJS@ @BSDSOCKOBJS@ @SCSIOBJS@ @CDOBJS@ \
|
||||
@DEBUGOBJS@ @ASMOBJS@ @THREADDEP@/libthreaddep.a \
|
||||
@OSDEP@/libosdep.a @UAE_LIBS@ @MATHLIB@
|
||||
readdisk_SOURCES = \
|
||||
readdisk.c missing.c
|
||||
|
||||
|
18
src/a2091.c
18
src/a2091.c
@ -1198,9 +1198,9 @@ static void freescsi (struct scsi_data *sd)
|
||||
scsi_free (sd);
|
||||
}
|
||||
|
||||
int addscsi (int ch, TCHAR *path, int blocksize, int readonly,
|
||||
TCHAR *devname, int sectors, int surfaces, int reserved,
|
||||
int bootpri, TCHAR *filesys, int scsi_level)
|
||||
int addscsi (int ch, const TCHAR *path, int blocksize, int readonly,
|
||||
const TCHAR *devname, int sectors, int surfaces, int reserved,
|
||||
int bootpri, const TCHAR *filesys, int scsi_level)
|
||||
{
|
||||
struct hd_hardfiledata *hfd;
|
||||
|
||||
@ -1270,9 +1270,9 @@ static void addnativescsi (void)
|
||||
}
|
||||
}
|
||||
|
||||
int a3000_add_scsi_unit (int ch, TCHAR *path, int blocksize, int readonly,
|
||||
TCHAR *devname, int sectors, int surfaces, int reserved,
|
||||
int bootpri, TCHAR *filesys)
|
||||
int a3000_add_scsi_unit (int ch, const TCHAR *path, int blocksize, int readonly,
|
||||
const TCHAR *devname, int sectors, int surfaces, int reserved,
|
||||
int bootpri, const TCHAR *filesys)
|
||||
{
|
||||
return addscsi (ch, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys, 2);
|
||||
}
|
||||
@ -1287,9 +1287,9 @@ void a3000scsi_free (void)
|
||||
freenativescsi ();
|
||||
}
|
||||
|
||||
int a2091_add_scsi_unit (int ch, TCHAR *path, int blocksize, int readonly,
|
||||
TCHAR *devname, int sectors, int surfaces, int reserved,
|
||||
int bootpri, TCHAR *filesys)
|
||||
int a2091_add_scsi_unit (int ch, const TCHAR *path, int blocksize, int readonly,
|
||||
const TCHAR *devname, int sectors, int surfaces, int reserved,
|
||||
int bootpri, const TCHAR *filesys)
|
||||
{
|
||||
return addscsi (ch, path, blocksize, readonly, devname, sectors, surfaces, reserved, bootpri, filesys, 1);
|
||||
}
|
||||
|
4
src/ar.c
4
src/ar.c
@ -1146,7 +1146,7 @@ int action_replay_freeze (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void action_replay_chipwrite (void)
|
||||
static void action_replay_chipwrite (void)
|
||||
{
|
||||
if (armodel == 2 || armodel == 3) {
|
||||
action_replay_flag = ACTION_REPLAY_DORESET;
|
||||
@ -1465,7 +1465,7 @@ static void action_replay_unsetbanks (void)
|
||||
/* param to allow us to unload the cart. Currently we know it is safe if we are doing a reset to unload it.*/
|
||||
int action_replay_unload (int in_memory_reset)
|
||||
{
|
||||
static const char *state[] = {
|
||||
static const TCHAR *state[] = {
|
||||
"ACTION_REPLAY_WAIT_PC",
|
||||
"ACTION_REPLAY_INACTIVE",
|
||||
"ACTION_REPLAY_WAITRESET",
|
||||
|
@ -590,23 +590,24 @@ static struct device_info *info_device (int unitnum, struct device_info *di)
|
||||
DEBUG_LOG ("SCSIDEV: unit=%d: info_device\n", unitnum);
|
||||
|
||||
if (unitnum < total_drives) {
|
||||
struct scsidevdata *sdd = &drives[unitnum];
|
||||
struct scsidevdata *sdd = &drives[unitnum];
|
||||
|
||||
di->bus = 0;
|
||||
di->target = unitnum;
|
||||
di->lun = 0;
|
||||
di->media_inserted = media_check (sdd->scgp);
|
||||
di->write_protected = 1;
|
||||
di->bytespersector = 2048;
|
||||
di->cylinders = 1;
|
||||
di->type = INQ_ROMD; /* We only support CD/DVD drives for now */
|
||||
di->id = unitnum + 1;
|
||||
/* TODO: Create a more informative device label */
|
||||
sprintf (di->label, "(%d,%d,%d)", sdd->bus, sdd->target, sdd->lun);
|
||||
di->bus = 0;
|
||||
di->target = unitnum;
|
||||
di->lun = 0;
|
||||
di->media_inserted = media_check (sdd->scgp);
|
||||
di->write_protected = 1;
|
||||
di->bytespersector = 2048;
|
||||
di->cylinders = 1;
|
||||
di->type = INQ_ROMD; /* We only support CD/DVD drives for now */
|
||||
di->unitnum = unitnum + 1;
|
||||
|
||||
/* TODO: Create a more informative device label */
|
||||
sprintf (di->label, "(%d,%d,%d)", sdd->bus, sdd->target, sdd->lun);
|
||||
} else
|
||||
di = 0;
|
||||
di = 0;
|
||||
|
||||
return di;
|
||||
return di;
|
||||
}
|
||||
|
||||
static int check_isatapi (int unitnum)
|
||||
|
@ -726,7 +726,11 @@ static int command_rawread (int unitnum, uae_u8 *data, int sector, int size, int
|
||||
} else if (sectorsize == 2048 && t->size == 2352) {
|
||||
// 2352 -> 2048
|
||||
while (size-- > 0) {
|
||||
zfile_fseek (t->handle, t->offset + sector * t->size + 16, SEEK_SET);
|
||||
uae_u8 b = 0;
|
||||
zfile_fseek (t->handle, t->offset + sector * t->size + 15, SEEK_SET);
|
||||
zfile_fread (&b, 1, 1, t->handle);
|
||||
if (b == 2) // MODE2?
|
||||
zfile_fseek (t->handle, t->offset + sector * t->size + 24, SEEK_SET);
|
||||
zfile_fread (data, sectorsize, 1, t->handle);
|
||||
sector++;
|
||||
data += sectorsize;
|
||||
@ -801,21 +805,26 @@ static int command_read (int unitnum, uae_u8 *data, int sector, int size)
|
||||
return 0;
|
||||
|
||||
struct cdtoc *t = findtoc (cdu, §or);
|
||||
int offset;
|
||||
|
||||
if (!t || t->handle == NULL)
|
||||
return NULL;
|
||||
cdda_stop (cdu);
|
||||
if (t->size == 2048) {
|
||||
int offset = 0;
|
||||
zfile_fseek (t->handle, t->offset + sector * t->size + offset, SEEK_SET);
|
||||
zfile_fseek (t->handle, t->offset + sector * t->size, SEEK_SET);
|
||||
zfile_fread (data, size, 2048, t->handle);
|
||||
sector += size;
|
||||
} else {
|
||||
offset = 16;
|
||||
while (size-- > 0) {
|
||||
zfile_fseek (t->handle, t->offset + sector * t->size + offset, SEEK_SET);
|
||||
zfile_fread (data, size, 2048, t->handle);
|
||||
if (t->size == 2352) {
|
||||
uae_u8 b = 0;
|
||||
zfile_fseek (t->handle, t->offset + sector * t->size + 15, SEEK_SET);
|
||||
zfile_fread (&b, 1, 1, t->handle);
|
||||
if (b == 2) // MODE2?
|
||||
zfile_fseek (t->handle, t->offset + sector * t->size + 24, SEEK_SET);
|
||||
} else {
|
||||
zfile_fseek (t->handle, t->offset + sector * t->size + 16, SEEK_SET);
|
||||
}
|
||||
zfile_fread (data, 1, 2048, t->handle);
|
||||
data += 2048;
|
||||
sector++;
|
||||
}
|
||||
|
44
src/cdtv.c
44
src/cdtv.c
@ -217,7 +217,7 @@ static int pause_audio (int pause)
|
||||
|
||||
static int read_sectors (int start, int length)
|
||||
{
|
||||
#ifdef CDTV_DEBUG
|
||||
#ifdef CDTV_DEBUG_CMD
|
||||
write_log ("READ DATA sector %d, %d sectors (blocksize=%d)\n", start, length, cdtv_sectorsize);
|
||||
#endif
|
||||
cdrom_sector = start;
|
||||
@ -384,7 +384,7 @@ static int play_cd (uae_u8 *p)
|
||||
play_start = start;
|
||||
last_play_pos = start;
|
||||
last_play_end = end;
|
||||
#ifdef CDTV_DEBUG
|
||||
#ifdef CDTV_DEBUG_CMD
|
||||
write_log ("PLAY CD AUDIO from %06X (%d) to %06X (%d)\n",
|
||||
lsn2msf (start), start, lsn2msf (end), end);
|
||||
#endif
|
||||
@ -682,7 +682,7 @@ static void dma_do_thread (void)
|
||||
if (!cdtv_sectorsize)
|
||||
return;
|
||||
cnt = dmac_wtc;
|
||||
#ifdef CDTV_DEBUG
|
||||
#ifdef CDTV_DEBUG_CMD
|
||||
write_log ("DMAC DMA: sector=%d, addr=%08X, words=%d (of %d)\n",
|
||||
cdrom_offset / cdtv_sectorsize, dmac_acr, cnt, cdrom_length / 2);
|
||||
#endif
|
||||
@ -691,6 +691,8 @@ static void dma_do_thread (void)
|
||||
uae_u8 buffer[2352];
|
||||
if (!didread || readsector != (cdrom_offset / cdtv_sectorsize)) {
|
||||
readsector = cdrom_offset / cdtv_sectorsize;
|
||||
// if (readsector > 3000)
|
||||
// write_log ("");
|
||||
if (cdtv_sectorsize != 2048)
|
||||
didread = read_raw (readsector, buffer, cdtv_sectorsize);
|
||||
else
|
||||
@ -793,7 +795,7 @@ static void init_play (int start, int end)
|
||||
play_start = start;
|
||||
last_play_pos = start;
|
||||
last_play_end = end;
|
||||
#ifdef CDTV_DEBUG
|
||||
#ifdef CDTV_DEBUG_CMD
|
||||
write_log ("PLAY CD AUDIO from %06X (%d) to %06X (%d)\n",
|
||||
lsn2msf (start), start, lsn2msf (end), end);
|
||||
#endif
|
||||
@ -1144,7 +1146,7 @@ void CDTV_hsync_handler (void)
|
||||
if (dma_wait >= 0 && dma_wait < 1024 && dma_finished) {
|
||||
if ((dmac_cntr & (CNTR_INTEN | CNTR_TCEN)) == (CNTR_INTEN | CNTR_TCEN)) {
|
||||
dmac_istr |= ISTR_INT_P | ISTR_E_INT;
|
||||
#ifdef CDTV_DEBUG
|
||||
#ifdef CDTV_DEBUG_CMD
|
||||
write_log ("DMA finished\n");
|
||||
#endif
|
||||
}
|
||||
@ -1194,6 +1196,13 @@ void CDTV_hsync_handler (void)
|
||||
subchannelcounter = 200;
|
||||
}
|
||||
}
|
||||
if (!scor && !cd_playing) {
|
||||
// frame interrupts happen all the time motor is running
|
||||
scor = 1;
|
||||
tp_check_interrupts ();
|
||||
scor = 0;
|
||||
subchannelcounter = 200;
|
||||
}
|
||||
}
|
||||
|
||||
if (cdtv_hsync < 200 && cdtv_hsync >= 0)
|
||||
@ -1225,7 +1234,7 @@ void CDTV_hsync_handler (void)
|
||||
cd_led |= LED_CD_ACTIVE;
|
||||
else
|
||||
cd_led &= ~LED_CD_ACTIVE;
|
||||
if (cd_led && !cd_playing)
|
||||
if ((cd_led & ~LED_CD_ACTIVE2) && !cd_playing)
|
||||
gui_flicker_led (LED_CD, 0, cd_led);
|
||||
|
||||
subqcnt--;
|
||||
@ -1265,7 +1274,7 @@ void bleh (void)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void cdtv_reset (void)
|
||||
static void cdtv_reset_int (void)
|
||||
{
|
||||
write_log ("CDTV: reset\n");
|
||||
cdaudiostop ();
|
||||
@ -1375,7 +1384,7 @@ static void dmac_bput2 (uaecptr addr, uae_u32 b)
|
||||
case 0x43:
|
||||
dmac_cntr = b;
|
||||
if (dmac_cntr & CNTR_PREST)
|
||||
cdtv_reset ();
|
||||
cdtv_reset_int ();
|
||||
break;
|
||||
case 0x80:
|
||||
dmac_wtc &= 0x00ffffff;
|
||||
@ -1560,6 +1569,12 @@ static void open_unit (void)
|
||||
sys_command_info (unitnum, &di, 0);
|
||||
write_log ("using drive %s (unit %d, media %d)\n", di.label, unitnum, di.media_inserted);
|
||||
}
|
||||
static void close_unit (void)
|
||||
{
|
||||
if (unitnum >= 0)
|
||||
sys_command_close (unitnum);
|
||||
unitnum = -1;
|
||||
}
|
||||
|
||||
static void ew (int addr, uae_u32 value)
|
||||
{
|
||||
@ -1706,15 +1721,14 @@ void cdtv_free (void)
|
||||
write_comm_pipe_u32 (&requests, 0xffff, 1);
|
||||
while (thread_alive > 0)
|
||||
uae_msleep (10);
|
||||
uae_sem_destroy (&sub_sem);
|
||||
}
|
||||
thread_alive = 0;
|
||||
if (unitnum >= 0)
|
||||
sys_command_close (unitnum);
|
||||
unitnum = -1;
|
||||
uae_sem_destroy (&sub_sem);
|
||||
close_unit ();
|
||||
configured = 0;
|
||||
}
|
||||
|
||||
|
||||
#ifdef ROMHACK2
|
||||
extern uae_u8 *extendedkickmemory, *cardmemory;
|
||||
static void romhack (void)
|
||||
@ -1758,11 +1772,13 @@ static void romhack (void)
|
||||
|
||||
void cdtv_init (void)
|
||||
{
|
||||
close_unit ();
|
||||
if (!thread_alive) {
|
||||
init_comm_pipe (&requests, 100, 1);
|
||||
uae_start_thread ("cdtv", dev_thread, NULL, NULL);
|
||||
while (!thread_alive)
|
||||
uae_msleep(10);
|
||||
uae_sem_init (&sub_sem, 0, 1);
|
||||
}
|
||||
write_comm_pipe_u32 (&requests, 0x0104, 1);
|
||||
|
||||
@ -1780,8 +1796,6 @@ void cdtv_init (void)
|
||||
ew (0x20, 0x00); /* ser.no. Byte 2 */
|
||||
ew (0x24, 0x00); /* ser.no. Byte 3 */
|
||||
|
||||
uae_sem_init (&sub_sem, 0, 1);
|
||||
|
||||
/* KS autoconfig handles the rest */
|
||||
map_banks (&dmac_bank, 0xe80000 >> 16, 0x10000 >> 16, 0x10000);
|
||||
if (!savestate_state) {
|
||||
@ -1966,4 +1980,4 @@ void cdtv_exitgui (void)
|
||||
if (cd_playing && !cd_paused)
|
||||
write_comm_pipe_u32 (&requests, 0x103, 1);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
157
src/cfgfile.c
157
src/cfgfile.c
@ -204,7 +204,8 @@ static const TCHAR *dongles[] =
|
||||
"rugby coach", "cricket captain", "leviathan",
|
||||
NULL
|
||||
};
|
||||
static const TCHAR *cdmodes[] = { "", "image", "ioctl", "spti", "aspi", 0 };
|
||||
static const TCHAR *cdmodes[] = { "disabled", "", "image", "ioctl", "spti", "aspi", 0 };
|
||||
static const TCHAR *cdconmodes[] = { "", "uae", "ide", "scsi", "cdtv", "cd32", 0 };
|
||||
|
||||
static const TCHAR *obsolete[] = {
|
||||
"accuracy", "gfx_opengl", "gfx_32bit_blits", "32bit_blits",
|
||||
@ -653,6 +654,8 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
|
||||
}
|
||||
}
|
||||
|
||||
if (p->statefile[0])
|
||||
cfgfile_write_str (f, "statefile", p->statefile);
|
||||
if (p->quitstatefile[0])
|
||||
cfgfile_write_str (f, "statefile_quit", p->quitstatefile);
|
||||
|
||||
@ -1276,18 +1279,51 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
|
||||
TCHAR tmp[20];
|
||||
_stprintf (tmp, "cdimage%d", i);
|
||||
if (!_tcsicmp (option, tmp)) {
|
||||
p->cdslots[i].delayed = false;
|
||||
TCHAR *next = _tcsrchr (value, ',');
|
||||
int type = SCSI_UNIT_DEFAULT;
|
||||
if (next) {
|
||||
int mode = 0;
|
||||
int unitnum = 0;
|
||||
for (;;) {
|
||||
if (!next)
|
||||
break;
|
||||
*next++ = 0;
|
||||
TCHAR *next2 = _tcschr (next, ':');
|
||||
if (next2)
|
||||
*next2 = 0;
|
||||
*next2++ = 0;
|
||||
int tmpval = 0;
|
||||
if (cfgfile_intval (option, next, tmp, &type, 1))
|
||||
if (!_tcsicmp (next, "delay")) {
|
||||
p->cdslots[i].delayed = true;
|
||||
next = next2;
|
||||
if (!next)
|
||||
break;
|
||||
next2 = _tcschr (next, ':');
|
||||
if (next2)
|
||||
*next2++ = 0;
|
||||
}
|
||||
type = match_string (cdmodes, next);
|
||||
if (type < 0)
|
||||
type = SCSI_UNIT_DEFAULT;
|
||||
else
|
||||
type--;
|
||||
next = next2;
|
||||
if (!next)
|
||||
break;
|
||||
next2 = _tcschr (next, ':');
|
||||
if (next2)
|
||||
*next2++ = 0;
|
||||
mode = match_string (cdconmodes, next);
|
||||
if (mode < 0)
|
||||
mode = 0;
|
||||
next = next2;
|
||||
if (!next)
|
||||
break;
|
||||
next2 = _tcschr (next, ':');
|
||||
if (next2)
|
||||
*next2++ = 0;
|
||||
cfgfile_intval (option, next, tmp, &unitnum, 1);
|
||||
}
|
||||
_tcsncpy (p->cdslots[i].name, value, sizeof p->cdslots[i].name);
|
||||
_tcsncpy (p->cdslots[i].name, value, sizeof p->cdslots[i].name / sizeof (TCHAR));
|
||||
p->cdslots[i].name[sizeof p->cdslots[i].name - 1] = 0;
|
||||
p->cdslots[i].inuse = true;
|
||||
p->cdslots[i].type = type;
|
||||
@ -1618,6 +1654,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
|
||||
|
||||
#ifdef SAVESTATE
|
||||
if (cfgfile_path (option, value, "statefile", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) {
|
||||
_tcscpy (p->statefile, tmpbuf);
|
||||
_tcscpy (savestate_fname, tmpbuf);
|
||||
if (zfile_exists (savestate_fname)) {
|
||||
savestate_state = STATE_DORESTORE;
|
||||
@ -1638,8 +1675,17 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
|
||||
*p = 0;
|
||||
}
|
||||
}
|
||||
if (!ok)
|
||||
savestate_fname[0] = 0;
|
||||
if (!ok) {
|
||||
TCHAR tmp[MAX_DPATH];
|
||||
//fetch_statefilepath (tmp, sizeof tmp / sizeof (TCHAR));
|
||||
_tcscat (tmp, savestate_fname);
|
||||
if (zfile_exists (tmp)) {
|
||||
_tcscpy (savestate_fname, tmp);
|
||||
savestate_state = STATE_DORESTORE;
|
||||
} else {
|
||||
savestate_fname[0] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@ -2335,12 +2381,17 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, TCHAR *option, TCHAR *va
|
||||
}
|
||||
}
|
||||
empty_fs:
|
||||
if (root)
|
||||
if (root) {
|
||||
if (_tcslen (root) > 3 && root[0] == 'H' && root[1] == 'D' && root[2] == '_') {
|
||||
root += 2;
|
||||
*root = ':';
|
||||
}
|
||||
str = cfgfile_subst_path (UNEXPANDED, p->path_hardfile, root);
|
||||
}
|
||||
#ifdef FILESYS
|
||||
add_filesys_config (p, -1, dname, aname, str, ro, secs, heads, reserved, bs, bp, fs, hdcv, 0);
|
||||
#endif
|
||||
free (str);
|
||||
xfree (str);
|
||||
return 1;
|
||||
|
||||
invalid_fs:
|
||||
@ -2639,12 +2690,15 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real
|
||||
cfgfile_parse_line (p, line, 0);
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
for (i = 0; i < 4; i++) {
|
||||
subst (prefs_get_attr("floppy_path"), p->floppyslots[i].df, sizeof p->floppyslots[i].df);
|
||||
|
||||
subst (p->path_floppy, p->floppyslots[i].df, sizeof p->floppyslots[i].df / sizeof (TCHAR));
|
||||
}
|
||||
subst (prefs_get_attr("rom_path"), p->romfile, sizeof p->romfile);
|
||||
subst (prefs_get_attr("rom_path"), p->romextfile, sizeof p->romextfile);
|
||||
subst (prefs_get_attr("rom_path"), p->keyfile, sizeof p->keyfile);
|
||||
subst (p->path_rom, p->romfile, sizeof p->romfile / sizeof (TCHAR));
|
||||
subst (p->path_rom, p->romextfile, sizeof p->romextfile / sizeof (TCHAR));
|
||||
|
||||
return 1;
|
||||
}
|
||||
@ -3136,6 +3190,82 @@ void cfgfile_addcfgparam (TCHAR *line)
|
||||
temp_lines = u;
|
||||
}
|
||||
|
||||
static int getconfigstoreline (struct zfile *z, TCHAR *option, TCHAR *value)
|
||||
{
|
||||
TCHAR tmp[CONFIG_BLEN * 2];
|
||||
int idx = 0;
|
||||
|
||||
for (;;) {
|
||||
TCHAR b = 0;
|
||||
if (zfile_fread (&b, 1, sizeof (TCHAR), z) != 1)
|
||||
return 0;
|
||||
tmp[idx++] = b;
|
||||
tmp[idx] = 0;
|
||||
if (b == '\n' || b == 0)
|
||||
break;
|
||||
}
|
||||
return cfgfile_separate_line (tmp, option, value);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static int cfgfile_handle_custom_event (TCHAR *custom, int mode)
|
||||
{
|
||||
TCHAR option[CONFIG_BLEN], value[CONFIG_BLEN];
|
||||
TCHAR option2[CONFIG_BLEN], value2[CONFIG_BLEN];
|
||||
TCHAR *tmp, *p, *nextp;
|
||||
struct zfile *configstore = NULL;
|
||||
int cnt = 0, cnt_ok = 0;
|
||||
|
||||
if (!mode) {
|
||||
TCHAR zero = 0;
|
||||
configstore = zfile_fopen_empty ("configstore", 50000);
|
||||
cfgfile_save_options (configstore, &currprefs, 0);
|
||||
cfg_write (&zero, configstore);
|
||||
}
|
||||
|
||||
nextp = NULL;
|
||||
tmp = p = xcalloc (TCHAR, _tcslen (custom) + 2);
|
||||
_tcscpy (tmp, custom);
|
||||
while (p && *p) {
|
||||
if (*p == '\"') {
|
||||
TCHAR *p2;
|
||||
p++;
|
||||
p2 = p;
|
||||
while (*p2 != '\"' && *p2 != 0)
|
||||
p2++;
|
||||
if (*p2 == '\"') {
|
||||
*p2++ = 0;
|
||||
nextp = p2 + 1;
|
||||
if (*nextp == ' ')
|
||||
nextp++;
|
||||
}
|
||||
}
|
||||
if (cfgfile_separate_line (p, option, value)) {
|
||||
cnt++;
|
||||
if (mode) {
|
||||
cfgfile_parse_option (&changed_prefs, option, value, 0);
|
||||
} else {
|
||||
zfile_fseek (configstore, 0, SEEK_SET);
|
||||
for (;;) {
|
||||
if (!getconfigstoreline (configstore, option2, value2))
|
||||
break;
|
||||
if (!_tcscmpi (option, option2) && !_tcscmpi (value, value2)) {
|
||||
cnt_ok++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
p = nextp;
|
||||
}
|
||||
xfree (tmp);
|
||||
zfile_fclose (configstore);
|
||||
if (cnt > 0 && cnt == cnt_ok)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int cmdlineparser (TCHAR *s, TCHAR *outp[], int max)
|
||||
{
|
||||
int j;
|
||||
@ -3661,6 +3791,7 @@ void default_prefs (struct uae_prefs *p, int type)
|
||||
p->gfx_filter_scanlineratio = (1 << 4) | 1;
|
||||
p->gfx_filter_keep_aspect = 0;
|
||||
p->gfx_filter_autoscale = 0;
|
||||
p->gfx_filteroverlay_overscan = 0;
|
||||
#endif
|
||||
|
||||
_tcscpy (p->floppyslots[0].df, "df0.adf");
|
||||
@ -3682,6 +3813,10 @@ void default_prefs (struct uae_prefs *p, int type)
|
||||
prefs_set_attr ("savestate_path", strdup_path_expand (TARGET_SAVESTATE_PATH));
|
||||
#endif
|
||||
|
||||
_tcscpy (p->romextfile, "");
|
||||
_tcscpy (p->flashfile, "");
|
||||
_tcscpy (p->cartfile, "");
|
||||
|
||||
_tcscpy (p->path_rom, "./");
|
||||
_tcscpy (p->path_floppy, "./");
|
||||
_tcscpy (p->path_hardfile, "./");
|
||||
|
15
src/custom.c
15
src/custom.c
@ -75,7 +75,7 @@ STATIC_INLINE bool nocustom (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void uae_abort (const char *format,...)
|
||||
static void uae_abort (const TCHAR *format,...)
|
||||
{
|
||||
static int nomore;
|
||||
va_list parms;
|
||||
@ -83,9 +83,9 @@ static void uae_abort (const char *format,...)
|
||||
|
||||
va_start (parms, format);
|
||||
#ifdef _WIN32
|
||||
_vsnprintf( buffer, sizeof (buffer) -1, format, parms );
|
||||
_vsnprintf(buffer, sizeof (buffer) -1, format, parms);
|
||||
#else
|
||||
vsnprintf( buffer, sizeof (buffer) -1, format, parms );
|
||||
vsnprintf(buffer, sizeof (buffer) -1, format, parms);
|
||||
#endif
|
||||
va_end (parms);
|
||||
if (nomore) {
|
||||
@ -2747,7 +2747,7 @@ void init_hz (void)
|
||||
if ((beamcon0 & 0xA0) != (new_beamcon0 & 0xA0))
|
||||
hzc = 1;
|
||||
if (beamcon0 != new_beamcon0) {
|
||||
write_log ("BEAMCON0 %04x -> %04x\n", beamcon0, new_beamcon0);
|
||||
write_log ("BEAMCON0 %04x -> %04x PC%=%08x\n", beamcon0, new_beamcon0, M68K_GETPC);
|
||||
vpos_count = vpos_count_prev = 0;
|
||||
}
|
||||
beamcon0 = new_beamcon0;
|
||||
@ -3755,6 +3755,7 @@ static void DIWSTRT (int hpos, uae_u16 v)
|
||||
{
|
||||
if (diwstrt == v && ! diwhigh_written)
|
||||
return;
|
||||
decide_diw (hpos);
|
||||
decide_line (hpos);
|
||||
diwhigh_written = 0;
|
||||
diwstrt = v;
|
||||
@ -3765,6 +3766,7 @@ static void DIWSTOP (int hpos, uae_u16 v)
|
||||
{
|
||||
if (diwstop == v && ! diwhigh_written)
|
||||
return;
|
||||
decide_diw (hpos);
|
||||
decide_line (hpos);
|
||||
diwhigh_written = 0;
|
||||
diwstop = v;
|
||||
@ -5951,7 +5953,10 @@ void dumpcustom (void)
|
||||
write_log ("COP1LC: %08lx, COP2LC: %08lx COPPTR: %08lx\n", (unsigned long)cop1lc, (unsigned long)cop2lc, cop_state.ip);
|
||||
write_log ("DIWSTRT: %04x DIWSTOP: %04x DDFSTRT: %04x DDFSTOP: %04x\n",
|
||||
(unsigned int)diwstrt, (unsigned int)diwstop, (unsigned int)ddfstrt, (unsigned int)ddfstop);
|
||||
write_log ("BPLCON 0: %04x 1: %04x 2: %04x 3: %04x 4: %04x LOF=%d/%d\n", bplcon0, bplcon1, bplcon2, bplcon3, bplcon4, lof_current, lof_store);
|
||||
write_log ("BPLCON 0: %04x 1: %04x 2: %04x 3: %04x 4: %04x LOF=%d/%d HDIW=%d VDIW=%d\n",
|
||||
bplcon0, bplcon1, bplcon2, bplcon3, bplcon4,
|
||||
lof_current, lof_store,
|
||||
hdiwstate == DIW_waiting_start ? 0 : 1, diwstate == DIW_waiting_start ? 0 : 1);
|
||||
if (timeframes) {
|
||||
write_log ("Average frame time: %.2f ms [frames: %d time: %d]\n",
|
||||
(double)frametime / timeframes, timeframes, frametime);
|
||||
|
@ -2189,6 +2189,7 @@ static void center_image (void)
|
||||
} else {
|
||||
visible_left_border = max_diwlastword - gfxvidinfo.width;
|
||||
}
|
||||
|
||||
if (currprefs.gfx_xcenter_pos >= 0) {
|
||||
int val = currprefs.gfx_xcenter_pos >> RES_MAX;
|
||||
#if 0
|
||||
|
@ -133,8 +133,8 @@ static void ersatz_init (void)
|
||||
if (disk_empty (0)) {
|
||||
already_failed = 1;
|
||||
gui_message ("You need to have a diskfile in DF0 to use the Kickstart replacement!\n");
|
||||
//uae_restart (-1, NULL);
|
||||
uae_quit ();
|
||||
uae_restart (-1, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2019,7 +2019,7 @@ static a_inode *get_aino (Unit *unit, a_inode *base, const TCHAR *rel, int *err)
|
||||
}
|
||||
|
||||
|
||||
static uae_u32 notifyhash (TCHAR *s)
|
||||
static uae_u32 notifyhash (const TCHAR *s)
|
||||
{
|
||||
uae_u32 hash = 0;
|
||||
while (*s)
|
||||
@ -5464,21 +5464,39 @@ static TCHAR *device_dupfix (uaecptr expbase, const TCHAR *devname)
|
||||
return strdup (newname);
|
||||
}
|
||||
|
||||
static void dump_partinfo (uae_u8 *name, int num, uaecptr pp, int partblock)
|
||||
static void dump_partinfo (struct hardfiledata *hfd, const uae_u8 *name, int num, uaecptr pp, int partblock)
|
||||
{
|
||||
uae_u32 dostype = get_long (pp + 80);
|
||||
uae_u64 size;
|
||||
int blocksize, surfaces, spb, spt, reserved;
|
||||
int lowcyl, highcyl;
|
||||
uae_u32 block;
|
||||
uae_u8 buf[512];
|
||||
|
||||
size = ((uae_u64)get_long (pp + 20)) * 4 * get_long (pp + 28) * get_long (pp + 36) * (get_long (pp + 56) - get_long (pp + 52) + 1);
|
||||
blocksize = get_long (pp + 20) * 4;
|
||||
surfaces = get_long (pp + 28);
|
||||
spb = get_long (pp + 32);
|
||||
spt = get_long (pp + 36);
|
||||
reserved = get_long (pp + 40);
|
||||
lowcyl = get_long (pp + 52);
|
||||
highcyl = get_long (pp + 56);
|
||||
|
||||
write_log ("RDB: '%s' dostype=%08X. PartBlock=%d\n", name, dostype, partblock);
|
||||
write_log ("BlockSize: %d, Surfaces: %d, SectorsPerBlock %d\n",
|
||||
get_long (pp + 20) * 4, get_long (pp + 28), get_long (pp + 32));
|
||||
blocksize, surfaces, spb);
|
||||
write_log ("SectorsPerTrack: %d, Reserved: %d, LowCyl %d, HighCyl %d, Size %dM\n",
|
||||
get_long (pp + 36), get_long (pp + 40), get_long (pp + 52), get_long (pp + 56), (uae_u32)(size >> 20));
|
||||
get_long (pp + 36), get_long (pp + 40), lowcyl, highcyl, (uae_u32)(size >> 20));
|
||||
|
||||
write_log ("Buffers: %d, BufMemType: %08x, MaxTransfer: %08x, BootPri: %d\n",
|
||||
get_long (pp + 60), get_long (pp + 64), get_long (pp + 68), get_long (pp + 76));
|
||||
|
||||
block = lowcyl * surfaces * spt;
|
||||
if (hdf_read (hfd, buf, (uae_u64)blocksize * block, sizeof buf)) {
|
||||
write_log ("First block %d dostype: %08X\n", block, (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | (buf[3] << 0));
|
||||
} else {
|
||||
write_log ("First block %d read failed!\n", block);
|
||||
}
|
||||
}
|
||||
|
||||
#define rdbmnt write_log ("Mounting uaehf.device %d (%d) (size=%I64u):\n", unit_no, partnum, hfd->virtsize);
|
||||
@ -5598,7 +5616,7 @@ static int rdb_mount (UnitInfo *uip, int unit_no, int partnum, uaecptr parmpacke
|
||||
put_long (parmpacket + 12, 0); /* Device flags */
|
||||
for (i = 0; i < PP_MAXSIZE; i++)
|
||||
put_byte (parmpacket + 16 + i, buf[128 + i]);
|
||||
dump_partinfo (buf + 37, uip->devno, parmpacket, partblock);
|
||||
dump_partinfo (hfd, buf + 37, uip->devno, parmpacket, partblock);
|
||||
dostype = get_long (parmpacket + 80);
|
||||
|
||||
if (dostype == 0) {
|
||||
|
@ -473,7 +473,7 @@ static BOOL wasFullscreen = NO; // used by ensureNotFullscreen() and restoreFull
|
||||
NSArray *files = [sheet filenames];
|
||||
NSString *file = [files objectAtIndex:0];
|
||||
|
||||
lossyASCIICopy (changed_prefs.df[drive], file, COCOA_GUI_MAX_PATH);
|
||||
lossyASCIICopy (changed_prefs.floppyslots[drive].df, file, COCOA_GUI_MAX_PATH);
|
||||
|
||||
// Save the path of this disk image so that future open panels can start in the same directory
|
||||
[[NSUserDefaults standardUserDefaults] setObject:[file stringByDeletingLastPathComponent] forKey:@"LastUsedDiskImagePath"];
|
||||
|
@ -480,8 +480,6 @@ extern int get_guid_target (uae_u8 *out);
|
||||
|
||||
static uae_u64 vhd_read (struct hardfiledata *hfd, void *v, uae_u64 offset, uae_u64 len)
|
||||
{
|
||||
uae_u32 bamoffset;
|
||||
uae_u32 sectoroffset;
|
||||
uae_u64 read;
|
||||
uae_u8 *dataptr = (uae_u8*)v;
|
||||
|
||||
@ -492,19 +490,19 @@ static uae_u64 vhd_read (struct hardfiledata *hfd, void *v, uae_u64 offset, uae_
|
||||
if (len & 511)
|
||||
return read;
|
||||
while (len > 0) {
|
||||
bamoffset = (offset / hfd->vhd_blocksize) * 4 + hfd->vhd_bamoffset;
|
||||
sectoroffset = gl (hfd->vhd_header + bamoffset);
|
||||
uae_u32 bamoffset = (offset / hfd->vhd_blocksize) * 4 + hfd->vhd_bamoffset;
|
||||
uae_u32 sectoroffset = gl (hfd->vhd_header + bamoffset);
|
||||
if (sectoroffset == 0xffffffff) {
|
||||
memset (dataptr, 0, 512);
|
||||
read += 512;
|
||||
} else {
|
||||
int bitmapoffsetbits;
|
||||
int bitmapoffsetbytes;
|
||||
int sectormapblock;
|
||||
uae_u64 sectormapblock;
|
||||
|
||||
bitmapoffsetbits = (offset / 512) % (hfd->vhd_blocksize / 512);
|
||||
bitmapoffsetbytes = bitmapoffsetbits / 8;
|
||||
sectormapblock = sectoroffset * 512 + (bitmapoffsetbytes & ~511);
|
||||
sectormapblock = sectoroffset * (uae_u64)512 + (bitmapoffsetbytes & ~511);
|
||||
if (hfd->vhd_sectormapblock != sectormapblock) {
|
||||
// read sector bitmap
|
||||
//write_log ("BM %08x\n", sectormapblock);
|
||||
@ -517,7 +515,7 @@ static uae_u64 vhd_read (struct hardfiledata *hfd, void *v, uae_u64 offset, uae_
|
||||
// block allocated in bitmap?
|
||||
if (hfd->vhd_sectormap[bitmapoffsetbytes & 511] & (1 << (7 - (bitmapoffsetbits & 7)))) {
|
||||
// read data block
|
||||
int block = sectoroffset * 512 + hfd->vhd_bitmapsize + bitmapoffsetbits * 512;
|
||||
uae_u64 block = sectoroffset * (uae_u64)512 + hfd->vhd_bitmapsize + bitmapoffsetbits * 512;
|
||||
//write_log ("DB %08x\n", block);
|
||||
if (hdf_read_target (hfd, dataptr, block, 512) != 512) {
|
||||
write_log ("vhd_read: data read error\n");
|
||||
@ -574,8 +572,6 @@ static int vhd_write_enlarge (struct hardfiledata *hfd, uae_u32 bamoffset)
|
||||
|
||||
static uae_u64 vhd_write (struct hardfiledata *hfd, void *v, uae_u64 offset, uae_u64 len)
|
||||
{
|
||||
uae_u32 bamoffset;
|
||||
uae_u32 sectoroffset;
|
||||
uae_u64 written;
|
||||
uae_u8 *dataptr = (uae_u8*)v;
|
||||
|
||||
@ -586,8 +582,8 @@ static uae_u64 vhd_write (struct hardfiledata *hfd, void *v, uae_u64 offset, uae
|
||||
if (len & 511)
|
||||
return written;
|
||||
while (len > 0) {
|
||||
bamoffset = (offset / hfd->vhd_blocksize) * 4 + hfd->vhd_bamoffset;
|
||||
sectoroffset = gl (hfd->vhd_header + bamoffset);
|
||||
uae_u32 bamoffset = (offset / hfd->vhd_blocksize) * 4 + hfd->vhd_bamoffset;
|
||||
uae_u32 sectoroffset = gl (hfd->vhd_header + bamoffset);
|
||||
if (sectoroffset == 0xffffffff) {
|
||||
if (!vhd_write_enlarge (hfd, bamoffset))
|
||||
return written;
|
||||
@ -595,11 +591,10 @@ static uae_u64 vhd_write (struct hardfiledata *hfd, void *v, uae_u64 offset, uae
|
||||
} else {
|
||||
int bitmapoffsetbits;
|
||||
int bitmapoffsetbytes;
|
||||
int sectormapblock;
|
||||
|
||||
bitmapoffsetbits = (offset / 512) % (hfd->vhd_blocksize / 512);
|
||||
bitmapoffsetbytes = bitmapoffsetbits / 8;
|
||||
sectormapblock = sectoroffset * 512 + (bitmapoffsetbytes & ~511);
|
||||
uae_u64 sectormapblock = sectoroffset * (uae_u64)512 + (bitmapoffsetbytes & ~511);
|
||||
if (hfd->vhd_sectormapblock != sectormapblock) {
|
||||
// read sector bitmap
|
||||
if (hdf_read_target (hfd, hfd->vhd_sectormap, sectormapblock, 512) != 512) {
|
||||
@ -609,7 +604,7 @@ static uae_u64 vhd_write (struct hardfiledata *hfd, void *v, uae_u64 offset, uae
|
||||
hfd->vhd_sectormapblock = sectormapblock;
|
||||
}
|
||||
// write data
|
||||
if (hdf_write_target (hfd, dataptr, sectoroffset * 512 + hfd->vhd_bitmapsize + bitmapoffsetbits * 512, 512) != 512) {
|
||||
if (hdf_write_target (hfd, dataptr, sectoroffset * (uae_u64)512 + hfd->vhd_bitmapsize + bitmapoffsetbits * 512, 512) != 512) {
|
||||
write_log ("vhd_write: data write error\n");
|
||||
return written;
|
||||
}
|
||||
@ -971,11 +966,11 @@ static uae_u64 cmd_write (struct hardfiledata *hfd, uaecptr dataptr, uae_u64 off
|
||||
return cmd_writex (hfd, bank_data->xlateaddr (dataptr), offset, len);
|
||||
}
|
||||
|
||||
static int checkbounds(struct hardfiledata *hfd, uae_u64 offset, uae_u64 len)
|
||||
static int checkbounds (struct hardfiledata *hfd, uae_u64 offset, uae_u64 len)
|
||||
{
|
||||
if (offset >= hfd->physsize)
|
||||
if (offset >= hfd->virtsize)
|
||||
return 0;
|
||||
if (offset + len > hfd->physsize)
|
||||
if (offset + len > hfd->virtsize)
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
|
@ -24,15 +24,15 @@ extern struct scsi_data *scsis[8];
|
||||
#define WD33C93 "WD33C93"
|
||||
#define SCSIID (scsis[wdregs[WD_DESTINATION_ID] & 7])
|
||||
|
||||
extern int a2091_add_scsi_unit (int ch, TCHAR *path, int blocksize, int readonly,
|
||||
TCHAR *devname, int sectors, int surfaces, int reserved,
|
||||
int bootpri, TCHAR *filesys);
|
||||
extern int a3000_add_scsi_unit (int ch, TCHAR *path, int blocksize, int readonly,
|
||||
TCHAR *devname, int sectors, int surfaces, int reserved,
|
||||
int bootpri, TCHAR *filesys);
|
||||
extern int a2091_add_scsi_unit (int ch, const TCHAR *path, int blocksize, int readonly,
|
||||
const TCHAR *devname, int sectors, int surfaces, int reserved,
|
||||
int bootpri, const TCHAR *filesys);
|
||||
extern int a3000_add_scsi_unit (int ch, const TCHAR *path, int blocksize, int readonly,
|
||||
const TCHAR *devname, int sectors, int surfaces, int reserved,
|
||||
int bootpri, const TCHAR *filesys);
|
||||
|
||||
extern int addscsi (int ch, TCHAR *path, int blocksize, int readonly,
|
||||
TCHAR *devname, int sectors, int surfaces, int reserved,
|
||||
int bootpri, TCHAR *filesys, int scsi_level);
|
||||
extern int addscsi (int ch, const TCHAR *path, int blocksize, int readonly,
|
||||
const TCHAR *devname, int sectors, int surfaces, int reserved,
|
||||
int bootpri, const TCHAR *filesys, int scsi_level);
|
||||
|
||||
#endif
|
||||
|
@ -42,7 +42,6 @@ extern int action_replay_load (void);
|
||||
extern void action_replay_memory_reset (void);
|
||||
extern void action_replay_init (int);
|
||||
extern void action_replay_cleanup (void);
|
||||
//extern void action_replay_map_banks (void);
|
||||
extern void REGPARAM3 chipmem_lput_actionreplay23 (uaecptr addr, uae_u32 l) REGPARAM;
|
||||
extern void REGPARAM3 chipmem_wput_actionreplay23 (uaecptr addr, uae_u32 w) REGPARAM;
|
||||
extern void REGPARAM3 chipmem_bput_actionreplay1 (uaecptr addr, uae_u32 b) REGPARAM;
|
||||
|
@ -13,8 +13,7 @@ extern void aud1_handler (void);
|
||||
extern void aud2_handler (void);
|
||||
extern void aud3_handler (void);
|
||||
|
||||
//extern void AUDxDAT (int nr, uae_u16 value);
|
||||
//extern void AUDxDAT (int nr, uae_u16 value, uaecptr addr);
|
||||
extern void AUDxDAT (int nr, uae_u16 value, uaecptr addr);
|
||||
extern void AUDxVOL (int nr, uae_u16 value);
|
||||
extern void AUDxPER (int nr, uae_u16 value);
|
||||
extern void AUDxLCH (int nr, uae_u16 value);
|
||||
@ -51,7 +50,7 @@ extern int sound_available;
|
||||
|
||||
extern void audio_sampleripper(int);
|
||||
extern int sampleripper_enabled;
|
||||
//extern void write_wavheader (FILE *wavfile, uae_u32 size, uae_u32 freq);
|
||||
//extern void write_wavheader (struct zfile *wavfile, uae_u32 size, uae_u32 freq);
|
||||
|
||||
enum {
|
||||
SND_MONO, SND_STEREO, SND_4CH_CLONEDSTEREO, SND_4CH, SND_6CH_CLONEDSTEREO, SND_6CH, SND_NONE };
|
||||
|
@ -231,6 +231,7 @@ struct uae_prefs {
|
||||
TCHAR gfx_filtermask[MAX_DPATH];
|
||||
TCHAR gfx_filteroverlay[MAX_DPATH];
|
||||
struct wh gfx_filteroverlay_pos;
|
||||
int gfx_filteroverlay_overscan;
|
||||
int gfx_filter_scanlines;
|
||||
int gfx_filter_scanlineratio;
|
||||
int gfx_filter_scanlinelevel;
|
||||
@ -321,6 +322,7 @@ struct uae_prefs {
|
||||
TCHAR a2065name[MAX_DPATH];
|
||||
struct cdslot cdslots[MAX_TOTAL_SCSI_DEVICES];
|
||||
TCHAR quitstatefile[MAX_DPATH];
|
||||
TCHAR statefile[MAX_DPATH];
|
||||
#ifndef WIN32
|
||||
char scsi_device[256];
|
||||
#endif
|
||||
|
@ -80,6 +80,7 @@ extern TCHAR *zfile_geterror (void);
|
||||
#define ZFD_DISKHISTORY 0x100 //allow diskhistory (if disk image)
|
||||
#define ZFD_CHECKONLY 0x200 //file exists checkc
|
||||
#define ZFD_DELAYEDOPEN 0x400 //do not unpack, just get metadata
|
||||
#define ZFD_NORECURSE 0x10000 // do not recurse archives
|
||||
#define ZFD_NORMAL (ZFD_ARCHIVE|ZFD_UNPACK)
|
||||
#define ZFD_ALL 0x0000ffff
|
||||
|
||||
@ -102,12 +103,13 @@ extern const TCHAR *uae_ignoreextensions[];
|
||||
extern const TCHAR *uae_diskimageextensions[];
|
||||
|
||||
extern struct zvolume *zfile_fopen_archive (const TCHAR *filename);
|
||||
extern struct zvolume *zfile_fopen_archive2 (const TCHAR *filename, bool norecurse);
|
||||
extern struct zvolume *zfile_fopen_archive2 (const TCHAR *filename, int flags);
|
||||
extern struct zvolume *zfile_fopen_archive_root (const TCHAR *filename);
|
||||
extern void zfile_fclose_archive (struct zvolume *zv);
|
||||
extern int zfile_fs_usage_archive (const TCHAR *path, const TCHAR *disk, struct fs_usage *fsp);
|
||||
extern int zfile_stat_archive (const TCHAR *path, struct _stat64 *statbuf);
|
||||
extern struct zdirectory *zfile_opendir_archive (const TCHAR *path);
|
||||
extern struct zdirectory *zfile_opendir_archive2 (const TCHAR *path, int flags);
|
||||
extern void zfile_closedir_archive (struct zdirectory *);
|
||||
extern int zfile_readdir_archive (struct zdirectory *, TCHAR*);
|
||||
extern int zfile_readdir_archive2 (struct zdirectory *, TCHAR*, bool fullpath);
|
||||
|
@ -2116,7 +2116,7 @@ static void cap_check (void)
|
||||
int isbutton = getbuttonstate (joy, i == 0 ? JOYBUTTON_3 : JOYBUTTON_2);
|
||||
|
||||
if (cd32_pad_enabled[joy]) {
|
||||
if (i != 0) // 3rd button?
|
||||
if (i == 0) // 3rd button?
|
||||
continue;
|
||||
if (cd32padmode (p5dir, p5dat))
|
||||
continue;
|
||||
@ -2238,7 +2238,7 @@ void handle_cd32_joystick_cia (uae_u8 pra, uae_u8 dra)
|
||||
uae_u8 but = 0x40 << i;
|
||||
uae_u16 p5dir = 0x0200 << (i * 4); /* output enable P5 */
|
||||
uae_u16 p5dat = 0x0100 << (i * 4); /* data P5 */
|
||||
if (!(potgo_value & p5dir) || !(potgo_value & p5dat)) {
|
||||
if (cd32padmode (p5dir, p5dat)) {
|
||||
if ((dra & but) && (pra & but) != oldstate[i]) {
|
||||
if (!(pra & but)) {
|
||||
cd32_shifter[i]--;
|
||||
@ -2286,7 +2286,7 @@ static uae_u16 handle_joystick_potgor (uae_u16 potgor)
|
||||
potgor |= p5dat;
|
||||
|
||||
|
||||
if (!cd32_pad_enabled[i]) {
|
||||
if (!cd32_pad_enabled[i] || !cd32padmode (p5dir, p5dat)) {
|
||||
potgor &= ~p9dat;
|
||||
if (pot_cap[i][1] > 100)
|
||||
potgor |= p9dat;
|
||||
@ -2504,14 +2504,11 @@ void inputdevice_do_keyboard (int code, int state)
|
||||
if (code < 0x80) {
|
||||
uae_u8 key = code | (state ? 0x00 : 0x80);
|
||||
keybuf[key & 0x7f] = (key & 0x80) ? 0 : 1;
|
||||
write_log("inp_do_key<80: %d\n", code);
|
||||
if (key == AK_RESETWARNING) {
|
||||
write_log("inp_do_key<80: RST\n");
|
||||
resetwarning_do (0);
|
||||
return;
|
||||
} else if ((keybuf[AK_CTRL] || keybuf[AK_RCTRL]) && keybuf[AK_LAMI] && keybuf[AK_RAMI]) {
|
||||
int r = keybuf[AK_LALT] | keybuf[AK_RALT];
|
||||
write_log("inp_do_key<80: RST2\n", code);
|
||||
if (!r && currprefs.cs_resetwarning && resetwarning_do (1))
|
||||
return;
|
||||
memset (keybuf, 0, sizeof (keybuf));
|
||||
|
14
src/memory.c
14
src/memory.c
@ -1914,7 +1914,7 @@ void mapped_free (uae_u8 *p)
|
||||
|
||||
shmpiece *shm_start;
|
||||
|
||||
static void dumplist(void)
|
||||
static void dumplist (void)
|
||||
{
|
||||
shmpiece *x = shm_start;
|
||||
write_log ("Start Dump:\n");
|
||||
@ -2523,7 +2523,8 @@ void memory_reset (void)
|
||||
map_banks (&dummy_bank, 0xc0, 0xd8 - 0xc0, 0);
|
||||
#endif
|
||||
|
||||
if (bogomemory != 0) { // Map "slow" memory from at 0xC00000 to max 0xDBFFFF, or 0xCFFFFF on an AGA machine.
|
||||
if (bogomemory != 0) {
|
||||
// Map "slow" memory from at 0xC00000 to max 0xDBFFFF, or 0xCFFFFF on an AGA machine.
|
||||
int t = currprefs.bogomem_size >> 16;
|
||||
if (t > 0x1C)
|
||||
t = 0x1C;
|
||||
@ -2547,7 +2548,8 @@ void memory_reset (void)
|
||||
}
|
||||
#endif
|
||||
if (currprefs.cs_rtc || currprefs.cs_cdtvram)
|
||||
map_banks (&clock_bank, 0xDC, 1, 0); // Real-time clock at 0xDC0000 - 0xDCFFFF.
|
||||
// Real-time clock at 0xDC0000 - 0xDCFFFF.
|
||||
map_banks (&clock_bank, 0xDC, 1, 0);
|
||||
else if (currprefs.cs_ksmirror_a8 || currprefs.cs_ide > 0 || currprefs.cs_pcmcia)
|
||||
map_banks (&clock_bank, 0xDC, 1, 0); /* none clock */
|
||||
#ifdef GAYLE
|
||||
@ -2570,7 +2572,8 @@ void memory_reset (void)
|
||||
if (cardmemory != 0)
|
||||
map_banks (&cardmem_bank, cardmem_start >> 16, allocated_cardmem >> 16, 0);
|
||||
|
||||
map_banks (&kickmem_bank, 0xF8, 8, 0); // Map primary Kickstart at 0xF80000 - 0xFFFFFF.
|
||||
// Map primary Kickstart at 0xF80000 - 0xFFFFFF.
|
||||
map_banks (&kickmem_bank, 0xF8, 8, 0);
|
||||
if (currprefs.maprom)
|
||||
map_banks (&kickram_bank, currprefs.maprom >> 16, 8, 0);
|
||||
/* map beta Kickstarts at 0x200000/0xC00000/0xF00000 */
|
||||
@ -2588,7 +2591,8 @@ void memory_reset (void)
|
||||
a1000_handle_kickstart (1);
|
||||
|
||||
#ifdef AUTOCONFIG
|
||||
map_banks (&expamem_bank, 0xE8, 1, 0); /* Map Autoconfig space at 0xE80000 - 0xE8FFFF. */
|
||||
// Map Autoconfig space at 0xE80000 - 0xE8FFFF.
|
||||
map_banks (&expamem_bank, 0xE8, 1, 0);
|
||||
#endif
|
||||
|
||||
if (a3000_f0)
|
||||
|
13
src/newcpu.c
13
src/newcpu.c
@ -2675,8 +2675,8 @@ STATIC_INLINE int do_specialties (int cycles)
|
||||
|
||||
//static uae_u32 pcs[1000];
|
||||
|
||||
//#define DEBUG_CD32IO
|
||||
#ifdef DEBUG_CD32IO
|
||||
//#define DEBUG_CD32CDTVIO
|
||||
#ifdef DEBUG_CD32CDTVIO
|
||||
|
||||
static uae_u32 cd32nextpc, cd32request;
|
||||
|
||||
@ -2768,7 +2768,7 @@ static void m68k_run_1 (void)
|
||||
|
||||
count_instr (opcode);
|
||||
|
||||
#ifdef DEBUG_CD32IO
|
||||
#ifdef DEBUG_CD32CDTVIO
|
||||
out_cd32io (m68k_getpc ());
|
||||
#endif
|
||||
|
||||
@ -2815,6 +2815,9 @@ static void m68k_run_1_ce (void)
|
||||
ipl_fetch ();
|
||||
for (;;) {
|
||||
uae_u32 opcode = r->ir;
|
||||
#ifdef DEBUG_CD32CDTVIO
|
||||
out_cd32io (m68k_getpc ());
|
||||
#endif
|
||||
(*cpufunctbl[opcode])(opcode);
|
||||
if (r->spcflags) {
|
||||
if (do_specialties (0))
|
||||
@ -3047,7 +3050,7 @@ static void m68k_run_2p (void)
|
||||
uae_u32 opcode;
|
||||
uae_u32 pc = m68k_getpc ();
|
||||
|
||||
#ifdef DEBUG_CD32IO
|
||||
#ifdef DEBUG_CD32CDTVIO
|
||||
out_cd32io (m68k_getpc ());
|
||||
#endif
|
||||
|
||||
@ -3358,7 +3361,7 @@ void m68k_disasm_2 (TCHAR *buf, int bufsize, uaecptr addr, uaecptr *nextpc, int
|
||||
m68kpc_offset = addr - m68k_getpc ();
|
||||
|
||||
if (buf)
|
||||
memset (buf, 0, bufsize);
|
||||
memset (buf, 0, bufsize * sizeof (TCHAR));
|
||||
if (!table68k)
|
||||
return;
|
||||
while (cnt-- > 0) {
|
||||
|
@ -395,7 +395,7 @@ void target_save_options (FILE *f, const struct uae_prefs *p)
|
||||
{
|
||||
}
|
||||
|
||||
int target_parse_option (struct uae_prefs *p, const char *option, const char *value)
|
||||
int target_parse_option (struct uae_prefs *p, TCHAR *option, TCHAR *value)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ hostname = GnoStiC-dv7
|
||||
uname -m = i686
|
||||
uname -r = 2.6.32-24-generic
|
||||
uname -s = Linux
|
||||
uname -v = #38-Ubuntu SMP Mon Jul 5 09:22:14 UTC 2010
|
||||
uname -v = #39-Ubuntu SMP Wed Jul 28 06:07:29 UTC 2010
|
||||
|
||||
/usr/bin/uname -p = unknown
|
||||
/bin/uname -X = unknown
|
||||
@ -445,7 +445,7 @@ configure:4344: $? = 0
|
||||
configure:4344: result: yes
|
||||
configure:4350: checking for _doprnt
|
||||
configure:4350: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
|
||||
/tmp/ccsRj39K.o: In function `main':
|
||||
/tmp/ccg6gkCX.o: In function `main':
|
||||
/home/gnostic/puaex/src/tools/conftest.c:67: undefined reference to `_doprnt'
|
||||
collect2: ld returned 1 exit status
|
||||
configure:4350: $? = 1
|
||||
@ -533,7 +533,7 @@ configure:4364: $? = 0
|
||||
configure:4364: result: yes
|
||||
configure:4364: checking for strcmpi
|
||||
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
|
||||
/tmp/ccHamKwY.o: In function `main':
|
||||
/tmp/ccyGlF54.o: In function `main':
|
||||
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `strcmpi'
|
||||
collect2: ld returned 1 exit status
|
||||
configure:4364: $? = 1
|
||||
@ -613,7 +613,7 @@ configure: failed program was:
|
||||
configure:4364: result: no
|
||||
configure:4364: checking for stricmp
|
||||
configure:4364: gcc -o conftest -g -O2 -Wall -W -Wno-unused conftest.c >&5
|
||||
/tmp/ccfzHOQ3.o: In function `main':
|
||||
/tmp/cct8UV89.o: In function `main':
|
||||
/home/gnostic/puaex/src/tools/conftest.c:69: undefined reference to `stricmp'
|
||||
collect2: ld returned 1 exit status
|
||||
configure:4364: $? = 1
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* E-UAE - The portable Amiga emulator
|
||||
* PUAE - The portable Amiga emulator
|
||||
*
|
||||
* Standard write_log that writes to the console or to a file.
|
||||
*
|
||||
|
135
src/zfile.c
135
src/zfile.c
@ -2385,7 +2385,7 @@ static struct zvolume *get_zvolume (const TCHAR *path)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static struct zvolume *zfile_fopen_archive_ext (struct znode *parent, struct zfile *zf)
|
||||
static struct zvolume *zfile_fopen_archive_ext (struct znode *parent, struct zfile *zf, int flags)
|
||||
{
|
||||
struct zvolume *zv = NULL;
|
||||
TCHAR *name = zfile_getname (zf);
|
||||
@ -2403,32 +2403,38 @@ static struct zvolume *zfile_fopen_archive_ext (struct znode *parent, struct zfi
|
||||
ext = _tcsrchr (name, '.');
|
||||
if (ext != NULL) {
|
||||
ext++;
|
||||
if (strcasecmp (ext, "lha") == 0 || strcasecmp (ext, "lzh") == 0)
|
||||
zv = archive_directory_lha (zf);
|
||||
if (strcasecmp (ext, "zip") == 0)
|
||||
zv = archive_directory_zip (zf);
|
||||
if (strcasecmp (ext, "7z") == 0)
|
||||
zv = archive_directory_7z (zf);
|
||||
if (strcasecmp (ext, "lzx") == 0)
|
||||
zv = archive_directory_lzx (zf);
|
||||
if (strcasecmp (ext, "rar") == 0)
|
||||
zv = archive_directory_rar (zf);
|
||||
if (strcasecmp (ext, "tar") == 0)
|
||||
zv = archive_directory_tar (zf);
|
||||
if (strcasecmp (ext, "adf") == 0 && !memcmp (header, "DOS", 3))
|
||||
zv = archive_directory_adf (parent, zf);
|
||||
if (strcasecmp (ext, "hdf") == 0) {
|
||||
if (!memcmp (header, "RDSK", 4))
|
||||
zv = archive_directory_rdb (zf);
|
||||
else
|
||||
zv = archive_directory_adf (parent, zf);
|
||||
if (flags & ZFD_ARCHIVE) {
|
||||
// if (strcasecmp (ext, "lha") == 0 || strcasecmp (ext, "lzh") == 0)
|
||||
// zv = archive_directory_lha (zf);
|
||||
// if (strcasecmp (ext, "zip") == 0)
|
||||
// zv = archive_directory_zip (zf);
|
||||
// if (strcasecmp (ext, "7z") == 0)
|
||||
// zv = archive_directory_7z (zf);
|
||||
// if (strcasecmp (ext, "lzx") == 0)
|
||||
// zv = archive_directory_lzx (zf);
|
||||
// if (strcasecmp (ext, "rar") == 0)
|
||||
// zv = archive_directory_rar (zf);
|
||||
// if (strcasecmp (ext, "tar") == 0)
|
||||
// zv = archive_directory_tar (zf);
|
||||
}
|
||||
if (flags & ZFD_ADF) {
|
||||
// if (strcasecmp (ext, "adf") == 0 && !memcmp (header, "DOS", 3))
|
||||
// zv = archive_directory_adf (parent, zf);
|
||||
}
|
||||
if (flags & ZFD_HD) {
|
||||
if (strcasecmp (ext, "hdf") == 0) {
|
||||
// if (!memcmp (header, "RDSK", 4))
|
||||
// zv = archive_directory_rdb (zf);
|
||||
// else
|
||||
// zv = archive_directory_adf (parent, zf);
|
||||
}
|
||||
}
|
||||
}
|
||||
return zv;
|
||||
}
|
||||
|
||||
|
||||
static struct zvolume *zfile_fopen_archive_data (struct znode *parent, struct zfile *zf)
|
||||
static struct zvolume *zfile_fopen_archive_data (struct znode *parent, struct zfile *zf, int flags)
|
||||
{
|
||||
struct zvolume *zv = NULL;
|
||||
uae_u8 header[32];
|
||||
@ -2436,20 +2442,26 @@ static struct zvolume *zfile_fopen_archive_data (struct znode *parent, struct zf
|
||||
memset (header, 0, sizeof (header));
|
||||
zfile_fread (header, sizeof (header), 1, zf);
|
||||
zfile_fseek (zf, 0, SEEK_SET);
|
||||
if (header[0] == 'P' && header[1] == 'K')
|
||||
zv = archive_directory_zip (zf);
|
||||
if (header[0] == 'R' && header[1] == 'a' && header[2] == 'r' && header[3] == '!')
|
||||
zv = archive_directory_rar (zf);
|
||||
if (header[0] == 'L' && header[1] == 'Z' && header[2] == 'X')
|
||||
zv = archive_directory_lzx (zf);
|
||||
if (header[2] == '-' && header[3] == 'l' && header[4] == 'h' && header[6] == '-')
|
||||
zv = archive_directory_lha (zf);
|
||||
if (header[0] == 'D' && header[1] == 'O' && header[2] == 'S' && (header[3] >= 0 && header[3] <= 7))
|
||||
zv = archive_directory_adf (parent, zf);
|
||||
if (header[0] == 'R' && header[1] == 'D' && header[2] == 'S' && header[3] == 'K')
|
||||
zv = archive_directory_rdb (zf);
|
||||
if (isfat (header))
|
||||
zv = archive_directory_fat (zf);
|
||||
if (flags & ZFD_ARCHIVE) {
|
||||
// if (header[0] == 'P' && header[1] == 'K')
|
||||
// zv = archive_directory_zip (zf);
|
||||
// if (header[0] == 'R' && header[1] == 'a' && header[2] == 'r' && header[3] == '!')
|
||||
// zv = archive_directory_rar (zf);
|
||||
// if (header[0] == 'L' && header[1] == 'Z' && header[2] == 'X')
|
||||
// zv = archive_directory_lzx (zf);
|
||||
// if (header[2] == '-' && header[3] == 'l' && header[4] == 'h' && header[6] == '-')
|
||||
// zv = archive_directory_lha (zf);
|
||||
}
|
||||
if (flags & ZFD_ADF) {
|
||||
// if (header[0] == 'D' && header[1] == 'O' && header[2] == 'S' && (header[3] >= 0 && header[3] <= 7))
|
||||
// zv = archive_directory_adf (parent, zf);
|
||||
}
|
||||
if (flags & ZFD_HD) {
|
||||
// if (header[0] == 'R' && header[1] == 'D' && header[2] == 'S' && header[3] == 'K')
|
||||
// zv = archive_directory_rdb (zf);
|
||||
// if (isfat (header))
|
||||
// zv = archive_directory_fat (zf);
|
||||
}
|
||||
return zv;
|
||||
}
|
||||
|
||||
@ -2501,17 +2513,17 @@ static int zfile_fopen_archive_recurse (struct zvolume *zv)
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!done) {
|
||||
/* if (!done) {
|
||||
z = archive_getzfile (zn, zv->method, 0);
|
||||
if (z && iszip (z))
|
||||
zfile_fopen_archive_recurse2 (zv, zn);
|
||||
}
|
||||
}*/
|
||||
zn = zn->next;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct zvolume *prepare_recursive_volume (struct zvolume *zv, const TCHAR *path)
|
||||
static struct zvolume *prepare_recursive_volume (struct zvolume *zv, const TCHAR *path, int flags)
|
||||
{
|
||||
struct zfile *zf = NULL;
|
||||
struct zvolume *zvnew = NULL;
|
||||
@ -2523,12 +2535,12 @@ static struct zvolume *prepare_recursive_volume (struct zvolume *zv, const TCHAR
|
||||
zf = zfile_open_archive (path, 0);
|
||||
if (!zf)
|
||||
goto end;
|
||||
zvnew = zfile_fopen_archive_ext (zv->parentz, zf);
|
||||
if (!zvnew) {
|
||||
zvnew = zfile_fopen_archive_ext (zv->parentz, zf, flags);
|
||||
if (!zvnew && !(flags & ZFD_NORECURSE)) {
|
||||
#if 1
|
||||
zvnew = archive_directory_plain (zf);
|
||||
/* zvnew = archive_directory_plain (zf);
|
||||
zfile_fopen_archive_recurse (zvnew);
|
||||
done = 1;
|
||||
done = 1;*/
|
||||
#else
|
||||
int rc;
|
||||
int index;
|
||||
@ -2603,7 +2615,7 @@ static struct znode *get_znode (struct zvolume *zv, const TCHAR *ppath, int recu
|
||||
#ifdef ZFILE_DEBUG
|
||||
write_log ("'%s'\n", newpath);
|
||||
#endif
|
||||
zvdeep = prepare_recursive_volume (zvdeep, newpath);
|
||||
zvdeep = prepare_recursive_volume (zvdeep, newpath, ZFD_ALL);
|
||||
if (!zvdeep) {
|
||||
write_log ("failed to unpack '%s'\n", newpath);
|
||||
return NULL;
|
||||
@ -2688,6 +2700,43 @@ struct znode *zvolume_adddir_abs (struct zvolume *zv, struct zarchive_info *zai)
|
||||
return znode_adddir (zn2, p, zai);
|
||||
}
|
||||
|
||||
void zfile_fclose_archive (struct zvolume *zv)
|
||||
{
|
||||
struct znode *zn;
|
||||
struct zvolume *v;
|
||||
|
||||
if (!zv)
|
||||
return;
|
||||
zn = &zv->root;
|
||||
while (zn) {
|
||||
struct znode *zn2 = zn->next;
|
||||
if (zn->vchild)
|
||||
zfile_fclose_archive (zn->vchild);
|
||||
xfree (zn->comment);
|
||||
xfree (zn->fullname);
|
||||
xfree (zn->name);
|
||||
zfile_fclose (zn->f);
|
||||
memset (zn, 0, sizeof (struct znode));
|
||||
if (zn != &zv->root)
|
||||
xfree (zn);
|
||||
zn = zn2;
|
||||
}
|
||||
//archive_access_close (zv->handle, zv->id);
|
||||
if (zvolume_list == zv) {
|
||||
zvolume_list = zvolume_list->next;
|
||||
} else {
|
||||
v = zvolume_list;
|
||||
while (v) {
|
||||
if (v->next == zv) {
|
||||
v->next = zv->next;
|
||||
break;
|
||||
}
|
||||
v = v->next;
|
||||
}
|
||||
}
|
||||
xfree (zv);
|
||||
}
|
||||
|
||||
#ifdef _CONSOLE
|
||||
static TCHAR *zerror;
|
||||
#define WRITE_LOG_BUF_SIZE 4096
|
||||
|
Loading…
Reference in New Issue
Block a user