src/mess/machine/gamepock.c
| r2016 | r2017 | |
| 129 | 129 | ad = hd44102ch[0].start_page; |
| 130 | 130 | for ( i = 0; i < 4; i++ ) { |
| 131 | 131 | for ( j = 0; j < 50; j++ ) { |
| 132 | | *BITMAP_ADDR16(bitmap, i * 8 + 0, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x01 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 133 | | *BITMAP_ADDR16(bitmap, i * 8 + 1, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x02 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 134 | | *BITMAP_ADDR16(bitmap, i * 8 + 2, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x04 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 135 | | *BITMAP_ADDR16(bitmap, i * 8 + 3, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x08 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 136 | | *BITMAP_ADDR16(bitmap, i * 8 + 4, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x10 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 137 | | *BITMAP_ADDR16(bitmap, i * 8 + 5, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x20 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 138 | | *BITMAP_ADDR16(bitmap, i * 8 + 6, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x40 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 139 | | *BITMAP_ADDR16(bitmap, i * 8 + 7, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x80 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 132 | *BITMAP_ADDR16(bitmap, i * 8 + 0, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x01 ) ? 0 : 1; |
| 133 | *BITMAP_ADDR16(bitmap, i * 8 + 1, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x02 ) ? 0 : 1; |
| 134 | *BITMAP_ADDR16(bitmap, i * 8 + 2, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x04 ) ? 0 : 1; |
| 135 | *BITMAP_ADDR16(bitmap, i * 8 + 3, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x08 ) ? 0 : 1; |
| 136 | *BITMAP_ADDR16(bitmap, i * 8 + 4, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x10 ) ? 0 : 1; |
| 137 | *BITMAP_ADDR16(bitmap, i * 8 + 5, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x20 ) ? 0 : 1; |
| 138 | *BITMAP_ADDR16(bitmap, i * 8 + 6, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x40 ) ? 0 : 1; |
| 139 | *BITMAP_ADDR16(bitmap, i * 8 + 7, 49 - j ) = ( hd44102ch[0].ram[ad+j] & 0x80 ) ? 0 : 1; |
| 140 | 140 | } |
| 141 | 141 | ad += 0x40; |
| 142 | 142 | } |
| r2016 | r2017 | |
| 145 | 145 | ad = hd44102ch[1].start_page; |
| 146 | 146 | for ( i = 4; i < 8; i++ ) { |
| 147 | 147 | for ( j = 0; j < 50; j++ ) { |
| 148 | | *BITMAP_ADDR16(bitmap, i * 8 + 0, j ) = ( hd44102ch[1].ram[ad+j] & 0x01 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 149 | | *BITMAP_ADDR16(bitmap, i * 8 + 1, j ) = ( hd44102ch[1].ram[ad+j] & 0x02 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 150 | | *BITMAP_ADDR16(bitmap, i * 8 + 2, j ) = ( hd44102ch[1].ram[ad+j] & 0x04 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 151 | | *BITMAP_ADDR16(bitmap, i * 8 + 3, j ) = ( hd44102ch[1].ram[ad+j] & 0x08 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 152 | | *BITMAP_ADDR16(bitmap, i * 8 + 4, j ) = ( hd44102ch[1].ram[ad+j] & 0x10 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 153 | | *BITMAP_ADDR16(bitmap, i * 8 + 5, j ) = ( hd44102ch[1].ram[ad+j] & 0x20 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 154 | | *BITMAP_ADDR16(bitmap, i * 8 + 6, j ) = ( hd44102ch[1].ram[ad+j] & 0x40 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 155 | | *BITMAP_ADDR16(bitmap, i * 8 + 7, j ) = ( hd44102ch[1].ram[ad+j] & 0x80 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 148 | *BITMAP_ADDR16(bitmap, i * 8 + 0, j ) = ( hd44102ch[1].ram[ad+j] & 0x01 ) ? 0 : 1; |
| 149 | *BITMAP_ADDR16(bitmap, i * 8 + 1, j ) = ( hd44102ch[1].ram[ad+j] & 0x02 ) ? 0 : 1; |
| 150 | *BITMAP_ADDR16(bitmap, i * 8 + 2, j ) = ( hd44102ch[1].ram[ad+j] & 0x04 ) ? 0 : 1; |
| 151 | *BITMAP_ADDR16(bitmap, i * 8 + 3, j ) = ( hd44102ch[1].ram[ad+j] & 0x08 ) ? 0 : 1; |
| 152 | *BITMAP_ADDR16(bitmap, i * 8 + 4, j ) = ( hd44102ch[1].ram[ad+j] & 0x10 ) ? 0 : 1; |
| 153 | *BITMAP_ADDR16(bitmap, i * 8 + 5, j ) = ( hd44102ch[1].ram[ad+j] & 0x20 ) ? 0 : 1; |
| 154 | *BITMAP_ADDR16(bitmap, i * 8 + 6, j ) = ( hd44102ch[1].ram[ad+j] & 0x40 ) ? 0 : 1; |
| 155 | *BITMAP_ADDR16(bitmap, i * 8 + 7, j ) = ( hd44102ch[1].ram[ad+j] & 0x80 ) ? 0 : 1; |
| 156 | 156 | } |
| 157 | 157 | ad += 0x40; |
| 158 | 158 | } |
| r2016 | r2017 | |
| 161 | 161 | ad = hd44102ch[2].start_page; |
| 162 | 162 | for ( i = 0; i < 4; i++ ) { |
| 163 | 163 | for ( j = 0; j < 25; j++ ) { |
| 164 | | *BITMAP_ADDR16(bitmap, i * 8 + 0, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x01 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 165 | | *BITMAP_ADDR16(bitmap, i * 8 + 1, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x02 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 166 | | *BITMAP_ADDR16(bitmap, i * 8 + 2, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x04 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 167 | | *BITMAP_ADDR16(bitmap, i * 8 + 3, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x08 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 168 | | *BITMAP_ADDR16(bitmap, i * 8 + 4, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x10 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 169 | | *BITMAP_ADDR16(bitmap, i * 8 + 5, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x20 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 170 | | *BITMAP_ADDR16(bitmap, i * 8 + 6, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x40 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 171 | | *BITMAP_ADDR16(bitmap, i * 8 + 7, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x80 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 164 | *BITMAP_ADDR16(bitmap, i * 8 + 0, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x01 ) ? 0 : 1; |
| 165 | *BITMAP_ADDR16(bitmap, i * 8 + 1, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x02 ) ? 0 : 1; |
| 166 | *BITMAP_ADDR16(bitmap, i * 8 + 2, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x04 ) ? 0 : 1; |
| 167 | *BITMAP_ADDR16(bitmap, i * 8 + 3, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x08 ) ? 0 : 1; |
| 168 | *BITMAP_ADDR16(bitmap, i * 8 + 4, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x10 ) ? 0 : 1; |
| 169 | *BITMAP_ADDR16(bitmap, i * 8 + 5, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x20 ) ? 0 : 1; |
| 170 | *BITMAP_ADDR16(bitmap, i * 8 + 6, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x40 ) ? 0 : 1; |
| 171 | *BITMAP_ADDR16(bitmap, i * 8 + 7, 50 + j ) = ( hd44102ch[2].ram[ad+j] & 0x80 ) ? 0 : 1; |
| 172 | 172 | } |
| 173 | 173 | for ( j = 25; j < 50; j++ ) { |
| 174 | | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 0, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x01 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 175 | | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 1, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x02 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 176 | | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 2, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x04 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 177 | | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 3, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x08 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 178 | | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 4, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x10 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 179 | | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 5, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x20 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 180 | | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 6, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x40 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 181 | | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 7, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x80 ) ? screen->machine->pens[0] : screen->machine->pens[1]; |
| 174 | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 0, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x01 ) ? 0 : 1; |
| 175 | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 1, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x02 ) ? 0 : 1; |
| 176 | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 2, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x04 ) ? 0 : 1; |
| 177 | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 3, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x08 ) ? 0 : 1; |
| 178 | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 4, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x10 ) ? 0 : 1; |
| 179 | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 5, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x20 ) ? 0 : 1; |
| 180 | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 6, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x40 ) ? 0 : 1; |
| 181 | *BITMAP_ADDR16(bitmap, 32 + i * 8 + 7, 25 + j ) = ( hd44102ch[2].ram[ad+j] & 0x80 ) ? 0 : 1; |
| 182 | 182 | } |
| 183 | 183 | ad += 0x40; |
| 184 | 184 | } |
src/mess/drivers/apexc.c
| r2016 | r2017 | |
| 491 | 491 | int width = video_screen_get_width(screen); |
| 492 | 492 | int height = video_screen_get_height(screen); |
| 493 | 493 | apexc_bitmap = auto_bitmap_alloc(width, height, BITMAP_FORMAT_INDEXED16); |
| 494 | | fillbitmap(apexc_bitmap, machine->pens[0], &/*machine->visible_area*/teletyper_window); |
| 494 | fillbitmap(apexc_bitmap, 0, &/*machine->visible_area*/teletyper_window); |
| 495 | 495 | } |
| 496 | 496 | |
| 497 | 497 | /* draw a small 8*8 LED (well, there were no LEDs at the time, so let's call this a lamp ;-) ) */ |
| 498 | | static void apexc_draw_led(running_machine *machine, bitmap_t *bitmap, int x, int y, int state) |
| 498 | static void apexc_draw_led(bitmap_t *bitmap, int x, int y, int state) |
| 499 | 499 | { |
| 500 | 500 | int xx, yy; |
| 501 | 501 | |
| 502 | 502 | for (yy=1; yy<7; yy++) |
| 503 | 503 | for (xx=1; xx<7; xx++) |
| 504 | | *BITMAP_ADDR16(bitmap, y+yy, x+xx) = machine->pens[state ? 2 : 3]; |
| 504 | *BITMAP_ADDR16(bitmap, y+yy, x+xx) = state ? 2 : 3; |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | /* write a single char on screen */ |
| r2016 | r2017 | |
| 529 | 529 | int i; |
| 530 | 530 | char the_char; |
| 531 | 531 | |
| 532 | | fillbitmap(bitmap, screen->machine->pens[0], &/*machine->visible_area*/panel_window); |
| 532 | fillbitmap(bitmap, 0, &/*machine->visible_area*/panel_window); |
| 533 | 533 | apexc_draw_string(screen->machine, bitmap, "power", 8, 0, 0); |
| 534 | 534 | apexc_draw_string(screen->machine, bitmap, "running", 8, 8, 0); |
| 535 | 535 | apexc_draw_string(screen->machine, bitmap, "data :", 0, 24, 0); |
| r2016 | r2017 | |
| 537 | 537 | copybitmap(bitmap, apexc_bitmap, 0, 0, 0, 0, &teletyper_window); |
| 538 | 538 | |
| 539 | 539 | |
| 540 | | apexc_draw_led(screen->machine, bitmap, 0, 0, 1); |
| 540 | apexc_draw_led(bitmap, 0, 0, 1); |
| 541 | 541 | |
| 542 | | apexc_draw_led(screen->machine, bitmap, 0, 8, cpunum_get_reg(0, APEXC_STATE)); |
| 542 | apexc_draw_led(bitmap, 0, 8, cpunum_get_reg(0, APEXC_STATE)); |
| 543 | 543 | |
| 544 | 544 | for (i=0; i<32; i++) |
| 545 | 545 | { |
| 546 | | apexc_draw_led(screen->machine, bitmap, i*8, 32, (panel_data_reg << i) & 0x80000000UL); |
| 546 | apexc_draw_led(bitmap, i*8, 32, (panel_data_reg << i) & 0x80000000UL); |
| 547 | 547 | the_char = '0' + ((i + 1) % 10); |
| 548 | 548 | apexc_draw_char(screen->machine, bitmap, the_char, i*8, 40, 0); |
| 549 | 549 | if (((i + 1) % 10) == 0) |
| r2016 | r2017 | |
| 575 | 575 | draw_scanline8(apexc_bitmap, teletyper_window_offset_x, y, teletyper_window_width, buf, machine->pens, -1); |
| 576 | 576 | } |
| 577 | 577 | |
| 578 | | fillbitmap(apexc_bitmap, machine->pens[0], &teletyper_scroll_clear_window); |
| 578 | fillbitmap(apexc_bitmap, 0, &teletyper_scroll_clear_window); |
| 579 | 579 | } |
| 580 | 580 | |
| 581 | 581 | static void apexc_teletyper_putchar(running_machine *machine, int character) |