From: Toni Wilen Date: Wed, 20 Nov 2013 18:36:35 +0000 (+0200) Subject: 2700b14 X-Git-Tag: 2700~3 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=0355179c4278e9329d7a971fc8485ba9a1d31c79;p=francis%2Fwinuae.git 2700b14 --- diff --git a/blitter.cpp b/blitter.cpp index 02f53e71..4b488700 100644 --- a/blitter.cpp +++ b/blitter.cpp @@ -336,14 +336,15 @@ STATIC_INLINE int canblit (int hpos) return 1; } -// blitter interrupt is set when last "main" cycle -// has been finished, any non-linedraw D-channel blit -// still needs 2 more cycles before final D is written +// blitter interrupt is set (and busy bit cleared) when +// last "main" cycle has been finished, any non-linedraw +// D-channel blit still needs 2 more cycles before final +// D is written static void blitter_interrupt (int hpos, int done) { if (blit_interrupt) return; - if (!done && (!currprefs.blitter_cycle_exact || currprefs.cpu_model >= 68020)) + if (!done && (!currprefs.blitter_cycle_exact || currprefs.cpu_model >= 68030)) return; blit_interrupt = 1; send_interrupt (6, 3 * CYCLE_UNIT); diff --git a/cfgfile.cpp b/cfgfile.cpp index 7ab3a406..9697bdc5 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -1392,6 +1392,8 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) if (p->filesys_no_uaefsdb) cfgfile_write_bool (f, _T("filesys_no_fsdb"), p->filesys_no_uaefsdb); cfgfile_dwrite (f, _T("filesys_max_size"), _T("%d"), p->filesys_limit); + cfgfile_dwrite (f, _T("filesys_max_name_length"), _T("%d"), p->filesys_max_name); + cfgfile_dwrite (f, _T("filesys_max_file_size"), _T("%d"), p->filesys_max_file_size); #endif write_inputdevice_config (p, f); } @@ -1850,6 +1852,8 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) || cfgfile_intval (option, value, _T("gfx_horizontal_tweak"), &p->gfx_extrawidth, 1) || cfgfile_string (option, value, _T("gfx_filter_mask"), p->gfx_filtermask[2 * MAX_FILTERSHADERS], sizeof p->gfx_filtermask[2 * MAX_FILTERSHADERS] / sizeof (TCHAR)) || cfgfile_intval (option, value, _T("filesys_max_size"), &p->filesys_limit, 1) + || cfgfile_intval (option, value, _T("filesys_max_name_length"), &p->filesys_max_name, 1) + || cfgfile_intval (option, value, _T("filesys_max_file_size"), &p->filesys_max_file_size, 1) || cfgfile_floatval (option, value, _T("rtg_vert_zoom_multf"), &p->rtg_vert_zoom_mult) || cfgfile_floatval (option, value, _T("rtg_horiz_zoom_multf"), &p->rtg_horiz_zoom_mult) @@ -5034,6 +5038,8 @@ void default_prefs (struct uae_prefs *p, int type) p->genlock = 0; p->ntscmode = 0; p->filesys_limit = 0; + p->filesys_max_name = 107; + p->filesys_max_file_size = 0x7fffffff; p->fastmem_size = 0x00000000; p->fastmem2_size = 0x00000000; diff --git a/custom.cpp b/custom.cpp index 483c2419..4ee14c2e 100644 --- a/custom.cpp +++ b/custom.cpp @@ -166,7 +166,7 @@ static int lof_togglecnt_lace, lof_togglecnt_nlace; //, nlace_cnt; */ static int vpos_previous, hpos_previous; static int vpos_lpen, hpos_lpen, lightpen_triggered; -int lightpen_x = -1, lightpen_y = -1, lightpen_cx, lightpen_cy, lightpen_active; +int lightpen_x = -1, lightpen_y = -1, lightpen_cx, lightpen_cy, lightpen_active, lightpen_enabled; static uae_u32 sprtaba[256],sprtabb[256]; static uae_u32 sprite_ab_merge[256]; @@ -200,7 +200,7 @@ static int maxvpos_total = 511; int minfirstline = VBLANK_ENDLINE_PAL; static int equ_vblank_endline = EQU_ENDLINE_PAL; static bool equ_vblank_toggle = true; -double vblank_hz = VBLANK_HZ_PAL, fake_vblank_hz, vblank_hz_stored; +double vblank_hz = VBLANK_HZ_PAL, fake_vblank_hz, vblank_hz_stored, vblank_hz_nom; static float vblank_hz_lof, vblank_hz_shf, vblank_hz_lace; static int vblank_hz_mult, vblank_hz_state; static struct chipset_refresh *stored_chipset_refresh; @@ -1023,7 +1023,7 @@ static void compute_toscr_delay (int hpos, int bplcon1) static int bpldmasetuphpos; static int bpldmasetupphase; -static void update_toscr_planes (void); +static void update_toscr_planes (int fm); /* set currently active Agnus bitplane DMA sequence */ static void setup_fmodes (int hpos) { @@ -1136,22 +1136,26 @@ STATIC_INLINE void clear_fetchbuffer (uae_u32 *ptr, int nwords) memset (ptr, 0, nwords * 4); } -static void update_toscr_planes (void) +static void update_toscr_planes (int fm) { // This must be called just before new bitplane block starts, // not when depth value changes. Depth can change early and can leave // 16+ pixel horizontal line of old data visible. if (toscr_nr_planes_agnus > thisline_decision.nr_planes) { - int j; - for (j = thisline_decision.nr_planes; j < toscr_nr_planes_agnus; j++) { - clear_fetchbuffer ((uae_u32 *)(line_data[next_lineno] + 2 * MAX_WORDS_PER_LINE * j), out_offs); - if (thisline_decision.plfleft >= 0) { - todisplay[j][0] = 0; + if (out_offs) { + int j; + for (j = thisline_decision.nr_planes; j < toscr_nr_planes_agnus; j++) { + clear_fetchbuffer ((uae_u32 *)(line_data[next_lineno] + 2 * MAX_WORDS_PER_LINE * j), out_offs); + if (thisline_decision.plfleft >= 0) { + todisplay[j][0] = 0; #ifdef AGA - todisplay[j][1] = 0; - todisplay[j][2] = 0; - todisplay[j][3] = 0; + if (fm) { + todisplay[j][1] = 0; + todisplay[j][2] = 0; + todisplay[j][3] = 0; + } #endif + } } } thisline_decision.nr_planes = toscr_nr_planes_agnus; @@ -1486,7 +1490,7 @@ STATIC_INLINE void beginning_of_plane_block (int hpos, int fm) #endif update_denise (hpos); - update_toscr_planes (); + update_toscr_planes (fm); maybe_first_bpl1dat (hpos); bplcon1t2 = bplcon1t; @@ -1908,7 +1912,7 @@ static void update_fetch_x (int until, int fm) return; pos = last_fetch_hpos; - update_toscr_planes (); + update_toscr_planes (fm); // not optimized, update_fetch_x() is extremely rarely used. for (; pos < until; pos++) { @@ -3059,7 +3063,7 @@ void compute_vsynctime (void) vblank_hz = currprefs.chipset_refreshrate; if (isvsync_chipset ()) { int mult = 0; - if (!fake_vblank_hz && getvsyncrate (vblank_hz, &mult) != vblank_hz) { + if (getvsyncrate (vblank_hz, &mult) != vblank_hz) { vblank_hz = getvsyncrate (vblank_hz, &vblank_hz_mult); if (vblank_hz_mult > 0) vblank_hz_state = 0; @@ -3077,8 +3081,21 @@ void compute_vsynctime (void) updatedisplayarea (); } #endif - if (currprefs.produce_sound > 1) - update_sound (fake_vblank_hz); + if (currprefs.produce_sound > 1) { + double svpos = maxvpos; + double shpos = maxhpos_short; + if (islinetoggle ()) { + shpos += 0.5; + } + if (interlace_seen) { + svpos += 0.5; + } else if (lof_current) { + svpos += 1.0; + } + double clk = svpos * shpos * fake_vblank_hz; + write_log (_T("SNDRATE %.1f*%.1f*%.6f=%.6f\n"), svpos, shpos, fake_vblank_hz, clk); + update_sound (clk); + } } @@ -3351,7 +3368,7 @@ void init_hz (bool fullinit) maxvpos = MAXVPOS_PAL; maxhpos = MAXHPOS_PAL; minfirstline = VBLANK_ENDLINE_PAL; - vblank_hz = VBLANK_HZ_PAL; + vblank_hz_nom = vblank_hz = VBLANK_HZ_PAL; sprite_vblank_endline = VBLANK_SPRITE_PAL; equ_vblank_endline = EQU_ENDLINE_PAL; equ_vblank_toggle = true; @@ -3362,13 +3379,13 @@ void init_hz (bool fullinit) maxvpos = MAXVPOS_NTSC; maxhpos = MAXHPOS_NTSC; minfirstline = VBLANK_ENDLINE_NTSC; - vblank_hz = VBLANK_HZ_NTSC; + vblank_hz_nom = vblank_hz = VBLANK_HZ_NTSC; sprite_vblank_endline = VBLANK_SPRITE_NTSC; equ_vblank_endline = EQU_ENDLINE_NTSC; equ_vblank_toggle = false; - vblank_hz_shf = (double)clk / ((maxvpos + 0) * maxhpos); - vblank_hz_lof = (double)clk / ((maxvpos + 1) * maxhpos); - vblank_hz_lace = (double)clk / ((maxvpos + 0.5) * maxhpos); + vblank_hz_shf = (double)clk / ((maxvpos + 0) * (maxhpos + 0.5)); + vblank_hz_lof = (double)clk / ((maxvpos + 1) * (maxhpos + 0.5)); + vblank_hz_lace = (double)clk / ((maxvpos + 0.5) * (maxhpos + 0.5)); } maxvpos_nom = maxvpos; @@ -3379,7 +3396,7 @@ void init_hz (bool fullinit) if (vpos_count < 10) vpos_count = 10; vblank_hz = (isntsc ? 15734 : 15625.0) / vpos_count; - vblank_hz_shf = vblank_hz_lof = vblank_hz_lace = vblank_hz; + vblank_hz_nom = vblank_hz_shf = vblank_hz_lof = vblank_hz_lace = vblank_hz; maxvpos_nom = vpos_count - (lof_current ? 1 : 0); if ((maxvpos_nom >= 256 && maxvpos_nom <= 313) || (beamcon0 & 0x80)) { maxvpos_display = maxvpos_nom; @@ -3398,7 +3415,7 @@ void init_hz (bool fullinit) if (htotal >= MAXHPOS) htotal = MAXHPOS - 1; maxhpos = htotal + 1; - vblank_hz = 227.0 * 312.0 * 50.0 / (maxvpos * maxhpos); + vblank_hz_nom = vblank_hz = 227.0 * 312.0 * 50.0 / (maxvpos * maxhpos); vblank_hz_shf = vblank_hz; vblank_hz_lof = 227.0 * 313.0 * 50.0 / (maxvpos * maxhpos);; vblank_hz_lace = 227.0 * 312.5 * 50.0 / (maxvpos * maxhpos);; @@ -3684,7 +3701,7 @@ static uae_u16 VPOSR (void) if (!(currprefs.chipset_mask & CSMASK_ECS_AGNUS)) vp &= 1; - vp = vp | (lof_store ? 0x8000 : 0) | csbit; + vp |= (lof_store ? 0x8000 : 0) | csbit; if (currprefs.chipset_mask & CSMASK_ECS_AGNUS) vp |= lol ? 0x80 : 0; hsyncdelay (); @@ -6262,6 +6279,11 @@ static void vsync_handler_post (void) if (lof_togglecnt_lace >= LOF_TOGGLES_NEEDED) lof_togglecnt_nlace = 0; } else { + // only 1-2 vblanks with bplcon0 lace bit set? + // lets check if lof has changed + if (!(bplcon0 & 4) && lof_togglecnt_lace > 0 && lof_togglecnt_lace < LOF_TOGGLES_NEEDED && !interlace_seen) { + lof_changed = 1; + } lof_togglecnt_nlace = LOF_TOGGLES_NEEDED; lof_togglecnt_lace = 0; #if 0 @@ -6579,7 +6601,7 @@ static void hsync_handler_pre (bool onvsync) lightpen_triggered = 0; sprite_0 = 0; } - if (lightpen_cx > 0 && (bplcon0 & 8) && !lightpen_triggered && lightpen_cy == vpos) { + if (lightpen_enabled && lightpen_cx > 0 && (bplcon0 & 8) && !lightpen_triggered && lightpen_cy == vpos) { vpos_lpen = vpos; hpos_lpen = lightpen_cx; lightpen_triggered = 1; diff --git a/drawing.cpp b/drawing.cpp index aa1859c5..ae3c8442 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -2357,18 +2357,12 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in 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 > 0) { + if (do_double) { if (dh == dh_emerg) memcpy (row_map[follow_ypos], xlinebuffer + linetoscr_x_adjust_bytes, gfxvidinfo.drawbuffer.pixbytes * gfxvidinfo.drawbuffer.inwidth); else if (dh == dh_buf) memcpy (row_map[follow_ypos], row_map[gfx_ypos], gfxvidinfo.drawbuffer.pixbytes * gfxvidinfo.drawbuffer.inwidth); do_flush_line (vb, follow_ypos); - } else if (do_double < 0) { - if (dh == dh_emerg) - memset (row_map[follow_ypos], 0, gfxvidinfo.drawbuffer.pixbytes * gfxvidinfo.drawbuffer.inwidth); - else if (dh == dh_buf) - memset (row_map[follow_ypos], 0, gfxvidinfo.drawbuffer.pixbytes * gfxvidinfo.drawbuffer.inwidth); - do_flush_line (vb, follow_ypos); } if (dip_for_drawing->nr_sprites) @@ -3141,12 +3135,24 @@ void hsync_record_line_state (int lineno, enum nln_how how, int changed) state[1] = LINE_DECIDED; //LINE_BLACK; break; case nln_lower_black: - state[1] = currprefs.gfx_scanlines >= 4 ? LINE_BLACK : LINE_DONE; - *state = LINE_DECIDED; + if (currprefs.gfx_scanlines >= 4) { + state[1] = LINE_BLACK; + *state = LINE_DECIDED; + } else { + changed += state[0] != LINE_DONE; + state[1] = LINE_DONE; + *state = changed ? LINE_DECIDED : LINE_DONE; + } break; case nln_upper_black: - *state = LINE_DECIDED; - state[-1] = currprefs.gfx_scanlines >= 4 ? LINE_BLACK : LINE_DONE; + if (currprefs.gfx_scanlines >= 4) { + *state = LINE_DECIDED; + state[1] = LINE_BLACK; + } else { + changed += state[0] != LINE_DONE; + *state = changed ? LINE_DECIDED : LINE_DONE; + state[-1] = LINE_DONE; + } break; } } diff --git a/filesys.cpp b/filesys.cpp index 5f06a411..6d5a529d 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -3669,8 +3669,10 @@ static void TRACE((_T("name=\"%s\"\n"), xs)); x2 = x = ua_fs (xs, -1); n = strlen (x); - if (n > 106) - n = 106; + if (n > 107) + n = 107; + if (n > abs (currprefs.filesys_max_name)) + n = abs (currprefs.filesys_max_name); i = 8; put_byte (info + i, n); i++; while (n--) @@ -4057,6 +4059,11 @@ end: return ret; } +static bool filesys_name_invalid (const TCHAR *fn) +{ + return _tcslen (fn) > currprefs.filesys_max_name; +} + static int action_examine_all_do (Unit *unit, uaecptr lock, ExAllKey *eak, uaecptr exalldata, uae_u32 exalldatasize, uae_u32 type, uaecptr control) { a_inode *aino, *base = NULL; @@ -4082,7 +4089,7 @@ static int action_examine_all_do (Unit *unit, uaecptr lock, ExAllKey *eak, uaecp ok = isofs_readdir (d->isod, fn, &uniq); else ok = 0; - } while (ok && d->fstype == FS_DIRECTORY && fsdb_name_invalid_dir (fn)); + } while (ok && d->fstype == FS_DIRECTORY && (filesys_name_invalid (fn) || fsdb_name_invalid_dir (fn))); if (!ok) return 0; } else { @@ -4355,7 +4362,7 @@ static void populate_directory (Unit *unit, a_inode *base) ok = isofs_readdir (d->isod, fn, &uniq); else ok = 0; - } while (ok && d->fstype == FS_DIRECTORY && fsdb_name_invalid_dir (fn)); + } while (ok && d->fstype == FS_DIRECTORY && (filesys_name_invalid (fn) || fsdb_name_invalid_dir (fn))); if (!ok) break; /* This calls init_child_aino, which will notice that the parent is diff --git a/fpp.cpp b/fpp.cpp index a8e6c392..911d41bd 100644 --- a/fpp.cpp +++ b/fpp.cpp @@ -233,7 +233,7 @@ static void fpu_op_unimp (uae_u16 opcode, uae_u32 ea, uaecptr oldpc, int type) } } else if (currprefs.cpu_model == 68040) { regs.fpiar = oldpc; - if (type == FPU_EXP_UNIMP_INS) { + if (type == FPU_EXP_UNIMP_INS || type == FPU_EXP_DISABLED) { // PC = next instruction oldpc = newpc; m68k_areg (regs, 7) -= 4; diff --git a/gencpu.cpp b/gencpu.cpp index a81e38c3..7bedc5dd 100644 --- a/gencpu.cpp +++ b/gencpu.cpp @@ -4620,13 +4620,15 @@ static void gen_opcode (unsigned long int opcode) genamode (curi, curi->smode, "srcreg", curi->size, "extra", 1, 0, 0); genamode (curi, curi->dmode, "dstreg", curi->size, "dst", 1, 0, 0); sync_m68k_pc (); - printf ("\tm68k_divl(opcode, dst, extra);\n"); + printf ("\tif (!m68k_divl(opcode, dst, extra)) goto %s;\n", endlabelstr); + need_endlabel = 1; break; case i_MULL: genamode (curi, curi->smode, "srcreg", curi->size, "extra", 1, 0, 0); genamode (curi, curi->dmode, "dstreg", curi->size, "dst", 1, 0, 0); sync_m68k_pc (); - printf ("\tm68k_mull(opcode, dst, extra);\n"); + printf ("\tif (!m68k_mull(opcode, dst, extra)) goto %s;\n", endlabelstr); + need_endlabel = 1; break; case i_BFTST: case i_BFEXTU: diff --git a/include/audio.h b/include/audio.h index 0429b290..5ce063b7 100644 --- a/include/audio.h +++ b/include/audio.h @@ -32,7 +32,7 @@ extern void update_audio (void); extern void audio_evhandler (void); extern void audio_hsync (void); extern void audio_update_adkmasks (void); -extern void update_sound (double freq); +extern void update_sound (double clk); extern void led_filter_audio (void); extern void set_audio (void); extern int audio_activate (void); diff --git a/include/custom.h b/include/custom.h index 21dd8c24..b6ee501c 100644 --- a/include/custom.h +++ b/include/custom.h @@ -216,7 +216,7 @@ STATIC_INLINE int GET_PLANES(uae_u16 bplcon0) extern void fpscounter_reset (void); extern unsigned long idletime; -extern int lightpen_x, lightpen_y, lightpen_cx, lightpen_cy, lightpen_active; +extern int lightpen_x, lightpen_y, lightpen_cx, lightpen_cy, lightpen_active, lightpen_enabled; struct customhack { uae_u16 v; diff --git a/include/newcpu.h b/include/newcpu.h index f410e502..b0ff1136 100644 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -411,8 +411,8 @@ extern void doint (void); extern void dump_counts (void); extern int m68k_move2c (int, uae_u32 *); extern int m68k_movec2 (int, uae_u32 *); -extern void m68k_divl (uae_u32, uae_u32, uae_u16); -extern void m68k_mull (uae_u32, uae_u32, uae_u16); +extern bool m68k_divl (uae_u32, uae_u32, uae_u16); +extern bool m68k_mull (uae_u32, uae_u32, uae_u16); extern void init_m68k (void); extern void init_m68k_full (void); extern void m68k_go (int); diff --git a/include/options.h b/include/options.h index c6f37466..d9a68138 100644 --- a/include/options.h +++ b/include/options.h @@ -383,6 +383,8 @@ struct uae_prefs { int turbo_emulation; bool headless; int filesys_limit; + int filesys_max_name; + int filesys_max_file_size; int cs_compatible; int cs_ciaatod; diff --git a/inputdevice.cpp b/inputdevice.cpp index 77202a3c..2bcab149 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -228,7 +228,6 @@ static uae_u8 pot_dat[NORMAL_JPORTS][2]; static int pot_dat_act[NORMAL_JPORTS][2]; static int analog_port[NORMAL_JPORTS][2]; static int digital_port[NORMAL_JPORTS][2]; -static int lightpen; #define POTDAT_DELAY_PAL 8 #define POTDAT_DELAY_NTSC 7 @@ -288,15 +287,16 @@ static void copyjport (const struct uae_prefs *src, struct uae_prefs *dst, int n dst->jports[num].autofire = src->jports[num].autofire; } -static void out_config (struct zfile *f, int id, int num, TCHAR *s1, TCHAR *s2) +static void out_config (struct zfile *f, int id, int num, const TCHAR *s1, const TCHAR *s2) { TCHAR tmp[MAX_DPATH]; _stprintf (tmp, _T("input.%d.%s%d"), id, s1, num); cfgfile_write_str (f, tmp, s2); } -static bool write_config_head (struct zfile *f, int idnum, int devnum, TCHAR *name, struct uae_input_device *id, struct inputdevice_functions *idf) +static bool write_config_head (struct zfile *f, int idnum, int devnum, const TCHAR *name, struct uae_input_device *id, struct inputdevice_functions *idf) { + TCHAR *s = NULL; TCHAR tmp2[CONFIG_BLEN]; if (idnum == GAMEPORT_INPUT_SETTINGS) { @@ -306,7 +306,6 @@ static bool write_config_head (struct zfile *f, int idnum, int devnum, TCHAR *na return false; } - TCHAR *s = NULL; if (id->name) s = id->name; else if (devnum < idf->get_num ()) @@ -331,7 +330,7 @@ static bool write_config_head (struct zfile *f, int idnum, int devnum, TCHAR *na cfgfile_write_bool (f, tmp2, true); if (id->enabled) { _stprintf (tmp2, _T("input.%d.%s.%d.disabled"), idnum + 1, name, devnum); - cfgfile_write (f, tmp2, _T("%d"), id->enabled ? 0 : 1); + cfgfile_write_bool (f, tmp2, id->enabled ? false : true); } return false; } @@ -541,7 +540,7 @@ static void write_kbr_config (struct zfile *f, int idnum, int devnum, struct uae } } -static void write_config (struct zfile *f, int idnum, int devnum, TCHAR *name, struct uae_input_device *id, struct inputdevice_functions *idf) +static void write_config (struct zfile *f, int idnum, int devnum, const TCHAR *name, struct uae_input_device *id, struct inputdevice_functions *idf) { TCHAR tmp1[MAX_DPATH]; int i; @@ -624,7 +623,7 @@ static int getnum (const TCHAR **pp) if (!_tcsnicmp (p, _T("false"), 5)) v = 0; - if (!_tcsnicmp (p, _T("true"), 4)) + else if (!_tcsnicmp (p, _T("true"), 4)) v = 1; else v = _tstol (p); @@ -671,8 +670,10 @@ static void reset_inputdevice_settings (struct uae_input_device *uid) for (int i = 0; i < MAX_INPUT_SUB_EVENT_ALL; i++) { uid->eventid[l][i] = 0; uid->flags[l][i] = 0; - xfree (uid->custom[l][i]); - uid->custom[l][i] = NULL; + if (uid->custom[l][i]) { + xfree (uid->custom[l][i]); + uid->custom[l][i] = NULL; + } } } } @@ -686,7 +687,7 @@ static void reset_inputdevice_slot (struct uae_prefs *prefs, int slot) } void reset_inputdevice_config (struct uae_prefs *prefs) { - for (int i = 0; i< MAX_INPUT_SETTINGS; i++) + for (int i = 0; i < MAX_INPUT_SETTINGS; i++) reset_inputdevice_slot (prefs, i); } @@ -3055,6 +3056,7 @@ static int handle_input_event (int nr, int state, int max, int autofire, bool ca lightpen_y = gfxvidinfo.outbuffer->outheight / 2; } lightpen_active = true; + lightpen_enabled = true; if (ie->type == 0) { int delta = 0; if (max == 0) @@ -3973,7 +3975,7 @@ static int isdigitalbutton (int ei) static int islightpen (int ei) { if (ei >= INPUTEVENT_LIGHTPEN_FIRST && ei < INPUTEVENT_LIGHTPEN_LAST) { - lightpen = 1; + lightpen_enabled = true; return 1; } return 0; @@ -4002,7 +4004,7 @@ static void scanevents (struct uae_prefs *p) joydirpot[i][j] = 128 / (312 * 100 / currprefs.input_analog_joystick_mult) + (128 * currprefs.input_analog_joystick_mult / 100) + currprefs.input_analog_joystick_offset; } } - lightpen = 0; + lightpen_enabled = false; if (lightpen_active > 0) lightpen_active = -1; diff --git a/newcpu.cpp b/newcpu.cpp index e2683954..f941fb28 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -3134,15 +3134,15 @@ STATIC_INLINE int div_unsigned (uae_u32 src_hi, uae_u32 src_lo, uae_u32 div, uae return 0; } -void m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra) +bool m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra) { if ((extra & 0x400) && currprefs.int_no_unimplemented && currprefs.cpu_model == 68060) { op_unimpl (opcode); - return; + return false; } if (src == 0) { Exception (5); - return; + return false; } #if defined (uae_s64) if (extra & 0x800) { @@ -3260,6 +3260,7 @@ void m68k_divl (uae_u32 opcode, uae_u32 src, uae_u16 extra) } } #endif + return true; } STATIC_INLINE void mul_unsigned (uae_u32 src1, uae_u32 src2, uae_u32 *dst_hi, uae_u32 *dst_lo) @@ -3280,11 +3281,11 @@ STATIC_INLINE void mul_unsigned (uae_u32 src1, uae_u32 src2, uae_u32 *dst_hi, ua *dst_hi = r3; } -void m68k_mull (uae_u32 opcode, uae_u32 src, uae_u16 extra) +bool m68k_mull (uae_u32 opcode, uae_u32 src, uae_u16 extra) { if ((extra & 0x400) && currprefs.int_no_unimplemented && currprefs.cpu_model == 68060) { op_unimpl (opcode); - return; + return false; } #if defined (uae_s64) if (extra & 0x800) { @@ -3369,6 +3370,7 @@ void m68k_mull (uae_u32 opcode, uae_u32 src, uae_u16 extra) m68k_dreg (regs, (extra >> 12) & 7) = dst_lo; } #endif + return true; } #endif diff --git a/od-win32/dinput.cpp b/od-win32/dinput.cpp index d4b78416..05b33b2c 100644 --- a/od-win32/dinput.cpp +++ b/od-win32/dinput.cpp @@ -3048,10 +3048,15 @@ static int get_kb_widget_first (int kb, int type) static int get_kb_widget_type (int kb, int num, TCHAR *name, uae_u32 *code) { - if (name) - _tcscpy (name, di_keyboard[kb].buttonname[num]); - if (code) + if (name) { + if (di_keyboard[kb].buttonname[num]) + _tcscpy (name, di_keyboard[kb].buttonname[num]); + else + name[0] = 0; + } + if (code) { *code = di_keyboard[kb].buttonmappings[num]; + } return IDEV_WIDGET_KEY; } diff --git a/od-win32/sounddep/sound.cpp b/od-win32/sounddep/sound.cpp index 2278da9b..8931b6cc 100644 --- a/od-win32/sounddep/sound.cpp +++ b/od-win32/sounddep/sound.cpp @@ -163,17 +163,18 @@ int setup_sound (void) return 1; } +float sound_sync_multiplier = 1.0; float scaled_sample_evtime_orig; extern float sampler_evtime; -void update_sound (double freq) + +void update_sound (double clk) { if (!have_sound) return; - int clk = currprefs.ntscmode ? CHIPSET_CLOCK_NTSC : CHIPSET_CLOCK_PAL; - scaled_sample_evtime_orig = clk * CYCLE_UNIT / (double)sdp->obtainedfreq; + scaled_sample_evtime_orig = clk * CYCLE_UNIT * sound_sync_multiplier / sdp->obtainedfreq; scaled_sample_evtime = scaled_sample_evtime_orig; - sampler_evtime = clk * CYCLE_UNIT; + sampler_evtime = clk * CYCLE_UNIT * sound_sync_multiplier; } extern int vsynctimebase_orig; @@ -1576,7 +1577,6 @@ static int open_sound (void) have_sound = 1; sound_available = 1; - update_sound (fake_vblank_hz); paula_sndbufsize = sdp->sndbufsize; paula_sndbufpt = paula_sndbuffer; driveclick_init (); diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 8c38792e..f1e90e43 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -4777,6 +4777,7 @@ extern int tablet_log; extern int log_blitter; extern int slirp_debug; extern int fakemodewaitms; +extern float sound_sync_multiplier; extern DWORD_PTR cpu_affinity, cpu_paffinity; static DWORD_PTR original_affinity = -1; @@ -4794,6 +4795,18 @@ static int getval (const TCHAR *s) return 0; return v; } +#if 0 +static float getvalf (const TCHAR *s) +{ + TCHAR *endptr; + double v; + + v = _tcstof (s, &endptr); + if (*endptr != '\0' || *s == '\0') + return 0; + return v; +} +#endif static void makeverstr (TCHAR *s) { @@ -5067,6 +5080,12 @@ static int parseargs (const TCHAR *argx, const TCHAR *np, const TCHAR *np2) if (!np) return 0; +#if 0 + if (!_tcscmp (arg, _T("sound_adjust"))) { + sound_sync_multiplier = getvalf (np); + return 2; + } +#endif if (!_tcscmp (arg, _T("vsync_modechangetimeout"))) { vsync_modechangetimeout = getval (np); return 2; diff --git a/od-win32/win32.h b/od-win32/win32.h index 0bf4907e..fe454f80 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -19,11 +19,11 @@ #define LANG_DLL 1 #if WINUAEPUBLICBETA -#define WINUAEBETA _T("13") +#define WINUAEBETA _T("14") #else #define WINUAEBETA _T("") #endif -#define WINUAEDATE MAKEBD(2013, 11, 15) +#define WINUAEDATE MAKEBD(2013, 11, 20) #define WINUAEEXTRA _T("") //#define WINUAEEXTRA _T("AmiKit Preview") //#define WINUAEEXTRA _T("Amiga Forever Edition") diff --git a/od-win32/win32_scaler.cpp b/od-win32/win32_scaler.cpp index fdbf9cbd..727f0fd5 100644 --- a/od-win32/win32_scaler.cpp +++ b/od-win32/win32_scaler.cpp @@ -441,7 +441,7 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height if (currprefs.gfx_ycenter_size >= 0) hh = currprefs.gfx_ycenter_size; int oldwinw = currprefs.gfx_size_win.width; - int oldwinh = currprefs.gfx_size_win.width; + int oldwinh = currprefs.gfx_size_win.height; changed_prefs.gfx_size_win.width = ww; changed_prefs.gfx_size_win.height = hh; fixup_prefs_dimensions (&changed_prefs); diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 39bd6106..88677a78 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -12335,7 +12335,6 @@ static void processport (HWND hDlg, bool reset, int port) updatejoyport (hDlg, port); inputdevice_updateconfig (NULL, &workprefs); inputdevice_config_change (); - reset_inputdevice_config (&workprefs); } /* Handle messages for the Joystick Settings page of our property-sheet */ @@ -12496,8 +12495,6 @@ static INT_PTR CALLBACK IOPortsDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPAR pages[IOPORTS_ID] = hDlg; currentpage = IOPORTS_ID; init_portsdlg (hDlg); - inputdevice_updateconfig (NULL, &workprefs); - reset_inputdevice_config (&workprefs); enable_for_portsdlg (hDlg); values_to_portsdlg (hDlg); recursive--; @@ -16530,7 +16527,7 @@ static int GetSettings (int all_options, HWND hwnd) } tres = scaleresource (panelresource, hwnd, gui_resize_enabled); - dhwnd = CreateDialogIndirect (tres->inst, tres->resource, NULL, DialogProc); + dhwnd = CreateDialogIndirect (tres->inst, tres->resource, isfullscreen () > 0 ? hwnd : NULL, DialogProc); dialog_rect.top = dialog_rect.left = 0; dialog_rect.right = tres->width; dialog_rect.bottom = tres->height; diff --git a/od-win32/win32gui_extra.cpp b/od-win32/win32gui_extra.cpp index b17bcfb9..a4c14696 100644 --- a/od-win32/win32gui_extra.cpp +++ b/od-win32/win32gui_extra.cpp @@ -24,6 +24,7 @@ #include "registry.h" #include "win32.h" #include "win32gui.h" +#include "xwin.h" #define MAX_GUI_FONTS 2 #define DEFAULT_FONTSIZE 8 @@ -243,7 +244,8 @@ struct newresource *scaleresource (struct newresource *res, HWND parent, int res d->style |= DS_MODALFRAME; d->style &= ~WS_THICKFRAME; } - d->style |= WS_MINIMIZEBOX; + if (isfullscreen () <= 0) + d->style |= WS_MINIMIZEBOX; d2 = (DLGTEMPLATEEX_END*)ns->resource; p = (BYTE*)d + sizeof (DLGTEMPLATEEX); diff --git a/od-win32/winuae_msvc11/winuae_msvc.vcxproj b/od-win32/winuae_msvc11/winuae_msvc.vcxproj index 90b67ad5..1c5c6fa4 100644 --- a/od-win32/winuae_msvc11/winuae_msvc.vcxproj +++ b/od-win32/winuae_msvc11/winuae_msvc.vcxproj @@ -70,7 +70,7 @@ false Unicode true - v110 + v120 Application @@ -692,7 +692,7 @@ Speed true true - ..\..\include;..\..;..\;..\resources;..\osdep;..\sounddep;%(AdditionalIncludeDirectories) + ..\..\include;..\..;..\;..\resources;..\osdep;..\sounddep;..\..\slirp;%(AdditionalIncludeDirectories) WINVER=0x0500;NDEBUG;_WIN32_IE=0x0700;WIN32;WIN64;%(PreprocessorDefinitions) true Sync @@ -723,7 +723,7 @@ 0x0409 - ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;vfw32.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;portaudio_x64.lib;packet.lib;wpcap.lib;openal32.lib;libpng15.lib;lglcd.lib;wtsapi32.lib;wntab32x.lib;enet_x64.lib;prowizard_x64.lib;lzmalib.lib;libFLAC_static.lib;avrt.lib;hid.lib;%(AdditionalDependencies) + ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;vfw32.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;portaudio_x64.lib;packet.lib;wpcap.lib;openal32.lib;libpng15.lib;lglcd.lib;wtsapi32.lib;wntab32x.lib;enet_x64.lib;prowizard_x64.lib;lzmalib.lib;libFLAC_static.lib;avrt.lib;hid.lib;Iphlpapi.lib;luastatic.lib;%(AdditionalDependencies) NotSet $(OutDir)$(TargetName)$(TargetExt) true diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 9b9d5b3c..a2ca7f29 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -2,6 +2,17 @@ - restore only single input target to default. +Beta 13: + +- Standard partition hardfile OFS filesystem check was broken (2.6.1) +- Adjusted sprite xpos == hpos check. (Shed Tears / Ozone scroller) +- 64-bit build didn't load portaudio dll. +- GUI window minimize button worked strangely when emulation window was open. +- Added new interlace emulation modes, first new is same as old one but display is updated every field + (Old doubling updated every frame) and another that does same and also blanks every other line. +- Added separate non-laced and lace doubling modes to GUI. (Better labels needed, but there is no space) +- Sound timing calculation wasn't updated to match new long/short field/interlace display emulation timing (b1). + Beta 12: - AROS rom memory mapping fixed (b1).