Beispiel #1
0
void mpu401_init(mpu_t *mpu, uint16_t addr, int irq, int mode)
{
#if 0
	if (mode != M_INTELLIGENT)
	{
		mpu401_uart_init(mpu, addr);
		return;
	}
#endif

	mpu->status = STATUS_INPUT_NOT_READY;
	mpu->irq = irq;
	mpu->queue_used = 0;
	mpu->queue_pos = 0;
	mpu->mode = M_UART;

	mpu->intelligent = (mode == M_INTELLIGENT) ? 1 : 0;
	pclog("Starting as %s (mode is %s)\n", mpu->intelligent ? "INTELLIGENT" : "UART", (mode == M_INTELLIGENT) ? "INTELLIGENT" : "UART");

	mpu401_event_callback = 0;
	mpu401_eoi_callback = 0;
	mpu401_reset_callback = 0;

	io_sethandler(addr, 0x0002, mpu401_read, NULL, NULL, mpu401_write, NULL, NULL, mpu);
	io_sethandler(0x2A20, 0x0010, NULL, NULL, NULL, imf_write, NULL, NULL, mpu);
	timer_add(MPU401_Event, &mpu401_event_callback, &mpu401_event_callback, mpu);
	timer_add(MPU401_EOIHandler, &mpu401_eoi_callback, &mpu401_eoi_callback, mpu);
	timer_add(MPU401_ResetDone, &mpu401_reset_callback, &mpu401_reset_callback, mpu);
	
	MPU401_Reset(mpu);
}
Beispiel #2
0
void amstrad_init(void)
{
        lpt2_remove_ams();
        
        io_sethandler(0x0078, 0x0001, amstrad_mouse_read, NULL, NULL, amstrad_mouse_write, NULL, NULL,  NULL);
        io_sethandler(0x007a, 0x0001, amstrad_mouse_read, NULL, NULL, amstrad_mouse_write, NULL, NULL,  NULL);
        io_sethandler(0x0379, 0x0002, amstrad_read,       NULL, NULL, NULL,                NULL, NULL,  NULL);
        io_sethandler(0xdead, 0x0001, amstrad_read,       NULL, NULL, amstrad_write,       NULL, NULL,  NULL);
}
Beispiel #3
0
void keyboard_pcjr_init()
{
        io_sethandler(0x0060, 0x0004, keyboard_pcjr_read, NULL, NULL, keyboard_pcjr_write, NULL, NULL,  NULL);
        io_sethandler(0x00a0, 0x0008, keyboard_pcjr_read, NULL, NULL, keyboard_pcjr_write, NULL, NULL,  NULL);
        keyboard_pcjr_reset();
        keyboard_send = keyboard_pcjr_adddata;
        keyboard_poll = keyboard_pcjr_poll;

        timer_add(keyboard_pcjr_poll, &keybsenddelay, TIMER_ALWAYS_ENABLED,  NULL);
}
Beispiel #4
0
static void *
sio_detect_init(const device_t *info)
{
    sio_detect_t *dev = (sio_detect_t *) malloc(sizeof(sio_detect_t));
    memset(dev, 0, sizeof(sio_detect_t));

    device_add(&fdc_at_smc_device);

    io_sethandler(0x0024, 0x0004,
		  sio_detect_read, NULL, NULL, sio_detect_write, NULL, NULL, dev);
    io_sethandler(0x002e, 0x0002,
		  sio_detect_read, NULL, NULL, sio_detect_write, NULL, NULL, dev);
    io_sethandler(0x0044, 0x0004,
		  sio_detect_read, NULL, NULL, sio_detect_write, NULL, NULL, dev);
    io_sethandler(0x004e, 0x0002,
		  sio_detect_read, NULL, NULL, sio_detect_write, NULL, NULL, dev);
    io_sethandler(0x0108, 0x0002,
		  sio_detect_read, NULL, NULL, sio_detect_write, NULL, NULL, dev);
    io_sethandler(0x0250, 0x0002,
		  sio_detect_read, NULL, NULL, sio_detect_write, NULL, NULL, dev);
    io_sethandler(0x0370, 0x0002,
		  sio_detect_read, NULL, NULL, sio_detect_write, NULL, NULL, dev);
    io_sethandler(0x03f0, 0x0002,
		  sio_detect_read, NULL, NULL, sio_detect_write, NULL, NULL, dev);

    return dev;
}
static void wd76c10_init(void)
{
        io_sethandler(0x0092, 2,
		      wd76c10_readb, wd76c10_read, NULL,
		      wd76c10_writeb, wd76c10_write, NULL, NULL);
        io_sethandler(0x2072, 2,
		      wd76c10_readb, wd76c10_read, NULL,
		      wd76c10_writeb, wd76c10_write, NULL, NULL);
        io_sethandler(0x2872, 2,
		      wd76c10_readb, wd76c10_read, NULL,
		      wd76c10_writeb, wd76c10_write, NULL, NULL);
        io_sethandler(0x5872, 2,
		      wd76c10_readb, wd76c10_read, NULL,
		      wd76c10_writeb, wd76c10_write, NULL, NULL);
}
void mpu401_uart_init(mpu401_uart_t *mpu, uint16_t addr)
{
        mpu->status = STATUS_INPUT_NOT_READY;
        mpu->uart_mode = 0;
        
        io_sethandler(addr, 0x0002, mpu401_uart_read, NULL, NULL, mpu401_uart_write, NULL, NULL, mpu);
}
Beispiel #7
0
void *tandy_eeprom_init()
{
        tandy_eeprom_t *eeprom = malloc(sizeof(tandy_eeprom_t));
        FILE *f;

        memset(eeprom, 0, sizeof(tandy_eeprom_t));
        
        eeprom->romset = romset;
        switch (romset)
        {
                case ROM_TANDY1000HX:
                f = romfopen("nvr/tandy1000hx.bin" ,"rb");
                break;
                case ROM_TANDY1000SL2:
                f = romfopen("nvr/tandy1000sl2.bin" ,"rb");
                break;
        }
        if (f)
        {
                fread(eeprom->store, 128, 1, f);
                fclose(f);
        }
        else
                memset(eeprom->store, 0, 128);

        io_sethandler(0x037c, 0x0001, NULL, NULL, NULL, tandy_eeprom_write, NULL, NULL, eeprom);
        
        return eeprom;
}
Beispiel #8
0
void serial2_set(uint16_t addr, int irq)
{
        serial2_remove();
        io_sethandler(addr, 0x0008, serial_read, NULL, NULL, serial_write, NULL, NULL, &serial2);
        serial2.irq = irq;
        serial2.addr = addr;
}
Beispiel #9
0
void *tandy_rom_init()
{
        FILE *f, *ff;
        int c;

        tandy_rom = malloc(0x80000);

        f  = romfopen(L"roms/tandy1000sl2/8079047.hu1", L"rb");
        ff = romfopen(L"roms/tandy1000sl2/8079048.hu2", L"rb");
        for (c = 0x0000; c < 0x80000; c += 2)
        {
                tandy_rom[c] = getc(f);
                tandy_rom[c + 1] = getc(ff);
        }
        fclose(ff);
        fclose(f);

        mem_mapping_add(&tandy_rom_mapping, 0xe0000, 0x10000,
                        tandy_read_rom, tandy_read_romw, tandy_read_roml,
                        NULL, NULL, NULL,
                        tandy_rom,  MEM_MAPPING_EXTERNAL, NULL);

        io_sethandler(0xffe8, 0x0008, tandy_rom_bank_read, NULL, NULL, tandy_rom_bank_write, NULL, NULL, NULL);
        
        return tandy_rom;
}
Beispiel #10
0
void serial2_init(uint16_t addr, int irq)
{
    memset(&serial2, 0, sizeof(serial2));
    io_sethandler(addr, 0x0008, serial_read, NULL, NULL, serial_write, NULL, NULL, &serial2);
    serial2.irq = irq;
    serial2.rcr_callback = NULL;
    timer_add(serial_recieve_callback, &serial2.recieve_delay, &serial2.recieve_delay, &serial2);
}
Beispiel #11
0
/* Initialize the ISA BusBugger emulator. */
void
bugger_init(void)
{
    pclog("ISA Bus (de)Bugger, I/O=%04x\n", BUGGER_ADDR);

    /* Initialize local registers. */
    bug_reset();

    io_sethandler(BUGGER_ADDR, BUGGER_ADDRLEN,
		  bug_read, NULL, NULL, bug_write, NULL, NULL,  NULL);
}
Beispiel #12
0
void keyboard_at_init()
{
        //return;
        io_sethandler(0x0060, 0x0005, keyboard_at_read, NULL, NULL, keyboard_at_write, NULL, NULL,  NULL);
        keyboard_at_reset();
        keyboard_send = keyboard_at_adddata_keyboard;
        keyboard_poll = keyboard_at_poll;
        mouse_write = NULL;
        
        timer_add(keyboard_at_poll, &keybsenddelay, TIMER_ALWAYS_ENABLED,  NULL);
}
Beispiel #13
0
void *ssi2001_init()
{
        ssi2001_t *ssi2001 = malloc(sizeof(ssi2001_t));
        memset(ssi2001, 0, sizeof(ssi2001_t));
        
        pclog("ssi2001_init\n");
        ssi2001->psid = sid_init();
        sid_reset(ssi2001->psid);
        io_sethandler(0x0280, 0x0020, ssi2001_read, NULL, NULL, ssi2001_write, NULL, NULL, ssi2001);
        sound_add_handler(ssi2001_get_buffer, ssi2001);
        return ssi2001;
}
Beispiel #14
0
void *pssj_init(const device_t *info)
{
        pssj_t *pssj = malloc(sizeof(pssj_t));
        memset(pssj, 0, sizeof(pssj_t));

        sn76489_init(&pssj->sn76489, 0x00c0, 0x0004, PSSJ, 3579545);

        io_sethandler(0x00C4, 0x0004, pssj_read, NULL, NULL, pssj_write, NULL, NULL, pssj);
        timer_add(pssj_callback, &pssj->timer_count, &pssj->enable, pssj);
        sound_add_handler(pssj_get_buffer, pssj);
        
        return pssj;
}
Beispiel #15
0
void *wss_init()
{
        wss_t *wss = malloc(sizeof(wss_t));
        int c;
        double attenuation;

        memset(wss, 0, sizeof(wss_t));

        opl3_init(&wss->opl);
        ad1848_init(&wss->ad1848);
        
        ad1848_setirq(&wss->ad1848, 7);
        ad1848_setdma(&wss->ad1848, 3);

        io_sethandler(0x0388, 0x0004, opl3_read,   NULL, NULL, opl3_write,   NULL, NULL,  &wss->opl);
        io_sethandler(0x0530, 0x0004, wss_read,    NULL, NULL, wss_write,    NULL, NULL,  wss);
        io_sethandler(0x0534, 0x0004, ad1848_read, NULL, NULL, ad1848_write, NULL, NULL,  &wss->ad1848);
                
        sound_add_handler(wss_poll, wss_get_buffer, wss);
        
        return wss;
}
Beispiel #16
0
void *trigem_unk_init()
{
        vga_t *vga = malloc(sizeof(vga_t));
        memset(vga, 0, sizeof(vga_t));

        rom_init(&vga->bios_rom, L"roms/ibm_vga.bin", 0xc0000, 0x8000, 0x7fff, 0x2000, MEM_MAPPING_EXTERNAL);

        svga_init(&vga->svga, vga, 1 << 18, /*256kb*/
                   NULL,
                   vga_in, vga_out,
                   NULL,
                   NULL);

        io_sethandler(0x03c0, 0x0020, vga_in, NULL, NULL, vga_out, NULL, NULL, vga);

	io_sethandler(0x22ca, 0x0002, svga_in, NULL, NULL, vga_out, NULL, NULL, vga);
	io_sethandler(0x22ce, 0x0002, svga_in, NULL, NULL, vga_out, NULL, NULL, vga);
	io_sethandler(0x32ca, 0x0002, svga_in, NULL, NULL, vga_out, NULL, NULL, vga);

        vga->svga.bpp = 8;
        vga->svga.miscout = 1;
        
        return vga;
}
Beispiel #17
0
void *pas16_init()
{
        pas16_t *pas16 = malloc(sizeof(pas16_t));
        memset(pas16, 0, sizeof(pas16_t));

        opl3_init(&pas16->opl);
        sb_dsp_init(&pas16->dsp, SB2);

        io_sethandler(0x9a01, 0x0001, NULL, NULL, NULL, pas16_out_base, NULL, NULL,  pas16);
        
        timer_add(pas16_pcm_poll, &pas16->pit.c[0], &pas16->pit.enable[0],  pas16);
        
        sound_add_handler(pas16_get_buffer, pas16);
        
        return pas16;
}
Beispiel #18
0
/*PS/1 uses a standard VGA controller, but with no option ROM*/
void *ps1vga_init()
{
        vga_t *vga = malloc(sizeof(vga_t));
        memset(vga, 0, sizeof(vga_t));
       
        svga_init(&vga->svga, vga, 1 << 18, /*256kb*/
                   NULL,
                   vga_in, vga_out,
                   NULL,
                   NULL);

        io_sethandler(0x03c0, 0x0020, vga_in, NULL, NULL, vga_out, NULL, NULL, vga);

        vga->svga.bpp = 8;
        vga->svga.miscout = 1;
        
        return vga;
}
Beispiel #19
0
void ps1mb_init()
{
        io_sethandler(0x0091, 0x0001, ps1_read, NULL, NULL, ps1_write, NULL, NULL, NULL);
        io_sethandler(0x0092, 0x0001, ps1_read, NULL, NULL, ps1_write, NULL, NULL, NULL);
        io_sethandler(0x0094, 0x0001, ps1_read, NULL, NULL, ps1_write, NULL, NULL, NULL);
        io_sethandler(0x0102, 0x0004, ps1_read, NULL, NULL, ps1_write, NULL, NULL, NULL);
        io_sethandler(0x0190, 0x0001, ps1_read, NULL, NULL, ps1_write, NULL, NULL, NULL);
        io_sethandler(0x0320, 0x0001, ps1_read, NULL, NULL, ps1_write, NULL, NULL, NULL);
        io_sethandler(0x0322, 0x0001, ps1_read, NULL, NULL, ps1_write, NULL, NULL, NULL);
        io_sethandler(0x0324, 0x0001, ps1_read, NULL, NULL, ps1_write, NULL, NULL, NULL);
        
        rom_init(&ps1_high_rom,
                                "roms/ibmps1es/f80000.bin",
                                0xf80000,
                                0x80000,
                                0x7ffff,
                                0,
                                MEM_MAPPING_EXTERNAL);
/*        rom_init_interleaved(&ps1_high_rom,
                                "roms/ibmps1es/ibm_1057757_24-05-90.bin",
                                "roms/ibmps1es/ibm_1057757_29-15-90.bin",
                                0xfc0000,
                                0x40000,
                                0x3ffff,
                                0,
                                MEM_MAPPING_EXTERNAL);*/
        ps1_190 = 0;
        
        lpt1_remove();
        lpt2_remove();
        lpt1_init(0x3bc);
        
        serial1_remove();
        serial2_remove();
        
        memset(&ps1_hd, 0, sizeof(ps1_hd));
}
Beispiel #20
0
void lpt2_init(uint16_t port)
{
        io_sethandler(port, 0x0003, lpt2_read, NULL, NULL, lpt2_write, NULL, NULL,  NULL);
}
Beispiel #21
0
void piix_write(int func, int addr, uint8_t val, void *priv)
{
//        pclog("piix_write: func=%d addr=%02x val=%02x %04x:%08x\n", func, addr, val, CS, pc);
        if (func > 1)
           return;
        
        if (func == 1) /*IDE*/
        {
                switch (addr)
                {
                        case 0x04:
                        card_piix_ide[0x04] = (card_piix_ide[0x04] & ~5) | (val & 5);
                        break;
                        case 0x07:
                        card_piix_ide[0x07] = (card_piix_ide[0x07] & ~0x38) | (val & 0x38);
                        break;
                        case 0x0d:
                        card_piix_ide[0x0d] = val;
                        break;
                        
                        case 0x20:
                        card_piix_ide[0x20] = (val & ~0x0f) | 1;
                        break;
                        case 0x21:
                        card_piix_ide[0x21] = val;
                        break;
                        
                        case 0x40:
                        card_piix_ide[0x40] = val;
                        break;
                        case 0x41:
                        if ((val ^ card_piix_ide[0x41]) & 0x80)
                        {
                                ide_pri_disable();
                                if (val & 0x80)
                                        ide_pri_enable();
                        }
                        card_piix_ide[0x41] = val;
                        break;
                        case 0x42:
                        card_piix_ide[0x42] = val;
                        break;
                        case 0x43:
                        if ((val ^ card_piix_ide[0x43]) & 0x80)
                        {
                                ide_sec_disable();
                                if (val & 0x80)
                                   ide_sec_enable();                                  
                        }
                        card_piix_ide[0x43] = val;
                        break;
                }
                if (addr == 4 || (addr & ~3) == 0x20) /*Bus master base address*/                
                {
                        uint16_t base = (card_piix_ide[0x20] & 0xf0) | (card_piix_ide[0x21] << 8);
                        io_removehandler(0, 0x10000, piix_bus_master_read, NULL, NULL, piix_bus_master_write, NULL, NULL,  NULL);
                        if (card_piix_ide[0x04] & 1)
                                io_sethandler(base, 0x10, piix_bus_master_read, NULL, NULL, piix_bus_master_write, NULL, NULL,  NULL);
                }
//                pclog("PIIX write %02X %02X\n", addr, val);
        }
        else
        {
                switch (addr)
                {
                        case 0x00: case 0x01: case 0x02: case 0x03:
                        case 0x08: case 0x09: case 0x0a: case 0x0b:
                        case 0x0e:
                        return;
                }
                card_piix[addr] = val;
        }
}
Beispiel #22
0
void piix_write(int func, int addr, uint8_t val, void *priv)
{
//        pclog("piix_write: func=%d addr=%02x val=%02x %04x:%08x\n", func, addr, val, CS, pc);
        if (func > 1)
           return;
        
        if (func == 1) /*IDE*/
        {
                switch (addr)
                {
                        case 0x04:
			// pclog("IDE on/off\n");
			if (romset == ROM_P55T2P4)  resetide();
                        card_piix_ide[0x04] = (card_piix_ide[0x04] & ~5) | (val & 5);
                        break;
                        case 0x07:
                        card_piix_ide[0x07] = (card_piix_ide[0x07] & ~0x38) | (val & 0x38);
                        break;
                        case 0x0d:
                        card_piix_ide[0x0d] = val;
                        break;
                        
                        case 0x20:
                        card_piix_ide[0x20] = (val & ~0x0f) | 1;
                        break;
                        case 0x21:
                        card_piix_ide[0x21] = val;
                        break;
                        
#if 0
			case 0x33:
			/* Note by OBattler: This is a hack, but it's needed to reset the cylinders of the IDE devices. */
			if (romset != ROM_P55T2P4)  break;
			if (val != piix_33)
			{
				resetide();
			}
			piix_33 = val;
			break;
#endif

                        case 0x40:
                        card_piix_ide[0x40] = val;
                        break;
                        case 0x41:
                        if ((val ^ card_piix_ide[0x41]) & 0x80)
                        {
                                ide_pri_disable();
                                if (val & 0x80)
                                        ide_pri_enable();
                        }
                        card_piix_ide[0x41] = val;
                        break;
                        case 0x42:
                        card_piix_ide[0x42] = val;
                        break;
                        case 0x43:
                        if ((val ^ card_piix_ide[0x43]) & 0x80)
                        {
                                ide_sec_disable();
                                if (val & 0x80)
                                   ide_sec_enable();                                  
                        }
                        card_piix_ide[0x43] = val;
                        break;
			case 0x44:
			if (piix_type >= 3)  card_piix_ide[0x44] = val;
			break;
                }
                if (addr == 4 || (addr & ~3) == 0x20) /*Bus master base address*/                
                {
                        uint16_t base = (card_piix_ide[0x20] & 0xf0) | (card_piix_ide[0x21] << 8);
                        io_removehandler(0, 0x10000, piix_bus_master_read, NULL, NULL, piix_bus_master_write, NULL, NULL,  NULL);
                        if (card_piix_ide[0x04] & 1)
                                io_sethandler(base, 0x10, piix_bus_master_read, NULL, NULL, piix_bus_master_write, NULL, NULL,  NULL);
                }
//                pclog("PIIX write %02X %02X\n", addr, val);
        }
        else
        {
                switch (addr)
                {
                        case 0x00: case 0x01: case 0x02: case 0x03:
                        case 0x08: case 0x09: case 0x0a: case 0x0b:
                        case 0x0e:
                        return;
                }
		if (addr == 0x6A)
		{
			if (piix_type == 1)
				card_piix[addr] = (val & 0xFC) | (card_piix[addr] | 3);
			else if (piix_type == 3)
				card_piix[addr] = (val & 0xFD) | (card_piix[addr] | 2);
		}
		else
	                card_piix[addr] = val;
        }
}
Beispiel #23
0
void sis85c471_init()
{
	int i = 0;

#ifndef RELEASE_BUILD
	pclog("SiS 85c471 Init\n");
#endif

	// ide_sec_disable();
	lpt2_remove();

	sis85c471_curreg = 0;
	for (i = 0; i < 0x27; i++)
	{
		sis85c471_regs[i] = 0;
	}
	sis85c471_regs[9] = 0x40;
	switch (mem_size)
	{
		case 0:
		case 1:
			sis85c471_regs[9] |= 0;
			break;
		case 2:
		case 3:
			sis85c471_regs[9] |= 1;
			break;
		case 4:
			sis85c471_regs[9] |= 2;
			break;
		case 5:
			sis85c471_regs[9] |= 0x20;
			break;
		case 6:
		case 7:
			sis85c471_regs[9] |= 9;
			break;
		case 8:
		case 9:
			sis85c471_regs[9] |= 4;
			break;
		case 10:
		case 11:
			sis85c471_regs[9] |= 5;
			break;
		case 12:
		case 13:
		case 14:
		case 15:
			sis85c471_regs[9] |= 0xB;
			break;
		case 16:
			sis85c471_regs[9] |= 0x13;
			break;
		case 17:
			sis85c471_regs[9] |= 0x21;
			break;
		case 18:
		case 19:
			sis85c471_regs[9] |= 6;
			break;
		case 20:
		case 21:
		case 22:
		case 23:
			sis85c471_regs[9] |= 0xD;
			break;
		case 24:
		case 25:
		case 26:
		case 27:
		case 28:
		case 29:
		case 30:
		case 31:
			sis85c471_regs[9] |= 0xE;
			break;
		case 32:
		case 33:
		case 34:
		case 35:
			sis85c471_regs[9] |= 0x1B;
			break;
		case 36:
		case 37:
		case 38:
		case 39:
			sis85c471_regs[9] |= 0xF;
			break;
		case 40:
		case 41:
		case 42:
		case 43:
		case 44:
		case 45:
		case 46:
		case 47:
			sis85c471_regs[9] |= 0x17;
			break;
		case 48:
			sis85c471_regs[9] |= 0x1E;
			break;
		default:
			if (mem_size < 64)
			{
				sis85c471_regs[9] |= 0x1E;
			}
			else if ((mem_size >= 65) && (mem_size < 68))
			{
				sis85c471_regs[9] |= 0x22;
			}
			else
			{
				sis85c471_regs[9] |= 0x24;
			}
			break;
	}

	sis85c471_regs[0x11] = 9;
	sis85c471_regs[0x12] = 0xFF;
	sis85c471_regs[0x23] = 0xF0;
	sis85c471_regs[0x26] = 1;

	fdc_update_densel_polarity(1);
	fdc_update_densel_force(0);
	fdd_swap = 0;
        io_sethandler(0x0022, 0x0002, sis85c471_read, NULL, NULL, sis85c471_write, NULL, NULL,  NULL);
}
Beispiel #24
0
void memregs_init(void)
{
        io_sethandler(0x00e1, 0x0002, memregs_read, NULL, NULL, memregs_write, NULL, NULL,  NULL);
}
Beispiel #25
0
void powermate_memregs_init(void)
{
        io_sethandler(0x00ed, 0x0002, memregs_read, NULL, NULL, memregs_write, NULL, NULL,  NULL);
        io_sethandler(0xffff, 0x0001, memregs_read, NULL, NULL, memregs_write, NULL, NULL,  NULL);
}
Beispiel #26
0
void serial1_set(uint16_t addr, int irq)
{
    serial1_remove();
    io_sethandler(addr, 0x0008, serial_read,  NULL, NULL, serial_write,  NULL, NULL, &serial1);
    serial1.irq = irq;
}
Beispiel #27
0
void nvr_init()
{
        io_sethandler(0x0070, 0x0002, readnvr, NULL, NULL, writenvr, NULL, NULL,  NULL);
        timer_add(nvr_rtc, &rtctime, TIMER_ALWAYS_ENABLED, NULL);
        timer_add(nvr_onesec, &nvr_onesec_time, TIMER_ALWAYS_ENABLED, NULL);
}
Beispiel #28
0
void pic2_init()
{
        io_sethandler(0x00a0, 0x0002, pic2_read, NULL, NULL, pic2_write, NULL, NULL, NULL);
}
void olivetti_m24_init()
{
        io_sethandler(0x0066, 0x0002, olivetti_m24_read, NULL, NULL, NULL, NULL, NULL, NULL);
}
Beispiel #30
0
static void pas16_out_base(uint16_t port, uint8_t val, void *p)
{
        pas16_t *pas16 = (pas16_t *)p;

        io_removehandler((pas16->base - 0x388) + 0x0388, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0x0788, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0x0b88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0x0f88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0x1388, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0x1788, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0x2788, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0x7f88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0x8388, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0xbf88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0xe388, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0xe788, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0xeb88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0xef88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0xf388, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0xf788, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0xfb88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_removehandler((pas16->base - 0x388) + 0xff88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        
        pas16->base = val << 2;
        pclog("pas16_write_base : PAS16 base now at %04X\n", pas16->base);

        io_sethandler((pas16->base - 0x388) + 0x0388, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0x0788, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0x0b88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0x0f88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0x1388, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0x1788, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0x2788, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0x7f88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0x8388, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0xbf88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0xe388, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0xe788, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0xeb88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0xef88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0xf388, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0xf788, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0xfb88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
        io_sethandler((pas16->base - 0x388) + 0xff88, 0x0004, pas16_in, NULL, NULL, pas16_out, NULL, NULL,  pas16);
}