Jump to content
IGNORED

Colecovision Cartridge reader (read > 32k?)


OriginalJohn

Recommended Posts

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");
}

 

Link to comment
Share on other sites

  • 3 months later...

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

 

 

 

 

Link to comment
Share on other sites

  • 4 weeks later...
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?

Link to comment
Share on other sites

  • 4 weeks later...
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. 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...