Previous 199869 Revisions Next

r34419 Friday 16th January, 2015 at 17:16:13 UTC by Osso
stfight.c, stlforce.c, strnskil.c: added / enabled save state support (nw)
[src/mame/drivers]stfight.c stlforce.c strnskil.c
[src/mame/includes]stfight.h stlforce.h strnskil.h
[src/mame/machine]stfight.c
[src/mame/video]strnskil.c

trunk/src/mame/drivers/stfight.c
r242930r242931
247247#include "cpu/z80/z80.h"
248248#include "cpu/m6805/m6805.h"
249249#include "sound/2203intf.h"
250#include "sound/msm5205.h"
251250#include "includes/stfight.h"
252251
253252static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, stfight_state )
r242930r242931
10371036ROM_END
10381037
10391038// Note: Marked GAME_IMPERFECT_SOUND due to YM2203 clock issue
1040GAME( 1986, empcity,  0,       stfight, stfight, stfight_state, empcity, ROT0,   "Seibu Kaihatsu",                           "Empire City: 1931 (bootleg?)", GAME_IMPERFECT_SOUND )
1041GAME( 1986, empcityu, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Taito / Romstar license)", "Empire City: 1931 (US)", GAME_IMPERFECT_SOUND ) // different title logo
1042GAME( 1986, empcityj, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Taito license)",           "Empire City: 1931 (Japan)", GAME_IMPERFECT_SOUND )
1043GAME( 1986, empcityi, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Eurobed license)",         "Empire City: 1931 (Italy)", GAME_IMPERFECT_SOUND )
1044GAME( 1986, stfight,  empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Tuning license)",          "Street Fight (Germany)", GAME_IMPERFECT_SOUND )
1045GAME( 1986, stfighta, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu",                           "Street Fight (bootleg?)", GAME_IMPERFECT_SOUND )
1039GAME( 1986, empcity,  0,       stfight, stfight, stfight_state, empcity, ROT0,   "Seibu Kaihatsu",                           "Empire City: 1931 (bootleg?)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1040GAME( 1986, empcityu, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Taito / Romstar license)", "Empire City: 1931 (US)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // different title logo
1041GAME( 1986, empcityj, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Taito license)",           "Empire City: 1931 (Japan)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1042GAME( 1986, empcityi, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Eurobed license)",         "Empire City: 1931 (Italy)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1043GAME( 1986, stfight,  empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu (Tuning license)",          "Street Fight (Germany)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
1044GAME( 1986, stfighta, empcity, stfight, stfight, stfight_state, stfight, ROT0,   "Seibu Kaihatsu",                           "Street Fight (bootleg?)", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
10461045/* Cross Shooter runs on a slightly modified PCB, with a different text tilemap and gfx blobs (see also cshooter.c) */
1047GAME( 1987, cshooter,  0,      cshooter,cshooter, stfight_state, cshooter,ROT270,"Seibu Kaihatsu (Taito license)",           "Cross Shooter (not encrypted)", GAME_NOT_WORKING )
1046GAME( 1987, cshooter,  0,      cshooter,cshooter, stfight_state, cshooter,ROT270,"Seibu Kaihatsu (Taito license)",           "Cross Shooter (not encrypted)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/stlforce.c
r242930r242931
370370}
371371
372372
373GAME( 1994, stlforce, 0,        stlforce, stlforce, stlforce_state, stlforce, ROT0, "Electronic Devices Italy / Ecogames S.L. Spain", "Steel Force", 0 )
374GAME( 1995, twinbrat, 0,        twinbrat, stlforce, stlforce_state, twinbrat, ROT0, "Elettronica Video-Games S.R.L.", "Twin Brats (set 1)", 0 )
375GAME( 1995, twinbrata,twinbrat, twinbrat, stlforce, stlforce_state, twinbrat, ROT0, "Elettronica Video-Games S.R.L.", "Twin Brats (set 2)", 0 )
373GAME( 1994, stlforce, 0,        stlforce, stlforce, stlforce_state, stlforce, ROT0, "Electronic Devices Italy / Ecogames S.L. Spain", "Steel Force", GAME_SUPPORTS_SAVE )
374GAME( 1995, twinbrat, 0,        twinbrat, stlforce, stlforce_state, twinbrat, ROT0, "Elettronica Video-Games S.R.L.", "Twin Brats (set 1)", GAME_SUPPORTS_SAVE )
375GAME( 1995, twinbrata,twinbrat, twinbrat, stlforce, stlforce_state, twinbrat, ROT0, "Elettronica Video-Games S.R.L.", "Twin Brats (set 2)", GAME_SUPPORTS_SAVE )
trunk/src/mame/drivers/strnskil.c
r242930r242931
2222#include "sound/sn76496.h"
2323#include "includes/strnskil.h"
2424
25
26
27void strnskil_state::machine_start()
28{
29   save_item(NAME(m_scrl_ctrl));
30   save_item(NAME(m_irq_source));
31}
32
2533/****************************************************************************/
2634
2735READ8_MEMBER(strnskil_state::strnskil_d800_r)
r242930r242931
533541   m_maincpu->space(AS_PROGRAM).install_write_handler(0xd80d, 0xd80d, write8_delegate(FUNC(strnskil_state::protection_w),this));
534542}
535543
536GAME( 1984, strnskil, 0,        strnskil, strnskil, driver_device, 0,       ROT0, "Sun Electronics", "Strength & Skill", 0 )
537GAME( 1984, guiness,  strnskil, strnskil, strnskil, driver_device, 0,       ROT0, "Sun Electronics", "The Guiness (Japan)", 0 )
538GAME( 1984, banbam,   0,        banbam,   banbam, strnskil_state,   banbam,  ROT0, "Sun Electronics", "BanBam", GAME_UNEMULATED_PROTECTION )
539GAME( 1984, pettanp,  banbam,   strnskil, banbam, strnskil_state,   pettanp, ROT0, "Sun Electronics", "Pettan Pyuu (Japan)", GAME_UNEMULATED_PROTECTION )
544GAME( 1984, strnskil, 0,        strnskil, strnskil, driver_device, 0,       ROT0, "Sun Electronics", "Strength & Skill", GAME_SUPPORTS_SAVE )
545GAME( 1984, guiness,  strnskil, strnskil, strnskil, driver_device, 0,       ROT0, "Sun Electronics", "The Guiness (Japan)", GAME_SUPPORTS_SAVE )
546GAME( 1984, banbam,   0,        banbam,   banbam, strnskil_state,   banbam,  ROT0, "Sun Electronics", "BanBam", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
547GAME( 1984, pettanp,  banbam,   strnskil, banbam, strnskil_state,   pettanp, ROT0, "Sun Electronics", "Pettan Pyuu (Japan)", GAME_UNEMULATED_PROTECTION | GAME_SUPPORTS_SAVE )
trunk/src/mame/includes/stfight.h
r242930r242931
1010
1111   stfight_state(const machine_config &mconfig, device_type type, const char *tag)
1212      : driver_device(mconfig, type, tag),
13      m_text_char_ram(*this, "text_char_ram"),
14      m_text_attr_ram(*this, "text_attr_ram"),
15      m_tx_vram(*this, "tx_vram"),
16      m_vh_latch_ram(*this, "vh_latch_ram"),
17      m_sprite_ram(*this, "sprite_ram"),
1813      m_maincpu(*this, "maincpu"),
1914      m_audiocpu(*this, "audiocpu"),
2015      m_mcu(*this, "mcu"),
2116      m_msm(*this, "msm"),
2217      m_gfxdecode(*this, "gfxdecode"),
23      m_palette(*this, "palette") { }
18      m_palette(*this, "palette"),
19      m_text_char_ram(*this, "text_char_ram"),
20      m_text_attr_ram(*this, "text_attr_ram"),
21      m_tx_vram(*this, "tx_vram"),
22      m_vh_latch_ram(*this, "vh_latch_ram"),
23      m_sprite_ram(*this, "sprite_ram") { }
2424
25   optional_shared_ptr<UINT8> m_text_char_ram;
26   optional_shared_ptr<UINT8> m_text_attr_ram;
27   optional_shared_ptr<UINT8> m_tx_vram;
28   required_shared_ptr<UINT8> m_vh_latch_ram;
29   required_shared_ptr<UINT8> m_sprite_ram;
3025   required_device<cpu_device> m_maincpu;
3126   required_device<cpu_device> m_audiocpu;
3227   required_device<cpu_device> m_mcu;
3328   required_device<msm5205_device> m_msm;
3429   required_device<gfxdecode_device> m_gfxdecode;
3530   required_device<palette_device> m_palette;
31   
32   optional_shared_ptr<UINT8> m_text_char_ram;
33   optional_shared_ptr<UINT8> m_text_attr_ram;
34   optional_shared_ptr<UINT8> m_tx_vram;
35   required_shared_ptr<UINT8> m_vh_latch_ram;
36   required_shared_ptr<UINT8> m_sprite_ram;
3637
3738   UINT8 *m_decrypt;
3839   UINT8 m_fm_data;
r242930r242931
7980
8081   DECLARE_VIDEO_START(stfight);
8182   DECLARE_VIDEO_START(cshooter);
83   virtual void machine_start();
8284   virtual void machine_reset();
8385   DECLARE_PALETTE_INIT(stfight);
8486   UINT32 screen_update_stfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
r242930r242931
106108   UINT8 m_portB_out, m_portB_in;
107109   UINT8 m_portC_out, m_portC_in;
108110   UINT8 m_ddrA, m_ddrB, m_ddrC;
109   UINT8 m_from_main, m_main_sent;
110111
111112protected:
112113   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
trunk/src/mame/includes/stlforce.h
r242930r242931
66public:
77   stlforce_state(const machine_config &mconfig, device_type type, const char *tag)
88      : driver_device(mconfig, type, tag),
9      m_maincpu(*this, "maincpu"),
10      m_oki(*this, "oki"),
11      m_eeprom(*this, "eeprom"),
12      m_gfxdecode(*this, "gfxdecode"),
13      m_palette(*this, "palette"),
914      m_bg_videoram(*this, "bg_videoram"),
1015      m_mlow_videoram(*this, "mlow_videoram"),
1116      m_mhigh_videoram(*this, "mhigh_videoram"),
r242930r242931
1419      m_mlow_scrollram(*this, "mlow_scrollram"),
1520      m_mhigh_scrollram(*this, "mhigh_scrollram"),
1621      m_vidattrram(*this, "vidattrram"),
17      m_spriteram(*this, "spriteram"),
18      m_maincpu(*this, "maincpu"),
19      m_oki(*this, "oki"),
20      m_eeprom(*this, "eeprom"),
21      m_gfxdecode(*this, "gfxdecode"),
22      m_palette(*this, "palette") { }
22      m_spriteram(*this, "spriteram") { }
2323
24   tilemap_t *m_bg_tilemap;
25   tilemap_t *m_mlow_tilemap;
26   tilemap_t *m_mhigh_tilemap;
27   tilemap_t *m_tx_tilemap;
24   required_device<cpu_device> m_maincpu;
25   required_device<okim6295_device> m_oki;
26   required_device<eeprom_serial_93cxx_device> m_eeprom;
27   required_device<gfxdecode_device> m_gfxdecode;
28   required_device<palette_device> m_palette;
2829
2930   required_shared_ptr<UINT16> m_bg_videoram;
3031   required_shared_ptr<UINT16> m_mlow_videoram;
r242930r242931
3435   required_shared_ptr<UINT16> m_mlow_scrollram;
3536   required_shared_ptr<UINT16> m_mhigh_scrollram;
3637   required_shared_ptr<UINT16> m_vidattrram;
37
3838   required_shared_ptr<UINT16> m_spriteram;
39   
40   tilemap_t *m_bg_tilemap;
41   tilemap_t *m_mlow_tilemap;
42   tilemap_t *m_mhigh_tilemap;
43   tilemap_t *m_tx_tilemap;
3944
4045   int m_sprxoffs;
46   
4147   DECLARE_WRITE16_MEMBER(stlforce_bg_videoram_w);
4248   DECLARE_WRITE16_MEMBER(stlforce_mlow_videoram_w);
4349   DECLARE_WRITE16_MEMBER(stlforce_mhigh_videoram_w);
4450   DECLARE_WRITE16_MEMBER(stlforce_tx_videoram_w);
4551   DECLARE_WRITE16_MEMBER(eeprom_w);
4652   DECLARE_WRITE16_MEMBER(oki_bank_w);
53   
4754   DECLARE_DRIVER_INIT(twinbrat);
4855   DECLARE_DRIVER_INIT(stlforce);
56   
4957   TILE_GET_INFO_MEMBER(get_stlforce_bg_tile_info);
5058   TILE_GET_INFO_MEMBER(get_stlforce_mlow_tile_info);
5159   TILE_GET_INFO_MEMBER(get_stlforce_mhigh_tile_info);
5260   TILE_GET_INFO_MEMBER(get_stlforce_tx_tile_info);
61   
5362   virtual void video_start();
5463   UINT32 screen_update_stlforce(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
5564   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect );
56   required_device<cpu_device> m_maincpu;
57   required_device<okim6295_device> m_oki;
58   required_device<eeprom_serial_93cxx_device> m_eeprom;
59   required_device<gfxdecode_device> m_gfxdecode;
60   required_device<palette_device> m_palette;
6165};
trunk/src/mame/includes/strnskil.h
r242930r242931
55      : driver_device(mconfig, type, tag),
66      m_maincpu(*this,"maincpu"),
77      m_subcpu(*this,"sub"),
8      m_gfxdecode(*this, "gfxdecode"),
9      m_palette(*this, "palette"),
810      m_videoram(*this, "videoram"),
911      m_xscroll(*this, "xscroll"),
10      m_spriteram(*this, "spriteram"),
11      m_gfxdecode(*this, "gfxdecode"),
12      m_palette(*this, "palette") { }
12      m_spriteram(*this, "spriteram") { }
1313
1414   required_device<cpu_device> m_maincpu;
1515   required_device<cpu_device> m_subcpu;
16   required_device<gfxdecode_device> m_gfxdecode;
17   required_device<palette_device> m_palette;
18   
1619   required_shared_ptr<UINT8> m_videoram;
1720   required_shared_ptr<UINT8> m_xscroll;
1821   required_shared_ptr<UINT8> m_spriteram;
19   required_device<gfxdecode_device> m_gfxdecode;
20   required_device<palette_device> m_palette;
2122
2223   UINT8 m_scrl_ctrl;
2324   tilemap_t *m_bg_tilemap;
2425   UINT8 m_irq_source;
26   
27   TIMER_DEVICE_CALLBACK_MEMBER(strnskil_irq);
2528
2629   DECLARE_READ8_MEMBER(strnskil_d800_r);
2730   DECLARE_READ8_MEMBER(pettanp_protection_r);
r242930r242931
2932   DECLARE_WRITE8_MEMBER(protection_w);
3033   DECLARE_WRITE8_MEMBER(strnskil_videoram_w);
3134   DECLARE_WRITE8_MEMBER(strnskil_scrl_ctrl_w);
35   
3236   DECLARE_DRIVER_INIT(banbam);
3337   DECLARE_DRIVER_INIT(pettanp);
38   
3439   TILE_GET_INFO_MEMBER(get_bg_tile_info);
40   
41   virtual void machine_start();   
3542   virtual void video_start();
3643   DECLARE_PALETTE_INIT(strnskil);
3744   UINT32 screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
38   TIMER_DEVICE_CALLBACK_MEMBER(strnskil_irq);
3945   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
4046};
trunk/src/mame/machine/stfight.c
r242930r242931
11/***************************************************************************
22
3  machine.c
3  stfight.c
44
55  Functions to emulate general aspects of the machine (RAM, ROM, interrupts,
66  I/O ports)
r242930r242931
6363            ( ( ( src ^ A ) >> 1 ) & 0x08 ) |
6464            ( ~( ( src >> 6 ) ^ A ) & 0x01 );
6565   }
66   
6667}
6768
6869DRIVER_INIT_MEMBER(stfight_state,stfight)
r242930r242931
7475{
7576}
7677
78void stfight_state::machine_start()
79{
80   save_item(NAME(m_fm_data));
81   save_item(NAME(m_cpu_to_mcu_data));
82   save_item(NAME(m_cpu_to_mcu_empty));
83   save_item(NAME(m_adpcm_data_offs));
84   save_item(NAME(m_adpcm_nibble));
85   save_item(NAME(m_adpcm_reset));
86   save_item(NAME(m_coin_state));
87   save_item(NAME(m_sprite_base));
88   save_item(NAME(m_portA_out));
89   save_item(NAME(m_portA_in));
90   save_item(NAME(m_portB_out));
91   save_item(NAME(m_portB_in));
92   save_item(NAME(m_portC_out));
93   save_item(NAME(m_portC_in));
94   save_item(NAME(m_ddrA));
95   save_item(NAME(m_ddrB));
96   save_item(NAME(m_ddrC));
97}
98
7799void stfight_state::machine_reset()
78100{
79101   m_fm_data = 0;
trunk/src/mame/video/strnskil.c
r242930r242931
4141
4242WRITE8_MEMBER(strnskil_state::strnskil_videoram_w)
4343{
44   UINT8 *videoram = m_videoram;
45   videoram[offset] = data;
44   m_videoram[offset] = data;
4645   m_bg_tilemap->mark_tile_dirty(offset / 2);
4746}
4847
r242930r242931
5958
6059TILE_GET_INFO_MEMBER(strnskil_state::get_bg_tile_info)
6160{
62   UINT8 *videoram = m_videoram;
63   int attr = videoram[tile_index * 2];
64   int code = videoram[(tile_index * 2) + 1] + ((attr & 0x60) << 3);
61   int attr = m_videoram[tile_index * 2];
62   int code = m_videoram[(tile_index * 2) + 1] + ((attr & 0x60) << 3);
6563   int color = (attr & 0x1f) | ((attr & 0x80) >> 2);
6664
6765   SET_TILE_INFO_MEMBER(0, code, color, 0);
r242930r242931
7775
7876void strnskil_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect)
7977{
80   UINT8 *spriteram = m_spriteram;
8178   int offs;
8279
8380   for (offs = 0x60; offs < 0x100; offs += 4)
8481   {
85      int code = spriteram[offs + 1];
86      int color = spriteram[offs + 2] & 0x3f;
82      int code = m_spriteram[offs + 1];
83      int color = m_spriteram[offs + 2] & 0x3f;
8784      int flipx = flip_screen_x();
8885      int flipy = flip_screen_y();
8986
90      int sx = spriteram[offs + 3];
91      int sy = spriteram[offs];
87      int sx = m_spriteram[offs + 3];
88      int sy = m_spriteram[offs];
9289      int px, py;
9390
9491      if (flip_screen())
r242930r242931
118115
119116UINT32 strnskil_state::screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
120117{
121   int row;
122118   const UINT8 *usr1 = memregion("user1")->base();
123119
124   for (row = 0; row < 32; row++)
120   for (int row = 0; row < 32; row++)
125121   {
126122      if (m_scrl_ctrl != 0x07)
127123      {


Previous 199869 Revisions Next


© 1997-2024 The MAME Team