INNOVA(Section* configuration):Module_base(configuration) { Section_prop * section=static_cast<Section_prop *>(configuration); if(!section->Get_bool("innova")) return; innova.rate = section->Get_int("samplerate"); innova.basePort = section->Get_hex("sidbase"); sampling_method method = SAMPLE_FAST; int m = section->Get_int("quality"); switch(m) { case 1: method = SAMPLE_INTERPOLATE; break; case 2: method = SAMPLE_RESAMPLE_FAST; break; case 3: method = SAMPLE_RESAMPLE_INTERPOLATE; break; } LOG_MSG("INNOVA:Initializing Innovation SSI-2001 (SID) emulation..."); WriteHandler.Install(innova.basePort,innova_write,IO_MB,0x20); ReadHandler.Install(innova.basePort,innova_read,IO_MB,0x20); innova.chan=MixerChan.Install(&INNOVA_CallBack,innova.rate,"INNOVA"); innova.sid = new SID2; innova.sid->set_chip_model(MOS6581); innova.sid->enable_filter(true); innova.sid->enable_external_filter(true); innova.sid->set_sampling_parameters(SID_FREQ, method, innova.rate, -1, 0.97); innova.last_used=0; LOG_MSG("INNOVA:... finished."); }
CMS(Section* configuration):Module_base(configuration) { Section_prop * section = static_cast<Section_prop *>(configuration); Bitu sample_rate_temp = section->Get_int("oplrate"); sample_rate = static_cast<double>(sample_rate_temp); base_port = section->Get_hex("sbbase"); WriteHandler.Install(base_port, write_cms, IO_MB,4); // A standalone Gameblaster has a magic chip on it which is // sometimes used for detection. const char * sbtype=section->Get_string("sbtype"); if (!strcasecmp(sbtype,"gb")) { DetWriteHandler.Install(base_port+4,write_cms_detect,IO_MB,12); DetReadHandler.Install(base_port,read_cms_detect,IO_MB,16); } /* Register the Mixer CallBack */ cms_chan = MixerChan.Install(CMS_CallBack,sample_rate_temp,"CMS"); last_command = PIC_Ticks; for (int s=0;s<2;s++) { struct SAA1099 *saa = &saa1099[s]; memset(saa, 0, sizeof(struct SAA1099)); } }
PCSPEAKER(Section* configuration):Module_base(configuration){ spkr.chan=0; Section_prop * section=static_cast<Section_prop *>(configuration); if(!section->Get_bool("pcspeaker")) return; spkr.mode=SPKR_OFF; spkr.last_ticks=0; spkr.last_index=0; spkr.rate=section->Get_int("pcrate"); spkr.pit_max=(1000.0f/PIT_TICK_RATE)*65535; spkr.pit_half=spkr.pit_max/2; spkr.pit_new_max=spkr.pit_max; spkr.pit_new_half=spkr.pit_half; spkr.pit_index=0; spkr.min_tr=(PIT_TICK_RATE+spkr.rate/2-1)/(spkr.rate/2); spkr.used=0; /* Register the sound channel */ spkr.chan=MixerChan.Install(&PCSPEAKER_CallBack,spkr.rate,"SPKR"); }
TANDYSOUND(Section* configuration):Module_base(configuration){ Section_prop * section=static_cast<Section_prop *>(configuration); bool enable_hw_tandy_dac=true; Bitu sbport, sbirq, sbdma; if (SB_Get_Address(sbport, sbirq, sbdma)) { enable_hw_tandy_dac=false; } //Select the correct tandy chip implementation if (machine == MCH_PCJR) activeDevice = &device_sn76496; else activeDevice = &device_ncr8496; real_writeb(0x40,0xd4,0x00); if (IS_TANDY_ARCH) { /* enable tandy sound if tandy=true/auto */ if ((strcmp(section->Get_string("tandy"),"true")!=0) && (strcmp(section->Get_string("tandy"),"on")!=0) && (strcmp(section->Get_string("tandy"),"auto")!=0)) return; } else { /* only enable tandy sound if tandy=true */ if ((strcmp(section->Get_string("tandy"),"true")!=0) && (strcmp(section->Get_string("tandy"),"on")!=0)) return; /* ports from second DMA controller conflict with tandy ports */ CloseSecondDMAController(); if (enable_hw_tandy_dac) { WriteHandler[2].Install(0x1e0,SN76496Write,IO_MB,2); WriteHandler[3].Install(0x1e4,TandyDACWrite,IO_MB,4); // ReadHandler[3].Install(0x1e4,TandyDACRead,IO_MB,4); } } Bit32u sample_rate = section->Get_int("tandyrate"); tandy.chan=MixerChan.Install(&SN76496Update,sample_rate,"TANDY"); WriteHandler[0].Install(0xc0,SN76496Write,IO_MB,2); if (enable_hw_tandy_dac) { // enable low-level Tandy DAC emulation WriteHandler[1].Install(0xc4,TandyDACWrite,IO_MB,4); ReadHandler[1].Install(0xc4,TandyDACRead,IO_MB,4); tandy.dac.enabled=true; tandy.dac.chan=MixerChanDAC.Install(&TandyDACUpdate,sample_rate,"TANDYDAC"); tandy.dac.hw.base=0xc4; tandy.dac.hw.irq =7; tandy.dac.hw.dma =1; } else { tandy.dac.enabled=false; tandy.dac.hw.base=0; tandy.dac.hw.irq =0; tandy.dac.hw.dma =0; } tandy.dac.control=0; tandy.dac.mode =0; tandy.dac.irq_activated=false; tandy.dac.frequency=0; tandy.dac.amplitude=0; tandy.dac.dma.last_sample=0; tandy.enabled=false; real_writeb(0x40,0xd4,0xff); /* BIOS Tandy DAC initialization value */ ((device_t&)device).device_start(); device.convert_samplerate(sample_rate); }