45 #include "libconio_z80.h"
48 static void scroll() {
51 for (y = 0; y < LIBCONIO_CONF_SCREEN_HEIGHT - 1; y++) {
52 dst = LIBCONIO_VRAM_OFFSET(0, y);
53 src = LIBCONIO_VRAM_OFFSET(0, y + 1);
54 memcpy(LIBCONIO_VRAM_CHAR + dst,
55 LIBCONIO_VRAM_CHAR + src,
56 LIBCONIO_CONF_SCREEN_WIDTH);
57 #ifdef LIBCONIO_CONF_ATTRIBUTES_ENABLED
58 memcpy(LIBCONIO_VRAM_ATTR + dst,
59 LIBCONIO_VRAM_ATTR + src,
60 LIBCONIO_CONF_SCREEN_WIDTH);
63 dst = LIBCONIO_VRAM_OFFSET(0, LIBCONIO_CONF_SCREEN_HEIGHT - 1);
64 memset(LIBCONIO_VRAM_CHAR + dst,
' ',
65 LIBCONIO_CONF_SCREEN_WIDTH);
66 #ifdef LIBCONIO_CONF_ATTRIBUTES_ENABLED
67 memset(LIBCONIO_VRAM_ATTR + dst, LIBCONIO_COLOR_NORMAL,
68 LIBCONIO_CONF_SCREEN_WIDTH);
71 gotoxy(0, LIBCONIO_CONF_SCREEN_HEIGHT - 1);
75 static void adjust(
unsigned char *x,
unsigned char *y) {
76 if (*x > LIBCONIO_CONF_SCREEN_WIDTH) {
77 *y += *x / LIBCONIO_CONF_SCREEN_WIDTH;
78 *x = *x % LIBCONIO_CONF_SCREEN_WIDTH;
86 unsigned char reversed,
87 unsigned char color) {
91 off = LIBCONIO_VRAM_OFFSET(xpos, ypos);
92 if (off >= LIBCONIO_VRAM_OFFSET_MAX) {
94 off = LIBCONIO_VRAM_OFFSET(0, LIBCONIO_CONF_SCREEN_HEIGHT - 1);
96 *(
char *)(LIBCONIO_VRAM_CHAR + off) = c;
97 #ifdef LIBCONIO_CONF_ATTRIBUTES_ENABLED
98 *(
char *)(LIBCONIO_VRAM_ATTR + off) = reversed ?
99 LIBCONIO_COLOR_REVERSED : LIBCONIO_COLOR_NORMAL;