Can a0 files be run on a real Vic-20?

Discuss anything related to the VIC
User avatar
necronom
Vic 20 Dabbler
Posts: 91
Joined: Mon Jul 19, 2010 11:41 am
Location: Middlesbrough, UK
Occupation: IT Support

Can a0 files be run on a real Vic-20?

Post by necronom »

I can play games like Gorf, Radar Rat Race, and Jelly Monsters in VICE, but I want to play them on my real Vic. I've looked at them, and they seem to be "a0" files (cartridges?), and I can't get them to run.

Do I need to find a PRG version (if available), convert them to another format (if possible), or can't I play them without buying a real cart?
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

A .a0 file is (most likely) the same thing as a .prg but without the first two bytes (the loading address). Prg versions of all the carts are available here:
http://www.zimmers.net/anonftp/pub/cbm/ ... index.html

To run them on a real vic, you need ram in the right place (in block 5 for a000-carts) and then do:

load "file",8,1
sys64802

If the .a0 file indeed is a prg with the two first bytes missing, then you can just add them in some editor, add 00 followed by A0 first in the file.

You can also use pokes to load files into different places, for example:

poke 43,0
poke 44,160
load "file",8

I'm not sure if the two first bytes in a cart file are needed. If they aren't then you should be able to do:

poke 43,2
poke 44,160
load "file.a0",8
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
Diddl
Vic 20 Afficionado
Posts: 425
Joined: Wed Jun 10, 2009 3:18 am

Post by Diddl »

Boray is right, A0 files are simply normal PRG files with first two byte missing.

You can detect it also by looking for exactly filesize is 8192 Bytes.


For running on a real VIC you will need a RAM expansion on $A (block 5). Sometimes you will need a RAM expansion with write protection (ROM emulator) for games with copy protection.

You can also use a MegaCart or a Final Expansion 3 as a block 5 ROM emulator.


You cannot use a normal LOAD command, cause LOAD always use first two bytes as loading address.


Either patch A0 file with a hex editor (insert two bytes: 00 A0) or use a special LOAD command like Final Expansion has.

With Final Expansion you can load A0, 60 and any other ROM file directly with LOAD command. Simply use a SA of 2 to indicate you want to load a ROM file:

LOAD "ANY-A0-FILE",8,2,$A000

You can also use any other address for binary files using other address.
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

Boray wrote: poke 43,0
poke 44,160
load "file",8
These commands do not work for A0 8192 bytes rom image because as Diddl said, the LOAD,8 command skips first 2 bytes and writes with an offset of 2 bytes

I'm not sure if the two first bytes in a cart file are needed.
first 2 bytes of the rom image (3rd and 4th byte of the PRG files) are the execution address of the rom, so it is required.

If they aren't then you should be able to do:

poke 43,2
poke 44,160
load "file.a0",8
These commands puts bytes where they must be without first to bytes of course so the start address will be likely $00 $00 end you will probably get a crash after the SYS64802.

The meaning of the story is, use prg files of 8194 bytes unless you don't use wedge commands.
Mega-Cart: the cartridge you plug in once and for all.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

nbla000 wrote:
If they aren't then you should be able to do:

poke 43,2
poke 44,160
load "file.a0",8
These commands puts bytes where they must be without first to bytes of course so the start address will be likely $00 $00 end you will probably get a crash after the SYS64802.

The meaning of the story is, use prg files of 8194 bytes unless you don't use wedge commands.
Or you could just write down the two first bytes and poke them into $A000 and $A001 as well.
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

Boray wrote:Or you could just write down the two first bytes and poke them into $A000 and $A001 as well.
Yes of course but how to easily know which value to POKE on $a000 and $a001 ? OPEN etc etc

better to use a prg :wink:
Mega-Cart: the cartridge you plug in once and for all.
User avatar
necronom
Vic 20 Dabbler
Posts: 91
Joined: Mon Jul 19, 2010 11:41 am
Location: Middlesbrough, UK
Occupation: IT Support

Post by necronom »

So if I understood that correctly, I still need RAM at block 5 regardless of the file I use, which I can't do with a normal RAM pack (I have a Vixen 16k switchable one).

Hasn't anyone been able to convert them to run in a normal 16k Vic, by changing their address, as at the moment it seems like only people emulating or with special cartridges can run them?

I think I'm just going to have to leave those, and play them in VICE, or look for non-cart versions, if there were any.
User avatar
Mike
Herr VC
Posts: 4839
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Boray wrote:If they aren't then you should be able to do:

Code: Select all

poke 43,2
poke 44,160
load "file.a0",8
These commands puts bytes where they must be without first to bytes of course [...]
I'd like to point out that this method will invoke the BASIC line re-link routine. Even though the cartridge raw binary is loaded to $A002, this applies unpredictable changes up to where 3 consecutive 0's are found, and may even "hang" the VIC-20, if a "line" happens to be longer than 255 bytes. Thus this is a method highly *not* recommended. These files are mainly intended for being burned into an EPROM.

VICE can cope with raw binaries, because you know the load address - and then attach the file as cartridge image at this address. *.prg files with start address are special cased in VICE, when attached as cartridge image, and recognized by their 2-byte over-length - here VICE ignores the first two bytes of the file.

As nbla000 points out, best stick with *.prg files including the load address as first two bytes, when using real hardware.
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Post by tlr »

necronom wrote:So if I understood that correctly, I still need RAM at block 5 regardless of the file I use, which I can't do with a normal RAM pack (I have a Vixen 16k switchable one).

Hasn't anyone been able to convert them to run in a normal 16k Vic, by changing their address, as at the moment it seems like only people emulating or with special cartridges can run them?
I've done this with Omega-Race, see this thread.
It is quite hard work. I wouldn't start mass-converting games. ;)
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

tlr wrote:I've done this with Omega-Race, see this thread.
And by following your example I've done the same for:
Centipede (Vic+16k)
Dig Dug (Vic+16k)
Donkey Kong (Vic+16k)
Frogger (Vic+8K)
Pacman (Vic+8K)
Polaris (Vic+8K)
Raid on Fort Knox (Vic+8K)

Grab them here.
tlr wrote:It is quite hard work. I wouldn't start mass-converting games. ;)
Yes I agree, I don't think I will do a similar work in the future :roll:
Mega-Cart: the cartridge you plug in once and for all.
User avatar
necronom
Vic 20 Dabbler
Posts: 91
Joined: Mon Jul 19, 2010 11:41 am
Location: Middlesbrough, UK
Occupation: IT Support

Post by necronom »

Wow! Excellent work, both of you.

It's great that people can now play those carts on original hardware without a modern specialist cart (or whatever allows you to have things in block 5).
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

yes but you may load also any other 8k cart image by using a standard 8k commodore expansion by opening it and changing the switch to address RAM to BLK5 instead of BLK1 as factory setted:

Code: Select all

     Commodore 8K Expansion     
(Remove the case, Switches inside)
        BLK        Switch       
         1             4         
         2             3         
         3             2         
         5             1         
For example to move 8K to BLK5 move switch 1 up and any other down, the factory settings are switch 4 up and any other down.

By using this tecnique you may have a Vic+32K with 1 standard 16k expansion + 2 standard 8k expansion and a cart port expander of course.
Mega-Cart: the cartridge you plug in once and for all.
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Mike wrote: I'd like to point out that this method will invoke the BASIC line re-link routine. Even though the cartridge raw binary is loaded to $A002, this applies unpredictable changes up to where 3 consecutive 0's are found, and may even "hang" the VIC-20, if a "line" happens to be longer than 255 bytes. Thus this is a method highly *not* recommended.
I always did that with cartridge files copied on tape as a kid because they didn't have the correct starting address. I guess someone had hacked a vic-20 expander routing block 5 to block 3 to be able to save them without having the game to start. So I always did this:

poke43,0:poke44,160
load
sys64802

And there was never any problems with the games. (Those numbers are deeply engraved in my brain :) )
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Mike
Herr VC
Posts: 4839
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Mike wrote:[...] this is a method highly *not* recommended.
Boray wrote:I always did that with cartridge files copied on tape [...] and there was never any problems with the games.
You just were very lucky. Please try your method with the *.prg cartridge image of Super Expander. The VIC hangs after displaying the READY prompt.
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Post by tlr »

nbla000 wrote:And by following your example I've done the same for:
Centipede (Vic+16k)
Dig Dug (Vic+16k)
Donkey Kong (Vic+16k)
Frogger (Vic+8K)
Pacman (Vic+8K)
Polaris (Vic+8K)
Raid on Fort Knox (Vic+8K)

Grab them here.
I didn't know you did so many, impressive! :)
Post Reply