trunk/src/mame/drivers/rmhaihai.c
| r245148 | r245149 | |
| 39 | 39 | public: |
| 40 | 40 | rmhaihai_state(const machine_config &mconfig, device_type type, const char *tag) |
| 41 | 41 | : driver_device(mconfig, type, tag), |
| 42 | | m_colorram(*this, "colorram"), |
| 43 | | m_videoram(*this, "videoram"), |
| 44 | 42 | m_maincpu(*this, "maincpu"), |
| 45 | 43 | m_msm(*this, "msm"), |
| 46 | | m_gfxdecode(*this, "gfxdecode") { } |
| 44 | m_gfxdecode(*this, "gfxdecode"), |
| 45 | m_colorram(*this, "colorram"), |
| 46 | m_videoram(*this, "videoram") { } |
| 47 | 47 | |
| 48 | | int m_gfxbank; |
| 48 | required_device<cpu_device> m_maincpu; |
| 49 | required_device<msm5205_device> m_msm; |
| 50 | required_device<gfxdecode_device> m_gfxdecode; |
| 51 | |
| 49 | 52 | required_shared_ptr<UINT8> m_colorram; |
| 50 | 53 | required_shared_ptr<UINT8> m_videoram; |
| 54 | |
| 51 | 55 | tilemap_t *m_bg_tilemap; |
| 52 | 56 | int m_keyboard_cmd; |
| 57 | int m_gfxbank; |
| 58 | |
| 53 | 59 | DECLARE_WRITE8_MEMBER(rmhaihai_videoram_w); |
| 54 | 60 | DECLARE_WRITE8_MEMBER(rmhaihai_colorram_w); |
| 55 | 61 | DECLARE_READ8_MEMBER(keyboard_r); |
| r245148 | r245149 | |
| 58 | 64 | DECLARE_WRITE8_MEMBER(ctrl_w); |
| 59 | 65 | DECLARE_WRITE8_MEMBER(themj_rombank_w); |
| 60 | 66 | DECLARE_WRITE8_MEMBER(adpcm_w); |
| 67 | |
| 61 | 68 | DECLARE_DRIVER_INIT(rmhaihai); |
| 62 | | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 63 | 69 | virtual void video_start(); |
| 70 | DECLARE_MACHINE_START(themj); |
| 64 | 71 | DECLARE_MACHINE_RESET(themj); |
| 65 | | UINT32 screen_update_rmhaihai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 66 | | required_device<cpu_device> m_maincpu; |
| 67 | | required_device<msm5205_device> m_msm; |
| 68 | | required_device<gfxdecode_device> m_gfxdecode; |
| 72 | |
| 73 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 74 | |
| 75 | TILE_GET_INFO_MEMBER(get_bg_tile_info); |
| 69 | 76 | }; |
| 70 | 77 | |
| 71 | 78 | |
| r245148 | r245149 | |
| 95 | 102 | { |
| 96 | 103 | m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(rmhaihai_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, |
| 97 | 104 | 8, 8, 64, 32); |
| 105 | |
| 106 | save_item(NAME(m_keyboard_cmd)); |
| 107 | save_item(NAME(m_gfxbank)); |
| 98 | 108 | } |
| 99 | 109 | |
| 100 | | UINT32 rmhaihai_state::screen_update_rmhaihai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 110 | UINT32 rmhaihai_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 101 | 111 | { |
| 102 | 112 | m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); |
| 103 | 113 | return 0; |
| r245148 | r245149 | |
| 190 | 200 | |
| 191 | 201 | WRITE8_MEMBER(rmhaihai_state::themj_rombank_w) |
| 192 | 202 | { |
| 193 | | UINT8 *rom = memregion("maincpu")->base() + 0x10000; |
| 194 | | int bank = data & 0x03; |
| 195 | | logerror("banksw %d\n",bank); |
| 196 | | membank("bank1")->set_base(rom + bank*0x4000); |
| 197 | | membank("bank2")->set_base(rom + bank*0x4000 + 0x2000); |
| 203 | logerror("banksw %d\n", data & 0x03); |
| 204 | membank("bank1")->set_entry(data & 0x03); |
| 205 | membank("bank2")->set_entry(data & 0x03); |
| 198 | 206 | } |
| 199 | 207 | |
| 208 | MACHINE_START_MEMBER(rmhaihai_state,themj) |
| 209 | { |
| 210 | membank("bank1")->configure_entries(0, 4, memregion("maincpu")->base() + 0x10000, 0x4000); |
| 211 | membank("bank2")->configure_entries(0, 4, memregion("maincpu")->base() + 0x12000, 0x4000); |
| 212 | } |
| 213 | |
| 200 | 214 | MACHINE_RESET_MEMBER(rmhaihai_state,themj) |
| 201 | 215 | { |
| 202 | | themj_rombank_w(m_maincpu->space(AS_IO), 0, 0); |
| 216 | membank("bank1")->set_entry(0); |
| 217 | membank("bank2")->set_entry(0); |
| 203 | 218 | } |
| 204 | 219 | |
| 205 | 220 | |
| r245148 | r245149 | |
| 465 | 480 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 466 | 481 | MCFG_SCREEN_SIZE(64*8, 32*8) |
| 467 | 482 | MCFG_SCREEN_VISIBLE_AREA(4*8, 60*8-1, 2*8, 30*8-1) |
| 468 | | MCFG_SCREEN_UPDATE_DRIVER(rmhaihai_state, screen_update_rmhaihai) |
| 483 | MCFG_SCREEN_UPDATE_DRIVER(rmhaihai_state, screen_update) |
| 469 | 484 | MCFG_SCREEN_PALETTE("palette") |
| 470 | 485 | |
| 471 | 486 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", rmhaihai) |
| r245148 | r245149 | |
| 503 | 518 | MCFG_CPU_PROGRAM_MAP(themj_map) |
| 504 | 519 | MCFG_CPU_IO_MAP(themj_io_map) |
| 505 | 520 | |
| 521 | MCFG_MACHINE_START_OVERRIDE(rmhaihai_state,themj) |
| 506 | 522 | MCFG_MACHINE_RESET_OVERRIDE(rmhaihai_state,themj) |
| 507 | 523 | |
| 508 | 524 | /* video hardware */ |
| r245148 | r245149 | |
| 678 | 694 | } |
| 679 | 695 | |
| 680 | 696 | |
| 681 | | GAME( 1985, rmhaihai, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai (Japan)", 0 ) |
| 682 | | GAME( 1985, rmhaihib, rmhaihai, rmhaihai, rmhaihib, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai [BET] (Japan)", 0 ) |
| 683 | | GAME( 1986, rmhaijin, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai Jinji Idou Hen (Japan)", 0 ) |
| 684 | | GAME( 1986, rmhaisei, 0, rmhaisei, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", 0 ) |
| 685 | | GAME( 1987, themj, 0, themj, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "The Mah-jong (Japan)", 0 ) |
| 697 | GAME( 1985, rmhaihai, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai (Japan)", GAME_SUPPORTS_SAVE ) |
| 698 | GAME( 1985, rmhaihib, rmhaihai, rmhaihai, rmhaihib, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai [BET] (Japan)", GAME_SUPPORTS_SAVE ) |
| 699 | GAME( 1986, rmhaijin, 0, rmhaihai, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Alba", "Real Mahjong Haihai Jinji Idou Hen (Japan)", GAME_SUPPORTS_SAVE ) |
| 700 | GAME( 1986, rmhaisei, 0, rmhaisei, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "Real Mahjong Haihai Seichouhen (Japan)", GAME_SUPPORTS_SAVE ) |
| 701 | GAME( 1987, themj, 0, themj, rmhaihai, rmhaihai_state, rmhaihai, ROT0, "Visco", "The Mah-jong (Japan)", GAME_SUPPORTS_SAVE ) |