--- np2/bios/sxsibios.c 2004/01/22 04:59:48 1.2 +++ np2/bios/sxsibios.c 2004/01/23 12:04:08 1.4 @@ -201,19 +201,24 @@ static const SXSIFUNC sasifunc[16] = { REG8 sasibios_operate(void) { - SXSIDEV sxsi; UINT type; + SXSIDEV sxsi; - sxsi = sxsi_getptr(CPU_AL); - if (sxsi == NULL) { - return(0x60); + if (pccore.hddif & PCHDD_IDE) { + type = SXSIBIOS_IDE; } - type = SXSIBIOS_IDE; #if defined(SUPPORT_SASI) - if (pccore.hddif & PCHDD_SASI) { + else if (pccore.hddif & PCHDD_SASI) { type = SXSIBIOS_SASI; } #endif + else { + return(0x60); + } + sxsi = sxsi_getptr(CPU_AL); + if (sxsi == NULL) { + return(0x60); + } return((*sasifunc[CPU_AH & 0x0f])(type, sxsi)); } @@ -225,7 +230,7 @@ static REG8 scsibios_init(UINT type, SXS UINT8 i; UINT8 bit; - UINT16 w; + UINT32 dat; mem[MEMB_DISK_EQUIPS] = 0; ZeroMemory(&mem[0x00460], 0x20); @@ -233,24 +238,25 @@ static REG8 scsibios_init(UINT type, SXS sxsi = sxsi_getptr((REG8)(0x20 + i)); if ((sxsi) && (sxsi->fname[0])) { mem[MEMB_DISK_EQUIPS] |= bit; - mem[0x00460+i*4] = sxsi->sectors; - mem[0x00461+i*4] = sxsi->surfaces; + dat = sxsi->sectors; + dat |= (sxsi->surfaces << 8); + dat |= sxsi->cylinders & 0xf000; + dat |= (sxsi->cylinders & 0xfff) << 16; switch(sxsi->size) { case 256: - w = 0 << 12; + // dat |= 0 << (12 + 16); break; case 512: - w = 1 << 12; + dat |= 1 << (12 + 16); break; default: - w = 2 << 12; + dat |= 2 << (12 + 16); break; } - w |= 0xc000; - w |= sxsi->cylinders; - SETBIOSMEM16(0x00462+i*4, w); + dat |= 0xc0000000; + SETBIOSMEM32(0x00460+i*4, dat); } } (void)type; @@ -311,6 +317,9 @@ REG8 scsibios_operate(void) { SXSIDEV sxsi; + if (!(pccore.hddif & PCHDD_SCSI)) { + return(0x60); + } sxsi = sxsi_getptr(CPU_AL); if (sxsi == NULL) { return(0x60);