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 > convert between MC sprite data and MC Font data?
2006-08-05 14:51
Trifox
Account closed

Registered: Mar 2006
Posts: 108
convert between MC sprite data and MC Font data?

hi2all, unfortunately i crossed a problem, when doing sprite multicolor graphics and font multicolor graphics, the problem is, i cant use the same sprite data in my MC Font data, the problem is:
color index in MC Text mode is determined by
"00": Background color 0 ($d021)
"01": Background color 1 ($d022)
"10": Background color 2 ($d023)
"11": Color from bits 8-10 of c-data

the dynamic color code is "11" and for sprite data it is

"00": Transparent
"01": Sprite multicolor 0 ($d025)
"10": Sprite color ($d027 - $d02e)
"11": Sprite multicolor 1 ($d026)

the dynamic color code is here "10", what a pitty, now i need a fast method of converting all "10"'s to "11"'s and vice versa, do i need to shift around and create the other bitcombination, or is there a faster method?
2006-08-05 15:20
tlr

Registered: Sep 2003
Posts: 1714
A 256 byte lookup table would be fast, i.e similar to:
ldx fontbyte
lda lut,x
sta spritebyte
Even faster would be store another copy of the charset, preconverted. ;)

What is it supposed to be used for?
2006-08-05 15:41
Trifox
Account closed

Registered: Mar 2006
Posts: 108
oh, its just for my little game i am actually on, i am first experimenting with font multicolor mode, but ran into this problem, i think i will build a complete lookuptable, its fast and easy .. ;) ii have written a routine for doing that with register a ... so, building a table can be quite easy
2006-08-05 16:34
Hein

Registered: Apr 2004
Posts: 933
or use

lda fontbyte
eor #%01010101
sta spritebyte

but you'd have to make $d022 your background colour and $d021 becomes object colour 1 (for instance a happy mushroom).
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
encore
Apollyon/ALD
cba
Linus/MSL
Honcho
Guests online: 168
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Swappers
1 Derbyshire Ram  (10)
2 Jerry  (9.8)
3 Violator  (9.8)
4 Acidchild  (9.7)
5 Starlight  (9.6)

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