trunk/src/mame/drivers/speglsht.c
| r32628 | r32629 | |
| 104 | 104 | */ |
| 105 | 105 | |
| 106 | 106 | #include "emu.h" |
| 107 | | #include "cpu/z80/z80.h" |
| 107 | #include "machine/st0016.h" |
| 108 | 108 | #include "cpu/mips/r3000.h" |
| 109 | | #include "sound/st0016.h" |
| 110 | 109 | #include "includes/st0016.h" |
| 111 | 110 | |
| 112 | 111 | |
| r32628 | r32629 | |
| 144 | 143 | AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w) |
| 145 | 144 | AM_RANGE(0xe000, 0xe7ff) AM_RAM |
| 146 | 145 | AM_RANGE(0xe800, 0xe87f) AM_RAM |
| 147 | | AM_RANGE(0xe900, 0xe9ff) AM_DEVREADWRITE("stsnd", st0016_device, st0016_snd_r, st0016_snd_w) |
| 146 | //AM_RANGE(0xe900, 0xe9ff) // sound - internal |
| 148 | 147 | AM_RANGE(0xea00, 0xebff) AM_READ(st0016_palette_ram_r) AM_WRITE(st0016_palette_ram_w) |
| 149 | 148 | AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w) |
| 150 | 149 | AM_RANGE(0xf000, 0xffff) AM_RAM AM_SHARE("shared") |
| r32628 | r32629 | |
| 321 | 320 | static GFXDECODE_START( speglsht ) |
| 322 | 321 | GFXDECODE_END |
| 323 | 322 | |
| 324 | | static const st0016_interface st0016_config = |
| 325 | | { |
| 326 | | &st0016_charram |
| 327 | | }; |
| 328 | 323 | |
| 329 | 324 | MACHINE_RESET_MEMBER(speglsht_state,speglsht) |
| 330 | 325 | { |
| r32628 | r32629 | |
| 380 | 375 | |
| 381 | 376 | static MACHINE_CONFIG_START( speglsht, speglsht_state ) |
| 382 | 377 | /* basic machine hardware */ |
| 383 | | MCFG_CPU_ADD("maincpu",Z80, 8000000) /* 8 MHz ? */ |
| 378 | MCFG_CPU_ADD("maincpu",ST0016_CPU, 8000000) /* 8 MHz ? */ |
| 384 | 379 | MCFG_CPU_PROGRAM_MAP(st0016_mem) |
| 385 | 380 | MCFG_CPU_IO_MAP(st0016_io) |
| 386 | 381 | |
| r32628 | r32629 | |
| 407 | 402 | |
| 408 | 403 | MCFG_VIDEO_START_OVERRIDE(speglsht_state,speglsht) |
| 409 | 404 | |
| 410 | | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 411 | | |
| 412 | | MCFG_ST0016_ADD("stsnd", 0) |
| 413 | | MCFG_SOUND_CONFIG(st0016_config) |
| 414 | | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 415 | | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 416 | 405 | MACHINE_CONFIG_END |
| 417 | 406 | |
| 418 | 407 | ROM_START( speglsht ) |
trunk/src/mame/drivers/srmp5.c
| r32628 | r32629 | |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | #include "emu.h" |
| 38 | | #include "cpu/z80/z80.h" |
| 38 | #include "machine/st0016.h" |
| 39 | 39 | #include "cpu/mips/r3000.h" |
| 40 | | #include "sound/st0016.h" |
| 41 | 40 | #include "includes/st0016.h" |
| 42 | 41 | |
| 43 | 42 | #define DEBUG_CHAR |
| r32628 | r32629 | |
| 370 | 369 | static ADDRESS_MAP_START( st0016_mem, AS_PROGRAM, 8, srmp5_state ) |
| 371 | 370 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 372 | 371 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 373 | | AM_RANGE(0xe900, 0xe9ff) AM_DEVREADWRITE("stsnd", st0016_device, st0016_snd_r, st0016_snd_w) |
| 372 | //AM_RANGE(0xe900, 0xe9ff) // sound - internal |
| 374 | 373 | AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w) |
| 375 | 374 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 376 | 375 | ADDRESS_MAP_END |
| r32628 | r32629 | |
| 497 | 496 | |
| 498 | 497 | INPUT_PORTS_END |
| 499 | 498 | |
| 500 | | static const st0016_interface st0016_config = |
| 501 | | { |
| 502 | | &st0016_charram |
| 503 | | }; |
| 504 | 499 | |
| 505 | 500 | static const gfx_layout tile_16x8x8_layout = |
| 506 | 501 | { |
| r32628 | r32629 | |
| 534 | 529 | static MACHINE_CONFIG_START( srmp5, srmp5_state ) |
| 535 | 530 | |
| 536 | 531 | /* basic machine hardware */ |
| 537 | | MCFG_CPU_ADD("maincpu",Z80,8000000) |
| 532 | MCFG_CPU_ADD("maincpu",ST0016_CPU,8000000) |
| 538 | 533 | MCFG_CPU_PROGRAM_MAP(st0016_mem) |
| 539 | 534 | MCFG_CPU_IO_MAP(st0016_io) |
| 540 | 535 | MCFG_CPU_VBLANK_INT_DRIVER("screen", srmp5_state, irq0_line_hold) |
| r32628 | r32629 | |
| 559 | 554 | #endif |
| 560 | 555 | MCFG_VIDEO_START_OVERRIDE(st0016_state,st0016) |
| 561 | 556 | |
| 562 | | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 563 | | |
| 564 | | MCFG_ST0016_ADD("stsnd", 0) |
| 565 | | MCFG_SOUND_CONFIG(st0016_config) |
| 566 | | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 567 | | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 568 | 557 | MACHINE_CONFIG_END |
| 569 | 558 | |
| 570 | 559 | ROM_START( srmp5 ) |
trunk/src/mame/drivers/macs.c
| r32628 | r32629 | |
| 56 | 56 | */ |
| 57 | 57 | |
| 58 | 58 | #include "emu.h" |
| 59 | | #include "cpu/z80/z80.h" |
| 60 | | #include "sound/st0016.h" |
| 59 | #include "machine/st0016.h" |
| 61 | 60 | #include "includes/st0016.h" |
| 62 | 61 | |
| 63 | 62 | |
| r32628 | r32629 | |
| 94 | 93 | AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w) |
| 95 | 94 | AM_RANGE(0xe000, 0xe7ff) AM_RAM /* work ram ? */ |
| 96 | 95 | AM_RANGE(0xe800, 0xe87f) AM_RAM AM_SHARE("ram2") |
| 97 | | AM_RANGE(0xe900, 0xe9ff) AM_DEVREADWRITE("stsnd", st0016_device, st0016_snd_r, st0016_snd_w) |
| 96 | //AM_RANGE(0xe900, 0xe9ff) // sound - internal |
| 98 | 97 | AM_RANGE(0xea00, 0xebff) AM_READ(st0016_palette_ram_r) AM_WRITE(st0016_palette_ram_w) |
| 99 | 98 | AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w) |
| 100 | 99 | AM_RANGE(0xf000, 0xf7ff) AM_RAMBANK("bank3") /* common /backup ram ?*/ |
| r32628 | r32629 | |
| 470 | 469 | INPUT_PORTS_END |
| 471 | 470 | |
| 472 | 471 | |
| 473 | | static const st0016_interface st0016_config = |
| 474 | | { |
| 475 | | &st0016_charram |
| 476 | | }; |
| 477 | 472 | |
| 473 | |
| 478 | 474 | static MACHINE_CONFIG_START( macs, macs_state ) |
| 479 | 475 | /* basic machine hardware */ |
| 480 | | MCFG_CPU_ADD("maincpu",Z80,8000000) /* 8 MHz ? */ |
| 476 | MCFG_CPU_ADD("maincpu",ST0016_CPU,8000000) /* 8 MHz ? */ |
| 481 | 477 | MCFG_CPU_PROGRAM_MAP(macs_mem) |
| 482 | 478 | MCFG_CPU_IO_MAP(macs_io) |
| 483 | 479 | |
| r32628 | r32629 | |
| 498 | 494 | MCFG_PALETTE_ADD("palette", 16*16*4+1) |
| 499 | 495 | |
| 500 | 496 | MCFG_VIDEO_START_OVERRIDE(st0016_state,st0016) |
| 501 | | |
| 502 | | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 503 | | |
| 504 | | MCFG_ST0016_ADD("stsnd", 0) |
| 505 | | MCFG_SOUND_CONFIG(st0016_config) |
| 506 | | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 507 | | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 508 | 497 | MACHINE_CONFIG_END |
| 509 | 498 | |
| 510 | 499 | |
trunk/src/mame/drivers/st0016.c
| r32628 | r32629 | |
| 14 | 14 | #include "cpu/z80/z80.h" |
| 15 | 15 | #include "sound/st0016.h" |
| 16 | 16 | #include "includes/st0016.h" |
| 17 | #include "machine/st0016.h" |
| 17 | 18 | |
| 18 | 19 | |
| 19 | | |
| 20 | 20 | UINT32 st0016_rom_bank; |
| 21 | 21 | |
| 22 | 22 | /************************************* |
| r32628 | r32629 | |
| 32 | 32 | AM_RANGE(0xd000, 0xdfff) AM_READ(st0016_sprite2_ram_r) AM_WRITE(st0016_sprite2_ram_w) |
| 33 | 33 | AM_RANGE(0xe000, 0xe7ff) AM_RAM |
| 34 | 34 | AM_RANGE(0xe800, 0xe87f) AM_RAM /* common ram */ |
| 35 | | AM_RANGE(0xe900, 0xe9ff) AM_DEVREADWRITE("stsnd", st0016_device, st0016_snd_r, st0016_snd_w) /* sound regs 8 x $20 bytes, see notes */ |
| 35 | //AM_RANGE(0xe900, 0xe9ff) // sound - internal |
| 36 | 36 | AM_RANGE(0xea00, 0xebff) AM_READ(st0016_palette_ram_r) AM_WRITE(st0016_palette_ram_w) |
| 37 | 37 | AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w) |
| 38 | 38 | AM_RANGE(0xf000, 0xffff) AM_RAM /* work ram */ |
| r32628 | r32629 | |
| 395 | 395 | m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE ); |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | | static const st0016_interface st0016_config = |
| 399 | | { |
| 400 | | &st0016_charram |
| 401 | | }; |
| 402 | 398 | |
| 403 | 399 | |
| 400 | |
| 404 | 401 | /************************************* |
| 405 | 402 | * |
| 406 | 403 | * Machine driver(s) |
| r32628 | r32629 | |
| 409 | 406 | |
| 410 | 407 | static MACHINE_CONFIG_START( st0016, st0016_state ) |
| 411 | 408 | /* basic machine hardware */ |
| 412 | | MCFG_CPU_ADD("maincpu",Z80,8000000) /* 8 MHz ? */ |
| 409 | MCFG_CPU_ADD("maincpu",ST0016_CPU,8000000) /* 8 MHz ? */ |
| 413 | 410 | MCFG_CPU_PROGRAM_MAP(st0016_mem) |
| 414 | 411 | MCFG_CPU_IO_MAP(st0016_io) |
| 415 | 412 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", st0016_state, st0016_int, "screen", 0, 1) |
| r32628 | r32629 | |
| 428 | 425 | |
| 429 | 426 | MCFG_VIDEO_START_OVERRIDE(st0016_state,st0016) |
| 430 | 427 | |
| 431 | | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 432 | | |
| 433 | | MCFG_ST0016_ADD("stsnd", 0) |
| 434 | | MCFG_SOUND_CONFIG(st0016_config) |
| 435 | | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 436 | | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 437 | 428 | MACHINE_CONFIG_END |
| 438 | 429 | |
| 439 | 430 | static MACHINE_CONFIG_DERIVED( mayjinsn, st0016 ) |
trunk/src/mame/drivers/jclub2.c
| r32628 | r32629 | |
| 96 | 96 | #include "cpu/m68000/m68000.h" |
| 97 | 97 | #include "machine/eepromser.h" |
| 98 | 98 | #include "sound/okim6295.h" |
| 99 | | #include "sound/st0016.h" |
| 100 | 99 | #include "includes/st0016.h" |
| 101 | | #include "cpu/z80/z80.h" |
| 100 | #include "machine/st0016.h" |
| 102 | 101 | #include "video/st0020.h" |
| 103 | 102 | #include "machine/nvram.h" |
| 104 | 103 | |
| r32628 | r32629 | |
| 1038 | 1037 | static ADDRESS_MAP_START( st0016_mem, AS_PROGRAM, 8, darkhors_state ) |
| 1039 | 1038 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 1040 | 1039 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") |
| 1041 | | AM_RANGE(0xe900, 0xe9ff) AM_DEVREADWRITE("stsnd", st0016_device, st0016_snd_r, st0016_snd_w) |
| 1040 | //AM_RANGE(0xe900, 0xe9ff) // sound - internal |
| 1042 | 1041 | AM_RANGE(0xec00, 0xec1f) AM_READ(st0016_character_ram_r) AM_WRITE(st0016_character_ram_w) |
| 1043 | 1042 | AM_RANGE(0xe82f, 0xe830) AM_READNOP |
| 1044 | 1043 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| r32628 | r32629 | |
| 1055 | 1054 | //AM_RANGE(0xf0, 0xf0) AM_READ(st0016_dma_r) |
| 1056 | 1055 | ADDRESS_MAP_END |
| 1057 | 1056 | |
| 1058 | | static const st0016_interface st0016_config = |
| 1059 | | { |
| 1060 | | &st0016_charram |
| 1061 | | }; |
| 1062 | 1057 | |
| 1063 | 1058 | VIDEO_START_MEMBER(darkhors_state,jclub2o) |
| 1064 | 1059 | { |
| r32628 | r32629 | |
| 1075 | 1070 | MCFG_CPU_PROGRAM_MAP(jclub2o_map) |
| 1076 | 1071 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", darkhors_state, darkhors_irq, "screen", 0, 1) |
| 1077 | 1072 | |
| 1078 | | MCFG_CPU_ADD("st0016",Z80,8000000) |
| 1073 | MCFG_CPU_ADD("st0016",ST0016_CPU,8000000) |
| 1079 | 1074 | MCFG_CPU_PROGRAM_MAP(st0016_mem) |
| 1080 | 1075 | MCFG_CPU_IO_MAP(st0016_io) |
| 1081 | 1076 | MCFG_CPU_VBLANK_INT_DRIVER("screen", darkhors_state, irq0_line_hold) |
| r32628 | r32629 | |
| 1104 | 1099 | |
| 1105 | 1100 | MCFG_VIDEO_START_OVERRIDE(darkhors_state,jclub2o) |
| 1106 | 1101 | |
| 1107 | | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1108 | | |
| 1109 | | MCFG_ST0016_ADD("stsnd", 0) |
| 1110 | | MCFG_SOUND_CONFIG(st0016_config) |
| 1111 | | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 1112 | | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 1113 | 1102 | MACHINE_CONFIG_END |
| 1114 | 1103 | |
| 1115 | 1104 | |
trunk/src/mame/machine/st0016.c
| r0 | r32629 | |
| 1 | /* ST0016 - CPU (z80) + Sound + Video */ |
| 2 | |
| 3 | #include "st0016.h" |
| 4 | |
| 5 | const device_type ST0016_CPU = &device_creator<st0016_cpu_device>; |
| 6 | |
| 7 | |
| 8 | static ADDRESS_MAP_START(st0016_cpu_internal_map, AS_PROGRAM, 8, st0016_cpu_device) |
| 9 | AM_RANGE(0xe900, 0xe9ff) AM_DEVREADWRITE("stsnd", st0016_device, st0016_snd_r, st0016_snd_w) /* sound regs 8 x $20 bytes, see notes */ |
| 10 | ADDRESS_MAP_END |
| 11 | |
| 12 | |
| 13 | static ADDRESS_MAP_START(st0016_cpu_internal_io_map, AS_IO, 8, st0016_cpu_device) |
| 14 | ADDRESS_MAP_END |
| 15 | |
| 16 | |
| 17 | st0016_cpu_device::st0016_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 18 | : z80_device(mconfig, ST0016_CPU, "ST0016", tag, owner, clock, "st0016_cpu", __FILE__), |
| 19 | m_io_space_config("io", ENDIANNESS_LITTLE, 8, 16, 0, ADDRESS_MAP_NAME(st0016_cpu_internal_io_map)), |
| 20 | m_space_config("regs", ENDIANNESS_LITTLE, 8, 16, 0, ADDRESS_MAP_NAME(st0016_cpu_internal_map)) |
| 21 | { |
| 22 | } |
| 23 | |
| 24 | |
| 25 | |
| 26 | //------------------------------------------------- |
| 27 | // device_start - device-specific startup |
| 28 | //------------------------------------------------- |
| 29 | |
| 30 | void st0016_cpu_device::device_start() |
| 31 | { |
| 32 | z80_device::device_start(); |
| 33 | } |
| 34 | |
| 35 | |
| 36 | //------------------------------------------------- |
| 37 | // device_reset - device-specific reset |
| 38 | //------------------------------------------------- |
| 39 | |
| 40 | void st0016_cpu_device::device_reset() |
| 41 | { |
| 42 | z80_device::device_reset(); |
| 43 | } |
| 44 | |
| 45 | static const st0016_interface st0016_config = |
| 46 | { |
| 47 | &st0016_charram |
| 48 | }; |
| 49 | |
| 50 | /* CPU interface */ |
| 51 | static MACHINE_CONFIG_FRAGMENT( st0016_cpu ) |
| 52 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 53 | |
| 54 | MCFG_ST0016_ADD("stsnd", 0) |
| 55 | MCFG_SOUND_CONFIG(st0016_config) |
| 56 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 57 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 58 | |
| 59 | MACHINE_CONFIG_END |
| 60 | |
| 61 | machine_config_constructor st0016_cpu_device::device_mconfig_additions() const |
| 62 | { |
| 63 | return MACHINE_CONFIG_NAME( st0016_cpu ); |
| 64 | } |
| 65 | |
| 66 | |
trunk/src/mame/machine/st0016.h
| r0 | r32629 | |
| 1 | /* ST0016 - CPU (z80) + Sound + Video */ |
| 2 | |
| 3 | #pragma once |
| 4 | |
| 5 | #ifndef __ST0016_CPU__ |
| 6 | #define __ST0016_CPU__ |
| 7 | |
| 8 | #include "emu.h" |
| 9 | #include "cpu/z80/z80.h" |
| 10 | #include "sound/st0016.h" |
| 11 | |
| 12 | extern UINT8 *st0016_charram; |
| 13 | |
| 14 | |
| 15 | class st0016_cpu_device : public z80_device |
| 16 | { |
| 17 | public: |
| 18 | st0016_cpu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32); |
| 19 | |
| 20 | protected: |
| 21 | // device-level overrides |
| 22 | virtual machine_config_constructor device_mconfig_additions() const; |
| 23 | virtual void device_start(); |
| 24 | virtual void device_reset(); |
| 25 | |
| 26 | const address_space_config m_io_space_config; |
| 27 | const address_space_config m_space_config; |
| 28 | |
| 29 | |
| 30 | const address_space_config *memory_space_config(address_spacenum spacenum) const |
| 31 | { |
| 32 | switch (spacenum) |
| 33 | { |
| 34 | case AS_IO: return &m_io_space_config; |
| 35 | case AS_PROGRAM: return &m_space_config; |
| 36 | default: return z80_device::memory_space_config(spacenum); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | |
| 41 | private: |
| 42 | |
| 43 | }; |
| 44 | |
| 45 | |
| 46 | // device type definition |
| 47 | extern const device_type ST0016_CPU; |
| 48 | |
| 49 | |
| 50 | #endif /// __ST0016_CPU__ |
trunk/src/emu/sound/st0016.c
| r32628 | r32629 | |
| 23 | 23 | //------------------------------------------------- |
| 24 | 24 | |
| 25 | 25 | st0016_device::st0016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 26 | | : device_t(mconfig, ST0016, "ST0016", tag, owner, clock, "st0016", __FILE__), |
| 26 | : device_t(mconfig, ST0016, "ST0016 (Audio)", tag, owner, clock, "st0016_audio", __FILE__), |
| 27 | 27 | device_sound_interface(mconfig, *this), |
| 28 | 28 | m_stream(NULL), |
| 29 | 29 | m_sound_ram(NULL) |