mirror of https://github.com/stella-emu/stella.git
Fix romSize overflow. Fixes DPC emulation with UNSAFE_OPTIMIZATIONS.
This commit is contained in:
parent
b1288f5059
commit
89c6b847e7
|
@ -53,7 +53,7 @@ using Common::Base;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt16 rom_size,
|
Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size,
|
||||||
const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack,
|
const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack,
|
||||||
bool traponfatal, Thumbulator::ConfigureFor configurefor,
|
bool traponfatal, Thumbulator::ConfigureFor configurefor,
|
||||||
Cartridge* cartridge)
|
Cartridge* cartridge)
|
||||||
|
@ -67,7 +67,7 @@ Thumbulator::Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt16 rom_size
|
||||||
configuration(configurefor),
|
configuration(configurefor),
|
||||||
myCartridge(cartridge)
|
myCartridge(cartridge)
|
||||||
{
|
{
|
||||||
for(uInt16 i = 0; i < romSize / 2; ++i)
|
for(uInt32 i = 0; i < romSize / 2; ++i)
|
||||||
decodedRom[i] = decodeInstructionWord(CONV_RAMROM(rom[i]));
|
decodedRom[i] = decodeInstructionWord(CONV_RAMROM(rom[i]));
|
||||||
|
|
||||||
setConsoleTiming(ConsoleTiming::ntsc);
|
setConsoleTiming(ConsoleTiming::ntsc);
|
||||||
|
|
|
@ -60,7 +60,7 @@ class Thumbulator
|
||||||
DPCplus // cartridges of type DPC+
|
DPCplus // cartridges of type DPC+
|
||||||
};
|
};
|
||||||
|
|
||||||
Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt16 rom_size,
|
Thumbulator(const uInt16* rom_ptr, uInt16* ram_ptr, uInt32 rom_size,
|
||||||
const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack,
|
const uInt32 c_base, const uInt32 c_start, const uInt32 c_stack,
|
||||||
bool traponfatal, Thumbulator::ConfigureFor configurefor,
|
bool traponfatal, Thumbulator::ConfigureFor configurefor,
|
||||||
Cartridge* cartridge);
|
Cartridge* cartridge);
|
||||||
|
@ -188,7 +188,7 @@ class Thumbulator
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const uInt16* rom{nullptr};
|
const uInt16* rom{nullptr};
|
||||||
uInt16 romSize{0};
|
uInt32 romSize{0};
|
||||||
uInt32 cBase{0};
|
uInt32 cBase{0};
|
||||||
uInt32 cStart{0};
|
uInt32 cStart{0};
|
||||||
uInt32 cStack{0};
|
uInt32 cStack{0};
|
||||||
|
|
Loading…
Reference in New Issue