Previous 15994 Revisions Next

r9696 Tuesday 30th November, 2010 at 11:21:15 UTC by Robbbert
[VTA2000] Added rudimentary video driver. Added F4 display.
[src/mess/drivers]vta2000.c

src/mess/drivers/vta2000.c
r9695r9696
1919   vta2000_state(running_machine &machine, const driver_device_config_base &config)
2020      : driver_device(machine, config) { }
2121
22   const UINT8 *FNT;
23   const UINT8 *videoram;
2224};
2325
2426static ADDRESS_MAP_START(vta2000_mem, ADDRESS_SPACE_PROGRAM, 8)
2527   ADDRESS_MAP_UNMAP_HIGH
26    AM_RANGE( 0x0000, 0x5fff ) AM_ROM
27    AM_RANGE( 0x6000, 0xffff ) AM_RAM
28   AM_RANGE( 0x0000, 0x5fff ) AM_ROM
29   AM_RANGE( 0x8000, 0xffff ) AM_RAM AM_REGION("maincpu", 0x8000)
2830ADDRESS_MAP_END
2931
30static ADDRESS_MAP_START( vta2000_io , ADDRESS_SPACE_IO, 8)
32static ADDRESS_MAP_START(vta2000_io, ADDRESS_SPACE_IO, 8)
3133   ADDRESS_MAP_UNMAP_HIGH
3234ADDRESS_MAP_END
3335
3436/* Input ports */
35INPUT_PORTS_START( vta2000 )
37static INPUT_PORTS_START( vta2000 )
3638INPUT_PORTS_END
3739
3840
r9695r9696
4244
4345static VIDEO_START( vta2000 )
4446{
47   vta2000_state *state = machine->driver_data<vta2000_state>();
48   state->FNT = memory_region(machine, "chargen");
49   state->videoram = memory_region(machine, "maincpu")+0x80a0;
4550}
4651
4752static VIDEO_UPDATE( vta2000 )
53/* Video is 80A0 to B21F, this resolves to 48 lines of 132 character pairs.
54There should therefore be hardware scroll registers, for down and sideways.
55Each character pair consists of a data byte followed by an attribute.
56
57Here we just show the first 80x25, with no scrolling. */
4858{
49    return 0;
59   vta2000_state *state = screen->machine->driver_data<vta2000_state>();
60   //static UINT8 framecnt=0;
61   UINT8 y,ra,gfx,attr;
62   UINT16 sy=0,ma=0,x,xx=0,chr;
63
64   //framecnt++;
65
66   //ma = (scroll-down * 132) + scroll-sideways;
67
68   for (y = 0; y < 25; y++)
69   {
70      for (ra = 0; ra < 12; ra++)
71      {
72         UINT16  *p = BITMAP_ADDR16(bitmap, sy++, 0);
73
74         xx = ma << 1;
75         for (x = ma; x < ma + 80; x++)
76         {
77            chr = state->videoram[xx++];
78            attr = state->videoram[xx++];
79
80            if ((chr & 0x60)==0x60)
81               chr+=256;
82
83            gfx = state->FNT[(chr<<4) | ra ];
84
85            /* Display a scanline of a character */
86            *p++ = ( gfx & 0x80 ) ? 1 : 0;
87            *p++ = ( gfx & 0x40 ) ? 1 : 0;
88            *p++ = ( gfx & 0x20 ) ? 1 : 0;
89            *p++ = ( gfx & 0x10 ) ? 1 : 0;
90            *p++ = ( gfx & 0x08 ) ? 1 : 0;
91            *p++ = ( gfx & 0x04 ) ? 1 : 0;
92            *p++ = ( gfx & 0x02 ) ? 1 : 0;
93            *p++ = ( gfx & 0x01 ) ? 1 : 0;
94         }
95      }
96      ma+=132;
97   }
98   return 0;
5099}
51100
101
102/* F4 Character Displayer */
103static const gfx_layout vta2000_charlayout =
104{
105   8, 16,               /* 8 x 16 characters */
106   512,               /* 128 characters */
107   1,               /* 1 bits per pixel */
108   { 0 },               /* no bitplanes */
109   /* x offsets */
110   { 0, 1, 2, 3, 4, 5, 6, 7 },
111   /* y offsets */
112   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 },
113   8*16               /* every char takes 16 bytes */
114};
115
116static GFXDECODE_START( vta2000 )
117   GFXDECODE_ENTRY( "chargen", 0x0000, vta2000_charlayout, 0, 1 )
118GFXDECODE_END
119
52120static MACHINE_CONFIG_START( vta2000, vta2000_state )
53    /* basic machine hardware */
54    MDRV_CPU_ADD("maincpu",I8080, XTAL_4MHz / 4)
55    MDRV_CPU_PROGRAM_MAP(vta2000_mem)
56    MDRV_CPU_IO_MAP(vta2000_io)   
121   /* basic machine hardware */
122   MDRV_CPU_ADD("maincpu",I8080, XTAL_4MHz / 4)
123   MDRV_CPU_PROGRAM_MAP(vta2000_mem)
124   MDRV_CPU_IO_MAP(vta2000_io)   
57125
58    MDRV_MACHINE_RESET(vta2000)
126   MDRV_MACHINE_RESET(vta2000)
59127   
60    /* video hardware */
61    MDRV_SCREEN_ADD("screen", RASTER)
62    MDRV_SCREEN_REFRESH_RATE(50)
63    MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
64    MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
65    MDRV_SCREEN_SIZE(640, 480)
66    MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
67    MDRV_PALETTE_LENGTH(2)
68    MDRV_PALETTE_INIT(black_and_white)
128   /* video hardware */
129   MDRV_SCREEN_ADD("screen", RASTER)
130   MDRV_SCREEN_REFRESH_RATE(50)
131   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
132   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
133   MDRV_SCREEN_SIZE(80*8, 25*12)
134   MDRV_SCREEN_VISIBLE_AREA(0, 80*8-1, 0, 25*12-1)
135   MDRV_PALETTE_LENGTH(2)
136   MDRV_PALETTE_INIT(black_and_white)
137   MDRV_GFXDECODE(vta2000)
69138
70    MDRV_VIDEO_START(vta2000)
71    MDRV_VIDEO_UPDATE(vta2000)
139   MDRV_VIDEO_START(vta2000)
140   MDRV_VIDEO_UPDATE(vta2000)
72141MACHINE_CONFIG_END
73142
74143
75144/* ROM definition */
76145ROM_START( vta2000 )
77    ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
78   ROM_LOAD( "bdp-15_11.rom", 0x4000, 0x2000, CRC(d4abe3e9) SHA1(ab1973306e263b0f66f2e1ede50cb5230f8d69d5))
79   ROM_LOAD( "bdp-15_12.rom", 0x2000, 0x2000, CRC(4a5fe332) SHA1(f1401c26687236184fec0558cc890e796d7d5c77))
80   ROM_LOAD( "bdp-15_13.rom", 0x0000, 0x2000, CRC(b6b89d90) SHA1(0356d7ba77013b8a79986689fb22ef4107ef885b))
81   ROM_REGION(0x2000, "gfx1",0)
82   ROM_LOAD( "bdp-15_14.rom", 0x0000, 0x2000, CRC(a1dc4f8e) SHA1(873fd211f44713b713d73163de2d8b5db83d2143))
146   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
147   ROM_LOAD( "bdp-15_11.rom", 0x4000, 0x2000, CRC(d4abe3e9) SHA1(ab1973306e263b0f66f2e1ede50cb5230f8d69d5) )
148   ROM_LOAD( "bdp-15_12.rom", 0x2000, 0x2000, CRC(4a5fe332) SHA1(f1401c26687236184fec0558cc890e796d7d5c77) )
149   ROM_LOAD( "bdp-15_13.rom", 0x0000, 0x2000, CRC(b6b89d90) SHA1(0356d7ba77013b8a79986689fb22ef4107ef885b) )
150
151   ROM_REGION(0x2000, "chargen", ROMREGION_INVERT )
152   ROM_LOAD( "bdp-15_14.rom", 0x0000, 0x2000, CRC(a1dc4f8e) SHA1(873fd211f44713b713d73163de2d8b5db83d2143) )
83153ROM_END
84154
85155/* Driver */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team