diff --git a/samples/memmap/charsetlo.c b/samples/memmap/charsetlo.c new file mode 100644 index 0000000..d262d66 --- /dev/null +++ b/samples/memmap/charsetlo.c @@ -0,0 +1,40 @@ +#include +#include +#include + +// make space until 0x2000 for code and data + +#pragma region( lower, 0x0a00, 0x2000, , , {code, data} ) + +// then space for our custom charset + +#pragma section( charset, 0) + +#pragma region( charset, 0x2000, 0x2800, , , {charset} ) + +// everything beyond will be code, data, bss and heap to the end + +#pragma region( main, 0x2800, 0xa000, , , {code, data, bss, heap, stack} ) + + +#pragma data(charset) + +char charset[2048] = { + #embed "../resources/charset.bin" +} + +#pragma data(data) + +char x; +int main(void) +{ + // map the vic to the new charset + + vic_setmode(VICM_TEXT, (char *)0x0400, charset) + + for(int i=0; i<10; i++) + printf(p"%D Hello World\n", i); + + return 0; +} + diff --git a/samples/memmap/make.bat b/samples/memmap/make.bat index a763ce6..d888275 100644 --- a/samples/memmap/make.bat +++ b/samples/memmap/make.bat @@ -1,2 +1,3 @@ ..\..\bin\oscar64 largemem.c ..\..\bin\oscar64 allmem.c +..\..\bin\oscar64 charsetlo.c diff --git a/samples/resources/charset.bin b/samples/resources/charset.bin new file mode 100644 index 0000000..9af8697 Binary files /dev/null and b/samples/resources/charset.bin differ