From b9ebebdbaa2815b6d43f0c28a21d5a2efea5c4f5 Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 19 Feb 2017 02:44:40 +0100 Subject: [PATCH] Fixed more compile-breaking errors in i82335.c. --- src/i82335.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/i82335.c b/src/i82335.c index 5ac2c8790..13e31a4e9 100644 --- a/src/i82335.c +++ b/src/i82335.c @@ -8,6 +8,7 @@ typedef struct { uint8_t reg_22; + uint8_t reg_23; } i82335_t; i82335_t i82335; @@ -36,6 +37,7 @@ void i82335_write(uint16_t addr, uint8_t val, void *priv) } break; case 0x23: + i82335.reg_23 = val | 0xd8; if (val & 0x80) { io_removehandler(0x0022, 0x0001, i82335_read, NULL, NULL, i82335_write, NULL, NULL, NULL); @@ -46,11 +48,19 @@ void i82335_write(uint16_t addr, uint8_t val, void *priv) uint8_t i82335_read(uint16_t addr, void *priv) { + if (addr == 0x22) + { + return i82335.reg_22; + } + else if (addr == 0x23) + { + return i82335.reg_23; + } } void i82335_init() { - memset(i82335, 0, sizeof(i82335_t)); + memset(&i82335, 0, sizeof(i82335_t)); i82335.reg_22 = 0xd9;