From 2144b3a7e97470cb0ea966185981240ba2115e5b Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Thu, 24 Jan 2008 19:43:21 +0200 Subject: [PATCH] imported winuaesrc1460b8.zip --- blitter.c | 31 +++++--------- cfgfile.c | 12 ++++-- custom.c | 13 +++++- debug.c | 77 ++++++++++++++++++++++++++++++----- drawing.c | 2 +- include/custom.h | 3 -- include/debug.h | 2 + include/newcpu.h | 1 + include/options.h | 3 ++ inputdevice.c | 2 +- newcpu.c | 2 +- od-win32/resources/resource | 5 ++- od-win32/resources/resource.h | 3 ++ od-win32/resources/winuae.rc | 5 ++- od-win32/rp.c | 13 ++++-- od-win32/screenshot.c | 26 +++++++++++- od-win32/win32.h | 4 +- od-win32/win32_scale2x.c | 58 ++++++++++++++++++-------- od-win32/win32gfx.c | 9 ++-- od-win32/win32gui.c | 19 ++++++++- od-win32/winuaechangelog.txt | 15 +++++++ 21 files changed, 233 insertions(+), 72 deletions(-) diff --git a/blitter.c b/blitter.c index 20a5990b..fadb1df5 100644 --- a/blitter.c +++ b/blitter.c @@ -24,6 +24,7 @@ #include "blitter.h" #include "blit.h" #include "savestate.h" +#include "debug.h" /* we must not change ce-mode while blitter is running.. */ static int blitter_cycle_exact; @@ -653,7 +654,7 @@ void blitter_handler (uae_u32 data) /* "free" blitter in immediate mode if it has been "stuck" ~3 frames * fixes some JIT game incompatibilities */ - write_log ("Blitter force-unstuck!\n"); + debugtest (DEBUGTEST_BLITTER, "force-unstuck!\n"); } blitter_stuck = 0; if (blit_slowdown > 0 && !currprefs.immediate_blits) { @@ -927,35 +928,24 @@ static void blit_bltset (int con) if (blitline) { if (blt_info.hblitsize != 2) - write_log ("weird hblitsize in linemode: %d vsize=%d PC%=%x\n", - blt_info.hblitsize, blt_info.vblitsize, m68k_getpc (®s)); + debugtest (DEBUGTEST_BLITTER, "weird hblitsize in linemode: %d vsize=%d\n", + blt_info.hblitsize, blt_info.vblitsize); blit_diag = blit_cycle_diagram_line; } else { if (con & 2) { blitfc = !!(bltcon1 & 0x4); blitife = bltcon1 & 0x8; if ((bltcon1 & 0x18) == 0x18) { - /* Digital "Trash" demo does this; others too. Apparently, no - * negative effects. */ - static int warn = 1; - if (warn) - write_log ("warning: weird fill mode (further messages suppressed) PC=%x\n", - m68k_getpc (®s)); - warn = 0; + debugtest (DEBUGTEST_BLITTER, "weird fill mode\n"); blitife = 0; } } - if (blitfill && !blitdesc) { - static int warn = 1; - if (warn) - write_log ("warning: blitter fill without desc (further messages suppressed) PC=%x\n", - m68k_getpc (®s)); - warn = 0; - } + if (blitfill && !blitdesc) + debugtest (DEBUGTEST_BLITTER, "fill without desc\n"); blit_diag = blitfill ? blit_cycle_diagram_fill[blit_ch] : blit_cycle_diagram[blit_ch]; } if ((bltcon1 & 0x80) && (currprefs.chipset_mask & CSMASK_ECS_AGNUS)) - write_log ("warning: ECS BLTCON1 DOFF-bit set\n"); + debugtest (DEBUGTEST_BLITTER, "ECS BLTCON1 DOFF-bit set\n"); blit_dmacount = blit_dmacount2 = 0; blit_nod = 1; @@ -1091,9 +1081,8 @@ void maybe_blit (int hpos, int hack) #ifndef BLITTER_DEBUG warned = 1; #endif - if (m68k_getpc (®s) < 0xe0000 || m68k_getpc (®s) >= 0x10000000) - write_log ("warning: Program does not wait for blitter %p vpos=%d tc=%d\n", - m68k_getpc (®s), vpos, blit_cyclecounter); + debugtest (DEBUGTEST_BLITTER, "program does not wait for blitter vpos=%d tc=%d\n", + vpos, blit_cyclecounter); } if (blitter_cycle_exact) { diff --git a/cfgfile.c b/cfgfile.c index 8ba2d3ae..21580576 100644 --- a/cfgfile.c +++ b/cfgfile.c @@ -565,6 +565,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_dwrite (f, "gfx_filter_gamma=%d\n", p->gfx_filter_gamma); cfgfile_dwrite (f, "gfx_filter_blur=%d\n", p->gfx_filter_blur); cfgfile_dwrite (f, "gfx_filter_noise=%d\n", p->gfx_filter_noise); + cfgfile_dwrite (f, "gfx_filter_upscale=%s\n", p->gfx_filter_upscale ? "true" : "false"); cfgfile_dwrite (f, "gfx_luminance=%d\n", p->gfx_luminance); cfgfile_dwrite (f, "gfx_contrast=%d\n", p->gfx_contrast); @@ -614,6 +615,8 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_dwrite (f, "scsi_a4000t=%s\n", p->cs_mbdmac == 2 ? "true" : "false"); cfgfile_dwrite (f, "bogomem_fast=%s\n", p->cs_slowmemisfast ? "true" : "false"); cfgfile_dwrite (f, "resetwarning=%s\n", p->cs_resetwarning ? "true" : "false"); + cfgfile_dwrite (f, "denise_noehb=%s\n", p->cs_denisenoehb ? "true" : "false"); + cfgfile_dwrite (f, "agnus_bltbusybug=%s\n", p->cs_agnusbltbusybug ? "true" : "false"); cfgfile_write (f, "fastmem_size=%d\n", p->fastmem_size / 0x100000); cfgfile_write (f, "a3000mem_size=%d\n", p->mbresmem_low_size / 0x100000); @@ -880,6 +883,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, char *option, char *value) || cfgfile_intval (option, value, "gfx_filter_gamma", &p->gfx_filter_gamma, 1) || cfgfile_intval (option, value, "gfx_filter_blur", &p->gfx_filter_blur, 1) || cfgfile_intval (option, value, "gfx_filter_noise", &p->gfx_filter_noise, 1) + || cfgfile_yesno (option, value, "gfx_filter_upscale", &p->gfx_filter_upscale) || cfgfile_intval (option, value, "gfx_luminance", &p->gfx_luminance, 1) || cfgfile_intval (option, value, "gfx_contrast", &p->gfx_contrast, 1) || cfgfile_intval (option, value, "gfx_gamma", &p->gfx_gamma, 1) @@ -1302,6 +1306,8 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, char *option, char *valu || cfgfile_yesno (option, value, "ksmirror_e0", &p->cs_ksmirror_e0) || cfgfile_yesno (option, value, "ksmirror_a8", &p->cs_ksmirror_a8) || cfgfile_yesno (option, value, "resetwarning", &p->cs_resetwarning) + || cfgfile_yesno (option, value, "denise_noehb", &p->cs_denisenoehb) + || cfgfile_yesno (option, value, "agnus_bltbusybug", &p->cs_agnusbltbusybug) || cfgfile_yesno (option, value, "kickshifter", &p->kickshifter) || cfgfile_yesno (option, value, "ntsc", &p->ntscmode) @@ -3234,9 +3240,10 @@ static int bip_a1000 (struct uae_prefs *p, int config, int compa, int romcheck) set_68000_compa (p, compa); p->dfxtype[1] = DRV_NONE; p->cs_compatible = CP_A1000; + p->cs_slowmemisfast = 1; built_in_chipset_prefs (p); if (config > 0) - p->chipset_mask |= CSMASK_NO_EHB; + p->cs_denisenoehb = 1; if (config > 1) p->chipmem_size = 0x40000; return configure_rom (p, roms, romcheck); @@ -3546,7 +3553,6 @@ int built_in_chipset_prefs (struct uae_prefs *p) if (!p->cs_compatible) return 1; - p->chipset_mask &= ~CSMASK_BUGS; p->cs_a1000ram = 0; p->cs_cd32c2p = p->cs_cd32cd = p->cs_cd32nvram = 0; p->cs_cdtvcd = p->cs_cdtvram = 0; @@ -3605,7 +3611,7 @@ int built_in_chipset_prefs (struct uae_prefs *p) p->cs_ciaatod = p->ntscmode ? 2 : 1; p->cs_ksmirror_e0 = 0; p->cs_rtc = 0; - p->chipset_mask |= CSMASK_BLTBUSY_BUG; + p->cs_agnusbltbusybug = 1; break; case CP_A1200: // A1200 p->cs_ide = 1; diff --git a/custom.c b/custom.c index 942574fc..8de41899 100644 --- a/custom.c +++ b/custom.c @@ -2467,7 +2467,7 @@ STATIC_INLINE uae_u16 DMACONR (void) { uae_u16 v; decide_blitter (current_hpos ()); - v = dmacon | (bltstate == BLT_done || (bltstate != BLT_done && (currprefs.chipset_mask & CSMASK_BLTBUSY_BUG) && !blt_info.got_cycle) ? 0 : 0x4000) + v = dmacon | (bltstate == BLT_done || (bltstate != BLT_done && currprefs.cs_agnusbltbusybug && !blt_info.got_cycle) ? 0 : 0x4000) | (blt_info.blitzero ? 0x2000 : 0); return v; } @@ -2688,9 +2688,20 @@ static void DMACON (int hpos, uae_u16 v) events_schedule(); } +static int irq_nmi; + +void NMI_delayed (void) +{ + irq_nmi = 1; +} + int intlev (void) { uae_u16 imask = intreq & intena; + if (irq_nmi) { + irq_nmi = 0; + return 7; + } if (!(imask && (intena & 0x4000))) return -1; if (imask & (0x4000 | 0x2000)) // 13 14 diff --git a/debug.c b/debug.c index c5c8e9d3..63364d5c 100644 --- a/debug.c +++ b/debug.c @@ -148,7 +148,7 @@ void debug_help (void) static int debug_linecounter; #define MAX_LINECOUNTER 1000 -static int debug_out (const char *format,...) +static int debug_out (const char *format, ...) { va_list parms; char buffer[4000]; @@ -2233,6 +2233,60 @@ static int staterecorder (char **cc) return 0; } +static int debugtest_modes[DEBUGTEST_MAX]; +static const char *debugtest_names[] = { + "Blitter", "Keyboard", "Floppy" +}; + +void debugtest (enum debugtest_item di, const char *format, ...) +{ + va_list parms; + char buffer[1000]; + + if (!debugtest_modes[di]) + return; + va_start (parms, format); + _vsnprintf (buffer, 1000 - 1, format, parms); + va_end (parms); + write_log ("%s PC=%08X: %s\n", debugtest_names[di], M68K_GETPC, buffer); + if (debugtest_modes[di] == 2) + activate_debugger (); +} + +static void debugtest_set (char **inptr) +{ + int i, val, val2; + ignore_ws (inptr); + + val2 = 1; + if (!more_params (inptr)) { + for (i = 0; i < DEBUGTEST_MAX; i++) + debugtest_modes[i] = 0; + console_out ("all debugtests disabled\n"); + return; + } + val = readint (inptr); + if (more_params (inptr)) { + val2 = readint (inptr); + if (val2 > 0) + val2 = 2; + } + if (val < 0) { + for (i = 0; i < DEBUGTEST_MAX; i++) + debugtest_modes[i] = val2; + console_out ("all debugtests enabled\n"); + return; + } + if (val >= 0 && val < DEBUGTEST_MAX) { + if (debugtest_modes[val]) + debugtest_modes[val] = 0; + else + debugtest_modes[val] = val2; + console_out ("debugtest '%s': %s. break = %s\n", + debugtest_names[val], debugtest_modes[val] ? "on" :"off", val2 == 2 ? "on" : "off"); + } +} + static void disk_debug(char **inptr) { char parm[10]; @@ -2240,14 +2294,14 @@ static void disk_debug(char **inptr) if (**inptr == 'd') { (*inptr)++; - ignore_ws(inptr); - disk_debug_logging = readint(inptr); + ignore_ws (inptr); + disk_debug_logging = readint (inptr); console_out ("disk logging level %d\n", disk_debug_logging); return; } disk_debug_mode = 0; disk_debug_track = -1; - ignore_ws(inptr); + ignore_ws (inptr); if (!next_string (inptr, parm, sizeof (parm), 1)) goto end; for (i = 0; i < strlen(parm); i++) { @@ -2426,16 +2480,19 @@ static void debug_1 (void) case 'd': { if (*inptr == 'i') { - next_char(&inptr); - disk_debug(&inptr); - } else if(*inptr == 'j') { + next_char (&inptr); + disk_debug (&inptr); + } else if (*inptr == 'j') { inptr++; inputdevice_logging = 1 | 2; - if (more_params(&inptr)) + if (more_params (&inptr)) inputdevice_logging = readint(&inptr); console_out("input logging level %d\n", inputdevice_logging); - } else if(*inptr == 'm') { - memory_map_dump_2(0); + } else if (*inptr == 'm') { + memory_map_dump_2 (0); + } else if (*inptr == 't') { + next_char (&inptr); + debugtest_set (&inptr); } else { uae_u32 daddr; int count; diff --git a/drawing.c b/drawing.c index 2ad5007a..6d63ad45 100644 --- a/drawing.c +++ b/drawing.c @@ -1604,7 +1604,7 @@ static void pfield_expand_dp_bplcon (void) else if (currprefs.chipset_mask & CSMASK_ECS_DENISE) bplehb = (dp_for_drawing->bplcon0 & 0xFC00) == 0x6000 && !(dp_for_drawing->bplcon2 & 0x200); else - bplehb = (dp_for_drawing->bplcon0 & 0xFC00) == 0x6000 && !(currprefs.chipset_mask & CSMASK_NO_EHB); + bplehb = (dp_for_drawing->bplcon0 & 0xFC00) == 0x6000 && !currprefs.cs_denisenoehb; plf1pri = dp_for_drawing->bplcon2 & 7; plf2pri = (dp_for_drawing->bplcon2 >> 3) & 7; diff --git a/include/custom.h b/include/custom.h index 01d48995..984a6ea5 100644 --- a/include/custom.h +++ b/include/custom.h @@ -13,9 +13,6 @@ #define CSMASK_ECS_AGNUS 1 #define CSMASK_ECS_DENISE 2 #define CSMASK_AGA 4 -#define CSMASK_BUGS 0x300 -#define CSMASK_NO_EHB 0x100 -#define CSMASK_BLTBUSY_BUG 0x200 uae_u32 get_copper_address(int copno); diff --git a/include/debug.h b/include/debug.h index f825d891..083fe502 100644 --- a/include/debug.h +++ b/include/debug.h @@ -64,6 +64,8 @@ void debug_bputpeek(uaecptr addr, uae_u32 v); void debug_wputpeek(uaecptr addr, uae_u32 v); void debug_lputpeek(uaecptr addr, uae_u32 v); +enum debugtest_item { DEBUGTEST_BLITTER, DEBUGTEST_KEYBOARD, DEBUGTEST_FLOPPY, DEBUGTEST_MAX }; +void debugtest (enum debugtest_item, const char *, ...); #else diff --git a/include/newcpu.h b/include/newcpu.h index 6f5731fb..cb9866a9 100644 --- a/include/newcpu.h +++ b/include/newcpu.h @@ -305,6 +305,7 @@ extern void REGPARAM3 MakeSR (struct regstruct *regs) REGPARAM; extern void REGPARAM3 MakeFromSR (struct regstruct *regs) REGPARAM; extern void REGPARAM3 Exception (int, struct regstruct *regs, uaecptr) REGPARAM; extern void NMI (void); +extern void NMI_delayed (void); extern void doint (void); extern void dump_counts (void); extern int m68k_move2c (int, uae_u32 *); diff --git a/include/options.h b/include/options.h index aa48032f..61ccfb83 100644 --- a/include/options.h +++ b/include/options.h @@ -179,6 +179,7 @@ struct uae_prefs { int gfx_filter_filtermode; int gfx_filter_noise, gfx_filter_blur; int gfx_filter_saturation, gfx_filter_luminance, gfx_filter_contrast, gfx_filter_gamma; + int gfx_filter_upscale; int immediate_blits; unsigned int chipset_mask; @@ -227,6 +228,8 @@ struct uae_prefs { int cs_df0idhw; int cs_slowmemisfast; int cs_resetwarning; + int cs_denisenoehb; + int cs_agnusbltbusybug; char df[4][MAX_DPATH]; char dfxlist[MAX_SPARE_DRIVES][MAX_DPATH]; diff --git a/inputdevice.c b/inputdevice.c index c8e54b2e..398ee0ad 100644 --- a/inputdevice.c +++ b/inputdevice.c @@ -1606,7 +1606,7 @@ void inputdevice_handle_inputcode (void) disk_eject (3); break; case AKS_IRQ7: - NMI (); + NMI_delayed (); break; case AKS_PAUSE: pausemode (-1); diff --git a/newcpu.c b/newcpu.c index 27bddcc0..28f4f11c 100644 --- a/newcpu.c +++ b/newcpu.c @@ -2038,7 +2038,7 @@ STATIC_INLINE int do_specialties (int cycles, struct regstruct *regs) if (regs->spcflags & SPCFLAG_INT) { int intr = intlev (); unset_special (regs, SPCFLAG_INT | SPCFLAG_DOINT); - if (intr != -1 && intr > regs->intmask) + if (intr != -1 && (intr > regs->intmask || intr == 7)) do_interrupt (intr, regs); } if (regs->spcflags & SPCFLAG_DOINT) { diff --git a/od-win32/resources/resource b/od-win32/resources/resource index 05034144..05fa1123 100644 --- a/od-win32/resources/resource +++ b/od-win32/resources/resource @@ -688,6 +688,8 @@ #define IDC_FILTERVO 1619 #define IDC_AVIOUTPUT_8BIT 1620 #define IDC_INPREC_PLAY 1620 +#define IDC_FILTERENABLE2 1620 +#define IDC_FILTERUPSCALE 1620 #define IDC_AVIOUTPUT_24BIT 1621 #define IDC_AVIOUTPUT_WIDTH 1622 #define IDC_AVIOUTPUT_HEIGHT 1623 @@ -882,10 +884,11 @@ #define IDC_DBG_DREG 1742 #define IDC_CS_CIAOVERLAY 1742 #define IDC_DBG_AREG 1743 -#define IDC_CS_KSMIRROR_E1 1743 #define IDC_CS_RESETWARNING 1743 #define IDC_DBG_CCR 1744 +#define IDC_CS_NOEHB 1744 #define IDC_DBG_AMEM 1745 +#define IDC_CS_BLITTERBUG 1745 #define IDC_DBG_SP_VBR 1746 #define IDC_DBG_MMISC 1747 #define IDC_DBG_PC 1748 diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index 0226c6a4..8632c669 100644 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -688,6 +688,7 @@ #define IDC_FILTERVO 1619 #define IDC_AVIOUTPUT_8BIT 1620 #define IDC_INPREC_PLAY 1620 +#define IDC_FILTERUPSCALE 1620 #define IDC_AVIOUTPUT_24BIT 1621 #define IDC_AVIOUTPUT_WIDTH 1622 #define IDC_AVIOUTPUT_HEIGHT 1623 @@ -884,7 +885,9 @@ #define IDC_DBG_AREG 1743 #define IDC_CS_RESETWARNING 1743 #define IDC_DBG_CCR 1744 +#define IDC_CS_NOEHB 1744 #define IDC_DBG_AMEM 1745 +#define IDC_CS_BLITTERBUG 1745 #define IDC_DBG_SP_VBR 1746 #define IDC_DBG_MMISC 1747 #define IDC_DBG_PC 1748 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 941d2356..6537db95 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -590,6 +590,8 @@ BEGIN CONTROL "ROM Mirror (E0)",IDC_CS_KSMIRROR_E0,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,146,80,10 CONTROL "CIA ROM Overlay",IDC_CS_CIAOVERLAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,95,80,10 CONTROL "KB Reset Warning",IDC_CS_RESETWARNING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,159,80,10 + CONTROL "No-EHB Denise",IDC_CS_NOEHB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,94,159,80,10 + CONTROL "Blitter Busy Bug",IDC_CS_BLITTERBUG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,187,159,80,10 END IDD_AVIOUTPUT DIALOGEX 0, 0, 288, 203 @@ -679,8 +681,9 @@ BEGIN PUSHBUTTON "Delete",IDC_FILTERPRESETDELETE,236,200,47,14 COMBOBOX IDC_FILTERHZMULT,67,43,27,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP COMBOBOX IDC_FILTERVZMULT,67,63,27,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP - CONTROL "Autoscale",IDC_FILTERAUTORES,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,26,168,63,10 + CONTROL "Autoscale",IDC_FILTERAUTORES,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,9,168,63,10 COMBOBOX IDC_FILTERXTRA,105,130,138,150,CBS_DROPDOWNLIST | CBS_HASSTRINGS | WS_VSCROLL | WS_TABSTOP + CONTROL "Full screen filter",IDC_FILTERUPSCALE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,9,153,87,10 END IDD_HARDDRIVE DIALOGEX 0, 0, 380, 76 diff --git a/od-win32/rp.c b/od-win32/rp.c index 0fbc3438..cb8a8a6a 100644 --- a/od-win32/rp.c +++ b/od-win32/rp.c @@ -169,9 +169,6 @@ static LRESULT CALLBACK RPHostMsgFunction(UINT uMessage, WPARAM wParam, LPARAM l currprefs.sound_volume = changed_prefs.sound_volume = wParam; set_volume (currprefs.sound_volume, 0); return TRUE; - case RPIPCHM_SCREENCAPTURE: - screenshot (1, 1); - return TRUE; case RPIPCHM_MINIMIZE: minimized = 1; if (ShowWindow (hAmigaWnd, SW_MINIMIZE)) @@ -234,7 +231,15 @@ static LRESULT CALLBACK RPHostMsgFunction(UINT uMessage, WPARAM wParam, LPARAM l xfree (s); return TRUE; } - + case RPIPCHM_SCREENCAPTURE: + { + extern int screenshotf (const char *spath, int mode, int doprepare); + int ok; + char *s = ua ((WCHAR*)pData); + ok = screenshotf (s, 1, 1); + xfree (s); + return ok ? TRUE : FALSE; + } } return FALSE; diff --git a/od-win32/screenshot.c b/od-win32/screenshot.c index c8f53c73..5fe20d47 100644 --- a/od-win32/screenshot.c +++ b/od-win32/screenshot.c @@ -221,16 +221,17 @@ static int savebmp(FILE *fp) /* Captures the Amiga display (DirectDraw, D3D or OpenGL) surface and saves it to file as a 24bit bitmap. */ -void screenshot(int mode, int doprepare) +int screenshotf (const char *spath, int mode, int doprepare) { static int recursive; FILE *fp = NULL; + int allok = 0; HBITMAP offscreen_bitmap = NULL; // bitmap that is converted to a DIB HDC offscreen_dc = NULL; // offscreen DC that we can select offscreen bitmap into if(recursive) - return; + return 0; recursive++; @@ -248,6 +249,20 @@ void screenshot(int mode, int doprepare) char underline[] = "_"; int number = 0; + if (spath) { + fp = fopen (spath, "wb"); + if (fp) { +#if PNG_SCREENSHOTS > 0 + if (screenshotmode) + allok = savepng (fp); + else +#endif + allok = savebmp (fp); + fclose (fp); + fp = NULL; + goto oops; + } + } fetch_path ("ScreenshotPath", path, sizeof (path)); CreateDirectory (path, NULL); name[0] = 0; @@ -276,6 +291,7 @@ void screenshot(int mode, int doprepare) if (!ok) goto oops; write_log ("Screenshot saved as \"%s\"\n", filename); + allok = 1; break; } fclose (fp); @@ -291,5 +307,11 @@ oops: screenshot_free(); recursive--; + + return allok; } +void screenshot (int mode, int doprepare) +{ + screenshotf (NULL, mode, doprepare); +} diff --git a/od-win32/win32.h b/od-win32/win32.h index 144c2a07..9b02b1dd 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -15,9 +15,9 @@ #define GETBDM(x) (((x) - ((x / 10000) * 10000)) / 100) #define GETBDD(x) ((x) % 100) -#define WINUAEBETA 7 +#define WINUAEBETA 8 #define WINUAEPUBLICBETA 1 -#define WINUAEDATE MAKEBD(2008, 1, 21) +#define WINUAEDATE MAKEBD(2008, 1, 24) #define WINUAEEXTRA "" #define WINUAEREV "" diff --git a/od-win32/win32_scale2x.c b/od-win32/win32_scale2x.c index 21b4a8e0..349c51dc 100644 --- a/od-win32/win32_scale2x.c +++ b/od-win32/win32_scale2x.c @@ -39,7 +39,6 @@ struct uae_filter uaefilters[] = static int dst_width, dst_height, amiga_width, amiga_height, amiga_depth, dst_depth, scale; uae_u8 *bufmem_ptr; -int bufmem_width, bufmem_height; static int tempsurf; static uae_u8 *tempsurf2, *tempsurf3; @@ -115,30 +114,43 @@ void S2X_init (int dw, int dh, int aw, int ah, int mult, int ad, int dd) void S2X_render (void) { int aw = amiga_width, ah = amiga_height, v, pitch; - uae_u8 *dptr, *sptr, *endsptr; + uae_u8 *dptr, *enddptr, *sptr, *endsptr; int ok = 0, temp_needed = 0; RECT sr, dr; HRESULT ddrval; LPDIRECTDRAWSURFACE7 dds; DDSURFACEDESC2 desc; + int dst_width2 = dst_width; + int dst_height2 = dst_height; + int dst_width3 = dst_width; + int dst_height3 = dst_height; + int scale2 = scale; + + if (currprefs.gfx_filter_upscale) { + dst_width2 = amiga_width; + dst_height2 = amiga_height; + dst_width3 = amiga_width * scale; + dst_height3 = amiga_height * scale; + scale2 = 1; + } sptr = gfxvidinfo.bufmem; - v = (dst_width - amiga_width) / 2; + v = (dst_width2 - amiga_width) / 2; aw += v; sptr -= v * (amiga_depth / 8); - v = (dst_height - amiga_height) / 2; + v = (dst_height2 - amiga_height) / 2; ah += v; sptr -= v * gfxvidinfo.rowbytes; endsptr = gfxvidinfo.bufmemend; v = currprefs.gfx_filter ? currprefs.gfx_filter_horiz_offset : 0; - v += (dst_width / scale - amiga_width) / 8; + v += (dst_width3 / scale - amiga_width) / 8; sptr += (int)(-v * 4.0 / 10.0) * (amiga_depth / 8); aw -= (int)(-v * 4.0 / 10); v = currprefs.gfx_filter ? currprefs.gfx_filter_vert_offset : 0; - v += (dst_height / scale - amiga_height) / 8; + v += (dst_height3 / scale - amiga_height) / 8; sptr += (int)(-v * 4.0 / 10.0) * gfxvidinfo.rowbytes; ah -= (int)(-v * 4.0 / 10); @@ -154,18 +166,23 @@ void S2X_render (void) if (currprefs.gfx_filter && (currprefs.gfx_filter_horiz_zoom || currprefs.gfx_filter_vert_zoom || currprefs.gfx_filter_horiz_zoom_mult != 1000 || - currprefs.gfx_filter_vert_zoom_mult != 1000)) { - int wz = dst_width * currprefs.gfx_filter_horiz_zoom_mult / 1000; - int hz = dst_height * currprefs.gfx_filter_vert_zoom_mult / 1000; + currprefs.gfx_filter_vert_zoom_mult != 1000 || currprefs.gfx_filter_upscale)) { + + int wz = dst_width3 * currprefs.gfx_filter_horiz_zoom_mult / 1000; + int hz = dst_height3 * currprefs.gfx_filter_vert_zoom_mult / 1000; + wz += currprefs.gfx_filter_horiz_zoom / 4; hz += currprefs.gfx_filter_vert_zoom / 4; - sr.left = (dst_width - wz) / 2; - sr.top = (dst_height - hz) / 2; - sr.right = sr.left + wz; - sr.bottom = sr.top + hz; + + sr.left = (dst_width3 - wz) / 2; + sr.top = (dst_height3 - hz) / 2; + sr.right = sr.left + wz; + sr.bottom = sr.top + hz; + dr.left = dr.top = 0; dr.right = dst_width; dr.bottom = dst_height; + if (sr.left >= sr.right) { sr.left = dst_width / 2 - 1; sr.right = dst_width / 2 + 1; @@ -191,16 +208,20 @@ void S2X_render (void) sr.bottom = sr.top + dst_height; } + if (currprefs.gfx_filter_upscale) { + dr.left = dr.top = 0; + dr.right = dst_width; + dr.bottom = dst_height; + } + if (tempsurf && sr.left != 0 || sr.top != 0 || sr.right != dst_width || sr.bottom != dst_height || - dr.top != 0 || dr.right != dst_width || dr.left != 0 || dr.bottom != dst_height) { + dr.top != 0 || dr.right != dst_width || dr.left != 0 || dr.bottom != dst_height || currprefs.gfx_filter_upscale) { dds = DirectDrawState.temporary.surface; temp_needed = 1; } } bufmem_ptr = sptr; - bufmem_width = aw; - bufmem_height = ah; if (temp_needed) { desc.dwSize = sizeof (desc); @@ -221,6 +242,7 @@ void S2X_render (void) dptr = DirectDraw_GetSurfacePointer (); pitch = DirectDraw_GetSurfacePitch (); } + enddptr = dptr + pitch * dst_height; if (!dptr) /* weird things can happen */ goto end; @@ -261,6 +283,10 @@ void S2X_render (void) sptr2 += w; dptr += pitch; } + while (i < dst_height && dptr < enddptr) { + memset (dptr, 0, dst_width * dst_depth / 8); + dptr += pitch; + } } } else if (usedfilter->type == UAE_FILTER_SUPEREAGLE) { /* 16/2X */ diff --git a/od-win32/win32gfx.c b/od-win32/win32gfx.c index 72b58a39..fe9742be 100644 --- a/od-win32/win32gfx.c +++ b/od-win32/win32gfx.c @@ -655,7 +655,8 @@ void sortdisplays (void) int w = DirectDraw_CurrentWidth (); int h = DirectDraw_CurrentHeight (); int b = DirectDraw_GetSurfaceBitCount (); - write_log ("Desktop: W=%d H=%d B=%d\n", w, h, b); + write_log ("Desktop: W=%d H=%d B=%d. CXVS=%d CYVS=%d\n", w, h, b, + GetSystemMetrics(SM_CXVIRTUALSCREEN), GetSystemMetrics(SM_CYVIRTUALSCREEN)); DirectDraw_EnumDisplayModes (DDEDM_REFRESHRATES , modesCallback); //dhack(); sortmodes (); @@ -1117,6 +1118,7 @@ int check_prefs_changed_gfx (void) c |= currprefs.gfx_filter_scanlines != changed_prefs.gfx_filter_scanlines ? (1|8) : 0; c |= currprefs.gfx_filter_scanlinelevel != changed_prefs.gfx_filter_scanlinelevel ? (1|8) : 0; c |= currprefs.gfx_filter_scanlineratio != changed_prefs.gfx_filter_scanlineratio ? (1|8) : 0; + c |= currprefs.gfx_filter_upscale != changed_prefs.gfx_filter_upscale ? (1|8) : 0; c |= currprefs.gfx_filter_luminance != changed_prefs.gfx_filter_luminance ? (1|8) : 0; c |= currprefs.gfx_filter_contrast != changed_prefs.gfx_filter_contrast ? (1|8) : 0; c |= currprefs.gfx_filter_saturation != changed_prefs.gfx_filter_saturation ? (1|8) : 0; @@ -1162,6 +1164,7 @@ int check_prefs_changed_gfx (void) currprefs.gfx_filter_scanlines = changed_prefs.gfx_filter_scanlines; currprefs.gfx_filter_scanlinelevel = changed_prefs.gfx_filter_scanlinelevel; currprefs.gfx_filter_scanlineratio = changed_prefs.gfx_filter_scanlineratio; + currprefs.gfx_filter_upscale = changed_prefs.gfx_filter_upscale; currprefs.gfx_filter_luminance = changed_prefs.gfx_filter_luminance; currprefs.gfx_filter_contrast = changed_prefs.gfx_filter_contrast; currprefs.gfx_filter_saturation = changed_prefs.gfx_filter_saturation; @@ -2192,8 +2195,8 @@ static BOOL doInit (void) fs_warning = IDS_UNSUPPORTEDSCREENMODE_1; } else if (colortype == RGBFB_CLUT && DirectDraw_GetSurfaceBitCount() != 8) { fs_warning = IDS_UNSUPPORTEDSCREENMODE_2; - } else if (currentmode->current_width >= GetSystemMetrics(SM_CXVIRTUALSCREEN) || - currentmode->current_height >= GetSystemMetrics(SM_CYVIRTUALSCREEN)) { + } else if (currentmode->current_width > GetSystemMetrics(SM_CXVIRTUALSCREEN) || + currentmode->current_height > GetSystemMetrics(SM_CYVIRTUALSCREEN)) { if (!console_logging) fs_warning = IDS_UNSUPPORTEDSCREENMODE_3; #ifdef PICASSO96 diff --git a/od-win32/win32gui.c b/od-win32/win32gui.c index fb5c9485..03385d28 100644 --- a/od-win32/win32gui.c +++ b/od-win32/win32gui.c @@ -4293,6 +4293,8 @@ static void values_to_chipsetdlg2 (HWND hDlg) } CheckDlgButton (hDlg, IDC_CS_COMPATIBLE, workprefs.cs_compatible); CheckDlgButton (hDlg, IDC_CS_RESETWARNING, workprefs.cs_resetwarning); + CheckDlgButton (hDlg, IDC_CS_NOEHB, workprefs.cs_denisenoehb); + CheckDlgButton (hDlg, IDC_CS_BLITTERBUG, workprefs.cs_agnusbltbusybug); CheckDlgButton (hDlg, IDC_CS_KSMIRROR_E0, workprefs.cs_ksmirror_e0); CheckDlgButton (hDlg, IDC_CS_KSMIRROR_A8, workprefs.cs_ksmirror_a8); CheckDlgButton (hDlg, IDC_CS_CIAOVERLAY, workprefs.cs_ciaoverlay); @@ -4366,6 +4368,8 @@ static void values_from_chipsetdlg2 (HWND hDlg, UINT msg, WPARAM wParam, LPARAM workprefs.cs_compatible = IsDlgButtonChecked (hDlg, IDC_CS_COMPATIBLE); workprefs.cs_resetwarning = IsDlgButtonChecked (hDlg, IDC_CS_RESETWARNING); + workprefs.cs_denisenoehb = IsDlgButtonChecked (hDlg, IDC_CS_NOEHB); + workprefs.cs_agnusbltbusybug = IsDlgButtonChecked (hDlg, IDC_CS_BLITTERBUG); workprefs.cs_ksmirror_e0 = IsDlgButtonChecked (hDlg, IDC_CS_KSMIRROR_E0); workprefs.cs_ksmirror_a8 = IsDlgButtonChecked (hDlg, IDC_CS_KSMIRROR_A8); workprefs.cs_ciaoverlay = IsDlgButtonChecked (hDlg, IDC_CS_CIAOVERLAY); @@ -4463,6 +4467,8 @@ static void enable_for_chipsetdlg2 (HWND hDlg) ew (hDlg, IDC_CS_CDTVRAM, e); ew (hDlg, IDC_CS_CDTVRAMEXP, e); ew (hDlg, IDC_CS_RESETWARNING, e); + ew (hDlg, IDC_CS_NOEHB, e); + ew (hDlg, IDC_CS_BLITTERBUG, e); ew (hDlg, IDC_CS_KSMIRROR_E0, e); ew (hDlg, IDC_CS_KSMIRROR_A8, e); ew (hDlg, IDC_CS_CIAOVERLAY, e); @@ -8471,6 +8477,7 @@ static void enable_for_hw3ddlg (HWND hDlg) ew (hDlg, IDC_FILTERXTRA, vv2); ew (hDlg, IDC_FILTERDEFAULT, v); ew (hDlg, IDC_FILTERFILTER, vv); + ew (hDlg, IDC_FILTERUPSCALE, vv && !vv2); ew (hDlg, IDC_FILTERAUTORES, vv && !vv2); ew (hDlg, IDC_FILTERPRESETSAVE, filterpreset_builtin < 0); @@ -8527,16 +8534,17 @@ static int *filtervars[] = { &workprefs.gfx_xcenter, &workprefs.gfx_ycenter, &workprefs.gfx_filter_luminance, &workprefs.gfx_filter_contrast, &workprefs.gfx_filter_saturation, &workprefs.gfx_filter_gamma, &workprefs.gfx_filter_blur, &workprefs.gfx_filter_noise, + &workprefs.gfx_filter_upscale, NULL }; struct filterpreset { char *name; - int conf[22]; + int conf[23]; }; static struct filterpreset filterpresets[] = { - { "PAL example", 8, 0, 0, 0, 1000, 1000, 0, 0, 50, 0, 0, 0, 1, 0, 0, 0, 10, 0, 0, 0, 300, 30 }, + { "PAL example", 8, 0, 0, 0, 1000, 1000, 0, 0, 50, 0, 0, 0, 1, 0, 0, 0, 10, 0, 0, 0, 300, 30, 0 }, { NULL } }; @@ -8882,6 +8890,8 @@ static INT_PTR CALLBACK hw3dDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l currprefs.gfx_filter_horiz_offset = workprefs.gfx_filter_horiz_offset = 0; currprefs.gfx_filter_vert_offset = workprefs.gfx_filter_vert_offset = 0; values_to_hw3ddlg (hDlg); + updatedisplayarea (); + WIN32GFX_WindowMove (); break; case IDC_FILTERPRESETLOAD: case IDC_FILTERPRESETSAVE: @@ -8894,6 +8904,11 @@ static INT_PTR CALLBACK hw3dDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM l case IDC_FILTERAUTORES: workprefs.gfx_autoresolution = IsDlgButtonChecked (hDlg, IDC_FILTERAUTORES); break; + case IDC_FILTERUPSCALE: + currprefs.gfx_filter_upscale = workprefs.gfx_filter_upscale = IsDlgButtonChecked (hDlg, IDC_FILTERUPSCALE); + updatedisplayarea (); + WIN32GFX_WindowMove (); + break; default: if (HIWORD (wParam) == CBN_SELCHANGE || HIWORD (wParam) == CBN_KILLFOCUS) { switch (LOWORD (wParam)) diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index e87170f4..1f72a23b 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -3,6 +3,21 @@ 1.4.6 will be the last Windows 98/ME compatible version. 1.5.0 will require Windows 2000 or newer. +Beta 8: + +- input-panel NMI and END+SHIFT+Break NMI was unstable in + cycle-exact/more compatible modes +- Denise without EHB added to advanced chipset (was already in + A1000 "ICS" Quickstart) +- original Agnus BLTBUSY bug added to advanced chipset (also was + already in A1000 Quickstart) +- accept same windowed mode resolution as windows desktop +- added "full screen" option to filter panel. Amiga display area + fills whole screen when this option is enabled. Maybe useful when + using "full-window" mode. Note: "whole screen" = resolution selected + in full screen display select box, even in "full-window" mode. + "Internal" filter window size can't be adjusted yet. + Beta 7: - debugger activating when address error happened (debug code..) -- 2.47.3