trunk/src/mame/drivers/atetris.c
| r241864 | r241865 | |
| 8 | 8 | * Tetris |
| 9 | 9 | |
| 10 | 10 | Known bugs: |
| 11 | | * none at this time |
| 11 | * the bootlegs don't actually have the slapstic. The additional |
| 12 | hardware needs to be emulated. |
| 12 | 13 | |
| 13 | 14 | **************************************************************************** |
| 14 | 15 | |
| r241864 | r241865 | |
| 130 | 131 | * |
| 131 | 132 | *************************************/ |
| 132 | 133 | |
| 133 | | READ8_MEMBER(atetris_state::atetris_slapstic_r) |
| 134 | READ8_MEMBER(atetris_state::slapstic_r) |
| 134 | 135 | { |
| 135 | 136 | int result = m_slapstic_base[0x2000 + offset]; |
| 136 | 137 | int new_bank = m_slapstic_device->slapstic_tweak(space, offset) & 1; |
| r241864 | r241865 | |
| 190 | 191 | /* full address map derived from schematics */ |
| 191 | 192 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, atetris_state ) |
| 192 | 193 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 193 | | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(atetris_videoram_w) AM_SHARE("videoram") |
| 194 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") |
| 194 | 195 | AM_RANGE(0x2000, 0x20ff) AM_MIRROR(0x0300) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 195 | 196 | AM_RANGE(0x2400, 0x25ff) AM_MIRROR(0x0200) AM_RAM_WRITE(nvram_w) AM_SHARE("nvram") |
| 196 | 197 | AM_RANGE(0x2800, 0x280f) AM_MIRROR(0x03e0) AM_DEVREADWRITE("pokey1", pokey_device, read, write) |
| r241864 | r241865 | |
| 200 | 201 | AM_RANGE(0x3800, 0x3800) AM_MIRROR(0x03ff) AM_WRITE(irq_ack_w) |
| 201 | 202 | AM_RANGE(0x3c00, 0x3c00) AM_MIRROR(0x03ff) AM_WRITE(coincount_w) |
| 202 | 203 | AM_RANGE(0x4000, 0x5fff) AM_ROM |
| 203 | | AM_RANGE(0x6000, 0x7fff) AM_READ(atetris_slapstic_r) |
| 204 | AM_RANGE(0x6000, 0x7fff) AM_READ(slapstic_r) |
| 204 | 205 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 205 | 206 | ADDRESS_MAP_END |
| 206 | 207 | |
| 207 | 208 | |
| 208 | 209 | static ADDRESS_MAP_START( atetrisb2_map, AS_PROGRAM, 8, atetris_state ) |
| 209 | 210 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 210 | | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(atetris_videoram_w) AM_SHARE("videoram") |
| 211 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") |
| 211 | 212 | AM_RANGE(0x2000, 0x20ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 212 | 213 | AM_RANGE(0x2400, 0x25ff) AM_RAM_WRITE(nvram_w) AM_SHARE("nvram") |
| 213 | 214 | AM_RANGE(0x2802, 0x2802) AM_DEVWRITE("sn1", sn76496_device, write) |
| r241864 | r241865 | |
| 220 | 221 | AM_RANGE(0x3800, 0x3800) AM_WRITE(irq_ack_w) |
| 221 | 222 | AM_RANGE(0x3c00, 0x3c00) AM_WRITE(coincount_w) |
| 222 | 223 | AM_RANGE(0x4000, 0x5fff) AM_ROM |
| 223 | | AM_RANGE(0x6000, 0x7fff) AM_READ(atetris_slapstic_r) |
| 224 | AM_RANGE(0x6000, 0x7fff) AM_READ(slapstic_r) |
| 224 | 225 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 225 | 226 | ADDRESS_MAP_END |
| 226 | 227 | |
| 227 | 228 | |
| 229 | static ADDRESS_MAP_START( atetrisb3_map, AS_PROGRAM, 8, atetris_state ) |
| 230 | AM_RANGE(0x0000, 0x0fff) AM_RAM |
| 231 | AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(videoram_w) AM_SHARE("videoram") |
| 232 | AM_RANGE(0x2000, 0x20ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 233 | AM_RANGE(0x2400, 0x25ff) AM_RAM_WRITE(nvram_w) AM_SHARE("nvram") |
| 234 | //AM_RANGE(0x2802, 0x2802) AM_DEVWRITE("sn1", sn76489_device, write) |
| 235 | //AM_RANGE(0x2804, 0x2804) AM_DEVWRITE("sn2", sn76489_device, write) |
| 236 | //AM_RANGE(0x2806, 0x2806) AM_DEVWRITE("sn3", sn76489_device, write) |
| 237 | AM_RANGE(0x2808, 0x2808) AM_READ_PORT("IN0") |
| 238 | AM_RANGE(0x2818, 0x2818) AM_READ_PORT("IN1") |
| 239 | AM_RANGE(0x3000, 0x3000) AM_WRITE(watchdog_reset_w) |
| 240 | AM_RANGE(0x3400, 0x3400) AM_WRITE(nvram_enable_w) |
| 241 | AM_RANGE(0x3800, 0x3800) AM_WRITE(irq_ack_w) |
| 242 | AM_RANGE(0x3c00, 0x3c00) AM_WRITE(coincount_w) |
| 243 | AM_RANGE(0x4000, 0x5fff) AM_ROM |
| 244 | AM_RANGE(0x6000, 0x7fff) AM_READ(slapstic_r) |
| 245 | AM_RANGE(0x8000, 0xffff) AM_ROM |
| 246 | ADDRESS_MAP_END |
| 228 | 247 | |
| 248 | |
| 249 | |
| 229 | 250 | /************************************* |
| 230 | 251 | * |
| 231 | 252 | * Port definitions |
| r241864 | r241865 | |
| 321 | 342 | /* note: these parameters are from published specs, not derived */ |
| 322 | 343 | /* the board uses an SOS-2 chip to generate video signals */ |
| 323 | 344 | MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/2, 456, 0, 336, 262, 0, 240) |
| 324 | | MCFG_SCREEN_UPDATE_DRIVER(atetris_state, screen_update_atetris) |
| 345 | MCFG_SCREEN_UPDATE_DRIVER(atetris_state, screen_update) |
| 325 | 346 | MCFG_SCREEN_PALETTE("palette") |
| 326 | 347 | |
| 327 | 348 | |
| r241864 | r241865 | |
| 358 | 379 | /* note: these parameters are from published specs, not derived */ |
| 359 | 380 | /* the board uses an SOS-2 chip to generate video signals */ |
| 360 | 381 | MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK/2, 456, 0, 336, 262, 0, 240) |
| 361 | | MCFG_SCREEN_UPDATE_DRIVER(atetris_state, screen_update_atetris) |
| 382 | MCFG_SCREEN_UPDATE_DRIVER(atetris_state, screen_update) |
| 362 | 383 | MCFG_SCREEN_PALETTE("palette") |
| 363 | 384 | |
| 364 | 385 | |
| r241864 | r241865 | |
| 376 | 397 | MACHINE_CONFIG_END |
| 377 | 398 | |
| 378 | 399 | |
| 400 | static MACHINE_CONFIG_DERIVED( atetrisb3, atetrisb2 ) |
| 379 | 401 | |
| 402 | MCFG_CPU_REPLACE("maincpu", M6502, MASTER_CLOCK/8) |
| 403 | MCFG_CPU_PROGRAM_MAP(atetrisb3_map) |
| 404 | |
| 405 | //8749 at 10 MHz instead of slapstic |
| 406 | |
| 407 | MCFG_SOUND_REPLACE("sn1", SN76489, 4000000) |
| 408 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 409 | |
| 410 | MCFG_SOUND_REPLACE("sn2", SN76489, 4000000) |
| 411 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 412 | |
| 413 | MCFG_SOUND_REPLACE("sn3", SN76489, 4000000) |
| 414 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 415 | MACHINE_CONFIG_END |
| 416 | |
| 417 | |
| 418 | |
| 380 | 419 | /************************************* |
| 381 | 420 | * |
| 382 | 421 | * ROM definitions |
| r241864 | r241865 | |
| 428 | 467 | ROM_END |
| 429 | 468 | |
| 430 | 469 | |
| 470 | /* |
| 471 | Tetris (Korean bootleg of atetrisa set) |
| 472 | |
| 473 | PCB Layout |
| 474 | ---------- |
| 475 | |
| 476 | RC-1108 |
| 477 | |---------------------------------------------------| |
| 478 | | 14.31818MHz| |
| 479 | | PAL | |
| 480 | | | |
| 481 | | P8749H 6116 | |
| 482 | |J | |
| 483 | |A 10MHz 27512 | |
| 484 | |M PAL | |
| 485 | |M 62256 | |
| 486 | |A | |
| 487 | | 27512 | |
| 488 | | PAL | |
| 489 | | PAL PAL | |
| 490 | |76489 76489 4MHz 82S123 | |
| 491 | |76489 6502 | |
| 492 | |VOL MB3713 PAL | |
| 493 | |---------------------------------------------------| |
| 494 | */ |
| 495 | |
| 496 | ROM_START( atetrisb3 ) |
| 497 | ROM_REGION( 0x18000, "maincpu", 0 ) |
| 498 | ROM_LOAD( "prg.bin", 0x10000, 0x8000, CRC(2bcab107) SHA1(3cfb8df8cd3782f3ff7f6b32ff15c461352061ee) ) |
| 499 | ROM_CONTINUE( 0x08000, 0x8000 ) |
| 500 | |
| 501 | ROM_REGION( 0x10000, "gfx1", 0 ) |
| 502 | ROM_LOAD( "gfx.bin", 0x0000, 0x10000, CRC(84a1939f) SHA1(d8577985fc8ed4e74f74c68b7c00c4855b7c3270) ) |
| 503 | |
| 504 | // 8749 (10 MHz OSC) instead of the slapstic, needs to be hooked up. |
| 505 | ROM_REGION( 0x0800, "user1", 0 ) |
| 506 | ROM_LOAD( "8749h.bin", 0x0000, 0x0800, CRC(a66a9c47) SHA1(fbebd755a5e826c7d94ebcafdff2f9a01c9fd1a5) ) |
| 507 | |
| 508 | // currently unused |
| 509 | ROM_REGION( 0x0020, "proms", 0 ) |
| 510 | ROM_LOAD( "82s123.bin", 0x00000, 0x0020, CRC(79656af3) SHA1(bf55f100806520b291157c03999606367dd14ecc) ) |
| 511 | ROM_END |
| 512 | |
| 513 | |
| 431 | 514 | ROM_START( atetrisc ) |
| 432 | 515 | ROM_REGION( 0x18000, "maincpu", 0 ) |
| 433 | 516 | ROM_LOAD( "tetcktl1.rom", 0x10000, 0x8000, CRC(9afd1f4a) SHA1(323d1576d92c905e8e95108b39cabf6fa0c10db6) ) |
| r241864 | r241865 | |
| 472 | 555 | * |
| 473 | 556 | *************************************/ |
| 474 | 557 | |
| 475 | | GAME( 1988, atetris, 0, atetris, atetris, atetris_state, atetris, ROT0, "Atari Games", "Tetris (set 1)", GAME_SUPPORTS_SAVE ) |
| 476 | | GAME( 1988, atetrisa, atetris, atetris, atetris, atetris_state, atetris, ROT0, "Atari Games", "Tetris (set 2)", GAME_SUPPORTS_SAVE ) |
| 477 | | GAME( 1988, atetrisb, atetris, atetris, atetris, atetris_state, atetris, ROT0, "bootleg", "Tetris (bootleg set 1)", GAME_SUPPORTS_SAVE ) |
| 478 | | GAME( 1988, atetrisb2,atetris, atetrisb2,atetris, atetris_state, atetris, ROT0, "bootleg", "Tetris (bootleg set 2)", GAME_SUPPORTS_SAVE ) |
| 479 | | GAME( 1989, atetrisc, atetris, atetris, atetrisc, atetris_state, atetris, ROT270, "Atari Games", "Tetris (cocktail set 1)", GAME_SUPPORTS_SAVE ) |
| 480 | | GAME( 1989, atetrisc2,atetris, atetris, atetrisc, atetris_state, atetris, ROT270, "Atari Games", "Tetris (cocktail set 2)", GAME_SUPPORTS_SAVE ) |
| 558 | GAME( 1988, atetris, 0, atetris, atetris, atetris_state, atetris, ROT0, "Atari Games", "Tetris (set 1)", GAME_SUPPORTS_SAVE ) |
| 559 | GAME( 1988, atetrisa, atetris, atetris, atetris, atetris_state, atetris, ROT0, "Atari Games", "Tetris (set 2)", GAME_SUPPORTS_SAVE ) |
| 560 | GAME( 1988, atetrisb, atetris, atetris, atetris, atetris_state, atetris, ROT0, "bootleg", "Tetris (bootleg set 1)", GAME_SUPPORTS_SAVE ) |
| 561 | GAME( 1988, atetrisb2,atetris, atetrisb2, atetris, atetris_state, atetris, ROT0, "bootleg", "Tetris (bootleg set 2)", GAME_SUPPORTS_SAVE ) |
| 562 | GAME( 1988, atetrisb3,atetris, atetrisb3, atetris, atetris_state, atetris, ROT0, "bootleg", "Tetris (bootleg set 3)", GAME_NO_SOUND | GAME_SUPPORTS_SAVE ) |
| 563 | GAME( 1989, atetrisc, atetris, atetris, atetrisc, atetris_state, atetris, ROT270, "Atari Games", "Tetris (cocktail set 1)", GAME_SUPPORTS_SAVE ) |
| 564 | GAME( 1989, atetrisc2,atetris, atetris, atetrisc, atetris_state, atetris, ROT270, "Atari Games", "Tetris (cocktail set 2)", GAME_SUPPORTS_SAVE ) |
trunk/src/mame/includes/atetris.h
| r241864 | r241865 | |
| 11 | 11 | public: |
| 12 | 12 | atetris_state(const machine_config &mconfig, device_type type, const char *tag) |
| 13 | 13 | : driver_device(mconfig, type, tag), |
| 14 | | m_nvram(*this, "nvram") , |
| 15 | | m_videoram(*this, "videoram"), |
| 16 | 14 | m_maincpu(*this, "maincpu"), |
| 17 | 15 | m_gfxdecode(*this, "gfxdecode"), |
| 18 | 16 | m_screen(*this, "screen"), |
| 19 | | m_slapstic_device(*this, "slapstic") |
| 17 | m_slapstic_device(*this, "slapstic"), |
| 18 | m_nvram(*this, "nvram") , |
| 19 | m_videoram(*this, "videoram") |
| 20 | 20 | { } |
| 21 | 21 | |
| 22 | required_device<cpu_device> m_maincpu; |
| 23 | required_device<gfxdecode_device> m_gfxdecode; |
| 24 | required_device<screen_device> m_screen; |
| 25 | optional_device<atari_slapstic_device> m_slapstic_device; |
| 26 | |
| 22 | 27 | required_shared_ptr<UINT8> m_nvram; |
| 23 | 28 | required_shared_ptr<UINT8> m_videoram; |
| 29 | |
| 24 | 30 | UINT8 *m_slapstic_source; |
| 25 | 31 | UINT8 *m_slapstic_base; |
| 26 | 32 | UINT8 m_current_bank; |
| 27 | 33 | UINT8 m_nvram_write_enable; |
| 28 | 34 | emu_timer *m_interrupt_timer; |
| 29 | 35 | tilemap_t *m_bg_tilemap; |
| 36 | |
| 30 | 37 | DECLARE_WRITE8_MEMBER(irq_ack_w); |
| 31 | | DECLARE_READ8_MEMBER(atetris_slapstic_r); |
| 38 | DECLARE_READ8_MEMBER(slapstic_r); |
| 32 | 39 | DECLARE_WRITE8_MEMBER(coincount_w); |
| 33 | 40 | DECLARE_WRITE8_MEMBER(nvram_w); |
| 34 | 41 | DECLARE_WRITE8_MEMBER(nvram_enable_w); |
| 35 | | DECLARE_WRITE8_MEMBER(atetris_videoram_w); |
| 42 | DECLARE_WRITE8_MEMBER(videoram_w); |
| 36 | 43 | DECLARE_DRIVER_INIT(atetris); |
| 37 | 44 | TILE_GET_INFO_MEMBER(get_tile_info); |
| 38 | 45 | virtual void machine_start(); |
| 39 | 46 | virtual void machine_reset(); |
| 40 | 47 | virtual void video_start(); |
| 41 | | UINT32 screen_update_atetris(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 48 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 42 | 49 | TIMER_CALLBACK_MEMBER(interrupt_gen); |
| 43 | 50 | void reset_bank(); |
| 44 | | required_device<cpu_device> m_maincpu; |
| 45 | | required_device<gfxdecode_device> m_gfxdecode; |
| 46 | | required_device<screen_device> m_screen; |
| 47 | | optional_device<atari_slapstic_device> m_slapstic_device; |
| 48 | 51 | }; |