From 19a5912e13891e323d90e6215b3dc3c328a307a8 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 22 Nov 2020 17:37:03 +0200 Subject: [PATCH] 4500b11 --- blkdev_cdimage.cpp | 2 - debugmem.cpp | 4 +- disk.cpp | 9 ++-- drawing.cpp | 6 ++- filesys.cpp | 3 +- gfxboard.cpp | 3 +- hardfile.cpp | 1 - ini.cpp | 4 +- inputdevice.cpp | 46 ++++++++++--------- jit/compemu_support.cpp | 12 +++-- od-win32/direct3d.cpp | 12 +++-- od-win32/direct3d11.cpp | 26 +++++++++-- od-win32/hardfile_win32.cpp | 15 +++--- od-win32/lcd.cpp | 7 +-- od-win32/mp3decoder.h | 4 +- od-win32/registry.cpp | 5 +- od-win32/sounddep/sound.cpp | 14 ++++-- od-win32/win32.h | 4 +- od-win32/winuae_msvc15/winuae_msvc.vcxproj | 12 ++++- .../winuae_msvc15/winuae_msvc.vcxproj.filters | 36 +++++++-------- od-win32/winuaechangelog.txt | 16 +++++++ sndboard.cpp | 2 +- x86.cpp | 16 +++++-- 23 files changed, 166 insertions(+), 93 deletions(-) diff --git a/blkdev_cdimage.cpp b/blkdev_cdimage.cpp index 012372e9..3baad1bc 100644 --- a/blkdev_cdimage.cpp +++ b/blkdev_cdimage.cpp @@ -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 diff --git a/debugmem.cpp b/debugmem.cpp index 31359366..5ba793ad 100644 --- a/debugmem.cpp +++ b/debugmem.cpp @@ -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; diff --git a/disk.cpp b/disk.cpp index a706e0ae..89066a00 100644 --- 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; } diff --git a/drawing.cpp b/drawing.cpp index f96d6b1c..c5851e9c 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -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; diff --git a/filesys.cpp b/filesys.cpp index e6afeb55..26af3778 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -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)) diff --git a/gfxboard.cpp b/gfxboard.cpp index 15cffaf9..111588cf 100644 --- a/gfxboard.cpp +++ b/gfxboard.cpp @@ -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; diff --git a/hardfile.cpp b/hardfile.cpp index 9feeed19..57f9280e 100644 --- a/hardfile.cpp +++ b/hardfile.cpp @@ -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 14413c49..f94e88f4 100644 --- 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); diff --git a/inputdevice.cpp b/inputdevice.cpp index 029661eb..9c410e25 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -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 { diff --git a/jit/compemu_support.cpp b/jit/compemu_support.cpp index 34d3ea61..0d5481da 100644 --- a/jit/compemu_support.cpp +++ b/jit/compemu_support.cpp @@ -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 diff --git a/od-win32/direct3d.cpp b/od-win32/direct3d.cpp index b730d999..bd73dbe0 100644 --- a/od-win32/direct3d.cpp +++ b/od-win32/direct3d.cpp @@ -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; diff --git a/od-win32/direct3d11.cpp b/od-win32/direct3d11.cpp index 51fdc597..2ab11c26 100644 --- a/od-win32/direct3d11.cpp +++ b/od-win32/direct3d11.cpp @@ -2,6 +2,8 @@ #include #include "resource.h" +#define FX11 1 + #include #include #include @@ -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; diff --git a/od-win32/hardfile_win32.cpp b/od-win32/hardfile_win32.cpp index 6052514e..4a4d91c5 100644 --- a/od-win32/hardfile_win32.cpp +++ b/od-win32/hardfile_win32.cpp @@ -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; diff --git a/od-win32/lcd.cpp b/od-win32/lcd.cpp index 29ba5b6f..c93f2e77 100644 --- a/od-win32/lcd.cpp +++ b/od-win32/lcd.cpp @@ -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; diff --git a/od-win32/mp3decoder.h b/od-win32/mp3decoder.h index 4ccb01f2..0f8ff4c2 100644 --- a/od-win32/mp3decoder.h +++ b/od-win32/mp3decoder.h @@ -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); }; diff --git a/od-win32/registry.cpp b/od-win32/registry.cpp index 4f3d3f35..d7ef5505 100644 --- a/od-win32/registry.cpp +++ b/od-win32/registry.cpp @@ -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); diff --git a/od-win32/sounddep/sound.cpp b/od-win32/sounddep/sound.cpp index 8b8738dd..34cb9307 100644 --- a/od-win32/sounddep/sound.cpp +++ b/od-win32/sounddep/sound.cpp @@ -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++; diff --git a/od-win32/win32.h b/od-win32/win32.h index 5b2445c8..1d28a6b7 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -20,12 +20,12 @@ #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") diff --git a/od-win32/winuae_msvc15/winuae_msvc.vcxproj b/od-win32/winuae_msvc15/winuae_msvc.vcxproj index be21789a..b0b02da9 100644 --- a/od-win32/winuae_msvc15/winuae_msvc.vcxproj +++ b/od-win32/winuae_msvc15/winuae_msvc.vcxproj @@ -243,7 +243,7 @@ true StreamingSIMDExtensions2 Fast - false + true false @@ -259,6 +259,11 @@ %(ForcedIncludeFiles) true stdcpplatest + /Zc:strictStrings- %(AdditionalOptions) + Default + false + + NDEBUG;%(PreprocessorDefinitions) @@ -421,6 +426,7 @@ %(ForcedIncludeFiles) true stdcpplatest + /Zc:strictStrings- %(AdditionalOptions) NDEBUG;%(PreprocessorDefinitions) @@ -501,6 +507,7 @@ %(ForcedIncludeFiles) true stdcpplatest + /Zc:strictStrings- %(AdditionalOptions) NDEBUG;%(PreprocessorDefinitions) @@ -654,6 +661,7 @@ %(ForcedIncludeFiles) true stdcpplatest + /Zc:strictStrings- %(AdditionalOptions) NDEBUG;%(PreprocessorDefinitions) @@ -731,6 +739,7 @@ %(ForcedIncludeFiles) true stdcpplatest + /Zc:strictStrings- %(AdditionalOptions) NDEBUG;%(PreprocessorDefinitions) @@ -811,6 +820,7 @@ %(ForcedIncludeFiles) true stdcpplatest + /Zc:strictStrings- %(AdditionalOptions) NDEBUG;%(PreprocessorDefinitions) diff --git a/od-win32/winuae_msvc15/winuae_msvc.vcxproj.filters b/od-win32/winuae_msvc15/winuae_msvc.vcxproj.filters index d03dc6ac..27a8b4eb 100644 --- a/od-win32/winuae_msvc15/winuae_msvc.vcxproj.filters +++ b/od-win32/winuae_msvc15/winuae_msvc.vcxproj.filters @@ -820,24 +820,6 @@ win32 - - win32\FX11 - - - win32\FX11 - - - win32\FX11 - - - win32\FX11 - - - win32\FX11 - - - win32\FX11 - common @@ -970,6 +952,24 @@ pcem + + win32\FX11 + + + win32\FX11 + + + win32\FX11 + + + win32\FX11 + + + win32\FX11 + + + win32\FX11 + diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index e147b8e7..2f862bd3 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -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. diff --git a/sndboard.cpp b/sndboard.cpp index dc5b6f3b..673ccdc6 100644 --- a/sndboard.cpp +++ b/sndboard.cpp @@ -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 6c5cb0ab..c1280b1a 100644 --- 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); -- 2.47.3