static void md_attr_write(PCMCIACardState *card, uint32_t at, uint8_t value) { MicroDriveState *s = MICRODRIVE(card); at -= s->attr_base; switch (at) { case 0x00: /* Configuration Option Register */ s->opt = value & 0xcf; if (value & OPT_SRESET) { device_reset(DEVICE(s)); } md_interrupt_update(s); break; case 0x02: /* Card Configuration Status Register */ if ((s->stat ^ value) & STAT_PWRDWN) { s->pins |= PINS_CRDY; } s->stat &= 0x82; s->stat |= value & 0x74; md_interrupt_update(s); /* Word 170 in Identify Device must be equal to STAT_XE */ break; case 0x04: /* Pin Replacement Register */ s->pins &= PINS_CRDY; s->pins |= value & PINS_MRDY; break; case 0x06: /* Socket and Copy Register */ break; default: printf("%s: Bad attribute space register %02x\n", __func__, at); } }
static void md_set_irq(void *opaque, int irq, int level) { MicroDriveState *s = opaque; if (level) s->stat |= STAT_INT; else s->stat &= ~STAT_INT; md_interrupt_update(s); }