Skip to content

Commit 5162043

Browse files
committed
bus/pc98_cbus: add SNE Sound Orchestra
1 parent 242ecf3 commit 5162043

File tree

6 files changed

+167
-20
lines changed

6 files changed

+167
-20
lines changed

scripts/src/bus.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5591,6 +5591,8 @@ if (BUSES["PC98_CBUS"]~=null) then
55915591
MAME_DIR .. "src/devices/bus/pc98_cbus/sb16_ct2720.h",
55925592
MAME_DIR .. "src/devices/bus/pc98_cbus/slot.cpp",
55935593
MAME_DIR .. "src/devices/bus/pc98_cbus/slot.h",
5594+
MAME_DIR .. "src/devices/bus/pc98_cbus/sound_orchestra.cpp",
5595+
MAME_DIR .. "src/devices/bus/pc98_cbus/sound_orchestra.h",
55945596
MAME_DIR .. "src/devices/bus/pc98_cbus/sound.cpp",
55955597
MAME_DIR .. "src/devices/bus/pc98_cbus/sound.h",
55965598
MAME_DIR .. "src/devices/bus/pc98_cbus/speakboard.cpp",

src/devices/bus/pc98_cbus/options.cpp

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,38 @@
1717
#include "mif201.h"
1818
#include "mpu_pc98.h"
1919
#include "sb16_ct2720.h"
20+
#include "sound_orchestra.h"
2021
#include "sound.h"
2122
#include "speakboard.h"
2223
#include "wavestar.h"
2324

2425
void pc98_cbus_devices(device_slot_interface &device)
2526
{
26-
// official HW
27+
// sound cards
28+
// NEC
2729
device.option_add("pc9801_14", PC9801_14);
2830
device.option_add("pc9801_26", PC9801_26);
29-
device.option_add("pc9801_27", PC9801_27);
30-
device.option_add("pc9801_55u", PC9801_55U);
31-
device.option_add("pc9801_55l", PC9801_55L);
3231
device.option_add("pc9801_86", PC9801_86);
3332
device.option_add("pc9801_118", PC9801_118);
33+
// System Sacom
34+
device.option_add("amd98", AMD98);
35+
// Creative Labs
36+
device.option_add("sb16", SB16_CT2720);
37+
// SNE
38+
device.option_add("sound_orchestra", SOUND_ORCHESTRA);
39+
// Idol Japan
40+
device.option_add("speakboard", SPEAKBOARD);
41+
// device.option_add("sparkboard", SPARKBOARD);
42+
// QVision
43+
device.option_add("wavestar", QVISION_WAVESTAR);
44+
// doujinshi HW
45+
// MAD Factory / Doujin Hard (同人ハード)
46+
// MAD Factory Chibi-Oto: an ADPCM override for -86
47+
// MAD Factory Otomi-chan: "TORIE9211 MAD FACTORY" printed on proto PCB, just overrides for ADPCM for -86?
48+
device.option_add("otomichan_kai", OTOMICHAN_KAI);
3449

35-
// Spark Board
36-
device.option_add("amd98", AMD98);
50+
// MIDI
3751
device.option_add("mpu_pc98", MPU_PC98);
38-
device.option_add("sb16", SB16_CT2720);
39-
device.option_add("speakboard", SPEAKBOARD);
40-
device.option_add("wavestar", QVISION_WAVESTAR);
4152

4253
// File Bay
4354
// for first gen only
@@ -46,11 +57,14 @@ void pc98_cbus_devices(device_slot_interface &device)
4657
// PC-9801-08 (2dd, external unit)
4758
// PC-9801-15 (8' unit)
4859

49-
// doujinshi HW
50-
// MAD Factory / Doujin Hard (同人ハード)
51-
// MAD Factory Chibi-Oto: an ADPCM override for -86
52-
// MAD Factory Otomi-chan: "TORIE9211 MAD FACTORY" printed on proto PCB, just overrides for ADPCM for -86?
53-
device.option_add("otomichan_kai", OTOMICHAN_KAI);
60+
// SASI
61+
device.option_add("pc9801_27", PC9801_27);
62+
63+
// SCSI
64+
// device_option_add("pc9801_55", PC9801_55);
65+
device.option_add("pc9801_55u", PC9801_55U);
66+
device.option_add("pc9801_55l", PC9801_55L);
67+
// device.option_add("pc9801_92", PC9801_92);
5468

5569
// internal sound options
5670
device.option_add_internal("sound_pc9821ce", SOUND_PC9821CE);
@@ -66,7 +80,7 @@ void pc98_cbus_ram_devices(device_slot_interface &device)
6680
device.option_add("640kb", PC9801_02_640KB);
6781
}
6882

69-
// TODO: add just a subset for now, all needs to be verified if compatible with C-Bus.
83+
// TODO: add just a subset for now, all needs to be verified if compatible with this C-Bus variant.
7084
void pc88va_cbus_devices(device_slot_interface &device)
7185
{
7286
device.option_add("pc9801_27", PC9801_27);
@@ -77,6 +91,7 @@ void pc88va_cbus_devices(device_slot_interface &device)
7791
}
7892

7993
// https://man.openbsd.org/cbus.4
94+
// Add the known options only
8095
void luna88k2_cbus_devices(device_slot_interface &device)
8196
{
8297
// Allied Telesis CentreCOM LA-98

src/devices/bus/pc98_cbus/pc9801_26.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ Legacy sound card for PC-98xx family, composed by a single YM2203
3232
// device type definition
3333
DEFINE_DEVICE_TYPE(PC9801_26, pc9801_26_device, "pc9801_26", "NEC PC-9801-26/K sound card")
3434

35-
pc9801_26_device::pc9801_26_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
36-
: device_t(mconfig, PC9801_26, tag, owner, clock)
35+
pc9801_26_device::pc9801_26_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
36+
: device_t(mconfig, type, tag, owner, clock)
3737
, device_pc98_cbus_slot_interface(mconfig, *this)
3838
, m_opn(*this, "opn")
3939
, m_joy(*this, "joy_p%u", 1U)
@@ -42,6 +42,11 @@ pc9801_26_device::pc9801_26_device(const machine_config &mconfig, const char *ta
4242
{
4343
}
4444

45+
pc9801_26_device::pc9801_26_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
46+
: pc9801_26_device(mconfig, PC9801_26, tag, owner, clock)
47+
{
48+
}
49+
4550
void pc9801_26_device::device_add_mconfig(machine_config &config)
4651
{
4752
SPEAKER(config, "mono").front_center();

src/devices/bus/pc98_cbus/pc9801_26.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ class pc9801_26_device : public device_t
3030
pc9801_26_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
3131

3232
protected:
33+
pc9801_26_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
34+
3335
virtual void device_start() override ATTR_COLD;
3436
virtual void device_reset() override ATTR_COLD;
3537
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
@@ -38,14 +40,14 @@ class pc9801_26_device : public device_t
3840
u16 read_io_base();
3941
virtual void remap(int space_id, offs_t start, offs_t end) override;
4042

41-
private:
43+
virtual void io_map(address_map &map) ATTR_COLD;
44+
4245
required_device<ym2203_device> m_opn;
46+
private:
4347
required_device_array<msx_general_purpose_port_device, 2U> m_joy;
4448
required_memory_region m_bios;
4549
required_ioport m_irq_jp;
4650

47-
void io_map(address_map &map) ATTR_COLD;
48-
4951
u32 m_rom_base;
5052
u8 m_joy_sel;
5153
u8 m_int_level;
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// license:BSD-3-Clause
2+
// copyright-holders:Angelo Salese
3+
/**************************************************************************************************
4+
5+
SNE Sound Orchestra
6+
7+
Built on top of -26, with extra YM3812 as ADPCM engine
8+
9+
https://j02.nobody.jp/jto98/n_desk_sound/sso.htm
10+
11+
TODO:
12+
- Better PnP (has separate ADPCM control)
13+
- valis2 has no sound from the ADPCM channel (initializes the registers tho?)
14+
- add SNE Sound Orchestra VS (replaces OPL2 with Y8950)
15+
16+
===================================================================================================
17+
18+
- Known SW with Sound Orchestra support
19+
albatr2
20+
valis2
21+
zan
22+
みゅあっぷ98/iv (V6.41A) ~ muap98/iv (VS only?)
23+
SNE Sound Musician / Great Musician / Little Musician / SOS1 / SOS2 (all undumped?)
24+
25+
**************************************************************************************************/
26+
27+
#include "emu.h"
28+
#include "sound_orchestra.h"
29+
30+
#include "speaker.h"
31+
32+
DEFINE_DEVICE_TYPE(SOUND_ORCHESTRA, sound_orchestra_device, "sound_orchestra", "SNE Sound Orchestra sound card")
33+
34+
sound_orchestra_device::sound_orchestra_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
35+
: pc9801_26_device(mconfig, SOUND_ORCHESTRA, tag, owner, clock)
36+
, m_opl2(*this, "opl2")
37+
{
38+
}
39+
40+
void sound_orchestra_device::device_add_mconfig(machine_config &config)
41+
{
42+
pc9801_26_device::device_add_mconfig(config);
43+
// YM2203C
44+
m_opn->reset_routes();
45+
46+
// pseudo-stereo
47+
config.device_remove("mono");
48+
SPEAKER(config, "ssg_left").front_left();
49+
SPEAKER(config, "fm_right").front_right();
50+
51+
// TODO: mixing unconfirmed
52+
m_opn->add_route(0, "fm_right", 0.25);
53+
m_opn->add_route(1, "fm_right", 0.25);
54+
m_opn->add_route(2, "fm_right", 0.25);
55+
m_opn->add_route(3, "fm_right", 0.50);
56+
57+
YM3812(config, m_opl2, 15.9744_MHz_XTAL / 4);
58+
m_opl2->add_route(ALL_OUTPUTS, "ssg_left", 1.00);
59+
60+
}
61+
62+
ROM_START( sound_orchestra )
63+
ROM_REGION( 0x4000, "bios", ROMREGION_ERASEFF )
64+
// baddump: should require own BIOS to accomodate the ADPCM in BASIC
65+
ROM_LOAD16_BYTE( "26k_wyka01_00.bin", 0x0000, 0x2000, BAD_DUMP CRC(f071bf69) SHA1(f3cdef94e9fee116cf4a9b54881e77c6cd903815) )
66+
ROM_LOAD16_BYTE( "26k_wyka02_00.bin", 0x0001, 0x2000, BAD_DUMP CRC(eaa01052) SHA1(5d47edae49aad591f139d5599fe04b61aefd5ecd) )
67+
ROM_END
68+
69+
const tiny_rom_entry *sound_orchestra_device::device_rom_region() const
70+
{
71+
return ROM_NAME( sound_orchestra );
72+
}
73+
74+
void sound_orchestra_device::io_map(address_map &map)
75+
{
76+
const u16 io_base = read_io_base();
77+
map(0x0088 | io_base, 0x008b | io_base).rw(m_opn, FUNC(ym2203_device::read), FUNC(ym2203_device::write)).umask16(0x00ff);
78+
map(0x008c | io_base, 0x008f | io_base).rw(m_opl2, FUNC(ym3812_device::read), FUNC(ym3812_device::write)).umask16(0x00ff);
79+
}
80+
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// license:BSD-3-Clause
2+
// copyright-holders:Angelo Salese
3+
/***************************************************************************
4+
5+
NEC PC-9801-26 sound card
6+
7+
***************************************************************************/
8+
9+
#ifndef MAME_BUS_PC98_CBUS_SOUND_ORCHESTRA_H
10+
#define MAME_BUS_PC98_CBUS_SOUND_ORCHESTRA_H
11+
12+
#pragma once
13+
14+
#include "slot.h"
15+
16+
#include "pc9801_26.h"
17+
#include "sound/ymopl.h"
18+
19+
20+
class sound_orchestra_device : public pc9801_26_device
21+
{
22+
public:
23+
// construction/destruction
24+
sound_orchestra_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
25+
26+
protected:
27+
28+
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
29+
30+
virtual void io_map(address_map &map) override ATTR_COLD;
31+
32+
virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
33+
34+
private:
35+
required_device<ym3812_device> m_opl2;
36+
37+
};
38+
39+
40+
DECLARE_DEVICE_TYPE(SOUND_ORCHESTRA, sound_orchestra_device)
41+
42+
43+
#endif // MAME_BUS_PC98_CBUS_SOUND_ORCHESTRA_H

0 commit comments

Comments
 (0)