| |
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.... |
| |
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. =) |
| |
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 |
| |
Krill
Registered: Apr 2002 Posts: 2855 |
Quoting Oswaldedit2: 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. =) |
| |
chatGPZ
Registered: Dec 2001 Posts: 11152 |
That has to be possible with some bitfiddling...maybe perhaps :) Why no lookup table though? :) |
| |
Oswald
Registered: Apr 2002 Posts: 5031 |
Quote: Quoting Oswaldedit2: 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 :) |
| |
Krill
Registered: Apr 2002 Posts: 2855 |
Quoting chatGPZThat has to be possible with some bitfiddling...maybe perhaps :) Why no lookup table though? :) The question is precisely about that bitfiddling! :)
Quoting Oswalddont 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.) |
| |
Krill
Registered: Apr 2002 Posts: 2855 |
<i misclicked something> |
| |
Krill
Registered: Apr 2002 Posts: 2855 |
Quoting KrillQuoting chatGPZThat 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! |
| |
chatGPZ
Registered: Dec 2001 Posts: 11152 |
It has to be bytes composed of 4 2bit pairs, right? |
| |
Krill
Registered: Apr 2002 Posts: 2855 |
Quoting chatGPZIt 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 |