trunk/src/mame/layout/spectra.lay
| r0 | r18156 | |
| 1 | <!-- spectra.lay --> |
| 2 | |
| 3 | <!-- 2012-09-26: Initial version. [Robbbert] --> |
| 4 | |
| 5 | <mamelayout version="2"> |
| 6 | |
| 7 | <element name="digit" defstate="0"> |
| 8 | <led7seg> |
| 9 | <color red="1.0" green="0.0" blue="0.0" /> |
| 10 | </led7seg> |
| 11 | </element> |
| 12 | |
| 13 | <element name="background"> |
| 14 | <rect> |
| 15 | <bounds left="0" top="0" right="1" bottom="1" /> |
| 16 | <color red="0.0" green="0.0" blue="0.0" /> |
| 17 | </rect> |
| 18 | </element> |
| 19 | <element name="P0"><text string="Ball / Match"><color red="1.0" green="1.0" blue="1.0" /></text></element> |
| 20 | <element name="P1"><text string="Credits"><color red="1.0" green="1.0" blue="1.0" /></text></element> |
| 21 | <element name="P3"><text string="Player 1"><color red="1.0" green="1.0" blue="1.0" /></text></element> |
| 22 | <element name="P4"><text string="Player 2"><color red="1.0" green="1.0" blue="1.0" /></text></element> |
| 23 | <element name="P5"><text string="Player 3"><color red="1.0" green="1.0" blue="1.0" /></text></element> |
| 24 | <element name="P6"><text string="Player 4"><color red="1.0" green="1.0" blue="1.0" /></text></element> |
| 25 | |
| 26 | <view name="Default Layout"> |
| 27 | |
| 28 | <!-- Background --> |
| 29 | <backdrop element="background"> |
| 30 | <bounds left="0" top="20" right="274" bottom="394" /> |
| 31 | </backdrop> |
| 32 | |
| 33 | <!-- LEDs --> |
| 34 | |
| 35 | <!-- Player 1 Score --> |
| 36 | |
| 37 | <bezel name="digit32" element="digit"> |
| 38 | <bounds left="10" top="45" right="44" bottom="84" /> |
| 39 | </bezel> |
| 40 | <bezel name="digit33" element="digit"> |
| 41 | <bounds left="54" top="45" right="88" bottom="84" /> |
| 42 | </bezel> |
| 43 | <bezel name="digit34" element="digit"> |
| 44 | <bounds left="98" top="45" right="132" bottom="84" /> |
| 45 | </bezel> |
| 46 | <bezel name="digit35" element="digit"> |
| 47 | <bounds left="142" top="45" right="176" bottom="84" /> |
| 48 | </bezel> |
| 49 | <bezel name="digit36" element="digit"> |
| 50 | <bounds left="186" top="45" right="220" bottom="84" /> |
| 51 | </bezel> |
| 52 | <bezel name="digit37" element="digit"> |
| 53 | <bounds left="230" top="45" right="264" bottom="84" /> |
| 54 | </bezel> |
| 55 | |
| 56 | <!-- Player 2 Score --> |
| 57 | <bezel name="digit24" element="digit"> |
| 58 | <bounds left="10" top="105" right="44" bottom="144" /> |
| 59 | </bezel> |
| 60 | <bezel name="digit25" element="digit"> |
| 61 | <bounds left="54" top="105" right="88" bottom="144" /> |
| 62 | </bezel> |
| 63 | <bezel name="digit26" element="digit"> |
| 64 | <bounds left="98" top="105" right="132" bottom="144" /> |
| 65 | </bezel> |
| 66 | <bezel name="digit27" element="digit"> |
| 67 | <bounds left="142" top="105" right="176" bottom="144" /> |
| 68 | </bezel> |
| 69 | <bezel name="digit28" element="digit"> |
| 70 | <bounds left="186" top="105" right="220" bottom="144" /> |
| 71 | </bezel> |
| 72 | <bezel name="digit29" element="digit"> |
| 73 | <bounds left="230" top="105" right="264" bottom="144" /> |
| 74 | </bezel> |
| 75 | |
| 76 | <!-- Player 3 Score --> |
| 77 | <bezel name="digit16" element="digit"> |
| 78 | <bounds left="10" top="165" right="44" bottom="204" /> |
| 79 | </bezel> |
| 80 | <bezel name="digit17" element="digit"> |
| 81 | <bounds left="54" top="165" right="88" bottom="204" /> |
| 82 | </bezel> |
| 83 | <bezel name="digit18" element="digit"> |
| 84 | <bounds left="98" top="165" right="132" bottom="204" /> |
| 85 | </bezel> |
| 86 | <bezel name="digit19" element="digit"> |
| 87 | <bounds left="142" top="165" right="176" bottom="204" /> |
| 88 | </bezel> |
| 89 | <bezel name="digit20" element="digit"> |
| 90 | <bounds left="186" top="165" right="220" bottom="204" /> |
| 91 | </bezel> |
| 92 | <bezel name="digit21" element="digit"> |
| 93 | <bounds left="230" top="165" right="264" bottom="204" /> |
| 94 | </bezel> |
| 95 | |
| 96 | <!-- Player 4 Score --> |
| 97 | <bezel name="digit8" element="digit"> |
| 98 | <bounds left="10" top="225" right="44" bottom="264" /> |
| 99 | </bezel> |
| 100 | <bezel name="digit9" element="digit"> |
| 101 | <bounds left="54" top="225" right="88" bottom="264" /> |
| 102 | </bezel> |
| 103 | <bezel name="digit10" element="digit"> |
| 104 | <bounds left="98" top="225" right="132" bottom="264" /> |
| 105 | </bezel> |
| 106 | <bezel name="digit11" element="digit"> |
| 107 | <bounds left="142" top="225" right="176" bottom="264" /> |
| 108 | </bezel> |
| 109 | <bezel name="digit12" element="digit"> |
| 110 | <bounds left="186" top="225" right="220" bottom="264" /> |
| 111 | </bezel> |
| 112 | <bezel name="digit13" element="digit"> |
| 113 | <bounds left="230" top="225" right="264" bottom="264" /> |
| 114 | </bezel> |
| 115 | |
| 116 | <!-- Credits and Balls --> |
| 117 | <bezel name="digit0" element="digit"> |
| 118 | <bounds left="10" top="345" right="44" bottom="384" /> |
| 119 | </bezel> |
| 120 | <bezel name="digit1" element="digit"> |
| 121 | <bounds left="54" top="345" right="88" bottom="384" /> |
| 122 | </bezel> |
| 123 | <bezel name="digit2" element="digit"> |
| 124 | <bounds left="98" top="345" right="132" bottom="384" /> |
| 125 | </bezel> |
| 126 | <bezel name="digit3" element="digit"> |
| 127 | <bounds left="142" top="345" right="176" bottom="384" /> |
| 128 | </bezel> |
| 129 | <bezel name="digit4" element="digit"> |
| 130 | <bounds left="186" top="345" right="220" bottom="384" /> |
| 131 | </bezel> |
| 132 | <bezel name="digit5" element="digit"> |
| 133 | <bounds left="230" top="345" right="264" bottom="384" /> |
| 134 | </bezel> |
| 135 | <bezel element="P0"><bounds left="200" right="258" top="330" bottom="342" /></bezel> |
| 136 | <bezel element="P1"><bounds left="30" right="88" top="330" bottom="342" /></bezel> |
| 137 | <bezel element="P3"><bounds left="100" right="180" top="30" bottom="42" /></bezel> |
| 138 | <bezel element="P4"><bounds left="100" right="180" top="90" bottom="102" /></bezel> |
| 139 | <bezel element="P5"><bounds left="100" right="180" top="150" bottom="162" /></bezel> |
| 140 | <bezel element="P6"><bounds left="100" right="180" top="210" bottom="222" /></bezel> |
| 141 | </view> |
| 142 | </mamelayout> |
trunk/src/mame/drivers/spectra.c
| r18155 | r18156 | |
| 14 | 14 | #include "cpu/m6502/m6502.h" |
| 15 | 15 | #include "machine/6532riot.h" |
| 16 | 16 | #include "machine/nvram.h" |
| 17 | | //#include "spectra.lh" |
| 17 | #include "spectra.lh" |
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | class spectra_state : public driver_device |
| r18155 | r18156 | |
| 23 | 23 | spectra_state(const machine_config &mconfig, device_type type, const char *tag) |
| 24 | 24 | : driver_device(mconfig, type, tag), |
| 25 | 25 | m_maincpu(*this, "maincpu"), |
| 26 | m_p_ram(*this, "ram"), |
| 26 | 27 | m_samples(*this, "samples") |
| 27 | 28 | { } |
| 28 | 29 | |
| r18155 | r18156 | |
| 30 | 31 | DECLARE_READ8_MEMBER(portb_r); |
| 31 | 32 | DECLARE_WRITE8_MEMBER(porta_w); |
| 32 | 33 | DECLARE_WRITE8_MEMBER(portb_w); |
| 34 | TIMER_DEVICE_CALLBACK_MEMBER(nmitimer); |
| 35 | TIMER_DEVICE_CALLBACK_MEMBER(outtimer); |
| 33 | 36 | protected: |
| 34 | 37 | |
| 35 | 38 | // devices |
| 36 | 39 | required_device<cpu_device> m_maincpu; |
| 40 | required_shared_ptr<UINT8> m_p_ram; |
| 37 | 41 | required_device<samples_device> m_samples; |
| 38 | 42 | |
| 39 | 43 | // driver_device overrides |
| 40 | 44 | virtual void machine_reset(); |
| 41 | | public: |
| 42 | | DECLARE_DRIVER_INIT(spectra); |
| 45 | private: |
| 46 | UINT8 m_t_c; |
| 47 | UINT8 m_out_offs; |
| 43 | 48 | }; |
| 44 | 49 | |
| 45 | 50 | |
| 46 | 51 | static ADDRESS_MAP_START( spectra_map, AS_PROGRAM, 8, spectra_state ) |
| 47 | 52 | ADDRESS_MAP_UNMAP_HIGH |
| 48 | 53 | ADDRESS_MAP_GLOBAL_MASK(0xfff) |
| 49 | | AM_RANGE(0x0000, 0x00ff) AM_RAM AM_SHARE("nvram") // battery backed, 2x 5101L |
| 54 | AM_RANGE(0x0000, 0x00ff) AM_RAM AM_SHARE("ram") // battery backed, 2x 5101L |
| 50 | 55 | AM_RANGE(0x0100, 0x017f) AM_RAM // RIOT RAM |
| 51 | 56 | AM_RANGE(0x0180, 0x019f) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
| 52 | 57 | AM_RANGE(0x0400, 0x0fff) AM_ROM |
| r18155 | r18156 | |
| 57 | 62 | |
| 58 | 63 | void spectra_state::machine_reset() |
| 59 | 64 | { |
| 65 | m_t_c = 0; |
| 60 | 66 | } |
| 61 | 67 | |
| 62 | | DRIVER_INIT_MEMBER(spectra_state,spectra) |
| 63 | | { |
| 64 | | } |
| 65 | | |
| 66 | 68 | READ8_MEMBER( spectra_state::porta_r ) |
| 67 | 69 | {printf("ReadA "); |
| 68 | 70 | return 0; |
| r18155 | r18156 | |
| 70 | 72 | |
| 71 | 73 | READ8_MEMBER( spectra_state::portb_r ) |
| 72 | 74 | {printf("ReadB "); |
| 73 | | return 0; |
| 75 | return 0x5a; |
| 74 | 76 | } |
| 75 | 77 | |
| 76 | 78 | WRITE8_MEMBER( spectra_state::porta_w ) |
| r18155 | r18156 | |
| 91 | 93 | DEVCB_CPU_INPUT_LINE("maincpu", M6502_IRQ_LINE) // interrupt |
| 92 | 94 | }; |
| 93 | 95 | |
| 96 | TIMER_DEVICE_CALLBACK_MEMBER( spectra_state::nmitimer) |
| 97 | { |
| 98 | if (m_t_c > 0x80) |
| 99 | m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 100 | else |
| 101 | m_t_c++; |
| 102 | } |
| 103 | |
| 104 | TIMER_DEVICE_CALLBACK_MEMBER( spectra_state::outtimer) |
| 105 | { |
| 106 | static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x38, 0x63, 0x01, 0x40, 0x08, 0 }; // 74C912 |
| 107 | m_out_offs++; |
| 108 | |
| 109 | if (m_out_offs < 0x28) |
| 110 | output_set_digit_value(m_out_offs, patterns[m_p_ram[m_out_offs]&15]); |
| 111 | else |
| 112 | m_out_offs = 0xff; |
| 113 | } |
| 114 | |
| 94 | 115 | static MACHINE_CONFIG_START( spectra, spectra_state ) |
| 95 | 116 | /* basic machine hardware */ |
| 96 | 117 | MCFG_CPU_ADD("maincpu", M6502, 3579545/4) // actually a 6503 |
| 97 | 118 | MCFG_CPU_PROGRAM_MAP(spectra_map) |
| 98 | 119 | MCFG_RIOT6532_ADD("riot", 3579545/4, riot6532_intf) // R6532 |
| 99 | | MCFG_NVRAM_ADD_0FILL("nvram") |
| 120 | MCFG_NVRAM_ADD_0FILL("ram") |
| 121 | MCFG_TIMER_DRIVER_ADD_PERIODIC("nmitimer", spectra_state, nmitimer, attotime::from_hz(120)) |
| 122 | MCFG_TIMER_DRIVER_ADD_PERIODIC("outtimer", spectra_state, outtimer, attotime::from_hz(1200)) |
| 100 | 123 | |
| 101 | 124 | /* Video */ |
| 102 | | //MCFG_DEFAULT_LAYOUT(layout_spectra) |
| 125 | MCFG_DEFAULT_LAYOUT(layout_spectra) |
| 103 | 126 | |
| 104 | 127 | /* Sound */ |
| 105 | 128 | MCFG_FRAGMENT_ADD( genpin_audio ) |
| r18155 | r18156 | |
| 117 | 140 | ROM_END |
| 118 | 141 | |
| 119 | 142 | |
| 120 | | GAME(1979, spectra, 0, spectra, spectra, spectra_state, spectra, ROT0, "Valley", "Spectra IV", GAME_IS_SKELETON_MECHANICAL) |
| 143 | GAME(1979, spectra, 0, spectra, spectra, driver_device, 0, ROT0, "Valley", "Spectra IV", GAME_IS_SKELETON_MECHANICAL) |