Beispiel #1
0
static UInt8 readIo(Svi328Fdc* rm, UInt16 ioPort) 
{
    switch (ioPort) {
        case 0x30:
            return wd2793GetStatusReg(rm->fdc);
        case 0x31:
            return wd2793GetTrackReg(rm->fdc);
        case 0x32:
            return wd2793GetSectorReg(rm->fdc);
        case 0x33:
            return wd2793GetDataReg(rm->fdc);
        case 0x34:
            return (wd2793GetIrq(rm->fdc) ? 0x80:0) | (wd2793GetDataRequest(rm->fdc) ? 0x40:0);
    }
    return 0xff;
}
static UInt8 readIo(Microsol* rm, UInt16 ioPort)
{	
    switch (ioPort) {
	case 0xd0:
		return wd2793GetStatusReg(rm->fdc);
	case 0xd1:
		return wd2793GetTrackReg(rm->fdc);
	case 0xd2:
		return wd2793GetSectorReg(rm->fdc);
	case 0xd3:
		return wd2793GetDataReg(rm->fdc);
	case 0xd4:
        return 0x3f | 
               (wd2793GetIrq(rm->fdc)         ? 0x80 : 0) | 
               (wd2793GetDataRequest(rm->fdc) ? 0 : 0x40);
    }
    return 0xff;
}
static UInt8 read(RomMapperNationalFdc* rm, UInt16 address) 
{
	switch (address & 0x3fc7) {
	case 0x3f80:
		return wd2793GetStatusReg(rm->fdc);
	case 0x3f81:
		return wd2793GetTrackReg(rm->fdc);
	case 0x3f82:
		return wd2793GetSectorReg(rm->fdc);
	case 0x3f83:
		return wd2793GetDataReg(rm->fdc);
	case 0x3f84:
	case 0x3f85:
	case 0x3f86:
	case 0x3f87:
        return (wd2793GetIrq(rm->fdc) ? 0x80 : 0) | (wd2793GetDataRequest(rm->fdc) ? 0 : 0x40) | 0x3f;
    }

    return address < 0x4000 ? rm->romData[address] : 0xff;
}
static UInt8 read(RomMapperPhilipsFdc* rm, UInt16 address) 
{
	switch (address & 0x3fff) {
	case 0x3ff8:
		return wd2793GetStatusReg(rm->fdc);
	case 0x3ff9:
		return wd2793GetTrackReg(rm->fdc);
	case 0x3ffa:
		return wd2793GetSectorReg(rm->fdc);
	case 0x3ffb:
		return wd2793GetDataReg(rm->fdc);
	case 0x3ffc:
        return rm->sideReg;
	case 0x3ffd:
        return rm->driveReg;
	case 0x3ffe:
        return 0xff;
	case 0x3fff:
        return (wd2793GetIrq(rm->fdc) ? 0 : 0x40) | (wd2793GetDataRequest(rm->fdc) ? 0 : 0x80);
    }

    return address < 0x4000 ? rm->romData[address] : 0xff;
}