From bdcbbab6dbb0218e532e04d35162283e5cbb862d Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Fri, 13 Apr 2012 20:16:46 +0300 Subject: [PATCH] 2410b6 --- cia.cpp | 5 +- custom.cpp | 230 ++++++++++++++------- debug.cpp | 175 +++++++++++----- drawing.cpp | 61 ++++-- epsonprinter.cpp | 1 + filesys.cpp | 24 ++- include/drawing.h | 7 +- include/gfxfilter.h | 3 - include/xwin.h | 3 + isofs.cpp | 4 +- od-win32/dinput.cpp | 32 +-- od-win32/dxwrap.cpp | 26 +-- od-win32/dxwrap.h | 13 +- od-win32/resources/winuae.rc | 2 +- od-win32/rp.cpp | 8 +- od-win32/screenshot.cpp | 2 + od-win32/uaeunp/uaeunp.vcxproj | 1 + od-win32/win32.h | 4 +- od-win32/win32_scaler.cpp | 12 +- od-win32/win32gfx.cpp | 27 ++- od-win32/win32gui.cpp | 25 +-- od-win32/winuae_msvc10/winuae_msvc.vcxproj | 6 +- od-win32/winuaechangelog.txt | 40 +++- specialmonitors.cpp | 6 +- 24 files changed, 474 insertions(+), 243 deletions(-) diff --git a/cia.cpp b/cia.cpp index c7e48f5d..2326eaeb 100644 --- a/cia.cpp +++ b/cia.cpp @@ -538,6 +538,7 @@ static void setcode (uae_u8 keycode) static void sendrw (void) { setcode (AK_RESETWARNING); + ciaasdr = kbcode; kblostsynccnt = 8 * maxvpos * 8; // 8 frames * 8 bits. ciaaicr |= 8; RethinkICRA (); @@ -1134,11 +1135,11 @@ static void WriteCIAA (uae_u16 addr, uae_u8 val) val &= 0x7f; /* bit 7 is unused */ if ((val & 1) && !(ciaacra & 1)) ciaastarta = CIASTARTCYCLESCRA; - if ((val & 0x40) != (ciaacra & 0x40)) { + if ((val & 0x40) == 0 && (ciaacra & 0x40) != 0) { /* todo: check if low to high or high to low only */ kblostsynccnt = 0; #if KB_DEBUG - write_log (_T("KB_ACK %02x->%02x\n"), val, ciaacra); + write_log (_T("KB_ACK %02x->%02x\n"), ciaacra, val); #endif } ciaacra = val; diff --git a/custom.cpp b/custom.cpp index 41b3759b..31ad34e7 100644 --- a/custom.cpp +++ b/custom.cpp @@ -140,7 +140,9 @@ static enum nln_how nextline_how; static int lof_changed = 0, lof_changing = 0, interlace_changed = 0; static int scandoubled_line; static bool vsync_rendered, frame_shown; +static int vsynctimeperline; static int jitcount = 0; +static int frameskiptime; #define LOF_TOGGLES_NEEDED 4 #define NLACE_CNT_NEEDED 50 @@ -532,21 +534,21 @@ static void remember_ctable (void) /* This can happen when program program crashes very badly */ if (next_color_entry >= COLOR_TABLE_SIZE) return; - if (remembered_color_entry == -1) { + if (remembered_color_entry < 0) { /* The colors changed since we last recorded a color map. Record a * new one. */ color_reg_cpy (curr_color_tables + next_color_entry, ¤t_colors); remembered_color_entry = next_color_entry++; } thisline_decision.ctable = remembered_color_entry; - if (color_src_match == -1 || color_dest_match != remembered_color_entry + if (color_src_match < 0 || color_dest_match != remembered_color_entry || line_decisions[next_lineno].ctable != color_src_match) { /* The remembered comparison didn't help us - need to compare again. */ int oldctable = line_decisions[next_lineno].ctable; int changed = 0; - if (oldctable == -1) { + if (oldctable < 0) { changed = 1; color_src_match = color_dest_match = -1; } else { @@ -591,12 +593,12 @@ static void decide_diw (int hpos) lhdiw = 512; if (lhdiw >= diw_hstrt && last_hdiw < diw_hstrt && hdiwstate == DIW_waiting_start) { - if (thisline_decision.diwfirstword == -1) + if (thisline_decision.diwfirstword < 0) thisline_decision.diwfirstword = diwfirstword < 0 ? 0 : diwfirstword; hdiwstate = DIW_waiting_stop; } if (lhdiw >= diw_hstop && last_hdiw < diw_hstop && hdiwstate == DIW_waiting_stop) { - if (thisline_decision.diwlastword == -1) + if (thisline_decision.diwlastword < 0) thisline_decision.diwlastword = diwlastword < 0 ? 0 : diwlastword; hdiwstate = DIW_waiting_start; } @@ -654,7 +656,7 @@ static void add_modulos (void) static void finish_playfield_line (void) { /* The latter condition might be able to happen in interlaced frames. */ - if (vpos >= minfirstline && (thisframe_first_drawn_line == -1 || vpos < thisframe_first_drawn_line)) + if (vpos >= minfirstline && (thisframe_first_drawn_line < 0 || vpos < thisframe_first_drawn_line)) thisframe_first_drawn_line = vpos; thisframe_last_drawn_line = vpos; @@ -1049,9 +1051,9 @@ static void update_toscr_planes (void) STATIC_INLINE void maybe_first_bpl1dat (int hpos) { - if (thisline_decision.plfleft != -1) { + if (thisline_decision.plfleft >= 0) { // early bpl1dat crap fix (Sequential engine animation) - if (plfleft_real == -1) { + if (plfleft_real < 0) { int i; for (i = 0; i < thisline_decision.nr_planes; i++) { todisplay[i][0] = 0; @@ -1310,7 +1312,7 @@ static int flush_plane_data (int fm) STATIC_INLINE void flush_display (int fm) { - if (toscr_nbits > 0 && thisline_decision.plfleft != -1) + if (toscr_nbits > 0 && thisline_decision.plfleft >= 0) toscr (toscr_nbits, fm); toscr_nbits = 0; } @@ -1559,7 +1561,7 @@ static void do_long_fetch (int hpos, int nwords, int dma, int fm) /* make sure fetch that goes beyond maxhpos is finished */ static void finish_final_fetch (int pos, int fm) { - if (thisline_decision.plfleft == -1) + if (thisline_decision.plfleft < 0) return; if (plf_state == plf_end) return; @@ -1760,7 +1762,7 @@ STATIC_INLINE void update_fetch (int until, int fm) if (count >= fetchstart) { count &= ~fetchstart_mask; - if (thisline_decision.plfleft == -1) { + if (thisline_decision.plfleft < 0) { compute_delay_offset (); compute_toscr_delay_1 (bplcon1); } @@ -1860,7 +1862,7 @@ static void start_bpl_dma (int hpos, int hstart) /* If someone already wrote BPL1DAT, clear the area between that point and the real fetch start. */ if (!nodraw ()) { - if (thisline_decision.plfleft != -1) { + if (thisline_decision.plfleft >= 0) { out_nbits = (plfstrt - thisline_decision.plfleft) << (1 + toscr_res); out_offs = out_nbits >> 5; out_nbits &= 31; @@ -1957,7 +1959,7 @@ static void record_color_change (int hpos, int regno, unsigned long value) decide_diw (hpos); decide_line (hpos); - if (thisline_decision.ctable == -1) + if (thisline_decision.ctable < 0) remember_ctable (); if ((regno < 0x1000 || regno == 0x1000 + 0x10c) && hpos < HBLANK_OFFSET && !(beamcon0 & 0x80) && prev_lineno >= 0) { @@ -2403,7 +2405,7 @@ static void decide_sprites (int hpos) int sscanmask = 0x100 << sprite_buffer_res; int gotdata = 0; - if (thisline_decision.plfleft == -1 && !(bplcon3 & 2)) + if (thisline_decision.plfleft < 0 && !(bplcon3 & 2)) return; if (nodraw () || hpos < 0x14 || nr_armed == 0 || point == last_sprite_point) @@ -2538,7 +2540,7 @@ static void finish_decisions (void) decide_fetch (hpos); record_color_change2 (hsyncstartpos, 0xffff, 0); - if (thisline_decision.plfleft != -1 && thisline_decision.plflinelen == -1) { + if (thisline_decision.plfleft >= 0 && thisline_decision.plflinelen < 0) { if (fetch_state != fetch_not_started) { write_log (_T("fetch_state=%d plfleft=%d,len=%d,vpos=%d,hpos=%d\n"), fetch_state, thisline_decision.plfleft, thisline_decision.plflinelen, @@ -2555,7 +2557,7 @@ static void finish_decisions (void) * there's a more-or-less full-screen DIW. */ if (hdiwstate == DIW_waiting_stop) { thisline_decision.diwlastword = max_diwlastword; - if (thisline_decision.diwfirstword == -1) + if (thisline_decision.diwfirstword < 0) thisline_decision.diwfirstword = 0; } @@ -2568,7 +2570,7 @@ static void finish_decisions (void) dip_old = prev_drawinfo + next_lineno; dp = line_decisions + next_lineno; changed = thisline_changed; - if (thisline_decision.plfleft != -1 && thisline_decision.nr_planes > 0) + if (thisline_decision.plfleft >= 0 && thisline_decision.nr_planes > 0) record_diw_line (thisline_decision.plfleft, diwfirstword, diwlastword); decide_sprites (hpos + 1); @@ -2576,8 +2578,8 @@ static void finish_decisions (void) dip->last_sprite_entry = next_sprite_entry; dip->last_color_change = next_color_change; - if (thisline_decision.ctable == -1) { - if (thisline_decision.plfleft == -1) + if (thisline_decision.ctable < 0) { + if (thisline_decision.plfleft < 0) remember_ctable_for_border (); else remember_ctable (); @@ -2591,7 +2593,7 @@ static void finish_decisions (void) if (! changed && color_changes_differ (dip, dip_old)) changed = 1; if (!changed && /* bitplane visible in this line OR border sprites enabled */ - (thisline_decision.plfleft != -1 || ((thisline_decision.bplcon0 & 1) && (thisline_decision.bplcon3 & 0x02) && !(thisline_decision.bplcon3 & 0x20))) + (thisline_decision.plfleft >= 0 || ((thisline_decision.bplcon0 & 1) && (thisline_decision.bplcon3 & 0x02) && !(thisline_decision.bplcon3 & 0x20))) && sprites_differ (dip, dip_old)) { changed = 1; @@ -2873,6 +2875,8 @@ void compute_framesync (void) } stored_chipset_refresh = cr; interlace_changed = 0; + gfxvidinfo.drawbuffer.inxoffset = -1; + gfxvidinfo.drawbuffer.inyoffset = -1; if (beamcon0 & 0x80) { int res = GET_RES_AGNUS (bplcon0); @@ -2897,7 +2901,9 @@ void compute_framesync (void) int start = hbstrt; int stop = hbstop; - gfxvidinfo.drawbuffer.inwidth = (((start > stop ? (maxhpos - (maxhpos - start + stop)) : (maxhpos - (stop - start))) * 2) << res2); + gfxvidinfo.drawbuffer.inwidth = (((start > stop ? (maxhpos - (maxhpos - start + stop)) : (maxhpos - (stop - start) + 2)) * 2) << res2); + gfxvidinfo.drawbuffer.inxoffset = ((stop + 1) & ~1) * 2; + gfxvidinfo.drawbuffer.extrawidth = 0; gfxvidinfo.drawbuffer.inwidth2 = gfxvidinfo.drawbuffer.inwidth; @@ -2937,6 +2943,8 @@ void compute_framesync (void) reset_drawing (); } + memset (line_decisions, 0, sizeof line_decisions); + compute_vsynctime (); write_log (_T("%s mode%s%s V=%.4fHz H=%0.4fHz (%dx%d+%d) IDX=%d (%s)\n"), @@ -3043,9 +3051,9 @@ void init_hz (bool fullinit) else hsyncstartpos = maxhpos + hbstrt; if (hbstop > maxhpos) - hsyncendpos = hbstop; + hsyncendpos = maxhpos - hbstop; else - hsyncendpos = maxhpos + hbstop; + hsyncendpos = hbstop; } else { hsyncstartpos = maxhpos_short + 13; hsyncendpos = 24; @@ -3146,7 +3154,7 @@ static void calcdiw (void) /* display mode changed (lores, doubling etc..), recalculate everything */ void init_custom (void) { - update_mirrors(); + update_mirrors (); create_cycle_diagram_table (); reset_drawing (); init_hz (); @@ -3773,7 +3781,7 @@ static void BPLCON0_Denise (int hpos, uae_u16 v) sprres = expand_sprres (v, bplcon3); } #endif - if (thisline_decision.plfleft == -1) + if (thisline_decision.plfleft < 0) update_denise (hpos); } @@ -3803,7 +3811,7 @@ static void BPLCON0 (int hpos, uae_u16 v) bpldmainitdelay (hpos); - if (thisline_decision.plfleft == -1) + if (thisline_decision.plfleft < 0) BPLCON0_Denise (hpos, v); } @@ -3894,7 +3902,7 @@ static void BPLxDAT (int hpos, int num, uae_u16 v) bplxdat[num] = v; if (num == 0) { bpl1dat_written = 1; - if (thisline_decision.plfleft == -1) { + if (thisline_decision.plfleft < 0) { thisline_decision.plfleft = hpos; compute_delay_offset (); } @@ -4293,6 +4301,27 @@ static uae_u16 COLOR_READ (int num) } #endif +static void checkautoscalecol0 (void) +{ + if (!copper_access) + return; + if (vpos < 20) + return; + // autoscale if copper changes COLOR00 on top or bottom of screen + if (vpos >= minfirstline) { + int vpos2 = autoscale_bordercolors ? minfirstline : vpos; + if (first_planes_vpos == 0) + first_planes_vpos = vpos2 - 2; + if (plffirstline_total == current_maxvpos ()) + plffirstline_total = vpos2 - 2; + if (vpos2 > last_planes_vpos || vpos2 > plflastline_total) + plflastline_total = last_planes_vpos = vpos2 + 3; + autoscale_bordercolors = 0; + } else { + autoscale_bordercolors++; + } +} + static void COLOR_WRITE (int hpos, uae_u16 v, int num) { bool colzero = false; @@ -4331,7 +4360,10 @@ static void COLOR_WRITE (int hpos, uae_u16 v, int num) colzero = true; if (cval == current_colors.color_regs_aga[colreg]) - goto end; + return; + + if (colreg == 0) + checkautoscalecol0 (); /* Call this with the old table still intact. */ record_color_change (hpos, colreg, cval); @@ -4343,7 +4375,10 @@ static void COLOR_WRITE (int hpos, uae_u16 v, int num) if (num && v == 0) colzero = true; if (current_colors.color_regs_ecs[num] == v) - goto end; + return; + if (num == 0) + checkautoscalecol0 (); + /* Call this with the old table still intact. */ record_color_change (hpos, num, v); remembered_color_entry = -1; @@ -4352,23 +4387,6 @@ static void COLOR_WRITE (int hpos, uae_u16 v, int num) #ifdef AGA } #endif -end: - if (copper_access && colzero && vpos >= 20) { - // autoscale if copper changes COLOR00 on top or bottom of screen - if (vpos >= minfirstline) { - int vpos2 = autoscale_bordercolors ? minfirstline : vpos; - if (first_planes_vpos == 0) - first_planes_vpos = vpos2 - 2; - if (plffirstline_total == current_maxvpos ()) - plffirstline_total = vpos2 - 2; - if (vpos2 > last_planes_vpos || vpos2 > plflastline_total) - plflastline_total = last_planes_vpos = vpos2 + 3; - autoscale_bordercolors = 0; - } else { - autoscale_bordercolors++; - } - } - } /* The copper code. The biggest nightmare in the whole emulator. @@ -5146,19 +5164,29 @@ static void do_savestate(void); static int rpt_vsync (void) { - int v = read_processor_time () - vsyncwaittime; + frame_time_t curr_time = read_processor_time (); + int v = curr_time - vsyncwaittime; if (v > (int)syncbase || v < -((int)syncbase)) { - vsyncmintime = vsyncmaxtime = vsyncwaittime = read_processor_time (); + vsyncmintime = vsyncmaxtime = vsyncwaittime = curr_time; v = 0; } return v; } +static void rtg_vsync (void) +{ + frame_time_t start, end; + start = read_processor_time (); + picasso_handle_vsync (); + end = read_processor_time (); + frameskiptime += end - start; +} + static void rtg_vsynccheck (void) { if (vblank_found_rtg) { vblank_found_rtg = false; - picasso_handle_vsync (); + rtg_vsync (); } } @@ -5172,6 +5200,7 @@ static void framewait (void) curr_time = read_processor_time (); vsyncwaittime = vsyncmaxtime = curr_time + vsynctimebase; + vsynctimeperline = vsynctimebase / maxvpos_nom; render_screen (); show_screen (); frame_shown = true; @@ -5188,6 +5217,7 @@ static void framewait (void) if (vs == -2 || vs == -3) { // fastest possible + int max; curr_time = read_processor_time (); vsync_busywait_end (); vsync_busywait_do (NULL, (bplcon0 & 4) != 0 && !lof_changed && !lof_changing, lof_store != 0); @@ -5195,7 +5225,16 @@ static void framewait (void) vsyncmintime = curr_time; vsyncwaittime = curr_time + vsynctimebase; - vsyncmaxtime = curr_time + vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000; + max = vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000; + max -= frameskiptime + maxvpos_nom / 10; + frameskiptime = 0; + if (max < 0) { + max = 0; + vsynctimeperline = 1; + } else { + vsynctimeperline = max / maxvpos_nom; + } + vsyncmaxtime = max + curr_time; } else { @@ -5206,6 +5245,7 @@ static void framewait (void) vsyncmintime = curr_time; vsyncwaittime = curr_time + vsynctimebase; vsyncmaxtime = curr_time + vsynctimebase; + vsynctimeperline = vsynctimebase / maxvpos_nom; if (!show) { show_screen (); if (extraframewait) @@ -5219,25 +5259,40 @@ static void framewait (void) if (currprefs.m68k_speed < 0) { - for (;;) { - double v = rpt_vsync () / (syncbase / 1000.0); - if (v >= -4) - break; - rtg_vsynccheck (); - sleep_millis_main (2); + if (currprefs.m68k_speed_throttle) { + // this delay can safely overshoot frame time by 1-2 ms, following code will compensate for it. + for (;;) { + curr_time = read_processor_time (); + if ((int)vsyncwaittime - (int)curr_time <= 0) + break; + rtg_vsynccheck (); + sleep_millis_main (1); + } + } else { + curr_time = read_processor_time (); } - while (rpt_vsync () < 0) - rtg_vsynccheck (); - curr_time = read_processor_time (); + + int max; if ((int)curr_time - (int)vsyncwaittime > 0 && (int)curr_time - (int)vsyncwaittime < vsynctimebase / 2) { - int adjust = curr_time - vsyncmaxtime; - vsyncmaxtime = curr_time + vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000 - adjust; + int adjust = curr_time - vsyncwaittime; + max = vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000 - adjust; vsyncwaittime = curr_time + vsynctimebase - adjust; } else { - vsyncmaxtime = curr_time + vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000; + max = vsynctimebase * (1000 + currprefs.m68k_speed_throttle) / 1000; vsyncwaittime = curr_time + vsynctimebase; } vsyncmintime = curr_time; + vsynctimeperline /= maxvpos_nom; + + max -= frameskiptime + maxvpos_nom / 10; + frameskiptime = 0; + if (max < 0) { + max = 0; + vsynctimeperline = 1; + } else { + vsynctimeperline = max / maxvpos_nom; + } + vsyncmaxtime = max + curr_time; } else { @@ -5258,6 +5313,7 @@ static void framewait (void) curr_time = read_processor_time (); vsyncmintime = curr_time; vsyncmaxtime = vsyncwaittime = curr_time + vsynctimebase; + vsynctimeperline = vsynctimebase / maxvpos_nom; if (didrender) show_screen (); frame_shown = true; @@ -5322,7 +5378,7 @@ static void vsync_handler_pre (void) #ifdef PICASSO96 if (isvsync_rtg () >= 0) - picasso_handle_vsync (); + rtg_vsync (); #endif audio_vsync (); blkdev_vsync (); @@ -5348,7 +5404,9 @@ static void vsync_handler_pre (void) #endif if (!vsync_rendered) { - vsync_handle_redraw (lof_store, lof_changed); + frame_time_t start, end; + start = read_processor_time (); + vsync_handle_redraw (lof_store, lof_changed, bplcon0, bplcon3); vsync_rendered = true; if (vblank_hz_state) { render_screen (); @@ -5357,6 +5415,8 @@ static void vsync_handler_pre (void) show_screen_maybe (isvsync_chipset () >= 0); } } + end = read_processor_time (); + frameskiptime += end - start; } if (vblank_hz_mult > 0) @@ -5662,7 +5722,7 @@ static void hsync_handler_pre (bool onvsync) if (!nocustom ()) { sync_copper_with_cpu (maxhpos, 0); finish_decisions (); - if (thisline_decision.plfleft != -1) { + if (thisline_decision.plfleft >= 0) { if (currprefs.collision_level > 1) do_sprite_collisions (); if (currprefs.collision_level > 2) @@ -5854,20 +5914,24 @@ static void hsync_handler_post (bool onvsync) if (currprefs.m68k_speed < 0) { if (vpos + 1 == maxvpos + lof_store) { /* really last line, just run the cpu emulation until whole vsync time has been used */ - is_syncline = 1; - if (currprefs.m68k_speed_throttle) + if (currprefs.m68k_speed_throttle) { vsyncmintime = read_processor_time (); /* end of CPU emulation time */ - else + } else { vsyncmintime = vsyncmaxtime; /* emulate if still time left */ + is_syncline = 1; + } } else { /* end of scanline, run cpu emulation as long as we still have time */ - vsyncmintime += (vsynctimebase * (1000 + currprefs.m68k_speed_throttle)) / (maxvpos_nom * 1000); - if (!vblank_found_chipset && (int)vsyncmaxtime - (int)vsyncmintime > 0) { - is_syncline = -1; - frame_time_t rpt = read_processor_time (); - /* No extra time left? Skip it */ - if ((int)rpt - (int)vsyncmintime >= 0) - is_syncline = 0; + vsyncmintime += vsynctimeperline; + is_syncline = 0; + if (!vblank_found_chipset) { + if ((int)vsyncmaxtime - (int)vsyncmintime >= 0) { + frame_time_t rpt = read_processor_time (); + /* Extra time left? Do some extra CPU emulation */ + if ((int)vsyncmintime - (int)rpt >= vsynctimeperline) { + is_syncline = -1; + } + } } } } else { @@ -5881,7 +5945,6 @@ static void hsync_handler_post (bool onvsync) } } - if (!nocustom ()) { int lineno = vpos; if (lineno >= MAXVPOS) @@ -5952,10 +6015,15 @@ static void hsync_handler_post (bool onvsync) } if (diw_change == 0) { if (vpos >= first_planes_vpos && vpos <= last_planes_vpos) { - if (diwlastword > diwlastword_total) + if (diwlastword > diwlastword_total) { diwlastword_total = diwlastword; + if (diwlastword_total > coord_diw_to_window_x (hsyncstartpos * 2)) + diwlastword_total = coord_diw_to_window_x (hsyncstartpos * 2); + } if (diwfirstword < diwfirstword_total) { diwfirstword_total = diwfirstword; + if (diwfirstword_total < coord_diw_to_window_x (hsyncendpos * 2)) + diwfirstword_total = coord_diw_to_window_x (hsyncendpos * 2); firstword_bplcon1 = bplcon1; } } @@ -5980,14 +6048,18 @@ static void hsync_handler_post (bool onvsync) diw_change--; if (is_syncline > 0 && isvsync_chipset () == -2 && !vsync_rendered && currprefs.gfx_apmode[0].gfx_vflip == 0) { + frame_time_t start, end; + start = read_processor_time (); /* fastest possible + last line and no vflip wait: render the frame as early as possible */ vsync_rendered = true; - vsync_handle_redraw (lof_store, lof_changed); + vsync_handle_redraw (lof_store, lof_changed, bplcon0, bplcon3); if (vblank_hz_state) { render_screen (); show_screen_maybe (false); } frame_shown = true; + end = read_processor_time (); + frameskiptime += end - start; } rtg_vsynccheck (); @@ -7445,7 +7517,7 @@ STATIC_INLINE int dma_cycle (void) int hpos, hpos_old; blitter_nasty = 1; - if (cpu_tracer == -1) + if (cpu_tracer < 0) return current_hpos (); if (!currprefs.cpu_cycle_exact) return current_hpos (); diff --git a/debug.cpp b/debug.cpp index 6ae6c9fc..eb500cfd 100644 --- a/debug.cpp +++ b/debug.cpp @@ -35,6 +35,7 @@ #include "cpummu.h" #include "rommgr.h" #include "inputrecord.h" +#include "calc.h" int debugger_active; static uaecptr skipaddr_start, skipaddr_end; @@ -175,11 +176,43 @@ static int debug_out (const TCHAR *format, ...) return 1; } + +static bool isoperator(TCHAR **cp) +{ + TCHAR c = **cp; + return c == '+' || c == '-' || c == '/' || c == '*' || c == '(' || c == ')'; +} + static void ignore_ws (TCHAR **c) { while (**c && _istspace(**c)) (*c)++; } +static TCHAR peekchar (TCHAR **c) +{ + return **c; +} +static TCHAR readchar (TCHAR **c) +{ + TCHAR cc = **c; + (*c)++; + return cc; +} +static TCHAR next_char (TCHAR **c) +{ + ignore_ws (c); + return *(*c)++; +} +static TCHAR peek_next_char (TCHAR **c) +{ + TCHAR *pc = *c; + return pc[1]; +} +static int more_params (TCHAR **c) +{ + ignore_ws (c); + return (**c) != 0; +} static uae_u32 readint (TCHAR **c); static uae_u32 readbin (TCHAR **c); @@ -292,7 +325,7 @@ static uae_u32 readintx (TCHAR **c) } -static int checkvaltype (TCHAR **c, uae_u32 *val) +static int checkvaltype2 (TCHAR **c, uae_u32 *val, TCHAR def) { TCHAR nc; @@ -322,81 +355,121 @@ static int checkvaltype (TCHAR **c, uae_u32 *val) if (readregx (c, val)) return 1; } + if (def == '!') { + *val = readintx (c); + return -1; + } else if (def == '$') { + *val = readhexx (c); + return -1; + } else if (def == '%') { + *val = readbinx (c); + return -1; + } return 0; } static int readsize (int val, TCHAR **c) { - if ((*c)[0] == '.') { - (*c)++; - TCHAR cc = _totupper ((*c)[0]); - (*c)++; - if (cc == 'B') - return 1; - if (cc == 'W') - return 2; - if (cc == '3') - return 3; - if (cc == 'L') - return 4; - } - if (val > 255 || val < -127) + TCHAR cc = _totupper (readchar(c)); + if (cc == 'B') + return 1; + if (cc == 'W') return 2; - if (val > 65535 || val < -32767) + if (cc == '3') + return 3; + if (cc == 'L') return 4; - return 1; + return 0; } -static uae_u32 readint (TCHAR **c) +static int checkvaltype (TCHAR **cp, uae_u32 *val, int *size, TCHAR def) { - uae_u32 val; - if (checkvaltype (c, &val)) - return val; - return readintx (c); + TCHAR form[256], *p; + bool gotop = false; + double out; + + form[0] = 0; + *size = 0; + p = form; + for (;;) { + uae_u32 v; + if (!checkvaltype2 (cp, &v, def)) + return 0; + *val = v; + // stupid but works! + _stprintf(p, L"%u", v); + p += _tcslen (p); + if (peekchar (cp) == '.') { + readchar (cp); + *size = readsize (v, cp); + } + if (!isoperator (cp)) + break; + gotop = true; + *p++= readchar (cp); + *p = 0; + } + if (!gotop) { + if (*size == 0) { + uae_s32 v = (uae_s32)(*val); + if (v > 255 || v < -127) { + *size = 2; + } else if (v > 65535 || v < -32767) { + *size = 4; + } else { + *size = 1; + } + } + return 1; + } + if (calc (form, &out)) { + *val = (uae_u32)out; + if (*size == 0) { + uae_s32 v = (uae_s32)(*val); + if (v > 255 || v < -127) { + *size = 2; + } else if (v > 65535 || v < -32767) { + *size = 4; + } else { + *size = 1; + } + } + return 1; + } + return 0; } -static uae_u32 readhex (TCHAR **c) + + +static uae_u32 readnum (TCHAR **c, int *size, TCHAR def) { uae_u32 val; - if (checkvaltype (c, &val)) + if (checkvaltype (c, &val, size, def)) return val; - return readhexx (c); + return 0; } -static uae_u32 readint (TCHAR **c, int *size) + +static uae_u32 readint (TCHAR **c) { - uae_u32 val = readint (c); - *size = readsize (val, c); - return val; + int size; + return readnum (c, &size, '!'); } -static uae_u32 readhex (TCHAR **c, int *size) +static uae_u32 readhex (TCHAR **c) { - uae_u32 val = readhex (c); - *size = readsize (val, c); - return val; + int size; + return readnum (c, &size, '$'); } static uae_u32 readbin (TCHAR **c) { - uae_u32 val; - if (checkvaltype (c, &val)) - return val; - return readbinx (c); -} - -static TCHAR next_char (TCHAR **c) -{ - ignore_ws (c); - return *(*c)++; + int size; + return readnum (c, &size, '%'); } - -static TCHAR peek_next_char (TCHAR **c) +static uae_u32 readint (TCHAR **c, int *size) { - TCHAR *pc = *c; - return pc[1]; + return readnum (c, size, '!'); } - -static int more_params (TCHAR **c) +static uae_u32 readhex (TCHAR **c, int *size) { - ignore_ws (c); - return (**c) != 0; + return readnum (c, size, '$'); } static int next_string (TCHAR **c, TCHAR *out, int max, int forceupper) diff --git a/drawing.cpp b/drawing.cpp index ca0e39ce..b95c7946 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -85,6 +85,7 @@ static int linedbl, linedbld; int interlace_seen = 0; #define AUTO_LORES_FRAMES 10 static int can_use_lores = 0, frame_res, frame_res_lace, last_max_ypos; +static uae_u16 bplcon0_store, bplcon3_store; /* Lookup tables for dual playfields. The dblpf_*1 versions are for the case that playfield 1 has the priority, dbplpf_*2 are used if playfield 2 has @@ -214,7 +215,8 @@ static int bplres; static int plf1pri, plf2pri, bplxor; static uae_u32 plf_sprite_mask; static int sbasecol[2] = { 16, 16 }; -static int brdsprt, brdblank, brdblank_changed, hposblank; +static bool brdsprt, brdblank, brdblank_changed; +static int hposblank; bool picasso_requested_on; bool picasso_on; @@ -389,6 +391,9 @@ int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy) if (!plflastline_total) plflastline_total = last_planes_vpos; + ddffirstword_total = coord_hw_to_window_x (ddffirstword_total * 2 + DIW_DDF_OFFSET); + ddflastword_total = coord_hw_to_window_x (ddflastword_total * 2 + DIW_DDF_OFFSET); + if (doublescan <= 0 && !programmedmode) { int min = coord_diw_to_window_x (92); int max = coord_diw_to_window_x (460); @@ -396,8 +401,6 @@ int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy) diwfirstword_total = min; if (diwlastword_total > max) diwlastword_total = max; - ddffirstword_total = coord_hw_to_window_x (ddffirstword_total * 2 + DIW_DDF_OFFSET); - ddflastword_total = coord_hw_to_window_x (ddflastword_total * 2 + DIW_DDF_OFFSET); if (ddffirstword_total < min) ddffirstword_total = min; if (ddflastword_total > max) @@ -724,6 +727,8 @@ STATIC_INLINE xcolnr getbgc (void) return xcolors[0x0f0]; else if (hposblank == 3) return xcolors[0x00f]; + else if (brdblank) + return xcolors[0x880]; #endif return (brdblank || hposblank) ? 0 : colors_for_drawing.acolors[0]; } @@ -1857,7 +1862,6 @@ STATIC_INLINE void do_flush_screen (struct vidbuffer *vb, int start, int stop) * form. */ static void pfield_expand_dp_bplcon (void) { - int brdblank_2; static int b2; bplres = dp_for_drawing->bplres; @@ -1884,13 +1888,6 @@ static void pfield_expand_dp_bplcon (void) bpldualpf = (dp_for_drawing->bplcon0 & 0x400) == 0x400; bpldualpfpri = (dp_for_drawing->bplcon2 & 0x40) == 0x40; -#ifdef ECS_DENISE - brdblank_2 = (currprefs.chipset_mask & CSMASK_ECS_DENISE) && (dp_for_drawing->bplcon0 & 1) && (dp_for_drawing->bplcon3 & 0x20); - if (brdblank_2 != brdblank) - brdblank_changed = 1; - brdblank = brdblank_2; -#endif - #ifdef AGA bpldualpf2of = (dp_for_drawing->bplcon3 >> 10) & 7; sbasecol[0] = ((dp_for_drawing->bplcon4 >> 4) & 15) << 4; @@ -1919,6 +1916,16 @@ static bool isham (uae_u16 bplcon0) return 0; } +static void isbrdblank (void) +{ +#ifdef ECS_DENISE + bool brdblank_2 = (currprefs.chipset_mask & CSMASK_ECS_DENISE) && (bplcon0_store & 1) && (bplcon3_store & 0x20); + if (brdblank_2 != brdblank) + brdblank_changed = true; + brdblank = brdblank_2; +#endif +} + static void pfield_expand_dp_bplconx (int regno, int v) { if (regno == 0xffff) { @@ -1933,6 +1940,8 @@ static void pfield_expand_dp_bplconx (int regno, int v) dp_for_drawing->bplres = GET_RES_DENISE (v); dp_for_drawing->nr_planes = GET_PLANES (v); dp_for_drawing->ham_seen = isham (v); + bplcon0_store = v; + isbrdblank (); break; case 0x104: dp_for_drawing->bplcon2 = v; @@ -1940,6 +1949,8 @@ static void pfield_expand_dp_bplconx (int regno, int v) #ifdef ECS_DENISE case 0x106: dp_for_drawing->bplcon3 = v; + bplcon3_store = v; + isbrdblank (); break; #endif #ifdef AGA @@ -2059,7 +2070,7 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in dp_for_drawing--; dip_for_drawing--; linestate[lineno] = LINE_DONE_AS_PREVIOUS; - if (dp_for_drawing->plfleft == -1) + if (dp_for_drawing->plfleft < 0) border = 1; break; @@ -2069,14 +2080,14 @@ static void pfield_draw_line (struct vidbuffer *vb, int lineno, int gfx_ypos, in return; case LINE_DECIDED_DOUBLE: - if (follow_ypos != -1) { + if (follow_ypos >= 0) { do_double = 1; linestate[lineno + 1] = LINE_DONE_AS_PREVIOUS; } /* fall through */ default: - if (dp_for_drawing->plfleft == -1) + if (dp_for_drawing->plfleft < 0) border = 1; linestate[lineno] = LINE_DONE; break; @@ -2246,7 +2257,11 @@ static void center_image (void) visible_left_border = max_diwlastword - w; //visible_left_border += gfxvidinfo.drawbuffer.extrawidth << currprefs.gfx_resolution; } else { - visible_left_border = 0; + if (gfxvidinfo.drawbuffer.inxoffset < 0) { + visible_left_border = 0; + } else { + visible_left_border = gfxvidinfo.drawbuffer.inxoffset - DISPLAY_LEFT_SHIFT; + } } @@ -2265,7 +2280,7 @@ static void center_image (void) visible_right_border = max_diwlastword; thisframe_y_adjust = minfirstline; - if (currprefs.gfx_ycenter && thisframe_first_drawn_line != -1 && !currprefs.gfx_filter_autoscale) { + if (currprefs.gfx_ycenter && thisframe_first_drawn_line >= 0 && !currprefs.gfx_filter_autoscale) { if (thisframe_last_drawn_line - thisframe_first_drawn_line < max_drawn_amiga_line && currprefs.gfx_ycenter == 2) thisframe_y_adjust = (thisframe_last_drawn_line - thisframe_first_drawn_line - max_drawn_amiga_line) / 2 + thisframe_first_drawn_line; @@ -2384,7 +2399,7 @@ static void init_drawing_frame (void) init_hardware_for_drawing_frame (); - if (thisframe_first_drawn_line == -1) + if (thisframe_first_drawn_line < 0) thisframe_first_drawn_line = minfirstline; if (thisframe_first_drawn_line > thisframe_last_drawn_line) thisframe_last_drawn_line = thisframe_first_drawn_line; @@ -2681,7 +2696,7 @@ void finish_drawing_frame (void) for (i = 0; i < sizeof linestate / sizeof *linestate; i++) linestate[i] = LINE_UNDECIDED; notice_screen_contents_lost (); - brdblank_changed = 0; + brdblank_changed = false; } #endif } @@ -2695,7 +2710,7 @@ void hardware_line_completed (int lineno) i = lineno - thisframe_y_adjust_real; if (i >= 0 && i < max_ypos_thisframe) { where = amiga2aspect_line_map[i+min_ypos_for_screen]; - if (where < gfxvidinfo.drawbuffer.outheight && where != -1) + if (where < gfxvidinfo.drawbuffer.outheight && where >= 0) pfield_draw_line (lineno, where, amiga2aspect_line_map[i+min_ypos_for_screen+1]); } } @@ -2759,7 +2774,7 @@ void vsync_handle_check (void) check_prefs_changed_cpu (); } -void vsync_handle_redraw (int long_frame, int lof_changed) +void vsync_handle_redraw (int long_frame, int lof_changed, uae_u16 bplcon0p, uae_u16 bplcon3p) { last_redraw_point++; if (lof_changed || interlace_seen <= 0 || last_redraw_point >= 2 || long_frame || doublescan < 0) { @@ -2802,6 +2817,12 @@ void vsync_handle_redraw (int long_frame, int lof_changed) if (isvsync_chipset ()) flush_screen (gfxvidinfo.inbuffer, 0, 0); /* vsync mode */ } + + /* check borderblank here because bplcon0 or especially bplcon3 may only be written once outside of displayable area */ + bplcon0_store = bplcon0p; + bplcon3_store = bplcon3p; + isbrdblank (); + gui_flicker_led (-1, 0, 0); #ifdef AVIOUTPUT frame_drawn (); diff --git a/epsonprinter.cpp b/epsonprinter.cpp index afd45ec0..d36e92be 100644 --- a/epsonprinter.cpp +++ b/epsonprinter.cpp @@ -40,6 +40,7 @@ int pngprint = 0; #ifdef C_LIBPNG +#include #include #endif diff --git a/filesys.cpp b/filesys.cpp index a94d7c6d..7fe9428b 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -1384,13 +1384,13 @@ static uae_u32 filesys_media_change_reply (TrapContext *ctx, int mode) uae_u64 uniq; ui->cdfs_superblock = u->ui.cdfs_superblock = isofs_mount (ui->cddevno, &uniq); u->rootnode.uniq_external = uniq; - if (!u->ui.cdfs_superblock) { - u->ui.unknown_media = true; + u->ui.unknown_media = true; + if (!u->ui.cdfs_superblock) return 0; - } struct isofs_info ii; set_highcyl (ui, 0); - if (isofs_mediainfo (ui->cdfs_superblock, &ii) && ii.media) { + bool r = isofs_mediainfo (ui->cdfs_superblock, &ii); + if (r && ii.media) { u->ui.unknown_media = ii.unknown_media; if (!ii.unknown_media) { u->ui.volname = ui->volname = my_strdup (ii.volumename); @@ -2527,7 +2527,13 @@ static void { struct fs_usage fsu; int ret, err = ERROR_NO_FREE_STORE; + int blocksize, nr; + uae_u32 dostype; + blocksize = 1204; + /* not FFS because it is not understood by WB1.x C:Info */ + dostype = DISK_TYPE_DOS; + nr = unit->unit; if (unit->volflags & MYVOLUMEINFO_ARCHIVE) { ret = zfile_fs_usage_archive (unit->ui.rootdir, 0, &fsu); } else if (unit->volflags & MYVOLUMEINFO_CDFS) { @@ -2535,6 +2541,8 @@ static void ret = isofs_mediainfo (unit->ui.cdfs_superblock, &ii) ? 0 : 1; fsu.fsu_blocks = ii.blocks; fsu.fsu_bavail = 0; + blocksize = ii.blocksize; + nr = unit->unit - cd_unit_offset; } else { ret = get_fs_usage (unit->ui.rootdir, 0, &fsu); if (ret) @@ -2546,13 +2554,13 @@ static void return; } put_long (info, 0); /* errors */ - put_long (info + 4, (unit->volflags & MYVOLUMEINFO_CDFS) ? unit->unit - cd_unit_offset : unit->unit); /* unit number */ + put_long (info + 4, nr); /* unit number */ put_long (info + 8, unit->ui.readonly || unit->ui.locked ? 80 : 82); /* state */ - put_long (info + 20, (unit->volflags & MYVOLUMEINFO_CDFS) ? 2048 : 1024); /* bytesperblock */ + put_long (info + 20, blocksize); /* bytesperblock */ if (disk_info && unit->ui.unknown_media) { put_long (info + 12, 0); put_long (info + 16, 0); - put_long (info + 24, ('B' << 24) | ('A' << 16) | ('D' << 8) | 0); /* ID_UNREADABLE_DISK */ + put_long (info + 24, ('B' << 24) | ('A' << 16) | ('D' << 8) | (0 << 0)); /* ID_UNREADABLE_DISK */ put_long (info + 28, 0); } else if (disk_info && !filesys_isvolume (unit)) { put_long (info + 12, 0); @@ -2562,7 +2570,7 @@ static void } else { put_long (info + 12, fsu.fsu_blocks ); /* numblocks */ put_long (info + 16, fsu.fsu_blocks - fsu.fsu_bavail); /* inuse */ - put_long (info + 24, (unit->volflags & MYVOLUMEINFO_CDFS) ? DISK_TYPE_DOS : DISK_TYPE_DOS_FFS); /* disk type */ + put_long (info + 24, dostype); /* disk type */ put_long (info + 28, unit->volume >> 2); /* volume node */ } put_long (info + 32, 0); /* inuse */ diff --git a/include/drawing.h b/include/drawing.h index aa0e3f79..45fa0389 100644 --- a/include/drawing.h +++ b/include/drawing.h @@ -35,7 +35,7 @@ before it appears on-screen. (TW: display emulation now does this automatically) #define HBLANK_OFFSET 9 /* We ignore that many lores pixels at the start of the display. These are * invisible anyway due to hardware DDF limits. */ -#define DISPLAY_LEFT_SHIFT 0x40 +#define DISPLAY_LEFT_SHIFT 0x38 #endif #define PIXEL_XPOS(HPOS) (((HPOS)*2 - DISPLAY_LEFT_SHIFT + DIW_DDF_OFFSET - 1) << lores_shift) @@ -176,8 +176,7 @@ struct color_change { #define MAX_VIDHEIGHT 2048 #endif -/* No divisors for MAX_PIXELS_PER_LINE; we support AGA and may one day -want to use SHRES sprites. */ +/* No divisors for MAX_PIXELS_PER_LINE; we support AGA and SHRES sprites */ #define MAX_SPR_PIXELS (((MAXVPOS + 1) * 2 + 1) * MAX_PIXELS_PER_LINE) struct sprite_entry @@ -272,7 +271,7 @@ enum nln_how { }; extern void hsync_record_line_state (int lineno, enum nln_how, int changed); -extern void vsync_handle_redraw (int long_frame, int lof_changed); +extern void vsync_handle_redraw (int long_frame, int lof_changed, uae_u16, uae_u16); extern void vsync_handle_check (void); extern void init_hardware_for_drawing_frame (void); extern void reset_drawing (void); diff --git a/include/gfxfilter.h b/include/gfxfilter.h index a0bbee66..1b133558 100644 --- a/include/gfxfilter.h +++ b/include/gfxfilter.h @@ -1,7 +1,4 @@ -#define AMIGA_WIDTH_MAX (752 / 2) -#define AMIGA_HEIGHT_MAX (574 / 2) - #ifdef GFXFILTER typedef unsigned char u8; diff --git a/include/xwin.h b/include/xwin.h index e470ecc2..09ecb550 100644 --- a/include/xwin.h +++ b/include/xwin.h @@ -125,6 +125,9 @@ struct vidbuffer int xoffset; /* superhires pixels from left edge */ int yoffset; /* lines from top edge */ + + int inxoffset; /* positive if sync positioning */ + int inyoffset; }; extern bool isnativevidbuf (void); diff --git a/isofs.cpp b/isofs.cpp index 3915f9af..774bbee8 100644 --- a/isofs.cpp +++ b/isofs.cpp @@ -1059,7 +1059,7 @@ repeat: int l = p[0]; char t = p[l]; p[l] = 0; - au_copy (inode->i_comment + _tcslen (inode->i_comment), maxcomment + 1 - l, p + 1); + au_copy (inode->i_comment + _tcslen (inode->i_comment), maxcomment + 1 - _tcslen (inode->i_comment), p + 1); p[l] = t; } break; @@ -2436,6 +2436,8 @@ bool isofs_mediainfo(void *sbp, struct isofs_info *ii) ii->totalblocks = totalblocks ? totalblocks : ii->blocks; ii->creation = sb->root->i_ctime.tv_sec; } + if (!ii->volumename[0] || !ii->blocks) + ii->unknown_media = true; } return true; } diff --git a/od-win32/dinput.cpp b/od-win32/dinput.cpp index 0c5bc4a5..b3ed6c0e 100644 --- a/od-win32/dinput.cpp +++ b/od-win32/dinput.cpp @@ -1697,7 +1697,7 @@ static void handle_rawinput_2 (RAWINPUT *raw) } } if (rawinput_log & 2) - write_log (_T("HANDLE=%08x %04x %04x %04x %08x %3d %3d %08x M=%d\n"), + write_log (_T("%08x %04x %04x %04x %08x %3d %3d %08x M=%d\n"), raw->header.hDevice, rm->usFlags, rm->usButtonFlags, @@ -1742,21 +1742,23 @@ static void handle_rawinput_2 (RAWINPUT *raw) setmousebuttonstate (num, bnum + 1, -1); } } - if (istest) { - if (abs (rm->lLastX - lastx[num]) > 7) { + if (!rm->ulButtons) { + if (istest) { + if (abs (rm->lLastX - lastx[num]) > 7) { + setmousestate (num, 0, rm->lLastX, (rm->usFlags & (MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP)) ? 1 : 0); + lastx[num] = rm->lLastX; + lasty[num] = rm->lLastY; + } else if (abs (rm->lLastY - lasty[num]) > 7) { + setmousestate (num, 1, rm->lLastY, (rm->usFlags & (MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP)) ? 1 : 0); + lastx[num] = rm->lLastX; + lasty[num] = rm->lLastY; + } + } else { setmousestate (num, 0, rm->lLastX, (rm->usFlags & (MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP)) ? 1 : 0); - lastx[num] = rm->lLastX; - lasty[num] = rm->lLastY; - } else if (abs (rm->lLastY - lasty[num]) > 7) { setmousestate (num, 1, rm->lLastY, (rm->usFlags & (MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP)) ? 1 : 0); lastx[num] = rm->lLastX; lasty[num] = rm->lLastY; } - } else { - setmousestate (num, 0, rm->lLastX, (rm->usFlags & (MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP)) ? 1 : 0); - setmousestate (num, 1, rm->lLastY, (rm->usFlags & (MOUSE_MOVE_ABSOLUTE | MOUSE_VIRTUAL_DESKTOP)) ? 1 : 0); - lastx[num] = rm->lLastX; - lasty[num] = rm->lLastY; } } if (isfocus () && !istest) { @@ -1847,13 +1849,13 @@ static void handle_rawinput_2 (RAWINPUT *raw) int min = vcaps->LogicalMin; if (vcaps->LogicalMax - min == 7) { - if (val == min + 0 && type == AXISTYPE_POV_Y) + if ((val == min + 0 || val == min + 1 || val == min + 7) && type == AXISTYPE_POV_Y) data = -127; - if (val == min + 2 && type == AXISTYPE_POV_X) + if ((val == min + 2 || val == min + 3 || val == min + 1) && type == AXISTYPE_POV_X) data = 127; - if (val == min + 4 && type == AXISTYPE_POV_Y) + if ((val == min + 4 || val == min + 5 || val == min + 3) && type == AXISTYPE_POV_Y) data = 127; - if (val == min + 6 && type == AXISTYPE_POV_X) + if ((val == min + 6 || val == min + 7 || val == min + 5) && type == AXISTYPE_POV_X) data = -127; } else { if (val == min + 0 && type == AXISTYPE_POV_Y) diff --git a/od-win32/dxwrap.cpp b/od-win32/dxwrap.cpp index 83406f0a..d528c915 100644 --- a/od-win32/dxwrap.cpp +++ b/od-win32/dxwrap.cpp @@ -117,7 +117,7 @@ static void clearsurf (LPDIRECTDRAWSURFACE7 surf, DWORD color) } } -void clearsurface (LPDIRECTDRAWSURFACE7 surf) +void DirectDraw_ClearSurface (LPDIRECTDRAWSURFACE7 surf) { if (surf == NULL) surf = getlocksurface (); @@ -125,7 +125,7 @@ void clearsurface (LPDIRECTDRAWSURFACE7 surf) } -int locksurface (LPDIRECTDRAWSURFACE7 surf, LPDDSURFACEDESC2 desc) +int DirectDraw_LockSurface (LPDIRECTDRAWSURFACE7 surf, LPDDSURFACEDESC2 desc) { static int cnt = 50; HRESULT ddrval; @@ -145,7 +145,7 @@ int locksurface (LPDIRECTDRAWSURFACE7 surf, LPDDSURFACEDESC2 desc) } return 1; } -void unlocksurface (LPDIRECTDRAWSURFACE7 surf) +void DirectDraw_UnlockSurface (LPDIRECTDRAWSURFACE7 surf) { HRESULT ddrval; @@ -398,9 +398,9 @@ HRESULT DirectDraw_CreateMainSurface (int width, int height) dxdata.swidth = width; dxdata.sheight = height; dxdata.pitch = 0; - if (locksurface (surf, &desc)) { + if (DirectDraw_LockSurface (surf, &desc)) { dxdata.pitch = desc.lPitch; - unlocksurface (surf); + DirectDraw_UnlockSurface (surf); } else { write_log (_T("Couldn't get surface pitch!\n")); } @@ -614,7 +614,7 @@ int DirectDraw_SurfaceLock (void) } if (dxdata.lockcnt > 0) return 1; - ok = locksurface (getlocksurface (), &dxdata.locksurface); + ok = DirectDraw_LockSurface (getlocksurface (), &dxdata.locksurface); if (ok) dxdata.lockcnt++; return ok; @@ -626,7 +626,7 @@ void DirectDraw_SurfaceUnlock (void) if (dxdata.lockcnt == 0) return; dxdata.lockcnt--; - unlocksurface (getlocksurface ()); + DirectDraw_UnlockSurface (getlocksurface ()); } uae_u8 *DirectDraw_GetSurfacePointer (void) @@ -805,8 +805,8 @@ static int DirectDraw_Blt_EmuCK (LPDIRECTDRAWSURFACE7 dst, RECT *dstrect, LPDIRE dx = dstrect->left; dy = dstrect->top; } - if (locksurface (dst, &dstd)) { - if (locksurface (src, &srcd)) { + if (DirectDraw_LockSurface (dst, &dstd)) { + if (DirectDraw_LockSurface (src, &srcd)) { bpp = srcd.ddpfPixelFormat.dwRGBBitCount / 8; h = srcd.dwHeight; w = srcd.dwWidth; @@ -831,9 +831,9 @@ static int DirectDraw_Blt_EmuCK (LPDIRECTDRAWSURFACE7 dst, RECT *dstrect, LPDIRE } } ok = 1; - unlocksurface (src); + DirectDraw_UnlockSurface (src); } - unlocksurface (dst); + DirectDraw_UnlockSurface (dst); } return ok; } @@ -870,12 +870,12 @@ int DirectDraw_BlitRect (LPDIRECTDRAWSURFACE7 dst, RECT *dstrect, LPDIRECTDRAWSU { return DirectDraw_Blt (dst, dstrect, src, scrrect, FALSE); } -int DirectDraw_BlitRectCK (LPDIRECTDRAWSURFACE7 dst, RECT *dstrect, LPDIRECTDRAWSURFACE7 src, RECT *scrrect) +static int DirectDraw_BlitRectCK (LPDIRECTDRAWSURFACE7 dst, RECT *dstrect, LPDIRECTDRAWSURFACE7 src, RECT *scrrect) { return DirectDraw_Blt (dst, dstrect, src, scrrect, TRUE); } -void DirectDraw_FillSurface (LPDIRECTDRAWSURFACE7 dst, RECT *rect, uae_u32 color) +static void DirectDraw_FillSurface (LPDIRECTDRAWSURFACE7 dst, RECT *rect, uae_u32 color) { HRESULT ddrval; DDBLTFX ddbltfx; diff --git a/od-win32/dxwrap.h b/od-win32/dxwrap.h index 5b977cfa..df6b37fd 100644 --- a/od-win32/dxwrap.h +++ b/od-win32/dxwrap.h @@ -90,10 +90,9 @@ HRESULT DirectDraw_GetDisplayMode (void); void DirectDraw_Release(void); int DirectDraw_Start(void); void DirectDraw_get_GUIDs (void); -void clearsurface(LPDIRECTDRAWSURFACE7 surf); -int locksurface (LPDIRECTDRAWSURFACE7 surf, LPDDSURFACEDESC2 desc); -void unlocksurface (LPDIRECTDRAWSURFACE7 surf); -HRESULT restoresurface (LPDIRECTDRAWSURFACE7 surf); +void DirectDraw_ClearSurface (LPDIRECTDRAWSURFACE7 surf); +int DirectDraw_LockSurface (LPDIRECTDRAWSURFACE7 surf, LPDDSURFACEDESC2 desc); +void DirectDraw_UnlockSurface (LPDIRECTDRAWSURFACE7 surf); LPDIRECTDRAWSURFACE7 allocsurface (int width, int height); LPDIRECTDRAWSURFACE7 allocsystemsurface (int width, int height); LPDIRECTDRAWSURFACE7 createsurface (uae_u8 *ptr, int pitch, int width, int height); @@ -116,8 +115,8 @@ int DirectDraw_IsLocked (void); DWORD DirectDraw_GetPixelFormatBitMask (DirectDraw_Mask_e mask); RGBFTYPE DirectDraw_GetPixelFormat (void); DWORD DirectDraw_GetBytesPerPixel (void); -HRESULT DirectDraw_GetDC(HDC *hdc); -HRESULT DirectDraw_ReleaseDC(HDC hdc); +HRESULT DirectDraw_GetDC (HDC *hdc); +HRESULT DirectDraw_ReleaseDC (HDC hdc); int DirectDraw_GetVerticalBlankStatus (void); DWORD DirectDraw_CurrentRefreshRate (void); void DirectDraw_GetPrimaryPixelFormat (DDSURFACEDESC2 *desc); @@ -127,8 +126,6 @@ int DirectDraw_BlitToPrimary (RECT *rect); int DirectDraw_BlitToPrimaryScale (RECT *dstrect, RECT *srcrect); int DirectDraw_Blit (LPDIRECTDRAWSURFACE7 dst, LPDIRECTDRAWSURFACE7 src); int DirectDraw_BlitRect (LPDIRECTDRAWSURFACE7 dst, RECT *dstrect, LPDIRECTDRAWSURFACE7 src, RECT *scrrect); -int DirectDraw_BlitRectCK (LPDIRECTDRAWSURFACE7 dst, RECT *dstrect, LPDIRECTDRAWSURFACE7 src, RECT *scrrect); -void DirectDraw_FillSurface (LPDIRECTDRAWSURFACE7 dst, RECT *rect, uae_u32 color); void DirectDraw_Fill (RECT *rect, uae_u32 color); void DirectDraw_FillPrimary (void); bool DD_getvblankpos (int *vpos); diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 69b75afe..a9b183d1 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -772,7 +772,7 @@ BEGIN EDITTEXT IDC_FILTERXLV,253,176,34,12,ES_CENTER | ES_READONLY COMBOBOX IDC_FILTERSLR,253,151,33,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP GROUPBOX "Presets",-1,0,203,296,36 - COMBOBOX IDC_FILTERPRESETS,8,217,119,150,CBS_DROPDOWN | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_FILTERPRESETS,8,217,119,150,CBS_DROPDOWN | CBS_SORT | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP PUSHBUTTON "Load",IDC_FILTERPRESETLOAD,132,216,47,14 PUSHBUTTON "Save",IDC_FILTERPRESETSAVE,184,216,47,14 PUSHBUTTON "Delete",IDC_FILTERPRESETDELETE,236,216,47,14 diff --git a/od-win32/rp.cpp b/od-win32/rp.cpp index 9184ecf1..51d2bd2a 100644 --- a/od-win32/rp.cpp +++ b/od-win32/rp.cpp @@ -30,6 +30,7 @@ #include "blkdev.h" #include "registry.h" #include "win32gui.h" +#include "drawing.h" #include static int initialized; @@ -257,12 +258,15 @@ int port_insert_custom (int inputmap_port, int devicetype, DWORD flags, const TC break; } } - if (wdnum >= 0) + if (wdnum >= 0) { inputdevice_set_gameports_mapping (&changed_prefs, kb + j, wdnum, evtnum, inputmap_port); + inputdevice_set_gameports_mapping (&currprefs, kb + j, wdnum, evtnum, inputmap_port); + } } } inputdevice_updateconfig (&changed_prefs); + inputdevice_updateconfig (&currprefs); return TRUE; } @@ -1011,7 +1015,7 @@ static void sendenum (void) _tcscpy (desc.szHostInputID, _T("KeyboardCustom")); _tcscpy (desc.szHostInputName, _T("KeyboardCustom")); desc.dwHostInputType = RP_HOSTINPUT_KEYJOY_CUSTOM; - desc.dwInputDeviceFeatures = RP_FEATURE_INPUTDEVICE_JOYSTICK; + desc.dwInputDeviceFeatures = RP_FEATURE_INPUTDEVICE_JOYSTICK | RP_FEATURE_INPUTDEVICE_JOYPAD; RPSendMessagex (RPIPCGM_INPUTDEVICE, 0, 0, &desc, sizeof desc, &guestinfo, NULL); cnt = 0; while ((cnt = rp_input_enum (&desc, cnt)) >= 0) { diff --git a/od-win32/screenshot.cpp b/od-win32/screenshot.cpp index 4bd25810..f4939569 100644 --- a/od-win32/screenshot.cpp +++ b/od-win32/screenshot.cpp @@ -235,11 +235,13 @@ void Screenshot_RGBinfo (int rb, int gb, int bb, int rs, int gs, int bs) static void _cdecl pngtest_blah (png_structp png_ptr, png_const_charp message) { +#if 0 TCHAR *name = au ("unknown"); if (png_ptr != NULL && png_ptr->error_ptr != NULL) name = au ((char*)png_ptr->error_ptr); write_log (_T("%s: libpng warning: %s\n"), name, message); xfree (name); +#endif } static int savepng (FILE *fp) diff --git a/od-win32/uaeunp/uaeunp.vcxproj b/od-win32/uaeunp/uaeunp.vcxproj index b62f017d..736155fa 100644 --- a/od-win32/uaeunp/uaeunp.vcxproj +++ b/od-win32/uaeunp/uaeunp.vcxproj @@ -66,6 +66,7 @@ false MachineX86 $(SolutionDir)\..\lib\ + LIBCMT diff --git a/od-win32/win32.h b/od-win32/win32.h index 661edc92..46a23bf6 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -19,8 +19,8 @@ #define LANG_DLL 1 //#define WINUAEBETA _T("") -#define WINUAEBETA _T("Beta 4") -#define WINUAEDATE MAKEBD(2012, 4, 4) +#define WINUAEBETA _T("Beta 6") +#define WINUAEDATE MAKEBD(2012, 4, 13) #define WINUAEEXTRA _T("") //#define WINUAEEXTRA _T("AmiKit Preview") #define WINUAEREV _T("") diff --git a/od-win32/win32_scaler.cpp b/od-win32/win32_scaler.cpp index 7f58ce58..f2f06e73 100644 --- a/od-win32/win32_scaler.cpp +++ b/od-win32/win32_scaler.cpp @@ -591,12 +591,12 @@ static void statusline (void) SetRect (&sr, slx, 0, slx + lx, TD_TOTAL_HEIGHT); SetRect (&dr, slx, sly, slx + lx, sly + TD_TOTAL_HEIGHT); DirectDraw_BlitRect (tempsurf, &sr, NULL, &dr); - if (locksurface (tempsurf, &desc)) { + if (DirectDraw_LockSurface (tempsurf, &desc)) { for (y = 0; y < TD_TOTAL_HEIGHT; y++) { uae_u8 *buf = (uae_u8*)desc.lpSurface + y * desc.lPitch; draw_status_line_single (buf, dst_depth / 8, y, lx, rc, gc, bc, NULL); } - unlocksurface (tempsurf); + DirectDraw_UnlockSurface (tempsurf); DirectDraw_BlitRect (NULL, &dr, tempsurf, &sr); } } @@ -758,10 +758,10 @@ void S2X_render (void) if (tempsurf == NULL) return; if (cleartemp) { - clearsurface (tempsurf); + DirectDraw_ClearSurface (tempsurf); cleartemp = 0; } - if (!locksurface (tempsurf, &desc)) + if (!DirectDraw_LockSurface (tempsurf, &desc)) return; pitch = desc.lPitch; surfstart = (uae_u8*)desc.lpSurface; @@ -899,7 +899,7 @@ end: if (d3d) { ;//D3D_unlocktexture (); unlock in win32gfx.c } else { - unlocksurface (tempsurf); + DirectDraw_UnlockSurface (tempsurf); getfilterrect2 (&dr, &sr, &zr, dst_width, dst_height, aw, ah, scale, temp_width, temp_height); //write_log (_T("(%d %d %d %d) - (%d %d %d %d) (%d %d)\n"), dr.left, dr.top, dr.right, dr.bottom, sr.left, sr.top, sr.right, sr.bottom, zr.left, zr.top); @@ -918,7 +918,7 @@ end: void S2X_refresh (void) { - clearsurface (NULL); + DirectDraw_ClearSurface (NULL); S2X_render (); } diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 897abef0..97e9d258 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -1989,10 +1989,14 @@ static int modeswitchneeded (struct winuae_currentmode *wc) DirectDraw_Fill (NULL, 0); DirectDraw_BlitToPrimary (NULL); if (screen_is_picasso) { - if (currprefs.win32_rtgscaleifsmall && (wc->native_width > picasso96_state.Width || wc->native_height > picasso96_state.Height)) + if (currprefs.win32_rtgscaleifsmall && ((wc->native_width > picasso96_state.Width && wc->native_height >= picasso96_state.Height) || (wc->native_height > picasso96_state.Height && wc->native_width >= picasso96_state.Width))) return -1; if (currprefs.win32_rtgallowscaling && (picasso96_state.Width != wc->native_width || picasso96_state.Height != wc->native_height)) return -1; +#if 0 + if (wc->native_width < picasso96_state.Width || wc->native_height < picasso96_state.Height) + return 1; +#endif } return -1; } @@ -2302,7 +2306,7 @@ static int getbestmode (int nextbest) currentmode->native_height = pr->res.height; currentmode->current_width = currentmode->native_width; currentmode->current_height = currentmode->native_height; - break; + goto end; } } // still not match? check all modes @@ -2317,16 +2321,18 @@ static int getbestmode (int nextbest) currentmode->native_height = pr->res.height; currentmode->current_width = currentmode->native_width; currentmode->current_height = currentmode->native_height; - break; + goto end; } } index++; } +end: if (index >= 0) { currprefs.gfx_apmode[screen_is_picasso ? APMODE_RTG : APMODE_NATIVE].gfx_display = changed_prefs.gfx_apmode[screen_is_picasso ? APMODE_RTG : APMODE_NATIVE].gfx_display = index; currprefs.gfx_apmode[screen_is_picasso ? APMODE_RTG : APMODE_NATIVE].gfx_display_name[0] = changed_prefs.gfx_apmode[screen_is_picasso ? APMODE_RTG : APMODE_NATIVE].gfx_display_name[0] = 0; + write_log (L"Can't find mode %dx%d ->\n", currentmode->native_width, currentmode->native_height); write_log (L"Monitor switched to '%s'\n", md->adaptername); } return 1; @@ -2994,6 +3000,11 @@ static int create_windows_2 (void) regqueryint (NULL, _T("MainPosX"), &stored_x); regqueryint (NULL, _T("MainPosY"), &stored_y); + if (borderless) { + stored_x = currprefs.gfx_size_win.x; + stored_y = currprefs.gfx_size_win.y; + } + while (first) { first--; if (stored_x < GetSystemMetrics (SM_XVIRTUALSCREEN)) @@ -3083,7 +3094,7 @@ static int create_windows_2 (void) hAmigaWnd = CreateWindowEx (dxfs || d3dfs ? WS_EX_ACCEPTFILES | WS_EX_TOPMOST : WS_EX_ACCEPTFILES | WS_EX_TOOLWINDOW | (currprefs.win32_alwaysontop ? WS_EX_TOPMOST : 0), _T("AmigaPowah"), _T("WinUAE"), WS_POPUP, - x, y, w, h, + 0, 0, w, h, parent, NULL, hInst, NULL); } else { hAmigaWnd = CreateWindowEx ( @@ -3342,6 +3353,7 @@ static BOOL doInit (void) init_colors (); S2X_free (); + oldtex_w = oldtex_h = -1; if (currentmode->flags & DM_D3D) { const TCHAR *err = D3D_init (hAmigaWnd, currentmode->native_width, currentmode->native_height, currentmode->current_depth, screen_is_picasso ? 1 : currprefs.gfx_filter_filtermode + 1); if (err) { @@ -3355,7 +3367,6 @@ static BOOL doInit (void) ret = -1; goto oops; } - oldtex_w = oldtex_h = -1; target_graphics_buffer_update (); } @@ -3377,8 +3388,8 @@ bool target_graphics_buffer_update (void) int w, h; if (screen_is_picasso) { - w = picasso_vidinfo.width; - h = picasso_vidinfo.height; + w = picasso96_state.Width > picasso_vidinfo.width ? picasso96_state.Width : picasso_vidinfo.width; + h = picasso96_state.Height > picasso_vidinfo.height ? picasso96_state.Height : picasso_vidinfo.height; } else { struct vidbuffer *vb = gfxvidinfo.drawbuffer.tempbufferinuse ? &gfxvidinfo.tempbuffer : &gfxvidinfo.drawbuffer; gfxvidinfo.outbuffer = vb; @@ -3397,6 +3408,8 @@ bool target_graphics_buffer_update (void) S2X_free (); if (currentmode->flags & DM_D3D) { D3D_alloctexture (w, h); + } else { + DirectDraw_ClearSurface (NULL); } if (currentmode->flags & DM_SWSCALE) { S2X_init (currentmode->native_width, currentmode->native_height, currentmode->native_depth); diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 1699edfa..6fa45181 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -3783,7 +3783,7 @@ void InitializeListView (HWND hDlg) _stprintf (bootpri_str, _T("%d"), uci->bootpri); } else if (type == FILESYS_HARDFILE_RDB || type == FILESYS_HARDDRIVE || uci->controller) { _stprintf (blocksize_str, _T("%d"), uci->blocksize); - _tcscpy (devname_str, _T("n/a")); + _tcscpy (devname_str, _T("*UAE*")); _tcscpy (volname_str, _T("n/a")); _tcscpy (bootpri_str, _T("n/a")); if (!_tcsncmp (rootdir, _T("HD_"), 3)) @@ -12512,13 +12512,13 @@ static int *filtervars2[] = { struct filterpreset { TCHAR *name; - int conf[25]; + int conf[26]; }; static struct filterpreset filterpresets[] = { - { _T("PAL"), UAE_FILTER_PAL, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 1, 1, 0, 0, 0, 10, 0, 0, 0, 300, 30, 0, 0, 0 }, - { _T("D3D Autoscale"), UAE_FILTER_NULL, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1 }, - { _T("D3D Full Scaling"), UAE_FILTER_NULL, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0 }, + { _T("PAL"), UAE_FILTER_PAL, 0, 0, 0, 0, 0, 0, 0, 50, 0, 0, 1, 1, 0, 0, 0, 10, 0, 0, 0, 300, 30, 0, 0, 0, 0 }, + { _T("D3D Autoscale"), UAE_FILTER_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 4, 0 }, + { _T("D3D Full Scaling"), UAE_FILTER_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0 }, { NULL } }; @@ -12773,12 +12773,6 @@ static void values_to_hw3ddlg (HWND hDlg) j = 0; SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_RESETCONTENT, 0, 0L); - SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_ADDSTRING, 0, (LPARAM)_T("")); - for (i = 0; filterpresets[i].name; i++) { - TCHAR tmp[MAX_DPATH]; - _stprintf (tmp, _T("* %s"), filterpresets[i].name); - SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_ADDSTRING, 0, (LPARAM)tmp); - } fkey = regcreatetree (NULL, _T("FilterPresets")); if (fkey) { int idx = 0; @@ -12793,9 +12787,16 @@ static void values_to_hw3ddlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_ADDSTRING, 0, (LPARAM)tmp); idx++; } - SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_SETCURSEL, filterpreset_selected, 0); regclosetree (fkey); } + for (i = 0; filterpresets[i].name; i++) { + TCHAR tmp[MAX_DPATH]; + _stprintf (tmp, _T("* %s"), filterpresets[i].name); + SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_INSERTSTRING, i, (LPARAM)tmp); + } + SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_INSERTSTRING, 0, (LPARAM)_T("")); + SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_SETCURSEL, filterpreset_selected, 0); + int ho, vo, hz, vz; if (workprefs.gfx_filter_autoscale == AUTOSCALE_MANUAL) { hz = workprefs.gfx_xcenter_size; diff --git a/od-win32/winuae_msvc10/winuae_msvc.vcxproj b/od-win32/winuae_msvc10/winuae_msvc.vcxproj index 480675ba..1c8fb9e9 100644 --- a/od-win32/winuae_msvc10/winuae_msvc.vcxproj +++ b/od-win32/winuae_msvc10/winuae_msvc.vcxproj @@ -161,7 +161,7 @@ /MACHINE:I386 %(AdditionalOptions) - ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9d.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;enet.lib;prowizard.lib;lzmalib.lib;libFLAC_static.lib;Avrt.lib;hid.lib;%(AdditionalDependencies) + ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9d.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng15.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;enet.lib;prowizard.lib;lzmalib.lib;libFLAC_static.lib;Avrt.lib;hid.lib;%(AdditionalDependencies) NotSet $(OutDir)$(TargetName)$(TargetExt) true @@ -286,7 +286,7 @@ 0x0409 - ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;enet.lib;lzmalib.lib;prowizard.lib;libFLAC_static.lib;Avrt.lib;hid.lib;%(AdditionalDependencies) + ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;libpng15.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;enet.lib;lzmalib.lib;prowizard.lib;libFLAC_static.lib;Avrt.lib;hid.lib;zlibstat.lib;%(AdditionalDependencies) $(OutDir)$(TargetName)$(TargetExt) true %(AdditionalLibraryDirectories);$(SolutionDir)\..\lib\ @@ -430,7 +430,7 @@ 0x0409 - ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;avrt.lib;enet.lib;prowizard.lib;lzmalib.lib;libFLAC_static.lib;Avrt.lib;hid.lib;%(AdditionalDependencies) + ws2_32.lib;ddraw.lib;dxguid.lib;winmm.lib;comctl32.lib;version.lib;msacm32.lib;dsound.lib;dinput8.lib;d3d9.lib;d3dx9.lib;winio.lib;setupapi.lib;wininet.lib;dxerr.lib;shlwapi.lib;zlibstat.lib;libpng15.lib;lglcd.lib;wpcap.lib;packet.lib;openal32.lib;wintab32.lib;portaudio_x86.lib;vfw32.lib;wtsapi32.lib;avrt.lib;enet.lib;prowizard.lib;lzmalib.lib;libFLAC_static.lib;Avrt.lib;hid.lib;%(AdditionalDependencies) $(OutDir)$(TargetName)$(TargetExt) true %(AdditionalLibraryDirectories);$(SolutionDir)\..\lib\ diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 8c5a3895..1c482e55 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,9 +1,43 @@ -- cpu throttling -- custom event autofire -- cycle exact mode scanline sync + - restore only single input target to default. - hdd from command line +Beta 6: + +- Most CDFS RockRidge file comments were truncated. (Very stupid bug) +- CDFS media change still crashed in some situations. +- Show "UAE" as HD controller, not "n/a" (same as "IDE0" and others do) +- Improved fastest possible CPU throttle option. (Less CPU% usage) +- If fastest possible CPU does not have enough frame time for extra CPU emulation, reduce extra time in next frame to + prevent possible high CPU% usage and slowdowns. +- Fullwindow RTG, D3D and scaling in Expansion panel enabled: switching to bigger RTG resolution than max fullwindow crashed. (b2) +- Updated statically linked zlib and libpng to latest versions (1.2.6 and 1.5.10) +- Debugger basic math operators support (+-*/) added, for example "m 8+100*4" lists memory beginning from 0x408. Note that space + is not allowed because it is parameter separator. +- Borderblank didn't work if BPLCON3 was only written outside of displayable area (b5). This is still quite ugly implemention, + it should be done similar to COLOR0 handling but it would require too big changes. Later.. +- A2024 2 lowest RGB bits set correctly, was always cleared previously. +- Keyboard reset warning fixed (2.4.0) +- Fixed 1-3 line background color bar on top of screen in autoscale modes (2.4.0) +- USB joypad/joystick rawinput dpad diagonal movement fix. (2.4.0) + +Beta 5: + +- Left edge display limit fix, it was correct when in lores but OCS/ECS hires max overscan + (or AGA in 16-bit fetchmode) can start 8 pixels earlier. (ECS SuperPlus missing left edge) +- Tweaked programmed mode sync positioning algorithm. +- Use config file gfx_top_windowed and gfx_left_windowed top/left window coordinates if borderless mode. +- Sort filter presets alphabetically. +- When calculating autoscale position, restrict left and right side of display inside hsync end and start positions, + fixes really wide display in promoted modes. Note that autoscale can't work correctly in (some?) promoted + modes because viewable area is larger than visible bitmap = borders are visible. +- DirectDraw mode wasn't re-initialized correctly when window size changed causing blank screen. +- Borderblank didn't blank topmost lines and last line. (Old bug which usually wasn't visible until now) +- Clear display decision tables when switching modes to prevent old, now possibly unvailable lines to be visible in new mode. +- Possible fix for mouse pointer jumping to (0,0) when pressing buttons and running on some virtual machines. (2.3.3) + +Beta 4: + - 68020 CE mode statefile CPUTRACE (CPU state can be saved even in mid instruction) support was not complete, should fix "CPU trace: blah" errors when restoring statefiles. It can't fix already created broken statefiles. - Fix built-in CDFS lowercase conversion. Only convert to lower case if plain ISO-9660 (without RockRidge or Joliet) diff --git a/specialmonitors.cpp b/specialmonitors.cpp index 807a1a17..284cf961 100644 --- a/specialmonitors.cpp +++ b/specialmonitors.cpp @@ -385,11 +385,11 @@ static bool a2024(struct vidbuffer *src, struct vidbuffer *dst) } if (dbl == 1) { c1 = (c1 + c2 + 1) / 2; - c1 = (c1 << 6) | (c1 << 4) | (c1 << 2); + c1 = (c1 << 6) | (c1 << 4) | (c1 << 2) | (c1 << 0); PRGB(dst, dstp1, c1, c1, c1); } else { - c1 = (c1 << 6) | (c1 << 4) | (c1 << 2); - c2 = (c2 << 6) | (c2 << 4) | (c2 << 2); + c1 = (c1 << 6) | (c1 << 4) | (c1 << 2) | (c1 << 0); + c2 = (c2 << 6) | (c2 << 4) | (c2 << 2) | (c2 << 0); PRGB(dst, dstp1, c1, c1, c1); PRGB(dst, dstp2, c2, c2, c2); dstp2 += dst->pixbytes; -- 2.47.3