Previous 199869 Revisions Next

r35094 Tuesday 17th February, 2015 at 18:32:44 UTC by Osso
pipeline.c: added save state support (nw)
[src/mame/drivers]pipeline.c

trunk/src/mame/drivers/pipeline.c
r243605r243606
7777public:
7878   pipeline_state(const machine_config &mconfig, device_type type, const char *tag)
7979      : driver_device(mconfig, type, tag),
80      m_vram1(*this, "vram1"),
81      m_vram2(*this, "vram2"),
8280      m_maincpu(*this, "maincpu"),
8381      m_gfxdecode(*this, "gfxdecode"),
84      m_palette(*this, "palette")  { }
82      m_palette(*this, "palette"),
83      m_vram1(*this, "vram1"),
84      m_vram2(*this, "vram2") { }
8585
86   required_device<cpu_device> m_maincpu;
87   required_device<gfxdecode_device> m_gfxdecode;
88   required_device<palette_device> m_palette;
89
90   required_shared_ptr<UINT8> m_vram1;
91   required_shared_ptr<UINT8> m_vram2;
92
8693   tilemap_t *m_tilemap1;
8794   tilemap_t *m_tilemap2;
88   required_shared_ptr<UINT8> m_vram1;
89   required_shared_ptr<UINT8> m_vram2;
95
9096   UINT8 m_vidctrl;
9197   UINT8 *m_palram;
9298   UINT8 m_toMCU;
9399   UINT8 m_fromMCU;
94100   UINT8 m_ddrA;
101   
95102   DECLARE_WRITE8_MEMBER(vram2_w);
96103   DECLARE_WRITE8_MEMBER(vram1_w);
97104   DECLARE_WRITE8_MEMBER(mcu_portA_w);
r243605r243606
100107   DECLARE_WRITE8_MEMBER(vidctrl_w);
101108   DECLARE_READ8_MEMBER(protection_r);
102109   DECLARE_WRITE8_MEMBER(protection_w);
110   
103111   TILE_GET_INFO_MEMBER(get_tile_info);
104112   TILE_GET_INFO_MEMBER(get_tile_info2);
113   
114   virtual void machine_start();
105115   virtual void video_start();
106116   DECLARE_PALETTE_INIT(pipeline);
107   UINT32 screen_update_pipeline(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
117   
118   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
119   
108120   TIMER_CALLBACK_MEMBER(protection_deferred_w);
109   required_device<cpu_device> m_maincpu;
110   required_device<gfxdecode_device> m_gfxdecode;
111   required_device<palette_device> m_palette;
112121};
113122
114123
124void pipeline_state::machine_start()
125{
126   save_item(NAME(m_toMCU));
127   save_item(NAME(m_fromMCU));
128   save_item(NAME(m_ddrA));
129}
130
115131TILE_GET_INFO_MEMBER(pipeline_state::get_tile_info)
116132{
117133   int code = m_vram2[tile_index]+m_vram2[tile_index+0x800]*256;
r243605r243606
137153   m_tilemap1 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(pipeline_state::get_tile_info),this),TILEMAP_SCAN_ROWS,8,8,64,32 );
138154   m_tilemap2 = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(pipeline_state::get_tile_info2),this),TILEMAP_SCAN_ROWS,8,8,64,32 );
139155   m_tilemap2->set_transparent_pen(0);
156   
157   save_item(NAME(m_vidctrl));
158   save_pointer(NAME(m_palram), 0x1000);
140159}
141160
142UINT32 pipeline_state::screen_update_pipeline(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
161UINT32 pipeline_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
143162{
144163   m_tilemap1->draw(screen, bitmap, cliprect, 0,0);
145164   m_tilemap2->draw(screen, bitmap, cliprect, 0,0);
r243605r243606
377396   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
378397   MCFG_SCREEN_SIZE(512, 512)
379398   MCFG_SCREEN_VISIBLE_AREA(0, 319, 16, 239)
380   MCFG_SCREEN_UPDATE_DRIVER(pipeline_state, screen_update_pipeline)
399   MCFG_SCREEN_UPDATE_DRIVER(pipeline_state, screen_update)
381400   MCFG_SCREEN_PALETTE("palette")
382401
383402   MCFG_GFXDECODE_ADD("gfxdecode", "palette", pipeline)
r243605r243606
424443   ROM_LOAD( "82s123.u79", 0x00200, 0x00020,CRC(6df3f972) SHA1(0096a7f7452b70cac6c0752cb62e24b643015b5c) )
425444ROM_END
426445
427GAME( 1990, pipeline, 0, pipeline, pipeline, driver_device, 0, ROT0, "Daehyun Electronics", "Pipeline",GAME_NO_SOUND )
446GAME( 1990, pipeline, 0, pipeline, pipeline, driver_device, 0, ROT0, "Daehyun Electronics", "Pipeline", GAME_NO_SOUND | GAME_SUPPORTS_SAVE )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team