src/emu/sound/sid6581.c
| r4311 | r4312 | |
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | |
| 15 | | static SID6581 *get_sid(int indx) |
| 15 | static SID6581 *get_sid(const device_config *device) |
| 16 | 16 | { |
| 17 | | return NULL; |
| 18 | | // sound_type type = sndnum_to_sndti(indx, NULL); |
| 19 | | // assert((type == SOUND_SID6581) || (type == SOUND_SID8580)); |
| 20 | | // return (SID6581 *) sndti_token(space->machine, type, indx); |
| 17 | assert(device != NULL); |
| 18 | assert((sound_get_type(device) == SOUND_SID6581) || (sound_get_type(device) == SOUND_SID8580)); |
| 19 | return (SID6581 *) device->token; |
| 21 | 20 | } |
| 22 | 21 | |
| 23 | 22 | |
| r4311 | r4312 | |
| 70 | 69 | |
| 71 | 70 | |
| 72 | 71 | |
| 73 | | READ8_HANDLER ( sid6581_0_port_r ) |
| 72 | READ8_DEVICE_HANDLER ( sid6581_r ) |
| 74 | 73 | { |
| 75 | | return sid6581_port_r(space->machine, get_sid(0), offset); |
| 74 | return sid6581_port_r(device->machine, get_sid(device), offset); |
| 76 | 75 | } |
| 77 | 76 | |
| 78 | | READ8_HANDLER ( sid6581_1_port_r ) |
| 79 | | { |
| 80 | | return sid6581_port_r(space->machine, get_sid(1), offset); |
| 81 | | } |
| 82 | 77 | |
| 83 | | WRITE8_HANDLER ( sid6581_0_port_w ) |
| 78 | WRITE8_DEVICE_HANDLER ( sid6581_w ) |
| 84 | 79 | { |
| 85 | | sid6581_port_w(get_sid(0), offset, data); |
| 80 | sid6581_port_w(get_sid(device), offset, data); |
| 86 | 81 | } |
| 87 | 82 | |
| 88 | | WRITE8_HANDLER ( sid6581_1_port_w ) |
| 89 | | { |
| 90 | | sid6581_port_w(get_sid(1), offset, data); |
| 91 | | } |
| 92 | 83 | |
| 93 | 84 | |
| 94 | | |
| 95 | 85 | /************************************************************************** |
| 96 | 86 | * Generic get_info |
| 97 | 87 | **************************************************************************/ |
src/mess/machine/c65.c
| r4311 | r4312 | |
| 473 | 473 | static WRITE8_HANDLER ( c65_write_io ) |
| 474 | 474 | { |
| 475 | 475 | running_machine *machine = space->machine; |
| 476 | const device_config *sid_0 = devtag_get_device(space->machine, SOUND, "sid_r"); |
| 477 | const device_config *sid_1 = devtag_get_device(space->machine, SOUND, "sid_l"); |
| 478 | |
| 476 | 479 | switch(offset&0xf00) { |
| 477 | 480 | case 0x000: |
| 478 | 481 | if (offset < 0x80) |
| r4311 | r4312 | |
| 489 | 492 | break; |
| 490 | 493 | case 0x400: |
| 491 | 494 | if (offset<0x420) /* maybe 0x20 */ |
| 492 | | sid6581_0_port_w (space, offset & 0x3f, data); |
| 495 | sid6581_w(sid_0, offset & 0x3f, data); |
| 493 | 496 | else if (offset<0x440) |
| 494 | | sid6581_1_port_w(space, offset&0x3f, data); |
| 497 | sid6581_w(sid_1, offset & 0x3f, data); |
| 495 | 498 | else |
| 496 | 499 | DBG_LOG (1, "io write", ("%.3x %.2x\n", offset, data)); |
| 497 | 500 | break; |
| r4311 | r4312 | |
| 530 | 533 | static READ8_HANDLER ( c65_read_io ) |
| 531 | 534 | { |
| 532 | 535 | running_machine *machine = space->machine; |
| 536 | const device_config *sid_0 = devtag_get_device(space->machine, SOUND, "sid_r"); |
| 537 | const device_config *sid_1 = devtag_get_device(space->machine, SOUND, "sid_l"); |
| 538 | |
| 533 | 539 | switch(offset&0xf00) { |
| 534 | 540 | case 0x000: |
| 535 | 541 | if (offset < 0x80) |
| r4311 | r4312 | |
| 547 | 553 | break; |
| 548 | 554 | case 0x400: |
| 549 | 555 | if (offset<0x420) |
| 550 | | return sid6581_0_port_r(space, offset & 0x3f); |
| 556 | return sid6581_r(sid_0, offset & 0x3f); |
| 551 | 557 | if (offset<0x440) |
| 552 | | return sid6581_1_port_r(space, offset&0x3f); |
| 558 | return sid6581_r(sid_1, offset & 0x3f); |
| 553 | 559 | DBG_LOG (1, "io read", ("%.3x\n", offset)); |
| 554 | 560 | break; |
| 555 | 561 | case 0x500: |
src/mess/machine/c128.c
| r4311 | r4312 | |
| 95 | 95 | running_machine *machine = space->machine; |
| 96 | 96 | const device_config *cia_0 = devtag_get_device(space->machine, CIA6526R1, "cia_0"); |
| 97 | 97 | const device_config *cia_1 = devtag_get_device(space->machine, CIA6526R1, "cia_1"); |
| 98 | const device_config *sid = devtag_get_device(space->machine, SOUND, "sid6581"); |
| 98 | 99 | |
| 99 | 100 | UINT8 c64_port6510 = (UINT8) device_get_info_int(space->machine->cpu[0], CPUINFO_INT_M6510_PORT); |
| 100 | 101 | |
| r4311 | r4312 | |
| 113 | 114 | vic2_port_w (space, offset & 0x3ff, data); |
| 114 | 115 | break; |
| 115 | 116 | case 4: |
| 116 | | sid6581_0_port_w (space, offset & 0x3f, data); |
| 117 | sid6581_w(sid, offset & 0x3f, data); |
| 117 | 118 | break; |
| 118 | 119 | case 5: |
| 119 | 120 | c128_mmu8722_port_w (space, offset & 0xff, data); |
| r4311 | r4312 | |
| 150 | 151 | running_machine *machine = space->machine; |
| 151 | 152 | const device_config *cia_0 = devtag_get_device(space->machine, CIA6526R1, "cia_0"); |
| 152 | 153 | const device_config *cia_1 = devtag_get_device(space->machine, CIA6526R1, "cia_1"); |
| 154 | const device_config *sid = devtag_get_device(space->machine, SOUND, "sid6581"); |
| 153 | 155 | |
| 154 | 156 | if (offset < 0x400) |
| 155 | 157 | return vic2_port_r (space, offset & 0x3ff); |
| 156 | 158 | else if (offset < 0x500) |
| 157 | | return sid6581_0_port_r (space, offset & 0xff); |
| 159 | return sid6581_r (sid, offset & 0xff); |
| 158 | 160 | else if (offset < 0x600) |
| 159 | 161 | return c128_mmu8722_port_r (space, offset & 0xff); |
| 160 | 162 | else if (offset < 0x800) |
src/mess/machine/c16.c
| r4311 | r4312 | |
| 490 | 490 | MACHINE_RESET( c16 ) |
| 491 | 491 | { |
| 492 | 492 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 493 | const device_config *sid = devtag_get_device(space->machine, SOUND, "sid6581"); |
| 493 | 494 | |
| 494 | 495 | c364_speech_init(machine); |
| 495 | 496 | |
| 496 | 497 | if (read_cfg1(machine) & 0x80) /* SID card present */ |
| 497 | 498 | { |
| 498 | | memory_install_read8_handler(space, 0xfd40, 0xfd5f, 0, 0, sid6581_0_port_r); |
| 499 | | memory_install_write8_handler(space, 0xfd40, 0xfd5f, 0, 0, sid6581_0_port_w); |
| 500 | | memory_install_read8_handler(space, 0xfe80, 0xfe9f, 0, 0, sid6581_0_port_r); |
| 501 | | memory_install_write8_handler(space, 0xfe80, 0xfe9f, 0, 0, sid6581_0_port_w); |
| 499 | memory_install_read8_device_handler(space, sid, 0xfd40, 0xfd5f, 0, 0, sid6581_r); |
| 500 | memory_install_write8_device_handler(space, sid, 0xfd40, 0xfd5f, 0, 0, sid6581_w); |
| 501 | memory_install_read8_device_handler(space, sid, 0xfe80, 0xfe9f, 0, 0, sid6581_r); |
| 502 | memory_install_write8_device_handler(space, sid, 0xfe80, 0xfe9f, 0, 0, sid6581_w); |
| 502 | 503 | } |
| 503 | 504 | else |
| 504 | 505 | { |
src/mess/machine/c64.c
| r4311 | r4312 | |
| 470 | 470 | running_machine *machine = space->machine; |
| 471 | 471 | const device_config *cia_0 = devtag_get_device(space->machine, CIA6526R1, "cia_0"); |
| 472 | 472 | const device_config *cia_1 = devtag_get_device(space->machine, CIA6526R1, "cia_1"); |
| 473 | const device_config *sid = devtag_get_device(space->machine, SOUND, "sid6581"); |
| 473 | 474 | |
| 474 | 475 | c64_io_mirror[ offset ] = data; |
| 475 | 476 | if (offset < 0x400) { |
| 476 | 477 | vic2_port_w (space, offset & 0x3ff, data); |
| 477 | 478 | } else if (offset < 0x800) { |
| 478 | | sid6581_0_port_w (space, offset & 0x3ff, data); |
| 479 | sid6581_w (sid, offset & 0x3ff, data); |
| 479 | 480 | } else if (offset < 0xc00) |
| 480 | 481 | c64_colorram[offset & 0x3ff] = data | 0xf0; |
| 481 | 482 | else if (offset < 0xd00) |
| r4311 | r4312 | |
| 516 | 517 | running_machine *machine = space->machine; |
| 517 | 518 | const device_config *cia_0 = devtag_get_device(space->machine, CIA6526R1, "cia_0"); |
| 518 | 519 | const device_config *cia_1 = devtag_get_device(space->machine, CIA6526R1, "cia_1"); |
| 520 | const device_config *sid = devtag_get_device(space->machine, SOUND, "sid6581"); |
| 519 | 521 | |
| 520 | 522 | if (offset < 0x400) |
| 521 | 523 | return vic2_port_r (space, offset & 0x3ff); |
| 522 | 524 | |
| 523 | 525 | else if (offset < 0x800) |
| 524 | | return sid6581_0_port_r (space, offset & 0x3ff); |
| 526 | return sid6581_r (sid, offset & 0x3ff); |
| 525 | 527 | |
| 526 | 528 | else if (offset < 0xc00) |
| 527 | 529 | return c64_colorram[offset & 0x3ff]; |
src/mess/drivers/cbmb.c
| r4311 | r4312 | |
| 133 | 133 | // AM_RANGE(0xfd800, 0xfd8ff) |
| 134 | 134 | AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_DEVREAD(MC6845, "crtc", mc6845_register_r) |
| 135 | 135 | /* disk units */ |
| 136 | | AM_RANGE(0xfda00, 0xfdaff) AM_READ( sid6581_0_port_r ) |
| 136 | AM_RANGE(0xfda00, 0xfdaff) AM_DEVREAD(SOUND, "sid6581", sid6581_r) |
| 137 | 137 | /* db00 coprocessor */ |
| 138 | 138 | AM_RANGE(0xfdc00, 0xfdcff) AM_DEVREAD( CIA6526R1, "cia", cia_r ) |
| 139 | 139 | /* dd00 acia */ |
| r4311 | r4312 | |
| 156 | 156 | AM_RANGE(0xfd800, 0xfd800) AM_MIRROR( 0xfe ) AM_DEVWRITE(MC6845, "crtc", mc6845_address_w) |
| 157 | 157 | AM_RANGE(0xfd801, 0xfd801) AM_MIRROR( 0xfe ) AM_DEVWRITE(MC6845, "crtc", mc6845_register_w) |
| 158 | 158 | /* disk units */ |
| 159 | | AM_RANGE(0xfda00, 0xfdaff) AM_WRITE( sid6581_0_port_w) |
| 159 | AM_RANGE(0xfda00, 0xfdaff) AM_DEVWRITE(SOUND, "sid6581", sid6581_w) |
| 160 | 160 | /* db00 coprocessor */ |
| 161 | 161 | AM_RANGE(0xfdc00, 0xfdcff) AM_DEVWRITE( CIA6526R1, "cia", cia_w) |
| 162 | 162 | /* dd00 acia */ |
| r4311 | r4312 | |
| 180 | 180 | AM_RANGE(0xfd400, 0xfd7ff) AM_READ( SMH_RAM ) /* colorram */ |
| 181 | 181 | AM_RANGE(0xfd800, 0xfd8ff) AM_READ( vic2_port_r ) |
| 182 | 182 | /* disk units */ |
| 183 | | AM_RANGE(0xfda00, 0xfdaff) AM_READ( sid6581_0_port_r ) |
| 183 | AM_RANGE(0xfda00, 0xfdaff) AM_DEVREAD(SOUND, "sid6581", sid6581_r) |
| 184 | 184 | /* db00 coprocessor */ |
| 185 | 185 | AM_RANGE(0xfdc00, 0xfdcff) AM_DEVREAD( CIA6526R1, "cia", cia_r ) |
| 186 | 186 | /* dd00 acia */ |
| r4311 | r4312 | |
| 204 | 204 | AM_RANGE(0xfd400, 0xfd7ff) AM_WRITE( cbmb_colorram_w) AM_BASE( &cbmb_colorram ) |
| 205 | 205 | AM_RANGE(0xfd800, 0xfd8ff) AM_WRITE( vic2_port_w ) |
| 206 | 206 | /* disk units */ |
| 207 | | AM_RANGE(0xfda00, 0xfdaff) AM_WRITE( sid6581_0_port_w) |
| 207 | AM_RANGE(0xfda00, 0xfdaff) AM_DEVWRITE(SOUND, "sid6581", sid6581_w) |
| 208 | 208 | /* db00 coprocessor */ |
| 209 | 209 | AM_RANGE(0xfdc00, 0xfdcff) AM_DEVWRITE( CIA6526R1, "cia", cia_w) |
| 210 | 210 | /* dd00 acia */ |
src/mess/drivers/c128.c
| r4311 | r4312 | |
| 251 | 251 | static ADDRESS_MAP_START( c128_z80_io , ADDRESS_SPACE_IO, 8) |
| 252 | 252 | AM_RANGE(0x1000, 0x13ff) AM_READWRITE(c64_colorram_read, c64_colorram_write) |
| 253 | 253 | AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(vic2_port_r, vic2_port_w) |
| 254 | | AM_RANGE(0xd400, 0xd4ff) AM_READWRITE(sid6581_0_port_r, sid6581_0_port_w) |
| 254 | AM_RANGE(0xd400, 0xd4ff) AM_DEVREADWRITE(SOUND, "sid6581", sid6581_r, sid6581_w) |
| 255 | 255 | AM_RANGE(0xd500, 0xd5ff) AM_READWRITE(c128_mmu8722_port_r, c128_mmu8722_port_w) |
| 256 | 256 | AM_RANGE(0xd600, 0xd7ff) AM_READWRITE(vdc8563_port_r, vdc8563_port_w) |
| 257 | 257 | AM_RANGE(0xdc00, 0xdcff) AM_DEVREADWRITE(CIA6526R1, "cia_0", cia_r, cia_w) |
src/mess/drivers/c16.c
| r4311 | r4312 | |
| 192 | 192 | AM_RANGE(0x4000, 0x7fff) AM_WRITE( c16_write_4000) /*configured in c16_common_init */ |
| 193 | 193 | AM_RANGE(0x8000, 0xbfff) AM_WRITE( c16_write_8000) /*configured in c16_common_init */ |
| 194 | 194 | AM_RANGE(0xc000, 0xfcff) AM_WRITE( c16_write_c000) /*configured in c16_common_init */ |
| 195 | | AM_RANGE(0xfd40, 0xfd5f) AM_READWRITE(sid6581_0_port_r, sid6581_0_port_w) /* sidcard, eoroidpro ... */ |
| 195 | AM_RANGE(0xfd40, 0xfd5f) AM_DEVREADWRITE(SOUND, "sid6581", sid6581_r, sid6581_w) /* sidcard, eoroidpro ... */ |
| 196 | 196 | AM_RANGE(0xfec0, 0xfedf) AM_READWRITE(c16_iec9_port_r, c16_iec9_port_w) /*configured in c16_common_init */ |
| 197 | 197 | AM_RANGE(0xfee0, 0xfeff) AM_READWRITE(c16_iec8_port_r, c16_iec8_port_w) /*configured in c16_common_init */ |
| 198 | 198 | AM_RANGE(0xff20, 0xff3d) AM_WRITE( c16_write_ff20) /*configure in c16_common_init */ |
| r4311 | r4312 | |
| 211 | 211 | AM_RANGE(0xfd30, 0xfd3f) AM_READWRITE(c16_6529_port_r, c16_6529_port_w) /* 6529 keyboard matrix */ |
| 212 | 212 | AM_RANGE(0xfdd0, 0xfddf) AM_WRITE( c16_select_roms) /* rom chips selection */ |
| 213 | 213 | #if 0 |
| 214 | | AM_RANGE(0xfd40, 0xfd5f) AM_READWRITE(sid6581_0_port_r, sid6581_0_port_w) /* sidcard, eoroidpro ... */ |
| 214 | AM_RANGE(0xfd40, 0xfd5f) AM_DEVREADWRITE(SOUND, "sid6581", sid6581_r, sid6581_w) /* sidcard, eoroidpro ... */ |
| 215 | 215 | AM_RANGE(0xfec0, 0xfedf) AM_READWRITE(c16_iec9_port_r, c16_iec9_port_w) /*configured in c16_common_init */ |
| 216 | 216 | AM_RANGE(0xfee0, 0xfeff) AM_READWRITE(c16_iec8_port_r, c16_iec8_port_w) /*configured in c16_common_init */ |
| 217 | 217 | #endif |
| r4311 | r4312 | |
| 235 | 235 | AM_RANGE(0xfd30, 0xfd3f) AM_READWRITE(c16_6529_port_r, c16_6529_port_w) /* 6529 keyboard matrix */ |
| 236 | 236 | AM_RANGE(0xfdd0, 0xfddf) AM_WRITE( c16_select_roms) /* rom chips selection */ |
| 237 | 237 | #if 0 |
| 238 | | AM_RANGE(0xfd40, 0xfd5f) AM_READWRITE(sid6581_0_port_r, sid6581_0_port_w) /* sidcard, eoroidpro ... */ |
| 238 | AM_RANGE(0xfd40, 0xfd5f) AM_DEVREADWRITE(SOUND, "sid6581", sid6581_r, sid6581_w) /* sidcard, eoroidpro ... */ |
| 239 | 239 | AM_RANGE(0xfec0, 0xfedf) AM_READWRITE(c16_iec9_port_r, c16_iec9_port_w) /*configured in c16_common_init */ |
| 240 | 240 | AM_RANGE(0xfee0, 0xfeff) AM_READWRITE(c16_iec8_port_r, c16_iec8_port_w) /*configured in c16_common_init */ |
| 241 | 241 | #endif |
src/mess/drivers/c64.c
| r4311 | r4312 | |
| 349 | 349 | AM_RANGE(0x0000, 0x0fff) AM_RAM AM_BASE(&c64_memory) |
| 350 | 350 | AM_RANGE(0x8000, 0x9fff) AM_ROM AM_BASE(&c64_roml) |
| 351 | 351 | AM_RANGE(0xd000, 0xd3ff) AM_READWRITE(vic2_port_r, vic2_port_w) |
| 352 | | AM_RANGE(0xd400, 0xd7ff) AM_READWRITE(sid6581_0_port_r, sid6581_0_port_w) |
| 352 | AM_RANGE(0xd400, 0xd7ff) AM_DEVREADWRITE(SOUND, "sid6581", sid6581_r, sid6581_w) |
| 353 | 353 | AM_RANGE(0xd800, 0xdbff) AM_READWRITE(SMH_RAM, c64_colorram_write) AM_BASE(&c64_colorram) /* colorram */ |
| 354 | 354 | AM_RANGE(0xdc00, 0xdcff) AM_DEVREADWRITE(CIA6526R1, "cia_0", cia_r, cia_w) |
| 355 | 355 | AM_RANGE(0xe000, 0xffff) AM_ROM AM_BASE(&c64_romh) /* ram or kernel rom */ |
| r4311 | r4312 | |
| 493 | 493 | |
| 494 | 494 | /* sound hardware */ |
| 495 | 495 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 496 | | MDRV_SOUND_ADD("sid", SID6581, VIC6567_CLOCK) |
| 496 | MDRV_SOUND_ADD("sid6581", SID6581, VIC6567_CLOCK) |
| 497 | 497 | MDRV_SOUND_CONFIG(c64_sound_interface) |
| 498 | 498 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 499 | 499 | MDRV_SOUND_ADD("dac", DAC, 0) |
| r4311 | r4312 | |
| 533 | 533 | |
| 534 | 534 | /* sound hardware */ |
| 535 | 535 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 536 | | MDRV_SOUND_ADD("sid", SID6581, VIC6569_CLOCK) |
| 536 | MDRV_SOUND_ADD("sid6581", SID6581, VIC6569_CLOCK) |
| 537 | 537 | MDRV_SOUND_CONFIG(c64_sound_interface) |
| 538 | 538 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 539 | 539 | MDRV_SOUND_ADD("dac", DAC, 0) |
| r4311 | r4312 | |
| 557 | 557 | MDRV_CPU_REPLACE( "main", M6510, VIC6567_CLOCK) |
| 558 | 558 | MDRV_CPU_PROGRAM_MAP( ultimax_mem, 0 ) |
| 559 | 559 | |
| 560 | | MDRV_SOUND_REPLACE("sid", SID6581, VIC6567_CLOCK) |
| 560 | MDRV_SOUND_REPLACE("sid6581", SID6581, VIC6567_CLOCK) |
| 561 | 561 | MDRV_SOUND_CONFIG(c64_sound_interface) |
| 562 | 562 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 563 | 563 | |