Previous 199869 Revisions Next

r32441 Sunday 28th September, 2014 at 01:21:43 UTC by Carl
(mess) pc9801: make sasi partially work (nw)
scsi: sync rest of lines with input buffer (nw)
---
The 9801f will read the hdd but appears to not like disks without 256 byte sectors.
The ux and rs don't even attempt to access the sasi controller and seem to have no driver in their firmwares, are they supposed to have an external rom?
[src/emu/bus]bus.mak
[src/emu/bus/scsi]pc9801_sasi.c* pc9801_sasi.h* scsi.c
[src/mess/drivers]pc9801.c

trunk/src/emu/bus/bus.mak
r32440r32441
12181218BUSOBJS += $(BUSOBJ)/scsi/d9060hd.o
12191219BUSOBJS += $(BUSOBJ)/scsi/sa1403d.o
12201220BUSOBJS += $(BUSOBJ)/scsi/s1410.o
1221BUSOBJS += $(BUSOBJ)/scsi/pc9801_sasi.o
12211222endif
12221223
12231224#-------------------------------------------------
trunk/src/emu/bus/scsi/scsi.c
r32440r32441
122122   m_data5_handler(0);
123123   m_data6_handler(0);
124124   m_data7_handler(0);
125
126   m_bsy_handler(0);
127   m_sel_handler(0);
128   m_cd_handler(0);
129   m_io_handler(0);
130   m_msg_handler(0);
131   m_req_handler(0);
132   m_ack_handler(0);
133   m_atn_handler(0);
134   m_rst_handler(0);
125135}
126136
127137void SCSI_PORT_DEVICE::update_bsy()
trunk/src/emu/bus/scsi/pc9801_sasi.c
r0r32441
1#include "pc9801_sasi.h"
2
3#define SASI_CMD_SPECIFY 0xc2 // according to x68k_hdc.c
4
5const device_type PC9801_SASI = &device_creator<pc9801_sasi_device>;
6
7pc9801_sasi_device::pc9801_sasi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
8   : scsihd_device(mconfig, PC9801_SASI, "PC-9801 SASI Controller", tag, owner, clock, "pc9801_sasi", __FILE__)
9{
10}
11
12void pc9801_sasi_device::ExecCommand()
13{
14   switch(command[0])
15   {
16      case SASI_CMD_SPECIFY:
17         m_phase = SCSI_PHASE_DATAOUT;
18         m_status_code = SCSI_STATUS_CODE_GOOD;
19         m_transfer_length = 10;
20         break;
21
22      default:
23         scsihd_device::ExecCommand();
24         break;
25   }
26}
Property changes on: trunk/src/emu/bus/scsi/pc9801_sasi.c
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/emu/bus/scsi/pc9801_sasi.h
r0r32441
1#ifndef PC9801_SASI_H_
2#define PC9801_SASI_H_
3
4#include "scsihd.h"
5
6class pc9801_sasi_device  : public scsihd_device
7{
8public:
9   // construction/destruction
10   pc9801_sasi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
11
12   virtual void ExecCommand();
13};
14
15// device type definition
16extern const device_type PC9801_SASI;
17
18#endif /* PC9801_SASI_H_ */
Property changes on: trunk/src/emu/bus/scsi/pc9801_sasi.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/mess/drivers/pc9801.c
r32440r32441
402402#include "machine/upd1990a.h"
403403#include "machine/i8251.h"
404404
405#include "bus/scsi/s1410.h"
405#include "bus/scsi/pc9801_sasi.h"
406406#include "bus/scsi/scsi.h"
407407#include "bus/scsi/scsihd.h"
408408#include "machine/buffer.h"
r32440r32441
600600   UINT32 pc9801_286_a20(bool state);
601601
602602   DECLARE_WRITE8_MEMBER(sasi_data_w);
603   DECLARE_READ8_MEMBER(sasi_data_r);
603604   DECLARE_WRITE_LINE_MEMBER(write_sasi_io);
605   DECLARE_WRITE_LINE_MEMBER(write_sasi_req);
604606   DECLARE_READ8_MEMBER(sasi_status_r);
605607   DECLARE_WRITE8_MEMBER(sasi_ctrl_w);
606608
r32440r32441
17301732   }
17311733}
17321734
1735READ8_MEMBER( pc9801_state::sasi_data_r )
1736{
1737   UINT8 data = m_sasi_data_in->read();
1738
1739   if(m_sasi_ctrl_in->read() & 0x80)
1740      m_sasibus->write_ack(1);
1741   return data;
1742}
1743
17331744WRITE8_MEMBER( pc9801_state::sasi_data_w )
17341745{
17351746   m_sasi_data = data;
r32440r32441
17371748   if (m_sasi_data_enable)
17381749   {
17391750      m_sasi_data_out->write(m_sasi_data);
1751      if(m_sasi_ctrl_in->read() & 0x80)
1752         m_sasibus->write_ack(1);
17401753   }
17411754}
17421755
r32440r32441
17541767   {
17551768      m_sasi_data_out->write(0);
17561769   }
1770   if((m_sasi_ctrl_in->read() & 0x9C) == 0x8C)
1771      m_pic2->ir1_w(m_sasi_ctrl & 1);
1772   else
1773      m_pic2->ir1_w(0);
17571774}
17581775
1776WRITE_LINE_MEMBER( pc9801_state::write_sasi_req )
1777{
1778   m_sasi_ctrl_in->write_bit7(state);
1779
1780   if (!state)
1781      m_sasibus->write_ack(0);
1782
1783   if((m_sasi_ctrl_in->read() & 0x9C) == 0x8C)
1784      m_pic2->ir1_w(m_sasi_ctrl & 1);
1785   else
1786      m_pic2->ir1_w(0);
1787
1788   m_dmac->dreq0_w(!(state && !(m_sasi_ctrl_in->read() & 8) && (m_sasi_ctrl & 2)));
1789}
1790
17591791#include "debugger.h"
17601792
17611793READ8_MEMBER( pc9801_state::sasi_status_r )
r32440r32441
17651797   if(m_sasi_ctrl & 0x40) // read status
17661798   {
17671799   /*
1768       x--- -.-- REQ
1800       x--- ---- REQ
17691801       -x-- ---- ACK
17701802       --x- ---- BSY
17711803       ---x ---- MSG
r32440r32441
17821814        --xx x--- SASI-1 media type
17831815        ---- -xxx SASI-2 media type
17841816*/
1785      res |= 7 << 3; // read mediatype SASI-1
1786      res |= 7;   // read mediatype SASI-2
1817      //res |= 7 << 3; // read mediatype SASI-1
1818      //res |= 7;   // read mediatype SASI-2
17871819   }
1788
17891820   return res;
17901821}
17911822
r32440r32441
18391870//  AM_RANGE(0x006c, 0x006f) border color / <undefined>
18401871   AM_RANGE(0x0070, 0x007b) AM_READWRITE8(pc9801_70_r,pc9801_70_w,0xffff) //display registers / i8253 pit
18411872//  AM_RANGE(0x0080, 0x0083) AM_READWRITE8(pc9801_sasi_r,pc9801_sasi_w,0xffff) //HDD SASI interface / <undefined>
1842   AM_RANGE(0x0080, 0x0081) AM_DEVREAD8("sasi_data_in", input_buffer_device, read, 0x00ff) AM_WRITE8(sasi_data_w, 0x00ff)
1873   AM_RANGE(0x0080, 0x0081) AM_READWRITE8(sasi_data_r, sasi_data_w, 0x00ff)
18431874   AM_RANGE(0x0082, 0x0083) AM_READWRITE8(sasi_status_r, sasi_ctrl_w,0x00ff)
18441875   AM_RANGE(0x0090, 0x0097) AM_READWRITE8(pc9801_fdc_2hd_r,pc9801_fdc_2hd_w,0xffff) //upd765a 2hd / cmt
18451876   AM_RANGE(0x00a0, 0x00af) AM_READWRITE8(pc9801_a0_r,pc9801_a0_w,0xffff) //upd7220 bitmap ports / display registers
r32440r32441
35423573   MCFG_SCSI_MSG_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit4))
35433574   MCFG_SCSI_BSY_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit5))
35443575   MCFG_SCSI_ACK_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit6))
3545   MCFG_SCSI_REQ_HANDLER(DEVWRITELINE("sasi_ctrl_in", input_buffer_device, write_bit7))
3576   MCFG_SCSI_REQ_HANDLER(WRITELINE(pc9801_state, write_sasi_req))
35463577
3547   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", S1410, SCSI_ID_0) // TODO: correct one, perhaps ttl
3578   MCFG_SCSIDEV_ADD(SASIBUS_TAG ":" SCSI_PORT_DEVICE1, "harddisk", PC9801_SASI, SCSI_ID_0)
35483579
35493580   MCFG_SCSI_OUTPUT_LATCH_ADD("sasi_data_out", SASIBUS_TAG)
35503581   MCFG_DEVICE_ADD("sasi_data_in", INPUT_BUFFER, 0)
35513582   MCFG_DEVICE_ADD("sasi_ctrl_in", INPUT_BUFFER, 0)
3583
3584   MCFG_DEVICE_MODIFY("i8237")
3585   MCFG_I8237_IN_IOR_0_CB(READ8(pc9801_state, sasi_data_r))
3586   MCFG_I8237_OUT_IOW_0_CB(WRITE8(pc9801_state, sasi_data_w))
35523587MACHINE_CONFIG_END
35533588
35543589

Previous 199869 Revisions Next


© 1997-2024 The MAME Team