src/mess/video/kim1.c
| r2052 | r2053 | |
| 13 | 13 | |
| 14 | 14 | PALETTE_INIT( kim1 ) |
| 15 | 15 | { |
| 16 | | int i; |
| 16 | int i; |
| 17 | 17 | |
| 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); |
| 26 | 19 | |
| 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); |
| 32 | 43 | } |
| 33 | 44 | |
| 34 | 45 | |
| r2052 | r2053 | |
| 42 | 53 | VIDEO_UPDATE( kim1 ) |
| 43 | 54 | { |
| 44 | 55 | 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} }; |
| 46 | 59 | |
| 47 | 60 | fillbitmap(bitmap, get_black_pen(screen->machine), NULL); |
| 48 | 61 | |
| 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); |
| 53 | 67 | |
| 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 | } |
| 57 | 70 | |
| 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; |
| 61 | 75 | |
| 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 | } |
| 83 | 85 | return 0; |
| 84 | 86 | } |
| 85 | 87 | |
src/mess/drivers/kim1.c
| r2052 | r2053 | |
| 154 | 154 | |
| 155 | 155 | static GFXDECODE_START( kim1 ) |
| 156 | 156 | 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 ) |
| 158 | 158 | GFXDECODE_END |
| 159 | 159 | |
| 160 | 160 | |
| r2052 | r2053 | |
| 175 | 175 | MDRV_SCREEN_SIZE(600, 768) |
| 176 | 176 | MDRV_SCREEN_VISIBLE_AREA(0, 600 - 1, 0, 768 - 1) |
| 177 | 177 | MDRV_GFXDECODE( kim1 ) |
| 178 | | MDRV_PALETTE_LENGTH(32768+21) |
| 178 | MDRV_PALETTE_LENGTH(40) |
| 179 | 179 | MDRV_PALETTE_INIT( kim1 ) |
| 180 | 180 | |
| 181 | 181 | MDRV_VIDEO_START( kim1 ) |
| r2052 | r2053 | |
| 195 | 195 | ROM_LOAD("6530-002.bin", 0x1c00, 0x0400, CRC(2b08e923) SHA1(054f7f6989af3a59462ffb0372b6f56f307b5362)) |
| 196 | 196 | ROM_REGION(128 * 24 * 3,REGION_GFX1,ROMREGION_ERASEFF) |
| 197 | 197 | /* 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) |
| 199 | 199 | /* space filled with key icons by kim1_init_driver */ |
| 200 | 200 | ROM_END |
| 201 | 201 | |