trunk/src/mame/drivers/homerun.c
r17767 | r17768 | |
9 | 9 | sprites in NES format etc) |
10 | 10 | |
11 | 11 | Todo : |
12 | | - dump remaining sample roms |
| 12 | - dump homerun sample rom |
13 | 13 | - improve controls/dips |
14 | 14 | - better emulation of gfx bank switching (problematic in ganjaja) |
15 | 15 | - is there 2 player mode ? |
r17767 | r17768 | |
58 | 58 | |
59 | 59 | ***************************************************************************/ |
60 | 60 | |
61 | | WRITE8_MEMBER(homerun_state::homerun_d7756c_control_w) |
| 61 | WRITE8_MEMBER(homerun_state::homerun_control_w) |
62 | 62 | { |
63 | | // d4: start pin |
64 | | // d5: reset pin(?) |
65 | | // other bits: unused? |
66 | | device_t *device = machine().device("d7756c"); |
67 | | upd7759_reset_w(device, ~data & 0x20); |
68 | | upd7759_start_w(device, ~data & 0x10); |
| 63 | // d0, d1: somehow related to port $40? |
| 64 | |
| 65 | // d4: d7756 start pin |
| 66 | // d5: d7756 reset pin(?) |
| 67 | if (m_d7756 != NULL) |
| 68 | { |
| 69 | upd7759_reset_w(m_d7756, ~data & 0x20); |
| 70 | upd7759_start_w(m_d7756, ~data & 0x10); |
| 71 | } |
| 72 | |
| 73 | // other bits: ? |
| 74 | m_control = data; |
69 | 75 | } |
70 | 76 | |
| 77 | WRITE8_MEMBER(homerun_state::homerun_d7756_sample_w) |
| 78 | { |
| 79 | if (m_d7756 != NULL) |
| 80 | upd7759_port_w(m_d7756, 0, data); |
| 81 | } |
| 82 | |
71 | 83 | static ADDRESS_MAP_START( homerun_memmap, AS_PROGRAM, 8, homerun_state ) |
72 | 84 | AM_RANGE(0x0000, 0x3fff) AM_ROM |
73 | 85 | AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank1") |
r17767 | r17768 | |
79 | 91 | |
80 | 92 | static ADDRESS_MAP_START( homerun_iomap, AS_IO, 8, homerun_state ) |
81 | 93 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
82 | | AM_RANGE(0x10, 0x10) AM_DEVWRITE_LEGACY("d7756c", upd7759_port_w) |
83 | | AM_RANGE(0x20, 0x20) AM_WRITE(homerun_d7756c_control_w) |
| 94 | AM_RANGE(0x10, 0x10) AM_WRITE(homerun_d7756_sample_w) |
| 95 | AM_RANGE(0x20, 0x20) AM_WRITE(homerun_control_w) |
84 | 96 | AM_RANGE(0x30, 0x33) AM_DEVREADWRITE("ppi8255", i8255_device, read, write) |
85 | 97 | AM_RANGE(0x40, 0x40) AM_READ_PORT("IN0") |
86 | 98 | AM_RANGE(0x50, 0x50) AM_READ_PORT("IN2") |
r17767 | r17768 | |
96 | 108 | return ret; |
97 | 109 | } |
98 | 110 | |
| 111 | CUSTOM_INPUT_MEMBER(homerun_state::homerun_d7756_busy_r) |
| 112 | { |
| 113 | return upd7759_busy_r(m_d7756); |
| 114 | } |
| 115 | |
99 | 116 | CUSTOM_INPUT_MEMBER(homerun_state::ganjaja_hopper_status_r) |
100 | 117 | { |
101 | 118 | // gives hopper error if not 0 |
r17767 | r17768 | |
113 | 130 | PORT_START("IN0") |
114 | 131 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) |
115 | 132 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, homerun_40_r, NULL) |
116 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // ? |
| 133 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, homerun_d7756_busy_r, NULL) |
117 | 134 | PORT_BIT( 0x37, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
118 | 135 | |
119 | 136 | PORT_START("IN1") |
r17767 | r17768 | |
186 | 203 | PORT_START("IN0") |
187 | 204 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // ? |
188 | 205 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN1 ) |
189 | | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) // ? |
| 206 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, homerun_state, homerun_d7756_busy_r, NULL) |
190 | 207 | PORT_BIT( 0x76, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
191 | 208 | |
192 | 209 | PORT_START("IN1") |
r17767 | r17768 | |
290 | 307 | state->membank("bank1")->configure_entry(0, &ROM[0x00000]); |
291 | 308 | state->membank("bank1")->configure_entries(1, 7, &ROM[0x10000], 0x4000); |
292 | 309 | |
| 310 | state->save_item(NAME(state->m_control)); |
293 | 311 | state->save_item(NAME(state->m_gfx_ctrl)); |
294 | 312 | state->save_item(NAME(state->m_gc_up)); |
295 | 313 | state->save_item(NAME(state->m_gc_down)); |
r17767 | r17768 | |
301 | 319 | { |
302 | 320 | homerun_state *state = machine.driver_data<homerun_state>(); |
303 | 321 | |
| 322 | state->m_control = 0; |
304 | 323 | state->m_gfx_ctrl = 0; |
305 | 324 | state->m_gc_up = 0; |
306 | 325 | state->m_gc_down = 0; |
r17767 | r17768 | |
310 | 329 | |
311 | 330 | /**************************************************************************/ |
312 | 331 | |
313 | | static MACHINE_CONFIG_START( homerun, homerun_state ) |
| 332 | static MACHINE_CONFIG_START( dynashot, homerun_state ) |
314 | 333 | |
315 | 334 | /* basic machine hardware */ |
316 | 335 | MCFG_CPU_ADD("maincpu", Z80, XTAL_20MHz/4) |
r17767 | r17768 | |
342 | 361 | MCFG_SOUND_ADD("ymsnd", YM2203, XTAL_20MHz/8) |
343 | 362 | MCFG_SOUND_CONFIG(ym2203_config) |
344 | 363 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 364 | MACHINE_CONFIG_END |
345 | 365 | |
346 | | MCFG_SOUND_ADD("d7756c", UPD7756, UPD7759_STANDARD_CLOCK) |
| 366 | static MACHINE_CONFIG_DERIVED( homerun, dynashot ) |
| 367 | |
| 368 | /* sound hardware */ |
| 369 | MCFG_SOUND_ADD("d7756", UPD7756, UPD7759_STANDARD_CLOCK) |
347 | 370 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
348 | 371 | MACHINE_CONFIG_END |
349 | 372 | |
r17767 | r17768 | |
369 | 392 | ROM_REGION( 0x20000, "gfx2", 0 ) |
370 | 393 | ROM_LOAD( "homerun.ic120", 0x00000, 0x20000, CRC(52f0709b) SHA1(19e675bcccadb774f60ec5929fc1fb5cf0d3f617) ) |
371 | 394 | |
372 | | ROM_REGION( 0x08000, "d7756c", ROMREGION_ERASE00 ) |
373 | | ROM_LOAD( "d7756c.ic98", 0x00000, 0x08000, NO_DUMP ) /* D7756C built-in rom */ |
| 395 | ROM_REGION( 0x08000, "d7756", ROMREGION_ERASE00 ) |
| 396 | ROM_LOAD( "d7756c.ic98", 0x00000, 0x08000, NO_DUMP ) /* D7756C built-in rom - very likely the same rom as [Moero!! Pro Yakyuu (Black/Red)] on Famicom, and [Moero!! Nettou Yakyuu '88] on MSX2 */ |
374 | 397 | ROM_END |
375 | 398 | |
376 | 399 | |
r17767 | r17768 | |
384 | 407 | |
385 | 408 | ROM_REGION( 0x20000, "gfx2", 0 ) |
386 | 409 | ROM_LOAD( "2.ic120", 0x00000, 0x20000, CRC(bedf7b98) SHA1(cb6c5fcaf8df5f5c7636c3c8f79b9dda78e30c2e) ) |
387 | | |
388 | | ROM_REGION( 0x08000, "d7756c", ROMREGION_ERASE00 ) |
389 | | ROM_LOAD( "d7756c.ic98", 0x00000, 0x08000, NO_DUMP ) /* D7756C built-in rom */ |
390 | 410 | ROM_END |
391 | 411 | |
392 | 412 | |
r17767 | r17768 | |
401 | 421 | ROM_REGION( 0x20000, "gfx2", 0 ) |
402 | 422 | ROM_LOAD( "2.ic120", 0x00000, 0x20000, CRC(e65d4d57) SHA1(2ec9e5bdaa94b808573313b6eca657d798004b53) ) |
403 | 423 | |
404 | | ROM_REGION( 0x08000, "d7756c", 0 ) |
| 424 | ROM_REGION( 0x08000, "d7756", 0 ) |
405 | 425 | ROM_LOAD( "d77p56cr.ic98", 0x00000, 0x08000, CRC(06a234ac) SHA1(b4ceff3f9f78551cf4a085642e162e33b266f067) ) /* D77P56CR OTP rom (One-Time Programmable, note the extra P) */ |
406 | 426 | ROM_END |
407 | 427 | |
408 | 428 | |
409 | | GAME( 1988, homerun, 0, homerun, homerun, driver_device, 0, ROT0, "Jaleco", "Moero!! Pro Yakyuu Homerun Kyousou", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
410 | | GAME( 1988, dynashot, 0, homerun, dynashot, driver_device, 0, ROT0, "Jaleco", "Dynamic Shoot Kyousou", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
411 | | GAME( 1990, ganjaja, 0, ganjaja, ganjaja, driver_device, 0, ROT0, "Jaleco", "Ganbare Jajamaru Saisho wa Goo / Ganbare Jajamaru Hop Step & Jump", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 429 | GAME( 1988, homerun, 0, homerun, homerun, driver_device, 0, ROT0, "Jaleco", "Moero!! Pro Yakyuu Homerun Kyousou", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) |
| 430 | GAME( 1988, dynashot, 0, dynashot, dynashot, driver_device, 0, ROT0, "Jaleco", "Dynamic Shoot Kyousou", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 431 | GAME( 1990, ganjaja, 0, ganjaja, ganjaja, driver_device, 0, ROT0, "Jaleco", "Ganbare Jajamaru Saisho wa Goo / Ganbare Jajamaru Hop Step & Jump", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |