trunk/src/mame/drivers/d9final.c
| r243403 | r243404 | |
| 7 | 7 | driver by Angelo Salese & David Haywood |
| 8 | 8 | |
| 9 | 9 | TODO: |
| 10 | | - Don't know where the ES8712 & RTC62421b chips routes; |
| 10 | - Don't know where the ES8712 & RTC62421b chips route; |
| 11 | 11 | - A bunch of missing port outputs; |
| 12 | 12 | - screen disable? Start-up fading looks horrible; |
| 13 | 13 | - Game looks IGS-esque, is there any correlation? |
| r243403 | r243404 | |
| 31 | 31 | public: |
| 32 | 32 | d9final_state(const machine_config &mconfig, device_type type, const char *tag) |
| 33 | 33 | : driver_device(mconfig, type, tag), |
| 34 | m_maincpu(*this, "maincpu"), |
| 35 | m_gfxdecode(*this, "gfxdecode"), |
| 34 | 36 | m_lo_vram(*this, "lo_vram"), |
| 35 | 37 | m_hi_vram(*this, "hi_vram"), |
| 36 | | m_cram(*this, "cram"), |
| 37 | | m_maincpu(*this, "maincpu"), |
| 38 | | m_gfxdecode(*this, "gfxdecode") { } |
| 38 | m_cram(*this, "cram") { } |
| 39 | 39 | |
| 40 | required_device<cpu_device> m_maincpu; |
| 41 | required_device<gfxdecode_device> m_gfxdecode; |
| 42 | |
| 40 | 43 | required_shared_ptr<UINT8> m_lo_vram; |
| 41 | 44 | required_shared_ptr<UINT8> m_hi_vram; |
| 42 | 45 | required_shared_ptr<UINT8> m_cram; |
| 46 | |
| 43 | 47 | tilemap_t *m_sc0_tilemap; |
| 48 | |
| 44 | 49 | DECLARE_WRITE8_MEMBER(sc0_lovram); |
| 45 | 50 | DECLARE_WRITE8_MEMBER(sc0_hivram); |
| 46 | 51 | DECLARE_WRITE8_MEMBER(sc0_cram); |
| 47 | | DECLARE_WRITE8_MEMBER(d9final_bank_w); |
| 52 | DECLARE_WRITE8_MEMBER(bank_w); |
| 48 | 53 | DECLARE_READ8_MEMBER(prot_latch_r); |
| 54 | |
| 49 | 55 | TILE_GET_INFO_MEMBER(get_sc0_tile_info); |
| 50 | | virtual void machine_reset(); |
| 56 | |
| 57 | virtual void machine_start(); |
| 51 | 58 | virtual void video_start(); |
| 52 | | UINT32 screen_update_d9final(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 53 | | required_device<cpu_device> m_maincpu; |
| 54 | | required_device<gfxdecode_device> m_gfxdecode; |
| 59 | |
| 60 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 55 | 61 | }; |
| 56 | 62 | |
| 57 | 63 | |
| r243403 | r243404 | |
| 72 | 78 | m_sc0_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(d9final_state::get_sc0_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32); |
| 73 | 79 | } |
| 74 | 80 | |
| 75 | | UINT32 d9final_state::screen_update_d9final(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 81 | UINT32 d9final_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 76 | 82 | { |
| 77 | 83 | m_sc0_tilemap->draw(screen, bitmap, cliprect, 0,0); |
| 78 | 84 | return 0; |
| r243403 | r243404 | |
| 96 | 102 | m_sc0_tilemap->mark_tile_dirty(offset); |
| 97 | 103 | } |
| 98 | 104 | |
| 99 | | WRITE8_MEMBER(d9final_state::d9final_bank_w) |
| 105 | WRITE8_MEMBER(d9final_state::bank_w) |
| 100 | 106 | { |
| 101 | | UINT8 *ROM = memregion("maincpu")->base(); |
| 102 | | UINT32 bankaddress; |
| 103 | | |
| 104 | | bankaddress = 0x10000+(0x4000 * (data & 0x7)); |
| 105 | | membank("bank1")->set_base(&ROM[bankaddress]); |
| 107 | membank("bank1")->set_entry(data & 0x7); |
| 106 | 108 | } |
| 107 | 109 | |
| 108 | 110 | /* game checks this after three attract cycles, otherwise coin inputs stop to work. */ |
| r243403 | r243404 | |
| 135 | 137 | AM_RANGE(0x40, 0x41) AM_DEVWRITE("ymsnd", ym2413_device, write) |
| 136 | 138 | AM_RANGE(0x60, 0x60) AM_READ_PORT("DSWD") |
| 137 | 139 | AM_RANGE(0x80, 0x80) AM_READ_PORT("IN0") |
| 138 | | AM_RANGE(0xa0, 0xa0) AM_READ_PORT("IN1") AM_WRITE(d9final_bank_w) |
| 140 | AM_RANGE(0xa0, 0xa0) AM_READ_PORT("IN1") AM_WRITE(bank_w) |
| 139 | 141 | AM_RANGE(0xe0, 0xe0) AM_READ_PORT("IN2") |
| 140 | 142 | ADDRESS_MAP_END |
| 141 | 143 | |
| r243403 | r243404 | |
| 277 | 279 | GFXDECODE_ENTRY( "gfx1", 0, tiles16x8_layout, 0, 16*4 ) |
| 278 | 280 | GFXDECODE_END |
| 279 | 281 | |
| 280 | | void d9final_state::machine_reset() |
| 282 | void d9final_state::machine_start() |
| 281 | 283 | { |
| 282 | | UINT8 *ROM = memregion("maincpu")->base(); |
| 283 | | |
| 284 | | membank("bank1")->set_base(&ROM[0x10000]); |
| 284 | membank("bank1")->configure_entries(0, 8, memregion("maincpu")->base() + 0x10000, 0x4000); |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | static MACHINE_CONFIG_START( d9final, d9final_state ) |
| r243403 | r243404 | |
| 298 | 298 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) |
| 299 | 299 | MCFG_SCREEN_SIZE(512, 256) |
| 300 | 300 | MCFG_SCREEN_VISIBLE_AREA(0, 512-1, 16, 256-16-1) |
| 301 | | MCFG_SCREEN_UPDATE_DRIVER(d9final_state, screen_update_d9final) |
| 301 | MCFG_SCREEN_UPDATE_DRIVER(d9final_state, screen_update) |
| 302 | 302 | MCFG_SCREEN_PALETTE("palette") |
| 303 | 303 | |
| 304 | 304 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", d9final) |
| r243403 | r243404 | |
| 326 | 326 | |
| 327 | 327 | |
| 328 | 328 | |
| 329 | | GAME( 1992, d9final, 0, d9final, d9final, driver_device, 0, ROT0, "Excellent System", "Dream 9 Final (v2.24)", 0 ) |
| 329 | GAME( 1992, d9final, 0, d9final, d9final, driver_device, 0, ROT0, "Excellent System", "Dream 9 Final (v2.24)", GAME_SUPPORTS_SAVE ) |