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 > Stacking multicolour layers in assembly
2024-02-15 22:20
Krill

Registered: Apr 2002
Posts: 2855
Stacking multicolour layers in assembly

Consider 3 single-coloured multicolour layers, such that, e.g.,

00 or 01 - layer 1
00 or 10 - layer 2
00 or 11 - layer 3 (with 00 being background or transparent).

Now, how to merge them, rendering one over/on top of the other (no "glenz"-like colour blending, particular layer ordering isn't important as long as any kind of priority regime is preserved, and background/transparent may not be 00) using only binary arithmetic or other primitives, but no lookup tables?

With the above example, it's some kind of max operation on bitpairs, with something like
  |00 01 10 11
--------------
00|00 01 10 11
01|01 01 10 11
10|10 10 10 11
11|11 11 11 11
but this doesn't seem to map very well to the 6502's operations. =)
 
... 81 posts hidden. Click here to view all posts....
 
2024-02-15 22:44
Krill

Registered: Apr 2002
Posts: 2855
If it's not possible, i'd like to see some kind of elegant formal proof in a few sentences. =)
2024-02-15 23:00
Oswald

Registered: Apr 2002
Posts: 5031
Quote: If it's not possible, i'd like to see some kind of elegant formal proof in a few sentences. =)

first please notice you didnt say what exactly you are looking for. if its turing complete anything is possible.

edit: oh god damn, okay now I see it my bad.
edit2: seems like a good candidate for xy problem
2024-02-15 23:12
Krill

Registered: Apr 2002
Posts: 2855
Quoting Oswald
edit2: seems like a good candidate for xy problem
It's formulated as an academic question in this thread, but the origin is..., well, just having but 2 index registers. =)
2024-02-15 23:17
chatGPZ

Registered: Dec 2001
Posts: 11152
That has to be possible with some bitfiddling...maybe perhaps :) Why no lookup table though? :)
2024-02-15 23:17
Oswald

Registered: Apr 2002
Posts: 5031
Quote: Quoting Oswald
edit2: seems like a good candidate for xy problem
It's formulated as an academic question in this thread, but the origin is..., well, just having but 2 index registers. =)


then it really IS an XY problem :D dont think you will find a nice way, cheat it, or go around it. but lets see what the experts have to say :)
2024-02-15 23:20
Krill

Registered: Apr 2002
Posts: 2855
Quoting chatGPZ
That has to be possible with some bitfiddling...maybe perhaps :) Why no lookup table though? :)
The question is precisely about that bitfiddling! :)

Quoting Oswald
dont think you will find a nice way, cheat it, or go around it. but lets see what the experts have to say :)
Yes, that's what i thought when i created this thread. =)

(XY problem is irrelevant in this context.)
2024-02-15 23:21
Krill

Registered: Apr 2002
Posts: 2855
<i misclicked something>
2024-02-15 23:23
Krill

Registered: Apr 2002
Posts: 2855
Quoting Krill
Quoting chatGPZ
That has to be possible with some bitfiddling...maybe perhaps :) Why no lookup table though? :)
The question is precisely about that bitfiddling! :)
And no tables, yeah, i hate swapping registers in and out in tight unrolled inner loops. Maybe the bitfiddling solution, if it exists, is surprisingly terse and elegant? Who knows!
2024-02-15 23:27
chatGPZ

Registered: Dec 2001
Posts: 11152
It has to be bytes composed of 4 2bit pairs, right?
2024-02-16 00:22
Krill

Registered: Apr 2002
Posts: 2855
Quoting chatGPZ
It has to be bytes composed of 4 2bit pairs, right?
Yes. :) Ready to be displayed by VIC.

(But if you have something on your mind that works but ignores this constraint, go ahead any say. =D)
Previous - 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 - Next
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
Jedfox/Exclusive ON
mutetus/Ald ^ Ons
DeeKay/Crest
Bansai/BSILabs
Guests online: 62
Top Demos
1 Next Level  (9.7)
2 Mojo  (9.7)
3 13:37  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.7)
6 Aliens in Wonderland  (9.6)
7 Comaland 100%  (9.6)
8 Uncensored  (9.6)
9 No Bounds  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 It's More Fun to Com..  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 SHAPE  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

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