/* * Probe for device. If found, try to raise an interrupt. */ int tsmatch(device_t parent, cfdata_t match, void *aux) { struct device tsdev; struct ts_softc ssc; struct ts_softc *sc = &ssc; struct uba_attach_args *ua = aux; int i; sc->sc_iot = ua->ua_iot; sc->sc_ioh = ua->ua_ioh; sc->sc_mapped = 0; sc->sc_dev = &tsdev; sc->sc_uh = device_private(parent); strcpy(sc->sc_dev->dv_xname, "ts"); /* Try to reset the device */ for (i = 0; i < 3; i++) { if (tsreset(sc)) break; } if (i == 3) return 0; tsinit(sc); tswchar(sc); /* write charact. to enable interrupts */ /* completion of this will raise the intr. */ DELAY(1000000); /* Wait for interrupt */ ubmemfree(sc->sc_uh, &sc->sc_ui); return 1; }
void reset(ROM_MODE mode) { comp.pEFF7 &= conf.EFF7_mask; comp.pEFF7 |= EFF7_GIGASCREEN; // [vv] disable turbo { conf.frame = frametime; cpu.SetTpi(conf.frame); // if ((conf.mem_model == MM_PENTAGON)&&(comp.pEFF7 & EFF7_GIGASCREEN))conf.frame = 71680; //removed 0.37 apply_sound(); } //Alone Coder 0.36.4 comp.t_states = 0; comp.frame_counter = 0; comp.p7FFD = comp.pDFFD = comp.pFDFD = comp.p1FFD = 0; comp.p7EFD = comp.p78FD = comp.p7AFD = comp.p7CFD = comp.gmx_config = comp.gmx_magic_shift = 0; comp.pLSY256 = 0; comp.ulaplus_mode=0; comp.ulaplus_reg=0; tsinit(); if (conf.mem_model == MM_TSL) set_clk(); // turbo 2x (7MHz) for TS-Conf else turbo(1); // turbo 1x (3.5MHz) for all other clones if (conf.mem_model == MM_LSY256) mode = RM_SYS; switch (mode) { case RM_SYS: {comp.ts.memconf = 4; break;} case RM_DOS: {comp.ts.memconf = 0; break;} case RM_128: {comp.ts.memconf = 0; break;} case RM_SOS: {comp.ts.memconf = 0; break;} } comp.p00 = comp.p80FD = 0; // quorum comp.pBF = 0; // ATM3 comp.pBE = 0; // ATM3 if (conf.mem_model == MM_ATM710 || conf.mem_model == MM_ATM3) { switch(mode) { case RM_DOS: // Запрет палитры, запрет cpm, включение диспетчера памяти // Включение механической клавиатуры, разрешение кадровых прерываний set_atm_FF77(0x4000 | 0x200 | 0x100, 0x80 | 0x40 | 0x20 | 3); comp.pFFF7[0] = 0x100 | 1; // trdos comp.pFFF7[1] = 0x200 | 5; // ram 5 comp.pFFF7[2] = 0x200 | 2; // ram 2 comp.pFFF7[3] = 0x200; // ram 0 comp.pFFF7[4] = 0x100 | 1; // trdos comp.pFFF7[5] = 0x200 | 5; // ram 5 comp.pFFF7[6] = 0x200 | 2; // ram 2 comp.pFFF7[7] = 0x200; // ram 0 break; default: set_atm_FF77(0,0); } } if (conf.mem_model == MM_ATM450) { switch(mode) { case RM_DOS: set_atm_aFE(0x80|0x60); comp.aFB = 0; break; default: set_atm_aFE(0x80); comp.aFB = 0x80; } } comp.flags = 0; comp.active_ay = 0; cpu.reset(); reset_tape(); reset_sound(); #ifdef MOD_VID_VD comp.vdbase = 0; comp.pVD = 0; #endif load_spec_colors(); comp.ide_hi_byte_r = 0; comp.ide_hi_byte_w = 0; comp.ide_hi_byte_w1 = 0; hdd.reset(); input.atm51.reset(); input.buffer.Enable(false); if ((!conf.trdos_present && mode == RM_DOS) || (!conf.cache && mode == RM_CACHE)) mode = RM_SOS; set_mode(mode); }
void tsattach(device_t parent, device_t self, void *aux) { struct ts_softc *sc = device_private(self); struct uba_attach_args *ua = aux; int error; const char *t; sc->sc_dev = self; sc->sc_uh = device_private(parent); sc->sc_iot = ua->ua_iot; sc->sc_ioh = ua->ua_ioh; sc->sc_dmat = ua->ua_dmat; sc->sc_uu.uu_dev = self; sc->sc_uu.uu_ready = tsready; tsinit(sc); /* reset and map */ error = bus_dmamap_create(sc->sc_dmat, (64*1024), 16, (64*1024), 0, BUS_DMA_NOWAIT, &sc->sc_dmam); if (error) { aprint_error(": failed create DMA map %d\n", error); return; } bufq_alloc(&sc->sc_bufq, "fcfs", 0); /* * write the characteristics (again) */ sc->sc_state = TS_INIT; /* tsintr() checks this ... */ tswchar(sc); if (tsleep(sc, PRIBIO, "tsattach", 100)) { aprint_error(": failed SET CHARACTERISTICS\n"); return; } sc->sc_state = TS_RUNNING; if (sc->sc_uh->uh_type == UBA_UBA) { if (sc->sc_vts->status.xst2 & TS_SF_TU80) { sc->sc_type = TYPE_TU80; t = "TU80"; } else { sc->sc_type = TYPE_TS11; t = "TS11"; } } else { sc->sc_type = TYPE_TS05; t = "TS05"; } aprint_normal(": %s\n", t); aprint_normal_dev(sc->sc_dev, "rev %d, extended features %s, transport %s\n", (sc->sc_vts->status.xst2 & TS_SF_MCRL) >> 2, (sc->sc_vts->status.xst2 & TS_SF_EFES ? "enabled" : "disabled"), (TS_RCSR(TSSR) & TS_OFL ? "offline" : "online")); uba_intr_establish(ua->ua_icookie, ua->ua_cvec, tsintr, sc, &sc->sc_intrcnt); evcnt_attach_dynamic(&sc->sc_intrcnt, EVCNT_TYPE_INTR, ua->ua_evcnt, device_xname(sc->sc_dev), "intr"); }