Previous 199869 Revisions Next

r36108 Wednesday 25th February, 2015 at 17:58:12 UTC by Osso
junofrst.c: enabled save state support (nw)
[/branches/kale/src/emu/sound]flt_rc.c
[/branches/kale/src/mame/drivers]junofrst.c

branches/kale/src/emu/sound/flt_rc.c
r244619r244620
3737{
3838   m_stream = stream_alloc(1, 1, machine().sample_rate());
3939   recalc();
40   
41   save_item(NAME(m_k));
42   save_item(NAME(m_memory));
43   save_item(NAME(m_type));
44   save_item(NAME(m_R1));
45   save_item(NAME(m_R2));
46   save_item(NAME(m_R3));
47   save_item(NAME(m_C));
4048}
4149
4250
branches/kale/src/mame/drivers/junofrst.c
r244619r244620
9595   junofrst_state(const machine_config &mconfig, device_type type, const char *tag)
9696      : tutankhm_state(mconfig, type, tag),
9797         m_audiocpu(*this, "audiocpu"),
98         m_i8039(*this, "mcu") { }
98         m_i8039(*this, "mcu"),
99         m_filter_0_0(*this, "filter.0.0"),
100         m_filter_0_1(*this, "filter.0.1"),
101         m_filter_0_2(*this, "filter.0.2") { }
99102
103   required_device<cpu_device> m_audiocpu;
104   required_device<cpu_device> m_i8039;
105   required_device<filter_rc_device> m_filter_0_0;
106   required_device<filter_rc_device> m_filter_0_1;
107   required_device<filter_rc_device> m_filter_0_2;
108   
100109   UINT8    m_blitterdata[4];
101110   int      m_i8039_status;
102111   int      m_last_irq;
103
104   required_device<cpu_device> m_audiocpu;
105   required_device<cpu_device> m_i8039;
106
107   device_t *m_filter_0_0;
108   device_t *m_filter_0_1;
109   device_t *m_filter_0_2;
110   DECLARE_WRITE8_MEMBER(junofrst_blitter_w);
111   DECLARE_WRITE8_MEMBER(junofrst_bankselect_w);
112   DECLARE_WRITE8_MEMBER(junofrst_sh_irqtrigger_w);
113   DECLARE_WRITE8_MEMBER(junofrst_i8039_irq_w);
112   
113   DECLARE_WRITE8_MEMBER(blitter_w);
114   DECLARE_WRITE8_MEMBER(bankselect_w);
115   DECLARE_WRITE8_MEMBER(sh_irqtrigger_w);
116   DECLARE_WRITE8_MEMBER(i8039_irq_w);
114117   DECLARE_WRITE8_MEMBER(i8039_irqen_and_status_w);
115118   DECLARE_WRITE8_MEMBER(flip_screen_w);
116   DECLARE_WRITE8_MEMBER(junofrst_coin_counter_w);
117   DECLARE_WRITE8_MEMBER(junofrst_irq_enable_w);
118   DECLARE_READ8_MEMBER(junofrst_portA_r);
119   DECLARE_WRITE8_MEMBER(junofrst_portB_w);
119   DECLARE_WRITE8_MEMBER(coincounter_w);
120   DECLARE_WRITE8_MEMBER(irq_enable_w);
121   DECLARE_READ8_MEMBER(portA_r);
122   DECLARE_WRITE8_MEMBER(portB_w);
123
120124   DECLARE_DRIVER_INIT(junofrst);
121125   DECLARE_MACHINE_START(junofrst);
122126   DECLARE_MACHINE_RESET(junofrst);
123   INTERRUPT_GEN_MEMBER(junofrst_30hz_irq);
127
128   INTERRUPT_GEN_MEMBER(_30hz_irq);
124129};
125130
126131
r244619r244620
142147          We have to mask it off otherwise the "Juno First" logo on the title screen is wrong.
143148*/
144149
145WRITE8_MEMBER(junofrst_state::junofrst_blitter_w)
150WRITE8_MEMBER(junofrst_state::blitter_w)
146151{
147152   m_blitterdata[offset] = data;
148153
r244619r244620
195200}
196201
197202
198WRITE8_MEMBER(junofrst_state::junofrst_bankselect_w)
203WRITE8_MEMBER(junofrst_state::bankselect_w)
199204{
200205   membank("bank1")->set_entry(data & 0x0f);
201206}
202207
203208
204READ8_MEMBER(junofrst_state::junofrst_portA_r)
209READ8_MEMBER(junofrst_state::portA_r)
205210{
206211   int timer;
207212
r244619r244620
217222}
218223
219224
220WRITE8_MEMBER(junofrst_state::junofrst_portB_w)
225WRITE8_MEMBER(junofrst_state::portB_w)
221226{
222   device_t *filter[3] = { m_filter_0_0, m_filter_0_1, m_filter_0_2 };
227   filter_rc_device *filter[3] = { m_filter_0_0, m_filter_0_1, m_filter_0_2 };
223228   int i;
224229
225230   for (i = 0; i < 3; i++)
r244619r244620
232237         C += 220000;    /* 220000pF = 0.22uF */
233238
234239      data >>= 2;
235      dynamic_cast<filter_rc_device*>(filter[i])->filter_rc_set_RC(FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(C));
240      filter[i]->filter_rc_set_RC(FLT_RC_LOWPASS, 1000, 2200, 200, CAP_P(C));
236241   }
237242}
238243
239244
240WRITE8_MEMBER(junofrst_state::junofrst_sh_irqtrigger_w)
245WRITE8_MEMBER(junofrst_state::sh_irqtrigger_w)
241246{
242247   if (m_last_irq == 0 && data == 1)
243248   {
r244619r244620
249254}
250255
251256
252WRITE8_MEMBER(junofrst_state::junofrst_i8039_irq_w)
257WRITE8_MEMBER(junofrst_state::i8039_irq_w)
253258{
254259   m_i8039->set_input_line(0, ASSERT_LINE);
255260}
r244619r244620
270275}
271276
272277
273WRITE8_MEMBER(junofrst_state::junofrst_coin_counter_w)
278WRITE8_MEMBER(junofrst_state::coincounter_w)
274279{
275280   coin_counter_w(machine(), offset, data);
276281}
277282
278WRITE8_MEMBER(junofrst_state::junofrst_irq_enable_w)
283WRITE8_MEMBER(junofrst_state::irq_enable_w)
279284{
280285   m_irq_enable = data & 1;
281286   if (!m_irq_enable)
r244619r244620
291296   AM_RANGE(0x8024, 0x8024) AM_READ_PORT("P1")
292297   AM_RANGE(0x8028, 0x8028) AM_READ_PORT("P2")
293298   AM_RANGE(0x802c, 0x802c) AM_READ_PORT("DSW1")
294   AM_RANGE(0x8030, 0x8030) AM_WRITE(junofrst_irq_enable_w)
295   AM_RANGE(0x8031, 0x8032) AM_WRITE(junofrst_coin_counter_w)
299   AM_RANGE(0x8030, 0x8030) AM_WRITE(irq_enable_w)
300   AM_RANGE(0x8031, 0x8032) AM_WRITE(coincounter_w)
296301   AM_RANGE(0x8033, 0x8033) AM_WRITEONLY AM_SHARE("scroll")  /* not used in Juno */
297302   AM_RANGE(0x8034, 0x8035) AM_WRITE(flip_screen_w)
298   AM_RANGE(0x8040, 0x8040) AM_WRITE(junofrst_sh_irqtrigger_w)
303   AM_RANGE(0x8040, 0x8040) AM_WRITE(sh_irqtrigger_w)
299304   AM_RANGE(0x8050, 0x8050) AM_WRITE(soundlatch_byte_w)
300   AM_RANGE(0x8060, 0x8060) AM_WRITE(junofrst_bankselect_w)
301   AM_RANGE(0x8070, 0x8073) AM_WRITE(junofrst_blitter_w)
305   AM_RANGE(0x8060, 0x8060) AM_WRITE(bankselect_w)
306   AM_RANGE(0x8070, 0x8073) AM_WRITE(blitter_w)
302307   AM_RANGE(0x8100, 0x8fff) AM_RAM
303308   AM_RANGE(0x9000, 0x9fff) AM_ROMBANK("bank1")
304309   AM_RANGE(0xa000, 0xffff) AM_ROM
r244619r244620
313318   AM_RANGE(0x4001, 0x4001) AM_DEVREAD("aysnd", ay8910_device, data_r)
314319   AM_RANGE(0x4002, 0x4002) AM_DEVWRITE("aysnd", ay8910_device, data_w)
315320   AM_RANGE(0x5000, 0x5000) AM_WRITE(soundlatch2_byte_w)
316   AM_RANGE(0x6000, 0x6000) AM_WRITE(junofrst_i8039_irq_w)
321   AM_RANGE(0x6000, 0x6000) AM_WRITE(i8039_irq_w)
317322ADDRESS_MAP_END
318323
319324
r244619r244620
370375
371376MACHINE_START_MEMBER(junofrst_state,junofrst)
372377{
373   m_filter_0_0 = machine().device("filter.0.0");
374   m_filter_0_1 = machine().device("filter.0.1");
375   m_filter_0_2 = machine().device("filter.0.2");
376
377378   save_item(NAME(m_i8039_status));
378379   save_item(NAME(m_last_irq));
379380   save_item(NAME(m_irq_toggle));
r244619r244620
395396   m_blitterdata[3] = 0;
396397}
397398
398INTERRUPT_GEN_MEMBER(junofrst_state::junofrst_30hz_irq)
399INTERRUPT_GEN_MEMBER(junofrst_state::_30hz_irq)
399400{
400401   /* flip flops cause the interrupt to be signalled every other frame */
401402   m_irq_toggle ^= 1;
r244619r244620
408409   /* basic machine hardware */
409410   MCFG_CPU_ADD("maincpu", M6809, 1500000)         /* 1.5 MHz ??? */
410411   MCFG_CPU_PROGRAM_MAP(main_map)
411   MCFG_CPU_VBLANK_INT_DRIVER("screen", junofrst_state,  junofrst_30hz_irq)
412   MCFG_CPU_VBLANK_INT_DRIVER("screen", junofrst_state,  _30hz_irq)
412413
413414   MCFG_CPU_ADD("audiocpu", Z80,14318000/8)    /* 1.78975 MHz */
414415   MCFG_CPU_PROGRAM_MAP(audio_map)
r244619r244620
432433   MCFG_SPEAKER_STANDARD_MONO("mono")
433434
434435   MCFG_SOUND_ADD("aysnd", AY8910, 14318000/8)
435   MCFG_AY8910_PORT_A_READ_CB(READ8(junofrst_state, junofrst_portA_r))
436   MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(junofrst_state, junofrst_portB_w))
436   MCFG_AY8910_PORT_A_READ_CB(READ8(junofrst_state, portA_r))
437   MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(junofrst_state, portB_w))
437438   MCFG_SOUND_ROUTE(0, "filter.0.0", 0.30)
438439   MCFG_SOUND_ROUTE(1, "filter.0.1", 0.30)
439440   MCFG_SOUND_ROUTE(2, "filter.0.2", 0.30)
r244619r244620
511512}
512513
513514
514GAME( 1983, junofrst, 0,        junofrst, junofrst, junofrst_state, junofrst, ROT90, "Konami", "Juno First", 0 )
515GAME( 1983, junofrstg,junofrst, junofrst, junofrst, junofrst_state, junofrst, ROT90, "Konami (Gottlieb license)", "Juno First (Gottlieb)", 0 )
515GAME( 1983, junofrst, 0,        junofrst, junofrst, junofrst_state, junofrst, ROT90, "Konami", "Juno First", GAME_SUPPORTS_SAVE )
516GAME( 1983, junofrstg,junofrst, junofrst, junofrst, junofrst_state, junofrst, ROT90, "Konami (Gottlieb license)", "Juno First (Gottlieb)", GAME_SUPPORTS_SAVE )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team