From: Shamus Hammons Date: Tue, 5 Feb 2013 23:50:09 +0000 (-0600) Subject: Added console redirection to win32 port, minor cleanup of documentation. X-Git-Tag: 2.1.0~1 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=virtualjaguar;a=commitdiff_plain;h=29525b808574d009a74c9af2a84fa32649bbd4d6 Added console redirection to win32 port, minor cleanup of documentation. --- diff --git a/docs/INSTALL b/docs/INSTALL index a159a6c..0fb9032 100644 --- a/docs/INSTALL +++ b/docs/INSTALL @@ -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 diff --git a/docs/README b/docs/README index 9d1a1b2..3d05119 100644 --- a/docs/README +++ b/docs/README @@ -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 [] [switches] - - Option Description - ---------------- ----------------------------------- - 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 - diff --git a/docs/TODO b/docs/TODO index 853bb0c..6a95a60 100644 --- 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 diff --git a/docs/WHATSNEW b/docs/WHATSNEW index 7c47b76..ab6d28b 100644 --- a/docs/WHATSNEW +++ b/docs/WHATSNEW @@ -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] diff --git a/res/help.html b/res/help.html index 29b814a..d23dbb8 100644 --- a/res/help.html +++ b/res/help.html @@ -43,6 +43,7 @@
  • NTSC
  • PAL
  • Blur
  • +
  • Full Screen
  • Here’s what they do.

    @@ -93,6 +94,10 @@

    Normally, the emulated Jaguar’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’s display to be averaged, resulting in a screen that looks slightly blurry—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.

    +

    Full Screen

    + +

    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 F9 key on your keyboard. Note that on monitors with a wide aspect ratio that Virtual Jaguar will still display its virtual screen in a 4:3 aspect ratio—this is normal and expected.

    +

    Jaguar Menu

    @@ -112,7 +117,7 @@

    Pause does the same as the toolbar button; see the “Pause” toolbar button description for details.

    -

    Frame Advance causes Virtual Jaguar 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 Virtual Jaguar is paused.

    +

    Frame Advance causes Virtual Jaguar 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 F7 key on your keyboard. This option only works when Virtual Jaguar is paused.

    Insert Cartridge... does the same as the toolbar button; see the “Insert Cartridge” toolbar button description for details.

    diff --git a/src/gui/app.cpp b/src/gui/app.cpp index 3961d31..10bc5af 100644 --- a/src/gui/app.cpp +++ b/src/gui/app.cpp @@ -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 // 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"