mirror of
https://github.com/libretro/PUAE.git
synced 2024-11-23 07:49:45 +00:00
puae 2.5.0 b19
This commit is contained in:
parent
d87399cfde
commit
874c47ea22
30
src/blkdev.c
30
src/blkdev.c
@ -125,7 +125,6 @@ static struct device_functions *devicetable[] = {
|
||||
#ifdef _WIN32
|
||||
&devicefunc_win32_ioctl,
|
||||
&devicefunc_win32_spti,
|
||||
&devicefunc_win32_aspi,
|
||||
#endif
|
||||
NULL
|
||||
};
|
||||
@ -166,9 +165,6 @@ static void install_driver (int flags)
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case SCSI_UNIT_ASPI:
|
||||
device_func[i] = devicetable[SCSI_UNIT_ASPI];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -220,17 +216,6 @@ void blkdev_fix_prefs (struct uae_prefs *p)
|
||||
p->cdslots[i].inuse = true;
|
||||
}
|
||||
|
||||
// blkdev_win32_aspi.cpp does not support multi units
|
||||
#ifdef _WIN32
|
||||
if (currprefs.win32_uaescsimode >= UAESCSI_ASPI_FIRST) {
|
||||
for (unsigned int i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) {
|
||||
if (cdscsidevicetype[i] != SCSI_UNIT_DISABLED)
|
||||
cdscsidevicetype[i] = SCSI_UNIT_ASPI;
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (unsigned int i = 0; i < MAX_TOTAL_SCSI_DEVICES; i++) {
|
||||
if (cdscsidevicetype[i] != SCSI_UNIT_DEFAULT)
|
||||
continue;
|
||||
@ -250,8 +235,6 @@ void blkdev_fix_prefs (struct uae_prefs *p)
|
||||
#ifdef _WIN32
|
||||
if (currprefs.win32_uaescsimode == UAESCSI_CDEMU)
|
||||
cdscsidevicetype[i] = SCSI_UNIT_IOCTL;
|
||||
else if (currprefs.win32_uaescsimode >= UAESCSI_ASPI_FIRST)
|
||||
cdscsidevicetype[i] = SCSI_UNIT_ASPI;
|
||||
else
|
||||
#endif
|
||||
cdscsidevicetype[i] = SCSI_UNIT_SPTI;
|
||||
@ -516,6 +499,13 @@ void blkdev_exitgui (void)
|
||||
}
|
||||
}
|
||||
|
||||
void check_prefs_changed_cd (void)
|
||||
{
|
||||
if (!config_changed)
|
||||
return;
|
||||
currprefs.sound_volume_cd = changed_prefs.sound_volume_cd;
|
||||
}
|
||||
|
||||
static void check_changes (int unitnum)
|
||||
{
|
||||
bool changed = false;
|
||||
@ -1871,8 +1861,10 @@ uae_u8 *restore_cd (int num, uae_u8 *src)
|
||||
int type = restore_u32 ();
|
||||
restore_u32 ();
|
||||
if (flags & 4) {
|
||||
_tcscpy (changed_prefs.cdslots[num].name, s);
|
||||
_tcscpy (currprefs.cdslots[num].name, s);
|
||||
if (currprefs.cdslots[num].name[0] == 0 || zfile_exists (s)) {
|
||||
_tcscpy (changed_prefs.cdslots[num].name, s);
|
||||
_tcscpy (currprefs.cdslots[num].name, s);
|
||||
}
|
||||
changed_prefs.cdslots[num].type = currprefs.cdslots[num].type = type;
|
||||
}
|
||||
if (flags & 8) {
|
||||
|
@ -344,7 +344,7 @@ static bool isdefault (const TCHAR *s)
|
||||
return false;
|
||||
}
|
||||
|
||||
static size_t cfg_write (void *b, struct zfile *z)
|
||||
static size_t cfg_write (const void *b, struct zfile *z)
|
||||
{
|
||||
size_t v;
|
||||
if (unicode_config) {
|
||||
@ -1272,12 +1272,10 @@ int cfgfile_path (const TCHAR *option, const TCHAR *value, const TCHAR *name, TC
|
||||
|
||||
int cfgfile_multipath (const TCHAR *option, const TCHAR *value, const TCHAR *name, struct multipath *mp)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
TCHAR tmploc[MAX_DPATH];
|
||||
if (!cfgfile_string (option, value, name, tmploc, 256))
|
||||
return 0;
|
||||
for (i = 0; i < MAX_PATHS; i++) {
|
||||
for (unsigned int i = 0; i < MAX_PATHS; i++) {
|
||||
if (mp->path[i][0] == 0 || (i == 0 && (!_tcscmp (mp->path[i], _T(".\\")) || !_tcscmp (mp->path[i], _T("./"))))) {
|
||||
//TCHAR *s = target_expand_environment (tmploc);
|
||||
_tcsncpy (mp->path[i], tmploc, 256 - 1);
|
||||
@ -4575,7 +4573,7 @@ static void buildin_default_prefs (struct uae_prefs *p)
|
||||
#endif
|
||||
p->socket_emu = 0;
|
||||
p->sound_volume = 0;
|
||||
p->sound_volume_cd = -1;
|
||||
p->sound_volume_cd = 0;
|
||||
p->clipboard_sharing = false;
|
||||
|
||||
p->chipmem_size = 0x00080000;
|
||||
|
@ -3006,7 +3006,7 @@ void compute_framesync (void)
|
||||
} else {
|
||||
|
||||
gfxvidinfo.inwidth = AMIGA_WIDTH_MAX << currprefs.gfx_resolution;
|
||||
gfxvidinfo.extrawidth = 1;
|
||||
gfxvidinfo.extrawidth = 8;
|
||||
gfxvidinfo.inwidth2 = gfxvidinfo.inwidth;
|
||||
gfxvidinfo.inheight = (maxvpos_nom - minfirstline + 1) << currprefs.gfx_vresolution;
|
||||
gfxvidinfo.inheight2 = gfxvidinfo.inheight;
|
||||
|
@ -2335,7 +2335,7 @@ static void center_image (void)
|
||||
}
|
||||
} else if (gfxvidinfo.extrawidth) {
|
||||
visible_left_border = max_diwlastword - w;
|
||||
//visible_left_border += gfxvidinfo.drawbuffer.extrawidth << currprefs.gfx_resolution;
|
||||
visible_left_border += gfxvidinfo.extrawidth << currprefs.gfx_resolution;
|
||||
} else {
|
||||
if (gfxvidinfo.inxoffset < 0) {
|
||||
visible_left_border = 0;
|
||||
@ -2848,6 +2848,9 @@ void vsync_handle_check (void)
|
||||
notice_new_xcolors ();
|
||||
}
|
||||
check_prefs_changed_audio ();
|
||||
#ifdef SCSI
|
||||
check_prefs_changed_cd ();
|
||||
#endif
|
||||
check_prefs_changed_custom ();
|
||||
check_prefs_changed_cpu ();
|
||||
}
|
||||
|
@ -28,6 +28,8 @@
|
||||
#define console_out(...) do {;} while (0)
|
||||
#endif
|
||||
|
||||
//#if defined(AHI)
|
||||
|
||||
#if defined(JIT)
|
||||
#define special_mem_r special_mem |= S_READ
|
||||
#define special_mem_w special_mem |= S_WRITE
|
||||
@ -171,9 +173,9 @@ static int enforcer_decode_hunk_and_offset (TCHAR *buf, uae_u32 pc)
|
||||
if (name) {
|
||||
native_name = au ((char*)amiga2native(name,100));
|
||||
if (!native_name)
|
||||
native_name = strdup (_T("Unknown"));
|
||||
native_name = my_strdup (_T("Unknown"));
|
||||
} else {
|
||||
native_name = strdup (_T("Unknown"));
|
||||
native_name = my_strdup (_T("Unknown"));
|
||||
}
|
||||
_stprintf (buf, _T("----> %08lx - \"%s\" Hunk %04lx Offset %08lx\n"), pc, native_name, hunk, offset);
|
||||
xfree (native_name);
|
||||
@ -374,8 +376,8 @@ static void enforcer_display_hit (const TCHAR *addressmode, uae_u32 pc, uaecptr
|
||||
|
||||
console_out (enforcer_buf);
|
||||
write_log (enforcer_buf);
|
||||
uae_msleep (5);
|
||||
//doflashscreen ();
|
||||
sleep_millis (5);
|
||||
doflashscreen ();
|
||||
|
||||
end:
|
||||
xfree (native_task_name);
|
||||
@ -658,3 +660,4 @@ int enforcer_disable (void)
|
||||
}
|
||||
|
||||
#endif
|
||||
//#endif
|
||||
|
307
src/filesys.c
307
src/filesys.c
@ -276,6 +276,12 @@ static void close_filesys_unit (UnitInfo *uip)
|
||||
uip->cd_open = 0;
|
||||
}
|
||||
|
||||
static struct uaedev_config_info *getuci (struct uaedev_config_info *uci, int nr)
|
||||
{
|
||||
return &uci[nr];
|
||||
}
|
||||
|
||||
|
||||
static UnitInfo *getuip (struct uae_prefs *p, int index)
|
||||
{
|
||||
if (index < 0)
|
||||
@ -639,7 +645,7 @@ int kill_filesys_unitconfig (struct uae_prefs *p, int nr)
|
||||
|
||||
if (nr < 0)
|
||||
return 0;
|
||||
uci = &p->mountconfig[nr];
|
||||
uci = getuci (p->mountconfig, nr);
|
||||
hardfile_do_disk_change (uci, 0);
|
||||
if (uci->configoffset >= 0 && uci->controller == 0)
|
||||
filesys_media_change (uci->rootdir, 0, uci);
|
||||
@ -656,8 +662,8 @@ int move_filesys_unitconfig (struct uae_prefs *p, int nr, int to)
|
||||
{
|
||||
struct uaedev_config_info *uci1, *uci2, tmpuci;
|
||||
|
||||
uci1 = &p->mountconfig[nr];
|
||||
uci2 = &p->mountconfig[to];
|
||||
uci1 = getuci (p->mountconfig, nr);
|
||||
uci2 = getuci (p->mountconfig, to);
|
||||
if (nr == to)
|
||||
return 0;
|
||||
memcpy (&tmpuci, uci1, sizeof (struct uaedev_config_info));
|
||||
@ -667,33 +673,69 @@ int move_filesys_unitconfig (struct uae_prefs *p, int nr, int to)
|
||||
}
|
||||
|
||||
|
||||
static void filesys_addexternals (void);
|
||||
void filesys_addexternals (void) {}
|
||||
|
||||
static void allocuci (struct uae_prefs *p, int nr, int idx)
|
||||
{
|
||||
struct uaedev_config_info *uci = &p->mountconfig[nr];
|
||||
if (idx >= 0) {
|
||||
UnitInfo *ui;
|
||||
uci->configoffset = idx;
|
||||
ui = &mountinfo.ui[idx];
|
||||
ui->configureddrive = 1;
|
||||
} else {
|
||||
uci->configoffset = -1;
|
||||
}
|
||||
}
|
||||
|
||||
static void initialize_mountinfo (void)
|
||||
{
|
||||
int nr;
|
||||
struct uaedev_config_info *uci;
|
||||
UnitInfo *uip = &mountinfo.ui[0];
|
||||
|
||||
cd_unit_offset = MAX_FILESYSTEM_UNITS;
|
||||
|
||||
for (nr = 0; nr < currprefs.mountitems; nr++) {
|
||||
uci = &currprefs.mountconfig[nr];
|
||||
struct uaedev_config_info *uci = &currprefs.mountconfig[nr];
|
||||
if (uci->controller == HD_CONTROLLER_UAE) {
|
||||
int idx = set_filesys_unit_1 (-1, uci->devname, uci->ishdf ? NULL : uci->volname, uci->rootdir,
|
||||
uci->readonly, uci->sectors, uci->surfaces, uci->reserved,
|
||||
uci->blocksize, uci->bootpri, uci->donotmount, uci->autoboot, uci->filesys, 0, MYVOLUMEINFO_REUSABLE);
|
||||
if (idx >= 0) {
|
||||
UnitInfo *ui;
|
||||
uci->configoffset = idx;
|
||||
ui = &mountinfo.ui[idx];
|
||||
ui->configureddrive = 1;
|
||||
allocuci (&currprefs, nr, idx);
|
||||
}
|
||||
}
|
||||
filesys_addexternals ();
|
||||
nr = nr_units ();
|
||||
cd_unit_offset = nr;
|
||||
cd_unit_number = 0;
|
||||
#if USE_CDFS == 2
|
||||
#ifdef SCSI
|
||||
if (currprefs.scsi /*&& currprefs.win32_automount_cddrives*/ && USE_CDFS) {
|
||||
uae_u32 mask = scsi_get_cd_drive_mask ();
|
||||
for (int i = 0; i < 32; i++) {
|
||||
if (mask & (1 << i)) {
|
||||
TCHAR cdname[30];
|
||||
_stprintf (cdname, _T("CD%d"), i);
|
||||
cd_unit_number++;
|
||||
int idx = set_filesys_unit_1 (i + cd_unit_offset, cdname, NULL, _T("/"), true, 1, 1, 0, 2048, 0, false, false, NULL, 0, 0);
|
||||
allocuci (&currprefs, nr, idx);
|
||||
nr++;
|
||||
}
|
||||
} else if (uci->controller <= HD_CONTROLLER_IDE3) {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
for (nr = 0; nr < currprefs.mountitems; nr++) {
|
||||
struct uaedev_config_info *uci = &currprefs.mountconfig[nr];
|
||||
if (uci->controller == HD_CONTROLLER_UAE)
|
||||
continue;
|
||||
if (uci->controller <= HD_CONTROLLER_IDE3) {
|
||||
#ifdef GAYLE
|
||||
gayle_add_ide_unit (uci->controller - HD_CONTROLLER_IDE0, uci->rootdir, uci->blocksize, uci->readonly,
|
||||
uci->devname, uci->sectors, uci->surfaces, uci->reserved,
|
||||
uci->bootpri, uci->filesys);
|
||||
allocuci (&currprefs, nr, -1);
|
||||
#endif
|
||||
} else if (uci->controller <= HD_CONTROLLER_SCSI6) {
|
||||
if (currprefs.cs_mbdmac) {
|
||||
@ -701,55 +743,35 @@ static void initialize_mountinfo (void)
|
||||
a3000_add_scsi_unit (uci->controller - HD_CONTROLLER_SCSI0, uci->rootdir, uci->blocksize, uci->readonly,
|
||||
uci->devname, uci->sectors, uci->surfaces, uci->reserved,
|
||||
uci->bootpri, uci->filesys);
|
||||
allocuci (&currprefs, nr, -1);
|
||||
#endif
|
||||
} else if (currprefs.cs_a2091) {
|
||||
#ifdef A2091
|
||||
a2091_add_scsi_unit (uci->controller - HD_CONTROLLER_SCSI0, uci->rootdir, uci->blocksize, uci->readonly,
|
||||
uci->devname, uci->sectors, uci->surfaces, uci->reserved,
|
||||
uci->bootpri, uci->filesys);
|
||||
allocuci (&currprefs, nr, -1);
|
||||
#endif
|
||||
} else if (currprefs.cs_cdtvscsi) {
|
||||
#ifdef CDTV
|
||||
cdtv_add_scsi_unit (uci->controller - HD_CONTROLLER_SCSI0, uci->rootdir, uci->blocksize, uci->readonly,
|
||||
uci->devname, uci->sectors, uci->surfaces, uci->reserved,
|
||||
uci->bootpri, uci->filesys);
|
||||
allocuci (&currprefs, nr, -1);
|
||||
#endif
|
||||
}
|
||||
} else if (uci->controller == HD_CONTROLLER_PCMCIA_SRAM) {
|
||||
#ifdef GAYLE
|
||||
gayle_add_pcmcia_sram_unit (uci->rootdir, uci->readonly);
|
||||
allocuci (&currprefs, nr, -1);
|
||||
} else if (uci->controller == HD_CONTROLLER_PCMCIA_IDE) {
|
||||
gayle_add_pcmcia_ide_unit (uci->rootdir, uci->readonly);
|
||||
allocuci (&currprefs, nr, -1);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
//filesys_addexternals ();
|
||||
cd_unit_offset = nr_units ();
|
||||
cd_unit_number = 0;
|
||||
|
||||
#ifdef SCSI
|
||||
#if USE_CDFS == 2
|
||||
if (currprefs.scsi /*&& currprefs.win32_automount_cddrives*/ && USE_CDFS) {
|
||||
uae_u32 mask = scsi_get_cd_drive_mask ();
|
||||
for (unsigned int i = 0; i < 32; i++) {
|
||||
if (mask & (1 << i)) {
|
||||
TCHAR cdname[30];
|
||||
_stprintf (cdname, _T("CD%d"), i);
|
||||
cd_unit_number++;
|
||||
int idx = set_filesys_unit_1 (i + cd_unit_offset, cdname, NULL, _T("/"), true, 1, 1, 0, 2048, 0, false, false, NULL, 0, 0);
|
||||
if (idx >= 0) {
|
||||
UnitInfo *ui;
|
||||
uci = &currprefs.mountconfig[nr];
|
||||
uci->configoffset = idx;
|
||||
ui = &mountinfo.ui[idx];
|
||||
ui->configureddrive = 1;
|
||||
nr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1124,8 +1146,12 @@ static void fs_closedir (struct fs_dirhandle *fsd)
|
||||
{
|
||||
if (!fsd)
|
||||
return;
|
||||
|
||||
my_closedir (fsd->od);
|
||||
if (fsd->fstype == FS_ARCHIVE)
|
||||
zfile_closedir_archive (fsd->zd);
|
||||
else if (fsd->fstype == FS_DIRECTORY)
|
||||
my_closedir (fsd->od);
|
||||
// else if (fsd->fstype == FS_CDFS)
|
||||
// isofs_closedir (fsd->isod);
|
||||
xfree (fsd);
|
||||
}
|
||||
static struct fs_filehandle *fs_openfile (Unit *unit, const TCHAR *name, char *flags)
|
||||
@ -1139,32 +1165,72 @@ end:
|
||||
xfree (fsf);
|
||||
return NULL;
|
||||
}
|
||||
static void fs_closefile (struct fs_filehandle *fd)
|
||||
static void fs_closefile (struct fs_filehandle *fsf)
|
||||
{
|
||||
if (!fd)
|
||||
if (!fsf)
|
||||
return;
|
||||
|
||||
my_close (fd->of);
|
||||
if (fsf->fstype == FS_ARCHIVE) {
|
||||
zfile_close_archive (fsf->zf);
|
||||
} else if (fsf->fstype == FS_DIRECTORY) {
|
||||
my_close (fsf->of);
|
||||
} /*else if (fsf->fstype == FS_CDFS) {
|
||||
isofs_closefile (fsf->isof);
|
||||
}*/
|
||||
xfree (fsf);
|
||||
}
|
||||
static unsigned int fs_read (struct fs_filehandle *fsf, void *b, unsigned int size)
|
||||
{
|
||||
return fread (b, 1, size, fsf->of);
|
||||
if (fsf->fstype == FS_ARCHIVE)
|
||||
return zfile_read_archive (fsf->zf, b, size);
|
||||
else if (fsf->fstype == FS_DIRECTORY)
|
||||
return fread (b, 1, size, fsf->of);
|
||||
/* else if (fsf->fstype == FS_CDFS)
|
||||
return isofs_read (fsf->isof, b, size);*/
|
||||
return 0;
|
||||
}
|
||||
static unsigned int fs_write (struct fs_filehandle *fsf, void *b, unsigned int size)
|
||||
{
|
||||
|
||||
return fwrite (b, 1, size, fsf->of);
|
||||
if (fsf->fstype == FS_DIRECTORY)
|
||||
return fwrite (b, 1, size, fsf->of);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* return value = old position. -1 = error. */
|
||||
static uae_u64 fs_lseek64 (struct fs_filehandle *fsf, uae_s64 offset, int whence)
|
||||
{
|
||||
|
||||
return my_lseek (fsf->of, offset, whence);
|
||||
if (fsf->fstype == FS_ARCHIVE)
|
||||
return zfile_lseek_archive (fsf->zf, offset, whence);
|
||||
else if (fsf->fstype == FS_DIRECTORY)
|
||||
return my_lseek (fsf->of, offset, whence);
|
||||
/* else if (fsf->fstype == FS_CDFS)
|
||||
return isofs_lseek (fsf->isof, offset, whence);*/
|
||||
return -1;
|
||||
}
|
||||
static uae_u32 fs_lseek (struct fs_filehandle *fsf, uae_s32 offset, int whence)
|
||||
{
|
||||
return (uae_u32)my_lseek (fsf->of, (uae_s32)offset, whence);
|
||||
}
|
||||
static uae_u64 fs_fsize64 (struct fs_filehandle *fsf)
|
||||
{
|
||||
if (fsf->fstype == FS_ARCHIVE)
|
||||
return zfile_fsize_archive (fsf->zf);
|
||||
else if (fsf->fstype == FS_DIRECTORY) {
|
||||
// return my_fsize (fsf->of);
|
||||
uae_s64 cur, filesize;
|
||||
|
||||
cur = fs_lseek64 (fsf->of, 0, SEEK_CUR);
|
||||
filesize = fs_lseek64 (fsf->of, 0, SEEK_END);
|
||||
fs_lseek64 (fsf->of, cur, SEEK_SET);
|
||||
return filesize;
|
||||
}
|
||||
// else if (fsf->fstype == FS_CDFS)
|
||||
// return isofs_fsize (fsf->isof);
|
||||
return -1;
|
||||
}
|
||||
static uae_u32 fs_fsize (struct fs_filehandle *fsf)
|
||||
{
|
||||
return (uae_u32)fs_fsize64 (fsf);
|
||||
}
|
||||
|
||||
static void set_highcyl (UnitInfo *ui, uae_u32 blocks)
|
||||
{
|
||||
@ -1289,7 +1355,7 @@ static void setsystime_vblank (void)
|
||||
{
|
||||
Unit *u;
|
||||
for (u = units; u; u = u->next) {
|
||||
if (is_virtual (u->unit)) {
|
||||
if (is_virtual (u->unit) && filesys_isvolume (u)) {
|
||||
put_byte (u->volume + 173 - 32, 1);
|
||||
uae_Signal (get_long (u->volume + 176 - 32), 1 << 13);
|
||||
break;
|
||||
@ -1398,7 +1464,6 @@ static uae_u32 filesys_media_change_reply (TrapContext *ctx, int mode)
|
||||
struct uaedev_config_info *uci = NULL;
|
||||
|
||||
clear_exkeys (u);
|
||||
uci = &currprefs.mountconfig[nr];
|
||||
xfree (u->ui.rootdir);
|
||||
ui->rootdir = u->ui.rootdir = my_strdup (u->mount_rootdir);
|
||||
flush_cache (u, -1);
|
||||
@ -1439,6 +1504,7 @@ static uae_u32 filesys_media_change_reply (TrapContext *ctx, int mode)
|
||||
#ifdef RETROPLATFORM
|
||||
rp_harddrive_image_change (nr, u->mount_readonly, u->mount_rootdir);
|
||||
#endif
|
||||
uci = getuci (currprefs.mountconfig, nr);
|
||||
}
|
||||
if (u->ui.unknown_media) {
|
||||
write_log (_T("FILESYS: inserted unreadable volume NR=%d RO=%d\n"), nr, u->mount_readonly);
|
||||
@ -1447,14 +1513,19 @@ static uae_u32 filesys_media_change_reply (TrapContext *ctx, int mode)
|
||||
set_volume_name (u, ctime);
|
||||
if (u->mount_flags >= 0)
|
||||
ui->volflags = u->volflags = u->ui.volflags = u->mount_flags;
|
||||
_tcscpy (uci->volname, ui->volname);
|
||||
_tcscpy (uci->rootdir, u->mount_rootdir);
|
||||
if (u->mount_flags >= 0)
|
||||
uci->readonly = ui->readonly = u->ui.readonly = u->mount_readonly;
|
||||
if (uci != NULL) {
|
||||
_tcscpy (uci->volname, ui->volname);
|
||||
_tcscpy (uci->rootdir, u->mount_rootdir);
|
||||
}
|
||||
if (u->mount_flags >= 0) {
|
||||
ui->readonly = u->ui.readonly = u->mount_readonly;
|
||||
if (uci != NULL)
|
||||
uci->readonly = u->mount_readonly;
|
||||
}
|
||||
put_byte (u->volume + 44, 0);
|
||||
put_byte (u->volume + 172 - 32, 1);
|
||||
}
|
||||
|
||||
|
||||
xfree (u->mount_volume);
|
||||
xfree (u->mount_rootdir);
|
||||
u->mount_rootdir = NULL;
|
||||
@ -2595,6 +2666,7 @@ static void
|
||||
put_long (info + 4, nr); /* unit number */
|
||||
put_long (info + 8, unit->ui.readonly || unit->ui.locked ? 80 : 82); /* state */
|
||||
put_long (info + 20, blocksize); /* bytesperblock */
|
||||
put_long (info + 32, 0); /* inuse */
|
||||
if (disk_info && unit->ui.unknown_media) {
|
||||
put_long (info + 12, 0);
|
||||
put_long (info + 16, 0);
|
||||
@ -2606,12 +2678,19 @@ static void
|
||||
put_long (info + 24, -1); /* ID_NO_DISK_PRESENT */
|
||||
put_long (info + 28, 0);
|
||||
} else {
|
||||
if (fs && currprefs.filesys_limit) {
|
||||
if (fsu.fsu_blocks > (uae_u64)currprefs.filesys_limit * 1024 / blocksize) {
|
||||
uae_u32 oldblocks = fsu.fsu_blocks;
|
||||
fsu.fsu_blocks = (uae_u32)((uae_u64)currprefs.filesys_limit * 1024 / blocksize);
|
||||
fsu.fsu_bavail = (uae_u32)((uae_u64)fsu.fsu_bavail * fsu.fsu_blocks / oldblocks);
|
||||
}
|
||||
}
|
||||
put_long (info + 12, fsu.fsu_blocks ); /* numblocks */
|
||||
put_long (info + 16, fsu.fsu_blocks - fsu.fsu_bavail); /* inuse */
|
||||
put_long (info + 24, dostype); /* disk type */
|
||||
put_long (info + 28, unit->volume >> 2); /* volume node */
|
||||
put_long (info + 32, (get_long (unit->volume + 28) || unit->keys) ? -1 : 0); /* inuse */
|
||||
}
|
||||
put_long (info + 32, 0); /* inuse */
|
||||
PUT_PCK_RES1 (packet, DOS_TRUE);
|
||||
}
|
||||
|
||||
@ -3274,7 +3353,7 @@ static void
|
||||
put_long (info + 140, fib.fib_Date.ds_Tick);
|
||||
#else
|
||||
put_long (info + 116, fsdb_can ? aino->amigaos_mode : fsdb_mode_supported (aino));
|
||||
put_long (info + 124, statbuf.st_size > MAXFILESIZE32 ? MAXFILESIZE32 : statbuf.st_size);
|
||||
put_long (info + 124, statbuf.st_size > MAXFILESIZE32 ? MAXFILESIZE32 : (uae_u32)statbuf.st_size);
|
||||
#ifdef HAVE_ST_BLOCKS
|
||||
put_long (info + 128, statbuf.st_blocks);
|
||||
#else
|
||||
@ -3885,11 +3964,11 @@ static uae_u32 REGPARAM2 fsmisc_helper (TrapContext *context)
|
||||
switch (mode)
|
||||
{
|
||||
case 0:
|
||||
return exall_helpder (context);
|
||||
return exall_helpder (context);
|
||||
case 1:
|
||||
return filesys_media_change_reply (context, 0);
|
||||
return filesys_media_change_reply (context, 0);
|
||||
case 2:
|
||||
return filesys_media_change_reply (context, 1);
|
||||
return filesys_media_change_reply (context, 1);
|
||||
case 3:
|
||||
t = getlocaltime ();
|
||||
uae_u32 secs = (uae_u32)t - (8 * 365 + 2) * 24 * 60 * 60;
|
||||
@ -4320,36 +4399,32 @@ static void
|
||||
gui_flicker_led (LED_HD, unit->unit, 1);
|
||||
|
||||
if (size == 0) {
|
||||
actual = 0;
|
||||
PUT_PCK_RES1 (packet, 0);
|
||||
PUT_PCK_RES2 (packet, 0);
|
||||
} else if (valid_address (addr, size)) {
|
||||
uae_u8 *realpt = get_real_address (addr);
|
||||
actual = fs_read (k->fd, realpt, size);
|
||||
} else if (!valid_address (addr, size)) {
|
||||
/* check if filesize < size */
|
||||
uae_s64 filesize, cur;
|
||||
|
||||
if (actual == 0) {
|
||||
filesize = fs_fsize64 (k->fd);
|
||||
cur = k->file_pos;
|
||||
if (size > filesize - cur)
|
||||
size = filesize - cur;
|
||||
|
||||
if (size == 0) {
|
||||
PUT_PCK_RES1 (packet, 0);
|
||||
PUT_PCK_RES2 (packet, 0);
|
||||
} else if (actual < 0) {
|
||||
PUT_PCK_RES1 (packet, 0);
|
||||
PUT_PCK_RES2 (packet, dos_errno ());
|
||||
} else {
|
||||
PUT_PCK_RES1 (packet, actual);
|
||||
k->file_pos += actual;
|
||||
}
|
||||
flush_dcache (addr, size);
|
||||
} else {
|
||||
uae_u8 *buf;
|
||||
off_t old, filesize;
|
||||
|
||||
} else if (!valid_address (addr, size)) {
|
||||
/* it really crosses memory boundary */
|
||||
uae_u8 *buf;
|
||||
|
||||
write_log (_T("unixfs warning: Bad pointer passed for read: %08x, size %d\n"), addr, size);
|
||||
/* ugh this is inefficient but easy */
|
||||
/* ugh this is inefficient but easy */
|
||||
|
||||
old = fs_lseek (k->fd, 0, SEEK_CUR);
|
||||
filesize = fs_lseek (k->fd, 0, SEEK_END);
|
||||
fs_lseek (k->fd, old, SEEK_SET);
|
||||
if (size > filesize)
|
||||
size = filesize;
|
||||
if (fs_lseek64 (k->fd, k->file_pos, SEEK_SET) < 0) {
|
||||
PUT_PCK_RES1 (packet, 0);
|
||||
PUT_PCK_RES2 (packet, dos_errno ());
|
||||
return;
|
||||
}
|
||||
|
||||
buf = xmalloc (uae_u8, size);
|
||||
if (!buf) {
|
||||
@ -4374,6 +4449,32 @@ static void
|
||||
flush_dcache (addr, size);
|
||||
size = 0;
|
||||
}
|
||||
}
|
||||
if (size) {
|
||||
/* normal fast read */
|
||||
uae_u8 *realpt = get_real_address (addr);
|
||||
|
||||
if (fs_lseek64 (k->fd, k->file_pos, SEEK_SET) < 0) {
|
||||
PUT_PCK_RES1 (packet, 0);
|
||||
PUT_PCK_RES2 (packet, dos_errno ());
|
||||
return;
|
||||
}
|
||||
|
||||
actual = fs_read (k->fd, realpt, size);
|
||||
|
||||
if (actual == 0) {
|
||||
PUT_PCK_RES1 (packet, 0);
|
||||
PUT_PCK_RES2 (packet, 0);
|
||||
} else if (actual < 0) {
|
||||
PUT_PCK_RES1 (packet, 0);
|
||||
PUT_PCK_RES2 (packet, dos_errno ());
|
||||
} else {
|
||||
PUT_PCK_RES1 (packet, actual);
|
||||
k->file_pos += actual;
|
||||
}
|
||||
flush_dcache (addr, size);
|
||||
}
|
||||
|
||||
TRACE((_T("=%d\n"), actual));
|
||||
}
|
||||
|
||||
@ -4472,13 +4573,11 @@ static void
|
||||
if (mode < 0)
|
||||
whence = SEEK_SET;
|
||||
|
||||
cur = fs_lseek (k->fd, 0, SEEK_CUR);
|
||||
cur = k->file_pos;
|
||||
TRACE((_T("ACTION_SEEK(%s,%d,%d)=%d\n"), k->aino->nname, pos, mode, cur));
|
||||
gui_flicker_led (LED_HD, unit->unit, 1);
|
||||
|
||||
filesize = fs_lseek64 (k->fd, 0, SEEK_END);
|
||||
fs_lseek (k->fd, cur, SEEK_SET);
|
||||
|
||||
filesize = fs_fsize64 (k->fd);
|
||||
if (whence == SEEK_CUR)
|
||||
temppos = cur + pos;
|
||||
if (whence == SEEK_SET)
|
||||
@ -4840,7 +4939,8 @@ static void
|
||||
}
|
||||
|
||||
/* Write one then truncate: that should give the right size in all cases. */
|
||||
offset = fs_lseek (k->fd, offset, whence);
|
||||
fs_lseek (k->fd, offset, whence);
|
||||
offset = fs_lseek (k->fd, 0, SEEK_CUR);
|
||||
fs_write (k->fd, /* whatever */(uae_u8*)&k1, 1);
|
||||
if (k->file_pos > offset)
|
||||
k->file_pos = offset;
|
||||
@ -5218,14 +5318,13 @@ static void action_change_file_position64 (Unit *unit, dpacket packet)
|
||||
if (mode < 0)
|
||||
whence = SEEK_SET;
|
||||
|
||||
TRACE((_T("ACTION_CHANGE_FILE_POSITION64(%s,%I64d,%d)\n"), k->aino->nname, pos, mode));
|
||||
TRACE((_T("ACTION_CHANGE_FILE_POSITION64(%s,%lld,%d)\n"), k->aino->nname, pos, mode));
|
||||
gui_flicker_led (LED_HD, unit->unit, 1);
|
||||
|
||||
cur = fs_lseek64 (k->fd, 0, SEEK_CUR);
|
||||
cur = k->file_pos;
|
||||
{
|
||||
uae_s64 temppos;
|
||||
uae_s64 filesize = fs_lseek64 (k->fd, 0, SEEK_END);
|
||||
fs_lseek64 (k->fd, cur, SEEK_SET);
|
||||
uae_s64 filesize = fs_fsize64 (k->fd);
|
||||
|
||||
if (whence == SEEK_CUR)
|
||||
temppos = cur + pos;
|
||||
@ -5248,7 +5347,7 @@ static void action_change_file_position64 (Unit *unit, dpacket packet)
|
||||
} else {
|
||||
PUT_PCK64_RES1 (packet, TRUE);
|
||||
PUT_PCK64_RES2 (packet, 0);
|
||||
k->file_pos = cur;
|
||||
k->file_pos = fs_lseek64 (k->fd, 0, SEEK_CUR);
|
||||
}
|
||||
TRACE((_T("= oldpos %lld newpos %lld\n"), cur, k->file_pos));
|
||||
|
||||
@ -5306,11 +5405,11 @@ static void action_change_file_size64 (Unit *unit, dpacket packet)
|
||||
|
||||
/* Write one then truncate: that should give the right size in all cases. */
|
||||
fs_lseek (k->fd, offset, whence);
|
||||
offset = fs_lseek (k->fd, offset, whence);
|
||||
offset = fs_lseek64 (k->fd, offset, whence);
|
||||
fs_write (k->fd, /* whatever */(uae_u8*)&k1, 1);
|
||||
if (k->file_pos > offset)
|
||||
k->file_pos = offset;
|
||||
fs_lseek (k->fd, k->file_pos, SEEK_SET);
|
||||
fs_lseek64 (k->fd, k->file_pos, SEEK_SET);
|
||||
|
||||
if (my_truncate (k->aino->nname, offset) == -1) {
|
||||
PUT_PCK64_RES1 (packet, DOS_FALSE);
|
||||
@ -5326,7 +5425,7 @@ static void action_change_file_size64 (Unit *unit, dpacket packet)
|
||||
static void action_get_file_size64 (Unit *unit, dpacket packet)
|
||||
{
|
||||
Key *k = lookup_key (unit, GET_PCK64_ARG1 (packet));
|
||||
uae_s64 old, filesize;
|
||||
uae_s64 filesize;
|
||||
|
||||
PUT_PCK64_RES0 (packet, DP64_INIT);
|
||||
|
||||
@ -5335,16 +5434,12 @@ static void action_get_file_size64 (Unit *unit, dpacket packet)
|
||||
PUT_PCK64_RES2 (packet, ERROR_INVALID_LOCK);
|
||||
return;
|
||||
}
|
||||
old = fs_lseek64 (k->fd, 0, SEEK_CUR);
|
||||
filesize = fs_fsize64 (k->fd);
|
||||
TRACE((_T("ACTION_GET_FILE_SIZE64(%s)=%lld\n"), k->aino->nname, filesize));
|
||||
if (old >= 0) {
|
||||
filesize = fs_lseek64 (k->fd, 0, SEEK_END);
|
||||
if (filesize >= 0) {
|
||||
fs_lseek64 (k->fd, old, SEEK_SET);
|
||||
PUT_PCK64_RES1 (packet, filesize);
|
||||
PUT_PCK64_RES2 (packet, 0);
|
||||
return;
|
||||
}
|
||||
if (filesize >= 0) {
|
||||
PUT_PCK64_RES1 (packet, filesize);
|
||||
PUT_PCK64_RES2 (packet, 0);
|
||||
return;
|
||||
}
|
||||
PUT_PCK64_RES1 (packet, DOS_FALSE);
|
||||
PUT_PCK64_RES2 (packet, ERROR_SEEK_ERROR);
|
||||
|
@ -1884,6 +1884,8 @@ static int hardfile_can_quick (uae_u32 command)
|
||||
{
|
||||
switch (command)
|
||||
{
|
||||
case CMD_REMCHANGEINT:
|
||||
return -1;
|
||||
case CMD_RESET:
|
||||
case CMD_STOP:
|
||||
case CMD_START:
|
||||
@ -1891,8 +1893,8 @@ static int hardfile_can_quick (uae_u32 command)
|
||||
case CMD_PROTSTATUS:
|
||||
case CMD_MOTOR:
|
||||
case CMD_GETDRIVETYPE:
|
||||
case CMD_GETNUMTRACKS:
|
||||
case CMD_GETGEOMETRY:
|
||||
case CMD_GETNUMTRACKS:
|
||||
case NSCMD_DEVICEQUERY:
|
||||
return 1;
|
||||
}
|
||||
@ -1913,6 +1915,7 @@ static uae_u32 REGPARAM2 hardfile_beginio (TrapContext *context)
|
||||
int unit = mangleunit (get_long (request + 24));
|
||||
struct hardfiledata *hfd = get_hardfile_data (unit);
|
||||
struct hardfileprivdata *hfpd = &hardfpd[unit];
|
||||
int canquick;
|
||||
|
||||
put_byte (request + 8, NT_MESSAGE);
|
||||
start_thread (context, unit);
|
||||
@ -1921,10 +1924,13 @@ static uae_u32 REGPARAM2 hardfile_beginio (TrapContext *context)
|
||||
return get_byte (request + 31);
|
||||
}
|
||||
put_byte (request + 31, 0);
|
||||
if ((flags & 1) && hardfile_canquick (hfd, request)) {
|
||||
canquick = hardfile_canquick (hfd, request);
|
||||
if (((flags & 1) && canquick) || (canquick < 0)) {
|
||||
hf_log (_T("hf quickio unit=%d request=%p cmd=%d\n"), unit, request, cmd);
|
||||
if (hardfile_do_io (hfd, hfpd, request))
|
||||
hf_log2 (_T("uaehf.device cmd %d bug with IO_QUICK\n"), cmd);
|
||||
if (!(flags & 1))
|
||||
uae_ReplyMsg (request);
|
||||
return get_byte (request + 31);
|
||||
} else {
|
||||
hf_log2 (_T("hf asyncio unit=%d request=%p cmd=%d\n"), unit, request, cmd);
|
||||
|
@ -645,6 +645,7 @@ extern void fixup_cpu (struct uae_prefs *prefs);
|
||||
extern void check_prefs_changed_custom (void);
|
||||
extern void check_prefs_changed_cpu (void);
|
||||
extern void check_prefs_changed_audio (void);
|
||||
extern void check_prefs_changed_cd (void);
|
||||
extern int check_prefs_changed_gfx (void);
|
||||
|
||||
extern struct uae_prefs currprefs, changed_prefs;
|
||||
|
@ -521,9 +521,9 @@ static void setwriteprotect (const TCHAR *fname, bool readonly)
|
||||
if (stat (fname, &st))
|
||||
return;
|
||||
oldmode = mode = st.st_mode;
|
||||
mode &= ~0x04;
|
||||
mode &= ~FILEFLAG_WRITE;
|
||||
if (!readonly)
|
||||
mode |= 0x04;
|
||||
mode |= FILEFLAG_WRITE;
|
||||
if (mode != oldmode)
|
||||
chmod (fname, mode);
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ int main (int argc, char **argv)
|
||||
{
|
||||
directory *root;
|
||||
FILE *inf;
|
||||
int ret;
|
||||
int ret;
|
||||
|
||||
if (argc < 2 || argc > 3) {
|
||||
write_log ("Usage: readdisk <file> [<destdir>]\n");
|
||||
@ -174,7 +174,7 @@ int main (int argc, char **argv)
|
||||
exit (20);
|
||||
}
|
||||
ret = fread (filemem, 1, 901120, inf);
|
||||
if (ret == 0)
|
||||
if (ret == 0)
|
||||
write_log ("Couldn't read enough");
|
||||
|
||||
if (strncmp ((const char *) filemem, "DOS\0", 4) == 0
|
||||
|
@ -412,7 +412,7 @@ static void abort_async (struct devstruct *dev, uaecptr request, int errcode, in
|
||||
while (i < MAX_ASYNC_REQUESTS) {
|
||||
if (dev->d_request[i] == request && dev->d_request_type[i] == ASYNC_REQUEST_TEMP) {
|
||||
/* ASYNC_REQUEST_TEMP = request is processing */
|
||||
uae_msleep (10);
|
||||
sleep_millis (10);
|
||||
i = 0;
|
||||
continue;
|
||||
}
|
||||
@ -940,6 +940,8 @@ static uae_u32 REGPARAM2 dev_beginio (TrapContext *context)
|
||||
canquick = dev_canquick (dev, request);
|
||||
if (((flags & 1) && canquick) || (canquick < 0)) {
|
||||
dev_do_io (dev, request);
|
||||
if (!(flags & 1))
|
||||
uae_ReplyMsg (request);
|
||||
return get_byte (request + 31);
|
||||
} else {
|
||||
add_async_request (dev, request, ASYNC_REQUEST_TEMP, 0);
|
||||
|
@ -34,11 +34,11 @@ void set_logfile (const char *logfile_name)
|
||||
if (newfile)
|
||||
logfile = newfile;
|
||||
} else {
|
||||
if (logfile) {
|
||||
fclose (logfile);
|
||||
if (logfile) {
|
||||
fclose (logfile);
|
||||
|
||||
logfile = 0;
|
||||
}
|
||||
logfile = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ void jit_abort (const char *fmt, ...)
|
||||
|
||||
void flush_log (void)
|
||||
{
|
||||
fflush (logfile ? logfile : stderr);
|
||||
fflush (logfile ? logfile : stderr);
|
||||
}
|
||||
|
||||
// Write Debug Log
|
||||
@ -107,13 +107,13 @@ static int console_buffer_size;
|
||||
|
||||
char *setconsolemode (char *buffer, int maxlen)
|
||||
{
|
||||
char *ret = NULL;
|
||||
if (buffer) {
|
||||
console_buffer = buffer;
|
||||
console_buffer_size = maxlen;
|
||||
} else {
|
||||
ret = console_buffer;
|
||||
console_buffer = NULL;
|
||||
}
|
||||
return ret;
|
||||
char *ret = NULL;
|
||||
if (buffer) {
|
||||
console_buffer = buffer;
|
||||
console_buffer_size = maxlen;
|
||||
} else {
|
||||
ret = console_buffer;
|
||||
console_buffer = NULL;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
64
src/zfile.c
64
src/zfile.c
@ -1005,6 +1005,7 @@ end:
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef A_LZX
|
||||
static struct zfile *dsq (struct zfile *z, int lzx)
|
||||
{
|
||||
struct zfile *zi = NULL;
|
||||
@ -1095,12 +1096,15 @@ static struct zfile *dsq (struct zfile *z, int lzx)
|
||||
zfile_fclose (zi);
|
||||
return z;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef A_WRP
|
||||
static struct zfile *wrp (struct zfile *z)
|
||||
{
|
||||
//return unwarp (z);
|
||||
return z;
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct zfile *bunzip (const char *decompress, struct zfile *z)
|
||||
{
|
||||
@ -1112,6 +1116,7 @@ static struct zfile *lha (struct zfile *z)
|
||||
return z;
|
||||
}
|
||||
|
||||
#ifdef A_DMS
|
||||
static struct zfile *dms (struct zfile *z, int index, int *retcode)
|
||||
{
|
||||
int ret;
|
||||
@ -1182,6 +1187,7 @@ end:
|
||||
zfile_fclose (zextra[i]);
|
||||
return zo;
|
||||
}
|
||||
#endif
|
||||
|
||||
const TCHAR *uae_ignoreextensions[] =
|
||||
{ _T(".gif"), _T(".jpg"), _T(".png"), _T(".xml"), _T(".pdf"), _T(".txt"), 0 };
|
||||
@ -1353,8 +1359,6 @@ struct zfile *zuncompress (struct znode *parent, struct zfile *z, int dodefault,
|
||||
}*/
|
||||
if (mask & ZFD_UNPACK) {
|
||||
if (index == 0) {
|
||||
// if (strcasecmp (ext, _T("zip")) == 0)
|
||||
// return unzip (z);
|
||||
if (strcasecmp (ext, _T("gz")) == 0)
|
||||
return zfile_gunzip (z, retcode);
|
||||
if (strcasecmp (ext, _T("adz")) == 0)
|
||||
@ -1363,13 +1367,19 @@ struct zfile *zuncompress (struct znode *parent, struct zfile *z, int dodefault,
|
||||
return zfile_gunzip (z, retcode);
|
||||
if (strcasecmp (ext, _T("hdz")) == 0)
|
||||
return zfile_gunzip (z, retcode);
|
||||
#ifdef A_WRP
|
||||
if (strcasecmp (ext, _T("wrp")) == 0)
|
||||
return wrp (z);
|
||||
#endif
|
||||
#ifdef A_7Z
|
||||
// if (strcasecmp (ext, _T("xz")) == 0)
|
||||
// return xz (z, retcode);
|
||||
#endif
|
||||
}
|
||||
#ifdef A_DMS
|
||||
if (strcasecmp (ext, _T("dms")) == 0)
|
||||
return dms (z, index, retcode);
|
||||
#endif
|
||||
}
|
||||
if (mask & ZFD_RAWDISK) {
|
||||
#ifdef CAPS
|
||||
@ -1381,8 +1391,14 @@ struct zfile *zuncompress (struct znode *parent, struct zfile *z, int dodefault,
|
||||
if (mask & (ZFD_RAWDISK_PC | ZFD_RAWDISK_AMIGA))
|
||||
return NULL;
|
||||
}
|
||||
if (strcasecmp (ext, "lha") == 0 || strcasecmp (ext, "lzh") == 0)
|
||||
return lha (z);
|
||||
#if defined(ARCHIVEACCESS)
|
||||
if (index == 0) {
|
||||
for (i = 0; plugins_7z_x[i]; i++) {
|
||||
if ((plugins_7z_t[i] & mask) && strcasecmp (ext, plugins_7z[i]) == 0)
|
||||
return archive_access_arcacc_select (z, plugins_7z_t[i], retcode);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
memset (header, 0, sizeof (header));
|
||||
zfile_fseek (z, 0, SEEK_SET);
|
||||
@ -1397,15 +1413,19 @@ struct zfile *zuncompress (struct znode *parent, struct zfile *z, int dodefault,
|
||||
if (index == 0) {
|
||||
if (header[0] == 0x1f && header[1] == 0x8b)
|
||||
return zfile_gunzip (z, retcode);
|
||||
// if (header[0] == 'P' && header[1] == 'K')
|
||||
// return unzip (z);
|
||||
#ifdef A_LZX
|
||||
if (header[0] == 'P' && header[1] == 'K' && header[2] == 'D')
|
||||
return dsq (z, 0);
|
||||
#endif
|
||||
#ifdef A_7Z
|
||||
// if (header[0] == 0xfd && header[1] == 0x37 && header[2] == 0x7a && header[3] == 0x58 && header[4] == 0x5a && header[5] == 0)
|
||||
// return xz (z);
|
||||
#endif
|
||||
}
|
||||
#ifdef A_DMS
|
||||
if (header[0] == 'D' && header[1] == 'M' && header[2] == 'S' && header[3] == '!')
|
||||
return dms (z, index, retcode);
|
||||
#endif
|
||||
}
|
||||
if (mask & ZFD_RAWDISK) {
|
||||
#ifdef CAPS
|
||||
@ -1440,8 +1460,10 @@ struct zfile *zuncompress (struct znode *parent, struct zfile *z, int dodefault,
|
||||
|
||||
/* if (ext) {
|
||||
if (mask & ZFD_UNPACK) {
|
||||
#ifdef A_LZX
|
||||
if (strcasecmp (ext, _T("dsq")) == 0)
|
||||
return dsq (z, 1);
|
||||
#endif
|
||||
}
|
||||
if (mask & ZFD_ADF) {
|
||||
if (strcasecmp (ext, _T("adf")) == 0 && !memcmp (header, "DOS", 3))
|
||||
@ -2549,18 +2571,30 @@ static struct zvolume *zfile_fopen_archive_ext (struct znode *parent, struct zfi
|
||||
if (ext != NULL) {
|
||||
ext++;
|
||||
if (flags & ZFD_ARCHIVE) {
|
||||
/* if (strcasecmp (ext, _T("lha")) == 0 || strcasecmp (ext, _T("lzh")) == 0)
|
||||
/*
|
||||
#ifdef A_LHA
|
||||
if (strcasecmp (ext, _T("lha")) == 0 || strcasecmp (ext, _T("lzh")) == 0)
|
||||
zv = archive_directory_lha (zf);
|
||||
#endif
|
||||
#ifdef A_ZIP
|
||||
if (strcasecmp (ext, _T("zip")) == 0)
|
||||
zv = archive_directory_zip (zf);
|
||||
#endif
|
||||
#ifdef A_7Z
|
||||
if (strcasecmp (ext, _T("7z")) == 0)
|
||||
zv = archive_directory_7z (zf);
|
||||
#endif
|
||||
#ifdef A_LZX
|
||||
if (strcasecmp (ext, _T("lzx")) == 0)
|
||||
zv = archive_directory_lzx (zf);
|
||||
#endif
|
||||
#ifdef A_RAR
|
||||
if (strcasecmp (ext, _T("rar")) == 0)
|
||||
zv = archive_directory_rar (zf);
|
||||
#endif
|
||||
if (strcasecmp (ext, _T("tar")) == 0)
|
||||
zv = archive_directory_tar (zf);*/
|
||||
zv = archive_directory_tar (zf);
|
||||
*/
|
||||
}
|
||||
if (flags & ZFD_ADF) {
|
||||
/* if (strcasecmp (ext, _T("adf")) == 0 && !memcmp (header, "DOS", 3))
|
||||
@ -2588,14 +2622,24 @@ static struct zvolume *zfile_fopen_archive_data (struct znode *parent, struct zf
|
||||
zfile_fread (header, sizeof (header), 1, zf);
|
||||
zfile_fseek (zf, 0, SEEK_SET);
|
||||
if (flags & ZFD_ARCHIVE) {
|
||||
/* if (header[0] == 'P' && header[1] == 'K')
|
||||
/*
|
||||
#ifdef A_ZIP
|
||||
if (header[0] == 'P' && header[1] == 'K')
|
||||
zv = archive_directory_zip (zf);
|
||||
#endif
|
||||
#ifdef A_RAR
|
||||
if (header[0] == 'R' && header[1] == 'a' && header[2] == 'r' && header[3] == '!')
|
||||
zv = archive_directory_rar (zf);
|
||||
#endif
|
||||
#ifdef A_LZX
|
||||
if (header[0] == 'L' && header[1] == 'Z' && header[2] == 'X')
|
||||
zv = archive_directory_lzx (zf);
|
||||
#endif
|
||||
#ifdef A_LHA
|
||||
if (header[2] == '-' && header[3] == 'l' && header[4] == 'h' && header[6] == '-')
|
||||
zv = archive_directory_lha (zf);*/
|
||||
zv = archive_directory_lha (zf);
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
if (flags & ZFD_ADF) {
|
||||
/* if (header[0] == 'D' && header[1] == 'O' && header[2] == 'S' && (header[3] >= 0 && header[3] <= 7))
|
||||
|
@ -66,21 +66,31 @@ static struct zvolume *getzvolume (struct znode *parent, struct zfile *zf, unsig
|
||||
|
||||
switch (id)
|
||||
{
|
||||
#ifdef A_ZIP
|
||||
case ArchiveFormatZIP:
|
||||
zv = archive_directory_zip (zf);
|
||||
break;
|
||||
#endif
|
||||
#ifdef A_7Z
|
||||
// case ArchiveFormat7Zip:
|
||||
// zv = archive_directory_7z (zf);
|
||||
// break;
|
||||
#endif
|
||||
#ifdef A_RAR
|
||||
// case ArchiveFormatRAR:
|
||||
// zv = archive_directory_rar (zf);
|
||||
// break;
|
||||
#endif
|
||||
#ifdef A_LHA
|
||||
// case ArchiveFormatLHA:
|
||||
// zv = archive_directory_lha (zf);
|
||||
// break;
|
||||
#endif
|
||||
#ifdef A_LZX
|
||||
// case ArchiveFormatLZX:
|
||||
// zv = archive_directory_lzx (zf);
|
||||
// break;
|
||||
#endif
|
||||
case ArchiveFormatPLAIN:
|
||||
zv = archive_directory_plain (zf);
|
||||
break;
|
||||
@ -97,8 +107,10 @@ static struct zvolume *getzvolume (struct znode *parent, struct zfile *zf, unsig
|
||||
zv = archive_directory_fat (zf);
|
||||
break;
|
||||
}
|
||||
// if (!zv)
|
||||
// zv = archive_directory_arcacc (zf, id);
|
||||
#ifdef ARCHIVEACCESS
|
||||
if (!zv)
|
||||
zv = archive_directory_arcacc (zf, id);
|
||||
#endif
|
||||
return zv;
|
||||
}
|
||||
|
||||
@ -351,6 +363,7 @@ struct zfile *archive_access_tar (struct znode *zn)
|
||||
}
|
||||
|
||||
/* ZIP */
|
||||
#ifdef A_ZIP
|
||||
|
||||
static void archive_close_zip (void *handle)
|
||||
{
|
||||
@ -492,6 +505,7 @@ static struct zfile *archive_unpack_zip (struct zfile *zf)
|
||||
{
|
||||
return archive_do_zip (NULL, zf, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ArchiveAccess */
|
||||
|
||||
@ -1704,17 +1718,25 @@ void archive_access_close (void *handle, unsigned int id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
#ifdef A_ZIP
|
||||
case ArchiveFormatZIP:
|
||||
archive_close_zip (handle);
|
||||
break;
|
||||
#endif
|
||||
#ifdef A_7Z
|
||||
// case ArchiveFormat7Zip:
|
||||
// archive_close_7z (handle);
|
||||
// break;
|
||||
#endif
|
||||
#ifdef A_RAR
|
||||
// case ArchiveFormatRAR:
|
||||
// archive_close_rar (handle);
|
||||
// break;
|
||||
#endif
|
||||
#ifdef A_LHA
|
||||
case ArchiveFormatLHA:
|
||||
break;
|
||||
#endif
|
||||
case ArchiveFormatADF:
|
||||
archive_close_adf (handle);
|
||||
break;
|
||||
@ -1739,9 +1761,11 @@ struct zfile *archive_unpackzfile (struct zfile *zf)
|
||||
zf->datasize = zf->size;
|
||||
switch (zf->archiveid)
|
||||
{
|
||||
#ifdef A_ZIP
|
||||
case ArchiveFormatZIP:
|
||||
zout = archive_unpack_zip (zf);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
zfile_fclose (zf->archiveparent);
|
||||
zf->archiveparent = NULL;
|
||||
@ -1755,21 +1779,31 @@ struct zfile *archive_getzfile (struct znode *zn, unsigned int id, int flags)
|
||||
|
||||
switch (id)
|
||||
{
|
||||
#ifdef A_ZIP
|
||||
case ArchiveFormatZIP:
|
||||
zf = archive_access_zip (zn, flags);
|
||||
break;
|
||||
#endif
|
||||
#ifdef A_7Z
|
||||
// case ArchiveFormat7Zip:
|
||||
// zf = archive_access_7z (zn);
|
||||
// break;
|
||||
#endif
|
||||
#ifdef A_RAR
|
||||
// case ArchiveFormatRAR:
|
||||
// zf = archive_access_rar (zn);
|
||||
// break;
|
||||
#endif
|
||||
#ifdef A_LHA
|
||||
// case ArchiveFormatLHA:
|
||||
// zf = archive_access_lha (zn);
|
||||
// break;
|
||||
#endif
|
||||
#ifdef A_LZX
|
||||
// case ArchiveFormatLZX:
|
||||
// zf = archive_access_lzx (zn);
|
||||
// break;
|
||||
#endif
|
||||
case ArchiveFormatPLAIN:
|
||||
zf = archive_access_plain (zn);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user