aboutsummaryrefslogtreecommitdiff
path: root/dlog.h
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2026-08-30 19:01:23 +0200
committerJavier <dev.git@javispedro.com>2026-08-30 19:01:23 +0200
commit8459567950d6d7dcc8f92753b0c1918f417ab149 (patch)
tree8ab3fe3e5c970a4c00b5e222a6c5a13525149287 /dlog.h
parent6c79dffa4fd38a36845f518443668a3aa654728c (diff)
downloadvbados-8459567950d6d7dcc8f92753b0c1918f417ab149.tar.gz
vbados-8459567950d6d7dcc8f92753b0c1918f417ab149.zip
handle wheel serial protocol (untested)
Diffstat (limited to 'dlog.h')
-rw-r--r--dlog.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/dlog.h b/dlog.h
index 2878ac9..19337cd 100644
--- a/dlog.h
+++ b/dlog.h
@@ -56,14 +56,26 @@ static inline void dlog_init()
// No initialization required
}
-static inline void dputc(char c);
-#pragma aux dputc = \
+static inline void dconputc(char c);
+#pragma aux dconputc = \
"mov ah, 0x0E" \
"xor bx, bx" \
"int 0x10" \
__parm [AL] \
__modify __exact [AH AL BH BL];
+static inline void dputc(char c)
+{
+ // Need to convert CR into CRLF...
+ if (c == '\n') {
+ dconputc('\n');
+ dconputc('\r');
+ } else {
+ dconputc(c);
+ }
+}
+
+
#elif DLOG_TARGET == DLOG_TARGET_SERIAL
static void dlog_init()
@@ -167,7 +179,6 @@ static void d_itoa(int num, unsigned base)
{
unsigned unum;
- // TODO
if (num < 0) {
dputc('-');
unum = -num;
@@ -182,7 +193,6 @@ static void d_ltoa(long num, unsigned base)
{
unsigned long unum;
- // TODO
if (num < 0) {
dputc('-');
unum = -num;