diff --git a/include/interface/romtype.hpp b/include/interface/romtype.hpp index 8e90840b..3bc9ea1b 100644 --- a/include/interface/romtype.hpp +++ b/include/interface/romtype.hpp @@ -45,7 +45,7 @@ struct core_vma_info uint64_t size; void* backing_ram; bool readonly; - bool native_endian; + int endian; uint8_t (*iospace_rw)(uint64_t offset, uint8_t data, bool write); }; diff --git a/src/core/memorymanip.cpp b/src/core/memorymanip.cpp index b5e93f26..cb1f9b0f 100644 --- a/src/core/memorymanip.cpp +++ b/src/core/memorymanip.cpp @@ -92,7 +92,7 @@ void refresh_cart_mappings() throw(std::bad_alloc) if(i.iospace_rw) tmp = new iospace_region(i.name, i.base, i.size, i.iospace_rw); else - tmp = new memory_region_direct(i.name, i.base, i.native_endian ? 0 : -1, + tmp = new memory_region_direct(i.name, i.base, i.endian, reinterpret_cast(i.backing_ram), i.size, i.readonly); regions.push_back(tmp); tmp = NULL; diff --git a/src/emulation/bsnes-legacy/core.cpp b/src/emulation/bsnes-legacy/core.cpp index 77ac8e5e..a46833d2 100644 --- a/src/emulation/bsnes-legacy/core.cpp +++ b/src/emulation/bsnes-legacy/core.cpp @@ -491,7 +491,7 @@ namespace i.base = base; i.size = size; i.readonly = false; - i.native_endian = false; + i.endian = -1; i.iospace_rw = iospace_rw; inf.push_back(i); } @@ -507,7 +507,7 @@ namespace i.size = size; i.backing_ram = memory; i.readonly = readonly; - i.native_endian = native_endian; + i.endian = native_endian ? 0 : -1; i.iospace_rw = NULL; inf.push_back(i); } diff --git a/src/emulation/gambatte/core.cpp b/src/emulation/gambatte/core.cpp index db0374ca..dc5805df 100644 --- a/src/emulation/gambatte/core.cpp +++ b/src/emulation/gambatte/core.cpp @@ -198,7 +198,7 @@ namespace sram.base = 0x20000; sram.size = g.second; sram.backing_ram = g.first; - sram.native_endian = false; + sram.endian = -1; sram.readonly = false; sram.iospace_rw = NULL; @@ -207,7 +207,7 @@ namespace wram.base = 0; wram.size = g2.second; wram.backing_ram = g2.first; - wram.native_endian = false; + wram.endian = -1; wram.readonly = false; wram.iospace_rw = NULL; @@ -216,7 +216,7 @@ namespace vram.base = 0x10000; vram.size = g3.second; vram.backing_ram = g3.first; - vram.native_endian = false; + vram.endian = -1; vram.readonly = false; vram.iospace_rw = NULL; @@ -225,7 +225,7 @@ namespace ioamhram.base = 0x18000; ioamhram.size = g4.second; ioamhram.backing_ram = g4.first; - ioamhram.native_endian = false; + ioamhram.endian = -1; ioamhram.readonly = false; ioamhram.iospace_rw = NULL; @@ -233,7 +233,7 @@ namespace rom.base = 0x80000000; rom.size = romdata.size(); rom.backing_ram = (void*)&romdata[0]; - rom.native_endian = false; + rom.endian = -1; rom.readonly = true; rom.iospace_rw = NULL;