Skip to content

Commit

Permalink
Card reset handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Cacodemon345 committed May 31, 2024
1 parent 097f822 commit 959946f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/include/86box/pcmcia.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
17 changes: 17 additions & 0 deletions src/pcmcia/pcmcia_socket_pd6710.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
}
Expand All @@ -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;
}
Expand Down

0 comments on commit 959946f

Please sign in to comment.