vicdual.c: enabled save state support (nw)

This commit is contained in:
Ivan Vangelista 2015-07-06 17:26:31 +02:00
parent 99eebe40b3
commit b13814ac44
4 changed files with 217 additions and 220 deletions

View File

@ -15,8 +15,6 @@
* Oct 2004, Derrick Renaud * Oct 2004, Derrick Renaud
************************************************************************/ ************************************************************************/
static emu_timer *frogs_croak_timer;
/* Discrete Sound Input Nodes */ /* Discrete Sound Input Nodes */
#define FROGS_FLY_EN NODE_01 #define FROGS_FLY_EN NODE_01
@ -133,7 +131,7 @@ TIMER_CALLBACK_MEMBER( vicdual_state::frogs_croak_callback )
MACHINE_START_MEMBER(vicdual_state,frogs_audio) MACHINE_START_MEMBER(vicdual_state,frogs_audio)
{ {
frogs_croak_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vicdual_state::frogs_croak_callback), this)); m_frogs_croak_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vicdual_state::frogs_croak_callback), this));
machine_start(); machine_start();
} }
@ -164,7 +162,7 @@ WRITE8_MEMBER( vicdual_state::frogs_audio_w )
if (last_croak) if (last_croak)
{ {
/* The croak will keep playing until .429s after being disabled */ /* The croak will keep playing until .429s after being disabled */
frogs_croak_timer->adjust(attotime::from_double(1.1 * RES_K(390) * CAP_U(1))); m_frogs_croak_timer->adjust(attotime::from_double(1.1 * RES_K(390) * CAP_U(1)));
} }
} }
if (new_buzzz) if (new_buzzz)

File diff suppressed because it is too large Load Diff

View File

@ -23,9 +23,9 @@ public:
m_discrete(*this, "discrete"), m_discrete(*this, "discrete"),
m_coinstate_timer(*this, "coinstate"), m_coinstate_timer(*this, "coinstate"),
m_nsub_coinage_timer(*this, "nsub_coin"), m_nsub_coinage_timer(*this, "nsub_coin"),
m_screen(*this, "screen"),
m_videoram(*this, "videoram"), m_videoram(*this, "videoram"),
m_characterram(*this, "characterram"), m_characterram(*this, "characterram")
m_screen(*this, "screen")
{ } { }
required_device<cpu_device> m_maincpu; required_device<cpu_device> m_maincpu;
@ -35,25 +35,30 @@ public:
optional_device<discrete_device> m_discrete; optional_device<discrete_device> m_discrete;
required_device<timer_device> m_coinstate_timer; required_device<timer_device> m_coinstate_timer;
optional_device<timer_device> m_nsub_coinage_timer; optional_device<timer_device> m_nsub_coinage_timer;
required_device<screen_device> m_screen;
required_shared_ptr<UINT8> m_videoram; required_shared_ptr<UINT8> m_videoram;
required_shared_ptr<UINT8> m_characterram; required_shared_ptr<UINT8> m_characterram;
required_device<screen_device> m_screen;
UINT8 m_coin_status; UINT8 m_coin_status;
UINT8 m_palette_bank; UINT8 m_palette_bank;
UINT8 m_samurai_protection_data; UINT8 m_samurai_protection_data;
int m_nsub_coin_counter; int m_nsub_coin_counter;
int m_nsub_play_counter; int m_nsub_play_counter;
int m_port1State; int m_port1State;
int m_port2State; int m_port2State;
int m_psgData; int m_psgData;
emu_timer *m_frogs_croak_timer;
void coin_in(); void coin_in();
void assert_coin_status(); void assert_coin_status();
DECLARE_WRITE8_MEMBER(vicdual_videoram_w); // common
DECLARE_WRITE8_MEMBER(vicdual_characterram_w); DECLARE_WRITE8_MEMBER(videoram_w);
DECLARE_WRITE8_MEMBER(characterram_w);
DECLARE_WRITE8_MEMBER(palette_bank_w);
// game specific
DECLARE_READ8_MEMBER(depthch_io_r); DECLARE_READ8_MEMBER(depthch_io_r);
DECLARE_WRITE8_MEMBER(depthch_io_w); DECLARE_WRITE8_MEMBER(depthch_io_w);
DECLARE_READ8_MEMBER(safari_io_r); DECLARE_READ8_MEMBER(safari_io_r);
@ -83,7 +88,6 @@ public:
DECLARE_WRITE8_MEMBER(nsub_io_w); DECLARE_WRITE8_MEMBER(nsub_io_w);
DECLARE_READ8_MEMBER(invinco_io_r); DECLARE_READ8_MEMBER(invinco_io_r);
DECLARE_WRITE8_MEMBER(invinco_io_w); DECLARE_WRITE8_MEMBER(invinco_io_w);
DECLARE_WRITE8_MEMBER(vicdual_palette_bank_w);
/*----------- defined in audio/vicdual.c -----------*/ /*----------- defined in audio/vicdual.c -----------*/
DECLARE_WRITE8_MEMBER( frogs_audio_w ); DECLARE_WRITE8_MEMBER( frogs_audio_w );
@ -109,12 +113,12 @@ public:
DECLARE_WRITE8_MEMBER( pulsar_audio_1_w ); DECLARE_WRITE8_MEMBER( pulsar_audio_1_w );
DECLARE_WRITE8_MEMBER( pulsar_audio_2_w ); DECLARE_WRITE8_MEMBER( pulsar_audio_2_w );
DECLARE_CUSTOM_INPUT_MEMBER(vicdual_read_coin_status); DECLARE_CUSTOM_INPUT_MEMBER(read_coin_status);
DECLARE_CUSTOM_INPUT_MEMBER(vicdual_get_64v); DECLARE_CUSTOM_INPUT_MEMBER(get_64v);
DECLARE_CUSTOM_INPUT_MEMBER(vicdual_get_vblank_comp); DECLARE_CUSTOM_INPUT_MEMBER(get_vblank_comp);
DECLARE_CUSTOM_INPUT_MEMBER(vicdual_get_composite_blank_comp); DECLARE_CUSTOM_INPUT_MEMBER(get_composite_blank_comp);
DECLARE_CUSTOM_INPUT_MEMBER(vicdual_get_timer_value); DECLARE_CUSTOM_INPUT_MEMBER(get_timer_value);
DECLARE_CUSTOM_INPUT_MEMBER(vicdual_fake_lives_r); DECLARE_CUSTOM_INPUT_MEMBER(fake_lives_r);
DECLARE_CUSTOM_INPUT_MEMBER(samurai_protection_r); DECLARE_CUSTOM_INPUT_MEMBER(samurai_protection_r);
DECLARE_INPUT_CHANGED_MEMBER(coin_changed); DECLARE_INPUT_CHANGED_MEMBER(coin_changed);
DECLARE_INPUT_CHANGED_MEMBER(nsub_coin_in); DECLARE_INPUT_CHANGED_MEMBER(nsub_coin_in);
@ -128,13 +132,12 @@ public:
DECLARE_MACHINE_START(frogs_audio); DECLARE_MACHINE_START(frogs_audio);
virtual void machine_start(); virtual void machine_start();
virtual void machine_reset();
UINT32 screen_update_vicdual_bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_vicdual_bw_or_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_bw_or_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_vicdual_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); UINT32 screen_update_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
int get_vcounter(); int get_vcounter();
int vicdual_is_cabinet_color(); int is_cabinet_color();
}; };
MACHINE_CONFIG_EXTERN( carnival_audio ); MACHINE_CONFIG_EXTERN( carnival_audio );

View File

@ -23,14 +23,14 @@ static const pen_t pens_from_color_prom[] =
}; };
WRITE8_MEMBER(vicdual_state::vicdual_palette_bank_w) WRITE8_MEMBER(vicdual_state::palette_bank_w)
{ {
m_screen->update_partial(m_screen->vpos()); m_screen->update_partial(m_screen->vpos());
m_palette_bank = data & 3; m_palette_bank = data & 3;
} }
UINT32 vicdual_state::screen_update_vicdual_bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) UINT32 vicdual_state::screen_update_bw(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{ {
UINT8 x = 0; UINT8 x = 0;
UINT8 y = cliprect.min_y; UINT8 y = cliprect.min_y;
@ -80,7 +80,7 @@ UINT32 vicdual_state::screen_update_vicdual_bw(screen_device &screen, bitmap_rgb
} }
UINT32 vicdual_state::screen_update_vicdual_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) UINT32 vicdual_state::screen_update_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{ {
UINT8 *color_prom = (UINT8 *)memregion("proms")->base(); UINT8 *color_prom = (UINT8 *)memregion("proms")->base();
UINT8 x = 0; UINT8 x = 0;
@ -138,12 +138,12 @@ UINT32 vicdual_state::screen_update_vicdual_color(screen_device &screen, bitmap_
} }
UINT32 vicdual_state::screen_update_vicdual_bw_or_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) UINT32 vicdual_state::screen_update_bw_or_color(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{ {
if (vicdual_is_cabinet_color()) if (is_cabinet_color())
screen_update_vicdual_color(screen, bitmap, cliprect); screen_update_color(screen, bitmap, cliprect);
else else
screen_update_vicdual_bw(screen, bitmap, cliprect); screen_update_bw(screen, bitmap, cliprect);
return 0; return 0;
} }