mirror of https://github.com/stella-emu/stella.git
Make sure 3E+ ROMs are always internally sized as a multiple 1024 bytes.
This commit is contained in:
parent
476a2b2c56
commit
e497405216
|
@ -140,6 +140,12 @@ namespace BSPF
|
|||
return power2;
|
||||
}
|
||||
|
||||
// Get next multiple of the given value
|
||||
// Note that this only works when multiple is a power of two
|
||||
inline size_t nextMultipleOf(size_t size, size_t multiple) {
|
||||
return (size + multiple - 1) & ~(multiple - 1);
|
||||
}
|
||||
|
||||
// Make 2D-arrays using std::array less verbose
|
||||
template<typename T, size_t ROW, size_t COL>
|
||||
using array2D = std::array<std::array<T, COL>, ROW>;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Cartridge3E::Cartridge3E(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: CartridgeEnhanced(image, size, BSPF::nextPowerOfTwo(size), md5, settings)
|
||||
: CartridgeEnhanced(image, size, BSPF::nextMultipleOf(size, 1_KB), md5, settings)
|
||||
{
|
||||
myBankShift = BANK_SHIFT;
|
||||
myRamSize = RAM_SIZE;
|
||||
|
|
Loading…
Reference in New Issue