Previous 199869 Revisions Next

r18707 Thursday 25th October, 2012 at 16:56:12 UTC by Curt Coder
(MESS) mos6566: Added BA/AEC outputs in preparation for 6502 RDY support, and implemented light pen trigger. (nw)
[src/mess]mess.lst
[src/mess/drivers]c128.c c64.c cbm2.c plus4.c vic10.c vic20.c
[src/mess/includes]c64.h cbm2.h vic10.h
[src/mess/machine]c128_comal80.c c128_comal80.h c64_16kb.c c64_16kb.h c64_comal80.c c64_comal80.h c64_cpm.c c64_cpm.h c64_currah_speech.c c64_currah_speech.h c64_dela_ep256.c c64_dela_ep256.h c64_dela_ep64.c c64_dela_ep64.h c64_dela_ep7x8.c c64_dela_ep7x8.h c64_dinamic.c c64_dinamic.h c64_dqbb.c c64_dqbb.h c64_easy_calc_result.c c64_easy_calc_result.h c64_easyflash.c c64_easyflash.h c64_epyx_fast_load.c c64_epyx_fast_load.h c64_exos.c c64_exos.h c64_final.c c64_final.h c64_final3.c c64_final3.h c64_fun_play.c c64_fun_play.h c64_georam.c c64_georam.h c64_ide64.c c64_ide64.h c64_ieee488.c c64_ieee488.h c64_kingsoft.c c64_kingsoft.h c64_mach5.c c64_mach5.h c64_magic_desk.c c64_magic_desk.h c64_magic_formel.c c64_magic_formel.h c64_mikro_assembler.c c64_mikro_assembler.h c64_multiscreen.c c64_multiscreen.h c64_neoram.c c64_neoram.h c64_ocean.c c64_ocean.h c64_pagefox.c c64_pagefox.h c64_prophet64.c c64_prophet64.h c64_ps64.c c64_ps64.h c64_reu.c c64_reu.h c64_rex.c c64_rex.h c64_rex_ep256.c c64_rex_ep256.h c64_ross.c c64_ross.h c64_sfx_sound_expander.c c64_sfx_sound_expander.h c64_silverrock.c c64_silverrock.h c64_simons_basic.c c64_simons_basic.h c64_stardos.c c64_stardos.h c64_std.c c64_std.h c64_structured_basic.c c64_structured_basic.h c64_super_explode.c c64_super_explode.h c64_super_games.c c64_super_games.h c64_sw8k.c c64_sw8k.h c64_system3.c c64_system3.h c64_tdos.c c64_tdos.h c64_vw64.c c64_vw64.h c64_warp_speed.c c64_warp_speed.h c64_westermann.c c64_westermann.h c64_xl80.c c64_xl80.h c64_zaxxon.c c64_zaxxon.h c64exp.c c64exp.h
[src/mess/video]mos6566.c mos6566.h

trunk/src/mess/machine/c64_currah_speech.h
r18706r18707
4343   virtual void device_reset();
4444
4545   // device_c64_expansion_card_interface overrides
46   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
47   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
46   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);
47   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);
4848
4949private:
5050   inline void set_osc1(int voice, int intonation);
trunk/src/mess/machine/c64_fun_play.c
r18706r18707
5959//  c64_cd_r - cartridge data read
6060//-------------------------------------------------
6161
62UINT8 c64_fun_play_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
62UINT8 c64_fun_play_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6363{
6464   if (!roml)
6565   {
r18706r18707
7575//  c64_cd_w - cartridge data write
7676//-------------------------------------------------
7777
78void c64_fun_play_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
78void c64_fun_play_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
7979{
8080   if (!io1)
8181   {
trunk/src/mess/machine/c64_fun_play.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343
4444private:
4545   UINT8 m_bank;
trunk/src/mess/machine/c64_std.c
r18706r18707
4747//  c64_cd_r - cartridge data read
4848//-------------------------------------------------
4949
50UINT8 c64_standard_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
50UINT8 c64_standard_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
5151{
5252   if (!roml && m_roml_mask)
5353   {
trunk/src/mess/machine/c64_std.h
r18706r18707
3838   virtual void device_start();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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);
4242};
4343
4444
trunk/src/mess/machine/c64_dela_ep7x8.c
r18706r18707
120120//  c64_cd_r - cartridge data read
121121//-------------------------------------------------
122122
123UINT8 c64_dela_ep7x8_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
123UINT8 c64_dela_ep7x8_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
124124{
125125   if (!roml)
126126   {
r18706r18707
144144//  c64_cd_w - cartridge data write
145145//-------------------------------------------------
146146
147void c64_dela_ep7x8_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
147void c64_dela_ep7x8_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
148148{
149149   if (!io1)
150150   {
trunk/src/mess/machine/c64_dela_ep7x8.h
r18706r18707
4343   virtual void device_reset();
4444
4545   // device_c64_expansion_card_interface overrides
46   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
47   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
46   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);
47   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);
4848
4949private:
5050   UINT8 *m_rom;
trunk/src/mess/machine/c64_ieee488.c
r18706r18707
106106   data |= m_bus->ifc_r();
107107   data |= m_bus->srq_r() << 1;
108108
109   data |= m_exp->exrom_r(offset, 1, 1, 0) << 7;
109   data |= m_exp->exrom_r(offset, 1, 1, 1, 0) << 7;
110110
111111   return data;
112112}
r18706r18707
277277//  c64_cd_r - cartridge data read
278278//-------------------------------------------------
279279
280UINT8 c64_ieee488_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
280UINT8 c64_ieee488_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
281281{
282   data = m_exp->cd_r(space, offset, data, ba, roml, romh, io1, io2);
282   data = m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2);
283283
284284   if (!roml)
285285   {
r18706r18707
301301//  c64_cd_w - cartridge data write
302302//-------------------------------------------------
303303
304void c64_ieee488_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
304void c64_ieee488_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
305305{
306306   if (!io2)
307307   {
308308      tpi6525_w(m_tpi, space, offset & 0x07, data);
309309   }
310310
311   m_exp->cd_w(space, offset, data, ba, roml, romh, io1, io2);
311   m_exp->cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2);
312312}
313313
314314
r18706r18707
316316//  c64_game_r - GAME read
317317//-------------------------------------------------
318318
319int c64_ieee488_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
319int c64_ieee488_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
320320{
321   return m_exp->game_r(offset, ba, rw, hiram);
321   return m_exp->game_r(offset, sphi2, ba, rw, hiram);
322322}
trunk/src/mess/machine/c64_ieee488.h
r18706r18707
5757   virtual void device_reset();
5858
5959   // device_c64_expansion_card_interface overrides
60   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
61   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
62   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
60   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);
61   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);
62   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
6363
6464private:
6565   required_device<device_t> m_tpi;
trunk/src/mess/machine/c64_silverrock.c
r18706r18707
9292//  c64_cd_r - cartridge data read
9393//-------------------------------------------------
9494
95UINT8 c64_silverrock_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
95UINT8 c64_silverrock_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
9696{
9797   if (!roml)
9898   {
r18706r18707
109109//  c64_cd_w - cartridge data write
110110//-------------------------------------------------
111111
112void c64_silverrock_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
112void c64_silverrock_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
113113{
114114   if (!io1)
115115   {
trunk/src/mess/machine/c64_silverrock.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343
4444private:
4545   UINT8 m_bank;
trunk/src/mess/machine/c64_super_games.c
r18706r18707
5959//  c64_cd_r - cartridge data read
6060//-------------------------------------------------
6161
62UINT8 c64_super_games_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
62UINT8 c64_super_games_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6363{
6464   if (!roml || !romh)
6565   {
r18706r18707
7575//  c64_cd_w - cartridge data write
7676//-------------------------------------------------
7777
78void c64_super_games_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
78void c64_super_games_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
7979{
8080   if (!io2)
8181   {
trunk/src/mess/machine/c64_super_games.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343
4444private:
4545   UINT8 m_bank;
trunk/src/mess/machine/c64_dqbb.c
r18706r18707
7676//  c64_cd_r - cartridge data read
7777//-------------------------------------------------
7878
79UINT8 c64_dqbb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
79UINT8 c64_dqbb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
8080{
8181   if (!m_cs && (!roml || !romh))
8282   {
r18706r18707
9191//  c64_cd_w - cartridge data write
9292//-------------------------------------------------
9393
94void c64_dqbb_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
94void c64_dqbb_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
9595{
9696   if (!m_cs && m_we && (offset >= 0x8000 && offset < 0xc000))
9797   {
trunk/src/mess/machine/c64_dqbb.h
r18706r18707
4545   virtual void nvram_write(emu_file &file) { if (m_nvram != NULL) { file.write(m_nvram, m_nvram_size); } }
4646
4747   // device_c64_expansion_card_interface overrides
48   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
49   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
48   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);
49   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);
5050
5151private:
5252   int m_cs;
trunk/src/mess/machine/c64_stardos.c
r18706r18707
148148//  c64_cd_r - cartridge data read
149149//-------------------------------------------------
150150
151UINT8 c64_stardos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
151UINT8 c64_stardos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
152152{
153153   if (!roml || !romh)
154154   {
r18706r18707
172172//  c64_cd_w - cartridge data write
173173//-------------------------------------------------
174174
175void c64_stardos_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
175void c64_stardos_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
176176{
177177   if (!io1)
178178   {
r18706r18707
189189//  c64_game_r - GAME read
190190//-------------------------------------------------
191191
192int c64_stardos_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
192int c64_stardos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
193193{
194194   return !(ba & rw & ((offset & 0xe000) == 0xe000) & hiram);
195195}
trunk/src/mess/machine/c64_magic_formel.c
r18706r18707
223223//  c64_cd_r - cartridge data read
224224//-------------------------------------------------
225225
226UINT8 c64_magic_formel_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
226UINT8 c64_magic_formel_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
227227{
228228   if (!romh && !m_rom_oe)
229229   {
r18706r18707
245245//  c64_cd_w - cartridge data write
246246//-------------------------------------------------
247247
248void c64_magic_formel_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
248void c64_magic_formel_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
249249{
250250   if (!io1)
251251   {
r18706r18707
269269//  c64_game_r - GAME read
270270//-------------------------------------------------
271271
272int c64_magic_formel_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
272int c64_magic_formel_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
273273{
274274   return !(ba & rw & ((offset & 0xe000) == 0xe000) & !(m_pb7 & m_cb2_ff));
275275}
trunk/src/mess/machine/c64_stardos.h
r18706r18707
4343   virtual void device_start();
4444
4545   // device_c64_expansion_card_interface overrides
46   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
47   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
48   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
46   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);
47   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);
4949
5050private:
5151   inline void charge_io1_capacitor();
trunk/src/mess/machine/c64_magic_formel.h
r18706r18707
5050   virtual void device_reset();
5151
5252   // device_c64_expansion_card_interface overrides
53   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
54   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
55   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
53   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);
54   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);
55   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
5656
5757private:
5858   required_device<pia6821_device> m_pia;
trunk/src/mess/machine/c64_sfx_sound_expander.c
r18706r18707
235235//  c64_cd_r - cartridge data read
236236//-------------------------------------------------
237237
238UINT8 c64_sfx_sound_expander_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
238UINT8 c64_sfx_sound_expander_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
239239{
240   data = m_exp->cd_r(space, offset, data, ba, roml, romh, io1, io2);
240   data = m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2);
241241
242242   if (!io2)
243243   {
r18706r18707
269269//  c64_cd_w - cartridge data write
270270//-------------------------------------------------
271271
272void c64_sfx_sound_expander_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
272void c64_sfx_sound_expander_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
273273{
274274   if (!io2 && BIT(offset, 5))
275275   {
276276      ym3526_w(m_opl, space, BIT(offset, 4), data);
277277   }
278278
279   m_exp->cd_w(space, offset, data, ba, roml, romh, io1, io2);
279   m_exp->cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2);
280280}
281281
282282
r18706r18707
284284//  c64_game_r - GAME read
285285//-------------------------------------------------
286286
287int c64_sfx_sound_expander_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
287int c64_sfx_sound_expander_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
288288{
289   return m_exp->game_r(offset, ba, rw, hiram);
289   return m_exp->game_r(offset, sphi2, ba, rw, hiram);
290290}
291291
292292
r18706r18707
294294//  c64_exrom_r - EXROM read
295295//-------------------------------------------------
296296
297int c64_sfx_sound_expander_cartridge_device::c64_exrom_r(offs_t offset, int ba, int rw, int hiram)
297int c64_sfx_sound_expander_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
298298{
299   return m_exp->exrom_r(offset, ba, rw, hiram);
299   return m_exp->exrom_r(offset, sphi2, ba, rw, hiram);
300300}
trunk/src/mess/machine/c64_sfx_sound_expander.h
r18706r18707
5252   virtual void device_reset();
5353
5454   // device_c64_expansion_card_interface overrides
55   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
56   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
57   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
58   virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram);
55   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);
56   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);
57   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
58   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
5959
6060private:
6161   required_device<device_t> m_opl;
trunk/src/mess/machine/c64_comal80.c
r18706r18707
5959//  c64_cd_r - cartridge data read
6060//-------------------------------------------------
6161
62UINT8 c64_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
62UINT8 c64_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6363{
6464   if (!roml || !romh)
6565   {
r18706r18707
7575//  c64_cd_w - cartridge data write
7676//-------------------------------------------------
7777
78void c64_comal80_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
78void c64_comal80_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
7979{
8080   if (!io1)
8181   {
trunk/src/mess/machine/c64_comal80.h
r18706r18707
3838   virtual void device_config_complete() { m_shortname = "c64_comal80"; }
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343
4444private:
4545   UINT8 m_bank;
trunk/src/mess/machine/c64_cpm.c
r18706r18707
169169//  c64_cd_w - cartridge data write
170170//-------------------------------------------------
171171
172void c64_cpm_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
172void c64_cpm_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
173173{
174174   if (!io1)
175175   {
r18706r18707
184184//  c64_game_r - GAME read
185185//-------------------------------------------------
186186
187int c64_cpm_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
187int c64_cpm_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
188188{
189189   if (m_ba != ba)
190190   {
trunk/src/mess/machine/c64_cpm.h
r18706r18707
4747   virtual void device_config_complete() { m_shortname = "c64_cpm"; }
4848
4949   // device_c64_expansion_card_interface overrides
50   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
51   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
50   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);
51   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
5252
5353private:
5454   inline void update_signals();
trunk/src/mess/machine/c64_warp_speed.c
r18706r18707
127127//  c64_cd_r - cartridge data read
128128//-------------------------------------------------
129129
130UINT8 c64_warp_speed_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
130UINT8 c64_warp_speed_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
131131{
132132   if (!roml || !romh || !io1 || !io2)
133133   {
r18706r18707
143143//  c64_cd_w - cartridge data write
144144//-------------------------------------------------
145145
146void c64_warp_speed_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
146void c64_warp_speed_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
147147{
148148   if (!io1)
149149   {
trunk/src/mess/machine/c64_ps64.c
r18706r18707
130130//  c64_cd_r - cartridge data read
131131//-------------------------------------------------
132132
133UINT8 c64_ps64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
133UINT8 c64_ps64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
134134{
135135   if (!roml)
136136   {
r18706r18707
149149//  c64_cd_w - cartridge data write
150150//-------------------------------------------------
151151
152void c64_ps64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
152void c64_ps64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
153153{
154154   if (!io1)
155155   {
trunk/src/mess/machine/c64_warp_speed.h
r18706r18707
4343   virtual void device_reset();
4444
4545   // device_c64_expansion_card_interface overrides
46   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
47   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
46   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);
47   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);
4848
4949private:
5050   UINT8 m_bank;
trunk/src/mess/machine/c64_ps64.h
r18706r18707
4242   virtual void device_reset();
4343
4444   // device_c64_expansion_card_interface overrides
45   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
46   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
45   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);
46   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);
4747};
4848
4949
trunk/src/mess/machine/c64_mikro_assembler.c
r18706r18707
4747//  c64_cd_r - cartridge data read
4848//-------------------------------------------------
4949
50UINT8 c64_mikro_assembler_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
50UINT8 c64_mikro_assembler_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
5151{
5252   if (!roml || !romh || !io1 || !io2)
5353   {
trunk/src/mess/machine/c64_mikro_assembler.h
r18706r18707
3737   virtual void device_start();
3838
3939   // device_c64_expansion_card_interface overrides
40   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
40   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};
4242
4343
trunk/src/mess/machine/c64_zaxxon.c
r18706r18707
4949//  c64_cd_r - cartridge data read
5050//-------------------------------------------------
5151
52UINT8 c64_zaxxon_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
52UINT8 c64_zaxxon_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
5353{
5454   if (!roml)
5555   {
trunk/src/mess/machine/c64_zaxxon.h
r18706r18707
3737   virtual void device_start();
3838
3939   // device_c64_expansion_card_interface overrides
40   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
40   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
4242private:
4343   int m_bank;
trunk/src/mess/machine/c64_georam.c
r18706r18707
6262//  c64_cd_r - cartridge data read
6363//-------------------------------------------------
6464
65UINT8 c64_georam_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
65UINT8 c64_georam_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6666{
6767   if (!io1)
6868   {
r18706r18707
7878//  c64_cd_w - cartridge data write
7979//-------------------------------------------------
8080
81void c64_georam_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
81void c64_georam_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
8282{
8383   if (!io1)
8484   {
trunk/src/mess/machine/c64_georam.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343
4444private:
4545   UINT16 m_bank;
trunk/src/mess/machine/c64_dinamic.c
r18706r18707
5959//  c64_cd_r - cartridge data read
6060//-------------------------------------------------
6161
62UINT8 c64_dinamic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
62UINT8 c64_dinamic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6363{
6464   if (!roml)
6565   {
trunk/src/mess/machine/c64_dinamic.h
r18706r18707
3838   virtual void device_config_complete() { m_shortname = "c64_dinamic"; }
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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);
4242
4343private:
4444   UINT8 m_bank;
trunk/src/mess/machine/c64_tdos.c
r18706r18707
215215//  c64_cd_r - cartridge data read
216216//-------------------------------------------------
217217
218UINT8 c64_tdos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
218UINT8 c64_tdos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
219219{
220   data = m_exp->cd_r(space, offset, data, ba, roml, romh, io1, io2);
220   data = m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2);
221221
222222   // TODO
223223
r18706r18707
229229//  c64_cd_w - cartridge data write
230230//-------------------------------------------------
231231
232void c64_tdos_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
232void c64_tdos_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
233233{
234234   // TODO
235   m_exp->cd_w(space, offset, data, ba, roml, romh, io1, io2);
235   m_exp->cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2);
236236}
237237
238238
r18706r18707
240240//  c64_game_r - GAME read
241241//-------------------------------------------------
242242
243int c64_tdos_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
243int c64_tdos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
244244{
245   return m_exp->game_r(offset, ba, rw, hiram);
245   return m_exp->game_r(offset, sphi2, ba, rw, hiram);
246246}
247247
248248
r18706r18707
250250//  c64_exrom_r - EXROM read
251251//-------------------------------------------------
252252
253int c64_tdos_cartridge_device::c64_exrom_r(offs_t offset, int ba, int rw, int hiram)
253int c64_tdos_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
254254{
255   return m_exp->exrom_r(offset, ba, rw, hiram);
255   return m_exp->exrom_r(offset, sphi2, ba, rw, hiram);
256256}
trunk/src/mess/machine/c64_tdos.h
r18706r18707
5252   virtual void device_reset();
5353
5454   // device_c64_expansion_card_interface overrides
55   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
56   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
57   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
58   virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram);
55   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);
56   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);
57   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
58   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
5959
6060private:
6161   required_device<mc6852_device> m_ssda;
trunk/src/mess/machine/c64_westermann.c
r18706r18707
5757//  c64_cd_r - cartridge data read
5858//-------------------------------------------------
5959
60UINT8 c64_westermann_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
60UINT8 c64_westermann_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6161{
6262   if (!roml)
6363   {
trunk/src/mess/machine/c64_westermann.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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);
4242};
4343
4444
trunk/src/mess/machine/c64_super_explode.c
r18706r18707
8585//  c64_cd_r - cartridge data read
8686//-------------------------------------------------
8787
88UINT8 c64_super_explode_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
88UINT8 c64_super_explode_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
8989{
9090   if (!roml)
9191   {
r18706r18707
112112//  c64_cd_w - cartridge data write
113113//-------------------------------------------------
114114
115void c64_super_explode_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
115void c64_super_explode_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
116116{
117117   if (!io1)
118118   {
trunk/src/mess/machine/c64_super_explode.h
r18706r18707
3939   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
4040
4141   // device_c64_expansion_card_interface overrides
42   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
43   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   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);
43   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);
4444
4545private:
4646   UINT8 m_bank;
trunk/src/mess/machine/c64_prophet64.c
r18706r18707
5959//  c64_cd_r - cartridge data read
6060//-------------------------------------------------
6161
62UINT8 c64_prophet64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
62UINT8 c64_prophet64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6363{
6464   if (!roml)
6565   {
r18706r18707
7575//  c64_cd_w - cartridge data write
7676//-------------------------------------------------
7777
78void c64_prophet64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
78void c64_prophet64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
7979{
8080   if (!io2)
8181   {
trunk/src/mess/machine/c64_prophet64.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343
4444private:
4545   UINT8 m_bank;
trunk/src/mess/machine/c64_epyx_fast_load.c
r18706r18707
8080//  c64_cd_r - cartridge data read
8181//-------------------------------------------------
8282
83UINT8 c64_epyx_fast_load_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
83UINT8 c64_epyx_fast_load_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
8484{
8585   if (!roml)
8686   {
r18706r18707
107107//  c64_cd_w - cartridge data write
108108//-------------------------------------------------
109109
110void c64_epyx_fast_load_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
110void c64_epyx_fast_load_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
111111{
112112   if (!io1)
113113   {
trunk/src/mess/machine/c64_epyx_fast_load.h
r18706r18707
3939   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
4040
4141   // device_c64_expansion_card_interface overrides
42   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
43   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   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);
43   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);
4444
4545private:
4646   emu_timer *m_exrom_timer;
trunk/src/mess/machine/c64_exos.c
r18706r18707
4747//  c64_cd_r - cartridge data read
4848//-------------------------------------------------
4949
50UINT8 c64_exos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
50UINT8 c64_exos_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
5151{
5252   if (!romh)
5353   {
r18706r18707
6262//  c64_game_r - GAME read
6363//-------------------------------------------------
6464
65int c64_exos_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
65int c64_exos_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
6666{
6767   return !(ba & rw & ((offset & 0xe000) == 0xe000) & hiram);
6868}
trunk/src/mess/machine/c64_exos.h
r18706r18707
3737   virtual void device_start();
3838
3939   // device_c64_expansion_card_interface overrides
40   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
40   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);
41   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
4242};
4343
4444
trunk/src/mess/machine/c64_xl80.c
r18706r18707
208208//  c64_cd_r - cartridge data read
209209//-------------------------------------------------
210210
211UINT8 c64_xl80_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
211UINT8 c64_xl80_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
212212{
213213   if (!io2 && BIT(offset, 2))
214214   {
r18706r18707
234234//  c64_cd_w - cartridge data write
235235//-------------------------------------------------
236236
237void c64_xl80_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
237void c64_xl80_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
238238{
239239   if (offset >= 0x9800 && offset < 0xa000)
240240   {
trunk/src/mess/machine/c64_xl80.h
r18706r18707
4646   virtual void device_reset();
4747
4848   // device_c64_expansion_card_interface overrides
49   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
50   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
51   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram) { return 1; }
52   virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram) { return 0; }
49   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);
50   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);
51   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return 1; }
52   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return 0; }
5353
5454private:
5555   required_device<h46505_device> m_crtc;
trunk/src/mess/machine/c64_reu.c
r18706r18707
132132//  c64_cd_r - cartridge data read
133133//-------------------------------------------------
134134
135UINT8 c64_reu_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
135UINT8 c64_reu_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
136136{
137137   if (!m_dmac->romsel_r(roml, romh))
138138   {
r18706r18707
151151//  c64_cd_w - cartridge data write
152152//-------------------------------------------------
153153
154void c64_reu_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
154void c64_reu_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
155155{
156156   if (!io2)
157157   {
trunk/src/mess/machine/c64_reu.h
r18706r18707
5151   virtual void device_reset();
5252
5353   // device_c64_expansion_card_interface overrides
54   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
55   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
54   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);
55   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);
5656
5757   required_device<mos8726_device> m_dmac;
5858
trunk/src/mess/machine/c64_16kb.c
r18706r18707
132132//  c64_cd_r - cartridge data read
133133//-------------------------------------------------
134134
135UINT8 c64_16kb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
135UINT8 c64_16kb_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
136136{
137137   if (!roml)
138138   {
trunk/src/mess/machine/c64_16kb.h
r18706r18707
4444   virtual void device_reset();
4545
4646   // device_c64_expansion_card_interface overrides
47   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
47   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);
4848};
4949
5050
trunk/src/mess/machine/c64_ocean.c
r18706r18707
5151
5252c64_ocean_cartridge_device::c64_ocean_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
5353   device_t(mconfig, C64_OCEAN, "C64 Ocean cartridge", tag, owner, clock),
54   device_c64_expansion_card_interface(mconfig, *this)
54   device_c64_expansion_card_interface(mconfig, *this),
55   m_bank(0)
5556{
5657}
5758
r18706r18707
8182//  c64_cd_r - cartridge data read
8283//-------------------------------------------------
8384
84UINT8 c64_ocean_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
85UINT8 c64_ocean_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
8586{
8687   if (!roml)
8788   {
8889      offs_t addr = (m_bank << 13) | (offset & 0x1fff);
8990      data = m_roml[addr & m_roml_mask];
9091   }
91   else if (!romh)
92   else if (!romh && m_romh)
9293   {
9394      offs_t addr = (m_bank << 13) | (offset & 0x1fff);
9495      data = m_romh[addr & m_romh_mask];
r18706r18707
106107//  c64_cd_w - cartridge data write
107108//-------------------------------------------------
108109
109void c64_ocean_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
110void c64_ocean_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
110111{
111112   if (!io1)
112113   {
trunk/src/mess/machine/c64_multiscreen.c
r18706r18707
208208//  c64_cd_r - cartridge data read
209209//-------------------------------------------------
210210
211UINT8 c64_multiscreen_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
211UINT8 c64_multiscreen_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
212212{
213213   if (!roml)
214214   {
r18706r18707
245245//  c64_cd_w - cartridge data write
246246//-------------------------------------------------
247247
248void c64_multiscreen_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
248void c64_multiscreen_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
249249{
250250   if (offset >= 0x8000 && offset < 0xa000)
251251   {
trunk/src/mess/machine/c64_ocean.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343
4444private:
4545   UINT8 m_bank;
trunk/src/mess/machine/c64_multiscreen.h
r18706r18707
4444   virtual void device_reset();
4545
4646   // device_c64_expansion_card_interface overrides
47   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
48   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
47   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);
48   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);
4949
5050private:
5151   UINT8 m_bank;
trunk/src/mess/machine/c64_simons_basic.c
r18706r18707
5757//  c64_cd_r - cartridge data read
5858//-------------------------------------------------
5959
60UINT8 c64_simons_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
60UINT8 c64_simons_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6161{
6262   if (!roml)
6363   {
r18706r18707
7676//  c64_cd_w - cartridge data write
7777//-------------------------------------------------
7878
79void c64_simons_basic_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
79void c64_simons_basic_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
8080{
8181   if (!io1)
8282   {
trunk/src/mess/machine/c64_simons_basic.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343};
4444
4545
trunk/src/mess/machine/c64_easyflash.c
r18706r18707
132132//  c64_cd_r - cartridge data read
133133//-------------------------------------------------
134134
135UINT8 c64_easyflash_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
135UINT8 c64_easyflash_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
136136{
137137   if (!roml)
138138   {
r18706r18707
157157//  c64_cd_w - cartridge data write
158158//-------------------------------------------------
159159
160void c64_easyflash_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
160void c64_easyflash_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
161161{
162162   if (!roml)
163163   {
r18706r18707
221221//  c64_exrom_r - EXROM read
222222//-------------------------------------------------
223223
224int c64_easyflash_cartridge_device::c64_exrom_r(offs_t offset, int ba, int rw, int hiram)
224int c64_easyflash_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
225225{
226226   return !BIT(m_mode, 1);
227227}
r18706r18707
231231//  c64_game_r - GAME read
232232//-------------------------------------------------
233233
234int c64_easyflash_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
234int c64_easyflash_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
235235{
236236   return !(BIT(m_mode, 0) | !(BIT(m_mode, 2) | device().ioport("JP1")->read()));
237237}
trunk/src/mess/machine/c64_easy_calc_result.c
r18706r18707
8080//  c64_cd_r - cartridge data read
8181//-------------------------------------------------
8282
83UINT8 c64_easy_calc_result_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
83UINT8 c64_easy_calc_result_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
8484{
8585   if (!roml)
8686   {
r18706r18707
9999//  c64_cd_w - cartridge data write
100100//-------------------------------------------------
101101
102void c64_easy_calc_result_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
102void c64_easy_calc_result_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
103103{
104104   if (!io1)
105105   {
trunk/src/mess/machine/c64_easyflash.h
r18706r18707
4545   virtual void device_reset();
4646
4747   // device_c64_expansion_card_interface overrides
48   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
49   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
50   virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram);
51   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
48   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);
49   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_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
51   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
5252
5353private:
5454   required_device<amd_29f040_device> m_flash_roml;
trunk/src/mess/machine/c64_easy_calc_result.h
r18706r18707
3838   virtual void device_config_complete() { m_shortname = "c64_easy_calc_result"; }
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343
4444private:
4545   int m_bank;
trunk/src/mess/machine/c64_vw64.c
r18706r18707
111111//  c64_cd_r - cartridge data read
112112//-------------------------------------------------
113113
114UINT8 c64_vizawrite_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
114UINT8 c64_vizawrite_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
115115{
116116   if (!roml)
117117   {
trunk/src/mess/machine/c64_vw64.h
r18706r18707
3939   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
4040
4141   // device_c64_expansion_card_interface overrides
42   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
43   virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram) { return 0; }
42   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);
43   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return 0; }
4444
4545private:
4646   emu_timer *m_game_timer;
trunk/src/mess/machine/c64_mach5.c
r18706r18707
5757//  c64_cd_r - cartridge data read
5858//-------------------------------------------------
5959
60UINT8 c64_mach5_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
60UINT8 c64_mach5_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6161{
6262   if (!roml || !io1 || !io2)
6363   {
r18706r18707
7272//  c64_cd_w - cartridge data write
7373//-------------------------------------------------
7474
75void c64_mach5_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
75void c64_mach5_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
7676{
7777   if (!io1)
7878   {
trunk/src/mess/machine/c64_mach5.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343};
4444
4545
trunk/src/mess/machine/c128_comal80.c
r18706r18707
5959//  c64_cd_r - cartridge data read
6060//-------------------------------------------------
6161
62UINT8 c128_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
62UINT8 c128_comal80_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6363{
6464   if (!romh)
6565   {
r18706r18707
7979//  c64_cd_w - cartridge data write
8080//-------------------------------------------------
8181
82void c128_comal80_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
82void c128_comal80_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
8383{
8484   if (!io1)
8585   {
trunk/src/mess/machine/c128_comal80.h
r18706r18707
3838   virtual void device_config_complete() { m_shortname = "c128_comal80"; }
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343
4444private:
4545   UINT8 m_bank;
trunk/src/mess/machine/c64_rex.c
r18706r18707
5757//  c64_cd_r - cartridge data read
5858//-------------------------------------------------
5959
60UINT8 c64_rex_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
60UINT8 c64_rex_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6161{
6262   if (!roml)
6363   {
trunk/src/mess/machine/c64_rex.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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);
4242};
4343
4444
trunk/src/mess/machine/c64_dela_ep64.c
r18706r18707
110110//  c64_cd_r - cartridge data read
111111//-------------------------------------------------
112112
113UINT8 c64_dela_ep64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
113UINT8 c64_dela_ep64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
114114{
115115   if (!roml)
116116   {
r18706r18707
136136//  c64_cd_w - cartridge data write
137137//-------------------------------------------------
138138
139void c64_dela_ep64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
139void c64_dela_ep64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
140140{
141141   if (!io1)
142142   {
trunk/src/mess/machine/c64_structured_basic.c
r18706r18707
6161//  c64_cd_r - cartridge data read
6262//-------------------------------------------------
6363
64UINT8 c64_structured_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
64UINT8 c64_structured_basic_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6565{
6666   if (!roml)
6767   {
r18706r18707
7878//  c64_cd_w - cartridge data write
7979//-------------------------------------------------
8080
81void c64_structured_basic_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
81void c64_structured_basic_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
8282{
8383   if (!io1)
8484   {
trunk/src/mess/machine/c64_dela_ep64.h
r18706r18707
4343   virtual void device_reset();
4444
4545   // device_c64_expansion_card_interface overrides
46   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
47   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
46   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);
47   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);
4848
4949private:
5050   UINT8 *m_rom;
trunk/src/mess/machine/c64_structured_basic.h
r18706r18707
3939   virtual void device_reset();
4040
4141   // device_c64_expansion_card_interface overrides
42   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
43   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   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);
43   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);
4444
4545private:
4646   UINT8 m_bank;
trunk/src/mess/machine/c64_ross.c
r18706r18707
6262//  c64_cd_r - cartridge data read
6363//-------------------------------------------------
6464
65UINT8 c64_ross_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
65UINT8 c64_ross_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6666{
6767   if (!roml || !romh)
6868   {
r18706r18707
7979//  c64_cd_w - cartridge data write
8080//-------------------------------------------------
8181
82void c64_ross_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
82void c64_ross_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
8383{
8484   if (!io1)
8585   {
trunk/src/mess/machine/c64_ross.h
r18706r18707
3939   virtual void device_reset();
4040
4141   // device_c64_expansion_card_interface overrides
42   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
43   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   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);
43   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);
4444
4545private:
4646   UINT8 m_bank;
trunk/src/mess/machine/c64_rex_ep256.c
r18706r18707
126126//  c64_cd_r - cartridge data read
127127//-------------------------------------------------
128128
129UINT8 c64_rex_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
129UINT8 c64_rex_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
130130{
131131   if (!roml)
132132   {
r18706r18707
160160//  c64_cd_w - cartridge data write
161161//-------------------------------------------------
162162
163void c64_rex_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
163void c64_rex_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
164164{
165165   if (!io2 && ((offset & 0xf0) == 0xa0))
166166   {
trunk/src/mess/machine/c64_neoram.c
r18706r18707
6363//  c64_cd_r - cartridge data read
6464//-------------------------------------------------
6565
66UINT8 c64_neoram_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
66UINT8 c64_neoram_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6767{
6868   if (!io1)
6969   {
r18706r18707
7979//  c64_cd_w - cartridge data write
8080//-------------------------------------------------
8181
82void c64_neoram_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
82void c64_neoram_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
8383{
8484   if (!io1)
8585   {
trunk/src/mess/machine/c64_rex_ep256.h
r18706r18707
4343   virtual void device_reset();
4444
4545   // device_c64_expansion_card_interface overrides
46   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
47   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
46   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);
47   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);
4848
4949private:
5050   UINT8 *m_rom;
trunk/src/mess/machine/c64_neoram.h
r18706r18707
4444   virtual void nvram_write(emu_file &file) { if (m_nvram != NULL) { file.write(m_nvram, m_nvram_size); } }
4545
4646   // device_c64_expansion_card_interface overrides
47   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
48   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
47   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);
48   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);
4949
5050private:
5151   UINT16 m_bank;
trunk/src/mess/machine/c64_final.c
r18706r18707
9595//  c64_cd_r - cartridge data read
9696//-------------------------------------------------
9797
98UINT8 c64_final_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
98UINT8 c64_final_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
9999{
100100   if (!roml || !romh || !io1 || !io2)
101101   {
r18706r18707
121121//  c64_cd_w - cartridge data write
122122//-------------------------------------------------
123123
124void c64_final_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
124void c64_final_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
125125{
126126   if (!io1)
127127   {
trunk/src/mess/machine/c64_final.h
r18706r18707
4444   virtual void device_reset();
4545
4646   // device_c64_expansion_card_interface overrides
47   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
48   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
47   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);
48   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);
4949};
5050
5151
trunk/src/mess/machine/c64_system3.c
r18706r18707
5959//  c64_cd_r - cartridge data read
6060//-------------------------------------------------
6161
62UINT8 c64_system3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
62UINT8 c64_system3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6363{
6464   if (!roml)
6565   {
r18706r18707
7575//  c64_cd_w - cartridge data write
7676//-------------------------------------------------
7777
78void c64_system3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
78void c64_system3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
7979{
8080   if (!io1)
8181   {
trunk/src/mess/machine/c64_ide64.c
r18706r18707
148148//  c64_cd_r - cartridge data read
149149//-------------------------------------------------
150150
151UINT8 c64_ide64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
151UINT8 c64_ide64_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
152152{
153153   if (!m_enable) return data;
154154
155155   int rom_oe = 1, ram_oe = 1;
156156
157   if (!m_game && m_exrom && ba)
157   if (!m_game && m_exrom && sphi2 && ba)
158158   {
159159      if (offset >= 0x1000 && offset < 0x8000)
160160      {
r18706r18707
175175      rom_oe = 0;
176176   }
177177
178   if (!io1)
178   if (!io1 && sphi2 && ba)
179179   {
180180      // 0x20-0x2f    IDE
181181      // 0x30-0x37    I/O
r18706r18707
248248//  c64_cd_w - cartridge data write
249249//-------------------------------------------------
250250
251void c64_ide64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
251void c64_ide64_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
252252{
253253   if (!m_enable) return;
254254
255   if (!m_game && m_exrom && ba)
255   if (!m_game && m_exrom)
256256   {
257257      if (offset >= 0x1000 && offset < 0x8000)
258258      {
r18706r18707
335335//  c64_game_r - GAME read
336336//-------------------------------------------------
337337
338int c64_ide64_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
338int c64_ide64_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
339339{
340   return ba ? m_game : 1;
340   return (sphi2 && ba) ? m_game : 1;
341341}
342342
343343
r18706r18707
345345//  c64_exrom_r - EXROM read
346346//-------------------------------------------------
347347
348int c64_ide64_cartridge_device::c64_exrom_r(offs_t offset, int ba, int rw, int hiram)
348int c64_ide64_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
349349{
350   return ba ? m_exrom : 1;
350   return (sphi2 && ba) ? m_exrom : 1;
351351}
trunk/src/mess/machine/c64_system3.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343
4444private:
4545   UINT8 m_bank;
trunk/src/mess/machine/c64_ide64.h
r18706r18707
4646   virtual void device_reset();
4747
4848   // device_c64_expansion_card_interface overrides
49   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
50   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
51   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
52   virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram);
49   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);
50   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);
51   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
52   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
5353
5454private:
5555   required_device<atmel_29c010_device> m_flash_rom;
trunk/src/mess/machine/c64_sw8k.c
r18706r18707
102102//  c64_cd_r - cartridge data read
103103//-------------------------------------------------
104104
105UINT8 c64_switchable_8k_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
105UINT8 c64_switchable_8k_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
106106{
107107   if (!roml)
108108   {
trunk/src/mess/machine/c64_sw8k.h
r18706r18707
4141   virtual void device_reset();
4242
4343   // device_c64_expansion_card_interface overrides
44   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
44   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);
4545
4646private:
4747   int m_bank;
trunk/src/mess/machine/c64_final3.c
r18706r18707
105105//  c64_cd_r - cartridge data read
106106//-------------------------------------------------
107107
108UINT8 c64_final3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
108UINT8 c64_final3_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
109109{
110110   if (!roml || !romh || !io1 || !io2)
111111   {
r18706r18707
121121//  c64_cd_w - cartridge data write
122122//-------------------------------------------------
123123
124void c64_final3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
124void c64_final3_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
125125{
126126   if (!m_hidden && !io2 && ((offset & 0xff) == 0xff))
127127   {
trunk/src/mess/machine/c64_final3.h
r18706r18707
4444   virtual void device_reset();
4545
4646   // device_c64_expansion_card_interface overrides
47   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
48   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
47   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);
48   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);
4949
5050private:
5151   UINT8 m_bank;
trunk/src/mess/machine/c64_magic_desk.c
r18706r18707
5959//  c64_cd_r - cartridge data read
6060//-------------------------------------------------
6161
62UINT8 c64_magic_desk_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
62UINT8 c64_magic_desk_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6363{
6464   if (!roml)
6565   {
r18706r18707
7575//  c64_cd_w - cartridge data write
7676//-------------------------------------------------
7777
78void c64_magic_desk_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
78void c64_magic_desk_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
7979{
8080   if (!io1)
8181   {
trunk/src/mess/machine/c64_pagefox.c
r18706r18707
8181//  c64_cd_r - cartridge data read
8282//-------------------------------------------------
8383
84UINT8 c64_pagefox_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
84UINT8 c64_pagefox_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
8585{
8686   if (!roml || !romh)
8787   {
r18706r18707
106106//  c64_cd_w - cartridge data write
107107//-------------------------------------------------
108108
109void c64_pagefox_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
109void c64_pagefox_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
110110{
111111   if (offset >= 0x8000 && offset < 0xc000)
112112   {
trunk/src/mess/machine/c64_magic_desk.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343
4444private:
4545   UINT8 m_bank;
trunk/src/mess/machine/c64_pagefox.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
4343
4444private:
4545   UINT8 m_bank;
trunk/src/mess/machine/c64_kingsoft.c
r18706r18707
5757//  c64_cd_r - cartridge data read
5858//-------------------------------------------------
5959
60UINT8 c64_kingsoft_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
60UINT8 c64_kingsoft_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
6161{
6262   if (!roml)
6363   {
r18706r18707
8080//  c64_cd_w - cartridge data write
8181//-------------------------------------------------
8282
83void c64_kingsoft_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
83void c64_kingsoft_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
8484{
8585   if (!io1)
8686   {
r18706r18707
9393//  c64_game_r - GAME read
9494//-------------------------------------------------
9595
96int c64_kingsoft_cartridge_device::c64_game_r(offs_t offset, int ba, int rw, int hiram)
96int c64_kingsoft_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
9797{
9898   return m_exrom & !(ba & rw & ((offset >= 0x8000 && offset < 0xc000) || (offset >= 0xe000)));
9999}
trunk/src/mess/machine/c64_dela_ep256.c
r18706r18707
126126//  c64_cd_r - cartridge data read
127127//-------------------------------------------------
128128
129UINT8 c64_dela_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
129UINT8 c64_dela_ep256_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
130130{
131131   if (!roml)
132132   {
r18706r18707
149149//  c64_cd_w - cartridge data write
150150//-------------------------------------------------
151151
152void c64_dela_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
152void c64_dela_ep256_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
153153{
154154   if (!io2 && ((offset & 0xf0) == 0xa0))
155155   {
trunk/src/mess/machine/c64_kingsoft.h
r18706r18707
3838   virtual void device_reset();
3939
4040   // device_c64_expansion_card_interface overrides
41   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
42   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
43   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram);
41   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 void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
43   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
4444};
4545
4646
trunk/src/mess/machine/c64_dela_ep256.h
r18706r18707
4343   virtual void device_reset();
4444
4545   // device_c64_expansion_card_interface overrides
46   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
47   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
46   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);
47   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);
4848
4949private:
5050   UINT8 *m_rom;
trunk/src/mess/machine/c64exp.c
r18706r18707
359359//  cd_r - cartridge data read
360360//-------------------------------------------------
361361
362UINT8 c64_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
362UINT8 c64_expansion_slot_device::cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
363363{
364364   if (m_cart != NULL)
365365   {
366      data = m_cart->c64_cd_r(space, offset, data, ba, roml, romh, io1, io2);
366      data = m_cart->c64_cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2);
367367   }
368368
369369   return data;
r18706r18707
374374//  cd_w - cartridge data write
375375//-------------------------------------------------
376376
377void c64_expansion_slot_device::cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
377void c64_expansion_slot_device::cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
378378{
379379   if (m_cart != NULL)
380380   {
381      m_cart->c64_cd_w(space, offset, data, ba, roml, romh, io1, io2);
381      m_cart->c64_cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2);
382382   }
383383}
384384
r18706r18707
387387//  game_r - GAME read
388388//-------------------------------------------------
389389
390int c64_expansion_slot_device::game_r(offs_t offset, int ba, int rw, int hiram)
390int c64_expansion_slot_device::game_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
391391{
392392   int state = 1;
393393
394394   if (m_cart != NULL)
395395   {
396      state = m_cart->c64_game_r(offset, ba, rw, hiram);
396      state = m_cart->c64_game_r(offset, sphi2, ba, rw, hiram);
397397   }
398398
399399   return state;
r18706r18707
404404//  exrom_r - EXROM read
405405//-------------------------------------------------
406406
407int c64_expansion_slot_device::exrom_r(offs_t offset, int ba, int rw, int hiram)
407int c64_expansion_slot_device::exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram)
408408{
409409   int state = 1;
410410
411411   if (m_cart != NULL)
412412   {
413      state = m_cart->c64_exrom_r(offset, ba, rw, hiram);
413      state = m_cart->c64_exrom_r(offset, sphi2, ba, rw, hiram);
414414   }
415415
416416   return state;
trunk/src/mess/machine/c64exp.h
r18706r18707
9797   virtual ~c64_expansion_slot_device();
9898
9999   // computer interface
100   UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
101   void cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2);
102   int game_r(offs_t offset, int ba, int rw, int hiram);
103   int exrom_r(offs_t offset, int ba, int rw, int hiram);
100   UINT8 cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
101   void cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2);
102   int game_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
103   int exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram);
104104   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
105105   DECLARE_WRITE_LINE_MEMBER( port_reset_w );
106106
r18706r18707
168168   virtual UINT8* c64_nvram_pointer(running_machine &machine, size_t size);
169169
170170   // runtime
171   virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { return data; };
172   virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2) { };
173   virtual int c64_game_r(offs_t offset, int ba, int rw, int hiram) { return m_game; }
174   virtual int c64_exrom_r(offs_t offset, int ba, int rw, int hiram) { return m_exrom; }
171   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; };
172   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) { };
173   virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return m_game; }
174   virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) { return m_exrom; }
175175   virtual void c64_reset_w(int state) { };
176176
177177   c64_expansion_slot_device *m_slot;
trunk/src/mess/machine/c64_currah_speech.c
r18706r18707
200200//  c64_cd_r - cartridge data read
201201//-------------------------------------------------
202202
203UINT8 c64_currah_speech_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
203UINT8 c64_currah_speech_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
204204{
205205   if (!romh)
206206   {
r18706r18707
240240//  c64_cd_w - cartridge data write
241241//-------------------------------------------------
242242
243void c64_currah_speech_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int ba, int roml, int romh, int io1, int io2)
243void c64_currah_speech_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2)
244244{
245245   if (!io1)
246246   {
trunk/src/mess/includes/cbm2.h
r18706r18707
201201   DECLARE_MACHINE_START( p500_pal );
202202   DECLARE_MACHINE_RESET( p500 );
203203
204   void read_pla1(offs_t offset, int bras, int busy2, int sphi2, int clrnibcsb, int procvid, int refen, int ba, int aec, int srw,
204   void read_pla1(offs_t offset, int busy2, int clrnibcsb, int procvid, int refen, int ba, int aec, int srw,
205205      int *datxen, int *dramxen, int *clrniben, int *segf, int *_64kcasen, int *casenb, int *viddaten, int *viddat_tr);
206206
207   void read_pla2(offs_t offset, offs_t va, int ba, int sphi2, int vicen, int ae, int segf, int bcas, int bank0,
207   void read_pla2(offs_t offset, offs_t va, int ba, int vicen, int ae, int segf, int bank0,
208208      int *clrnibcsb, int *extbufcs, int *discromcs, int *buframcs, int *charomcs, int *procvid, int *viccs, int *vidmatcs);
209209
210   void bankswitch(offs_t offset, offs_t va, int srw, int sphi0, int sphi1, int sphi2, int ba, int ae, int bras, int bcas, int busy2, int refen,
210   void bankswitch(offs_t offset, offs_t va, int srw, int ba, int ae, int busy2, int refen,
211211      int *datxen, int *dramxen, int *clrniben, int *_64kcasen, int *casenb, int *viddaten, int *viddat_tr,
212212      int *clrnibcs, int *extbufcs, int *discromcs, int *buframcs, int *charomcs, int *viccs, int *vidmatcs,
213213      int *csbank1, int *csbank2, int *csbank3, int *basiclocs, int *basichics, int *kernalcs,
214214      int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs, int *aec, int *vsysaden);
215215
216   UINT8 read_memory(address_space &space, offs_t offset, offs_t va, int sphi0, int sphi1, int sphi2, int ba, int ae, int bras, int bcas, UINT8 *clrnib);
217   void write_memory(address_space &space, offs_t offset, UINT8 data, int sphi0, int sphi1, int sphi2, int ba, int ae, int bras, int bcas);
216   UINT8 read_memory(address_space &space, offs_t offset, offs_t va, int ba, int ae, UINT8 *clrnib);
217   void write_memory(address_space &space, offs_t offset, UINT8 data, int ba, int ae);
218218
219219   DECLARE_READ8_MEMBER( read );
220220   DECLARE_WRITE8_MEMBER( write );
trunk/src/mess/includes/vic10.h
r18706r18707
3838        m_exp(*this, VIC10_EXPANSION_SLOT_TAG),
3939        m_ram(*this, RAM_TAG),
4040        m_cassette(*this, PET_DATASSETTE_PORT_TAG),
41        m_color_ram(*this, "color_ram"),
4142        m_cia_irq(CLEAR_LINE),
4243        m_vic_irq(CLEAR_LINE),
4344        m_exp_irq(CLEAR_LINE)
r18706r18707
8485   DECLARE_WRITE_LINE_MEMBER( exp_irq_w );
8586
8687   // video state
87   UINT8 *m_color_ram;
88   optional_shared_ptr<UINT8> m_color_ram;
8889
8990   // interrupt state
9091   int m_cia_irq;
trunk/src/mess/includes/c64.h
r18706r18707
8181   virtual void machine_reset();
8282
8383   void check_interrupts();
84   void read_pla(offs_t offset, offs_t va, int rw, int aec, int ba, int cas, int *casram, int *basic, int *kernal, int *charom, int *grw, int *io, int *roml, int *romh);
85   UINT8 read_memory(address_space &space, offs_t offset, offs_t va, int rw, int aec, int ba, int cas);
86   void write_memory(address_space &space, offs_t offset, UINT8 data, int rw, int aec, int ba, int cas);
84   void read_pla(offs_t offset, offs_t va, int rw, int aec, int ba, int *casram, int *basic, int *kernal, int *charom, int *grw, int *io, int *roml, int *romh);
85   UINT8 read_memory(address_space &space, offs_t offset, offs_t va, int aec, int ba);
86   void write_memory(address_space &space, offs_t offset, UINT8 data, int aec, int ba);
8787
8888   DECLARE_READ8_MEMBER( read );
8989   DECLARE_WRITE8_MEMBER( write );
9090
9191   INTERRUPT_GEN_MEMBER( frame_interrupt );
9292   DECLARE_READ8_MEMBER( vic_videoram_r );
93   DECLARE_READ8_MEMBER( vic_colorram_r );
9394   DECLARE_WRITE_LINE_MEMBER( vic_irq_w );
9495
9596   DECLARE_READ8_MEMBER( sid_potx_r );
r18706r18707
127128   UINT8 *m_charom;
128129
129130   // video state
130   required_shared_ptr<UINT8> m_color_ram;
131   optional_shared_ptr<UINT8> m_color_ram;
131132   int m_va14;
132133   int m_va15;
133134
trunk/src/mess/video/mos6566.c
r18706r18707
2121    TODO:
2222
2323    - cleanup
24    - light pen
2524    - http://hitmen.c02.at/temp/palstuff/
2625
2726*/
r18706r18707
175174
176175#define GFXMODE               ((m_reg[0x11] & 0x60) | (m_reg[0x16] & 0x10)) >> 4
177176#define SCREENON            (m_reg[0x11] & 0x10)
178#define VERTICALPOS            (m_reg[0x11] & 0x07)
179#define HORIZONTALPOS         (m_reg[0x16] & 0x07)
177#define YSCROLL               (m_reg[0x11] & 0x07)
178#define XSCROLL               (m_reg[0x16] & 0x07)
180179#define ECMON               (m_reg[0x11] & 0x40)
181180#define HIRESON               (m_reg[0x11] & 0x20)
182181#define COLUMNS40            (m_reg[0x16] & 0x08)         /* else 38 Columns */
r18706r18707
202201#define VIC2_FIRSTCOLUMN      (IS_PAL ? VIC6569_FIRSTCOLUMN : VIC6567_FIRSTCOLUMN)
203202#define VIC2_X_2_EMU(a)         (IS_PAL ? VIC6569_X_2_EMU(a) : VIC6567_X_2_EMU(a))
204203
204#define IRQ_RST               0x01
205#define IRQ_MBC               0x02
206#define IRQ_MMC               0x04
207#define IRQ_LP               0x08
205208
206209
207210
r18706r18707
249252//  INLINE HELPERS
250253//**************************************************************************
251254
252inline void mos6566_device::vic2_set_interrupt( int mask )
255inline void mos6566_device::set_interrupt( int mask )
253256{
254257   if (((m_reg[0x19] ^ mask) & m_reg[0x1a] & 0xf))
255258   {
r18706r18707
257260      {
258261         DBG_LOG(2, "vic2", ("irq start %.2x\n", mask));
259262         m_reg[0x19] |= 0x80;
260         m_out_irq_func(1);
263         m_out_irq_func(ASSERT_LINE);
261264      }
262265   }
263266   m_reg[0x19] |= mask;
264267}
265268
266inline void mos6566_device::vic2_clear_interrupt( int mask )
269inline void mos6566_device::clear_interrupt( int mask )
267270{
268271   m_reg[0x19] &= ~mask;
269272   if ((m_reg[0x19] & 0x80) && !(m_reg[0x19] & m_reg[0x1a] & 0xf))
270273   {
271274      DBG_LOG(2, "vic2", ("irq end %.2x\n", mask));
272275      m_reg[0x19] &= ~0x80;
273      m_out_irq_func(0);
276      m_out_irq_func(CLEAR_LINE);
274277   }
275278}
276279
277280inline UINT8 mos6566_device::read_videoram(offs_t offset)
278281{
282   //logerror("cycle %u VRAM %04x BA %u AEC %u\n", m_cycle, offset & 0x3fff, m_ba, m_aec);
279283   m_last_data = space(AS_0).read_byte(offset & 0x3fff);
280284
281285   return m_last_data;
r18706r18707
287291}
288292
289293// Idle access
290inline void mos6566_device::vic2_idle_access()
294inline void mos6566_device::idle_access()
291295{
292296   read_videoram(0x3fff);
293297}
294298
295299// Fetch sprite data pointer
296inline void mos6566_device::vic2_spr_ptr_access( int num )
300inline void mos6566_device::spr_ptr_access( int num )
297301{
298302   m_spr_ptr[num] = read_videoram(SPRITE_ADDR(num)) << 6;
299303}
300304
305inline void mos6566_device::spr_ba(int num)
306{
307   if (BIT(m_spr_dma_on, num))
308   {
309      set_ba(CLEAR_LINE);
310      m_rdy_cycles += 2;
311   }
312   else if (num > 1 && !BIT(m_spr_dma_on, num - 1))
313   {
314      set_ba(ASSERT_LINE);
315   }
316}
317
301318// Fetch sprite data, increment data counter
302inline void mos6566_device::vic2_spr_data_access( int num, int bytenum )
319inline void mos6566_device::spr_data_access( int num, int bytenum )
303320{
304321   if (m_spr_dma_on & (1 << num))
305322   {
r18706r18707
308325   }
309326   else
310327      if (bytenum == 1)
311         vic2_idle_access();
328         idle_access();
312329}
313330
314331// Turn on display if Bad Line
315inline void mos6566_device::vic2_display_if_bad_line()
332inline void mos6566_device::display_if_bad_line()
316333{
317334   if (m_is_bad_line)
318335      m_display_state = 1;
319336}
320337
321// Suspend CPU
322inline void mos6566_device::vic2_suspend_cpu()
338inline void mos6566_device::set_ba(int state)
323339{
324   if (m_device_suspended == 0)
340   if (m_ba != state)
325341   {
326      m_first_ba_cycle = m_cycles_counter;
327      //if (m_in_rdy_workaround_func(0) != 7 )
342      m_ba = state;
343
344      if (m_ba)
328345      {
329//          machine.firstcpu->suspend(SUSPEND_REASON_SPIN, 0);
346         m_aec_delay = 0xff;
330347      }
331      m_device_suspended = 1;
332348   }
333349}
334350
335// Resume CPU
336inline void mos6566_device::vic2_resume_cpu()
351inline void mos6566_device::set_aec(int state)
337352{
338   if (m_device_suspended == 1)
353   if (m_aec != state)
339354   {
340   //  machine.firstcpu->resume(SUSPEND_REASON_SPIN);
341      m_device_suspended = 0;
355      m_aec = state;
342356   }
343357}
344358
359inline void mos6566_device::bad_line_ba()
360{
361   if (m_is_bad_line)
362   {
363      if (m_ba)
364      {
365         set_ba(CLEAR_LINE);
366         m_rdy_cycles += 55 - m_cycle;     
367      }
368   }
369   else
370   {
371      set_ba(ASSERT_LINE);
372   }
373}
374
345375// Refresh access
346inline void mos6566_device::vic2_refresh_access()
376inline void mos6566_device::refresh_access()
347377{
348378   read_videoram(0x3f00 | m_ref_cnt--);
349379}
350380
351381
352inline void mos6566_device::vic2_fetch_if_bad_line()
382inline void mos6566_device::fetch_if_bad_line()
353383{
354384   if (m_is_bad_line)
355385      m_display_state = 1;
r18706r18707
357387
358388
359389// Turn on display and matrix access and reset RC if Bad Line
360inline void mos6566_device::vic2_rc_if_bad_line()
390inline void mos6566_device::rc_if_bad_line()
361391{
362392   if (m_is_bad_line)
363393   {
r18706r18707
367397}
368398
369399// Sample border color and increment m_graphic_x
370inline void mos6566_device::vic2_sample_border()
400inline void mos6566_device::sample_border()
371401{
372402   if (m_draw_this_line)
373403   {
r18706r18707
379409
380410
381411// Turn on sprite DMA if necessary
382inline void mos6566_device::vic2_check_sprite_dma()
412inline void mos6566_device::check_sprite_dma()
383413{
384414   int i;
385415   UINT8 mask = 1;
r18706r18707
395425}
396426
397427// Video matrix access
398inline void mos6566_device::vic2_matrix_access()
428inline void mos6566_device::matrix_access()
399429{
400//  if (m_device_suspended == 1)
430   if (!m_is_bad_line) return;
431
432   UINT16 adr = (m_vc & 0x03ff) | VIDEOADDR;
433
434   // we're in the second clock phase
435   m_phi0 = 1;
436   set_aec(BIT(m_aec_delay, 2));
437
438   if (!m_ba && m_aec)
401439   {
402      if (m_cycles_counter < m_first_ba_cycle)
403         m_matrix_line[m_ml_index] = m_color_line[m_ml_index] = 0xff;
404      else
405      {
406         UINT16 adr = (m_vc & 0x03ff) | VIDEOADDR;
407         m_matrix_line[m_ml_index] = read_videoram(adr);
408         m_color_line[m_ml_index] = read_colorram((adr & 0x03ff));
409      }
440      m_matrix_line[m_ml_index] = 0xff;
410441   }
442   else
443   {
444      m_matrix_line[m_ml_index] = read_videoram(adr);
445   }
446
447   m_color_line[m_ml_index] = read_colorram(adr & 0x03ff);
411448}
412449
413450// Graphics data access
414inline void mos6566_device::vic2_graphics_access()
451inline void mos6566_device::graphics_access()
415452{
416453   if (m_display_state == 1)
417454   {
r18706r18707
435472   }
436473}
437474
438inline void mos6566_device::vic2_draw_background()
475inline void mos6566_device::draw_background()
439476{
440477   if (m_draw_this_line)
441478   {
r18706r18707
471508   }
472509}
473510
474inline void mos6566_device::vic2_draw_mono( UINT16 p, UINT8 c0, UINT8 c1 )
511inline void mos6566_device::draw_mono( UINT16 p, UINT8 c0, UINT8 c1 )
475512{
476513   UINT8 c[2];
477514   UINT8 data = m_gfx_data;
r18706r18707
497534   m_fore_coll_buf[p + 0] = data & 1;
498535}
499536
500inline void mos6566_device::vic2_draw_multi( UINT16 p, UINT8 c0, UINT8 c1, UINT8 c2, UINT8 c3 )
537inline void mos6566_device::draw_multi( UINT16 p, UINT8 c0, UINT8 c1, UINT8 c2, UINT8 c3 )
501538{
502539   UINT8 c[4];
503540   UINT8 data = m_gfx_data;
r18706r18707
552589     device_execute_interface(mconfig, *this),
553590     m_icount(0),
554591     m_videoram_space_config("videoram", ENDIANNESS_LITTLE, 8, 14, 0, NULL, *ADDRESS_MAP_NAME(mos6566_videoram_map)),
555     m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6566_colorram_map))
592     m_colorram_space_config("colorram", ENDIANNESS_LITTLE, 8, 10, 0, NULL, *ADDRESS_MAP_NAME(mos6566_colorram_map)),
593     m_phi0(1),
594     m_ba(ASSERT_LINE),
595     m_aec(ASSERT_LINE)
556596{
557597}
558598
r18706r18707
597637   // or initialize to defaults if none provided
598638   else
599639   {
600      // TODO
640      memset(&m_out_irq_cb, 0, sizeof(m_out_irq_cb));
641      memset(&m_out_ba_cb, 0, sizeof(m_out_ba_cb));
642      memset(&m_out_aec_cb, 0, sizeof(m_out_aec_cb));
643      memset(&m_out_k_cb, 0, sizeof(m_out_k_cb));
601644    }
602645}
603646
r18706r18707
613656
614657   // resolve callbacks
615658   m_out_irq_func.resolve(m_out_irq_cb, *this);
616   m_out_rdy_func.resolve(m_out_rdy_cb, *this);
659   m_out_ba_func.resolve(m_out_ba_cb, *this);
660   m_out_aec_func.resolve(m_out_aec_cb, *this);
617661   m_out_k_func.resolve(m_out_k_cb, *this);
618662
619663   m_cpu = machine().device<cpu_device>(m_cpu_tag);
r18706r18707
678722   save_item(NAME(m_spritemulti));
679723
680724   save_item(NAME(m_rasterline));
681   save_item(NAME(m_cycles_counter));
682725   save_item(NAME(m_cycle));
683726   save_item(NAME(m_raster_x));
684727   save_item(NAME(m_graphic_x));
r18706r18707
744787   // from 0 to 311 (0 first, PAL) or from 0 to 261 (? first, NTSC 6567R56A) or from 0 to 262 (? first, NTSC 6567R8)
745788   m_rasterline = 0; // VIC2_LINES - 1;
746789
747   m_cycles_counter = -1;
748   m_cycle = 63;
790   m_cycle = 14;
791   m_raster_x = 0x004;
749792
750793   m_on = 1;
751794
r18706r18707
805848      m_colors[i] = 0;
806849      m_spritemulti[i] = 0;
807850   }
851
852   m_phi0 = 1;
853   m_ba = CLEAR_LINE;
854   m_aec = CLEAR_LINE;
855   m_aec_delay = 0xff;
856   m_rdy_cycles = 0;
857
858   set_ba(ASSERT_LINE);
859   set_aec(ASSERT_LINE);
808860}
809861
810862
r18706r18707
816868{
817869   do
818870   {
871      UINT8 cpu_cycles = m_cpu->total_cycles() & 0xff;
872      UINT8 vic_cycles = total_cycles() & 0xff;
873
874      m_phi0 = 0;
875
876      m_aec_delay <<= 1;
877      m_aec_delay |= m_ba;
878
879      set_aec(CLEAR_LINE);
880
819881      int i;
820882      UINT8 mask;
821      m_cycles_counter++;
822883
884      if (m_rasterline == VIC2_FIRST_DMA_LINE)
885         m_bad_lines_enabled = SCREENON;
886
887      m_is_bad_line = ((m_rasterline >= VIC2_FIRST_DMA_LINE) && (m_rasterline <= VIC2_LAST_DMA_LINE) &&
888         ((m_rasterline & 0x07) == YSCROLL) && m_bad_lines_enabled);
889
823890      switch (m_cycle)
824891      {
825
826892      // Sprite 3, raster counter, raster IRQ, bad line
827893      case 1:
828894         if (m_rasterline == (VIC2_LINES - 1))
829895         {
830896            m_vblanking = 1;
831
832   //          if (LIGHTPEN_BUTTON)
833            {
834//               m_reg[0x13] = VIC2_X_VALUE;
835//               m_reg[0x14] = VIC2_Y_VALUE;
836            }
837            vic2_set_interrupt(8);
838897         }
839898         else
840899         {
841900            m_rasterline++;
842901
843            if (m_rasterline == VIC2_FIRST_DMA_LINE)
844               m_bad_lines_enabled = SCREENON;
845
846            m_is_bad_line = ((m_rasterline >= VIC2_FIRST_DMA_LINE) && (m_rasterline <= VIC2_LAST_DMA_LINE) &&
847                     ((m_rasterline & 0x07) == VERTICALPOS) && m_bad_lines_enabled);
848
849902            m_draw_this_line = ((VIC2_RASTER_2_EMU(m_rasterline) >= VIC2_RASTER_2_EMU(VIC2_FIRST_DISP_LINE)) &&
850903                     (VIC2_RASTER_2_EMU(m_rasterline ) <= VIC2_RASTER_2_EMU(VIC2_LAST_DISP_LINE)));
851904         }
852905
853906         m_border_on_sample[0] = m_border_on;
854         vic2_spr_ptr_access(3);
855         vic2_spr_data_access(3, 0);
856         vic2_display_if_bad_line();
907         spr_ptr_access(3);
908         spr_data_access(3, 0);
909         display_if_bad_line();
857910
858         if (m_spr_dma_on & 0x08)
859            vic2_suspend_cpu();
860         else
861            vic2_resume_cpu();
862
863911         m_cycle++;
864912         break;
865913
r18706r18707
875923            // Trigger raster IRQ if IRQ in line 0
876924            if (RASTERLINE == 0)
877925            {
878               vic2_set_interrupt(1);
926               set_interrupt(IRQ_RST);
879927            }
880928         }
881929
882930         if (m_rasterline == RASTERLINE)
883931         {
884            vic2_set_interrupt(1);
932            set_interrupt(IRQ_RST);
885933         }
886934
887935         m_graphic_x = VIC2_X_2_EMU(0);
888936
889         vic2_spr_data_access(3, 1);
890         vic2_spr_data_access(3, 2);
891         vic2_display_if_bad_line();
937         spr_data_access(3, 1);
938         spr_data_access(3, 2);
939         display_if_bad_line();
892940
941         spr_ba(5);
942
893943         m_cycle++;
894944         break;
895945
896946      // Sprite 4
897947      case 3:
898         vic2_spr_ptr_access(4);
899         vic2_spr_data_access(4, 0);
900         vic2_display_if_bad_line();
948         spr_ptr_access(4);
949         spr_data_access(4, 0);
950         display_if_bad_line();
901951
902         if (m_spr_dma_on & 0x10)
903            vic2_suspend_cpu();
904         else
905            vic2_resume_cpu();
906
907952         m_cycle++;
908953         break;
909954
910955      // Sprite 4
911956      case 4:
912         vic2_spr_data_access(4, 1);
913         vic2_spr_data_access(4, 2);
914         vic2_display_if_bad_line();
957         spr_data_access(4, 1);
958         spr_data_access(4, 2);
959         display_if_bad_line();
915960
961         spr_ba(6);
962
916963         m_cycle++;
917964         break;
918965
919966      // Sprite 5
920967      case 5:
921         vic2_spr_ptr_access(5);
922         vic2_spr_data_access(5, 0);
923         vic2_display_if_bad_line();
968         spr_ptr_access(5);
969         spr_data_access(5, 0);
970         display_if_bad_line();
924971
925         if (m_spr_dma_on & 0x20)
926            vic2_suspend_cpu();
927         else
928            vic2_resume_cpu();
929
930972         m_cycle++;
931973         break;
932974
933975      // Sprite 5
934976      case 6:
935         vic2_spr_data_access(5, 1);
936         vic2_spr_data_access(5, 2);
937         vic2_display_if_bad_line();
977         spr_data_access(5, 1);
978         spr_data_access(5, 2);
979         display_if_bad_line();
938980
981         spr_ba(7);
982
939983         m_cycle++;
940984         break;
941985
942986      // Sprite 6
943987      case 7:
944         vic2_spr_ptr_access(6);
945         vic2_spr_data_access(6, 0);
946         vic2_display_if_bad_line();
988         spr_ptr_access(6);
989         spr_data_access(6, 0);
990         display_if_bad_line();
947991
948         if (m_spr_dma_on & 0x40)
949            vic2_suspend_cpu();
950         else
951            vic2_resume_cpu();
952
953992         m_cycle++;
954993         break;
955994
956995      // Sprite 6
957996      case 8:
958         vic2_spr_data_access(6, 1);
959         vic2_spr_data_access(6, 2);
960         vic2_display_if_bad_line();
997         spr_data_access(6, 1);
998         spr_data_access(6, 2);
999         display_if_bad_line();
9611000
9621001         m_cycle++;
9631002         break;
9641003
9651004      // Sprite 7
9661005      case 9:
967         vic2_spr_ptr_access(7);
968         vic2_spr_data_access(7, 0);
969         vic2_display_if_bad_line();
1006         spr_ptr_access(7);
1007         spr_data_access(7, 0);
1008         display_if_bad_line();
9701009
971         if (m_spr_dma_on & 0x80)
972            vic2_suspend_cpu();
973         else
974            vic2_resume_cpu();
975
9761010         m_cycle++;
9771011         break;
9781012
9791013      // Sprite 7
9801014      case 10:
981         vic2_spr_data_access(7, 1);
982         vic2_spr_data_access(7, 2);
983         vic2_display_if_bad_line();
1015         spr_data_access(7, 1);
1016         spr_data_access(7, 2);
1017         display_if_bad_line();
9841018
1019         set_ba(ASSERT_LINE);
1020
9851021         m_cycle++;
9861022         break;
9871023
9881024      // Refresh
9891025      case 11:
990         vic2_refresh_access();
991         vic2_display_if_bad_line();
1026         refresh_access();
1027         display_if_bad_line();
9921028
993         vic2_resume_cpu();
994
9951029         m_cycle++;
9961030         break;
9971031
9981032      // Refresh, fetch if bad line
9991033      case 12:
1000         vic2_refresh_access();
1001         vic2_fetch_if_bad_line();
1034         bad_line_ba();
10021035
1036         refresh_access();
1037         fetch_if_bad_line();
1038
10031039         m_cycle++;
10041040         break;
10051041
10061042      // Refresh, fetch if bad line, raster_x
10071043      case 13:
1008         vic2_draw_background();
1009         vic2_sample_border();
1010         vic2_refresh_access();
1011         vic2_fetch_if_bad_line();
1044         bad_line_ba();
10121045
1013         m_raster_x = 0xfffc;
1046         draw_background();
1047         sample_border();
1048         refresh_access();
1049         fetch_if_bad_line();
10141050
10151051         m_cycle++;
10161052         break;
10171053
10181054      // Refresh, fetch if bad line, RC, VC
10191055      case 14:
1020         vic2_draw_background();
1021         vic2_sample_border();
1022         vic2_refresh_access();
1023         vic2_rc_if_bad_line();
1056         bad_line_ba();
10241057
1058         draw_background();
1059         sample_border();
1060         refresh_access();
1061         rc_if_bad_line();
1062
10251063         m_vc = m_vc_base;
10261064
10271065         m_cycle++;
r18706r18707
10291067
10301068      // Refresh, fetch if bad line, sprite y expansion
10311069      case 15:
1032         vic2_draw_background();
1033         vic2_sample_border();
1034         vic2_refresh_access();
1035         vic2_fetch_if_bad_line();
1070         bad_line_ba();
10361071
1072         draw_background();
1073         sample_border();
1074         refresh_access();
1075         fetch_if_bad_line();
1076
10371077         for (i = 0; i < 8; i++)
10381078            if (m_spr_exp_y & (1 << i))
10391079               m_mc_base[i] += 2;
10401080
1041         if (m_is_bad_line)
1042            vic2_suspend_cpu();
1043
10441081         m_ml_index = 0;
1045         vic2_matrix_access();
1082         matrix_access();
10461083
10471084         m_cycle++;
10481085         break;
10491086
10501087      // Graphics, sprite y expansion, sprite DMA
10511088      case 16:
1052         vic2_draw_background();
1053         vic2_sample_border();
1054         vic2_graphics_access();
1055         vic2_fetch_if_bad_line();
1089         bad_line_ba();
10561090
1091         draw_background();
1092         sample_border();
1093         graphics_access();
1094         fetch_if_bad_line();
1095
10571096         mask = 1;
10581097         for (i = 0; i < 8; i++, mask <<= 1)
10591098         {
r18706r18707
10631102               m_spr_dma_on &= ~mask;
10641103         }
10651104
1066         vic2_matrix_access();
1105         matrix_access();
10671106
10681107         m_cycle++;
10691108         break;
10701109
10711110      // Graphics, check border
10721111      case 17:
1112         bad_line_ba();
1113
10731114         if (COLUMNS40)
10741115         {
10751116            if (m_rasterline == m_dy_stop)
r18706r18707
10931134         // Second sample of border state
10941135         m_border_on_sample[1] = m_border_on;
10951136
1096         vic2_draw_background();
1097         vic2_draw_graphics();
1098         vic2_sample_border();
1099         vic2_graphics_access();
1100         vic2_fetch_if_bad_line();
1101         vic2_matrix_access();
1137         draw_background();
1138         draw_graphics();
1139         sample_border();
1140         graphics_access();
1141         fetch_if_bad_line();
1142         matrix_access();
11021143
11031144         m_cycle++;
11041145         break;
11051146
11061147      // Check border
11071148      case 18:
1149         bad_line_ba();
1150
11081151         if (!COLUMNS40)
11091152         {
11101153            if (m_rasterline == m_dy_stop)
r18706r18707
11661209      case 52:
11671210      case 53:
11681211      case 54:
1169         vic2_draw_graphics();
1170         vic2_sample_border();
1171         vic2_graphics_access();
1172         vic2_fetch_if_bad_line();
1173         vic2_matrix_access();
1212         draw_graphics();
1213         sample_border();
1214         graphics_access();
1215         fetch_if_bad_line();
1216         matrix_access();
11741217         m_last_char_data = m_char_data;
11751218
11761219         m_cycle++;
r18706r18707
11781221
11791222      // Graphics, sprite y expansion, sprite DMA
11801223      case 55:
1181         vic2_draw_graphics();
1182         vic2_sample_border();
1183         vic2_graphics_access();
1184         vic2_display_if_bad_line();
1224         if (m_is_bad_line)
1225            set_ba(ASSERT_LINE);
11851226
1227         draw_graphics();
1228         sample_border();
1229         graphics_access();
1230         display_if_bad_line();
1231
11861232         // sprite y expansion
11871233         mask = 1;
11881234         for (i = 0; i < 8; i++, mask <<= 1)
11891235            if (SPRITE_Y_EXPAND (i))
11901236               m_spr_exp_y ^= mask;
11911237
1192         vic2_check_sprite_dma();
1238         check_sprite_dma();
11931239
1194         vic2_resume_cpu();
1195
11961240         m_cycle++;
11971241         break;
11981242
r18706r18707
12041248         // Fourth sample of border state
12051249         m_border_on_sample[3] = m_border_on;
12061250
1207         vic2_draw_graphics();
1208         vic2_sample_border();
1209         vic2_idle_access();
1210         vic2_display_if_bad_line();
1211         vic2_check_sprite_dma();
1251         draw_graphics();
1252         sample_border();
1253         idle_access();
1254         display_if_bad_line();
1255         check_sprite_dma();
12121256
12131257         m_cycle++;
12141258         break;
r18706r18707
12311275            if ((m_spr_disp_on & mask) && !(m_spr_dma_on & mask))
12321276               m_spr_disp_on &= ~mask;
12331277
1234         vic2_draw_background();
1235         vic2_sample_border();
1236         vic2_idle_access();
1237         vic2_display_if_bad_line();
1278         draw_background();
1279         sample_border();
1280         idle_access();
1281         display_if_bad_line();
12381282
1283         spr_ba(0);
1284
12391285         m_cycle++;
12401286         break;
12411287
12421288      // for NTSC 6567R8
12431289      case 58:
1244         vic2_draw_background();
1245         vic2_sample_border();
1246         vic2_idle_access();
1247         vic2_display_if_bad_line();
1290         draw_background();
1291         sample_border();
1292         idle_access();
1293         display_if_bad_line();
12481294
12491295         m_cycle++;
12501296         break;
12511297
12521298      // for NTSC 6567R8
12531299      case 59:
1254         vic2_draw_background();
1255         vic2_sample_border();
1256         vic2_idle_access();
1257         vic2_display_if_bad_line();
1300         draw_background();
1301         sample_border();
1302         idle_access();
1303         display_if_bad_line();
12581304
1305         spr_ba(1);
1306
12591307         m_cycle++;
12601308         break;
12611309
12621310      // Sprite 0, sprite DMA, MC, RC
12631311      case 60:
1264         vic2_draw_background();
1265         vic2_sample_border();
1312         draw_background();
1313         sample_border();
12661314
12671315         mask = 1;
12681316         for (i = 0; i < 8; i++, mask <<= 1)
r18706r18707
12721320               m_spr_disp_on |= mask;
12731321         }
12741322
1275         vic2_spr_ptr_access(0);
1276         vic2_spr_data_access(0, 0);
1323         spr_ptr_access(0);
1324         spr_data_access(0, 0);
12771325
12781326         if (m_rc == 7)
12791327         {
r18706r18707
12871335            m_rc = (m_rc + 1) & 7;
12881336         }
12891337
1290         if (m_spr_dma_on & 0x01)
1291            vic2_suspend_cpu();
1292         else
1293            vic2_resume_cpu();
1294
12951338         m_cycle++;
12961339         break;
12971340
12981341      // Sprite 0
12991342      case 61:
1300         vic2_draw_background();
1301         vic2_sample_border();
1302         vic2_spr_data_access(0, 1);
1303         vic2_spr_data_access(0, 2);
1304         vic2_display_if_bad_line();
1343         draw_background();
1344         sample_border();
1345         spr_data_access(0, 1);
1346         spr_data_access(0, 2);
1347         display_if_bad_line();
13051348
1349         spr_ba(2);
1350
13061351         m_cycle++;
13071352         break;
13081353
13091354      // Sprite 1, draw
13101355      case 62:
1311         vic2_draw_background();
1312         vic2_sample_border();
1356         draw_background();
1357         sample_border();
13131358
13141359         if (m_draw_this_line)
13151360         {
1316            vic2_draw_sprites();
1361            draw_sprites();
13171362
13181363            if (m_border_on_sample[0])
13191364               for (i = 0; i < 4; i++)
r18706r18707
13381383            }
13391384         }
13401385
1341         vic2_spr_ptr_access(1);
1342         vic2_spr_data_access(1, 0);
1343         vic2_display_if_bad_line();
1386         spr_ptr_access(1);
1387         spr_data_access(1, 0);
1388         display_if_bad_line();
13441389
1345         if (m_spr_dma_on & 0x02)
1346            vic2_suspend_cpu();
1347         else
1348            vic2_resume_cpu();
1349
13501390         m_cycle++;
13511391         break;
13521392
13531393      // Sprite 1
13541394      case 63:
1355         vic2_spr_data_access(1, 1);
1356         vic2_spr_data_access(1, 2);
1357         vic2_display_if_bad_line();
1395         spr_data_access(1, 1);
1396         spr_data_access(1, 2);
1397         display_if_bad_line();
13581398
1399         spr_ba(3);
1400
13591401         m_cycle++;
13601402         break;
13611403
13621404      // Sprite 2
13631405      case 64:
1364         vic2_spr_ptr_access(2);
1365         vic2_spr_data_access(2, 0);
1366         vic2_display_if_bad_line();
1406         spr_ptr_access(2);
1407         spr_data_access(2, 0);
1408         display_if_bad_line();
13671409
1368         if (m_spr_dma_on & 0x04)
1369            vic2_suspend_cpu();
1370         else
1371            vic2_resume_cpu();
1372
13731410         m_cycle++;
13741411         break;
13751412
13761413      // Sprite 2
13771414      case 65:
1378         vic2_spr_data_access(2, 1);
1379         vic2_spr_data_access(2, 2);
1380         vic2_display_if_bad_line();
1415         spr_data_access(2, 1);
1416         spr_data_access(2, 2);
1417         display_if_bad_line();
13811418
13821419         if (m_rasterline == m_dy_stop)
13831420            m_ud_border_on = 1;
r18706r18707
13851422            if (SCREENON && (m_rasterline == m_dy_start))
13861423               m_ud_border_on = 0;
13871424
1425         spr_ba(4);
1426
13881427         // Last cycle
13891428         m_cycle = 1;
13901429      }
1430     
1431      m_phi0 = 1;
1432      set_aec(BIT(m_aec_delay, 2));
13911433
1434      m_out_ba_func(m_ba);
1435      m_out_aec_func(m_aec);
1436
13921437      m_raster_x += 8;
1438      if (m_raster_x == 0x1fc) m_raster_x = 0x004;
1439
1440      if ((cpu_cycles == vic_cycles) && (m_rdy_cycles > 0))
1441      {
1442         m_cpu->spin_until_time(m_cpu->cycles_to_attotime(m_rdy_cycles));
1443         m_rdy_cycles = 0;
1444      }
1445
13931446      m_icount--;
13941447   } while (m_icount > 0);
13951448}
r18706r18707
14031456{
14041457   do
14051458   {
1459      UINT8 cpu_cycles = m_cpu->total_cycles() & 0xff;
1460      UINT8 vic_cycles = total_cycles() & 0xff;
1461
1462      m_phi0 = 0;
1463
1464      m_aec_delay <<= 1;
1465      m_aec_delay |= m_ba;
1466
1467      set_aec(CLEAR_LINE);
1468
14061469      int i;
14071470      UINT8 mask;
1408      //static int adjust[9] = {0, 0, 0, 0, 0, 0, 0, 0, 0};
14091471
1410      UINT8 cpu_cycles = m_cpu->total_cycles() & 0xff;
1411      UINT8 vic_cycles = (m_cycles_counter + 1) & 0xff;
1412      m_cycles_counter++;
1472      if ((m_rasterline == VIC2_FIRST_DMA_LINE) && !m_bad_lines_enabled)
1473         m_bad_lines_enabled = SCREENON;
14131474
1414   //  printf("%02x %02x %02x\n",cpu_cycles,vic_cycles,m_rdy_cycles);
1415   #if 0
1416   if (machine.input().code_pressed(KEYCODE_X))
1417   {
1418   if (machine.input().code_pressed_once(KEYCODE_Q)) adjust[1]++;
1419   if (machine.input().code_pressed_once(KEYCODE_W)) adjust[2]++;
1420   if (machine.input().code_pressed_once(KEYCODE_E)) adjust[3]++;
1421   if (machine.input().code_pressed_once(KEYCODE_R)) adjust[4]++;
1422   if (machine.input().code_pressed_once(KEYCODE_T)) adjust[5]++;
1423   if (machine.input().code_pressed_once(KEYCODE_Y)) adjust[6]++;
1424   if (machine.input().code_pressed_once(KEYCODE_U)) adjust[7]++;
1425   if (machine.input().code_pressed_once(KEYCODE_I)) adjust[8]++;
1426   if (machine.input().code_pressed_once(KEYCODE_A)) adjust[1]--;
1427   if (machine.input().code_pressed_once(KEYCODE_S)) adjust[2]--;
1428   if (machine.input().code_pressed_once(KEYCODE_D)) adjust[3]--;
1429   if (machine.input().code_pressed_once(KEYCODE_F)) adjust[4]--;
1430   if (machine.input().code_pressed_once(KEYCODE_G)) adjust[5]--;
1431   if (machine.input().code_pressed_once(KEYCODE_H)) adjust[6]--;
1432   if (machine.input().code_pressed_once(KEYCODE_J)) adjust[7]--;
1433   if (machine.input().code_pressed_once(KEYCODE_K)) adjust[8]--;
1434   if (machine.input().code_pressed_once(KEYCODE_C)) adjust[0]++;
1435   if (machine.input().code_pressed_once(KEYCODE_V)) adjust[0]--;
1436   if (machine.input().code_pressed_once(KEYCODE_Z)) printf("b:%02x 1:%02x 2:%02x 3:%02x 4:%02x 5:%02x 6:%02x 7:%02x 8:%02x\n",
1437                                   adjust[0],adjust[1],adjust[2],adjust[3],adjust[4],adjust[5],adjust[6],adjust[7],adjust[8]);
1438   }
1439   #define adjust(x) adjust[x]
1440   #else
1441   #define adjust(x) 0
1442   #endif
1475      m_is_bad_line = ((m_rasterline >= VIC2_FIRST_DMA_LINE) && (m_rasterline <= VIC2_LAST_DMA_LINE) &&
1476         ((m_rasterline & 0x07) == YSCROLL) && m_bad_lines_enabled);
14431477
1444      switch(m_cycle)
1478      switch (m_cycle)
14451479      {
1446
14471480      // Sprite 3, raster counter, raster IRQ, bad line
14481481      case 1:
14491482         if (m_rasterline == (VIC2_LINES - 1))
14501483         {
14511484            m_vblanking = 1;
1452
1453   //          if (LIGHTPEN_BUTTON)
1454            {
1455//               m_reg[0x13] = VIC2_X_VALUE;
1456//               m_reg[0x14] = VIC2_Y_VALUE;
1457            }
1458            vic2_set_interrupt(8);
14591485         }
14601486         else
14611487         {
14621488            m_rasterline++;
14631489
1464            if (m_rasterline == VIC2_FIRST_DMA_LINE)
1465               m_bad_lines_enabled = SCREENON;
1466
1467            m_is_bad_line = ((m_rasterline >= VIC2_FIRST_DMA_LINE) && (m_rasterline <= VIC2_LAST_DMA_LINE) &&
1468                     ((m_rasterline & 0x07) == VERTICALPOS) && m_bad_lines_enabled);
1469
14701490            m_draw_this_line =   ((VIC2_RASTER_2_EMU(m_rasterline) >= VIC2_RASTER_2_EMU(VIC2_FIRST_DISP_LINE)) &&
14711491                     (VIC2_RASTER_2_EMU(m_rasterline ) <= VIC2_RASTER_2_EMU(VIC2_LAST_DISP_LINE)));
14721492         }
14731493
14741494         m_border_on_sample[0] = m_border_on;
1475         vic2_spr_ptr_access(3);
1476         vic2_spr_data_access(3, 0);
1477         vic2_display_if_bad_line();
1495         spr_ptr_access(3);
1496         spr_data_access(3, 0);
1497         display_if_bad_line();
14781498
1479         if (m_spr_dma_on & 0x08)
1480            vic2_suspend_cpu();
1481         else
1482            vic2_resume_cpu();
1483
1484         if (m_spr_dma_on & 0x08) m_rdy_cycles += (2 + adjust(1));
1485
14861499         m_cycle++;
14871500         break;
14881501
14891502      // Sprite 3
14901503      case 2:
1504         spr_ba(5);
1505
14911506         if (m_vblanking)
14921507         {
14931508            // Vertical blank, reset counters
r18706r18707
14981513            // Trigger raster IRQ if IRQ in line 0
14991514            if (RASTERLINE == 0)
15001515            {
1501               vic2_set_interrupt(1);
1516               set_interrupt(IRQ_RST);
15021517            }
15031518         }
15041519
15051520         if (m_rasterline == RASTERLINE)
15061521         {
1507            vic2_set_interrupt(1);
1522            set_interrupt(IRQ_RST);
15081523         }
15091524
15101525         m_graphic_x = VIC2_X_2_EMU(0);
15111526
1512         vic2_spr_data_access(3, 1);
1513         vic2_spr_data_access(3, 2);
1514         vic2_display_if_bad_line();
1527         spr_data_access(3, 1);
1528         spr_data_access(3, 2);
1529         display_if_bad_line();
15151530
15161531         m_cycle++;
15171532         break;
15181533
15191534      // Sprite 4
15201535      case 3:
1521         vic2_spr_ptr_access(4);
1522         vic2_spr_data_access(4, 0);
1523         vic2_display_if_bad_line();
1536         spr_ptr_access(4);
1537         spr_data_access(4, 0);
1538         display_if_bad_line();
15241539
1525         if (m_spr_dma_on & 0x10)
1526            vic2_suspend_cpu();
1527         else
1528            vic2_resume_cpu();
1529
1530         if (m_spr_dma_on & 0x10) m_rdy_cycles += (2 + adjust(2));
1531
15321540         m_cycle++;
15331541         break;
15341542
15351543      // Sprite 4
15361544      case 4:
1537         vic2_spr_data_access(4, 1);
1538         vic2_spr_data_access(4, 2);
1539         vic2_display_if_bad_line();
1545         spr_ba(6);
15401546
1547         spr_data_access(4, 1);
1548         spr_data_access(4, 2);
1549         display_if_bad_line();
1550
15411551         m_cycle++;
15421552         break;
15431553
15441554      // Sprite 5
15451555      case 5:
1546         vic2_spr_ptr_access(5);
1547         vic2_spr_data_access(5, 0);
1548         vic2_display_if_bad_line();
1556         spr_ptr_access(5);
1557         spr_data_access(5, 0);
1558         display_if_bad_line();
15491559
1550         if (m_spr_dma_on & 0x20)
1551            vic2_suspend_cpu();
1552         else
1553            vic2_resume_cpu();
1554
1555         if (m_spr_dma_on & 0x20) m_rdy_cycles += (2 + adjust(3));
1556
15571560         m_cycle++;
15581561         break;
15591562
15601563      // Sprite 5
15611564      case 6:
1562         vic2_spr_data_access(5, 1);
1563         vic2_spr_data_access(5, 2);
1564         vic2_display_if_bad_line();
1565         spr_ba(7);
15651566
1567         spr_data_access(5, 1);
1568         spr_data_access(5, 2);
1569         display_if_bad_line();
1570
15661571         m_cycle++;
15671572         break;
15681573
15691574      // Sprite 6
15701575      case 7:
1571         vic2_spr_ptr_access(6);
1572         vic2_spr_data_access(6, 0);
1573         vic2_display_if_bad_line();
1576         spr_ptr_access(6);
1577         spr_data_access(6, 0);
1578         display_if_bad_line();
15741579
1575         if (m_spr_dma_on & 0x40)
1576            vic2_suspend_cpu();
1577         else
1578            vic2_resume_cpu();
1579
1580         if (m_spr_dma_on & 0x40) m_rdy_cycles += (2 + adjust(4));
1581
15821580         m_cycle++;
15831581         break;
15841582
15851583      // Sprite 6
15861584      case 8:
1587         vic2_spr_data_access(6, 1);
1588         vic2_spr_data_access(6, 2);
1589         vic2_display_if_bad_line();
1585         spr_data_access(6, 1);
1586         spr_data_access(6, 2);
1587         display_if_bad_line();
15901588
15911589         m_cycle++;
15921590         break;
15931591
15941592      // Sprite 7
15951593      case 9:
1596         vic2_spr_ptr_access(7);
1597         vic2_spr_data_access(7, 0);
1598         vic2_display_if_bad_line();
1594         spr_ptr_access(7);
1595         spr_data_access(7, 0);
1596         display_if_bad_line();
15991597
1600         if (m_spr_dma_on & 0x80)
1601            vic2_suspend_cpu();
1602         else
1603            vic2_resume_cpu();
1604
1605         if (m_spr_dma_on & 0x80) m_rdy_cycles += (2 + adjust(5));
1606
16071598         m_cycle++;
16081599         break;
16091600
16101601      // Sprite 7
16111602      case 10:
1612         vic2_spr_data_access(7, 1);
1613         vic2_spr_data_access(7, 2);
1614         vic2_display_if_bad_line();
1603         spr_data_access(7, 1);
1604         spr_data_access(7, 2);
1605         display_if_bad_line();
16151606
1607         set_ba(ASSERT_LINE);
1608
16161609         m_cycle++;
16171610         break;
16181611
16191612      // Refresh
16201613      case 11:
1621         vic2_refresh_access();
1622         vic2_display_if_bad_line();
1614         refresh_access();
1615         display_if_bad_line();
16231616
1624         vic2_resume_cpu();
1625
16261617         m_cycle++;
16271618         break;
16281619
16291620      // Refresh, fetch if bad line
16301621      case 12:
1631         vic2_refresh_access();
1632         vic2_fetch_if_bad_line();
1622         bad_line_ba();
16331623
1624         refresh_access();
1625         fetch_if_bad_line();
1626
16341627         m_cycle++;
16351628         break;
16361629
16371630      // Refresh, fetch if bad line, raster_x
16381631      case 13:
1639         vic2_draw_background();
1640         vic2_sample_border();
1641         vic2_refresh_access();
1642         vic2_fetch_if_bad_line();
1632         bad_line_ba();
16431633
1644         m_raster_x = 0xfffc;
1634         draw_background();
1635         sample_border();
1636         refresh_access();
1637         fetch_if_bad_line();
16451638
1646//         if ((m_in_rdy_workaround_func(0) == 0 ) && (m_is_bad_line))
1647//            m_rdy_cycles += (43+adjust(0));
1648
16491639         m_cycle++;
16501640         break;
16511641
16521642      // Refresh, fetch if bad line, RC, VC
16531643      case 14:
1654         vic2_draw_background();
1655         vic2_sample_border();
1656         vic2_refresh_access();
1657         vic2_rc_if_bad_line();
1644         bad_line_ba();
16581645
1646         draw_background();
1647         sample_border();
1648         refresh_access();
1649         rc_if_bad_line();
1650
16591651         m_vc = m_vc_base;
16601652
1661//         if ((m_in_rdy_workaround_func(0) == 1 ) && (m_is_bad_line))
1662//            m_rdy_cycles += (42+adjust(0));
1663
16641653         m_cycle++;
16651654         break;
16661655
16671656      // Refresh, fetch if bad line, sprite y expansion
16681657      case 15:
1669         vic2_draw_background();
1670         vic2_sample_border();
1671         vic2_refresh_access();
1672         vic2_fetch_if_bad_line();
1658         bad_line_ba();
16731659
1660         draw_background();
1661         sample_border();
1662         refresh_access();
1663         fetch_if_bad_line();
1664
16741665         for (i = 0; i < 8; i++)
16751666            if (m_spr_exp_y & (1 << i))
16761667               m_mc_base[i] += 2;
16771668
16781669         m_ml_index = 0;
1679         vic2_matrix_access();
16801670
1681//         if ((m_in_rdy_workaround_func(0) == 2 ) && (m_is_bad_line))
1682//            m_rdy_cycles += (41+adjust(0));
1671         matrix_access();
16831672
16841673         m_cycle++;
16851674         break;
16861675
16871676      // Graphics, sprite y expansion, sprite DMA
16881677      case 16:
1689         vic2_draw_background();
1690         vic2_sample_border();
1691         vic2_graphics_access();
1692         vic2_fetch_if_bad_line();
1678         bad_line_ba();
16931679
1680         draw_background();
1681         sample_border();
1682         graphics_access();
1683         fetch_if_bad_line();
1684
16941685         mask = 1;
16951686         for (i = 0; i < 8; i++, mask <<= 1)
16961687         {
1697            if (m_spr_exp_y & mask)
1688            if (m_spr_exp_y & (1 << i))
16981689               m_mc_base[i]++;
16991690            if ((m_mc_base[i] & 0x3f) == 0x3f)
17001691               m_spr_dma_on &= ~mask;
17011692         }
17021693
1703         vic2_matrix_access();
1694         matrix_access();
17041695
1705//         if ((m_in_rdy_workaround_func(0) == 3 ) && (m_is_bad_line))
1706//            m_rdy_cycles += (40+adjust(0));
1707
17081696         m_cycle++;
17091697         break;
17101698
17111699      // Graphics, check border
17121700      case 17:
1701         bad_line_ba();
1702
17131703         if (COLUMNS40)
17141704         {
17151705            if (m_rasterline == m_dy_stop)
r18706r18707
17321722         // Second sample of border state
17331723         m_border_on_sample[1] = m_border_on;
17341724
1735         vic2_draw_background();
1736         vic2_draw_graphics();
1737         vic2_sample_border();
1738         vic2_graphics_access();
1739         vic2_fetch_if_bad_line();
1740         vic2_matrix_access();
1725         draw_background();
1726         draw_graphics();
1727         sample_border();
1728         graphics_access();
1729         fetch_if_bad_line();
1730         matrix_access();
17411731
1742//         if ((m_in_rdy_workaround_func(0) == 4 ) && (m_is_bad_line))
1743//            m_rdy_cycles += (40+adjust(0));
1744
17451732         m_cycle++;
17461733         break;
17471734
17481735      // Check border
17491736      case 18:
1737         bad_line_ba();
1738
17501739         if (!COLUMNS40)
17511740         {
17521741            if (m_rasterline == m_dy_stop)
r18706r18707
18071796      case 52:
18081797      case 53:
18091798      case 54:
1810         vic2_draw_graphics();
1811         vic2_sample_border();
1812         vic2_graphics_access();
1813         vic2_fetch_if_bad_line();
1814         vic2_matrix_access();
1799         bad_line_ba();
1800
1801         draw_graphics();
1802         sample_border();
1803         graphics_access();
1804         fetch_if_bad_line();
1805         matrix_access();
18151806         m_last_char_data = m_char_data;
18161807
18171808         m_cycle++;
r18706r18707
18191810
18201811      // Graphics, sprite y expansion, sprite DMA
18211812      case 55:
1822         vic2_draw_graphics();
1823         vic2_sample_border();
1824         vic2_graphics_access();
1825         vic2_display_if_bad_line();
1813         if (m_is_bad_line)
1814            set_ba(ASSERT_LINE);
18261815
1816         draw_graphics();
1817         sample_border();
1818         graphics_access();
1819         display_if_bad_line();
1820
18271821         // sprite y expansion
18281822         mask = 1;
18291823         for (i = 0; i < 8; i++, mask <<= 1)
18301824            if (SPRITE_Y_EXPAND (i))
18311825               m_spr_exp_y ^= mask;
18321826
1833         vic2_check_sprite_dma();
1827         check_sprite_dma();
18341828
1835         vic2_resume_cpu();
1836
1829         spr_ba(0);
1830   
18371831         m_cycle++;
18381832         break;
18391833
r18706r18707
18451839         // Fourth sample of border state
18461840         m_border_on_sample[3] = m_border_on;
18471841
1848         vic2_draw_graphics();
1849         vic2_sample_border();
1850         vic2_idle_access();
1851         vic2_display_if_bad_line();
1852         vic2_check_sprite_dma();
1842         draw_graphics();
1843         sample_border();
1844         idle_access();
1845         display_if_bad_line();
1846         check_sprite_dma();
18531847
18541848         m_cycle++;
18551849         break;
18561850
18571851      // Check border, sprites
18581852      case 57:
1853         spr_ba(1);
1854
18591855         if (COLUMNS40)
18601856            m_border_on = 1;
18611857
r18706r18707
18721868            if ((m_spr_disp_on & mask) && !(m_spr_dma_on & mask))
18731869               m_spr_disp_on &= ~mask;
18741870
1875         vic2_draw_background();
1876         vic2_sample_border();
1877         vic2_idle_access();
1878         vic2_display_if_bad_line();
1871         draw_background();
1872         sample_border();
1873         idle_access();
1874         display_if_bad_line();
18791875
18801876         m_cycle++;
18811877         break;
18821878
18831879      // Sprite 0, sprite DMA, MC, RC
18841880      case 58:
1885         vic2_draw_background();
1886         vic2_sample_border();
1881         draw_background();
1882         sample_border();
18871883
18881884         mask = 1;
18891885         for (i = 0; i < 8; i++, mask <<= 1)
r18706r18707
18931889               m_spr_disp_on |= mask;
18941890         }
18951891
1896         vic2_spr_ptr_access(0);
1897         vic2_spr_data_access(0, 0);
1892         spr_ptr_access(0);
1893         spr_data_access(0, 0);
18981894
18991895         if (m_rc == 7)
19001896         {
r18706r18707
19081904            m_rc = (m_rc + 1) & 7;
19091905         }
19101906
1911         if (m_spr_dma_on & 0x01)
1912            vic2_suspend_cpu();
1913         else
1914            vic2_resume_cpu();
1915
1916         if (m_spr_dma_on & 0x01) m_rdy_cycles += (2 + adjust(6));
1917
19181907         m_cycle++;
19191908         break;
19201909
19211910      // Sprite 0
19221911      case 59:
1923         vic2_draw_background();
1924         vic2_sample_border();
1925         vic2_spr_data_access(0, 1);
1926         vic2_spr_data_access(0, 2);
1927         vic2_display_if_bad_line();
1912         spr_ba(2);
19281913
1914         draw_background();
1915         sample_border();
1916         spr_data_access(0, 1);
1917         spr_data_access(0, 2);
1918         display_if_bad_line();
1919
19291920         m_cycle++;
19301921         break;
19311922
19321923      // Sprite 1, draw
19331924      case 60:
1934         vic2_draw_background();
1935         vic2_sample_border();
1925         draw_background();
1926         sample_border();
19361927
19371928         if (m_draw_this_line)
19381929         {
1939            vic2_draw_sprites();
1930            draw_sprites();
19401931
19411932            if (m_border_on_sample[0])
19421933               for (i = 0; i < 4; i++)
r18706r18707
19611952            }
19621953         }
19631954
1964         vic2_spr_ptr_access(1);
1965         vic2_spr_data_access(1, 0);
1966         vic2_display_if_bad_line();
1955         spr_ptr_access(1);
1956         spr_data_access(1, 0);
1957         display_if_bad_line();
19671958
1968         if (m_spr_dma_on & 0x02)
1969            vic2_suspend_cpu();
1970         else
1971            vic2_resume_cpu();
1972
1973         if (m_spr_dma_on & 0x02) m_rdy_cycles += (2 + adjust(7));
1974
19751959         m_cycle++;
19761960         break;
19771961
19781962      // Sprite 1
19791963      case 61:
1980         vic2_spr_data_access(1, 1);
1981         vic2_spr_data_access(1, 2);
1982         vic2_display_if_bad_line();
1964         spr_ba(3);
19831965
1966         spr_data_access(1, 1);
1967         spr_data_access(1, 2);
1968         display_if_bad_line();
1969
19841970         m_cycle++;
19851971         break;
19861972
19871973      // Sprite 2
19881974      case 62:
1989         vic2_spr_ptr_access(2);
1990         vic2_spr_data_access(2, 0);
1991         vic2_display_if_bad_line();
1975         spr_ptr_access(2);
1976         spr_data_access(2, 0);
1977         display_if_bad_line();
19921978
1993         if (m_spr_dma_on & 0x04)
1994            vic2_suspend_cpu();
1995         else
1996            vic2_resume_cpu();
1997
1998         if (m_spr_dma_on & 0x04) m_rdy_cycles += (2 + adjust(8));
1999
20001979         m_cycle++;
20011980         break;
20021981
20031982      // Sprite 2
20041983      case 63:
2005         vic2_spr_data_access(2, 1);
2006         vic2_spr_data_access(2, 2);
2007         vic2_display_if_bad_line();
1984         spr_ba(4);
20081985
1986         spr_data_access(2, 1);
1987         spr_data_access(2, 2);
1988         display_if_bad_line();
1989
20091990         if (m_rasterline == m_dy_stop)
20101991            m_ud_border_on = 1;
20111992         else
r18706r18707
20151996         // Last cycle
20161997         m_cycle = 1;
20171998      }
1999     
2000      m_phi0 = 1;
2001      set_aec(BIT(m_aec_delay, 2));
20182002
2003      m_out_ba_func(m_ba);
2004      m_out_aec_func(m_aec);
2005
2006      m_raster_x += 8;
2007      if (m_raster_x == 0x1fc) m_raster_x = 0x004;
2008
20192009      if ((cpu_cycles == vic_cycles) && (m_rdy_cycles > 0))
20202010      {
20212011         m_cpu->spin_until_time(m_cpu->cycles_to_attotime(m_rdy_cycles));
20222012         m_rdy_cycles = 0;
20232013      }
20242014
2025      m_raster_x += 8;
20262015      m_icount--;
20272016   } while (m_icount > 0);
20282017}
20292018
20302019// Graphics display (8 pixels)
2031void mos6566_device::vic2_draw_graphics()
2020void mos6566_device::draw_graphics()
20322021{
20332022   if (m_draw_this_line == 0)
20342023   {
2035      UINT16 p = m_graphic_x + HORIZONTALPOS;
2024      UINT16 p = m_graphic_x + XSCROLL;
20362025      m_fore_coll_buf[p + 7] = 0;
20372026      m_fore_coll_buf[p + 6] = 0;
20382027      m_fore_coll_buf[p + 5] = 0;
r18706r18707
20442033   }
20452034   else if (m_ud_border_on)
20462035   {
2047      UINT16 p = m_graphic_x + HORIZONTALPOS;
2036      UINT16 p = m_graphic_x + XSCROLL;
20482037      m_fore_coll_buf[p + 7] = 0;
20492038      m_fore_coll_buf[p + 6] = 0;
20502039      m_fore_coll_buf[p + 5] = 0;
r18706r18707
20532042      m_fore_coll_buf[p + 2] = 0;
20542043      m_fore_coll_buf[p + 1] = 0;
20552044      m_fore_coll_buf[p + 0] = 0;
2056      vic2_draw_background();
2045      draw_background();
20572046   }
20582047   else
20592048   {
20602049      UINT8 tmp_col;
2061      UINT16 p = m_graphic_x + HORIZONTALPOS;
2050      UINT16 p = m_graphic_x + XSCROLL;
20622051      switch (GFXMODE)
20632052      {
20642053         case 0:
2065            vic2_draw_mono(p, m_colors[0], m_color_data & 0x0f);
2054            draw_mono(p, m_colors[0], m_color_data & 0x0f);
20662055            break;
20672056         case 1:
20682057            if (m_color_data & 0x08)
2069               vic2_draw_multi(p, m_colors[0], m_colors[1], m_colors[2], m_color_data & 0x07);
2058               draw_multi(p, m_colors[0], m_colors[1], m_colors[2], m_color_data & 0x07);
20702059            else
2071               vic2_draw_mono(p, m_colors[0], m_color_data & 0x0f);
2060               draw_mono(p, m_colors[0], m_color_data & 0x0f);
20722061            break;
20732062         case 2:
2074            vic2_draw_mono(p, m_char_data & 0x0f, m_char_data >> 4);
2063            draw_mono(p, m_char_data & 0x0f, m_char_data >> 4);
20752064            break;
20762065         case 3:
2077            vic2_draw_multi(p, m_colors[0], m_char_data >> 4, m_char_data & 0x0f, m_color_data & 0x0f);
2066            draw_multi(p, m_colors[0], m_char_data >> 4, m_char_data & 0x0f, m_color_data & 0x0f);
20782067            break;
20792068         case 4:
20802069            if (m_char_data & 0x80)
r18706r18707
20872076                  tmp_col = m_colors[1];
20882077               else
20892078                  tmp_col = m_colors[0];
2090            vic2_draw_mono(p, tmp_col, m_color_data & 0x0f);
2079            draw_mono(p, tmp_col, m_color_data & 0x0f);
20912080            break;
20922081         case 5:
20932082            m_bitmap.pix32(VIC2_RASTER_2_EMU(m_rasterline), p + 7) = PALETTE[0];
r18706r18707
21472136   }
21482137}
21492138
2150void mos6566_device::vic2_draw_sprites()
2139void mos6566_device::draw_sprites()
21512140{
21522141   int i;
21532142   UINT8 snum, sbit;
r18706r18707
24272416   {
24282417      SPRITE_COLL = spr_coll;
24292418      if (SPRITE_COLL)
2430         vic2_set_interrupt(4);
2419         set_interrupt(IRQ_MMC);
24312420   }
24322421
24332422   if (SPRITE_BG_COLL)
r18706r18707
24362425   {
24372426      SPRITE_BG_COLL = gfx_coll;
24382427      if (SPRITE_BG_COLL)
2439         vic2_set_interrupt(2);
2428         set_interrupt(IRQ_MBC);
24402429   }
24412430}
24422431
r18706r18707
24852474      break;
24862475
24872476   case 0x19:                     /* interrupt flag register */
2488      /* vic2_clear_interrupt(0xf); */
2477      /* clear_interrupt(0xf); */
24892478      val = m_reg[offset] | 0x70;
24902479      break;
24912480
r18706r18707
24962485   case 0x1e:                     /* sprite to sprite collision detect */
24972486      val = m_reg[offset];
24982487      m_reg[offset] = 0;
2499      vic2_clear_interrupt(4);
2488      clear_interrupt(4);
25002489      break;
25012490
25022491   case 0x1f:                     /* sprite to background collision detect */
25032492      val = m_reg[offset];
25042493      m_reg[offset] = 0;
2505      vic2_clear_interrupt(2);
2494      clear_interrupt(2);
25062495      break;
25072496
25082497   case 0x20:
r18706r18707
26872676      break;
26882677
26892678   case 0x19:
2690      vic2_clear_interrupt(data & 0x0f);
2679      clear_interrupt(data & 0x0f);
26912680      break;
26922681
26932682   case 0x1a:                     /* irq mask */
26942683      m_reg[offset] = data;
2695      vic2_set_interrupt(0);   // beamrider needs this
2684      set_interrupt(0);   // beamrider needs this
26962685      break;
26972686
26982687   case 0x11:
r18706r18707
27902779         if (BIT(m_reg[offset], 0) != BIT(data, 0))
27912780         {
27922781            m_cpu->set_unscaled_clock(clock() << BIT(data, 0));
2793            printf("clock %u\n",clock() << BIT(data, 0));
27942782         }
27952783         
27962784         m_reg[offset] = data | 0xfc;
r18706r18707
28312819
28322820WRITE_LINE_MEMBER( mos6566_device::lp_w )
28332821{
2822   if (m_lp && !state && !(m_reg[REGISTER_IRQ] & IRQ_LP))
2823   {
2824      m_reg[REGISTER_LPX] = m_raster_x >> 1;
2825      m_reg[REGISTER_LPY] = m_rasterline;
2826
2827      set_interrupt(IRQ_LP);
2828   }
2829
2830   m_lp = state;
28342831}
28352832
28362833
28372834//-------------------------------------------------
2835//  phi0_r - phi 0
2836//-------------------------------------------------
2837
2838READ_LINE_MEMBER( mos6566_device::phi0_r )
2839{
2840   return m_phi0;
2841}
2842
2843
2844//-------------------------------------------------
2845//  ba_r - bus available
2846//-------------------------------------------------
2847
2848READ_LINE_MEMBER( mos6566_device::ba_r )
2849{
2850   return m_ba;
2851}
2852
2853
2854//-------------------------------------------------
2855//  aec_r - address enable control
2856//-------------------------------------------------
2857
2858READ_LINE_MEMBER( mos6566_device::aec_r )
2859{
2860   return m_aec;
2861}
2862
2863
2864//-------------------------------------------------
28382865//  bus_r - data bus read
28392866//-------------------------------------------------
28402867
trunk/src/mess/video/mos6566.h
r18706r18707
289289   const char         *m_cpu_tag;
290290
291291   devcb_write_line   m_out_irq_cb;
292   devcb_write_line   m_out_rdy_cb;
292   devcb_write_line   m_out_ba_cb;
293   devcb_write_line   m_out_aec_cb;
293294
294295   devcb_write8      m_out_k_cb;
295296};
r18706r18707
313314   DECLARE_WRITE8_MEMBER( write );
314315
315316   DECLARE_WRITE_LINE_MEMBER( lp_w );
317   
318   DECLARE_READ_LINE_MEMBER( phi0_r );
319   DECLARE_READ_LINE_MEMBER( ba_r );
320   DECLARE_READ_LINE_MEMBER( aec_r );
316321
317322   UINT8 bus_r();
318323
r18706r18707
346351   const address_space_config      m_videoram_space_config;
347352   const address_space_config      m_colorram_space_config;
348353
349   inline void vic2_set_interrupt( int mask );
350   inline void vic2_clear_interrupt( int mask );
354   inline void set_interrupt( int mask );
355   inline void clear_interrupt( int mask );
356   inline void set_ba(int state);
357   inline void set_aec(int state);
358   inline void bad_line_ba();
351359   inline UINT8 read_videoram(offs_t offset);
352360   inline UINT8 read_colorram(offs_t offset);
353   inline void vic2_idle_access();
354   inline void vic2_spr_ptr_access( int num );
355   inline void vic2_spr_data_access( int num, int bytenum );
356   inline void vic2_display_if_bad_line();
357   inline void vic2_suspend_cpu();
358   inline void vic2_resume_cpu();
359   inline void vic2_refresh_access();
360   inline void vic2_fetch_if_bad_line();
361   inline void vic2_rc_if_bad_line();
362   inline void vic2_sample_border();
363   inline void vic2_check_sprite_dma();
364   inline void vic2_matrix_access();
365   inline void vic2_graphics_access();
366   inline void vic2_draw_background();
367   inline void vic2_draw_mono( UINT16 p, UINT8 c0, UINT8 c1 );
368   inline void vic2_draw_multi( UINT16 p, UINT8 c0, UINT8 c1, UINT8 c2, UINT8 c3 );
369   void vic2_draw_graphics();
370   void vic2_draw_sprites();
361   inline void idle_access();
362   inline void spr_ba(int num);
363   inline void spr_ptr_access( int num );
364   inline void spr_data_access( int num, int bytenum );
365   inline void display_if_bad_line();
366   inline void refresh_access();
367   inline void fetch_if_bad_line();
368   inline void rc_if_bad_line();
369   inline void sample_border();
370   inline void check_sprite_dma();
371   inline void matrix_access();
372   inline void graphics_access();
373   inline void draw_background();
374   inline void draw_mono( UINT16 p, UINT8 c0, UINT8 c1 );
375   inline void draw_multi( UINT16 p, UINT8 c0, UINT8 c1, UINT8 c2, UINT8 c3 );
376   void draw_graphics();
377   void draw_sprites();
371378
372379   screen_device *m_screen;         // screen which sets bitmap properties
373380   cpu_device *m_cpu;
374381
375   UINT8 m_rdy_cycles;
382   int m_phi0;
383   int m_ba;
384   int m_aec;
385   UINT8 m_aec_delay;
386   int m_rdy_cycles;
387
376388   UINT8 m_reg[0x80];
377389
378390   int m_on;                        /* rastering of the screen */
r18706r18707
384396   UINT16 m_colors[4], m_spritemulti[4];
385397
386398   int m_rasterline;
387   UINT64 m_cycles_counter;
388399   UINT8 m_cycle;
389400   UINT16 m_raster_x;
390401   UINT16 m_graphic_x;
391402   UINT8 m_last_data;
403   int m_lp;
392404
393405   /* convert multicolor byte to background/foreground for sprite collision */
394406   UINT16 m_expandx[256];
r18706r18707
440452   UINT8 m_device_suspended;
441453
442454   devcb_resolved_write_line      m_out_irq_func;
443   devcb_resolved_write_line      m_out_rdy_func;
455   devcb_resolved_write_line      m_out_ba_func;
456   devcb_resolved_write_line      m_out_aec_func;
444457   devcb_resolved_write8         m_out_k_func;
445458};
446459
trunk/src/mess/mess.lst
r18706r18707
583583vic1001   // Commodore VIC-1001 (Japan)
584584vic20    // Commodore VIC 20 (NTSC)
585585vic20p   // Commodore VIC 20 (PAL)
586vic20s   // Commodore VIC 20 (Swedish Expanson Kit)
586vic20_se   // Commodore VIC 20 (Swedish Expanson Kit)
587587
588588vic10      // Commodore Max Machine (Japan)
589c64n
589c64
590590c64p   // Commodore 64 (PAL)
591c64j   // Commodore 64 (Japan)
592c64sw   // Commodore 64 (Sweden)
591c64_jp   // Commodore 64 (Japan)
592c64_se   // Commodore 64 (Sweden)
593593pet64    // Commodore PET 64
594594edu64    // Commodore Educator 64
595595//  clipper  // C64 in a briefcase with 3" floppy, electroluminescent flat screen, thermal printer
596596//  tesa6240  //  modified SX64 with label printer
597sx64n
597sx64
598598sx64p
599599
600600vip64    // Commodore VIP64 (SX64, PAL, Swedish)
601601dx64    // Commodore DX-64 - Prototype
602c64cn     // Commodore 64C (NTSC)
602c64c     // Commodore 64C (NTSC)
603603c64cp   // Commodore 64C (PAL)
604c64csw
604c64c_se
605605c64g     // Commodore 64G (PAL)
606606c64gs    // Commodore 64 Games System
607607c64dtv    // Commodore 64 Direct-to-TV
r18706r18707
620620cbm720   // Commodore CBM 720
621621cbm720sw  // Commodore CBM 720 (Sweden / Finland)
622622cbm730
623p500n     // Commodore P500 (proto, a.k.a. C128-40, PET-II)
623p500     // Commodore P500 (proto, a.k.a. C128-40, PET-II)
624624p500p
625625
626626c264
627plus4n
627plus4
628628plus4p
629c16n
629c16
630630c16p
631c16h
631c16_hu
632632c116
633633c232
634634v364
trunk/src/mess/drivers/c128.c
r18706r18707
22
33    TODO:
44
5   - charom address
6   - VDC colors
5   - FROM and some cartridges don't work (IDE64)
76    - connect CAPS LOCK to charom A12 on international variants
87   - DCR models won't boot with 1571CR drive
98    - fix fast serial
r18706r18707
7877   int _128_256 = 1;
7978   int dmaack = 1;
8079   int vicfix = 1;
81   int clk = 1;
80   int sphi2 = m_vic->phi0_r();
8281
83   m_game = m_exp->game_r(ca, ba, rw, m_hiram);
84   m_exrom = m_exp->exrom_r(ca, ba, rw, m_hiram);
82   m_game = m_exp->game_r(ca, sphi2, ba, rw, m_hiram);
83   m_exrom = m_exp->exrom_r(ca, sphi2, ba, rw, m_hiram);
8584
86   UINT32 input = clk << 26 | m_va14 << 25 | m_charen << 24 |
85   UINT32 input = sphi2 << 26 | m_va14 << 25 | m_charen << 24 |
8786      m_hiram << 23 | m_loram << 22 | ba << 21 | VMA5 << 20 | VMA4 << 19 | ms0 << 18 | ms1 << 17 | ms2 << 16 |
8887      m_exrom << 15 | m_game << 14 | rw << 13 | aec << 12 | A10 << 11 | A11 << 10 | A12 << 9 | A13 << 8 |
8988      A14 << 7 | A15 << 6 | z80io << 5 | m_z80en << 4 | ms3 << 3 | vicfix << 2 | dmaack << 1 | _128_256;
r18706r18707
123122   int sden = 1, dir = 1, gwe = 1, rom1 = 1, rom2 = 1, rom3 = 1, rom4 = 1, charom = 1, colorram = 1, vic = 1,
124123      from1 = 1, romh = 1, roml = 1, dwe = 1, ioacc = 1, clrbank = 1, iocs = 1, casenb = 1;
125124   int io1 = 1, io2 = 1;
125   int sphi2 = m_vic->phi0_r();
126126
127127   UINT8 data = 0xff;
128128
r18706r18707
138138   }
139139   else
140140   {
141      ta &= ~0xf00;
141142      ta |= (vma & 0xf00);
142143      ma = (!m_va15 << 15) | (!m_va14 << 14) | vma;
143144      sa = vma & 0xff;
144145   }
145146
146   offs_t ca = ta | (offset & 0xff);
147   offs_t ca = ta | sa;
147148
148149   read_pla(offset, ca, vma, ba, rw, aec, z80io, ms3, ms2, ms1, ms0,
149150      &sden, &dir, &gwe, &rom1, &rom2, &rom3, &rom4, &charom, &colorram, &vic,
r18706r18707
231232      }
232233   }
233234
234   data = m_exp->cd_r(space, ca, data, ba, roml, romh, io1, io2);
235   data = m_exp->cd_r(space, ca, data, sphi2, ba, roml, romh, io1, io2);
235236
236237   return m_mmu->read(offset, data);
237238}
r18706r18707
247248   int sden = 1, dir = 1, gwe = 1, rom1 = 1, rom2 = 1, rom3 = 1, rom4 = 1, charom = 1, colorram = 1, vic = 1,
248249      from1 = 1, romh = 1, roml = 1, dwe = 1, ioacc = 1, clrbank = 1, iocs = 1, casenb = 1;
249250   int io1 = 1, io2 = 1;
251   int sphi2 = m_vic->phi0_r();
250252
251253   offs_t ta = m_mmu->ta_r(offset, aec, &ms0, &ms1, &ms2, &ms3, &cas0, &cas1);
252254   offs_t ca = ta | (offset & 0xff);
r18706r18707
313315      }
314316   }
315317
316   m_exp->cd_w(space, ca, data, ba, roml, romh, io1, io2);
318   m_exp->cd_w(space, ca, data, sphi2, ba, roml, romh, io1, io2);
317319
318320   m_mmu->write(space, offset, data);
319321}
r18706r18707
833835   M8502_TAG,
834836   DEVCB_DRIVER_LINE_MEMBER(c128_state, vic_irq_w),
835837   DEVCB_NULL,
838   DEVCB_NULL,
836839   DEVCB_DRIVER_MEMBER(c128_state, vic_k_w)
837840};
838841
r18706r18707
843846
844847READ8_MEMBER( c128_state::sid_potx_r )
845848{
846   UINT8 cia1_pa = m_cia1->pa_r();
849   UINT8 data = 0xff;
847850
848   int sela = BIT(cia1_pa, 6);
849   int selb = BIT(cia1_pa, 7);
851   switch (m_cia1->pa_r() >> 6)
852   {
853   case 1: data = m_joy1->pot_x_r(); break;
854   case 2: data = m_joy2->pot_x_r(); break;
855   case 3: break; // TODO pot1 and pot2 in series
856   }
850857
851   UINT8 data = 0;
852
853   if (sela) data = m_joy1->pot_x_r();
854   if (selb) data = m_joy2->pot_x_r();
855
856858   return data;
857859}
858860
859861READ8_MEMBER( c128_state::sid_poty_r )
860862{
861   UINT8 cia1_pa = m_cia1->pa_r();
863   UINT8 data = 0xff;
862864
863   int sela = BIT(cia1_pa, 6);
864   int selb = BIT(cia1_pa, 7);
865   switch (m_cia1->pa_r() >> 6)
866   {
867   case 1: data = m_joy1->pot_y_r(); break;
868   case 2: data = m_joy2->pot_y_r(); break;
869   case 3: break; // TODO pot1 and pot2 in series
870   }
865871
866   UINT8 data = 0;
867
868   if (sela) data = m_joy1->pot_y_r();
869   if (selb) data = m_joy2->pot_y_r();
870
871872   return data;
872873}
873874
r18706r18707
12871288};
12881289
12891290
1291
12901292//**************************************************************************
12911293//  MACHINE INITIALIZATION
12921294//**************************************************************************
r18706r18707
13101312   // allocate memory
13111313   m_color_ram.allocate(0x800);
13121314
1315   // initialize memory
1316   UINT8 data = 0xff;
1317
1318   for (offs_t offset = 0; offset < m_ram->size(); offset++)
1319   {
1320      m_ram->pointer()[offset] = data;
1321      if (!(offset % 64)) data ^= 0xff;
1322   }
1323
13131324   // state saving
13141325   save_item(NAME(m_z80en));
13151326   save_item(NAME(m_loram));
trunk/src/mess/drivers/c64.c
r18706r18707
7171//  read_pla -
7272//-------------------------------------------------
7373
74void c64_state::read_pla(offs_t offset, offs_t va, int rw, int aec, int ba, int cas, int *casram, int *basic, int *kernal, int *charom, int *grw, int *io, int *roml, int *romh)
74void c64_state::read_pla(offs_t offset, offs_t va, int rw, int aec, int ba, int *casram, int *basic, int *kernal, int *charom, int *grw, int *io, int *roml, int *romh)
7575{
76   int game = m_exp->game_r(offset, ba, rw, m_hiram);
77   int exrom = m_exp->exrom_r(offset, ba, rw, m_hiram);
76   //int ba = m_vic->ba_r();
77   //int aec = !m_vic->aec_r();
78   int sphi2 = m_vic->phi0_r();
79   int game = m_exp->game_r(offset, sphi2, ba, rw, m_hiram);
80   int exrom = m_exp->exrom_r(offset, sphi2, ba, rw, m_hiram);
81   int cas = 0;
7882
7983   UINT32 input = VA12 << 15 | VA13 << 14 | game << 13 | exrom << 12 | rw << 11 | aec << 10 | ba << 9 | A12 << 8 |
8084      A13 << 7 | A14 << 6 | A15 << 5 | m_va14 << 4 | m_charen << 3 | m_hiram << 2 | m_loram << 1 | cas;
r18706r18707
96100//  read_memory -
97101//-------------------------------------------------
98102
99UINT8 c64_state::read_memory(address_space &space, offs_t offset, offs_t va, int rw, int aec, int ba, int cas)
103UINT8 c64_state::read_memory(address_space &space, offs_t offset, offs_t va, int aec, int ba)
100104{
105   int rw = 1;
101106   int casram, basic, kernal, charom, grw, io, roml, romh;
102107   int io1 = 1, io2 = 1;
108   int sphi2 = m_vic->phi0_r();
103109
104   read_pla(offset, va, rw, !aec, ba, cas, &casram, &basic, &kernal, &charom, &grw, &io, &roml, &romh);
110   read_pla(offset, va, rw, !aec, ba, &casram, &basic, &kernal, &charom, &grw, &io, &roml, &romh);
105111
106112   UINT8 data = 0xff;
107113
r18706r18707
112118
113119   if (!casram)
114120   {
115      data = m_ram->pointer()[offset];
121      if (aec)
122      {
123         data = m_ram->pointer()[offset];
124      }
125      else
126      {
127         data = m_ram->pointer()[(!m_va15 << 15) | (!m_va14 << 14) | va];
128      }
116129   }
117130   if (!basic)
118131   {
r18706r18707
165178      }
166179   }
167180
168   return m_exp->cd_r(space, offset, data, ba, roml, romh, io1, io2);
181   return m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2);
169182}
170183
171184
r18706r18707
173186//  write_memory -
174187//-------------------------------------------------
175188
176void c64_state::write_memory(address_space &space, offs_t offset, UINT8 data, int rw, int aec, int ba, int cas)
189void c64_state::write_memory(address_space &space, offs_t offset, UINT8 data, int aec, int ba)
177190{
191   int rw = 0;
178192   int casram, basic, kernal, charom, grw, io, roml, romh;
179193   offs_t va = 0;
180194   int io1 = 1, io2 = 1;
195   int sphi2 = m_vic->phi0_r();
181196
182   read_pla(offset, va, rw, !aec, ba, cas, &casram, &basic, &kernal, &charom, &grw, &io, &roml, &romh);
197   read_pla(offset, va, rw, !aec, ba, &casram, &basic, &kernal, &charom, &grw, &io, &roml, &romh);
183198   
184199   if (offset < 0x0002)
185200   {
r18706r18707
230245      }
231246   }
232247
233   m_exp->cd_w(space, offset, data, ba, roml, romh, io1, io2);
248   m_exp->cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2);
234249}
235250
236251
r18706r18707
240255
241256READ8_MEMBER( c64_state::read )
242257{
243   offs_t va = 0;
244   int rw = 1, aec = 1, ba = 1, cas = 0;
258   int aec = 1, ba = 1;
245259
246   return read_memory(space, offset, va, rw, aec, ba, cas);
260   // VIC address bus is floating
261   offs_t va = 0x3fff;
262   
263   return read_memory(space, offset, va, aec, ba);
247264}
248265
249266
r18706r18707
253270
254271WRITE8_MEMBER( c64_state::write )
255272{
256   int rw = 0, aec = 1, ba = 1, cas = 0;
273   int aec = 1, ba = 1;
257274   
258   write_memory(space, offset, data, rw, aec, ba, cas);
275   write_memory(space, offset, data, aec, ba);
259276}
260277
261278
r18706r18707
265282
266283READ8_MEMBER( c64_state::vic_videoram_r )
267284{
268   offs_t va = (!m_va15 << 15) | (!m_va14 << 14) | offset;
269   int rw = 1, aec = 0, ba = 0, cas = 0;
285   int aec = m_vic->aec_r(), ba = m_vic->ba_r();
286   offs_t va = offset;
270287
271   return read_memory(space, offset, va, rw, aec, ba, cas);
288   // A15/A14 are not connected to VIC so they are floating
289   offset |= 0xc000;
290   
291   return read_memory(space, offset, va, aec, ba);
272292}
273293
274294
295//-------------------------------------------------
296//  vic_colorram_r -
297//-------------------------------------------------
275298
299READ8_MEMBER( c64_state::vic_colorram_r )
300{
301   UINT8 data;
302
303   if (m_vic->aec_r())
304   {
305      // TODO low nibble of last opcode
306      data = 0x0f;
307   }
308   else
309   {
310      data = m_color_ram[offset] & 0x0f;
311   }
312
313   return data;
314}
315
316
317
276318//**************************************************************************
277319//  ADDRESS MAPS
278320//**************************************************************************
r18706r18707
300342//-------------------------------------------------
301343
302344static ADDRESS_MAP_START( vic_colorram_map, AS_1, 8, c64_state )
303   AM_RANGE(0x000, 0x3ff) AM_RAM AM_SHARE("color_ram")
345   AM_RANGE(0x000, 0x3ff) AM_READ(vic_colorram_r)
304346ADDRESS_MAP_END
305347
306348
r18706r18707
402444   SCREEN_TAG,
403445   M6510_TAG,
404446   DEVCB_DRIVER_LINE_MEMBER(c64_state, vic_irq_w),
405   DEVCB_NULL,
447   DEVCB_NULL, // BA -> 6502 RDY
448   DEVCB_NULL, // AEC -> 6502 AEC
406449   DEVCB_NULL
407450};
408451
r18706r18707
413456
414457READ8_MEMBER( c64_state::sid_potx_r )
415458{
416   UINT8 cia1_pa = m_cia1->pa_r();
459   UINT8 data = 0xff;
417460
418   int sela = BIT(cia1_pa, 6);
419   int selb = BIT(cia1_pa, 7);
461   switch (m_cia1->pa_r() >> 6)
462   {
463   case 1: data = m_joy1->pot_x_r(); break;
464   case 2: data = m_joy2->pot_x_r(); break;
465   case 3: break; // TODO pot1 and pot2 in series
466   }
420467
421   UINT8 data = 0;
422
423   if (sela) data = m_joy1->pot_x_r();
424   if (selb) data = m_joy2->pot_x_r();
425
426468   return data;
427469}
428470
429471READ8_MEMBER( c64_state::sid_poty_r )
430472{
431   UINT8 cia1_pa = m_cia1->pa_r();
473   UINT8 data = 0xff;
432474
433   int sela = BIT(cia1_pa, 6);
434   int selb = BIT(cia1_pa, 7);
475   switch (m_cia1->pa_r() >> 6)
476   {
477   case 1: data = m_joy1->pot_y_r(); break;
478   case 2: data = m_joy2->pot_y_r(); break;
479   case 3: break; // TODO pot1 and pot2 in series
480   }
435481
436   UINT8 data = 0;
437
438   if (sela) data = m_joy1->pot_y_r();
439   if (selb) data = m_joy2->pot_y_r();
440
441482   return data;
442483}
443484
r18706r18707
919960   m_kernal = memregion("kernal")->base();
920961   m_charom = memregion("charom")->base();
921962
963   // allocate memory
964   m_color_ram.allocate(0x400);
965
966   // initialize memory
967   UINT8 data = 0xff;
968
969   for (offs_t offset = 0; offset < m_ram->size(); offset++)
970   {
971      m_ram->pointer()[offset] = data;
972      if (!(offset % 64)) data ^= 0xff;
973   }
974
922975   // state saving
923976   save_item(NAME(m_loram));
924977   save_item(NAME(m_hiram));
r18706r18707
12081261//**************************************************************************
12091262
12101263//-------------------------------------------------
1211//  ROM( c64n )
1264//  ROM( c64 )
12121265//-------------------------------------------------
12131266
1214ROM_START( c64n )
1267ROM_START( c64 )
12151268   ROM_REGION( 0x2000, "basic", 0 )
12161269   ROM_LOAD( "901226-01.u3", 0x0000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
12171270
r18706r18707
12871340
12881341
12891342//-------------------------------------------------
1290//  ROM( c64j )
1343//  ROM( c64_jp )
12911344//-------------------------------------------------
12921345
1293ROM_START( c64j )
1346ROM_START( c64_jp )
12941347   ROM_REGION( 0x2000, "basic", 0 )
12951348   ROM_LOAD( "901226-01.u3", 0x0000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
12961349
r18706r18707
13091362//  ROM( c64p )
13101363//-------------------------------------------------
13111364
1312#define rom_c64p rom_c64n
1365#define rom_c64p rom_c64
13131366
13141367
13151368//-------------------------------------------------
1316//  ROM( c64sw )
1369//  ROM( c64_se )
13171370//-------------------------------------------------
13181371
1319ROM_START( c64sw )
1372ROM_START( c64_se )
13201373   ROM_REGION( 0x2000, "basic", 0 )
13211374   ROM_LOAD( "901226-01.u3", 0x0000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
13221375
r18706r18707
13571410//  ROM( edu64 )
13581411//-------------------------------------------------
13591412
1360#define rom_edu64   rom_c64n
1413#define rom_edu64   rom_c64
13611414
13621415
13631416//-------------------------------------------------
1364//  ROM( sx64n )
1417//  ROM( sx64 )
13651418//-------------------------------------------------
13661419
1367ROM_START( sx64n )
1420ROM_START( sx64 )
13681421   ROM_REGION( 0x2000, "basic", 0 )
13691422   ROM_LOAD( "901226-01.ud4", 0x0000, 0x2000, CRC(f833d117) SHA1(79015323128650c742a3694c9429aa91f355905e) )
13701423
r18706r18707
13901443//  ROM( rom_sx64p )
13911444//-------------------------------------------------
13921445
1393#define rom_sx64p   rom_sx64n
1446#define rom_sx64p   rom_sx64
13941447
13951448
13961449//-------------------------------------------------
r18706r18707
14171470//-------------------------------------------------
14181471
14191472// ROM_LOAD( "dx64kern.bin", 0x0000, 0x2000, CRC(58065128) ) TODO where is this illusive ROM?
1420#define rom_dx64   rom_sx64n
1473#define rom_dx64   rom_sx64
14211474
14221475
14231476//-------------------------------------------------
1424//  ROM( c64cn )
1477//  ROM( c64c )
14251478//-------------------------------------------------
14261479
1427ROM_START( c64cn )
1480ROM_START( c64c )
14281481   ROM_REGION( 0x4000, M6510_TAG, 0 )
14291482   ROM_LOAD( "251913-01.u4", 0x0000, 0x4000, CRC(0010ec31) SHA1(765372a0e16cbb0adf23a07b80f6b682b39fbf88) )
14301483
r18706r18707
14401493//  ROM( c64cp )
14411494//-------------------------------------------------
14421495
1443#define rom_c64cp      rom_c64cn
1496#define rom_c64cp      rom_c64c
14441497
14451498
14461499//-------------------------------------------------
14471500//  ROM( c64g )
14481501//-------------------------------------------------
14491502
1450#define rom_c64g      rom_c64cn
1503#define rom_c64g      rom_c64c
14511504
14521505
14531506//-------------------------------------------------
1454//  ROM( c64csw )
1507//  ROM( c64c_se )
14551508//-------------------------------------------------
14561509
1457ROM_START( c64csw )
1510ROM_START( c64c_se )
14581511   ROM_REGION( 0x4000, M6510_TAG, 0 )
14591512   ROM_LOAD( "325182-01.u4", 0x0000, 0x4000, CRC(2aff27d3) SHA1(267654823c4fdf2167050f41faa118218d2569ce) ) // 128/64 FI
14601513
r18706r18707
14881541//**************************************************************************
14891542
14901543//    YEAR  NAME    PARENT  COMPAT  MACHINE     INPUT   INIT                        COMPANY                        FULLNAME                                     FLAGS
1491COMP( 1982,   c64n,   0,     0,      ntsc,      c64,   driver_device,      0,      "Commodore Business Machines", "Commodore 64 (NTSC)",                  GAME_SUPPORTS_SAVE )
1492COMP( 1982,   c64j,   c64n,   0,      ntsc,      c64,   driver_device,      0,      "Commodore Business Machines", "Commodore 64 (Japan)",                  GAME_SUPPORTS_SAVE )
1493COMP( 1982,   c64p,   c64n,   0,      pal,      c64,   driver_device,      0,      "Commodore Business Machines", "Commodore 64 (PAL)",                  GAME_SUPPORTS_SAVE )
1494COMP( 1982,   c64sw,   c64n,   0,      pal,      c64sw,   driver_device,      0,      "Commodore Business Machines", "Commodore 64 / VIC-64S (Sweden/Finland)",   GAME_SUPPORTS_SAVE )
1495COMP( 1983, pet64,   c64n,   0,     pet64,     c64,   driver_device,      0,     "Commodore Business Machines", "PET 64 / CBM 4064 (NTSC)",               GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS )
1496COMP( 1983, edu64,  c64n,   0,     pet64,     c64,   driver_device,      0,     "Commodore Business Machines", "Educator 64 (NTSC)",                  GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS )
1497COMP( 1984, sx64n,   c64n,   0,      ntsc_sx,   c64,   driver_device,      0,      "Commodore Business Machines", "SX-64 / Executive 64 (NTSC)",            GAME_SUPPORTS_SAVE )
1498COMP( 1984, sx64p,   c64n,   0,      pal_sx,      c64,   driver_device,      0,      "Commodore Business Machines", "SX-64 / Executive 64 (PAL)",            GAME_SUPPORTS_SAVE )
1499COMP( 1984, vip64,   c64n,   0,      pal_sx,      c64sw,   driver_device,      0,      "Commodore Business Machines", "VIP-64 (Sweden/Finland)",               GAME_SUPPORTS_SAVE )
1500COMP( 1984, dx64,   c64n,   0,      ntsc_dx,   c64,   driver_device,      0,      "Commodore Business Machines", "DX-64 (NTSC)",                        GAME_SUPPORTS_SAVE )
1544COMP( 1982,   c64,   0,     0,      ntsc,      c64,   driver_device,      0,      "Commodore Business Machines", "Commodore 64 (NTSC)",                  GAME_SUPPORTS_SAVE )
1545COMP( 1982,   c64_jp,   c64,   0,      ntsc,      c64,   driver_device,      0,      "Commodore Business Machines", "Commodore 64 (Japan)",                  GAME_SUPPORTS_SAVE )
1546COMP( 1982,   c64p,   c64,   0,      pal,      c64,   driver_device,      0,      "Commodore Business Machines", "Commodore 64 (PAL)",                  GAME_SUPPORTS_SAVE )
1547COMP( 1982,   c64_se,   c64,   0,      pal,      c64sw,   driver_device,      0,      "Commodore Business Machines", "Commodore 64 / VIC-64S (Sweden/Finland)",   GAME_SUPPORTS_SAVE )
1548COMP( 1983, pet64,   c64,   0,     pet64,     c64,   driver_device,      0,     "Commodore Business Machines", "PET 64 / CBM 4064 (NTSC)",               GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS )
1549COMP( 1983, edu64,  c64,   0,     pet64,     c64,   driver_device,      0,     "Commodore Business Machines", "Educator 64 (NTSC)",                  GAME_SUPPORTS_SAVE | GAME_WRONG_COLORS )
1550COMP( 1984, sx64,   c64,   0,      ntsc_sx,   c64,   driver_device,      0,      "Commodore Business Machines", "SX-64 / Executive 64 (NTSC)",            GAME_SUPPORTS_SAVE )
1551COMP( 1984, sx64p,   c64,   0,      pal_sx,      c64,   driver_device,      0,      "Commodore Business Machines", "SX-64 / Executive 64 (PAL)",            GAME_SUPPORTS_SAVE )
1552COMP( 1984, vip64,   c64,   0,      pal_sx,      c64sw,   driver_device,      0,      "Commodore Business Machines", "VIP-64 (Sweden/Finland)",               GAME_SUPPORTS_SAVE )
1553COMP( 1984, dx64,   c64,   0,      ntsc_dx,   c64,   driver_device,      0,      "Commodore Business Machines", "DX-64 (NTSC)",                        GAME_SUPPORTS_SAVE )
15011554//COMP(1983, clipper,  c64,  0, c64pal,  clipper, XXX_CLASS, c64pal,  "PDC", "Clipper", GAME_NOT_WORKING) // C64 in a briefcase with 3" floppy, electroluminescent flat screen, thermal printer
15021555//COMP(1983, tesa6240, c64,  0, c64pal,  c64, XXX_CLASS,     c64pal,  "Tesa", "6240", GAME_NOT_WORKING) // modified SX64 with label printer
1503COMP( 1986, c64cn,   c64n,   0,     ntsc_c,      c64,   driver_device,      0,      "Commodore Business Machines", "Commodore 64C (NTSC)",                  GAME_SUPPORTS_SAVE )
1504COMP( 1986, c64cp,   c64n,   0,     pal_c,      c64,   driver_device,      0,      "Commodore Business Machines", "Commodore 64C (PAL)",                  GAME_SUPPORTS_SAVE )
1505COMP( 1986, c64csw,   c64n,   0,     pal_c,      c64sw,   driver_device,      0,      "Commodore Business Machines", "Commodore 64C (Sweden/Finland)",         GAME_SUPPORTS_SAVE )
1506COMP( 1986, c64g,   c64n,   0,      pal_c,      c64,   driver_device,      0,      "Commodore Business Machines", "Commodore 64G (PAL)",                  GAME_SUPPORTS_SAVE )
1507CONS( 1990, c64gs,   c64n,   0,      pal_gs,      c64gs,   driver_device,      0,      "Commodore Business Machines", "Commodore 64 Games System (PAL)",         GAME_SUPPORTS_SAVE )
1556COMP( 1986, c64c,   c64,   0,     ntsc_c,      c64,   driver_device,      0,      "Commodore Business Machines", "Commodore 64C (NTSC)",                  GAME_SUPPORTS_SAVE )
1557COMP( 1986, c64cp,   c64,   0,     pal_c,      c64,   driver_device,      0,      "Commodore Business Machines", "Commodore 64C (PAL)",                  GAME_SUPPORTS_SAVE )
1558COMP( 1986, c64c_se,c64,   0,     pal_c,      c64sw,   driver_device,      0,      "Commodore Business Machines", "Commodore 64C (Sweden/Finland)",         GAME_SUPPORTS_SAVE )
1559COMP( 1986, c64g,   c64,   0,      pal_c,      c64,   driver_device,      0,      "Commodore Business Machines", "Commodore 64G (PAL)",                  GAME_SUPPORTS_SAVE )
1560CONS( 1990, c64gs,   c64,   0,      pal_gs,      c64gs,   driver_device,      0,      "Commodore Business Machines", "Commodore 64 Games System (PAL)",         GAME_SUPPORTS_SAVE )
trunk/src/mess/drivers/vic10.c
r18706r18707
220220   M6510_TAG,
221221   DEVCB_DRIVER_LINE_MEMBER(vic10_state, vic_irq_w),
222222   DEVCB_NULL,
223   DEVCB_NULL,
223224   DEVCB_NULL
224225};
225226
r18706r18707
230231
231232READ8_MEMBER( vic10_state::sid_potx_r )
232233{
233   UINT8 cia_pa = m_cia->pa_r();
234   UINT8 data = 0xff;
234235
235   int sela = BIT(cia_pa, 6);
236   int selb = BIT(cia_pa, 7);
236   switch (m_cia->pa_r() >> 6)
237   {
238   case 1: data = m_joy1->pot_x_r(); break;
239   case 2: data = m_joy2->pot_x_r(); break;
240   case 3: break; // TODO pot1 and pot2 in series
241   }
237242
238   UINT8 data = 0;
239
240   if (sela) data = m_joy1->pot_x_r();
241   if (selb) data = m_joy2->pot_x_r();
242
243243   return data;
244244}
245245
246246READ8_MEMBER( vic10_state::sid_poty_r )
247247{
248   UINT8 cia_pa = m_cia->pa_r();
248   UINT8 data = 0xff;
249249
250   int sela = BIT(cia_pa, 6);
251   int selb = BIT(cia_pa, 7);
250   switch (m_cia->pa_r() >> 6)
251   {
252   case 1: data = m_joy1->pot_y_r(); break;
253   case 2: data = m_joy2->pot_y_r(); break;
254   case 3: break; // TODO pot1 and pot2 in series
255   }
252256
253   UINT8 data = 0;
254
255   if (sela) data = m_joy1->pot_y_r();
256   if (selb) data = m_joy2->pot_y_r();
257
258257   return data;
259258}
260259
r18706r18707
463462void vic10_state::machine_start()
464463{
465464   // allocate memory
466   m_color_ram = auto_alloc_array(machine(), UINT8, 0x400);
465   m_color_ram.allocate(0x400);
467466
467   // initialize memory
468   UINT8 data = 0xff;
469
470   for (offs_t offset = 0; offset < m_ram->size(); offset++)
471   {
472      m_ram->pointer()[offset] = data;
473      if (!(offset % 64)) data ^= 0xff;
474   }
475
468476   // state saving
469477   save_item(NAME(m_cia_irq));
470478   save_item(NAME(m_vic_irq));
trunk/src/mess/drivers/vic20.c
r18706r18707
696696   m_kernal = memregion("kernal")->base();
697697   m_charom = memregion("charom")->base();
698698
699   // initialize memory
700   UINT8 data = 0xff;
701
702   for (offs_t offset = 0; offset < m_ram->size(); offset++)
703   {
704      m_ram->pointer()[offset] = data;
705      if (!(offset % 64)) data ^= 0xff;
706   }
707
699708   // state saving
700709   save_item(NAME(m_key_col));
701710}
r18706r18707
859868
860869
861870//-------------------------------------------------
862//  ROM( vic20s )
871//  ROM( vic20_se )
863872//-------------------------------------------------
864873
865ROM_START( vic20s )
874ROM_START( vic20_se )
866875   ROM_REGION( 0x2000, "basic", 0 )
867876   ROM_LOAD( "901486-01.ue11",   0x0000, 0x2000, CRC(db4c43c1) SHA1(587d1e90950675ab6b12d91248a3f0d640d02e8d) )
868877
r18706r18707
883892COMP( 1980, vic1001,    0,          0,      ntsc,      vic1001,   driver_device,   0,          "Commodore Business Machines",      "VIC-1001 (Japan)",         GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
884893COMP( 1981, vic20,      vic1001,    0,      ntsc,      vic20,      driver_device,   0,          "Commodore Business Machines",      "VIC-20 (NTSC)",            GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
885894COMP( 1981, vic20p,     vic1001,    0,      pal,      vic20,      driver_device,   0,          "Commodore Business Machines",      "VIC-20 / VC-20 (PAL)",     GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
886COMP( 1981, vic20s,     vic1001,    0,      pal,      vic20s,    driver_device,   0,          "Commodore Business Machines",      "VIC-20 (Sweden/Finland)",  GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
895COMP( 1981, vic20_se,   vic1001,    0,      pal,      vic20s,    driver_device,   0,          "Commodore Business Machines",      "VIC-20 (Sweden/Finland)",  GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_SUPPORTS_SAVE )
trunk/src/mess/drivers/plus4.c
r18706r18707
849849   {
850850      m_c2 = memregion("c2")->base();
851851   }
852   
853   // initialize memory
854   UINT8 data = 0xff;
852855
856   for (offs_t offset = 0; offset < m_ram->size(); offset++)
857   {
858      m_ram->pointer()[offset] = data;
859      if (!(offset % 64)) data ^= 0xff;
860   }
861
853862   // state saving
854863   save_item(NAME(m_addr));
855864   save_item(NAME(m_ted_irq));
r18706r18707
10971106
10981107
10991108//-------------------------------------------------
1100//  ROM( plus4n )
1109//  ROM( plus4 )
11011110//-------------------------------------------------
11021111
1103ROM_START( plus4n )
1112ROM_START( plus4 )
11041113   ROM_REGION( 0x8000, "kernal", 0 )
11051114   ROM_DEFAULT_BIOS("r5")
11061115   ROM_SYSTEM_BIOS( 0, "r4", "Revision 4" )
r18706r18707
11471156
11481157
11491158//-------------------------------------------------
1150//  ROM( c16n )
1159//  ROM( c16 )
11511160//-------------------------------------------------
11521161
1153ROM_START( c16n )
1162ROM_START( c16 )
11541163   ROM_REGION( 0x8000, "kernal", 0 )
11551164   ROM_DEFAULT_BIOS("r5")
11561165   ROM_SYSTEM_BIOS( 0, "r4", "Revision 4" )
r18706r18707
11891198
11901199
11911200//-------------------------------------------------
1192//  ROM( c16h )
1201//  ROM( c16_hu )
11931202//-------------------------------------------------
11941203
1195ROM_START( c16h )
1204ROM_START( c16_hu )
11961205   ROM_REGION( 0x8000, "kernal", 0 )
11971206   ROM_LOAD( "318006-01.u3", 0x0000, 0x4000, CRC(74eaae87) SHA1(161c96b4ad20f3a4f2321808e37a5ded26a135dd) )
11981207
r18706r18707
12371246COMP( 1984, c264,   0,      0,      ntsc,   plus4,   driver_device,   0,      "Commodore Business Machines",   "Commodore 264 (Prototype)",   GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE )
12381247COMP( 1984, c232,   c264,   0,      c232,   plus4,   driver_device,   0,      "Commodore Business Machines",   "Commodore 232 (Prototype)",   GAME_SUPPORTS_SAVE )
12391248COMP( 1984, v364,   c264,   0,      v364,   plus4,   driver_device,   0,      "Commodore Business Machines",   "Commodore V364 (Prototype)",   GAME_SUPPORTS_SAVE )
1240COMP( 1984, plus4n,   c264,   0,      ntsc,   plus4,   driver_device,   0,      "Commodore Business Machines",   "Plus/4 (NTSC)",            GAME_SUPPORTS_SAVE )
1249COMP( 1984, plus4,   c264,   0,      ntsc,   plus4,   driver_device,   0,      "Commodore Business Machines",   "Plus/4 (NTSC)",            GAME_SUPPORTS_SAVE )
12411250COMP( 1984, plus4p,   c264,   0,      pal,   plus4,   driver_device,   0,      "Commodore Business Machines",   "Plus/4 (PAL)",               GAME_SUPPORTS_SAVE )
1242COMP( 1984, c16n,   c264,   0,      c16n,   c16,   driver_device,   0,      "Commodore Business Machines",   "Commodore 16 (NTSC)",         GAME_SUPPORTS_SAVE )
1251COMP( 1984, c16,   c264,   0,      c16n,   c16,   driver_device,   0,      "Commodore Business Machines",   "Commodore 16 (NTSC)",         GAME_SUPPORTS_SAVE )
12431252COMP( 1984, c16p,   c264,   0,      c16p,   c16,   driver_device,   0,      "Commodore Business Machines",   "Commodore 16 (PAL)",         GAME_SUPPORTS_SAVE )
1244COMP( 1984, c16h,   c264,   0,      c16p,   c16,   driver_device,   0,      "Commodore Business Machines",   "Commodore 16 (Hungary)",      GAME_SUPPORTS_SAVE )
1253COMP( 1984, c16_hu,   c264,   0,      c16p,   c16,   driver_device,   0,      "Commodore Business Machines",   "Commodore 16 (Hungary)",      GAME_SUPPORTS_SAVE )
12451254COMP( 1984, c116,   c264,   0,      c16p,   c16,   driver_device,   0,      "Commodore Business Machines",   "Commodore 116",            GAME_SUPPORTS_SAVE )
trunk/src/mess/drivers/cbm2.c
r18706r18707
328328//  read_pla1 - P500 PLA #1 read
329329//-------------------------------------------------
330330
331void p500_state::read_pla1(offs_t offset, int bras, int busy2, int sphi2, int clrnibcsb, int procvid, int refen, int ba, int aec, int srw,
331void p500_state::read_pla1(offs_t offset, int busy2, int clrnibcsb, int procvid, int refen, int ba, int aec, int srw,
332332   int *datxen, int *dramxen, int *clrniben, int *segf, int *_64kcasen, int *casenb, int *viddaten, int *viddat_tr)
333333{
334   int sphi2 = m_vic->phi0_r();
335   int bras = 1;
336   
334337   UINT32 input = P0 << 15 | P2 << 14 | bras << 13 | P1 << 12 | P3 << 11 | busy2 << 10 | m_statvid << 9 | sphi2 << 8 |
335338         clrnibcsb << 7 | m_dramon << 6 | procvid << 5 | refen << 4 | m_vicdotsel << 3 | ba << 2 | aec << 1 | srw;
336339
r18706r18707
351354//  read_pla2 - P500 PLA #2 read
352355//-------------------------------------------------
353356
354void p500_state::read_pla2(offs_t offset, offs_t va, int ba, int sphi2, int vicen, int ae, int segf, int bcas, int bank0,
357void p500_state::read_pla2(offs_t offset, offs_t va, int ba, int vicen, int ae, int segf, int bank0,
355358   int *clrnibcsb, int *extbufcs, int *discromcs, int *buframcs, int *charomcs, int *procvid, int *viccs, int *vidmatcs)
356359{
360   int sphi2 = m_vic->phi0_r();
361   int bcas = 1;
362
357363   UINT32 input = VA12 << 15 | ba << 14 | A13 << 13 | A15 << 12 | A14 << 11 | A11 << 10 | A10 << 9 | A12 << 8 |
358364         sphi2 << 7 | vicen << 6 | m_statvid << 5 | m_vicdotsel << 4 | ae << 3 | segf << 2 | bcas << 1 | bank0;
359365
r18706r18707
374380//  bankswitch -
375381//-------------------------------------------------
376382
377void p500_state::bankswitch(offs_t offset, offs_t va, int srw, int sphi0, int sphi1, int sphi2, int ba, int ae, int bras, int bcas, int busy2, int refen,
383void p500_state::bankswitch(offs_t offset, offs_t va, int srw, int ba, int ae, int busy2, int refen,
378384   int *datxen, int *dramxen, int *clrniben, int *_64kcasen, int *casenb, int *viddaten, int *viddat_tr,
379385   int *clrnibcs, int *extbufcs, int *discromcs, int *buframcs, int *charomcs, int *viccs, int *vidmatcs,
380386   int *csbank1, int *csbank2, int *csbank3, int *basiclocs, int *basichics, int *kernalcs,
381387   int *cs1, int *sidcs, int *extprtcs, int *ciacs, int *aciacs, int *tript1cs, int *tript2cs, int *aec, int *vsysaden)
382388{
389   int sphi2 = m_vic->phi0_r();
390   int sphi1 = !sphi2;
391   //int ba = !m_vic->ba_r();
392   //int ae = m_vic->aec_r();
393   int bcas = 0;
394
383395   *aec = !((m_statvid || ae) && sphi2);
384396   *vsysaden = sphi1 || ba;
385397
386398   int clrnibcsb = 1, procvid = 1, segf = 1;
387399
388   read_pla1(offset, bras, busy2, sphi2, clrnibcsb, procvid, refen, ba, *aec, srw,
400   read_pla1(offset, busy2, clrnibcsb, procvid, refen, ba, *aec, srw,
389401      datxen, dramxen, clrniben, &segf, _64kcasen, casenb, viddaten, viddat_tr);
390402
391403   int bank0 = 1, vicen = 1;
r18706r18707
423435
424436   int vidmatcsb = 1;
425437
426   read_pla2(offset, va, ba, sphi2, vicen, ae, segf, bcas, bank0,
438   read_pla2(offset, va, ba, vicen, ae, segf, bank0,
427439      &clrnibcsb, extbufcs, discromcs, buframcs, charomcs, &procvid, viccs, &vidmatcsb);
428440
429441   *clrnibcs = clrnibcsb || bcas;
430442   *vidmatcs = vidmatcsb || bcas;
431443
432   read_pla1(offset, bras, busy2, sphi2, clrnibcsb, procvid, refen, ba, *aec, srw,
444   read_pla1(offset, busy2, clrnibcsb, procvid, refen, ba, *aec, srw,
433445      datxen, dramxen, clrniben, &segf, _64kcasen, casenb, viddaten, viddat_tr);
434446}
435447
r18706r18707
438450//  read_memory -
439451//-------------------------------------------------
440452
441UINT8 p500_state::read_memory(address_space &space, offs_t offset, offs_t va, int sphi0, int sphi1, int sphi2, int ba, int ae, int bras, int bcas, UINT8 *clrnib)
453UINT8 p500_state::read_memory(address_space &space, offs_t offset, offs_t va, int ba, int ae, UINT8 *clrnib)
442454{
443455   int srw = 1, busy2 = 1, refen = 0;
444456
r18706r18707
448460   int cs1 = 1, sidcs = 1, extprtcs = 1, ciacs = 1, aciacs = 1, tript1cs = 1, tript2cs = 1;
449461   int aec = 1, vsysaden = 1;
450462
451   bankswitch(offset, va, srw, sphi0, sphi1, sphi2, ba, ae, bras, bcas, busy2, refen,
463   bankswitch(offset, va, srw, ba, ae, busy2, refen,
452464      &datxen, &dramxen, &clrniben, &_64kcasen, &casenb, &viddaten, &viddat_tr,
453465      &clrnibcs, &extbufcs, &discromcs, &buframcs, &charomcs, &viccs, &vidmatcs,
454466      &csbank1, &csbank2, &csbank3, &basiclocs, &basichics, &kernalcs,
r18706r18707
560572//  write_memory -
561573//-------------------------------------------------
562574
563void p500_state::write_memory(address_space &space, offs_t offset, UINT8 data, int sphi0, int sphi1, int sphi2, int ba, int ae, int bras, int bcas)
575void p500_state::write_memory(address_space &space, offs_t offset, UINT8 data, int ba, int ae)
564576{
565577   int srw = 0, busy2 = 1, refen = 0;
566578   offs_t va = 0xffff;
r18706r18707
571583   int cs1 = 1, sidcs = 1, extprtcs = 1, ciacs = 1, aciacs = 1, tript1cs = 1, tript2cs = 1;
572584   int aec = 1, vsysaden = 1;
573585
574   bankswitch(offset, va, srw, sphi0, sphi1, sphi2, ba, ae, bras, bcas, busy2, refen,
586   bankswitch(offset, va, srw, ba, ae, busy2, refen,
575587      &datxen, &dramxen, &clrniben, &_64kcasen, &casenb, &viddaten, &viddat_tr,
576588      &clrnibcs, &extbufcs, &discromcs, &buframcs, &charomcs, &viccs, &vidmatcs,
577589      &csbank1, &csbank2, &csbank3, &basiclocs, &basichics, &kernalcs,
r18706r18707
648660
649661READ8_MEMBER( p500_state::read )
650662{
651   int sphi0 = 1, sphi1 = 0, sphi2 = 1, ba = 0, ae = 1, bras = 1, bcas = 0;
663   int ba = 0, ae = 1;
652664   offs_t va = 0xffff;
653665   UINT8 clrnib = 0xf;
654666
655   return read_memory(space, offset, va, sphi0, sphi1, sphi2, ba, ae, bras, bcas, &clrnib);
667   return read_memory(space, offset, va, ba, ae, &clrnib);
656668}
657669
658670
r18706r18707
662674
663675WRITE8_MEMBER( p500_state::write )
664676{
665   int sphi0 = 1, sphi1 = 0, sphi2 = 1, ba = 0, ae = 1, bras = 1, bcas = 0;
677   int ba = 0, ae = 1;
666678
667   write_memory(space, offset, data, sphi0, sphi1, sphi2, ba, ae, bras, bcas);
679   write_memory(space, offset, data, ba, ae);
668680}
669681
670682
r18706r18707
674686
675687READ8_MEMBER( p500_state::vic_videoram_r )
676688{
677   /*
678    int sphi0 = 0, sphi1 = 1, sphi2 = 0, ba = 1, ae = 0, bras = 0, bcas = 0;
689/*    int ba = !m_vic->ba_r(), ae = m_vic->aec_r();
679690    offs_t va = offset;
680
681    return read_memory(space, 0, va, sphi0, sphi1, sphi2, ba, ae, bras, bcas);
682    */
683   /*
684    int ba = 1, ae = 0, bras = 1, bcas = 0;
685691    UINT8 clrnib = 0xf;
692   logerror("VIC %04x phi0 %u BA %u AEC %u VICDOTSEL %u STATVID %u\n", va, m_vic->phi0_r(), !m_vic->ba_r(), m_vic->aec_r(), m_vicdotsel, m_statvid);
686693
687    if (offset < 0x1000)
688    {
689        return read_memory(space, 0, offset, 0, 1, 0, ba, ae, bras, bcas, &clrnib);
690    }
691    else
692    {
693        return read_memory(space, 0, offset, 1, 0, 1, ba, ae, bras, bcas, &clrnib);
694    }
695    */
696
694    return read_memory(space, 0, va, ba, ae, &clrnib);
695*/
697696   if (offset < 0x1000)
698697   {
699698      return m_charom[offset & 0xfff];
r18706r18707
10401039   SCREEN_TAG,
10411040   M6509_TAG,
10421041   DEVCB_DRIVER_LINE_MEMBER(p500_state, vic_irq_w),
1043   DEVCB_NULL, // RDY
1042   DEVCB_NULL,
1043   DEVCB_NULL,
10441044   DEVCB_NULL
10451045};
10461046
r18706r18707
21162116//**************************************************************************
21172117
21182118//-------------------------------------------------
2119//  ROM( p500n )
2119//  ROM( p500 )
21202120//-------------------------------------------------
21212121
2122ROM_START( p500n )
2122ROM_START( p500 )
21232123   ROM_REGION( 0x4000, "basic", 0 )
21242124   ROM_DEFAULT_BIOS("r2")
21252125   ROM_SYSTEM_BIOS( 0, "r1", "Revision 1" )
r18706r18707
21482148//  ROM( p500p )
21492149//-------------------------------------------------
21502150
2151#define rom_p500p   rom_p500n
2151#define rom_p500p   rom_p500
21522152
21532153
21542154//-------------------------------------------------
r18706r18707
23782378//**************************************************************************
23792379
23802380//    YEAR  NAME        PARENT  COMPAT  MACHINE     INPUT   INIT                        COMPANY                         FULLNAME                            FLAGS
2381COMP( 1983,   p500n,      0,      0,      p500_ntsc,   cbm2,   driver_device,      0,      "Commodore Business Machines",   "P500 ~ C128-40 ~ PET-II (NTSC)",   GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // VIC 64K RAM mode is not supported
2382COMP( 1983,   p500p,      p500n,   0,      p500_pal,   cbm2,   driver_device,      0,      "Commodore Business Machines",   "P500 ~ C128-40 ~ PET-II (PAL)",   GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // VIC 64K RAM mode is not supported
2381COMP( 1983,   p500,      0,      0,      p500_ntsc,   cbm2,   driver_device,      0,      "Commodore Business Machines",   "P500 ~ C128-40 ~ PET-II (NTSC)",   GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // VIC 64K RAM mode is not supported
2382COMP( 1983,   p500p,      p500,   0,      p500_pal,   cbm2,   driver_device,      0,      "Commodore Business Machines",   "P500 ~ C128-40 ~ PET-II (PAL)",   GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) // VIC 64K RAM mode is not supported
23832383
2384COMP( 1983,   b500,      p500n,   0,      b128,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "B500 (NTSC)",                  GAME_SUPPORTS_SAVE )
2385COMP( 1983,   b128,      p500n,   0,      b128,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "B128 (NTSC)",                  GAME_SUPPORTS_SAVE )
2386COMP( 1983,   b256,      p500n,   0,      b256,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "B256 (NTSC)",                  GAME_SUPPORTS_SAVE )
2387COMP( 1983,   cbm610,      p500n,   0,      cbm610,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "CBM 610 (PAL)",               GAME_SUPPORTS_SAVE )
2388COMP( 1983,   cbm620,      p500n,   0,      cbm620,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "CBM 620 (PAL)",               GAME_SUPPORTS_SAVE )
2389COMP( 1983,   cbm620hu,   p500n,   0,      cbm620,      cbm2hu,   driver_device,      0,      "Commodore Business Machines",   "CBM 620 (Hungary)",            GAME_SUPPORTS_SAVE )
2384COMP( 1983,   b500,      p500,   0,      b128,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "B500 (NTSC)",                  GAME_SUPPORTS_SAVE )
2385COMP( 1983,   b128,      p500,   0,      b128,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "B128 (NTSC)",                  GAME_SUPPORTS_SAVE )
2386COMP( 1983,   b256,      p500,   0,      b256,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "B256 (NTSC)",                  GAME_SUPPORTS_SAVE )
2387COMP( 1983,   cbm610,      p500,   0,      cbm610,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "CBM 610 (PAL)",               GAME_SUPPORTS_SAVE )
2388COMP( 1983,   cbm620,      p500,   0,      cbm620,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "CBM 620 (PAL)",               GAME_SUPPORTS_SAVE )
2389COMP( 1983,   cbm620hu,   p500,   0,      cbm620,      cbm2hu,   driver_device,      0,      "Commodore Business Machines",   "CBM 620 (Hungary)",            GAME_SUPPORTS_SAVE )
23902390
2391COMP( 1983,   b128hp,      p500n,   0,      b128hp,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "B128-80HP (NTSC)",               GAME_SUPPORTS_SAVE )
2392COMP( 1983,   b256hp,      p500n,   0,      b256hp,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "B256-80HP (NTSC)",               GAME_SUPPORTS_SAVE )
2393COMP( 1983,   bx256hp,   p500n,   0,      bx256hp,   cbm2,   driver_device,      0,      "Commodore Business Machines",   "BX256-80HP (NTSC)",            GAME_NOT_WORKING ) // 8088 co-processor is missing
2394COMP( 1983,   cbm710,      p500n,   0,      cbm710,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "CBM 710 (PAL)",               GAME_SUPPORTS_SAVE )
2395COMP( 1983,   cbm720,      p500n,   0,      cbm720,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "CBM 720 (PAL)",               GAME_SUPPORTS_SAVE )
2396COMP( 1983,   cbm720sw,   p500n,   0,      cbm720,      cbm2sw,   driver_device,      0,      "Commodore Business Machines",   "CBM 720 (Sweden/Finland)",         GAME_SUPPORTS_SAVE )
2397COMP( 1983,   cbm730,      p500n,   0,      cbm730,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "CBM 730 (PAL)",               GAME_NOT_WORKING ) // 8088 co-processor is missing
2391COMP( 1983,   b128hp,      p500,   0,      b128hp,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "B128-80HP (NTSC)",               GAME_SUPPORTS_SAVE )
2392COMP( 1983,   b256hp,      p500,   0,      b256hp,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "B256-80HP (NTSC)",               GAME_SUPPORTS_SAVE )
2393COMP( 1983,   bx256hp,   p500,   0,      bx256hp,   cbm2,   driver_device,      0,      "Commodore Business Machines",   "BX256-80HP (NTSC)",            GAME_NOT_WORKING ) // 8088 co-processor is missing
2394COMP( 1983,   cbm710,      p500,   0,      cbm710,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "CBM 710 (PAL)",               GAME_SUPPORTS_SAVE )
2395COMP( 1983,   cbm720,      p500,   0,      cbm720,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "CBM 720 (PAL)",               GAME_SUPPORTS_SAVE )
2396COMP( 1983,   cbm720sw,   p500,   0,      cbm720,      cbm2sw,   driver_device,      0,      "Commodore Business Machines",   "CBM 720 (Sweden/Finland)",         GAME_SUPPORTS_SAVE )
2397COMP( 1983,   cbm730,      p500,   0,      cbm730,      cbm2,   driver_device,      0,      "Commodore Business Machines",   "CBM 730 (PAL)",               GAME_NOT_WORKING ) // 8088 co-processor is missing

Previous 199869 Revisions Next


© 1997-2024 The MAME Team