Previous 199869 Revisions Next

r34780 Sunday 1st February, 2015 at 08:07:26 UTC by Osso
fastfred.c: added save state support to all games except imago and imagoa (nw)
These 2 games use the galaxold starfield functions and therefore suffer from the same underlying save problem. Up to now I've not been able to identify the cause.
[src/mame/drivers]fastfred.c
[src/mame/includes]fastfred.h
[src/mame/video]fastfred.c

trunk/src/mame/drivers/fastfred.c
r243291r243292
1414#include "sound/ay8910.h"
1515
1616
17void fastfred_state::machine_start()
18{
19   save_item(NAME(m_charbank));
20   save_item(NAME(m_colorbank));
21   save_item(NAME(m_nmi_mask));
22   save_item(NAME(m_sound_nmi_mask));
23}
24
1725// This routine is a big hack, but the only way I can get the game working
1826// without knowing anything about the way the protection chip works.
1927// These values were derived based on disassembly of the code. Usually, it
r243291r243292
124132
125133MACHINE_START_MEMBER(fastfred_state,imago)
126134{
135   machine_start();
127136   m_gfxdecode->gfx(1)->set_source(m_imago_sprites);
128137}
129138
r243291r243292
10391048   m_hardware_type = 3;
10401049}
10411050
1042GAME( 1982, flyboy,   0,        fastfred, flyboy, fastfred_state,   flyboy,   ROT90, "Kaneko", "Fly-Boy", 0 )
1043GAME( 1982, flyboyb,  flyboy,   fastfred, flyboy, fastfred_state,   flyboyb,  ROT90, "bootleg", "Fly-Boy (bootleg)", 0 )
1044GAME( 1982, fastfred, flyboy,   fastfred, fastfred, fastfred_state, fastfred, ROT90, "Kaneko (Atari license)", "Fast Freddie", 0 )
1045GAME( 1983, jumpcoas, 0,        jumpcoas, jumpcoas, fastfred_state, jumpcoas, ROT90, "Kaneko", "Jump Coaster", 0 )
1046GAME( 1983, jumpcoast,jumpcoas, jumpcoas, jumpcoas, fastfred_state, jumpcoas, ROT90, "Kaneko (Taito license)", "Jump Coaster (Taito)", 0 )
1047GAME( 1983, boggy84,  0,        jumpcoas, boggy84, fastfred_state,  boggy84,  ROT90, "Kaneko", "Boggy '84", 0 )
1048GAME( 1983, boggy84b, boggy84,  jumpcoas, boggy84, fastfred_state,  boggy84b, ROT90, "bootleg (Eddie's Games)", "Boggy '84 (bootleg)", 0 )
1049GAME( 1986, redrobin, 0,        fastfred, redrobin, fastfred_state, flyboyb,  ROT90, "Elettronolo", "Red Robin", 0 )
1051GAME( 1982, flyboy,   0,        fastfred, flyboy, fastfred_state,   flyboy,   ROT90, "Kaneko", "Fly-Boy", GAME_SUPPORTS_SAVE )
1052GAME( 1982, flyboyb,  flyboy,   fastfred, flyboy, fastfred_state,   flyboyb,  ROT90, "bootleg", "Fly-Boy (bootleg)", GAME_SUPPORTS_SAVE )
1053GAME( 1982, fastfred, flyboy,   fastfred, fastfred, fastfred_state, fastfred, ROT90, "Kaneko (Atari license)", "Fast Freddie", GAME_SUPPORTS_SAVE )
1054GAME( 1983, jumpcoas, 0,        jumpcoas, jumpcoas, fastfred_state, jumpcoas, ROT90, "Kaneko", "Jump Coaster", GAME_SUPPORTS_SAVE )
1055GAME( 1983, jumpcoast,jumpcoas, jumpcoas, jumpcoas, fastfred_state, jumpcoas, ROT90, "Kaneko (Taito license)", "Jump Coaster (Taito)", GAME_SUPPORTS_SAVE )
1056GAME( 1983, boggy84,  0,        jumpcoas, boggy84, fastfred_state,  boggy84,  ROT90, "Kaneko", "Boggy '84", GAME_SUPPORTS_SAVE )
1057GAME( 1983, boggy84b, boggy84,  jumpcoas, boggy84, fastfred_state,  boggy84b, ROT90, "bootleg (Eddie's Games)", "Boggy '84 (bootleg)", GAME_SUPPORTS_SAVE )
1058GAME( 1986, redrobin, 0,        fastfred, redrobin, fastfred_state, flyboyb,  ROT90, "Elettronolo", "Red Robin", GAME_SUPPORTS_SAVE )
10501059GAME( 1984, imago,    0,        imago,    imago, fastfred_state,    imago,    ROT90, "Acom", "Imago (cocktail set)", 0 )
10511060GAME( 1983, imagoa,   imago,    imago,    imagoa, fastfred_state,   imago,    ROT90, "Acom", "Imago (no cocktail set)", 0 )
trunk/src/mame/includes/fastfred.h
r243291r243292
1212public:
1313   fastfred_state(const machine_config &mconfig, device_type type, const char *tag)
1414      : galaxold_state(mconfig, type, tag),
15         m_gfxdecode(*this, "gfxdecode"),
16         m_palette(*this, "palette"),
1517         m_videoram(*this, "videoram"),
1618         m_spriteram(*this, "spriteram"),
1719         m_attributesram(*this, "attributesram"),
1820         m_background_color(*this, "bgcolor"),
19         m_imago_fg_videoram(*this, "imago_fg_vram"),
20         m_gfxdecode(*this, "gfxdecode"),
21         m_palette(*this, "palette") { }
21         m_imago_fg_videoram(*this, "imago_fg_vram") { }
2222
23   UINT8 m_imago_sprites[0x800*3];
24   UINT16 m_imago_sprites_address;
25   UINT8 m_imago_sprites_bank;
26   int m_hardware_type;
23   required_device<gfxdecode_device> m_gfxdecode;
24   required_device<palette_device> m_palette;
25   
2726   required_shared_ptr<UINT8> m_videoram;
2827   required_shared_ptr<UINT8> m_spriteram;
2928   required_shared_ptr<UINT8> m_attributesram;
3029   optional_shared_ptr<UINT8> m_background_color;
3130   optional_shared_ptr<UINT8> m_imago_fg_videoram;
32   required_device<gfxdecode_device> m_gfxdecode;
33   required_device<palette_device> m_palette;
3431
32   int m_hardware_type;
3533   UINT16 m_charbank;
3634   UINT8 m_colorbank;
35   UINT8 m_nmi_mask;
36   UINT8 m_sound_nmi_mask;
37   UINT8 m_imago_sprites[0x800*3];
38   UINT16 m_imago_sprites_address;
39   UINT8 m_imago_sprites_bank;
40   
3741   tilemap_t *m_bg_tilemap;
3842   tilemap_t *m_fg_tilemap;
3943   tilemap_t *m_web_tilemap;
4044
41   UINT8 m_nmi_mask;
42   UINT8 m_sound_nmi_mask;
4345   DECLARE_READ8_MEMBER(fastfred_custom_io_r);
4446   DECLARE_READ8_MEMBER(flyboy_custom1_io_r);
4547   DECLARE_READ8_MEMBER(flyboy_custom2_io_r);
r243291r243292
5153   DECLARE_READ8_MEMBER(imago_sprites_offset_r);
5254   DECLARE_WRITE8_MEMBER(nmi_mask_w);
5355   DECLARE_WRITE8_MEMBER(sound_nmi_mask_w);
56   DECLARE_WRITE8_MEMBER(fastfred_videoram_w);
57   DECLARE_WRITE8_MEMBER(fastfred_attributes_w);
58   DECLARE_WRITE8_MEMBER(fastfred_charbank1_w);
59   DECLARE_WRITE8_MEMBER(fastfred_charbank2_w);
60   DECLARE_WRITE8_MEMBER(fastfred_colorbank1_w);
61   DECLARE_WRITE8_MEMBER(fastfred_colorbank2_w);
62   DECLARE_WRITE8_MEMBER(fastfred_flip_screen_x_w);
63   DECLARE_WRITE8_MEMBER(fastfred_flip_screen_y_w);
64   DECLARE_WRITE8_MEMBER(imago_fg_videoram_w);
65   DECLARE_WRITE8_MEMBER(imago_charbank_w);
66
5467   DECLARE_DRIVER_INIT(fastfred);
5568   DECLARE_DRIVER_INIT(flyboy);
5669   DECLARE_DRIVER_INIT(flyboyb);
r243291r243292
5871   DECLARE_DRIVER_INIT(boggy84);
5972   DECLARE_DRIVER_INIT(jumpcoas);
6073   DECLARE_DRIVER_INIT(boggy84b);
74
6175   TILE_GET_INFO_MEMBER(get_tile_info);
6276   TILE_GET_INFO_MEMBER(imago_get_tile_info_bg);
6377   TILE_GET_INFO_MEMBER(imago_get_tile_info_fg);
6478   TILE_GET_INFO_MEMBER(imago_get_tile_info_web);
65   DECLARE_VIDEO_START(fastfred);
79   
80   INTERRUPT_GEN_MEMBER(vblank_irq);
81   INTERRUPT_GEN_MEMBER(sound_timer_irq);
82
83   virtual void machine_start();
6684   DECLARE_PALETTE_INIT(fastfred);
6785   DECLARE_MACHINE_START(imago);
86   DECLARE_VIDEO_START(fastfred);
6887   DECLARE_VIDEO_START(imago);
88
6989   UINT32 screen_update_fastfred(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
7090   UINT32 screen_update_imago(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
71   INTERRUPT_GEN_MEMBER(vblank_irq);
72   INTERRUPT_GEN_MEMBER(sound_timer_irq);
7391   void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect);
74   DECLARE_WRITE8_MEMBER(fastfred_videoram_w);
75   DECLARE_WRITE8_MEMBER(fastfred_attributes_w);
76   DECLARE_WRITE8_MEMBER(fastfred_charbank1_w);
77   DECLARE_WRITE8_MEMBER(fastfred_charbank2_w);
78   DECLARE_WRITE8_MEMBER(fastfred_colorbank1_w);
79   DECLARE_WRITE8_MEMBER(fastfred_colorbank2_w);
80   DECLARE_WRITE8_MEMBER(fastfred_flip_screen_x_w);
81   DECLARE_WRITE8_MEMBER(fastfred_flip_screen_y_w);
82
83   DECLARE_WRITE8_MEMBER(imago_fg_videoram_w);
84   DECLARE_WRITE8_MEMBER(imago_charbank_w);
8592};
trunk/src/mame/video/fastfred.c
r243291r243292
345345   /* web colors */
346346   m_palette->set_pen_color(256+64+0,rgb_t(0x50,0x00,0x00));
347347   m_palette->set_pen_color(256+64+1,rgb_t(0x00,0x00,0x00));
348   
349   save_item(NAME(m_imago_sprites));
350   save_item(NAME(m_imago_sprites_address));
351   save_item(NAME(m_imago_sprites_bank));
352
353   // galaxold starfield related save states. Something's still missing here.
354   save_item(NAME(m_stars_on));
355   save_item(NAME(m_stars_blink_state));
356   save_item(NAME(m_timer_adjusted));
357   save_item(NAME(m_stars_colors_start));
358   save_item(NAME(m_stars_scrollpos));
359   
360   for (int i = 0; i < STAR_COUNT; i++)
361   {
362      save_item(NAME(m_stars[i].x), i);
363      save_item(NAME(m_stars[i].y), i);
364      save_item(NAME(m_stars[i].color), i);
365   }
348366}
349367
350368UINT32 fastfred_state::screen_update_imago(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team