]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2300b19
authorToni Wilen <twilen@winuae.net>
Sun, 19 Sep 2010 14:34:37 +0000 (17:34 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 19 Sep 2010 14:34:37 +0000 (17:34 +0300)
16 files changed:
cfgfile.cpp
include/inputdevice.h
include/options.h
inputdevice.cpp
main.cpp
newcpu.cpp
od-win32/resources/resource
od-win32/resources/winuae.rc
od-win32/rp.cpp
od-win32/win32.cpp
od-win32/win32.h
od-win32/win32_scaler.cpp
od-win32/win32gui.cpp
od-win32/winuaechangelog.txt
zfile.cpp
zfile_archive.cpp

index cdd2d79f6cf75d8b6b168537bf77038022c59a3e..ea693cea1cf8ceacd53668faa6ff3e9315b9f3f0 100644 (file)
@@ -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 };
index d5e375a168e2eb468be9f27053fedf41025633bb..0351b405033038416476e51298a0fd0e3892119d 100644 (file)
@@ -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);
index 64a42a31b342df61834236ebebb5bfb490e20a37..d2a4e1c90b49861a9609a229684550cd38788013 100644 (file)
@@ -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];
index ea027d68355750a26ea367cfb44bc6b92c66bd54..7f8b43251829e8ad8ad1213f242118f2e21fc2b1 100644 (file)
@@ -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 ();
index 702b818d3b06d99fdb4abdaa375020c56e8e4fca..b8d15de3d5ea5e06f7063ff89e8e291739c8197f 100644 (file)
--- 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;
        }
index dbd9e03f092fa5be0da950ab8be777997e3c15ed..31be1dccd3c7944fba3d221a4dec0e2c2d71a2a8 100644 (file)
@@ -31,7 +31,7 @@
 #include "ar.h"
 #include "gayle.h"
 #include "cia.h"
-
+#include "inputdevice.h"
 #ifdef JIT
 #include "jit/compemu.h"
 #include <signal.h>
@@ -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;
index d973831b472d20465a6bf27481682618eae0ea02..400772a883cbf68216f6e543cdc85d73f8f9cf2f 100644 (file)
 #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
 #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
index a30d0971e9d05040297d17451af8e935bdb2362d..fd9443ebba651ffd8781b7c8f6ed853cc3028de0 100644 (file)
@@ -1667,6 +1667,8 @@ BEGIN
     IDS_BUFFER_DOUBLE       "Double buffering"\r
     IDS_BUFFER_TRIPLE       "Triple buffering"\r
     IDS_AUTOSCALE_CENTER    "Automatic center"\r
+    IDS_AUTOSCALE_MAX       "Fullscreen (Max)"\r
+    IDS_AUTOSCALE_TV        "Fullscreen (TV)"\r
 END\r
 \r
 #endif    // English resources\r
index 5a88b923e8d8eb3a2fd97c939d5542c0122cfeff..41b07b35657c70ed0d4916a6761e56350fadcde3 100644 (file)
@@ -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;
index 0ca474ed2697b3ebb03e8b9fd21d650dc74bdb93..12db19ea38533270430ee91415607d98f28d6c7a 100644 (file)
@@ -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)
index 6b19f823f39c277b3e4f213e6b62a2c0710040c2..f976a2df9cdc635856529c00b75e035b73bcaf39 100644 (file)
@@ -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
index 0828033e6735c9191732aab2dbe397ae3aafd12c..4255492a50d0a2353ee460c86d25fc028d04de34 100644 (file)
@@ -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;
index 8ffd895cbd29b86d092485ec71b146298fb48f21..0663bdf103292d39659e7bebed1b23b93dcbe70d 100644 (file)
@@ -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));
index 77eb5d842f359824f11794c7deba5b4ebe3e1507..ecfb0e0d14994e869f7b9b0e0e9cdfc0dbb5eb17 100644 (file)
@@ -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)
index 57d6012bede0665583b8d322911318d0e8b74388..13965c6c30fd15740944464685d46a134e48a329 100644 (file)
--- 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) {
index cb080c264dd41fe70e165b8d65d63c50915a77c6..14979f7817d70ad90021fd36c7a1270dafe53388 100644 (file)
@@ -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);
        }