line and erasing is sort of working
This commit is contained in:
parent
6468a122df
commit
55462f53e4
1 changed files with 22 additions and 3 deletions
23
src/main.c
23
src/main.c
|
@ -65,23 +65,42 @@ void setPositionWhite(unsigned short x, BYTE y)
|
||||||
*(unsigned short*)(ad) = *(unsigned short*)(ad) | ma;
|
*(unsigned short*)(ad) = *(unsigned short*)(ad) | ma;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setPositionBlack(long x, int y)
|
void setPositionBlack(unsigned short x, BYTE y)
|
||||||
{
|
{
|
||||||
|
unsigned short ra = (320 * (BYTE)(y/8)) + (y & 7);
|
||||||
|
unsigned short ba = 8 * (BYTE)(x/8);
|
||||||
|
unsigned short ma = 255 - power(2,(7-(x & 7)));
|
||||||
|
unsigned short sa = 0x2000;
|
||||||
|
unsigned short ad = sa+ra+ba;
|
||||||
|
*(unsigned short*)(ad) = *(unsigned short*)(ad) & ma;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
unsigned short line;
|
||||||
int main(void) {
|
int main(void) {
|
||||||
x = 160;
|
x = 160;
|
||||||
y = 100;
|
y = 100;
|
||||||
setAndClearHiRes();
|
setAndClearHiRes();
|
||||||
while (1) {
|
for (line = 0;line<50;line++)
|
||||||
|
{
|
||||||
setPositionWhite(x,y);
|
setPositionWhite(x,y);
|
||||||
x = x+1;
|
x = x+1;
|
||||||
y = y + 1;
|
y = y + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
x = 160;
|
||||||
|
y = 100;
|
||||||
|
setAndClearHiRes();
|
||||||
|
for (line = 0;line<50;line++)
|
||||||
|
{
|
||||||
|
setPositionBlack(x,y);
|
||||||
|
x = x+1;
|
||||||
|
y = y + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue