Previous 15994 Revisions Next

r2053 Saturday 22nd March, 2008 at 04:06:43 UTC by Robbbert
[KIM1] Fixed palette (bug 1536).
[src/mess/drivers]kim1.c
[src/mess/machine]kim1.c
[src/mess/video]kim1.c

src/mess/video/kim1.c
r2052r2053
1313
1414PALETTE_INIT( kim1 )
1515{
16    int i;
16   int i;
1717
18   /* initialize 16 colors with shades of red (orange) */
19    for (i = 0; i < 16; i++)
20    {
21      palette_set_color_rgb(machine, i,
22         24 + (i + 1) * (i + 1) - 1,
23         (i + 1) * (i + 1) / 4,
24         0);
25    }
18   machine->colortable = colortable_alloc(machine, 21);
2619
27   palette_set_color_rgb(machine, 16,   0,   0,   0);
28   palette_set_color_rgb(machine, 17,  30,  30,  30);
29   palette_set_color_rgb(machine, 18,  90,  90,  90);
30   palette_set_color_rgb(machine, 19,  50,  50,  50);
31   palette_set_color_rgb(machine, 20, 255, 255, 255);
20   for (i = 0; i < 16; i++)
21      colortable_palette_set_color(machine->colortable, i, MAKE_RGB(24 + (i + 1) * (i + 1) - 1, (i + 1) * (i + 1) / 4, 0));
22   
23   colortable_palette_set_color(machine->colortable, 16, MAKE_RGB(0, 0, 0));
24   colortable_palette_set_color(machine->colortable, 17, MAKE_RGB(30, 30, 30));
25   colortable_palette_set_color(machine->colortable, 18, MAKE_RGB(90, 90, 90));
26   colortable_palette_set_color(machine->colortable, 19, MAKE_RGB(50, 50, 50));
27   colortable_palette_set_color(machine->colortable, 20, MAKE_RGB(255, 255, 255));
28
29   for (i = 0; i < 16; i++)
30   {
31      colortable_entry_set_value(machine->colortable, i*2, 1);
32      colortable_entry_set_value(machine->colortable, i*2+1, i);
33   }
34
35   colortable_entry_set_value(machine->colortable, 32, 17);
36   colortable_entry_set_value(machine->colortable, 33, 18);
37   colortable_entry_set_value(machine->colortable, 34, 19);
38   colortable_entry_set_value(machine->colortable, 35, 20);
39   colortable_entry_set_value(machine->colortable, 36, 17);
40   colortable_entry_set_value(machine->colortable, 37, 17);
41   colortable_entry_set_value(machine->colortable, 38, 19);
42   colortable_entry_set_value(machine->colortable, 39, 15);
3243}
3344
3445
r2052r2053
4253VIDEO_UPDATE( kim1 )
4354{
4455   int width = video_screen_get_width(screen);
45    int x, y;
56   int x, y;
57   static const int layout[6][4] = { {19, 21, 22, 23}, {16, 17, 20, 18}, {12, 13, 14, 15},
58               { 8,  9, 10, 11}, { 4,  5,  6,  7}, { 0,  1,  2,  3} };
4659
4760   fillbitmap(bitmap, get_black_pen(screen->machine), NULL);
4861
49    for (x = 0; x < 6; x++)
50    {
51        int sy = 408;
52        int sx = width - 212 + x * 30 + ((x >= 4) ? 6 : 0);
62   /* show leds */
63   for (x = 0; x < 6; x++)
64   {
65      int sy = 408;
66      int sx = width - 212 + x * 30 + ((x >= 4) ? 6 : 0);
5367
54      drawgfx (bitmap, screen->machine->gfx[0], videoram[2 * x + 0], videoram[2 * x + 1],
55         0, 0, sx, sy, NULL, TRANSPARENCY_PEN, 0);
56    }
68      drawgfx (bitmap, screen->machine->gfx[0], videoram[x<<1], videoram[(x<<1) + 1],   0, 0, sx, sy, NULL, TRANSPARENCY_PEN, 0);
69   }
5770
58    for (y = 0; y < 6; y++)
59    {
60        int sy = 516 + y * 36;
71   /* show buttons */
72   for (y = 0; y < 6; y++)
73   {
74      int sy = 516 + y * 36;
6175
62        for (x = 0; x < 4; x++)
63        {
64            static const int layout[6][4] =
65            {
66                {22, 19, 21, 23},
67                {16, 17, 20, 18},
68                {12, 13, 14, 15},
69            { 8,  9, 10, 11},
70            { 4,  5,  6,  7},
71            { 0,  1,  2,  3}
72            };
73            int sx = width - 182 + x * 37;
74            int color, code = layout[y][x];
75
76            color = (readinputport (code / 7) & (0x40 >> (code % 7))) ? 0 : 1;
77
78            videoram[6 * 2 + code] = color;
79         drawgfx (bitmap, screen->machine->gfx[1], layout[y][x], color,
80            0, 0, sx, sy, NULL, TRANSPARENCY_NONE, 0);
81        }
82    }
76      for (x = 0; x < 4; x++)
77      {
78         int sx = width - 182 + x * 37;
79         int code = layout[y][x];
80         int color = (readinputport (code / 7) & (0x40 >> (code % 7))) ? 0 : 1;
81         videoram[6 * 2 + code] = color;
82         drawgfx (bitmap, screen->machine->gfx[1], layout[y][x], color, 0, 0, sx, sy, NULL, TRANSPARENCY_NONE, 0);
83      }
84   }
8385   return 0;
8486}
8587
src/mess/machine/kim1.c
r2052r2053
567567      }
568568   }
569569
570   dst = memory_region(2);
571   memset(dst, 0, 24 * 18 * 24 / 8);
570   dst = memory_region(REGION_GFX2);
571   memset(dst, 0, memory_region_length(REGION_GFX2));
572572   for (i = 0; i < 24; i++)
573573   {
574574      for (y = 0; y < 18; y++)
src/mess/drivers/kim1.c
r2052r2053
154154
155155static GFXDECODE_START( kim1 )
156156   GFXDECODE_ENTRY( REGION_GFX1, 0, led_layout, 0, 16 )
157   GFXDECODE_ENTRY( REGION_GFX2, 0, key_layout, 16*2, 2 )
157   GFXDECODE_ENTRY( REGION_GFX2, 0, key_layout, 34, 2 )
158158GFXDECODE_END
159159
160160
r2052r2053
175175   MDRV_SCREEN_SIZE(600, 768)
176176   MDRV_SCREEN_VISIBLE_AREA(0, 600 - 1, 0, 768 - 1)
177177   MDRV_GFXDECODE( kim1 )
178   MDRV_PALETTE_LENGTH(32768+21)
178   MDRV_PALETTE_LENGTH(40)
179179   MDRV_PALETTE_INIT( kim1 )
180180
181181   MDRV_VIDEO_START( kim1 )
r2052r2053
195195      ROM_LOAD("6530-002.bin",    0x1c00, 0x0400, CRC(2b08e923) SHA1(054f7f6989af3a59462ffb0372b6f56f307b5362))
196196   ROM_REGION(128 * 24 * 3,REGION_GFX1,ROMREGION_ERASEFF)
197197      /* space filled with 7segement graphics by kim1_init_driver */
198   ROM_REGION( 24 * 18 * 3 * 2,REGION_GFX2,ROMREGION_ERASEFF)
198   ROM_REGION( 24 * 18 * 3 * 2,REGION_GFX2, ROMREGION_ERASEFF)
199199      /* space filled with key icons by kim1_init_driver */
200200ROM_END
201201

Previous 15994 Revisions Next


© 1998-2018 The MESS Team