Previous 15994 Revisions Next

r3466 Sunday 19th October, 2008 at 10:44:44 UTC by Curt Coder
[ABC80] Better separation of video code.
[src/mess/drivers]abc80.c
[src/mess/includes]abc80.h
[src/mess/video]abc80.c

src/mess/video/abc80.c
r3465r3466
77#include "driver.h"
88#include "includes/abc80.h"
99
10PALETTE_INIT( abc80 )
10/* Graphics Layout */
11
12static const gfx_layout charlayout =
1113{
14   6, 10,
15   128,
16   1,
17   { 0 },
18   { 0, 1, 2, 3, 4, 5 },
19   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8 },
20   10*8
21};
22
23/* Graphics Decode Information */
24
25static GFXDECODE_START( abc80 )
26   GFXDECODE_ENTRY( "chargen", 0,      charlayout, 0, 2 ) // normal characters
27   GFXDECODE_ENTRY( "chargen", 0x500, charlayout, 0, 2 ) // graphics characters
28GFXDECODE_END
29
30static PALETTE_INIT( abc80 )
31{
1232   palette_set_color(machine, 0, RGB_BLACK);
1333   palette_set_color(machine, 1, RGB_WHITE);
1434   palette_set_color(machine, 2, RGB_WHITE);
r3465r3466
178198}
179199#endif
180200
181VIDEO_START( abc80 )
201static VIDEO_START( abc80 )
182202{
183203   abc80_state *state = machine->driver_data;
184204
r3465r3466
209229   state_save_register_global(state->char_row);
210230}
211231
212VIDEO_UPDATE( abc80 )
232static VIDEO_UPDATE( abc80 )
213233{
214234   abc80_state *state = screen->machine->driver_data;
215235   rectangle rect;
r3465r3466
228248
229249   return 0;
230250}
251
252MACHINE_DRIVER_START( abc80_video )
253//   MDRV_TIMER_ADD_PERIODIC("blink", abc80_blink_tick, HZ(ABC80_XTAL/2/6/64/312/16))
254
255   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
256   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
257   MDRV_GFXDECODE(abc80)
258   MDRV_PALETTE_LENGTH(4)
259
260   MDRV_PALETTE_INIT(abc80)
261   MDRV_VIDEO_START(abc80)
262   MDRV_VIDEO_UPDATE(abc80)
263
264   MDRV_SCREEN_RAW_PARAMS(ABC80_XTAL/2, ABC80_HTOTAL, ABC80_HBEND, ABC80_HBSTART, ABC80_VTOTAL, ABC80_VBEND, ABC80_VBSTART)
265MACHINE_DRIVER_END
src/mess/includes/abc80.h
r3465r3466
8080
8181/*----------- defined in video/abc80.c -----------*/
8282
83PALETTE_INIT( abc80 );
84VIDEO_START( abc80 );
85VIDEO_UPDATE( abc80 );
83MACHINE_DRIVER_EXTERN( abc80_video );
8684
87
8885#endif /* ABC80_H_ */
src/mess/drivers/abc80.c
r3465r3466
323323   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
324324INPUT_PORTS_END
325325
326/* Graphics Layout */
327
328static const gfx_layout charlayout =
329{
330   6, 10,
331   128,
332   1,
333   { 0 },
334   { 0, 1, 2, 3, 4, 5 },
335   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8 },
336   10*8
337};
338
339/* Graphics Decode Information */
340
341static GFXDECODE_START( abc80 )
342   GFXDECODE_ENTRY( "chargen", 0,      charlayout, 0, 2 ) // normal characters
343   GFXDECODE_ENTRY( "chargen", 0x500, charlayout, 0, 2 ) // graphics characters
344GFXDECODE_END
345
346326/* Sound Interface */
347327
348328static const sn76477_interface abc80_sn76477_interface =
r3465r3466
536516
537517   MDRV_MACHINE_START(abc80)
538518
519   /* keyboard */
520//   MDRV_TIMER_ADD_PERIODIC("keyboard", abc80_keyboard_tick, USEC(2500))
521
539522   /* Z80PIO */
540   MDRV_Z80PIO_ADD( Z80PIO_TAG, abc80_pio_intf )
523//   MDRV_TIMER_ADD_SCANLINE("pio_astb", z80pio_astb_tick, SCREEN_TAG, 0, 1)
524   MDRV_Z80PIO_ADD(Z80PIO_TAG, abc80_pio_intf)
541525
542526   /* video hardware */
543   MDRV_SCREEN_ADD(SCREEN_TAG, RASTER)
544   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
545   MDRV_GFXDECODE(abc80)
546   MDRV_PALETTE_LENGTH(4)
527   MDRV_IMPORT_FROM(abc80_video)
547528
548   MDRV_PALETTE_INIT(abc80)
549   MDRV_VIDEO_START(abc80)
550   MDRV_VIDEO_UPDATE(abc80)
551
552   MDRV_SCREEN_RAW_PARAMS(ABC80_XTAL/2, ABC80_HTOTAL, ABC80_HBEND, ABC80_HBSTART, ABC80_VTOTAL, ABC80_VBEND, ABC80_VBSTART)
553
554529   /* sound hardware */
555530   MDRV_SPEAKER_STANDARD_MONO("mono")
556531   MDRV_SOUND_ADD("sn76477", SN76477, 0)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team