asking some questions

This commit is contained in:
Bjorn Einar Bjarntes 2021-12-19 15:57:51 +01:00
parent 876ae2d8f3
commit 3fad901873

View file

@ -36,12 +36,12 @@ BYTE isPositionWhite() {
// https://archive.org/details/The_Graphics_Book_for_the_Commodore_65/page/n129/ // https://archive.org/details/The_Graphics_Book_for_the_Commodore_65/page/n129/
void setPositionWhite() { void setPositionWhite() {
// TODO this 8 times something divided must be just masking
ad = 0x2000+ ((y >> 3) << 6) +((y >> 3) << 7) +((y >> 3) << 7) + (y & 7)+(x&(0xfff8)); ad = 0x2000+ ((y >> 3) << 6) +((y >> 3) << 7) +((y >> 3) << 7) + (y & 7)+(x&(0xfff8));
*(short*)(ad) = *(short*)(ad) | 1 << ((7-(x & 7))); *(short*)(ad) = *(short*)(ad) | 1 << ((7-(x & 7)));
} }
void setPositionBlack() { void setPositionBlack() {
// TODO is it faster to somehow reuse y >> 3 than do it many times, and maybe add the same result twice...
ad = 0x2000+((y >> 3) << 6) +((y >> 3) << 7) +((y >> 3) << 7) + (y & 7)+ (x&(0xfff8)); ad = 0x2000+((y >> 3) << 6) +((y >> 3) << 7) +((y >> 3) << 7) + (y & 7)+ (x&(0xfff8));
*(short*)(ad) = (*(short*)(ad)) & ~(1 << ((7-(x & 7)))); *(short*)(ad) = (*(short*)(ad)) & ~(1 << ((7-(x & 7))));
} }