r/c64 2d ago

Programming Saving bitmap mode graphics?

Post image
6 Upvotes

5 comments sorted by

3

u/Ok-Parking-9383 1d ago edited 1d ago

If you open the monitor in Vice, you can save memory to floppy by using the bs or s commands. The difference between them is that bs does not save the 2-byte loading address, while s does.

For example, if you want to save bitmap data from 16384-24383 ($4000-$5f3f in hexadecimal format) without the loading adress, you type:

bs "picture" 8 4000 5f3f

8 is the drive number. To write to your pc harddrive, use drivenumber 0. It will write to the current directory vice is looking at. You can add the path to the filename, or use commands like pwd and cd to see and change the current directory.

I think you can use decimal numbers as well by adding a + before the numbers, like this:

bs "picture" 8 +16384 +24383

1

u/AutomaticDoor75 2d ago

I've been working on a program to convert images to standard bitmap mode. I have a workflow that's based around the HTML <canvas> element, JavaScript, BASIC, and VICE.

Now I'm trying to figure out how I can save these images to a floppy, or any storage, really. I was assuming there would be some kind of "BSAVE" command I'd use at the end of this. Boy was I wrong. 8-(

Here's the code I used to produce the image in this post: https://codeberg.org/nantucketlit/canvas_to_c64

Any advice on saving an image once you get it loaded into the RAM you set aside for bitmap mode?

2

u/morsvensen 1d ago

Check out an established/classic image format like Koala Painter.

1

u/siliconlore 2d ago

You already poked the data into memory. Saving it should be as easy as opening a file and writing those bytes out in a loop. You can do the same with the color map and either save it separately or at the end of the file.

1

u/Crlan420 1d ago

You might want to look into a C64 Ultimate or FlashMaster. They have bitmap capture functions that make this a lot easier than tape.