Skip to content

bug in E7 cartridge handling #37

@deater

Description

@deater

I found a bug while working on my "Myst" demake. It looks like the E7 cartridge handling code enables RAM when the proper memory location is accessed, but it never disables the RAM when ROM is swapped back in. This caused my game to crash after a few steps.

I have a patch that fixes things for me. I tried to attach it but github was giving me issues so I've included it inline here too. Thanks!

diff --git a/src/main/atari/cartridge/formats/Cartridge16K_E7.js b/src/main/atari/cartridge/formats/Cartridge16K_E7.js
index 2478deb..32faa19 100644
--- a/src/main/atari/cartridge/formats/Cartridge16K_E7.js
+++ b/src/main/atari/cartridge/formats/Cartridge16K_E7.js
@@ -41,8 +41,10 @@ jt.Cartridge16K_E7 = function(rom, format) {
         var maskedAddress = address & ADDRESS_MASK;
         // Check if address is within range of bank selection
         if (maskedAddress >= 0x0fe0 && maskedAddress <= 0x0feb) {
-            if (/* maskedAddress >= 0x0fe0 && */ maskedAddress <= 0x0fe6)          // Selectable ROM Slice
+            if (/* maskedAddress >= 0x0fe0 && */ maskedAddress <= 0x0fe6) {        // Selectable ROM Slice
                 bankAddressOffset = BANK_SIZE * (maskedAddress - 0x0fe0);
+                extraRAMSlice0Active = false;
+            }
             else if (maskedAddress == 0x0fe7)                                                              // Extra RAM Slice0
                 extraRAMSlice0Active = true;
             else if (/* maskedAddress >= 0x0fe8 && */ maskedAddress <= 0x0feb) // Extra RAM Slice1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions