| Posted By
zzarko on 2021-03-29 03:44:34
| 264 Magic Cartridge, new banking cartridge
After too much waiting, boards for new 264 banking cartridge made by my friend Marko have finally arrived. Marko also made Magic Desk compatible C64 cartridge, which was starting point for this cartridge (and, thus, the name).
Software for the cartridge is done and is in the testing phase. Software is largely based on my software for C64 Magic Desk Cartridge Generator and they share a significant portion of the code. It allows you to make your own compilation of games, and to customize the menu(s) to your liking. Software supports only single-load prg files and consists of Plus/4 assembly code that runs the cartridge and Python program that generates cartridge binary file.
Making your own programs/games compilation is as easy as copying all prg files into one place and running the Python code with
python3 crtgen.py -p
That would create a compilation with default settings. For more advanced usage, you can define cartridge config file.
As of recently, 264 Magic Cartridge is supported in VICE emulator and you can test your creations with:
xplus4 -cartmagic cart_name.bin
All the source code and cartridge schematics will soon be available online, so anyone could make its own compilation of prg files.
Now, during testing, we found out a lot of games that bypass Plus/4 reset, and initial cartridge menu isn't shown after the reset, but the game still runs. Is there any way to be sure that reset will go back to cartridge menu, or is power off/on the only solution? If latter is required, that kind of beats the reset's purpose...
|
|
Posted By
Chronos on 2021-03-29 06:39:41
| Re: 264 Magic Cartridge, new banking cartridge
nice!
|
|
Posted By
Bones on 2021-03-29 07:57:07
| Re: 264 Magic Cartridge, new banking cartridge
Some games disabled the reset button on purpose to prevent copies being made as it allows access to the built-in machine code monitor ~ hold the run/stop button down as you press reset. Turning off is the only way.
Thrust and some of the Gremlin Graphics games leave a copyright message on the screen. Others like ACE +4 reset the game back to the title screen. While it might not be needed today it's all part of the original games DNA as to why its left in.
|
|
Posted By
zzarko on 2021-03-29 08:18:56
| Re: 264 Magic Cartridge, new banking cartridge
I do not know 264 hardware enough, so this may be a stupid question: is there some other way to reset Plus4, meaning, can I maybe install some additional reset button, connect it to some traces on motherboard and get something that will always interrupt running code and get back to system as if game wasn't loaded? I would really like to not power off/on the machine multiple times when testing the cartridges, I think that is not good for the hardware.
|
|
Posted By
crock on 2021-03-29 16:42:42
| Re: 264 Magic Cartridge, new banking cartridge
I do not think it is possible without power cycling the machine. The reason is simple, the buffered /reset signal that is triggered by the button and exposed on the cartridge port only resets the CPU and the ROM bank latches, and not TED. TED has no /reset pin.
This is a problem because the TED implements the virtual registers at $FF3E and $FF3F which select ROM or RAM when reading from the upper 32k of address space. If reset is triggered when RAM is enabled, the CPU resets and starts executing from whatever address is read from the reset vector at $FFFC in RAM which could be an uninitialised random address causing the machine to hang, or a vector to some message or to restart the game.
|
|
Posted By
gerliczer on 2021-03-30 02:45:30
| Re: 264 Magic Cartridge, new banking cartridge
crock wrote: I do not think it is possible without power cycling the machine.
Unless, you modify the machine with a code sequence generator that forces the CPU to execute a program after /RESET that pages back the default ROM configuration and calls the original reset routine.
|
|
Posted By
zzarko on 2021-04-01 06:04:57
| Re: 264 Magic Cartridge, new banking cartridge
I have two more questions... First, there is some trouble with filebrowser (fb16). When it is started from the cartridge right after powering the machine, display is wrong, some colors aren't correct and there some flashing on the screen. If I go to BASIC from cartridge, reset the machine and start the program again, then it displays as it should.
Here is the video: Youtube
Cartridge init code and code to start a program was mainly taken from Gamecart Plus/4. Exit to BASIC from cartridge is done with JMP $8A7B. Some initialization is still missing for FB16 to work right after power on, but I do know what. Does someone maybe know?
Second question, it seems that 3plus1 package on Plus/4 isn't initialized with init code and it is inactive after exit to BASIC from cartridge. Personally, I do not mind, but if someone knows how to activate it, please tell, just for completeness sake.
EDIT: It seems that I do not get how to put links in comments, sometimes they show as expected, sometimes they do not. What am I missing?
|
|
Posted By
Csabo on 2021-04-01 08:11:35
| Re: 264 Magic Cartridge, new banking cartridge
After watching that video my random guess would be that the colors at $0113 aren't initialized. You can do that like this:
LDX#$0F LDA$E143,X STA$0113,X DEX BPL *-7
|
|
Posted By
MMS on 2021-04-02 12:44:41
| Re: 264 Magic Cartridge, new banking cartridge
@zzarko Maybe I am wrong, but I think the http links work, the https links do not show properly.
|
|
Posted By
zzarko on 2021-04-18 02:14:16
| Re: 264 Magic Cartridge, new banking cartridge
@MMS I have just tried in another topic, when I put links in a new post, they show as regular text (with all HTML tags displayed as regular text also), but if I go to edit the post, place and erase a space for example and save, the links are displayed properly
|
|
Posted By
unclouded on 2021-04-23 08:06:53
| Re: 264 Magic Cartridge, new banking cartridge
Might it be possible for a cartridge to defeat the reset protection? After the CPU fetches the RESET vector, could the cartridge somehow present STA $FF3E to the CPU without bus contention from the RAM chips trying to supply the addressed data? And then reset the machine again with ROM selected this time? If not, how long does the 555 hold the CPU in RESET? Could the cartridge write the RESET vector and the STA $FF3E "handler" to RAM in the CPU's half of PHI2 before it is released from RESET?
|
|
Posted By
zzarko on 2021-05-03 01:10:12
| Re: 264 Magic Cartridge, new banking cartridge
@unclouded: This is something like what Kung Fu Flash and/or EasyFlash cartridges do on C64, if I understood correctly. I have discussed this with Marko and it would be too much out of scope of our small project.
@Csabo: we tried that fix with filebrowser, but it doesn't change its behavior right after power on. When we release everything, maybe you or someone else can take a look and help with missing initializations ...
|
|
Posted By
Csabo on 2021-05-03 08:11:37
| Re: 264 Magic Cartridge, new banking cartridge
If the code can be tested in YAPE, you can send it to me and I'll take a look (before release).
|
|
Posted By
siz on 2021-05-03 15:48:46
| Re: 264 Magic Cartridge, new banking cartridge
Most probably KERNAL ROM is not mapped in so you have to provide your own color initialization table.
|
|
Posted By
zzarko on 2021-05-07 01:38:47
| Re: 264 Magic Cartridge, new banking cartridge
@Csabo: THANK YOU for figuring out what went wrong! Marko tested on real machine and now it works as it should. I can now consider Plus/4 side of the code complete (at least until some bug pops up)
|
|
Posted By
msolajic on 2021-06-17 17:19:41
| Re: 264 Magic Cartridge, new banking cartridge
Hi everyone, we have finally documented everything and both the hardware and software are ready to be released! The cartridge design you can find at https://github.com/msolajic/c264-magic-cart and the software (new version, for both C64 and C16/116/plus4) at https://bitbucket.org/zzarko/magic-cartridge-generator/ You can download the gerbers or wait a few days for the PCBs to become available on PCBWay's website (the link is in the hardware repo).
I would like to thank everyone from the Plus/4 World who helped with the software part with their vast knowledge of the machine internals.
Have fun! Marko
|
|
Posted By
nameless on 2021-08-02 05:08:43
| Re: 264 Magic Cartridge, new banking cartridge
Hi msolajic and zzarko great job. I built 264 Magic Cart with 2Mb eprom 27C160. I created compilation with about 80 games. It works great with my plus4
|
|
Posted By
zzarko on 2021-08-11 11:52:01
| Re: 264 Magic Cartridge, new banking cartridge
Hi Nameless, I'm really glad that everything worked for you! I hope you will enjoy your new 264 cartridge!
|
|
| |
Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon |