I am a fool when it comes to the PCXTool
Posted: Fri Jun 27, 2014 9:53 pm
Hi Guys,
I have loved the Turbo since I was kid. I now have a flash cart and I have enjoyed the likes of Ninja Gaiden, Magical Chase, and Parasol Stars on my North American Turbo!
It's time to take it to the next level and make a game! I am not a total noob as I have some C coding experience.
I am able to compile with HuC no problem. I did however run into a major issue when loading a .pcx file generated from Adobe PhotoShop CS5.
The 32x32 .pcx appeared as a black box when testing the compiled code!
After some poking around I found the PCXTool.exe and figured hey I guess I need to use this nifty tool to get PCE graphics formatted properly for my game.
I used the pcxtool -dump GoodFile.pcx to compare against the results of using the same command on my bad file.
What I found is that on the bad file all of my palette entries where on the bottom (in the F zone like this is F----ing annoying!) and in the
good file all my palette entries where on the top starting at position $00.
I wrote this little .bat file to see what would happen when processing my lame .pcx file. that displays as a blackbox when I compile and run code that includes it.
pcxtool -swap $F0 $00 NewGraphic.pcx NewGraphic1.pcx
pcxtool -swap $F1 $01 NewGraphic1.pcx NewGraphic2.pcx
pcxtool -swap $F2 $02 NewGraphic2.pcx NewGraphic3.pcx
pcxtool -swap $F3 $03 NewGraphic3.pcx NewGraphic4.pcx
pcxtool -swap $F4 $04 NewGraphic4.pcx NewGraphic5.pcx
pcxtool -swap $F5 $05 NewGraphic5.pcx NewGraphic6.pcx
pcxtool -swap $F6 $06 NewGraphic6.pcx NewGraphic7.pcx
pcxtool -swap $F7 $07 NewGraphic7.pcx NewGraphic8.pcx
pcxtool -swap $F8 $08 NewGraphic8.pcx NewGraphic9.pcx
pcxtool -swap $F9 $09 NewGraphic9.pcx NewGraphic10.pcx
pcxtool -swap $FA $0A NewGraphic10.pcx NewGraphic11.pcx
pcxtool -swap $FB $0B NewGraphic11.pcx NewGraphic12.pcx
pcxtool -swap $FC $0C NewGraphic12.pcx NewGraphic13.pcx
pcxtool -swap $FD $0D NewGraphic13.pcx NewGraphic14.pcx
pcxtool -swap $FE $0E NewGraphic14.pcx NewGraphic15.pcx
pcxtool -swap $FF $0F NewGraphic15.pcx PceFormattedGraphic.pcx
Here's the thing upon compiling my code it was a bitter sweet victory the graphic loaded perfectly a little too perfectly! The background colour was still fully intact! Now my graphic has a pink box around it!
What I can say is that I did Index my sprite to 16 colors my knockout or background colour is the first entry in the palette. I noticed the references are still all at the bottom in the F zone (F for F--- so close yet so far)
even though my palette entries are placed correctly at the top of the file in the $00.
With the -pcepal -pcepal2 flags I haven't had any luck. I have performed tests with no positive results. Does anybody know what their purposes are in terms formatting graphics for display?
Most importantly if anybody could point in the right direction as to how to get my background colour knocked out when my image is displayed it would be much appreciated.
I have tried Gimp, Irfan View, YY-CHR and even looked for a version of Paint Brush for Win 3.1
Any useful graphics editors that export .pcx files in the right format for .PCE would also be greatly appreciated.
Thanks for your time!
I have loved the Turbo since I was kid. I now have a flash cart and I have enjoyed the likes of Ninja Gaiden, Magical Chase, and Parasol Stars on my North American Turbo!
It's time to take it to the next level and make a game! I am not a total noob as I have some C coding experience.
I am able to compile with HuC no problem. I did however run into a major issue when loading a .pcx file generated from Adobe PhotoShop CS5.
The 32x32 .pcx appeared as a black box when testing the compiled code!
After some poking around I found the PCXTool.exe and figured hey I guess I need to use this nifty tool to get PCE graphics formatted properly for my game.
I used the pcxtool -dump GoodFile.pcx to compare against the results of using the same command on my bad file.
What I found is that on the bad file all of my palette entries where on the bottom (in the F zone like this is F----ing annoying!) and in the
good file all my palette entries where on the top starting at position $00.
I wrote this little .bat file to see what would happen when processing my lame .pcx file. that displays as a blackbox when I compile and run code that includes it.
pcxtool -swap $F0 $00 NewGraphic.pcx NewGraphic1.pcx
pcxtool -swap $F1 $01 NewGraphic1.pcx NewGraphic2.pcx
pcxtool -swap $F2 $02 NewGraphic2.pcx NewGraphic3.pcx
pcxtool -swap $F3 $03 NewGraphic3.pcx NewGraphic4.pcx
pcxtool -swap $F4 $04 NewGraphic4.pcx NewGraphic5.pcx
pcxtool -swap $F5 $05 NewGraphic5.pcx NewGraphic6.pcx
pcxtool -swap $F6 $06 NewGraphic6.pcx NewGraphic7.pcx
pcxtool -swap $F7 $07 NewGraphic7.pcx NewGraphic8.pcx
pcxtool -swap $F8 $08 NewGraphic8.pcx NewGraphic9.pcx
pcxtool -swap $F9 $09 NewGraphic9.pcx NewGraphic10.pcx
pcxtool -swap $FA $0A NewGraphic10.pcx NewGraphic11.pcx
pcxtool -swap $FB $0B NewGraphic11.pcx NewGraphic12.pcx
pcxtool -swap $FC $0C NewGraphic12.pcx NewGraphic13.pcx
pcxtool -swap $FD $0D NewGraphic13.pcx NewGraphic14.pcx
pcxtool -swap $FE $0E NewGraphic14.pcx NewGraphic15.pcx
pcxtool -swap $FF $0F NewGraphic15.pcx PceFormattedGraphic.pcx
Here's the thing upon compiling my code it was a bitter sweet victory the graphic loaded perfectly a little too perfectly! The background colour was still fully intact! Now my graphic has a pink box around it!
What I can say is that I did Index my sprite to 16 colors my knockout or background colour is the first entry in the palette. I noticed the references are still all at the bottom in the F zone (F for F--- so close yet so far)
even though my palette entries are placed correctly at the top of the file in the $00.
With the -pcepal -pcepal2 flags I haven't had any luck. I have performed tests with no positive results. Does anybody know what their purposes are in terms formatting graphics for display?
Most importantly if anybody could point in the right direction as to how to get my background colour knocked out when my image is displayed it would be much appreciated.
I have tried Gimp, Irfan View, YY-CHR and even looked for a version of Paint Brush for Win 3.1
Any useful graphics editors that export .pcx files in the right format for .PCE would also be greatly appreciated.
Thanks for your time!