diff --git a/Experiments/10print/10print b/Experiments/10print/10print new file mode 100644 index 0000000..1da921a Binary files /dev/null and b/Experiments/10print/10print differ diff --git a/Experiments/10print/10print.c b/Experiments/10print/10print.c new file mode 100644 index 0000000..bcb2046 --- /dev/null +++ b/Experiments/10print/10print.c @@ -0,0 +1,71 @@ +// zcc +zx -lndos -create-app -o 10print 10print.c +#include +#include +#include +#include +#include + +static unsigned char *attrMem = 22528; +static unsigned int x, y, i; + +void main() +{ + zx_border(BLUE); + textbackground(CYAN); + + // Prep. + in_GetKeyReset(); + srand(0); + + // Loop. + while (!in_GetKey()) + { + clrscr(); + + // Draw. + for (y = 0; y < 192; y += 8) + { + for (x = 0; x < 256; x += 8) + { + switch (rand() % 2) + { + case 0: + plot(x + 1, y); + drawr(7, 7); + plot(x, y + 1); + drawr(7, 7); + break; + case 1: + plot(x + 7, y); + drawr(-7, 7); + plot(x + 8, y + 1); + drawr(-7, 7); + break; + } + } + } + + // Footer. + clga(152, 184, 104, 8); + drawb(151, 183, 106, 10); + + gotoxy(40, 23); + printf("10PRINT (@DeanTheCoder)"); + for (x = 755; x < 768; ++x) + attrMem[x] = PAPER_BLUE + INK_WHITE + BRIGHT; + + // Fill. + i = 0; + while (i < 8) + { + x = rand() % 256; + y = rand() % 192; + + if (point(x, y) + point(x + 1, y) + point(x, y - 1) + point(x, y + 1)) + continue; + + fill(x, y); + i++; + } + } +} diff --git a/Experiments/10print/10print.png b/Experiments/10print/10print.png new file mode 100644 index 0000000..359f859 Binary files /dev/null and b/Experiments/10print/10print.png differ diff --git a/Experiments/10print/10print.tap b/Experiments/10print/10print.tap new file mode 100644 index 0000000..9368eb5 Binary files /dev/null and b/Experiments/10print/10print.tap differ diff --git a/README.md b/README.md index 876971e..c1dde47 100644 --- a/README.md +++ b/README.md @@ -110,6 +110,12 @@ I first populate the entire screen with characters (black on black), then build This array is then used to set the colors on the screen, and a `memmove` command is used to scroll the buffer by one byte. This keeps the framerate up as it's only the color attributes that change - Not the characters on the screen. ![](Experiments/TheMatrix/TheMatrix.png) +# Experiments - 10PRINT +C compiled into Z80 machine code ([here](Experiments/10print/10print.tap)). + +The screen is filled with forward and backslashes (Drawn with a small gap in my case), then I randomly fill areas of the screen. Quite relaxing to watch! +![](Experiments/10print/10print.png) + ## Contribution and Improvements ZX Speculator is an ongoing project and contributions are welcome. Whether it's improving emulation accuracy, testing on different platforms, or enhancing existing features, your input is valuable (although I can't always promise a fast response, as this is a side project).