Previous 15994 Revisions Next

r8486 Tuesday 13th July, 2010 at 12:28:59 UTC by Robbbert
[RX78] Added a crude screen with flashing cursor. Added F4 display.
[src/mess/drivers]rx78.c

src/mess/drivers/rx78.c
r8485r8486
1111
1212static ADDRESS_MAP_START(rx78_mem, ADDRESS_SPACE_PROGRAM, 8)
1313   ADDRESS_MAP_UNMAP_HIGH
14   AM_RANGE(0x0000, 0x1fff) AM_ROM
15   AM_RANGE(0x2000, 0xffff) AM_RAM AM_REGION("maincpu", 0x2000)
1416ADDRESS_MAP_END
1517
1618static ADDRESS_MAP_START( rx78_io , ADDRESS_SPACE_IO, 8)
r8485r8486
1820ADDRESS_MAP_END
1921
2022/* Input ports */
21INPUT_PORTS_START( rx78 )
23static INPUT_PORTS_START( rx78 )
2224INPUT_PORTS_END
2325
2426
r8485r8486
3234
3335static VIDEO_UPDATE( rx78 )
3436{
35    return 0;
37   UINT8 y,ra,chr,gfx;
38   UINT16 sy=0,ma=0xe8be,x;
39   UINT8 *RAM = memory_region(screen->machine, "maincpu");
40
41   for (y = 0; y < 23; y++)
42   {
43      for (ra = 0; ra < 8; ra++)
44      {
45         UINT16  *p = BITMAP_ADDR16(bitmap, sy++, 0);
46
47         for (x = ma; x < ma+30; x++)
48         {
49            chr = RAM[x];
50
51            /* get pattern of pixels for that character scanline */
52            gfx = RAM[0x1a27 + (chr<<3) + ra];
53
54            /* Display a scanline of a character (8 pixels) */
55            *p = ( gfx & 0x01 ) ? 1 : 0; p++;
56            *p = ( gfx & 0x02 ) ? 1 : 0; p++;
57            *p = ( gfx & 0x04 ) ? 1 : 0; p++;
58            *p = ( gfx & 0x08 ) ? 1 : 0; p++;
59            *p = ( gfx & 0x10 ) ? 1 : 0; p++;
60            *p = ( gfx & 0x20 ) ? 1 : 0; p++;
61            *p = ( gfx & 0x40 ) ? 1 : 0; p++;
62            *p = ( gfx & 0x80 ) ? 1 : 0; p++;
63         }
64      }
65      ma+=30;
66   }
67   return 0;
3668}
3769
70/* F4 Character Displayer */
71static const gfx_layout rx78_charlayout =
72{
73   8, 8,               /* 8 x 8 characters */
74   187,               /* 187 characters */
75   1,               /* 1 bits per pixel */
76   { 0 },               /* no bitplanes */
77   /* x offsets */
78   { 7, 6, 5, 4, 3, 2, 1, 0 },
79   /* y offsets */
80   { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
81   8*8               /* every char takes 8 bytes */
82};
83
84static GFXDECODE_START( rx78 )
85   GFXDECODE_ENTRY( "maincpu", 0x1a27, rx78_charlayout, 0, 1 )
86GFXDECODE_END
87
3888static MACHINE_DRIVER_START( rx78 )
3989    /* basic machine hardware */
40    MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz)
90    MDRV_CPU_ADD("maincpu",Z80, XTAL_4MHz)   // 4.1mhz
4191    MDRV_CPU_PROGRAM_MAP(rx78_mem)
4292    MDRV_CPU_IO_MAP(rx78_io)   
4393
r8485r8486
4898    MDRV_SCREEN_REFRESH_RATE(50)
4999    MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
50100    MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
51    MDRV_SCREEN_SIZE(640, 480)
52    MDRV_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
101    MDRV_SCREEN_SIZE(240, 184)
102    MDRV_SCREEN_VISIBLE_AREA(0, 240-1, 0, 184-1)
53103    MDRV_PALETTE_LENGTH(2)
54104    MDRV_PALETTE_INIT(black_and_white)
105   MDRV_GFXDECODE(rx78)
55106
56107    MDRV_VIDEO_START(rx78)
57108    MDRV_VIDEO_UPDATE(rx78)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team