diff --git a/src/include/86box/pcmcia.h b/src/include/86box/pcmcia.h index d010f73bed..3347e1befb 100644 --- a/src/include/86box/pcmcia.h +++ b/src/include/86box/pcmcia.h @@ -34,6 +34,9 @@ struct pcmcia_socket_t { /* Signals READY to the socket. */ void (*ready_changed)(bool ready, pcmcia_socket_t* socket); + /* Resets the card. */ + void (*reset)(void *priv); + /* Opaque pointer to card-specific information. */ void *card_priv; diff --git a/src/pcmcia/pcmcia_socket_pd6710.c b/src/pcmcia/pcmcia_socket_pd6710.c index 73f0a0aa41..ad7fd50d89 100644 --- a/src/pcmcia/pcmcia_socket_pd6710.c +++ b/src/pcmcia/pcmcia_socket_pd6710.c @@ -383,6 +383,15 @@ void pd67xx_port_write(uint16_t port, uint8_t val, void* priv) pd67xx->power_control = val; break; } + case 0x03: + { + bool reset = !(val & (1 << 6)) && (pd67xx->interrupt_general_control & (1 << 6)); + pd67xx->interrupt_general_control = val; + if ((pd67xx->power_control & (1 << 7)) && reset) { + pd67xx->socket.reset(pd67xx->socket.card_priv); + } + break; + } } } } @@ -401,6 +410,14 @@ uint8_t pd67xx_port_read(uint16_t port, void* priv) return pd67xx->interface_status; case 0x02: return pd67xx->power_control; + case 0x03: + return pd67xx->interrupt_general_control; + case 0x04: + { + uint8_t ret = pd67xx->card_status; + pd67xx->card_status = 0; + return ret; + } default: return 0xFF; }