Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > bitmap display/extraction
2006-08-11 02:42
Trifox
Account closed

Registered: Mar 2006
Posts: 108
bitmap display/extraction

hi all, i have a severe problem, i have some pictures, they are mulcticolor only, so it should be easy to extract the image data from it, can anyone point me to a description of those .prg multicolor images?

btw. i have a font/charset ( 2x2) in png format, what is the easiest/fastest way to get a c64 charset from it? i would not like to write a converter for this .,..

can there be a program wich outputs the bytes (valued 0..3 so, to bits a pixel) only????

time is runing out...
2006-08-11 08:35
Jetboy

Registered: Jul 2006
Posts: 221
Try some programs on pc that deal with c64 stuff - Thimanthes, ConGo.

As for converting png font, just convert image to c64, and then use centauri logo editor to change the bitmap into c64 font (though you will need 4 character map for each leter).

There are description of c64 formats in ConGo.
2006-08-11 13:19
MRT
Account closed

Registered: Sep 2005
Posts: 149
Quoting trifox
can anyone point me to a description of those .prg multicolor images?

There is no standard for .prg files for images. There are multiple well-known formats though, such as Amica Paint format or Koala Paint format for example.
For which formats are you searching?


Some formats write the .prg files as runnable files. If this is the case for your .prg files, it's quite easy to extract the images.
Just run the .prg file and check which VIC bank is beeing displayed ($dd00). Then check where (inside the VIC bank) the charset (bitmap data) resides ($d018).
Write $1f40 bytes to disk.
Also check the VideoMatricBaseAddress (normal charscreen) in $d018. This is where you find some of the color data.
Write $3e8 bytes to disk.
And then at last, at $d800 you will find the remaining color data.
Write $3e8 bytes to disk.

Oh, and check $d021 for the background color :-)

That should be it for normal multicolor bitmap mode.
2006-08-11 13:27
Trifox
Account closed

Registered: Mar 2006
Posts: 108
ok, thank you for reply, at first i have a hires picture, 320x200 pixel big, ( only used some pixels for chars) now i want to extract this image, is it right that this hires pic is located from $0400-somewhere? where 8 consecutive bits form a 8x8 pixel block on screen ? so all i have to do is to read 8 bytes and put them in my char memory ... ;)? correct me if iam wrong ... i think i will load such a prg file at the tail of my asm proggy, and search for the data area, i hope it is a connected block of memory ...
2006-08-11 13:33
Stryyker

Registered: Dec 2001
Posts: 465
What was used to create the images? If you don't know then do you know the file size?

Most bitmap gfx editors store the bitmap data then the colour data. When testing I would often load the file to $2000 (8192) then change the VIC screen/charset point to use that as the bitmap or charset (poke 53272,24 or something). poke 53269,59 and you'll sort of see it.

If you load a font in to $2000 you'll see how the first 8 bytes = character $00, the next 8 bytes loaded are for character $01 etc. The 8 bytes are arranged so the first byte = first line at the top, bext byte = next line down until you get your 8 pixel height (so 8 bytes = 1 character).
2006-08-11 14:10
Trifox
Account closed

Registered: Mar 2006
Posts: 108
here is the charset picture, created with congo ... i need urgent help with that gfx stuff, cause i would like to release a demo tomorrow, text output is fine already, all i need is this )=/$()=/$(=)/ 2x2 charset, beside of that i would like to extract a picture from a multicolor image

this one is the 2x2 font as hires picture
http://www.fractalmovies.com/c64/charset.prg
2006-08-11 14:19
MRT
Account closed

Registered: Sep 2005
Posts: 149
Quoting trifox
at first i have a hires picture, 320x200 pixel big, ( only used some pixels for chars) now i want to extract this image, is it right that this hires pic is located from $0400-somewhere?


NO! Without knowing the programm which created the file or knowing (figuring out) the fileformat, you can never be sure where the image data resides in the file.

AND... For Hires bitmaps, it works in an otherway then MultiCol bitmaps.
1. You don't have additional color data at $d800
2. You don't use $d021 (screen background color)

So, in other words... You have only two data banks in your hires file.
1. Charscreen data (colors in high and low nybles)
2. Bitmap data

Charscreen data is $3e8 bytes long
Bitmap data is $1f40 bytes long

So, if your file-size (in bytes) is 9002 ($232a), try to cut-up your .prg file like this:
2 bytes for mem address
$3e8 byes charscreen data
$1f40 bytes bitmap data

or like this
2 bytes for mem address
$1f40 bytes bitmap data
$3e8 byes charscreen data


If your size (in bytes) is more like 9218 ($2402), try to cut-up your .prg like this:
2 bytes for mem address
$400 byes charscreen data
$2000 bytes bitmap data

or like this
2 bytes for mem address
$2000 bytes bitmap data
$400 byes charscreen data

2006-08-11 14:27
MRT
Account closed

Registered: Sep 2005
Posts: 149
Quoting trifox
this one is the 2x2 font as hires picture
http://www.fractalmovies.com/c64/charset.prg

When you load this image and press space and the chars are beeing displayed...
your colordata is at $0400
your bitmap data is at $2000

Just open it in Vice and use monitor to write $2000 to $3f40 to file..

But then still... It's going to be a bitch to use this bitmap data straight up as a charset, coz the parts of the chars aren't well sorted.
2006-08-11 14:28
enthusi

Registered: May 2004
Posts: 675
An also common yet a bit wasty format is coloram at $5c00 and bitmap data at $6000. The Hires-Ed I use uses that.
2006-08-11 14:41
Trifox
Account closed

Registered: Mar 2006
Posts: 108
okay thank you for that explanation, i will try it out ... resorting the chars is then my problem, but if i got them, it should be no problem anymore ....
2006-08-11 14:44
MRT
Account closed

Registered: Sep 2005
Posts: 149
Quote: okay thank you for that explanation, i will try it out ... resorting the chars is then my problem, but if i got them, it should be no problem anymore ....

K, try to resort them in a way that you don't use more then $800 bytes for the bitmap data. That way you make sure that you can use it as a charset...
Then you'll have to save it from $2000 to $2800 ;-)
 
... 22 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 | 4 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Sentinel/Excess/TREX
eryngi
MCM/ONSLAUGHT
fredrikr
kbs/Pht/Lxt
Guests online: 156
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 MWS  (9.6)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.039 sec.