Previous 15994 Revisions Next

r6497 Wednesday 2nd December, 2009 at 11:29:31 UTC by Miodrag Milanović
[HT68K] Hook up generic terminal, and connect it to duart. Video now shown.
[src/mess/drivers]ht68k.c

src/mess/drivers/ht68k.c
r6496r6497
1111#include "machine/68681.h"
1212#include "devices/flopdrv.h"
1313#include "machine/wd17xx.h"
14#include "machine/terminal.h"
1415
1516static UINT16* ht68k_ram;
1617
r6496r6497
2627
2728/* Input ports */
2829INPUT_PORTS_START( ht68k )
30   PORT_INCLUDE(generic_terminal)
2931INPUT_PORTS_END
3032
3133
r6496r6497
3840   device_reset(cputag_get_cpu(machine, "maincpu"));
3941}
4042
41static VIDEO_START( ht68k )
43static void duart_irq_handler(const device_config *device, UINT8 vector)
4244{
45   cputag_set_input_line_and_vector(device->machine, "maincpu", M68K_IRQ_3, HOLD_LINE, M68K_INT_ACK_AUTOVECTOR);
4346}
4447
45static VIDEO_UPDATE( ht68k )
48static void duart_tx(const device_config *device, int channel, UINT8 data)
4649{
47    return 0;
50   const device_config   *devconf = devtag_get_device(device->machine, "terminal");
51   terminal_write(devconf,0,data);
4852}
4953
50
51static void duart_irq_handler(const device_config *device, UINT8 vector)
54static UINT8 duart_input(const device_config *device)
5255{
53   logerror("duart_irq_handler\n");
56   return 0;
5457}
5558
56static void duart_tx(const device_config *device, int channel, UINT8 data)
59static WRITE8_DEVICE_HANDLER( ht68k_kbd_put )
5760{
61   duart68681_rx_data(devtag_get_device(device->machine, "duart68681"), 1, data);
5862}
5963
60static UINT8 duart_inp = 0x0e;
61
62static UINT8 duart_input(const device_config *device)
64static GENERIC_TERMINAL_INTERFACE( ht68k_terminal_intf )
6365{
64   if (duart_inp != 0)
65   {
66      duart_inp = 0;
67      return 0x0e;
68   }
69   else
70   {
71      duart_inp = 0x0e;
72      return 0x00;
73   }
74}
66   DEVCB_HANDLER(ht68k_kbd_put)
67};
7568
7669static const duart68681_config ht68k_duart68681_config =
7770{
r6496r6497
10194    MDRV_MACHINE_RESET(ht68k)
10295
10396    /* video hardware */
104    MDRV_SCREEN_ADD("screen", RASTER)
105    MDRV_SCREEN_REFRESH_RATE(50)
106    MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
107    MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
108    MDRV_SCREEN_SIZE(640, 480)
109    MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
110    MDRV_PALETTE_LENGTH(2)
111    MDRV_PALETTE_INIT(black_and_white)
97    MDRV_IMPORT_FROM( generic_terminal )   
98   MDRV_GENERIC_TERMINAL_ADD(TERMINAL_TAG,ht68k_terminal_intf)   
11299
113    MDRV_VIDEO_START(ht68k)
114    MDRV_VIDEO_UPDATE(ht68k)
115
116   MDRV_DUART68681_ADD( "duart68681", XTAL_8MHz, ht68k_duart68681_config )
100   MDRV_DUART68681_ADD( "duart68681", XTAL_8MHz / 2, ht68k_duart68681_config )
117101   MDRV_WD1770_ADD("wd1770", default_wd17xx_interface_2_drives )
118102   MDRV_FLOPPY_2_DRIVES_ADD(ht68k_floppy_config)
119103MACHINE_DRIVER_END

Previous 15994 Revisions Next


© 1998-2018 The MESS Team