Previous 199869 Revisions Next

r23553 Sunday 9th June, 2013 at 03:55:02 UTC by Barry Rodewald
attache: fixed RTC detection and reading.
[src/emu/machine]msm5832.c
[src/mess/drivers]attache.c

trunk/src/emu/machine/msm5832.c
r23552r23553
180180      {
181181         // TODO reference output
182182      }
183      else if(m_address == 0x0d || m_address == 0x0e)  // Otrona Attache CP/M BIOS checks these unused registers to detect it
184      {
185         data = 0x0f;
186      }
183187      else
184188      {
185189         data = m_reg[m_address];
trunk/src/mess/drivers/attache.c
r23552r23553
6464#include "video/tms9927.h"
6565#include "machine/ram.h"
6666#include "machine/nvram.h"
67#include "debugger.h"
6768
6869class attache_state : public driver_device
6970{
r23552r23553
434435   m_kb_clock = state;
435436}
436437
438// TODO: Figure out exactly how the HLD, RD, WR and CS lines are hooked up
437439READ8_MEMBER(attache_state::pio_portA_r)
438440{
439441   UINT8 ret = 0xff;
r23552r23553
446448      logerror("PSG: data read %02x\n",ret);
447449      break;
448450   case PIO_SEL_5832_WRITE:
451      m_rtc->cs_w(1);
452      m_rtc->write_w(0);
453      m_rtc->read_w(1);
449454      m_rtc->address_w((porta & 0xf0) >> 4);
450455      ret = m_rtc->data_r(space,0);
451      logerror("RTC: read %02x (write)\n",ret);
456      logerror("RTC: read %02x from %02x (write)\n",ret,(porta & 0xf0) >> 4);
452457      break;
453458   case PIO_SEL_5832_READ:
459      m_rtc->cs_w(1);
460      m_rtc->write_w(0);
461      m_rtc->read_w(1);
454462      m_rtc->address_w((porta & 0xf0) >> 4);
455463      ret = m_rtc->data_r(space,0);
456      logerror("RTC: read %02x\n",ret);
464      logerror("RTC: read %02x from %02x\n",ret,(porta & 0xf0) >> 4);
457465      break;
458466   case PIO_SEL_5101_WRITE:
459467      m_cmos_select = (m_cmos_select & 0xf0) | ((porta & 0xf0) >> 4);
r23552r23553
491499   {
492500   case PIO_SEL_8910_ADDR:
493501      m_psg->address_w(space,0,data);
494      logerror("PSG: address write %02x\n",data);
495502      break;
496503   case PIO_SEL_8910_DATA:
497504      m_psg->data_w(space,0,data);
498      logerror("PSG: data write %02x\n",data);
499505      break;
500506   case PIO_SEL_5832_WRITE:
507      m_rtc->cs_w(1);
508      m_rtc->write_w(0);
509      m_rtc->read_w(1);
501510      m_rtc->address_w((data & 0xf0) >> 4);
502511      m_rtc->data_w(space,0,data & 0x0f);
503512      logerror("RTC: write %01x to %01x\n",data & 0x0f,(data & 0xf0) >> 4);
504513      break;
505514   case PIO_SEL_5832_READ:
515      m_rtc->cs_w(1);
516      m_rtc->write_w(0);
517      m_rtc->read_w(1);
506518      m_rtc->address_w((data & 0xf0) >> 4);
507519      logerror("RTC: write %01x to %01x (read)\n",data & 0x0f,(data & 0xf0) >> 4);
508520      break;
r23552r23553
561573   //B5 = /'138 OPERATION STROBE
562574   //B6 = /KEYBOARD DATA IN
563575   //B7 = /KEYBOARD CLOCK OUT
576   m_pio_select = (data & 0x1c) >> 2;
577   m_cmos_select = ((data & 0x03) << 4) | (m_cmos_select & 0x0f);
564578   if((data & 0x20) && !(m_pio_portb & 0x20))
565579      operation_strobe(space,m_pio_porta);
566   m_pio_select = (data & 0x1c) >> 2;
567   m_cmos_select = ((data & 0x03) << 4) | (m_cmos_select & 0x0f);
568580   m_pio_portb = data;
569581   keyboard_clock_w(data & 0x80);
570582}
r23552r23553
10121024   MCFG_SOUND_CONFIG(ay8912_interface)
10131025   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25)
10141026
1015   MCFG_MSM5832_ADD("rtc",XTAL_8MHz / 4)
1027   MCFG_MSM5832_ADD("rtc",XTAL_32_768kHz)
10161028
10171029   MCFG_Z80PIO_ADD("pio",XTAL_8MHz / 26, pio_interface)
10181030   MCFG_Z80SIO0_ADD("sio",XTAL_8MHz / 26, sio_interface)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team