diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c index 9d3c44d1c7b1fb8eeec0e33d8eea08bf55a5a39e..f5a91ba10aba11b3bf73d80443c7d768feb08668 100644 --- a/hw/lsi53c895a.c +++ b/hw/lsi53c895a.c @@ -543,7 +543,7 @@ static void lsi_do_dma(LSIState *s, int out) return; } - id = s->current->tag >> 8; + id = (s->current->tag >> 8) & 0xf; dev = s->bus.devs[id]; if (!dev) { lsi_bad_selection(s, id); @@ -745,7 +745,7 @@ static void lsi_do_command(LSIState *s) s->sfbr = buf[0]; s->command_complete = 0; - id = s->select_tag >> 8; + id = (s->select_tag >> 8) & 0xf; dev = s->bus.devs[id]; if (!dev) { lsi_bad_selection(s, id);