summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/bus/isa/fdc.cpp3
-rw-r--r--src/devices/bus/snes/sfx.h3
-rw-r--r--src/devices/machine/upd765.cpp22
-rw-r--r--src/devices/machine/upd765.h12
-rw-r--r--src/mame/drivers/h01x.cpp52
-rw-r--r--src/mame/drivers/interpro.cpp2
-rw-r--r--src/mame/drivers/next.cpp3
-rw-r--r--src/mame/drivers/sun3x.cpp2
-rw-r--r--src/mame/includes/h01x.h1
9 files changed, 51 insertions, 49 deletions
diff --git a/src/devices/bus/isa/fdc.cpp b/src/devices/bus/isa/fdc.cpp
index 9c9f52d7a1d..3c601e42ce2 100644
--- a/src/devices/bus/isa/fdc.cpp
+++ b/src/devices/bus/isa/fdc.cpp
@@ -129,7 +129,8 @@ isa8_fdc_ps2_device::isa8_fdc_ps2_device(const machine_config &mconfig, const ch
void isa8_fdc_ps2_device::device_add_mconfig(machine_config &config)
{
- n82077aa_device &n82077aa(N82077AA(config, m_fdc, 24'000'000, n82077aa_device::MODE_PS2));
+ n82077aa_device &n82077aa(N82077AA(config, m_fdc, 24'000'000));
+ n82077aa.set_mode(n82077aa_device::mode_t::PS2);
n82077aa.intrq_wr_callback().set(FUNC(isa8_fdc_device::irq_w));
n82077aa.drq_wr_callback().set(FUNC(isa8_fdc_device::drq_w));
FLOPPY_CONNECTOR(config, "fdc:0", pc_hd_floppies, "35hd", isa8_fdc_device::floppy_formats);
diff --git a/src/devices/bus/snes/sfx.h b/src/devices/bus/snes/sfx.h
index 50a6583a155..54df5a8018b 100644
--- a/src/devices/bus/snes/sfx.h
+++ b/src/devices/bus/snes/sfx.h
@@ -12,11 +12,10 @@
class sns_rom_superfx_device : public sns_rom_device
{
-public:
+protected:
// construction/destruction
sns_rom_superfx_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
-protected:
// device-level overrides
virtual void device_start() override;
virtual void device_reset() override;
diff --git a/src/devices/machine/upd765.cpp b/src/devices/machine/upd765.cpp
index 3d763187bd8..b9f51c66645 100644
--- a/src/devices/machine/upd765.cpp
+++ b/src/devices/machine/upd765.cpp
@@ -167,19 +167,19 @@ constexpr int upd765_family_device::rates[4];
upd765_family_device::upd765_family_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
pc_fdc_interface(mconfig, type, tag, owner, clock),
+ ready_connected(true),
+ ready_polled(true),
+ select_connected(true),
+ select_multiplexed(true),
+ external_ready(false),
+ mode(mode_t::AT),
intrq_cb(*this),
drq_cb(*this),
hdl_cb(*this),
idx_cb(*this),
- us_cb(*this)
+ us_cb(*this),
+ dor_reset(0x00)
{
- ready_polled = true;
- ready_connected = true;
- select_connected = true;
- select_multiplexed = true;
- external_ready = false;
- dor_reset = 0x00;
- mode = MODE_AT;
}
void upd765_family_device::set_ready_line_connected(bool _ready)
@@ -192,7 +192,7 @@ void upd765_family_device::set_select_lines_connected(bool _select)
select_connected = _select;
}
-void upd765_family_device::set_mode(int _mode)
+void upd765_family_device::set_mode(mode_t _mode)
{
mode = _mode;
}
@@ -379,7 +379,7 @@ uint8_t upd765_family_device::sra_r()
sra |= 0x40;
if(cur_irq)
sra |= 0x80;
- if(mode == MODE_M30)
+ if(mode == mode_t::M30)
sra ^= 0x1f;
return sra;
}
@@ -2362,7 +2362,7 @@ void upd765_family_device::check_irq()
{
bool old_irq = cur_irq;
cur_irq = data_irq || other_irq || internal_drq;
- cur_irq = cur_irq && (dor & 4) && (mode != MODE_AT || (dor & 8));
+ cur_irq = cur_irq && (dor & 4) && (mode != mode_t::AT || (dor & 8));
if(cur_irq != old_irq) {
LOGTCIRQ("irq = %d\n", cur_irq);
intrq_cb(cur_irq);
diff --git a/src/devices/machine/upd765.h b/src/devices/machine/upd765.h
index f796673d77a..b0ca8e49657 100644
--- a/src/devices/machine/upd765.h
+++ b/src/devices/machine/upd765.h
@@ -12,7 +12,7 @@ class floppy_image_device;
/*
* ready = true if the ready line is physically connected to the floppy drive
* select = true if the fdc controls the floppy drive selection
- * mode = MODE_AT, MODE_PS2 or MODE_M30 for the fdcs that have reset-time selection
+ * mode = mode_t::AT, mode_t::PS2 or mode_t::M30 for the fdcs that have reset-time selection
*/
/* Interface required for PC ISA wrapping */
@@ -40,7 +40,7 @@ public:
class upd765_family_device : public pc_fdc_interface {
public:
- enum { MODE_AT, MODE_PS2, MODE_M30 };
+ enum class mode_t { AT, PS2, M30 };
auto intrq_wr_callback() { return intrq_cb.bind(); }
auto drq_wr_callback() { return drq_cb.bind(); }
@@ -77,7 +77,7 @@ public:
void set_rate(int rate); // rate in bps, to be used when the fdc is externally frequency-controlled
- void set_mode(int mode);
+ void set_mode(mode_t mode);
void set_ready_line_connected(bool ready);
void set_select_lines_connected(bool select);
void set_floppy(floppy_image_device *image);
@@ -261,7 +261,7 @@ protected:
bool external_ready;
- int mode;
+ mode_t mode;
int main_phase;
live_info cur_live, checkpoint_live;
@@ -483,8 +483,8 @@ public:
class n82077aa_device : public upd765_family_device {
public:
- n82077aa_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, int mode)
- : n82077aa_device(mconfig, tag, owner, clock)
+ n82077aa_device(const machine_config &mconfig, const char *tag, device_t *owner, mode_t mode)
+ : n82077aa_device(mconfig, tag, owner, 0U)
{
set_mode(mode);
}
diff --git a/src/mame/drivers/h01x.cpp b/src/mame/drivers/h01x.cpp
index dcd4eb1e568..75b7f103eae 100644
--- a/src/mame/drivers/h01x.cpp
+++ b/src/mame/drivers/h01x.cpp
@@ -16,7 +16,7 @@ static const int16_t speaker_levels[] = {-32768, 0, 32767, 0};
void h01x_state::h01x(machine_config &config)
{
// basic machine hardware
- Z80(config, m_maincpu, 10.6445_MHz_XTAL / 6);
+ Z80(config, m_maincpu, 10.6445_MHz_XTAL / 6); // TRS-80 clock frequency
m_maincpu->set_addrmap(AS_PROGRAM, &h01x_state::h01x_mem_map);
m_maincpu->set_addrmap(AS_IO, &h01x_state::h01x_io_map);
@@ -49,21 +49,21 @@ void h01x_state::h01b(machine_config &config)
{
// H-01B CPU: 2MHz ROM: 16KB + 32KB
h01x(config);
- m_maincpu->set_clock(16_MHz_XTAL/8);
+ //m_maincpu->set_clock(16_MHz_XTAL/8); using TRS-80 clock frequency until original cassettes can be found
}
void h01x_state::nf500a(machine_config &config)
{
// NF-500A CPU: 4MHz ROM: 16KB + 32KB
h01x(config);
- m_maincpu->set_clock(16_MHz_XTAL/4);
+ //m_maincpu->set_clock(16_MHz_XTAL/4); using TRS-80 clock frequency until original cassettes can be found
}
void h01x_state::h01jce(machine_config &config)
{
// JCE CPU: 4MHz ROM: 16KB + 32KB + 16KB
h01x(config);
- m_maincpu->set_clock(16_MHz_XTAL/4);
+ //m_maincpu->set_clock(16_MHz_XTAL/4); using TRS-80 clock frequency until original cassettes can be found
}
void h01x_state::h01x_mem_map(address_map &map)
@@ -87,8 +87,8 @@ void h01x_state::h01x_io_map(address_map &map)
/*
H-01B
- KD7 KD6 KD5 KD4 KD3 KD2 KD1 KD0 扫描用地址
-A0 空格 Z A Q 1 BFFEH
+ KD7 KD6 KD5 KD4 KD3 KD2 KD1 KD0 scan address
+A0 space Z A Q 1 BFFEH
A1 BRK X S W 2 BFFDH
A2 (16) C D E 3 BFFBH
A3 E/C V F R 4 BFF7H
@@ -100,7 +100,7 @@ A8 BS 左 . L O 9 BEFFH
A9 : / ; P 0 BDFFH
A10 SHIFT 下 BBFFH
-需要确定的键
+need to determine keys:
Ctrl ESC
*/
@@ -224,36 +224,36 @@ INPUT_PORTS_END
NF-500A
- KD7 KD6 KD5 KD4 KD3 KD2 KD1 KD0 扫描用地址
+ KD7 KD6 KD5 KD4 KD3 KD2 KD1 KD0 scan address
A0 R E 5 CTRL? 6 T W BFFEH
A1 3 2 Y E/C U 4 1 BFFDH
A2 9 : 8 - 7 0 下 BFFBH
A3 D S G ESC H F Q BFF7H
A4 X A V Z C BRK BFEFH
-A5 L BS 左 K 空格 J ; 右 BFDFH
+A5 L BS 左 K space J ; 右 BFDFH
A6 M . N B , / BFBFH
A7 P RETN O SHIFT I [ BF7FH
-按键 3 56 34 51 功能未验证,暂时放在 ] TAB \ ' 位置。
+3 56 34 51 key functions not verified, temporarily mapped to ] TAB \ '
-E/C E汉 = ~ 对应 ascii 20
-ESC 对应 ascii 31
-BS 对应 ascii 8
-61 对应 ascii 13 回车键
-16 对应 ascii 10 下
-56 对应 ascii 16
-27 3 34 51 无反应
+E/C E汉 = ~ translates to ASCII 20
+ESC translates to ASCII 31
+BS translates to ASCII 8
+61 translates to ASCII 13 enter
+16 translates to ASCII 10 down
+56 translates to ASCII 16
+27 3 34 51 no action
-测试按键 ASCII 码的程序
+Program to test key ASCII codes
10 A$=INKEY$
20 IF LEN(A$)>0 THEN PRINT ASC(A$)
30 GOTO 10
TRS-80
-左8 右9 上91 下10
+left 8 right 9 up 91 down 10
Clear 31
@ 64
-退格 8
+backspace 8
*/
@@ -577,17 +577,17 @@ ROM_END
// hzrom 32KB EPROM
// extrom 16KB EPROM
-// 开机画面
+// Startup screens
// H-01B : H-01型中文教育电脑 普乐电器公司制造
// NF500A : H-01型汉字微电脑 中国科学院H电脑公司
// JCE : H-01型中文普及电脑 北岳电子有限公司制造
-// 未完成功能:
-// 录音输入输出未完成,另机器主频设置与 TRS-80 相同
-// 视频芯片 MC6845P 功能未模拟
-// JCE 的 16KB 扩展 ROM 功能不详,功能未模拟
+// Incomplete features:
+// Cassette I/O is incomplete, and the TRS-80 main CPU frequency is used
+// MC6845P video chip functionality is not emulated
+// JCE's 16KB extended ROM functionality is not understood, functionality is unemulated
-// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
+// YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS
COMP( 1985, h01b, 0, 0, h01b, h01b, h01x_state, init_h01x, "China H Computer Company", "H-01B", 0 )
COMP( 1985, nf500a, 0, 0, nf500a, h01x, h01x_state, init_h01x, "China State-owned 830 Factory", "NF500A", 0 )
COMP( 1987, h01jce, 0, 0, h01jce, h01x, h01x_state, init_h01x, "China Jiangmen Computer Equipment Factory", "H-01 JCE", 0 )
diff --git a/src/mame/drivers/interpro.cpp b/src/mame/drivers/interpro.cpp
index c91aba9d9fe..c7dca01ea82 100644
--- a/src/mame/drivers/interpro.cpp
+++ b/src/mame/drivers/interpro.cpp
@@ -1003,7 +1003,7 @@ void sapphire_state::sapphire(machine_config &config)
// floppy controller
N82077AA(config, m_fdc, 24_MHz_XTAL);
- m_fdc->set_mode(n82077aa_device::MODE_PS2);
+ m_fdc->set_mode(n82077aa_device::mode_t::PS2);
m_fdc->intrq_wr_callback().set(m_ioga, FUNC(interpro_ioga_device::ir1_w));
m_fdc->drq_wr_callback().set(m_ioga, FUNC(interpro_ioga_device::drq_floppy));
diff --git a/src/mame/drivers/next.cpp b/src/mame/drivers/next.cpp
index 013cdd6c270..61aeadf52f4 100644
--- a/src/mame/drivers/next.cpp
+++ b/src/mame/drivers/next.cpp
@@ -1056,7 +1056,8 @@ void next_state::next(machine_config &config)
void next_state::next_fdc_base(machine_config &config)
{
next_base(config);
- N82077AA(config, fdc, n82077aa_device::MODE_PS2);
+
+ N82077AA(config, fdc, n82077aa_device::mode_t::PS2);
fdc->intrq_wr_callback().set(FUNC(next_state::fdc_irq));
fdc->drq_wr_callback().set(FUNC(next_state::fdc_drq));
FLOPPY_CONNECTOR(config, "fdc:0", next_floppies, "35ed", next_state::floppy_formats);
diff --git a/src/mame/drivers/sun3x.cpp b/src/mame/drivers/sun3x.cpp
index 7eda7de1c30..6ddfa4eeebd 100644
--- a/src/mame/drivers/sun3x.cpp
+++ b/src/mame/drivers/sun3x.cpp
@@ -625,7 +625,7 @@ void sun3x_state::sun3_80(machine_config &config)
NCR539X(config, ESP_TAG, 20000000/2).set_scsi_port("scsi");
- N82077AA(config, m_fdc, n82077aa_device::MODE_PS2);
+ N82077AA(config, m_fdc, n82077aa_device::mode_t::PS2);
FLOPPY_CONNECTOR(config, "fdc:0", sun_floppies, "35hd", sun3x_state::floppy_formats);
// the timekeeper has no interrupt output, so 3/80 includes a dedicated timer circuit
diff --git a/src/mame/includes/h01x.h b/src/mame/includes/h01x.h
index 999649b4863..df089ed3a7a 100644
--- a/src/mame/includes/h01x.h
+++ b/src/mame/includes/h01x.h
@@ -1,4 +1,5 @@
// license:BSD-3-Clause
+// copyright-holders:zzemu-cn
/***************************************************************************
NF500A (TRS80 Level II Basic)
09/01/2019