Previous 199869 Revisions Next

r26598 Thursday 12th December, 2013 at 10:11:04 UTC by Robbbert
(MESS) v6809 : added some devices
[src/mess/drivers]v6809.c

trunk/src/mess/drivers/v6809.c
r26597r26598
3434- Colours (a photo shows colours but the schematic doesn't
3535           have any ram for colours).
3636
37- Connect the devices (RTC, FDC, PIAs, ACIAs, timer).
37- Connect the devices (RTC, FDC).
3838
3939- Find the missing character generator rom.
4040
41- Add mirrors to the address map.
42
4341- Add sound. Pressing BEL character issues commands to the timer chip.
4442
45- Replace terminal keyboard with proper plug-in unit (no info).
4643
4744****************************************************************************/
4845
4946#include "emu.h"
5047#include "cpu/m6809/m6809.h"
48#include "machine/6821pia.h"
49#include "machine/6840ptm.h"
5150#include "video/mc6845.h"
52//#include "machine/6821pia.h"
53//#include "machine/6850acia.h"
51#include "machine/6850acia.h"
5452#include "machine/keyboard.h"
53#include "sound/speaker.h"
5554
5655
5756
r26597r26598
5958{
6059public:
6160   v6809_state(const machine_config &mconfig, device_type type, const char *tag)
62      : driver_device(mconfig, type, tag),
63   m_maincpu(*this, "maincpu"),
64   m_crtc(*this, "crtc"),
65   m_video_address(0)
61      : driver_device(mconfig, type, tag)
62      , m_video_address(0)
63      , m_pia0(*this, "pia0")
64      , m_maincpu(*this, "maincpu")
65      , m_crtc(*this, "crtc")
6666   { }
6767
68   required_device<cpu_device> m_maincpu;
69   required_device<mc6845_device> m_crtc;
70   DECLARE_READ8_MEMBER(key_r);
71   DECLARE_READ8_MEMBER(status_r);
68   DECLARE_READ8_MEMBER(pb_r);
7269   DECLARE_WRITE8_MEMBER(videoram_w);
7370   DECLARE_WRITE8_MEMBER(v6809_address_w);
7471   DECLARE_WRITE8_MEMBER(v6809_register_w);
7572   DECLARE_WRITE8_MEMBER(kbd_put);
73   DECLARE_MACHINE_RESET(v6809);
7674   UINT8 *m_p_videoram;
7775   const UINT8 *m_p_chargen;
7876   UINT16 m_video_address;
77private:
7978   UINT8 m_video_index;
8079   UINT8 m_term_data;
8180   UINT8 m_vidbyte;
82   virtual void machine_reset();
83   virtual void video_start();
81   required_device<pia6821_device> m_pia0;
82   required_device<cpu_device> m_maincpu;
83   required_device<mc6845_device> m_crtc;
8484};
8585
8686
r26597r26598
9090   AM_RANGE(0xf000, 0xf000) AM_MIRROR(0xfe) AM_DEVREAD("crtc", mc6845_device, status_r) AM_WRITE(v6809_address_w)
9191   AM_RANGE(0xf001, 0xf001) AM_MIRROR(0xfe) AM_DEVREAD("crtc", mc6845_device, register_r) AM_WRITE(v6809_register_w)
9292   AM_RANGE(0xf200, 0xf200) AM_MIRROR(0xff) AM_WRITE(videoram_w)
93   //AM_RANGE(0xf505, 0xf506) acia-1 (modem)
94   //AM_RANGE(0xf50c, 0xf50d) acia-2 (printer)
93   AM_RANGE(0xf504, 0xf504) AM_MIRROR(0x36) AM_DEVREADWRITE("acia0", acia6850_device, status_read, control_write) // modem
94   AM_RANGE(0xf505, 0xf505) AM_MIRROR(0x36) AM_DEVREADWRITE("acia0", acia6850_device, data_read, data_write)
95   AM_RANGE(0xf50c, 0xf50c) AM_MIRROR(0x36) AM_DEVREADWRITE("acia1", acia6850_device, status_read, control_write) // printer
96   AM_RANGE(0xf50d, 0xf50d) AM_MIRROR(0x36) AM_DEVREADWRITE("acia1", acia6850_device, data_read, data_write)
9597   //AM_RANGE(0xf600, 0xf603) AM_MIRROR(0x3c) disk controller
9698   //AM_RANGE(0xf640, 0xf64f) AM_MIRROR(0x30) real time clock
97   //AM_RANGE(0xf680, 0xf683) AM_MIRROR(0x3c) pia-1 (disk & keyboard)
98   //AM_RANGE(0xf6c8, 0xf6cf) timer
99   //AM_RANGE(0xf6d0, 0xf6d3) pia-2
99   AM_RANGE(0xf680, 0xf683) AM_MIRROR(0x3c) AM_DEVREADWRITE("pia0", pia6821_device, read, write)
100   AM_RANGE(0xf6c8, 0xf6cf) AM_MIRROR(0x08) AM_DEVREADWRITE("ptm", ptm6840_device, read, write)
101   AM_RANGE(0xf6d0, 0xf6d3) AM_MIRROR(0x0c) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
100102   AM_RANGE(0xf800, 0xffff) AM_ROM
101
102   //temp
103   AM_RANGE(0xf682, 0xf682) AM_READ(key_r)
104   AM_RANGE(0xf683, 0xf683) AM_READ(status_r)
105103ADDRESS_MAP_END
106104
107105static ADDRESS_MAP_START(v6809_io, AS_PROGRAM, 8, v6809_state)
r26597r26598
113111static INPUT_PORTS_START( v6809 )
114112INPUT_PORTS_END
115113
114MACHINE_RESET_MEMBER( v6809_state, v6809)
115{
116   m_p_chargen = memregion("chargen")->base();
117   m_p_videoram = memregion("videoram")->base();
118   m_term_data = 0;
119   m_pia0->cb1_w(1);
120}
121
116122// **** Video ****
117123
118124/* F4 Character Displayer */
r26597r26598
169175   state->m_video_address = address & 0x7ff;
170176}
171177
172void v6809_state::video_start()
173{
174   m_p_chargen = memregion("chargen")->base();
175   m_p_videoram = memregion("videoram")->base();
176}
177
178
179178static MC6845_INTERFACE( v6809_crtc )
180179{
181180   false,
r26597r26598
221220
222221// **** Keyboard ****
223222
224READ8_MEMBER( v6809_state::key_r )
223WRITE8_MEMBER( v6809_state::kbd_put )
225224{
225   m_term_data = data;
226   m_pia0->cb1_w(0);
227   m_pia0->cb1_w(1);
228}
229
230static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
231{
232   DEVCB_DRIVER_MEMBER(v6809_state, kbd_put)
233};
234
235READ8_MEMBER( v6809_state::pb_r )
236{
226237   UINT8 ret = m_term_data;
227238   m_term_data = 0;
228239   return ret;
229240}
230241
231READ8_MEMBER( v6809_state::status_r )
242// port A = drive select and 2 control lines ; port B = keyboard
243static const pia6821_interface pia0_intf =
232244{
233   return (m_term_data) ? 0x80 : 0;
234}
245   DEVCB_NULL,     /* port A input */
246   DEVCB_DRIVER_MEMBER(v6809_state, pb_r),     /* port B input */
247   DEVCB_NULL,     /* CA1 input */
248   DEVCB_NULL,     /* CB1 input */
249   DEVCB_NULL,     /* CA2 input */
250   DEVCB_NULL,     /* CB2 input */
251   DEVCB_NULL,     /* port A output */
252   DEVCB_NULL,     /* port B output */
253   DEVCB_NULL,     /* CA2 output */
254   DEVCB_NULL,     /* CB2 output */
255   DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE),    /* IRQA output */
256   DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE)     /* IRQB output */
257};
235258
236WRITE8_MEMBER( v6809_state::kbd_put )
259// no idea what this does
260static const pia6821_interface pia1_intf =
237261{
238   m_term_data = data;
239}
262   DEVCB_NULL,     /* port A input */
263   DEVCB_NULL,     /* port B input */
264   DEVCB_NULL,     /* CA1 input */
265   DEVCB_NULL,     /* CB1 input */
266   DEVCB_NULL,     /* CA2 input */
267   DEVCB_NULL,     /* CB2 input */
268   DEVCB_NULL,     /* port A output */
269   DEVCB_NULL,     /* port B output */
270   DEVCB_NULL,     /* CA2 output */
271   DEVCB_NULL,     /* CB2 output */
272   DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE),    /* IRQA output */
273   DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE)     /* IRQB output */
274};
240275
241static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
276static const ptm6840_interface mc6840_intf =
242277{
243   DEVCB_DRIVER_MEMBER(v6809_state, kbd_put)
278   XTAL_16MHz / 4,
279   { 0, 0, 0 },
280   { DEVCB_NULL,
281      DEVCB_DEVICE_LINE_MEMBER("speaker", speaker_sound_device, level_w),
282      DEVCB_DEVICE_LINE_MEMBER("speaker", speaker_sound_device, level_w) },
283   DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE)
244284};
245285
286static ACIA6850_INTERFACE( mc6850_intf )
287{
288   10,
289   10,
290   DEVCB_NULL,
291   DEVCB_NULL,
292   DEVCB_NULL,
293   DEVCB_NULL,
294   DEVCB_NULL,
295   DEVCB_NULL
296};
297
246298// *** Machine ****
247299
248void v6809_state::machine_reset()
249{
250}
251
252300static MACHINE_CONFIG_START( v6809, v6809_state )
253301   /* basic machine hardware */
254302   MCFG_CPU_ADD("maincpu", M6809, XTAL_16MHz / 4)
255303   MCFG_CPU_PROGRAM_MAP(v6809_mem)
256304   MCFG_CPU_IO_MAP(v6809_io)
305   MCFG_MACHINE_RESET_OVERRIDE(v6809_state, v6809)
257306
258
259307   /* video hardware */
260308   MCFG_SCREEN_ADD("screen", RASTER)
261309   MCFG_SCREEN_REFRESH_RATE(50)
r26597r26598
267315   MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
268316   MCFG_GFXDECODE(v6809)
269317
318   /* sound hardware */
319   MCFG_SPEAKER_STANDARD_MONO("mono")
320   MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0)
321   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
322
270323   /* Devices */
271324   MCFG_MC6845_ADD("crtc", SY6545_1, "screen", XTAL_16MHz / 8, v6809_crtc)
272325   MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
326   MCFG_PIA6821_ADD("pia0", pia0_intf)
327   MCFG_PIA6821_ADD("pia1", pia1_intf)
328   MCFG_PTM6840_ADD("ptm", mc6840_intf)
329   MCFG_ACIA6850_ADD("acia0", mc6850_intf)
330   MCFG_ACIA6850_ADD("acia1", mc6850_intf)
273331MACHINE_CONFIG_END
274332
275333/* ROM definition */
r26597r26598
287345
288346/* Driver */
289347
290/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT     COMPANY      FULLNAME       FLAGS */
291COMP( 1982, v6809,  0,      0,       v6809,     v6809, driver_device,   0,      "Microkit", "Vegas 6809", GAME_NOT_WORKING | GAME_NO_SOUND)
348/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT  CLASS           INIT     COMPANY      FULLNAME       FLAGS */
349COMP( 1982, v6809,  0,      0,       v6809,     v6809, driver_device,   0,     "Microkit", "Vegas 6809", GAME_NOT_WORKING )

Previous 199869 Revisions Next


© 1997-2024 The MAME Team