]> Shamusworld >> Repos - virtualjaguar/commitdiff
Fixed OP scaling bug for sizes of 7.0 and up.
authorShamus Hammons <jlhamm@acm.org>
Thu, 7 Jul 2011 03:43:27 +0000 (03:43 +0000)
committerShamus Hammons <jlhamm@acm.org>
Thu, 7 Jul 2011 03:43:27 +0000 (03:43 +0000)
src/gui/app.cpp
src/objectp.cpp

index b313f66c6eba21bc35b76fd25b5af6151668a565..c407149d8c2d3a402cd146905b4833f93ed84341 100644 (file)
@@ -31,11 +31,13 @@ int main(int argc, char * argv[])
 {
        if (argc > 1)
        {
-               if (strcmp(argv[1], "--help") == 0)
+               if ((strcmp(argv[1], "--help") == 0) || (strcmp(argv[1], "-h") == 0)
+                       || (strcmp(argv[1], "-?") == 0))
                {
                        printf("Virtual Jaguar 2.0.0 help\n");
                        printf("\n");
-                       printf("This is an experimental branch of Virtual Jaguar, how did you get it?\n");
+                       printf("Command line interface is non-functional ATM, but may return if there is\n"
+                               "enough demand for it. :-)\n");
                        return 0;
                }
        }
@@ -58,6 +60,10 @@ int main(int argc, char * argv[])
                WriteLog("VJ: SDL (joystick, audio) successfully initialized.\n");
                App app(argc, argv);                                    // Declare an instance of the application
                retVal = app.exec();                                    // And run it!
+
+               // Free SDL components last...!
+               SDL_QuitSubSystem(SDL_INIT_JOYSTICK | SDL_INIT_AUDIO);
+               SDL_Quit();
        }
 
        LogDone();                                                                      // Close logfile
index 5e2c9850d8f73e6066af07b9a010aa231a7163f0..de366eec31e906e8d2cf5392d8fc470aa1f9dbe5 100644 (file)
@@ -454,7 +454,7 @@ WriteLog("    --> List end\n\n");
                                ypos = TOMReadWord(0xF00046, OP) / 2;                   // Get the VDB value
 #endif
 // Actually, no. Any item less than VDB will get only the lines that hang over VDB displayed.
-// So we need to fix this somehow...
+// So we need to fix this somehow... (and it has... in tom.cpp :-P)
 
                        uint32 height = (p0 & 0xFFC000) >> 14;
                        uint32 oldOPP = op_pointer - 8;
@@ -1175,10 +1175,10 @@ if (firstPix)
        // for use when using endian-corrected data (i.e., any of the *ReadWord functions!)
        uint16 * paletteRAM16 = (uint16 *)paletteRAM;
 
-       uint8 hscale = p2 & 0xFF;
+       uint16 hscale = p2 & 0xFF;
 // Hmm. It seems that fixing the horizontal scale necessitated re-fixing this. Not sure why,
 // but seems to be consistent with the vertical scaling now (and it may turn out to be wrong!)...
-       uint8 horizontalRemainder = hscale;                             // Not sure if it starts full, but seems reasonable [It's not!]
+       uint16 horizontalRemainder = hscale;                            // Not sure if it starts full, but seems reasonable [It's not!]
 //     uint8 horizontalRemainder = 0;                                  // Let's try zero! Seems to work! Yay! [No, it doesn't!]
        int32 scaledWidthInPixels = (iwidth * phraseWidthToPixels[depth] * hscale) >> 5;
        uint32 scaledPhrasePixels = (phraseWidthToPixels[depth] * hscale) >> 5;
@@ -1392,6 +1392,11 @@ if (firstPix != 0)
 
                        currentLineBuffer += lbufDelta;
 
+/*
+The reason we subtract the horizontalRemainder *after* the test is because we had too few
+bytes for horizontalRemainder to properly recognize a negative number. But now it's 16 bits
+wide, so we could probably go back to that (as long as we make it an int16 and not a uint16!)
+*/
 /*                     horizontalRemainder -= 0x20;            // Subtract 1.0f in [3.5] fixed point format
                        while (horizontalRemainder & 0x80)
                        {
@@ -1399,7 +1404,8 @@ if (firstPix != 0)
                                pixCount++;
                                pixels <<= 1;
                        }//*/
-                       while (horizontalRemainder <= 0x20)             // I.e., it's <= 0 (*before* subtraction)
+//                     while (horizontalRemainder <= 0x20)             // I.e., it's <= 1.0 (*before* subtraction)
+                       while (horizontalRemainder < 0x20)              // I.e., it's <= 1.0 (*before* subtraction)
                        {
                                horizontalRemainder += hscale;
                                pixCount++;
@@ -1458,7 +1464,8 @@ if (firstPix != 0)
                                pixCount++;
                                pixels <<= 2;
                        }//*/
-                       while (horizontalRemainder <= 0x20)             // I.e., it's <= 0 (*before* subtraction)
+//                     while (horizontalRemainder <= 0x20)             // I.e., it's <= 0 (*before* subtraction)
+                       while (horizontalRemainder < 0x20)              // I.e., it's <= 1.0 (*before* subtraction)
                        {
                                horizontalRemainder += hscale;
                                pixCount++;
@@ -1517,7 +1524,8 @@ if (firstPix != 0)
                                pixCount++;
                                pixels <<= 4;
                        }//*/
-                       while (horizontalRemainder <= 0x20)             // I.e., it's <= 0 (*before* subtraction)
+//                     while (horizontalRemainder <= 0x20)             // I.e., it's <= 0 (*before* subtraction)
+                       while (horizontalRemainder < 0x20)              // I.e., it's <= 0 (*before* subtraction)
                        {
                                horizontalRemainder += hscale;
                                pixCount++;
@@ -1572,7 +1580,8 @@ if (firstPix)
 
                        currentLineBuffer += lbufDelta;
 
-                       while (horizontalRemainder <= 0x20)             // I.e., it's <= 0 (*before* subtraction)
+//                     while (horizontalRemainder <= 0x20)             // I.e., it's <= 0 (*before* subtraction)
+                       while (horizontalRemainder < 0x20)              // I.e., it's <= 1.0 (*before* subtraction)
                        {
                                horizontalRemainder += hscale;
                                pixCount++;
@@ -1629,7 +1638,8 @@ if (firstPix != 0)
                                pixCount++;
                                pixels <<= 16;
                        }//*/
-                       while (horizontalRemainder <= 0x20)             // I.e., it's <= 0 (*before* subtraction)
+//                     while (horizontalRemainder <= 0x20)             // I.e., it's <= 0 (*before* subtraction)
+                       while (horizontalRemainder < 0x20)              // I.e., it's <= 1.0 (*before* subtraction)
                        {
                                horizontalRemainder += hscale;
                                pixCount++;