Previous 199869 Revisions Next

r34892 Friday 6th February, 2015 at 17:37:10 UTC by Osso
d9final.c: enabled save state support (nw)
[src/mame/drivers]d9final.c

trunk/src/mame/drivers/d9final.c
r243403r243404
77    driver by Angelo Salese & David Haywood
88
99    TODO:
10    - Don't know where the ES8712 & RTC62421b chips routes;
10    - Don't know where the ES8712 & RTC62421b chips route;
1111    - A bunch of missing port outputs;
1212    - screen disable? Start-up fading looks horrible;
1313    - Game looks IGS-esque, is there any correlation?
r243403r243404
3131public:
3232   d9final_state(const machine_config &mconfig, device_type type, const char *tag)
3333      : driver_device(mconfig, type, tag),
34      m_maincpu(*this, "maincpu"),
35      m_gfxdecode(*this, "gfxdecode"),
3436      m_lo_vram(*this, "lo_vram"),
3537      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") { }
3939
40   required_device<cpu_device> m_maincpu;
41   required_device<gfxdecode_device> m_gfxdecode;
42   
4043   required_shared_ptr<UINT8> m_lo_vram;
4144   required_shared_ptr<UINT8> m_hi_vram;
4245   required_shared_ptr<UINT8> m_cram;
46   
4347   tilemap_t *m_sc0_tilemap;
48   
4449   DECLARE_WRITE8_MEMBER(sc0_lovram);
4550   DECLARE_WRITE8_MEMBER(sc0_hivram);
4651   DECLARE_WRITE8_MEMBER(sc0_cram);
47   DECLARE_WRITE8_MEMBER(d9final_bank_w);
52   DECLARE_WRITE8_MEMBER(bank_w);
4853   DECLARE_READ8_MEMBER(prot_latch_r);
54   
4955   TILE_GET_INFO_MEMBER(get_sc0_tile_info);
50   virtual void machine_reset();
56   
57   virtual void machine_start();
5158   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);
5561};
5662
5763
r243403r243404
7278   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);
7379}
7480
75UINT32 d9final_state::screen_update_d9final(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
81UINT32 d9final_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
7682{
7783   m_sc0_tilemap->draw(screen, bitmap, cliprect, 0,0);
7884   return 0;
r243403r243404
96102   m_sc0_tilemap->mark_tile_dirty(offset);
97103}
98104
99WRITE8_MEMBER(d9final_state::d9final_bank_w)
105WRITE8_MEMBER(d9final_state::bank_w)
100106{
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);
106108}
107109
108110/* game checks this after three attract cycles, otherwise coin inputs stop to work. */
r243403r243404
135137   AM_RANGE(0x40, 0x41) AM_DEVWRITE("ymsnd", ym2413_device, write)
136138   AM_RANGE(0x60, 0x60) AM_READ_PORT("DSWD")
137139   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)
139141   AM_RANGE(0xe0, 0xe0) AM_READ_PORT("IN2")
140142ADDRESS_MAP_END
141143
r243403r243404
277279   GFXDECODE_ENTRY( "gfx1", 0, tiles16x8_layout, 0, 16*4 )
278280GFXDECODE_END
279281
280void d9final_state::machine_reset()
282void d9final_state::machine_start()
281283{
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);
285285}
286286
287287static MACHINE_CONFIG_START( d9final, d9final_state )
r243403r243404
298298   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
299299   MCFG_SCREEN_SIZE(512, 256)
300300   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)
302302   MCFG_SCREEN_PALETTE("palette")
303303
304304   MCFG_GFXDECODE_ADD("gfxdecode", "palette", d9final)
r243403r243404
326326
327327
328328
329GAME( 1992, d9final, 0, d9final, d9final, driver_device, 0, ROT0, "Excellent System", "Dream 9 Final (v2.24)", 0 )
329GAME( 1992, d9final, 0, d9final, d9final, driver_device, 0, ROT0, "Excellent System", "Dream 9 Final (v2.24)", GAME_SUPPORTS_SAVE )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team