| |
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... |
|
| |
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. |
| |
MRT Account closed
Registered: Sep 2005 Posts: 149 |
Quoting trifoxcan 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.
|
| |
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 ... |
| |
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). |
| |
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
|
| |
MRT Account closed
Registered: Sep 2005 Posts: 149 |
Quoting trifoxat 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
|
| |
MRT Account closed
Registered: Sep 2005 Posts: 149 |
Quoting trifoxthis 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.
|
| |
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. |
| |
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 .... |
| |
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 |