Previous 199869 Revisions Next

r25378 Friday 20th September, 2013 at 16:27:08 UTC by Curt Coder
(MESS) c64: Cleanup. (nw)
[src/mess/machine/c64]cpm.c cpm.h easyflash.c easyflash.h exos.c exos.h exp.c exp.h ide64.c ide64.h ieee488.c ieee488.h kingsoft.c kingsoft.h magic_formel.c magic_formel.h magic_voice.c magic_voice.h music64.c music64.h sfx_sound_expander.c sfx_sound_expander.h stardos.c stardos.h supercpu.c supercpu.h tdos.c tdos.h vw64.h xl80.h

trunk/src/mess/machine/c64/xl80.h
r25377r25378
4747   // device_c64_expansion_card_interface overrides
4848   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4949   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
50   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return 1; }
51   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return 0; }
50   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) { return 1; }
51   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) { return 0; }
5252
5353private:
5454   required_device<h46505_device> m_crtc;
trunk/src/mess/machine/c64/ieee488.c
r25377r25378
252252//  c64_game_r - GAME read
253253//-------------------------------------------------
254254
255int c64_ieee488_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
255int c64_ieee488_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
256256{
257   return m_exp->game_r(offset, sphi2, ba, rw, hiram);
257   return m_exp->game_r(offset, sphi2, ba, rw, m_slot->hiram());
258258}
trunk/src/mess/machine/c64/ieee488.h
r25377r25378
5151   // device_c64_expansion_card_interface overrides
5252   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
5353   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
54   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
54   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
5555
5656private:
5757   required_device<tpi6525_device> m_tpi;
trunk/src/mess/machine/c64/music64.c
r25377r25378
223223//  c64_game_r - GAME read
224224//-------------------------------------------------
225225
226int c64_music64_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
226int c64_music64_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
227227{
228   return m_exp->game_r(offset, sphi2, ba, rw, hiram);
228   return m_exp->game_r(offset, sphi2, ba, rw, m_slot->hiram());
229229}
230230
231231
r25377r25378
233233//  c64_exrom_r - EXROM read
234234//-------------------------------------------------
235235
236int c64_music64_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
236int c64_music64_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw)
237237{
238   return m_exp->exrom_r(offset, sphi2, ba, rw, hiram);
238   return m_exp->exrom_r(offset, sphi2, ba, rw, m_slot->hiram());
239239}
trunk/src/mess/machine/c64/music64.h
r25377r25378
4242   // device_c64_expansion_card_interface overrides
4343   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4444   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
45   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
46   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
45   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
46   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw);
4747
4848private:
4949   required_device<c64_expansion_slot_device> m_exp;
trunk/src/mess/machine/c64/supercpu.c
r25377r25378
291291//  c64_game_r - GAME read
292292//-------------------------------------------------
293293
294int c64_supercpu_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
294int c64_supercpu_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
295295{
296   return m_exp->game_r(offset, sphi2, ba, rw, hiram);
296   return m_exp->game_r(offset, sphi2, ba, rw, m_slot->hiram());
297297}
298298
299299
r25377r25378
301301//  c64_exrom_r - EXROM read
302302//-------------------------------------------------
303303
304int c64_supercpu_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
304int c64_supercpu_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw)
305305{
306   return m_exp->exrom_r(offset, sphi2, ba, rw, hiram);
306   return m_exp->exrom_r(offset, sphi2, ba, rw, m_slot->hiram());
307307}
trunk/src/mess/machine/c64/tdos.c
r25377r25378
176176//  c64_game_r - GAME read
177177//-------------------------------------------------
178178
179int c64_tdos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
179int c64_tdos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
180180{
181   return m_exp->game_r(offset, sphi2, ba, rw, hiram);
181   return m_exp->game_r(offset, sphi2, ba, rw, m_slot->hiram());
182182}
183183
184184
r25377r25378
186186//  c64_exrom_r - EXROM read
187187//-------------------------------------------------
188188
189int c64_tdos_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
189int c64_tdos_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw)
190190{
191   return m_exp->exrom_r(offset, sphi2, ba, rw, hiram);
191   return m_exp->exrom_r(offset, sphi2, ba, rw, m_slot->hiram());
192192}
trunk/src/mess/machine/c64/supercpu.h
r25377r25378
4444   // device_c64_expansion_card_interface overrides
4545   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4646   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
47   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
48   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
47   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
48   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw);
4949
5050private:
5151   required_device<legacy_cpu_device> m_maincpu;
trunk/src/mess/machine/c64/ide64.c
r25377r25378
341341//  c64_game_r - GAME read
342342//-------------------------------------------------
343343
344int c64_ide64_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
344int c64_ide64_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
345345{
346346   return (sphi2 && ba) ? m_game : 1;
347347}
r25377r25378
351351//  c64_exrom_r - EXROM read
352352//-------------------------------------------------
353353
354int c64_ide64_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
354int c64_ide64_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw)
355355{
356356   return (sphi2 && ba) ? m_exrom : 1;
357357}
trunk/src/mess/machine/c64/tdos.h
r25377r25378
4242   // device_c64_expansion_card_interface overrides
4343   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4444   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
45   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
46   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
45   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
46   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw);
4747
4848private:
4949   required_device<mc6852_device> m_ssda;
trunk/src/mess/machine/c64/easyflash.c
r25377r25378
212212//  c64_exrom_r - EXROM read
213213//-------------------------------------------------
214214
215int c64_easyflash_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
215int c64_easyflash_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw)
216216{
217217   return !BIT(m_mode, 1);
218218}
r25377r25378
222222//  c64_game_r - GAME read
223223//-------------------------------------------------
224224
225int c64_easyflash_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
225int c64_easyflash_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
226226{
227227   return !(BIT(m_mode, 0) | !(BIT(m_mode, 2) | m_jp1->read()));
228228}
trunk/src/mess/machine/c64/ide64.h
r25377r25378
4747   // device_c64_expansion_card_interface overrides
4848   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4949   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
50   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
51   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
50   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
51   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw);
5252
5353private:
5454   required_device<atmel_29c010_device> m_flash_rom;
trunk/src/mess/machine/c64/easyflash.h
r25377r25378
4444   // device_c64_expansion_card_interface overrides
4545   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4646   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
47   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
48   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
47   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw);
48   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
4949
5050private:
5151   required_device<amd_29f040_device> m_flash_roml;
trunk/src/mess/machine/c64/exp.c
r25377r25378
351351{
352352   int state = 1;
353353
354   m_hiram = hiram;
355
354356   if (m_card != NULL)
355357   {
356      state = m_card->c64_game_r(offset, sphi2, ba, rw, hiram);
358      state = m_card->c64_game_r(offset, sphi2, ba, rw);
357359   }
358360
359361   return state;
r25377r25378
368370{
369371   int state = 1;
370372
373   m_hiram = hiram;
374
371375   if (m_card != NULL)
372376   {
373      state = m_card->c64_exrom_r(offset, sphi2, ba, rw, hiram);
377      state = m_card->c64_exrom_r(offset, sphi2, ba, rw);
374378   }
375379
376380   return state;
trunk/src/mess/machine/c64/exp.h
r25377r25378
115115   DECLARE_WRITE_LINE_MEMBER( reset_w ) { m_write_reset(state); }
116116   int phi2() { return clock(); }
117117   int dotclock() { return phi2() * 8; }
118   int hiram() { return m_hiram; }
118119
119120protected:
120121   // device-level overrides
r25377r25378
148149   devcb2_write_line   m_write_reset;
149150
150151   device_c64_expansion_card_interface *m_card;
152
153   int m_hiram;
151154};
152155
153156
r25377r25378
172175   // runtime
173176   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) { return data; };
174177   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) { };
175   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return m_game; }
176   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return m_exrom; }
178   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw) { return m_game; }
179   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) { return m_exrom; }
177180
178181   c64_expansion_slot_device *m_slot;
179182
trunk/src/mess/machine/c64/vw64.h
r25377r25378
3939
4040   // device_c64_expansion_card_interface overrides
4141   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
42   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return 0; }
42   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw) { return 0; }
4343
4444private:
4545   emu_timer *m_game_timer;
trunk/src/mess/machine/c64/stardos.c
r25377r25378
179179//  c64_game_r - GAME read
180180//-------------------------------------------------
181181
182int c64_stardos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
182int c64_stardos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
183183{
184   return !(sphi2 && ba & rw & ((offset & 0xe000) == 0xe000) & hiram);
184   return !(sphi2 && ba & rw & ((offset & 0xe000) == 0xe000) & m_slot->hiram());
185185}
186186
187187
r25377r25378
189189//  c64_exrom_r - EXROM read
190190//-------------------------------------------------
191191
192int c64_stardos_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
192int c64_stardos_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw)
193193{
194194   return (BIT(offset, 13)) ? 1 : m_exrom;
195195}
trunk/src/mess/machine/c64/magic_formel.c
r25377r25378
274274//  c64_game_r - GAME read
275275//-------------------------------------------------
276276
277int c64_magic_formel_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
277int c64_magic_formel_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
278278{
279279   return !(ba & rw & ((offset & 0xe000) == 0xe000) & !(m_pb7 & m_cb2_ff));
280280}
trunk/src/mess/machine/c64/kingsoft.c
r25377r25378
9393//  c64_game_r - GAME read
9494//-------------------------------------------------
9595
96int c64_kingsoft_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
96int c64_kingsoft_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
9797{
9898   return m_exrom & !(ba & rw & ((offset >= 0x8000 && offset < 0xc000) || (offset >= 0xe000)));
9999}
trunk/src/mess/machine/c64/stardos.h
r25377r25378
4242   // device_c64_expansion_card_interface overrides
4343   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4444   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
45   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
46   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
45   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
46   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw);
4747
4848private:
4949   inline void charge_io1_capacitor();
trunk/src/mess/machine/c64/magic_formel.h
r25377r25378
5151   // device_c64_expansion_card_interface overrides
5252   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
5353   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
54   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
54   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
5555
5656private:
5757   required_device<pia6821_device> m_pia;
trunk/src/mess/machine/c64/kingsoft.h
r25377r25378
3939   // device_c64_expansion_card_interface overrides
4040   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4141   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
42   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
42   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
4343};
4444
4545
trunk/src/mess/machine/c64/sfx_sound_expander.c
r25377r25378
271271//  c64_game_r - GAME read
272272//-------------------------------------------------
273273
274int c64_sfx_sound_expander_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
274int c64_sfx_sound_expander_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
275275{
276   return m_exp->game_r(get_offset(offset, rw), sphi2, ba, rw, hiram);
276   return m_exp->game_r(get_offset(offset, rw), sphi2, ba, rw, m_slot->hiram());
277277}
278278
279279
r25377r25378
281281//  c64_exrom_r - EXROM read
282282//-------------------------------------------------
283283
284int c64_sfx_sound_expander_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
284int c64_sfx_sound_expander_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw)
285285{
286   return m_exp->exrom_r(get_offset(offset, rw), sphi2, ba, rw, hiram);
286   return m_exp->exrom_r(get_offset(offset, rw), sphi2, ba, rw, m_slot->hiram());
287287}
trunk/src/mess/machine/c64/sfx_sound_expander.h
r25377r25378
4545   // device_c64_expansion_card_interface overrides
4646   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4747   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
48   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
49   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
48   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
49   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw);
5050
5151private:
5252   required_device<ym3526_device> m_opl;
trunk/src/mess/machine/c64/cpm.c
r25377r25378
184184//  c64_game_r - GAME read
185185//-------------------------------------------------
186186
187int c64_cpm_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
187int c64_cpm_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
188188{
189189   if (m_ba != ba)
190190   {
trunk/src/mess/machine/c64/cpm.h
r25377r25378
4747
4848   // device_c64_expansion_card_interface overrides
4949   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
50   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
50   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
5151
5252private:
5353   inline void update_signals();
trunk/src/mess/machine/c64/magic_voice.c
r25377r25378
359359//  c64_game_r - GAME read
360360//-------------------------------------------------
361361
362int c64_magic_voice_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
362int c64_magic_voice_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
363363{
364364   return !((m_tpi_pc6 && sphi2) || (!m_tpi_pc6 && sphi2 && !PB5 && A12 && A13 && !A14));
365365}
trunk/src/mess/machine/c64/magic_voice.h
r25377r25378
5858   // device_c64_expansion_card_interface overrides
5959   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
6060   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
61   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
61   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
6262
6363private:
6464   offs_t get_offset(offs_t offset);
trunk/src/mess/machine/c64/exos.c
r25377r25378
6262//  c64_game_r - GAME read
6363//-------------------------------------------------
6464
65int c64_exos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
65int c64_exos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw)
6666{
67   return !(ba & rw & ((offset & 0xe000) == 0xe000) & hiram);
67   return !(ba & rw & ((offset & 0xe000) == 0xe000) & m_slot->hiram());
6868}
trunk/src/mess/machine/c64/exos.h
r25377r25378
3737
3838   // device_c64_expansion_card_interface overrides
3939   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
40   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
40   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw);
4141};
4242
4343

Previous 199869 Revisions Next


© 1997-2024 The MAME Team