From: Toni Wilen Date: Sat, 7 Jun 2014 17:39:25 +0000 (+0300) Subject: 2810b6 X-Git-Tag: 2810~3 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=b52d8d03c644cb516e31e7d1b2f404b7ec8819da;p=francis%2Fwinuae.git 2810b6 --- diff --git a/custom.cpp b/custom.cpp index f3778f43..a24fbc72 100644 --- a/custom.cpp +++ b/custom.cpp @@ -345,7 +345,6 @@ struct copper { int vcmp, hcmp; int strobe; /* COPJMP1 / COPJMP2 accessed */ - int last_write, last_write_hpos; int moveaddr, movedata, movedelay; }; @@ -5978,8 +5977,6 @@ static void update_copper (int until_hpos) if (cop_state.ignore_next) reg = 0x1fe; - cop_state.last_write = reg; - cop_state.last_write_hpos = old_hpos; if (reg == 0x88) { cop_state.strobe = 1; cop_state.state = COP_strobe_delay1; @@ -7774,7 +7771,6 @@ static void hsync_handler_post (bool onvsync) plfstrt_sprite = 0xff; /* See if there's a chance of a copper wait ending this line. */ cop_state.hpos = 0; - cop_state.last_write = 0; compute_spcflag_copper (maxhpos); serial_hsynchandler (); @@ -8021,6 +8017,9 @@ void custom_reset (bool hardreset, bool keyboardreset) memset (&spixstate, 0, sizeof spixstate); cop_state.state = COP_stop; + cop_state.movedelay = 0; + cop_state.strobe = 0; + cop_state.ignore_next = 0; diwstate = DIW_waiting_start; dmal = 0; diff --git a/drawing.cpp b/drawing.cpp index c43fe5a0..77fd02d6 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -746,7 +746,7 @@ static int linetoscr_diw_start, linetoscr_diw_end; static int native_ddf_left, native_ddf_right; static int pixels_offset; -static int src_pixel, ham_src_pixel; +static int src_pixel; /* How many pixels in window coordinates which are to the left of the left border. */ static int unpainted; @@ -874,7 +874,6 @@ static void pfield_init_linetoscr (bool border) #endif unpainted = visible_left_border < playfield_start ? 0 : visible_left_border - playfield_start; - ham_src_pixel = MAX_PIXELS_PER_LINE + res_shift_from_window (playfield_start - native_ddf_left); unpainted = res_shift_from_window (unpainted); int first_x = sprite_first_x; @@ -1666,7 +1665,7 @@ static void init_ham_decoding (void) { int unpainted_amiga = unpainted; - ham_decode_pixel = ham_src_pixel; + ham_decode_pixel = src_pixel; ham_lastcolor = color_reg_get (&colors_for_drawing, 0); if (!bplham) { @@ -1780,8 +1779,12 @@ static void decode_ham (int pix, int stoppos, bool blank) } } -static void decode_ham_border(int pix, int stoppos, bool blank) +static void erase_ham_right_border(int pix, int stoppos, bool blank) { + if (stoppos < playfield_end) + return; + // erase right border in HAM modes or old HAM data may be visible + // if DDFSTOP < DIWSTOP (Uridium II title screen) int todraw_amiga = res_shift_from_window (stoppos - pix); while (todraw_amiga-- > 0) ham_linebuf[ham_decode_pixel++] = 0; @@ -2366,18 +2369,21 @@ static void do_color_changes (line_draw_func worker_border, line_draw_func worke if (lastpos >= endpos) break; } +#if 1 if (vp < visible_top_start || vp >= visible_bottom_stop) { // outside of visible area // Just overwrite with black. Above code needs to run because of custom registers, // not worth the trouble for separate code path just for max 10 lines or so (*worker_border) (visible_left_border, visible_left_border + gfxvidinfo.drawbuffer.inwidth, true); } - +#endif } -STATIC_INLINE bool have_color_changes(struct draw_info *di) +STATIC_INLINE bool is_color_changes(struct draw_info *di) { - return (di->nr_color_changes == 0 || (di->nr_color_changes == 1 && curr_color_changes[di->first_color_change].regno == -1)); + int regno = curr_color_changes[di->first_color_change].regno; + int changes = di->nr_color_changes; + return changes > 1 || (changes == 1 && regno != 0xffff && regno != -1); } enum double_how { @@ -2391,6 +2397,7 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in static int warned = 0; int border = 0; int do_double = 0; + bool have_color_changes; enum double_how dh; dp_for_drawing = line_decisions + lineno; @@ -2443,10 +2450,12 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in break; } + have_color_changes = is_color_changes(dip_for_drawing); + dh = dh_line; xlinebuffer = gfxvidinfo.drawbuffer.linemem; if (xlinebuffer == 0 && do_double - && (border == 0 || dip_for_drawing->nr_color_changes > 0)) + && (border == 0 || have_color_changes)) xlinebuffer = gfxvidinfo.drawbuffer.emergmem, dh = dh_emerg; if (xlinebuffer == 0) xlinebuffer = row_map[gfx_ypos], dh = dh_buf; @@ -2460,22 +2469,18 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in adjust_drawing_colors (dp_for_drawing->ctable, dp_for_drawing->ham_seen || bplehb || ecsshres); - /* The problem is that we must call decode_ham() BEFORE we do the - sprites. */ + /* The problem is that we must call decode_ham() BEFORE we do the sprites. */ if (dp_for_drawing->ham_seen) { + int ohposblank = hposblank; init_ham_decoding (); - if (!have_color_changes(dip_for_drawing)) { - /* The easy case: need to do HAM decoding only once for the - * full line. */ - decode_ham (visible_left_border, visible_right_border, false); - } else /* Argh. */ { - int ohposblank = hposblank; - do_color_changes (decode_ham_border, decode_ham, lineno); - hposblank = ohposblank; - // reset colors to state before above do_color_changes() - adjust_drawing_colors (dp_for_drawing->ctable, (dp_for_drawing->ham_seen || bplehb) ? -1 : 0); + do_color_changes (dummy_worker, decode_ham, lineno); + if (have_color_changes) { + // do_color_changes() did color changes, reset colors back to original state + adjust_drawing_colors (dp_for_drawing->ctable, -1); pfield_expand_dp_bplcon (); } + hposblank = ohposblank; + ham_decode_pixel = src_pixel; bplham = dp_for_drawing->ham_at_start; } @@ -2533,7 +2538,7 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in } #endif - if (!dosprites && have_color_changes(dip_for_drawing)) { + if (!dosprites && !have_color_changes) { if (dp_for_drawing->plfleft < -1) { // blanked border line int tmp = hposblank; @@ -2544,6 +2549,7 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in // normal border line fill_line_border (); } + do_flush_line (vb, gfx_ypos); if (do_double) { if (dh == dh_buf) { @@ -2577,7 +2583,6 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in if (dh == dh_emerg) memcpy (row_map[gfx_ypos], xlinebuffer + linetoscr_x_adjust_bytes, gfxvidinfo.drawbuffer.pixbytes * gfxvidinfo.drawbuffer.inwidth); - do_flush_line (vb, gfx_ypos); if (do_double) { if (dh == dh_emerg) diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index fa5c7d77..58e39ebf 100644 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -392,6 +392,8 @@ #define IDS_SLIRP_INBOUND 399 #define IDS_FILTER_PAL_EXTRA 400 #define IDS_FILTER_3D_EXTRA 401 +#define IDS_ALWAYS_ON 402 +#define IDS_DISPLAY_ATTRIBUTES 403 #define IDS_QS_MODELS 1000 #define IDS_QS_MODEL_A500 1001 #define IDS_QS_MODEL_A500P 1002 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 12ece70f..a3efc44b 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -1912,6 +1912,8 @@ STRINGTABLE BEGIN IDS_FILTER_PAL_EXTRA "Brightness\nContrast\nSaturation\nGamma\nScanlines\nBlurriness\nNoise\n" IDS_FILTER_3D_EXTRA "Point/Bilinear\nScanline opacity\nScanline level\n" + IDS_ALWAYS_ON "Always on" + IDS_DISPLAY_ATTRIBUTES "Brightness\nContrast\nGamma" END #endif // English resources diff --git a/od-win32/win32.h b/od-win32/win32.h index 71d0e320..5d6c0d4a 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -20,11 +20,11 @@ #define LANG_DLL_FULL_VERSION_MATCH 0 #if WINUAEPUBLICBETA -#define WINUAEBETA _T("5") +#define WINUAEBETA _T("6") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2014, 6, 3) +#define WINUAEDATE MAKEBD(2014, 6, 7) #define WINUAEEXTRA _T("") //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 09f31509..b3478055 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -1752,22 +1752,27 @@ int check_prefs_changed_gfx (void) for (int j = 0; j < 2; j++) { struct gfx_filterdata *gf = &currprefs.gf[j]; struct gfx_filterdata *gfc = &changed_prefs.gf[j]; + + c |= gf->gfx_filter != gfc->gfx_filter ? (2|8) : 0; + for (int i = 0; i <= 2 * MAX_FILTERSHADERS; i++) { c |= _tcscmp (gf->gfx_filtershader[i], gfc->gfx_filtershader[i]) ? (2|8) : 0; c |= _tcscmp (gf->gfx_filtermask[i], gfc->gfx_filtermask[i]) ? (2|8) : 0; } - - c |= gf->gfx_filter != gfc->gfx_filter ? (2|8) : 0; c |= _tcscmp (gf->gfx_filteroverlay, gfc->gfx_filteroverlay) ? (2|8) : 0; - c |= gf->gfx_filter_filtermode != gfc->gfx_filter_filtermode ? (2|8) : 0; - c |= gf->gfx_filter_bilinear != gfc->gfx_filter_bilinear ? (2|8) : 0; + + c |= gf->gfx_filter_scanlines != gfc->gfx_filter_scanlines ? (1|8) : 0; + c |= gf->gfx_filter_scanlinelevel != gfc->gfx_filter_scanlinelevel ? (1|8) : 0; + c |= gf->gfx_filter_scanlineratio != gfc->gfx_filter_scanlineratio ? (1|8) : 0; + c |= gf->gfx_filter_horiz_zoom_mult != gfc->gfx_filter_horiz_zoom_mult ? (1) : 0; c |= gf->gfx_filter_vert_zoom_mult != gfc->gfx_filter_vert_zoom_mult ? (1) : 0; + + c |= gf->gfx_filter_filtermode != gfc->gfx_filter_filtermode ? (2|8) : 0; + c |= gf->gfx_filter_bilinear != gfc->gfx_filter_bilinear ? (2|8) : 0; c |= gf->gfx_filter_noise != gfc->gfx_filter_noise ? (1) : 0; c |= gf->gfx_filter_blur != gfc->gfx_filter_blur ? (1) : 0; - c |= gf->gfx_filter_scanlines != gfc->gfx_filter_scanlines ? (1|8) : 0; - c |= gf->gfx_filter_scanlinelevel != gfc->gfx_filter_scanlinelevel ? (1|8) : 0; - c |= gf->gfx_filter_scanlineratio != gfc->gfx_filter_scanlineratio ? (1|8) : 0; + c |= gf->gfx_filter_aspect != gfc->gfx_filter_aspect ? (1) : 0; c |= gf->gfx_filter_keep_aspect != gfc->gfx_filter_keep_aspect ? (1) : 0; c |= gf->gfx_filter_keep_autoscale_aspect != gfc->gfx_filter_keep_autoscale_aspect ? (1) : 0; @@ -1853,30 +1858,7 @@ int check_prefs_changed_gfx (void) for (int j = 0; j < 2; j++) { struct gfx_filterdata *gf = &currprefs.gf[j]; struct gfx_filterdata *gfc = &changed_prefs.gf[j]; - for (int i = 0; i <= 2 * MAX_FILTERSHADERS; i++) { - _tcscpy (gf->gfx_filtershader[i], gfc->gfx_filtershader[i]); - _tcscpy (gf->gfx_filtermask[i], gfc->gfx_filtermask[i]); - } - gf->gfx_filter = gfc->gfx_filter; - gf->gfx_filter_scanlines = gfc->gfx_filter_scanlines; - gf->gfx_filter_scanlinelevel = gfc->gfx_filter_scanlinelevel; - gf->gfx_filter_scanlineratio = gfc->gfx_filter_scanlineratio; - _tcscpy (gf->gfx_filteroverlay, gfc->gfx_filteroverlay); - gf->gfx_filter_filtermode = gfc->gfx_filter_filtermode; - gf->gfx_filter_bilinear = gfc->gfx_filter_bilinear; - gf->gfx_filter_horiz_zoom_mult = gfc->gfx_filter_horiz_zoom_mult; - gf->gfx_filter_vert_zoom_mult = gfc->gfx_filter_vert_zoom_mult; - gf->gfx_filter_noise = gfc->gfx_filter_noise; - gf->gfx_filter_blur = gfc->gfx_filter_blur; - gf->gfx_filter_aspect = gfc->gfx_filter_aspect; - gf->gfx_filter_keep_aspect = gfc->gfx_filter_keep_aspect; - gf->gfx_filter_keep_autoscale_aspect = gfc->gfx_filter_keep_autoscale_aspect; - gf->gfx_filter_luminance = gfc->gfx_filter_luminance; - gf->gfx_filter_contrast = gfc->gfx_filter_contrast; - gf->gfx_filter_saturation = gfc->gfx_filter_saturation; - gf->gfx_filter_gamma = gfc->gfx_filter_gamma; - gf->gfx_filter_autoscale = gfc->gfx_filter_autoscale; - //gf->gfx_filter_ = gfc->gfx_filter_; + memcpy(gf, gfc, sizeof(struct gfx_filterdata)); } currprefs.rtg_horiz_zoom_mult = changed_prefs.rtg_horiz_zoom_mult; diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index d9aad4cf..c649a23d 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -6169,10 +6169,21 @@ static void handle_da (HWND hDlg) void init_da (HWND hDlg) { int *p; + TCHAR tmp[MAX_DPATH], *p1, *p2; + + WIN32GUI_LoadUIString(IDS_DISPLAY_ATTRIBUTES, tmp, sizeof tmp / sizeof (TCHAR)); SendDlgItemMessage(hDlg, IDC_DA_MODE, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage(hDlg, IDC_DA_MODE, CB_ADDSTRING, 0, (LPARAM)_T("Brightness")); - SendDlgItemMessage(hDlg, IDC_DA_MODE, CB_ADDSTRING, 0, (LPARAM)_T("Contrast")); - SendDlgItemMessage(hDlg, IDC_DA_MODE, CB_ADDSTRING, 0, (LPARAM)_T("Gamma")); + _tcscat (tmp, _T("\n")); + p1 = tmp; + for (;;) { + p2 = _tcschr (p1, '\n'); + if (p2 && _tcslen (p2) > 0) { + *p2++ = 0; + SendDlgItemMessage (hDlg, IDC_DA_MODE, CB_ADDSTRING, 0, (LPARAM)p1); + p1 = p2; + } else + break; + } if (da_mode_selected == CB_ERR) da_mode_selected = 0; SendDlgItemMessage (hDlg, IDC_DA_MODE, CB_SETCURSEL, da_mode_selected, 0); @@ -6432,8 +6443,12 @@ static void values_to_displaydlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_LORES, CB_SETCURSEL, workprefs.gfx_resolution, 0); SendDlgItemMessage(hDlg, IDC_AUTORESOLUTIONSELECT, CB_RESETCONTENT, 0, 0); - SendDlgItemMessage(hDlg, IDC_AUTORESOLUTIONSELECT, CB_ADDSTRING, 0, (LPARAM)_T("Disabled")); - SendDlgItemMessage(hDlg, IDC_AUTORESOLUTIONSELECT, CB_ADDSTRING, 0, (LPARAM)_T("Always on")); + + + WIN32GUI_LoadUIString(IDS_DISABLED, buffer, sizeof buffer / sizeof (TCHAR)); + SendDlgItemMessage(hDlg, IDC_AUTORESOLUTIONSELECT, CB_ADDSTRING, 0, (LPARAM)buffer); + WIN32GUI_LoadUIString(IDS_ALWAYS_ON, buffer, sizeof buffer / sizeof (TCHAR)); + SendDlgItemMessage(hDlg, IDC_AUTORESOLUTIONSELECT, CB_ADDSTRING, 0, (LPARAM)buffer); SendDlgItemMessage(hDlg, IDC_AUTORESOLUTIONSELECT, CB_ADDSTRING, 0, (LPARAM)_T("10%")); SendDlgItemMessage(hDlg, IDC_AUTORESOLUTIONSELECT, CB_ADDSTRING, 0, (LPARAM)_T("33%")); SendDlgItemMessage(hDlg, IDC_AUTORESOLUTIONSELECT, CB_ADDSTRING, 0, (LPARAM)_T("66%")); diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 18a5113d..4d7adbd1 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -18,6 +18,15 @@ Things that may happen in 2015: - restore only single input target to default. +Beta 6: + +- b2 HAM update was incomplete and broken, nr_color_changes check was not fully working. (b2) +- Display panel missing translations added (autoresolution and brightness/contrast/gamma) +- Some file operations (zipped files, possibly something else too) didn't support recently introduced + relative "..\" path part update. +- Copper emulation state was not fully reset when restoring state file, in some situations copper + may have modified restored custom register in next cycle after state was restored. + Beta 5: - Relative path improvement broke CDFS CD mounting in some configurations. diff --git a/zfile.cpp b/zfile.cpp index 8514957a..3230da74 100644 --- a/zfile.cpp +++ b/zfile.cpp @@ -1630,7 +1630,7 @@ static struct zfile *openzip (const TCHAR *pname) _tcscpy (name, pname); i = _tcslen (name) - 2; while (i > 0) { - if (name[i] == '/' || name[i] == '\\' && i > 4) { + if ((name[i] == '/' || name[i] == '\\') && i > 4) { v = name[i]; name[i] = 0; for (j = 0; plugins_7z[j]; j++) { @@ -2592,7 +2592,7 @@ static struct zvolume *zvolume_alloc_2 (const TCHAR *name, struct zfile *z, unsi root->volume = zv; root->type = ZNODE_DIR; i = 0; - if (name[0] != '/' && name[0] != '\\' && _tcsncmp (name, _T(".\\"), 2) != 0) { + if (name[0] != '/' && name[0] != '\\' && _tcsncmp(name, _T(".\\"), 2) != 0 && _tcsncmp(name, _T("..\\"), 3) != 0) { if (_tcschr (name, ':') == 0) { for (i = _tcslen (name) - 1; i > 0; i--) { if (name[i] == FSDB_DIR_SEPARATOR) {