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)); } }
JOYSTICK(Section* configuration):Module_base(configuration){ Section_prop * section=static_cast<Section_prop *>(configuration); const char * type=section->Get_string("joysticktype"); if (!strcasecmp(type,"none")) joytype = JOY_NONE; else if (!strcasecmp(type,"false")) joytype = JOY_NONE; else if (!strcasecmp(type,"auto")) joytype = JOY_AUTO; else if (!strcasecmp(type,"2axis")) joytype = JOY_2AXIS; else if (!strcasecmp(type,"4axis")) joytype = JOY_4AXIS; else if (!strcasecmp(type,"4axis_2")) joytype = JOY_4AXIS_2; else if (!strcasecmp(type,"fcs")) joytype = JOY_FCS; else if (!strcasecmp(type,"ch")) joytype = JOY_CH; else joytype = JOY_AUTO; bool timed = section->Get_bool("timed"); if(timed) { ReadHandler.Install(0x201,read_p201_timed,IO_MB); WriteHandler.Install(0x201,write_p201_timed,IO_MB); } else { ReadHandler.Install(0x201,read_p201,IO_MB); WriteHandler.Install(0x201,write_p201,IO_MB); } autofire = section->Get_bool("autofire"); swap34 = section->Get_bool("swap34"); button_wrapping_enabled = section->Get_bool("buttonwrap"); stick[0].enabled = false; stick[1].enabled = false; stick[0].xtick = stick[0].ytick = stick[1].xtick = stick[1].ytick = PIC_FullIndex(); }
JOYSTICK(Section* configuration):Module_base(configuration){ Section_prop * section=static_cast<Section_prop *>(configuration); bool timed = section->Get_bool("timed"); if(timed) { ReadHandler.Install(0x201,read_p201_timed,IO_MB); WriteHandler.Install(0x201,write_p201_timed,IO_MB); } else { ReadHandler.Install(0x201,read_p201,IO_MB); WriteHandler.Install(0x201,write_p201,IO_MB); } }
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."); }
MEMORY(Section* configuration):Module_base(configuration){ Bitu i; Section_prop * section=static_cast<Section_prop *>(configuration); /* Setup the Physical Page Links */ Bitu memsize=section->Get_int("memsize"); if (memsize < 1) memsize = 1; /* max 63 to solve problems with certain xms handlers */ if (memsize > MAX_MEMORY-1) { LOG_MSG("Maximum memory size is %d MB",MAX_MEMORY - 1); memsize = MAX_MEMORY-1; } if (memsize > SAFE_MEMORY-1) { LOG_MSG("Memory sizes above %d MB are NOT recommended.",SAFE_MEMORY - 1); LOG_MSG("Stick with the default values unless you are absolutely certain."); } MemBase = new Bit8u[memsize*1024*1024]; if (!MemBase) E_Exit("Can't allocate main memory of %d MB",memsize); /* Clear the memory, as new doesn't always give zeroed memory * (Visual C debug mode). We want zeroed memory though. */ memset((void*)MemBase,0,memsize*1024*1024); memory.pages = (memsize*1024*1024)/4096; /* Allocate the data for the different page information blocks */ memory.phandlers=new PageHandler * [memory.pages]; memory.mhandles=new MemHandle [memory.pages]; for (i = 0;i < memory.pages;i++) { memory.phandlers[i] = &ram_page_handler; memory.mhandles[i] = 0; //Set to 0 for memory allocation } /* Setup rom at 0xc0000-0xc8000 */ for (i=0xc0;i<0xc8;i++) { memory.phandlers[i] = &rom_page_handler; } /* Setup rom at 0xf0000-0x100000 */ for (i=0xf0;i<0x100;i++) { memory.phandlers[i] = &rom_page_handler; } if (machine==MCH_PCJR) { /* Setup cartridge rom at 0xe0000-0xf0000 */ for (i=0xe0;i<0xf0;i++) { memory.phandlers[i] = &rom_page_handler; } } /* Reset some links */ memory.links.used = 0; // A20 Line - PS/2 system control port A WriteHandler.Install(0x92,write_p92,IO_MB); ReadHandler.Install(0x92,read_p92,IO_MB); MEM_A20_Enable(false); }
DISNEY(Section* configuration):Module_base(configuration) { Section_prop * section=static_cast<Section_prop *>(configuration); if(!section->Get_bool("disney")) return; WriteHandler.Install(DISNEY_BASE,disney_write,IO_MB,3); ReadHandler.Install(DISNEY_BASE,disney_read,IO_MB,3); disney.status=0x84; disney.control=0; disney.last_used=0; disney.mo = new MixerObject(); disney.chan=disney.mo->Install(&DISNEY_CallBack,10000,"DISNEY"); DISNEY_disable(0); }
DISNEY(Section* configuration):Module_base(configuration) { Section_prop * section=static_cast<Section_prop *>(configuration); if(!section->Get_bool("disney")) return; if(mem_readw(BIOS_ADDRESS_LPT1) != 0) return; BIOS_SetLPTPort(0,0x378); WriteHandler.Install(DISNEY_BASE,disney_write,IO_MB,3); ReadHandler.Install(DISNEY_BASE,disney_read,IO_MB,3); // see above //WriteHandler_cvm.Install(0x330,disney_write,IO_MB,1); disney.status=0x84; disney.control=0; disney.last_used=0; disney.mo = new MixerObject(); disney.chan=disney.mo->Install(&DISNEY_CallBack,10000,"DISNEY"); DISNEY_disable(0); }
DISNEY(Section* configuration):Module_base(configuration) { Section_prop * section=static_cast<Section_prop *>(configuration); if(!section->Get_bool("disney")) return; for(int i = 0; i < 2; i++) { disney.da[i].used = 0; disney.da[i].speedcheck_sum = 0; disney.da[i].speedcheck_failed = false; disney.da[i].speedcheck_init = false; } WriteHandler.Install(DISNEY_BASE,disney_write,IO_MB,3); ReadHandler.Install(DISNEY_BASE,disney_read,IO_MB,3); // see above //WriteHandler_cvm.Install(0x330,disney_write,IO_MB,1); disney.status=0x84; disney.control=0; disney.last_used=0; disney.mo = new MixerObject(); disney.chan=disney.mo->Install(&DISNEY_CallBack,10000,"DISNEY"); DISNEY_disable(0); }