From: Toni Wilen Date: Sat, 6 Mar 2010 09:48:23 +0000 (+0200) Subject: 2100b15 X-Git-Tag: 2100~13 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=87213f37de4438c3c37eadf6d52a94915713e32c;p=francis%2Fwinuae.git 2100b15 --- diff --git a/custom.cpp b/custom.cpp index 84e75b92..5548ba61 100644 --- a/custom.cpp +++ b/custom.cpp @@ -2777,7 +2777,7 @@ void init_hz (void) vblank_hz = 300; maxhpos_short = maxhpos; eventtab[ev_hsync].oldcycles = get_cycles (); - eventtab[ev_hsync].evtime = get_cycles() + HSYNCTIME; + eventtab[ev_hsync].evtime = get_cycles () + HSYNCTIME; events_schedule (); if (hzc) { interlace_seen = (bplcon0 & 4) ? 1 : 0; @@ -3353,7 +3353,7 @@ int intlev (void) return -1; } -#define INT_PROCESSING_DELAY 3 * CYCLE_UNIT +#define INT_PROCESSING_DELAY (3 * CYCLE_UNIT) STATIC_INLINE int use_eventmode (uae_u16 v) { if (!currprefs.cpu_cycle_exact) @@ -5721,6 +5721,13 @@ void customreset (int hardreset) CLXCON (clxcon); CLXCON2 (clxcon2); calcdiw (); + write_log (L"CPU=%d Chipset=%s %s\n", + currprefs.cpu_model, + (currprefs.chipset_mask & CSMASK_AGA) ? L"AGA" : + (currprefs.chipset_mask & CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE) == (CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE) ? L"Full ECS" : + (currprefs.chipset_mask & CSMASK_ECS_DENISE) ? L"ECS Denise" : + (currprefs.chipset_mask & CSMASK_ECS_AGNUS) ? L"ECS" : + L"OCS", currprefs.ntscmode ? L"NTSC" : L"PAL"); write_log (L"State restored\n"); for (i = 0; i < 8; i++) nr_armed += spr[i].armed != 0; @@ -6299,7 +6306,7 @@ uae_u8 *restore_custom (uae_u8 *src) audio_reset (); - changed_prefs.chipset_mask = currprefs.chipset_mask = RL; + changed_prefs.chipset_mask = currprefs.chipset_mask = RL & CSMASK_MASK; update_mirrors (); RW; /* 000 BLTDDAT */ RW; /* 002 DMACONR */ @@ -6321,7 +6328,7 @@ uae_u8 *restore_custom (uae_u8 *src) dsklen = RW; /* 024 DSKLEN */ RW; /* 026 DSKDAT */ RW; /* 028 REFPTR */ - i = RW; lof = (i & 0x8000) ? 1 : 0; lol = (i & 0x0080); /* 02A VPOSW */ + i = RW; lof = (i & 0x8000) ? 1 : 0; lol = (i & 0x0080) ? 1 : 0; /* 02A VPOSW */ RW; /* 02C VHPOSW */ COPCON (RW); /* 02E COPCON */ RW; /* 030 SERDAT* */ @@ -6423,7 +6430,9 @@ uae_u8 *restore_custom (uae_u8 *src) RW; /* 1F4 ? */ RW; /* 1F6 ? */ RW; /* 1F8 ? */ - RW; /* 1FA ? */ + i = RW; /* 1FA ? */ + if (i & 0x8000) + currprefs.ntscmode = changed_prefs.ntscmode = i & 1; fmode = RW; /* 1FC FMODE */ last_custom_value1 = RW;/* 1FE ? */ @@ -6595,7 +6604,7 @@ uae_u8 *save_custom (int *len, uae_u8 *dstptr, int full) SW (0); /* 1F4 */ SW (0); /* 1F6 */ SW (0); /* 1F8 */ - SW (0); /* 1FA */ + SW (0x8000 | (currprefs.ntscmode ? 1 : 0)); /* 1FA (re-used for NTSC) */ SW (fmode); /* 1FC FMODE */ SW (last_custom_value1); /* 1FE */ diff --git a/enforcer.cpp b/enforcer.cpp index b0563cad..c24e80f7 100644 --- a/enforcer.cpp +++ b/enforcer.cpp @@ -207,9 +207,11 @@ static void enforcer_display_hit (const TCHAR *addressmode, uae_u32 pc, uaecptr enforcer_hit = 1; - if (!(sysbase = get_long (4))) + sysbase = get_long (4); + if (sysbase < 0x100 || !valid_address (sysbase, 1000)) goto end; - if (!(this_task = get_long (sysbase + 276))) + this_task = get_long (sysbase + 276); + if (this_task < 0x100 || !valid_address (this_task, 1000)) goto end; task_name = get_long (this_task + 10); /* ln_Name */ diff --git a/include/custom.h b/include/custom.h index 27b807cd..508c4b5d 100644 --- a/include/custom.h +++ b/include/custom.h @@ -13,6 +13,7 @@ #define CSMASK_ECS_AGNUS 1 #define CSMASK_ECS_DENISE 2 #define CSMASK_AGA 4 +#define CSMASK_MASK (CSMASK_ECS_AGNUS | CSMASK_ECS_DENISE | CSMASK_AGA) uae_u32 get_copper_address (int copno); diff --git a/newcpu.cpp b/newcpu.cpp index 1ce4450d..961ec468 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -2687,7 +2687,7 @@ STATIC_INLINE int do_specialties (int cycles) } while (regs.spcflags & SPCFLAG_STOP) { - do_cycles (4 * CYCLE_UNIT); + do_cycles (currprefs.cpu_cycle_exact ? 2 * CYCLE_UNIT : 4 * CYCLE_UNIT); if (regs.spcflags & SPCFLAG_COPPER) do_copper (); @@ -3811,7 +3811,6 @@ uae_u8 *restore_cpu (uae_u8 *src) l = restore_u32 (); if (l & CPUMODE_HALT) { regs.stopped = 1; - set_special (SPCFLAG_STOP); } else { regs.stopped = 0; } @@ -3867,6 +3866,9 @@ void restore_cpu_finish (void) m68k_setpc (regs.pc); set_cpu_caches (); doint (); + if (regs.stopped) + set_special (SPCFLAG_STOP); + } uae_u8 *save_cpu (int *len, uae_u8 *dstptr) diff --git a/od-win32/direct3d.cpp b/od-win32/direct3d.cpp index 6dcc1255..605ff1e2 100644 --- a/od-win32/direct3d.cpp +++ b/od-win32/direct3d.cpp @@ -473,12 +473,8 @@ static LPD3DXEFFECT psEffect_LoadEffect (const TCHAR *shaderfile, int full) _stprintf (tmp, L"%s%sfiltershaders\\direct3d\\%s", start_path_data, WIN32_PLUGINDIR, shaderfile); hr = D3DXCreateEffectCompilerFromFile (tmp, NULL, NULL, compileflags, &EffectCompiler, &Errors); if (FAILED (hr)) { - if (hr == 0x88760B59) - hr = D3DXCreateEffectCompilerFromFile (shaderfile, NULL, NULL, compileflags, &EffectCompiler, &Errors); - if (FAILED (hr)) { - write_log (L"%s: D3DXCreateEffectCompilerFromFile failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors)); - goto end; - } + write_log (L"%s: D3DXCreateEffectCompilerFromFile failed: %s\n", D3DHEAD, D3DX_ErrorString (hr, Errors)); + goto end; } hr = EffectCompiler->CompileEffect (0, &BufferEffect, &Errors); if (FAILED (hr)) { @@ -830,6 +826,69 @@ static int createledtexture (void) return 1; } + +static void createscanlines (int force) +{ + HRESULT hr; + D3DLOCKED_RECT locked; + static int osl1, osl2, osl3; + int sl4, sl42; + int l1, l2; + int x, y, yy; + uae_u8 *sld, *p; + int bpp; + + if (!sltexture) + return; + if (osl1 == currprefs.gfx_filter_scanlines && osl3 == currprefs.gfx_filter_scanlinelevel && osl2 == currprefs.gfx_filter_scanlineratio && !force) + return; + bpp = t_depth < 32 ? 2 : 4; + osl1 = currprefs.gfx_filter_scanlines; + osl3 = currprefs.gfx_filter_scanlinelevel; + osl2 = currprefs.gfx_filter_scanlineratio; + sl4 = currprefs.gfx_filter_scanlines * 16 / 100; + sl42 = currprefs.gfx_filter_scanlinelevel * 16 / 100; + if (sl4 > 15) + sl4 = 15; + if (sl42 > 15) + sl42 = 15; + l1 = (currprefs.gfx_filter_scanlineratio >> 0) & 15; + l2 = (currprefs.gfx_filter_scanlineratio >> 4) & 15; + + if (l1 + l2 <= 0) + return; + hr = sltexture->LockRect (0, &locked, NULL, 0); + if (FAILED (hr)) { + write_log (L"%s: SL LockRect failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); + return; + } + sld = (uae_u8*)locked.pBits; + for (y = 0; y < required_sl_texture_h; y++) + memset (sld + y * locked.Pitch, 0, required_sl_texture_w * bpp); + for (y = 1; y < required_sl_texture_h; y += l1 + l2) { + for (yy = 0; yy < l2 && y + yy < required_sl_texture_h; yy++) { + for (x = 0; x < required_sl_texture_w; x++) { + uae_u8 sll = sl42; + p = &sld[(y + yy) * locked.Pitch + (x * bpp)]; + if (bpp < 4) { + /* 16-bit, A4R4G4B4 */ + p[1] = (sl4 << 4) | (sll << 0); + p[0] = (sll << 4) | (sll << 0); + } else { + /* 32-bit, A8R8G8B8 */ + uae_u8 sll4 = sl4 | (sl4 << 4); + uae_u8 sll2 = sll | (sll << 4); + p[0] = sll2; + p[1] = sll2; + p[2] = sll2; + p[3] = sll4; + } + } + } + } + sltexture->UnlockRect (0); +} + static int createsltexture (void) { if (masktexture) @@ -840,6 +899,7 @@ static int createsltexture (void) write_log (L"%s: SL %d*%d texture allocated\n", D3DHEAD, required_sl_texture_w, required_sl_texture_h); maskmult_x = 1.0; maskmult_y = 1.0; + createscanlines (1); return 1; } @@ -1075,69 +1135,6 @@ static void settransform (void) psEffect_SetMatrices (&m_matProj, &m_matView, &m_matWorld); } -static void createscanlines (int force) -{ - HRESULT hr; - D3DLOCKED_RECT locked; - static int osl1, osl2, osl3; - int sl4, sl42; - int l1, l2; - int x, y, yy; - uae_u8 *sld, *p; - int bpp; - - if (!sltexture) - return; - if (osl1 == currprefs.gfx_filter_scanlines && osl3 == currprefs.gfx_filter_scanlinelevel && osl2 == currprefs.gfx_filter_scanlineratio && !force) - return; - bpp = t_depth < 32 ? 2 : 4; - osl1 = currprefs.gfx_filter_scanlines; - osl3 = currprefs.gfx_filter_scanlinelevel; - osl2 = currprefs.gfx_filter_scanlineratio; - sl4 = currprefs.gfx_filter_scanlines * 16 / 100; - sl42 = currprefs.gfx_filter_scanlinelevel * 16 / 100; - if (sl4 > 15) - sl4 = 15; - if (sl42 > 15) - sl42 = 15; - l1 = (currprefs.gfx_filter_scanlineratio >> 0) & 15; - l2 = (currprefs.gfx_filter_scanlineratio >> 4) & 15; - - if (l1 + l2 <= 0) - return; - hr = sltexture->LockRect (0, &locked, NULL, 0); - if (FAILED (hr)) { - write_log (L"%s: SL LockRect failed: %s\n", D3DHEAD, D3D_ErrorString (hr)); - return; - } - sld = (uae_u8*)locked.pBits; - for (y = 0; y < required_sl_texture_h; y++) - memset (sld + y * locked.Pitch, 0, required_sl_texture_w * bpp); - for (y = 1; y < required_sl_texture_h; y += l1 + l2) { - for (yy = 0; yy < l2 && y + yy < required_sl_texture_h; yy++) { - for (x = 0; x < required_sl_texture_w; x++) { - uae_u8 sll = sl42; - p = &sld[(y + yy) * locked.Pitch + (x * bpp)]; - if (bpp < 4) { - /* 16-bit, A4R4G4B4 */ - p[1] = (sl4 << 4) | (sll << 0); - p[0] = (sll << 4) | (sll << 0); - } else { - /* 32-bit, A8R8G8B8 */ - uae_u8 sll4 = sl4 | (sl4 << 4); - uae_u8 sll2 = sll | (sll << 4); - p[0] = sll2; - p[1] = sll2; - p[2] = sll2; - p[3] = sll4; - } - } - } - } - sltexture->UnlockRect (0); -} - - static void invalidatedeviceobjects (void) { if (texture) { @@ -1215,6 +1212,7 @@ static void invalidatedeviceobjects (void) static int restoredeviceobjects (void) { int vbsize; + int wasshader = shaderon; HRESULT hr; invalidatedeviceobjects (); @@ -1236,6 +1234,9 @@ static int restoredeviceobjects (void) createmasktexture (currprefs.gfx_filtermask); break; } + if (wasshader && !shaderon) + write_log (L"Falling back to non-shader mode\n"); + if (!createtexture (tin_w, tin_h)) return 0; createledtexture (); @@ -1510,10 +1511,10 @@ const TCHAR *D3D_init (HWND ahwnd, int w_w, int w_h, int t_w, int t_h, int depth { case 32: default: - tformat = D3DFMT_A8R8G8B8; + tformat = D3DFMT_X8R8G8B8; break; case 15: - tformat = D3DFMT_A1R5G5B5; + tformat = D3DFMT_X1R5G5B5; break; case 16: tformat = D3DFMT_R5G6B5; @@ -1630,7 +1631,7 @@ static void D3D_render22 (void) write_log (L"%s: BeginScene: %s\n", D3DHEAD, D3D_ErrorString (hr)); return; } - if (shaderon) { + if (shaderon && postEffect) { if (psActive) { LPDIRECT3DSURFACE9 lpRenderTarget; LPDIRECT3DSURFACE9 lpNewRenderTarget; @@ -1762,13 +1763,12 @@ static void D3D_render22 (void) if (sprite && sltexture) { D3DXVECTOR3 v; sprite->Begin (D3DXSPRITE_ALPHABLEND); - if (sltexture) { - v.x = v.y = v.z = 0; - sprite->Draw (sltexture, NULL, NULL, &v, 0xffffffff); - } + v.x = v.y = v.z = 0; + sprite->Draw (sltexture, NULL, NULL, &v, 0xffffffff); sprite->End (); } } + if (sprite && ((ledtexture) || (cursorsurfaced3d && cursor_v))) { D3DXVECTOR3 v; sprite->Begin (D3DXSPRITE_ALPHABLEND); @@ -1784,7 +1784,7 @@ static void D3D_render22 (void) MatrixScaling (&t, 1, 1, 0); sprite->SetTransform (&t); } - if (ledtexture) { + if (ledtexture && (((currprefs.leds_on_screen & STATUSLINE_RTG) && WIN32GFX_IsPicassoScreen ()) || ((currprefs.leds_on_screen & STATUSLINE_CHIPSET) && !WIN32GFX_IsPicassoScreen ()))) { v.x = 0; v.y = window_h - TD_TOTAL_HEIGHT; v.z = 0; @@ -1828,7 +1828,7 @@ void D3D_unlocktexture (void) if (!isd3d ()) return; - if (currprefs.leds_on_screen & STATUSLINE_CHIPSET) + if (currprefs.leds_on_screen & (STATUSLINE_CHIPSET | STATUSLINE_RTG)) updateleds (); if (locked) @@ -1893,7 +1893,7 @@ void D3D_getpixelformat (int depth, int *rb, int *gb, int *bb, int *rs, int *gs, *gs = 8; *bs = 0; *as = 24; - *a = 255; + *a = 0; break; case 15: *rb = 5; @@ -1910,7 +1910,7 @@ void D3D_getpixelformat (int depth, int *rb, int *gb, int *bb, int *rs, int *gs, *rb = 5; *gb = 6; *bb = 5; - *ab = 1; + *ab = 0; *rs = 11; *gs = 5; *bs = 0; diff --git a/od-win32/hardfile_win32.cpp b/od-win32/hardfile_win32.cpp index 29e9dd8f..af9d9331 100644 --- a/od-win32/hardfile_win32.cpp +++ b/od-win32/hardfile_win32.cpp @@ -821,10 +821,25 @@ static int hdf_write_2 (struct hardfiledata *hfd, void *buffer, uae_u64 offset, hdf_seek (hfd, offset); poscheck (hfd, len); memcpy (hfd->cache, buffer, len); - if (hfd->handle_valid == HDF_HANDLE_WIN32) + if (hfd->handle_valid == HDF_HANDLE_WIN32) { WriteFile (hfd->handle->h, hfd->cache, len, &outlen, NULL); - else if (hfd->handle_valid == HDF_HANDLE_ZFILE) + if (offset == 0) { + DWORD outlen2; + uae_u8 *tmp; + int tmplen = 512; + tmp = (uae_u8*)VirtualAlloc (NULL, tmplen, MEM_COMMIT, PAGE_READWRITE); + if (tmp) { + memset (tmp, 0xa1, tmplen); + hdf_seek (hfd, offset); + ReadFile (hfd->handle->h, tmp, tmplen, &outlen2, NULL); + if (memcmp (hfd->cache, tmp, tmplen) != 0 || outlen != len) + gui_message (L"Harddrive\n%s\nblock zero write failed!", hfd->device_name); + VirtualFree (tmp, 0, MEM_RELEASE); + } + } + } else if (hfd->handle_valid == HDF_HANDLE_ZFILE) { outlen = zfile_fwrite (hfd->cache, 1, len, hfd->handle->zf); + } return outlen; } int hdf_write_target (struct hardfiledata *hfd, void *buffer, uae_u64 offset, int len) diff --git a/od-win32/picasso96_win.cpp b/od-win32/picasso96_win.cpp index 90c05fed..67df02eb 100644 --- a/od-win32/picasso96_win.cpp +++ b/od-win32/picasso96_win.cpp @@ -2429,7 +2429,7 @@ static uae_u32 REGPARAM2 picasso_SetPanning (TrapContext *ctx) picasso_SetPanningInit(); if (rgbf != picasso96_state.RGBFormat) - gfx_set_picasso_colors (picasso96_state.RGBFormat); + setconvert (); full_refresh = 1; set_panning_called = 1; @@ -3882,8 +3882,6 @@ static int flushpixels (void) if (dst == NULL) { dst = gfx_lock_picasso (); lock = 1; - } else { - dst = picasso96_state.HostAddress; } if (dst) { statusline (dst); diff --git a/od-win32/serial_win32.cpp b/od-win32/serial_win32.cpp index c8a5faff..712f7ed2 100644 --- a/od-win32/serial_win32.cpp +++ b/od-win32/serial_win32.cpp @@ -23,6 +23,7 @@ #include "newcpu.h" #include "cia.h" #include "serial.h" +#include "enforcer.h" #include "od-win32/parser.h" @@ -98,10 +99,11 @@ void SERPER (uae_u16 w) #endif } -static uae_char dochar (int v) +static TCHAR dochar (int v) { v &= 0xff; - if (v >= 32 && v < 127) return (char)v; + if (v >= 32 && v < 127) + return v; return '.'; } @@ -277,11 +279,10 @@ void SERDAT (uae_u16 w) console_out_f (L"%c", dochar (w)); if (serper == 372) { - extern int enforcermode; if (enforcermode & 2) { console_out_f (L"%c", dochar (w)); - if (w == 266) - console_out(L"\n"); + if (w == 256 + 10) + console_out (L"\n"); } } diff --git a/od-win32/win32.h b/od-win32/win32.h index 21b0e90e..b05631bf 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -18,8 +18,8 @@ #define WINUAEPUBLICBETA 1 #define LANG_DLL 1 -#define WINUAEBETA L"14" -#define WINUAEDATE MAKEBD(2010, 3, 1) +#define WINUAEBETA L"15" +#define WINUAEDATE MAKEBD(2010, 3, 6) #define WINUAEEXTRA L"" #define WINUAEREV L"" diff --git a/od-win32/win32_scaler.cpp b/od-win32/win32_scaler.cpp index 6ed36eff..921c55aa 100644 --- a/od-win32/win32_scaler.cpp +++ b/od-win32/win32_scaler.cpp @@ -131,11 +131,22 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height float srcratio, dstratio; int aws, ahs, ahs2; int xs, ys; - float xmult, ymult; int v; int extraw, extrah; int fpuv; + int filter_horiz_zoom = currprefs.gfx_filter_horiz_zoom; + int filter_vert_zoom = currprefs.gfx_filter_vert_zoom; + int filter_horiz_zoom_mult = currprefs.gfx_filter_horiz_zoom_mult; + int filter_vert_zoom_mult = currprefs.gfx_filter_vert_zoom_mult; + int filter_horiz_offset = currprefs.gfx_filter_horiz_offset; + int filter_vert_offset = currprefs.gfx_filter_vert_offset; + if (!usedfilter) { + filter_horiz_zoom = filter_vert_zoom = 0; + filter_horiz_zoom_mult = filter_vert_zoom_mult = 1000; + filter_horiz_offset = filter_vert_offset = 0; + } + if (screen_is_picasso) { getrtgfilterrect2 (sr, dr, zr, dst_width, dst_height); return; @@ -148,8 +159,8 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height aws = aw * scale; ahs = ah * scale; - extraw = -aws * currprefs.gfx_filter_horiz_zoom / 2000; - extrah = -ahs * currprefs.gfx_filter_vert_zoom / 2000; + extraw = -aws * filter_horiz_zoom / 2000; + extrah = -ahs * filter_vert_zoom / 2000; SetRect (sr, 0, 0, dst_width, dst_height); SetRect (zr, 0, 0, 0, 0); @@ -162,9 +173,8 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height filteroffsetx = 0; filteroffsety = 0; - - xmult = currprefs.gfx_filter_horiz_zoom_mult; - ymult = currprefs.gfx_filter_vert_zoom_mult; + float xmult = filter_horiz_zoom_mult; + float ymult = filter_vert_zoom_mult; srcratio = 4.0 / 3.0; if (currprefs.gfx_filter_aspect > 0) { @@ -307,7 +317,7 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height } } - if (!currprefs.gfx_filter_horiz_zoom_mult && !currprefs.gfx_filter_vert_zoom_mult) { + if (!filter_horiz_zoom_mult && !filter_vert_zoom_mult) { sizeoffset (dr, zr, extraw, extrah); @@ -349,13 +359,13 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height if (xmult <= 0.01) xmult = aws * 1000 / dst_width; else - xmult = xmult + xmult * currprefs.gfx_filter_horiz_zoom / 2000; + xmult = xmult + xmult * filter_horiz_zoom / 2000; if (ymult <= 0.01) ymult = ahs * 1000 / dst_height; else - ymult = ymult + ymult * currprefs.gfx_filter_vert_zoom / 2000; + ymult = ymult + ymult * filter_vert_zoom / 2000; - if (!currprefs.gfx_filter_horiz_zoom_mult && !currprefs.gfx_filter_vert_zoom_mult) { + if (!filter_horiz_zoom_mult && !filter_vert_zoom_mult) { if (currprefs.ntscmode) { int v = vblscale2 (ahs); ymult /= 1.21; @@ -367,9 +377,9 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height ymult = vblscale (ymult); OffsetRect (dr, 0, (ahs2 - ahs) / 2); - v = currprefs.gfx_filter_horiz_offset; + v = filter_horiz_offset; OffsetRect (zr, (int)(-v * aws / 1000.0), 0); - v = currprefs.gfx_filter_vert_offset; + v = filter_vert_offset; OffsetRect (zr, 0, (int)(-v * ahs / 1000.0)); xs = dst_width - dst_width * xmult / 1000; diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 722c02c7..f5842561 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -802,7 +802,7 @@ void flush_screen (int a, int b) OGL_render (); #endif } else if (currentmode->flags & DM_D3D) { - if (currentmode->flags & DM_SWSCALE) + if ((currentmode->flags & DM_SWSCALE) && usedfilter->type != UAE_FILTER_NULL) S2X_render (); return; #ifdef GFXFILTER @@ -836,7 +836,7 @@ int lockscr (void) ret = 1; if (currentmode->flags & DM_D3D) { #ifdef D3D - if (currentmode->flags & DM_SWSCALE) { + if ((currentmode->flags & DM_SWSCALE) && usedfilter->type != UAE_FILTER_NULL) { ret = 1; } else { ret = 0; @@ -858,7 +858,7 @@ int lockscr (void) void unlockscr (void) { if (currentmode->flags & DM_D3D) { - if (currentmode->flags & DM_SWSCALE) + if ((currentmode->flags & DM_SWSCALE) && usedfilter->type != UAE_FILTER_NULL) return; D3D_unlocktexture (); } else if (currentmode->flags & DM_SWSCALE) { @@ -1523,7 +1523,6 @@ void init_colors (void) } } } - write_log (L"%d %d %d %d %d %d\n", red_bits, green_bits, blue_bits, red_shift, green_shift, blue_shift); alloc_colors64k (red_bits, green_bits, blue_bits, red_shift,green_shift, blue_shift, alpha_bits, alpha_shift, alpha, 0); notice_new_xcolors (); #ifdef GFXFILTER diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 21beef39..205824d6 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -10686,13 +10686,15 @@ static void enable_for_hw3ddlg (HWND hDlg) int vv = FALSE, vv2 = FALSE, vv3 = FALSE, vv4 = FALSE; int as = workprefs.gfx_filter_autoscale; struct uae_filter *uf; - int i; + int i, isfilter; + isfilter = 0; uf = &uaefilters[0]; i = 0; while (uaefilters[i].name) { if (workprefs.gfx_filter == uaefilters[i].type) { uf = &uaefilters[i]; + isfilter = 1; break; } i++; @@ -10705,7 +10707,7 @@ static void enable_for_hw3ddlg (HWND hDlg) vv3 = TRUE; if (v && uf->x[0]) vv4 = TRUE; - if (workprefs.gfx_api) + if (workprefs.gfx_api && isfilter) v = vv = vv2 = vv3 = vv4 = TRUE; ew (hDlg, IDC_FILTERHZ, v); @@ -11212,7 +11214,7 @@ static void filter_handle (HWND hDlg) hw3d_changed = 1; } } - if (workprefs.gfx_filter == 0 && !workprefs.gfx_api) + if (workprefs.gfx_filter == 0) workprefs.gfx_filter_autoscale = 0; } item = SendDlgItemMessage (hDlg, IDC_FILTEROVERLAY, CB_GETCURSEL, 0, 0L); @@ -11320,10 +11322,8 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM item = SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_GETCURSEL, 0, 0L); if (item != CB_ERR) { workprefs.gfx_filter_autoscale = item; - if (workprefs.gfx_filter_autoscale && workprefs.gfx_filter == 0) { - if (!workprefs.gfx_api) - workprefs.gfx_filter = 1; // NULL - } + if (workprefs.gfx_filter_autoscale && workprefs.gfx_filter == 0) + workprefs.gfx_filter = 1; // NULL values_to_hw3ddlg (hDlg); enable_for_hw3ddlg (hDlg); }