Jump to content
IGNORED

Another working Megacart


PkK

Recommended Posts

For a long time, I wanted to make a Megacart, but often, I found very little time for ColecoVision development.

 

Today, I finally did a sucessfull basic test of some Megacart prototypes I soldered yesterday.

 

Spec:

 

* Up to 512 KB of memory-mapped Flash, via bankswitching.

* Fixed 24 KB memory area, two switchable areas of 4 KB each (different configurations would be possible with different firmware in the CPLD).

* 64 KB of EEPROM for savegames (not memory-mapped, slow serial access).

* Fits into the short cartridge cases I use for the Homebrew kit (http://www.colecovision.eu/ColecoVision/development/Homebrew kit.shtml)

 

Today's test:

 

* Used both AT49F040A and SST39SF040 512 KB Flash chips

* Switched bank two two different parts of the Flash, checked that the expected, different values were read from fixed address.

* Wrote a byte into EEPROM and read it back.

 

Originally, I started working on my Megacart design for a T&T game, but I don't think I'll be able to find the time to finish that game anytime soon.

 

  • Like 3
Link to comment
Share on other sites

How does one program the "Up to 512KB of memory-mapped Flash"? Is it easily reprogrammable after it's soldered onto the PCB? I'm mostly thinking of testing successive ROM revisions of a game during its development, since no emulators will support the bankswitching scheme (although I expect this may change over time) and testing on real hardware will be necessary anyway.

 

Link to comment
Share on other sites

Hellp Pkk, nice to hear about your current work.

Some questions ?

How does the bankswitching works ? Is it with a specific adress read ?

How do you create a rom with your current bankswitching system ?

You're talking about 4K bank switching, we can't use more ? like 16k, which is more confortable with lots of graphics / musics (like current megacart project).

Link to comment
Share on other sites

Bankswitching works by writing specific addresses. The 4K bank size is a choice I made, since I assume it to work well with my coding style (have 1 large 24K non-switched are for common code, 1 switched area for level data, 1 switched are for level-specific code). When one wants one switched 8K bank, one could just set the two adjacent areas in logical memory to adjacent areas in physical memory.

But all this is not a hardware limitation: With a different firmware on the CPLD one could use a different bank size.

 

Originally, I wanted to have the bank-size configurable at run-time, like CBAR in the Z180 MMU, but my original design was too much for the XC9536XL CPLD used. And the bigger XC9572XL is much more expensive. I'll probably revisit that to see if maybe I can fit a somewhat restricted variant of configurable bank size into the XC9536XL, as there are still some unused CPLD resources left when using the current firmware.

 

I've attached my current documentation draft.

README

 

Edited by PkK
Link to comment
Share on other sites

Well, while I have working prototypes, there might still be changes.

In particular, today, I worked on the limited support for different bank sizes in the default firmware. See the updated README for details.

However, I have not yet tested this new firmware version in hardware. But if it works well, I might just make this the new default firmware, as it still provides all the functionality of the old version.

 

README

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...

Support for bank switching for code in banks in SDCC is still incomplete.

 

For data in banks it works using named address spaces from the Embedded C standard (see section 3.5.5, "Non-intrinsic named address spaces" in the SDCC manual).

Link to comment
Share on other sites

On 1/4/2020 at 10:26 AM, alekmaul said:

Nice, I think 8KB is better than 4KB, because it is easier to have gfxs & code in the same bank (very practical with other megacart PCB)

If you don't want to use separate banks for code and data, even with the 4K banks, you could just configure the two adjacent 4K banks as a single 8K bank. With the new firmware you also have the option of configuring two adjacent 8K banks as a single 16Kbank.

 

So we have (among others) the following options:

 

1) A 24K fixed area followed by a 4K switched area and another 4K switched area.

1a) Use this as a fixed 24K area followed by a 8K switched area.

1b) Use this as a fixed 28K area followed by a 4K switched area.

2) A 16K fixed area followed by an 8K switched area and another 8K switched area.

2a) Use this as a fixed 16K area followed by a 16K switched area.

2b) Use this as a fixed 24K area followed by a 8K switched area.

 

For my own projects, I intend to use 1), but the hard- and firmware is quite flexible.

Link to comment
Share on other sites

20 hours ago, PkK said:

Support for bank switching for code in banks in SDCC is still incomplete.

 

For data in banks it works using named address spaces from the Embedded C standard (see section 3.5.5, "Non-intrinsic named address spaces" in the SDCC manual).

OK, will check chapter 3.5.5.

Why are you saying it is still incomplete ? you are working on a new version that will support your new bank switching (you agree it is OK for the current megacart support ?)

Link to comment
Share on other sites

4 hours ago, alekmaul said:

OK, will check chapter 3.5.5.

Why are you saying it is still incomplete ? you are working on a new version that will support your new bank switching (you agree it is OK for the current megacart support ?)

If you want code (as opposed to data) in banks, AFAIK the current state of the Z80 backend in SDCC is insufficient. No matter which hardware you use (my Megacart, other Megacarts, Sega Master System Mappers, Z180, eZ80, etc).

I'll have to look at it to see how much needs to be done to get it fully working.

AFAIK some people still use it (e.g. Alan Cox for FUZIX), but they modified the linker, as the linker as it comes with SDCC was not sufficient for them.

 

  • Like 1
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...