Previous 15994 Revisions Next

r15147 Saturday 12th May, 2012 at 02:48:40 UTC by R. Belmont
M20: Add i8255 and 2x i8251 skeleton hookups. BIOS still fails because they are not connected to anything. [R. Belmont]
[src/mess/drivers]m20.c

src/mess/drivers/m20.c
r15146r15147
3838#include "cpu/z8000/z8000.h"
3939#include "cpu/i86/i86.h"
4040#include "video/mc6845.h"
41#include "machine/i8251.h"
42#include "machine/i8255.h"
4143
42
4344class m20_state : public driver_device
4445{
4546public:
4647   m20_state(const machine_config &mconfig, device_type type, const char *tag)
4748      : driver_device(mconfig, type, tag) ,
4849        m_maincpu(*this, "maincpu"),
50        m_kbdi8251(*this, "i8251_1"),
51        m_ttyi8251(*this, "i8251_2"),
52        m_i8255(*this, "ppi8255"),
4953      m_p_videoram(*this, "p_videoram"){ }
5054
5155    required_device<device_t> m_maincpu;
56    required_device<i8251_device> m_kbdi8251;
57    required_device<i8251_device> m_ttyi8251;
58    required_device<i8255_device> m_i8255;
5259   required_shared_ptr<UINT16> m_p_videoram;
5360
5461    virtual void machine_reset();
62
63   DECLARE_READ8_MEMBER(ppi_r);
64   DECLARE_WRITE8_MEMBER(ppi_w);
5565};
5666
5767
r15146r15147
92102   return 0;
93103}
94104
105// translate addresses 81/83/85/87 to PPI offsets 0/1/2/3
106READ8_MEMBER(m20_state::ppi_r)
107{
108    return m_i8255->read(space, offset/2);
109}
110
111WRITE8_MEMBER(m20_state::ppi_w)
112{
113    m_i8255->write(space, offset/2, data);
114}
115
95116/* from the M20 hardware reference manual:
96117   M20 memory is configured according to the following scheme:
97118   Segment   Contents
r15146r15147
126147   ADDRESS_MAP_GLOBAL_MASK(0xff) // may not be needed
127148   AM_RANGE(0x61, 0x61) AM_DEVWRITE("crtc", mc6845_device, address_w)
128149   AM_RANGE(0x63, 0x63) AM_DEVWRITE("crtc", mc6845_device, register_w)
129   // 0x81 / 0x87 - i8255A
130   // 0xa1 - i8251 keyboard data
131   // 0xa3 - i8251 keyboard status / control
132   // 0xc1 - i8251 TTY / printer data
133   // 0xc3 - i8251 TTY / printer status / control
150    AM_RANGE(0x81, 0x87) AM_READWRITE(ppi_r, ppi_w)
151    AM_RANGE(0xa1, 0xa1) AM_DEVREADWRITE("i8251_1", i8251_device, data_r, data_w)
152    AM_RANGE(0xa3, 0xa3) AM_DEVREADWRITE("i8251_1", i8251_device, status_r, control_w)
153    AM_RANGE(0xc1, 0xc1) AM_DEVREADWRITE("i8251_2", i8251_device, data_r, data_w)
154    AM_RANGE(0xc3, 0xc3) AM_DEVREADWRITE("i8251_2", i8251_device, status_r, control_w)
155
134156   // 0x121 / 0x127 - pit8253 (TTY/printer, keyboard, RTC/NVI)
135157
136158   // 0x21?? / 0x21? - fdc ... seems to control the screen colors???
r15146r15147
184206   NULL      /* update address callback */
185207};
186208
209static I8255A_INTERFACE( ppi_interface )
210{
211   DEVCB_NULL,     // port A read
212   DEVCB_NULL,     // port A write
213    DEVCB_NULL,     // port B read
214   DEVCB_NULL,     // port B write
215    DEVCB_NULL,     // port C read
216    DEVCB_NULL      // port C write
217};
218
219static const i8251_interface kbd_i8251_intf =
220{
221   DEVCB_NULL,         // rxd in
222   DEVCB_NULL,         // txd out
223   DEVCB_NULL,         // dsr
224   DEVCB_NULL,         // dtr
225   DEVCB_NULL,         // rts
226   DEVCB_NULL,         // rx ready
227   DEVCB_NULL,         // tx ready
228   DEVCB_NULL,         // tx empty
229   DEVCB_NULL          // syndet
230};
231
232static const i8251_interface tty_i8251_intf =
233{
234   DEVCB_NULL,         // rxd in
235   DEVCB_NULL,         // txd out
236   DEVCB_NULL,         // dsr
237   DEVCB_NULL,         // dtr
238   DEVCB_NULL,         // rts
239   DEVCB_NULL,         // rx ready
240   DEVCB_NULL,         // tx ready
241   DEVCB_NULL,         // tx empty
242   DEVCB_NULL          // syndet
243};
244
187245static MACHINE_CONFIG_START( m20, m20_state )
188246   /* basic machine hardware */
189247   MCFG_CPU_ADD("maincpu", Z8001, MAIN_CLOCK)
r15146r15147
209267
210268   /* Devices */
211269   MCFG_MC6845_ADD("crtc", MC6845, PIXEL_CLOCK/8, mc6845_intf)   /* hand tuned to get ~50 fps */
270   MCFG_I8255A_ADD("ppi8255",  ppi_interface)
271   MCFG_I8251_ADD("i8251_1", kbd_i8251_intf)
272   MCFG_I8251_ADD("i8251_2", tty_i8251_intf)
212273MACHINE_CONFIG_END
213274
214275ROM_START(m20)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team