PkK Posted December 13, 2019 Share Posted December 13, 2019 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. 3 Quote Link to comment Share on other sites More sharing options...
Pixelboy Posted December 13, 2019 Share Posted December 13, 2019 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. Quote Link to comment Share on other sites More sharing options...
PkK Posted December 13, 2019 Author Share Posted December 13, 2019 The flash chip is socketed, not soldered, and can be removed from the board using PLCC pliers. Quote Link to comment Share on other sites More sharing options...
alekmaul Posted December 15, 2019 Share Posted December 15, 2019 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). Quote Link to comment Share on other sites More sharing options...
PkK Posted December 15, 2019 Author Share Posted December 15, 2019 (edited) 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 December 15, 2019 by PkK Quote Link to comment Share on other sites More sharing options...
alekmaul Posted December 15, 2019 Share Posted December 15, 2019 Tanks a lot, will check it and add it to my pvcollib and emultwo emulator ! 1 Quote Link to comment Share on other sites More sharing options...
PkK Posted December 15, 2019 Author Share Posted December 15, 2019 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 1 Quote Link to comment Share on other sites More sharing options...
PkK Posted January 2, 2020 Author Share Posted January 2, 2020 Finally found a bit of time today for this. The new firmware works fine and I'll use it as default. So bank size can now be switched between 4KB and 8KB at runtime. 1 Quote Link to comment Share on other sites More sharing options...
alekmaul Posted January 4, 2020 Share Posted January 4, 2020 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) How sdcc handles your bank switching ? Quote Link to comment Share on other sites More sharing options...
PkK Posted January 7, 2020 Author Share Posted January 7, 2020 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). Quote Link to comment Share on other sites More sharing options...
PkK Posted January 8, 2020 Author Share Posted January 8, 2020 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. Quote Link to comment Share on other sites More sharing options...
alekmaul Posted January 8, 2020 Share Posted January 8, 2020 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 ?) Quote Link to comment Share on other sites More sharing options...
PkK Posted January 8, 2020 Author Share Posted January 8, 2020 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. 1 Quote Link to comment Share on other sites More sharing options...
alekmaul Posted January 8, 2020 Share Posted January 8, 2020 (edited) oh yeah I understand. I also modified the linker and add a new tool : cvmkcart If I want to be compatible with your megacart, I will have to modify it. You also got an example here : https://github.com/alekmaul/pvcollib/tree/master/coleco-examples/megacart Edited January 8, 2020 by alekmaul 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.