From cfa60784113bb0d24c4c40c0b399535c1230aed9 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 9 Jan 2011 16:49:05 +0200 Subject: [PATCH] 2310b10 --- blkdev.cpp | 15 +++++++++++++-- custom.cpp | 3 ++- debug.cpp | 19 ++++++++++++++----- disk.cpp | 2 +- drawing.cpp | 4 +--- filesys.cpp | 4 ++-- inputdevice.cpp | 6 +++--- memory.cpp | 6 +++++- newcpu.cpp | 21 ++++++++++++++++++++- od-win32/dinput.cpp | 2 +- od-win32/picasso96_win.cpp | 20 ++++++++++++++++---- od-win32/rp.cpp | 24 ++++++++++++------------ od-win32/rp.h | 7 ++++--- od-win32/win32.h | 4 ++-- od-win32/win32gfx.cpp | 5 +++-- od-win32/winuaechangelog.txt | 6 ++++++ 16 files changed, 105 insertions(+), 43 deletions(-) diff --git a/blkdev.cpp b/blkdev.cpp index 8e7fe837..00ecd7c5 100644 --- a/blkdev.cpp +++ b/blkdev.cpp @@ -385,6 +385,9 @@ int get_standard_cd_unit (cd_standard_unit csu) int unitnum = get_standard_cd_unit2 (csu); if (unitnum < 0) return -1; +#ifdef RETROPLATFORM + rp_cd_device_enable (unitnum, true); +#endif delayed[unitnum] = 0; if (currprefs.cdslots[unitnum].delayed) { delayed[unitnum] = PRE_INSERT_DELAY; @@ -405,11 +408,20 @@ int sys_command_isopen (int unitnum) int sys_command_open (int unitnum) { waspaused[unitnum] = 0; - return sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name[0] ? currprefs.cdslots[unitnum].name : NULL, CD_STANDARD_UNIT_DEFAULT); + int v = sys_command_open_internal (unitnum, currprefs.cdslots[unitnum].name[0] ? currprefs.cdslots[unitnum].name : NULL, CD_STANDARD_UNIT_DEFAULT); + if (!v) + return 0; +#ifdef RETROPLATFORM + rp_cd_device_enable (unitnum, true); +#endif + return v; } void sys_command_close (int unitnum) { +#ifdef RETROPLATFORM + rp_cd_device_enable (unitnum, false); +#endif sys_command_close_internal (unitnum); } @@ -418,7 +430,6 @@ void blkdev_cd_change (int unitnum, const TCHAR *name) struct device_info di; sys_command_info (unitnum, &di, 1); #ifdef RETROPLATFORM - rp_cd_change (unitnum, di.media_inserted); rp_cd_image_change (unitnum, name); #endif } diff --git a/custom.cpp b/custom.cpp index 910f97e0..1b278a12 100644 --- a/custom.cpp +++ b/custom.cpp @@ -4749,7 +4749,8 @@ STATIC_INLINE void do_sprites_1 (int num, int cycle, int hpos) struct sprite *s = &spr[num]; int dma, posctl = 0; uae_u16 data; - int isdma = dmaen (DMA_SPRITE); + // fetch both sprite pairs even if DMA was switched off between sprites + int isdma = dmaen (DMA_SPRITE) || ((num & 1) && spr[num & ~1].dmacycle); if (isdma && vpos == sprite_vblank_endline) spr_arm (num, 0); diff --git a/debug.cpp b/debug.cpp index 1dfa5963..2355f37a 100644 --- a/debug.cpp +++ b/debug.cpp @@ -3363,6 +3363,7 @@ static BOOL debug_line (TCHAR *input) case 'H': { int count, temp, badly, skip; + uae_u32 addr = 0; uae_u32 oldpc = m68k_getpc (); struct regstruct save_regs = regs; @@ -3376,6 +3377,10 @@ static BOOL debug_line (TCHAR *input) count = readint (&inptr); else count = 10; + if (count > 1000) { + addr = count; + count = MAX_HIST; + } if (count < 0) break; skip = count; @@ -3391,11 +3396,15 @@ static BOOL debug_line (TCHAR *input) } while (temp != lasthist) { regs = history[temp]; - m68k_setpc (history[temp].pc); - if (badly) - m68k_dumpstate (stdout, NULL); - else - m68k_disasm (stdout, history[temp].pc, NULL, 1); + if (history[temp].pc == addr || addr == 0) { + m68k_setpc (history[temp].pc); + if (badly) + m68k_dumpstate (stdout, NULL); + else + m68k_disasm (stdout, history[temp].pc, NULL, 1); + if (addr && history[temp].pc == addr) + break; + } if (skip-- < 0) break; if (++temp == MAX_HIST) diff --git a/disk.cpp b/disk.cpp index a0c299a5..d1d2424c 100644 --- a/disk.cpp +++ b/disk.cpp @@ -2365,7 +2365,7 @@ static void DISK_check_change (void) currprefs.floppyslots[i].dfxtype = changed_prefs.floppyslots[i].dfxtype; reset_drive (i); #ifdef RETROPLATFORM - rp_floppydrive_change (i, currprefs.floppyslots[i].dfxtype >= 0 ? 1 : 0); + rp_floppy_device_enable (i, currprefs.floppyslots[i].dfxtype >= 0); #endif } } diff --git a/drawing.cpp b/drawing.cpp index 9fafac4d..a3cfc07c 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -2238,7 +2238,7 @@ static void center_image (void) thisframe_y_adjust = minfirstline; thisframe_y_adjust_real = thisframe_y_adjust << linedbl; - tmp = (maxvpos_nom - thisframe_y_adjust) << linedbl; + tmp = (maxvpos_nom - thisframe_y_adjust + 1) << linedbl; if (tmp != max_ypos_thisframe) { last_max_ypos = tmp; if (last_max_ypos < 0) @@ -2525,12 +2525,10 @@ void finish_drawing_frame (void) break; if (where2 < 0) continue; - hposblank = 0; pfield_draw_line (line, where2, amiga2aspect_line_map[i1 + 1]); } - /* clear possible old garbage at the bottom if emulated area become smaller */ for (i = last_max_ypos; i < gfxvidinfo.height; i++) { int i1 = i + min_ypos_for_screen; diff --git a/filesys.cpp b/filesys.cpp index da9d0fe5..1c249a44 100644 --- a/filesys.cpp +++ b/filesys.cpp @@ -3989,10 +3989,10 @@ static void if (mode < 0) whence = SEEK_SET; - TRACE((L"ACTION_SEEK(%s,%d,%d)\n", k->aino->nname, pos, mode)); + old = fs_lseek (k->fd, 0, SEEK_CUR); + TRACE((L"ACTION_SEEK(%s,%d,%d)=%d\n", k->aino->nname, pos, mode, old)); gui_flicker_led (LED_HD, unit->unit, 1); - old = fs_lseek (k->fd, 0, SEEK_CUR); { uae_s64 temppos; uae_s64 filesize = fs_lseek64 (k->fd, 0, SEEK_END); diff --git a/inputdevice.cpp b/inputdevice.cpp index d0907446..9dfb1bb9 100644 --- a/inputdevice.cpp +++ b/inputdevice.cpp @@ -3081,7 +3081,7 @@ static int switchdevice (struct uae_input_device *id, int num, int button) if (num == 0 && otherbuttonpressed) newport = newport ? 0 : 1; if (currprefs.input_selected_setting == GAMEPORT_INPUT_SETTINGS) { - if (num == 0 || num == 1) { + if ((num == 0 || num == 1) && currprefs.jports[newport].id != JPORT_CUSTOM) { int om = jsem_ismouse (num, &currprefs); int om1 = jsem_ismouse (0, &currprefs); int om2 = jsem_ismouse (1, &currprefs); @@ -4271,8 +4271,8 @@ static void compatibility_copy (struct uae_prefs *prefs, bool gameports) if (gameports) cleardev (joysticks, joy); input_get_default_joystick (joysticks, joy, i, af, 0); - _tcsncpy (prefs->jports[i].name, idev[IDTYPE_MOUSE].get_friendlyname (joy), MAX_JPORTNAME - 1); - _tcsncpy (prefs->jports[i].configname, idev[IDTYPE_MOUSE].get_uniquename (joy), MAX_JPORTNAME - 1); + _tcsncpy (prefs->jports[i].name, idev[IDTYPE_JOYSTICK].get_friendlyname (joy), MAX_JPORTNAME - 1); + _tcsncpy (prefs->jports[i].configname, idev[IDTYPE_JOYSTICK].get_uniquename (joy), MAX_JPORTNAME - 1); used[joy] = 1; joymodes[i] = JSEM_MODE_JOYSTICK; } diff --git a/memory.cpp b/memory.cpp index b1cabfc5..0236dacd 100644 --- a/memory.cpp +++ b/memory.cpp @@ -6,6 +6,8 @@ * (c) 1995 Bernd Schmidt */ +#define DEBUG_STUPID 0 + #include "sysconfig.h" #include "sysdeps.h" @@ -1227,7 +1229,9 @@ uae_u8 *REGPARAM2 default_xlate (uaecptr a) uaecptr a2 = a - 32; uaecptr a3 = m68k_getpc () - 32; write_log (L"Your Amiga program just did something terribly stupid %08X PC=%08X\n", a, M68K_GETPC); - //activate_debugger(); +#if DEBUG_STUPID + activate_debugger(); +#endif m68k_dumpstate (0, 0); for (i = 0; i < 10; i++) { write_log (L"%08X ", i >= 5 ? a3 : a2); diff --git a/newcpu.cpp b/newcpu.cpp index 3bf6db6e..7d319329 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -3331,6 +3331,25 @@ STATIC_INLINE int do_specialties (int cycles) } while (regs.spcflags & SPCFLAG_STOP) { + + if (uae_int_requested) { + INTREQ_f (0x8008); + set_special (SPCFLAG_INT); + } + { + extern int volatile uaenet_int_requested; + if (uaenet_int_requested) { + INTREQ_f (0x8000 | 0x2000); + set_special (SPCFLAG_INT); + } + } + { + extern void bsdsock_fake_int_handler (void); + extern int volatile bsd_int_requested; + if (bsd_int_requested) + bsdsock_fake_int_handler (); + } + if (cpu_tracer > 0) { cputrace.stopped = regs.stopped; cputrace.intmask = regs.intmask; @@ -3366,7 +3385,7 @@ STATIC_INLINE int do_specialties (int cycles) return 1; } - if (currprefs.cpu_idle && currprefs.m68k_speed != 0 && ((regs.spcflags & SPCFLAG_STOP)) == SPCFLAG_STOP) { + if (!uae_int_requested && currprefs.cpu_idle && currprefs.m68k_speed != 0 && ((regs.spcflags & SPCFLAG_STOP)) == SPCFLAG_STOP) { /* sleep 1ms if STOP-instruction is executed */ if (1) { static int sleepcnt, lvpos, zerocnt; diff --git a/od-win32/dinput.cpp b/od-win32/dinput.cpp index 61a77ca2..f3f46864 100644 --- a/od-win32/dinput.cpp +++ b/od-win32/dinput.cpp @@ -1734,7 +1734,7 @@ static BOOL di_enumcallback2 (LPCDIDEVICEINSTANCE lpddi, int joy) _tcscpy (did->name, lpddi->tszInstanceName); } else { did->name = xmalloc (TCHAR, 100); - _stprintf (did->name, L"[no name]"); + _tcscpy (did->name, L"[no name]"); } trimws (did->name); _stprintf (tmp, L"%08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X %08X-%04X-%04X-%02X%02X%02X%02X%02X%02X%02X%02X", diff --git a/od-win32/picasso96_win.cpp b/od-win32/picasso96_win.cpp index 15d36f08..074fad26 100644 --- a/od-win32/picasso96_win.cpp +++ b/od-win32/picasso96_win.cpp @@ -2274,6 +2274,12 @@ void picasso_enablescreen (int on) checkrtglibrary(); } +static void resetpalette(void) +{ + for (int i = 0; i < 256; i++) + picasso96_state.CLUT[i].Pad = 0xff; +} + /* * SetColorArray: * a0: struct BoardInfo @@ -2295,16 +2301,20 @@ static int updateclut (uaecptr clut, int start, int count) int g = get_byte (clut + 1); int b = get_byte (clut + 2); - changed |= (picasso96_state.CLUT[i].Red != r + //write_log(L"%d: %02x%02x%02x\n", i, r, g, b); + changed |= picasso96_state.CLUT[i].Red != r || picasso96_state.CLUT[i].Green != g - || picasso96_state.CLUT[i].Blue != b); - + || picasso96_state.CLUT[i].Blue != b; + if (picasso96_state.CLUT[i].Pad) { + changed = 1; + picasso96_state.CLUT[i].Pad = 0; + } picasso96_state.CLUT[i].Red = r; picasso96_state.CLUT[i].Green = g; picasso96_state.CLUT[i].Blue = b; clut += 3; } - picasso_palette (); + changed |= picasso_palette (); return changed; } static uae_u32 REGPARAM2 picasso_SetColorArray (TrapContext *ctx) @@ -3212,6 +3222,7 @@ static uae_u32 REGPARAM2 picasso_SetDisplay (TrapContext *ctx) { uae_u32 state = m68k_dreg (regs, 0); P96TRACE ((L"SetDisplay(%d)\n", state)); + resetpalette(); return !state; } @@ -4300,6 +4311,7 @@ void picasso_reset (void) uaegfx_active = 0; interrupt_enabled = 0; reserved_gfxmem = 0; + resetpalette(); } void uaegfx_install_code (void) diff --git a/od-win32/rp.cpp b/od-win32/rp.cpp index 49450f4d..82b6f5ed 100644 --- a/od-win32/rp.cpp +++ b/od-win32/rp.cpp @@ -994,36 +994,36 @@ void rp_cd_image_change (int num, const TCHAR *name) rp_device_change (RP_DEVICE_CD, num, name); } -void rp_floppydrive_change (int num, int removed) +void rp_floppy_device_enable (int num, bool enabled) { if (!cando ()) return; - if (removed) - floppy_mask &= ~(1 << num); - else + if (enabled) floppy_mask |= 1 << num; + else + floppy_mask &= ~(1 << num); RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_FLOPPY, floppy_mask, NULL, 0, &guestinfo, NULL); } -void rp_hd_change (int num, int removed) +void rp_hd_device_enable (int num, bool enabled) { if (!cando ()) return; - if (removed) - hd_mask &= ~(1 << num); - else + if (enabled) hd_mask |= 1 << num; + else + hd_mask &= ~(1 << num); RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_HD, hd_mask, NULL, 0, &guestinfo, NULL); } -void rp_cd_change (int num, int removed) +void rp_cd_device_enable (int num, bool enabled) { if (!cando ()) return; - if (removed) - cd_mask &= ~(1 << num); - else + if (enabled) cd_mask |= 1 << num; + else + cd_mask &= ~(1 << num); RPSendMessagex (RPIPCGM_DEVICES, RP_DEVICE_CD, cd_mask, NULL, 0, &guestinfo, NULL); } diff --git a/od-win32/rp.h b/od-win32/rp.h index bce81613..ef796385 100644 --- a/od-win32/rp.h +++ b/od-win32/rp.h @@ -32,8 +32,9 @@ extern void rp_update_gameport (int port, int mask, int onoff); extern void rp_update_volume (struct uae_prefs*); extern void rp_update_leds (int, int, int); extern void rp_floppy_track (int floppy, int track); -extern void rp_floppydrive_change (int num, int removed); extern void rp_hd_activity (int, int, int); -extern void rp_hd_change (int, int); extern void rp_cd_activity (int, int); -extern void rp_cd_change (int, int); + +void rp_floppy_device_enable (int num, bool enabled); +void rp_hd_device_enable (int num, bool enabled); +void rp_cd_device_enable (int num, bool enabled); diff --git a/od-win32/win32.h b/od-win32/win32.h index 46d8c730..83bfc2b0 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"9" -#define WINUAEDATE MAKEBD(2011, 1, 4) +#define WINUAEBETA L"10" +#define WINUAEDATE MAKEBD(2011, 1, 9) #define WINUAEEXTRA L"" #define WINUAEREV L"" diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 48fe2d79..71d72f3e 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -55,7 +55,7 @@ #endif #define AMIGA_WIDTH_MAX (752 / 2) -#define AMIGA_HEIGHT_MAX (572 / 2) +#define AMIGA_HEIGHT_MAX (574 / 2) #define DM_DX_FULLSCREEN 1 #define DM_W_FULLSCREEN 2 @@ -1615,7 +1615,8 @@ int picasso_palette (void) | doMask256 (g, green_bits, green_shift) | doMask256 (b, blue_bits, blue_shift)) | doMask256 (0xff, alpha_bits, alpha_shift); - if (v != picasso_vidinfo.clut[i]) { + if (v != picasso_vidinfo.clut[i]) { + //write_log (L"%d:%08x\n", i, v); picasso_vidinfo.clut[i] = v; changed = 1; } diff --git a/od-win32/winuaechangelog.txt b/od-win32/winuaechangelog.txt index 478b7fb4..d1d6487c 100644 --- a/od-win32/winuaechangelog.txt +++ b/od-win32/winuaechangelog.txt @@ -1,4 +1,10 @@ +- fast multicore systems filesystem slowdown fix (always been there but "slower" CPUs didn't trigger it so easily) +- last scanline was invisible in filtered doubled modes +- sprite dma does not switch immediately off when DMACON sprite bit is cleared (Magic Demo / Diabolics) +- do not autoswitch (button press on unused input device) if it would replace GamePorts custom remapped input device +- fixed GamePorts parallel port configuration possible crash and wrong configuration + Beta 9: - emulate mouse counter behavior 100% when joystick is connected (increase/decrease counter by 4 when -- 2.47.3