trunk/src/mess/drivers/hh_pic16.c
| r244706 | r244707 | |
| 5 | 5 | Collection of PIC16xx/16Cxx-driven dedicated handhelds or other simple devices |
| 6 | 6 | |
| 7 | 7 | |
| 8 | TODO: |
| 9 | - it doesn't work, emu/cpu/pic16c5x needs some love (dev note: hack to make it |
| 10 | playable: remove the TRIS masks) |
| 11 | |
| 8 | 12 | ***************************************************************************/ |
| 9 | 13 | |
| 10 | 14 | #include "emu.h" |
| r244706 | r244707 | |
| 20 | 24 | hh_pic16_state(const machine_config &mconfig, device_type type, const char *tag) |
| 21 | 25 | : driver_device(mconfig, type, tag), |
| 22 | 26 | m_maincpu(*this, "maincpu"), |
| 23 | | // m_inp_matrix(*this, "IN"), |
| 24 | | m_speaker(*this, "speaker") |
| 27 | m_inp_matrix(*this, "IN"), |
| 28 | m_speaker(*this, "speaker"), |
| 29 | m_display_wait(33), |
| 30 | m_display_maxy(1), |
| 31 | m_display_maxx(0) |
| 25 | 32 | { } |
| 26 | 33 | |
| 27 | 34 | // devices |
| 28 | 35 | required_device<cpu_device> m_maincpu; |
| 29 | | // optional_ioport_array<3> m_inp_matrix; // max 3 |
| 36 | optional_ioport_array<2> m_inp_matrix; // max 2 |
| 30 | 37 | optional_device<speaker_sound_device> m_speaker; |
| 31 | 38 | |
| 39 | // misc common |
| 40 | UINT8 m_b; |
| 41 | UINT8 m_c; |
| 42 | |
| 32 | 43 | virtual void machine_start(); |
| 44 | |
| 45 | // display common |
| 46 | int m_display_wait; |
| 47 | int m_display_maxy; |
| 48 | int m_display_maxx; |
| 49 | |
| 50 | UINT32 m_display_state[0x20]; |
| 51 | UINT32 m_display_cache[0x20]; |
| 52 | UINT8 m_display_decay[0x20][0x20]; |
| 53 | UINT16 m_7seg_mask[0x20]; |
| 54 | |
| 55 | TIMER_DEVICE_CALLBACK_MEMBER(display_decay_tick); |
| 56 | void display_update(); |
| 57 | void display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety); |
| 58 | |
| 59 | // game-specific handlers |
| 60 | DECLARE_WRITE8_MEMBER(maniac_output_w); |
| 33 | 61 | }; |
| 34 | 62 | |
| 35 | 63 | |
| 36 | 64 | void hh_pic16_state::machine_start() |
| 37 | 65 | { |
| 66 | // zerofill |
| 67 | memset(m_display_state, 0, sizeof(m_display_state)); |
| 68 | memset(m_display_cache, 0, sizeof(m_display_cache)); |
| 69 | memset(m_display_decay, 0, sizeof(m_display_decay)); |
| 70 | memset(m_7seg_mask, 0, sizeof(m_7seg_mask)); |
| 71 | |
| 72 | m_b = 0; |
| 73 | m_c = 0; |
| 74 | |
| 75 | // register for savestates |
| 76 | save_item(NAME(m_display_maxy)); |
| 77 | save_item(NAME(m_display_maxx)); |
| 78 | save_item(NAME(m_display_wait)); |
| 79 | |
| 80 | save_item(NAME(m_display_state)); |
| 81 | save_item(NAME(m_display_cache)); |
| 82 | save_item(NAME(m_display_decay)); |
| 83 | save_item(NAME(m_7seg_mask)); |
| 84 | |
| 85 | save_item(NAME(m_b)); |
| 86 | save_item(NAME(m_c)); |
| 38 | 87 | } |
| 39 | 88 | |
| 40 | 89 | |
| 41 | 90 | |
| 91 | /*************************************************************************** |
| 42 | 92 | |
| 93 | Helper Functions |
| 43 | 94 | |
| 95 | ***************************************************************************/ |
| 44 | 96 | |
| 97 | // The device may strobe the outputs very fast, it is unnoticeable to the user. |
| 98 | // To prevent flickering here, we need to simulate a decay. |
| 99 | |
| 100 | void hh_pic16_state::display_update() |
| 101 | { |
| 102 | UINT32 active_state[0x20]; |
| 103 | |
| 104 | for (int y = 0; y < m_display_maxy; y++) |
| 105 | { |
| 106 | active_state[y] = 0; |
| 107 | |
| 108 | for (int x = 0; x < m_display_maxx; x++) |
| 109 | { |
| 110 | // turn on powered segments |
| 111 | if (m_display_state[y] >> x & 1) |
| 112 | m_display_decay[y][x] = m_display_wait; |
| 113 | |
| 114 | // determine active state |
| 115 | int ds = (m_display_decay[y][x] != 0) ? 1 : 0; |
| 116 | active_state[y] |= (ds << x); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | // on difference, send to output |
| 121 | for (int y = 0; y < m_display_maxy; y++) |
| 122 | if (m_display_cache[y] != active_state[y]) |
| 123 | { |
| 124 | if (m_7seg_mask[y] != 0) |
| 125 | output_set_digit_value(y, active_state[y] & m_7seg_mask[y]); |
| 126 | |
| 127 | const int mul = (m_display_maxx <= 10) ? 10 : 100; |
| 128 | for (int x = 0; x < m_display_maxx; x++) |
| 129 | output_set_lamp_value(y * mul + x, active_state[y] >> x & 1); |
| 130 | } |
| 131 | |
| 132 | memcpy(m_display_cache, active_state, sizeof(m_display_cache)); |
| 133 | } |
| 134 | |
| 135 | TIMER_DEVICE_CALLBACK_MEMBER(hh_pic16_state::display_decay_tick) |
| 136 | { |
| 137 | // slowly turn off unpowered segments |
| 138 | for (int y = 0; y < m_display_maxy; y++) |
| 139 | for (int x = 0; x < m_display_maxx; x++) |
| 140 | if (!(m_display_state[y] >> x & 1) && m_display_decay[y][x] != 0) |
| 141 | m_display_decay[y][x]--; |
| 142 | |
| 143 | display_update(); |
| 144 | } |
| 145 | |
| 146 | void hh_pic16_state::display_matrix(int maxx, int maxy, UINT32 setx, UINT32 sety) |
| 147 | { |
| 148 | m_display_maxx = maxx; |
| 149 | m_display_maxy = maxy; |
| 150 | |
| 151 | // update current state |
| 152 | UINT32 mask = (1 << maxx) - 1; |
| 153 | for (int y = 0; y < maxy; y++) |
| 154 | m_display_state[y] = (sety >> y & 1) ? (setx & mask) : 0; |
| 155 | |
| 156 | display_update(); |
| 157 | } |
| 158 | |
| 159 | |
| 160 | |
| 45 | 161 | /*************************************************************************** |
| 46 | 162 | |
| 47 | 163 | Minidrivers (I/O, Inputs, Machine Config) |
| r244706 | r244707 | |
| 51 | 167 | /*************************************************************************** |
| 52 | 168 | |
| 53 | 169 | Ideal Maniac, by Ralph Baer |
| 54 | | * PIC1655-036 |
| 170 | * PIC1655A-036 |
| 55 | 171 | |
| 56 | 172 | |
| 57 | 173 | ***************************************************************************/ |
| 58 | 174 | |
| 175 | WRITE8_MEMBER(hh_pic16_state::maniac_output_w) |
| 176 | { |
| 177 | // B,C: outputs |
| 178 | offset -= PIC16C5x_PORTB; |
| 179 | if (offset) |
| 180 | m_c = data; |
| 181 | else |
| 182 | m_b = data; |
| 183 | |
| 184 | // d7: speaker out/enable |
| 185 | m_speaker->level_w((m_b & m_c) >> 7 & 1); |
| 59 | 186 | |
| 187 | // d0-d6: 7seg |
| 188 | m_display_maxx = 7; |
| 189 | m_display_maxy = 2; |
| 190 | |
| 191 | m_7seg_mask[offset] = 0x7f; |
| 192 | m_display_state[offset] = ~data & 0x7f; |
| 193 | display_update(); |
| 194 | } |
| 195 | |
| 196 | |
| 60 | 197 | static INPUT_PORTS_START( maniac ) |
| 198 | PORT_START("IN.0") // port A |
| 199 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // bottom-right |
| 200 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) // upper-right |
| 201 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) // bottom-left |
| 202 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON4 ) // upper-left |
| 61 | 203 | INPUT_PORTS_END |
| 62 | 204 | |
| 63 | 205 | |
| 64 | 206 | static MACHINE_CONFIG_START( maniac, hh_pic16_state ) |
| 65 | 207 | |
| 66 | 208 | /* basic machine hardware */ |
| 67 | | MCFG_CPU_ADD("maincpu", PIC16C55, 500000) |
| 209 | MCFG_CPU_ADD("maincpu", PIC16C55, 850000) // RC osc. R=13.4K, C=470pf, but unknown RC curve - measured 800-890kHz |
| 210 | MCFG_PIC16C5x_READ_A_CB(IOPORT("IN.0")) |
| 211 | MCFG_PIC16C5x_WRITE_B_CB(WRITE8(hh_pic16_state, maniac_output_w)) |
| 212 | MCFG_PIC16C5x_WRITE_C_CB(WRITE8(hh_pic16_state, maniac_output_w)) |
| 213 | MCFG_PIC16C5x_SET_CONFIG(0) // ? |
| 68 | 214 | |
| 215 | MCFG_TIMER_DRIVER_ADD_PERIODIC("display_decay", hh_pic16_state, display_decay_tick, attotime::from_msec(1)) |
| 69 | 216 | MCFG_DEFAULT_LAYOUT(layout_maniac) |
| 70 | 217 | |
| 71 | 218 | /* no video! */ |
| r244706 | r244707 | |
| 78 | 225 | |
| 79 | 226 | |
| 80 | 227 | |
| 228 | |
| 229 | |
| 230 | /*************************************************************************** |
| 231 | |
| 232 | Game driver(s) |
| 233 | |
| 234 | ***************************************************************************/ |
| 235 | |
| 81 | 236 | ROM_START( maniac ) |
| 82 | 237 | ROM_REGION( 0x0800, "maincpu", 0 ) |
| 83 | | ROM_LOAD( "1655-036", 0x0000, 0x0400, CRC(a96f7011) SHA1(e97ae44d3c1e74c7e1024bb0bdab03eecdc9f827) ) |
| 238 | ROM_LOAD( "pic1655a-036", 0x0000, 0x0400, CRC(a96f7011) SHA1(e97ae44d3c1e74c7e1024bb0bdab03eecdc9f827) ) |
| 84 | 239 | ROM_END |
| 85 | 240 | |
| 86 | 241 | |
| 87 | | CONS( 1979, maniac, 0, 0, maniac, maniac, driver_device, 0, "Ideal", "Maniac", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) |
| 242 | |
| 243 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */ |
| 244 | CONS( 1979, maniac, 0, 0, maniac, maniac, driver_device, 0, "Ideal", "Maniac", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) |
trunk/src/mess/drivers/hh_tms1k.c
| r244706 | r244707 | |
| 50 | 50 | TODO: |
| 51 | 51 | - verify output PLA and microinstructions PLA for MCUs that have been dumped |
| 52 | 52 | electronically (mpla is usually the default, opla is often custom) |
| 53 | | - unknown MCU clocks for some |
| 53 | - unknown MCU clocks for some: TMS1000 and TMS1100 RC curve is documented in |
| 54 | the data manual, but for TMS1400 it's unknown. TMS0970/0980 osc. is on-die. |
| 54 | 55 | - some of the games rely on the fact that faster(longer) strobed leds appear |
| 55 | 56 | brighter: tc4(offensive players), bankshot(cue ball) |
| 56 | 57 | - add softwarelist for tc4 cartridges? |
| r244706 | r244707 | |
| 250 | 251 | lDP = 0x80 |
| 251 | 252 | }; |
| 252 | 253 | |
| 253 | | // The device strobes the outputs very fast, it is unnoticeable to the user. |
| 254 | // The device may strobe the outputs very fast, it is unnoticeable to the user. |
| 254 | 255 | // To prevent flickering here, we need to simulate a decay. |
| 255 | 256 | |
| 256 | 257 | void hh_tms1k_state::display_update() |
| r244706 | r244707 | |
| 2261 | 2262 | |
| 2262 | 2263 | |
| 2263 | 2264 | |
| 2264 | | CONS( 1980, mathmagi, 0, 0, mathmagi, mathmagi, driver_device, 0, "APF Electronics Inc.", "Mathemagician", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) |
| 2265 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */ |
| 2266 | CONS( 1980, mathmagi, 0, 0, mathmagi, mathmagi, driver_device, 0, "APF Electronics Inc.", "Mathemagician", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) |
| 2265 | 2267 | |
| 2266 | | CONS( 1979, amaztron, 0, 0, amaztron, amaztron, driver_device, 0, "Coleco", "Amaze-A-Tron", GAME_SUPPORTS_SAVE ) |
| 2267 | | CONS( 1981, tc4, 0, 0, tc4, tc4, driver_device, 0, "Coleco", "Total Control 4", GAME_SUPPORTS_SAVE ) |
| 2268 | CONS( 1979, amaztron, 0, 0, amaztron, amaztron, driver_device, 0, "Coleco", "Amaze-A-Tron", GAME_SUPPORTS_SAVE ) |
| 2269 | CONS( 1981, tc4, 0, 0, tc4, tc4, driver_device, 0, "Coleco", "Total Control 4", GAME_SUPPORTS_SAVE ) |
| 2268 | 2270 | |
| 2269 | | CONS( 1978, ebball, 0, 0, ebball, ebball, driver_device, 0, "Entex", "Electronic Baseball (Entex)", GAME_SUPPORTS_SAVE ) |
| 2271 | CONS( 1978, ebball, 0, 0, ebball, ebball, driver_device, 0, "Entex", "Electronic Baseball (Entex)", GAME_SUPPORTS_SAVE ) // or 1979? |
| 2270 | 2272 | |
| 2271 | | CONS( 1979, elecdet, 0, 0, elecdet, elecdet, driver_device, 0, "Ideal", "Electronic Detective", GAME_SUPPORTS_SAVE ) |
| 2273 | CONS( 1979, elecdet, 0, 0, elecdet, elecdet, driver_device, 0, "Ideal", "Electronic Detective", GAME_SUPPORTS_SAVE ) // unplayable without game cards |
| 2272 | 2274 | |
| 2273 | | CONS( 1979, starwbc, 0, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command", GAME_SUPPORTS_SAVE ) |
| 2274 | | CONS( 1979, starwbcp, starwbc, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command (prototype)", GAME_SUPPORTS_SAVE ) |
| 2275 | CONS( 1979, starwbc, 0, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command", GAME_SUPPORTS_SAVE ) |
| 2276 | CONS( 1979, starwbcp, starwbc, 0, starwbc, starwbc, driver_device, 0, "Kenner", "Star Wars - Electronic Battle Command (prototype)", GAME_SUPPORTS_SAVE ) |
| 2275 | 2277 | |
| 2276 | | CONS( 1977, comp4, 0, 0, comp4, comp4, driver_device, 0, "Milton Bradley", "Comp IV", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) |
| 2277 | | CONS( 1978, simon, 0, 0, simon, simon, driver_device, 0, "Milton Bradley", "Simon (Rev. A)", GAME_SUPPORTS_SAVE ) |
| 2278 | CONS( 1977, comp4, 0, 0, comp4, comp4, driver_device, 0, "Milton Bradley", "Comp IV", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) |
| 2279 | CONS( 1978, simon, 0, 0, simon, simon, driver_device, 0, "Milton Bradley", "Simon (Rev. A)", GAME_SUPPORTS_SAVE ) |
| 2278 | 2280 | |
| 2279 | | CONS( 1977, cnsector, 0, 0, cnsector, cnsector, driver_device, 0, "Parker Brothers", "Code Name: Sector", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) |
| 2280 | | CONS( 1978, merlin, 0, 0, merlin, merlin, driver_device, 0, "Parker Brothers", "Merlin", GAME_SUPPORTS_SAVE ) |
| 2281 | | CONS( 1979, stopthie, 0, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner)", GAME_SUPPORTS_SAVE ) |
| 2281 | CONS( 1977, cnsector, 0, 0, cnsector, cnsector, driver_device, 0, "Parker Brothers", "Code Name: Sector", GAME_SUPPORTS_SAVE | GAME_NO_SOUND_HW ) // unplayable without writing board |
| 2282 | CONS( 1978, merlin, 0, 0, merlin, merlin, driver_device, 0, "Parker Brothers", "Merlin", GAME_SUPPORTS_SAVE ) |
| 2283 | CONS( 1979, stopthie, 0, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner)", GAME_SUPPORTS_SAVE ) // unplayable without game board |
| 2282 | 2284 | CONS( 1979, stopthiep, stopthie, 0, stopthief, stopthief, driver_device, 0, "Parker Brothers", "Stop Thief (Electronic Crime Scanner) (prototype)", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) |
| 2283 | | CONS( 1980, bankshot, 0, 0, bankshot, bankshot, driver_device, 0, "Parker Brothers", "Bank Shot - Electronic Pool", GAME_SUPPORTS_SAVE ) |
| 2284 | | CONS( 1980, splitsec, 0, 0, splitsec, splitsec, driver_device, 0, "Parker Brothers", "Split Second", GAME_SUPPORTS_SAVE ) |
| 2285 | CONS( 1980, bankshot, 0, 0, bankshot, bankshot, driver_device, 0, "Parker Brothers", "Bank Shot - Electronic Pool", GAME_SUPPORTS_SAVE ) |
| 2286 | CONS( 1980, splitsec, 0, 0, splitsec, splitsec, driver_device, 0, "Parker Brothers", "Split Second", GAME_SUPPORTS_SAVE ) |
| 2285 | 2287 | |
| 2286 | | CONS( 1981, tandy12, 0, 0, tandy12, tandy12, driver_device, 0, "Tandy Radio Shack", "Tandy-12: Computerized Arcade", GAME_SUPPORTS_SAVE ) |
| 2288 | CONS( 1981, tandy12, 0, 0, tandy12, tandy12, driver_device, 0, "Tandy Radio Shack", "Tandy-12: Computerized Arcade", GAME_SUPPORTS_SAVE ) // partially unplayable without cards/dice/.. |
| 2287 | 2289 | |
| 2288 | | CONS( 1978, unk3403, 0, 0, unk3403, unk3403, driver_device, 0, "<unknown>", "unknown TMS1100 electronic game", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) |
| 2290 | CONS( 1978, unk3403, 0, 0, unk3403, unk3403, driver_device, 0, "<unknown>", "unknown TMS1100 electronic game", GAME_SUPPORTS_SAVE | GAME_NOT_WORKING ) |
trunk/src/mess/drivers/hh_ucom4.c
| r244706 | r244707 | |
| 134 | 134 | |
| 135 | 135 | ***************************************************************************/ |
| 136 | 136 | |
| 137 | | // The device strobes the outputs very fast, it is unnoticeable to the user. |
| 137 | // The device may strobe the outputs very fast, it is unnoticeable to the user. |
| 138 | 138 | // To prevent flickering here, we need to simulate a decay. |
| 139 | 139 | |
| 140 | 140 | void hh_ucom4_state::display_update() |
| r244706 | r244707 | |
| 231 | 231 | |
| 232 | 232 | NOTE!: MESS external artwork is recommended |
| 233 | 233 | |
| 234 | | |
| 235 | 234 | ***************************************************************************/ |
| 236 | 235 | |
| 237 | 236 | WRITE8_MEMBER(hh_ucom4_state::edracula_grid_w) |
| r244706 | r244707 | |
| 456 | 455 | - USA: Pac Man |
| 457 | 456 | - UK: Puckman (Tomy), and also published by Grandstand as Munchman |
| 458 | 457 | - Australia: Pac Man-1, published by Futuretronics |
| 458 | |
| 459 | The game will start automatically after turning it on. This Pac Man refuses |
| 460 | to eat dots with his butt, you can only eat them going right-to-left. |
| 459 | 461 | |
| 460 | 462 | NOTE!: MESS external artwork is recommended |
| 461 | 463 | |
| r244706 | r244707 | |
| 694 | 696 | |
| 695 | 697 | |
| 696 | 698 | |
| 697 | | CONS( 1982, edracula, 0, 0, edracula, edracula, driver_device, 0, "Epoch", "Dracula (Epoch)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |
| 699 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY, FULLNAME, FLAGS */ |
| 700 | CONS( 1982, edracula, 0, 0, edracula, edracula, driver_device, 0, "Epoch", "Dracula (Epoch)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |
| 698 | 701 | |
| 699 | | CONS( 1980, tmtennis, 0, 0, tmtennis, tmtennis, driver_device, 0, "Tomy", "Tennis (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |
| 700 | | CONS( 1982, tmpacman, 0, 0, tmpacman, tmpacman, driver_device, 0, "Tomy", "Pac Man (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |
| 701 | | CONS( 1984, alnchase, 0, 0, alnchase, alnchase, driver_device, 0, "Tomy", "Alien Chase", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |
| 702 | CONS( 1980, tmtennis, 0, 0, tmtennis, tmtennis, driver_device, 0, "Tomy", "Tennis (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |
| 703 | CONS( 1982, tmpacman, 0, 0, tmpacman, tmpacman, driver_device, 0, "Tomy", "Pac Man (Tomy)", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |
| 704 | CONS( 1984, alnchase, 0, 0, alnchase, alnchase, driver_device, 0, "Tomy", "Alien Chase", GAME_SUPPORTS_SAVE | GAME_REQUIRES_ARTWORK ) |