Guarantee 'inline' code actually happens.

This commit is contained in:
Stephen Anthony 2020-09-08 12:52:20 -02:30
parent b8c6a9b024
commit 7e8be2b347
2 changed files with 7 additions and 14 deletions

View File

@ -294,18 +294,6 @@ bool CartridgeEnhanced::bank(uInt16 bank, uInt16 segment)
return myBankChanged = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
inline uInt32 CartridgeEnhanced::romAddressSegmentOffset(uInt16 address) const
{
return myCurrentSegOffset[((address & ROM_MASK) >> myBankShift) % myBankSegs];
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
inline uInt16 CartridgeEnhanced::ramAddressSegmentOffset(uInt16 address) const
{
return uInt16(myCurrentSegOffset[((address & ROM_MASK) >> myBankShift) % myBankSegs] - mySize) >> 1;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt16 CartridgeEnhanced::getBank(uInt16 address) const
{

View File

@ -275,7 +275,9 @@ class CartridgeEnhanced : public Cartridge
@param address The address to get the offset for
@return The calculated offset
*/
uInt32 romAddressSegmentOffset(uInt16 address) const;
uInt32 romAddressSegmentOffset(uInt16 address) const {
return myCurrentSegOffset[((address & ROM_MASK) >> myBankShift) % myBankSegs];
}
/**
Get the RAM offset of the segment of the given address
@ -283,7 +285,10 @@ class CartridgeEnhanced : public Cartridge
@param address The address to get the offset for
@return The calculated offset
*/
uInt16 ramAddressSegmentOffset(uInt16 address) const;
uInt16 ramAddressSegmentOffset(uInt16 address) const {
return static_cast<uInt16>((myCurrentSegOffset[
((address & ROM_MASK) >> myBankShift) % myBankSegs] - mySize) >> 1);
}
private:
// Following constructors and assignment operators not supported