Merge remote-tracking branch 'remotes/origin/master' into feature/quadtari

This commit is contained in:
Thomas Jentzsch 2020-09-08 16:22:21 +02:00
commit 9a183bf8b5
8 changed files with 40 additions and 16 deletions

View File

@ -41,6 +41,8 @@
* Added option to select the audio device.
* Further enhanced UA bankswitching to support more Brazilian carts.
* Added option to display detected settings info when a ROM is loaded.
* Added another oddball TIA glitch option for delayed background color.

View File

@ -47,7 +47,7 @@ string CartridgeUAWidget::hotspotStr(int bank, int, bool prefix)
uInt16 hotspot = myCart.hotspot() + (bank ^ (mySwappedHotspots ? 1 : 0)) * myHotspotDelta;
info << "(" << (prefix ? "hotspot " : "");
info << "$" << Common::Base::HEX1 << hotspot << ", $" << (hotspot | 0x80);
info << "$" << Common::Base::HEX1 << hotspot << ", $" << (hotspot | 0x80) << ", $" << (hotspot | 0xf80);
info << ")";
return info.str();

View File

@ -708,15 +708,18 @@ bool CartDetector::isProbablyUA(const ByteBuffer& image, size_t size)
// using 'STA $240' or 'LDA $240'
// Similar Brazilian (Digivison) cart bankswitching switches to bank 1 by accessing address 0x2C0
// using 'BIT $2C0', 'STA $2C0' or 'LDA $2C0'
uInt8 signature[6][3] = {
// Other Brazilian (Atari Mania) ROM's bankswitching switches to bank 1 by accessing address 0xFC0
// using 'BIT $FA0', 'BIT $FC0' or 'STA $FA0'
uInt8 signature[7][3] = {
{ 0x8D, 0x40, 0x02 }, // STA $240 (Funky Fish, Pleiades)
{ 0xAD, 0x40, 0x02 }, // LDA $240 (???)
{ 0xBD, 0x1F, 0x02 }, // LDA $21F,X (Gingerbread Man)
{ 0x2C, 0xC0, 0x02 }, // BIT $2C0 (Time Pilot)
{ 0x8D, 0xC0, 0x02 }, // STA $2C0 (Fathom, Vanguard)
{ 0xAD, 0xC0, 0x02 } // LDA $2C0 (Mickey)
{ 0xAD, 0xC0, 0x02 }, // LDA $2C0 (Mickey)
{ 0x2C, 0xC0, 0x0F } // BIT $FC0 (H.E.R.O., Kung-Fu Master)
};
for(uInt32 i = 0; i < 6; ++i)
for(uInt32 i = 0; i < 7; ++i)
if(searchForBytes(image, size, signature[i], 3))
return true;

View File

@ -295,7 +295,7 @@ bool CartridgeEnhanced::bank(uInt16 bank, uInt16 segment)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
inline uInt16 CartridgeEnhanced::romAddressSegmentOffset(uInt16 address) const
inline uInt32 CartridgeEnhanced::romAddressSegmentOffset(uInt16 address) const
{
return myCurrentSegOffset[((address & ROM_MASK) >> myBankShift) % myBankSegs];
}

View File

@ -275,7 +275,7 @@ class CartridgeEnhanced : public Cartridge
@param address The address to get the offset for
@return The calculated offset
*/
uInt16 romAddressSegmentOffset(uInt16 address) const;
uInt32 romAddressSegmentOffset(uInt16 address) const;
/**
Get the RAM offset of the segment of the given address

View File

@ -39,11 +39,21 @@ void CartridgeUA::install(System& system)
// Set the page accessing methods for the hot spots
System::PageAccess access(this, System::PageAccessType::READ);
mySystem->setPageAccess(0x0220, access);
mySystem->setPageAccess(0x0240, access);
mySystem->setPageAccess(0x0220 | 0x80, access);
mySystem->setPageAccess(0x0240 | 0x80, access);
// Map all potential addresses
// - A11, A10 and A8 are not connected to RIOT
// - A9 is the fixed part of the hotspot address
// - A7 is used by Brazilian carts
// - A5 and A4 determine bank
for(uInt16 a11 = 0; a11 <= 1; ++a11)
for(uInt16 a10 = 0; a10 <= 1; ++a10)
for(uInt16 a8 = 0; a8 <= 1; ++a8)
for(uInt16 a7 = 0; a7 <= 1; ++a7)
{
uInt16 addr = (a11 << 11) + (a10 << 10) + (a8 << 8) + (a7 << 7);
mySystem->setPageAccess(0x0220 | addr, access);
mySystem->setPageAccess(0x0240 | addr, access);
}
// Install pages for the startup bank
bank(startBank());
}

View File

@ -28,7 +28,9 @@
/**
Cartridge class used for UA Limited's 8K bankswitched games. There
are two 4K banks, which are switched by accessing $0220 (bank 0) and
$0240 (bank 1).
$0240 (bank 1). Similar addresses are used by Brazilian carts, e.g.
$02A0, $02C0 and $0FA0, $0FC0. The code accepts further potential
hotspot addresses.
@author Bradford W. Mott, Thomas Jentzsch
*/

View File

@ -140,8 +140,14 @@
<ClCompile Include="..\common\JoyMap.cxx" />
<ClCompile Include="..\common\KeyMap.cxx" />
<ClCompile Include="..\common\Logger.cxx" />
<ClCompile Include="..\common\PaletteHandler.cxx" />
<ClCompile Include="..\common\PhosphorHandler.cxx" />
<ClCompile Include="..\emucore\Cart3EX.cxx" />
<ClCompile Include="..\emucore\CartCreator.cxx" />
<ClCompile Include="..\emucore\CartEnhanced.cxx" />
<ClCompile Include="..\emucore\CartFC.cxx" />
<ClCompile Include="..\emucore\CartTVBoy.cxx" />
<ClCompile Include="..\emucore\Lightgun.cxx" />
<ClCompile Include="libretro.cxx" />
<ClCompile Include="EventHandlerLIBRETRO.cxx" />
<ClCompile Include="FBSurfaceLIBRETRO.cxx" />
@ -174,8 +180,6 @@
<ClCompile Include="..\emucore\CartCDF.cxx" />
<ClCompile Include="..\emucore\CartCM.cxx" />
<ClCompile Include="..\emucore\CartCTY.cxx" />
<ClCompile Include="..\emucore\CartCVPlus.cxx" />
<ClCompile Include="..\emucore\CartDASH.cxx" />
<ClCompile Include="..\emucore\CartDetector.cxx" />
<ClCompile Include="..\emucore\CartDF.cxx" />
<ClCompile Include="..\emucore\CartDFSC.cxx" />
@ -248,7 +252,6 @@
<ClCompile Include="..\emucore\Joystick.cxx" />
<ClCompile Include="..\emucore\Keyboard.cxx" />
<ClCompile Include="..\emucore\KidVid.cxx" />
<ClCompile Include="..\emucore\Lighgun.cxx" />
<ClCompile Include="..\emucore\M6502.cxx" />
<ClCompile Include="..\emucore\M6532.cxx" />
<ClCompile Include="..\emucore\MD5.cxx" />
@ -276,6 +279,7 @@
<ClInclude Include="..\common\Logger.hxx" />
<ClInclude Include="..\common\MediaFactory.hxx" />
<ClInclude Include="..\common\MouseControl.hxx" />
<ClInclude Include="..\common\PaletteHandler.hxx" />
<ClInclude Include="..\common\PhosphorHandler.hxx" />
<ClInclude Include="..\common\PhysicalJoystick.hxx" />
<ClInclude Include="..\common\PJoystickHandler.hxx" />
@ -296,23 +300,25 @@
<ClInclude Include="..\emucore\Bankswitch.hxx" />
<ClInclude Include="..\emucore\BSType.hxx" />
<ClInclude Include="..\emucore\Cart3EPlus.hxx" />
<ClInclude Include="..\emucore\Cart3EX.hxx" />
<ClInclude Include="..\emucore\Cart4KSC.hxx" />
<ClInclude Include="..\emucore\CartBF.hxx" />
<ClInclude Include="..\emucore\CartBFSC.hxx" />
<ClInclude Include="..\emucore\CartBUS.hxx" />
<ClInclude Include="..\emucore\CartCDF.hxx" />
<ClInclude Include="..\emucore\CartCM.hxx" />
<ClInclude Include="..\emucore\CartCreator.hxx" />
<ClInclude Include="..\emucore\CartCTY.hxx" />
<ClInclude Include="..\emucore\CartCVPlus.hxx" />
<ClInclude Include="..\emucore\CartDASH.hxx" />
<ClInclude Include="..\emucore\CartDetector.hxx" />
<ClInclude Include="..\emucore\CartDF.hxx" />
<ClInclude Include="..\emucore\CartDFSC.hxx" />
<ClInclude Include="..\emucore\CartEnhanced.hxx" />
<ClInclude Include="..\emucore\CartFA2.hxx" />
<ClInclude Include="..\emucore\CartFC.hxx" />
<ClInclude Include="..\emucore\CartMDM.hxx" />
<ClInclude Include="..\emucore\CartMNetwork.hxx" />
<ClInclude Include="..\emucore\CartE78K.hxx" />
<ClInclude Include="..\emucore\CartTVBoy.hxx" />
<ClInclude Include="..\emucore\CartWD.hxx" />
<ClInclude Include="..\emucore\CompuMate.hxx" />
<ClInclude Include="..\emucore\ControllerDetector.hxx" />
@ -325,6 +331,7 @@
<ClInclude Include="..\emucore\exception\FatalEmulationError.hxx" />
<ClInclude Include="..\emucore\FBSurface.hxx" />
<ClInclude Include="..\emucore\FrameBufferConstants.hxx" />
<ClInclude Include="..\emucore\Lightgun.hxx" />
<ClInclude Include="..\emucore\MindLink.hxx" />
<ClInclude Include="..\emucore\PointingDevice.hxx" />
<ClInclude Include="..\emucore\ProfilingRunner.hxx" />