From: Toni Wilen Date: Sun, 19 Sep 2010 14:34:37 +0000 (+0300) Subject: 2300b19 X-Git-Tag: 2300~2 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=8f8f98de9ad02babfb62e290ad7eb4e8797f4d36;p=francis%2Fwinuae.git 2300b19 --- diff --git a/cfgfile.cpp b/cfgfile.cpp index cdd2d79f..ea693cea 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -165,7 +165,7 @@ static const TCHAR *maxhoriz[] = { L"lores", L"hires", L"superhires", 0 }; static const TCHAR *maxvert[] = { L"nointerlace", L"interlace", 0 }; static const TCHAR *abspointers[] = { L"none", L"mousehack", L"tablet", 0 }; static const TCHAR *magiccursors[] = { L"both", L"native", L"host", 0 }; -static const TCHAR *autoscale[] = { L"none", L"scale", L"resize", L"center", 0 }; +static const TCHAR *autoscale[] = { L"none", L"standard", L"max", L"scale", L"resize", L"center", 0 }; static const TCHAR *joyportmodes[] = { L"", L"mouse", L"djoy", L"ajoy", L"cdtvjoy", L"cd32joy", L"lightpen", 0 }; static const TCHAR *joyaf[] = { L"none", L"normal", L"toggle", 0 }; static const TCHAR *epsonprinter[] = { L"none", L"ascii", L"epson_matrix_9pin", L"epson_matrix_24pin", L"epson_matrix_48pin", 0 }; diff --git a/include/inputdevice.h b/include/inputdevice.h index d5e375a1..0351b405 100644 --- a/include/inputdevice.h +++ b/include/inputdevice.h @@ -244,12 +244,13 @@ extern int inputdevice_uaelib (TCHAR *, TCHAR *); #define INPREC_DISKREMOVE 5 #define INPREC_VSYNC 6 #define INPREC_CIAVSYNC 7 +#define INPREC_STATEFILE 0x7f #define INPREC_END 0xff #define INPREC_QUIT 0xfe extern int input_recording; extern void inprec_close (void); -extern int inprec_open (TCHAR*, int); +extern int inprec_open (const TCHAR*, int); extern void inprec_rend (void); extern void inprec_rstart (uae_u8); extern void inprec_ru8 (uae_u8); diff --git a/include/options.h b/include/options.h index 64a42a31..d2a4e1c9 100644 --- a/include/options.h +++ b/include/options.h @@ -118,6 +118,13 @@ enum { CP_GENERIC = 1, CP_CDTV, CP_CD32, CP_A500, CP_A500P, CP_A600, CP_A1000, #define GFX_FULLSCREEN 1 #define GFX_FULLWINDOW 2 +#define AUTOSCALE_NONE 0 +#define AUTOSCALE_STATIC_NOMINAL 1 +#define AUTOSCALE_STATIC_MAX 2 +#define AUTOSCALE_NORMAL 3 +#define AUTOSCALE_RESIZE 4 +#define AUTOSCALE_CENTER 5 + struct uae_prefs { struct strlist *all_lines; @@ -301,6 +308,8 @@ struct uae_prefs { struct cdslot cdslots[MAX_TOTAL_SCSI_DEVICES]; TCHAR quitstatefile[MAX_DPATH]; TCHAR statefile[MAX_DPATH]; + TCHAR inprecfile[MAX_DPATH]; + int inprecmode; TCHAR path_floppy[256]; TCHAR path_hardfile[256]; diff --git a/inputdevice.cpp b/inputdevice.cpp index ea027d68..7f8b4325 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -135,7 +135,7 @@ static int bouncy; static signed long bouncy_cycles; #define BOUNCY_CYCLES 30 -int inprec_open (TCHAR *fname, int record) +int inprec_open (const TCHAR *fname, int record) { uae_u32 t = (uae_u32)time(0); int i; @@ -165,6 +165,11 @@ int inprec_open (TCHAR *fname, int record) while (i-- > 0) inprec_pu8 (); inprec_p = inprec_plastptr; + if (inprec_pstart (INPREC_STATEFILE)) { + inprec_pstr (savestate_fname); + savestate_state = STATE_RESTORE; + inprec_pend (); + } oldbuttons[0] = oldbuttons[1] = oldbuttons[2] = oldbuttons[3] = 0; oldjoy[0] = oldjoy[1] = 0; if (record < -1) @@ -178,6 +183,11 @@ int inprec_open (TCHAR *fname, int record) inprec_ru8 (UAESUBREV); inprec_ru32 (t); inprec_ru32 (0); // extra header size + if (savestate_state == STATE_DORESTORE) { + inprec_rstart (INPREC_STATEFILE); + inprec_rstr (savestate_fname); + inprec_rend (); + } } else { return 0; } @@ -188,7 +198,7 @@ int inprec_open (TCHAR *fname, int record) return 1; } -void inprec_close(void) +void inprec_close (void) { if (!inprec_zf) return; @@ -225,12 +235,13 @@ void inprec_ru32 (uae_u32 v) void inprec_rstr (const TCHAR *src) { char *s = ua (src); + char *ss = s; while(*s) { inprec_ru8 (*s); s++; } inprec_ru8 (0); - xfree (s); + xfree (ss); } void inprec_rstart (uae_u8 type) { @@ -1793,7 +1804,7 @@ int getbuttonstate (int joy, int button) inprec_ru8 (v); inprec_rend (); } else if (input_recording < 0) { - while(inprec_pstart (INPREC_JOYBUTTON)) { + while (inprec_pstart (INPREC_JOYBUTTON)) { uae_u8 j = inprec_pu8 (); uae_u8 but = inprec_pu8 (); uae_u8 vv = inprec_pu8 (); diff --git a/main.cpp b/main.cpp index 702b818d..b8d15de3 100644 --- a/main.cpp +++ b/main.cpp @@ -112,7 +112,7 @@ void fixup_prefs_dimensions (struct uae_prefs *prefs) fixup_prefs_dim2 (&prefs->gfx_size_win); if (prefs->gfx_filter == 0 && prefs->gfx_filter_autoscale && !prefs->gfx_api) prefs->gfx_filter = 1; - if (prefs->gfx_filter_autoscale == 1 || prefs->gfx_filter_autoscale == 2) { + if (prefs->gfx_filter_autoscale == AUTOSCALE_RESIZE || prefs->gfx_filter_autoscale == AUTOSCALE_CENTER) { prefs->gfx_filter_horiz_zoom_mult = 0; prefs->gfx_filter_vert_zoom_mult = 0; } diff --git a/newcpu.cpp b/newcpu.cpp index dbd9e03f..31be1dcc 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -31,7 +31,7 @@ #include "ar.h" #include "gayle.h" #include "cia.h" - +#include "inputdevice.h" #ifdef JIT #include "jit/compemu.h" #include @@ -3276,6 +3276,13 @@ void m68k_go (int may_quit) quit_program = 0; hardboot = 0; + + if (currprefs.inprecfile[0] && currprefs.inprecmode < 0) { + inprec_open (currprefs.inprecfile, currprefs.inprecmode); + changed_prefs.inprecmode = currprefs.inprecmode = 0; + changed_prefs.inprecfile[0] = currprefs.inprecfile[0] = 0; + } + #ifdef SAVESTATE if (savestate_state == STATE_RESTORE) restore_state (savestate_fname); @@ -3297,6 +3304,12 @@ void m68k_go (int may_quit) } savestate_restore_finish (); #endif + if (currprefs.inprecfile[0] && currprefs.inprecmode > 0) { + inprec_open (currprefs.inprecfile, currprefs.inprecmode); + changed_prefs.inprecmode = currprefs.inprecmode = 0; + changed_prefs.inprecfile[0] = currprefs.inprecfile[0] = 0; + } + fill_prefetch_slow (); if (currprefs.produce_sound == 0) eventtab[ev_audio].active = 0; diff --git a/od-win32/resources/resource b/od-win32/resources/resource index d973831b..400772a8 100644 --- a/od-win32/resources/resource +++ b/od-win32/resources/resource @@ -339,6 +339,8 @@ #define IDS_BUFFER_DOUBLE 363 #define IDS_BUFFER_TRIPLE 364 #define IDS_AUTOSCALE_CENTER 365 +#define IDS_AUTOSCALE_MAX 366 +#define IDS_AUTOSCALE_TV 367 #define IDS_QS_MODELS 1000 #define IDS_QS_MODEL_A500 1001 #define IDS_QS_MODEL_A500P 1002 @@ -1002,7 +1004,6 @@ #define IDC_DF2ENABLE 1776 #define IDC_FS_SELECT_EJECT 1776 #define IDC_FS_RW 1777 -#define IDC_FLOPPY_FFS2 1777 #define IDC_FLOPPY_BOOTABLE 1777 #define IDC_DF3ENABLE 1778 #define IDC_HDF_RW 1778 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index a30d0971..fd9443eb 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -1667,6 +1667,8 @@ BEGIN IDS_BUFFER_DOUBLE "Double buffering" IDS_BUFFER_TRIPLE "Triple buffering" IDS_AUTOSCALE_CENTER "Automatic center" + IDS_AUTOSCALE_MAX "Fullscreen (Max)" + IDS_AUTOSCALE_TV "Fullscreen (TV)" END #endif // English resources diff --git a/od-win32/rp.cpp b/od-win32/rp.cpp index 5a88b923..41b07b35 100644 --- a/od-win32/rp.cpp +++ b/od-win32/rp.cpp @@ -488,9 +488,7 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) if (fs) { if (smm == RP_SCREENMODE_XX) { p->gfx_filter = rp_filter; - p->gfx_filter_horiz_zoom_mult = 0; - p->gfx_filter_vert_zoom_mult = 0; - //p->gfx_filter_autoscale = 1; + p->gfx_filter_autoscale = AUTOSCALE_STATIC_NOMINAL; } else { int mult; int prevmult = 1; diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 0ca474ed..12db19ea 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -1386,7 +1386,7 @@ static int canstretch (void) { if (isfullscreen () != 0) return 0; - if (currprefs.gfx_filter_autoscale == 2) + if (currprefs.gfx_filter_autoscale == AUTOSCALE_RESIZE) return 0; if (!WIN32GFX_IsPicassoScreen ()) return 1; @@ -3115,6 +3115,8 @@ void fetch_path (const TCHAR *name, TCHAR *out, int size) _tcscat (out, L"Configurations\\"); if (!_tcscmp (name, L"StatefilePath")) _tcscat (out, L"Savestates\\"); + if (!_tcscmp (name, L"InputPath")) + _tcscat (out, L"Inputrecordings\\"); if (start_data >= 0) regquerystr (NULL, name, out, &size); if (GetFileAttributes (out) == INVALID_FILE_ATTRIBUTES) diff --git a/od-win32/win32.h b/od-win32/win32.h index 6b19f823..f976a2df 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -18,9 +18,9 @@ #define WINUAEPUBLICBETA 1 #define LANG_DLL 1 -#define WINUAEBETA L"18" -#define WINUAEDATE MAKEBD(2010, 9, 18) -#define WINUAEEXTRA L"RC1" +#define WINUAEBETA L"19" +#define WINUAEDATE MAKEBD(2010, 9, 19) +#define WINUAEEXTRA L"RC2" #define WINUAEREV L"" #define IHF_WINDOWHIDDEN 6 diff --git a/od-win32/win32_scaler.cpp b/od-win32/win32_scaler.cpp index 0828033e..4255492a 100644 --- a/od-win32/win32_scaler.cpp +++ b/od-win32/win32_scaler.cpp @@ -215,11 +215,26 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height filterxmult = 1000 / scale; filterymult = 1000 / scale; - cv = get_custom_limits (&cw, &ch, &cx, &cy); + if (currprefs.gfx_filter_autoscale == AUTOSCALE_STATIC_MAX || currprefs.gfx_filter_autoscale == AUTOSCALE_STATIC_NOMINAL) { + cw = (752 / 2) << currprefs.gfx_resolution; + ch = (572 / 2) << currprefs.gfx_vresolution; + cx = 0; + cy = 0; + cv = 1; + if (currprefs.gfx_filter_autoscale == AUTOSCALE_STATIC_NOMINAL) { + cw -= 80; + ch -= 50; + cx = 56; + cy = 20; + } + } else { + cv = get_custom_limits (&cw, &ch, &cx, &cy); + } + if (cv) { int diff; - if (currprefs.gfx_filter_autoscale == 3) { + if (currprefs.gfx_filter_autoscale == AUTOSCALE_CENTER) { int ww = cw * scale; int hh = ch * scale; @@ -231,7 +246,7 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height OffsetRect (zr, cx * scale - (dst_width - ww) / 2, cy * scale - (dst_height - hh) / 2); goto cont; - } else if (currprefs.gfx_filter_autoscale == 2 && isfullscreen () == 0 && !currprefs.gfx_filteroverlay[0]) { + } else if (currprefs.gfx_filter_autoscale == AUTOSCALE_RESIZE && isfullscreen () == 0 && !currprefs.gfx_filteroverlay[0]) { static int lastresize = 0; static int lastdelay = 1; static int ocw, och, ocx, ocy, lcw, lch, lcx, lcy; diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 8ffd895c..0663bdf1 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -2387,10 +2387,12 @@ int DiskSelection_2 (HWND hDlg, WPARAM wParam, int flag, struct uae_prefs *prefs fullpath (workprefs.cartfile, MAX_DPATH); break; case IDC_INPREC_PLAY: - inprec_open (full_path, ischecked (hDlg, IDC_INPREC_PLAYMODE) ? -1 : -2); + _tcscpy (workprefs.inprecfile, full_path); + workprefs.inprecmode = ischecked (hDlg, IDC_INPREC_PLAYMODE) ? -1 : -2; break; case IDC_INPREC_RECORD: - inprec_open (full_path, 1); + _tcscpy (workprefs.inprecfile, full_path); + workprefs.inprecmode = 1; break; } if (!nosavepath || 1) { @@ -12041,7 +12043,7 @@ static void enable_for_hw3ddlg (HWND hDlg) { int v = workprefs.gfx_filter ? TRUE : FALSE; int vv = FALSE, vv2 = FALSE, vv3 = FALSE; - int as = workprefs.gfx_filter_autoscale == 2; + int as = workprefs.gfx_filter_autoscale == AUTOSCALE_CENTER; struct uae_filter *uf; int i, isfilter; @@ -12227,6 +12229,10 @@ static void values_to_hw3ddlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_RESETCONTENT, 0, 0L); WIN32GUI_LoadUIString (IDS_AUTOSCALE_DISABLED, txt, sizeof (txt) / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + WIN32GUI_LoadUIString (IDS_AUTOSCALE_TV, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + WIN32GUI_LoadUIString (IDS_AUTOSCALE_MAX, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); WIN32GUI_LoadUIString (IDS_AUTOSCALE_SCALING, txt, sizeof (txt) / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); WIN32GUI_LoadUIString (IDS_AUTOSCALE_RESIZE, txt, sizeof (txt) / sizeof (TCHAR)); diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 77eb5d84..ecfb0e0d 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,9 @@ +- rar archives crashed if file was already open (due to design flaw, it was possible to + open archives even if requested mode was read-write) +- added "fullscreen (max)" and "fullscreen (tv)" (approximate only) to "autoscale" select + menu, basically replaces old "FS" filter multiplier + Beta 18 (RC1): - F13/F14/F15 rawinput keycodes fixed (at least available on some apple usb keyboards) diff --git a/zfile.cpp b/zfile.cpp index 57d6012b..13965c6c 100644 --- a/zfile.cpp +++ b/zfile.cpp @@ -1244,13 +1244,12 @@ static const int plugins_7z_m[] = { ZFD_ADF, ZFD_ADF, ZFD_ADF, ZFD_ARCHIVE }; -int iszip (struct zfile *z) +int iszip (struct zfile *z, int mask) { TCHAR *name = z->name; TCHAR *ext = _tcsrchr (name, '.'); uae_u8 header[32]; int i; - int mask = ZFD_NORMAL;//z->zfdmask; if (!ext) return 0; @@ -1323,6 +1322,10 @@ int iszip (struct zfile *z) #endif return 0; } +int iszip (struct zfile *z) +{ + return iszip (z, ZFD_NORMAL); +} struct zfile *zuncompress (struct znode *parent, struct zfile *z, int dodefault, int mask, int *retcode, int index) { @@ -1548,6 +1551,11 @@ static struct zfile *openzip (const TCHAR *pname) return 0; } +static bool writeneeded (const TCHAR *mode) +{ + return _tcschr (mode, 'w') || _tcschr (mode, 'a') || _tcschr (mode, '+') || _tcschr (mode, 't'); +} + static struct zfile *zfile_fopen_2 (const TCHAR *name, const TCHAR *mode, int mask) { struct zfile *l; @@ -1561,7 +1569,7 @@ static struct zfile *zfile_fopen_2 (const TCHAR *name, const TCHAR *mode, int ma #endif l = openzip (name); if (l) { - if (_tcsicmp (mode, L"rb") && _tcsicmp (mode, L"r")) { + if (writeneeded (mode)) { zfile_fclose (l); return 0; } @@ -1585,6 +1593,10 @@ static struct zfile *zfile_fopen_2 (const TCHAR *name, const TCHAR *mode, int ma if (stat (l->name, &st) != -1) l->size = st.st_size; l->f = f; + if (writeneeded (mode) && iszip (l, ZFD_ARCHIVE)) { + zfile_fclose (l); + return NULL; + } } return l; } @@ -1639,7 +1651,6 @@ int zfile_zopen (const TCHAR *name, zfile_callback zc, void *user) return 1; } - /* * fopen() for a compressed file */ @@ -1655,7 +1666,7 @@ static struct zfile *zfile_fopen_x (const TCHAR *name, const TCHAR *mode, int ma l = zfile_fopen_2 (path, mode, mask); if (!l) return 0; - if (_tcschr (mode, 'w') || _tcschr (mode, 'a')) + if (writeneeded (mode)) return l; l2 = NULL; while (cnt-- > 0) { diff --git a/zfile_archive.cpp b/zfile_archive.cpp index cb080c26..14979f78 100644 --- a/zfile_archive.cpp +++ b/zfile_archive.cpp @@ -712,7 +712,6 @@ struct zvolume *archive_directory_rar (struct zfile *z) rc->OpenArchiveData.OpenMode = RAR_OM_LIST; rc->hArcData = pRAROpenArchiveEx (&rc->OpenArchiveData); if (rc->OpenArchiveData.OpenResult != 0) { - xfree (rc); zfile_fclose_archive (zv); return archive_directory_arcacc (z, ArchiveFormatRAR); }