summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/machine/compis.c
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2012-10-10 15:33:51 +0000
committer Olivier Galibert <galibert@pobox.com>2012-10-10 15:33:51 +0000
commit9d1aaf97ae5a4d5b2272f064fe6b6fe7df9dbf88 (patch)
tree74e3dc1e5558b42717e62f9b81cc7d7d47b90449 /src/mess/machine/compis.c
parent204b78cf00de0c3bd8b6afefa601cd26aa391c91 (diff)
(mess) upd765: Modernize [O. Galibert]
Remaining TODO list: - take WP into account - test the amstrad, implement its observational format (edsk) using pasti as a start. Or find the legendary amstrad IPFs. Or both. - correct read track, the implementation is completely wrong. See previous for testing, it's only used in protections the check the inter-sector gaps. - shake and bake on the amstrad, protections are the best to find bugs in a fdc - add the scan id commands, but nothing seems to use them - debug the 2.88M formatting which is unreliable. Fix its IDAM/DAM gap size on formatting too (but that's not what's making it unreliable) - test all the systems that were hit, and fix what needs to be fixed. Beware that multiple problems may happen: - upd765 may be wrong - the driver may not be working - the hookup may be wrong/incomplete (bitrate selection and floppy rpm in particular) - the driver may be too limited for the new implementation (the x68k dma device does not handle non-instant dma yet for instance) - report invalid command when appropriate depending on the actual chip emulated - add the russian clones with their real names
Diffstat (limited to 'src/mess/machine/compis.c')
-rw-r--r--src/mess/machine/compis.c71
1 files changed, 5 insertions, 66 deletions
diff --git a/src/mess/machine/compis.c b/src/mess/machine/compis.c
index 6be6779b958..eee3503983d 100644
--- a/src/mess/machine/compis.c
+++ b/src/mess/machine/compis.c
@@ -159,12 +159,7 @@ static void compis_keyb_init(compis_state *state)
/*-------------------------------------------------------------------------*/
static void compis_fdc_reset(running_machine &machine)
{
- device_t *fdc = machine.device("upd765");
-
- upd765_reset(fdc, 0);
-
- /* set FDC at reset */
- upd765_reset_w(fdc, 1);
+ machine.device("upd765")->reset();
}
void compis_state::compis_fdc_tc(int state)
@@ -172,11 +167,11 @@ void compis_state::compis_fdc_tc(int state)
/* Terminal count if iSBX-218A has DMA enabled */
if (ioport("DSW1")->read())
{
- upd765_tc_w(m_fdc, state);
+ m_fdc->tc_w(state);
}
}
-WRITE_LINE_MEMBER( compis_state::compis_fdc_int )
+void compis_state::fdc_irq(bool state)
{
/* No interrupt requests if iSBX-218A has DMA enabled */
if (!ioport("DSW1")->read() && state)
@@ -189,71 +184,15 @@ WRITE_LINE_MEMBER( compis_state::compis_fdc_int )
}
}
-WRITE_LINE_MEMBER( compis_state::compis_fdc_dma_drq )
+void compis_state::fdc_drq(bool state)
{
- /* DMA requst if iSBX-218A has DMA enabled */
+ /* DMA request if iSBX-218A has DMA enabled */
if (ioport("DSW1")->read() && state)
{
//compis_dma_drq(state, read);
}
}
-const upd765_interface compis_fdc_interface =
-{
- DEVCB_DRIVER_LINE_MEMBER(compis_state, compis_fdc_int),
- DEVCB_DRIVER_LINE_MEMBER(compis_state, compis_fdc_dma_drq),
- NULL,
- UPD765_RDY_PIN_CONNECTED,
- {FLOPPY_0, FLOPPY_1, NULL, NULL}
-};
-
-READ16_MEMBER( compis_state::compis_fdc_dack_r )
-{
- UINT16 data;
- data = 0xffff;
- /* DMA acknowledge if iSBX-218A has DMA enabled */
- if (ioport("DSW1")->read())
- {
- data = upd765_dack_r(m_fdc, space, 0);
- }
-
- return data;
-}
-
-WRITE8_MEMBER( compis_state::compis_fdc_w )
-{
- switch(offset)
- {
- case 2:
- upd765_data_w(m_fdc, space, 0, data);
- break;
- default:
- printf("FDC Unknown Port Write %04X = %04X\n", offset, data);
- break;
- }
-}
-
-READ8_MEMBER( compis_state::compis_fdc_r )
-{
- UINT16 data;
- data = 0xffff;
- switch(offset)
- {
- case 0:
- data = upd765_status_r(m_fdc, space, 0);
- break;
- case 2:
- data = upd765_data_r(m_fdc, space, 0);
- break;
- default:
- printf("FDC Unknown Port Read %04X\n", offset);
- break;
- }
-
- return data;
-}
-
-
/*-------------------------------------------------------------------------*/
/* Bit 0: J5-4 */