Previous 199869 Revisions Next

r26587 Wednesday 11th December, 2013 at 15:21:29 UTC by Robbbert
(MESS) ivg09 : added 2nd pia, beeper. Fixed video bug.
[src/mess/drivers]tavernie.c

trunk/src/mess/drivers/tavernie.c
r26586r26587
1212    IVG09 includes 6845, WD1795, another 6821, beeper
1313
1414ToDo:
15    - Almost everything
16    - Scrolling can cause the screen to go blank (use Z command to fix)
17    - There's supposed to be a device at 2000-2003
15    - FDC
16    - Attributes ram
17    - Graphics
1818    - Character rom is not dumped
19    - Graphics rom is not dumped
1920    - Fix cassette
2021    - Need software
2122
r26586r26587
5556#include "machine/serial.h"
5657#include "imagedev/cassette.h"
5758#include "sound/wave.h"
59#include "sound/beep.h"
5860#include "tavernie.lh"
5961
6062
r26586r26587
6567      : driver_device(mconfig, type, tag)
6668      , m_p_videoram(*this, "videoram")
6769      , m_cass(*this, "cassette")
70      , m_pia_ivg(*this, "pia_ivg")
71      , m_beep(*this, "beeper")
6872      , m_maincpu(*this, "maincpu")
6973   { }
7074
r26586r26587
7276   DECLARE_READ8_MEMBER(pa_r);
7377   DECLARE_WRITE8_MEMBER(pa_w);
7478   DECLARE_WRITE8_MEMBER(pb_w);
75   DECLARE_READ8_MEMBER(keyin_r);
79   DECLARE_WRITE8_MEMBER(pa_ivg_w);
80   DECLARE_READ8_MEMBER(pb_ivg_r);
7681   DECLARE_WRITE8_MEMBER(kbd_put);
82   DECLARE_MACHINE_RESET(cpu09);
83   DECLARE_MACHINE_RESET(ivg09);
7784   const UINT8 *m_p_chargen;
7885   optional_shared_ptr<UINT8> m_p_videoram;
7986private:
8087   UINT8 m_term_data;
8188   UINT8 m_pa;
82   virtual void machine_reset();
8389   required_device<cassette_image_device> m_cass;
90   optional_device<pia6821_device> m_pia_ivg;
91   optional_device<beep_device> m_beep;
8492   required_device<cpu_device> m_maincpu;
8593};
8694
r26586r26587
99107static ADDRESS_MAP_START(ivg09_mem, AS_PROGRAM, 8, tavernie_state)
100108   ADDRESS_MAP_UNMAP_HIGH
101109   AM_RANGE(0x1000, 0x1fff) AM_RAM AM_SHARE("videoram")
102   //AM_RANGE(0x2000, 0x2003) 6821 on ivg09
103   AM_RANGE(0x2002, 0x2003) AM_READ(keyin_r)
110   AM_RANGE(0x2000, 0x2003) AM_DEVREADWRITE("pia_ivg", pia6821_device, read, write)
104111   AM_RANGE(0x2080, 0x2080) AM_DEVREADWRITE("crtc", mc6845_device, status_r, address_w)
105112   AM_RANGE(0x2081, 0x2081) AM_DEVREADWRITE("crtc", mc6845_device, register_r, register_w)
106113   AM_RANGE(0xeb00, 0xeb03) AM_DEVREADWRITE("pia", pia6821_device, read, write)
r26586r26587
143150   PORT_DIPSETTING(    0x60, "IVG09 (mc6845)" )
144151INPUT_PORTS_END
145152
146void tavernie_state::machine_reset()
153MACHINE_RESET_MEMBER( tavernie_state, cpu09)
147154{
155   m_term_data = 0;
156}
157
158MACHINE_RESET_MEMBER( tavernie_state, ivg09)
159{
148160   m_p_chargen = memregion("chargen")->base();
161   m_beep->set_frequency(950);    /* guess */
162   m_beep->set_state(1);
149163   m_term_data = 0;
164   m_pia_ivg->cb1_w(1);
150165}
151166
152167
r26586r26587
162177   {
163178      UINT8 inv=0;
164179      if (x == cursor_x) inv=0xff;
165      mem = (ma + x) & 0x7ff;
180      mem = (ma + x) & 0xfff;
166181      if (ra > 7)
167182         gfx = inv;  // some blank spacing lines
168183      else
r26586r26587
233248{
234249   DEVCB_DRIVER_MEMBER(tavernie_state, pa_r),     /* port A input */
235250   DEVCB_NULL,     /* port B input */
236   DEVCB_DRIVER_LINE_MEMBER(tavernie_state, ca1_r),     /* CA1 input - cassin */
251   DEVCB_DRIVER_LINE_MEMBER(tavernie_state, ca1_r),     /* CA1 input */
237252   DEVCB_NULL,     /* CB1 input */
238253   DEVCB_NULL,     /* CA2 input */
239254   DEVCB_NULL,     /* CB2 input */
r26586r26587
245260   DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE)     /* IRQB output */
246261};
247262
263READ8_MEMBER( tavernie_state::pb_ivg_r )
264{
265   UINT8 ret = m_term_data;
266   m_term_data = 0;
267   return ret;
268}
269
270WRITE8_MEMBER( tavernie_state::pa_ivg_w )
271{
272// bits 0-3 are attribute bits
273}
274
275static const pia6821_interface pia_ivg_intf =
276{
277   DEVCB_NULL,     /* port A input */
278   DEVCB_DRIVER_MEMBER(tavernie_state, pb_ivg_r),     /* port B input */
279   DEVCB_NULL,     /* CA1 input */
280   DEVCB_NULL,     /* CB1 input */
281   DEVCB_NULL,     /* CA2 input */
282   DEVCB_NULL,     /* CB2 input */
283   DEVCB_DRIVER_MEMBER(tavernie_state, pa_ivg_w),     /* port A output */
284   DEVCB_NULL,     /* port B output */
285   DEVCB_NULL,     /* CA2 output */
286   DEVCB_DEVICE_LINE_MEMBER("beeper", beep_device, set_state),     /* CB2 output */
287   DEVCB_NULL,    /* IRQA output */
288   DEVCB_NULL     /* IRQB output */
289};
290
248291// all i/o lines connect to the 40-pin expansion connector
249292static const ptm6840_interface mc6840_intf =
250293{
r26586r26587
277320   DEVCB_NULL
278321};
279322
280READ8_MEMBER( tavernie_state::keyin_r )
281{
282   if (offset)
283      return (m_term_data) ? 0x80 : 0;
284
285   UINT8 ret = m_term_data;
286   m_term_data = 0;
287   return ret;
288}
289
290323WRITE8_MEMBER( tavernie_state::kbd_put )
291324{
292325   m_term_data = data;
326   m_pia_ivg->cb1_w(0);
327   m_pia_ivg->cb1_w(1);
293328}
294329
295330static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
r26586r26587
301336   /* basic machine hardware */
302337   MCFG_CPU_ADD("maincpu",M6809E, XTAL_4MHz)
303338   MCFG_CPU_PROGRAM_MAP(cpu09_mem)
339   MCFG_MACHINE_RESET_OVERRIDE(tavernie_state, cpu09)
304340
305341   /* sound hardware */
306342   MCFG_SPEAKER_STANDARD_MONO("mono")
r26586r26587
319355   /* basic machine hardware */
320356   MCFG_CPU_MODIFY("maincpu")
321357   MCFG_CPU_PROGRAM_MAP(ivg09_mem)
358   MCFG_MACHINE_RESET_OVERRIDE(tavernie_state, ivg09)
322359
323360   /* video hardware */
324361   MCFG_SCREEN_ADD("screen", RASTER)
r26586r26587
331368   MCFG_PALETTE_INIT_OVERRIDE(driver_device, black_and_white)
332369   MCFG_DEFAULT_LAYOUT(layout_tavernie)
333370
371   /* sound hardware */
372   MCFG_SOUND_ADD("beeper", BEEP, 0)
373   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
374
334375   /* Devices */
335376   MCFG_ASCII_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf)
336377   MCFG_MC6845_ADD("crtc", MC6845, "screen", 1008000, mc6845_intf) // unknown clock
378   MCFG_PIA6821_ADD("pia_ivg", pia_ivg_intf)
337379MACHINE_CONFIG_END
338380
339381/* ROM definition */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team