|
|
| version 1.5, 2004/01/23 16:57:20 | version 1.10, 2004/02/13 08:01:12 |
|---|---|
| Line 196 static REG8 sasibios_sense(UINT type, SX | Line 196 static REG8 sasibios_sense(UINT type, SX |
| CPU_DH = sxsi->surfaces; | CPU_DH = sxsi->surfaces; |
| CPU_DL = sxsi->sectors; | CPU_DL = sxsi->sectors; |
| } | } |
| return(0x00); | return(0x0f); |
| } | } |
| } | } |
| Line 245 REG8 sasibios_operate(void) { | Line 245 REG8 sasibios_operate(void) { |
| // ---- scsi | // ---- scsi |
| #if defined(SUPPORT_SCSI) | #if defined(SUPPORT_SCSI) |
| static void scsibios_set(REG8 drv, REG8 sectors, REG8 surfaces, | |
| REG16 cylinders, REG16 size, BOOL hwsec) { | |
| BYTE *scsiinf; | |
| UINT16 inf; | |
| scsiinf = mem + 0x00460 + ((drv & 7) * 4); | |
| inf = 0; | |
| inf = (UINT16)(cylinders & 0xfff); | |
| if (cylinders >= 0x1000) { | |
| inf |= 0x4000; | |
| surfaces |= (cylinders >> 8) & 0xf0; | |
| } | |
| if (size == 512) { | |
| inf |= 0x1000; | |
| } | |
| else if (size == 1024) { | |
| inf |= 0x2000; | |
| } | |
| if (hwsec) { | |
| inf |= 0x8000; | |
| } | |
| scsiinf[0] = (UINT8)sectors; | |
| scsiinf[1] = (UINT8)surfaces; | |
| STOREINTELWORD(scsiinf + 2, inf); | |
| } | |
| static REG8 scsibios_init(UINT type, SXSIDEV sxsi) { | static REG8 scsibios_init(UINT type, SXSIDEV sxsi) { |
| UINT8 i; | UINT8 i; |
| UINT8 bit; | UINT8 bit; |
| UINT32 dat; | |
| mem[MEMB_DISK_EQUIPS] = 0; | mem[MEMB_DISK_EQUIPS] = 0; |
| ZeroMemory(&mem[0x00460], 0x20); | ZeroMemory(&mem[0x00460], 0x20); |
| Line 257 static REG8 scsibios_init(UINT type, SXS | Line 285 static REG8 scsibios_init(UINT type, SXS |
| sxsi = sxsi_getptr((REG8)(0x20 + i)); | sxsi = sxsi_getptr((REG8)(0x20 + i)); |
| if ((sxsi) && (sxsi->fname[0])) { | if ((sxsi) && (sxsi->fname[0])) { |
| mem[MEMB_DISK_EQUIPS] |= bit; | mem[MEMB_DISK_EQUIPS] |= bit; |
| dat = sxsi->sectors; | scsibios_set(i, sxsi->sectors, sxsi->surfaces, |
| dat |= (sxsi->surfaces << 8); | sxsi->cylinders, sxsi->size, TRUE); |
| dat |= sxsi->cylinders & 0xf000; | |
| dat |= (sxsi->cylinders & 0xfff) << 16; | |
| switch(sxsi->size) { | |
| case 256: | |
| // dat |= 0 << (12 + 16); | |
| break; | |
| case 512: | |
| dat |= 1 << (12 + 16); | |
| break; | |
| default: | |
| dat |= 2 << (12 + 16); | |
| break; | |
| } | |
| dat |= 0xc0000000; | |
| SETBIOSMEM32(0x00460+i*4, dat); | |
| } | } |
| } | } |
| (void)type; | (void)type; |
| Line 284 static REG8 scsibios_init(UINT type, SXS | Line 295 static REG8 scsibios_init(UINT type, SXS |
| static REG8 scsibios_sense(UINT type, SXSIDEV sxsi) { | static REG8 scsibios_sense(UINT type, SXSIDEV sxsi) { |
| if (CPU_AH == 0x44) { | BYTE *scsiinf; |
| CPU_BX = 1; | |
| scsiinf = mem + 0x00460 + ((CPU_AL & 7) * 4); | |
| if (CPU_AH == 0x24) { | |
| scsibios_set(CPU_AL, CPU_DL, CPU_DH, CPU_CX, CPU_BX, FALSE); | |
| } | |
| else if (CPU_AH == 0x44) { | |
| CPU_BX = (scsiinf[3] & 0x80)?2:1; | |
| } | } |
| else if (CPU_AH == 0x84) { | else if (CPU_AH == 0x84) { |
| CPU_BX = sxsi->size; | CPU_DL = scsiinf[0]; |
| CPU_CX = sxsi->cylinders; | CPU_DH = scsiinf[1] & 0x0f; |
| CPU_DH = sxsi->surfaces; | CPU_CX = scsiinf[2] + ((scsiinf[3] & 0xf) << 8); |
| CPU_DL = sxsi->sectors; | if (scsiinf[3] & 0x40) { |
| CPU_CX += (scsiinf[1] & 0xf0) << 8; | |
| } | |
| CPU_BX = 256 << ((scsiinf[3] >> 4) & 3); | |
| } | } |
| (void)type; | (void)type; |
| (void)sxsi; | |
| return(0x00); | return(0x00); |
| } | } |