]> Shamusworld >> Repos - virtualjaguar/commitdiff
Added console redirection to win32 port, minor cleanup of documentation.
authorShamus Hammons <jlhamm@acm.org>
Tue, 5 Feb 2013 23:50:09 +0000 (17:50 -0600)
committerShamus Hammons <jlhamm@acm.org>
Tue, 5 Feb 2013 23:50:09 +0000 (17:50 -0600)
docs/INSTALL
docs/README
docs/TODO
docs/WHATSNEW
res/help.html
src/gui/app.cpp

index a159a6ce5adbbe6c71509630f6e98f4ebb627f6c..0fb9032e67bb9f21331b41fe54913594a5451f6b 100644 (file)
@@ -11,7 +11,7 @@ The minimum requirements for compiling Virtual Jaguar from source are:
  o  GCC v4.4.x or higher
  o  SDL v1.2.14 or higher
  o  zlib v1.2.5
- o  libcdio v0.82 or higher (optional, for Jaguar CD support)
+ o  libcdio v0.90 or higher (optional, for Jaguar CD support)
  o  OpenGL libraries
  o  Qt 4.7.3 or higher
  o  supported OS (BeOS, Linux, FreeBSD and WIN32 through mingw, MacOS); other
index 9d1a1b2aba19fe1a67e21a3988070d9c1e6c16f4..3d05119ca3ecee9cedb129537773a8799f0a4951 100644 (file)
@@ -27,6 +27,7 @@ interest.
 This software is released under the GPL v3 or later. For more information, read
 the GPLv3 file.
 
+
 ----------------------------------------------------------------
 - IMPORTANT NOTE ABOUT JAGUAR FILE FORMATS--READ THIS OR ELSE! -
 ----------------------------------------------------------------
@@ -74,6 +75,7 @@ There is a fifth type of file that is supported by Virtual Jaguar, the .j64
 file, which is simply a 1, 2, or 4 Meg dump of a Jaguar cartridge ROM which
 loads at $800000 in the Jaguar memory space.
 
+
 ----------------------------------
 - What is Virtual Jaguar GCC/Qt? -
 ----------------------------------
@@ -100,6 +102,7 @@ are particularly welcome! :)
 More information about the incredible SDL libraries can be found at
 http://www.libsdl.org. Thanks Sam--you rock! :)
 
+
 -------------------------------
 - Using Virtual Jaguar GCC/Qt -
 -------------------------------
@@ -108,39 +111,6 @@ Simply double click on the Virtual Jaguar icon or type ./virtualjaguar -h from
 the command line. See the built in help (under Help|Contents) for more
 information on how to use it. :-)
 
-People on Windows platforms are unable to read the from the command line at
-the moment. So here's what it says:
-
-"Virtual Jaguar GIT 20120914 (2.1.0 Prerelease)
-Based upon Virtual Jaguar core v1.0.0 by David Raingeard.
-Written by James Hammons (Linux/WIN32), Niels Wagenaar (Linux/WIN32),
-Carwin Jones (BeOS), and Adam Green (MacOS)
-Contact: http://sdlemu.ngemu.com/ | sdlemu@ngemu.com
-
-Usage:
-   virtualjaguar [<filename>] [switches]
-
-   Option            Description
-   ----------------  -----------------------------------
-   <filename>        Name of file to autoload
-   --alpine      -a  Put Virtual Jaguar into Alpine mode
-   --pal         -p  PAL mode
-   --ntsc        -n  NTSC mode
-   --bios        -b  Boot using Jagaur BIOS
-   --no-bios         Do not use Jaguar BIOS
-   --gpu         -g  Enable GPU
-   --no-gpu          Disable GPU
-   --dsp         -d  Enable DSP
-   --no-dsp          Disable DSP
-   --fullscreen  -f  Start in full screen mode
-   --blur        -B  Enable GL bilinear filter
-   --no-blur         Disable GL bilinear filtering
-   --log         -l  Create and use log file
-   --no-log          Do not use log file
-   --help        -h  Show this message
-
-Invoking Virtual Jagaur with no filename will cause it to boot up
-with the VJ GUI."
 
 -----------
 - Finally -
index 853bb0c9161a82a4bd34261a39670ca0ac14cc58..6a95a605e36793887e9e66c4ed42e0640bba210d 100644 (file)
--- a/docs/TODO
+++ b/docs/TODO
@@ -16,7 +16,6 @@ Stuff to add/fix for the next release of Virtual Jaguar
 - Blitter needs fixing. [Shamus]
 - In emulator screenshots. [Shamus]
 - Audio/video dumping. [Shamus]
-- Controller handling. [Shamus]
 - Need to emulate bus contention. [Shamus]
 - Need to fix timing in the OP. As it is now, it gives a false impression of
   how much it's capable of. [Shamus]
@@ -27,6 +26,7 @@ Stuff to add/fix for the next release of Virtual Jaguar
 Stuff that was added/fixed
 --------------------------
 
+- Controller handling. [Shamus] [DONE--Shamus]
 - Full screen option. [Shamus] [DONE--Shamus]
 - Command line switches for frontends. [Shamus] [DONE-Shamus]
 - Fix DSP code so that it doesn't hang in a spinlock waiting for the sound
index 7c47b76405035aff7229f2d2e7d8d5f1aa8559cd..ab6d28bfc4fdf6bfafd8e5f3a2a38215a0370385 100644 (file)
@@ -1,6 +1,7 @@
 Virtual Jaguar v2.1.0 GCC/Qt
 ----------------------------
 
+* Added gamepad support. [Shamus]
 * Added fullscreen option. [Shamus]
 * Added some more developer goodies to Alpine mode. [Shamus]
 * Re-added command line switches. [Shamus]
index 29b814aeacfaca18a709afb3938a9bee29e0ef0b..d23dbb8785a4e1116ec6b60c4fe1ba0c03a87a86 100644 (file)
@@ -43,6 +43,7 @@
 <li>NTSC</li>
 <li>PAL</li>
 <li>Blur</li>
+<li>Full Screen</li>
 </ul>
 
 <p>Here&rsquo;s what they do.</p>
 
 <p>Normally, the emulated Jaguar&rsquo;s display shows pixels that are razor sharp and is what you would likely see if the Jaguar was hooked up to a high quality monitor. Selecting this item will cause the emulated Jaguar&rsquo;s display to be averaged, resulting in a screen that looks slightly blurry&mdash;more like what you would expect to see if the Jaguar was hooked up to a television. This is an aesthetic option that some people prefer; you may or may not like it.</p>
 
+<h3>Full Screen</h3>
+
+<p>Selecting this toolbar button will switch the display into full screen mode; selecting it again will switch it back to windowed mode. This option can also be activated by pressing the <b>F9</b> key on your keyboard. Note that on monitors with a wide aspect ratio that <i>Virtual Jaguar</i> will still display its virtual screen in a 4:3 aspect ratio&mdash;this is normal and expected.</p>
+
 
 <h2>Jaguar Menu</h2>
 
 
 <p><b>Pause</b> does the same as the toolbar button; see the &ldquo;Pause&rdquo; toolbar button description for details.</p>
 
-<p><b>Frame Advance</b> causes <i>Virtual Jaguar</i> to run for one frame (1/60th of a second for NTSC, 1/50th for PAL), and update the screen. This option only works when <i>Virtual Jaguar</i> is paused.</p>
+<p><b>Frame Advance</b> causes <i>Virtual Jaguar</i> to run for one frame (1/60th of a second for NTSC, 1/50th for PAL), and update the screen. This function can also be activated by pressing the <b>F7</b> key on your keyboard. This option only works when <i>Virtual Jaguar</i> is paused.</p>
 
 <p><b>Insert Cartridge...</b> does the same as the toolbar button; see the &ldquo;Insert Cartridge&rdquo; toolbar button description for details.</p>
 
index 3961d31aaef3c92b7aba18b2790623fa79e7c11f..10bc5af8a5ee224056809e82adc3ced67372b56b 100644 (file)
@@ -12,6 +12,7 @@
 // JLH  01/21/2011  Added SDL initialization
 // JLH  06/26/2011  Added fix to keep SDL from hijacking main() on win32
 // JLH  05/24/2012  Added option switches
+// JLH  03/05/2013  Fixed console redireciton on win32 platform  :-P
 //
 
 #include "app.h"
@@ -29,6 +30,7 @@
 // Apparently on win32, SDL is hijacking main from Qt. So let's do this:
 #ifdef __GCCWIN32__
 #undef main
+#include <windows.h>   // Ick, but needed for console redirection on win32 :-O
 #endif
 
 // Function prototypes...
@@ -38,9 +40,10 @@ static void ParseOptions(int argc, char * argv[]);
 
 //hm. :-/
 // This is stuff we pass into the mainWindow...
+// Also, these are defaults. :-)
 bool noUntunedTankPlease = false;
 bool loadAndGo = false;
-bool useLogfile = true;
+bool useLogfile = false;
 QString filename;
 
 // Here's the main application loop--short and simple...
@@ -48,13 +51,24 @@ int main(int argc, char * argv[])
 {
        // Win32 console redirection, because MS and their band of super geniuses decided
        // that nobody would ever launch an app from the command line. :-P
-       // And, of course, this doesn't work, but causes weird problems. Yay Microsoft. :-/
 #ifdef __GCCWIN32__
-#if 0
-       FILE * ctt = fopen("CON", "w");
-       freopen("CON", "w", stdout);
-       freopen("CON", "w", stderr);
-#endif
+       BOOL (WINAPI * AttachConsole)(DWORD dwProcessId);
+
+       AttachConsole = (BOOL (WINAPI *)(DWORD))
+               GetProcAddress(LoadLibraryA("kernel32.dll"), "AttachConsole");
+
+       if (AttachConsole != NULL && AttachConsole(((DWORD)-1)))
+       {
+               if (_fileno(stdout) == -1)
+                       freopen("CONOUT$","wb",stdout);
+               if (_fileno(stderr) == -1)
+                       freopen("CONOUT$","wb",stderr);
+               if (_fileno(stdin) == -1)
+                       freopen("CONIN$","rb",stdin);
+
+               // Fix C++
+               std::ios::sync_with_stdio();
+       }
 #endif
 
        // Normally, this would be read in from the settings module... :-P
@@ -65,11 +79,6 @@ int main(int argc, char * argv[])
        // Check for options that must be in place be constructing the App object
        if (!ParseCommandLine(argc, argv))
        {
-#ifdef __GCCWIN32__
-#if 0
-               fclose(ctt);
-#endif
-#endif
                return 0;
        }
 
@@ -174,6 +183,8 @@ bool ParseCommandLine(int argc, char * argv[])
                                "   --log         -l  Create and use log file\n"
                                "   --no-log          Do not use log file\n"
                                "   --help        -h  Show this message\n"
+                               "   --please-dont-kill-my-computer\n"
+                               "                 -z  Run Virtual Jaguar without \"snow\"\n"
                                "\n"
                                "Invoking Virtual Jagaur with no filename will cause it to boot up\n"
                                "with the VJ GUI.\n"