Previous 15994 Revisions Next

r9573 Saturday 13th November, 2010 at 23:44:21 UTC by Robbbert
[C10] Added rudimentary video driver.
[src/mess/drivers]c10.c

src/mess/drivers/c10.c
r9572r9573
44
55        30/08/2010 Skeleton driver
66
7        Driver currently gets to a loop where it waits for an interrupt.
8        The interrupt routine presumably writes to FE69 which the loop is
9        constantly looking at.
10
711****************************************************************************/
812
913#include "emu.h"
1014#include "cpu/z80/z80.h"
1115
12static UINT8 *c10_ram;
16static const UINT8 *FNT;
17static const UINT8 *videoram;
1318
1419static ADDRESS_MAP_START(c10_mem, ADDRESS_SPACE_PROGRAM, 8)
1520   ADDRESS_MAP_UNMAP_HIGH
16   AM_RANGE(0x0000, 0xffff) AM_RAM AM_BASE(&c10_ram)
21   AM_RANGE(0x0000, 0x0fff) AM_RAMBANK("boot")
22   AM_RANGE(0x1000, 0x7fff) AM_RAM
23   AM_RANGE(0x8000, 0xbfff) AM_ROM
24   AM_RANGE(0xc000, 0xffff) AM_RAM AM_REGION("maincpu", 0xc000)
1725ADDRESS_MAP_END
1826
1927static ADDRESS_MAP_START( c10_io, ADDRESS_SPACE_IO, 8 )
r9572r9573
2432static INPUT_PORTS_START( c10 )
2533INPUT_PORTS_END
2634
35/* after the first 4 bytes have been read from ROM, switch the ram back in */
36static TIMER_CALLBACK( c10_reset )
37{
38   memory_set_bank(machine, "boot", 0);
39}
40
2741static MACHINE_RESET(c10)
2842{
29   UINT8* bios = memory_region(machine, "maincpu");
30
31   memcpy(c10_ram,bios, 0x4000);
32   memcpy(c10_ram+0x8000,bios, 0x4000);
43   memory_set_bank(machine, "boot", 1);
44   timer_set(machine, ATTOTIME_IN_USEC(4), NULL, 0, c10_reset);
3345}
3446
3547static VIDEO_START( c10 )
3648{
49   FNT = memory_region(machine, "chargen");
50   videoram = memory_region(machine, "maincpu")+0xf0a2;
3751}
3852
53/* This system appears to have inline attribute bytes of unknown meaning.
54    Currently they are ignored. The word at FAB5 looks like it might be cursor location. */
3955static VIDEO_UPDATE( c10 )
4056{
57   //static UINT8 framecnt=0;
58   UINT8 y,ra,chr,gfx;
59   UINT16 sy=0,ma=0,x,xx;
60
61   //framecnt++;
62
63   for (y = 0; y < 25; y++)
64   {
65      for (ra = 0; ra < 10; ra++)
66      {
67         UINT16  *p = BITMAP_ADDR16(bitmap, sy++, 0);
68
69         xx = ma;
70         for (x = ma; x < ma + 80; x++)
71         {
72            gfx = 0;
73            if (ra < 9)
74            {
75               chr = videoram[xx++];
76
77            //   /* Take care of flashing characters */
78            //   if ((chr < 0x80) && (framecnt & 0x08))
79            //      chr |= 0x80;
80
81               if (chr & 0x80)  // ignore attribute bytes
82                  x--;
83               else
84               {
85                  gfx = FNT[(chr<<4) | ra ];
86
87                  /* Display a scanline of a character */
88                  *p = ( gfx & 0x80 ) ? 1 : 0; p++;
89                  *p = ( gfx & 0x40 ) ? 1 : 0; p++;
90                  *p = ( gfx & 0x20 ) ? 1 : 0; p++;
91                  *p = ( gfx & 0x10 ) ? 1 : 0; p++;
92                  *p = ( gfx & 0x08 ) ? 1 : 0; p++;
93                  *p = ( gfx & 0x04 ) ? 1 : 0; p++;
94                  *p = ( gfx & 0x02 ) ? 1 : 0; p++;
95                  *p = ( gfx & 0x01 ) ? 1 : 0; p++;
96               }
97            }
98         }
99      }
100      ma+=96;
101   }
41102   return 0;
42103}
43104
r9572r9573
73134   MDRV_SCREEN_REFRESH_RATE(60)
74135   MDRV_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */
75136   MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
76   MDRV_SCREEN_SIZE(256, 192) /* border size not accurate */
77   MDRV_SCREEN_VISIBLE_AREA(0, 256 - 1, 0, 192 - 1)
137   MDRV_SCREEN_SIZE(640, 250)
138   MDRV_SCREEN_VISIBLE_AREA(0, 639, 0, 249)
78139   MDRV_GFXDECODE(c10)
79140
80141   MDRV_PALETTE_LENGTH(2)
r9572r9573
84145   MDRV_VIDEO_UPDATE(c10)
85146MACHINE_CONFIG_END
86147
148DRIVER_INIT( c10 )
149{
150   UINT8 *RAM = memory_region(machine, "maincpu");
151   memory_configure_bank(machine, "boot", 0, 2, &RAM[0x0000], 0x8000);
152}
87153
88154/* ROM definition */
89155ROM_START( c10 )
90156   ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF )
91   ROM_LOAD( "c10_cros.bin", 0x0000, 0x4000, CRC(2ccf5983) SHA1(52f7c497f5284bf5df9eb0d6e9142bb1869d8c24))
157   ROM_LOAD( "c10_cros.bin", 0x8000, 0x4000, CRC(2ccf5983) SHA1(52f7c497f5284bf5df9eb0d6e9142bb1869d8c24))
92158   ROM_REGION( 0x2000, "chargen", 0 )
93159   ROM_LOAD( "c10_char.bin", 0x0000, 0x2000, CRC(cb530b6f) SHA1(95590bbb433db9c4317f535723b29516b9b9fcbf))
94160ROM_END
r9572r9573
96162/* Driver */
97163
98164/*   YEAR  NAME    PARENT  COMPAT   MACHINE  INPUT  INIT        COMPANY   FULLNAME       FLAGS */
99COMP( 1982, c10,  0,       0,   c10,   c10,    0,      "Cromemco",   "C-10",      GAME_NOT_WORKING | GAME_NO_SOUND)
165COMP( 1982, c10,  0,       0,   c10,   c10,    c10,      "Cromemco",   "C-10",      GAME_NOT_WORKING | GAME_NO_SOUND)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team