summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/amstrad.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/machine/amstrad.cpp')
-rw-r--r--src/mame/machine/amstrad.cpp80
1 files changed, 34 insertions, 46 deletions
diff --git a/src/mame/machine/amstrad.cpp b/src/mame/machine/amstrad.cpp
index 0725ab3142e..05cd44546c2 100644
--- a/src/mame/machine/amstrad.cpp
+++ b/src/mame/machine/amstrad.cpp
@@ -1947,28 +1947,22 @@ b8 b0 Function Read/Write state
If b10 is reset but none of b7-b5 are reset, user expansion peripherals are selected.
The exception is the case where none of b7-b0 are reset (i.e. port &FBFF), which causes the expansion peripherals to reset.
*/
- if ( m_system_type != SYSTEM_GX4000 )
+ if (m_fdc.found()) // if FDC is present (it isn't on a 464 or GX4000)
{
- if(m_fdc) // if FDC is present (it isn't on a 464)
+ if ( ( offset & (1<<10) ) == 0 )
{
- if ( ( offset & (1<<10) ) == 0 )
- {
- if ( ( offset & (1<<10) ) == 0 )
- {
- int b8b0 = ( ( offset & (1<<8) ) >> (8 - 1) ) | ( offset & 0x01 );
+ int b8b0 = ( ( offset & (1<<8) ) >> (8 - 1) ) | ( offset & 0x01 );
- switch (b8b0)
- {
- case 0x02:
- data = m_fdc->msr_r(space, 0);
- break;
- case 0x03:
- data = m_fdc->fifo_r(space, 0);
- break;
- default:
- break;
- }
- }
+ switch (b8b0)
+ {
+ case 0x02:
+ data = m_fdc->msr_r(space, 0);
+ break;
+ case 0x03:
+ data = m_fdc->fifo_r(space, 0);
+ break;
+ default:
+ break;
}
}
}
@@ -2159,39 +2153,33 @@ b8 b0 Function Read/Write state
If b10 is reset but none of b7-b5 are reset, user expansion peripherals are selected.
The exception is the case where none of b7-b0 are reset (i.e. port &FBFF), which causes the expansion peripherals to reset.
*/
- if(m_system_type != SYSTEM_GX4000)
+ if (m_fdc.found()) // if FDC is present (it isn't on a 464 or GX4000)
{
- if(m_fdc) // if FDC is present (it isn't on a 464)
+ if ((offset & (1<<7)) == 0)
{
- if ((offset & (1<<7)) == 0)
- {
- unsigned int b8b0 = ((offset & 0x0100) >> (8 - 1)) | (offset & 0x01);
+ unsigned int b8b0 = ((offset & 0x0100) >> (8 - 1)) | (offset & 0x01);
- switch (b8b0)
+ switch (b8b0)
+ {
+ case 0x00:
+ case 0x01:
+ /* FDC Motor Control - Bit 0 defines the state of the FDD motor:
+ * "1" the FDD motor will be active.
+ * "0" the FDD motor will be in-active.*/
+ for (auto &fd : m_floppy)
{
- case 0x00:
- case 0x01:
- {
- /* FDC Motor Control - Bit 0 defines the state of the FDD motor:
- * "1" the FDD motor will be active.
- * "0" the FDD motor will be in-active.*/
- floppy_image_device *floppy;
- floppy = machine().device<floppy_connector>(":upd765:0")->get_device();
- if(floppy)
- floppy->mon_w(!BIT(data, 0));
- floppy = machine().device<floppy_connector>(":upd765:1")->get_device();
- if(floppy)
- floppy->mon_w(!BIT(data, 0));
- break;
- }
+ floppy_image_device *floppy = fd->get_device();
+ if(floppy)
+ floppy->mon_w(!BIT(data, 0));
+ }
+ break;
- case 0x03: /* Write Data register of FDC */
- m_fdc->fifo_w(space, 0,data);
- break;
+ case 0x03: /* Write Data register of FDC */
+ m_fdc->fifo_w(space, 0,data);
+ break;
- default:
- break;
- }
+ default:
+ break;
}
}
}