diff options
Diffstat (limited to 'ROMs/hid.c')
| -rw-r--r-- | ROMs/hid.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ROMs/hid.c b/ROMs/hid.c new file mode 100644 index 0000000..615808a --- /dev/null +++ b/ROMs/hid.c @@ -0,0 +1,34 @@ +int setPixel(int x, int y, int c) +{ + char* screenStart = 0x402F; + int i = (y * 128) + x; + screenStart[i] = c; +} + +int setPixelIndex(int i, int c) +{ + char* screenStart = 0x402F; + screenStart[i] = c; +} + +int clear(int c) +{ + char* screenStart = 0x402F; + char screenSize = 64 * 128; + for (int i = 0; i < screenSize; i++) + { + screenStart[i] = c; + } +} + +int main() +{ + while (1) + { + int* hid = 0x602F; + int mouseIndex = hid[0]; + int mouseState = hid[1]; + if (mouseState & 1 == 1) + setPixelIndex(mouseIndex, 1); + } +}
\ No newline at end of file |
