From 6767298f85386123028dc355a78a56acec00e26c Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Mon, 6 Dec 2010 18:14:17 +0200 Subject: [PATCH] 2310b7 --- cfgfile.cpp | 27 ++++-- cia.cpp | 4 +- debug.cpp | 107 +++++++++++++-------- drawing.cpp | 49 +++------- expansion.cpp | 48 +++++---- filesys.cpp | 5 +- fpp.cpp | 13 ++- include/debug.h | 5 +- include/drawing.h | 1 + include/inputdevice.h | 2 +- include/options.h | 3 + include/sysdeps.h | 1 + inputdevice.cpp | 2 +- inputrecord.cpp | 2 +- od-win32/direct3d.cpp | 4 - od-win32/mman.cpp | 5 +- od-win32/posixemu.cpp | 31 ++++-- od-win32/resources/resource | 3 +- od-win32/resources/winuae.rc | 1 + od-win32/rp.cpp | 34 +++---- od-win32/win32.cpp | 27 +++--- od-win32/win32.h | 4 +- od-win32/win32_scaler.cpp | 70 +++++++++++--- od-win32/win32gui.cpp | 33 +++++-- od-win32/winuae_msvc10/winuae_msvc.vcxproj | 6 +- od-win32/winuaechangelog.txt | 14 +++ od-win32/writelog.cpp | 33 ++++++- 27 files changed, 338 insertions(+), 196 deletions(-) diff --git a/cfgfile.cpp b/cfgfile.cpp index b1ff815f..6659af13 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -31,6 +31,7 @@ #include "disk.h" #include "blkdev.h" #include "statusline.h" +#include "debug.h" static int config_newfilesystem; static struct strlist *temp_lines; @@ -165,7 +166,7 @@ static const TCHAR *maxhoriz[] = { L"lores", L"hires", L"superhires", 0 }; static const TCHAR *maxvert[] = { L"nointerlace", L"interlace", 0 }; static const TCHAR *abspointers[] = { L"none", L"mousehack", L"tablet", 0 }; static const TCHAR *magiccursors[] = { L"both", L"native", L"host", 0 }; -static const TCHAR *autoscale[] = { L"none", L"auto", L"standard", L"max", L"scale", L"resize", L"center", 0 }; +static const TCHAR *autoscale[] = { L"none", L"auto", L"standard", L"max", L"scale", L"resize", L"center", L"manual", 0 }; static const TCHAR *joyportmodes[] = { L"", L"mouse", L"djoy", L"gamepad", L"ajoy", L"cdtvjoy", L"cd32joy", L"lightpen", 0 }; static const TCHAR *joyaf[] = { L"none", L"normal", L"toggle", 0 }; static const TCHAR *epsonprinter[] = { L"none", L"ascii", L"epson_matrix_9pin", L"epson_matrix_24pin", L"epson_matrix_48pin", 0 }; @@ -521,6 +522,10 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_write_bool (f, L"use_debugger", p->start_debugger); cfgfile_write_rom (f, p->path_rom, p->romfile, L"kickstart_rom_file"); cfgfile_write_rom (f, p->path_rom, p->romextfile, L"kickstart_ext_rom_file"); + if (p->romextfile2addr) { + cfgfile_write (f, L"kickstart_ext_rom_file2_address", L"%x", p->romextfile2addr); + cfgfile_write_rom (f, p->path_rom, p->romextfile2, L"kickstart_ext_rom_file2"); + } if (p->romident[0]) cfgfile_dwrite_str (f, L"kickstart_rom", p->romident); if (p->romextident[0]) @@ -957,6 +962,7 @@ int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, } return 1; } + int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, int scale) { unsigned int v = 0; @@ -967,8 +973,6 @@ int cfgfile_intval (const TCHAR *option, const TCHAR *value, const TCHAR *name, return r; } - - int cfgfile_strval (const TCHAR *option, const TCHAR *value, const TCHAR *name, int *location, const TCHAR *table[], int more) { int val; @@ -1720,7 +1724,7 @@ end: xfree (romtxt); } -static struct uaedev_config_info *getuci(struct uae_prefs *p) +static struct uaedev_config_info *getuci (struct uae_prefs *p) { if (p->mountitems < MOUNT_CONFIG_SIZE) return &p->mountconfig[p->mountitems++]; @@ -1930,6 +1934,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH || cfgfile_intval (option, value, L"parallel_autoflush", &p->parallel_autoflush_time, 1) || cfgfile_intval (option, value, L"uae_hide", &p->uae_hide, 1) || cfgfile_intval (option, value, L"cpu_frequency", &p->cpu_frequency, 1) + || cfgfile_intval (option, value, L"kickstart_ext_rom_file2addr", &p->romextfile2addr, 1) || cfgfile_intval (option, value, L"catweasel", &p->catweasel, 1)) return 1; @@ -1949,6 +1954,7 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH if (cfgfile_path (option, value, L"kickstart_rom_file", p->romfile, sizeof p->romfile / sizeof (TCHAR)) || cfgfile_path (option, value, L"kickstart_ext_rom_file", p->romextfile, sizeof p->romextfile / sizeof (TCHAR)) + || cfgfile_path (option, value, L"kickstart_ext_rom_file2", p->romextfile2, sizeof p->romextfile2 / sizeof (TCHAR)) || cfgfile_rom (option, value, L"kickstart_rom_file_id", p->romfile, sizeof p->romfile / sizeof (TCHAR)) || cfgfile_rom (option, value, L"kickstart_ext_rom_file_id", p->romextfile, sizeof p->romextfile / sizeof (TCHAR)) || cfgfile_path (option, value, L"amax_rom_file", p->amaxromfile, sizeof p->amaxromfile / sizeof (TCHAR)) @@ -2560,6 +2566,7 @@ static int cfgfile_load_2 (struct uae_prefs *p, const TCHAR *filename, bool real subst (p->path_floppy, p->floppyslots[i].df, sizeof p->floppyslots[i].df / sizeof (TCHAR)); subst (p->path_rom, p->romfile, sizeof p->romfile / sizeof (TCHAR)); subst (p->path_rom, p->romextfile, sizeof p->romextfile / sizeof (TCHAR)); + subst (p->path_rom, p->romextfile2, sizeof p->romextfile2 / sizeof (TCHAR)); return 1; } @@ -3149,8 +3156,10 @@ int cmdlineparser (const TCHAR *s, TCHAR *outp[], int max) j++; } if (doout) { - outp[cnt++] = my_strdup (tmp1); - outp[cnt] = 0; + if (_tcslen (tmp1) > 0) { + outp[cnt++] = my_strdup (tmp1); + outp[cnt] = 0; + } tmp1[0] = 0; doout = 0; j = 0; @@ -3293,7 +3302,9 @@ uae_u32 cfgfile_modify (uae_u32 index, TCHAR *parms, uae_u32 size, TCHAR *out, u for (i = 0; i < argv; i++) { if (i + 2 <= argv) { - if (!inputdevice_uaelib (argc[i], argc[i + 1])) { + if (!_tcsicmp (argc[i], L"dbg")) { + debug_parser (argc[i + 1], out, outsize); + } else if (!inputdevice_uaelib (argc[i], argc[i + 1])) { if (!cfgfile_parse_option (&changed_prefs, argc[i], argc[i + 1], 0)) { err = 5; break; @@ -3623,6 +3634,8 @@ void default_prefs (struct uae_prefs *p, int type) configure_rom (p, roms, 0); _tcscpy (p->romextfile, L""); + _tcscpy (p->romextfile2, L""); + p->romextfile2addr = 0; _tcscpy (p->flashfile, L""); _tcscpy (p->cartfile, L""); diff --git a/cia.cpp b/cia.cpp index 3bebe9c6..4418f070 100644 --- a/cia.cpp +++ b/cia.cpp @@ -1561,7 +1561,7 @@ static uae_u32 REGPARAM2 clock_bget (uaecptr addr) #ifdef JIT special_mem |= S_READ; #endif - //write_log("R: %x (%x), PC=%08x\n", addr, addr >> 2, M68K_GETPC); +// write_log(L"R: %x (%x), PC=%08x\n", addr, (addr & 0xff) >> 2, M68K_GETPC); #ifdef CDTV if (currprefs.cs_cdtvram && addr >= 0xdc8000) return cdtv_battram_read (addr); @@ -1642,7 +1642,7 @@ static void REGPARAM2 clock_bput (uaecptr addr, uae_u32 value) #ifdef JIT special_mem |= S_WRITE; #endif - //write_log("W: %x: %x, PC=%08x\n", addr, value & 0xff, M68K_GETPC); +// write_log(L"W: %x (%x): %x, PC=%08x\n", addr, (addr & 0xff) >> 2, value & 0xff, M68K_GETPC); #ifdef CDTV if (currprefs.cs_cdtvram && addr >= 0xdc8000) { cdtv_battram_write (addr, value); diff --git a/debug.cpp b/debug.cpp index 5bab88fb..074ba5d6 100644 --- a/debug.cpp +++ b/debug.cpp @@ -2149,7 +2149,7 @@ void memwatch_dump2 (TCHAR *buf, int bufsize, int num) mwn = &mwnodes[i]; if (mwn->size == 0) continue; - buf = buf_out (buf, &bufsize, L"%d: %08X - %08X (%d) %c%c%c", + buf = buf_out (buf, &bufsize, L"%2d: %08X - %08X (%d) %c%c%c", i, mwn->addr, mwn->addr + (mwn->size - 1), mwn->size, (mwn->rwi & 1) ? 'R' : ' ', (mwn->rwi & 2) ? 'W' : ' ', (mwn->rwi & 4) ? 'I' : ' '); if (mwn->frozen) @@ -2182,13 +2182,14 @@ static void memwatch (TCHAR **c) { int num; struct memwatch_node *mwn; - TCHAR nc; + TCHAR nc, *cp; if (!memwatch_enabled) { initialize_memwatch (0); console_out (L"Memwatch breakpoints enabled\n"); } + cp = *c; ignore_ws (c); if (!more_params (c)) { memwatch_dump (-1); @@ -2229,7 +2230,8 @@ static void memwatch (TCHAR **c) } return; } - num = nc - '0'; + *c = cp; + num = readint (c); if (num < 0 || num >= MEMWATCH_TOTAL) return; mwn = &mwnodes[num]; @@ -3071,7 +3073,7 @@ static void find_ea (TCHAR **inptr) m68k_disasm (stdout, addr, NULL, 1); hits++; if (hits > 100) { - write_log (L"Too many hits. End addr = %08X\n", addr); + console_out_f (L"Too many hits. End addr = %08X\n", addr); break; } } @@ -3127,35 +3129,18 @@ static void m68k_modify (TCHAR **inptr) } } -static void debug_1 (void) -{ - TCHAR input[MAX_LINEWIDTH]; - uaecptr nxdis, nxmem, addr; +static uaecptr nxdis, nxmem; - m68k_dumpstate (stdout, &nextpc); - nxdis = nextpc; nxmem = 0; - debugger_active = 1; +static BOOL debug_line (TCHAR *input) +{ + TCHAR cmd, *inptr; + uaecptr addr; - for (;;) { - TCHAR cmd, *inptr; - int v; + inptr = input; + cmd = next_char (&inptr); - if (!debugger_active) - return; - update_debug_info (); - console_out (L">"); - console_flush (); - debug_linecounter = 0; - v = console_get (input, MAX_LINEWIDTH); - if (v < 0) - return; - if (v == 0) - continue; - - inptr = input; - cmd = next_char (&inptr); - switch (cmd) - { + switch (cmd) + { case 'c': dumpcia (); dumpdisk (); dumpcustom (); break; case 'i': { @@ -3167,7 +3152,7 @@ static void debug_1 (void) debug_illegal_mask = debug_illegal ? 0 : -1; debug_illegal_mask &= ~((uae_u64)255 << 24); // mask interrupts } - write_log (L"Exception breakpoint mask: %0I64X\n", debug_illegal_mask); + console_out_f (L"Exception breakpoint mask: %0I64X\n", debug_illegal_mask); debug_illegal = debug_illegal_mask ? 1 : 0; } else { addr = 0xffffffff; @@ -3266,13 +3251,13 @@ static void debug_1 (void) } set_special (SPCFLAG_BRK); exception_debugging = 1; - return; + return true; case 'z': skipaddr_start = nextpc; skipaddr_doskip = 1; do_skip = 1; exception_debugging = 1; - return; + return true; case 'f': if (inptr[0] == 'a') { @@ -3281,17 +3266,17 @@ static void debug_1 (void) } else if (inptr[0] == 'p') { inptr++; if (process_breakpoint (&inptr)) - return; + return true; } else { if (instruction_breakpoint (&inptr)) - return; + return true; } break; case 'q': uae_quit(); deactivate_debugger(); - return; + return true; case 'g': if (more_params (&inptr)) { @@ -3299,7 +3284,7 @@ static void debug_1 (void) fill_prefetch (); } deactivate_debugger(); - return; + return true; case 'x': if (_totupper(inptr[0]) == 'X') { @@ -3307,7 +3292,7 @@ static void debug_1 (void) } else { deactivate_debugger(); close_console(); - return; + return true; } break; @@ -3428,7 +3413,7 @@ static void debug_1 (void) if (copper_debugger (&inptr)) { debugger_active = 0; debugging = 0; - return; + return true; } break; } @@ -3436,7 +3421,7 @@ static void debug_1 (void) break; case 'b': if (staterecorder (&inptr)) - return; + return true; break; case 'U': if (currprefs.cpu_model && more_params (&inptr)) { @@ -3472,7 +3457,34 @@ static void debug_1 (void) else debug_help (); break; - } + } + return false; +} + +static void debug_1 (void) +{ + TCHAR input[MAX_LINEWIDTH]; + + m68k_dumpstate (stdout, &nextpc); + nxdis = nextpc; nxmem = 0; + debugger_active = 1; + + for (;;) { + int v; + + if (!debugger_active) + return; + update_debug_info (); + console_out (L">"); + console_flush (); + debug_linecounter = 0; + v = console_get (input, MAX_LINEWIDTH); + if (v < 0) + return; + if (v == 0) + continue; + if (debug_line (input)) + return; } } @@ -4018,3 +4030,16 @@ int mmu_init(int mode, uaecptr parm, uaecptr parm2) set_special (SPCFLAG_BRK); return 1; } + +void debug_parser (const TCHAR *cmd, TCHAR *out, uae_u32 outsize) +{ + TCHAR empty[2] = { 0 }; + TCHAR *input = my_strdup (cmd); + if (out == NULL || outsize == 0) + setconsolemode (empty, 1); + else + setconsolemode (out, outsize); + debug_line (input); + setconsolemode (NULL, 0); + xfree (input); +} diff --git a/drawing.cpp b/drawing.cpp index 06ecf42e..9fafac4d 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -327,6 +327,12 @@ extern int firstword_bplcon1; static int gclow, gcloh, gclox, gcloy; +void get_custom_topedge (int *x, int *y) +{ + *x = visible_left_border; + *y = minfirstline << currprefs.gfx_vresolution; +} + static void reset_custom_limits (void) { gclow = gcloh = gclox = gcloy = 0; @@ -2182,7 +2188,7 @@ static void center_image (void) if (visible_left_border < prev_x_adjust && prev_x_adjust < min_diwstart && min_diwstart - visible_left_border <= 32) visible_left_border = prev_x_adjust; } - } else if ((beamcon0 & 0x80) && max_diwstop > 0) { + } else if ((beamcon0 & 0x80) && max_diwstop > 0 && !currprefs.gfx_filter_autoscale) { int w = gfxvidinfo.width; if (max_diwstop - min_diwstart < w) visible_left_border = (max_diwstop - min_diwstart - w) / 2 + min_diwstart; @@ -2192,26 +2198,15 @@ static void center_image (void) visible_left_border = max_diwlastword - gfxvidinfo.width; } - if (currprefs.gfx_xcenter_pos >= 0 && !currprefs.gfx_filter_autoscale) { - int val = currprefs.gfx_xcenter_pos >> RES_MAX; -#if 0 - if (currprefs.gfx_xcenter_size > 0) { - int diff = ((gfxvidinfo.width << (RES_MAX - currprefs.gfx_resolution)) - currprefs.gfx_xcenter_size) / 1; - write_log (L"%d %d\n", currprefs.gfx_xcenter_size, gfxvidinfo.width); - val -= diff >> RES_MAX; - } -#endif - if (val < 56) - val = 56; - visible_left_border = val + (DIW_DDF_OFFSET << currprefs.gfx_resolution) - (DISPLAY_LEFT_SHIFT * 2 - (DISPLAY_LEFT_SHIFT << currprefs.gfx_resolution)); - } - if (visible_left_border > max_diwlastword - 32) visible_left_border = max_diwlastword - 32; if (visible_left_border < 0) visible_left_border = 0; visible_left_border &= ~((xshift (1, lores_shift)) - 1); + //write_log (L"%d %d %d %d %d\n", max_diwlastword, gfxvidinfo.width, lores_shift, currprefs.gfx_resolution, visible_left_border); + + linetoscr_x_adjust_bytes = visible_left_border * gfxvidinfo.pixbytes; visible_right_border = visible_left_border + gfxvidinfo.width; @@ -2235,25 +2230,13 @@ static void center_image (void) thisframe_y_adjust = prev_y_adjust; } } - if (currprefs.gfx_ycenter_pos >= 0 && !currprefs.gfx_filter_autoscale) { - thisframe_y_adjust = currprefs.gfx_ycenter_pos >> 1; -#if 0 - if (currprefs.gfx_ycenter_size > 0) { - int diff = (currprefs.gfx_ycenter_size - (gfxvidinfo.height << (linedbl ? 0 : 1))) / 2; - thisframe_y_adjust += diff >> 1; - } -#endif - if (thisframe_y_adjust + max_drawn_amiga_line > 2 * maxvpos_nom) - thisframe_y_adjust = 2 * maxvpos_nom - max_drawn_amiga_line; - if (thisframe_y_adjust < 0) - thisframe_y_adjust = 0; - } else { + /* Make sure the value makes sense */ - if (thisframe_y_adjust + max_drawn_amiga_line > maxvpos_nom) - thisframe_y_adjust = maxvpos_nom - max_drawn_amiga_line; - if (thisframe_y_adjust < minfirstline) - thisframe_y_adjust = minfirstline; - } + if (thisframe_y_adjust + max_drawn_amiga_line > maxvpos_nom) + thisframe_y_adjust = maxvpos_nom - max_drawn_amiga_line; + if (thisframe_y_adjust < minfirstline) + thisframe_y_adjust = minfirstline; + thisframe_y_adjust_real = thisframe_y_adjust << linedbl; tmp = (maxvpos_nom - thisframe_y_adjust) << linedbl; if (tmp != max_ypos_thisframe) { diff --git a/expansion.cpp b/expansion.cpp index d99e634c..d8dc5c96 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -36,22 +36,22 @@ /* 00 / 02 */ /* er_Type */ -#define Z2_MEM_8MB 0x00 /* Size of Memory Block */ -#define Z2_MEM_4MB 0x07 -#define Z2_MEM_2MB 0x06 -#define Z2_MEM_1MB 0x05 +#define Z2_MEM_8MB 0x00 /* Size of Memory Block */ +#define Z2_MEM_4MB 0x07 +#define Z2_MEM_2MB 0x06 +#define Z2_MEM_1MB 0x05 #define Z2_MEM_512KB 0x04 #define Z2_MEM_256KB 0x03 #define Z2_MEM_128KB 0x02 -#define Z2_MEM_64KB 0x01 +#define Z2_MEM_64KB 0x01 /* extended definitions */ -#define Z2_MEM_16MB 0x00 -#define Z2_MEM_32MB 0x01 -#define Z2_MEM_64MB 0x02 +#define Z2_MEM_16MB 0x00 +#define Z2_MEM_32MB 0x01 +#define Z2_MEM_64MB 0x02 #define Z2_MEM_128MB 0x03 #define Z2_MEM_256MB 0x04 #define Z2_MEM_512MB 0x05 -#define Z2_MEM_1GB 0x06 +#define Z2_MEM_1GB 0x06 #define chainedconfig 0x08 /* Next config is part of the same card */ #define rom_card 0x10 /* ROM vector is valid */ @@ -82,20 +82,20 @@ /* ********************************************************** */ /* 08 - 0A */ /* er_Flags */ -#define Z3_MEM_64KB 0x02 +#define Z3_MEM_64KB 0x02 #define Z3_MEM_128KB 0x03 #define Z3_MEM_256KB 0x04 #define Z3_MEM_512KB 0x05 -#define Z3_MEM_1MB 0x06 /* Zorro III card subsize */ -#define Z3_MEM_2MB 0x07 -#define Z3_MEM_4MB 0x08 -#define Z3_MEM_6MB 0x09 -#define Z3_MEM_8MB 0x0a -#define Z3_MEM_10MB 0x0b -#define Z3_MEM_12MB 0x0c -#define Z3_MEM_14MB 0x0d -#define Z3_MEM_16MB 0x00 -#define Z3_MEM_AUTO 0x01 +#define Z3_MEM_1MB 0x06 /* Zorro III card subsize */ +#define Z3_MEM_2MB 0x07 +#define Z3_MEM_4MB 0x08 +#define Z3_MEM_6MB 0x09 +#define Z3_MEM_8MB 0x0a +#define Z3_MEM_10MB 0x0b +#define Z3_MEM_12MB 0x0c +#define Z3_MEM_14MB 0x0d +#define Z3_MEM_16MB 0x00 +#define Z3_MEM_AUTO 0x01 #define Z3_MEM_defunct1 0x0e #define Z3_MEM_defunct2 0x0f @@ -298,15 +298,13 @@ static void REGPARAM2 expamem_wput (uaecptr addr, uae_u32 value) // Z3 P96 RAM p2 = p96ram_start >> 16; } - if (value != p2) { - put_word (regs.regs[11] + 0x20, p2); - put_word (regs.regs[11] + 0x28, p2); - } + put_word (regs.regs[11] + 0x20, p2); + put_word (regs.regs[11] + 0x28, p2); // -Bernd Roesch expamem_hi = p2; (*card_map[ecard]) (); ecard++; - if (value != p2) + if (p1 != p2) write_log (L" Card %d remapped %04x0000 -> %04x0000\n", ecard, p1, p2); write_log (L" Card %d (Zorro%s) done.\n", ecard, expamem_type () == 0xc0 ? L"II" : L"III"); if (ecard < cardno) diff --git a/filesys.cpp b/filesys.cpp index bab0a618..cf3e8a4e 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -3570,7 +3570,7 @@ no_more_entries: PUT_PCK_RES1 (packet, DOS_FALSE); PUT_PCK_RES2 (packet, ERROR_NO_MORE_ENTRIES); } -extern void activate_debugger(void); + static void do_find (Unit *unit, dpacket packet, int mode, int create, int fallback) { uaecptr fh = GET_PCK_ARG1 (packet) << 2; @@ -3588,9 +3588,6 @@ static void do_find (Unit *unit, dpacket packet, int mode, int create, int fallb TRACE((L"fh=%x lock=%x name=%x\n", fh, lock, name)); DUMPLOCK(unit, lock); - if (!_tcsicmp(bstr(unit,name), L"NĂ¹")) - activate_debugger(); - aino = find_aino (unit, lock, bstr (unit, name), &err); if (aino == 0 || (err != 0 && err != ERROR_OBJECT_NOT_AROUND)) { diff --git a/fpp.cpp b/fpp.cpp index e06432a2..9c57244c 100644 --- a/fpp.cpp +++ b/fpp.cpp @@ -113,15 +113,21 @@ float fp_1e0 = 1, fp_1e1 = 10, fp_1e2 = 100, fp_1e4 = 10000; #define MAKE_FPSR(r) (regs).fp_result=(r) +static __inline__ void native_set_fpucw (uae_u32 m68k_cw) +{ +#ifdef _WIN32 + // RN, RZ, RM, RP + static unsigned int fp87_round[4] = { _RC_NEAR, _RC_CHOP, _RC_DOWN, _RC_UP }; + // X, S, D, U + static unsigned int fp87_prec[4] = { _PC_64 , _PC_24 , _PC_53, 0 }; + _control87(fp87_round[(m68k_cw >> 4) & 3] | fp87_prec[(m68k_cw >> 6) & 3], _MCW_RC | _MCW_PC); +#else static uae_u16 x87_cw_tab[] = { 0x137f, 0x1f7f, 0x177f, 0x1b7f, /* Extended */ 0x107f, 0x1c7f, 0x147f, 0x187f, /* Single */ 0x127f, 0x1e7f, 0x167f, 0x1a7f, /* Double */ 0x137f, 0x1f7f, 0x177f, 0x1b7f /* undefined */ }; -/* Nearest, toZero, Down, Up */ -static __inline__ void native_set_fpucw (uae_u32 m68k_cw) -{ #if USE_X86_FPUCW uae_u16 x87_cw = x87_cw_tab[(m68k_cw >> 4) & 0xf]; @@ -133,6 +139,7 @@ static __inline__ void native_set_fpucw (uae_u32 m68k_cw) __asm__ ("fldcw %0" : : "m" (*&x87_cw)); #endif #endif +#endif } #if defined(uae_s64) /* Close enough for government work? */ diff --git a/include/debug.h b/include/debug.h index 2d2cd37e..9120bdfd 100644 --- a/include/debug.h +++ b/include/debug.h @@ -40,15 +40,16 @@ extern void update_debug_info (void); extern int instruction_breakpoint (TCHAR **c); extern int debug_bankchange (int); extern void log_dma_record (void); +extern void debug_parser (const TCHAR *cmd, TCHAR *out, uae_u32 outsize); -#define BREAKPOINT_TOTAL 8 +#define BREAKPOINT_TOTAL 20 struct breakpoint_node { uaecptr addr; int enabled; }; extern struct breakpoint_node bpnodes[BREAKPOINT_TOTAL]; -#define MEMWATCH_TOTAL 8 +#define MEMWATCH_TOTAL 20 struct memwatch_node { uaecptr addr; int size; diff --git a/include/drawing.h b/include/drawing.h index df402501..837ebb80 100644 --- a/include/drawing.h +++ b/include/drawing.h @@ -277,6 +277,7 @@ extern void notice_interlace_seen (void); extern void frame_drawn (void); extern void redraw_frame (void); extern int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy); +extern void get_custom_topedge (int *x, int *y); extern void putpixel (uae_u8 *buf, int bpp, int x, xcolnr c8, int opaq); /* Finally, stuff that shouldn't really be shared. */ diff --git a/include/inputdevice.h b/include/inputdevice.h index 478417e0..7217d5d4 100644 --- a/include/inputdevice.h +++ b/include/inputdevice.h @@ -235,7 +235,7 @@ extern int jsem_isjoy (int port, const struct uae_prefs *p); extern int jsem_ismouse (int port, const struct uae_prefs *p); extern int jsem_iskbdjoy (int port, const struct uae_prefs *p); -extern int inputdevice_uaelib (TCHAR *, TCHAR *); +extern int inputdevice_uaelib (const TCHAR *, const TCHAR *); extern int inputdevice_testread (int*, int*, int*); extern int inputdevice_istest (void); diff --git a/include/options.h b/include/options.h index dc90476d..2b2a7b42 100644 --- a/include/options.h +++ b/include/options.h @@ -126,6 +126,7 @@ enum { CP_GENERIC = 1, CP_CDTV, CP_CD32, CP_A500, CP_A500P, CP_A600, CP_A1000, #define AUTOSCALE_NORMAL 4 #define AUTOSCALE_RESIZE 5 #define AUTOSCALE_CENTER 6 +#define AUTOSCALE_MANUAL 7 // use gfx_xcenter_pos and gfx_ycenter_pos struct uae_prefs { @@ -297,6 +298,8 @@ struct uae_prefs { TCHAR romfile[MAX_DPATH]; TCHAR romident[256]; TCHAR romextfile[MAX_DPATH]; + uae_u32 romextfile2addr; + TCHAR romextfile2[MAX_DPATH]; TCHAR romextident[256]; TCHAR flashfile[MAX_DPATH]; TCHAR cartfile[MAX_DPATH]; diff --git a/include/sysdeps.h b/include/sysdeps.h index dba9b27c..c8ddd34e 100644 --- a/include/sysdeps.h +++ b/include/sysdeps.h @@ -469,6 +469,7 @@ extern void write_log (const TCHAR *, ...); extern void write_dlog (const TCHAR *, ...); extern void flush_log (void); +extern TCHAR *setconsolemode (TCHAR *buffer, int maxlen); extern void close_console (void); extern void reopen_console (void); extern void console_out (const TCHAR *); diff --git a/inputdevice.cpp b/inputdevice.cpp index f4d69bc4..07831e71 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -142,7 +142,7 @@ static int isdevice (struct uae_input_device *id) return 0; } -int inputdevice_uaelib (TCHAR *s, TCHAR *parm) +int inputdevice_uaelib (const TCHAR *s, const TCHAR *parm) { int i; diff --git a/inputrecord.cpp b/inputrecord.cpp index fb677894..bd38ed6b 100644 --- a/inputrecord.cpp +++ b/inputrecord.cpp @@ -8,7 +8,7 @@ */ #define INPUTRECORD_DEBUG 1 -#define ENABLE_DEBUGGER 0 +#define ENABLE_DEBUGGER 1 #define HEADERSIZE 12 diff --git a/od-win32/direct3d.cpp b/od-win32/direct3d.cpp index 7e9c1786..2c16272e 100644 --- a/od-win32/direct3d.cpp +++ b/od-win32/direct3d.cpp @@ -2430,11 +2430,7 @@ static void D3D_render22 (void) static void D3D_render2 (void) { - int fpuv; - - fpux_save (&fpuv); D3D_render22 (); - fpux_restore (&fpuv); } void D3D_setcursor (int x, int y, int visible) diff --git a/od-win32/mman.cpp b/od-win32/mman.cpp index 0375c2f7..a71722c6 100644 --- a/od-win32/mman.cpp +++ b/od-win32/mman.cpp @@ -222,8 +222,9 @@ restart: size = 0x10000000; if (currprefs.z3fastmem_size || currprefs.z3fastmem2_size || currprefs.z3chipmem_size) { z3size = currprefs.z3fastmem_size + currprefs.z3fastmem2_size + currprefs.z3chipmem_size + (currprefs.z3fastmem_start - 0x10000000); - if (currprefs.gfxmem_size) - rtgbarrier = 16 * 1024 * 1024; + if (currprefs.gfxmem_size) { + rtgbarrier = 16 * 1024 * 1024 - ((currprefs.z3fastmem_size + currprefs.z3fastmem2_size) & 0x00ffffff); + } if (currprefs.z3chipmem_size && (currprefs.z3fastmem_size || currprefs.z3fastmem2_size)) z3chipbarrier = 16 * 1024 * 1024; } else { diff --git a/od-win32/posixemu.cpp b/od-win32/posixemu.cpp index f3e82bb2..758ecac9 100644 --- a/od-win32/posixemu.cpp +++ b/od-win32/posixemu.cpp @@ -30,6 +30,10 @@ #include "filesys.h" #include "win32.h" +#include + +extern HANDLE AVTask; + /* Our Win32 implementation of this function */ void gettimeofday (struct timeval *tv, void *blah) { @@ -233,6 +237,8 @@ void uae_sem_destroy (uae_sem_t * event) } } +#ifndef _CONSOLE + typedef unsigned (__stdcall *BEGINTHREADEX_FUNCPTR)(void *); struct thparms @@ -282,7 +288,11 @@ int uae_start_thread (const TCHAR *name, void *(*f)(void *), void *arg, uae_thre if (hThread) { if (name) { //write_log (L"Thread '%s' started (%d)\n", name, hThread); - SetThreadPriority (hThread, THREAD_PRIORITY_HIGHEST); + if (!AVTask) { + SetThreadPriority (hThread, THREAD_PRIORITY_HIGHEST); + } else { + AvSetMmThreadPriority(AVTask, AVRT_PRIORITY_HIGH); + } } } else { result = 0; @@ -298,8 +308,13 @@ int uae_start_thread (const TCHAR *name, void *(*f)(void *), void *arg, uae_thre int uae_start_thread_fast (void *(*f)(void *), void *arg, uae_thread_id *tid) { int v = uae_start_thread (NULL, f, arg, tid); - if (*tid) - SetThreadPriority (*tid, THREAD_PRIORITY_HIGHEST); + if (*tid) { + if (!AVTask) { + SetThreadPriority (*tid, THREAD_PRIORITY_HIGHEST); + } else { + AvSetMmThreadPriority(AVTask, AVRT_PRIORITY_HIGH); + } + } return v; } @@ -329,8 +344,12 @@ void uae_set_thread_priority (uae_thread_id *tid, int pri) pri2 = -1; SetThreadPriority (th, pri2); #endif - if (!SetThreadPriority (GetCurrentThread(), THREAD_PRIORITY_HIGHEST)) - SetThreadPriority (GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); - + if (!AVTask) { + if (!SetThreadPriority (GetCurrentThread(), THREAD_PRIORITY_HIGHEST)) + SetThreadPriority (GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); + } else { + AvSetMmThreadPriority(AVTask, AVRT_PRIORITY_HIGH); + } } +#endif diff --git a/od-win32/resources/resource b/od-win32/resources/resource index be389bcf..f86fb7b9 100644 --- a/od-win32/resources/resource +++ b/od-win32/resources/resource @@ -343,6 +343,8 @@ #define IDS_AUTOSCALE_TV 367 #define IDS_JOYMODE_GAMEPAD 368 #define IDS_AUTOSCALE_DEFAULT 369 +#define IDS_AUTOSCALE_MANUEL 370 +#define IDS_AUTOSCALE_MANUAL 370 #define IDS_QS_MODELS 1000 #define IDS_QS_MODEL_A500 1001 #define IDS_QS_MODEL_A500P 1002 @@ -738,7 +740,6 @@ #define IDC_AVIOUTPUT_FILE 1611 #define IDC_INPUTLIST 1611 #define IDC_CATWEASEL 1611 -#define IDC_CLOCKSYNC2 1611 #define IDC_CLIPBOARDSHARE 1611 #define IDC_INPUTAMIGA 1612 #define IDC_BORDERLESS 1612 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 1193e1ca..d8a44f35 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -1681,6 +1681,7 @@ STRINGTABLE BEGIN IDS_JOYMODE_GAMEPAD "Gamepad" IDS_AUTOSCALE_DEFAULT "Default" + IDS_AUTOSCALE_MANUAL "Manual" END #endif // English resources diff --git a/od-win32/rp.cpp b/od-win32/rp.cpp index 844f39fa..58a9e337 100644 --- a/od-win32/rp.cpp +++ b/od-win32/rp.cpp @@ -361,8 +361,8 @@ static void get_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) totalhdbl, hres, totalvdbl, vres, full, p->gfx_xcenter_pos, p->gfx_ycenter_pos, p->gfx_size_win.width, p->gfx_size_win.height); - sm->lClipLeft = p->gfx_xcenter_pos <= 0 ? -1 : p->gfx_xcenter_pos; - sm->lClipTop = p->gfx_ycenter_pos <= 0 ? -1 : p->gfx_ycenter_pos; + sm->lClipLeft = p->gfx_xcenter_pos < 0 ? -1 : p->gfx_xcenter_pos; + sm->lClipTop = p->gfx_ycenter_pos < 0 ? -1 : p->gfx_ycenter_pos; if (full) { sm->lClipWidth = LORES_WIDTH << RES_MAX; sm->lClipHeight = LORES_HEIGHT << 1; @@ -395,9 +395,9 @@ static void get_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) static int shift (int val, int shift) { - if (shift >= 0) + if (shift > 0) val >>= shift; - else + else if (shift < 0) val <<= -shift; return val; } @@ -423,8 +423,8 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) if (log_rp) write_log (L"SET_RPSM: %08X %dx%d %dx%d hres=%d vres=%d disp=%d fs=%d\n", - sm->dwScreenMode, sm->lClipLeft, sm->lClipTop, sm->lClipWidth, sm->lClipHeight, - hdbl, vdbl, display, fs); + sm->dwScreenMode, sm->lClipLeft, sm->lClipTop, sm->lClipWidth, sm->lClipHeight, + hdbl, vdbl, display, fs); if (!WIN32GFX_IsPicassoScreen ()) { @@ -480,7 +480,6 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) //p->gfx_filter = rp_filter_default; p->gfx_filter_horiz_zoom_mult = 1000; p->gfx_filter_vert_zoom_mult = 1000; - //p->gfx_filter_autoscale = 0; if (log_rp) write_log (L"WW=%d WH=%d FW=%d FH=%d\n", p->gfx_size_win.width, p->gfx_size_win.height, @@ -488,7 +487,6 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) if (fs) { if (smm == RP_SCREENMODE_XX) { p->gfx_filter = rp_filter; - p->gfx_filter_autoscale = AUTOSCALE_STATIC_NOMINAL; } else { int mult; int prevmult = 1; @@ -509,12 +507,6 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) p->gfx_filter_vert_zoom_mult = 1000 / mult; } } - } else { - if (hdbl != hres || vdbl != vres) { - p->gfx_filter = rp_filter; - p->gfx_filter_horiz_zoom_mult = shift (1000, hdbl - hres); - p->gfx_filter_vert_zoom_mult = shift (1000, vdbl - vres); - } } } @@ -534,12 +526,18 @@ static void set_screenmode (struct RPScreenMode *sm, struct uae_prefs *p) p->gfx_xcenter_size = sm->lClipWidth; p->gfx_ycenter_size = sm->lClipHeight; + if (p->gfx_xcenter_pos >= 0 || p->gfx_ycenter_pos >= 0) + p->gfx_filter_autoscale = AUTOSCALE_MANUAL; + else + p->gfx_filter_autoscale = AUTOSCALE_STATIC_NOMINAL; + + p->gfx_filter_scanlines = 0; p->gfx_scanlines = 0; if (sm->dwScreenMode & RP_SCREENMODE_SCANLINES) { - if (p->gfx_vresolution > VRES_NONDOUBLE) { - p->gfx_scanlines = 1; - p->gfx_filter_scanlines = 0; - } + p->gfx_scanlines = 1; + p->gfx_filter_scanlines = 8; + p->gfx_filter_scanlinelevel = 8; + p->gfx_filter_scanlineratio = (1 << 4) | 1; } updatewinfsmode (p); diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index 1dfc46fa..07830733 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -15,7 +15,7 @@ #include "sysconfig.h" - +#define USETHREADCHARACTERICS 0 #define _WIN32_WINNT 0x700 /* XButtons + MOUSEHWHEEL=XP, Jump List=Win7 */ #include @@ -126,7 +126,7 @@ static int start_data = 0; static void *tablet; HCURSOR normalcursor; static HWND hwndNextViewer; -static HANDLE AVTask; +HANDLE AVTask; TCHAR VersionStr[256]; TCHAR BetaStr[64]; @@ -504,13 +504,15 @@ static int avioutput_video = 0; void setpriority (struct threadpriorities *pri) { int err; - DWORD opri = GetPriorityClass (GetCurrentProcess ()); + if (!AVTask) { + DWORD opri = GetPriorityClass (GetCurrentProcess ()); - if (opri != IDLE_PRIORITY_CLASS && opri != NORMAL_PRIORITY_CLASS && opri != BELOW_NORMAL_PRIORITY_CLASS && opri != ABOVE_NORMAL_PRIORITY_CLASS) - return; - err = SetPriorityClass (GetCurrentProcess (), pri->classvalue); - if (!err) - write_log (L"priority set failed, %08X\n", GetLastError ()); + if (opri != IDLE_PRIORITY_CLASS && opri != NORMAL_PRIORITY_CLASS && opri != BELOW_NORMAL_PRIORITY_CLASS && opri != ABOVE_NORMAL_PRIORITY_CLASS) + return; + err = SetPriorityClass (GetCurrentProcess (), pri->classvalue); + if (!err) + write_log (L"priority set failed, %08X\n", GetLastError ()); + } } static void setcursorshape (void) @@ -675,10 +677,11 @@ static void winuae_active (HWND hWnd, int minimized) #endif clipboard_active (hAmigaWnd, 1); SetThreadExecutionState (ES_CONTINUOUS | ES_DISPLAY_REQUIRED); -#if 0 +#if USETHREADCHARACTERICS if (os_vista && AVTask == NULL) { DWORD taskIndex = 0; - AVTask = AvSetMmThreadCharacteristics (TEXT("Games"), &taskIndex); + if (!(AVTask = AvSetMmThreadCharacteristics (TEXT("Pro Audio"), &taskIndex))) + write_log (L"AvSetMmThreadCharacteristics failed: %d\n", GetLastError ()); } #endif } @@ -689,7 +692,7 @@ static void winuae_inactive (HWND hWnd, int minimized) int wasfocus = focus; write_log (L"winuae_inactive(%d)\n", minimized); -#if 0 +#if USETHREADCHARACTERICS if (AVTask) AvRevertMmThreadCharacteristics (AVTask); AVTask = NULL; @@ -5499,7 +5502,7 @@ void fpux_restore (int *v) #ifndef _WIN64 if (v) _controlfp (*v, _MCW_IC | _MCW_RC | _MCW_PC); - else +#else _controlfp (fpucontrol, _MCW_IC | _MCW_RC | _MCW_PC); #endif } diff --git a/od-win32/win32.h b/od-win32/win32.h index 814c235b..08ce54b7 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -18,8 +18,8 @@ #define WINUAEPUBLICBETA 1 #define LANG_DLL 1 -#define WINUAEBETA L"6" -#define WINUAEDATE MAKEBD(2010, 11, 22) +#define WINUAEBETA L"7" +#define WINUAEDATE MAKEBD(2010, 12, 6) #define WINUAEEXTRA L"" #define WINUAEREV L"" diff --git a/od-win32/win32_scaler.cpp b/od-win32/win32_scaler.cpp index c6001dd9..5ca52d38 100644 --- a/od-win32/win32_scaler.cpp +++ b/od-win32/win32_scaler.cpp @@ -182,26 +182,25 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height ahs2 = vblscale (ah) * scale; aws = aw * scale; ahs = ah * scale; - + //write_log (L"%d %d %d\n", dst_width, temp_width, aws); extraw = -aws * (filter_horiz_zoom - currprefs.gfx_filteroverlay_overscan * 10) / 2000; extrah = -ahs * (filter_vert_zoom - currprefs.gfx_filteroverlay_overscan * 10) / 2000; SetRect (sr, 0, 0, dst_width, dst_height); SetRect (zr, 0, 0, 0, 0); - dr->left = (temp_width - aws) /2; - dr->top = (temp_height - ahs) / 2; - if (currprefs.gfx_xcenter_pos < 0) - dr->left -= (dst_width - aws) / 2; - if (currprefs.gfx_ycenter_pos < 0) - dr->top -= (dst_height - ahs) / 2; - dr->right = dr->left + dst_width; - dr->bottom = dr->top + dst_height; + dr->left = (temp_width - aws) / 2; + dr->top = (temp_height - ahs) / 2; filteroffsetx = 0; filteroffsety = 0; float xmult = filter_horiz_zoom_mult; float ymult = filter_vert_zoom_mult; + dr->left -= (dst_width - aws) / 2; + dr->top -= (dst_height - ahs) / 2; + dr->right = dr->left + dst_width; + dr->bottom = dr->top + dst_height; + srcratio = 4.0 / 3.0; if (currprefs.gfx_filter_aspect > 0) { dstratio = (currprefs.gfx_filter_aspect >> 8) * 1.0 / (currprefs.gfx_filter_aspect & 0xff); @@ -247,13 +246,52 @@ void getfilterrect2 (RECT *sr, RECT *dr, RECT *zr, int dst_width, int dst_height cy = 0; cv = 1; if (scalemode == AUTOSCALE_STATIC_NOMINAL) { - cw -= 80; - ch -= 50; - cx = 56; - cy = 20; + cw -= 40 << currprefs.gfx_resolution; + ch -= 25 << currprefs.gfx_vresolution; + cx = 28 << currprefs.gfx_resolution; + cy = 10 << currprefs.gfx_vresolution; } + } else if (scalemode == AUTOSCALE_MANUAL) { + int v; + + changed_prefs.gfx_filter_horiz_offset = currprefs.gfx_filter_horiz_offset = 0; + changed_prefs.gfx_filter_vert_offset = currprefs.gfx_filter_vert_offset = 0; + filter_horiz_offset = 0; + filter_vert_offset = 0; + + get_custom_topedge(&cx, &cy); + //write_log (L"%dx%d %dx%d\n", cx, cy, currprefs.gfx_resolution, currprefs.gfx_vresolution); + + v = currprefs.gfx_xcenter_pos; + if (v >= 0) + cx = (v >> (RES_MAX - currprefs.gfx_resolution + 1)) - cx; + + v = currprefs.gfx_ycenter_pos; + if (v >= 0) + cy = (v >> (VRES_MAX - currprefs.gfx_vresolution)) - cy; + + v = currprefs.gfx_xcenter_size; + if (v <= 0) + cw = 752 * 2; + else + cw = v; + cw >>= (RES_MAX - currprefs.gfx_resolution); + + v = currprefs.gfx_ycenter_size; + if (v <= 0) + ch = 572; + else + ch = v; + ch >>= (VRES_MAX - currprefs.gfx_vresolution); + + //write_log (L"%dx%d %dx%d %dx%d\n", currprefs.gfx_xcenter_pos, currprefs.gfx_ycenter_pos, cx, cy, cw, ch); + + cv = 1; + } else { + cv = get_custom_limits (&cw, &ch, &cx, &cy); + } if (cv) { @@ -575,7 +613,6 @@ void S2X_free (void) void S2X_init (int dw, int dh, int aw, int ah, int ad, int dd) { int flags = 0; - int res_shift; dst_width2 = dw; dst_height2 = dh; @@ -610,14 +647,15 @@ void S2X_init (int dw, int dh, int aw, int ah, int ad, int dd) changed_prefs.gfx_filter = usedfilter->type; } } - +#if 0 + int res_shift; res_shift = RES_MAX - currprefs.gfx_resolution; if (currprefs.gfx_xcenter_size > 0 && (currprefs.gfx_xcenter_size >> res_shift) < aw) aw = currprefs.gfx_xcenter_size >> res_shift; res_shift = VRES_MAX - currprefs.gfx_vresolution; if (currprefs.gfx_ycenter_size > 0 && (currprefs.gfx_ycenter_size >> res_shift) < ah) ah = currprefs.gfx_ycenter_size >> res_shift; - +#endif dst_width = dw; dst_height = dh; dst_depth = dd; diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 41a08d55..dcbdf5e2 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -12216,6 +12216,8 @@ static void values_to_hw3ddlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); WIN32GUI_LoadUIString (IDS_AUTOSCALE_CENTER, txt, sizeof (txt) / sizeof (TCHAR)); SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); + WIN32GUI_LoadUIString (IDS_AUTOSCALE_MANUAL, txt, sizeof (txt) / sizeof (TCHAR)); + SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt); SendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_SETCURSEL, workprefs.gfx_filter_autoscale, 0); SendDlgItemMessage (hDlg, IDC_FILTERHZ, TBM_SETRANGE, TRUE, MAKELONG (-999, +999)); @@ -12400,15 +12402,23 @@ static void values_to_hw3ddlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_FILTERPRESETS, CB_SETCURSEL, filterpreset_selected, 0); regclosetree (fkey); } + int ho, vo; + if (workprefs.gfx_filter_autoscale == AUTOSCALE_MANUAL) { + ho = workprefs.gfx_xcenter_pos; + vo = workprefs.gfx_ycenter_pos; + } else { + ho = workprefs.gfx_filter_horiz_offset; + vo = workprefs.gfx_filter_vert_offset; + } SendDlgItemMessage (hDlg, IDC_FILTERHZ, TBM_SETPOS, TRUE, workprefs.gfx_filter_horiz_zoom); SendDlgItemMessage (hDlg, IDC_FILTERVZ, TBM_SETPOS, TRUE, workprefs.gfx_filter_vert_zoom); - SendDlgItemMessage (hDlg, IDC_FILTERHO, TBM_SETPOS, TRUE, workprefs.gfx_filter_horiz_offset); - SendDlgItemMessage (hDlg, IDC_FILTERVO, TBM_SETPOS, TRUE, workprefs.gfx_filter_vert_offset); + SendDlgItemMessage (hDlg, IDC_FILTERHO, TBM_SETPOS, TRUE, ho); + SendDlgItemMessage (hDlg, IDC_FILTERVO, TBM_SETPOS, TRUE, vo); SetDlgItemInt (hDlg, IDC_FILTERHZV, workprefs.gfx_filter_horiz_zoom, TRUE); SetDlgItemInt (hDlg, IDC_FILTERVZV, workprefs.gfx_filter_vert_zoom, TRUE); - SetDlgItemInt (hDlg, IDC_FILTERHOV, workprefs.gfx_filter_horiz_offset, TRUE); - SetDlgItemInt (hDlg, IDC_FILTERVOV, workprefs.gfx_filter_vert_offset, TRUE); + SetDlgItemInt (hDlg, IDC_FILTERHOV, ho, TRUE); + SetDlgItemInt (hDlg, IDC_FILTERVOV, vo, TRUE); } static void values_from_hw3ddlg (HWND hDlg) @@ -12767,8 +12777,17 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM SendDlgItemMessage (hDlg, IDC_FILTERHZ, TBM_SETPOS, TRUE, workprefs.gfx_filter_horiz_zoom); } } else { - currprefs.gfx_filter_horiz_offset = workprefs.gfx_filter_horiz_offset = (int)SendMessage (GetDlgItem (hDlg, IDC_FILTERHO), TBM_GETPOS, 0, 0); - currprefs.gfx_filter_vert_offset = workprefs.gfx_filter_vert_offset = (int)SendMessage (GetDlgItem (hDlg, IDC_FILTERVO), TBM_GETPOS, 0, 0); + if (currprefs.gfx_filter_autoscale == AUTOSCALE_MANUAL) { + currprefs.gfx_xcenter_pos = workprefs.gfx_xcenter_pos = (int)SendMessage (GetDlgItem (hDlg, IDC_FILTERHO), TBM_GETPOS, 0, 0); + currprefs.gfx_ycenter_pos = workprefs.gfx_ycenter_pos = (int)SendMessage (GetDlgItem (hDlg, IDC_FILTERVO), TBM_GETPOS, 0, 0); + SetDlgItemInt (hDlg, IDC_FILTERHOV, workprefs.gfx_xcenter_pos, TRUE); + SetDlgItemInt (hDlg, IDC_FILTERVOV, workprefs.gfx_ycenter_pos, TRUE); + } else { + currprefs.gfx_filter_horiz_offset = workprefs.gfx_filter_horiz_offset = (int)SendMessage (GetDlgItem (hDlg, IDC_FILTERHO), TBM_GETPOS, 0, 0); + currprefs.gfx_filter_vert_offset = workprefs.gfx_filter_vert_offset = (int)SendMessage (GetDlgItem (hDlg, IDC_FILTERVO), TBM_GETPOS, 0, 0); + SetDlgItemInt (hDlg, IDC_FILTERHOV, workprefs.gfx_filter_horiz_offset, TRUE); + SetDlgItemInt (hDlg, IDC_FILTERVOV, workprefs.gfx_filter_vert_offset, TRUE); + } } if (filter_selected) { int *pw = filter_selected->varw; @@ -12784,8 +12803,6 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM } SetDlgItemInt (hDlg, IDC_FILTERHZV, workprefs.gfx_filter_horiz_zoom, TRUE); SetDlgItemInt (hDlg, IDC_FILTERVZV, workprefs.gfx_filter_vert_zoom, TRUE); - SetDlgItemInt (hDlg, IDC_FILTERHOV, workprefs.gfx_filter_horiz_offset, TRUE); - SetDlgItemInt (hDlg, IDC_FILTERVOV, workprefs.gfx_filter_vert_offset, TRUE); init_colors (); notice_new_xcolors (); reset_drawing (); diff --git a/od-win32/winuae_msvc10/winuae_msvc.vcxproj b/od-win32/winuae_msvc10/winuae_msvc.vcxproj index 1d2aa945..e90718b4 100644 --- a/od-win32/winuae_msvc10/winuae_msvc.vcxproj +++ b/od-win32/winuae_msvc10/winuae_msvc.vcxproj @@ -157,7 +157,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;%(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;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;%(AdditionalDependencies) NotSet $(OutDir)$(TargetName)$(TargetExt) true @@ -283,7 +283,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;%(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;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;%(AdditionalDependencies) $(OutDir)$(TargetName)$(TargetExt) true %(AdditionalLibraryDirectories);$(SolutionDir)\..\lib\ @@ -427,7 +427,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;%(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;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;%(AdditionalDependencies) $(OutDir)$(TargetName)$(TargetExt) true %(AdditionalLibraryDirectories);$(SolutionDir)\..\lib\ diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 42af5f68..639f8826 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,18 @@ +Beta 7: + +- RTG board start address was not 16M aligned if Z3 fast board smaller than 16M was enabled (no functional difference) +- D3D mode was still modifying host FPU rounding modes +- increased number of available breakpoints and memwatch points +- debugger commands can be sent via uae-configuration (or custom input event) + uae-configuration dbg "debugger command" (remember quotes if debugger command has spaces) +- Fullscreen Max/TV filter settings only worked if display panel resolution matched emulated resolution +- added "Manual" filter option (originally used by AF, now added to GUI, positioning using absolute shres/laced coordinates) Ignore it. + +Beta 6: + +- "old" RTG interface added, used by AROS KS ROM replacement RTG driver + Beta 5: - check clipboard sharing disabled state earlier, before any resource allocations diff --git a/od-win32/writelog.cpp b/od-win32/writelog.cpp index cf778ce3..b7503901 100644 --- a/od-win32/writelog.cpp +++ b/od-win32/writelog.cpp @@ -257,6 +257,33 @@ static void flushconsole (void) } } +static TCHAR *console_buffer; +static int console_buffer_size; + +TCHAR *setconsolemode (TCHAR *buffer, int maxlen) +{ + TCHAR *ret = NULL; + if (buffer) { + console_buffer = buffer; + console_buffer_size = maxlen; + } else { + ret = console_buffer; + console_buffer = NULL; + } + return ret; +} + +static void console_put (const TCHAR *buffer) +{ + if (console_buffer) { + if (_tcslen (console_buffer) + _tcslen (buffer) < console_buffer_size) + _tcscat (console_buffer, buffer); + } else { + openconsole (); + writeconsole (buffer); + } +} + void console_out_f (const TCHAR *format,...) { va_list parms; @@ -265,13 +292,11 @@ void console_out_f (const TCHAR *format,...) va_start (parms, format); _vsntprintf (buffer, WRITE_LOG_BUF_SIZE - 1, format, parms); va_end (parms); - openconsole (); - writeconsole (buffer); + console_put (buffer); } void console_out (const TCHAR *txt) { - openconsole (); - writeconsole (txt); + console_put (txt); } TCHAR console_getch (void) -- 2.47.3