1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
// license:BSD-3-Clause
// copyright-holders: Angelo Salese
#ifndef MAME_MACHINE_PC97338_H
#define MAME_MACHINE_PC97338_H
#pragma once
#include "bus/isa/isa.h"
//#include "machine/8042kbdc.h"
//#include "machine/ds128x.h"
#include "machine/ins8250.h"
#include "machine/pc_lpt.h"
class pc97338_device : public device_t,
public device_isa16_card_interface,
public device_memory_interface
{
public:
pc97338_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
~pc97338_device() {}
void remap(int space_id, offs_t start, offs_t end) override;
// auto gp20_reset() { return m_gp20_reset_callback.bind(); }
// auto gp25_gatea20() { return m_gp25_gatea20_callback.bind(); }
auto irq1() { return m_irq1_callback.bind(); }
auto irq8() { return m_irq8_callback.bind(); }
auto irq9() { return m_irq9_callback.bind(); }
auto txd1() { return m_txd1_callback.bind(); }
auto ndtr1() { return m_ndtr1_callback.bind(); }
auto nrts1() { return m_nrts1_callback.bind(); }
auto txd2() { return m_txd2_callback.bind(); }
auto ndtr2() { return m_ndtr2_callback.bind(); }
auto nrts2() { return m_nrts2_callback.bind(); }
void rxd1_w(int state);
void ndcd1_w(int state);
void ndsr1_w(int state);
void nri1_w(int state);
void ncts1_w(int state);
void rxd2_w(int state);
void ndcd2_w(int state);
void ndsr2_w(int state);
void nri2_w(int state);
void ncts2_w(int state);
protected:
virtual void device_start() override ATTR_COLD;
virtual void device_reset() override ATTR_COLD;
virtual space_config_vector memory_space_config() const override;
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
private:
const address_space_config m_space_config;
// required_device<kbdc8042_device> m_kbdc;
// required_device<ds12885_device> m_rtc;
required_device_array<ns16550_device, 2> m_pc_com;
required_device<pc_lpt_device> m_pc_lpt;
// devcb_write_line m_gp20_reset_callback;
// devcb_write_line m_gp25_gatea20_callback;
devcb_write_line m_irq1_callback;
devcb_write_line m_irq8_callback;
devcb_write_line m_irq9_callback;
devcb_write_line m_txd1_callback;
devcb_write_line m_ndtr1_callback;
devcb_write_line m_nrts1_callback;
devcb_write_line m_txd2_callback;
devcb_write_line m_ndtr2_callback;
devcb_write_line m_nrts2_callback;
void request_irq(int irq, int state);
u8 read(offs_t offset);
void write(offs_t offset, u8 data);
void config_map(address_map &map) ATTR_COLD;
u8 far_r(offs_t offset);
void far_w(offs_t offset, u8 data);
u8 fer_r(offs_t offset);
void fer_w(offs_t offset, u8 data);
// u8 keybc_status_r(offs_t offset);
// void keybc_command_w(offs_t offset, u8 data);
// u8 rtc_r(offs_t offset);
// void rtc_w(offs_t offset, u8 data);
//
// void kbdp21_gp25_gatea20_w(int state);
// void kbdp20_gp20_reset_w(int state);
//
// void irq_keyboard_w(int state);
// void irq_mouse_w(int state);
//
// u8 krr_r(offs_t offset);
// void krr_w(offs_t offset, u8 data);
void irq_parallel_w(int state);
void irq_serial1_w(int state);
void txd_serial1_w(int state);
void dtr_serial1_w(int state);
void rts_serial1_w(int state);
void irq_serial2_w(int state);
void txd_serial2_w(int state);
void dtr_serial2_w(int state);
void rts_serial2_w(int state);
u8 m_index = 0;
u8 m_locked_state = 2;
// u8 m_krr = 0;
u8 m_fer = 0;
u8 m_far = 0;
};
DECLARE_DEVICE_TYPE(PC97338, pc97338_device);
#endif // MAME_MACHINE_PC97338_H
|