From: Shamus Hammons Date: Thu, 6 Oct 2011 14:28:34 +0000 (+0000) Subject: Mask out ALT for now, small optimization in screen rendering code. X-Git-Tag: 2.0.0~1 X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34c2f4526d11f2139130c4c94920dd7b1c7a6124;p=virtualjaguar Mask out ALT for now, small optimization in screen rendering code. --- diff --git a/docs/INSTALL b/docs/INSTALL index 299e206..36ea778 100644 --- a/docs/INSTALL +++ b/docs/INSTALL @@ -31,8 +31,7 @@ Optionally you can manually strip virtualjaguar[.exe] to downsize the binary. You can also run upx on the binary as well and you'll end up with a somewhat smaller binary. -That's it! You can now start the emulator with ./virtualjaguar. See the output -for more details (or stdout.txt on Win32) or consult the README file for more -info. +That's it! You can now start the emulator with ./virtualjaguar. See the built +in help (Help|Contents) for more info. For even more info, go to http://icculus.org/virtualjaguar. diff --git a/docs/README b/docs/README index da59ae4..1f2f3b3 100644 --- a/docs/README +++ b/docs/README @@ -107,75 +107,9 @@ http://www.libsdl.org. Thanks Sam--you rock! :) - Using Virtual Jaguar GCC/Qt - ------------------------------- -After compiling the binary (see INSTALL) you can now run original Atari Jaguar -games. These games are distributed on cartridges and can therefore cannot be -used on a PC (we're still waiting for that Jaguar-on-a-PCI-card that you plug -into your late model PC, complete with cartridge slot and controller connectors -;-). To use these games on Virtual Jaguar GCC/Qt you need to get ROM images. -For legal issues concerning ROM images please consult the DISCLAIMER at the -beginning of this file. - -After obtaining several game ROMs you can now use Virtual Jaguar using the -following command: - -./virtualjaguar [romfile] [-switches] - -The context of ROMFILE is the filename of the an Atari Jaguar ROM dump (can be -either compressed or uncompressed). You can also use switches. By just typing -./virtualjaguar -? (or ./virtualjaguar -help) you get an overview of the -options you can use. WIN32 users should look into the stdout.txt in the -directory they ran Virtual Jaguar for that information. Also, WIN32 users -should be aware that if their ROM filenames contain any spaces, you will have -to enclose the ROMFILE in double quotes for Virtual Jaguar to function -properly. - -Note that running Virtual Jaguar this way will cause the emulator to exit -completely upon pressing the ESC key. If this is not what you want, then omit -the ROMFILE and it will bring up a nice GUI instead. - -If you prefer a nice GUI instead of typing in command lines, you can either -type ./virtualjaguar or double click on the Virtual Jaguar executable. If you -have a directory full of ROM files, you can tell Virtual Jaguar where they are -by editing the appropriate line in the vj.cfg file (it assumes a ROMs directory -under the directory where VJ lives) so that they show up when you pick the -"Load" option from the "File" menu. - -This emulator also emulates the Atari Jaguar gamepads. By using the following -keyboard or joystick settings you can (possibly) play a given game: - -Atari Button C : Z or joystick button 3 -Atari Button B : X or joystick button 2 -Atari Button A : C or joystick button 1 -Atari Buttons 1 - 10 : Keypad 0 - 9 (0 = 10) -Atari Start/Pause : ENTER -Atari Select : ' -Atari UP : UP or joystick UP -Atari DOWN : DOWN or joystick DOWN -Atari LEFT : LEFT or joystick LEFT -Atari RIGHT : RIGHT or joystick RIGHT -Atari # : Keypad / -Atari * : Keypad * - -With ESC you can easily stop Virtual Jaguar GCC/Qt which will get you back to -the GUI (pressing ESC again will take you back to the game). To exit VJ, you -can either select File|Quit or press the "Q" key on your keyboard. If you want -to change the key layout, simply edit the vj.cfg file and change the keys. :) -NOTE: There are quite a few keys mapped to debugging functions at present. You -have been warned! - -------------------- -- A note on sound - -------------------- - -By default, the Virtual Jaguar's DSP is turned off, since it doesn't work very -well at present (it requires a lot of horsepower to sound decent at this -point!). In order to hear any sound at all, you have to either edit the vj.cfg -file and change the appropriate line or set the DSP on in the GUI (found under -Settings|Misc). One word of caution: Use the old DSP core instead of the new -pipelined version for now--the new pipelined DSP core has not yet been -optimized and runs quite slow at present! Once the DSP issues have been ironed -out, it will be turned on by default and you won't have to deal with it -anymore. ;) +Simply double click on the Virtual Jaguar icon or type ./virtualjaguar from +the command line. See the built in help (under Help|Contents) for more +information on how to use it. :-) ----------- - Finally - @@ -190,16 +124,13 @@ website [http://sdlemu.ngemu.com]. We hope you enjoy the emulator and will use it wisely! -Special thanks go to guys over at ngemu.com and #ngemu (EFNET). Thanks also to -David Raingeard of Potato Emulation who originally developed this emulator and +Thanks go to guys over at ngemu.com and #ngemu (EFNET). Thanks also to David +Raingeard of Potato Emulation who originally developed this emulator and released the sources to the public. We couldn't have done it without you! -SDLEMU - +Special thanks go to everyone who submitted good, detailed bug reports, +sometimes with demonstration code(!); your help has helped to make Virtual +Jaguar better, more accurate, and more polished than it would be otherwise. We +really appreciate your help! -*** Stuff to add in: - - o Documentation needs a rewrite, more or less, as the GUI is now front and - center. Need to update the docs to reflect this change. - o Document the new "solid" zip file archive mechanism which allows putting - artwork into a "ROM". +SDLEMU diff --git a/docs/WHATSNEW b/docs/WHATSNEW index 6d5d3a6..bb53efa 100644 --- a/docs/WHATSNEW +++ b/docs/WHATSNEW @@ -6,7 +6,7 @@ Virtual Jaguar v2.0.0 GCC/Qt means is that now you can have other goodies inside of your ROM ZIP like labels, box art, and overlays. See README for details. [Shamus] * Various usability improvements, too many to list here. ;-) [Shamus] -* Various compatibility improvemnents to the Jaguar core, too many to list +* Various compatibility improvements to the Jaguar core, too many to list here. ;-) [Shamus] diff --git a/res/help.html b/res/help.html new file mode 100644 index 0000000..c9bd8cc --- /dev/null +++ b/res/help.html @@ -0,0 +1,13 @@ + + + +Virtual Jaguar: The Documentation + + + +

Virtual Jaguar: The Documentation

+ +Coming Soon! + + + diff --git a/res/pause.png b/res/pause.png index 1032cb9..7b03a0d 100644 Binary files a/res/pause.png and b/res/pause.png differ diff --git a/res/power.png b/res/power.png index 903b60d..742c441 100644 Binary files a/res/power.png and b/res/power.png differ diff --git a/res/zoom100.png b/res/zoom100.png index 1c34227..8cbc738 100644 Binary files a/res/zoom100.png and b/res/zoom100.png differ diff --git a/res/zoom200.png b/res/zoom200.png index 20821da..62788fd 100644 Binary files a/res/zoom200.png and b/res/zoom200.png differ diff --git a/res/zoom300.png b/res/zoom300.png index 3567764..9f9573f 100644 Binary files a/res/zoom300.png and b/res/zoom300.png differ diff --git a/src/filedb.cpp b/src/filedb.cpp index e4e9e1f..eadfda7 100644 --- a/src/filedb.cpp +++ b/src/filedb.cpp @@ -62,6 +62,7 @@ RomIdentifier romList[] = { { 0x47EBC158, "Theme Park (World)", FF_ROM | FF_VERIFIED }, { 0x4899628F, "Hover Strike (World)", FF_ROM | FF_VERIFIED }, { 0x4A08A2BD, "SuperCross 3D (World)", FF_ROM | FF_BAD_DUMP }, + { 0x544E7A01, "Downfall (World)", FF_ROM | FF_VERIFIED }, { 0x55A0669C, "[BIOS] Atari Jaguar Developer CD (World)", FF_BIOS }, { 0x58272540, "Syndicate (World)", FF_ROM | FF_VERIFIED }, { 0x5A101212, "Sensible Soccer - International Edition (World)", FF_ROM | FF_VERIFIED }, diff --git a/src/gui/glwidget.cpp b/src/gui/glwidget.cpp index 2501ad8..65ccd57 100644 --- a/src/gui/glwidget.cpp +++ b/src/gui/glwidget.cpp @@ -117,6 +117,15 @@ printf("Resizing: new raster width/height = %i x %i\n", rasterWidth, rasterHeigh } buffer = new uint32_t[textureWidth * textureHeight]; +#warning "!!! Remove all backbuffer stuff, since it's unneeded !!!" +/* +We do this here just as a quick 'n' dirty shortcut. We don't need a backbuffer, +as OpenGL takes care of all that crap for us. This means we also have to fix the +Jaguar core, giving it a setup function for setting things like the video buffer, +etc. +*/ + backbuffer = buffer; + //??? memset(buffer, 0x00, textureWidth * textureHeight * sizeof(uint32_t)); glGenTextures(1, &texture); diff --git a/src/gui/help.cpp b/src/gui/help.cpp index 8bafe98..8c8c98d 100644 --- a/src/gui/help.cpp +++ b/src/gui/help.cpp @@ -16,12 +16,12 @@ #include "help.h" + HelpWindow::HelpWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog) { setWindowTitle(tr("Virtual Jaguar Help")); // Need to set the size as well... -// resize(560, 480); resize(560, 480); layout = new QVBoxLayout(); @@ -33,20 +33,15 @@ HelpWindow::HelpWindow(QWidget * parent/*= 0*/): QWidget(parent, Qt::Dialog) // image->setPixmap(QPixmap(":/res/vj_title_small.png")); // layout->addWidget(image); -// QString s = QString(tr("SVN %1
")).arg(__DATE__); - QString s;// = QString(""); - s.append(tr( - "

Virtual Jaguar Documentation

" - "
" - "Coming soon!" - )); text = new QTextBrowser; - text->setHtml(s); + text->setSource(QUrl("qrc:/res/help.html")); layout->addWidget(text); } - #if 0 +label size is 365x168 +scaled(365, 168 + #include "htmlviewer.moc" HtmlViewerWindow *htmlViewerWindow; diff --git a/src/gui/keygrabber.cpp b/src/gui/keygrabber.cpp index cc0b714..23954b8 100644 --- a/src/gui/keygrabber.cpp +++ b/src/gui/keygrabber.cpp @@ -45,5 +45,8 @@ void KeyGrabber::SetKeyText(int keyNum) void KeyGrabber::keyPressEvent(QKeyEvent * e) { key = e->key(); - accept(); + + // Since this is problematic, we don't allow this key... + if (key != Qt::Key_Alt) + accept(); } diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index 41c1a0e..08693d0 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -79,7 +79,7 @@ // We'll make the VJ core modular so that it doesn't matter what GUI is in // use, we can drop it in anywhere and use it as-is. -MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit(true), +MainWin::MainWin(): running(true), powerButtonOn(false), showUntunedTankCircuit(true), cartridgeLoaded(false), CDActive(false),//, alpineLoadSuccessful(false), pauseForFileSelector(false) { @@ -115,7 +115,7 @@ MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit powerAct->setStatusTip(tr("Powers Jaguar on/off")); powerAct->setCheckable(true); powerAct->setChecked(false); - powerAct->setDisabled(true); +// powerAct->setDisabled(true); connect(powerAct, SIGNAL(triggered()), this, SLOT(TogglePowerState())); pauseAct = new QAction(QIcon(":/res/pause.png"), tr("Pause"), this); @@ -226,7 +226,7 @@ MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit x1Act->setChecked(zoomLevel == 1); x2Act->setChecked(zoomLevel == 2); x3Act->setChecked(zoomLevel == 3); - running = powerAct->isChecked(); +// running = powerAct->isChecked(); ntscAct->setChecked(vjs.hardwareTypeNTSC); palAct->setChecked(!vjs.hardwareTypeNTSC); @@ -294,11 +294,25 @@ void MainWin::closeEvent(QCloseEvent * event) void MainWin::keyPressEvent(QKeyEvent * e) { + // We ignore the Alt key for now, since it causes problems with the GUI + if (e->key() == Qt::Key_Alt) + { + e->accept(); + return; + } + HandleKeys(e, true); } void MainWin::keyReleaseEvent(QKeyEvent * e) { + // We ignore the Alt key for now, since it causes problems with the GUI + if (e->key() == Qt::Key_Alt) + { + e->accept(); + return; + } + HandleKeys(e, false); } @@ -342,7 +356,7 @@ void MainWin::HandleKeys(QKeyEvent * e, bool state) joypad_0_buttons[i] = (state ? 0x01 : 0x00); // Pad #2 is screwing up pad #1. Prolly a problem in joystick.cpp... -// So let's try to fix it there. :-P +// So let's try to fix it there. :-P [DONE] if (e->key() == (int)vjs.p2KeyBindings[i]) // joypad_1_buttons[i] = (uint8)state; joypad_1_buttons[i] = (state ? 0x01 : 0x00); @@ -444,9 +458,10 @@ void MainWin::Timer(void) { // Otherwise, run the Jaguar simulation JaguarExecuteNew(); -// memcpy(videoWidget->buffer, backbuffer, videoWidget->rasterHeight * videoWidget->rasterWidth); - memcpy(videoWidget->buffer, backbuffer, videoWidget->rasterHeight * videoWidget->textureWidth * sizeof(uint32_t)); -// memcpy(surface->pixels, backbuffer, TOMGetVideoModeWidth() * TOMGetVideoModeHeight() * 4); +//// memcpy(videoWidget->buffer, backbuffer, videoWidget->rasterHeight * videoWidget->rasterWidth); +//No longer needed--see glwidget.cpp for details! +// memcpy(videoWidget->buffer, backbuffer, videoWidget->rasterHeight * videoWidget->textureWidth * sizeof(uint32_t)); +//// memcpy(surface->pixels, backbuffer, TOMGetVideoModeWidth() * TOMGetVideoModeHeight() * 4); } videoWidget->updateGL(); @@ -568,7 +583,7 @@ void MainWin::InsertCart(void) { // If the emulator is running, we pause it here and unpause it later // if we dismiss the file selector without choosing anything - if (running) + if (running && powerButtonOn) { ToggleRunState(); pauseForFileSelector = true; @@ -618,6 +633,7 @@ void MainWin::ToggleCDUsage(void) { CDActive = !CDActive; +#if 0 if (CDActive) { powerAct->setDisabled(false); @@ -626,6 +642,7 @@ void MainWin::ToggleCDUsage(void) { powerAct->setDisabled(true); } +#endif } void MainWin::ResizeMainWindow(void) diff --git a/src/gui/virtualjaguar.qrc b/src/gui/virtualjaguar.qrc index 1e2f0f7..1c60900 100644 --- a/src/gui/virtualjaguar.qrc +++ b/src/gui/virtualjaguar.qrc @@ -23,5 +23,6 @@ ../../res/skunkboard-file.png ../../res/homebrew-file.png ../../res/unknown-file.png + ../../res/help.html diff --git a/src/op.cpp b/src/op.cpp index 3765250..2978c6d 100644 --- a/src/op.cpp +++ b/src/op.cpp @@ -682,9 +682,13 @@ OP: Scaled bitmap 4x? 4bpp at 34,? hscale=80 fpix=0 data=000756E8 pitch 1 hflipp op_pointer = link; break; case CONDITION_SECOND_HALF_LINE: +//Here's the ASIC code: +// ND4(cctrue5, newheight[2], heightl[1], heightl[0], hcb[10]); +//which means, do the link if bit 10 of HC is set... + // This basically means branch if bit 10 of HC is set #warning "Unhandled condition code causes emulator to crash... !!! FIX !!!" - WriteLog("OP: Unexpected CONDITION_SECOND_HALF_LINE in BRANCH object\nOP: shuting down\n"); + WriteLog("OP: Unexpected CONDITION_SECOND_HALF_LINE in BRANCH object\nOP: shutting down!\n"); LogDone(); exit(0); break; diff --git a/src/tom.cpp b/src/tom.cpp index 11d963b..ed47bf8 100644 --- a/src/tom.cpp +++ b/src/tom.cpp @@ -770,6 +770,7 @@ void TOMExecScanline(uint16 scanline, bool render) //Interlacing is still not handled correctly here... !!! FIX !!! if (scanline & 0x01) // Execute OP only on even lines (non-interlaced only!) +// if (!(scanline & 0x01)) // Execute OP only on even lines (non-interlaced only!) return; //Hm, it seems that the OP needs to execute from zero, so let's try it: @@ -1386,6 +1387,8 @@ if (offset == VP) WriteLog("TOM: Vertical Period written by %s: %u (%sinterlaced)\n", whoName[who], data, (data & 0x01 ? "non-" : "")); if (offset == HDB1) WriteLog("TOM: Horizontal Display Begin 1 written by %s: %u\n", whoName[who], data); +if (offset == HDB2) + WriteLog("TOM: Horizontal Display Begin 2 written by %s: %u\n", whoName[who], data); if (offset == HDE) WriteLog("TOM: Horizontal Display End written by %s: %u\n", whoName[who], data); if (offset == HP)