Hi good afternoon.
what is the offset?
how/where does the palette offset have to be written in basic for sprites 16 color?
I don't really understand that.
where are the palettes for 16 color written?
I also have to use my palette from the system.
--------------------------
BVLOAD "SPRITE.BIN",8,1,$3000 >>>>> 64x64
BVLOAD "FUNKPAL.PAL",8,1,$fa00) ; 256 color for the system
BVLOAD "SPR.PAL",8,1,($fa00.....) >>>>>>>>> 16 color for the sprite ???
SPRMEM 1,1,$3000,0
SPRITE 1,3,0,0,3,3 >>>>> ?
MOVSPR 1,320,200
------------------------
Thanks.
greeting
------------------------
palette offset is the palette offset for the sprite. Range is 0-15 inclusive. This value is multiplied by 16 to determine the starting palette index.
-----------------------
how does it work based on the palette offset at 16 colors
- ahenry3068
- Posts: 1146
- Joined: Tue Apr 04, 2023 9:57 pm
Re: how does it work based on the palette offset at 16 colors
There is only 1 palette. The Palette for a 16 color sprite is an Offset into the 256 color hardware palette.
Re: how does it work based on the palette offset at 16 colors
hello, thanks for info.
greeting.
greeting.
Re: how does it work based on the palette offset at 16 colors
Hi good afternoon.
With the red background, the funkpal.pal from the demo program where my code was taken is not correct. So are there other system colors?
The sprites are fine in terms of color.
If I then want to have the system pal, then
Do I have to save it first?
BSAVE "SYSTEM.PAL",8,1,$FA00,$FA00 + 255 ?
why don't all colors appear?
Thanks.
greeting
this no funkpal.pal :
----------------------------------------
BVLOAD "pebispr641.bin",8,1,$3000
BVLOAD "spr641.pal",8,1,($fa00 + (16*2))
SPRMEM 1,1,$3000,0
SPRITE 1,3,1,0,3,3,0
MOVSPR 1,320,200
-----------------------------------------
this with funkpal.pal :
-----------------------------------------
BVLOAD "pebispr641.bin",8,1,$3000
BVLOAD "funkpal.pal",8,1,$fa00)
BVLOAD "spr641.pal",8,1,($fa00 + (16*2))
SPRMEM 1,1,$3000,0
SPRITE 1,3,1,0,3,3,0
MOVSPR 1,320,200
-----------------------------------------
With the red background, the funkpal.pal from the demo program where my code was taken is not correct. So are there other system colors?
The sprites are fine in terms of color.
If I then want to have the system pal, then
Do I have to save it first?
BSAVE "SYSTEM.PAL",8,1,$FA00,$FA00 + 255 ?
why don't all colors appear?
Thanks.
greeting
this no funkpal.pal :
----------------------------------------
BVLOAD "pebispr641.bin",8,1,$3000
BVLOAD "spr641.pal",8,1,($fa00 + (16*2))
SPRMEM 1,1,$3000,0
SPRITE 1,3,1,0,3,3,0
MOVSPR 1,320,200
-----------------------------------------
this with funkpal.pal :
-----------------------------------------
BVLOAD "pebispr641.bin",8,1,$3000
BVLOAD "funkpal.pal",8,1,$fa00)
BVLOAD "spr641.pal",8,1,($fa00 + (16*2))
SPRMEM 1,1,$3000,0
SPRITE 1,3,1,0,3,3,0
MOVSPR 1,320,200
-----------------------------------------
- Attachments
-
- system-farben.jpg (99.49 KiB) Viewed 569 times
-
- with-funkpal.jpg (42.62 KiB) Viewed 579 times
-
- no-funkpal.jpg (42.28 KiB) Viewed 579 times
- ahenry3068
- Posts: 1146
- Joined: Tue Apr 04, 2023 9:57 pm
Re: how does it work based on the palette offset at 16 colors
Saving the system Palette that way won't work. BSAVE doesn't work on Video Ram. After you change the Palette you do need to restore it to use it. THERE IS ONLY 1 HARDWARE PALETTE. Whatever is loaded in the HARDWARE PALETTE is used by whatever image is on the screen. For 8 bit images the entire palette is used. For 16 color (4 bit) sprites an OFFSET into the HARDWARE PALETTE tells it where the 16 Colors START. I'm attaching a DPAL.PAL here. It is a binary image of the default VERA palette.funkheld wrote: ↑Fri Mar 22, 2024 11:39 am Hi good afternoon.
With the red background, the funkpal.pal from the demo program where my code was taken is not correct. So are there other system colors?
The sprites are fine in terms of color.
If I then want to have the system pal, then
Do I have to save it first?
BSAVE "SYSTEM.PAL",8,1,$FA00,$FA00 + 255 ?
Thanks.
greeting
this no funkpal.pal :
----------------------------------------
BVLOAD "pebispr641.bin",8,1,$3000
BVLOAD "spr641.pal",8,1,($fa00 + (16*2))
SPRMEM 1,1,$3000,0
SPRITE 1,3,1,0,3,3,0
MOVSPR 1,320,200
-----------------------------------------
this with funkpal.pal :
-----------------------------------------
BVLOAD "pebispr641.bin",8,1,$3000
BVLOAD "funkpal.pal",8,1,$fa00)
BVLOAD "spr641.pal",8,1,($fa00 + (16*2))
SPRMEM 1,1,$3000,0
SPRITE 1,3,1,0,3,3,0
MOVSPR 1,320,200
-----------------------------------------
HERE'S THE DEFAULT PALETTE IMAGE (zipped)
Re: how does it work based on the palette offset at 16 colors
hello, thanks for the pal.
is an interesting story.
I have to understand the whole x16 system first.
takes longer for me.
Thanks.
greeting
is an interesting story.
I have to understand the whole x16 system first.
takes longer for me.
Thanks.
greeting
Re: how does it work based on the palette offset at 16 colors
Guess I'll put this here, seems should be topical here.
https://github.com/hstubbs3/CommanderX1 ... png_to_bin
I had just made changes to the Python code so it takes in the RGBA PNG file and then attempts to find best colors in _each_ of the 16 palette offsets ...
will have to update the GIT with some documentation later.. but for now .. as example -
first on the host - prepped my BIN file for the graphics data ( is 32 64x64 sprites at 16 colors = 64KB !)
then wrote a bas file so could do exec
so in the x16 -
BVLOAD "SPIDERS.BIN",8,0,$0000
BLOAD "SPIDERS.BAS",8,1,$8000
EXEC $8000
have no clue what the errors are but hey mostly works..
https://github.com/hstubbs3/CommanderX1 ... png_to_bin
I had just made changes to the Python code so it takes in the RGBA PNG file and then attempts to find best colors in _each_ of the 16 palette offsets ...
will have to update the GIT with some documentation later.. but for now .. as example -
first on the host - prepped my BIN file for the graphics data ( is 32 64x64 sprites at 16 colors = 64KB !)
Code: Select all
python3 png_to_bin_perceptual_4bit.py spider_128x64.png spider_128x64_4bit_perc.inc
python3 inc_to_bin.py spider_128x64_4bit_perc.inc SPIDERS.BIN
so in the x16 -
BVLOAD "SPIDERS.BIN",8,0,$0000
BLOAD "SPIDERS.BAS",8,1,$8000
EXEC $8000
have no clue what the errors are but hey mostly works..