diff --git a/include/console.h b/include/console.h index 01d792b..263c19b 100644 --- a/include/console.h +++ b/include/console.h @@ -5,3 +5,5 @@ char get_char(); void put_string(char* s); +void put_char_fast(char c); +void put_string_fast(char* s); diff --git a/src/console.c b/src/console.c index f3ac80e..badb5c6 100644 --- a/src/console.c +++ b/src/console.c @@ -21,9 +21,37 @@ void put_char(char c) __naked { __endasm; } +void put_char_fast(char c) __naked { + c; + __asm + conout: + in a, (0x03) + and #0x01 + jp z, debug + + ld iy, #2 + add iy, sp + ld a, 0(iy) + + out (0x02), a + ret + debug: + ld a, #0 + out (0xFF), a + jp conout + __endasm; +} + void put_string(char* s) { while (*s) { put_char(*s); s++; } } + +void put_string_fast(char* s) { + while (*s) { + put_char_fast(*s); + s++; + } +}