Previous 15994 Revisions Next

r9764 Monday 13th December, 2010 at 05:38:20 UTC by Robbbert
[H19] Added interrupts. Added terminal bell.
[src/mess/drivers]h19.c

src/mess/drivers/h19.c
r9763r9764
99#include "emu.h"
1010#include "cpu/z80/z80.h"
1111#include "video/mc6845.h"
12#include "sound/beep.h"
1213
14#define H19_CLOCK (XTAL_12_288MHz / 6)
15#define H19_BEEP_FRQ (H19_CLOCK / 1024)
16// next one needs to be measured
17#define H19_IRQ_PULSE (H19_BEEP_FRQ / 2)
1318
19
1420class h19_state : public driver_device
1521{
1622public:
1723   h19_state(running_machine &machine, const driver_device_config_base &config)
1824      : driver_device(machine, config) { }
1925
20   UINT8 *video_ram;
26   UINT8 *videoram;
2127   UINT8 *charrom;
28   running_device *beeper;
2229};
2330
2431
32static TIMER_CALLBACK( h19_beepoff )
33{
34   h19_state *state = machine->driver_data<h19_state>();
35   beep_set_state(state->beeper, 0);
36}
2537
38static WRITE8_HANDLER( h19_c0_w )
39{
40   h19_state *state = space->machine->driver_data<h19_state>();
41/* Beeper control - lengths need verifying
42    offset 00-1F = keyclick
43    offset 20-3F = terminal bell */
44
45   UINT16 length = 0;
46
47   if (offset & 0x20)
48      length = 200;
49   else
50      length = 4;
51
52   timer_set(space->machine, ATTOTIME_IN_MSEC(length), NULL, 0, h19_beepoff);
53   beep_set_state(state->beeper, 1);
54}
55
2656static ADDRESS_MAP_START(h19_mem, ADDRESS_SPACE_PROGRAM, 8)
2757   ADDRESS_MAP_UNMAP_HIGH
2858   AM_RANGE(0x0000, 0x1fff) AM_ROM
2959   AM_RANGE(0x2000, 0xf7ff) AM_RAM
30   AM_RANGE(0xf800, 0xffff) AM_RAM AM_BASE_MEMBER(h19_state, video_ram)
60   AM_RANGE(0xf800, 0xffff) AM_RAM AM_BASE_MEMBER(h19_state, videoram)
3161ADDRESS_MAP_END
3262
3363static ADDRESS_MAP_START( h19_io , ADDRESS_SPACE_IO, 8)
3464   ADDRESS_MAP_UNMAP_HIGH
3565   ADDRESS_MAP_GLOBAL_MASK(0xff)
36   AM_RANGE(0x60, 0x60) AM_DEVWRITE("crtc", mc6845_address_w)
37   AM_RANGE(0x61, 0x61) AM_DEVREADWRITE("crtc", mc6845_register_r , mc6845_register_w)
66   AM_RANGE(0x60, 0x60) AM_MIRROR(0x1E) AM_DEVWRITE("crtc", mc6845_address_w)
67   AM_RANGE(0x61, 0x61) AM_MIRROR(0x1E) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w)
68   AM_RANGE(0xc0, 0xff) AM_WRITE(h19_c0_w)
69   //AM_RANGE(0x00, 0x3F) powerup logic
70   //AM_RANGE(0x40, 0x5F) serial control
71   //AM_RANGE(0x80, 0x9F) keyboard data
72   //AM_RANGE(0xA0, 0xBF) keyboard control
3873ADDRESS_MAP_END
3974
4075/* Input ports */
r9763r9764
4479
4580static MACHINE_RESET(h19)
4681{
82   h19_state *state = machine->driver_data<h19_state>();
83   state->beeper = machine->device("beep");
84   beep_set_frequency(state->beeper, H19_BEEP_FRQ);
4785}
4886
4987static VIDEO_START( h19 )
r9763r9764
70108   {
71109      UINT8 inv=0;
72110      if (x == cursor_x) inv=0xff;
73      mem = (ma + x) & 0xfff;
74      chr = state->video_ram[mem];
111      mem = (ma + x) & 0x7ff;
112      chr = state->videoram[mem];
75113
76114      if (chr & 0x80)
77115      {
r9763r9764
104142   DEVCB_NULL,
105143   DEVCB_NULL,
106144   DEVCB_NULL,
107   DEVCB_NULL,
145   DEVCB_CPU_INPUT_LINE("maincpu", INPUT_LINE_NMI), // frame pulse
108146   NULL
109147};
110148
r9763r9764
129167
130168static MACHINE_CONFIG_START( h19, h19_state )
131169   /* basic machine hardware */
132   MDRV_CPU_ADD("maincpu",Z80, XTAL_12_288MHz / 6) // From schematics
170   MDRV_CPU_ADD("maincpu",Z80, H19_CLOCK) // From schematics
133171   MDRV_CPU_PROGRAM_MAP(h19_mem)
134172   MDRV_CPU_IO_MAP(h19_io)
173   MDRV_DEVICE_PERIODIC_INT(irq0_line_hold, H19_IRQ_PULSE)
135174
136175   MDRV_MACHINE_RESET(h19)
137176
r9763r9764
150189
151190   MDRV_VIDEO_START( h19 )
152191   MDRV_VIDEO_UPDATE( h19 )
192
193   /* sound hardware */
194   MDRV_SPEAKER_STANDARD_MONO("mono")
195   MDRV_SOUND_ADD("beep", BEEP, 0)
196   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
153197MACHINE_CONFIG_END
154198
155199/* ROM definition */
r9763r9764
174218   ROM_LOAD( "2716_444-37_h19keyb.bin", 0x0000, 0x0800, CRC(5c3e6972) SHA1(df49ce64ae48652346a91648c58178a34fb37d3c))
175219   // Watzman keyboard
176220   ROM_LOAD( "keybd.bin", 0x0000, 0x0800, CRC(58dc8217) SHA1(1b23705290bdf9fc6342065c6a528c04bff67b13))
177
178221ROM_END
179222
180/* Driver */
223/* Driver (year is either 1978 or 1979) */
181224
182225/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    COMPANY   FULLNAME       FLAGS */
183COMP( 19??, h19,     0,       0,   h19,   h19,    0,    "Heath Inc", "Heathkit H-19", GAME_NOT_WORKING | GAME_NO_SOUND)
226COMP( 1978, h19,     0,       0,   h19,   h19,    0,    "Heath Inc", "Heathkit H-19", GAME_NOT_WORKING | GAME_NO_SOUND)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team