From f6a1b1ec8968cadd67fe2dcee166c88678893147 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sat, 15 Jun 2013 20:49:01 +0300 Subject: [PATCH] 2610b3 --- cfgfile.cpp | 45 ++++++++++++++++++++++++------------ custom.cpp | 10 +++++--- fpp.cpp | 4 ++++ newcpu.cpp | 16 +++++++------ od-win32/direct3d.cpp | 4 ++-- od-win32/win32.cpp | 15 ++++++++++-- od-win32/win32.h | 4 ++-- od-win32/winuaechangelog.txt | 10 ++++++++ 8 files changed, 77 insertions(+), 31 deletions(-) diff --git a/cfgfile.cpp b/cfgfile.cpp index aa44cf2a..093f54d9 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -920,20 +920,30 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_write_str (f, _T("gfx_filtermask_post"), p->gfx_filtermask[i + MAX_FILTERSHADERS]); } cfgfile_dwrite_str (f, _T("gfx_filter_mask"), p->gfx_filtermask[2 * MAX_FILTERSHADERS - 1]); - if (p->gfx_filtershader[0][0] && p->gfx_api) { - cfgfile_dwrite (f, _T("gfx_filter"), _T("D3D:%s"), p->gfx_filtershader[0]); - } else if (p->gfx_filter > 0) { - int i = 0; - struct uae_filter *uf; - while (uaefilters[i].name) { - uf = &uaefilters[i]; - if (uf->type == p->gfx_filter) { - cfgfile_dwrite_str (f, _T("gfx_filter"), uf->cfgname); + { + bool d3dfound = false; + for (int i = 0; i < 2 * MAX_FILTERSHADERS; i++) { + if (p->gfx_filtershader[i][0] && p->gfx_api) { + cfgfile_dwrite (f, _T("gfx_filter"), _T("D3D:%s"), p->gfx_filtershader[i]); + d3dfound = true; + break; + } + } + if (!d3dfound) { + if (p->gfx_filter > 0) { + int i = 0; + struct uae_filter *uf; + while (uaefilters[i].name) { + uf = &uaefilters[i]; + if (uf->type == p->gfx_filter) { + cfgfile_dwrite_str (f, _T("gfx_filter"), uf->cfgname); + } + i++; + } + } else { + cfgfile_dwrite (f, _T("gfx_filter"), _T("no")); } - i++; } - } else { - cfgfile_dwrite (f, _T("gfx_filter"), _T("no")); } cfgfile_dwrite_str (f, _T("gfx_filter_mode"), filtermode2[p->gfx_filter_filtermode]); cfgfile_dwrite (f, _T("gfx_filter_vert_zoomf"), _T("%f"), p->gfx_filter_vert_zoom); @@ -1973,20 +1983,25 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) } if (_tcscmp (option, _T("gfx_filter")) == 0) { - int i = 0; TCHAR *s = _tcschr (value, ':'); - p->gfx_filtershader[0][0] = 0; p->gfx_filter = 0; if (s) { *s++ = 0; if (!_tcscmp (value, _T("D3D"))) { + int i; p->gfx_api = 1; - _tcscpy (p->gfx_filtershader[0], s); + for (i = 0; i < 2 * MAX_FILTERSHADERS; i++) { + if (p->gfx_filtershader[i][0]) + break; + } + if (i >= 2 * MAX_FILTERSHADERS) + _tcscpy (p->gfx_filtershader[0], s); } } if (!_tcscmp (value, _T("direct3d"))) { p->gfx_api = 1; // forwards compatibiity } else { + int i = 0; while(uaefilters[i].name) { if (!_tcscmp (uaefilters[i].cfgname, value)) { p->gfx_filter = uaefilters[i].type; diff --git a/custom.cpp b/custom.cpp index 01f8c97a..cd193995 100644 --- a/custom.cpp +++ b/custom.cpp @@ -3068,7 +3068,7 @@ void compute_framesync (void) struct chipset_refresh *cr = get_chipset_refresh (); while (cr) { double v = -1; - if (!picasso_on) { + if (!picasso_on && !picasso_requested_on) { if (isvsync_chipset ()) { if (cr->index == CHIPSET_REFRESH_PAL || cr->index == CHIPSET_REFRESH_NTSC) { if ((fabs (vblank_hz - 50) < 1 || fabs (vblank_hz - 60) < 1 || fabs (vblank_hz - 100) < 1 || fabs (vblank_hz - 120) < 1) && currprefs.gfx_apmode[0].gfx_vsync == 2 && currprefs.gfx_apmode[0].gfx_fullscreen > 0) { @@ -3121,6 +3121,10 @@ void compute_framesync (void) } stored_chipset_refresh = cr; interlace_changed = 0; + lof_togglecnt_lace = 0; + lof_togglecnt_nlace = 0; + nlace_cnt = NLACE_CNT_NEEDED; + lof_changing = 0; gfxvidinfo.drawbuffer.inxoffset = -1; gfxvidinfo.drawbuffer.inyoffset = -1; @@ -3193,7 +3197,7 @@ void compute_framesync (void) compute_vsynctime (); - write_log (_T("%s mode%s%s V=%.4fHz H=%0.4fHz (%dx%d+%d) IDX=%d (%s) D=%d RTG=%d\n"), + write_log (_T("%s mode%s%s V=%.4fHz H=%0.4fHz (%dx%d+%d) IDX=%d (%s) D=%d RTG=%d/%d\n"), isntsc ? _T("NTSC") : _T("PAL"), islace ? _T(" lace") : _T(""), doublescan > 0 ? _T(" dblscan") : _T(""), @@ -3202,7 +3206,7 @@ void compute_framesync (void) maxhpos, maxvpos, lof_store ? 1 : 0, cr ? cr->index : -1, cr != NULL && cr->label != NULL ? cr->label : _T(""), - currprefs.gfx_apmode[picasso_on ? 1 : 0].gfx_display, picasso_on + currprefs.gfx_apmode[picasso_on ? 1 : 0].gfx_display, picasso_on, picasso_requested_on ); config_changed = 1; diff --git a/fpp.cpp b/fpp.cpp index f89992b6..45da4737 100644 --- a/fpp.cpp +++ b/fpp.cpp @@ -1072,6 +1072,7 @@ void fpuop_dbcc (uae_u32 opcode, uae_u16 extra) if (fault_if_no_fpu_u (opcode, extra, pc + disp, pc - 4)) return; regs.fpiar = pc - 4; + regs.fpu_state = 1; cc = fpp_cond (extra & 0x3f); if (cc == -1) { fpu_op_illg (opcode, regs.fpiar); @@ -1099,6 +1100,7 @@ void fpuop_scc (uae_u32 opcode, uae_u16 extra) return; regs.fpiar = pc; + regs.fpu_state = 1; cc = fpp_cond (extra & 0x3f); if (cc == -1) { fpu_op_illg (opcode, regs.fpiar); @@ -1127,6 +1129,7 @@ void fpuop_trapcc (uae_u32 opcode, uaecptr oldpc, uae_u16 extra) return; regs.fpiar = oldpc; + regs.fpu_state = 1; cc = fpp_cond (extra & 0x3f); if (cc == -1) { fpu_op_illg (opcode, oldpc); @@ -1147,6 +1150,7 @@ void fpuop_bcc (uae_u32 opcode, uaecptr oldpc, uae_u32 extra) return; regs.fpiar = oldpc - 2; + regs.fpu_state = 1; cc = fpp_cond (opcode & 0x3f); if (cc == -1) { fpu_op_illg (opcode, oldpc - 2); diff --git a/newcpu.cpp b/newcpu.cpp index 7fe881fa..e004d1de 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -2486,8 +2486,13 @@ static void Exception_mmu030 (int nr, uaecptr oldpc) Exception_build_stack_frame (oldpc, currpc, regs.mmu_ssw, nr, 0x1); } else if (nr ==5 || nr == 6 || nr == 7 || nr == 9 || nr == 56) { Exception_build_stack_frame (oldpc, currpc, regs.mmu_ssw, nr, 0x2); - } else if (nr == 2 || nr == 3) { + } else if (nr == 2) { Exception_build_stack_frame (oldpc, currpc, regs.mmu_ssw, nr, 0xB); + } else if (nr == 3) { + regs.mmu_fault_addr = last_fault_for_exception_3; + mmu030_state[0] = mmu030_state[1] = 0; + mmu030_data_buffer = 0; + Exception_build_stack_frame (last_fault_for_exception_3, currpc, MMU030_SSW_RW | MMU030_SSW_SIZE_W | (regs.s ? 6 : 2), nr, 0xA); } else { Exception_build_stack_frame (oldpc, currpc, regs.mmu_ssw, nr, 0x0); } @@ -2543,12 +2548,9 @@ static void Exception_mmu (int nr, uaecptr oldpc) else Exception_build_stack_frame(oldpc, currpc, regs.mmu_fslw, nr, 0x4); } else if (nr == 3) { // address error - uae_u16 ssw = (sv ? 4 : 0) | (last_instructionaccess_for_exception_3 ? 2 : 1); - ssw |= last_writeaccess_for_exception_3 ? 0 : 0x40; - ssw |= 0x20; - Exception_build_stack_frame(oldpc, currpc, ssw, nr, 0xB); - write_log (_T("Exception %d (%x) at %x -> %x! %s at %d\n"), nr, oldpc, currpc, get_long (regs.vbr + 4*nr),__FILE__,__LINE__); - } else if (nr ==5 || nr == 6 || nr == 7 || nr == 9) { + Exception_build_stack_frame(last_fault_for_exception_3, currpc, 0, nr, 0x2); + write_log (_T("Exception %d (%x) at %x -> %x! %s at %d\n"), nr, last_fault_for_exception_3, currpc, get_long (regs.vbr + 4 * nr), __FILE__, __LINE__); + } else if (nr == 5 || nr == 6 || nr == 7 || nr == 9) { Exception_build_stack_frame(oldpc, currpc, regs.mmu_ssw, nr, 0x2); } else if (regs.m && nr >= 24 && nr < 32) { /* M + Interrupt */ Exception_build_stack_frame(oldpc, currpc, regs.mmu_ssw, nr, 0x1); diff --git a/od-win32/direct3d.cpp b/od-win32/direct3d.cpp index 9966f9de..47a0710e 100644 --- a/od-win32/direct3d.cpp +++ b/od-win32/direct3d.cpp @@ -1165,6 +1165,7 @@ static int createamigatexture (int w, int h) write_log (_T("%s: Failed to lock box of volume texture: %s\n"), D3DHEAD, D3D_ErrorString (hr)); return 0; } + write_log (_T("HQ2X texture (%dx%d) (%dx%d)\n"), w2, h2, w, h); BuildHq2xLookupTexture (w2, h2, w, h, (unsigned char*)lockedBox.pBits); shaders[i].lpHq2xLookupTexture->UnlockBox (0); } @@ -1974,7 +1975,6 @@ static void invalidatedeviceobjects (void) d3dswapchain->Release (); d3dswapchain = NULL; } - m_Hq2xLookupTextureHandle = NULL; locked = 0; maskshift.x = maskshift.y = maskshift.z = maskshift.w = 0; maskmult.x = maskmult.y = maskmult.z = maskmult.w = 0; @@ -2750,7 +2750,7 @@ static void D3D_render2 (void) for (int i = 0; i < MAX_SHADERS; i++) { struct shaderdata *s = &shaders[i]; if (s->type == SHADERTYPE_BEFORE) { - settransform (s); + settransform2 (s); srctex = processshader (srctex, s, true); if (!srctex) return; diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index a4299752..7ec5ae8a 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -96,13 +96,14 @@ extern int force_directsound; extern int log_a2065, a2065_promiscuous; extern int rawinput_enabled_hid, rawinput_log; extern int log_filesys; +extern int forcedframelatency; int log_scsi; int log_net; int log_vsync, debug_vsync_min_delay, debug_vsync_forced_delay; int uaelib_debug; int pissoff_value = 15000 * CYCLE_UNIT; unsigned int fpucontrol; -int extraframewait = 0; +int extraframewait; extern FILE *debugfile; extern int console_logging; @@ -3158,6 +3159,9 @@ void target_save_options (struct zfile *f, struct uae_prefs *p) cfgfile_target_dwrite_str (f, _T("gui_page"), p->win32_guipage); cfgfile_target_dwrite_str (f, _T("gui_active_page"), p->win32_guiactivepage); cfgfile_target_dwrite_bool (f, _T("filesystem_mangle_reserved_names"), p->win32_filesystem_mangle_reserved_names); + + cfgfile_target_dwrite (f, _T("extraframewait"), _T("%d"), extraframewait); + cfgfile_target_dwrite (f, _T("framelatency"), _T("%d"), forcedframelatency); } void target_restart (void) @@ -3427,6 +3431,14 @@ int target_parse_option (struct uae_prefs *p, const TCHAR *option, const TCHAR * return 1; } + if (cfgfile_intval (option, value, _T("extraframewait"), &v, 1)) { + extraframewait = fetchpri (v, 1); + return 1; + } + if (cfgfile_intval (option, value, _T("framelatency"), &v, 1)) { + forcedframelatency = fetchpri (v, 1); + return 1; + } i = 0; while (obsolete[i]) { @@ -4736,7 +4748,6 @@ extern int debug_rtg_blitter; extern int log_bsd; extern int inputdevice_logging; extern int vsync_modechangetimeout; -extern int forcedframelatency; extern int tablet_log; extern int log_blitter; diff --git a/od-win32/win32.h b/od-win32/win32.h index 07dcb758..a5b94556 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -19,11 +19,11 @@ #define LANG_DLL 1 #if WINUAEPUBLICBETA -#define WINUAEBETA _T("2") +#define WINUAEBETA _T("3") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2013, 6, 12) +#define WINUAEDATE MAKEBD(2013, 6, 15) #define WINUAEEXTRA _T("") //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index e9e189b7..30712745 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,6 +1,16 @@ - restore only single input target to default. +Beta 3: + +- Direct3D hq2x shader filter should work correctly again. (2.6.0) +- 68040/060 MMU mode address error stack frame fixed. (Possibly only debuggers need this) +- 68030 MMU mode address error stack frame has correct format but it is not yet + recoverable. (I don't think address error recovery is used by any OS) +- FScc, FTRAP and FBcc didn't get FPU out of NULL state. (No one cares fix) +- extraframewait and framelatency command line parameters are also available via + config file too (uses win32. prefix) + Beta 2: - Moved >2M Chip RAM merge earlier in boot process. Previous was too late and it broke -- 2.47.3