Previous 199869 Revisions Next

r24061 Wednesday 3rd July, 2013 at 21:41:34 UTC by Angelo Salese
Hooked up Terminal to Quadtel Harriet
[src/mess/drivers]harriet.c

trunk/src/mess/drivers/harriet.c
r24060r24061
1212
1313#include "emu.h"
1414#include "cpu/m68000/m68000.h"
15//#include "sound/ay8910.h"
15#include "machine/terminal.h"
1616
1717class harriet_state : public driver_device
1818{
1919public:
2020   harriet_state(const machine_config &mconfig, device_type type, const char *tag)
2121      : driver_device(mconfig, type, tag),
22         m_maincpu(*this, "maincpu")
22         m_maincpu(*this, "maincpu"),
23         m_terminal(*this, TERMINAL_TAG)
2324   { }
2425
2526   // devices
2627   required_device<cpu_device> m_maincpu;
28   required_device<generic_terminal_device> m_terminal;
2729
2830   // screen updates
2931   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
3032
33   UINT8 m_teletype_data;
34   UINT8 m_teletype_status;
35
3136   DECLARE_READ8_MEMBER(unk_r);
3237   DECLARE_WRITE8_MEMBER(unk_w);
3338   DECLARE_WRITE8_MEMBER(serial_w);
3439   DECLARE_READ8_MEMBER(unk2_r);
3540   DECLARE_READ8_MEMBER(unk3_r);
36   DECLARE_READ8_MEMBER(unk4_r);
41   DECLARE_READ8_MEMBER(keyboard_status_r);
42   DECLARE_WRITE8_MEMBER( kbd_put );
3743
3844protected:
3945   // driver_device overrides
r24060r24061
7682
7783WRITE8_MEMBER(harriet_state::serial_w)
7884{
79   printf("%c",data);
85   m_terminal->write(space, 0, data);
8086}
8187
8288/* tested before putting data to serial port at PC=0x4c78 */
r24060r24061
8591   return 0xff;//machine().rand();
8692}
8793
88/* 0x314c, terminal status? */
89READ8_MEMBER(harriet_state::unk4_r)
94/* 0x314c bit 7: keyboard status */
95READ8_MEMBER(harriet_state::keyboard_status_r)
9096{
91   return 0;//machine().rand();
97   UINT8 res;
98
99   res = m_teletype_status | m_teletype_data;
100   m_teletype_status &= ~0x80;
101
102   return res;
92103}
93104
94105static ADDRESS_MAP_START( harriet_map, AS_PROGRAM, 16, harriet_state )
r24060r24061
101112   AM_RANGE(0xf20024, 0xf20025) AM_READ8(unk2_r,0x00ff)
102113   AM_RANGE(0xf2002c, 0xf2002d) AM_READ8(unk3_r,0x00ff)
103114   AM_RANGE(0xf2002e, 0xf2002f) AM_WRITE8(serial_w,0x00ff)
104   AM_RANGE(0xf4003e, 0xf4003f) AM_READ8(unk4_r,0x00ff)
105//   AM_RANGE(0xf4002e, 0xf4002f) AM_READ8(unk4_r,0x00ff)
106//   AM_RANGE(0xf4003e, 0xf4003f) AM_READ8(unk4_r,0x00ff)
115//   AM_RANGE(0xf4001e, 0xf4001f) AM_READ8(keyboard_status_r,0x00ff)
116//   AM_RANGE(0xf4002e, 0xf4002f) AM_READ8(keyboard_status_r,0x00ff)
117   AM_RANGE(0xf4003e, 0xf4003f) AM_READ8(keyboard_status_r,0x00ff)
107118ADDRESS_MAP_END
108119
109120static INPUT_PORTS_START( harriet )
r24060r24061
162173   PORT_DIPSETTING(    0x00, DEF_STR( On ) )
163174INPUT_PORTS_END
164175
176WRITE8_MEMBER( harriet_state::kbd_put )
177{
178   m_teletype_data = data;
179   m_teletype_status |= 0x80;
180}
165181
182static GENERIC_TERMINAL_INTERFACE( terminal_intf )
183{
184   DEVCB_DRIVER_MEMBER(harriet_state, kbd_put)
185};
186
166187void harriet_state::machine_start()
167188{
168189}
r24060r24061
176197{
177198}
178199
200
201
179202static MACHINE_CONFIG_START( harriet, harriet_state )
180203
181204   /* basic machine hardware */
r24060r24061
183206   MCFG_CPU_PROGRAM_MAP(harriet_map)
184207
185208   /* video hardware */
186   MCFG_SCREEN_ADD("screen", RASTER)
187   MCFG_SCREEN_REFRESH_RATE(60)
188   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
189   MCFG_SCREEN_UPDATE_DRIVER(harriet_state, screen_update)
190   MCFG_SCREEN_SIZE(32*8, 32*8)
191   MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
209   MCFG_GENERIC_TERMINAL_ADD(TERMINAL_TAG, terminal_intf)
192210
193211   MCFG_PALETTE_LENGTH(8)
194212

Previous 199869 Revisions Next


© 1997-2024 The MAME Team