0 Members and 2 Guests are viewing this topic.
Code: [Select] Second buffer 1 0 First 1 Black GrayBuffer 0 White Transparent
Second buffer 1 0 First 1 Black GrayBuffer 0 White Transparent
Second buffer 1 0 First 1 Black Buffer 0 White Transparent
Yes, you can use the Pt-Mask() routine for masking monochrome sprites, but you didn't quite define the logic of how things are drawn correctly. You got how to draw white and transparent pixels correctly, but black pixels need to have their corresponding bit be on in both buffers, not just the front buffer. Having the bit on in just the front buffer was designed for gray, which turns the pixel on in the back buffer (not used in black and white displaying) but turns the pixel off in the front buffer.
Quote from: Runer112 on October 20, 2010, 02:08:43 pmYes, you can use the Pt-Mask() routine for masking monochrome sprites, but you didn't quite define the logic of how things are drawn correctly. You got how to draw white and transparent pixels correctly, but black pixels need to have their corresponding bit be on in both buffers, not just the front buffer. Having the bit on in just the front buffer was designed for gray, which turns the pixel on in the back buffer (not used in black and white displaying) but turns the pixel off in the front buffer.Not true, runer. If you use Dispgraph with no r at the end it does it with only black on the first buffer...
.TEST[FFFFFFFF00000000]→Pic1[FFFF0000FFFF0000]ClrDrawDrawInv Pt-Mask(0,0,Pic1)DispGraphRepeat getKeyEnd
http://ourl.ca/5980I believe Builderboy explains it pretty well.
You can still have 4 level grayscale by using 4 level backgrounds and 3 level foreground sprites. I think this is what the original game boy used for the same reason. But be aware that when you use the Pt-Mask routine for monochrome, data will still be written to the back-buffer even when you're not displaying it. So you can't use L3 to store additional variables and data structures since they can easily get corrupted.
Sorry for the confusion, my last post was directed towards ASBAD_ALVIN, not you DJ.Quote from: ASHBAD_ALVIN on October 20, 2010, 02:18:46 pmQuote from: Runer112 on October 20, 2010, 02:08:43 pmYes, you can use the Pt-Mask() routine for masking monochrome sprites, but you didn't quite define the logic of how things are drawn correctly. You got how to draw white and transparent pixels correctly, but black pixels need to have their corresponding bit be on in both buffers, not just the front buffer. Having the bit on in just the front buffer was designed for gray, which turns the pixel on in the back buffer (not used in black and white displaying) but turns the pixel off in the front buffer.Not true, runer. If you use Dispgraph with no r at the end it does it with only black on the first buffer...Take the following program for example:Code: [Select].TEST[FFFFFFFF00000000]→Pic1[FFFF0000FFFF0000]ClrDrawDrawInv Pt-Mask(0,0,Pic1)DispGraphRepeat getKeyEndThat sprite has both bits set for the first two lines of data, only the first buffer bits set for the third and fourth lines, only the second buffer bits set for the fifth and sixth lines, and all of the bits unset for the seventh and eighth lines. You get the result displayed in the attached picture. The first two lines are black, because both bits are set in the sprite data, but when only the first buffer bit is set in the sprite (lines three and four), the result is white. This is because the Pt-Mask() command is doing what would be gray, which means the back buffer pixels are on but the front buffer pixels are off.EDIT by DJ: post was messed up due to additional code tag at beginning. Fixed EDIT by me: I think I might have fixed it first, in which case you would have been edit ninja'd