ChildOfCv Posted November 14, 2021 Share Posted November 14, 2021 So, here is yet another correction since I didn't correct the bank counter: void ReadCartridge() { const unsigned int baseAddress = 0x8000; unsigned int bankAddress = 0xffc0; const unsigned int bankStart = 0xc000; const unsigned int bankSize = 0x4000; const int numBanks = (<size of cartridge> - 0x4000l + bankSize - 1) / bankSize; Serial.println("START:"); // Read additional banks for (int bank = 0; bank < numBanks; bank++) { SetAddress(bankAddress++); for (unsigned int currentAddress = 0; currentAddress < bankSize-0x40; currentAddress++) { SetAddress(bankStart + currentAddress); ReadDataLines(); } // Simulate reading the last 0x40 for(unsigned int c = 0; c < 0x40; c++) { Serial.print("00"); // Should this be println? Need to check ReadDataLines to be sure. } } // Read constant bank for (unsigned int currentAddress = 0; currentAddress < 0x4000; currentAddress++) { SetAddress(baseAddress + currentAddress); ReadDataLines(); } Serial.println(":END"); } Quote Link to comment Share on other sites More sharing options...
OriginalJohn Posted March 12, 2022 Author Share Posted March 12, 2022 Thank you to everyone that's helped out so far. I'm trying to get my head around the info in this thread: https://atariage.com/forums/topic/327053-activision-pcb-bank-switching-and-eeprom/?do=findComment&comment=5018713 I understand that after I select an address to activate the bank, I can then read 0xc000 - 0x4000 (omitting the last 0x40 as in the code above and replacing it with '00's). As an aside on this, I think that the padding changes to 'FF's above 32k, is this a unwritten rule? When mega carts are read (any size) this method works. However on the Pixelboy 'activision' 64k pcbs, this does not work. So as in the example in the mentioned thread, I can read the first 16k no problem, however switching to bank 0xff90, 0xffa0, and 0ffb0 then reading the next 16k (0xc000 - 0x4000) results with incorrect data (so much so that it isn't close to matching anything when I do a hex comparison. Does anyone know what I might be missing on this one? Thank you! John Quote Link to comment Share on other sites More sharing options...
ChildOfCv Posted April 7, 2022 Share Posted April 7, 2022 On 3/11/2022 at 7:47 PM, OriginalJohn said: Thank you to everyone that's helped out so far. I'm trying to get my head around the info in this thread: https://atariage.com/forums/topic/327053-activision-pcb-bank-switching-and-eeprom/?do=findComment&comment=5018713 I understand that after I select an address to activate the bank, I can then read 0xc000 - 0x4000 (omitting the last 0x40 as in the code above and replacing it with '00's). As an aside on this, I think that the padding changes to 'FF's above 32k, is this a unwritten rule? When mega carts are read (any size) this method works. However on the Pixelboy 'activision' 64k pcbs, this does not work. So as in the example in the mentioned thread, I can read the first 16k no problem, however switching to bank 0xff90, 0xffa0, and 0ffb0 then reading the next 16k (0xc000 - 0x4000) results with incorrect data (so much so that it isn't close to matching anything when I do a hex comparison. Don't you mean C000-FFFF? Quote Link to comment Share on other sites More sharing options...
OriginalJohn Posted May 3, 2022 Author Share Posted May 3, 2022 On 4/7/2022 at 3:14 PM, ChildOfCv said: Don't you mean C000-FFFF? Thank you, @ChildOfCv, your suggestion saved my bacon but not in the way you'd expect. I went back over my code to validate that I was reading the correct range, which I was, but I had not set my start address for the read properly. After that was changed, it worked. But, for some reason, some pixelboy 64k games have eof data after the addresses that cause the shift to happen, thus causing my checksum to be different. I worked around that and now 64k games are read properly. This is good news, after some refactoring, I'll be uploading my revisions to the repo. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.