Zero-byte ROMs are now rejected, instead of being loaded as Supercharger ROMs.

Fixed bug in handling analog axes with jitter; they were overriding events from
digital, hat and keyboard input.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2251 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2011-06-09 20:50:19 +00:00
parent df71aa03d1
commit cb3f0e96ba
5 changed files with 52 additions and 30 deletions

View File

@ -20,19 +20,29 @@
- it only has meaning while in emulation mode
- it is enabled by default
* Fixed bug with emulation of paddles using the mouse in Warlords;
movement was being filtered out if the mouse was moved too fast.
* Fixed bug with emulation of paddles using the mouse most evident in
Warlords; movement was being filtered out if the mouse was moved too
fast. There's still more work required in this area, however.
* Fixed bug whereby switching to the debugger and back again would
* Fixed bug with analog axes on gamepad devices, whereby jittering in
these axes would override input from digital axis, hat or keyboard
input.
* Fixed bug when switching to the debugger and back again would
sometimes cause an extra mouse motion event (which would cause the
emulation to think the mouse was moved and move the player
accordingly).
* Tweaked bankswitch autodetection code for 4A50 bankswitching.
* Tweaked bankswitch autodetection code for 4A50 bankswitching; several
more test ROMs are automatically detected.
* The 'saverom' debugger command now saves ROMs in your home
directory by default if you don't specify a valid path. This fixes
a bug whereby ROMs were saved and couldn't later be located.
a bug whereby ROMs were saved in strange locations and couldn't later
be found.
* Zero-byte ROMs are no longer loaded and mis-detected as Supercharger
images.
-Have fun!

View File

@ -2934,7 +2934,7 @@ Ms Pac-Man (Stella extended codes):
<tr><td>2K </td><td>64-2048 byte Atari </td></tr>
<tr><td>3E </td><td>32K Tigervision </td></tr>
<tr><td>3F </td><td>512K Tigervision </td></tr>
<tr><td>4A50 &#185;</td><td>64K 4A50 + ram </td></tr>
<tr><td>4A50 </td><td>64K 4A50 + ram </td></tr>
<tr><td>4K </td><td>4K Atari </td></tr>
<tr><td>AR </td><td>Supercharger </td></tr>
<tr><td>CV </td><td>Commavid extra ram </td></tr>

View File

@ -817,12 +817,21 @@ void EventHandler::poll(uInt64 time)
else if(value < -Joystick::deadzone())
handleEvent(eventAxisNeg, 1);
else
{
// Treat any deadzone value as zero
value = 0;
// Now filter out consecutive, similar values
// (only pass on the event if the state has changed)
if(myAxisLastValue[stick][axis] != value)
{
// Turn off both events, since we don't know exactly which one
// was previously activated.
handleEvent(eventAxisNeg, 0);
handleEvent(eventAxisPos, 0);
}
}
myAxisLastValue[stick][axis] = value;
break;
}
}

View File

@ -479,7 +479,7 @@ bool OSystem::createConsole(const string& romfile, const string& md5sum)
// Do a little error checking; it shouldn't be necessary
if(myConsole) deleteConsole();
bool retval = false, showmessage = false;
bool showmessage = false;
// If a blank ROM has been given, we reload the current one (assuming one exists)
if(romfile == "")
@ -546,14 +546,6 @@ bool OSystem::createConsole(const string& romfile, const string& md5sum)
resetLoopTiming();
myFrameBuffer->setCursorState();
retval = true;
}
else
{
buf << "ERROR: Couldn't create console for " << myRomFile << endl;
logMessage(buf.str(), 0);
retval = false;
}
// Also check if certain virtual buttons should be held down
// These must be checked each time a new console is being created
@ -564,7 +556,14 @@ bool OSystem::createConsole(const string& romfile, const string& md5sum)
if(mySettings->getBool("holdbutton0"))
myEventHandler->handleEvent(Event::JoystickZeroFire1, 1);
return retval;
return true;
}
else
{
buf << "ERROR: Couldn't create console for " << myRomFile << endl;
logMessage(buf.str(), 0);
return false;
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -813,6 +812,13 @@ uInt8* OSystem::openROM(string file, string& md5, uInt32& size)
gzclose(f);
}
// Zero-byte files should be automatically discarded
if(size == 0)
{
delete[] image;
return (uInt8*) 0;
}
// If we get to this point, we know we have a valid file to open
// Now we make sure that the file has a valid properties entry
// To save time, only generate an MD5 if we really need one
@ -868,7 +874,7 @@ void OSystem::validatePath(const string& setting, const string& partialpath,
{
const string& s = mySettings->getString(setting) != "" ?
mySettings->getString(setting) : myBaseDir + partialpath;
FilesystemNode node = FilesystemNode(s);
FilesystemNode node(s);
if(!node.isDirectory())
{
AbstractFilesystemNode::makeDir(s);

View File

@ -538,14 +538,11 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
if(LauncherFilterDialog::isValidRomName(rom, extension))
{
if(instance().createConsole(rom, md5))
{
#if !defined(GP2X) // Quick GP2X hack to spare flash-card saves
instance().settings().setString("lastrom", myList->getSelectedString());
#endif
}
else
instance().frameBuffer().showMessage(
"Error creating console (screen too small)", kMiddleCenter, true);
"Error creating console (check ROM file)",
kMiddleCenter, true);
}
else
instance().frameBuffer().showMessage("Not a valid ROM file",