]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
4500b11
authorToni Wilen <twilen@winuae.net>
Sun, 22 Nov 2020 15:37:03 +0000 (17:37 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 22 Nov 2020 15:37:03 +0000 (17:37 +0200)
23 files changed:
blkdev_cdimage.cpp
debugmem.cpp
disk.cpp
drawing.cpp
filesys.cpp
gfxboard.cpp
hardfile.cpp
ini.cpp
inputdevice.cpp
jit/compemu_support.cpp
od-win32/direct3d.cpp
od-win32/direct3d11.cpp
od-win32/hardfile_win32.cpp
od-win32/lcd.cpp
od-win32/mp3decoder.h
od-win32/registry.cpp
od-win32/sounddep/sound.cpp
od-win32/win32.h
od-win32/winuae_msvc15/winuae_msvc.vcxproj
od-win32/winuae_msvc15/winuae_msvc.vcxproj.filters
od-win32/winuaechangelog.txt
sndboard.cpp
x86.cpp

index 012372e9b4def7f5fbd8a1f8b4120217076670b0..3baad1bca40aa20e65ab1b39d89d026519655bef 100644 (file)
@@ -45,8 +45,6 @@
 
 #define scsi_log write_log
 
-#define CDDA_BUFFERS 12
-
 enum audenc { AUDENC_NONE, AUDENC_PCM, AUDENC_MP3, AUDENC_FLAC, ENC_CHD };
 
 struct cdtoc
index 31359366275b1b9bd492cd2dee3eb12153817883..5ba793ad50f7c298e778fbab8a6e6ea160209784 100644 (file)
@@ -2119,6 +2119,8 @@ static bool debugger_load_library(const TCHAR *name)
        bool ret = false;
        int filelen;
        struct zfile *zf = NULL;
+       struct libname* lvo = NULL;
+       int lvoid = 1;
 
        if (libraries_loaded)
                return true;
@@ -2150,8 +2152,6 @@ static bool debugger_load_library(const TCHAR *name)
                libsymbols = xcalloc(struct libsymbol, 10000);
        }
 
-       struct libname *lvo = NULL;
-       int lvoid = 1;
        for (;;) {
                if (p == file + filelen) {
                        ret = true;
index a706e0ae081d0c5422032b5f9580c02eb447c7a1..89066a00911ee415f4fccc7a64f3f90f436de59c 100644 (file)
--- a/disk.cpp
+++ b/disk.cpp
@@ -570,16 +570,17 @@ static int get_floppy_speed_from_image(drive *drv)
        int l, m;
        
        m = get_floppy_speed();
+       l = drv->tracklen;
        if (!drv->tracktiming[0]) {
-               l = drv->tracklen;
                m = m * l / (2 * 8 * FLOPPY_WRITE_LEN * drv->ddhd);
        }
        // 4us track?
-       if (l < (FLOPPY_WRITE_LEN_PAL * 8) * 4 / 6)
+       if (l < (FLOPPY_WRITE_LEN_PAL * 8) * 4 / 6) {
                m *= 2;
-
-       if (m <= 0)
+       }
+       if (m <= 0) {
                m = 1;
+       }
 
        return m;
 }
index f96d6b1cc08c4619ae45209911258dd7530090f4..c5851e9c5433a4378212290d6e76a3baefcba2eb 100644 (file)
@@ -4088,10 +4088,12 @@ bool draw_frame (struct vidbuffer *vb)
        for (int i = 0; i < LINESTATE_SIZE; i++) {
                uae_u8 v = linestate[i];
                if (v == LINE_REMEMBERED_AS_PREVIOUS) {
-                       linestate[i - 1] = LINE_DECIDED_DOUBLE;
+                       if (i > 0)
+                               linestate[i - 1] = LINE_DECIDED_DOUBLE;
                        v = LINE_AS_PREVIOUS;
                } else if (v == LINE_DONE_AS_PREVIOUS) {
-                       linestate[i - 1] = LINE_DECIDED_DOUBLE;
+                       if (i > 0)
+                               linestate[i - 1] = LINE_DECIDED_DOUBLE;
                        v = LINE_AS_PREVIOUS;
                } else if (v == LINE_REMEMBERED_AS_BLACK) {
                        v = LINE_BLACK;
index e6afeb554e3f514a2125f0581c79b46643cd4fc5..26af377827e4d649de8d4462567f56d566a8051c 100644 (file)
@@ -8359,6 +8359,7 @@ static int pt_rdsk (TrapContext *ctx, uae_u8 *bufrdb, int rdblock, UnitInfo *uip
        int newversion, newrevision;
        TCHAR *s;
        bool showdebug = partnum == 0;
+       int cnt;
 
        blocksize = rl (bufrdb + 16);
        readblocksize = blocksize > hfd->ci.blocksize ? blocksize : hfd->ci.blocksize;
@@ -8521,7 +8522,7 @@ static int pt_rdsk (TrapContext *ctx, uae_u8 *bufrdb, int rdblock, UnitInfo *uip
        /* we found required FSHD block */
        fsmem = xmalloc (uae_u8, 262144);
        lsegblock = rl (buf + 72);
-       int cnt = 0;
+       cnt = 0;
        for (;;) {
                int pb = lsegblock;
                if (!legalrdbblock (uip, lsegblock))
index 15cffaf90dc0737af321aeba5b0628e5dd8a5b1f..111588cfb41f6999358e43ad1ac468af01f92556 100644 (file)
@@ -1065,6 +1065,7 @@ bool gfxboard_rtg_enable_initial(int monid, int index)
 int gfxboard_toggle(int monid, int index, int log)
 {
        bool initial = false;
+       struct rtggfxboard *gb;
 
        if (rtg_visible[monid] < 0 && rtg_initial[monid] >= 0 && rtg_initial[monid] < MAX_RTG_BOARDS) {
                index = rtg_initial[monid];
@@ -1078,7 +1079,7 @@ int gfxboard_toggle(int monid, int index, int log)
        if (index < 0)
                goto end;
 
-       struct rtggfxboard *gb = &rtggfxboards[index];
+       gb = &rtggfxboards[index];
        if (!gb->active)
                goto end;
 
index 9feeed199537f3765be760cb683467e90b8a3e09..57f9280eccadc6bdf10cda6fdc3f9dd3cf519d24 100644 (file)
@@ -2880,7 +2880,6 @@ no_disk:
                break;
 
        default:
-no_cmd:
                /* Command not understood. */
                error = IOERR_NOCMD;
                break;
diff --git a/ini.cpp b/ini.cpp
index 14413c49a43ff9a1610285c20232cdd3920dbae0..f94e88f44e7698b9ea6d62cdaf1e29c3b6a860a8 100644 (file)
--- a/ini.cpp
+++ b/ini.cpp
@@ -403,6 +403,7 @@ bool ini_getdata_multi(struct ini_data *ini, const TCHAR *section, const TCHAR *
        uae_u8 *outp = NULL;
        int len;
        bool quoted = false;
+       int j = 0;
 
        if (!ini_getstring_multi(ini, section, key, &out2, ctx))
                return false;
@@ -412,7 +413,6 @@ bool ini_getdata_multi(struct ini_data *ini, const TCHAR *section, const TCHAR *
        if (!outp)
                goto err;
 
-       int j = 0;
        for (int i = 0; i < len; ) {
                TCHAR c1 = _totupper(out2[i + 0]);
                if (c1 == '\"') {
@@ -548,7 +548,7 @@ bool ini_addstring(struct ini_data *ini, const TCHAR *section, const TCHAR *key,
                        if (il->key == NULL)
                                return true;
                        if (!_tcsicmp(key, il->key)) {
-                               TCHAR* v = val ? val : _T("");
+                               const TCHAR *v = val ? val : _T("");
                                if (il->value && !_tcscmp(il->value, v))
                                        return true;
                                xfree(il->value);
index 029661eb95b3b5ee49ca28f8155cdee93e69a4de..9c410e259ef7a6b9ca278635d157aebfdf8a1852 100644 (file)
@@ -1879,28 +1879,35 @@ void inputdevice_parse_jport_custom(struct uae_prefs *pr, int index, int port, T
        _tcscat(data, _T(" "));
        bufp = data;
        for (;;) {
+               const struct inputevent* ie;
                TCHAR *next = bufp;
+               TCHAR devtype;
+               int devindex;
+               int flags = 0;
+               const TCHAR* bufp2 = bufp;
+               struct uae_input_device* id = 0;
+               int joystick = 0;
+               int devnum = 0;
+               int num = -1;
+               int keynum = 0;
+
                while (next != NULL && *next != ' ' && *next != 0)
                        next++;
                if (!next || *next == 0)
                        break;
                *next++ = 0;
-               const TCHAR *bufp2 = bufp;
-               struct uae_input_device *id = 0;
-               int joystick = 0;
                TCHAR *p = getstring(&bufp2);
                if (!p)
                        goto skip;
 
-               int devindex = getnum(&bufp2);
+               devindex = getnum(&bufp2);
                if (*bufp == 0)
                        goto skip;
                if (devindex < 0 || devindex >= MAX_INPUT_DEVICES)
                        goto skip;
 
-               TCHAR devtype = _totupper(*p);
+               devtype = _totupper(*p);
 
-               int devnum = 0;
                if (devtype == 'M') {
                        id = &pr->mouse_settings[pr->input_selected_setting][devindex];
                        joystick = 0;
@@ -1931,8 +1938,6 @@ void inputdevice_parse_jport_custom(struct uae_prefs *pr, int index, int port, T
                if (!p)
                        goto skip;
 
-               int num = -1;
-               int keynum = 0;
                if (joystick < 0) {
                        num = getnum(&bufp2);
                        if (*bufp == 0)
@@ -1959,7 +1964,6 @@ void inputdevice_parse_jport_custom(struct uae_prefs *pr, int index, int port, T
                        }
                }
 
-               int flags = 0;
                if (*bufp2 != '=') {
                        flags = getnum(&bufp2);
                }
@@ -1974,7 +1978,7 @@ void inputdevice_parse_jport_custom(struct uae_prefs *pr, int index, int port, T
                if (!p)
                        goto skip;
 
-               const struct inputevent *ie = readevent(p, NULL);
+               ie = readevent(p, NULL);
                if (ie) {
                        // Different port? Find matching request port event.
                        if (port >= 0 && ie->unit > 0 && ie->unit != port + 1) {
@@ -2366,6 +2370,12 @@ void tablet_lightpen(int tx, int ty, int tmaxx, int tmaxy, int touch, int button
        int monid = 0;
        struct vidbuf_description *vidinfo = &adisplays[monid].gfxvidinfo;
        struct amigadisplay *ad = &adisplays[monid];
+       int dw, dh, ax, ay, aw, ah;
+       float fx, fy;
+       float xmult, ymult;
+       float fdx, fdy, fmx, fmy;
+       int x, y;
+
        if (ad->picasso_on)
                goto end;
 
@@ -2375,10 +2385,6 @@ void tablet_lightpen(int tx, int ty, int tmaxx, int tmaxy, int touch, int button
        if (touch < 0)
                goto end;
 
-       int dw, dh, ax, ay, aw, ah;
-       float fx, fy;
-       float xmult, ymult;
-
        fx = (float)tx;
        fy = (float)ty;
 
@@ -2408,11 +2414,10 @@ void tablet_lightpen(int tx, int ty, int tmaxx, int tmaxy, int touch, int button
        fx -= ax;
        fy -= ay;
 
-       float fdx, fdy, fmx, fmy;
        getgfxoffset(0, &fdx, &fdy, &fmx, &fmy);
 
-       int x = (int)(fx * fmx);
-       int y = (int)(fy * fmy);
+       x = (int)(fx * fmx);
+       y = (int)(fy * fmy);
        x -= (int)(fdx * fmx) - 1;
        y -= (int)(fdy * fmy) - 2;
 
@@ -4190,6 +4195,7 @@ static bool inputdevice_handle_inputcode2(int monid, int code, int state, const
        static int swapperslot;
        static int tracer_enable;
        int newstate;
+       int onoffstate = state & ~SET_ONOFF_MASK_PRESS;
 
        if (s != NULL && s[0] == 0)
                s = NULL;
@@ -4206,8 +4212,6 @@ static bool inputdevice_handle_inputcode2(int monid, int code, int state, const
        if (vpos != 0)
                write_log (_T("inputcode=%d but vpos = %d"), code, vpos);
 
-       int onoffstate = state & ~SET_ONOFF_MASK_PRESS;
-
        if (onoffstate == SET_ONOFF_ON_VALUE)
                newstate = 1;
        else if (onoffstate == SET_ONOFF_OFF_VALUE)
@@ -8970,9 +8974,9 @@ void setmousestate (int mouse, int axis, int data, int isabs)
        } else {
                extraflags |= HANDLE_IE_FLAG_ABSOLUTE;
                extrastate = data;
-               d = data - *oldm_p;
+               d = (float)(data - *oldm_p);
                *oldm_p = data;
-               *mouse_p += d;
+               *mouse_p += (int)d;
                if (axis == 0) {
                        lastmx = data;
                } else {
index 34d3ea61d6a7403bf4d0da017f0ff01e8975b63d..0d5481da2d9579b1bb30a62d3036e1f131ee2fbd 100644 (file)
@@ -251,9 +251,11 @@ static uae_u32 raw_cputbl_count[65536] = { 0, };
 static uae_u16 opcode_nums[65536];
 
 
-static int untranslated_compfn(const void *e1, const void *e2)
+static int __cdecl untranslated_compfn(const void *e1, const void *e2)
 {
-       return raw_cputbl_count[*(const uae_u16 *)e1] < raw_cputbl_count[*(const uae_u16 *)e2];
+       int v1 = *(const uae_u16*)e1;
+       int v2 = *(const uae_u16*)e2;
+       return (int)raw_cputbl_count[v2] - (int)raw_cputbl_count[v1];
 }
 #endif
 
@@ -2958,9 +2960,9 @@ void compiler_exit(void)
                opcode_nums[i] = i;
                untranslated_count += raw_cputbl_count[i];
        }
-       bug("Sorting out untranslated instructions count...");
+       bug("Sorting out untranslated instructions count, total %llu...\n", untranslated_count);
        qsort(opcode_nums, 65536, sizeof(uae_u16), untranslated_compfn);
-       jit_log("Rank  Opc      Count Name");
+       jit_log("Rank  Opc      Count Name\n");
        for (int i = 0; i < untranslated_top_ten; i++) {
                uae_u32 count = raw_cputbl_count[opcode_nums[i]];
                struct instr *dp;
@@ -2970,7 +2972,7 @@ void compiler_exit(void)
                dp = table68k + opcode_nums[i];
                for (lookup = lookuptab; lookup->mnemo != (instrmnem)dp->mnemo; lookup++)
                        ;
-               bug("%03d: %04x %10u %s", i, opcode_nums[i], count, lookup->name);
+               bug(_T("%03d: %04x %10u %s\n"), i, opcode_nums[i], count, lookup->name);
        }
 #endif
 
index b730d99947c616970b6dfb8dff82422ccdbaaf2e..bd73dbe0498b09d679067494598c11c01abaa4f7 100644 (file)
@@ -901,6 +901,9 @@ static bool psEffect_LoadEffect (struct d3dstruct *d3d, const TCHAR *shaderfile,
        int canusefile = 0, existsfile = 0;
        bool plugin_path;
        D3DXEFFECT_DESC EffectDesc;
+       void *bp;
+       int bplen;
+
 
        compileflags |= EFFECTCOMPILERFLAGS;
        plugin_path = get_plugin_path (tmp, sizeof tmp / sizeof (TCHAR), _T("filtershaders\\direct3d"));
@@ -962,8 +965,8 @@ static bool psEffect_LoadEffect (struct d3dstruct *d3d, const TCHAR *shaderfile,
                write_log (_T("%s: CompileEffect failed: %s\n"), D3DHEAD, D3DX_ErrorString (hr, Errors));
                goto end;
        }
-       void *bp = BufferEffect->GetBufferPointer ();
-       int bplen = BufferEffect->GetBufferSize ();
+       bp = BufferEffect->GetBufferPointer ();
+       bplen = BufferEffect->GetBufferSize ();
        hr = D3DXCreateEffect (d3d->d3ddev,
                bp, bplen,
                NULL, NULL,
@@ -1752,6 +1755,7 @@ static int createmask2texture (struct d3dstruct *d3d, const TCHAR *filename)
        TCHAR tmp[MAX_DPATH];
        TCHAR filepath[MAX_DPATH];
        D3DLOCKED_RECT locked;
+       float xmult, ymult;
 
        if (d3d->mask2texture)
                d3d->mask2texture->Release();
@@ -1888,8 +1892,8 @@ static int createmask2texture (struct d3dstruct *d3d, const TCHAR *filename)
        if (d3d->mask2texture_offsetw > 0)
                d3d->blanktexture = createtext (d3d, d3d->mask2texture_offsetw + 1, d3d->window_h, D3DFMT_X8R8G8B8);
 
-       float xmult = d3d->mask2texture_multx;
-       float ymult = d3d->mask2texture_multy;
+       xmult = d3d->mask2texture_multx;
+       ymult = d3d->mask2texture_multy;
 
        d3d->mask2rect.left *= xmult;
        d3d->mask2rect.right *= xmult;
index 51fdc5973ab358d69bf2c07151a8ade0a4d27c65..2ab11c26efe47b8a28422033c7b1481c2c00f29d 100644 (file)
@@ -2,6 +2,8 @@
 #include <windows.h>
 #include "resource.h"
 
+#define FX11 1
+
 #include <DXGI1_5.h>
 #include <dxgi1_6.h>
 #include <d3d11.h>
@@ -965,6 +967,7 @@ static void fxremoveline(char *s, char *dst, const char **lines)
        *d = 0;
 }
 
+#if FX11
 
 static bool psEffect_LoadEffect(struct d3d11struct *d3d, const TCHAR *shaderfile, struct shaderdata11 *s, int num)
 {
@@ -979,6 +982,9 @@ static bool psEffect_LoadEffect(struct d3d11struct *d3d, const TCHAR *shaderfile
        char *fx1 = NULL;
        char *fx2 = NULL;
        char *name = NULL;
+       int layout = 0;
+       char *fx;
+       int size;
 
        if (!pD3DCompileFromFile || !ppD3DCompile) {
                write_log(_T("D3D11 No shader compiler available (D3DCompiler_46.dll or D3DCompiler_47.dll).\n"));
@@ -1014,7 +1020,7 @@ static bool psEffect_LoadEffect(struct d3d11struct *d3d, const TCHAR *shaderfile
                write_log(_T("Failed to open '%s'\n"), tmp);
                goto end;
        }
-       int size = zfile_size(z);
+       size = zfile_size(z);
        fx1 = xcalloc(char, size * 4);
        fx2 = xcalloc(char, size * 4);
        if (zfile_fread(fx1, 1, size, z) != size) {
@@ -1025,7 +1031,7 @@ static bool psEffect_LoadEffect(struct d3d11struct *d3d, const TCHAR *shaderfile
        zfile_fclose(z);
        z = NULL;
 
-       char *fx = fx1;
+       fx = fx1;
        if (fxneedconvert(fx1)) {
                static const char *converts1[] = { "technique", "vs_3_0", "vs_2_0", "vs_1_1", "ps_3_0", "ps_2_0", NULL };
                static const char *converts2[] = { "technique10", "vs_4_0_level_9_3", "vs_4_0_level_9_3", "vs_4_0_level_9_3", "ps_4_0_level_9_3", "ps_4_0_level_9_3", NULL };
@@ -1069,7 +1075,6 @@ static bool psEffect_LoadEffect(struct d3d11struct *d3d, const TCHAR *shaderfile
 
        s->effect = g_pEffect;
 
-       int layout = 0;
        s->CombineTechniqueEffectIndex = layout;
        layout = createfxlayout(d3d, s, s->m_CombineTechniqueEffectHandle, layout);
        s->PreprocessTechnique1EffectIndex = layout;
@@ -1116,6 +1121,16 @@ end:
        return false;
 }
 
+#else
+
+static bool psEffect_LoadEffect(struct d3d11struct* d3d, const TCHAR* shaderfile, struct shaderdata11* s, int num)
+{
+       write_log(_T("FX11 disabled\n"));
+       return false;
+}
+
+#endif
+
 static bool psEffect_SetMatrices(D3DXMATRIX *matProj, D3DXMATRIX *matView, D3DXMATRIX *matWorld, struct shaderdata11 *s)
 {
        if (s->m_MatWorldEffectHandle) {
@@ -2472,6 +2487,7 @@ static int createmask2texture(struct d3d11struct *d3d, const TCHAR *filename)
        ID3D11Texture2D *tx = NULL;
        HRESULT hr;
        TCHAR filepath[MAX_DPATH];
+       float xmult, ymult;
 
        freesprite(&d3d->mask2texture);
        for (int i = 0; overlayleds[i]; i++) {
@@ -2601,8 +2617,8 @@ static int createmask2texture(struct d3d11struct *d3d, const TCHAR *filename)
                allocsprite(d3d, &d3d->blanksprite, d3d->mask2texture_offsetw + 1, d3d->m_screenHeight, false);
        }
 
-       float xmult = d3d->mask2texture_multx;
-       float ymult = d3d->mask2texture_multy;
+       xmult = d3d->mask2texture_multx;
+       ymult = d3d->mask2texture_multy;
 
        d3d->mask2rect.left *= xmult;
        d3d->mask2rect.right *= xmult;
index 6052514e51a87225b9b2170c9878f91754bbb8ce..4a4d91c51aaba08287e5e68533705be0f0d537d9 100644 (file)
@@ -1402,6 +1402,8 @@ static int gethdfchs(HWND hDlg, struct uae_driveinfo *udi, HANDLE h, int *cylsp,
        int cyls = 0, heads = 0, secs = 0;
        uae_u8 *data = (uae_u8*)VirtualAlloc(NULL, 65536, MEM_COMMIT, PAGE_READWRITE);
        DWORD err = 0;
+       HFONT font;
+       HWND hwnd;
 
        memset(data, 0, 512);
        memset(cmd, 0, sizeof(cmd));
@@ -1429,12 +1431,12 @@ static int gethdfchs(HWND hDlg, struct uae_driveinfo *udi, HANDLE h, int *cylsp,
        }
 
        chsdialogactive = 1;
-       HWND hwnd = CustomCreateDialog(IDD_CHSQUERY, hDlg, CHSDialogProc);
+       hwnd = CustomCreateDialog(IDD_CHSQUERY, hDlg, CHSDialogProc);
        if (hwnd == NULL) {
                err = -15;
                goto end;
        }
-       HFONT font = CreateFont(getscaledfontsize(-1), 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, _T("Lucida Console"));
+       font = CreateFont(getscaledfontsize(-1), 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, _T("Lucida Console"));
        if (font)
                SendMessage(GetDlgItem(hwnd, IDD_CHSQUERY), WM_SETFONT, WPARAM(font), FALSE);
        while (chsdialogactive == 1) {
@@ -1533,6 +1535,8 @@ void hd_get_meta(HWND hDlg, int idx, TCHAR *geometryfile)
        TCHAR *text, *tptr;
        struct ini_data *ini = NULL;
        bool atapi = false;
+       HWND hwnd;
+       bool empty = true;
 
        geometryfile[0] = 0;
        text = xcalloc(TCHAR, 100000);
@@ -1594,7 +1598,6 @@ void hd_get_meta(HWND hDlg, int idx, TCHAR *geometryfile)
                goto doout;
        }
 
-       bool empty = true;
        for (int i = 0; i < 512; i++) {
                if (data[i] != 0)
                        empty = false;
@@ -1661,7 +1664,7 @@ doout:
 
        stringboxdialogactive = 1;
        hdini = ini;
-       HWND hwnd = CustomCreateDialog (IDD_DISKINFO, hDlg, StringBoxDialogProc);
+       hwnd = CustomCreateDialog (IDD_DISKINFO, hDlg, StringBoxDialogProc);
        if (hwnd != NULL) {
                HFONT font = CreateFont (getscaledfontsize(-1), 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, _T("Lucida Console"));
                if (font)
@@ -2878,7 +2881,7 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR
        ULONG                               length = 0, returned = 0, returnedLength;
        BOOL showonly = FALSE;
        struct uae_driveinfo tmpudi = { 0 };
-
+       struct uae_driveinfo* udi2;
        udi = &tmpudi;
        int udiindex = *index2;
 
@@ -2974,7 +2977,7 @@ static BOOL GetDevicePropertyFromName(const TCHAR *DevicePath, DWORD Index, DWOR
        }
        udi = &uae_drives[udiindex < 0 ? *index2 : udiindex];
        memcpy (udi, &tmpudi, sizeof (struct uae_driveinfo));
-       struct uae_driveinfo *udi2 = udi;
+       udi2 = udi;
 
        _tcscpy (orgname, udi->device_name);
        udi->bytespersector = 512;
index 29ba5b6f21c4193db28883b92bc1cfe57429e3e0..c93f2e77a2f608cfcf98ac3a33e0cfed2d4ecdf9 100644 (file)
@@ -30,7 +30,7 @@ extern unsigned long timeframes;
 
 // Do it this way because stupid LogitechLCDLib.lib LogiLcdInit() refuses to link.
 
-typedef bool(__cdecl *LOGILCDINIT)(wchar_t*, int);
+typedef bool(__cdecl *LOGILCDINIT)(const wchar_t*, int);
 static LOGILCDINIT pLogiLcdInit;
 typedef bool(__cdecl *LOGILCDISCONNECTED)(int);
 static LOGILCDISCONNECTED pLogiLcdIsConnected;
@@ -77,6 +77,7 @@ static int lcd_init (void)
        DWORD type = REG_SZ;
        DWORD size = sizeof(path) / sizeof(TCHAR);
        HKEY key;
+       bool lcd_mono, lcd_color;
 
        if (!logitech_lcd)
                return 0;
@@ -104,8 +105,8 @@ static int lcd_init (void)
        if (!pLogiLcdInit(_T("WinUAE"), LOGI_LCD_TYPE_MONO | LOGI_LCD_TYPE_COLOR))
                goto err;
 
-       bool lcd_mono = pLogiLcdIsConnected(LOGI_LCD_TYPE_MONO);
-       bool lcd_color = pLogiLcdIsConnected(LOGI_LCD_TYPE_COLOR);
+       lcd_mono = pLogiLcdIsConnected(LOGI_LCD_TYPE_MONO);
+       lcd_color = pLogiLcdIsConnected(LOGI_LCD_TYPE_COLOR);
        if (!lcd_mono && !lcd_color) {
                pLogiLcdShutdown();
                goto err;
index 4ccb01f2356349194589442f96240e2555a3856f..0f8ff4c2a839b4315cf7c721e26579171058514c 100644 (file)
@@ -3,9 +3,9 @@ class mp3decoder
 {
        void *g_mp3stream;
 public:
-       mp3decoder::mp3decoder(struct zfile *zf);
+       mp3decoder(struct zfile *zf);
        mp3decoder();
        ~mp3decoder();
        uae_u8 *get(struct zfile *zf, uae_u8 *, int maxsize);
-       uae_u32 mp3decoder::getsize(struct zfile *zf);
+       uae_u32 getsize(struct zfile *zf);
 };
index 4f3d3f35a99b9ddc6fb32da2ab667b0e055555ee..d7ef5505661741d7e48ed83413923972a733393d 100644 (file)
@@ -21,7 +21,7 @@ static HKEY gr (UAEREG *root)
                return hWinUAEKey;
        return root->fkey;
 }
-static TCHAR *gs (UAEREG *root)
+static const TCHAR *gs (UAEREG *root)
 {
        if (!root)
                return ROOT_TREE;
@@ -29,7 +29,8 @@ static TCHAR *gs (UAEREG *root)
 }
 static TCHAR *gsn (UAEREG *root, const TCHAR *name)
 {
-       TCHAR *r, *s;
+       const TCHAR *r;
+       TCHAR *s;
        if (!root)
                return my_strdup (name);
        r = gs (root);
index 8b8738ddcda8882533a896852269519d51c2c59f..34cb93075a610b669fe2b1a531b9fc3cfd9c7e2d 100644 (file)
@@ -1309,6 +1309,11 @@ static int open_audio_wasapi (struct sound_data *sd, int index, int exclusive)
        AUDCLNT_SHAREMODE sharemode;
        REFERENCE_TIME phnsMinimumDevicePeriod, hnsDefaultDevicePeriod;
        int v;
+       int loop;
+       REFERENCE_TIME hnsRequestedDuration;
+       UINT32 DefaultPeriodInFrames = 0, FundamentalPeriodInFrames = 0, MinPeriodInFrames = 0, MaxPeriodInFrames = 0;
+       UINT32  RequestedDuration;
+       UINT32 DefaultDevicePeriod;
 
 retry:
        sd->devicetype = exclusive ? SOUND_DEVICE_WASAPI_EXCLUSIVE : SOUND_DEVICE_WASAPI;
@@ -1458,20 +1463,19 @@ retry:
                sd->freq = pwfx_saved->nSamplesPerSec;
        }
 
-       UINT32 DefaultDevicePeriod = (UINT32)( // frames =
+       DefaultDevicePeriod = (UINT32)( // frames =
                1.0 * hnsDefaultDevicePeriod * // hns *
                wavfmt.Format.nSamplesPerSec / // (frames / s) /
                1000 / // (ms / s) /
                10000 // (hns / s) /
                + 0.5); // rounding
-       UINT32  RequestedDuration = (UINT32)( // frames =
+       RequestedDuration = (UINT32)( // frames =
                1.0 * phnsMinimumDevicePeriod * // hns *
                wavfmt.Format.nSamplesPerSec / // (frames / s) /
                1000 / // (ms / s) /
                10000 // (hns / s) /
                + 0.5); // rounding
 
-       UINT32 DefaultPeriodInFrames = 0, FundamentalPeriodInFrames = 0, MinPeriodInFrames = 0, MaxPeriodInFrames = 0;
        if (s->AudioClientVersion >= 3 && sharemode == AUDCLNT_SHAREMODE_SHARED) {
                UINT32 CurrentPeriodInFrames;
                WAVEFORMATEX *outwfx;
@@ -1503,7 +1507,7 @@ retry:
        s->snd_configsize = sd->sndbufsize * sd->samplesize;
 
        s->bufferFrameCount = sd->sndbufsize;
-       REFERENCE_TIME hnsRequestedDuration = // hns =
+       hnsRequestedDuration = // hns =
                (REFERENCE_TIME)(
                10000.0 * // (hns / ms) *
                1000 * // (ms / s) *
@@ -1519,7 +1523,7 @@ retry:
                write_log(_T("WASAPI: IsOffloadCapable() returned %d %08x\n"), cap, hr);
        }
 
-       int loop = 0;
+       loop = 0;
        for (;;) {
                loop++;
 
index 5b2445c8ad1791e82662830acc94bf664a8d6c4a..1d28a6b732bafcc9e7074e5f7c4d668e3f481a1f 100644 (file)
 #define LANG_DLL_FULL_VERSION_MATCH 1
 
 #if WINUAEPUBLICBETA
-#define WINUAEBETA _T("Beta 10")
+#define WINUAEBETA _T("Beta 11")
 #else
 #define WINUAEBETA _T("")
 #endif
 
-#define WINUAEDATE MAKEBD(2020, 11, 8)
+#define WINUAEDATE MAKEBD(2020, 11, 22)
 
 //#define WINUAEEXTRA _T("AmiKit Preview")
 //#define WINUAEEXTRA _T("Amiga Forever Edition")
index be21789a52a85635f3cf8a8f949eb5196183e9d9..b0b02da9f064bf8e3ba40ce9545027c2ab4a8739 100644 (file)
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <EnableEnhancedInstructionSet>StreamingSIMDExtensions2</EnableEnhancedInstructionSet>
       <FloatingPointModel>Fast</FloatingPointModel>
-      <TreatWChar_tAsBuiltInType>false</TreatWChar_tAsBuiltInType>
+      <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
       <RuntimeTypeInfo>false</RuntimeTypeInfo>
       <PrecompiledHeader>
       </PrecompiledHeader>
       <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <LanguageStandard>stdcpplatest</LanguageStandard>
+      <AdditionalOptions>/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
+      <LanguageStandard_C>Default</LanguageStandard_C>
+      <ConformanceMode>false</ConformanceMode>
+      <EnforceTypeConversionRules>
+      </EnforceTypeConversionRules>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <LanguageStandard>stdcpplatest</LanguageStandard>
+      <AdditionalOptions>/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <LanguageStandard>stdcpplatest</LanguageStandard>
+      <AdditionalOptions>/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <LanguageStandard>stdcpplatest</LanguageStandard>
+      <AdditionalOptions>/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <LanguageStandard>stdcpplatest</LanguageStandard>
+      <AdditionalOptions>/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
       <MultiProcessorCompilation>true</MultiProcessorCompilation>
       <LanguageStandard>stdcpplatest</LanguageStandard>
+      <AdditionalOptions>/Zc:strictStrings- %(AdditionalOptions)</AdditionalOptions>
     </ClCompile>
     <ResourceCompile>
       <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
index d03dc6acbae81a704c9b2adebba75418026c4b7a..27a8b4eb2efe69d5cf25da7cb7b3ebca6bb92bfb 100644 (file)
     <ClCompile Include="..\direct3d11.cpp">
       <Filter>win32</Filter>
     </ClCompile>
-    <ClCompile Include="..\FX11\d3dxGlobal.cpp">
-      <Filter>win32\FX11</Filter>
-    </ClCompile>
-    <ClCompile Include="..\FX11\EffectLoad.cpp">
-      <Filter>win32\FX11</Filter>
-    </ClCompile>
-    <ClCompile Include="..\FX11\EffectNonRuntime.cpp">
-      <Filter>win32\FX11</Filter>
-    </ClCompile>
-    <ClCompile Include="..\FX11\EffectReflection.cpp">
-      <Filter>win32\FX11</Filter>
-    </ClCompile>
-    <ClCompile Include="..\FX11\EffectRuntime.cpp">
-      <Filter>win32\FX11</Filter>
-    </ClCompile>
-    <ClCompile Include="..\FX11\EffectAPI.cpp">
-      <Filter>win32\FX11</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\debugmem.cpp">
       <Filter>common</Filter>
     </ClCompile>
     <ClCompile Include="..\..\pcem\vid_cl5429.cpp">
       <Filter>pcem</Filter>
     </ClCompile>
+    <ClCompile Include="..\FX11\d3dxGlobal.cpp">
+      <Filter>win32\FX11</Filter>
+    </ClCompile>
+    <ClCompile Include="..\FX11\EffectAPI.cpp">
+      <Filter>win32\FX11</Filter>
+    </ClCompile>
+    <ClCompile Include="..\FX11\EffectLoad.cpp">
+      <Filter>win32\FX11</Filter>
+    </ClCompile>
+    <ClCompile Include="..\FX11\EffectNonRuntime.cpp">
+      <Filter>win32\FX11</Filter>
+    </ClCompile>
+    <ClCompile Include="..\FX11\EffectReflection.cpp">
+      <Filter>win32\FX11</Filter>
+    </ClCompile>
+    <ClCompile Include="..\FX11\EffectRuntime.cpp">
+      <Filter>win32\FX11</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\resources\35floppy.ico">
index e147b8e73c17c4549f27c3e0902911993059f811..2f862bd310ee5610354e83d539c9f94486cc4079 100644 (file)
@@ -1,4 +1,20 @@
 
+
+Beta 11:
+
+- S3Trio/S3Virge double scan mode detection fixed. Calculation used size parameters before bit depth specific screen width adjustments.
+- Hardware emulated RTG boards interlace modes fixed.
+- Added DMA capable RAM checkbox to RAM GUI panel.
+- Added force 16-bit checkbox to RAM GUI panel. Affects more compatible and cycle-exact CPU modes only. If 68020+ and 16-bit: CPU always splits 32-bit accesses to two 16-bit accesses. Defaults have not changed, chip ram is 32-bit if A3000 or AGA, all other RAM is 32-bit if 68020+ CPU. Most common use case is to be able to change "slow" RAM bus width. ("Real" 16-bit "slow" ram vs 32-bit accelerator board "slow" ram)
+- Lightpen cursor left trails if vertical centering was enabled.
+- Effects 11 (FX11) updated to latest (and apparently final) version. WinUAE uses it to support D3D9 shaders in D3D11 mode.
+- Fixed HAM left border corruption if overscan HAM mode and bitplane horizontal start was earlier than current filter horizontal start. (Old bug)
+- scp disk image format support fix (keirf). Account for residual flux time at end of final revolution. Fix double replay of revolution #0 when track is initially loaded.
+- uaedbg does not anymore report word reads from execbase or exception vectors as invalid if CPU is 68000/68010 or if chip ram is 16-bit wide.
+- $bfff00 debug logging word/long behavior changed. Format string without %l (except pointers: %p, %s and %b) is now consided word even if long was written to $bfff00.
+- A2386SX 1.2M floppy error workaround. It expects to read 1.2M and 1.4M floppies using 720k floppy bit rate. 1.4M was already worked around previously. (Software thinks it is using shared Amiga 1760k drive, "Flipper" hardware is not emulated).
+
+
 Beta 10:
 
 - Added workaround for Windows socket behavior difference compared to Unix/Amiga. Windows return truncated data and error status if bsdsocket.library recv/recvfrom() supplied buffer is smaller than available data. Unix/Amiga sockets will also return truncated data but don't return error status.
index dc5b6f3b4d7155e528a3ddd2d1a53f0e60d95fe3..673ccdc67ad6311907b3fea83f93224999579a75 100644 (file)
@@ -3067,6 +3067,7 @@ static bool sndboard_init_capture(int freq)
        WAVEFORMATEX wavfmtsrc;
        WAVEFORMATEX *wavfmt2;
        WAVEFORMATEX *wavfmt;
+       bool init = false;
 
        wavfmt2 = NULL;
 
@@ -3091,7 +3092,6 @@ static bool sndboard_init_capture(int freq)
        wavfmtsrc.nBlockAlign = wavfmtsrc.wBitsPerSample / 8 * wavfmtsrc.nChannels;
        wavfmtsrc.nAvgBytesPerSec = wavfmtsrc.nBlockAlign * wavfmtsrc.nSamplesPerSec;
 
-       bool init = false;
        AUDCLNT_SHAREMODE exc;
        for (int mode = 0; mode < 2; mode++) {
                exc = mode == 0 ? AUDCLNT_SHAREMODE_EXCLUSIVE : AUDCLNT_SHAREMODE_SHARED;
diff --git a/x86.cpp b/x86.cpp
index 6c5cb0ab670dd2b7e22b08118d1a260c53e30a29..c1280b1a7e0ae5d3818f67f1e2d407d017267928 100644 (file)
--- a/x86.cpp
+++ b/x86.cpp
@@ -197,6 +197,8 @@ struct x86_bridge
        uae_u8 vlsi_regs[0x100];
        uae_u16 vlsi_regs_ems[64];
        bool vlsi_config;
+       int a2386flipper;
+       bool a2386_amigapcdrive;
 };
 static int x86_found;
 
@@ -394,6 +396,7 @@ static uae_u8 x86_bridge_put_io(struct x86_bridge *xb, uaecptr addr, uae_u8 v)
                        v |= 2;
                else if (!(v & 2))
                        v |= 1;
+               xb->a2386flipper = (v >> 5) & 3;
 #if X86_DEBUG_BRIDGE_IO
                write_log(_T("IO_CONTROL_REGISTER %02X -> %02x\n"), old, v);
 #endif
@@ -434,8 +437,13 @@ static uae_u8 x86_bridge_put_io(struct x86_bridge *xb, uaecptr addr, uae_u8 v)
                        xb->a2386_default_video = v & 1;
                        write_log(_T("A2386 Default mode = %s\n"), xb->a2386_default_video ? _T("MDA") : _T("CGA"));
                }
-               if (v == 6 || v == 7)
+               if (v == 6 || v == 7) {
                        xb->pc_speaker = (v & 1) != 0;
+               }
+               if (v == 10 || v == 11) {
+                       xb->a2386_amigapcdrive = (v & 1) != 0;
+                       write_log(_T("A2386 Flipper mode = %s\n"), xb->a2386_amigapcdrive ? _T("PC") : _T("Amiga"));
+               }
                break;
 
                default:
@@ -699,9 +707,9 @@ static int floppy_selected(void)
 static bool floppy_valid_rate(struct floppy_reserved *fr)
 {
        struct x86_bridge *xb = bridges[0];
-       // A2386 BIOS sets 720k data rate for both 720k and 1.4M drives
+       // A2386 BIOS sets 720k data rate for 720k, 1.2M and 1.4M drives
        // probably because it thinks Amiga half-speed drive is connected?
-       if (xb->type == TYPE_2386 && fr->rate == 0 && floppy_rate == 2)
+       if (xb->type == TYPE_2386 && fr->rate == 0 && (floppy_rate == 1 || floppy_rate == 2))
                return true;
        return fr->rate == floppy_rate || floppy_rate < 0;
 }
@@ -3186,6 +3194,8 @@ static void bridge_reset(struct x86_bridge *xb)
        xb->pc_irq3a = xb->pc_irq3b = xb->pc_irq7 = false;
        xb->mode_register = -1;
        xb->video_initialized = false;
+       xb->a2386flipper = 0;
+       xb->a2386_amigapcdrive = false;
        x86_cpu_active = false;
        memset(xb->amiga_io, 0, 0x50000);
        memset(xb->io_ports, 0, 0x10000);