mirror of https://github.com/stella-emu/stella.git
Changed uInt32 to size_t where necessary.
Finally decided to stop fighting C++, and just use size_t everywhere an array is used. Even though this is a 64-bit value, it seems that C++/STL expects it when dealing with arrays, so I guess we will too.
This commit is contained in:
parent
08fa405a06
commit
218969eb59
|
@ -74,11 +74,11 @@ CartDebug::CartDebug(Debugger& dbg, Console& console, const OSystem& osystem)
|
|||
// Banksizes greater than 4096 indicate multi-bank ROMs, but we handle only
|
||||
// 4K pieces at a time
|
||||
// Banksizes less than 4K use the actual value
|
||||
uInt32 banksize = 0;
|
||||
size_t banksize = 0;
|
||||
myConsole.cartridge().getImage(banksize);
|
||||
|
||||
BankInfo info;
|
||||
info.size = std::min(banksize, 4096u);
|
||||
info.size = std::min<size_t>(banksize, 4_KB);
|
||||
for(uInt32 i = 0; i < myConsole.cartridge().bankCount(); ++i)
|
||||
myBankInfo.push_back(info);
|
||||
|
||||
|
|
|
@ -271,7 +271,7 @@ class CartDebug : public DebuggerSystem
|
|||
uInt16 start; // start of address space
|
||||
uInt16 end; // end of address space
|
||||
uInt16 offset; // ORG value
|
||||
uInt32 size; // size of a bank (in bytes)
|
||||
size_t size; // size of a bank (in bytes)
|
||||
AddressList addressList; // addresses which PC has hit
|
||||
DirectiveList directiveList; // overrides for automatic code determination
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
|
|||
myOffset = info.offset;
|
||||
if (start & 0x1000) {
|
||||
info.start = myAppData.start = 0x0000;
|
||||
info.end = myAppData.end = info.size - 1;
|
||||
info.end = myAppData.end = static_cast<uInt16>(info.size - 1);
|
||||
// Keep previous offset; it may be different between banks
|
||||
if (info.offset == 0)
|
||||
info.offset = myOffset = (start - (start % info.size));
|
||||
|
@ -56,7 +56,7 @@ DiStella::DiStella(const CartDebug& dbg, CartDebug::DisassemblyList& list,
|
|||
// Resolve code is never used in ZP RAM mode
|
||||
resolve_code = false;
|
||||
}
|
||||
myAppData.length = info.size;
|
||||
myAppData.length = static_cast<uInt16>(info.size);
|
||||
|
||||
myLabels.fill(0);
|
||||
myDirectives.fill(0);
|
||||
|
|
|
@ -27,7 +27,7 @@ Cartridge3EPlusWidget::Cartridge3EPlusWidget(
|
|||
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
||||
myCart(cart)
|
||||
{
|
||||
uInt32 size = cart.mySize;
|
||||
size_t size = cart.mySize;
|
||||
|
||||
ostringstream info;
|
||||
info << "3EPlus cartridge - (64K ROM + RAM)\n"
|
||||
|
|
|
@ -25,10 +25,10 @@ Cartridge3EWidget::Cartridge3EWidget(
|
|||
int x, int y, int w, int h, Cartridge3E& cart)
|
||||
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
||||
myCart(cart),
|
||||
myNumRomBanks(cart.mySize >> 11),
|
||||
myNumRomBanks(uInt32(cart.mySize >> 11)),
|
||||
myNumRamBanks(32)
|
||||
{
|
||||
uInt32 size = cart.mySize;
|
||||
size_t size = cart.mySize;
|
||||
|
||||
ostringstream info;
|
||||
info << "3E cartridge - (3F + RAM)\n"
|
||||
|
|
|
@ -26,7 +26,7 @@ Cartridge3FWidget::Cartridge3FWidget(
|
|||
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
||||
myCart(cart)
|
||||
{
|
||||
uInt32 size = cart.mySize;
|
||||
size_t size = cart.mySize;
|
||||
|
||||
ostringstream info;
|
||||
info << "Tigervision 3F cartridge, 2-256 2K banks\n"
|
||||
|
|
|
@ -26,7 +26,7 @@ CartridgeARWidget::CartridgeARWidget(
|
|||
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
||||
myCart(cart)
|
||||
{
|
||||
uInt16 size = myCart.mySize;
|
||||
size_t size = myCart.mySize;
|
||||
|
||||
string info =
|
||||
"Supercharger cartridge, four 2K slices (3 RAM, 1 ROM)\n"
|
||||
|
|
|
@ -28,7 +28,7 @@ CartridgeCVPlusWidget::CartridgeCVPlusWidget(
|
|||
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
||||
myCart(cart)
|
||||
{
|
||||
uInt32 size = cart.mySize;
|
||||
size_t size = cart.mySize;
|
||||
|
||||
ostringstream info;
|
||||
info << "LS_Dracon CV+ cartridge, 1K RAM, 2-256 2K ROM\n"
|
||||
|
|
|
@ -27,7 +27,7 @@ CartridgeDASHWidget::CartridgeDASHWidget(
|
|||
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
||||
myCart(cart)
|
||||
{
|
||||
uInt32 size = cart.mySize;
|
||||
size_t size = cart.mySize;
|
||||
|
||||
ostringstream info;
|
||||
info << "DASH cartridge - (64K ROM + RAM)\n"
|
||||
|
|
|
@ -27,7 +27,7 @@ CartridgeDPCPlusWidget::CartridgeDPCPlusWidget(
|
|||
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
||||
myCart(cart)
|
||||
{
|
||||
uInt16 size = cart.mySize;
|
||||
size_t size = cart.mySize;
|
||||
|
||||
ostringstream info;
|
||||
info << "Extended DPC cartridge, six 4K banks, 4K display bank, 1K frequency table, "
|
||||
|
|
|
@ -27,7 +27,7 @@ CartridgeDPCWidget::CartridgeDPCWidget(
|
|||
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
||||
myCart(cart)
|
||||
{
|
||||
uInt16 size = cart.mySize;
|
||||
size_t size = cart.mySize;
|
||||
|
||||
ostringstream info;
|
||||
info << "DPC cartridge, two 4K banks + 2K display bank\n"
|
||||
|
|
|
@ -37,7 +37,7 @@ CartDebugWidget::CartDebugWidget(GuiObject* boss, const GUI::Font& lfont,
|
|||
myDesc(nullptr) { }
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
int CartDebugWidget::addBaseInformation(int bytes, const string& manufacturer,
|
||||
int CartDebugWidget::addBaseInformation(size_t bytes, const string& manufacturer,
|
||||
const string& desc, const uInt16 maxlines)
|
||||
{
|
||||
const int lwidth = _font.getStringWidth("Manufacturer "),
|
||||
|
|
|
@ -41,7 +41,7 @@ class CartDebugWidget : public Widget, public CommandSender
|
|||
virtual ~CartDebugWidget() = default;
|
||||
|
||||
public:
|
||||
int addBaseInformation(int bytes, const string& manufacturer,
|
||||
int addBaseInformation(size_t bytes, const string& manufacturer,
|
||||
const string& desc, const uInt16 maxlines = 10);
|
||||
|
||||
// Inform the ROM Widget that the underlying cart has somehow changed
|
||||
|
|
|
@ -28,7 +28,7 @@ CartridgeFA2Widget::CartridgeFA2Widget(
|
|||
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
||||
myCart(cart)
|
||||
{
|
||||
uInt16 size = cart.mySize;
|
||||
size_t size = cart.mySize;
|
||||
|
||||
ostringstream info;
|
||||
info << "Modified FA RAM+, six or seven 4K banks\n"
|
||||
|
|
|
@ -27,7 +27,7 @@ CartridgeMDMWidget::CartridgeMDMWidget(
|
|||
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
||||
myCart(cart)
|
||||
{
|
||||
uInt32 size = myCart.mySize;
|
||||
size_t size = myCart.mySize;
|
||||
|
||||
ostringstream info;
|
||||
info << "Menu Driven Megacart, containing up to 128 4K banks\n"
|
||||
|
|
|
@ -26,7 +26,7 @@ CartridgeSBWidget::CartridgeSBWidget(
|
|||
: CartDebugWidget(boss, lfont, nfont, x, y, w, h),
|
||||
myCart(cart)
|
||||
{
|
||||
uInt32 size = myCart.mySize;
|
||||
size_t size = myCart.mySize;
|
||||
|
||||
VariantList items;
|
||||
ostringstream info, bank;
|
||||
|
|
|
@ -59,7 +59,7 @@ void Cartridge::setAbout(const string& about, const string& type,
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool Cartridge::saveROM(ofstream& out) const
|
||||
{
|
||||
uInt32 size = 0;
|
||||
size_t size = 0;
|
||||
|
||||
const uInt8* image = getImage(size);
|
||||
if(image == nullptr || size == 0)
|
||||
|
@ -119,7 +119,7 @@ void Cartridge::pokeRAM(uInt8& dest, uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Cartridge::createCodeAccessBase(uInt32 size)
|
||||
void Cartridge::createCodeAccessBase(size_t size)
|
||||
{
|
||||
#ifdef DEBUGGER_SUPPORT
|
||||
myCodeAccessBase = make_unique<uInt8[]>(size);
|
||||
|
@ -130,10 +130,10 @@ void Cartridge::createCodeAccessBase(uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void Cartridge::initializeRAM(uInt8* arr, uInt32 size, uInt8 val) const
|
||||
void Cartridge::initializeRAM(uInt8* arr, size_t size, uInt8 val) const
|
||||
{
|
||||
if(randomInitialRAM())
|
||||
for(uInt32 i = 0; i < size; ++i)
|
||||
for(size_t i = 0; i < size; ++i)
|
||||
arr[i] = mySystem->randGenerator().next();
|
||||
else
|
||||
std::fill_n(arr, size, val);
|
||||
|
|
|
@ -192,7 +192,7 @@ class Cartridge : public Device
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
virtual const uInt8* getImage(uInt32& size) const = 0;
|
||||
virtual const uInt8* getImage(size_t& size) const = 0;
|
||||
|
||||
/**
|
||||
Get a descriptor for the cart name.
|
||||
|
@ -273,7 +273,7 @@ class Cartridge : public Device
|
|||
|
||||
@param size The size of the code-access array to create
|
||||
*/
|
||||
void createCodeAccessBase(uInt32 size);
|
||||
void createCodeAccessBase(size_t size);
|
||||
|
||||
/**
|
||||
Fill the given RAM array with (possibly random) data.
|
||||
|
@ -282,7 +282,7 @@ class Cartridge : public Device
|
|||
@param size The size of the RAM array
|
||||
@param val If provided, the value to store in the RAM array
|
||||
*/
|
||||
void initializeRAM(uInt8* arr, uInt32 size, uInt8 val = 0) const;
|
||||
void initializeRAM(uInt8* arr, size_t size, uInt8 val = 0) const;
|
||||
|
||||
/**
|
||||
Set the start bank to be used when the cart is reset. This method
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "Cart0840.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Cartridge0840::Cartridge0840(const ByteBuffer& image, uInt32 size,
|
||||
Cartridge0840::Cartridge0840(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ bool Cartridge0840::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* Cartridge0840::getImage(uInt32& size) const
|
||||
const uInt8* Cartridge0840::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -45,7 +45,7 @@ class Cartridge0840 : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
Cartridge0840(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
Cartridge0840(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~Cartridge0840() = default;
|
||||
|
||||
|
@ -97,7 +97,7 @@ class Cartridge0840 : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "Cart2K.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Cartridge2K::Cartridge2K(const ByteBuffer& image, uInt32 size,
|
||||
Cartridge2K::Cartridge2K(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5)
|
||||
{
|
||||
|
@ -78,7 +78,7 @@ bool Cartridge2K::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* Cartridge2K::getImage(uInt32& size) const
|
||||
const uInt8* Cartridge2K::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myImage.get();
|
||||
|
|
|
@ -48,7 +48,7 @@ class Cartridge2K : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
Cartridge2K(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
Cartridge2K(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~Cartridge2K() = default;
|
||||
|
||||
|
@ -81,7 +81,7 @@ class Cartridge2K : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "Cart3E.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Cartridge3E::Cartridge3E(const ByteBuffer& image, uInt32 size,
|
||||
Cartridge3E::Cartridge3E(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(size),
|
||||
|
@ -236,7 +236,7 @@ bool Cartridge3E::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* Cartridge3E::getImage(uInt32& size) const
|
||||
const uInt8* Cartridge3E::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myImage.get();
|
||||
|
|
|
@ -74,7 +74,7 @@ class Cartridge3E : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
Cartridge3E(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
Cartridge3E(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~Cartridge3E() = default;
|
||||
|
||||
|
@ -126,7 +126,7 @@ class Cartridge3E : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -188,7 +188,7 @@ class Cartridge3E : public Cartridge
|
|||
std::array<uInt8, 32_KB> myRAM;
|
||||
|
||||
// Size of the ROM image
|
||||
uInt32 mySize;
|
||||
size_t mySize;
|
||||
|
||||
// Indicates which bank is currently active for the first segment
|
||||
uInt16 myCurrentBank;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "Cart3EPlus.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Cartridge3EPlus::Cartridge3EPlus(const ByteBuffer& image, uInt32 size,
|
||||
Cartridge3EPlus::Cartridge3EPlus(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(size)
|
||||
|
@ -87,7 +87,7 @@ uInt16 Cartridge3EPlus::getBank(uInt16 address) const
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt16 Cartridge3EPlus::bankCount() const
|
||||
{
|
||||
return mySize >> 10; // 1K slices
|
||||
return uInt16(mySize >> 10); // 1K slices
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -307,7 +307,7 @@ bool Cartridge3EPlus::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* Cartridge3EPlus::getImage(uInt32& size) const
|
||||
const uInt8* Cartridge3EPlus::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myImage.get();
|
||||
|
|
|
@ -54,7 +54,7 @@ class Cartridge3EPlus: public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
Cartridge3EPlus(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
Cartridge3EPlus(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~Cartridge3EPlus() = default;
|
||||
|
||||
|
@ -97,7 +97,7 @@ class Cartridge3EPlus: public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -191,7 +191,7 @@ class Cartridge3EPlus: public Cartridge
|
|||
static constexpr uInt16 RAM_WRITE_OFFSET = 0x200;
|
||||
|
||||
ByteBuffer myImage; // Pointer to a dynamically allocated ROM image of the cartridge
|
||||
uInt32 mySize; // Size of the ROM image
|
||||
size_t mySize; // Size of the ROM image
|
||||
std::array<uInt8, RAM_TOTAL_SIZE> myRAM;
|
||||
|
||||
private:
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "Cart3F.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Cartridge3F::Cartridge3F(const ByteBuffer& image, uInt32 size,
|
||||
Cartridge3F::Cartridge3F(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(size),
|
||||
|
@ -128,7 +128,7 @@ bool Cartridge3F::bank(uInt16 bank)
|
|||
uInt16 Cartridge3F::getBank(uInt16 address) const
|
||||
{
|
||||
if (address & 0x800)
|
||||
return (mySize >> 11) - 1; // 2K slices, fixed bank
|
||||
return uInt16((mySize >> 11) - 1); // 2K slices, fixed bank
|
||||
else
|
||||
return myCurrentBank;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ uInt16 Cartridge3F::getBank(uInt16 address) const
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt16 Cartridge3F::bankCount() const
|
||||
{
|
||||
return mySize >> 11; // 2K slices
|
||||
return uInt16(mySize >> 11); // 2K slices
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -153,7 +153,7 @@ bool Cartridge3F::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* Cartridge3F::getImage(uInt32& size) const
|
||||
const uInt8* Cartridge3F::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myImage.get();
|
||||
|
|
|
@ -51,7 +51,7 @@ class Cartridge3F : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
Cartridge3F(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
Cartridge3F(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~Cartridge3F() = default;
|
||||
|
||||
|
@ -103,7 +103,7 @@ class Cartridge3F : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -162,7 +162,7 @@ class Cartridge3F : public Cartridge
|
|||
ByteBuffer myImage;
|
||||
|
||||
// Size of the ROM image
|
||||
uInt32 mySize;
|
||||
size_t mySize;
|
||||
|
||||
// Indicates which bank is currently active for the first segment
|
||||
uInt16 myCurrentBank;
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "Cart4A50.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Cartridge4A50::Cartridge4A50(const ByteBuffer& image, uInt32 size,
|
||||
Cartridge4A50::Cartridge4A50(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(size),
|
||||
|
@ -356,7 +356,7 @@ bool Cartridge4A50::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* Cartridge4A50::getImage(uInt32& size) const
|
||||
const uInt8* Cartridge4A50::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myImage.data();
|
||||
|
|
|
@ -65,7 +65,7 @@ class Cartridge4A50 : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
Cartridge4A50(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
Cartridge4A50(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~Cartridge4A50() = default;
|
||||
|
||||
|
@ -98,7 +98,7 @@ class Cartridge4A50 : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -225,7 +225,7 @@ class Cartridge4A50 : public Cartridge
|
|||
std::array<uInt8, 32_KB> myRAM;
|
||||
|
||||
// (Actual) Size of the ROM image
|
||||
uInt32 mySize;
|
||||
size_t mySize;
|
||||
|
||||
// Indicates the slice mapped into each of the three segments
|
||||
uInt16 mySliceLow; /* index pointer for $1000-$17ff slice */
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
#include "Cart4K.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Cartridge4K::Cartridge4K(const ByteBuffer& image, uInt32 size,
|
||||
Cartridge4K::Cartridge4K(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ bool Cartridge4K::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* Cartridge4K::getImage(uInt32& size) const
|
||||
const uInt8* Cartridge4K::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -45,7 +45,7 @@ class Cartridge4K : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
Cartridge4K(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
Cartridge4K(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~Cartridge4K() = default;
|
||||
|
||||
|
@ -78,7 +78,7 @@ class Cartridge4K : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
#include "Cart4KSC.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Cartridge4KSC::Cartridge4KSC(const ByteBuffer& image, uInt32 size,
|
||||
Cartridge4KSC::Cartridge4KSC(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@ bool Cartridge4KSC::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* Cartridge4KSC::getImage(uInt32& size) const
|
||||
const uInt8* Cartridge4KSC::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -44,7 +44,7 @@ class Cartridge4KSC : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
Cartridge4KSC(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
Cartridge4KSC(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~Cartridge4KSC() = default;
|
||||
|
||||
|
@ -77,7 +77,7 @@ class Cartridge4KSC : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
#include "CartAR.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeAR::CartridgeAR(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeAR::CartridgeAR(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(std::max(size, 8448u)),
|
||||
mySize(std::max<size_t>(size, 8448)),
|
||||
myWriteEnabled(false),
|
||||
myPower(true),
|
||||
myDataHoldRegister(0),
|
||||
|
@ -33,7 +33,7 @@ CartridgeAR::CartridgeAR(const ByteBuffer& image, uInt32 size,
|
|||
{
|
||||
// Create a load image buffer and copy the given image
|
||||
myLoadImages = make_unique<uInt8[]>(mySize);
|
||||
myNumberOfLoadImages = mySize / 8448;
|
||||
myNumberOfLoadImages = uInt8(mySize / 8448);
|
||||
std::copy_n(image.get(), size, myLoadImages.get());
|
||||
|
||||
// Add header if image doesn't include it
|
||||
|
@ -422,7 +422,7 @@ bool CartridgeAR::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeAR::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeAR::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myLoadImages.get();
|
||||
|
|
|
@ -52,7 +52,7 @@ class CartridgeAR : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeAR(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeAR(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeAR() = default;
|
||||
|
||||
|
@ -104,7 +104,7 @@ class CartridgeAR : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -196,7 +196,7 @@ class CartridgeAR : public Cartridge
|
|||
std::array<uInt8, 256> myHeader;
|
||||
|
||||
// Size of the ROM image
|
||||
uInt32 mySize;
|
||||
size_t mySize;
|
||||
|
||||
// All of the 8448 byte loads associated with the game
|
||||
ByteBuffer myLoadImages;
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "CartBF.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeBF::CartridgeBF(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeBF::CartridgeBF(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ bool CartridgeBF::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeBF::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeBF::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -46,7 +46,7 @@ class CartridgeBF : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeBF(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeBF(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeBF() = default;
|
||||
|
||||
|
@ -98,7 +98,7 @@ class CartridgeBF : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "CartBFSC.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeBFSC::CartridgeBFSC(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeBFSC::CartridgeBFSC(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ bool CartridgeBFSC::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeBFSC::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeBFSC::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -46,7 +46,7 @@ class CartridgeBFSC : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeBFSC(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeBFSC(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeBFSC() = default;
|
||||
|
||||
|
@ -98,7 +98,7 @@ class CartridgeBFSC : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#define DIGITAL_AUDIO_ON ((myMode & 0xF0) == 0)
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeBUS::CartridgeBUS(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeBUS::CartridgeBUS(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myAudioCycles(0),
|
||||
|
@ -49,7 +49,7 @@ CartridgeBUS::CartridgeBUS(const ByteBuffer& image, uInt32 size,
|
|||
myFractionalClocks(0.0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
|
||||
// Even though the ROM is 32K, only 28K is accessible to the 6507
|
||||
createCodeAccessBase(28_KB);
|
||||
|
@ -69,7 +69,7 @@ CartridgeBUS::CartridgeBUS(const ByteBuffer& image, uInt32 size,
|
|||
myThumbEmulator = make_unique<Thumbulator>(
|
||||
reinterpret_cast<uInt16*>(myImage.data()),
|
||||
reinterpret_cast<uInt16*>(myBUSRAM.data()),
|
||||
myImage.size(),
|
||||
static_cast<uInt32>(myImage.size()),
|
||||
devSettings ? settings.getBool("dev.thumb.trapfatal") : false, Thumbulator::ConfigureFor::BUS, this
|
||||
);
|
||||
|
||||
|
@ -477,7 +477,7 @@ bool CartridgeBUS::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeBUS::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeBUS::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -54,7 +54,7 @@ class CartridgeBUS : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeBUS(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeBUS(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeBUS() = default;
|
||||
|
||||
|
@ -115,7 +115,7 @@ class CartridgeBUS : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace {
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeCDF::CartridgeCDF(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeCDF::CartridgeCDF(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myAudioCycles(0),
|
||||
|
@ -65,7 +65,7 @@ CartridgeCDF::CartridgeCDF(const ByteBuffer& image, uInt32 size,
|
|||
myFractionalClocks(0.0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
|
||||
// even though the ROM is 32K, only 28K is accessible to the 6507
|
||||
createCodeAccessBase(4096 * 7);
|
||||
|
@ -87,7 +87,7 @@ CartridgeCDF::CartridgeCDF(const ByteBuffer& image, uInt32 size,
|
|||
myThumbEmulator = make_unique<Thumbulator>(
|
||||
reinterpret_cast<uInt16*>(myImage.data()),
|
||||
reinterpret_cast<uInt16*>(myCDFRAM.data()),
|
||||
myImage.size(),
|
||||
static_cast<uInt32>(myImage.size()),
|
||||
devSettings ? settings.getBool("dev.thumb.trapfatal") : false, thumulatorConfiguration(myCDFSubtype), this);
|
||||
|
||||
setInitialState();
|
||||
|
@ -449,7 +449,7 @@ bool CartridgeCDF::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeCDF::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeCDF::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -62,7 +62,7 @@ class CartridgeCDF : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeCDF(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeCDF(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeCDF() = default;
|
||||
|
||||
|
@ -123,7 +123,7 @@ class CartridgeCDF : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -21,14 +21,14 @@
|
|||
#include "CartCM.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeCM::CartridgeCM(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeCM::CartridgeCM(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySWCHA(0xFF), // portA is all 1's
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -180,7 +180,7 @@ bool CartridgeCM::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeCM::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeCM::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -120,7 +120,7 @@ class CartridgeCM : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeCM(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeCM(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeCM() = default;
|
||||
|
||||
|
@ -172,7 +172,7 @@ class CartridgeCM : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "CartCTY.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeCTY::CartridgeCTY(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeCTY::CartridgeCTY(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myOperationType(0),
|
||||
|
@ -35,7 +35,7 @@ CartridgeCTY::CartridgeCTY(const ByteBuffer& image, uInt32 size,
|
|||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
|
||||
// Default to no tune data in case user is utilizing an old ROM
|
||||
|
@ -285,7 +285,7 @@ bool CartridgeCTY::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeCTY::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeCTY::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -118,7 +118,7 @@ class CartridgeCTY : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the settings object
|
||||
*/
|
||||
CartridgeCTY(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeCTY(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeCTY() = default;
|
||||
|
||||
|
@ -170,7 +170,7 @@ class CartridgeCTY : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "CartCV.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeCV::CartridgeCV(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeCV::CartridgeCV(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(size)
|
||||
|
@ -128,7 +128,7 @@ bool CartridgeCV::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeCV::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeCV::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -48,7 +48,7 @@ class CartridgeCV : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeCV(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeCV(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeCV() = default;
|
||||
|
||||
|
@ -81,7 +81,7 @@ class CartridgeCV : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -140,7 +140,7 @@ class CartridgeCV : public Cartridge
|
|||
std::array<uInt8, 2048> myImage;
|
||||
|
||||
// Initial size of the cart data
|
||||
uInt32 mySize;
|
||||
size_t mySize;
|
||||
|
||||
// The 1024 bytes of RAM
|
||||
std::array<uInt8, 1024> myRAM;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "CartCVPlus.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeCVPlus::CartridgeCVPlus(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeCVPlus::CartridgeCVPlus(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(size),
|
||||
|
@ -152,7 +152,7 @@ uInt16 CartridgeCVPlus::getBank(uInt16) const
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt16 CartridgeCVPlus::bankCount() const
|
||||
{
|
||||
return mySize >> 11;
|
||||
return uInt16(mySize >> 11);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -175,7 +175,7 @@ bool CartridgeCVPlus::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeCVPlus::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeCVPlus::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myImage.get();
|
||||
|
|
|
@ -57,7 +57,7 @@ class CartridgeCVPlus : public Cartridge
|
|||
@param size The size of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeCVPlus(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeCVPlus(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeCVPlus() = default;
|
||||
|
||||
|
@ -109,7 +109,7 @@ class CartridgeCVPlus : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -171,7 +171,7 @@ class CartridgeCVPlus : public Cartridge
|
|||
std::array<uInt8, 1_KB> myRAM;
|
||||
|
||||
// Size of the ROM image
|
||||
uInt32 mySize;
|
||||
size_t mySize;
|
||||
|
||||
// Indicates which bank is currently active for the first segment
|
||||
uInt16 myCurrentBank;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "CartDASH.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeDASH::CartridgeDASH(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeDASH::CartridgeDASH(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(size)
|
||||
|
@ -300,7 +300,7 @@ bool CartridgeDASH::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeDASH::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeDASH::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myImage.get();
|
||||
|
|
|
@ -136,7 +136,7 @@ class CartridgeDASH: public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeDASH(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeDASH(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeDASH() = default;
|
||||
|
||||
|
@ -167,7 +167,7 @@ class CartridgeDASH: public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -262,7 +262,7 @@ class CartridgeDASH: public Cartridge
|
|||
static constexpr uInt16 RAM_WRITE_OFFSET = 0x800;
|
||||
|
||||
ByteBuffer myImage; // Pointer to a dynamically allocated ROM image of the cartridge
|
||||
uInt32 mySize; // Size of the ROM image
|
||||
size_t mySize; // Size of the ROM image
|
||||
std::array<uInt8, RAM_TOTAL_SIZE> myRAM;
|
||||
|
||||
private:
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "CartDF.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeDF::CartridgeDF(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeDF::CartridgeDF(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ bool CartridgeDF::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeDF::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeDF::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -46,7 +46,7 @@ class CartridgeDF : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeDF(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeDF(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeDF() = default;
|
||||
|
||||
|
@ -98,7 +98,7 @@ class CartridgeDF : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "CartDFSC.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeDFSC::CartridgeDFSC(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeDFSC::CartridgeDFSC(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ bool CartridgeDFSC::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeDFSC::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeDFSC::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -46,7 +46,7 @@ class CartridgeDFSC : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeDFSC(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeDFSC(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeDFSC() = default;
|
||||
|
||||
|
@ -98,7 +98,7 @@ class CartridgeDFSC : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
#include "CartDPC.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeDPC::CartridgeDPC(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeDPC::CartridgeDPC(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(size),
|
||||
|
@ -29,7 +29,7 @@ CartridgeDPC::CartridgeDPC(const ByteBuffer& image, uInt32 size,
|
|||
myBankOffset(0)
|
||||
{
|
||||
// Make a copy of the entire image
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(8192);
|
||||
|
||||
// Pointer to the program ROM (8K @ 0 byte offset)
|
||||
|
@ -431,7 +431,7 @@ bool CartridgeDPC::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeDPC::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeDPC::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myImage.data();
|
||||
|
|
|
@ -50,7 +50,7 @@ class CartridgeDPC : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeDPC(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeDPC(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeDPC() = default;
|
||||
|
||||
|
@ -102,7 +102,7 @@ class CartridgeDPC : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -175,7 +175,7 @@ class CartridgeDPC : public Cartridge
|
|||
std::array<uInt8, 8_KB + 2_KB + 256> myImage;
|
||||
|
||||
// (Actual) Size of the ROM image
|
||||
uInt32 mySize;
|
||||
size_t mySize;
|
||||
|
||||
// Pointer to the 8K program ROM image of the cartridge
|
||||
uInt8* myProgramImage;
|
||||
|
|
|
@ -26,10 +26,10 @@
|
|||
#include "exception/FatalEmulationError.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeDPCPlus::CartridgeDPCPlus(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeDPCPlus::CartridgeDPCPlus(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(std::min<uInt32>(size, myImage.size())),
|
||||
mySize(std::min(size, myImage.size())),
|
||||
myFastFetch(false),
|
||||
myLDAimmediate(false),
|
||||
myParameterPointer(0),
|
||||
|
@ -44,7 +44,7 @@ CartridgeDPCPlus::CartridgeDPCPlus(const ByteBuffer& image, uInt32 size,
|
|||
if(mySize < myImage.size())
|
||||
myImage.fill(0);
|
||||
std::copy_n(image.get(), size, myImage.begin() + (myImage.size() - mySize));
|
||||
createCodeAccessBase(4096 * 6);
|
||||
createCodeAccessBase(4_KB * 6);
|
||||
|
||||
// Pointer to the program ROM (24K @ 3072 byte offset; ignore first 3K)
|
||||
myProgramImage = myImage.data() + 0xC00;
|
||||
|
@ -60,7 +60,7 @@ CartridgeDPCPlus::CartridgeDPCPlus(const ByteBuffer& image, uInt32 size,
|
|||
myThumbEmulator = make_unique<Thumbulator>
|
||||
(reinterpret_cast<uInt16*>(myImage.data()),
|
||||
reinterpret_cast<uInt16*>(myDPCRAM.data()),
|
||||
myImage.size(),
|
||||
static_cast<uInt32>(myImage.size()),
|
||||
devSettings ? settings.getBool("dev.thumb.trapfatal") : false,
|
||||
Thumbulator::ConfigureFor::DPCplus,
|
||||
this);
|
||||
|
@ -629,7 +629,7 @@ bool CartridgeDPCPlus::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeDPCPlus::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeDPCPlus::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myImage.data() + (myImage.size() - mySize);
|
||||
|
|
|
@ -56,7 +56,7 @@ class CartridgeDPCPlus : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeDPCPlus(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeDPCPlus(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeDPCPlus() = default;
|
||||
|
||||
|
@ -117,7 +117,7 @@ class CartridgeDPCPlus : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -201,7 +201,7 @@ class CartridgeDPCPlus : public Cartridge
|
|||
private:
|
||||
// The ROM image and size
|
||||
std::array<uInt8, 32_KB> myImage;
|
||||
uInt32 mySize;
|
||||
size_t mySize;
|
||||
|
||||
// Pointer to the 24K program ROM image of the cartridge
|
||||
uInt8* myProgramImage;
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
unique_ptr<Cartridge> CartDetector::create(const FilesystemNode& file,
|
||||
const ByteBuffer& image, uInt32 size, string& md5,
|
||||
const ByteBuffer& image, size_t size, string& md5,
|
||||
const string& propertiesType, Settings& settings)
|
||||
{
|
||||
unique_ptr<Cartridge> cartridge;
|
||||
|
@ -104,7 +104,7 @@ unique_ptr<Cartridge> CartDetector::create(const FilesystemNode& file,
|
|||
{
|
||||
case Bankswitch::Type::_2IN1:
|
||||
// Make sure we have a valid sized image
|
||||
if(size == 2*2048 || size == 2*4096 || size == 2*8192 || size == 2*16384)
|
||||
if(size == 2*2_KB || size == 2*4_KB || size == 2*8_KB || size == 2*16_KB)
|
||||
{
|
||||
cartridge =
|
||||
createFromMultiCart(image, size, 2, md5, detectedType, id, settings);
|
||||
|
@ -117,7 +117,7 @@ unique_ptr<Cartridge> CartDetector::create(const FilesystemNode& file,
|
|||
|
||||
case Bankswitch::Type::_4IN1:
|
||||
// Make sure we have a valid sized image
|
||||
if(size == 4*2048 || size == 4*4096 || size == 4*8192)
|
||||
if(size == 4*2_KB || size == 4*4_KB || size == 4*8_KB)
|
||||
{
|
||||
cartridge =
|
||||
createFromMultiCart(image, size, 4, md5, detectedType, id, settings);
|
||||
|
@ -130,7 +130,7 @@ unique_ptr<Cartridge> CartDetector::create(const FilesystemNode& file,
|
|||
|
||||
case Bankswitch::Type::_8IN1:
|
||||
// Make sure we have a valid sized image
|
||||
if(size == 8*2048 || size == 8*4096 || size == 8*8192)
|
||||
if(size == 8*2_KB || size == 8*4_KB || size == 8*8_KB)
|
||||
{
|
||||
cartridge =
|
||||
createFromMultiCart(image, size, 8, md5, detectedType, id, settings);
|
||||
|
@ -143,7 +143,7 @@ unique_ptr<Cartridge> CartDetector::create(const FilesystemNode& file,
|
|||
|
||||
case Bankswitch::Type::_16IN1:
|
||||
// Make sure we have a valid sized image
|
||||
if(size == 16*2048 || size == 16*4096 || size == 16*8192)
|
||||
if(size == 16*2_KB || size == 16*4_KB || size == 16*8_KB)
|
||||
{
|
||||
cartridge =
|
||||
createFromMultiCart(image, size, 16, md5, detectedType, id, settings);
|
||||
|
@ -156,7 +156,7 @@ unique_ptr<Cartridge> CartDetector::create(const FilesystemNode& file,
|
|||
|
||||
case Bankswitch::Type::_32IN1:
|
||||
// Make sure we have a valid sized image
|
||||
if(size == 32*2048 || size == 32*4096)
|
||||
if(size == 32*2_KB || size == 32*4_KB)
|
||||
{
|
||||
cartridge =
|
||||
createFromMultiCart(image, size, 32, md5, detectedType, id, settings);
|
||||
|
@ -169,7 +169,7 @@ unique_ptr<Cartridge> CartDetector::create(const FilesystemNode& file,
|
|||
|
||||
case Bankswitch::Type::_64IN1:
|
||||
// Make sure we have a valid sized image
|
||||
if(size == 64*2048 || size == 64*4096)
|
||||
if(size == 64*2_KB || size == 64*4_KB)
|
||||
{
|
||||
cartridge =
|
||||
createFromMultiCart(image, size, 64, md5, detectedType, id, settings);
|
||||
|
@ -182,7 +182,7 @@ unique_ptr<Cartridge> CartDetector::create(const FilesystemNode& file,
|
|||
|
||||
case Bankswitch::Type::_128IN1:
|
||||
// Make sure we have a valid sized image
|
||||
if(size == 128*2048 || size == 128*4096)
|
||||
if(size == 128*2_KB || size == 128*4_KB)
|
||||
{
|
||||
cartridge =
|
||||
createFromMultiCart(image, size, 128, md5, detectedType, id, settings);
|
||||
|
@ -198,10 +198,10 @@ unique_ptr<Cartridge> CartDetector::create(const FilesystemNode& file,
|
|||
break;
|
||||
}
|
||||
|
||||
if(size < 1024)
|
||||
if(size < 1_KB)
|
||||
buf << " (" << size << "B) ";
|
||||
else
|
||||
buf << " (" << (size/1024) << "K) ";
|
||||
buf << " (" << (size/1_KB) << "K) ";
|
||||
|
||||
cartridge->setAbout(buf.str(), Bankswitch::typeToName(type), id);
|
||||
|
||||
|
@ -210,17 +210,17 @@ unique_ptr<Cartridge> CartDetector::create(const FilesystemNode& file,
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
unique_ptr<Cartridge>
|
||||
CartDetector::createFromMultiCart(const ByteBuffer& image, uInt32& size,
|
||||
CartDetector::createFromMultiCart(const ByteBuffer& image, size_t& size,
|
||||
uInt32 numroms, string& md5, Bankswitch::Type type, string& id, Settings& settings)
|
||||
{
|
||||
// Get a piece of the larger image
|
||||
uInt32 i = settings.getInt("romloadcount");
|
||||
size /= numroms;
|
||||
ByteBuffer slice = make_unique<uInt8[]>(size);
|
||||
memcpy(slice.get(), image.get()+i*size, size);
|
||||
std::copy_n(image.get()+i*size, size, slice.get());
|
||||
|
||||
// We need a new md5 and name
|
||||
md5 = MD5::hash(slice, size);
|
||||
md5 = MD5::hash(slice, uInt32(size)); // FIXME
|
||||
ostringstream buf;
|
||||
buf << " [G" << (i+1) << "]";
|
||||
id = buf.str();
|
||||
|
@ -228,9 +228,9 @@ CartDetector::createFromMultiCart(const ByteBuffer& image, uInt32& size,
|
|||
// Move to the next game the next time this ROM is loaded
|
||||
settings.setValue("romloadcount", (i+1)%numroms);
|
||||
|
||||
if(size <= 2048) type = Bankswitch::Type::_2K;
|
||||
else if(size == 4096) type = Bankswitch::Type::_4K;
|
||||
else if(size == 8192) type = Bankswitch::Type::_F8;
|
||||
if(size <= 2_KB) type = Bankswitch::Type::_2K;
|
||||
else if(size == 4_KB) type = Bankswitch::Type::_4K;
|
||||
else if(size == 8_KB) type = Bankswitch::Type::_F8;
|
||||
else /* default */ type = Bankswitch::Type::_4K;
|
||||
|
||||
return createFromImage(slice, size, type, md5, settings);
|
||||
|
@ -238,7 +238,7 @@ CartDetector::createFromMultiCart(const ByteBuffer& image, uInt32& size,
|
|||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
unique_ptr<Cartridge>
|
||||
CartDetector::createFromImage(const ByteBuffer& image, uInt32 size, Bankswitch::Type type,
|
||||
CartDetector::createFromImage(const ByteBuffer& image, size_t size, Bankswitch::Type type,
|
||||
const string& md5, Settings& settings)
|
||||
{
|
||||
// We should know the cart's type by now so let's create it
|
||||
|
@ -336,7 +336,7 @@ CartDetector::createFromImage(const ByteBuffer& image, uInt32 size, Bankswitch::
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, uInt32 size)
|
||||
Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// Guess type based on size
|
||||
Bankswitch::Type type = Bankswitch::Type::_AUTO;
|
||||
|
@ -349,16 +349,16 @@ Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, uInt32 si
|
|||
{
|
||||
type = Bankswitch::Type::_AR;
|
||||
}
|
||||
else if(size < 2048) // Sub2K images
|
||||
else if(size < 2_KB) // Sub2K images
|
||||
{
|
||||
type = Bankswitch::Type::_2K;
|
||||
}
|
||||
else if((size == 2048) ||
|
||||
(size == 4096 && memcmp(image.get(), image.get() + 2048, 2048) == 0))
|
||||
else if((size == 2_KB) ||
|
||||
(size == 4_KB && std::memcmp(image.get(), image.get() + 2_KB, 2_KB) == 0))
|
||||
{
|
||||
type = isProbablyCV(image, size) ? Bankswitch::Type::_CV : Bankswitch::Type::_2K;
|
||||
}
|
||||
else if(size == 4096)
|
||||
else if(size == 4_KB)
|
||||
{
|
||||
if(isProbablyCV(image, size))
|
||||
type = Bankswitch::Type::_CV;
|
||||
|
@ -367,7 +367,7 @@ Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, uInt32 si
|
|||
else
|
||||
type = Bankswitch::Type::_4K;
|
||||
}
|
||||
else if(size == 8*1024) // 8K
|
||||
else if(size == 8_KB)
|
||||
{
|
||||
// First check for *potential* F8
|
||||
uInt8 signature[2][3] = {
|
||||
|
@ -379,7 +379,7 @@ Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, uInt32 si
|
|||
|
||||
if(isProbablySC(image, size))
|
||||
type = Bankswitch::Type::_F8SC;
|
||||
else if(memcmp(image.get(), image.get() + 4096, 4096) == 0)
|
||||
else if(std::memcmp(image.get(), image.get() + 4_KB, 4_KB) == 0)
|
||||
type = Bankswitch::Type::_4K;
|
||||
else if(isProbablyE0(image, size))
|
||||
type = Bankswitch::Type::_E0;
|
||||
|
@ -398,7 +398,7 @@ Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, uInt32 si
|
|||
else
|
||||
type = Bankswitch::Type::_F8;
|
||||
}
|
||||
else if(size == 8*1024 + 3) // 8195 bytes (Experimental)
|
||||
else if(size == 8_KB + 3) // 8195 bytes (Experimental)
|
||||
{
|
||||
type = Bankswitch::Type::_WD;
|
||||
}
|
||||
|
@ -406,11 +406,11 @@ Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, uInt32 si
|
|||
{
|
||||
type = Bankswitch::Type::_DPC;
|
||||
}
|
||||
else if(size == 12*1024) // 12K
|
||||
else if(size == 12_KB)
|
||||
{
|
||||
type = Bankswitch::Type::_FA;
|
||||
}
|
||||
else if(size == 16*1024) // 16K
|
||||
else if(size == 16_KB)
|
||||
{
|
||||
if(isProbablySC(image, size))
|
||||
type = Bankswitch::Type::_F6SC;
|
||||
|
@ -425,18 +425,18 @@ Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, uInt32 si
|
|||
else
|
||||
type = Bankswitch::Type::_F6;
|
||||
}
|
||||
else if(size == 24*1024 || size == 28*1024) // 24K & 28K
|
||||
else if(size == 24_KB || size == 28_KB)
|
||||
{
|
||||
type = Bankswitch::Type::_FA2;
|
||||
}
|
||||
else if(size == 29*1024) // 29K
|
||||
else if(size == 29_KB)
|
||||
{
|
||||
if(isProbablyARM(image, size))
|
||||
type = Bankswitch::Type::_FA2;
|
||||
else /*if(isProbablyDPCplus(image, size))*/
|
||||
type = Bankswitch::Type::_DPCP;
|
||||
}
|
||||
else if(size == 32*1024) // 32K
|
||||
else if(size == 32_KB)
|
||||
{
|
||||
if (isProbablyCTY(image, size))
|
||||
type = Bankswitch::Type::_CTY;
|
||||
|
@ -457,14 +457,14 @@ Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, uInt32 si
|
|||
else
|
||||
type = Bankswitch::Type::_F4;
|
||||
}
|
||||
else if(size == 60*1024) // 60K
|
||||
else if(size == 60_KB)
|
||||
{
|
||||
if(isProbablyCTY(image, size))
|
||||
type = Bankswitch::Type::_CTY;
|
||||
else
|
||||
type = Bankswitch::Type::_F4;
|
||||
}
|
||||
else if(size == 64*1024) // 64K
|
||||
else if(size == 64_KB)
|
||||
{
|
||||
if(isProbably3E(image, size))
|
||||
type = Bankswitch::Type::_3E;
|
||||
|
@ -479,7 +479,7 @@ Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, uInt32 si
|
|||
else
|
||||
type = Bankswitch::Type::_F0;
|
||||
}
|
||||
else if(size == 128*1024) // 128K
|
||||
else if(size == 128_KB)
|
||||
{
|
||||
if(isProbably3E(image, size))
|
||||
type = Bankswitch::Type::_3E;
|
||||
|
@ -492,7 +492,7 @@ Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, uInt32 si
|
|||
else if(isProbablySB(image, size))
|
||||
type = Bankswitch::Type::_SB;
|
||||
}
|
||||
else if(size == 256*1024) // 256K
|
||||
else if(size == 256_KB)
|
||||
{
|
||||
if(isProbably3E(image, size))
|
||||
type = Bankswitch::Type::_3E;
|
||||
|
@ -525,7 +525,7 @@ Bankswitch::Type CartDetector::autodetectType(const ByteBuffer& image, uInt32 si
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::searchForBytes(const uInt8* image, uInt32 imagesize,
|
||||
bool CartDetector::searchForBytes(const uInt8* image, size_t imagesize,
|
||||
const uInt8* signature, uInt32 sigsize,
|
||||
uInt32 minhits)
|
||||
{
|
||||
|
@ -553,24 +553,24 @@ bool CartDetector::searchForBytes(const uInt8* image, uInt32 imagesize,
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablySC(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablySC(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// We assume a Superchip cart repeats the first 128 bytes for the second
|
||||
// 128 bytes in the RAM area, which is the first 256 bytes of each 4K bank
|
||||
const uInt8* ptr = image.get();
|
||||
while(size)
|
||||
{
|
||||
if(memcmp(ptr, ptr + 128, 128) != 0)
|
||||
if(std::memcmp(ptr, ptr + 128, 128) != 0)
|
||||
return false;
|
||||
|
||||
ptr += 4096;
|
||||
size -= 4096;
|
||||
ptr += 4_KB;
|
||||
size -= 4_KB;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyARM(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyARM(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// ARM code contains the following 'loader' patterns in the first 1K
|
||||
// Thanks to Thomas Jentzsch of AtariAge for this advice
|
||||
|
@ -578,14 +578,14 @@ bool CartDetector::isProbablyARM(const ByteBuffer& image, uInt32 size)
|
|||
{ 0xA0, 0xC1, 0x1F, 0xE0 },
|
||||
{ 0x00, 0x80, 0x02, 0xE0 }
|
||||
};
|
||||
if(searchForBytes(image.get(), std::min(size, 1024u), signature[0], 4, 1))
|
||||
if(searchForBytes(image.get(), std::min<size_t>(size, 1_KB), signature[0], 4, 1))
|
||||
return true;
|
||||
else
|
||||
return searchForBytes(image.get(), std::min(size, 1024u), signature[1], 4, 1);
|
||||
return searchForBytes(image.get(), std::min<size_t>(size, 1_KB), signature[1], 4, 1);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbably0840(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbably0840(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// 0840 cart bankswitching is triggered by accessing addresses 0x0800
|
||||
// or 0x0840 at least twice
|
||||
|
@ -610,7 +610,7 @@ bool CartDetector::isProbably0840(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbably3E(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbably3E(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// 3E cart bankswitching is triggered by storing the bank number
|
||||
// in address 3E using 'STA $3E', commonly followed by an
|
||||
|
@ -620,7 +620,7 @@ bool CartDetector::isProbably3E(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbably3EPlus(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbably3EPlus(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// 3E+ cart is identified key 'TJ3E' in the ROM
|
||||
uInt8 tj3e[] = { 'T', 'J', '3', 'E' };
|
||||
|
@ -628,7 +628,7 @@ bool CartDetector::isProbably3EPlus(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbably3F(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbably3F(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// 3F cart bankswitching is triggered by storing the bank number
|
||||
// in address 3F using 'STA $3F'
|
||||
|
@ -639,7 +639,7 @@ bool CartDetector::isProbably3F(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbably4A50(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbably4A50(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// 4A50 carts store address $4A50 at the NMI vector, which
|
||||
// in this scheme is always in the last page of ROM at
|
||||
|
@ -657,7 +657,7 @@ bool CartDetector::isProbably4A50(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbably4KSC(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbably4KSC(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// We check if the first 256 bytes are identical *and* if there's
|
||||
// an "SC" signature for one of our larger SC types at 1FFA.
|
||||
|
@ -674,7 +674,7 @@ bool CartDetector::isProbably4KSC(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyBF(const ByteBuffer& image, uInt32 size,
|
||||
bool CartDetector::isProbablyBF(const ByteBuffer& image, size_t size,
|
||||
Bankswitch::Type& type)
|
||||
{
|
||||
// BF carts store strings 'BFBF' and 'BFSC' starting at address $FFF8
|
||||
|
@ -696,7 +696,7 @@ bool CartDetector::isProbablyBF(const ByteBuffer& image, uInt32 size,
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyBUS(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyBUS(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// BUS ARM code has 2 occurrences of the string BUS
|
||||
// Note: all Harmony/Melody custom drivers also contain the value
|
||||
|
@ -706,7 +706,7 @@ bool CartDetector::isProbablyBUS(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyCDF(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyCDF(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// CDF ARM code has 3 occurrences of the string CDF
|
||||
// Note: all Harmony/Melody custom drivers also contain the value
|
||||
|
@ -716,14 +716,14 @@ bool CartDetector::isProbablyCDF(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyCTY(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyCTY(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
uInt8 lenin[] = { 'L', 'E', 'N', 'I', 'N' };
|
||||
return searchForBytes(image.get(), size, lenin, 5, 1);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyCV(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyCV(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// CV RAM access occurs at addresses $f3ff and $f400
|
||||
// These signatures are attributed to the MESS project
|
||||
|
@ -738,7 +738,7 @@ bool CartDetector::isProbablyCV(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyCVPlus(const ByteBuffer& image, uInt32)
|
||||
bool CartDetector::isProbablyCVPlus(const ByteBuffer& image, size_t)
|
||||
{
|
||||
// CV+ cart is identified key 'commavidplus' @ $04 in the ROM
|
||||
// We inspect only this area to speed up the search
|
||||
|
@ -748,7 +748,7 @@ bool CartDetector::isProbablyCVPlus(const ByteBuffer& image, uInt32)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyDASH(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyDASH(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// DASH cart is identified key 'TJAD' in the ROM
|
||||
uInt8 tjad[] = { 'T', 'J', 'A', 'D' };
|
||||
|
@ -756,7 +756,7 @@ bool CartDetector::isProbablyDASH(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyDF(const ByteBuffer& image, uInt32 size,
|
||||
bool CartDetector::isProbablyDF(const ByteBuffer& image, size_t size,
|
||||
Bankswitch::Type& type)
|
||||
{
|
||||
|
||||
|
@ -779,7 +779,7 @@ bool CartDetector::isProbablyDF(const ByteBuffer& image, uInt32 size,
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyDPCplus(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyDPCplus(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// DPC+ ARM code has 2 occurrences of the string DPC+
|
||||
// Note: all Harmony/Melody custom drivers also contain the value
|
||||
|
@ -789,7 +789,7 @@ bool CartDetector::isProbablyDPCplus(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyE0(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyE0(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// E0 cart bankswitching is triggered by accessing addresses
|
||||
// $FE0 to $FF9 using absolute non-indexed addressing
|
||||
|
@ -815,7 +815,7 @@ bool CartDetector::isProbablyE0(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyE7(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyE7(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// E7 cart bankswitching is triggered by accessing addresses
|
||||
// $FE0 to $FE6 using absolute non-indexed addressing
|
||||
|
@ -840,7 +840,7 @@ bool CartDetector::isProbablyE7(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyE78K(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyE78K(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// E78K cart bankswitching is triggered by accessing addresses
|
||||
// $FE4 to $FE6 using absolute non-indexed addressing
|
||||
|
@ -859,7 +859,7 @@ bool CartDetector::isProbablyE78K(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyEF(const ByteBuffer& image, uInt32 size,
|
||||
bool CartDetector::isProbablyEF(const ByteBuffer& image, size_t size,
|
||||
Bankswitch::Type& type)
|
||||
{
|
||||
// Newer EF carts store strings 'EFEF' and 'EFSC' starting at address $FFF8
|
||||
|
@ -908,7 +908,7 @@ bool CartDetector::isProbablyEF(const ByteBuffer& image, uInt32 size,
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyFA2(const ByteBuffer& image, uInt32)
|
||||
bool CartDetector::isProbablyFA2(const ByteBuffer& image, size_t)
|
||||
{
|
||||
// This currently tests only the 32K version of FA2; the 24 and 28K
|
||||
// versions are easy, in that they're the only possibility with those
|
||||
|
@ -923,7 +923,7 @@ bool CartDetector::isProbablyFA2(const ByteBuffer& image, uInt32)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyFE(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyFE(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// FE bankswitching is very weird, but always seems to include a
|
||||
// 'JSR $xxxx'
|
||||
|
@ -942,15 +942,15 @@ bool CartDetector::isProbablyFE(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyMDM(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyMDM(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// MDM cart is identified key 'MDMC' in the first 8K of ROM
|
||||
uInt8 mdmc[] = { 'M', 'D', 'M', 'C' };
|
||||
return searchForBytes(image.get(), std::min(size, 8192u), mdmc, 4, 1);
|
||||
return searchForBytes(image.get(), std::min<size_t>(size, 8_KB), mdmc, 4, 1);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablySB(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablySB(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// SB cart bankswitching switches banks by accessing address 0x0800
|
||||
uInt8 signature[2][3] = {
|
||||
|
@ -964,7 +964,7 @@ bool CartDetector::isProbablySB(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyUA(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyUA(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// UA cart bankswitching switches to bank 1 by accessing address 0x240
|
||||
// using 'STA $240' or 'LDA $240'
|
||||
|
@ -986,7 +986,7 @@ bool CartDetector::isProbablyUA(const ByteBuffer& image, uInt32 size)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool CartDetector::isProbablyX07(const ByteBuffer& image, uInt32 size)
|
||||
bool CartDetector::isProbablyX07(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// X07 bankswitching switches to bank 0, 1, 2, etc by accessing address 0x08xd
|
||||
uInt8 signature[6][3] = {
|
||||
|
|
|
@ -46,7 +46,7 @@ class CartDetector
|
|||
@return Pointer to the new cartridge object allocated on the heap
|
||||
*/
|
||||
static unique_ptr<Cartridge> create(const FilesystemNode& file,
|
||||
const ByteBuffer& image, uInt32 size, string& md5,
|
||||
const ByteBuffer& image, size_t size, string& md5,
|
||||
const string& dtype, Settings& settings);
|
||||
|
||||
/**
|
||||
|
@ -57,7 +57,7 @@ class CartDetector
|
|||
|
||||
@return The "best guess" for the cartridge type
|
||||
*/
|
||||
static Bankswitch::Type autodetectType(const ByteBuffer& image, uInt32 size);
|
||||
static Bankswitch::Type autodetectType(const ByteBuffer& image, size_t size);
|
||||
|
||||
private:
|
||||
/**
|
||||
|
@ -75,7 +75,7 @@ class CartDetector
|
|||
@return Pointer to the new cartridge object allocated on the heap
|
||||
*/
|
||||
static unique_ptr<Cartridge>
|
||||
createFromMultiCart(const ByteBuffer& image, uInt32& size,
|
||||
createFromMultiCart(const ByteBuffer& image, size_t& size,
|
||||
uInt32 numroms, string& md5, Bankswitch::Type type, string& id,
|
||||
Settings& settings);
|
||||
|
||||
|
@ -91,7 +91,7 @@ class CartDetector
|
|||
@return Pointer to the new cartridge object allocated on the heap
|
||||
*/
|
||||
static unique_ptr<Cartridge>
|
||||
createFromImage(const ByteBuffer& image, uInt32 size, Bankswitch::Type type,
|
||||
createFromImage(const ByteBuffer& image, size_t size, Bankswitch::Type type,
|
||||
const string& md5, Settings& settings);
|
||||
|
||||
/**
|
||||
|
@ -105,7 +105,7 @@ class CartDetector
|
|||
|
||||
@return True if the signature was found at least 'minhits' time, else false
|
||||
*/
|
||||
static bool searchForBytes(const uInt8* image, uInt32 imagesize,
|
||||
static bool searchForBytes(const uInt8* image, size_t imagesize,
|
||||
const uInt8* signature, uInt32 sigsize,
|
||||
uInt32 minhits);
|
||||
|
||||
|
@ -113,142 +113,142 @@ class CartDetector
|
|||
Returns true if the image is probably a SuperChip (128 bytes RAM)
|
||||
Note: should be called only on ROMs with size multiple of 4K
|
||||
*/
|
||||
static bool isProbablySC(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablySC(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image probably contains ARM code in the first 1K
|
||||
*/
|
||||
static bool isProbablyARM(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyARM(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a 0840 bankswitching cartridge
|
||||
*/
|
||||
static bool isProbably0840(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbably0840(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a 3E bankswitching cartridge
|
||||
*/
|
||||
static bool isProbably3E(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbably3E(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a 3E+ bankswitching cartridge
|
||||
*/
|
||||
static bool isProbably3EPlus(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbably3EPlus(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a 3F bankswitching cartridge
|
||||
*/
|
||||
static bool isProbably3F(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbably3F(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a 4A50 bankswitching cartridge
|
||||
*/
|
||||
static bool isProbably4A50(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbably4A50(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a 4K SuperChip (128 bytes RAM)
|
||||
*/
|
||||
static bool isProbably4KSC(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbably4KSC(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a BF/BFSC bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyBF(const ByteBuffer& image, uInt32 size, Bankswitch::Type& type);
|
||||
static bool isProbablyBF(const ByteBuffer& image, size_t size, Bankswitch::Type& type);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a BUS bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyBUS(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyBUS(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a CDF bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyCDF(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyCDF(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a CTY bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyCTY(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyCTY(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a CV bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyCV(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyCV(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a CV+ bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyCVPlus(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyCVPlus(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a DASH bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyDASH(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyDASH(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a DF/DFSC bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyDF(const ByteBuffer& image, uInt32 size, Bankswitch::Type& type);
|
||||
static bool isProbablyDF(const ByteBuffer& image, size_t size, Bankswitch::Type& type);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a DPC+ bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyDPCplus(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyDPCplus(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a E0 bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyE0(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyE0(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a E7 bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyE7(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyE7(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a E78K bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyE78K(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyE78K(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably an EF/EFSC bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyEF(const ByteBuffer& image, uInt32 size, Bankswitch::Type& type);
|
||||
static bool isProbablyEF(const ByteBuffer& image, size_t size, Bankswitch::Type& type);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably an F6 bankswitching cartridge
|
||||
*/
|
||||
//static bool isProbablyF6(const ByteBuffer& image, uInt32 size);
|
||||
//static bool isProbablyF6(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably an FA2 bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyFA2(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyFA2(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably an FE bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyFE(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyFE(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a MDM bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyMDM(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyMDM(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a SB bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablySB(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablySB(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably a UA bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyUA(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyUA(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Returns true if the image is probably an X07 bankswitching cartridge
|
||||
*/
|
||||
static bool isProbablyX07(const ByteBuffer& image, uInt32 size);
|
||||
static bool isProbablyX07(const ByteBuffer& image, size_t size);
|
||||
|
||||
private:
|
||||
// Following constructors and assignment operators not supported
|
||||
|
|
|
@ -19,12 +19,12 @@
|
|||
#include "CartE0.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeE0::CartridgeE0(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeE0::CartridgeE0(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -201,7 +201,7 @@ bool CartridgeE0::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeE0::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeE0::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -54,7 +54,7 @@ class CartridgeE0 : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeE0(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeE0(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeE0() = default;
|
||||
|
||||
|
@ -100,7 +100,7 @@ class CartridgeE0 : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "CartE7.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeE7::CartridgeE7(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeE7::CartridgeE7(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: CartridgeMNetwork(image, size, md5, settings)
|
||||
{
|
||||
|
|
|
@ -43,7 +43,7 @@ class CartridgeE7 : public CartridgeMNetwork
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeE7(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeE7(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeE7() = default;
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "CartE78K.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeE78K::CartridgeE78K(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeE78K::CartridgeE78K(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: CartridgeMNetwork(image, size, md5, settings)
|
||||
{
|
||||
|
|
|
@ -41,7 +41,7 @@ class CartridgeE78K : public CartridgeMNetwork
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeE78K(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeE78K(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeE78K() = default;
|
||||
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "CartEF.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeEF::CartridgeEF(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeEF::CartridgeEF(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ bool CartridgeEF::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeEF::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeEF::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -46,7 +46,7 @@ class CartridgeEF : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeEF(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeEF(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeEF() = default;
|
||||
|
||||
|
@ -98,7 +98,7 @@ class CartridgeEF : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "CartEFSC.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeEFSC::CartridgeEFSC(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeEFSC::CartridgeEFSC(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ bool CartridgeEFSC::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeEFSC::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeEFSC::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -47,7 +47,7 @@ class CartridgeEFSC : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeEFSC(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeEFSC(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeEFSC() = default;
|
||||
|
||||
|
@ -99,7 +99,7 @@ class CartridgeEFSC : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "CartF0.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeF0::CartridgeF0(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeF0::CartridgeF0(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -128,7 +128,7 @@ bool CartridgeF0::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeF0::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeF0::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -46,7 +46,7 @@ class CartridgeF0 : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeF0(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeF0(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeF0() = default;
|
||||
|
||||
|
@ -98,7 +98,7 @@ class CartridgeF0 : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -20,13 +20,13 @@
|
|||
#include "CartF4.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeF4::CartridgeF4(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeF4::CartridgeF4(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -124,7 +124,7 @@ bool CartridgeF4::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeF4::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeF4::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -45,7 +45,7 @@ class CartridgeF4 : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeF4(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeF4(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeF4() = default;
|
||||
|
||||
|
@ -97,7 +97,7 @@ class CartridgeF4 : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "CartF4SC.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeF4SC::CartridgeF4SC(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeF4SC::CartridgeF4SC(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ bool CartridgeF4SC::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeF4SC::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeF4SC::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -46,7 +46,7 @@ class CartridgeF4SC : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeF4SC(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeF4SC(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeF4SC() = default;
|
||||
|
||||
|
@ -98,7 +98,7 @@ class CartridgeF4SC : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "CartF6.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeF6::CartridgeF6(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeF6::CartridgeF6(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ bool CartridgeF6::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeF6::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeF6::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -45,7 +45,7 @@ class CartridgeF6 : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeF6(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeF6(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeF6() = default;
|
||||
|
||||
|
@ -97,7 +97,7 @@ class CartridgeF6 : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "CartF6SC.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeF6SC::CartridgeF6SC(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeF6SC::CartridgeF6SC(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -214,7 +214,7 @@ bool CartridgeF6SC::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeF6SC::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeF6SC::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -46,7 +46,7 @@ class CartridgeF6SC : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeF6SC(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeF6SC(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeF6SC() = default;
|
||||
|
||||
|
@ -98,7 +98,7 @@ class CartridgeF6SC : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "CartF8.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeF8::CartridgeF8(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeF8::CartridgeF8(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -145,7 +145,7 @@ bool CartridgeF8::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeF8::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeF8::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -45,7 +45,7 @@ class CartridgeF8 : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeF8(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeF8(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeF8() = default;
|
||||
|
||||
|
@ -97,7 +97,7 @@ class CartridgeF8 : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "CartF8SC.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeF8SC::CartridgeF8SC(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeF8SC::CartridgeF8SC(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -194,7 +194,7 @@ bool CartridgeF8SC::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeF8SC::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeF8SC::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -46,7 +46,7 @@ class CartridgeF8SC : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeF8SC(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeF8SC(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeF8SC() = default;
|
||||
|
||||
|
@ -98,7 +98,7 @@ class CartridgeF8SC : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,13 +19,13 @@
|
|||
#include "CartFA.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeFA::CartridgeFA(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeFA::CartridgeFA(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -204,7 +204,7 @@ bool CartridgeFA::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeFA::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeFA::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -46,7 +46,7 @@ class CartridgeFA : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeFA(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeFA(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeFA() = default;
|
||||
|
||||
|
@ -98,7 +98,7 @@ class CartridgeFA : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
#include "CartFA2.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeFA2::CartridgeFA2(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeFA2::CartridgeFA2(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(28 * 1024),
|
||||
mySize(28_KB),
|
||||
myRamAccessTimeout(0),
|
||||
myBankOffset(0)
|
||||
{
|
||||
|
@ -249,7 +249,7 @@ uInt16 CartridgeFA2::getBank(uInt16) const
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt16 CartridgeFA2::bankCount() const
|
||||
{
|
||||
return (mySize / 4_KB);
|
||||
return uInt16(mySize / 4_KB);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -271,7 +271,7 @@ bool CartridgeFA2::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeFA2::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeFA2::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myImage.data();
|
||||
|
|
|
@ -58,7 +58,7 @@ class CartridgeFA2 : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the settings object
|
||||
*/
|
||||
CartridgeFA2(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeFA2(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeFA2() = default;
|
||||
|
||||
|
@ -110,7 +110,7 @@ class CartridgeFA2 : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -196,7 +196,7 @@ class CartridgeFA2 : public Cartridge
|
|||
std::array<uInt8, 28_KB> myImage;
|
||||
|
||||
// Actual usable size of the ROM image
|
||||
uInt32 mySize;
|
||||
size_t mySize;
|
||||
|
||||
// The 256 bytes of RAM on the cartridge
|
||||
std::array<uInt8, 256> myRAM;
|
||||
|
|
|
@ -20,14 +20,14 @@
|
|||
#include "CartFE.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeFE::CartridgeFE(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeFE::CartridgeFE(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
myBankOffset(0),
|
||||
myLastAccessWasFE(false)
|
||||
{
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min<uInt32>(myImage.size(), size), myImage.begin());
|
||||
std::copy_n(image.get(), std::min(myImage.size(), size), myImage.begin());
|
||||
createCodeAccessBase(myImage.size());
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ bool CartridgeFE::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeFE::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeFE::getImage(size_t& size) const
|
||||
{
|
||||
size = myImage.size();
|
||||
return myImage.data();
|
||||
|
|
|
@ -88,7 +88,7 @@ class CartridgeFE : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeFE(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeFE(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeFE() = default;
|
||||
|
||||
|
@ -140,7 +140,7 @@ class CartridgeFE : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "CartMDM.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeMDM::CartridgeMDM(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeMDM::CartridgeMDM(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(size),
|
||||
|
@ -132,7 +132,7 @@ uInt16 CartridgeMDM::getBank(uInt16) const
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt16 CartridgeMDM::bankCount() const
|
||||
{
|
||||
return mySize >> 12;
|
||||
return uInt16(mySize >> 12);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -143,7 +143,7 @@ bool CartridgeMDM::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeMDM::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeMDM::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myImage.get();
|
||||
|
|
|
@ -57,7 +57,7 @@ class CartridgeMDM : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeMDM(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeMDM(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeMDM() = default;
|
||||
|
||||
|
@ -109,7 +109,7 @@ class CartridgeMDM : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -168,7 +168,7 @@ class CartridgeMDM : public Cartridge
|
|||
ByteBuffer myImage;
|
||||
|
||||
// Size of the ROM image
|
||||
uInt32 mySize;
|
||||
size_t mySize;
|
||||
|
||||
// Previous Device's page access
|
||||
std::array<System::PageAccess, 8> myHotSpotPageAccess;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "CartMNetwork.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeMNetwork::CartridgeMNetwork(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeMNetwork::CartridgeMNetwork(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(size),
|
||||
|
@ -29,13 +29,13 @@ CartridgeMNetwork::CartridgeMNetwork(const ByteBuffer& image, uInt32 size,
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void CartridgeMNetwork::initialize(const ByteBuffer& image, uInt32 size)
|
||||
void CartridgeMNetwork::initialize(const ByteBuffer& image, size_t size)
|
||||
{
|
||||
// Allocate array for the ROM image
|
||||
myImage = make_unique<uInt8[]>(size);
|
||||
|
||||
// Copy the ROM image into my buffer
|
||||
std::copy_n(image.get(), std::min(romSize(), size), myImage.get());
|
||||
std::copy_n(image.get(), std::min<size_t>(romSize(), size), myImage.get());
|
||||
createCodeAccessBase(romSize() + myRAM.size());
|
||||
|
||||
myRAMSlice = bankCount() - 1;
|
||||
|
@ -232,7 +232,7 @@ bool CartridgeMNetwork::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeMNetwork::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeMNetwork::getImage(size_t& size) const
|
||||
{
|
||||
size = bankCount() * BANK_SIZE;
|
||||
return myImage.get();
|
||||
|
@ -281,11 +281,11 @@ bool CartridgeMNetwork::load(Serializer& in)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt16 CartridgeMNetwork::bankCount() const
|
||||
{
|
||||
return mySize >> 11;
|
||||
return uInt16(mySize >> 11);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt32 CartridgeMNetwork::romSize() const
|
||||
uInt16 CartridgeMNetwork::romSize() const
|
||||
{
|
||||
return bankCount() * BANK_SIZE;
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ class CartridgeMNetwork : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeMNetwork(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeMNetwork(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeMNetwork() = default;
|
||||
|
||||
|
@ -125,7 +125,7 @@ class CartridgeMNetwork : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -164,7 +164,7 @@ class CartridgeMNetwork : public Cartridge
|
|||
/**
|
||||
Class initialization
|
||||
*/
|
||||
void initialize(const ByteBuffer& image, uInt32 size);
|
||||
void initialize(const ByteBuffer& image, size_t size);
|
||||
|
||||
/**
|
||||
Install pages for the specified 256 byte bank of RAM
|
||||
|
@ -185,7 +185,7 @@ class CartridgeMNetwork : public Cartridge
|
|||
/**
|
||||
Query the size of the BS type.
|
||||
*/
|
||||
uInt32 romSize() const;
|
||||
uInt16 romSize() const;
|
||||
|
||||
/**
|
||||
Check hotspots and switch bank if triggered.
|
||||
|
@ -202,7 +202,7 @@ class CartridgeMNetwork : public Cartridge
|
|||
//uInt8 myImage[BANK_SIZE * 8];
|
||||
|
||||
// Size of the ROM image
|
||||
uInt32 mySize;
|
||||
size_t mySize;
|
||||
|
||||
// The 2K of RAM
|
||||
std::array<uInt8, RAM_SIZE> myRAM;
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "CartSB.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
CartridgeSB::CartridgeSB(const ByteBuffer& image, uInt32 size,
|
||||
CartridgeSB::CartridgeSB(const ByteBuffer& image, size_t size,
|
||||
const string& md5, const Settings& settings)
|
||||
: Cartridge(settings, md5),
|
||||
mySize(size),
|
||||
|
@ -137,7 +137,7 @@ uInt16 CartridgeSB::getBank(uInt16) const
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt16 CartridgeSB::bankCount() const
|
||||
{
|
||||
return mySize >> 12;
|
||||
return uInt16(mySize >> 12);
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -148,7 +148,7 @@ bool CartridgeSB::patch(uInt16 address, uInt8 value)
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
const uInt8* CartridgeSB::getImage(uInt32& size) const
|
||||
const uInt8* CartridgeSB::getImage(size_t& size) const
|
||||
{
|
||||
size = mySize;
|
||||
return myImage.get();
|
||||
|
|
|
@ -46,7 +46,7 @@ class CartridgeSB : public Cartridge
|
|||
@param md5 The md5sum of the ROM image
|
||||
@param settings A reference to the various settings (read-only)
|
||||
*/
|
||||
CartridgeSB(const ByteBuffer& image, uInt32 size, const string& md5,
|
||||
CartridgeSB(const ByteBuffer& image, size_t size, const string& md5,
|
||||
const Settings& settings);
|
||||
virtual ~CartridgeSB() = default;
|
||||
|
||||
|
@ -98,7 +98,7 @@ class CartridgeSB : public Cartridge
|
|||
@param size Set to the size of the internal ROM image data
|
||||
@return A pointer to the internal ROM image data
|
||||
*/
|
||||
const uInt8* getImage(uInt32& size) const override;
|
||||
const uInt8* getImage(size_t& size) const override;
|
||||
|
||||
/**
|
||||
Save the current state of this cart to the given Serializer.
|
||||
|
@ -155,7 +155,7 @@ class CartridgeSB : public Cartridge
|
|||
private:
|
||||
// The 128-256K ROM image and size of the cartridge
|
||||
ByteBuffer myImage;
|
||||
uInt32 mySize;
|
||||
size_t mySize;
|
||||
|
||||
// Indicates the offset into the ROM image (aligns to current bank)
|
||||
uInt32 myBankOffset;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue