Fixed the SMC FDC37C932FR's GPIO port change handler.

This commit is contained in:
OBattler
2018-03-14 04:17:16 +01:00
parent ddcb901421
commit b35e6a535d

View File

@@ -9,7 +9,7 @@
* Implementation of the SMC FDC37C932FR and FDC37C935 Super
* I/O Chips.
*
* Version: @(#)sio_fdc37c93x.c 1.0.10 2018/01/16
* Version: @(#)sio_fdc37c93x.c 1.0.11 2018/03/14
*
* Author: Miran Grca, <mgrca8@gmail.com>
* Copyright 2016-2018 Miran Grca.
@@ -36,7 +36,7 @@ static int fdc37c93x_curreg = 0;
static int fdc37c93x_gpio_reg = 0;
static uint8_t fdc37c93x_regs[48];
static uint8_t fdc37c93x_ld_regs[10][256];
static uint8_t fdc37c93x_gpio_base = 0x00EA;
static uint16_t fdc37c93x_gpio_base = 0x00EA;
static fdc_t *fdc37c93x_fdc;
static uint8_t tries;
@@ -122,12 +122,12 @@ static void fdc37c93x_auxio_handler(void)
{
uint16_t ld_port = 0;
uint8_t local_enable = !!fdc37c93x_ld_regs[3][0x30];
uint8_t local_enable = !!fdc37c93x_ld_regs[8][0x30];
io_removehandler(fdc37c93x_gpio_base, 0x0001, fdc37c93x_gpio_read, NULL, NULL, fdc37c93x_gpio_write, NULL, NULL, NULL);
if (local_enable)
{
fdc37c93x_gpio_base = ld_port = make_port(3);
fdc37c93x_gpio_base = ld_port = make_port(8);
/* pclog("fdc37c93x: Setting Auxiliary I/O port to %04X\n", ld_port); */
if ((ld_port >= 0x0100) && (ld_port <= 0x0FFF))
io_sethandler(fdc37c93x_gpio_base, 0x0001, fdc37c93x_gpio_read, NULL, NULL, fdc37c93x_gpio_write, NULL, NULL, NULL);
@@ -377,7 +377,7 @@ process_value:
}
break;
case 8:
/* Serial port 2 */
/* Auxiliary I/O */
switch(fdc37c93x_curreg)
{
case 0x30: