| |
spider-j
Registered: Oct 2004 Posts: 498 |
Release id #244202 : png2prg 1.8
Awesome job again Burglar! Thanks!
But one thing for the "wishlist":
It would be nice if your console output would provide a "machine recognizable" line what the final output format is.
Somewhere (I think between 1.4 and 1.6) you changed the output so that my conversion script broke.
I like to keep all the "original" files (CharPad, SpritePad, SID, PNG) in a resources folder which get converted to C64 binaries as I need them to my sources folder. For PNG of course I want to use png2prg, but as it can output different formats I need a way to get the format for further treatment with dd etc.
This here i.e. worked in the past:
function getPng2PrgOutputFormat(array $output) : string
{
$convLine = '';
/*
* find the line with the converted info
* png2prg echoes a line like this:
*
* converted "INFILE" to "OUFILE" in "FORMAT" format
*
* step 1.) look for a line starting with 'converted'
*/
foreach ($output as $line)
{
if (substr($line, 0, 9) === 'converted')
{
$convLine = $line;
break;
}
}
/*
* step 2.) split the line on char " to array
* and return element '5' with the FORMAT
*/
$convLineArr = explode('"', $convLine);
if (!array_key_exists('5', $convLineArr)) return '';
return trim($convLineArr['5']);
}
From what I can tell now there would be two lines to consider:
file "INFILE" has graphics mode: FORMAT/FINALFORMAT
falling back to FINALFORMAT because FORMAT for "INFILE" failed
This makes everything much more complicated.
EDIT: also having the output format in quotes was very good because it can contain a space :) |
|
| |
Burglar
Registered: Dec 2004 Posts: 1090 |
Quoting spider-jAwesome job again Burglar! Thanks!
But one thing for the "wishlist":
It would be nice if your console output would provide a "machine recognizable" line what the final output format is.
Cheers Spider!
This is actually solvable with the current version already, in 2 ways even:
1. Use the -sym flag
The -sym or -symbols flag makes png2prg write an output.sym file that looks like this for koala:bitmap = $2000
screenram = $3f40
colorram = $4328
d020color = 0
d021color = 1 imho thats machine readable :)
2. Use -mode koala
When using -m <mode> or -mode <mode>, the gfxmode is forced and fallback is disabled.
And you are right, it did change between 1.4 and 1.6 to accommodate additional charset formats that cannot be distinguished by just counting colors per char.
Because I want default conversion to really do it's best to always provide a .prg, more fallback methods got introduced. For example when a pic looks like hires, I will first try ECM.
That said, I will add a final output line specifying the gfxmode. I think it's a good addition regardless. |
| |
spider-j
Registered: Oct 2004 Posts: 498 |
Ah, thanks for the hint with -sym. That'll do the trick for now.
Option 2. is something I wanted to avoid, because I want to be able to just throw a bunch of PNGs that could contain anything into a dir and rely on your autodetection ;-) |
| |
Burglar
Registered: Dec 2004 Posts: 1090 |
Quoting spider-jOption 2. is something I wanted to avoid, because I want to be able to just throw a bunch of PNGs that could contain anything into a dir and rely on your autodetection ;-)
I actually already added the requested feature. You just need to build from current source.
It will print this:
write 8356 bytes to "q.prg" in "koala" format. |
| |
spider-j
Registered: Oct 2004 Posts: 498 |
Awesome, that's perfect. Thank you! :-) |