Help converting Cart images to disk

Discuss anything related to the VIC
Post Reply
Disc Master I
Vic 20 Amateur
Posts: 43
Joined: Wed Mar 31, 2004 10:19 pm

Help converting Cart images to disk

Post by Disc Master I »

Hi all,
I have a VIC-20 and about 40 or so carts. I recently came across a bunch of Vic-20 cart images for the Vic-20 emulators. What I'd like to do is be able to copy those files to a Commodore floppy and run them from my 1541 drive. I have used Star Commander before and have an XE1541 cable. I know because they are images of cartridges that you just can't take the .prg file and copy it to a Vic-20 formatted diskette and then run them natively. Can anyone help me by telling me how I can make these files load off the 1541 and then run on my real Vic? As of now I can load them but typing in run doesn't help. Also on the Lemon64 forums a person tried to help me by giving me a 3 line basic program to run the files. When I followed the instructions and line 3 runs sys 64802, the system just resets to the initial screen. I have a Cardo Cardram 16k Memory Expansion Cartridge, but don't have any instructions on how to use it. It does list me as having 19k or so of Ram when the cart is in and only 3k when it is not in, so the cart is apparently working. Anyhow, if anyone can help me I'd appreciate it.

Sincerely,
John
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

You're halfway done, but first some bad news; your memory expansion has to have a possibility to switch which memory block(s) it maps into.

Your 16K expansion probably maps into address $2000, just extending the Basic memory, while most cartridges maps into address $A000 (and $6000 if it is a 16K cartridge). This means that your memory expansion does not cover the addresses the cartridge image is supposed to run at. It is possible to physically modify a memory expansion to map elsewhere, but I would strongly advice you not to do that.

Another solution would be to try to find a switchable expansion, typically 32K as those automagically indicates they are built to map memory into the RAM/ROM slot at address $A000. If you are handy with electronics, you may also build one yourself.

Once you got as far as getting the right kind of memory expansion, you can now load the binary file from the floppy using LOAD"file",8,1. Notice the second parameter to LOAD, which tells it to load the file into the address it was saved at (i.e. $A000). After doing that, you should do a soft reset (SYS 64802) just as the guy in Lemon64 forum suggested. Bear in mind that a 16K image normally is split into two files of 8K each, and you will find in which order you should load those into memory.

I believe all the cartridge images you find have the load address attached to them, i.e. the file size is 8194 bytes rather than 8192 bytes. If you come across an image without load address, you will have to somehow add it, preferrably on the PC before transferring the file.

Likewise, if you would burn an EPROM with the image (which is an interesting solution), you may have to strip away the load address if your EPROM burning software isn't able to bypass it.

Of course, if you like machine code programming, you can rewrite the cartridge image so it will run into another memory slot (i.e. replacing all references to $Axxx with $2xxx and $Bxxx with $3xxx), but that is something not even I have tried to do.
Anders Carlsson

Image Image Image Image Image
Disc Master I
Vic 20 Amateur
Posts: 43
Joined: Wed Mar 31, 2004 10:19 pm

Post by Disc Master I »

My 16k memory card has two banks of switches on it. Ram Block 1 and Ram Block 2. There are 4 switches per block and they are numbered 5, 3,2,1. I'm not sure if those are the switches you are talking about. I don't have the manual for this memory card, but would love to find an online version of the manual. Does anyone know if there is a site with Vic-20 instructions in text format?

Thanks
John
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

i have the cardco expansion board, with an excellent manual.

it has several pages devoted to dip switches, etc..

the manual is incredibly well written.

i do know that the cardco 16k cart, is made up of 2 8k sections, and you are able to switch each 8k to whatever bank you want (1,2,3,5)

i will look it up when i get home, and type out what i can.

chris
Disc Master I
Vic 20 Amateur
Posts: 43
Joined: Wed Mar 31, 2004 10:19 pm

Post by Disc Master I »

Thanks Chris! That will be a big help. :)
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

well, this is just coming off from the top of my head, but I am assuming that the card is currently configured for one 8k section mapped to block 1, and the other 8k section mapped to block 2, and thus when you have it plugged in, you get 19k or so.

to have one of the 8k sections mapped to block 5, (place where game carts auto start etc..) you will have to just toggle the dip switch on for block 5 and toggle all the other switches for that 8k section to off.

that should give you the 8k section in block 5.

if you do this for the second 8k section, and leave the first 8k section alone, when you boot up your vic, you should only see 11k or so, and not that 19k.

although it will look like you lost 8k, you didn't. the vic just can't see that 8k section in block 5 as available for user memory, as the vic needs continous memory for this purpose, and that damn block 4 is used by the vic.

you can still access that 8k in block 5, through pokes, ML routines, etc..

Anders is way better at explaining this than me.

still, when i get home, i will eventually type that stuff in for you.

chris
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Let's see...

Block 0 = $0000-$1FFF *
Block 1 = $2000-$3FFF (8192-16383)
Block 2 = $4000-$5FFF (16384-24575)
Block 3 = $6000-$7FFF (24576-32767)
Block 4 = $8000-$9FFF **
Block 5 = $A000-$BFFF (40960-49151)
Block 6 = $C000-$DFFF ***
Block 7 = $E000-$FFFF ****

*) In this block, you already find the zeropage, system addresses, a slot for 3K RAM expansion, the normal unexpanded 3.5K RAM and screen memory

**) In this block, you already have character ROM, VIC-I and other I/O addresses and colour memory

***) In this block, you already have Basic ROM

****) In this block, you already have Kernel ROM

So, you are quite lucky that your cartridge is switchable. As Chris said, set one of the two RAM blocks to block 5, and the cartridge image should be possible to load and run (soft reset). You can also set the other RAM block to block 3, and in that way load 16K cartridges.

Most 16K cartridges use block 3+5, but some use block 1+5 or 2+3, which you hopefully will find out from the page you downloaded the images - otherwise you can examine the file, experiment or ask here.

As a side effect, as long as neither of the RAM blocks is located in block 1, the computer will not notice the RAM expansion, i.e. it will appear as the computer is running as unexpanded although there is expansion RAM plugged in "deeper down" in the system. As some cartridges are written with the assumption the computer doesn't have a memory expansion, this is good news that you can fool the computer.

A hint to know if a memory expansion works or not is to POKE and then PEEK a certain address. If there is no memory connected, you will get random "bus noise" when reading an address, but of course you will get the value you stored back if the memory actually works:

POKE 8192,somevalue : PRINT PEEK(8192)

See the memory ranges above for which addresses belongs to which block.
Anders Carlsson

Image Image Image Image Image
Disc Master I
Vic 20 Amateur
Posts: 43
Joined: Wed Mar 31, 2004 10:19 pm

Post by Disc Master I »

Any of you know where I might be able to purchase a 16k or bigger Ram cart with switches built in to it? A fellow Commie user over at Lemon64 just gave me a program to type in that would test the $A000 ram. I kept getting fails, but when I tried it and adjusted the memory range to 8192 ($2000) and then set the card to on for the $2000 range the program tested OK, so I think that the $A000 block might be non functional. :( Man I was so excited to get these carts running as diskettes. I don't want to have to lug all my Vic-20 carts to the classic expo that I am going to attend and host a Commodore Exhibit. I was hoping to bring the disks and just load the games from there. :(
Last edited by Disc Master I on Thu Apr 01, 2004 9:05 pm, edited 1 time in total.
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

The only one I know is the cardco 16k cart, that has switches, but my vic 20 knowledge is far from extensive.

If you get yourself a stock 8k cart, you can open up the case and get at the four internal dip switches.

dip switch #1 on: sets the 8k cart to block 5

switch #2: block 3

switch #3: block 2

switch #4: block 1 (already set to that position if unmodified)

I think you can take a stock 16k cart and fiddle with it, but that would require some soldering, as I think it does not have dip switches for bank slection. It is just set for bank 1 and bank 2.

Chris
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Most RAM expansions does not have switches at all. Internally the block selection is determined by which pins on the card edge are connected to the computer. Thus a regular expansion should be possible to modify by open it, cut trace to one pin and add soldering or a wire to another pin.

John, since your expansion allows both RAM banks to select blocks, have you tried different combinations?

10 B=5
20 A=B*8192:FOR I=0 TO 8191:J=I AND 255
25 POKE A+I,J:IF PEEK(A+I)<>J THEN PRINT "ERROR ON ADDRESS ";A+I
30 NEXT

This little program would test memory at block B (1,2,3,5) which you can change on line 10. What it does is filling the memory with continuous patterns of characters/values 0 to 255 and checking each position directly afterwards. It is possible that you would need a more advanced routine:

10 B=5
20 A=B*8192:FOR I=0 TO 8191:FOR J=0 TO 255
25 POKE A+I,J:IF PEEK(A+I)<>J THEN PRINT "ERROR ON ADDRESS";A+I;" FOR VALUE ";J
30 NEXT J,I

This one will test all possible addresses for all possible values, but it would take ages to execute. :o

You may also try to clean the edge connector of your expansion, as I said above that different pins are used to map the banks into blocks, and maybe one or a few of the pins are dirty or damaged. Thus the expansion would work in one block but not in another.
Anders Carlsson

Image Image Image Image Image
Disc Master I
Vic 20 Amateur
Posts: 43
Joined: Wed Mar 31, 2004 10:19 pm

Post by Disc Master I »

Anders,
Thanks for the information. I'll try the bottom set of code to test the whole card. I've been working with tnt/beyond force over at the Lemon64 site as well. He sent me the following code earlier.

10 M=40960
20 FOR I=0 to 15:R=256:FOR J=0 TO 255
30 POKE M+I*256+J,J:R=R+(PEEK(M+I*256+J)=J):NEXT
40 IF R=0 THEN PRINT I;" OK":GOTO60
50 PRINT I;" FAIL"
60 NEXT

I also substituted line 10 with different values like 8129 to test the $2000 range.

He also sent me a table with the two ram banks and how the different switches = different memory sizes. Any of the RAM Bank 1 settings all showed 3.5kb even when some should have said 11k or 19k, but when I tried the other way with RAM Bank 2 I got the right memory sizes listed upon bootup. Let me give an example.

I just cut and pasted the info I sent back to tnt/beyond force earlier, but this is what I got when I followed his table and tested the different switch settings.

RAM1 = 2 RAM2 = 1 [I got 3.5k only] Not 19k as listed.
RAM1 = 3 RAM2 = 1 [I got 3.5kb, not 11kb]
RAM1 = 5 RAM2 = 1 [I got 3.5kb and not 11kb]
RAM1 = 1 RAM2 = 2 [I got 19kb, that worked]
RAM1 = 1 RAM2 = 3 [I got 11kb, that worked]
RAM1 = 1 RAM2 = 5 [I got 11kb, that worked]

I have cleaned the edge connector a few times and they are clean. I also opened the cart and blew air via compressed air can into the switch area to clear it out in case there was some dust in there. Still the card didn't work.

As for the idea of modifying a memory card by cutting a trace and soldering, etc... I'm not experienced in electronics like that. I'm not saying its something I couldn't do if I had instructions, but its not something I've done before. Its probably easier if I just keep searching for a working Cardco card like I have, or one of the other switchable ram cards I read about. Problem will be finding them on eBay or such.


Ohh, also, tnt/beyong force sent me an image of Firegalaxy that he knew worked. He wanted me to set the ram card to 19k then load it and see what happens. the game loaded and started up, but the title and game screen was jumbled up. tnt/beyond force said that it is possible that one of the memory chips could be bad. :(
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

There is a company located in Italy, that have the cardco 16k cart on ebay, every week, for months now.

I guarantee they have one on ebay right now.

I wouldn't worry too much about going nuts bidding on it though, as they will post another one for sale, right after the current one ends.

Chris
vic user
VicGyver
Posts: 1401
Joined: Thu Mar 25, 2004 9:40 am

Post by vic user »

carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Hmm.. I think line 20 should read FOR I=0 TO 31, as 32*256 = 8192 bytes to test. Otherwise you're only testing 4K of the 8K.

It seems your RAM cartridge wants RAM1 to be mapped before RAM2, which sounds logical but stupid if all combations are possible but some not allowed. When you had RAM1=1 and RAM2=5, did the test program still fail?

Myself I own an unidentified 32K cartridge which has the following three switches:

SW1 = 8K in block 1 on/off (I believe)
SW2 = 3K in block 0, 8K in block 5 or nothing (tri-state)
SW3 = 8K in block 3 on/off

which means I can get the following combinations:

unexpanded
unexpanded + 8K in block 5
3K expansion
16K expansion
16K expansion + 8K in block 5
24K expansion
24K expansion + 8K in block 5

I belive 8K in block 2 always will be present, but it was a while ago I was playing around, so I may be wrong about that. If I have both 3K and 8K in block 1 at the same time, the computer locks up as it is confused how to configure memory. Apparently there is no priority order.

The experienced user can also see that my memory expansion can not fully emulate the Super Expander, Buti Plus, VIC Forth etc, as those cartridges come both with a ROM in block 5 and 3K expansion RAM while my expansion memory forces me to choose. I have a multi-cartridge expander too, so if I had a standalone 3K expansion, I could do it. :lol:
Anders Carlsson

Image Image Image Image Image
Disc Master I
Vic 20 Amateur
Posts: 43
Joined: Wed Mar 31, 2004 10:19 pm

Post by Disc Master I »

When you had RAM1=1 and RAM2=5, did the test program still fail?
Ok, I tried the program with switches set at RAM1 = 1 and RAM2 = 5 and got the Fail msg. I also reversed it to 5,1 and that also gave me a Fail msg. :(

[/quote]
Post Reply