/* * This device has "ISA style" MIDI and FM subsystems. Such devices don't * use PCI config space for the I/O ports and interrupts. Instead the driver * needs to allocate proper resources itself. This functionality is no longer * possible. For this reason the MIDI and FM parts are not accessible. */ static void attach_fm (als300_devc * devc) { if (!opl3_detect (0x388, devc->osdev)) return; opl3_init (0x388, devc->osdev); devc->fm_attached = 1; }
/* * This device has "ISA style" MIDI and FM subsystems. Such devices don't * use PCI config space for the I/O ports and interrupts. Instead the driver * needs to allocate proper resources itself. This functionality is no longer * possible. For this reason the MIDI and FM parts are not accessible. */ static void attach_fm (fm801_devc * devc) { if (!opl3_detect (devc->base + 0x68, devc->osdev)) return; opl3_init (devc->base + 0x68, devc->osdev); devc->fm_attached = 1; }
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; }
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; }
void attach_adlib_card(struct address_info *hw_config) { hw_config->slots[0] = opl3_init(hw_config->io_base, hw_config->osp); request_region(hw_config->io_base, 4, "OPL3/OPL2"); }