]> Shamusworld >> Repos - virtualjaguar/commitdiff
Fixes in the controller config for MacOSX, added option to turn off GPU.
authorShamus Hammons <jlhamm@acm.org>
Sun, 31 Jul 2011 23:07:25 +0000 (23:07 +0000)
committerShamus Hammons <jlhamm@acm.org>
Sun, 31 Jul 2011 23:07:25 +0000 (23:07 +0000)
src/gui/configdialog.cpp
src/gui/controllerwidget.cpp
src/gui/generaltab.cpp
src/gui/generaltab.h
src/gui/keygrabber.cpp
src/gui/mainwin.cpp
src/jaguar.cpp
src/op.cpp
src/settings.h

index ab12b13f02631d9f94c311f9be957156b4a4c274..8ee3ce175fb95a1a3ec2c2204d4abe636fa7128e 100644 (file)
@@ -67,6 +67,7 @@ void ConfigDialog::LoadDialogFromSettings(void)
        generalTab->edit4->setText(vjs.ROMPath);
 
        generalTab->useBIOS->setChecked(vjs.useJaguarBIOS);
+       generalTab->useGPU->setChecked(vjs.GPUEnabled);
        generalTab->useDSP->setChecked(vjs.DSPEnabled);
        generalTab->useHostAudio->setChecked(vjs.audioEnabled);
 
@@ -94,6 +95,7 @@ void ConfigDialog::UpdateVJSettings(void)
        strcpy(vjs.ROMPath,     generalTab->edit4->text().toAscii().data());
 
        vjs.useJaguarBIOS = generalTab->useBIOS->isChecked();
+       vjs.GPUEnabled    = generalTab->useGPU->isChecked();
        vjs.DSPEnabled    = generalTab->useDSP->isChecked();
        vjs.audioEnabled  = generalTab->useHostAudio->isChecked();
 
index 112592996a12eb3b2a162ae2f881c8e8ed5324f8..fd9ebf24bee74952235e38e458c5a15c0054a407 100644 (file)
@@ -25,7 +25,7 @@ char ControllerWidget::keyName1[96][16] = {
        "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":", ";", "<", "=", ">", "?",
        "@", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N",
        "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
-       "[", "]", "\\", "^", "_", "`",
+       "[", "\\", "]", "^", "_", "`",
        "$61", "$62", "$63", "$64", "$65", "$66", "$67", "$68", "$69", "$6A", "$6B", "$6C", "$6D", 
        "$6E", "$6F", "$70", "$71", "$72", "$73", "$74", "$75", "$76", "$77", "$78", "$79", "$7A", 
        "{", "|", "}", "~"
index a9f824af58030eec6ace62c1f29af0a90a09c2a7..883f13755397f4e3998670e143c1974cd0fa3ec8 100644 (file)
@@ -54,11 +54,13 @@ GeneralTab::GeneralTab(QWidget * parent/*= 0*/): QWidget(parent)
 
        // Checkboxes...
        useBIOS            = new QCheckBox(tr("Enable Jaguar BIOS"));
+       useGPU             = new QCheckBox(tr("Enable GPU"));
        useDSP             = new QCheckBox(tr("Enable DSP"));
        useHostAudio       = new QCheckBox(tr("Enable audio playback (requires DSP)"));
        useUnknownSoftware = new QCheckBox(tr("Show all files in file chooser"));
 
        layout4->addWidget(useBIOS);
+       layout4->addWidget(useGPU);
        layout4->addWidget(useDSP);
        layout4->addWidget(useHostAudio);
        layout4->addWidget(useUnknownSoftware);
index 2d3afb55a86738ce3b9a1fbee8e7aaca980a2ad9..d1338ab4ad08e7d9e23264f8f333d4f3a71adf5f 100644 (file)
@@ -18,6 +18,7 @@ class GeneralTab: public QWidget
                QLineEdit * edit4;
 
                QCheckBox * useBIOS;
+               QCheckBox * useGPU;
                QCheckBox * useDSP;
                QCheckBox * useHostAudio;
                QCheckBox * useUnknownSoftware;
index 0bea66f33ae636846745f29d5fcd3ba5b220f9b5..cc0b7143b08c861cfbf2bab5cac6c94e6bfa316c 100644 (file)
@@ -21,6 +21,9 @@ KeyGrabber::KeyGrabber(QWidget * parent/*= 0*/): QDialog(parent)
        mainLayout->addWidget(label);
        setLayout(mainLayout);
        setWindowTitle(tr("Grab"));
+
+       // Will this make Mac OSX work???
+       setFocusPolicy(Qt::StrongFocus);
 }
 
 KeyGrabber::~KeyGrabber()
index 5c0f1b492d9978395d3809cb304eee5aec5d110e..3ff3ded3283fe0dab0fc07f9640773ccac40aee1 100644 (file)
@@ -643,6 +643,7 @@ void MainWin::ReadSettings(void)
        vjs.hardwareTypeNTSC = settings.value("hardwareTypeNTSC", true).toBool();
        vjs.frameSkip        = settings.value("frameSkip", 0).toInt();
        vjs.useJaguarBIOS    = settings.value("useJaguarBIOS", false).toBool();
+       vjs.GPUEnabled       = settings.value("GPUEnabled", true).toBool();
        vjs.DSPEnabled       = settings.value("DSPEnabled", false).toBool();
        vjs.audioEnabled     = settings.value("audioEnabled", true).toBool();
        vjs.usePipelinedDSP  = settings.value("usePipelinedDSP", false).toBool();
@@ -726,6 +727,7 @@ void MainWin::WriteSettings(void)
        settings.setValue("hardwareTypeNTSC", vjs.hardwareTypeNTSC);
        settings.setValue("frameSkip", vjs.frameSkip);
        settings.setValue("useJaguarBIOS", vjs.useJaguarBIOS);
+       settings.setValue("GPUEnabled", vjs.GPUEnabled);
        settings.setValue("DSPEnabled", vjs.DSPEnabled);
        settings.setValue("audioEnabled", vjs.audioEnabled);
        settings.setValue("usePipelinedDSP", vjs.usePipelinedDSP);
index 2ce5da5a5cba671e6ab823a56e6a6e465142a866..2cf99dbb09f5e23146858d75d5781cfc4a6c5894 100644 (file)
@@ -1817,7 +1817,8 @@ if (effect_start)
                BUTCHExec(RISCCyclesPerScanline);
 //if (start_logging)
 //     WriteLog("About to execute GPU (%u)...\n", i);
-               GPUExec(RISCCyclesPerScanline);
+               if (vjs.GPUEnabled)
+                       GPUExec(RISCCyclesPerScanline);
 
                if (vjs.DSPEnabled)
                {
@@ -1968,7 +1969,9 @@ void JaguarExecuteNew(void)
 //WriteLog("JEN: Time to next event (%u) is %f usec (%u RISC cycles)...\n", nextEvent, timeToNextEvent, USEC_TO_RISC_CYCLES(timeToNextEvent));
 
                m68k_execute(USEC_TO_M68K_CYCLES(timeToNextEvent));
-               GPUExec(USEC_TO_RISC_CYCLES(timeToNextEvent));
+
+               if (vjs.GPUEnabled)
+                       GPUExec(USEC_TO_RISC_CYCLES(timeToNextEvent));
 
                if (vjs.DSPEnabled)
                {
index 510b034b14685e479c0618fd53cc2b216009ec26..3765250e1ab55c78d1676f53efdff881c5f6a770 100644 (file)
@@ -898,6 +898,10 @@ if (depth > 5)
 // anyway.
 // This seems to be the case (at least according to the Midsummer docs)...!
 
+// This is to test using palette zeroes instead of bit zeroes...
+// And it seems that this is wrong, index == 0 is transparent apparently... :-/
+//#define OP_USES_PALETTE_ZERO
+
        if (depth == 0)                                                                 // 1 BPP
        {
                // The LSB of flags is OPFLAG_REFLECT, so sign extend it and or 2 into it.
@@ -915,7 +919,11 @@ if (depth > 5)
                        while (i++ < 64)
                        {
                                uint8 bit = pixels >> 63;
+#ifndef OP_USES_PALETTE_ZERO
                                if (flagTRANS && bit == 0)
+#else
+                               if (flagTRANS && (paletteRAM16[index | bit] == 0))
+#endif
                                        ;       // Do nothing...
                                else
                                {
@@ -963,7 +971,11 @@ if (firstPix)
 // This only works for the palettized modes (1 - 8 BPP), since we actually have to
 // copy data from memory in 16 BPP mode (or does it? Isn't this the same as the CLUT case?)
 // No, it isn't because we read the memory in an endian safe way--this *won't* work...
+#ifndef OP_USES_PALETTE_ZERO
                                if (flagTRANS && bits == 0)
+#else
+                               if (flagTRANS && (paletteRAM16[index | bits] == 0))
+#endif
                                        ;       // Do nothing...
                                else
                                {
@@ -1003,7 +1015,11 @@ if (firstPix)
 // This only works for the palettized modes (1 - 8 BPP), since we actually have to
 // copy data from memory in 16 BPP mode (or does it? Isn't this the same as the CLUT case?)
 // No, it isn't because we read the memory in an endian safe way--this *won't* work...
+#ifndef OP_USES_PALETTE_ZERO
                                if (flagTRANS && bits == 0)
+#else
+                               if (flagTRANS && (paletteRAM16[index | bits] == 0))
+#endif
                                        ;       // Do nothing...
                                else
                                {
@@ -1044,7 +1060,14 @@ if (firstPix)
 // This only works for the palettized modes (1 - 8 BPP), since we actually have to
 // copy data from memory in 16 BPP mode (or does it? Isn't this the same as the CLUT case?)
 // No, it isn't because we read the memory in an endian safe way--this *won't* work...
+//This would seem to be problematic...
+//Because it's the palette entry being zero that makes the pixel transparent...
+//Let's try it and see.
+#ifndef OP_USES_PALETTE_ZERO
                                if (flagTRANS && bits == 0)
+#else
+                               if (flagTRANS && (paletteRAM16[bits] == 0))
+#endif
                                        ;       // Do nothing...
                                else
                                {
@@ -1087,7 +1110,10 @@ if (firstPix)
 // This only works for the palettized modes (1 - 8 BPP), since we actually have to
 // copy data from memory in 16 BPP mode (or does it? Isn't this the same as the CLUT case?)
 // No, it isn't because we read the memory in an endian safe way--it *won't* work...
-                               if (flagTRANS && (bitsLo | bitsHi) == 0)
+//This doesn't seem right... Let's try the encoded black value ($8800):
+//Apparently, CRY 0 maps to $8800...
+                               if (flagTRANS && ((bitsLo | bitsHi) == 0))
+//                             if (flagTRANS && (bitsHi == 0x88) && (bitsLo == 0x00))
                                        ;       // Do nothing...
                                else
                                {
@@ -1379,7 +1405,11 @@ if (firstPix != 0)
                {
                        uint8 bits = pixels >> 63;
 
+#ifndef OP_USES_PALETTE_ZERO
                        if (flagTRANS && bits == 0)
+#else
+                       if (flagTRANS && (paletteRAM16[index | bits] == 0))
+#endif
                                ;       // Do nothing...
                        else
                        {
@@ -1444,7 +1474,11 @@ if (firstPix != 0)
                {
                        uint8 bits = pixels >> 62;
 
+#ifndef OP_USES_PALETTE_ZERO
                        if (flagTRANS && bits == 0)
+#else
+                       if (flagTRANS && (paletteRAM16[index | bits] == 0))
+#endif
                                ;       // Do nothing...
                        else
                        {
@@ -1504,7 +1538,11 @@ if (firstPix != 0)
                {
                        uint8 bits = pixels >> 60;
 
+#ifndef OP_USES_PALETTE_ZERO
                        if (flagTRANS && bits == 0)
+#else
+                       if (flagTRANS && (paletteRAM16[index | bits] == 0))
+#endif
                                ;       // Do nothing...
                        else
                        {
@@ -1563,7 +1601,11 @@ if (firstPix)
                {
                        uint8 bits = pixels >> 56;
 
+#ifndef OP_USES_PALETTE_ZERO
                        if (flagTRANS && bits == 0)
+#else
+                       if (flagTRANS && (paletteRAM16[bits] == 0))
+#endif
                                ;       // Do nothing...
                        else
                        {
@@ -1619,7 +1661,10 @@ if (firstPix != 0)
                {
                        uint8 bitsHi = pixels >> 56, bitsLo = pixels >> 48;
 
-                       if (flagTRANS && (bitsLo | bitsHi) == 0)
+//This doesn't seem right... Let's try the encoded black value ($8800):
+//Apparently, CRY 0 maps to $8800...
+                               if (flagTRANS && ((bitsLo | bitsHi) == 0))
+//                             if (flagTRANS && (bitsHi == 0x88) && (bitsLo == 0x00))
                                ;       // Do nothing...
                        else
                        {
index a8f5aa3658d3e8a4b5bb4ebad21bc9162f628d66..28aa2b9c4205c71613e079e783b730df71149c82 100644 (file)
@@ -22,6 +22,7 @@ struct VJSettings
        int32 joyport;                                                          // Joystick port
        bool hardwareTypeNTSC;                                          // Set to false for PAL
        bool useJaguarBIOS;
+       bool GPUEnabled;
        bool DSPEnabled;
        bool usePipelinedDSP;
        bool fullscreen;