Skip to content

Commit 5fc23d9

Browse files
committed
bus/pc98_cbus: move slots as children of root
* BREAKING CHANGE: mapping slots now uses the -cbus:N nomenclature rather than -cbusN
1 parent d25ecdb commit 5fc23d9

File tree

12 files changed

+42
-38
lines changed

12 files changed

+42
-38
lines changed

src/devices/bus/pc98_cbus/lha201.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ Maximum -chs 13329,15,63 according to link above (for LHA-20B BIOS, TBD for LHA-
1717
- Need data throttle between here, wd33c9x and/or NSCSI harddisk, otherwise executing anything will
1818
fail (should be fixed with pc98_hd option?);
1919
- PIO mode (involves port $cc6 and a ready flag in port $37 bit 0)
20-
- Tends to miss BIOS ROM loading at first boot, need to refactor C-Bus to actually have slots
21-
as children (and make remapping phase less arbitrary, can't read required input port at
22-
device_start);
2320
- Remaining remap options;
2421
2522
**************************************************************************************************/
@@ -186,6 +183,7 @@ void lha201_device::remap(int space_id, offs_t start, offs_t end)
186183
{
187184
if (space_id == AS_PROGRAM)
188185
{
186+
// TODO: move base in device_reset
189187
const u32 m_memory_base = 0x000d0000 + ((m_dsw2->read() & 7) * 0x2000);
190188
m_bus->space(AS_PROGRAM).install_rom(
191189
m_memory_base,

src/devices/bus/pc98_cbus/lha201.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ class lha201_device : public pc9801_55_device
1616
{
1717
public:
1818
lha201_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
19-
//lha201_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
2019

21-
static constexpr feature_type unemulated_features() { return feature::DISK; }
20+
static constexpr feature_type imperfect_features() { return feature::DISK; }
21+
static constexpr feature_type unemulated_features() { return feature::NONE; }
2222

2323
protected:
24+
//lha201_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
25+
2426
// virtual void device_validity_check(validity_checker &valid) const override;
2527
virtual void device_start() override ATTR_COLD;
2628
virtual void device_reset() override ATTR_COLD;

src/devices/bus/pc98_cbus/pc9801_26.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ void pc9801_26_device::remap(int space_id, offs_t start, offs_t end)
167167
{
168168
if (space_id == AS_PROGRAM)
169169
{
170+
// TODO: move base in device_reset
170171
const u8 rom_setting = ioport("JP6A2")->read() & 7;
171172
static const u32 rom_addresses[8] = { 0xc8000, 0xcc000, 0xd0000, 0xd4000, 0, 0, 0, 0 };
172173
const u32 start_address = rom_addresses[rom_setting & 7];

src/devices/bus/pc98_cbus/pc9801_55.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ void pc9801_55_device::remap(int space_id, offs_t start, offs_t end)
236236
{
237237
if (space_id == AS_PROGRAM)
238238
{
239+
// TODO: move base to device_reset
239240
// incredibly verbose for LHA-201
240241
// logerror("map ROM at 0x000dc000-0x000dcfff (bank %d)\n", m_rom_bank);
241242
m_bus->space(AS_PROGRAM).install_rom(

src/devices/bus/pc98_cbus/pc9801_86.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ void pc9801_86_device::remap(int space_id, offs_t start, offs_t end)
233233
{
234234
if (space_id == AS_PROGRAM)
235235
{
236+
// TODO: check against unmap ROM option
236237
logerror("map ROM at 0x000cc000-0x000cffff\n");
237238
m_bus->space(AS_PROGRAM).install_rom(
238239
0xcc000,

src/devices/bus/pc98_cbus/speakboard.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ void speakboard_device::remap(int space_id, offs_t start, offs_t end)
110110
{
111111
if (space_id == AS_PROGRAM)
112112
{
113+
// TODO: check against unmap ROM option
113114
logerror("map ROM at 0x000cc000-0x000cffff\n");
114115
m_bus->space(AS_PROGRAM).install_rom(
115116
0xcc000,

src/mame/nec/pc88va.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,9 +1299,9 @@ void pc88va_state::pc88va_cbus(machine_config &config)
12991299
m_maincpu->out_iow_cb<0>().set([this] (u8 data) { m_cbus_root->dack_w(0, data); });
13001300

13011301
// should be 3 slots for each iteration here
1302-
PC98_CBUS_SLOT(config, "cbus0", 0, "cbus_root", pc88va_cbus_devices, nullptr);
1303-
PC98_CBUS_SLOT(config, "cbus1", 0, "cbus_root", pc88va_cbus_devices, nullptr);
1304-
PC98_CBUS_SLOT(config, "cbus2", 0, "cbus_root", pc88va_cbus_devices, nullptr);
1302+
PC98_CBUS_SLOT(config, "cbus:0", 0, "cbus", pc88va_cbus_devices, nullptr);
1303+
PC98_CBUS_SLOT(config, "cbus:1", 0, "cbus", pc88va_cbus_devices, nullptr);
1304+
PC98_CBUS_SLOT(config, "cbus:2", 0, "cbus", pc88va_cbus_devices, nullptr);
13051305
}
13061306

13071307
void pc88va_state::pc88va(machine_config &config)

src/mame/nec/pc88va.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class pc88va_state : public driver_device
4949
, m_fdd(*this, "upd765:%u", 0U)
5050
, m_pic2(*this, "pic8259_slave")
5151
, m_rtc(*this, "rtc")
52-
, m_cbus_root(*this, "cbus_root")
52+
, m_cbus_root(*this, "cbus")
5353
// labelled "マウス" (mouse) - can't use "mouse" because of core -mouse option
5454
, m_mouse_port(*this, "mouseport")
5555
, m_opna(*this, "opna")

src/mame/nec/pc9801.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ void pc9801vm_state::ide_cs1_w(offs_t offset, uint16_t data, uint16_t mem_mask)
190190
void pc9801_state::pc9801_map(address_map &map)
191191
{
192192
map.unmap_value_high();
193-
map(0x00000, 0x9ffff).rw("cbus_root", FUNC(pc98_cbus_root_device::mem_r), FUNC(pc98_cbus_root_device::mem_w));
193+
map(0x00000, 0x9ffff).rw("cbus", FUNC(pc98_cbus_root_device::mem_r), FUNC(pc98_cbus_root_device::mem_w));
194194
map(0xa0000, 0xa3fff).rw(FUNC(pc9801_state::tvram_r), FUNC(pc9801_state::tvram_w)); //TVRAM
195195
map(0xa8000, 0xbffff).rw(FUNC(pc9801_state::gvram_r), FUNC(pc9801_state::gvram_w)); //bitmap VRAM
196-
map(0xc0000, 0xdffff).rw("cbus_root", FUNC(pc98_cbus_root_device::mem_slot_r), FUNC(pc98_cbus_root_device::mem_slot_w));
196+
map(0xc0000, 0xdffff).rw("cbus", FUNC(pc98_cbus_root_device::mem_slot_r), FUNC(pc98_cbus_root_device::mem_slot_w));
197197
// map(0xcc000, 0xcffff).rom().region("sound_bios", 0); //sound BIOS
198198
// map(0xd6000, 0xd6fff).rom().region("fdc_bios_2dd", 0); //floppy BIOS 2dd
199199
// map(0xd7000, 0xd7fff).rom().region("fdc_bios_2hd", 0); //floppy BIOS 2hd
@@ -227,7 +227,7 @@ void pc9801_state::pc9801_common_io(address_map &map)
227227
void pc9801_state::pc9801_io(address_map &map)
228228
{
229229
map.unmap_value_high();
230-
map(0x0000, 0xffff).rw("cbus_root", FUNC(pc98_cbus_root_device::io_r), FUNC(pc98_cbus_root_device::io_w));
230+
map(0x0000, 0xffff).rw("cbus", FUNC(pc98_cbus_root_device::io_r), FUNC(pc98_cbus_root_device::io_w));
231231
pc9801_common_io(map);
232232
map(0x0020, 0x002f).w(FUNC(pc9801_state::dmapg4_w)).umask16(0xff00);
233233
map(0x0050, 0x0057).m("fdd_2d", FUNC(pc80s31k_device::host_map)).umask16(0xff00);
@@ -746,12 +746,12 @@ void pc9801_state::ipl_bank(address_map &map)
746746

747747
void pc9801vm_state::pc9801vm_map(address_map &map)
748748
{
749-
map(0x000000, 0x09ffff).rw("cbus_root", FUNC(pc98_cbus_root_device::mem_r), FUNC(pc98_cbus_root_device::mem_w));
749+
map(0x000000, 0x09ffff).rw("cbus", FUNC(pc98_cbus_root_device::mem_r), FUNC(pc98_cbus_root_device::mem_w));
750750

751751
map(0x0a0000, 0x0a3fff).rw(FUNC(pc9801vm_state::tvram_r), FUNC(pc9801vm_state::tvram_w));
752752
map(0x0a4000, 0x0a4fff).rw(FUNC(pc9801vm_state::pc9801rs_knjram_r), FUNC(pc9801vm_state::pc9801rs_knjram_w));
753753
map(0x0a8000, 0x0bffff).rw(FUNC(pc9801vm_state::grcg_gvram_r), FUNC(pc9801vm_state::grcg_gvram_w));
754-
map(0x0c0000, 0x0dffff).rw("cbus_root", FUNC(pc98_cbus_root_device::mem_slot_r), FUNC(pc98_cbus_root_device::mem_slot_w));
754+
map(0x0c0000, 0x0dffff).rw("cbus", FUNC(pc98_cbus_root_device::mem_slot_r), FUNC(pc98_cbus_root_device::mem_slot_w));
755755

756756
map(0x0e0000, 0x0e7fff).rw(FUNC(pc9801vm_state::grcg_gvram0_r), FUNC(pc9801vm_state::grcg_gvram0_w));
757757
map(0x0e8000, 0x0fffff).m(m_ipl, FUNC(address_map_bank_device::amap16));
@@ -2019,16 +2019,16 @@ void pc9801_state::pc9801(machine_config &config)
20192019
m_maincpu->set_irq_acknowledge_callback("pic8259_master", FUNC(pic8259_device::inta_cb));
20202020

20212021
pc9801_cbus(config);
2022-
PC98_CBUS_SLOT(config, "cbus0", 0, "cbus_root", pc98_cbus_devices, "pc9801_26");
2023-
PC98_CBUS_SLOT(config, "cbus1", 0, "cbus_root", pc98_cbus_devices, nullptr);
2024-
PC98_CBUS_SLOT(config, "cbus2", 0, "cbus_root", pc98_cbus_devices, nullptr);
2025-
PC98_CBUS_SLOT(config, "cbus3", 0, "cbus_root", pc98_cbus_devices, nullptr);
2026-
PC98_CBUS_SLOT(config, "cbus4", 0, "cbus_root", pc98_cbus_devices, nullptr);
2027-
PC98_CBUS_SLOT(config, "cbus5", 0, "cbus_root", pc98_cbus_devices, nullptr);
2022+
PC98_CBUS_SLOT(config, "cbus:0", 0, "cbus", pc98_cbus_devices, "pc9801_26");
2023+
PC98_CBUS_SLOT(config, "cbus:1", 0, "cbus", pc98_cbus_devices, nullptr);
2024+
PC98_CBUS_SLOT(config, "cbus:2", 0, "cbus", pc98_cbus_devices, nullptr);
2025+
PC98_CBUS_SLOT(config, "cbus:3", 0, "cbus", pc98_cbus_devices, nullptr);
2026+
PC98_CBUS_SLOT(config, "cbus:4", 0, "cbus", pc98_cbus_devices, nullptr);
2027+
PC98_CBUS_SLOT(config, "cbus:5", 0, "cbus", pc98_cbus_devices, nullptr);
20282028

20292029
// RAM 128KB (vanilla/F1/F2) ~ 256KB (F3/M2/M3) ~ 640KB (max)
20302030
// TODO: really dedicates this space in N slots above
2031-
PC98_CBUS_SLOT(config, "cbus_ram", 0, "cbus_root", pc98_cbus_ram_devices, "640kb");
2031+
PC98_CBUS_SLOT(config, "cbus:ram", 0, "cbus", pc98_cbus_ram_devices, "640kb");
20322032
// RAM(config, m_ram).set_default_size("640K").set_extra_options("128K,256K,384K,512K");
20332033

20342034
pc9801_common(config);
@@ -2050,13 +2050,13 @@ void pc9801_state::pc9801(machine_config &config)
20502050
void pc9801_state::pc9801f(machine_config &config)
20512051
{
20522052
pc9801(config);
2053-
PC98_CBUS_SLOT(config.replace(), "cbus1", 0, "cbus_root", pc98_cbus_devices, "fdd_2dd");
2053+
PC98_CBUS_SLOT(config.replace(), "cbus:1", 0, "cbus", pc98_cbus_devices, "fdd_2dd");
20542054
}
20552055

20562056
void pc9801_state::pc9801m(machine_config &config)
20572057
{
20582058
pc9801(config);
2059-
PC98_CBUS_SLOT(config.replace(), "cbus1", 0, "cbus_root", pc98_cbus_devices, "fdd_2hd");
2059+
PC98_CBUS_SLOT(config.replace(), "cbus:1", 0, "cbus", pc98_cbus_devices, "fdd_2hd");
20602060
}
20612061

20622062
void pc9801vm_state::pc9801vm(machine_config &config)
@@ -2068,10 +2068,10 @@ void pc9801vm_state::pc9801vm(machine_config &config)
20682068

20692069
pc9801_common(config);
20702070
pc9801_cbus(config);
2071-
PC98_CBUS_SLOT(config, "cbus0", 0, "cbus_root", pc98_cbus_devices, "pc9801_26");
2072-
PC98_CBUS_SLOT(config, "cbus1", 0, "cbus_root", pc98_cbus_devices, nullptr);
2073-
PC98_CBUS_SLOT(config, "cbus2", 0, "cbus_root", pc98_cbus_devices, nullptr);
2074-
PC98_CBUS_SLOT(config, "cbus3", 0, "cbus_root", pc98_cbus_devices, nullptr);
2071+
PC98_CBUS_SLOT(config, "cbus:0", 0, "cbus", pc98_cbus_devices, "pc9801_26");
2072+
PC98_CBUS_SLOT(config, "cbus:1", 0, "cbus", pc98_cbus_devices, nullptr);
2073+
PC98_CBUS_SLOT(config, "cbus:2", 0, "cbus", pc98_cbus_devices, nullptr);
2074+
PC98_CBUS_SLOT(config, "cbus:3", 0, "cbus", pc98_cbus_devices, nullptr);
20752075

20762076
m_ppi_sys->out_pc_callback().set(FUNC(pc9801vm_state::ppi_sys_dac_portc_w));
20772077
// TODO: verify if it needs invert();
@@ -2083,7 +2083,7 @@ void pc9801vm_state::pc9801vm(machine_config &config)
20832083
ADDRESS_MAP_BANK(config, m_ipl).set_map(&pc9801vm_state::ipl_bank).set_options(ENDIANNESS_LITTLE, 16, 18, 0x18000);
20842084

20852085
// RAM 384KB (VM0/VM2/VM4) ~ 640KB (VM21/VM11)
2086-
PC98_CBUS_SLOT(config, "cbus_ram", 0, "cbus_root", pc98_cbus_ram_devices, "640kb");
2086+
PC98_CBUS_SLOT(config, "cbus_ram", 0, "cbus", pc98_cbus_ram_devices, "640kb");
20872087
// RAM(config, m_ram).set_default_size("640K").set_extra_options("384K");
20882088

20892089
MCFG_MACHINE_START_OVERRIDE(pc9801vm_state, pc9801rs)

src/mame/nec/pc9801.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class pc9801_state : public pc98_base_state
141141
, m_fdc_2hd(*this, "fdc_2hd")
142142
, m_hgdc(*this, "hgdc%d", 1)
143143
, m_video_ram(*this, "video_ram_%d", 1)
144-
, m_cbus_root(*this, "cbus_root")
144+
, m_cbus_root(*this, "cbus")
145145
, m_pic1(*this, "pic8259_master")
146146
, m_pic2(*this, "pic8259_slave")
147147
, m_memsw(*this, "memsw")

0 commit comments

Comments
 (0)