Attaching cartridge images in VICE

You need an actual VIC.

Moderator: Moderators

Post Reply
User avatar
srowe
Vic 20 Scientist
Posts: 1472
Joined: Mon Jun 16, 2014 3:19 pm

Attaching cartridge images in VICE

Post by srowe »

Can someone explain clearly how this is supposed to work. I've tried the various interactive menu options and none of them seem to actually present the ROM image correctly.

For starters the dialogs seem to expect .PRG files, is that right? I've tried added the start address to raw .BIN files but they still don't get loaded at the address I give. And what's the difference between 'Attach generic image...' and 'Add to generic cartridge'. The manual isn't much help, it refers to the C64 cartridge section which goes on about slots.

The only way I can get ROM images to work is to convert them to .PRGs, put them in a disk image and then load them into expansion RAM.

What am I missing? :(
rhurst
Omega Star Commander
Posts: 1375
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Re: Attaching cartridge images in VICE

Post by rhurst »

Depends greatly on the image. VICE offers a "smart attach cartridge" (ALT+C), and it works fine with the garden variety 4kb or 8kb cartridge images for me. Other cartridge images, that do not autostart at $A000 (thus the command-line argument of -cartA) and require a SYS to activate its ROM programming, need you to specify which BLOCK ($2/4/6/A/B000) address to assign it to.
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
User avatar
srowe
Vic 20 Scientist
Posts: 1472
Joined: Mon Jun 16, 2014 3:19 pm

Re: Attaching cartridge images in VICE

Post by srowe »

I'm trying to run Scott Adams Adventure ROMs. I think they're 16K starting at $4000. If I use 'Attach cartridge image' > 'Add to generic cartridge' > 'Attach 4/8/16KB cartridge image at $4000...' I get a file dialog looking for .PRG files. Whatever I select doesn't load anything at $4000.
rhurst
Omega Star Commander
Posts: 1375
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Re: Attaching cartridge images in VICE

Post by rhurst »

Ah, not your typical 16kb cartridge load. From the command-line, I do:

$ xvic -memory 2,3 -autostart 'Adventure #1 - Adventureland - SYS 32592 (1981)(Commodore).40'

... or -autoload, whichever you prefer.

From the menu UI, change VIC memory expansions to have block #2 and #3 enabled, with all others off. Then smart-attach (ALT+A) the .40 rom image file, SYS 32592

Note, I've never been able to make either method work as a compressed ZIP file.
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
User avatar
srowe
Vic 20 Scientist
Posts: 1472
Joined: Mon Jun 16, 2014 3:19 pm

Re: Attaching cartridge images in VICE

Post by srowe »

If I smart attach with the .40 file it just hangs with a black screen. If I convert it to a .PRG file by prepending $00 $40 then it does load it and I can run it with SYS 32592 but I still can't get raw images to load.
User avatar
Mayhem
High Bidder
Posts: 3007
Joined: Mon May 24, 2004 7:03 am
Website: http://www.mayhem64.co.uk
Location: London

Re: Attaching cartridge images in VICE

Post by Mayhem »

File -> Attach Cartridge Image -> Add To Generic (for versions 2.3 onwards)

Then pick the memory location you want to attach to ($20, $40, $60, $A0)

Generally the filenames will have the memory location at the end, so you know which memory address to use. In the case of Pole Position you might see:

Pole Position-6000.prg
Pole Position-A000.prg

So attach the first image to $60, the second image to $A0 and then soft reset the emulator to boot. In the case of the Scott Adams adventures, you'll SYS 32592 to start instead.
Lie with passion and be forever damned...
User avatar
srowe
Vic 20 Scientist
Posts: 1472
Joined: Mon Jun 16, 2014 3:19 pm

Re: Attaching cartridge images in VICE

Post by srowe »

But are these .PRG files, i.e. have their start address in the first two bytes? I can easily convert plain ROM dumps to .PRG but it seems a bit odd that VICE can't load them directly.
User avatar
Mike
Herr VC
Posts: 5134
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: Attaching cartridge images in VICE

Post by Mike »

rhurst wrote:From the menu UI, change VIC memory expansions to have block #2 and #3 enabled, with all others off. Then smart-attach (ALT+A) the .40 rom image file, SYS 32592 [...]
VICE does not need to have RAM expansion enabled for a certain BLK to attach a cartridge ROM there (and, when done so regardless, the RAM expansion in that BLK is automagically disabled).

Conversely, some cartridges fall over RAM expansions mapped into a address range not occupied by the cartridge ROM itself. For example, Bug Crusher runs fine as attached cartridge when there are no RAM expansions activated, but when there is RAM in BLK1, the screen gets moved to another base address by the partially executed reset routine and Bug Crusher doesn't take that into account.
srowe wrote:But are these .PRG files, i.e. have their start address in the first two bytes? I can easily convert plain ROM dumps to .PRG but it seems a bit odd that VICE can't load them directly.
I also never had issues with attaching either *.bin or *.prg files. For the "standard" file sizes of 4K/8K/16K, the emulator checks for the excess 2 bytes of a *.prg file and ignores them in that case.
rhurst
Omega Star Commander
Posts: 1375
Joined: Thu Jan 31, 2008 2:12 pm
Website: https://robert.hurst-ri.us
Location: Providence, RI
Occupation: Tech & Innovation

Re: Attaching cartridge images in VICE

Post by rhurst »

Just a disclaimer, Mike: I use VICE svn builds for Linux/GTK; maybe the magic you describe works differently, but the methods I described are its only working methods for Scott carts with my builds. Of course, those Scott cart ROM dumps I got have the 2-byte header, but I also tried it stripped too. Thus, enabling blk 2,3 is required.

Code: Select all

Extension memory enabled: 
blk2 
blk3 
 
*** VICE Version 2.4.8, rev 28557M ***
OS compiled for: Linux glibc 2.18
GUI compiled for: GTK+
CPU compiled for: AMD64/x86_64
Compiler used: GCC-4.8.3
Current OS:  (glibc 2.18)
Current CPU: Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
 
Welcome to xvic, the free portable VIC20 Emulator.
...
AUTOSTART: Autodetecting image type of `Adventure #1 - Adventureland - SYS 32592 (1981)(Commodore).40'.
Filesystem Image: Unknown disk image `Adventure #1 - Adventureland - SYS 32592 (1981)(Commodore).40'.
Tape: Error - Cannot open file `Adventure #1 - Adventureland - SYS 32592 (1981)(Commodore).40'
AUTOSTART: Loading PRG file `Adventure #1 - Adventureland - SYS 32592 (1981)(Commodore).40' with autostart disk image.
AUTOSTART: Turning true drive emulation off.
AUTOSTART: Turning true drive emulation on.
AUTOSTART: Resetting the machine to autostart '*'
AUTOSTART: Turning Warp mode on
AUTOSTART: `Adventure #1 - Adventureland - SYS 32592 (1981)(Commodore).40' recognized as program/p00 file.
...
Press ALT+H to activate the monitor shows the bytes loaded. But any other permutation typically shows me a byte pattern of $00 (or $FF) in those memory areas, despite similarly good startup messages that the binary was attached or loaded. :?

For all other carts that I've tried, they just smart attach without any extra fuss as expected/prescribed. :)
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
Post Reply