Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
telecomadm1145 committed Aug 6, 2024
1 parent 5f3ecd4 commit 7693ac4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CasioEmuMsvc/Chipset/MMU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ namespace casioemu {
// return (((uint16_t)emulator.chipset.flash_data[off + segment_offset + 1]) << 8) | emulator.chipset.flash_data[off + segment_offset];
// }
// Read from rom data?

auto rom = emulator.chipset.rom_data.data();
auto rom_size = emulator.chipset.rom_data.size();
switch (emulator.hardware_id) {
Expand Down Expand Up @@ -168,6 +169,11 @@ namespace casioemu {
// if (offset >= (1 << 24))
// PANIC("offset doesn't fit 24 bits\n");

if (offset == 0x60721) {
std::cout << data;
return;
}

MemoryEventArgs mea{};
mea.offset = offset;
mea.value = data;
Expand Down
9 changes: 4 additions & 5 deletions CasioEmuMsvc/Peripheral/ROMWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ namespace casioemu {
void Initialise();
};
static void SetupROMRegion(MMURegion& region, size_t region_base, size_t size, size_t rom_base, bool strict_memory, Emulator& emulator, std::string description = {}) {
if (rom_base + size > emulator.chipset.rom_data.size()) {
printf("[ROMWindow][Warn] Invalid ROM region: base %zx, size %zx\n", rom_base, size);
return;
// emulator.chipset.rom_data.resize(rom_base + size);
}
uint8_t* data = emulator.chipset.rom_data.data();
auto offset = (long long)rom_base - (long long)region_base;
if (description.empty())
Expand Down Expand Up @@ -56,13 +51,15 @@ namespace casioemu {
switch (emulator.hardware_id) { // Initializer list cannot be used with move-only type: https://stackoverflow.com/q/8468774
case HW_ES_PLUS:
regions.reset(new MMURegion[3]);
emulator.chipset.rom_data.resize(0x20000, 0);
SetupROMRegion(regions[0], 0x00000, 0x08000, 0x00000, strict_memory, emulator);
SetupROMRegion(regions[1], 0x10000, 0x10000, 0x10000, strict_memory, emulator);
SetupROMRegion(regions[2], 0x80000, 0x10000, 0x00000, strict_memory, emulator);
break;

case HW_CLASSWIZ:
regions.reset(new MMURegion[5]);
emulator.chipset.rom_data.resize(0x40000, 0);
SetupROMRegion(regions[0], 0x00000, 0x0D000, 0x00000, strict_memory, emulator);
SetupROMRegion(regions[1], 0x10000, 0x10000, 0x10000, strict_memory, emulator);
SetupROMRegion(regions[2], 0x20000, 0x10000, 0x20000, strict_memory, emulator);
Expand All @@ -71,6 +68,7 @@ namespace casioemu {
break;
case HW_CLASSWIZ_II:
regions.reset(new MMURegion[16]);
emulator.chipset.rom_data.resize(0x60000, 0);
SetupROMRegion(regions[0], 0x00000, 0x09000, 0x00000, strict_memory, emulator);
SetupROMRegion(regions[1], 0x10000, 0x10000, 0x10000, strict_memory, emulator);
SetupROMRegion(regions[2], 0x20000, 0x10000, 0x20000, strict_memory, emulator);
Expand Down Expand Up @@ -100,6 +98,7 @@ namespace casioemu {
break;
case HW_FX_5800P:
regions.reset(new MMURegion[2]);
emulator.chipset.rom_data.resize(0x20000, 0);
SetupROMRegion(regions[0], 0x00000, 0x8000, 0x00000, strict_memory, emulator);
SetupROMRegion(regions[1], 0x10000, 0x10000, 0x10000, strict_memory, emulator);
}
Expand Down

0 comments on commit 7693ac4

Please sign in to comment.