am i doing assembly right...
This commit is contained in:
parent
8bea2e8121
commit
876ae2d8f3
1 changed files with 4 additions and 4 deletions
|
@ -30,19 +30,19 @@ void setAndClearHiRes(){
|
||||||
}
|
}
|
||||||
|
|
||||||
BYTE isPositionWhite() {
|
BYTE isPositionWhite() {
|
||||||
ad = 0x2000+(40*(y >> 3)<<3) + (y & 7)+ (x&(0xfff8));
|
ad = 0x2000+((y >> 3) << 6) +((y >> 3) << 7) +((y >> 3) << 7) + (y & 7)+ (x&(0xfff8));
|
||||||
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_65/page/n129/
|
||||||
void setPositionWhite() {
|
void setPositionWhite() {
|
||||||
// TODO this 8 times something divided must be just masking
|
// TODO this 8 times something divided must be just masking
|
||||||
ad = 0x2000+(40 * (y >> 3) << 3) + (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() {
|
||||||
ad = 0x2000+ (40* (y >> 3) << 3) + (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))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue