trunk/src/mame/drivers/spectra.c
| r18136 | r18137 | |
| 1 | 1 | /****************************************************************************************** |
| 2 | | Pinball |
| 3 | | Valley Spectra IV |
| 4 | | ----------------- |
| 5 | | Rotating game, like Midway's "Rotation VIII". |
| 2 | Pinball |
| 3 | Valley Spectra IV |
| 4 | |
| 5 | Rotating game, like Midway's "Rotation VIII". |
| 6 | |
| 7 | Schematic and PinMAME used as references. |
| 8 | |
| 9 | |
| 6 | 10 | *******************************************************************************************/ |
| 7 | 11 | |
| 8 | 12 | |
| 9 | | #include "emu.h" |
| 13 | #include "machine/genpin.h" |
| 10 | 14 | #include "cpu/m6502/m6502.h" |
| 15 | #include "machine/6532riot.h" |
| 16 | #include "machine/nvram.h" |
| 17 | //#include "spectra.lh" |
| 11 | 18 | |
| 19 | |
| 12 | 20 | class spectra_state : public driver_device |
| 13 | 21 | { |
| 14 | 22 | public: |
| 15 | 23 | spectra_state(const machine_config &mconfig, device_type type, const char *tag) |
| 16 | 24 | : driver_device(mconfig, type, tag), |
| 17 | | m_maincpu(*this, "maincpu") |
| 25 | m_maincpu(*this, "maincpu"), |
| 26 | m_samples(*this, "samples") |
| 18 | 27 | { } |
| 19 | 28 | |
| 29 | DECLARE_READ8_MEMBER(porta_r); |
| 30 | DECLARE_READ8_MEMBER(portb_r); |
| 31 | DECLARE_WRITE8_MEMBER(porta_w); |
| 32 | DECLARE_WRITE8_MEMBER(portb_w); |
| 20 | 33 | protected: |
| 21 | 34 | |
| 22 | 35 | // devices |
| 23 | 36 | required_device<cpu_device> m_maincpu; |
| 37 | required_device<samples_device> m_samples; |
| 24 | 38 | |
| 25 | 39 | // driver_device overrides |
| 26 | 40 | virtual void machine_reset(); |
| r18136 | r18137 | |
| 32 | 46 | static ADDRESS_MAP_START( spectra_map, AS_PROGRAM, 8, spectra_state ) |
| 33 | 47 | ADDRESS_MAP_UNMAP_HIGH |
| 34 | 48 | ADDRESS_MAP_GLOBAL_MASK(0xfff) |
| 35 | | AM_RANGE(0x0000, 0x017f) AM_RAM |
| 36 | | //AM_RANGE(0x0180, 0x019f) riot device |
| 49 | AM_RANGE(0x0000, 0x00ff) AM_RAM AM_SHARE("nvram") // battery backed, 2x 5101L |
| 50 | AM_RANGE(0x0100, 0x017f) AM_RAM // RIOT RAM |
| 51 | AM_RANGE(0x0180, 0x019f) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
| 37 | 52 | AM_RANGE(0x0400, 0x0fff) AM_ROM |
| 38 | 53 | ADDRESS_MAP_END |
| 39 | 54 | |
| r18136 | r18137 | |
| 48 | 63 | { |
| 49 | 64 | } |
| 50 | 65 | |
| 66 | READ8_MEMBER( spectra_state::porta_r ) |
| 67 | {printf("ReadA "); |
| 68 | return 0; |
| 69 | } |
| 70 | |
| 71 | READ8_MEMBER( spectra_state::portb_r ) |
| 72 | {printf("ReadB "); |
| 73 | return 0; |
| 74 | } |
| 75 | |
| 76 | WRITE8_MEMBER( spectra_state::porta_w ) |
| 77 | {printf("A=%X ",data); |
| 78 | } |
| 79 | |
| 80 | WRITE8_MEMBER( spectra_state::portb_w ) |
| 81 | {printf("B=%X ",data); |
| 82 | } |
| 83 | |
| 84 | |
| 85 | static const riot6532_interface riot6532_intf = |
| 86 | { |
| 87 | DEVCB_DRIVER_MEMBER(spectra_state, porta_r), // port a in |
| 88 | DEVCB_DRIVER_MEMBER(spectra_state, portb_r), // port b in |
| 89 | DEVCB_DRIVER_MEMBER(spectra_state, porta_w), // port a out |
| 90 | DEVCB_DRIVER_MEMBER(spectra_state, portb_w), // port b in |
| 91 | DEVCB_CPU_INPUT_LINE("maincpu", M6502_IRQ_LINE) // interrupt |
| 92 | }; |
| 93 | |
| 51 | 94 | static MACHINE_CONFIG_START( spectra, spectra_state ) |
| 52 | 95 | /* basic machine hardware */ |
| 53 | | MCFG_CPU_ADD("maincpu", M6502, 3579545/4) |
| 96 | MCFG_CPU_ADD("maincpu", M6502, 3579545/4) // actually a 6503 |
| 54 | 97 | MCFG_CPU_PROGRAM_MAP(spectra_map) |
| 98 | MCFG_RIOT6532_ADD("riot", 3579545/4, riot6532_intf) // R6532 |
| 99 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 100 | |
| 101 | /* Video */ |
| 102 | //MCFG_DEFAULT_LAYOUT(layout_spectra) |
| 103 | |
| 104 | /* Sound */ |
| 105 | MCFG_FRAGMENT_ADD( genpin_audio ) |
| 55 | 106 | MACHINE_CONFIG_END |
| 56 | 107 | |
| 57 | 108 | /*-------------------------------- |
| r18136 | r18137 | |
| 60 | 111 | ROM_START(spectra) |
| 61 | 112 | ROM_REGION(0x10000, "maincpu", 0) |
| 62 | 113 | ROM_LOAD("spect_u5.dat", 0x0400, 0x0400, CRC(49e0759f) SHA1(c3badc90ff834cbc92d8c519780069310c2b1507)) |
| 114 | // pinmame has a different u4 rom: CRC(b58f1205) SHA1(9578fd89485f3f560789cb0f24c7116e4bc1d0da) |
| 63 | 115 | ROM_LOAD("spect_u4.dat", 0x0800, 0x0400, BAD_DUMP CRC(e6519689) SHA1(06ef3d349ea27a072889b7c379f258d29b7217be)) |
| 64 | 116 | ROM_LOAD("spect_u3.dat", 0x0c00, 0x0400, CRC(9ca7510f) SHA1(a87849f16903836158063d593bb4a2e90c7473c8)) |
| 65 | 117 | ROM_END |