CPCWiki forum

General Category => Technical Support - Software related => Topic started by: khaz on 17:49, 03 November 17

Title: converting an image to show on the CPC with the correct palette
Post by: khaz on 17:49, 03 November 17
"with the correct palette" is the part I fail.

I'm using cpcimgconv 0.17 to create a .scr, without changing any option.
I transfer it with a header into a .dsk via winape
I switch to mode 0 then use the command LOAD"FILE.SCR",&C000
The image appear, except it's not using the palette made by convimgcpc

Same if I read the scr in OCP.
Only if I generate a separate .pal file and load that in OCP do I get the correct image.

In convimgcpc I tried generating a .asm, but it doesn't contain palette information
(compared to the listing on that page (http://www.cpcmania.com/Docs/Programming/Converting_and_displaying_an_image_on_the_screen.htm), I'm missing the palette line entirely.)

What am I missing?
Title: Re: converting an image to show on the CPC with the correct palette
Post by: SRS on 18:32, 03 November 17
Quote from: khaz on 17:49, 03 November 17(compared to the listing on that pa

They add the palette code manually, "Finally add the palette, keys and record the file as being rihanna.h ..."

The Screen Binary (as a memory dump from &C000 with length &3fff) itself does not have the palette information in it.

We always have to take care of changing the inks for ourselfs. That's what I remember from the 80ies :)

Title: Re: converting an image to show on the CPC with the correct palette
Post by: khaz on 19:48, 03 November 17
Quote from: SRS on 18:32, 03 November 17
We always have to take care of changing the inks for ourselfs. That's what I remember from the 80ies :)

Fair enough, that's what I'll do.

Out of curiousty, what's that CALL &C7D0 mentioned in the second post of this thread:
http://www.cpcwiki.eu/forum/applications/something-regarding-the-advanced-art-studio-gt-c000/
?
(and load"",&4000 doesn't work here, it gives me a memory full error message.)
Title: Re: converting an image to show on the CPC with the correct palette
Post by: HAL6128 on 19:56, 03 November 17
You can save the palette seperatly (right on the bottom of the App). It will Save a *.pal file which contains the palette code and which could also be loaded by ocp.
Title: Re: converting an image to show on the CPC with the correct palette
Post by: khaz on 19:59, 03 November 17
Quote from: HAL 6128 on 19:56, 03 November 17
You can save the palette seperatly (right on the bottom of the App). It will Save a *.pal file which contains the palette code and which could also be loaded by ocp.
Yes I tried that and it works, I was wondering about how to do that directly from the prompt, and how, if possible at all, store the palette information in the .scr.

Though I now have typed all my palette into a little basic programme, perhaps it may be of use for other people?
Title: Re: converting an image to show on the CPC with the correct palette
Post by: Duke on 20:19, 03 November 17
Quote from: khaz on 19:48, 03 November 17
Fair enough, that's what I'll do.

Out of curiousty, what's that CALL &C7D0 mentioned in the second post of this thread:
http://www.cpcwiki.eu/forum/applications/something-regarding-the-advanced-art-studio-gt-c000/ (http://www.cpcwiki.eu/forum/applications/something-regarding-the-advanced-art-studio-gt-c000/)
?
(and load"",&4000 doesn't work here, it gives me a memory full error message.)

Don't think the palette is stored in the .SCR files by Art Studio, although there would be room for it.
You would have to do
memory &3FFF:load"filename",&4000
To avoid the memory full message.

I made a small basic program many moons ago, to generate a .BAS file with the inks from the Art Studio .PAL file, probably isn't any use now. Attached anyway.
Title: Re: converting an image to show on the CPC with the correct palette
Post by: ZbyniuR on 14:18, 04 November 17
My shorter version Basic to set pallette from .PAL file:

110 BORDER 0:IF PEEK(&BB5B)=0 THEN p=45530 ELSE p=47061  ' this line check version of CPC: 464 or 6128
120 LOAD name$+".pal",&7F00:m=PEEK(&7F00):IF m<3 THEN MODE m:FOR a=0 TO 15:i=PEEK(&7F03+a*12):POKE p+a,i:POKE p+17+a,i:NEXT    ' if m is bigger, thats mean this pallette file is with colors for CPC PLUS

So if you want see pictures from PLUS on OLD CPC, this lines below convert palette of 4096 into palette 125 blinking colors, thats close enough to enjoy the picture. :)

130 MODE 0:SPEED INK 1,1:DEFINT r  '  here LOAD name$+".pal",&7F00  if it nessesery ;)
140 FOR i=0 TO 15:i(2)=PEEK(&7F08+i*2):i(3)=i(2)AND 15:i(2)=(i(2)AND 240)/16:i(1)=PEEK(&7F09+i*2):FOR a=1 TO 3:IF i(a)<3 THEN i(a)=0 ELSE IF i(a)<6 THEN i(a)=1 ELSE IF i(a)<10 THEN i(a)=2 ELSE IF i(a)<13 THEN i(a)=3 ELSE i(a)=4
150 NEXT:r2=i(2)\2:g1=i(1)\2:b2=i(3)\2:r=(i(2)+1)\2:g2=(i(1)+1)\2:b=(i(3)+1)\2:IF g1=g2 OR b=b2 THEN r1=r2:r2=r:r=r1
160 INK i,b+r*3+g1*9,b2+r2*3+g2*9:NEXT:  ' that is good moment to load screen :)

If you need binary procedure to show compressed ART STUDIO scr file try my  0.BAS  program from post-link below.
There is binary code at &A500, just 114 bytes long. This version program need compressed scr if palette is old (LOAD name$+".scr",&6100:CALL &A500) and not compressed scr if palette is for plus (LOAD name$+".scr",&C000).
Any comments and likes welcome. ;)

http://www.cpcwiki.eu/forum/other-retro/proof-that-the-commodre-64-palette-is-far-superior-to-the-amstrad-cpc/msg119731/#msg119731
Powered by SMFPacks Menu Editor Mod