static REG8 bios1bc_seltrans(REG8 id) { UINT8 cdb[16]; REG8 ret; MEMR_READS(CPU_DS, CPU_DX, cdb, 16); scsiio.reg[SCSICTR_TARGETLUN] = cdb[0]; if ((cdb[1] & 0x0c) == 0x08) { // OUT MEMR_READS(CPU_ES, CPU_BX, scsiio.data, CPU_CX); } ret = scsicmd_transfer(id, cdb + 4); if ((cdb[1] & 0x0c) == 0x04) { // IN MEMR_WRITES(CPU_ES, CPU_BX, scsiio.data, CPU_CX); } return(ret); }
void bios0x1c(void) { UINT8 buf[6]; switch(CPU_AH) { case 0x00: // get system timer calendar_get(buf); MEMR_WRITES(CPU_ES, CPU_BX, buf, 6); break; case 0x01: // put system timer MEMR_READS(CPU_ES, CPU_BX, buf, 6); mem[MEMB_MSW8] = buf[0]; calendar_set(buf); break; case 0x02: // set interval timer (single) SETBIOSMEM16(0x0001c, CPU_BX); SETBIOSMEM16(0x0001e, CPU_ES); SETBIOSMEM16(0x0058a, CPU_CX); iocore_out8(0x77, 0x36); /* through */ case 0x03: // continue interval timer iocore_out8(0x71, 0x00); if (pccore.cpumode & CPUMODE_8MHZ) { iocore_out8(0x71, 0x4e); // 4MHz } else { iocore_out8(0x71, 0x60); // 5MHz } pic.pi[0].imr &= ~(PIC_SYSTEMTIMER); break; } }
static void fetch_sft(INTRST is, SFTREC sft) { REG16 off; REG16 seg; off = LOADINTELWORD(is->r.w.di); seg = LOADINTELWORD(is->r.w.es); MEMR_READS(seg, off, sft, sizeof(_SFTREC)); }
static void fetch_sda_currcds(SDACDS sc) { REG16 off; REG16 seg; if (hostdrv.stat.dosver_major == 3) { MEMR_READS(hostdrv.stat.sda_seg, hostdrv.stat.sda_off, &sc->ver3.sda, sizeof(sc->ver3.sda)); off = LOADINTELWORD(sc->ver3.sda.cdsptr.off); seg = LOADINTELWORD(sc->ver3.sda.cdsptr.seg); MEMR_READS(seg, off, &sc->ver3.cds, sizeof(sc->ver3.cds)); } else { MEMR_READS(hostdrv.stat.sda_seg, hostdrv.stat.sda_off, &sc->ver4.sda, sizeof(sc->ver4.sda)); off = LOADINTELWORD(sc->ver4.sda.cdsptr.off); seg = LOADINTELWORD(sc->ver4.sda.cdsptr.seg); MEMR_READS(seg, off, &sc->ver4.cds, sizeof(sc->ver4.cds)); } }
REG8 lio_gcircle(GLIO lio) { GCIRCLE dat; SINT16 cx; SINT16 cy; SINT16 rx; SINT16 ry; REG8 pal; SINT16 d1; SINT16 d2; SINT16 d3; lio_updatedraw(lio); MEMR_READS(CPU_DS, CPU_BX, &dat, sizeof(dat)); // チェック if (dat.flag & 0x7f) { TRACEOUT(("LIO GCIRCLE not support flags: %.2x", dat.flag)); } cx = (SINT16)LOADINTELWORD(dat.cx); cy = (SINT16)LOADINTELWORD(dat.cy); rx = (SINT16)LOADINTELWORD(dat.rx); ry = (SINT16)LOADINTELWORD(dat.ry); pal = dat.pal; if (pal == 0xff) { pal = lio->work.fgcolor; } if (rx != ry) { TRACEOUT(("LIO GCIRCLE not support ellipse")); return(LIO_SUCCESS); } // 単純な円の描画 d1 = 0; d2 = ry; d3 = 0 - ry; while(d1 <= d2) { draw4(lio, cx, cy, d1, d2, pal); draw4(lio, cx, cy, d2, d1, pal); lio->wait += 8 * (10 + 10 + 10); d1++; d3 += (d1 * 2) - 1; if (d3 >= 0) { d2--; d3 -= d2 * 2; } } return(LIO_SUCCESS); }
static void fetch_if4dos(void) { REG16 off; REG16 seg; IF4DOS if4dos; off = MEMR_READ16(IF4DOSPTR_SEG, IF4DOSPTR_OFF + 0); seg = MEMR_READ16(IF4DOSPTR_SEG, IF4DOSPTR_OFF + 2); MEMR_READS(seg, off, &if4dos, sizeof(if4dos)); hostdrv.stat.drive_no = if4dos.drive_no; hostdrv.stat.dosver_major = if4dos.dosver_major; hostdrv.stat.dosver_minor = if4dos.dosver_minor; hostdrv.stat.sda_off = LOADINTELWORD(if4dos.sda_off); hostdrv.stat.sda_seg = LOADINTELWORD(if4dos.sda_seg); TRACEOUT(("hostdrv:drive_no = %d", if4dos.drive_no)); TRACEOUT(("hostdrv:dosver = %d.%.2d", if4dos.dosver_major, if4dos.dosver_minor)); TRACEOUT(("hostdrv.sda = %.4x:%.4x", hostdrv.stat.sda_seg, hostdrv.stat.sda_off)); }
static void fetch_intr_regs(INTRST is) { MEMR_READS(CPU_SS, CPU_BP, &is->r, sizeof(is->r)); }