Created
April 18, 2022 20:37
-
-
Save andrzejsliwa/d3835ddcbbca91591ae009fcb9c3f8db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <c64.h> | |
#include <stdio.h> | |
unsigned byte* const SCREEN = (char*)$0400; | |
void main() { | |
fillscreen(SCREEN, $20); | |
charset(); | |
} | |
void charset() { | |
unsigned byte i = 0; | |
unsigned byte max = 32 + 32 + 32 + 2; | |
do { | |
unsigned byte column = (i % 32) + 4; | |
unsigned byte row = (i / 32) + 4; | |
unsigned byte *pointer = SCREEN + (row * 40) + column; | |
*pointer = i; | |
//printf("row %u, col %u - %p\n", row, column, pointer); | |
i++; | |
} while (i != max); | |
} | |
void fillscreen(char* screen, char fill) { | |
for( char* cursor = screen; cursor < screen+1000; cursor++) { | |
*cursor = fill; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment