tnzs.c: enabled save state support (nw)

This commit is contained in:
Ivan Vangelista 2015-02-14 08:49:03 +01:00
parent 619982dc06
commit f366747d5f
4 changed files with 46 additions and 63 deletions

View File

@ -185,14 +185,12 @@ GFXDECODE_END
MACHINE_START_MEMBER(cchance_state,cchance)
{
save_item(NAME(m_screenflip));
save_item(NAME(m_hop_io));
save_item(NAME(m_bell_io));
}
MACHINE_RESET_MEMBER(cchance_state,cchance)
{
m_screenflip = 0;
m_mcu_type = -1;
m_hop_io = 0;
m_bell_io = 0;

View File

@ -622,10 +622,7 @@ Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 1999/11/06
#include "emu.h"
#include "cpu/z80/z80.h"
#include "includes/taitoipt.h"
#include "cpu/mcs48/mcs48.h"
#include "sound/2203intf.h"
#include "sound/dac.h"
#include "sound/samples.h"
#include "includes/tnzs.h"
#include "sound/2151intf.h"
@ -2660,38 +2657,38 @@ ROM_END
// YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS
GAME( 1987, plumppop, 0, drtoppel, plumppop, tnzs_state, plumpop, ROT0, "Taito Corporation", "Plump Pop (Japan)", 0 )
GAME( 1992, jpopnics, 0, jpopnics, jpopnics, driver_device, 0, ROT0, "Nics", "Jumping Pop (Nics, Korean hack of Plump Pop)", GAME_IMPERFECT_GRAPHICS )
GAME( 1987, plumppop, 0, drtoppel, plumppop, tnzs_state, plumpop, ROT0, "Taito Corporation", "Plump Pop (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1992, jpopnics, 0, jpopnics, jpopnics, driver_device, 0, ROT0, "Nics", "Jumping Pop (Nics, Korean hack of Plump Pop)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
GAME( 1987, extrmatn, 0, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito Corporation Japan", "Extermination (World)", 0 )
GAME( 1987, extrmatnu, extrmatn, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito (World Games license)", "Extermination (US)", 0 )
GAME( 1987, extrmatnj, extrmatn, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito Corporation", "Extermination (Japan)", 0 )
GAME( 1987, extrmatn, 0, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito Corporation Japan", "Extermination (World)", GAME_SUPPORTS_SAVE )
GAME( 1987, extrmatnu, extrmatn, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito (World Games license)", "Extermination (US)", GAME_SUPPORTS_SAVE )
GAME( 1987, extrmatnj, extrmatn, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito Corporation", "Extermination (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1987, arknoid2, 0, arknoid2, arknoid2, tnzs_state, arknoid2, ROT270, "Taito Corporation Japan", "Arkanoid - Revenge of DOH (World)", 0 )
GAME( 1987, arknoid2u, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "Taito America Corporation (Romstar license)", "Arkanoid - Revenge of DOH (US)", 0 )
GAME( 1987, arknoid2j, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "Taito Corporation", "Arkanoid - Revenge of DOH (Japan)", 0 )
GAME( 1987, arknoid2b, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "bootleg", "Arkanoid - Revenge of DOH (Japan bootleg)", 0 )
GAME( 1987, arknoid2, 0, arknoid2, arknoid2, tnzs_state, arknoid2, ROT270, "Taito Corporation Japan", "Arkanoid - Revenge of DOH (World)", GAME_SUPPORTS_SAVE )
GAME( 1987, arknoid2u, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "Taito America Corporation (Romstar license)", "Arkanoid - Revenge of DOH (US)", GAME_SUPPORTS_SAVE )
GAME( 1987, arknoid2j, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "Taito Corporation", "Arkanoid - Revenge of DOH (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1987, arknoid2b, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "bootleg", "Arkanoid - Revenge of DOH (Japan bootleg)", GAME_SUPPORTS_SAVE )
GAME( 1987, drtoppel, 0, drtoppel, drtoppel, tnzs_state, drtoppel, ROT90, "Kaneko / Taito Corporation Japan", "Dr. Toppel's Adventure (World)", 0 ) /* Possible region hack */
GAME( 1987, drtoppelu, drtoppel, drtoppel, drtopplu, tnzs_state, drtoppel, ROT90, "Kaneko / Taito America Corporation", "Dr. Toppel's Adventure (US)", 0 ) /* Possible region hack */
GAME( 1987, drtoppelj, drtoppel, drtoppel, drtopplu, tnzs_state, drtoppel, ROT90, "Kaneko / Taito Corporation", "Dr. Toppel's Tankentai (Japan)", 0 )
GAME( 1987, drtoppel, 0, drtoppel, drtoppel, tnzs_state, drtoppel, ROT90, "Kaneko / Taito Corporation Japan", "Dr. Toppel's Adventure (World)", GAME_SUPPORTS_SAVE ) /* Possible region hack */
GAME( 1987, drtoppelu, drtoppel, drtoppel, drtopplu, tnzs_state, drtoppel, ROT90, "Kaneko / Taito America Corporation", "Dr. Toppel's Adventure (US)", GAME_SUPPORTS_SAVE ) /* Possible region hack */
GAME( 1987, drtoppelj, drtoppel, drtoppel, drtopplu, tnzs_state, drtoppel, ROT90, "Kaneko / Taito Corporation", "Dr. Toppel's Tankentai (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1988, kageki, 0, kageki, kageki, tnzs_state, kageki, ROT90, "Kaneko / Taito America Corporation (Romstar license)", "Kageki (US)", 0 )
GAME( 1988, kagekij, kageki, kageki, kagekij, tnzs_state, kageki, ROT90, "Kaneko / Taito Corporation", "Kageki (Japan)", 0 )
GAME( 1992, kagekih, kageki, kageki, kageki, tnzs_state, kageki, ROT90, "hack", "Kageki (hack)", 0 ) // date is hacked at least, might also be a Japan set hacked to show english
GAME( 1988, kageki, 0, kageki, kageki, tnzs_state, kageki, ROT90, "Kaneko / Taito America Corporation (Romstar license)", "Kageki (US)", GAME_SUPPORTS_SAVE )
GAME( 1988, kagekij, kageki, kageki, kagekij, tnzs_state, kageki, ROT90, "Kaneko / Taito Corporation", "Kageki (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1992, kagekih, kageki, kageki, kageki, tnzs_state, kageki, ROT90, "hack", "Kageki (hack)", GAME_SUPPORTS_SAVE ) // date is hacked at least, might also be a Japan set hacked to show english
GAME( 1988, chukatai, 0, tnzs, chukatai, tnzs_state, chukatai, ROT0, "Taito Corporation Japan", "Chuka Taisen (World)", 0 ) /* Possible region hack */
GAME( 1988, chukataiu, chukatai, tnzs, chukatau, tnzs_state, chukatai, ROT0, "Taito America Corporation", "Chuka Taisen (US)", 0 ) /* Possible region hack */
GAME( 1988, chukataij, chukatai, tnzs, chukatau, tnzs_state, chukatai, ROT0, "Taito Corporation", "Chuka Taisen (Japan)", 0 )
GAME( 1988, chukatai, 0, tnzs, chukatai, tnzs_state, chukatai, ROT0, "Taito Corporation Japan", "Chuka Taisen (World)", GAME_SUPPORTS_SAVE ) /* Possible region hack */
GAME( 1988, chukataiu, chukatai, tnzs, chukatau, tnzs_state, chukatai, ROT0, "Taito America Corporation", "Chuka Taisen (US)", GAME_SUPPORTS_SAVE ) /* Possible region hack */
GAME( 1988, chukataij, chukatai, tnzs, chukatau, tnzs_state, chukatai, ROT0, "Taito Corporation", "Chuka Taisen (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1988, tnzs, 0, tnzsb, tnzs, tnzs_state, tnzsb, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, new version) (newer PCB)", 0 )
GAME( 1988, tnzsj, tnzs, tnzsb, tnzsj, tnzs_state, tnzsb, ROT0, "Taito Corporation", "The NewZealand Story (Japan, new version) (newer PCB)", 0 )
GAME( 1988, tnzsjo, tnzs, tnzs, tnzsjo, tnzs_state, tnzs, ROT0, "Taito Corporation", "The NewZealand Story (Japan, old version) (older PCB)", 0 )
GAME( 1988, tnzso, tnzs, tnzs, tnzsop, tnzs_state, tnzs, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, old version) (older PCB)", 0 )
GAME( 1988, tnzsop, tnzs, tnzs, tnzsop, tnzs_state, tnzs, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, prototype?) (older PCB)", 0 )
GAME( 1988, tnzs, 0, tnzsb, tnzs, tnzs_state, tnzsb, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, new version) (newer PCB)", GAME_SUPPORTS_SAVE )
GAME( 1988, tnzsj, tnzs, tnzsb, tnzsj, tnzs_state, tnzsb, ROT0, "Taito Corporation", "The NewZealand Story (Japan, new version) (newer PCB)", GAME_SUPPORTS_SAVE )
GAME( 1988, tnzsjo, tnzs, tnzs, tnzsjo, tnzs_state, tnzs, ROT0, "Taito Corporation", "The NewZealand Story (Japan, old version) (older PCB)", GAME_SUPPORTS_SAVE )
GAME( 1988, tnzso, tnzs, tnzs, tnzsop, tnzs_state, tnzs, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, old version) (older PCB)", GAME_SUPPORTS_SAVE )
GAME( 1988, tnzsop, tnzs, tnzs, tnzsop, tnzs_state, tnzs, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, prototype?) (older PCB)", GAME_SUPPORTS_SAVE )
GAME( 1988, kabukiz, 0, kabukiz, kabukiz, tnzs_state, kabukiz, ROT0, "Kaneko / Taito Corporation Japan", "Kabuki-Z (World)", 0 )
GAME( 1988, kabukizj, kabukiz, kabukiz, kabukizj, tnzs_state, kabukiz, ROT0, "Kaneko / Taito Corporation", "Kabuki-Z (Japan)", 0 )
GAME( 1988, kabukiz, 0, kabukiz, kabukiz, tnzs_state, kabukiz, ROT0, "Kaneko / Taito Corporation Japan", "Kabuki-Z (World)", GAME_SUPPORTS_SAVE )
GAME( 1988, kabukizj, kabukiz, kabukiz, kabukizj, tnzs_state, kabukiz, ROT0, "Kaneko / Taito Corporation", "Kabuki-Z (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1989, insectx, 0, insectx, insectx, tnzs_state, insectx, ROT0, "Taito Corporation Japan", "Insector X (World)", 0 )
GAME( 1989, insectxj, insectx, insectx, insectxj, tnzs_state, insectx, ROT0, "Taito Corporation", "Insector X (Japan)", 0 )
GAME( 1989, insectx, 0, insectx, insectx, tnzs_state, insectx, ROT0, "Taito Corporation Japan", "Insector X (World)", GAME_SUPPORTS_SAVE )
GAME( 1989, insectxj, insectx, insectx, insectxj, tnzs_state, insectx, ROT0, "Taito Corporation", "Insector X (Japan)", GAME_SUPPORTS_SAVE )

View File

@ -25,19 +25,27 @@ class tnzs_state : public driver_device
public:
tnzs_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_subcpu(*this, "sub"),
m_mcu(*this, "mcu"),
m_maincpu(*this, "maincpu"),
m_seta001(*this, "spritegen"),
m_dac(*this, "dac"),
m_samples(*this, "samples"),
m_palette(*this, "palette"),
m_mainbank(*this, "mainbank")
{ }
/* video-related */
int m_screenflip;
/* devices */
required_device<cpu_device> m_maincpu;
optional_device<cpu_device> m_audiocpu;
optional_device<cpu_device> m_subcpu;
optional_device<upi41_cpu_device> m_mcu;
optional_device<seta001_device> m_seta001;
optional_device<dac_device> m_dac;
optional_device<samples_device> m_samples;
required_device<palette_device> m_palette;
optional_device<address_map_bank_device> m_mainbank;
/* sound-related */
INT16 *m_sampledata[MAX_SAMPLES];
@ -59,12 +67,6 @@ public:
UINT8 m_mcu_credits;
int m_bank2;
UINT8* m_ROM;
/* devices */
optional_device<cpu_device> m_audiocpu;
optional_device<cpu_device> m_subcpu;
optional_device<upi41_cpu_device> m_mcu;
DECLARE_WRITE8_MEMBER(tnzsb_sound_command_w);
DECLARE_WRITE8_MEMBER(jpopnics_subbankswitch_w);
DECLARE_READ8_MEMBER(tnzs_port1_r);
@ -86,6 +88,7 @@ public:
DECLARE_WRITE8_MEMBER(kageki_csport_w);
DECLARE_WRITE8_MEMBER(kabukiz_sound_bank_w);
DECLARE_WRITE8_MEMBER(kabukiz_sample_w);
DECLARE_WRITE_LINE_MEMBER(irqhandler);
SAMPLES_START_CB_MEMBER(kageki_init_samples);
@ -104,18 +107,14 @@ public:
DECLARE_PALETTE_INIT(arknoid2);
DECLARE_MACHINE_START(tnzs_common);
DECLARE_MACHINE_RESET(jpopnics);
UINT32 screen_update_tnzs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_tnzs(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(arknoid2_interrupt);
TIMER_CALLBACK_MEMBER(kludge_callback);
void tnzs_postload();
void mcu_reset( );
void mcu_handle_coins( int coin );
DECLARE_WRITE_LINE_MEMBER(irqhandler);
required_device<cpu_device> m_maincpu;
optional_device<seta001_device> m_seta001;
optional_device<dac_device> m_dac;
optional_device<samples_device> m_samples;
required_device<palette_device> m_palette;
optional_device<address_map_bank_device> m_mainbank;
void mcu_reset();
void mcu_handle_coins(int coin);
};

View File

@ -624,7 +624,6 @@ MACHINE_RESET_MEMBER(tnzs_state,tnzs)
break;
}
m_screenflip = 0;
m_kageki_csport_sel = 0;
m_input_select = 0;
m_mcu_readcredits = 0; // this might belong to mcu_reset
@ -633,31 +632,21 @@ MACHINE_RESET_MEMBER(tnzs_state,tnzs)
MACHINE_RESET_MEMBER(tnzs_state,jpopnics)
{
m_screenflip = 0;
m_mcu_type = -1;
}
void tnzs_state::tnzs_postload()
{
membank("subbank")->set_entry(m_bank2);
}
MACHINE_START_MEMBER(tnzs_state,tnzs_common)
{
UINT8 *SUB = memregion("sub")->base();
m_ROM = memregion("maincpu")->base();
membank("subbank")->configure_entries(0, 4, &SUB[0x08000], 0x2000);
membank("subbank")->set_entry(m_bank2);
m_bank2 = 0;
m_mainbank->set_bank(2);
save_item(NAME(m_screenflip));
save_item(NAME(m_bank2));
machine().save().register_postload(save_prepost_delegate(FUNC(tnzs_state::tnzs_postload), this));
}
MACHINE_START_MEMBER(tnzs_state,tnzs)