Previous 15994 Revisions Next

r5160 Monday 6th July, 2009 at 07:50:08 UTC by Curt Coder
[HUEBLER] Added devices and video.
[src/mess/drivers]huebler.c
[src/mess/includes]huebler.h*

src/mess/includes/huebler.h
r0r5160
1#ifndef __HUEBLER__
2#define __HUEBLER__
3
4#define SCREEN_TAG      "screen"
5#define Z80_TAG         "z80"
6#define Z80CTC_TAG      "z80ctc"
7#define Z80SIO_TAG      "z80sio"
8#define Z80PIO1_TAG      "z80pio1"
9#define Z80PIO2_TAG      "z80pio2"
10#define CASSETTE_TAG   "cassette"
11
12typedef struct _huebler_state huebler_state;
13struct _huebler_state
14{
15   /* video state */
16   UINT8 *video_ram;
17   UINT8 *char_rom;
18};
19
20#endif
src/mess/drivers/huebler.c
r5159r5160
11/***************************************************************************
22
3        Hubler/Everts
3    Hubler/Everts
44
5        12/05/2009 Skeleton driver.
5    12/05/2009 Skeleton driver.
66
77****************************************************************************/
88
99#include "driver.h"
10#include "includes/huebler.h"
1011#include "cpu/z80/z80.h"
12#include "cpu/z80/z80daisy.h"
13#include "devices/cassette.h"
14#include "machine/z80pio.h"
15#include "machine/z80sio.h"
16#include "machine/z80ctc.h"
1117
12static ADDRESS_MAP_START(huebler_mem, ADDRESS_SPACE_PROGRAM, 8)
18/* Read/Write Handlers */
19
20static READ8_DEVICE_HANDLER( huebler_z80sio_r )
21{
22   switch (offset)
23   {
24   case 0: return z80sio_d_r(device, 0);
25   case 1: return z80sio_c_r(device, 0);
26   case 2: return z80sio_d_r(device, 1);
27   case 3: return z80sio_c_r(device, 1);
28   }
29
30   return 0;
31}
32
33static WRITE8_DEVICE_HANDLER( huebler_z80sio_w )
34{
35   switch (offset)
36   {
37   case 0: z80sio_d_w(device, 0, data); break;
38   case 1: z80sio_c_w(device, 0, data); break;
39   case 2: z80sio_d_w(device, 1, data); break;
40   case 3: z80sio_c_w(device, 1, data); break;
41   }
42}
43
44/* Memory Maps */
45
46static ADDRESS_MAP_START( huebler_mem, ADDRESS_SPACE_PROGRAM, 8 )
1347   ADDRESS_MAP_UNMAP_HIGH
48   AM_RANGE(0x0000, 0xe7ff) AM_RAM
49   AM_RANGE(0xe800, 0xefff) AM_RAM AM_BASE_MEMBER(huebler_state, video_ram)
50   AM_RANGE(0xf000, 0xfbff) AM_ROM
51   AM_RANGE(0xfc00, 0xffff) AM_RAM
1452ADDRESS_MAP_END
1553
16static ADDRESS_MAP_START( huebler_io , ADDRESS_SPACE_IO, 8)
54static ADDRESS_MAP_START( huebler_io, ADDRESS_SPACE_IO, 8 )
1755   ADDRESS_MAP_UNMAP_HIGH
56   ADDRESS_MAP_GLOBAL_MASK(0xff)
57   AM_RANGE(0x0c, 0x0f) AM_DEVREADWRITE(Z80PIO2_TAG, z80pio_alt_r, z80pio_alt_w)
58   AM_RANGE(0x10, 0x13) AM_DEVREADWRITE(Z80PIO1_TAG, z80pio_alt_r, z80pio_alt_w)
59   AM_RANGE(0x14, 0x17) AM_DEVREADWRITE(Z80CTC_TAG, z80ctc_r, z80ctc_w)
60   AM_RANGE(0x18, 0x1b) AM_DEVREADWRITE(Z80SIO_TAG, huebler_z80sio_r, huebler_z80sio_w)
1861ADDRESS_MAP_END
1962
20/* Input ports */
63/* Input Ports */
64
2165static INPUT_PORTS_START( huebler )
2266INPUT_PORTS_END
2367
68/* Video */
2469
25static MACHINE_RESET(huebler)
70static VIDEO_START( huebler )
2671{
27}
72   huebler_state *state = machine->driver_data;
2873
29static VIDEO_START( huebler )
30{
74   /* find memory regions */
75   state->char_rom = memory_region(machine, "chargen");
3176}
3277
3378static VIDEO_UPDATE( huebler )
3479{
80   huebler_state *state = screen->machine->driver_data;
81
82   int y, sx, x, line;
83
84   for (y = 0; y < 240; y++)
85   {
86      line = y % 10;
87
88      for (sx = 0; sx < 64; sx++)
89      {
90         UINT16 videoram_addr = ((y / 10) * 64) + sx;
91         UINT8 videoram_data = state->video_ram[videoram_addr & 0x7ff];
92
93         UINT16 charrom_addr = (videoram_data << 3) | line;
94         UINT8 data = state->char_rom[charrom_addr & 0x3ff];
95
96         for (x = 0; x < 6; x++)
97         {
98            int color = (line > 7) ? 0 : BIT(data, 7);
99
100            *BITMAP_ADDR16(bitmap, y, (sx * 6) + x) = color;
101
102            data <<= 1;
103         }
104      }
105   }
106
35107    return 0;
36108}
37109
110/* Z80-CTC Interface */
111
112static void z80daisy_interrupt(const device_config *device, int state)
113{
114   cputag_set_input_line(device->machine, Z80_TAG, INPUT_LINE_IRQ0, state);
115}
116
117static WRITE8_DEVICE_HANDLER( ctc_z0_w )
118{
119}
120
121static WRITE8_DEVICE_HANDLER( ctc_z1_w )
122{
123}
124
125static WRITE8_DEVICE_HANDLER( ctc_z2_w )
126{
127}
128
129static const z80ctc_interface ctc_intf =
130{
131   0,                 /* timer disables */
132   z80daisy_interrupt,   /* interrupt handler */
133   ctc_z0_w,         /* ZC/TO0 callback */
134   ctc_z1_w,         /* ZC/TO1 callback */
135   ctc_z2_w          /* ZC/TO2 callback */
136};
137
138/* Z80-PIO Interface */
139
140static const z80pio_interface pio1_intf =
141{
142   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),   /* callback when change interrupt status */
143   DEVCB_NULL,                  /* port A read callback */
144   DEVCB_NULL,                  /* port B read callback */
145   DEVCB_NULL,                  /* port A write callback */
146   DEVCB_NULL,                  /* port B write callback */
147   DEVCB_NULL,                  /* portA ready active callback */
148   DEVCB_NULL                  /* portB ready active callback */
149};
150
151static const z80pio_interface pio2_intf =
152{
153   DEVCB_CPU_INPUT_LINE(Z80_TAG, INPUT_LINE_IRQ0),   /* callback when change interrupt status */
154   DEVCB_NULL,                  /* port A read callback */
155   DEVCB_NULL,                  /* port B read callback */
156   DEVCB_NULL,                  /* port A write callback */
157   DEVCB_NULL,                  /* port B write callback */
158   DEVCB_NULL,                  /* portA ready active callback */
159   DEVCB_NULL                  /* portB ready active callback */
160};
161
162/* Z80-PIO Interface */
163
164static const z80sio_interface sio_intf =
165{
166   z80daisy_interrupt,   /* interrupt handler */
167   NULL,            /* DTR changed handler */
168   NULL,            /* RTS changed handler */
169   NULL,            /* BREAK changed handler */
170   NULL,            /* transmit handler */
171   NULL            /* receive handler */
172};
173
174/* Z80 Daisy Chain */
175
176static const z80_daisy_chain huebler_daisy_chain[] =
177{
178   { Z80CTC_TAG },
179   { Z80SIO_TAG },
180   { Z80PIO1_TAG },
181   { Z80PIO2_TAG },
182   { NULL }
183};
184
185/* Machine Initialization */
186
187static MACHINE_START(huebler)
188{
189}
190
191/* Machine Driver */
192
193static const cassette_config huebler_cassette_config =
194{
195   cassette_default_formats,
196   NULL,
197   CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED
198};
199
38200static MACHINE_DRIVER_START( huebler )
39    /* basic machine hardware */
40    MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz)
201   MDRV_DRIVER_DATA(huebler_state)
202
203   /* basic machine hardware */
204    MDRV_CPU_ADD(Z80_TAG, Z80, 2500000) /* U880D */
41205    MDRV_CPU_PROGRAM_MAP(huebler_mem)
42206    MDRV_CPU_IO_MAP(huebler_io)
207   MDRV_CPU_CONFIG(huebler_daisy_chain)
43208
44    MDRV_MACHINE_RESET(huebler)
209    MDRV_MACHINE_START(huebler)
45210
46211    /* video hardware */
47    MDRV_SCREEN_ADD("screen", RASTER)
212    MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
48213    MDRV_SCREEN_REFRESH_RATE(50)
49214    MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
50215    MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
51    MDRV_SCREEN_SIZE(640, 480)
52    MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
216    MDRV_SCREEN_SIZE(384, 240)
217    MDRV_SCREEN_VISIBLE_AREA(0, 384-1, 0, 240-1)
53218    MDRV_PALETTE_LENGTH(2)
54219    MDRV_PALETTE_INIT(black_and_white)
55220
56221    MDRV_VIDEO_START(huebler)
57222    MDRV_VIDEO_UPDATE(huebler)
223
224   /* devices */
225   MDRV_Z80CTC_ADD(Z80CTC_TAG, 2500000, ctc_intf)
226   MDRV_Z80PIO_ADD(Z80PIO1_TAG, pio1_intf)
227   MDRV_Z80PIO_ADD(Z80PIO2_TAG, pio2_intf)
228   MDRV_Z80SIO_ADD(Z80SIO_TAG, 2500000, sio_intf)
229
230   MDRV_CASSETTE_ADD(CASSETTE_TAG, huebler_cassette_config)
58231MACHINE_DRIVER_END
59232
60static SYSTEM_CONFIG_START(huebler)
61SYSTEM_CONFIG_END
233/* ROMs */
62234
63/* ROM definition */
64235ROM_START( huebler )
65   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
66   /* Various bioses here, load address of each is shown */
67   ROM_LOAD( "mon21.bin",    0xf000, 0x0bdf, CRC(ba905563) SHA1(1fa0aeab5428731756bdfa74efa3c664898bf083))
68   ROM_LOAD( "mon30.bin",    0x0000, 0x1000, CRC(033f8112) SHA1(0c6ae7b9d310dec093652db6e8ae84f8ebfdcd29))
69   ROM_LOAD( "mon30p_hbasic33p.bin", 0x0000, 0x4800, CRC(c927e7be) SHA1(2d1f3ff4d882c40438a1281872c6037b2f07fdf2))
236   ROM_REGION( 0x10000, Z80_TAG, 0 )
237   ROM_LOAD( "mon21.bin",    0xf000, 0x0bdf, BAD_DUMP CRC(ba905563) SHA1(1fa0aeab5428731756bdfa74efa3c664898bf083) )
238   ROM_LOAD( "mon30.bin",    0x0000, 0x1000, CRC(033f8112) SHA1(0c6ae7b9d310dec093652db6e8ae84f8ebfdcd29) )
239   ROM_LOAD( "mon30p_hbasic33p.bin", 0x0000, 0x4800, CRC(c927e7be) SHA1(2d1f3ff4d882c40438a1281872c6037b2f07fdf2) )
70240
71   ROM_REGION( 0x0400, "gfx1", ROMREGION_ERASEFF )
72   ROM_LOAD( "hemcfont.bin", 0x0000, 0x0400, CRC(1074d103) SHA1(e558279cff5744acef4eccf30759a9508b7f8750))
241   ROM_REGION( 0x0400, "chargen", 0 )
242   ROM_LOAD( "hemcfont.bin", 0x0000, 0x0400, CRC(1074d103) SHA1(e558279cff5744acef4eccf30759a9508b7f8750) )
73243ROM_END
74244
75/* Driver */
245/* System Configuration */
76246
77/*    YEAR  NAME    PARENT  COMPAT   MACHINE    INPUT    INIT    CONFIG COMPANY   FULLNAME       FLAGS */
78COMP( ????, huebler,  0,       0,    huebler,    huebler,     0,       huebler,      "Bernd Hubler, Klaus-Peter Evert",   "Hubler/Everts",      GAME_NOT_WORKING)
247static SYSTEM_CONFIG_START( huebler )
248   CONFIG_RAM_DEFAULT( 59 * 1024 )
249SYSTEM_CONFIG_END
79250
251/* System Drivers */
252
253/*    YEAR   NAME      PARENT   COMPAT   MACHINE      INPUT      INIT   CONFIG      COMPANY                        FULLNAME         FLAGS */
254COMP( 1985, huebler,   0,      0,      huebler,   huebler,   0,      huebler,   "Bernd Hubler, Klaus-Peter Evert",   "Hubler/Everts",   GAME_NOT_WORKING )

Previous 15994 Revisions Next


© 1998-2018 The MESS Team