mirror of
https://github.com/holub/mame
synced 2025-07-05 18:08:04 +03:00
msx.cpp: Added layouts for displaying internal drive activity. (#10932)
This commit is contained in:
parent
4210a5f1a8
commit
6e9b7c571f
File diff suppressed because it is too large
Load Diff
@ -53,6 +53,9 @@ DECLARE_DEVICE_TYPE(MSX_SLOT_DISK11_WD2793, msx_slot_disk11_wd2793_device)
|
||||
|
||||
class msx_slot_disk_device : public msx_slot_rom_device
|
||||
{
|
||||
public:
|
||||
int get_nr_drives() const { return m_nr_drives; }
|
||||
|
||||
protected:
|
||||
static constexpr int NO_DRIVES = 0;
|
||||
static constexpr int DRIVES_1 = 1;
|
||||
@ -62,41 +65,56 @@ protected:
|
||||
static constexpr bool DS = true;
|
||||
static constexpr bool SS = false;
|
||||
|
||||
msx_slot_disk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
|
||||
msx_slot_disk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int nr_drives);
|
||||
|
||||
static void floppy_formats(format_registration &fr);
|
||||
void add_drive_mconfig(machine_config &config, int nr_of_drives, bool double_sided);
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
void add_drive_mconfig(machine_config &config, bool double_sided);
|
||||
void set_drive_access_led_state(int drive, int led_state);
|
||||
|
||||
optional_device<floppy_connector> m_floppy0;
|
||||
optional_device<floppy_connector> m_floppy1;
|
||||
optional_device<floppy_connector> m_floppy2;
|
||||
optional_device<floppy_connector> m_floppy3;
|
||||
floppy_image_device *m_floppy;
|
||||
|
||||
private:
|
||||
output_finder<4> m_access_int_drv_out;
|
||||
int m_nr_drives;
|
||||
};
|
||||
|
||||
|
||||
class msx_slot_wd_disk_device : public msx_slot_disk_device
|
||||
{
|
||||
public:
|
||||
virtual void use_motor_for_led() { }
|
||||
|
||||
protected:
|
||||
static constexpr bool FORCE_READY = true;
|
||||
static constexpr bool NO_FORCE_READY = false;
|
||||
|
||||
msx_slot_wd_disk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
msx_slot_wd_disk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int nr_drives);
|
||||
|
||||
virtual void device_start() override;
|
||||
template <typename FDCType> void add_mconfig(machine_config &config, FDCType &&type, bool force_ready, int nr_of_drives, bool double_sided);
|
||||
template <typename FDCType> void add_mconfig(machine_config &config, FDCType &&type, bool force_ready, bool double_sided);
|
||||
void set_control_led_bit(u8 control_led_bit) { m_control_led_bit = control_led_bit; }
|
||||
u8 get_control_led_bit() const { return m_control_led_bit; }
|
||||
|
||||
required_device<wd_fdc_analog_device_base> m_fdc;
|
||||
output_finder<> m_led;
|
||||
|
||||
private:
|
||||
u8 m_control_led_bit; // For the implementations that need it, which bit of a control write controls the LED bit.
|
||||
};
|
||||
|
||||
|
||||
class msx_slot_tc8566_disk_device : public msx_slot_disk_device
|
||||
{
|
||||
protected:
|
||||
msx_slot_tc8566_disk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
msx_slot_tc8566_disk_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, int nr_drives);
|
||||
|
||||
void add_mconfig(machine_config &config, int nr_of_drives);
|
||||
void add_mconfig(machine_config &config);
|
||||
void dor_w(u8 data);
|
||||
|
||||
required_device<tc8566af_device> m_fdc;
|
||||
};
|
||||
@ -104,8 +122,11 @@ protected:
|
||||
|
||||
class msx_slot_disk1_base_device : public msx_slot_wd_disk_device
|
||||
{
|
||||
public:
|
||||
virtual void use_motor_for_led() override { set_control_led_bit(7); }
|
||||
|
||||
protected:
|
||||
msx_slot_disk1_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
|
||||
msx_slot_disk1_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int nr_drives);
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_post_load() override;
|
||||
@ -196,8 +217,11 @@ protected:
|
||||
|
||||
class msx_slot_disk2_base_device : public msx_slot_wd_disk_device
|
||||
{
|
||||
public:
|
||||
virtual void use_motor_for_led() override { set_control_led_bit(3); }
|
||||
|
||||
protected:
|
||||
msx_slot_disk2_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
|
||||
msx_slot_disk2_base_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int nr_drives);
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_post_load() override;
|
||||
@ -271,7 +295,7 @@ public:
|
||||
msx_slot_disk3_tc8566_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
protected:
|
||||
msx_slot_disk3_tc8566_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
|
||||
msx_slot_disk3_tc8566_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int nr_drives);
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
};
|
||||
@ -333,15 +357,16 @@ private:
|
||||
void select_drive();
|
||||
u8 side_motor_r();
|
||||
u8 select0_r();
|
||||
u8 select1_r();
|
||||
u8 dskchg_r();
|
||||
u8 status_r();
|
||||
void side_motor_w(u8 data);
|
||||
void select0_w(u8 data);
|
||||
void select1_w(u8 data);
|
||||
void select_w(u8 data);
|
||||
void unknown_w(u8 data);
|
||||
|
||||
u8 m_side_motor;
|
||||
u8 m_drive_select0;
|
||||
u8 m_drive_select1;
|
||||
u8 m_drive_select;
|
||||
bool m_drive_present;
|
||||
u8 m_unknown;
|
||||
};
|
||||
|
||||
|
||||
@ -372,7 +397,7 @@ public:
|
||||
msx_slot_disk8_mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
protected:
|
||||
msx_slot_disk8_mb8877_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
|
||||
msx_slot_disk8_mb8877_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int nr_drives);
|
||||
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
@ -421,7 +446,7 @@ public:
|
||||
msx_slot_disk10_mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
protected:
|
||||
msx_slot_disk10_mb8877_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
|
||||
msx_slot_disk10_mb8877_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock, int nr_drives);
|
||||
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
34
src/mame/layout/msx_1drive.lay
Normal file
34
src/mame/layout/msx_1drive.lay
Normal file
@ -0,0 +1,34 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
license:CC0-1.0
|
||||
|
||||
Basic display of LEDs for an MSX
|
||||
-->
|
||||
|
||||
<mamelayout version="2">
|
||||
<element name="access_led">
|
||||
<rect state="0">
|
||||
<color red="0.2" green="0.2" blue="0.2" />
|
||||
</rect>
|
||||
<rect state="1">
|
||||
<color red="1.0" green="0.6" blue="0.0" />
|
||||
</rect>
|
||||
</element>
|
||||
<element name="drv0">
|
||||
<text string="Drive A">
|
||||
<color red="1.0" green="1.0" blue="1.0" />
|
||||
</text>
|
||||
</element>
|
||||
|
||||
<view name="System LEDs">
|
||||
<screen index="0">
|
||||
<bounds x="75" y="0" width="1024" height="768" />
|
||||
</screen>
|
||||
<element name="int_drv0text" ref="drv0">
|
||||
<bounds left="0" right="74" top="0" bottom="30" />
|
||||
</element>
|
||||
<element name="access_int_drv0" ref="access_led">
|
||||
<bounds left="0" right="20" top="31" bottom="39" />
|
||||
</element>
|
||||
</view>
|
||||
</mamelayout>
|
45
src/mame/layout/msx_2drives.lay
Normal file
45
src/mame/layout/msx_2drives.lay
Normal file
@ -0,0 +1,45 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
license:CC0-1.0
|
||||
|
||||
Basic display of LEDs for an MSX
|
||||
-->
|
||||
|
||||
<mamelayout version="2">
|
||||
<element name="access_led">
|
||||
<rect state="0">
|
||||
<color red="0.2" green="0.2" blue="0.2" />
|
||||
</rect>
|
||||
<rect state="1">
|
||||
<color red="1.0" green="0.6" blue="0.0" />
|
||||
</rect>
|
||||
</element>
|
||||
<element name="drv0">
|
||||
<text string="Drive A">
|
||||
<color red="1.0" green="1.0" blue="1.0" />
|
||||
</text>
|
||||
</element>
|
||||
<element name="drv1">
|
||||
<text string="Drive B">
|
||||
<color red="1.0" green="1.0" blue="1.0" />
|
||||
</text>
|
||||
</element>
|
||||
|
||||
<view name="System LEDs">
|
||||
<screen index="0">
|
||||
<bounds x="75" y="0" width="1024" height="768" />
|
||||
</screen>
|
||||
<element name="int_drv0text" ref="drv0">
|
||||
<bounds left="0" right="74" top="0" bottom="30" />
|
||||
</element>
|
||||
<element name="access_int_drv0" ref="access_led">
|
||||
<bounds left="0" right="20" top="31" bottom="39" />
|
||||
</element>
|
||||
<element name="int_drv1text" ref="drv1">
|
||||
<bounds left="0" right="74" top="40" bottom="70" />
|
||||
</element>
|
||||
<element name="access_int_drv1" ref="access_led">
|
||||
<bounds left="0" right="20" top="71" bottom="79" />
|
||||
</element>
|
||||
</view>
|
||||
</mamelayout>
|
@ -107,6 +107,9 @@
|
||||
#include "screen.h"
|
||||
#include "softlist_dev.h"
|
||||
|
||||
#include "msx_1drive.lh"
|
||||
#include "msx_2drives.lh"
|
||||
|
||||
|
||||
//#define VERBOSE (LOG_GENERAL)
|
||||
#include "logmacro.h"
|
||||
@ -608,6 +611,16 @@ void msx_state::msx_base(ay8910_type ay8910_type, machine_config &config, XTAL x
|
||||
m_cassette->add_route(ALL_OUTPUTS, m_speaker, 0.05);
|
||||
m_cassette->set_interface("msx_cass");
|
||||
}
|
||||
|
||||
switch (m_hw_def.get_internal_drives())
|
||||
{
|
||||
case 1:
|
||||
config.set_default_layout(layout_msx_1drive);
|
||||
break;
|
||||
case 2:
|
||||
config.set_default_layout(layout_msx_2drives);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void msx_state::msx1_add_softlists(machine_config &config)
|
||||
|
@ -31,16 +31,19 @@ public:
|
||||
bool has_printer_port() const { return m_has_printer_port; }
|
||||
bool has_cartslot() const { return m_has_cartslot; }
|
||||
bool has_fdc() const { return m_has_fdc; }
|
||||
int get_internal_drives() const { return m_internal_drives; }
|
||||
msx_hw_def &has_cassette(bool has_cassette) { m_has_cassette = has_cassette; return *this;}
|
||||
msx_hw_def &has_printer_port(bool has_printer_port) { m_has_printer_port = has_printer_port; return *this; }
|
||||
msx_hw_def &has_cartslot(bool has_cartslot) { m_has_cartslot = has_cartslot; return *this; }
|
||||
msx_hw_def &has_fdc(bool has_fdc) { m_has_fdc = has_fdc; return *this; }
|
||||
msx_hw_def &internal_drives(int internal_drives) { m_internal_drives = internal_drives; return *this; }
|
||||
|
||||
private:
|
||||
bool m_has_cassette = true;
|
||||
bool m_has_printer_port = true;
|
||||
bool m_has_cartslot = false;
|
||||
bool m_has_fdc = false;
|
||||
int m_internal_drives = 0;
|
||||
};
|
||||
|
||||
class msx_state : public driver_device
|
||||
@ -267,6 +270,7 @@ private:
|
||||
{
|
||||
auto &device = add_internal_slot(config, std::forward<T>(type), std::forward<U>(tag), prim, true, sec, page, numpages, region, offset);
|
||||
m_hw_def.has_fdc(true);
|
||||
m_hw_def.internal_drives(device.get_nr_drives());
|
||||
return device;
|
||||
}
|
||||
template <int N, typename T, typename U>
|
||||
|
@ -184,7 +184,7 @@ void msx1_v9938_state::svi738(machine_config &config)
|
||||
add_internal_slot(config, MSX_SLOT_RAM, "ram", 1, 0, 4); // 64KB RAM
|
||||
add_cartridge_slot<1>(config, 2);
|
||||
add_internal_slot_irq<2>(config, MSX_SLOT_RS232_SVI738, "rs232", 3, 0, 1, 1, "rs232rom");
|
||||
add_internal_disk_mirrored(config, MSX_SLOT_DISK2_FD1793_SS, "disk", 3, 1, 1, 2, "diskrom");
|
||||
add_internal_disk_mirrored(config, MSX_SLOT_DISK2_FD1793_SS, "disk", 3, 1, 1, 2, "diskrom").use_motor_for_led();
|
||||
|
||||
msx1_v9938_pal(SND_AY8910, config);
|
||||
}
|
||||
|
@ -613,7 +613,7 @@ void msx2_state::mbh70(machine_config &config)
|
||||
add_cartridge_slot<1>(config, 1);
|
||||
add_cartridge_slot<2>(config, 2);
|
||||
add_internal_slot(config, MSX_SLOT_ROM, "subrom", 3, 0, 0, 1, "subrom");
|
||||
add_internal_disk_mirrored(config, MSX_SLOT_DISK1_WD2793_N_2_DRIVES, "disk", 3, 0, 1, 2, "diskrom");
|
||||
add_internal_disk_mirrored(config, MSX_SLOT_DISK1_WD2793_N_2_DRIVES, "disk", 3, 0, 1, 2, "diskrom").use_motor_for_led();
|
||||
add_internal_slot(config, MSX_SLOT_RAM_MM, "ram_mm", 3, 2, 0, 4).set_total_size(0x20000); // 128KB Mapper RAM
|
||||
|
||||
MSX_S1985(config, "s1985", 0);
|
||||
@ -727,7 +727,7 @@ void msx2_state::mlg3(machine_config &config)
|
||||
add_cartridge_slot<1>(config, 1);
|
||||
add_cartridge_slot<2>(config, 2);
|
||||
add_internal_slot(config, MSX_SLOT_ROM, "subrom", 3, 0, 0, 1, "subrom");
|
||||
add_internal_disk_mirrored(config, MSX_SLOT_DISK1_WD2793_N, "disk", 3, 0, 1, 2, "diskrom");
|
||||
add_internal_disk_mirrored(config, MSX_SLOT_DISK1_WD2793_N, "disk", 3, 0, 1, 2, "diskrom").use_motor_for_led();
|
||||
add_cartridge_slot<3>(config, 3, 1);
|
||||
add_internal_slot(config, MSX_SLOT_RAM_MM, "ram_mm", 3, 2, 0, 4).set_total_size(0x10000); // 64KB Mapper RAM
|
||||
add_internal_slot_irq<4>(config, MSX_SLOT_RS232_MITSUBISHI, "rs232", 3, 3, 1, 1, "rs232");
|
||||
@ -798,7 +798,7 @@ void msx2_state::mlg30(machine_config &config)
|
||||
add_cartridge_slot<1>(config, 1);
|
||||
add_cartridge_slot<2>(config, 2);
|
||||
add_internal_slot(config, MSX_SLOT_ROM, "subrom", 3, 0, 0, 1, "subrom");
|
||||
add_internal_disk_mirrored(config, MSX_SLOT_DISK1_WD2793_N, "disk", 3, 0, 1, 2, "diskrom");
|
||||
add_internal_disk_mirrored(config, MSX_SLOT_DISK1_WD2793_N, "disk", 3, 0, 1, 2, "diskrom").use_motor_for_led();
|
||||
add_cartridge_slot<3>(config, 3, 1);
|
||||
add_internal_slot(config, MSX_SLOT_RAM_MM, "ram_mm", 3, 2, 0, 4).set_total_size(0x20000); // 128KB Mapper RAM
|
||||
add_cartridge_slot<4>(config, 3, 3);
|
||||
@ -838,7 +838,7 @@ void msx2_state::mlg30_2(machine_config &config)
|
||||
add_cartridge_slot<1>(config, 1);
|
||||
add_cartridge_slot<2>(config, 2);
|
||||
add_internal_slot(config, MSX_SLOT_ROM, "subrom", 3, 0, 0, 1, "subrom");
|
||||
add_internal_disk_mirrored(config, MSX_SLOT_DISK1_WD2793_N_2_DRIVES, "disk", 3, 0, 1, 2, "diskrom");
|
||||
add_internal_disk_mirrored(config, MSX_SLOT_DISK1_WD2793_N_2_DRIVES, "disk", 3, 0, 1, 2, "diskrom").use_motor_for_led();
|
||||
add_cartridge_slot<3>(config, 3, 1);
|
||||
add_internal_slot(config, MSX_SLOT_RAM_MM, "ram_mm", 3, 2, 0, 4).set_total_size(0x20000); // 128KB Mapper RAM
|
||||
add_internal_slot_irq<4>(config, MSX_SLOT_RS232_MITSUBISHI, "rs232", 3, 3, 1, 1, "rs232");
|
||||
@ -1944,7 +1944,7 @@ ROM_END
|
||||
void msx2_state::ucv102(machine_config &config)
|
||||
{
|
||||
// YM2149 (in S1985)
|
||||
// FDC: wd1793, 2 3.5" DSDD drives
|
||||
// FDC: wd1793, 1 3.5" DSDD drives (could be upgraded to 2)
|
||||
// 1 Cartridge slots
|
||||
// S1985
|
||||
// RS232
|
||||
@ -1957,7 +1957,7 @@ void msx2_state::ucv102(machine_config &config)
|
||||
// Expansion slot 1 connects to slots 2-1 and 3-1 (2x 50 pin)
|
||||
// Expansion slot 2 connects to slots 2-2 and 3-2 (2x 50 pin)
|
||||
// Expansion slot 3 connects to slots 2-3 and 3-3 (2x 50 pin)
|
||||
add_internal_disk_mirrored(config, MSX_SLOT_DISK1_FD1793, "disk", 3, 1, 2, "diskrom"); // Mitsubishi MSW1793
|
||||
add_internal_disk_mirrored(config, MSX_SLOT_DISK1_FD1793, "disk", 3, 1, 2, "diskrom").use_motor_for_led(); // Mitsubishi MSW1793
|
||||
|
||||
MSX_S1985(config, "s1985", 0);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user