From 13ca7eadd46e1380084390767d727ed8a2b6ea9d Mon Sep 17 00:00:00 2001 From: TomW Date: Sun, 12 Jul 2015 14:09:26 +0100 Subject: [PATCH] Implemented LPT control register. --- src/lpt.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lpt.c b/src/lpt.c index f4d1e8d..b7b7d54 100644 --- a/src/lpt.c +++ b/src/lpt.c @@ -4,6 +4,8 @@ #include "lpt.h" static uint8_t lpt1_dat, lpt2_dat; +static uint8_t lpt1_ctrl, lpt2_ctrl; + void lpt1_write(uint16_t port, uint8_t val, void *priv) { switch (port & 3) @@ -14,6 +16,7 @@ void lpt1_write(uint16_t port, uint8_t val, void *priv) break; case 2: writedacctrl(val); + lpt1_ctrl = val; break; } } @@ -25,6 +28,8 @@ uint8_t lpt1_read(uint16_t port, void *priv) return lpt1_dat; case 1: return readdacfifo(); + case 2: + return lpt1_ctrl; } return 0xff; } @@ -39,6 +44,7 @@ void lpt2_write(uint16_t port, uint8_t val, void *priv) break; case 2: writedacctrl(val); + lpt2_ctrl = val; break; } } @@ -50,6 +56,8 @@ uint8_t lpt2_read(uint16_t port, void *priv) return lpt2_dat; case 1: return readdacfifo(); + case 2: + return lpt2_ctrl; } return 0xff; }