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: 1814
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: 965
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
Guests online: 457
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Codeboys & Endians  (9.7)
4 Mojo  (9.6)
5 Coma Light 13  (9.6)
6 Edge of Disgrace  (9.6)
7 Signal Carnival  (9.6)
8 Wonderland XIV  (9.5)
9 Uncensored  (9.5)
10 Comaland 100%  (9.5)
Top onefile Demos
1 Nine  (9.7)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.5)
6 Scan and Spin  (9.5)
7 Onscreen 5k  (9.5)
8 Grey  (9.5)
9 Dawnfall V1.1  (9.5)
10 Rainbow Connection  (9.5)
Top Groups
1 Artline Designs  (9.3)
2 Booze Design  (9.3)
3 Performers  (9.3)
4 Oxyron  (9.3)
5 Censor Design  (9.3)
Top Cover Designers
1 Duce  (9.8)
2 Electric  (9.8)
3 Junkie  (9.6)
4 The Elegance  (9.5)
5 Mermaid  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2025
Page generated in: 0.051 sec.