Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in E7 cartridge handling #37

Open
deater opened this issue Jun 22, 2023 · 1 comment
Open

bug in E7 cartridge handling #37

deater opened this issue Jun 22, 2023 · 1 comment

Comments

@deater
Copy link

deater commented Jun 22, 2023

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
@ppeccin
Copy link
Owner

ppeccin commented Jun 22, 2023

Thanks for reporting the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants