Cartridge images -> real C64?

Started by xlar54, December 13, 2008, 07:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

xlar54

We all know you can transfer disk images to real floppies, but Im wondering is there a way to "poke" cartridge images into memory on the 64 or 128? These images are basically just ML, so it seems logical to me without knowing exactly how cartridges work.  Only way I could see it not working, is if carts are accessed through registers (like the VDC chip) instead of memory mapped, but I dont think this is the case.  Any thoughts?

Andrew Wiskow

I don't have the "technical know-how" to know how something like this would be done...  But a do recall a program "back in the day" that could be used to copy a cartridge program to a file on a disk that could later just be loaded and run like any other program.
Cottonwood BBS & Cottonwood II
http://cottonwood.servebbs.com

RobertB

Quote from: Andrew Wiskow on December 13, 2008, 11:00 PM...do recall a program "back in the day" that could be used to copy a cartridge program to a file on a disk...
I believe that was limited to 8K carts, maximum.

              Whoa... deadline for newsletter articles in 2 days,
              Robert Bernardo
              Fresno Commodore User Group
              http://videocam.net.au/fcug
              The Other Group of Amigoids
              http://www.calweb.com/~rabel1/
              Southern California Commodore/Amiga Network
              http://www.sccaners.org/

SmallCleverDinosaur

#3
This could be done, for certain cartridges. As Robert said, the program was probably limited to 8K cartridges. These are mapped into the C64 memory at $8000 where RAM is normally found. This happens when the EXROM-line of the expansionport is grounded. Then the PLA of the C64 maps out RAM and maps in the cartridge-ROM.

So, if you have the cartridge-ROM on a disk it can be loaded into address $8000 and run from there. The program has no way of knowing it is run from RAM and not ROM. If the cartridge is an autostart cartridge (almost 100% of all gamecartridges are), then all you have to do is to load the file into RAM and then reset the computer. Upon reset the C64 will check for the autostart signature (CBM80) at $8000 and autostart the code no matter if it resides in RAM or ROM.

An exception to this is if the cartridge uses adress $01 to switch itself out of the memorymap. It is possible for a cartridge to replace the cartridge-ROM at $8000 with RAM by manipulating certain bits of address $01.

Downloading 16K cartridge-ROMS into RAM is probably a little more tricky since these replace the BASIC-ROM or the KERNAL-ROM depending on which type of cartridge it is.

In the C64, cartridges replaced the internal RAM or ROM with its own cartridge-ROM. This is not the case with the C128 since the memorymap of the C128 is completely dynamic due to the MMU. So using this method is even more trickier for the C128 (if at all possible without altering the code). The cartridge expects to be in cartridge-ROM and not in RAM. If the code in the cartridge will alter the MMU registers (which is most likely) the computer will immediately crash since the RAM that the code has been loaded into will be switched out of the memorymap.
Ignorance is a precious thing. Once lost, it can never be regained.

Mark Smith

Does anyone know how the System3 carts worked ?  Myth and Last Ninja 3 were BIG games so how did the cartridge function to hold them ?

And more importantly can it be reproduced because I always wanted to play those games :-)

Mark

------------------------------------------------------------------------------------------------------------------

Commodore 128, 512K 1750 REU, 1581, 1571, 1541-II, MMC64 + MP3@64, Retro-Replay + RR-Net and a 1541 Ultimate with 16MB REU, IDE64 v4.1 + 4GB CF :-)

RobertB

Quote from: Mark Smith on January 01, 2009, 03:11 PMDoes anyone know how the System3 carts worked ?  Myth and Last Ninja 3 were BIG games so how did the cartridge function to hold them ?
I think your questions would be best answered by a C= game programmer, like Jason "TMR" Kelk.  He hangs out at

              http://www.commodorecomputerclub.co.uk/forums/index.php

                            Happy New Year!
                            Robert Bernardo
                            Fresno Commodore User Group
                            http://videocam.net.au/fcug
                            The Other Group of Amigoids
                            http://www.calweb.com/~rabel1/
                            Southern California Commodore/Amiga Network
                            http://www.sccaners.org/

SmallCleverDinosaur

Cartridges that have more than 16KB of ROM usually contains some sort of bankswitching circuitary. For instance, the OCEAN cartridge Terminator II has 1MB of ROM. It uses 13 adressbits to address 8KB at a time (2^13=8192=8KB). But the eprom used has an additional 7 addressbits which makes it a total of 1MB (2^20=1048576=1MB). These extra 7 bits are controlled via a D-latch circuit soldered to the cartridge PCB. It's accessed through the I/01 area (56832-57087/$DE00-$DEFF).

Since this is a game cartridge the solution is pretty simple. For instance, you can POKE any part of the I/01 area with a value in order to set or clear the D-latches. And your program has to "remember" the setting of the D-latches since there is no way of PEEK'ing the value currently in the D-latches. The solution can of course be developed to be much more sophisticated.

For example, only 7 latches of the D-latch IC are used, but it contains 8 D-latches. The 8'th one could be connected to the EXROM line so the program in the eprom could alter the status of the EXROM line and thus, through software, be able to decide if C64 mode or C128 mode should be active :)

To reproduce it is also not that difficult. The only problem is to find someone that can make PCB's at a reasonable price. The PCB for Terminator II is pretty simple and uses only one eprom, one NOR-gate IC and one D-latch IC. It also has an unused space for an additonal eprom so it could be used to hold 2 eproms with a total of 2MB.
Ignorance is a precious thing. Once lost, it can never be regained.

RobertB

Quote from: SmallCleverDinosaur on January 01, 2009, 11:29 PMCartridges that have more than 16KB of ROM usually contains some sort of bankswitching circuitary.
Like the Warpspeed cart?  FWIW, the manual says that they squeezed 64K of Warpspeed code into 32K of space.
Quote from: SmallCleverDinosaur on January 01, 2009, 11:29 PMFor instance, the OCEAN cartridge Terminator II has 1MB of ROM. It uses 13 adressbits to address 8KB at a time (2^13=8192=8KB). But the eprom used has an additional 7 addressbits which makes it a total of 1MB (2^20=1048576=1MB). These extra 7 bits are controlled via a D-latch circuit soldered to the cartridge PCB. It's accessed through the I/01 area (56832-57087/$DE00-$DEFF).

Since this is a game cartridge the solution is pretty simple. For instance, you can POKE any part of the I/01 area with a value in order to set or clear the D-latches. And your program has to "remember" the setting of the D-latches since there is no way of PEEK'ing the value currently in the D-latches. The solution can of course be developed to be much more sophisticated.

For example, only 7 latches of the D-latch IC are used, but it contains 8 D-latches. The 8'th one could be connected to the EXROM line so the program in the eprom could alter the status of the EXROM line and thus, through software, be able to decide if C64 mode or C128 mode should be active :)
Thanks for the very comprehensive answer.
Quote from: SmallCleverDinosaur on January 01, 2009, 11:29 PMTo reproduce it is also not that difficult. The only problem is to find someone that can make PCB's at a reasonable price.
That is very true.

                Happy New Year!
                Robert Bernardo
                Fresno Commodore User Group
                http://videocam.net.au/fcug
                The Other Group of Amigoids
                http://www.calweb.com/~rabel1/
                Southern California Commodore/Amiga Network
                http://www.sccaners.org/

SmallCleverDinosaur

Quote from: RobertB on January 02, 2009, 07:23 AM
Quote from: SmallCleverDinosaur on January 01, 2009, 11:29 PMCartridges that have more than 16KB of ROM usually contains some sort of bankswitching circuitary.
Like the Warpspeed cart?  FWIW, the manual says that they squeezed 64K of Warpspeed code into 32K of space.
I haven't seen the Warpspeed cartridge in person but if it has 32KB of ROM it's most certainly a bankswitching cartridge since the C64 can only address a maximum of 16KB at a time via the expansionport. The C128 can address up to 32KB the same way.

When it comes to "squeezing" 64KB into 32KB the manual probably only say that to make the Warpspeed cartridge sound like something extra or to let everyone know how effecient their programmers write their code :)
Ignorance is a precious thing. Once lost, it can never be regained.

RobertB

Quote from: SmallCleverDinosaur on January 02, 2009, 09:22 AM...but if it has 32KB of ROM it's most certainly a bankswitching cartridge since the C64 can only address a maximum of 16KB at a time via the expansionport. The C128 can address up to 32KB the same way.
Yeah, Warpspeed works in 64 mode and in 128 mode, both 40 and 80-column.
Quote from: SmallCleverDinosaur on January 02, 2009, 09:22 AMWhen it comes to "squeezing" 64KB into 32KB the manual probably only say that to make the Warpspeed cartridge sound like something extra or to let everyone know how effecient their programmers write their code :)
Right.

               Happy New Year!
               Robert Bernardo
               Fresno Commodore User Group
               http://videocam.net.au/fcug
               The Other Group of Amigoids
               http://www.calweb.com/~rabel1/
               Southern California Commodore/Amiga Network
               http://www.sccaners.org/

SmallCleverDinosaur

Wow, seems like a cool cartridge :) Do you have one of those? Do you know if there exists a cartridge emulationfile for VICE for that cartridge?
Ignorance is a precious thing. Once lost, it can never be regained.

RobertB

Quote from: SmallCleverDinosaur on January 02, 2009, 08:01 PMDo you have one of those?
Yes.
Quote from: SmallCleverDinosaur on January 02, 2009, 08:01 PMDo you know if there exists a cartridge emulationfile for VICE for that cartridge?
I don't know, because I'm not a VICE-type of person.  If you need a dump of the chip, there may be others here who could tell you where to find it.  Or if you could wait until January 11, at the SCCAN meeting Andrew Wiskow will bring his Promenade clone, and I can ask him to do a dump of chip from my cart.

                  Truly,
                  Robert Bernardo
                  Fresno Commodore User Group
                  http://videocam.net.au/fcug
                  The Other Group of Amigoids
                  http://www.calweb.com/~rabel1/
                  Southern California Commodore/Amiga Network
                  http://www.sccaners.org/

SmallCleverDinosaur

That is most kind of you. I will be patient and wait for Mr Wiskow to help you :) Do you have any photos of the cartridge?
Ignorance is a precious thing. Once lost, it can never be regained.

Golan Klinger

You can download a ROM image from a Warp Speed v1 here and from a Warp Speed v2 here. It is not presently emulated by VICE but it will be supported in an upcoming version. Here is a picture of a (somewhat beaten up) Warp Speed cartridge:


Call me Golan; my parents did.

RobertB

Quote from: SmallCleverDinosaur on January 03, 2009, 04:01 AMI will be patient and wait for Mr Wiskow to help you :) Do you have any photos of the cartridge?
No, but I'll get Andrew to take a photo of its board for you.  :)

              It looks very much like a FastLoad board,
              Robert Bernardo
              Fresno Commodore User Group
              http://videocam.net.au/fcug
              The Other Group of Amigoids
              http://www.calweb.com/~rabel1/
              Southern California Commodore/Amiga Network
              http://www.sccaners.org/

SmallCleverDinosaur

Quote from: Golan Klinger on January 03, 2009, 12:23 PM
You can download a ROM image from a Warp Speed v1 here and from a Warp Speed v2 here. It is not presently emulated by VICE but it will be supported in an upcoming version.
Thanks for the picture Golan! And for the emulation info.

Quote from: RobertB on January 03, 2009, 04:31 PM
I'll get Andrew to take a photo of its board for you.  :)
Thanks! It's always interesting to see how they have solved the bankswitching :)
Ignorance is a precious thing. Once lost, it can never be regained.

RobertB

Quote from: SmallCleverDinosaur on January 03, 2009, 04:01 AMI will be patient and wait for Mr Wiskow to help you :) Do you have any photos of the cartridge?
Quote from: me on January 03, 2009, 04:31 PMNo, but I'll get Andrew to take a photo of its board for you.  :)
Andrew has snapped the photos of the both sides of the Warpspeed board.  Now we await!  :)

               A successful SCCAN meeting,
               Robert Bernardo
               Fresno Commodore User Group
               http://videocam.net.au/fcug
               Catch the Fatman and Circuit Girl on http://vimeo.com

SmallCleverDinosaur

Great, thanks!

We await patiently :)

Both these pictures and those of the Turbo Master CPU
Ignorance is a precious thing. Once lost, it can never be regained.

Andrew Wiskow

Quote from: SmallCleverDinosaur on January 12, 2009, 07:09 PM
Great, thanks!

We await patiently :)

Both these pictures and those of the Turbo Master CPU

Yeah, I should have them posted tomorrow night, or Wednesday at the latest...
Cottonwood BBS & Cottonwood II
http://cottonwood.servebbs.com

RobertB

Quote from: Andrew Wiskow on January 13, 2009, 05:21 PM...I should have them posted tomorrow night, or Wednesday at the latest...
Yay!

             Truly,
             Robert Bernardo
             Fresno Commodore User Group
             http://videocam.net.au/fcug
             Catch the Fatman and Circuit Girl on http://vimeo.com

Andrew Wiskow

#20
The photos I shot at this past Sunday's SCCAN meeting can be found here.  Enjoy!  :)

BTW, if anyone needs copies of the original 7 megapixel photos for greater detail, let me know privately, and I can send you copies via e-mail.
Cottonwood BBS & Cottonwood II
http://cottonwood.servebbs.com

SmallCleverDinosaur

Those are great pictures, thanks! :)

The WarpSpeed cartridge uses a 27C256 Eprom which holds 32K of ROM. Since the EXROM and GAME lines from the expansionport are being connected by this cartridge (pins 8 and 9 on the top left), it has 16K for the C64 mode. And the other 16K are presumably used for the C128 mode. Since both modes can map 16K of external ROM without bankswitching one wonders what the 74LS109 circuit is used for. That is a dual JK flip-flop IC which suggests some form of bankswitching.

Intriguing :)

Many thanks for the great photos of the TurboMaster CPU cartridge as well! :)
Ignorance is a precious thing. Once lost, it can never be regained.

RobertB

Quote from: SmallCleverDinosaur on January 14, 2009, 07:27 PMThe WarpSpeed cartridge uses a 27C256 Eprom which holds 32K of ROM. Since the EXROM and GAME lines from the expansionport are being connected by this cartridge (pins 8 and 9 on the top left), it has 16K for the C64 mode. And the other 16K are presumably used for the C128 mode. Since both modes can map 16K of external ROM without bankswitching one wonders what the 74LS109 circuit is used for. That is a dual JK flip-flop IC which suggests some form of bankswitching.
I'll ask about the 74LS109.

               Truly,
               Robert Bernardo
               Fresno Commodore User Group
               http://videocam.net.au/fcug
               The Other Group of Amigoids
               http://www.calweb.com/~rabel1/
               Southern California Commodore/Amiga Network
               http://www.sccaners.org/

RobertB

Quote from: SmallCleverDinosaur on January 14, 2009, 07:27 PMMany thanks for the great photos of the TurboMaster CPU cartridge as well! :)
The Turbomaster CPU was on loan to Jeri Ellsworth for about a year and a half.  I just got it back from her on Thursday.  However, when I powered it up on Friday, it wouldn't go into 4 MHz. mode (instead of the Turbomaster screen, there would be a black screen) and 1 MHz. mode was shaky, at best.  For awhile, I thought the TM was broken.  I did have an unused 65C02S from Western Design Center that I bought 2 years ago.  Well, the old Rockwell 65C02 was pulled, and the WDC 65C02S was put in its place.  Either the new chip would fry, or it would work!  C64 power up... success!  (And there was much high-fiving!)  The TM screen came up at 4.09 MHz, some test programs were tried and ran 4 times faster, and the 1 MHz. mode was fine.  Whew!  All is well again.

          BTW, Andrew's pics of the TM are not coming up,
          Robert Bernardo
          Fresno Commodore User Group
          http://videocam.net.au/fcug
          The Other Group of Amigoids
          http://www.calweb.com/~rabel1/
          Southern California Commodore & Amiga Network
          http://www.sccaners.org