Previous 199869 Revisions Next

r29371 Sunday 6th April, 2014 at 16:03:17 UTC by Carl
(mess) x68k: rework bus errors (nw)
hd63450: don't set timer when transfer expects only drqs (nw)
upd765: x68k hangs when it receives polling irqs so can only guess the upd72065 doesn't send them (nw)
[src/emu/machine]hd63450.c upd765.c upd765.h
[src/mess/drivers]x68k.c
[src/mess/includes]x68k.h

trunk/src/emu/machine/upd765.c
r29370r29371
107107   ready_connected = true;
108108   select_connected = true;
109109   external_ready = false;
110   no_poll_irq = false;
110111   dor_reset = 0x00;
111112   mode = MODE_AT;
112113}
r29370r29371
20182019         if(!flopi[fid].st0_filled) {
20192020            flopi[fid].st0 = ST0_ABRT | fid;
20202021            flopi[fid].st0_filled = true;
2021            other_irq = true;
2022            if(!no_poll_irq)
2023               other_irq = true;
20222024         }
20232025      }
20242026   }
r29370r29371
22252227upd72065_device::upd72065_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, UPD72065, "UPD72065", tag, owner, clock, "upd72065", __FILE__)
22262228{
22272229   dor_reset = 0x0c;
2230   no_poll_irq = true;
22282231}
22292232
22302233smc37c78_device::smc37c78_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : upd765_family_device(mconfig, SMC37C78, "SMC37C78", tag, owner, clock, "smc37c78", __FILE__)
trunk/src/emu/machine/upd765.h
r29370r29371
298298
299299   bool ready_connected, ready_polled, select_connected;
300300
301   bool external_ready;
301   bool external_ready, no_poll_irq;
302302
303303   int mode;
304304   int main_phase;
trunk/src/emu/machine/hd63450.c
r29370r29371
269269      m_timer[channel]->adjust(attotime::from_usec(500), channel, m_our_clock[channel]);
270270   else if((m_reg[channel].ocr & 3) == 3)
271271      m_timer[channel]->adjust(attotime::from_usec(500), channel, attotime::never);
272   else if((m_reg[channel].ocr & 3) == 2)
273      m_timer[channel]->adjust(attotime::never, channel, attotime::never);
272274
273275   m_transfer_size[channel] = m_reg[channel].mtc;
274276
r29370r29371
284286
285287TIMER_CALLBACK_MEMBER(hd63450_device::dma_transfer_timer)
286288{
289   if((m_reg[param].ocr & 3) == 2)
290      return;
287291   single_transfer(param);
288292}
289293
trunk/src/mess/drivers/x68k.c
r29370r29371
10421042
10431043TIMER_CALLBACK_MEMBER(x68k_state::x68k_bus_error)
10441044{
1045   int val = param;
1046   int v;
1047   UINT8 *ram = m_ram->pointer();
1045   m_bus_error = false;
1046}
10481047
1049   if(strcmp(machine().system().name,"x68030") == 0)
1050      v = 0x0b;
1051   else
1052      v = 0x09;
1053   if(ram[v] != 0x02)  // normal vector for bus errors points to 02FF0540
1054   {
1055      m_maincpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE);
1056      m_maincpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE);
1057      popmessage("Bus error: Unused RAM access [%08x]", val);
1058   }
1048void x68k_state::set_bus_error(UINT32 address, bool write, UINT16 mem_mask)
1049{
1050   if(m_bus_error)
1051      return;
1052   if(!ACCESSING_BITS_8_15)
1053      address++;
1054   m_bus_error = true;
1055   m68k_set_buserror_details(m_maincpu, address, write, m68k_get_fc(m_maincpu));
1056   m_maincpu->mmu_tmp_buserror_address = address; // Hack for x68030
1057   m_maincpu->set_input_line(M68K_LINE_BUSERROR, ASSERT_LINE);
1058   m_maincpu->set_input_line(M68K_LINE_BUSERROR, CLEAR_LINE);
1059   timer_set(m_maincpu->cycles_to_attotime(16), TIMER_X68K_BUS_ERROR); // let rmw cycles complete
1060   logerror("%s: Bus error: Unused RAM access [%08x]\n", machine().describe_context(), address);   
10591061}
10601062
10611063READ16_MEMBER(x68k_state::x68k_rom0_r)
r29370r29371
10641066      then access causes a bus error */
10651067   m_current_vector[2] = 0x02;  // bus error
10661068   m_current_irq_line = 2;
1067//  m_maincpu->set_input_line_and_vector(2,ASSERT_LINE,m_current_vector[2]);
1068   if(ioport("options")->read() & 0x02)
1069   {
1070      offset *= 2;
1071      if(ACCESSING_BITS_0_7)
1072         offset++;
1073      timer_set(m_maincpu->cycles_to_attotime(4), TIMER_X68K_BUS_ERROR, 0xbffffc+offset);
1074   }
1069   if((ioport("options")->read() & 0x02) && !space.debugger_access())
1070      set_bus_error((offset << 1) + 0xbffffc, 0, mem_mask);
10751071   return 0xff;
10761072}
10771073
r29370r29371
10811077      then access causes a bus error */
10821078   m_current_vector[2] = 0x02;  // bus error
10831079   m_current_irq_line = 2;
1084//  m_maincpu->set_input_line_and_vector(2,ASSERT_LINE,m_current_vector[2]);
1085   if(ioport("options")->read() & 0x02)
1086   {
1087      offset *= 2;
1088      if(ACCESSING_BITS_0_7)
1089         offset++;
1090      timer_set(m_maincpu->cycles_to_attotime(4), TIMER_X68K_BUS_ERROR, 0xbffffc+offset);
1091   }
1080   if((ioport("options")->read() & 0x02) && !space.debugger_access())
1081      set_bus_error((offset << 1) + 0xbffffc, 1, mem_mask);
10921082}
10931083
10941084READ16_MEMBER(x68k_state::x68k_emptyram_r)
r29370r29371
10971087      Often a method for detecting amount of installed RAM, is to read or write at 1MB intervals, until a bus error occurs */
10981088   m_current_vector[2] = 0x02;  // bus error
10991089   m_current_irq_line = 2;
1100//  m_maincpu->set_input_line_and_vector(2,ASSERT_LINE,m_current_vector[2]);
1101   if(ioport("options")->read() & 0x02)
1102   {
1103      offset *= 2;
1104      if(ACCESSING_BITS_0_7)
1105         offset++;
1106      timer_set(m_maincpu->cycles_to_attotime(4), TIMER_X68K_BUS_ERROR, offset);
1107   }
1090   if((ioport("options")->read() & 0x02) && !space.debugger_access())
1091      set_bus_error((offset << 1), 0, mem_mask);
11081092   return 0xff;
11091093}
11101094
r29370r29371
11141098      Often a method for detecting amount of installed RAM, is to read or write at 1MB intervals, until a bus error occurs */
11151099   m_current_vector[2] = 0x02;  // bus error
11161100   m_current_irq_line = 2;
1117//  m_maincpu->set_input_line_and_vector(2,ASSERT_LINE,m_current_vector[2]);
1118   if(ioport("options")->read() & 0x02)
1119   {
1120      offset *= 2;
1121      if(ACCESSING_BITS_0_7)
1122         offset++;
1123      timer_set(m_maincpu->cycles_to_attotime(4), TIMER_X68K_BUS_ERROR, offset);
1124   }
1101   if((ioport("options")->read() & 0x02) && !space.debugger_access())
1102      set_bus_error((offset << 1), 1, mem_mask);
11251103}
11261104
11271105READ16_MEMBER(x68k_state::x68k_exp_r)
11281106{
11291107   /* These are expansion devices, if not present, they cause a bus error */
1130   if(ioport("options")->read() & 0x02)
1131   {
1132      m_current_vector[2] = 0x02;  // bus error
1133      m_current_irq_line = 2;
1134      offset *= 2;
1135      if(ACCESSING_BITS_0_7)
1136         offset++;
1137      timer_set(m_maincpu->cycles_to_attotime(16), TIMER_X68K_BUS_ERROR, 0xeafa00+offset);
1138//      m_maincpu->set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
1139   }
1140   return 0xffff;
1108   m_current_vector[2] = 0x02;  // bus error
1109   m_current_irq_line = 2;
1110   if((ioport("options")->read() & 0x02) && !space.debugger_access())
1111      set_bus_error((offset << 1) + 0xeafa00, 0, mem_mask);
1112   return 0xff;
11411113}
11421114
11431115WRITE16_MEMBER(x68k_state::x68k_exp_w)
11441116{
11451117   /* These are expansion devices, if not present, they cause a bus error */
1146   if(ioport("options")->read() & 0x02)
1147   {
1148      m_current_vector[2] = 0x02;  // bus error
1149      m_current_irq_line = 2;
1150      offset *= 2;
1151      if(ACCESSING_BITS_0_7)
1152         offset++;
1153      timer_set(m_maincpu->cycles_to_attotime(16), TIMER_X68K_BUS_ERROR, 0xeafa00+offset);
1154//      m_maincpu->set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
1155   }
1118   m_current_vector[2] = 0x02;  // bus error
1119   m_current_irq_line = 2;
1120   if((ioport("options")->read() & 0x02) && !space.debugger_access())
1121      set_bus_error((offset << 1) + 0xeafa00, 1, mem_mask);
11561122}
11571123
11581124void x68k_state::dma_irq(int channel)
r29370r29371
17661732   address_space &space = m_maincpu->space(AS_PROGRAM);
17671733   /*  Install RAM handlers  */
17681734   m_spriteram = (UINT16*)(*memregion("user1"));
1769   space.install_read_handler(0x000000,0xbffffb,0xffffffff,0,read16_delegate(FUNC(x68k_state::x68k_rom0_r),this),0xffffffff);
1770   space.install_write_handler(0x000000,0xbffffb,0xffffffff,0,write16_delegate(FUNC(x68k_state::x68k_rom0_w),this),0xffffffff);
1735   space.install_read_handler(0x000000,0xbffffb,0xffffffff,0,read16_delegate(FUNC(x68k_state::x68k_emptyram_r),this),0xffffffff);
1736   space.install_write_handler(0x000000,0xbffffb,0xffffffff,0,write16_delegate(FUNC(x68k_state::x68k_emptyram_w),this),0xffffffff);
17711737   space.install_readwrite_bank(0x000000,m_ram->size()-1,0xffffffff,0,"bank1");
17721738   membank("bank1")->set_base(m_ram->pointer());
17731739   space.install_read_handler(0xc00000,0xdfffff,0xffffffff,0,read32_delegate(FUNC(x68k_state::x68k_gvram32_r),this));
trunk/src/mess/includes/x68k.h
r29370r29371
99#ifndef X68K_H_
1010#define X68K_H_
1111
12#include "cpu/m68000/m68000.h"
1213#include "machine/hd63450.h"
1314#include "machine/rp5c15.h"
1415#include "machine/upd765.h"
r29370r29371
5859         m_gvram32(*this, "gvram32"),
5960         m_tvram32(*this, "tvram32") { }
6061
61   required_device<cpu_device> m_maincpu;
62   required_device<m68000_base_device> m_maincpu;
6263   required_device<okim6258_device> m_okim6258;
6364   required_device<hd63450_device> m_hd63450;
6465   required_device<ram_device> m_ram;
r29370r29371
327328
328329protected:
329330   virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);
331   void set_bus_error(UINT32 address, bool write, UINT16 mem_mask);
332   bool m_bus_error;
330333};
331334
332335

Previous 199869 Revisions Next


© 1997-2024 The MAME Team