summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess
diff options
context:
space:
mode:
author cracyc <cracyc@users.noreply.github.com>2015-09-13 20:48:27 -0500
committer cracyc <cracyc@users.noreply.github.com>2015-09-13 20:48:27 -0500
commit13f3f78103e039428c0ba0d3d7192968f3a5c817 (patch)
treeaf32230741930c8280fc400d3a8159a31f222daa /src/mess
parent9bfb44b096b259d2598a49ad5cc1995909083e88 (diff)
pcd: make scsi work (nw)
Diffstat (limited to 'src/mess')
-rw-r--r--src/mess/drivers/pcd.c37
-rw-r--r--src/mess/video/pcd.c10
2 files changed, 31 insertions, 16 deletions
diff --git a/src/mess/drivers/pcd.c b/src/mess/drivers/pcd.c
index 4b989d4b07d..808eaef5725 100644
--- a/src/mess/drivers/pcd.c
+++ b/src/mess/drivers/pcd.c
@@ -4,7 +4,7 @@
Siemens PC-D
- Skeleton driver
+ For PC-X HDD should have 306,4,9 chs at 1024Bps or 17 at 512Bps
***************************************************************************/
@@ -41,7 +41,8 @@ public:
m_scsi(*this, "scsi"),
m_scsi_data_out(*this, "scsi_data_out"),
m_scsi_data_in(*this, "scsi_data_in"),
- m_ram(*this, "ram")
+ m_ram(*this, "ram"),
+ m_req_hack(NULL)
{ }
DECLARE_READ8_MEMBER( irq_callback );
@@ -94,12 +95,15 @@ private:
int m_msg, m_bsy, m_io, m_cd, m_req, m_rst;
emu_timer *m_req_hack;
UINT16 m_dskctl;
+ bool m_sound;
struct {
UINT16 ctl;
UINT16 regs[1024];
int type;
bool sc;
} m_mmu;
+
+ void check_scsi_irq();
};
@@ -148,7 +152,8 @@ TIMER_DEVICE_CALLBACK_MEMBER( pcd_state::timer0_tick )
WRITE_LINE_MEMBER( pcd_state::i186_timer1_w )
{
- m_speaker->level_w(state);
+ if(m_dskctl & 0x20)
+ m_speaker->level_w(state);
}
READ8_MEMBER( pcd_state::nmi_io_r )
@@ -242,7 +247,7 @@ WRITE8_MEMBER( pcd_state::led_w )
READ16_MEMBER( pcd_state::mmu_r )
{
UINT16 data = m_mmu.regs[((m_mmu.ctl & 0x1f) << 5) | ((offset >> 2) & 0x1f)];
- logerror("%s: mmu read %04x %04x\n", machine().describe_context(), (offset << 1) + 0x8000, data);
+ //logerror("%s: mmu read %04x %04x\n", machine().describe_context(), (offset << 1) + 0x8000, data);
if(!offset)
return m_mmu.ctl;
else if((offset >= 0x200) && (offset < 0x300) && !(offset & 3))
@@ -257,7 +262,7 @@ READ16_MEMBER( pcd_state::mmu_r )
WRITE16_MEMBER( pcd_state::mmu_w )
{
- logerror("%s: mmu write %04x %04x\n", machine().describe_context(), (offset << 1) + 0x8000, data);
+ //logerror("%s: mmu write %04x %04x\n", machine().describe_context(), (offset << 1) + 0x8000, data);
if(!offset)
m_mmu.ctl = data;
else if((offset >= 0x200) && (offset < 0x300) && !(offset & 3))
@@ -298,11 +303,7 @@ WRITE8_MEMBER(pcd_state::scsi_w)
case 0:
m_scsi_data_out->write(data);
m_scsi->write_ack(1);
- if(m_cd)
- {
- m_maincpu->drq0_w(0);
- m_req_hack->adjust(attotime::never);
- }
+ m_maincpu->drq0_w(0);
break;
case 1:
if(data & 4)
@@ -327,6 +328,11 @@ WRITE8_MEMBER(pcd_state::scsi_w)
}
}
+void pcd_state::check_scsi_irq()
+{
+ m_pic1->ir5_w(m_io && m_cd && m_req);
+}
+
WRITE_LINE_MEMBER(pcd_state::write_scsi_bsy)
{
m_bsy = state ? 1 : 0;
@@ -335,10 +341,14 @@ WRITE_LINE_MEMBER(pcd_state::write_scsi_bsy)
WRITE_LINE_MEMBER(pcd_state::write_scsi_cd)
{
m_cd = state ? 1 : 0;
+ check_scsi_irq();
}
WRITE_LINE_MEMBER(pcd_state::write_scsi_io)
{
m_io = state ? 1 : 0;
+ if(state)
+ m_scsi_data_out->write(0);
+ check_scsi_irq();
}
WRITE_LINE_MEMBER(pcd_state::write_scsi_msg)
{
@@ -362,7 +372,12 @@ WRITE_LINE_MEMBER(pcd_state::write_scsi_req)
}
}
else
+ {
+ if(m_req_hack) // this might be called before machine_start
+ m_req_hack->adjust(attotime::never);
m_scsi->write_ack(0);
+ }
+ check_scsi_irq();
}
WRITE16_MEMBER(pcd_state::mem_w)
@@ -430,7 +445,7 @@ static ADDRESS_MAP_START( pcd_io, AS_IO, 16, pcd_state )
AM_RANGE(0xf900, 0xf903) AM_DEVREADWRITE8("fdc", wd2793_t, read, write, 0xffff)
AM_RANGE(0xf904, 0xf905) AM_READWRITE(dskctl_r, dskctl_w)
AM_RANGE(0xf940, 0xf943) AM_READWRITE8(scsi_r, scsi_w, 0xffff)
- AM_RANGE(0xf980, 0xf98f) AM_DEVICE("video", pcdx_video_device, map)
+ AM_RANGE(0xf980, 0xf9bf) AM_DEVICE("video", pcdx_video_device, map)
AM_RANGE(0xf9c0, 0xf9c3) AM_DEVREADWRITE8("usart1",mc2661_device,read,write,0xffff) // UARTs
AM_RANGE(0xf9d0, 0xf9d3) AM_DEVREADWRITE8("usart2",mc2661_device,read,write,0xffff)
AM_RANGE(0xf9e0, 0xf9e3) AM_DEVREADWRITE8("usart3",mc2661_device,read,write,0xffff)
diff --git a/src/mess/video/pcd.c b/src/mess/video/pcd.c
index 3979f663a40..991a646b2c7 100644
--- a/src/mess/video/pcd.c
+++ b/src/mess/video/pcd.c
@@ -112,6 +112,7 @@ static ADDRESS_MAP_START( pcx_vid_io, AS_IO, 8, pcx_video_device )
AM_RANGE(0xa000, 0xa001) AM_READWRITE(vram_latch_r, vram_latch_w)
AM_RANGE(0xa002, 0xa003) AM_READWRITE(term_mcu_r, term_mcu_w)
AM_RANGE(0xc000, 0xc7ff) AM_RAM
+ AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_NOP // revisit this
ADDRESS_MAP_END
static ADDRESS_MAP_START( pcx_vram, AS_0, 8, pcx_video_device )
@@ -300,8 +301,6 @@ READ8_MEMBER(pcx_video_device::unk_r)
void pcd_video_device::device_start()
{
- m_maincpu->space(AS_IO).install_write_handler(0xf9a0, 0xf9a1, 0, 0, write8_delegate(FUNC(pcd_video_device::vram_sw_w), this), 0x00ff);
- m_maincpu->space(AS_IO).install_readwrite_handler(0xf9b0, 0xf9b3, 0, 0, read8_delegate(FUNC(pcd_video_device::mcu_r), this), write8_delegate(FUNC(pcd_video_device::mcu_w), this), 0x00ff);
m_maincpu->space(AS_IO).install_readwrite_handler(0xfb00, 0xfb01, 0, 0, read8_delegate(FUNC(pcdx_video_device::detect_r), this), write8_delegate(FUNC(pcdx_video_device::detect_w), this), 0xff00);
m_maincpu->space(AS_PROGRAM).install_readwrite_handler(0xf0000, 0xf7fff, 0, 0, read8_delegate(FUNC(pcd_video_device::vram_r), this), write8_delegate(FUNC(pcd_video_device::vram_w), this), 0xffff);
m_gfxdecode->set_gfx(0, global_alloc(gfx_element(machine().device<palette_device>("palette"), pcd_charlayout, &m_charram[0], 0, 1, 0)));
@@ -312,10 +311,11 @@ void pcd_video_device::device_reset()
m_vram_sw = 1;
}
-
DEVICE_ADDRESS_MAP_START(map, 16, pcd_video_device)
- AM_RANGE(0x0, 0xf) AM_DEVWRITE8("crtc", scn2674_device, write, 0x00ff)
- AM_RANGE(0x0, 0xf) AM_DEVREAD8("crtc", scn2674_device, read, 0xff00)
+ AM_RANGE(0x00, 0x0f) AM_DEVWRITE8("crtc", scn2674_device, write, 0x00ff)
+ AM_RANGE(0x00, 0x0f) AM_DEVREAD8("crtc", scn2674_device, read, 0xff00)
+ AM_RANGE(0x20, 0x21) AM_WRITE8(vram_sw_w, 0x00ff)
+ AM_RANGE(0x30, 0x33) AM_READWRITE8(mcu_r, mcu_w, 0x00ff)
ADDRESS_MAP_END
void pcx_video_device::device_start()