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 > Kickassembler - Converting .PNG to Koala
2012-02-21 15:04
TWW

Registered: Jul 2009
Posts: 545
Kickassembler - Converting .PNG to Koala

Hey fellow hackers.

I wanted to write a converter in Kickassembler which can take any .PNG MC Bitmap screenshot from VICE (Then I don't need to worry about the RGB values since they are known) and convert into raw data you can use in your productions.

This is the way I imagine doing it:

#1 - Determin the background collor based on the most used collor in the picture
#2 - Verify there is no 4x8 block containing more than 3 collors+BG
#3 - Convert each 4x8 block afterwards and write the data into 3 lists (1 for BMP data, 1 for Charcollors and 1 for collmem).
#4 - Add BG collor at the end :-)

I'm looking for improvement comments on this or maybee I need to revise the way I think about this?
 
... 40 posts hidden. Click here to view all posts....
 
2012-04-17 05:38
Total Chaos

Registered: Mar 2006
Posts: 74
I did warn you I was stupid ;)

The error I get is non-specific, it just says "Error on line .." and it's on the first line of the macro:

// .macro PNGtoKOALA(PNGpicture,BMPData,Chardata,D800data,BGC) {
.macro PNGtoKOALA("320x200.png", $2000, $5000, $6000, $7000) {

parsing
//----------------------------------------------------------

// .macro PNGtoKOALA(PNGpicture,BMPData,Chardata,D800data,BGC) {
.macro PNGtoKOALA("320x200.png", $2000, $5000, $6000, $7000) { <-- Row 81
^

Error: Syntax error
at line 81, column 32 in C:\c64\sources\www.asm

But to be honest, I did not get the Are you sure you have the same RGB values?
I just copy/paste'ed from codebase...

So, I need to set that up first? (and where will I find this info?)

//Total Chaos aka Dumbass
2012-04-17 08:48
Cruzer

Registered: Dec 2001
Posts: 1048
Total Chaos: You seem to have replaced the definition of the macro with the parameters used for calling it. So change it back to:
.macro PNGtoKOALA(PNGpicture,BMPData,Chardata,D800data,BGC) {
And call it with:
:PNGtoKOALA("320x200.png", $2000, $5000, $6000, $7000)

2012-04-17 11:49
Total Chaos

Registered: Mar 2006
Posts: 74
Yes! That was it.. (bangs head on table)
Now to figure out the hash-table-thingy-rgb-stuff...

Thanks guys
2012-10-21 00:37
TWW

Registered: Jul 2009
Posts: 545
    // VICE C64 PALETTE
    .struct RGB {r,g,b}  // Based on standard vice colors
    .const black   = RGB(  0,  0,  0) // #$000000
    .const white   = RGB(255,255,255) // #$FFFFFF
    .const red     = RGB(137, 64, 54) // #$894036
    .const cyan    = RGB(122,191,199) // #$7ABFC7
    .const purple  = RGB(138, 70,174) // #$8A46AE
    .const green   = RGB(104,169, 65) // #$68A941
    .const blue    = RGB( 62, 49,162) // #$3E31A2
    .const yellow  = RGB(208,220,113) // #$D0DC71
    .const l_brown = RGB(144, 95, 37) // #$905F25
    .const d_brown = RGB( 92, 71,  0) // #$5C4700
    .const l_red   = RGB(187,119,109) // #$BB776D
    .const d_grey  = RGB( 85, 85, 85) // #$555555
    .const grey    = RGB(128,128,128) // #$808080
    .const l_green = RGB(172,234,136) // #$ACEA88
    .const l_blue  = RGB(124,112,218) // #$7C70DA
    .const l_grey  = RGB(171,171,171) // #$ABABAB

    .const Black   =   black.r * 65536 +   black.g * 256 +   black.b
    .const White   =   white.r * 65536 +   white.g * 256 +   white.b
    .const Red     =     red.r * 65536 +     red.g * 256 +     red.b
    .const Cyan    =    cyan.r * 65536 +    cyan.g * 256 +    cyan.b
    .const Purple  =  purple.r * 65536 +  purple.g * 256 +  purple.b
    .const Green   =   green.r * 65536 +   green.g * 256 +   green.b
    .const Blue    =    blue.r * 65536 +    blue.g * 256 +    blue.b 
    .const Yellow  =  yellow.r * 65536 +  yellow.g * 256 +  yellow.b
    .const L_brown = l_brown.r * 65536 + l_brown.g * 256 + l_brown.b
    .const D_brown = d_brown.r * 65536 + d_brown.g * 256 + d_brown.b
    .const L_red   =   l_red.r * 65536 +   l_red.g * 256 +   l_red.b
    .const D_grey  =  d_grey.r * 65536 +  d_grey.g * 256 +  d_grey.b
    .const Grey    =    grey.r * 65536 +    grey.g * 256 +    grey.b
    .const L_green = l_green.r * 65536 + l_green.g * 256 + l_green.b
    .const L_blue  =  l_blue.r * 65536 +  l_blue.g * 256 +  l_blue.b
    .const L_grey  =  l_grey.g * 65536 +  l_grey.g * 256 +  l_grey.b




I should have posted this earlier :-)
2013-08-11 15:48
TWW

Registered: Jul 2009
Posts: 545
Necro thread but just to let anyone interested know, I've added a macro alowing you to load up your HiRes PNG pictures as well on codebase:

http://codebase64.org/doku.php?id=base:kick_assembler_macros&#l..
2015-05-29 19:36
xIII

Registered: Nov 2008
Posts: 210
necro thread v2

Can some1 add this list to the kickasm source at codebase ?
2015-05-31 19:37
TWW

Registered: Jul 2009
Posts: 545
I added the collor definition listing to codebase. I do however recomend looking at the routine by Pantaloon as it allows more flexibility.
Previous - 1 | 2 | 3 | 4 | 5 - 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
Scrap/Genesis Project
Guests online: 75
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Triad  (9.3)
5 Censor Design  (9.3)
Top Webmasters
1 Slaygon  (9.6)
2 Perff  (9.6)
3 Sabbi  (9.5)
4 Morpheus  (9.4)
5 CreaMD  (9.1)

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