]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
2100b25
authorToni Wilen <twilen@winuae.net>
Sun, 25 Apr 2010 15:59:55 +0000 (18:59 +0300)
committerToni Wilen <twilen@winuae.net>
Sun, 25 Apr 2010 15:59:55 +0000 (18:59 +0300)
cia.cpp
disk.cpp
drawing.cpp
expansion.cpp
gencpu.cpp
include/cpummu.h
newcpu.cpp
od-win32/win32.cpp
od-win32/win32.h
od-win32/win32gfx.cpp
od-win32/win32gui.cpp

diff --git a/cia.cpp b/cia.cpp
index b0817703a529d35161932bd54db4a79bc208ea90..a3728c7e2998f1f1d39667e7c94419e83ebe6d1f 100644 (file)
--- 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 ();
 }
index 0f75a9cd8265c7fc7be2706947018331d88863d2..13920bc5292457c75ecebb76c5bd4d0f1f4e7737 100644 (file)
--- 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);
index 124155fbd39adfcae7e2440e3f62ec4a12bd2a2d..8f34aa867e58cca50a52c4b7a31d173d41e1209d 100644 (file)
@@ -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;
index 46702b2c498e82f5253396a2a5099497e27c3353..bc06e345f0d2005329fa858b0b9fcef8d46d5593 100644 (file)
@@ -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;
index 00f3c72739d41c2f16c730126bc0780fec0ad9e9..72c2015074f9c4574c54d68ad315aebcd31dd844 100644 (file)
@@ -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");
index 8408bddc49aa7316b9e0b1f2a112f38262723dd4..13c65f6dd04aca570466ad2e804bcc40193b06b1 100644 (file)
@@ -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
index a46e34f148c0e84beb7d866c73ba71a83824f5f0..ea00fbadf82479ea831a48ca867bb689b0171cce 100644 (file)
@@ -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
index d578640c3accd14939b64cc72b157d20e9acb6a9..a2c7a025c0729b05b90bf69d71dc46e411aeead9 100644 (file)
@@ -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);
 }
 
index 8b6739784c12ef1fc848e3ea14d5eb4bc56817f4..ef702193cc609b17a865e7047dfd3abc6f2afd8a 100644 (file)
@@ -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
index 550774eac5e071fe74bf1224779a202f83e7d042..9d33194e7d45121b7c51cfaac0ec8ba9f77d750b 100644 (file)
@@ -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);
index 130ba1d61705094c35a7699006f3f0829ad894fe..7f01041f9e27ecc3d2639d30c009a85783400af4 100644 (file)
@@ -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);
        }
 }