Previous 199869 Revisions Next

r39981 Monday 27th July, 2015 at 18:23:31 UTC by Osso
photon2.c: added save state support (nw)
[src/mame/drivers]photon2.c

trunk/src/mame/drivers/photon2.c
r248492r248493
2121   photon2_state(const machine_config &mconfig, device_type type, const char *tag)
2222      : driver_device(mconfig, type, tag),
2323      m_maincpu(*this,"maincpu"),
24      m_spectrum_video_ram(*this, "spectrum_vram"),
25      m_speaker(*this, "speaker"){ }
24      m_speaker(*this, "speaker"),
25      m_spectrum_video_ram(*this, "spectrum_vram") { }
2626
2727   required_device<cpu_device> m_maincpu;
28   required_device<speaker_sound_device> m_speaker;
29
2830   required_shared_ptr<UINT8> m_spectrum_video_ram;
31
2932   int m_spectrum_frame_number;
3033   int m_spectrum_flash_invert;
3134   UINT8 m_spectrum_port_fe;
3235   UINT8 m_nmi_enable;
3336
34   DECLARE_WRITE8_MEMBER(photon2_membank_w);
35   DECLARE_READ8_MEMBER(photon2_fe_r);
36   DECLARE_WRITE8_MEMBER(photon2_fe_w);
37   DECLARE_WRITE8_MEMBER(photon2_misc_w);
38   virtual void machine_reset();
37   DECLARE_WRITE8_MEMBER(membank_w);
38   DECLARE_READ8_MEMBER(fe_r);
39   DECLARE_WRITE8_MEMBER(fe_w);
40   DECLARE_WRITE8_MEMBER(misc_w);
41
42   virtual void machine_start();
3943   virtual void video_start();
4044   DECLARE_PALETTE_INIT(photon2);
45
4146   UINT32 screen_update_spectrum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4247   void screen_eof_spectrum(screen_device &screen, bool state);
48
4349   TIMER_DEVICE_CALLBACK_MEMBER(spec_interrupt_hack);
44   required_device<speaker_sound_device> m_speaker;
4550};
4651
4752
r248492r248493
100105{
101106   m_spectrum_frame_number = 0;
102107   m_spectrum_flash_invert = 0;
108   
109   save_item(NAME(m_spectrum_frame_number));
110   save_item(NAME(m_spectrum_flash_invert));
111   save_item(NAME(m_spectrum_port_fe));
103112}
104113
105114#if 0
r248492r248493
187196 *
188197 *************************************/
189198
190WRITE8_MEMBER(photon2_state::photon2_membank_w)
199WRITE8_MEMBER(photon2_state::membank_w)
191200{
192201   int bank = 0;
193202   if (data == 0)
r248492r248493
207216      logerror( "Unknown banking write: %02X\n", data);
208217   }
209218
210   membank("bank1")->set_base(memregion("maincpu")->base() + 0x4000*bank );
219   membank("mainbank")->set_entry(bank);
211220}
212221
213READ8_MEMBER(photon2_state::photon2_fe_r)
222READ8_MEMBER(photon2_state::fe_r)
214223{
215224   return 0xff;
216225}
217226
218WRITE8_MEMBER(photon2_state::photon2_fe_w)
227WRITE8_MEMBER(photon2_state::fe_w)
219228{
220229   m_spectrum_port_fe = data;
221230   m_speaker->level_w(BIT(data,4));
222231}
223232
224WRITE8_MEMBER(photon2_state::photon2_misc_w)
233WRITE8_MEMBER(photon2_state::misc_w)
225234{
226235   m_nmi_enable = !BIT(data,5);
227236}
r248492r248493
233242 *************************************/
234243
235244static ADDRESS_MAP_START (spectrum_mem, AS_PROGRAM, 8, photon2_state )
236   AM_RANGE(0x0000, 0x3fff) AM_ROMBANK("bank1")
245   AM_RANGE(0x0000, 0x3fff) AM_ROMBANK("mainbank")
237246   AM_RANGE(0x4000, 0x5aff) AM_RAM AM_SHARE("spectrum_vram")
238247   AM_RANGE(0x5b00, 0xffff) AM_RAM
239248ADDRESS_MAP_END
r248492r248493
241250static ADDRESS_MAP_START (spectrum_io, AS_IO, 8, photon2_state )
242251   ADDRESS_MAP_GLOBAL_MASK(0xff)
243252   AM_RANGE(0x1f, 0x1f) AM_READ_PORT("JOY")
244   AM_RANGE(0x5b, 0x5b) AM_READ_PORT("COIN") AM_WRITE(photon2_misc_w)
245   AM_RANGE(0x7a, 0x7a) AM_WRITE(photon2_membank_w)
253   AM_RANGE(0x5b, 0x5b) AM_READ_PORT("COIN") AM_WRITE(misc_w)
254   AM_RANGE(0x7a, 0x7a) AM_WRITE(membank_w)
246255   AM_RANGE(0x7b, 0x7b) AM_WRITENOP // unknown write
247   AM_RANGE(0x7e, 0x7e) AM_WRITE(photon2_membank_w)
248   AM_RANGE(0xfe, 0xfe) AM_READWRITE(photon2_fe_r, photon2_fe_w)
256   AM_RANGE(0x7e, 0x7e) AM_WRITE(membank_w)
257   AM_RANGE(0xfe, 0xfe) AM_READWRITE(fe_r, fe_w)
249258ADDRESS_MAP_END
250259
251260/*************************************
r248492r248493
316325   }
317326}
318327
319void photon2_state::machine_reset()
328void photon2_state::machine_start()
320329{
321   membank("bank1")->set_base(memregion("maincpu")->base());
330   membank("mainbank")->configure_entries(0, 4, memregion("maincpu")->base(), 0x4000);
331   membank("mainbank")->set_entry(0);
332   
333   save_item(NAME(m_nmi_enable));
322334}
323335
324336static MACHINE_CONFIG_START( photon2, photon2_state )
r248492r248493
383395   ROM_LOAD( "brod13.bin", 0xa000, 0x2000, CRC(1177cd17) SHA1(58c5c09a7b857ce6311339c4d0f4d8c1a7e232a3) )
384396ROM_END
385397
386GAME( 19??,  kok,   0,      photon2, photon2, driver_device, 0, ROT0, "bootleg", "Povar / Sobrat' Buran / Agroprom (Arcade multi-game bootleg of ZX Spectrum 'Cookie', 'Jetpac' & 'Pssst')", 0 ) // originals (c)1983 ACG / Ultimate
387GAME( 19??,  black, 0,      photon2, black, driver_device,   0, ROT0, "bootleg", "Czernyj Korabl (Arcade bootleg of ZX Spectrum 'Blackbeard')", 0 ) // original (c)1988 Toposoft
388GAME( 19??,  brod,  0,      photon2, black, driver_device,   0, ROT0, "bootleg", "Brodjaga (Arcade bootleg of ZX Spectrum 'Inspector Gadget and the Circus of Fear')", 0 ) // original (c)1987 BEAM software
398GAME( 19??,  kok,   0,      photon2, photon2, driver_device, 0, ROT0, "bootleg", "Povar / Sobrat' Buran / Agroprom (Arcade multi-game bootleg of ZX Spectrum 'Cookie', 'Jetpac' & 'Pssst')", GAME_SUPPORTS_SAVE ) // originals (c)1983 ACG / Ultimate
399GAME( 19??,  black, 0,      photon2, black, driver_device,   0, ROT0, "bootleg", "Czernyj Korabl (Arcade bootleg of ZX Spectrum 'Blackbeard')", GAME_SUPPORTS_SAVE ) // original (c)1988 Toposoft
400GAME( 19??,  brod,  0,      photon2, black, driver_device,   0, ROT0, "bootleg", "Brodjaga (Arcade bootleg of ZX Spectrum 'Inspector Gadget and the Circus of Fear')", GAME_SUPPORTS_SAVE ) // original (c)1987 BEAM software


Previous 199869 Revisions Next


© 1997-2024 The MAME Team