WMLONG transparent value

"WMLONG writes longs, like WRLONG; however, it does not write any byte fields whose data are $FF. This is intended for things like sprite overlays, where $FF byte data represent transparent pixels."

Why FF instead of 00?

Comments

  • 4 Comments sorted by Date Added Votes
  • TonyB wrote: »
    "WMLONG writes longs, like WRLONG; however, it does not write any byte fields whose data are $FF. This is intended for things like sprite overlays, where $FF byte data represent transparent pixels."

    Why FF instead of 00?

    Because $00 is probably more useful than $FF as a data value.
  • potatoheadpotatohead Posts: 8,812
    edited April 21 Vote Up0Vote Down
    Yes, people may use it for other things. As for sprites, something needs to be transparent. Since we use color lookups, any value is fine as they will rarely be associated with a given color.

    ie: $FE = white = $FF_FF_FF rgb



    Do not taunt Happy Fun Ball! @opengeekorg ---> Be Excellent To One Another SKYPE = acuity_doug
    Parallax colors simplified: http://forums.parallax.com/showthread.php?123709-Commented-Graphics_Demo.spin<br>
  • Well this is the inverse of what I was expecting. I've come across bit = 0 or nibble = 0 or byte = 00 for transparent. FF not white and 00 not transparent makes no sense to me.

    Is WMLONG only intended for writing data that's read from a LUT?
  • cgraceycgracey Posts: 7,835
    edited April 22 Vote Up0Vote Down
    TonyB wrote: »
    Well this is the inverse of what I was expecting. I've come across bit = 0 or nibble = 0 or byte = 00 for transparent. FF not white and 00 not transparent makes no sense to me.

    Is WMLONG only intended for writing data that's read from a LUT?

    WMLONG can write data strings from cog registers (SETQ+WMLONG) or lut registers (SETQ2+WMLONG). Or, just one long at a time from a single cog register.

    About $FF being the data pattern that is not written, it seems to me that you would not want to inhibit $00 values, since they are used for lots of purposes. $FF is at the other end of the spectrum for likely usefulness. Also, bytes are the low limit on hub memory granularity. To affect nibbles or bits, you would have to read, modify, and then write back bytes/words/longs, which are not atomic operations, all together. Byte writes are atomic, though.
Sign In or Register to comment.