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},
46 {5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,0,0,0,0},
47 {5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,0,0,0,0},
48 {5,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,0,0,0,0},
49 {5,5,5,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,3,3,3,0,0,0,0,0},
50 {5,5,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,3,3,0,8,8,8,0},
51 {0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,8,8,8,8,8},
52 {0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,8,8,8,0},
55 void DISPLAY::initialize()
57 memset(seg, 0, sizeof(seg));
61 register_vline_event(this);
64 void DISPLAY::event_vline(int v, int clock)
67 memset(seg, 0, sizeof(seg));
76 for(int i = 0; i < 8; i++) {
78 seg[(pc >> 4) & 7][i]++;
85 void DISPLAY::write_signal(int id, uint32 data, uint32 mask)
87 if(id == SIG_DISPLAY_PORT_B) {
89 } else if(id == SIG_DISPLAY_PORT_C) {
94 void DISPLAY::draw_screen()
97 scrntype col_h, col_l;
100 col_h = RGB_COLOR(255, 0, 0);
101 col_l = RGB_COLOR(107, 0, 0);
102 col[0] = RGB_COLOR(38, 8, 0);
104 for(int i = 0; i < 6; i++) {
105 for(int j = 0; j < 8; j++) {
106 col[j + 1] = (seg[i][j] > 8) ? col_h : col_l;
108 for(int y = 0; y < 40; y++) {
109 scrntype* dest = emu->screen_buffer(ranges[i].y + y) + ranges[i].x;
110 for(int x = 0; x < 28; x++) {
111 dest[x] = col[pat_7seg_led[y][x]];