do not divide
This commit is contained in:
parent
179a722414
commit
985a228bac
1 changed files with 3 additions and 3 deletions
|
@ -30,18 +30,18 @@ void setAndClearHiRes(){
|
||||||
}
|
}
|
||||||
|
|
||||||
BYTE isPositionWhite() {
|
BYTE isPositionWhite() {
|
||||||
ad = 0x2000+(320 * (BYTE)(y/8)) + (y & 7)+8 * (BYTE)(x/8);
|
ad = 0x2000+(320 * (BYTE)(y >> 3)) + (y & 7)+8 * (BYTE)(x/8);
|
||||||
return *(short*)(ad) & 1 << ((7-(x & 7)));
|
return *(short*)(ad) & 1 << ((7-(x & 7)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://archive.org/details/The_Graphics_Book_for_the_Commodore_64/page/n129/
|
// https://archive.org/details/The_Graphics_Book_for_the_Commodore_64/page/n129/
|
||||||
void setPositionWhite() {
|
void setPositionWhite() {
|
||||||
ad = 0x2000+(320 * (y/8)) + (y & 7)+8 * (x/8);
|
ad = 0x2000+(320 * (y >> 3)) + (y & 7)+8 * (x/8);
|
||||||
*(short*)(ad) = *(short*)(ad) | 1 << ((7-(x & 7)));
|
*(short*)(ad) = *(short*)(ad) | 1 << ((7-(x & 7)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void setPositionBlack() {
|
void setPositionBlack() {
|
||||||
ad = 0x2000+320 * (y/8) + (y & 7)+8 * (x/8);
|
ad = 0x2000+320 * (y >> 3) + (y & 7)+8 * (x/8);
|
||||||
*(short*)(ad) = (*(short*)(ad)) & ~(1 << ((7-(x & 7))));
|
*(short*)(ad) = (*(short*)(ad)) & ~(1 << ((7-(x & 7))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue