trunk/src/mame/layout/wico.lay
| r0 | r18232 | |
| 1 | <!-- g627.lay --> |
| 2 | |
| 3 | <!-- 2012-09-11: 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="East"><color red="1.0" green="1.0" blue="1.0" /></text></element> |
| 22 | <element name="P4"><text string="North"><color red="1.0" green="1.0" blue="1.0" /></text></element> |
| 23 | <element name="P5"><text string="West"><color red="1.0" green="1.0" blue="1.0" /></text></element> |
| 24 | <element name="P6"><text string="South"><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="digit0" element="digit"> |
| 38 | <bounds left="10" top="45" right="44" bottom="84" /> |
| 39 | </bezel> |
| 40 | <bezel name="digit1" element="digit"> |
| 41 | <bounds left="54" top="45" right="88" bottom="84" /> |
| 42 | </bezel> |
| 43 | <bezel name="digit2" element="digit"> |
| 44 | <bounds left="98" top="45" right="132" bottom="84" /> |
| 45 | </bezel> |
| 46 | <bezel name="digit3" element="digit"> |
| 47 | <bounds left="142" top="45" right="176" bottom="84" /> |
| 48 | </bezel> |
| 49 | <bezel name="digit4" element="digit"> |
| 50 | <bounds left="186" top="45" right="220" bottom="84" /> |
| 51 | </bezel> |
| 52 | <bezel name="digit5" element="digit"> |
| 53 | <bounds left="230" top="45" right="264" bottom="84" /> |
| 54 | </bezel> |
| 55 | |
| 56 | <!-- Player 2 Score --> |
| 57 | <bezel name="digit10" element="digit"> |
| 58 | <bounds left="10" top="105" right="44" bottom="144" /> |
| 59 | </bezel> |
| 60 | <bezel name="digit11" element="digit"> |
| 61 | <bounds left="54" top="105" right="88" bottom="144" /> |
| 62 | </bezel> |
| 63 | <bezel name="digit12" element="digit"> |
| 64 | <bounds left="98" top="105" right="132" bottom="144" /> |
| 65 | </bezel> |
| 66 | <bezel name="digit13" element="digit"> |
| 67 | <bounds left="142" top="105" right="176" bottom="144" /> |
| 68 | </bezel> |
| 69 | <bezel name="digit14" element="digit"> |
| 70 | <bounds left="186" top="105" right="220" bottom="144" /> |
| 71 | </bezel> |
| 72 | <bezel name="digit15" element="digit"> |
| 73 | <bounds left="230" top="105" right="264" bottom="144" /> |
| 74 | </bezel> |
| 75 | |
| 76 | <!-- Player 3 Score --> |
| 77 | <bezel name="digit20" element="digit"> |
| 78 | <bounds left="10" top="165" right="44" bottom="204" /> |
| 79 | </bezel> |
| 80 | <bezel name="digit21" element="digit"> |
| 81 | <bounds left="54" top="165" right="88" bottom="204" /> |
| 82 | </bezel> |
| 83 | <bezel name="digit22" element="digit"> |
| 84 | <bounds left="98" top="165" right="132" bottom="204" /> |
| 85 | </bezel> |
| 86 | <bezel name="digit23" element="digit"> |
| 87 | <bounds left="142" top="165" right="176" bottom="204" /> |
| 88 | </bezel> |
| 89 | <bezel name="digit24" element="digit"> |
| 90 | <bounds left="186" top="165" right="220" bottom="204" /> |
| 91 | </bezel> |
| 92 | <bezel name="digit25" element="digit"> |
| 93 | <bounds left="230" top="165" right="264" bottom="204" /> |
| 94 | </bezel> |
| 95 | |
| 96 | <!-- Player 4 Score --> |
| 97 | <bezel name="digit30" element="digit"> |
| 98 | <bounds left="10" top="225" right="44" bottom="264" /> |
| 99 | </bezel> |
| 100 | <bezel name="digit31" element="digit"> |
| 101 | <bounds left="54" top="225" right="88" bottom="264" /> |
| 102 | </bezel> |
| 103 | <bezel name="digit32" element="digit"> |
| 104 | <bounds left="98" top="225" right="132" bottom="264" /> |
| 105 | </bezel> |
| 106 | <bezel name="digit33" element="digit"> |
| 107 | <bounds left="142" top="225" right="176" bottom="264" /> |
| 108 | </bezel> |
| 109 | <bezel name="digit34" element="digit"> |
| 110 | <bounds left="186" top="225" right="220" bottom="264" /> |
| 111 | </bezel> |
| 112 | <bezel name="digit35" element="digit"> |
| 113 | <bounds left="230" top="225" right="264" bottom="264" /> |
| 114 | </bezel> |
| 115 | |
| 116 | <!-- Credits and Balls --> |
| 117 | <bezel name="digit50" element="digit"> |
| 118 | <bounds left="10" top="345" right="44" bottom="384" /> |
| 119 | </bezel> |
| 120 | <bezel name="digit51" element="digit"> |
| 121 | <bounds left="54" top="345" right="88" bottom="384" /> |
| 122 | </bezel> |
| 123 | <bezel name="digit52" element="digit"> |
| 124 | <bounds left="98" top="345" right="132" bottom="384" /> |
| 125 | </bezel> |
| 126 | <bezel name="digit53" element="digit"> |
| 127 | <bounds left="142" top="345" right="176" bottom="384" /> |
| 128 | </bezel> |
| 129 | <bezel name="digit54" element="digit"> |
| 130 | <bounds left="186" top="345" right="220" bottom="384" /> |
| 131 | </bezel> |
| 132 | <bezel name="digit55" 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/wico.c
| r18231 | r18232 | |
| 13 | 13 | #include "cpu/m6809/m6809.h" |
| 14 | 14 | #include "machine/nvram.h" |
| 15 | 15 | #include "sound/sn76496.h" |
| 16 | | //#include "wico.lh" |
| 16 | #include "wico.lh" |
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | class wico_state : public driver_device |
| r18231 | r18232 | |
| 27 | 27 | m_samples(*this, "samples") |
| 28 | 28 | { } |
| 29 | 29 | |
| 30 | DECLARE_READ8_MEMBER(lampst_r); |
| 31 | DECLARE_READ8_MEMBER(switch_r); |
| 32 | DECLARE_WRITE8_MEMBER(muxen_w); |
| 33 | DECLARE_WRITE8_MEMBER(muxld_w); |
| 34 | DECLARE_WRITE8_MEMBER(dled0_w); |
| 35 | DECLARE_WRITE8_MEMBER(dled1_w); |
| 30 | 36 | DECLARE_WRITE8_MEMBER(zcres_w); |
| 31 | 37 | DECLARE_WRITE8_MEMBER(wdogcl_w); |
| 32 | 38 | DECLARE_READ8_MEMBER(gentmrcl_r); |
| r18231 | r18232 | |
| 45 | 51 | private: |
| 46 | 52 | bool m_zcen; |
| 47 | 53 | bool m_gten; |
| 54 | bool m_disp_on; |
| 55 | bool m_diag_on; |
| 48 | 56 | UINT8 m_firqtimer; |
| 57 | UINT8 m_digit; |
| 49 | 58 | public: |
| 50 | 59 | DECLARE_DRIVER_INIT(wico); |
| 51 | 60 | }; |
| r18231 | r18232 | |
| 53 | 62 | // housekeeping cpu |
| 54 | 63 | static ADDRESS_MAP_START( hcpu_map, AS_PROGRAM, 8, wico_state ) |
| 55 | 64 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("sharedram") |
| 56 | | //AM_RANGE(0x1fe0, 0x1fe0) AM_NOP //AM_WRITE(muxld_w) |
| 65 | AM_RANGE(0x1fe0, 0x1fe0) AM_WRITE(muxld_w) |
| 57 | 66 | //AM_RANGE(0x1fe1, 0x1fe1) AM_WRITE(store_w) |
| 58 | | //AM_RANGE(0x1fe2, 0x1fe2) AM_WRITE(muxen_w) |
| 67 | AM_RANGE(0x1fe2, 0x1fe2) AM_WRITE(muxen_w) |
| 59 | 68 | //AM_RANGE(0x1fe3, 0x1fe3) AM_WRITE(csols_w) |
| 60 | | //AM_RANGE(0x1fe4, 0x1fe4) AM_READWRITE(msols_r,msols_w) |
| 69 | AM_RANGE(0x1fe4, 0x1fe4) AM_READNOP //AM_WRITE(msols_w) |
| 61 | 70 | AM_RANGE(0x1fe5, 0x1fe5) AM_DEVWRITE("sn76494", sn76494_new_device, write) |
| 62 | 71 | AM_RANGE(0x1fe6, 0x1fe6) AM_WRITE(wdogcl_w) |
| 63 | 72 | AM_RANGE(0x1fe7, 0x1fe7) AM_WRITE(zcres_w) |
| 64 | | //AM_RANGE(0x1fe8, 0x1fe8) AM_WRITE(dled0_w) |
| 65 | | //AM_RANGE(0x1fe9, 0x1fe9) AM_WRITE(dled1_w) |
| 73 | AM_RANGE(0x1fe8, 0x1fe8) AM_WRITE(dled0_w) |
| 74 | AM_RANGE(0x1fe9, 0x1fe9) AM_WRITE(dled1_w) |
| 66 | 75 | AM_RANGE(0x1fea, 0x1fea) AM_READ(gentmrcl_r) |
| 67 | | //AM_RANGE(0x1feb, 0x1feb) AM_READ(lampst_r) |
| 76 | AM_RANGE(0x1feb, 0x1feb) AM_READ(lampst_r) |
| 68 | 77 | //AM_RANGE(0x1fec, 0x1fec) AM_READ(sast_r) |
| 69 | 78 | //AM_RANGE(0x1fed, 0x1fed) AM_READ(solst1_r) |
| 70 | 79 | //AM_RANGE(0x1fee, 0x1fee) AM_READ(solst0_r) |
| 71 | | //AM_RANGE(0x1fef, 0x1fef) AM_READ(switch_r) |
| 80 | AM_RANGE(0x1fef, 0x1fef) AM_READ(switch_r) |
| 72 | 81 | AM_RANGE(0xf000, 0xffff) AM_ROM |
| 73 | 82 | ADDRESS_MAP_END |
| 74 | 83 | |
| 75 | 84 | // command cpu |
| 76 | 85 | static ADDRESS_MAP_START( ccpu_map, AS_PROGRAM, 8, wico_state ) |
| 77 | 86 | AM_RANGE(0x0000, 0x07ff) AM_RAM AM_SHARE("sharedram") // 2128 2k RAM |
| 78 | | //AM_RANGE(0x1fe0, 0x1fe0) AM_WRITE(muxld_w) // to display module |
| 87 | AM_RANGE(0x1fe0, 0x1fe0) AM_WRITE(muxld_w) // to display module |
| 79 | 88 | //AM_RANGE(0x1fe1, 0x1fe1) AM_WRITE(store_w) // enable save to nvram |
| 80 | | //AM_RANGE(0x1fe2, 0x1fe2) AM_WRITE(muxen_w) // digit to display on diagnostic LED; d0=L will disable main displays |
| 89 | AM_RANGE(0x1fe2, 0x1fe2) AM_WRITE(muxen_w) // digit to display on diagnostic LED; d0=L will disable main displays |
| 81 | 90 | //AM_RANGE(0x1fe3, 0x1fe3) AM_WRITE(csols_w) // solenoid column |
| 82 | | //AM_RANGE(0x1fe4, 0x1fe4) AM_WRITE(msols_w) // solenoid row |
| 91 | //AM_RANGE(0x1fe4, 0x1fe4) AM_READNOP AM_WRITE(msols_w) // solenoid row |
| 83 | 92 | AM_RANGE(0x1fe5, 0x1fe5) AM_DEVWRITE("sn76494", sn76494_new_device, write) |
| 84 | 93 | AM_RANGE(0x1fe6, 0x1fe6) AM_WRITE(wdogcl_w) // watchdog clear |
| 85 | 94 | AM_RANGE(0x1fe7, 0x1fe7) AM_WRITE(zcres_w) // enable IRQ on hcpu |
| 86 | | //AM_RANGE(0x1fe8, 0x1fe8) AM_WRITE(dled0_w) // turn off diagnostic LED |
| 87 | | //AM_RANGE(0x1fe9, 0x1fe9) AM_WRITE(dled1_w) // turn on diagnostic LED |
| 95 | AM_RANGE(0x1fe8, 0x1fe8) AM_WRITE(dled0_w) // turn off diagnostic LED |
| 96 | AM_RANGE(0x1fe9, 0x1fe9) AM_WRITE(dled1_w) // turn on diagnostic LED |
| 88 | 97 | AM_RANGE(0x1fea, 0x1fea) AM_READ(gentmrcl_r) // enable IRQ on ccpu |
| 89 | | //AM_RANGE(0x1feb, 0x1feb) AM_READ(lampst_r) // lamps? |
| 98 | AM_RANGE(0x1feb, 0x1feb) AM_READ(lampst_r) // lamps? |
| 90 | 99 | //AM_RANGE(0x1fec, 0x1fec) AM_READ(sast_r) // a pwron pulse to d0 L->H |
| 91 | 100 | //AM_RANGE(0x1fed, 0x1fed) AM_READ(solst1_r) // switches |
| 92 | 101 | //AM_RANGE(0x1fee, 0x1fee) AM_READ(solst0_r) // switches |
| 93 | | //AM_RANGE(0x1fef, 0x1fef) AM_READ(switch_r) // switches |
| 102 | AM_RANGE(0x1fef, 0x1fef) AM_READ(switch_r) // switches |
| 94 | 103 | AM_RANGE(0x4000, 0x40ff) AM_RAM AM_SHARE("nvram") // X2212 4bit x 256 NVRAM, stores only when store_w is active |
| 95 | 104 | AM_RANGE(0x8000, 0x9fff) AM_ROM |
| 96 | 105 | AM_RANGE(0xe000, 0xffff) AM_ROM |
| r18231 | r18232 | |
| 120 | 129 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Oil Pit Release") PORT_CODE(KEYCODE_Z) |
| 121 | 130 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Oil Pit Target") PORT_CODE(KEYCODE_C) |
| 122 | 131 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Waterhole Release") PORT_CODE(KEYCODE_V) |
| 123 | | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Outhole") PORT_CODE(KEYCODE_X) |
| 132 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Outhole") PORT_CODE(KEYCODE_X) // not working |
| 124 | 133 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Spinner") PORT_CODE(KEYCODE_B) |
| 125 | 134 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Rollunder") PORT_CODE(KEYCODE_N) |
| 126 | 135 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Spinner") PORT_CODE(KEYCODE_M) |
| r18231 | r18232 | |
| 128 | 137 | PORT_START("X6") |
| 129 | 138 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L SLingshot") PORT_CODE(KEYCODE_COMMA) |
| 130 | 139 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Slingshot") PORT_CODE(KEYCODE_STOP) |
| 131 | | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Drop Bank E") |
| 132 | | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Drop Bank P") |
| 133 | | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Drop Bank A") |
| 134 | | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Drop Bank C") |
| 135 | | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Drop Bank S") |
| 136 | | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Drop Bank E") |
| 140 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Drop Bank E") PORT_CODE(KEYCODE_A) |
| 141 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Drop Bank P") PORT_CODE(KEYCODE_S) |
| 142 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Drop Bank A") PORT_CODE(KEYCODE_D) |
| 143 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Drop Bank C") PORT_CODE(KEYCODE_F) |
| 144 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Drop Bank S") PORT_CODE(KEYCODE_G) |
| 145 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Drop Bank E") PORT_CODE(KEYCODE_H) |
| 137 | 146 | PORT_START("X7") |
| 138 | 147 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Target Zone E") |
| 139 | 148 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Target Zone D") |
| r18231 | r18232 | |
| 144 | 153 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Target Zone A") |
| 145 | 154 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Target Zone F") |
| 146 | 155 | PORT_START("X8") |
| 147 | | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Outlane Target") |
| 148 | | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Outlane Target") |
| 149 | | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Rollover R Outlane") |
| 150 | | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Rollover M Outlane") |
| 151 | | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Rollover L Outlane") |
| 152 | | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Rollover R Outlane") |
| 153 | | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Rollover M Outlane") |
| 154 | | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Rollover L Outlane") |
| 156 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Outlane Target") PORT_CODE(KEYCODE_MINUS) |
| 157 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Outlane Target") PORT_CODE(KEYCODE_EQUALS) |
| 158 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Rollover R Outlane") PORT_CODE(KEYCODE_J) |
| 159 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Rollover M Outlane") PORT_CODE(KEYCODE_K) |
| 160 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Rollover L Outlane") PORT_CODE(KEYCODE_L) |
| 161 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Rollover R Outlane") PORT_CODE(KEYCODE_QUOTE) |
| 162 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Rollover M Outlane") PORT_CODE(KEYCODE_ENTER) |
| 163 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L Rollover L Outlane") PORT_CODE(KEYCODE_SLASH) |
| 155 | 164 | PORT_START("X9") |
| 156 | 165 | PORT_START("XA") |
| 157 | | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Door Slam") PORT_CODE(KEYCODE_B) |
| 166 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Door Slam") |
| 158 | 167 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_TILT) PORT_NAME("Playfield Tilt") |
| 159 | 168 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Pendulum Tilt") |
| 160 | 169 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R Flipper Lane Change") |
| r18231 | r18232 | |
| 276 | 285 | m_zcen = 0; |
| 277 | 286 | m_gten = 0; |
| 278 | 287 | m_firqtimer = 0; |
| 288 | m_digit = 0; |
| 289 | m_disp_on = 0; |
| 290 | m_diag_on = 0; |
| 279 | 291 | } |
| 280 | 292 | |
| 281 | 293 | DRIVER_INIT_MEMBER(wico_state,wico) |
| 282 | 294 | { |
| 283 | 295 | } |
| 284 | 296 | |
| 297 | // diagnostic display off |
| 298 | WRITE8_MEMBER( wico_state::dled0_w ) |
| 299 | { |
| 300 | m_diag_on = 0; |
| 301 | } |
| 302 | |
| 303 | // diagnostic display on |
| 304 | WRITE8_MEMBER( wico_state::dled1_w ) |
| 305 | { |
| 306 | m_diag_on = 1; |
| 307 | } |
| 308 | |
| 309 | // write to diagnostic display |
| 310 | WRITE8_MEMBER( wico_state::muxen_w ) |
| 311 | { |
| 312 | static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71 }; // MC14495 |
| 313 | UINT8 segments = 0; |
| 314 | if (m_diag_on) |
| 315 | segments = patterns[data>>4]; |
| 316 | output_set_digit_value(41, segments); |
| 317 | } |
| 318 | |
| 319 | // reset digit/scan counter |
| 320 | WRITE8_MEMBER( wico_state::muxld_w ) |
| 321 | { |
| 322 | m_digit = 0; |
| 323 | } |
| 324 | |
| 325 | // enable zero-crossing interrupt |
| 285 | 326 | WRITE8_MEMBER( wico_state::zcres_w ) |
| 286 | 327 | { |
| 287 | 328 | m_zcen = 1; |
| 288 | 329 | } |
| 289 | 330 | |
| 331 | // enable firq |
| 290 | 332 | READ8_MEMBER( wico_state::gentmrcl_r ) |
| 291 | 333 | { |
| 292 | 334 | m_gten = 1; |
| 293 | 335 | return 0xff; |
| 294 | 336 | } |
| 295 | 337 | |
| 338 | // read a switch row |
| 339 | READ8_MEMBER( wico_state::switch_r ) |
| 340 | { |
| 341 | char kbdrow[8]; |
| 342 | sprintf(kbdrow,"X%X",m_shared_ram[0x95]); |
| 343 | return ioport(kbdrow)->read(); |
| 344 | } |
| 345 | |
| 346 | // write digits in main display |
| 347 | READ8_MEMBER( wico_state::lampst_r ) |
| 348 | { |
| 349 | UINT8 i; |
| 350 | for (i = 0; i < 5; i++) |
| 351 | output_set_digit_value(i * 10 + (m_shared_ram[0x96] & 7), m_shared_ram[0x7f9 + i]); |
| 352 | return 0xff; |
| 353 | } |
| 354 | |
| 355 | // reset watchdog and enable housekeeping cpu |
| 296 | 356 | WRITE8_MEMBER( wico_state::wdogcl_w ) |
| 297 | 357 | { |
| 298 | 358 | m_hcpu->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); |
| r18231 | r18232 | |
| 341 | 401 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 342 | 402 | |
| 343 | 403 | /* Video */ |
| 344 | | //MCFG_DEFAULT_LAYOUT(layout_wico) |
| 404 | MCFG_DEFAULT_LAYOUT(layout_wico) |
| 345 | 405 | |
| 346 | 406 | /* Sound */ |
| 347 | 407 | MCFG_FRAGMENT_ADD( genpin_audio ) |
| 348 | 408 | MCFG_SOUND_ADD("sn76494", SN76494_NEW, 10000000 / 64) |
| 349 | | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 409 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 350 | 410 | MCFG_SOUND_CONFIG(psg_intf) |
| 351 | 411 | MACHINE_CONFIG_END |
| 352 | 412 | |