]> Shamusworld >> Repos - virtualjaguar/commitdiff
2.0.2 release. 2.0.2
authorShamus Hammons <jlhamm@acm.org>
Thu, 5 Jan 2012 17:07:05 +0000 (17:07 +0000)
committerShamus Hammons <jlhamm@acm.org>
Thu, 5 Jan 2012 17:07:05 +0000 (17:07 +0000)
12 files changed:
Makefile
docs/TODO
docs/WHATSNEW
src/gui/about.cpp
src/gui/app.cpp
src/gui/filepicker.cpp
src/gui/mainwin.cpp
src/jaguar.cpp
src/m68000/Makefile
src/m68000/gencpu.c
src/m68000/m68kdasm.c
src/m68000/m68kinterface.c

index 761360af08a7e04c7949bffe434c0b766de00ee0..59adb8ba49ac8d159a0e5f31ce8d25c4a6c2fb45 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -26,10 +26,10 @@ obj:
 
 prepare: obj
        @echo -e "\033[01;33m***\033[00;32m Preparing to compile Virtual Jaguar...\033[00m"
-#      @echo "#define VJ_RELEASE_VERSION \"v2.0.2\"" > src/version.h
-#      @echo "#define VJ_RELEASE_SUBVERSION \"Final\"" >> src/version.h
-       @echo "#define VJ_RELEASE_VERSION \"SVN `svn info | grep -i revision`\"" > src/version.h
-       @echo "#define VJ_RELEASE_SUBVERSION \"2.0.2 Prerelease\"" >> src/version.h
+       @echo "#define VJ_RELEASE_VERSION \"v2.0.2\"" > src/version.h
+       @echo "#define VJ_RELEASE_SUBVERSION \"Final\"" >> src/version.h
+#      @echo "#define VJ_RELEASE_VERSION \"SVN `svn info | grep -i revision`\"" > src/version.h
+#      @echo "#define VJ_RELEASE_SUBVERSION \"2.0.2 Prerelease\"" >> src/version.h
 
 virtualjaguar: sources libs makefile-qt
        @echo -e "\033[01;33m***\033[00;32m Making Virtual Jaguar GUI...\033[00m"
index ed4b68b1ca12b8859a295ea670305afb3ecc042b..f8276aff5a9e3015db35be95ca90e82897659deb 100644 (file)
--- a/docs/TODO
+++ b/docs/TODO
@@ -1,6 +1,8 @@
 Stuff to add/fix for the next release of Virtual Jaguar
 -------------------------------------------------------
 
+- Fix VC behavior to match what a real Jaguar does. Still not sure just what
+  the heck is going on there. [Shamus]
 - Fix DSP code so that it doesn't hang in a spinlock waiting for the sound
   buffer to empty. Probably a CS lock contention issue. [Shamus]
 - Create an EEPROMs directory (or whatever is in EEPROMPath[]) if it doesn't
index 7019f5573abf1760086e1aea3ecc9b190abd2677..4bd733273591956abbb1435492bbdbd77bfde4b9 100644 (file)
@@ -8,7 +8,7 @@ Virtual Jaguar v2.0.2 GCC/Qt
   real hardware. [Shamus]
 * Fixed video frame timing for both NTSC *and* PAL. [Shamus]
 * Improved OP logging, added emulation of OP bug. [Shamus]
-* Fixed VC behavior to match what a real Jaguar does. [Shamus]
+* Fixed addressing bug with UAE 68000 core. [Shamus]
 
 
 Virtual Jaguar v2.0.1 GCC/Qt
index 1e11561479f8a686703283f83682b8b2341cd49c..c00711a7cf5a5b0f991b193377437cfe335bf9ed 100644 (file)
@@ -40,7 +40,7 @@ AboutWindow::AboutWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog)
                VJ_RELEASE_VERSION " (" VJ_RELEASE_SUBVERSION ")"
                "</td></tr>"
                "<tr><td align='right'><b>Coders: </b></td><td>James L. Hammons (shamus)<br>Niels Wagenaar (nwagenaar)<br>Carwin Jones (Caz)<br>Adam Green</td></tr>"
-               "<tr><td align='right'><b>Testers: </b></td><td>Cyrano Jones, Robert R, TheUMan, Dissection,<br>overridex, geormetal</td></tr>"
+               "<tr><td align='right'><b>Testers: </b></td><td>Cyrano Jones, LinkoVitch, neo-rg, Robert R,<br>TheUMan, Dissection, overridex, geormetal</td></tr>"
                "<tr><td align='right'><b>Build Team: </b></td><td>ggn (win32)<br>LinkoVitch, goldenegg (MacOS)</td></tr>"
                "<tr><td align='right'><b>Homepage: </b></td><td>http://icculus.org/virtualjaguar/</td></tr>"
                "</table>"
index aad90feb2b128db4e6982916d2356868f7ea6f01..d6875160132d9b9219fff8201f5550e15a2b0010 100644 (file)
@@ -40,8 +40,8 @@ int main(int argc, char * argv[])
                {
                        printf("Virtual Jaguar 2.0.0 help\n");
                        printf("\n");
-                       printf("Command line interface is non-functional ATM, but may return if there is\n"
-                               "enough demand for it. :-)\n");
+                       printf("Command line interface is mostly non-functional ATM, but may return if\n"
+                               "there is enough demand for it. :-)\n");
                        return 0;
                }
                if (strcmp(argv[1], "--yarrr") == 0)
@@ -63,9 +63,12 @@ int main(int argc, char * argv[])
        // This is so we can pass this stuff using signal/slot mechanism...
 //ick  int id = qRegisterMetaType<uint32>();
 
-       LogInit("virtualjaguar.log");                           // Init logfile
+       bool success = (bool)LogInit("virtualjaguar.log");      // Init logfile
        int retVal = -1;                                                        // Default is failure
 
+       if (!success)
+               printf("Failed to open virtualjaguar.log for writing!\n");
+
        // Set up SDL library
        if (SDL_Init(SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) < 0)
        {
index 2082ee92fe5a7ca49f8aa4177ee1f54e47bb7fe8..eeec7f4937448dbf613d0ded7376c0cbb7dc1978 100644 (file)
@@ -86,26 +86,26 @@ printf("VSB size: %u, %u\n", sbSize3.width(), sbSize3.height());
        // This sets it to the "too large size" as the minimum!
        QScrollBar * vsb = new QScrollBar(Qt::Vertical, this);
        int sbWidth = vsb->size().width();
-       printf("VSB size width: %u\n", sbWidth);
+//     printf("VSB size width: %u\n", sbWidth);
        int sbWidth2 = vsb->sizeHint().width();
-       printf("VSB sizeHint width: %u\n", sbWidth2);
+//     printf("VSB sizeHint width: %u\n", sbWidth2);
        int sbWidth3 = vsb->minimumSize().width();
-       printf("VSB minimum width: %u\n", sbWidth3);
+//     printf("VSB minimum width: %u\n", sbWidth3);
        int sbWidth4 = vsb->frameSize().width();
-       printf("VSB frame width: %u\n", sbWidth4);
+//     printf("VSB frame width: %u\n", sbWidth4);
        delete vsb;
 
 //     fileList->setFixedWidth((488/4) + 4);
        int sbWidth5 = fileList->frameWidth();
-       printf("List frame width: %u, (diff=%d)\n", sbWidth5, sbWidth5 - ((488/4) + 4));
+//     printf("List frame width: %u, (diff=%d)\n", sbWidth5, sbWidth5 - ((488/4) + 4));
        int sbWidth6 = fileList->sizeHint().width();
-       printf("List sizeHint width: %u\n", sbWidth6);
+//     printf("List sizeHint width: %u\n", sbWidth6);
        int sbWidth7 = fileList->minimumSize().width();
-       printf("List minimum width: %u\n", sbWidth7);
+//     printf("List minimum width: %u\n", sbWidth7);
        int sbWidth8 = fileList->minimumSizeHint().width();
-       printf("List minimum hint width: %u\n", sbWidth8);
-//     fileList->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
-//     fileList->verticalScrollBar()->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
+//     printf("List minimum hint width: %u\n", sbWidth8);
+////   fileList->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
+////   fileList->verticalScrollBar()->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Preferred);
        // (488/4) + 4 is the width of the object in the filelistmodel. Dunno why the QListView
        // isn't picking that up. :-(
        // 488/4 + 4 = 126
index af1dab100837dae93376b6338a0c671ccb288e2a..3cf2ec5a6d1ff183b9eaeebc19cc64b12b32f8d6 100644 (file)
@@ -592,7 +592,10 @@ void MainWin::Unpause(void)
        if (pauseForFileSelector)
        {
                pauseForFileSelector = false;
-               ToggleRunState();
+
+               // Some nutter might have unpaused while in the file selector, so check for that
+               if (!running)
+                       ToggleRunState();
        }
 }
 
index f45678710f6cb853d0e6fa5729c21b962c861e17..e6fd3b60df6efd83a0edc69d68be8e5711fb1f19 100644 (file)
@@ -818,6 +818,39 @@ uint32 ReadDWord(uint32 adddress)
 }
 #endif
 
+void ShowM68KContext(void)
+{
+       printf("\t68K PC=%06X\n", m68k_get_reg(NULL, M68K_REG_PC));
+
+       for(int i=M68K_REG_D0; i<=M68K_REG_D7; i++)
+       {
+               printf("D%i = %08X ", i-M68K_REG_D0, m68k_get_reg(NULL, (m68k_register_t)i));
+
+               if (i == M68K_REG_D3 || i == M68K_REG_D7)
+                       printf("\n");
+       }
+
+       for(int i=M68K_REG_A0; i<=M68K_REG_A7; i++)
+       {
+               printf("A%i = %08X ", i-M68K_REG_A0, m68k_get_reg(NULL, (m68k_register_t)i));
+
+               if (i == M68K_REG_A3 || i == M68K_REG_A7)
+                       printf("\n");
+       }
+
+       uint32_t currpc = m68k_get_reg(NULL, M68K_REG_PC);
+       uint32_t disPC = currpc - 30;
+       char buffer[128];
+
+       do
+       {
+               uint32_t oldpc = disPC;
+               disPC += m68k_disassemble(buffer, disPC, 0);
+               printf("%s%08X: %s\n", (oldpc == currpc ? ">" : " "), oldpc, buffer);
+       }
+       while (disPC < (currpc + 10));
+}
+
 //
 // Musashi 68000 read/write/IRQ functions
 //
@@ -906,6 +939,8 @@ int irq_ack_handler(int level)
 
 unsigned int m68k_read_memory_8(unsigned int address)
 {
+       // Musashi does this automagically for you, UAE core does not :-P
+       address &= 0x00FFFFFF;
 #ifdef CPU_DEBUG_MEMORY
        if ((address >= 0x000000) && (address <= 0x3FFFFF))
        {
@@ -954,6 +989,8 @@ void gpu_dump_registers(void);
 
 unsigned int m68k_read_memory_16(unsigned int address)
 {
+       // Musashi does this automagically for you, UAE core does not :-P
+       address &= 0x00FFFFFF;
 #ifdef CPU_DEBUG_MEMORY
 /*     if ((address >= 0x000000) && (address <= 0x3FFFFE))
        {
@@ -1052,6 +1089,8 @@ unsigned int m68k_read_memory_16(unsigned int address)
 
 unsigned int m68k_read_memory_32(unsigned int address)
 {
+       // Musashi does this automagically for you, UAE core does not :-P
+       address &= 0x00FFFFFF;
 //; So, it seems that it stores the returned DWORD at $51136 and $FB074.
 /*     if (address == 0x51136 || address == 0xFB074 || address == 0x1AF05E)
                WriteLog("[RM32  PC=%08X] Addr: %08X, val: %08X\n", m68k_get_reg(NULL, M68K_REG_PC), address, (m68k_read_memory_16(address) << 16) | m68k_read_memory_16(address + 2));//*/
@@ -1066,6 +1105,8 @@ unsigned int m68k_read_memory_32(unsigned int address)
 
 void m68k_write_memory_8(unsigned int address, unsigned int value)
 {
+       // Musashi does this automagically for you, UAE core does not :-P
+       address &= 0x00FFFFFF;
 #ifdef CPU_DEBUG_MEMORY
        if ((address >= 0x000000) && (address <= 0x3FFFFF))
        {
@@ -1089,6 +1130,10 @@ void m68k_write_memory_8(unsigned int address, unsigned int value)
 //$53D0
 /*if (address >= 0x53D0 && address <= 0x53FF)
        printf("M68K: Writing byte $%02X at $%08X, PC=$%08X\n", value, address, m68k_get_reg(NULL, M68K_REG_PC));//*/
+//Testing AvP on UAE core...
+//000075A0: FFFFF80E B6320220 (BITMAP)
+/*if (address == 0x75A0 && value == 0xFF)
+       printf("M68K: (8) Tripwire hit...\n");//*/
 
 #ifndef USE_NEW_MMU
        if ((address >= 0x000000) && (address <= 0x3FFFFF))
@@ -1108,6 +1153,8 @@ void m68k_write_memory_8(unsigned int address, unsigned int value)
 
 void m68k_write_memory_16(unsigned int address, unsigned int value)
 {
+       // Musashi does this automagically for you, UAE core does not :-P
+       address &= 0x00FFFFFF;
 #ifdef CPU_DEBUG_MEMORY
        if ((address >= 0x000000) && (address <= 0x3FFFFE))
        {
@@ -1155,6 +1202,13 @@ if (address == 0xF02110)
 //$53D0
 /*if (address >= 0x53D0 && address <= 0x53FF)
        printf("M68K: Writing word $%04X at $%08X, PC=$%08X\n", value, address, m68k_get_reg(NULL, M68K_REG_PC));//*/
+//Testing AvP on UAE core...
+//000075A0: FFFFF80E B6320220 (BITMAP)
+/*if (address == 0x75A0 && value == 0xFFFF)
+{
+       printf("\nM68K: (16) Tripwire hit...\n");
+       ShowM68KContext();
+}//*/
 
 #ifndef USE_NEW_MMU
        if ((address >= 0x000000) && (address <= 0x3FFFFE))
@@ -1185,6 +1239,8 @@ if (address == 0xF02110)
 
 void m68k_write_memory_32(unsigned int address, unsigned int value)
 {
+       // Musashi does this automagically for you, UAE core does not :-P
+       address &= 0x00FFFFFF;
 /*if (address == 0x4E00)
        WriteLog("M68K: Writing %02X at %08X, PC=%08X\n", value, address, m68k_get_reg(NULL, M68K_REG_PC));//*/
 //WriteLog("--> [WM32]\n");
@@ -1199,6 +1255,13 @@ if (address == 0xF03214 && value == 0x88E30047)
        doGPUDis = true;//*/
 /*     if (address == 0x51136 || address == 0xFB074)
                WriteLog("[WM32  PC=%08X] Addr: %08X, val: %02X\n", m68k_get_reg(NULL, M68K_REG_PC), address, value);//*/
+//Testing AvP on UAE core...
+//000075A0: FFFFF80E B6320220 (BITMAP)
+/*if (address == 0x75A0 && (value & 0xFFFF0000) == 0xFFFF0000)
+{
+       printf("\nM68K: (32) Tripwire hit...\n");
+       ShowM68KContext();
+}//*/
 
 #ifndef USE_NEW_MMU
        m68k_write_memory_16(address, value >> 16);
@@ -1222,12 +1285,23 @@ bool JaguarInterruptHandlerIsValid(uint32 i) // Debug use only...
 
 void M68K_show_context(void)
 {
-       WriteLog("\t68K PC=%06X\n", m68k_get_reg(NULL, M68K_REG_PC));
+       WriteLog("68K PC=%06X\n", m68k_get_reg(NULL, M68K_REG_PC));
+
        for(int i=M68K_REG_D0; i<=M68K_REG_D7; i++)
-               WriteLog("\tD%i = %08X\n", i-M68K_REG_D0, m68k_get_reg(NULL, (m68k_register_t)i));
-       WriteLog("\n");
+       {
+               WriteLog("D%i = %08X ", i-M68K_REG_D0, m68k_get_reg(NULL, (m68k_register_t)i));
+
+               if (i == M68K_REG_D3 || i == M68K_REG_D7)
+                       WriteLog("\n");
+       }
+
        for(int i=M68K_REG_A0; i<=M68K_REG_A7; i++)
-               WriteLog("\tA%i = %08X\n", i-M68K_REG_A0, m68k_get_reg(NULL, (m68k_register_t)i));
+       {
+               WriteLog("A%i = %08X ", i-M68K_REG_A0, m68k_get_reg(NULL, (m68k_register_t)i));
+
+               if (i == M68K_REG_A3 || i == M68K_REG_A7)
+                       WriteLog("\n");
+       }
 
        WriteLog("68K disasm\n");
 //     jaguar_dasm(s68000readPC()-0x1000,0x20000);
@@ -1651,9 +1725,10 @@ void JaguarInit(void)
 //Seems to want $01010101... Dunno why. Investigate!
        memset(jaguarMainROM, 0x01, 0x600000);  // & set it to all 01s...
 //     memset(jaguar_mainRom, 0xFF, 0x600000); // & set it to all Fs...
-       lowerField = false;                                                             // Reset the lower field flag
+       lowerField = false;                                                     // Reset the lower field flag
 
        m68k_set_cpu_type(M68K_CPU_TYPE_68000);
+       m68k_pulse_reset();                                                     // Need to do this so UAE disasm doesn't segfault on exit
        GPUInit();
        DSPInit();
        TOMInit();
@@ -1819,6 +1894,8 @@ void JaguarDone(void)
 /*     WriteLog("\n\nM68000 disassembly at $4000...\n");
        JaguarDasm(0x4000, 10000);
        WriteLog("\n");//*/
+//     WriteLog("\n\nM68000 disassembly at $802000...\n");
+//     JaguarDasm(0x800830, 0x1000);
 }
 
 //
index d1890c8e296dde8fe94007a78bd2cbc40c71ec19..fd771ae22457767e605f90de604b96dc74276935 100644 (file)
@@ -13,7 +13,7 @@ AR      := ar
 ARFLAGS := -rs
 
 # Note that we use optimization level 2 instead of 3--3 doesn't seem to gain much over 2
-CFLAGS  := -MMD -O2 -ffast-math -fomit-frame-pointer
+CFLAGS  := -MMD -O2 -ffast-math -fomit-frame-pointer -g
 
 INCS    := -I. -I./obj `sdl-config --cflags`
 
index a4729a819beccc69e5290c1b4b42c6a12a269e54..88f121ba1b975740b3e43ea9bf2c0fb3f3ceec52 100644 (file)
@@ -67,7 +67,7 @@
 /*                     Sommarhack 2010) (see m68000.h)                                                 */
 
 
-const char GenCpu_fileid[] = "Hatari gencpu.c : " __DATE__ " " __TIME__;
+//const char GenCpu_fileid[] = "Hatari gencpu.c : " __DATE__ " " __TIME__;
 
 #include <ctype.h>
 #include <string.h>
index 3c54b67b76e725b5d41d76095dcc155f20064cbe..63c65dd53c0cfbb42ef139cd3ad49fc7c930865b 100644 (file)
@@ -234,6 +234,10 @@ int32_t ShowEA(FILE * f, int reg, amodes mode, wordsizes size, char * buf)
 //void m68k_disasm(FILE * f, uint32_t addr, uint32_t * nextpc, int cnt)
 unsigned int m68k_disasm(char * output, uint32_t addr, uint32_t * nextpc, int cnt)
 {
+       // Sanity checking...
+//     if (addr > 0xFFFFFF)
+//             addr = 0;
+
        char f[256], str[256];
        static const char * const ccnames[] =
                { "T ","F ","HI","LS","CC","CS","NE","EQ",
index c6e81021be9e833283dd4266d9f2dec4b4ed3ed7..132a91aa1fe708b5bf69e04bf5c0c00ea8280d41 100644 (file)
@@ -80,6 +80,8 @@ cpuop_func * cpuFunctionTable[65536];
 void Dasm(uint32_t offset, uint32_t qt)
 {
 #ifdef CPU_DEBUG
+// back up a few instructions...
+//offset -= 100;
        static char buffer[2048];//, mem[64];
        int pc = offset, oldpc;
        uint32_t i;
@@ -100,6 +102,21 @@ void Dasm(uint32_t offset, uint32_t qt)
 #endif
 }
 
+#ifdef CPU_DEBUG
+void DumpRegisters(void)
+{
+       uint32_t i;
+
+       for(i=0; i<16; i++)
+       {
+               printf("%s%i: %08X ", (i < 8 ? "D" : "A"), i & 0x7, regs.regs[i]);
+
+               if ((i & 0x03) == 3)
+                       printf("\n");
+       }
+}
+#endif
+
 
 void m68k_set_cpu_type(unsigned int type)
 {
@@ -261,6 +278,34 @@ else if (regs.pc == 0x803422)
 
 if (inRoutine)
        instSeen++;
+#endif
+// AvP testing... (problem was: 32 bit addresses on 24 bit address cpu--FIXED)
+#if 0
+       static int go = 0;
+
+       if (regs.pc == 0x94BA)
+       {
+               go = 1;
+               printf("\n");
+       }
+
+       if (regs.pc == 0x94C6)
+               go = 0;
+
+//     if (regs.regs[10] == 0xFFFFFFFF && go)
+       if (go)
+       {
+//             printf("A2=-1, PC=%08X\n", regs.pc);
+//             go = 0;
+//             Dasm(regs.pc, 130);
+               Dasm(regs.pc, 1);
+               DumpRegisters();
+       }
+//94BA: 2468 0000                MOVEA.L       (A0,$0000) == $0002328A, A2
+//94BE: 200A                     MOVE.L        A2, D0
+//94C0: 6A02                     BPL.B $94C4
+//94C2: 2452                     MOVEA.L       (A2), A2                        ; <--- HERE
+//94C4: 4283                     CLR.L D3
 #endif
                uint32_t opcode = get_iword(0);
 //if ((opcode & 0xFFF8) == 0x31C0)