trunk/src/mame/drivers/goodejan.c
| r243349 | r243350 | |
| 78 | 78 | public: |
| 79 | 79 | goodejan_state(const machine_config &mconfig, device_type type, const char *tag) |
| 80 | 80 | : driver_device(mconfig, type, tag), |
| 81 | m_maincpu(*this, "maincpu"), |
| 82 | m_gfxdecode(*this, "gfxdecode"), |
| 83 | m_palette(*this, "palette"), |
| 81 | 84 | m_sc0_vram(*this, "sc0_vram"), |
| 82 | 85 | m_sc1_vram(*this, "sc1_vram"), |
| 83 | 86 | m_sc2_vram(*this, "sc2_vram"), |
| 84 | 87 | m_sc3_vram(*this, "sc3_vram"), |
| 85 | | m_spriteram16(*this, "sprite_ram"), |
| 86 | | m_maincpu(*this, "maincpu"), |
| 87 | | m_gfxdecode(*this, "gfxdecode"), |
| 88 | | m_palette(*this, "palette") { } |
| 88 | m_spriteram16(*this, "sprite_ram") { } |
| 89 | 89 | |
| 90 | required_device<cpu_device> m_maincpu; |
| 91 | required_device<gfxdecode_device> m_gfxdecode; |
| 92 | required_device<palette_device> m_palette; |
| 93 | |
| 90 | 94 | required_shared_ptr<UINT16> m_sc0_vram; |
| 91 | 95 | required_shared_ptr<UINT16> m_sc1_vram; |
| 92 | 96 | required_shared_ptr<UINT16> m_sc2_vram; |
| 93 | 97 | required_shared_ptr<UINT16> m_sc3_vram; |
| 94 | 98 | required_shared_ptr<UINT16> m_spriteram16; |
| 95 | | required_device<cpu_device> m_maincpu; |
| 96 | | required_device<gfxdecode_device> m_gfxdecode; |
| 97 | | required_device<palette_device> m_palette; |
| 99 | |
| 98 | 100 | tilemap_t *m_sc0_tilemap; |
| 99 | 101 | tilemap_t *m_sc1_tilemap; |
| 100 | 102 | tilemap_t *m_sc2_tilemap; |
| 101 | 103 | tilemap_t *m_sc3_tilemap; |
| 104 | |
| 102 | 105 | UINT16 m_mux_data; |
| 103 | 106 | UINT16 m_seibucrtc_sc0bank; |
| 104 | | DECLARE_WRITE16_MEMBER(goodejan_gfxbank_w); |
| 107 | UINT16 m_layer_en; |
| 108 | UINT16 m_scrollram[6]; |
| 109 | |
| 110 | DECLARE_WRITE16_MEMBER(gfxbank_w); |
| 105 | 111 | DECLARE_READ16_MEMBER(mahjong_panel_r); |
| 106 | 112 | DECLARE_WRITE16_MEMBER(mahjong_panel_w); |
| 107 | 113 | DECLARE_WRITE16_MEMBER(seibucrtc_sc0vram_w); |
| 108 | 114 | DECLARE_WRITE16_MEMBER(seibucrtc_sc1vram_w); |
| 109 | 115 | DECLARE_WRITE16_MEMBER(seibucrtc_sc2vram_w); |
| 110 | 116 | DECLARE_WRITE16_MEMBER(seibucrtc_sc3vram_w); |
| 117 | DECLARE_WRITE16_MEMBER(layer_en_w); |
| 118 | DECLARE_WRITE16_MEMBER(layer_scroll_w); |
| 119 | |
| 111 | 120 | TILE_GET_INFO_MEMBER(seibucrtc_sc0_tile_info); |
| 112 | 121 | TILE_GET_INFO_MEMBER(seibucrtc_sc1_tile_info); |
| 113 | 122 | TILE_GET_INFO_MEMBER(seibucrtc_sc2_tile_info); |
| 114 | 123 | TILE_GET_INFO_MEMBER(seibucrtc_sc3_tile_info); |
| 115 | | INTERRUPT_GEN_MEMBER(goodejan_irq); |
| 116 | | DECLARE_WRITE16_MEMBER(layer_en_w); |
| 117 | | DECLARE_WRITE16_MEMBER(layer_scroll_w); |
| 118 | | UINT16 m_layer_en; |
| 119 | | UINT16 m_scrollram[6]; |
| 124 | |
| 125 | INTERRUPT_GEN_MEMBER(irq); |
| 126 | |
| 120 | 127 | void seibucrtc_sc0bank_w(UINT16 data); |
| 121 | 128 | void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri); |
| 122 | 129 | virtual void video_start(); |
| 123 | | UINT32 screen_update_goodejan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 130 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 124 | 131 | }; |
| 125 | 132 | |
| 126 | 133 | /******************************* |
| r243349 | r243350 | |
| 348 | 355 | m_sc3_tilemap->set_transparent_pen(15); |
| 349 | 356 | |
| 350 | 357 | m_seibucrtc_sc0bank = 0; |
| 358 | |
| 359 | save_item(NAME(m_mux_data)); |
| 360 | save_item(NAME(m_seibucrtc_sc0bank)); |
| 361 | save_item(NAME(m_layer_en)); |
| 362 | save_item(NAME(m_scrollram)); |
| 351 | 363 | } |
| 352 | 364 | |
| 353 | | UINT32 goodejan_state::screen_update_goodejan(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 365 | UINT32 goodejan_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 354 | 366 | { |
| 355 | 367 | bitmap.fill(m_palette->pen(0x7ff), cliprect); //black pen |
| 356 | 368 | |
| r243349 | r243350 | |
| 381 | 393 | #define GOODEJAN_MHZ3 12000000 |
| 382 | 394 | |
| 383 | 395 | |
| 384 | | WRITE16_MEMBER(goodejan_state::goodejan_gfxbank_w) |
| 396 | WRITE16_MEMBER(goodejan_state::gfxbank_w) |
| 385 | 397 | { |
| 386 | 398 | seibucrtc_sc0bank_w((data & 0x100)>>8); |
| 387 | 399 | } |
| r243349 | r243350 | |
| 423 | 435 | |
| 424 | 436 | /* totmejan CRTC is at 8000-804f,goodejan is at 8000-807f */ |
| 425 | 437 | static ADDRESS_MAP_START( common_io_map, AS_IO, 16, goodejan_state ) |
| 426 | | AM_RANGE(0x9000, 0x9001) AM_WRITE(goodejan_gfxbank_w) |
| 438 | AM_RANGE(0x9000, 0x9001) AM_WRITE(gfxbank_w) |
| 427 | 439 | AM_RANGE(0xb000, 0xb003) AM_WRITENOP |
| 428 | 440 | AM_RANGE(0xb004, 0xb005) AM_WRITE(mahjong_panel_w) |
| 429 | 441 | |
| r243349 | r243350 | |
| 592 | 604 | GFXDECODE_ENTRY( "tx_gfx", 0, charlayout, 0x100, 0x10 ) /* Text */ |
| 593 | 605 | GFXDECODE_END |
| 594 | 606 | |
| 595 | | INTERRUPT_GEN_MEMBER(goodejan_state::goodejan_irq) |
| 607 | INTERRUPT_GEN_MEMBER(goodejan_state::irq) |
| 596 | 608 | { |
| 597 | 609 | device.execute().set_input_line_and_vector(0,HOLD_LINE,0x208/4); |
| 598 | 610 | /* vector 0x00c is just a reti */ |
| r243349 | r243350 | |
| 616 | 628 | MCFG_CPU_ADD("maincpu", V30, GOODEJAN_MHZ2/2) |
| 617 | 629 | MCFG_CPU_PROGRAM_MAP(goodejan_map) |
| 618 | 630 | MCFG_CPU_IO_MAP(goodejan_io_map) |
| 619 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", goodejan_state, goodejan_irq) |
| 631 | MCFG_CPU_VBLANK_INT_DRIVER("screen", goodejan_state, irq) |
| 620 | 632 | |
| 621 | 633 | SEIBU_SOUND_SYSTEM_CPU(GOODEJAN_MHZ1/2) |
| 622 | 634 | |
| r243349 | r243350 | |
| 626 | 638 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 627 | 639 | MCFG_SCREEN_SIZE(32*8, 32*8) |
| 628 | 640 | MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) //TODO: dynamic resolution |
| 629 | | MCFG_SCREEN_UPDATE_DRIVER(goodejan_state, screen_update_goodejan) |
| 641 | MCFG_SCREEN_UPDATE_DRIVER(goodejan_state, screen_update) |
| 630 | 642 | MCFG_SCREEN_PALETTE("palette") |
| 631 | 643 | |
| 632 | 644 | MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0) |
| r243349 | r243350 | |
| 742 | 754 | ROM_LOAD( "fmj08.083", 0x000, 0x100, CRC(9657b7ad) SHA1(e9b469c2b3534593f7fe0ea19cbbf93b55957e42) ) |
| 743 | 755 | ROM_END |
| 744 | 756 | |
| 745 | | GAME( 1991, totmejan, 0, totmejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Tottemo E Jong", GAME_IMPERFECT_GRAPHICS ) |
| 746 | | GAME( 1991, goodejan, 0, goodejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 1)", GAME_IMPERFECT_GRAPHICS ) |
| 747 | | GAME( 1991, goodejana,goodejan, goodejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 2)", GAME_IMPERFECT_GRAPHICS ) |
| 757 | GAME( 1991, totmejan, 0, totmejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Tottemo E Jong", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 758 | GAME( 1991, goodejan, 0, goodejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 759 | GAME( 1991, goodejana,goodejan, goodejan, goodejan, driver_device, 0, ROT0, "Seibu Kaihatsu (Tecmo license)", "Good E Jong -Kachinuki Mahjong Syoukin Oh!!- (set 2)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
trunk/src/mame/drivers/sengokmj.c
| r243349 | r243350 | |
| 66 | 66 | public: |
| 67 | 67 | sengokmj_state(const machine_config &mconfig, device_type type, const char *tag) |
| 68 | 68 | : driver_device(mconfig, type, tag), |
| 69 | m_maincpu(*this, "maincpu"), |
| 70 | m_gfxdecode(*this, "gfxdecode"), |
| 71 | m_palette(*this, "palette"), |
| 69 | 72 | m_sc0_vram(*this, "sc0_vram"), |
| 70 | 73 | m_sc1_vram(*this, "sc1_vram"), |
| 71 | 74 | m_sc2_vram(*this, "sc2_vram"), |
| 72 | 75 | m_sc3_vram(*this, "sc3_vram"), |
| 73 | | m_spriteram16(*this, "sprite_ram"), |
| 74 | | m_maincpu(*this, "maincpu"), |
| 75 | | m_gfxdecode(*this, "gfxdecode"), |
| 76 | | m_palette(*this, "palette") { } |
| 76 | m_spriteram16(*this, "sprite_ram") { } |
| 77 | 77 | |
| 78 | required_device<cpu_device> m_maincpu; |
| 79 | required_device<gfxdecode_device> m_gfxdecode; |
| 80 | required_device<palette_device> m_palette; |
| 81 | |
| 78 | 82 | required_shared_ptr<UINT16> m_sc0_vram; |
| 79 | 83 | required_shared_ptr<UINT16> m_sc1_vram; |
| 80 | 84 | required_shared_ptr<UINT16> m_sc2_vram; |
| 81 | 85 | required_shared_ptr<UINT16> m_sc3_vram; |
| 82 | 86 | required_shared_ptr<UINT16> m_spriteram16; |
| 83 | | required_device<cpu_device> m_maincpu; |
| 84 | | required_device<gfxdecode_device> m_gfxdecode; |
| 85 | | required_device<palette_device> m_palette; |
| 87 | |
| 86 | 88 | tilemap_t *m_sc0_tilemap; |
| 87 | 89 | tilemap_t *m_sc1_tilemap; |
| 88 | 90 | tilemap_t *m_sc2_tilemap; |
| 89 | 91 | tilemap_t *m_sc3_tilemap; |
| 90 | | UINT16 m_sengokumj_mux_data; |
| 92 | |
| 93 | UINT16 m_mux_data; |
| 91 | 94 | UINT8 m_hopper_io; |
| 92 | 95 | UINT16 m_layer_en; |
| 93 | 96 | UINT16 m_scrollram[6]; |
| 97 | |
| 94 | 98 | DECLARE_READ16_MEMBER(mahjong_panel_r); |
| 95 | 99 | DECLARE_WRITE16_MEMBER(mahjong_panel_w); |
| 96 | | DECLARE_WRITE16_MEMBER(sengokmj_out_w); |
| 97 | | DECLARE_READ16_MEMBER(sengokmj_system_r); |
| 100 | DECLARE_WRITE16_MEMBER(out_w); |
| 101 | DECLARE_READ16_MEMBER(system_r); |
| 98 | 102 | DECLARE_WRITE16_MEMBER(seibucrtc_sc0vram_w); |
| 99 | 103 | DECLARE_WRITE16_MEMBER(seibucrtc_sc1vram_w); |
| 100 | 104 | DECLARE_WRITE16_MEMBER(seibucrtc_sc2vram_w); |
| 101 | 105 | DECLARE_WRITE16_MEMBER(seibucrtc_sc3vram_w); |
| 106 | DECLARE_WRITE16_MEMBER(layer_en_w); |
| 107 | DECLARE_WRITE16_MEMBER(layer_scroll_w); |
| 108 | |
| 102 | 109 | TILE_GET_INFO_MEMBER(seibucrtc_sc0_tile_info); |
| 103 | 110 | TILE_GET_INFO_MEMBER(seibucrtc_sc1_tile_info); |
| 104 | 111 | TILE_GET_INFO_MEMBER(seibucrtc_sc2_tile_info); |
| 105 | 112 | TILE_GET_INFO_MEMBER(seibucrtc_sc3_tile_info); |
| 106 | | INTERRUPT_GEN_MEMBER(sengokmj_interrupt); |
| 107 | | DECLARE_WRITE16_MEMBER(layer_en_w); |
| 108 | | DECLARE_WRITE16_MEMBER(layer_scroll_w); |
| 113 | |
| 114 | INTERRUPT_GEN_MEMBER(interrupt); |
| 109 | 115 | |
| 116 | virtual void machine_start(); |
| 117 | virtual void video_start(); |
| 118 | |
| 110 | 119 | void draw_sprites(bitmap_ind16 &bitmap,const rectangle &cliprect,int pri); |
| 111 | | virtual void video_start(); |
| 112 | | UINT32 screen_update_sengokmj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 120 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 113 | 121 | }; |
| 114 | 122 | |
| 115 | 123 | |
| r243349 | r243350 | |
| 294 | 302 | m_sc2_tilemap->set_transparent_pen(15); |
| 295 | 303 | m_sc1_tilemap->set_transparent_pen(15); |
| 296 | 304 | m_sc3_tilemap->set_transparent_pen(15); |
| 305 | |
| 306 | save_item(NAME(m_layer_en)); |
| 307 | save_item(NAME(m_scrollram)); |
| 297 | 308 | } |
| 298 | 309 | |
| 299 | | UINT32 sengokmj_state::screen_update_sengokmj(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 310 | UINT32 sengokmj_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 300 | 311 | { |
| 301 | 312 | bitmap.fill(m_palette->pen(0x7ff), cliprect); //black pen |
| 302 | 313 | |
| r243349 | r243350 | |
| 323 | 334 | } |
| 324 | 335 | |
| 325 | 336 | |
| 337 | void sengokmj_state::machine_start() |
| 338 | { |
| 339 | save_item(NAME(m_mux_data)); |
| 340 | save_item(NAME(m_hopper_io)); |
| 341 | } |
| 326 | 342 | |
| 327 | 343 | |
| 328 | 344 | /* Multiplexer device for the mahjong panel */ |
| r243349 | r243350 | |
| 334 | 350 | |
| 335 | 351 | for(i=0;i<5;i++) |
| 336 | 352 | { |
| 337 | | if(m_sengokumj_mux_data & 1 << i) |
| 353 | if(m_mux_data & 1 << i) |
| 338 | 354 | res = ioport(mpnames[i])->read(); |
| 339 | 355 | } |
| 340 | 356 | |
| r243349 | r243350 | |
| 343 | 359 | |
| 344 | 360 | WRITE16_MEMBER(sengokmj_state::mahjong_panel_w) |
| 345 | 361 | { |
| 346 | | m_sengokumj_mux_data = (data & 0x3f00) >> 8; |
| 362 | m_mux_data = (data & 0x3f00) >> 8; |
| 347 | 363 | |
| 348 | 364 | if(data & 0xc0ff) |
| 349 | 365 | logerror("Write to mux %04x\n",data); |
| 350 | 366 | } |
| 351 | 367 | |
| 352 | | WRITE16_MEMBER(sengokmj_state::sengokmj_out_w) |
| 368 | WRITE16_MEMBER(sengokmj_state::out_w) |
| 353 | 369 | { |
| 354 | 370 | /* ---- ---- ---x ---- J.P. Signal (?)*/ |
| 355 | 371 | /* ---- ---- ---- -x-- Coin counter (done AFTER you press start)*/ |
| r243349 | r243350 | |
| 362 | 378 | // popmessage("%02x",m_hopper_io); |
| 363 | 379 | } |
| 364 | 380 | |
| 365 | | READ16_MEMBER(sengokmj_state::sengokmj_system_r) |
| 381 | READ16_MEMBER(sengokmj_state::system_r) |
| 366 | 382 | { |
| 367 | 383 | return (ioport("SYSTEM")->read() & 0xffbf) | m_hopper_io; |
| 368 | 384 | } |
| r243349 | r243350 | |
| 387 | 403 | // AM_RANGE(0x8080, 0x8081) CRTC extra register? |
| 388 | 404 | // AM_RANGE(0x80c0, 0x80c1) CRTC extra register? |
| 389 | 405 | // AM_RANGE(0x8100, 0x8101) AM_WRITENOP // always 0 |
| 390 | | AM_RANGE(0x8180, 0x8181) AM_WRITE(sengokmj_out_w) |
| 406 | AM_RANGE(0x8180, 0x8181) AM_WRITE(out_w) |
| 391 | 407 | AM_RANGE(0x8140, 0x8141) AM_WRITE(mahjong_panel_w) |
| 392 | 408 | AM_RANGE(0xc000, 0xc001) AM_READ_PORT("DSW1") |
| 393 | 409 | AM_RANGE(0xc002, 0xc003) AM_READ(mahjong_panel_r) |
| 394 | | AM_RANGE(0xc004, 0xc005) AM_READ(sengokmj_system_r) //switches |
| 410 | AM_RANGE(0xc004, 0xc005) AM_READ(system_r) //switches |
| 395 | 411 | ADDRESS_MAP_END |
| 396 | 412 | |
| 397 | 413 | |
| r243349 | r243350 | |
| 538 | 554 | GFXDECODE_ENTRY( "tx_gfx", 0, charlayout, 0x700, 0x10 ) /* Text */ |
| 539 | 555 | GFXDECODE_END |
| 540 | 556 | |
| 541 | | INTERRUPT_GEN_MEMBER(sengokmj_state::sengokmj_interrupt) |
| 557 | INTERRUPT_GEN_MEMBER(sengokmj_state::interrupt) |
| 542 | 558 | { |
| 543 | 559 | device.execute().set_input_line_and_vector(0,HOLD_LINE,0xc8/4); |
| 544 | 560 | } |
| r243349 | r243350 | |
| 560 | 576 | MCFG_CPU_ADD("maincpu", V30, 16000000/2) /* V30-8 */ |
| 561 | 577 | MCFG_CPU_PROGRAM_MAP(sengokmj_map) |
| 562 | 578 | MCFG_CPU_IO_MAP(sengokmj_io_map) |
| 563 | | MCFG_CPU_VBLANK_INT_DRIVER("screen", sengokmj_state, sengokmj_interrupt) |
| 579 | MCFG_CPU_VBLANK_INT_DRIVER("screen", sengokmj_state, interrupt) |
| 564 | 580 | |
| 565 | 581 | SEIBU_SOUND_SYSTEM_CPU(14318180/4) |
| 566 | 582 | |
| r243349 | r243350 | |
| 572 | 588 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 573 | 589 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 574 | 590 | MCFG_SCREEN_VISIBLE_AREA(0, 320-1, 16, 256-1) //TODO: dynamic resolution |
| 575 | | MCFG_SCREEN_UPDATE_DRIVER(sengokmj_state, screen_update_sengokmj) |
| 591 | MCFG_SCREEN_UPDATE_DRIVER(sengokmj_state, screen_update) |
| 576 | 592 | MCFG_SCREEN_PALETTE("palette") |
| 577 | 593 | |
| 578 | 594 | MCFG_DEVICE_ADD("crtc", SEIBU_CRTC, 0) |
| r243349 | r243350 | |
| 624 | 640 | ROM_LOAD( "rs006.89", 0x000, 0x200, CRC(96f7646e) SHA1(400a831b83d6ac4d2a46ef95b97b1ee237099e44) ) /* Priority */ |
| 625 | 641 | ROM_END |
| 626 | 642 | |
| 627 | | GAME( 1991, sengokmj, 0, sengokmj, sengokmj, driver_device, 0, ROT0, "Sigma", "Sengoku Mahjong [BET] (Japan)", GAME_IMPERFECT_GRAPHICS ) |
| 643 | GAME( 1991, sengokmj, 0, sengokmj, sengokmj, driver_device, 0, ROT0, "Sigma", "Sengoku Mahjong [BET] (Japan)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 628 | 644 | /*Non-Bet Version?*/ |