I had been using poke(0x5f00, 128 ..etc) to set transparency and setting it to 128 works for spr,
Then I tried the same thing for tline and it wouldn't work unless I set it to 16 or had bit5 flipped.
This test code alternates between the 2 values, 16 works for both 128 only works for spr.
t,f = 0 memset(0x2000,1,0x1000) function _draw() cls"12" -- palette t+=1 if t%20==0 then poke(0x5f00,f and 16 or 128) f = not f end -- tline for i = 31,95 do tline(47,i,111,i,0,i/8) end -- spr spr(0,16,60) end |
Is this intentional? A bug? What's the difference between those higher-bits? I was confused when I stumbled into this.
It's probably a misfeature.
Only @zep would know, obviously, but as far as I know, it's only supposed to be bit 4, but I wouldn't be surprised if there's rasterization code that simply checks to see if the unsigned byte value is >15 as an optimization vs. masking off bit 4 and testing it.
Or, since you said something about using bit 5 as well, perhaps there's some broken code that does the test just plain wrong, or bit 5 is meant to do something special in some circumstance we haven't discovered yet, since zep likes to hide functionality.
Regardless, you're right to call it out as inconsistent.
[Please log in to post a comment]