From 5abb65297a3e4415ba83c0600977e9b7fae5d2f1 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 25 Apr 2010 18:59:55 +0300 Subject: [PATCH] 2100b25 --- cia.cpp | 2 +- disk.cpp | 2 +- drawing.cpp | 2 +- expansion.cpp | 2 +- gencpu.cpp | 33 ++++++++++++++---------- include/cpummu.h | 2 +- newcpu.cpp | 19 +++++++------- od-win32/win32.cpp | 36 ++++++++++++++++++++++++-- od-win32/win32.h | 6 ++--- od-win32/win32gfx.cpp | 4 +-- od-win32/win32gui.cpp | 60 ++++++++++++++++++++++++++++++++++--------- 11 files changed, 122 insertions(+), 46 deletions(-) diff --git a/cia.cpp b/cia.cpp index b0817703..a3728c7e 100644 --- a/cia.cpp +++ b/cia.cpp @@ -553,7 +553,7 @@ static void led_vsync (void) led_on = 0; led_times = 0; if (led_changed) - gui_led (LED_POWER, gui_data.powerled_brightness); + gui_led (LED_POWER, gui_data.powerled); led_changed = 0; led_cycle = get_cycles (); } diff --git a/disk.cpp b/disk.cpp index 0f75a9cd..13920bc5 100644 --- a/disk.cpp +++ b/disk.cpp @@ -649,7 +649,7 @@ static void update_drive_gui (int num) gui_data.drive_track[num] = drv->cyl; gui_data.drive_side = side; gui_data.drive_writing[num] = writ; - gui_led (num + LED_DF0, gui_data.drive_motor[num]); + gui_led (num + LED_DF0, (gui_data.drive_motor[num] ? 1 : 0) | (gui_data.drive_writing[num] ? 2 : 0)); } static void drive_fill_bigbuf (drive * drv,int); diff --git a/drawing.cpp b/drawing.cpp index 124155fb..8f34aa86 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -2479,7 +2479,7 @@ void draw_status_line_single (uae_u8 *buf, int bpp, int y, int totalwidth, uae_u else x_start = TD_PADX; - for (led = 0; led < VISIBLE_LEDS; led++) { + for (led = 0; led < LED_MAX; led++) { int side, pos, num1 = -1, num2 = -1, num3 = -1, num4 = -1; int x, c, on = 0, am = 2; xcolnr on_rgb, on_rgb2, off_rgb, pen_rgb; diff --git a/expansion.cpp b/expansion.cpp index 46702b2c..bc06e345 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -1307,7 +1307,7 @@ void expamem_reset (void) write_log (L"Kickstart version is below 1.3! Disabling autoconfig devices.\n"); do_mount = 0; } - if (need_uae_boot_rom() == 0) + if (need_uae_boot_rom () == 0) do_mount = 0; if (fastmemory != NULL) { card_init[cardno] = expamem_init_fastcard; diff --git a/gencpu.cpp b/gencpu.cpp index 00f3c727..72c20150 100644 --- a/gencpu.cpp +++ b/gencpu.cpp @@ -2115,22 +2115,29 @@ static void gen_opcode (unsigned long int opcode) if (using_ce020) // need some delay so that interrupts have time to clear if previous ins was move to INTREQ printf ("\tdo_cycles_ce (6 * CYCLE_UNIT);\n"); printf ("\tfor (;;) {\n"); - genamode (Aipi, "7", sz_word, "sr", 1, 0, 0); + printf ("\t\tuaecptr a = m68k_areg (regs, 7);\n"); + printf ("\t\tuae_s16 sr = %s (a);\n", srcw); + printf ("\t\tuae_s32 pc = %s (a + 2);\n", srcl); + printf ("\t\tuae_s16 format = %s (a + 2 + 4);\n", srcw); + printf ("\t\tint offset = 8;\n"); +#if 0 + genamode (Aipi, "7", sz_word, "sr", 1, 0, 0); genamode (Aipi, "7", sz_long, "pc", 1, 0, 0); genamode (Aipi, "7", sz_word, "format", 1, 0, 0); - printf ("\tnewsr = sr; newpc = pc;\n"); - printf ("\tif ((format & 0xF000) == 0x0000) { break; }\n"); - printf ("\telse if ((format & 0xF000) == 0x1000) { ; }\n"); - printf ("\telse if ((format & 0xF000) == 0x2000) { m68k_areg (regs, 7) += 4; break; }\n"); - printf ("\telse if ((format & 0xF000) == 0x4000) { m68k_areg (regs, 7) += 8; break; }\n"); - printf ("\telse if ((format & 0xF000) == 0x8000) { m68k_areg (regs, 7) += 50; break; }\n"); +#endif + printf ("\t\tnewsr = sr; newpc = pc;\n"); + printf ("\t\tif ((format & 0xF000) == 0x0000) { m68k_areg (regs, 7) += offset; break; }\n"); + printf ("\t\telse if ((format & 0xF000) == 0x1000) { m68k_areg (regs, 7) += offset; }\n"); + printf ("\t\telse if ((format & 0xF000) == 0x2000) { m68k_areg (regs, 7) += offset + 4; break; }\n"); + printf ("\t\telse if ((format & 0xF000) == 0x4000) { m68k_areg (regs, 7) += offset + 8; break; }\n"); + printf ("\t\telse if ((format & 0xF000) == 0x8000) { m68k_areg (regs, 7) += offset + 50; break; }\n"); if (using_mmu) - printf ("\telse if ((format & 0xF000) == 0x7000) { m68k_do_rte_mmu (); m68k_areg (regs, 7) += 52; break; }\n"); - printf ("\telse if ((format & 0xF000) == 0x9000) { m68k_areg (regs, 7) += 12; break; }\n"); - printf ("\telse if ((format & 0xF000) == 0xa000) { m68k_areg (regs, 7) += 24; break; }\n"); - printf ("\telse if ((format & 0xF000) == 0xb000) { m68k_areg (regs, 7) += 84; break; }\n"); - printf ("\telse { Exception (14, 0); goto %s; }\n", endlabelstr); - printf ("\tregs.sr = newsr; MakeFromSR ();\n}\n"); + printf ("\t\telse if ((format & 0xF000) == 0x7000) { m68k_do_rte_mmu (a); m68k_areg (regs, 7) += offset + 52; break; }\n"); + printf ("\t\telse if ((format & 0xF000) == 0x9000) { m68k_areg (regs, 7) += offset + 12; break; }\n"); + printf ("\t\telse if ((format & 0xF000) == 0xa000) { m68k_areg (regs, 7) += offset + 24; break; }\n"); + printf ("\t\telse if ((format & 0xF000) == 0xb000) { m68k_areg (regs, 7) += offset + 84; break; }\n"); + printf ("\t\telse { m68k_areg (regs, 7) += offset; Exception (14, 0); goto %s; }\n", endlabelstr); + printf ("\t\tregs.sr = newsr; MakeFromSR ();\n}\n"); pop_braces (old_brace_level); printf ("\tregs.sr = newsr; MakeFromSR ();\n"); printf ("\tif (newpc & 1)\n"); diff --git a/include/cpummu.h b/include/cpummu.h index 8408bddc..13c65f6d 100644 --- a/include/cpummu.h +++ b/include/cpummu.h @@ -573,7 +573,7 @@ STATIC_INLINE uae_u32 next_ilong_mmu (void) } extern void m68k_do_rts_mmu (void); -extern void m68k_do_rte_mmu (void); +extern void m68k_do_rte_mmu (uaecptr a7); extern void m68k_do_bsr_mmu (uaecptr oldpc, uae_s32 offset); struct mmufixup diff --git a/newcpu.cpp b/newcpu.cpp index a46e34f1..ea00fbad 100644 --- a/newcpu.cpp +++ b/newcpu.cpp @@ -1468,8 +1468,7 @@ static void Exception_mmu (int nr, uaecptr oldpc) mmu_set_super (1); } if (nr == 2) { - - write_log (L"%08x %08x %08x\n", currpc, oldpc, regs.mmu_fault_addr); +// write_log (L"%08x %08x %08x\n", currpc, oldpc, regs.mmu_fault_addr); // if (currpc == 0x0013b5e2) // activate_debugger (); // bus error @@ -2348,6 +2347,7 @@ unsigned long REGPARAM2 op_illg (uae_u32 opcode) warned++; } Exception (0xB, 0); + //activate_debugger (); return 4; } if ((opcode & 0xF000) == 0xA000) { @@ -3034,9 +3034,10 @@ static void opcodedebug (uae_u32 pc, uae_u16 opcode) } if (!fault) { TCHAR buf[100]; - write_log (L"PC=%08x %04x %s\n", regs.fault_pc, opcode, lookup->name); + write_log (L"mmufixup=%d %04x %04x\n", mmufixup[0].reg, regs.wb3_status, regs.mmu_ssw); m68k_disasm_2 (buf, 100, addr, NULL, 1, NULL, NULL, 0); write_log (L"%s\n", buf); + m68k_dumpstate (stdout, NULL); } } @@ -3062,8 +3063,6 @@ retry: } } CATCH (prb) { - //opcodedebug (regs.fault_pc, opcode); - if (currprefs.mmu_model == 68060) { regs.fault_pc = pc; if (mmufixup[1].reg >= 0) { @@ -3080,6 +3079,8 @@ retry: } } + //opcodedebug (regs.fault_pc, opcode); + if (mmufixup[0].reg >= 0) { m68k_areg (regs, mmufixup[0].reg) = mmufixup[0].value; mmufixup[0].reg = -1; @@ -4291,12 +4292,12 @@ void do_cycles_ce000 (int clocks) do_cycles_ce (clocks * cpucycleunit); } -void m68k_do_rte_mmu (void) +void m68k_do_rte_mmu (uaecptr a7) { - uae_u16 ssr = get_word_mmu (m68k_areg (regs, 7) + 4); + uae_u16 ssr = get_word_mmu (a7 + 8 + 4); if (ssr & MMU_SSW_CT) { - uaecptr src_a7 = m68k_areg (regs, 7) - 8; - uaecptr dst_a7 = m68k_areg (regs, 7) + 52; + uaecptr src_a7 = a7 + 8 - 8; + uaecptr dst_a7 = a7 + 8 + 52; put_word_mmu (dst_a7 + 0, get_word_mmu (src_a7 + 0)); put_long_mmu (dst_a7 + 2, get_long_mmu (src_a7 + 2)); // skip this word diff --git a/od-win32/win32.cpp b/od-win32/win32.cpp index d578640c..a2c7a025 100644 --- a/od-win32/win32.cpp +++ b/od-win32/win32.cpp @@ -1456,12 +1456,44 @@ static LRESULT CALLBACK MainWindowProc (HWND hWnd, UINT message, WPARAM wParam, } break; - + case WM_DRAWITEM: + { + LPDRAWITEMSTRUCT lpDIS = (LPDRAWITEMSTRUCT)lParam; + if (lpDIS->hwndItem == hStatusWnd) { + DWORD flags, tflags; + COLORREF oc; + TCHAR *txt = (TCHAR*)lpDIS->itemData; + tflags = txt[_tcslen (txt) + 1]; + SetBkMode (lpDIS->hDC, TRANSPARENT); + if ((tflags & 2) == 0) + tflags &= ~(4 | 8 | 16); + if (tflags & 4) { + oc = SetTextColor (lpDIS->hDC, RGB(0xcc, 0x00, 0x00)); // writing + } else if (tflags & 8) { + oc = SetTextColor (lpDIS->hDC, RGB(0x00, 0xcc, 0x00)); // playing + } else { + oc = SetTextColor (lpDIS->hDC, GetSysColor ((tflags & 2) ? COLOR_BTNTEXT : COLOR_GRAYTEXT)); + } + flags = DT_VCENTER | DT_SINGLELINE ; + if (tflags & 1) { + flags |= DT_CENTER; + lpDIS->rcItem.left++; + lpDIS->rcItem.right -= 3; + } else { + flags |= DT_LEFT; + lpDIS->rcItem.right--; + lpDIS->rcItem.left += 2; + } + DrawText (lpDIS->hDC, txt, _tcslen (txt), &lpDIS->rcItem, flags); + SetTextColor (lpDIS->hDC, oc); + } + break; + } + default: break; } - return DefWindowProc (hWnd, message, wParam, lParam); } diff --git a/od-win32/win32.h b/od-win32/win32.h index 8b673978..ef702193 100644 --- a/od-win32/win32.h +++ b/od-win32/win32.h @@ -18,9 +18,9 @@ #define WINUAEPUBLICBETA 0 #define LANG_DLL 1 -#define WINUAEBETA L"24" -#define WINUAEDATE MAKEBD(2010, 4, 23) -#define WINUAEEXTRA L"RC2" +#define WINUAEBETA L"25" +#define WINUAEDATE MAKEBD(2010, 4, 25) +#define WINUAEEXTRA L"RC3" #define WINUAEREV L"" #define IHF_WINDOWHIDDEN 6 diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 550774ea..9d33194e 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -1976,7 +1976,7 @@ static void createstatuswindow (void) DestroyWindow (hStatusWnd); } hStatusWnd = CreateWindowEx ( - 0, STATUSCLASSNAME, (LPCTSTR) NULL, SBT_TOOLTIPS | WS_CHILD | WS_VISIBLE, + 0, STATUSCLASSNAME, (LPCTSTR) NULL, SBARS_TOOLTIPS | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hMainWnd, (HMENU) 1, hInst, NULL); if (!hStatusWnd) return; @@ -1994,7 +1994,7 @@ static void createstatuswindow (void) power_width = (int)(42 * scaleX); fps_width = (int)(64 * scaleX); idle_width = (int)(64 * scaleX); - snd_width = (int)(64 * scaleX); + snd_width = (int)(72 * scaleX); GetClientRect (hMainWnd, &rc); /* Allocate an array for holding the right edge coordinates. */ hloc = LocalAlloc (LHND, sizeof (int) * num_parts); diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 130ba1d6..7f01041f 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -13203,7 +13203,7 @@ void gui_fps (int fps, int idle) gui_data.idle = idle; gui_led (LED_FPS, 0); gui_led (LED_CPU, 0); - gui_led (LED_SND, gui_data.sndbuf_status > 1 || gui_data.sndbuf_status < 0); + gui_led (LED_SND, (gui_data.sndbuf_status > 1 || gui_data.sndbuf_status < 0) ? 0 : 1); } void gui_led (int led, int on) @@ -13213,7 +13213,8 @@ void gui_led (int led, int on) static TCHAR dfx[4][300]; TCHAR *ptr, *tt, *p; int pos = -1, j; - int writing = 0; + int writing = 0, playing = 0, active2 = 0; + int center = 0; indicator_leds (led, on); #ifdef LOGITECHLCD @@ -13235,7 +13236,7 @@ void gui_led (int led, int on) if (gui_data.drive_disabled[led - 1]) _tcscpy (ptr, L""); else - _stprintf (ptr , L"%02d .", gui_data.drive_track[led - 1]); + _stprintf (ptr , L"%02d", gui_data.drive_track[led - 1]); p = gui_data.df[led - 1]; j = _tcslen (p) - 1; if (j < 0) @@ -13249,15 +13250,28 @@ void gui_led (int led, int on) tt[0] = 0; if (_tcslen (p + j) > 0) _stprintf (tt, L"%s [CRC=%08X]", p + j, gui_data.crc32[led - 1]); + center = 1; + if (gui_data.drive_writing[led - 1]) + writing = 1; } else if (led == LED_POWER) { pos = 3; ptr = _tcscpy (drive_text + pos * 16, L"Power"); + center = 1; } else if (led == LED_HD) { pos = 4; ptr = _tcscpy (drive_text + pos * 16, L"HD"); + center = 1; + if (on > 1) + writing = 1; } else if (led == LED_CD) { pos = 5; ptr = _tcscpy (drive_text + pos * 16, L"CD"); + center = 1; + if (on & LED_CD_AUDIO) + playing = 1; + else if (on & LED_CD_ACTIVE2) + active2 = 1; + on &= 1; } else if (led == LED_FPS) { double fps = (double)gui_data.fps / 10.0; extern int p96vblank; @@ -13269,30 +13283,52 @@ void gui_led (int led, int on) _stprintf (ptr, L"%d [%.1f]", p96vblank, fps); else _stprintf (ptr, L"FPS: %.1f", fps); - if (pause_emulation) + if (pause_emulation) { _tcscpy (ptr, L"PAUSED"); + center = 1; + } + on = 1; } else if (led == LED_CPU) { pos = 1; ptr = drive_text + pos * 16; _stprintf (ptr, L"CPU: %.0f%%", (double)((gui_data.idle) / 10.0)); - } else if (led == LED_SND) { + if (pause_emulation) + on = 0; + else + on = 1; + } else if (led == LED_SND && gui_data.drive_disabled[3]) { pos = 0; ptr = drive_text + pos * 16; - if (gui_data.sndbuf_status < 3) { + if (gui_data.sndbuf_status < 3 && !pause_emulation) { _stprintf (ptr, L"SND: %+.0f%%", (double)((gui_data.sndbuf) / 10.0)); } else { _tcscpy (ptr, L"SND: -"); + center = 1; on = 0; } + } else if (led == LED_MD) { + pos = 6 + 3; + ptr = _tcscpy (drive_text + pos * 16, L"NV"); } - if (on) - type = SBT_POPOUT; - else - type = 0; + + type = SBT_OWNERDRAW; if (pos >= 0) { - PostMessage (hStatusWnd, SB_SETTEXT, (WPARAM) ((pos + 1) | type), (LPARAM) ptr); + ptr[_tcslen (ptr) + 1] = 0; + if (center) + ptr[_tcslen (ptr) + 1] |= 1; + if (on) { + ptr[_tcslen (ptr) + 1] |= 2; + type |= SBT_POPOUT; + } + if (writing) + ptr[_tcslen (ptr) + 1] |= 4; + if (playing) + ptr[_tcslen (ptr) + 1] |= 8; + if (active2) + ptr[_tcslen (ptr) + 1] |= 16; + PostMessage (hStatusWnd, SB_SETTEXT, (WPARAM)((pos + 1) | type), (LPARAM)ptr); if (tt != NULL) - PostMessage (hStatusWnd, SB_SETTIPTEXT, (WPARAM) (pos + 1), (LPARAM) tt); + PostMessage (hStatusWnd, SB_SETTIPTEXT, (WPARAM)(pos + 1), (LPARAM)tt); } } -- 2.47.3