From 48d7bf18d608d6c8a8a7f773473a18fa98fef2d3 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Fri, 11 Jun 2010 21:38:49 +0300 Subject: [PATCH] 2200b9 --- filesys.asm | 2 +- filesys_bootrom.cpp | 6 +- od-win32/dinput.cpp | 1 - od-win32/direct3d.cpp | 9 +-- od-win32/hardfile_win32.cpp | 8 ++- od-win32/resources/resource | 10 ++-- od-win32/resources/winuae.rc | 20 +++++++ od-win32/win32.cpp | 6 +- od-win32/win32.h | 2 +- od-win32/win32gfx.cpp | 4 +- od-win32/win32gui.cpp | 111 +++++++++++++++++++++++++++++++---- rommgr.cpp | 12 ++-- uaeunp.cpp | 4 +- zfile.cpp | 11 +++- zfile_archive.cpp | 7 ++- 15 files changed, 167 insertions(+), 46 deletions(-) diff --git a/filesys.asm b/filesys.asm index 2231477a..523b44d2 100644 --- a/filesys.asm +++ b/filesys.asm @@ -250,9 +250,9 @@ FSIN_chip_done move.w #$FF80,d0 bsr.w getrtbase jsr (a0) ; d1 = size, a1 = start address - beq.s FSIN_fchip_done move.l a1,a0 move.l d1,d0 + beq.s FSIN_fchip_done move.l d4,d1 moveq #-5,d2 lea fchipname(pc),a1 diff --git a/filesys_bootrom.cpp b/filesys_bootrom.cpp index 23745ac0..9b150eb3 100644 --- a/filesys_bootrom.cpp +++ b/filesys_bootrom.cpp @@ -22,9 +22,9 @@ db(0x22); db(0x4e); db(0x20); db(0x08); db(0x30); db(0x7c); db(0xff); db(0xb8); db(0x4e); db(0xae); db(0xfe); db(0x5c); db(0x61); db(0x00); db(0x11); db(0xfe); db(0x61); db(0x00); db(0x15); db(0xb0); db(0x4c); db(0xdf); db(0x7e); db(0xff); - db(0x4e); db(0x75); db(0x4e); db(0xae); db(0x08); db(0x00); db(0x00); db(0x02); + db(0x4e); db(0x75); db(0x00); db(0x00); db(0x08); db(0x00); db(0x00); db(0x02); db(0x67); db(0x06); db(0x4e); db(0xb9); db(0x00); db(0xf0); db(0x00); db(0x00); - db(0x4e); db(0xf9); db(0x00); db(0xf0); db(0x00); db(0x00); db(0x28); db(0x40); + db(0x4e); db(0xf9); db(0x00); db(0xf0); db(0x00); db(0x00); db(0x00); db(0x00); db(0x48); db(0xe7); db(0xff); db(0xfe); db(0x2c); db(0x78); db(0x00); db(0x04); db(0x30); db(0x3c); db(0xff); db(0xfc); db(0x61); db(0x00); db(0x0b); db(0xaa); db(0x2a); db(0x50); db(0x43); db(0xfa); db(0x16); db(0xf3); db(0x70); db(0x24); @@ -51,7 +51,7 @@ db(0x00); db(0x20); db(0x00); db(0x00); db(0x90); db(0x88); db(0x65); db(0x08); db(0x67); db(0x06); db(0x93); db(0xc9); db(0x4e); db(0xae); db(0xfd); db(0x96); db(0x30); db(0x3c); db(0xff); db(0x80); db(0x61); db(0x00); db(0x0a); db(0xea); - db(0x4e); db(0x90); db(0x67); db(0x10); db(0x20); db(0x49); db(0x20); db(0x01); + db(0x4e); db(0x90); db(0x20); db(0x49); db(0x20); db(0x01); db(0x67); db(0x0c); db(0x22); db(0x04); db(0x74); db(0xfb); db(0x43); db(0xfa); db(0x16); db(0x4f); db(0x4e); db(0xae); db(0xfd); db(0x96); db(0x41); db(0xfa); db(0x15); db(0xc6); db(0x43); db(0xfa); db(0x00); db(0x54); db(0x70); db(0x0a); db(0x61); db(0x00); diff --git a/od-win32/dinput.cpp b/od-win32/dinput.cpp index 819eb45d..643d6318 100644 --- a/od-win32/dinput.cpp +++ b/od-win32/dinput.cpp @@ -1454,7 +1454,6 @@ static BOOL di_enumcallback2 (LPCDIDEVICEINSTANCE lpddi, int joy) if (!memcmp (&did->iguid, &GUID_SysKeyboard, sizeof (GUID)) || !memcmp (&did->iguid, &GUID_SysMouse, sizeof (GUID))) { did->priority = 2; did->superdevice = 1; - _tcscat (did->name, L" *"); } return DIENUM_CONTINUE; } diff --git a/od-win32/direct3d.cpp b/od-win32/direct3d.cpp index 3a8206ae..09d42664 100644 --- a/od-win32/direct3d.cpp +++ b/od-win32/direct3d.cpp @@ -8,7 +8,8 @@ #if defined (D3D) && defined (GFXFILTER) #define EFFECT_VERSION 2 -#define D3DX9DLL L"d3dx9_43.dll" +#define D3DX9DLL1 L"d3dx9_42.dll" +#define D3DX9DLL2 L"d3dx9_43.dll" #include "options.h" #include "xwin.h" @@ -445,7 +446,7 @@ int D3D_canshaders (void) if (d3d_yesno > 0) return 1; d3d_yesno = -1; - h = LoadLibrary (D3DX9DLL); + h = LoadLibrary (D3DX9DLL1); if (h != NULL) { FreeLibrary (h); d3dx = Direct3DCreate9 (D3D_SDK_VERSION); @@ -1570,9 +1571,9 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth return errmsg; } - d3dx = LoadLibrary (D3DX9DLL); + d3dx = LoadLibrary (os_vista ? D3DX9DLL2 : D3DX9DLL1); if (d3dx == NULL) { - _tcscpy (errmsg, L"Direct3D: June 2010 or newer DirectX Runtime required.\n\nhttp://go.microsoft.com/fwlink/?linkid=56513"); + _tcscpy (errmsg, L"Direct3D: Newer DirectX Runtime required.\n\nhttp://go.microsoft.com/fwlink/?linkid=56513"); if (isfullscreen () <= 0) ShellExecute(NULL, L"open", L"http://go.microsoft.com/fwlink/?linkid=56513", NULL, NULL, SW_SHOWNORMAL); return errmsg; diff --git a/od-win32/hardfile_win32.cpp b/od-win32/hardfile_win32.cpp index 410e45ee..545d5226 100644 --- a/od-win32/hardfile_win32.cpp +++ b/od-win32/hardfile_win32.cpp @@ -1744,9 +1744,11 @@ int harddrive_to_hdf (HWND hDlg, struct uae_prefs *p, int idx) SendMessage (hwndprogress, PBM_SETPOS, (WPARAM)pct, 0); _stprintf (tmp, L"%dM / %dM (%d%%)", (int)(written >> 20), (int)(size >> 20), pct); SendMessage (hwndprogresstxt, WM_SETTEXT, 0, (LPARAM)tmp); - while (PeekMessage (&msg, 0, 0, 0, PM_REMOVE)) { - TranslateMessage (&msg); - DispatchMessage (&msg); + while (PeekMessage (&msg, hwnd, 0, 0, PM_REMOVE)) { + if (!IsDialogMessage (hwnd, &msg)) { + TranslateMessage (&msg); + DispatchMessage (&msg); + } } cnt = 0; } diff --git a/od-win32/resources/resource b/od-win32/resources/resource index 51560c3d..8cfdd2a5 100644 --- a/od-win32/resources/resource +++ b/od-win32/resources/resource @@ -328,6 +328,7 @@ #define IDS_PRINTER_POSTSCRIPT_EMULATION 354 #define IDD_INPUTMAP 354 #define IDS_PRINTER_PASSTHROUGH 355 +#define IDD_INFOBOX 355 #define IDS_RES_LORES 356 #define IDS_RES_HIRES 357 #define IDS_RES_SUPERHIRES 358 @@ -402,7 +403,6 @@ #define IDC_MBRAM1 1050 #define IDC_MBRAM2 1051 #define IDC_Z3CHIPMEM 1052 -#define IDC_Z3FASTRAM2 1053 #define IDC_Z3CHIPRAM 1053 #define IDC_UAEHOME 1070 #define IDC_PICASSOHOME 1071 @@ -1041,8 +1041,10 @@ #define IDC_PORT0_REMAP 1799 #define IDC_PORT2_REMAP 1800 #define IDC_PORT3_REMAP 1801 -#define IDC_EDIT1 1801 #define IDC_INPUTMAPOUT 1801 +#define IDC_INFOBOX_TEXT2 1802 +#define IDC_INFOBOX_TEXT1 1803 +#define IDC_INFOBOX_TEXT3 1804 #define ID__FLOPPYDRIVES 40004 #define ID_FLOPPYDRIVES_DF0 40005 #define ID_ST_CONFIGURATION 40010 @@ -1086,9 +1088,9 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 #define _APS_3D_CONTROLS 1 -#define _APS_NEXT_RESOURCE_VALUE 355 +#define _APS_NEXT_RESOURCE_VALUE 356 #define _APS_NEXT_COMMAND_VALUE 40045 -#define _APS_NEXT_CONTROL_VALUE 1802 +#define _APS_NEXT_CONTROL_VALUE 1803 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index bd95b895..d790206c 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -1032,6 +1032,18 @@ BEGIN EDITTEXT IDC_INPUTMAPOUT,0,222,299,14,ES_AUTOHSCROLL | WS_DISABLED END +IDD_INFOBOX DIALOGEX 0, 0, 420, 68 +STYLE DS_LOCALEDIT | DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "Scanning ROM image files..." +FONT 8, "MS Sans Serif", 0, 0, 0x0 +BEGIN + DEFPUSHBUTTON "OK",IDOK,123,50,50,14,NOT WS_VISIBLE + PUSHBUTTON "Cancel",IDCANCEL,182,50,50,14 + CTEXT "",IDC_INFOBOX_TEXT2,6,21,412,11,SS_CENTERIMAGE | SS_SUNKEN | WS_TABSTOP + CTEXT "",IDC_INFOBOX_TEXT1,6,7,412,11,SS_CENTERIMAGE | SS_SUNKEN | WS_TABSTOP + CTEXT "",IDC_INFOBOX_TEXT3,5,35,412,11,SS_CENTERIMAGE | SS_SUNKEN | WS_TABSTOP +END + ///////////////////////////////////////////////////////////////////////////// // @@ -1249,6 +1261,10 @@ BEGIN BEGIN END + IDD_PROGRESSBAR, DIALOG + BEGIN + END + IDD_STRINGBOX, DIALOG BEGIN END @@ -1257,6 +1273,10 @@ BEGIN BEGIN TOPMARGIN, 1 END + + IDD_INFOBOX, DIALOG + BEGIN + END END #endif // APSTUDIO_INVOKED diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 1b682aa3..45c9c565 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -2916,7 +2916,7 @@ void fetch_path (TCHAR *name, TCHAR *out, int size) fixtrailing (out); } -int get_rom_path(TCHAR *out, int mode) +int get_rom_path (TCHAR *out, int mode) { TCHAR tmp[MAX_DPATH]; @@ -3050,7 +3050,7 @@ static void romlist_add2 (TCHAR *path, struct romdata *rd) romlist_add (path, rd); } -extern int scan_roms (int); +extern int scan_roms (HWND, int); void read_rom_list (void) { TCHAR tmp2[1000]; @@ -3066,7 +3066,7 @@ void read_rom_list (void) return; if (!exists || forceroms) { load_keyring (NULL, NULL); - scan_roms (forceroms ? 0 : 1); + scan_roms (NULL, forceroms ? 0 : 1); } forceroms = 0; idx = 0; diff --git a/od-win32/win32.h b/od-win32/win32.h index fb2cb89d..b708e384 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -19,7 +19,7 @@ #define LANG_DLL 1 #define WINUAEBETA L"8" -#define WINUAEDATE MAKEBD(2010, 6, 9) +#define WINUAEDATE MAKEBD(2010, 6, 11) #define WINUAEEXTRA L"" #define WINUAEREV L"" diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 84681014..87124dde 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -2321,11 +2321,11 @@ static int create_windows_2 (void) SetCursorPos (x + w / 2, y + h / 2); addnotifications (hAmigaWnd, FALSE, FALSE); if (hMainWnd != hAmigaWnd) { - if (!currprefs.headless) + if (!currprefs.headless && !rp_isactive ()) ShowWindow (hMainWnd, firstwindow ? SW_SHOWDEFAULT : SW_SHOWNORMAL); UpdateWindow (hMainWnd); } - if (!currprefs.headless) + if (!currprefs.headless && !rp_isactive ()) ShowWindow (hAmigaWnd, firstwindow ? SW_SHOWDEFAULT : SW_SHOWNORMAL); UpdateWindow (hAmigaWnd); firstwindow = 0; diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 2c7b0a89..fd8dc630 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -1277,16 +1277,87 @@ static int isromext (TCHAR *path) return 0; } +static bool infoboxdialogstate; +static HWND infoboxhwnd; +static INT_PTR CALLBACK InfoBoxDialogProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) + { + case WM_DESTROY: + PostQuitMessage (0); + infoboxdialogstate = false; + return TRUE; + case WM_CLOSE: + DestroyWindow (hDlg); + infoboxdialogstate = false; + return TRUE; + case WM_INITDIALOG: + { + HWND owner = GetParent (hDlg); + if (!owner) { + owner = GetDesktopWindow (); + RECT ownerrc, merc; + GetWindowRect (owner, &ownerrc); + GetWindowRect (hDlg, &merc); + SetWindowPos (hDlg, NULL, + ownerrc.left + ((ownerrc.right - ownerrc.left) - (merc.right - merc.left)) /2, + ownerrc.top + ((ownerrc.bottom - ownerrc.top) - (merc.bottom - merc.top)) / 2, + 0, 0, + SWP_NOSIZE); + } + return TRUE; + } + case WM_COMMAND: + switch (LOWORD (wParam)) + { + case IDCANCEL: + infoboxdialogstate = false; + DestroyWindow (hDlg); + return TRUE; + } + break; + } + return FALSE; +} +static bool scan_rom_hook (const TCHAR *name, int line) +{ + MSG msg; + if (!infoboxhwnd) + return true; + if (name != NULL) { + const TCHAR *s = NULL; + if (line == 2) { + s = _tcsrchr (name, '/'); + if (!s) + s = _tcsrchr (name, '\\'); + if (s) + s++; + } + SetWindowText (GetDlgItem (infoboxhwnd, line == 1 ? IDC_INFOBOX_TEXT1 : (line == 2 ? IDC_INFOBOX_TEXT2 : IDC_INFOBOX_TEXT3)), s ? s : name); + } + while (PeekMessage (&msg, infoboxhwnd, 0, 0, PM_REMOVE)) { + if (!IsDialogMessage (infoboxhwnd, &msg)) { + TranslateMessage (&msg); + DispatchMessage (&msg); + } + } + return infoboxdialogstate; +} + static int scan_rom_2 (struct zfile *f, void *vrsd) { struct romscandata *rsd = (struct romscandata*)vrsd; TCHAR *path = zfile_getname(f); struct romdata *rd; - if (!isromext(path)) + scan_rom_hook (NULL, 0); + if (!isromext (path)) return 0; rd = scan_single_rom_2 (f); if (rd) { + TCHAR name[MAX_DPATH]; + getromname (rd, name); + scan_rom_hook (name, 3); addrom (rsd->fkey, rd, path); rsd->got = 1; } @@ -1303,6 +1374,7 @@ static int scan_rom (TCHAR *path, UAEREG *fkey) //write_log("ROMSCAN: skipping file '%s', unknown extension\n", path); return 0; } + scan_rom_hook (path, 2); for (;;) { TCHAR tmp[MAX_DPATH]; _tcscpy (tmp, path); @@ -1411,6 +1483,7 @@ static int scan_roms_2 (UAEREG *fkey, TCHAR *path) handle = FindFirstFile (buf, &find_data); if (handle == INVALID_HANDLE_VALUE) return 0; + scan_rom_hook (path, 1); for (;;) { TCHAR tmppath[MAX_DPATH]; _tcscpy (tmppath, path); @@ -1419,7 +1492,7 @@ static int scan_roms_2 (UAEREG *fkey, TCHAR *path) if (scan_rom (tmppath, fkey)) ret = 1; } - if (FindNextFile (handle, &find_data) == 0) { + if (!scan_rom_hook (NULL, 0) || FindNextFile (handle, &find_data) == 0) { FindClose (handle); break; } @@ -1429,12 +1502,13 @@ static int scan_roms_2 (UAEREG *fkey, TCHAR *path) #define MAX_ROM_PATHS 10 -static int scan_roms_3(UAEREG *fkey, TCHAR **paths, TCHAR *path) +static int scan_roms_3 (UAEREG *fkey, TCHAR **paths, TCHAR *path) { int i, ret; TCHAR pathp[MAX_DPATH]; ret = 0; + scan_rom_hook (NULL, 0); GetFullPathName (path, MAX_DPATH, pathp, NULL); for (i = 0; i < MAX_ROM_PATHS; i++) { if (paths[i] && !_tcsicmp (paths[i], pathp)) @@ -1450,15 +1524,17 @@ static int scan_roms_3(UAEREG *fkey, TCHAR **paths, TCHAR *path) return ret; } -extern int get_rom_path(TCHAR *out, int mode); +extern int get_rom_path (TCHAR *out, int mode); -int scan_roms (int show) +int scan_roms (HWND hDlg, int show) { TCHAR path[MAX_DPATH]; static int recursive; int id, i, ret, keys, cnt; UAEREG *fkey, *fkey2; TCHAR *paths[MAX_ROM_PATHS]; + HWND hwnd = 0; + MSG msg; if (recursive) return 0; @@ -1469,11 +1545,18 @@ int scan_roms (int show) if (fkey == NULL) goto end; + infoboxdialogstate = true; + hwnd = CreateDialog (hUIDLL ? hUIDLL : hInst, MAKEINTRESOURCE (IDD_INFOBOX), hDlg, InfoBoxDialogProc); + if (!hwnd) + goto end; + infoboxhwnd = hwnd; + cnt = 0; ret = 0; for (i = 0; i < MAX_ROM_PATHS; i++) paths[i] = NULL; - for (;;) { + scan_rom_hook (NULL, 0); + while (scan_rom_hook (NULL, 0)) { keys = get_keyring (); fetch_path (L"KickstartPath", path, sizeof path / sizeof (TCHAR)); cnt += scan_roms_3 (fkey, paths, path); @@ -1516,6 +1599,14 @@ int scan_roms (int show) } end: + infoboxhwnd = NULL; + if (hwnd) { + DestroyWindow (hwnd); + while (PeekMessage (&msg, 0, 0, 0, PM_REMOVE)) { + TranslateMessage (&msg); + DispatchMessage (&msg); + } + } read_rom_list (); if (show) show_rom_list (); @@ -4431,7 +4522,7 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM if (DirectorySelection (hDlg, &pathsguid, tmp)) { load_keyring (&workprefs, NULL); set_path (L"KickstartPath", tmp); - if (!scan_roms (1)) + if (!scan_roms (hDlg, 1)) gui_message_id (IDS_ROMSCANNOROMS); values_to_pathsdialog (hDlg); } @@ -4549,7 +4640,7 @@ static INT_PTR CALLBACK PathsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM } break; case IDC_ROM_RESCAN: - scan_roms (1); + scan_roms (hDlg, 1); break; case IDC_RESETREGISTRY: resetregistry (); @@ -6870,7 +6961,7 @@ static void init_kickstart (HWND hDlg) ew (hDlg, IDC_FLASHCHOOSER), FALSE); #endif if (!regexiststree (NULL , L"DetectedROMs")) - scan_roms (1); + scan_roms (NULL, 1); } static void kickstartfilebuttons (HWND hDlg, WPARAM wParam, TCHAR *path) @@ -10844,7 +10935,7 @@ static int askinputcustom (HWND hDlg, TCHAR *custom, int maxlen, DWORD titleid) while (stringboxdialogactive == 1) { MSG msg; int ret; - WaitMessage(); + WaitMessage (); while ((ret = GetMessage (&msg, NULL, 0, 0))) { if (ret == -1) break; diff --git a/rommgr.cpp b/rommgr.cpp index 2996f976..e3069f4b 100644 --- a/rommgr.cpp +++ b/rommgr.cpp @@ -357,13 +357,13 @@ static void romlist_cleanup (void) } if (ok == 0) { while (i < j) { - struct romlist *rl = romlist_getrl (&roms[i]); - if (rl) { - int cnt = romlist_cnt - i - 1; - write_log (L"%s '%s' removed from romlist\n", roms[k].name, rl->path); - xfree (rl->path); + struct romlist *rl2 = romlist_getrl (&roms[i]); + if (rl2) { + int cnt = romlist_cnt - (rl2 - rl) - 1; + write_log (L"%s '%s' removed from romlist\n", roms[k].name, rl2->path); + xfree (rl2->path); if (cnt > 0) - memmove (rl, rl + 1, cnt * sizeof (struct romlist)); + memmove (rl2, rl2 + 1, cnt * sizeof (struct romlist)); romlist_cnt--; } i++; diff --git a/uaeunp.cpp b/uaeunp.cpp index 3dab5fb8..8d33ab2e 100644 --- a/uaeunp.cpp +++ b/uaeunp.cpp @@ -15,7 +15,7 @@ TCHAR start_path_data[MAX_DPATH]; TCHAR sep[] = { FSDB_DIR_SEPARATOR, 0 }; struct uae_prefs currprefs; -static int debug = 1; +static int debug = 0; static int amigatest; #define WRITE_LOG_BUF_SIZE 4096 @@ -698,7 +698,7 @@ int __cdecl wmain (int argc, wchar_t *argv[], wchar_t *envp[]) ok = 1; } if (!ok) { - _tprintf (L"UAE unpacker uaeunp 0.8b by Toni Wilen (c)2010\n"); + _tprintf (L"UAE unpacker uaeunp 0.8c by Toni Wilen (c)2010\n"); _tprintf (L"\n"); _tprintf (L"List: \"uaeunp (-l) \"\n"); _tprintf (L"List all recursively: \"uaeunp -l **\"\n"); diff --git a/zfile.cpp b/zfile.cpp index 4569df21..2d3f8914 100644 --- a/zfile.cpp +++ b/zfile.cpp @@ -2584,7 +2584,6 @@ static struct zvolume *prepare_recursive_volume (struct zvolume *zv, const TCHAR { struct zfile *zf = NULL; struct zvolume *zvnew = NULL; -// int i; int done = 0; #ifdef ZFILE_DEBUG @@ -2595,6 +2594,11 @@ static struct zvolume *prepare_recursive_volume (struct zvolume *zv, const TCHAR goto end; zvnew = zfile_fopen_archive_ext (zv->parentz, zf); if (!zvnew) { +#if 1 + zvnew = archive_directory_plain (zf); + zfile_fopen_archive_recurse (zvnew); + done = 1; +#else int rc; int index; struct zfile *zf2, *zf3; @@ -2615,12 +2619,13 @@ static struct zvolume *prepare_recursive_volume (struct zvolume *zv, const TCHAR } } else { zfile_fclose (zf3); - if (rc == 0) + if (rc <= 0) break; } index++; - break; + break; // TODO } +#endif } else { zvnew->parent = zv->parent; zfile_fopen_archive_recurse (zvnew); diff --git a/zfile_archive.cpp b/zfile_archive.cpp index 97f64602..6a45aac6 100644 --- a/zfile_archive.cpp +++ b/zfile_archive.cpp @@ -1022,9 +1022,10 @@ struct zvolume *archive_directory_plain (struct zfile *z) zai.size = zfile_ftell (zf2); zfile_fseek (zf2, 0, SEEK_SET); zn = zvolume_addfile_abs (zv, &zai); - if (zn) - zn->offset = index + 1; - zfile_fclose (zf2); + zn->f = zf2; +// if (zn) +// zn->offset = index + 1; +// zfile_fclose (zf2); } else { if (rc == 0) { zfile_fclose (zf); -- 2.47.3