Previous 199869 Revisions Next

r35020 Saturday 14th February, 2015 at 12:01:40 UTC by Osso
snowbros.c: added save state support (nw)
[src/mame/drivers]snowbros.c
[src/mame/includes]snowbros.h

trunk/src/mame/drivers/snowbros.c
r243531r243532
450450   }
451451}
452452
453void snowbros_state::sb3_play_sound (okim6295_device *oki, int data)
453void snowbros_state::sb3_play_sound (int data)
454454{
455   int status = oki->read_status();
455   int status = m_oki->read_status();
456456
457457   if ((status&0x01)==0x00)
458458   {
459      oki->write_command(0x80|data);
460      oki->write_command(0x00|0x12);
459      m_oki->write_command(0x80|data);
460      m_oki->write_command(0x00|0x12);
461461   }
462462   else if ((status&0x02)==0x00)
463463   {
464      oki->write_command(0x80|data);
465      oki->write_command(0x00|0x22);
464      m_oki->write_command(0x80|data);
465      m_oki->write_command(0x00|0x22);
466466   }
467467   else if ((status&0x04)==0x00)
468468   {
469      oki->write_command(0x80|data);
470      oki->write_command(0x00|0x42);
469      m_oki->write_command(0x80|data);
470      m_oki->write_command(0x00|0x42);
471471   }
472472
473473
r243531r243532
486486
487487      if (data <= 0x21)
488488      {
489         sb3_play_sound(m_oki, data);
489         sb3_play_sound(data);
490490      }
491491
492492      if (data>=0x22 && data<=0x31)
r243531r243532
496496
497497      if ((data>=0x30) && (data<=0x51))
498498      {
499         sb3_play_sound(m_oki, data-0x30);
499         sb3_play_sound(data-0x30);
500500      }
501501
502502      if (data>=0x52 && data<=0x5f)
r243531r243532
28532853         buffer[i] = src[BITSWAP24(i,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,3,4,1,2,0)];
28542854      memcpy(src,buffer,len);
28552855   }
2856   
2857   save_item(NAME(m_sb3_music_is_playing));
2858   save_item(NAME(m_sb3_music));
28562859}
28572860
28582861READ16_MEMBER(snowbros_state::_3in1_read)
r243531r243532
29132916   m_maincpu->space(AS_PROGRAM).install_read_handler(0x500006, 0x500007, read16_delegate(FUNC(snowbros_state::toto_read),this));
29142917}
29152918
2919DRIVER_INIT_MEMBER(snowbros_state, hyperpac)
2920{
2921   save_item(NAME(m_semicom_prot_offset));
2922}
29162923
29172924
2918GAME( 1990, snowbros,  0,        snowbros, snowbros, driver_device, 0, ROT0, "Toaplan",                        "Snow Bros. - Nick & Tom (set 1)", 0 )
2919GAME( 1990, snowbrosa, snowbros, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan",                        "Snow Bros. - Nick & Tom (set 2)", 0 )
2920GAME( 1990, snowbrosb, snowbros, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan",                        "Snow Bros. - Nick & Tom (set 3)", 0 )
2921GAME( 1990, snowbrosc, snowbros, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan",                        "Snow Bros. - Nick & Tom (set 4)", 0 )
2922GAME( 1990, snowbrosj, snowbros, snowbros, snowbroj, driver_device, 0, ROT0, "Toaplan",                        "Snow Bros. - Nick & Tom (Japan)", 0 )
2923GAME( 1990, snowbrosd, snowbros, snowbros, snowbroj, driver_device, 0, ROT0, "Toaplan (Dooyong license)",      "Snow Bros. - Nick & Tom (Dooyong license)", 0 )
2924GAME( 1990, wintbob,   snowbros, wintbob,  snowbros, driver_device, 0, ROT0, "bootleg (Sakowa Project Korea)", "The Winter Bobble (bootleg of Snow Bros.)", 0 )
2925GAME( 1990, snowbroswb,snowbros, wintbob,  snowbros, driver_device, 0, ROT0, "bootleg",                        "Snow Bros. - Nick & Tom (The Winter Bobble hardware bootleg)", 0 ) // this was probably unhacked back from the more common Winter Bobble to make it look more original
2925GAME( 1990, snowbros,  0,        snowbros, snowbros, driver_device, 0, ROT0, "Toaplan",                        "Snow Bros. - Nick & Tom (set 1)", GAME_SUPPORTS_SAVE )
2926GAME( 1990, snowbrosa, snowbros, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan",                        "Snow Bros. - Nick & Tom (set 2)", GAME_SUPPORTS_SAVE )
2927GAME( 1990, snowbrosb, snowbros, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan",                        "Snow Bros. - Nick & Tom (set 3)", GAME_SUPPORTS_SAVE )
2928GAME( 1990, snowbrosc, snowbros, snowbros, snowbros, driver_device, 0, ROT0, "Toaplan",                        "Snow Bros. - Nick & Tom (set 4)", GAME_SUPPORTS_SAVE )
2929GAME( 1990, snowbrosj, snowbros, snowbros, snowbroj, driver_device, 0, ROT0, "Toaplan",                        "Snow Bros. - Nick & Tom (Japan)", GAME_SUPPORTS_SAVE )
2930GAME( 1990, snowbrosd, snowbros, snowbros, snowbroj, driver_device, 0, ROT0, "Toaplan (Dooyong license)",      "Snow Bros. - Nick & Tom (Dooyong license)", GAME_SUPPORTS_SAVE )
2931GAME( 1990, wintbob,   snowbros, wintbob,  snowbros, driver_device, 0, ROT0, "bootleg (Sakowa Project Korea)", "The Winter Bobble (bootleg of Snow Bros.)", GAME_SUPPORTS_SAVE )
2932GAME( 1990, snowbroswb,snowbros, wintbob,  snowbros, driver_device, 0, ROT0, "bootleg",                        "Snow Bros. - Nick & Tom (The Winter Bobble hardware bootleg)", GAME_SUPPORTS_SAVE ) // this was probably unhacked back from the more common Winter Bobble to make it look more original
29262933
2927GAME( 1996, toto,      0,        snowbros, snowbros, snowbros_state, toto, ROT0, "SoftClub",                    "Come Back Toto", 0 ) // modified from 'snowbros' code
2934GAME( 1996, toto,      0,        snowbros, snowbros, snowbros_state, toto, ROT0, "SoftClub",                    "Come Back Toto", GAME_SUPPORTS_SAVE ) // modified from 'snowbros' code
29282935
29292936// none of the games below are on genuine SnowBros hardware, but they clone the functionality of it.
29302937
29312938// SemiCom / Jeil titles are protected, a dumb MCU copies code into RAM at startup, some also check for a specific return value from an address on startup.
2932GAME( 1993, finalttr, 0,        finalttr,     finalttr, driver_device,  0,        ROT0, "Jeil Computer System", "Final Tetris", 0 )
2933GAME( 1995, hyperpac, 0,        semicom_mcu,  hyperpac, driver_device,  0,        ROT0, "SemiCom",              "Hyper Pacman", 0 )
2934GAME( 1995, hyperpacb,hyperpac, semicom,      hyperpac, driver_device,  0,        ROT0, "bootleg",              "Hyper Pacman (bootleg)", 0 )
2935GAME( 1996, cookbib2, 0,        semiprot,     cookbib2, snowbros_state, cookbib2, ROT0, "SemiCom",              "Cookie & Bibi 2", 0 )
2936GAME( 1996, toppyrap, 0,        semiprot,     toppyrap, driver_device,  0,        ROT0, "SemiCom",              "Toppy & Rappy", 0 )
2937GAME( 1997, cookbib3, 0,        semiprot,     cookbib3, snowbros_state, cookbib3, ROT0, "SemiCom",              "Cookie & Bibi 3", 0 )
2938GAME( 1997, 3in1semi, 0,        semiprot,     moremore, snowbros_state, 3in1semi, ROT0, "SemiCom",              "XESS - The New Revolution (SemiCom 3-in-1)", 0 )
2939GAME( 1997, twinkle,  0,        semiprot,     twinkle,  driver_device,  0,        ROT0, "SemiCom",              "Twinkle", 0 )
2940GAME( 1997, pzlbreak, 0,        semiprot,     pzlbreak, snowbros_state, pzlbreak, ROT0, "SemiCom",              "Puzzle Break", 0 )
2941GAME( 1999, moremore, 0,        semiprot,     moremore, snowbros_state, moremorp, ROT0, "SemiCom / Exit",       "More More", 0 )
2942GAME( 1999, moremorp, 0,        semiprot,     moremore, snowbros_state, moremorp, ROT0, "SemiCom / Exit",       "More More Plus", 0 )
2943GAME( 1997, suhosong, 0,        semiprot,     suhosong, driver_device,  0,        ROT0, "SemiCom",              "Su Ho Seong", 0 )
2939GAME( 1993, finalttr, 0,        finalttr,     finalttr, driver_device,  0,        ROT0, "Jeil Computer System", "Final Tetris", GAME_SUPPORTS_SAVE )
2940GAME( 1995, hyperpac, 0,        semicom_mcu,  hyperpac, snowbros_state, hyperpac, ROT0, "SemiCom",              "Hyper Pacman", GAME_SUPPORTS_SAVE )
2941GAME( 1995, hyperpacb,hyperpac, semicom,      hyperpac, driver_device,  0,        ROT0, "bootleg",              "Hyper Pacman (bootleg)", GAME_SUPPORTS_SAVE )
2942GAME( 1996, cookbib2, 0,        semiprot,     cookbib2, snowbros_state, cookbib2, ROT0, "SemiCom",              "Cookie & Bibi 2", GAME_SUPPORTS_SAVE )
2943GAME( 1996, toppyrap, 0,        semiprot,     toppyrap, driver_device,  0,        ROT0, "SemiCom",              "Toppy & Rappy", GAME_SUPPORTS_SAVE )
2944GAME( 1997, cookbib3, 0,        semiprot,     cookbib3, snowbros_state, cookbib3, ROT0, "SemiCom",              "Cookie & Bibi 3", GAME_SUPPORTS_SAVE )
2945GAME( 1997, 3in1semi, 0,        semiprot,     moremore, snowbros_state, 3in1semi, ROT0, "SemiCom",              "XESS - The New Revolution (SemiCom 3-in-1)", GAME_SUPPORTS_SAVE )
2946GAME( 1997, twinkle,  0,        semiprot,     twinkle,  driver_device,  0,        ROT0, "SemiCom",              "Twinkle", GAME_SUPPORTS_SAVE )
2947GAME( 1997, pzlbreak, 0,        semiprot,     pzlbreak, snowbros_state, pzlbreak, ROT0, "SemiCom",              "Puzzle Break", GAME_SUPPORTS_SAVE )
2948GAME( 1999, moremore, 0,        semiprot,     moremore, snowbros_state, moremorp, ROT0, "SemiCom / Exit",       "More More", GAME_SUPPORTS_SAVE )
2949GAME( 1999, moremorp, 0,        semiprot,     moremore, snowbros_state, moremorp, ROT0, "SemiCom / Exit",       "More More Plus", GAME_SUPPORTS_SAVE )
2950GAME( 1997, suhosong, 0,        semiprot,     suhosong, driver_device,  0,        ROT0, "SemiCom",              "Su Ho Seong", GAME_SUPPORTS_SAVE )
29442951// This is very similar to the SemiCom titles, but unprotected.
2945GAME( 2002, 4in1boot, 0,        _4in1,    4in1boot, snowbros_state, 4in1boot, ROT0, "K1 Soft", "Puzzle King (PacMan 2, Tetris, HyperMan 2, Snow Bros.)" , 0)
2952GAME( 2002, 4in1boot, 0,        _4in1,    4in1boot, snowbros_state, 4in1boot, ROT0, "K1 Soft", "Puzzle King (PacMan 2, Tetris, HyperMan 2, Snow Bros.)" , GAME_SUPPORTS_SAVE )
29462953
2947GAME( 1995, honeydol, 0,        honeydol, honeydol, driver_device, 0, ROT0, "Barko Corp.", "Honey Dolls", 0 ) // based on snowbros code..
2954GAME( 1995, honeydol, 0,        honeydol, honeydol, driver_device, 0, ROT0, "Barko Corp.", "Honey Dolls", GAME_SUPPORTS_SAVE ) // based on snowbros code..
29482955
2949GAME( 1995, twinadv,  0,        twinadv,  twinadv, driver_device,  0, ROT0, "Barko Corp.", "Twin Adventure (World)", 0 )
2950GAME( 1995, twinadvk, twinadv,  twinadv,  twinadv, driver_device,  0, ROT0, "Barko Corp.", "Twin Adventure (Korea)", 0 )
2956GAME( 1995, twinadv,  0,        twinadv,  twinadv, driver_device,  0, ROT0, "Barko Corp.", "Twin Adventure (World)", GAME_SUPPORTS_SAVE )
2957GAME( 1995, twinadvk, twinadv,  twinadv,  twinadv, driver_device,  0, ROT0, "Barko Corp.", "Twin Adventure (Korea)", GAME_SUPPORTS_SAVE )
29512958
29522959// The Korean games database shows an earlier version of this called Ball Boy with a different title screen to the version of Ball Boy we have
29532960// http://mamedev.emulab.it/undumped/images/Ballboy.jpg
29542961// it is possible this 'ball boy' is the original bootleg, with snwobro3 being a hack of that, and the ballboy set we have a further hack of that
29552962// there is also a later 2004 version with 3 player support
29562963// these use an MCU to drive the sound
2957GAME( 2002, snowbro3, 0,        snowbro3, snowbroj, snowbros_state, snowbro3, ROT0, "Syrmex",  "Snow Brothers 3 - Magical Adventure", GAME_IMPERFECT_SOUND ) // hacked from SnowBros code but released as an original game
2958GAME( 2003, ballboy,  snowbro3, snowbro3, snowbroj, snowbros_state, snowbro3, ROT0, "bootleg", "Ball Boy", GAME_IMPERFECT_SOUND )
2964GAME( 2002, snowbro3, 0,        snowbro3, snowbroj, snowbros_state, snowbro3, ROT0, "Syrmex",  "Snow Brothers 3 - Magical Adventure", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE ) // hacked from SnowBros code but released as an original game
2965GAME( 2003, ballboy,  snowbro3, snowbro3, snowbroj, snowbros_state, snowbro3, ROT0, "bootleg", "Ball Boy", GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
trunk/src/mame/includes/snowbros.h
r243531r243532
1010      m_maincpu(*this,"maincpu"),
1111      m_soundcpu(*this, "soundcpu"),
1212      m_oki(*this, "oki"),
13      m_gfxdecode(*this, "gfxdecode"),
14      m_palette(*this, "palette"),
1315      m_pandora(*this, "pandora"),
1416      m_hyperpac_ram(*this, "hyperpac_ram"),
15      m_bootleg_spriteram16(*this, "spriteram16b"),
16      m_gfxdecode(*this, "gfxdecode"),
17      m_palette(*this, "palette")
17      m_bootleg_spriteram16(*this, "spriteram16b")
1818      { }
1919
2020   required_device<cpu_device> m_maincpu;
2121   optional_device<cpu_device> m_soundcpu;
2222   optional_device<okim6295_device> m_oki;
23   required_device<gfxdecode_device> m_gfxdecode;
24   required_device<palette_device> m_palette;
25
2326   optional_device<kaneko_pandora_device> m_pandora;
2427   optional_shared_ptr<UINT16> m_hyperpac_ram;
2528   optional_shared_ptr<UINT16> m_bootleg_spriteram16;
26   required_device<gfxdecode_device> m_gfxdecode;
27   required_device<palette_device> m_palette;
28
29   
2930   int m_sb3_music_is_playing;
3031   int m_sb3_music;
3132   UINT8 m_semicom_prot_offset;
32   UINT8 *m_spriteram;
3333
3434   DECLARE_WRITE16_MEMBER(snowbros_flipscreen_w);
3535   DECLARE_WRITE16_MEMBER(snowbros_irq4_ack_w);
r243531r243532
4848   DECLARE_READ16_MEMBER(cookbib3_read);
4949   DECLARE_WRITE8_MEMBER(twinadv_oki_bank_w);
5050   DECLARE_WRITE16_MEMBER(sb3_sound_w);
51   DECLARE_READ16_MEMBER(toto_read);
52   
5153   DECLARE_DRIVER_INIT(pzlbreak);
5254   DECLARE_DRIVER_INIT(moremorp);
5355   DECLARE_DRIVER_INIT(snowbro3);
r243531r243532
5658   DECLARE_DRIVER_INIT(3in1semi);
5759   DECLARE_DRIVER_INIT(cookbib2);
5860   DECLARE_DRIVER_INIT(toto);
59   DECLARE_READ16_MEMBER(toto_read);
61   DECLARE_DRIVER_INIT(hyperpac);
6062   DECLARE_MACHINE_RESET(semiprot);
6163   DECLARE_MACHINE_RESET(finalttr);
64   
6265   UINT32 screen_update_snowbros(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6366   UINT32 screen_update_honeydol(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6467   UINT32 screen_update_twinadv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6568   UINT32 screen_update_snowbro3(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6669   UINT32 screen_update_wintbob(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
6770   void screen_eof_snowbros(screen_device &screen, bool state);
71   
6872   TIMER_DEVICE_CALLBACK_MEMBER(snowbros_irq);
6973   TIMER_DEVICE_CALLBACK_MEMBER(snowbros3_irq);
74   
7075   void sb3_play_music(int data);
71   void sb3_play_sound (okim6295_device *oki, int data);
76   void sb3_play_sound(int data);
7277};


Previous 199869 Revisions Next


© 1997-2024 The MAME Team