Thumbulator::fetch16 can fetch only ROM when optimized

This commit is contained in:
thrust26 2019-02-24 14:39:52 +01:00
parent 6f94174989
commit 28d1113523
2 changed files with 7 additions and 8 deletions

View File

@ -184,32 +184,31 @@ uInt32 Thumbulator::fetch16(uInt32 addr)
++fetches; ++fetches;
#endif #endif
#ifndef UNSAFE_OPTIMIZATIONS
uInt32 data; uInt32 data;
switch(addr & 0xF0000000) switch(addr & 0xF0000000)
{ {
case 0x00000000: //ROM case 0x00000000: //ROM
addr &= ROMADDMASK; addr &= ROMADDMASK;
#ifndef UNSAFE_OPTIMIZATIONS
if(addr < 0x50) if(addr < 0x50)
fatalError("fetch16", addr, "abort"); fatalError("fetch16", addr, "abort");
#endif
addr >>= 1; addr >>= 1;
data = CONV_RAMROM(rom[addr]); data = CONV_RAMROM(rom[addr]);
DO_DBUG(statusMsg << "fetch16(" << Base::HEX8 << addr << ")=" << Base::HEX4 << data << endl); DO_DBUG(statusMsg << "fetch16(" << Base::HEX8 << addr << ")=" << Base::HEX4 << data << endl);
return data; return data;
#ifndef UNSAFE_OPTIMIZATIONS
case 0x40000000: //RAM case 0x40000000: //RAM
#else
default:
#endif
addr &= RAMADDMASK; addr &= RAMADDMASK;
addr >>= 1; addr >>= 1;
data=CONV_RAMROM(ram[addr]); data=CONV_RAMROM(ram[addr]);
DO_DBUG(statusMsg << "fetch16(" << Base::HEX8 << addr << ")=" << Base::HEX4 << data << endl); DO_DBUG(statusMsg << "fetch16(" << Base::HEX8 << addr << ")=" << Base::HEX4 << data << endl);
return data; return data;
} }
#ifndef UNSAFE_OPTIMIZATIONS
return fatalError("fetch16", addr, "abort"); return fatalError("fetch16", addr, "abort");
#else
addr &= ROMADDMASK;
addr >>= 1;
return CONV_RAMROM(rom[addr]);
#endif #endif
} }

View File

@ -344,7 +344,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<DisableSpecificWarnings>4100;4127;4146;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings> <DisableSpecificWarnings>4100;4127;4146;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<CompileAs>CompileAsCpp</CompileAs> <CompileAs>CompileAsCpp</CompileAs>
<AssemblerOutput>NoListing</AssemblerOutput> <AssemblerOutput>All</AssemblerOutput>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>SDL2.lib;SDL2main.lib;%(AdditionalDependencies)</AdditionalDependencies>