Lines Matching +full:1 +full:kb

10  * 1. Redistributions of source code must retain the above copyright
46 #define KB (1024UL) macro
200 sc->gc_width = (sc->vga_crtc.crtc_horiz_disp_end + 1) * in vga_check_size()
205 (((sc->vga_crtc.crtc_overflow & CRTC_OF_VDE9) >> CRTC_OF_VDE9_SHIFT) << 9)) + 1; in vga_check_size()
222 data = (((sc->vga_ram[offset + 0 * 64*KB] >> bit) & 0x1) << 0) | in vga_get_pixel()
223 (((sc->vga_ram[offset + 1 * 64*KB] >> bit) & 0x1) << 1) | in vga_get_pixel()
224 (((sc->vga_ram[offset + 2 * 64*KB] >> bit) & 0x1) << 2) | in vga_get_pixel()
225 (((sc->vga_ram[offset + 3 * 64*KB] >> bit) & 0x1) << 3); in vga_get_pixel()
269 ch = sc->vga_ram[offset + 0 * 64*KB]; in vga_get_text_pixel()
270 attr = sc->vga_ram[offset + 1 * 64*KB]; in vga_get_text_pixel()
293 font = sc->vga_ram[font_offset + 2 * 64*KB]; in vga_get_text_pixel()
295 if (font & (1 << bit)) in vga_get_text_pixel()
352 offset &= (128 * KB - 1); in vga_mem_rd_handler()
359 offset &= (64 * KB - 1); in vga_mem_rd_handler()
363 * monochrome text mode: base 0xb0000 size 32kb in vga_mem_rd_handler()
368 * color text mode and CGA: base 0xb8000 size 32kb in vga_mem_rd_handler()
371 offset &= (32 * KB - 1); in vga_mem_rd_handler()
376 sc->vga_gc.gc_latch0 = sc->vga_ram[offset + 0*64*KB]; in vga_mem_rd_handler()
377 sc->vga_gc.gc_latch1 = sc->vga_ram[offset + 1*64*KB]; in vga_mem_rd_handler()
378 sc->vga_gc.gc_latch2 = sc->vga_ram[offset + 2*64*KB]; in vga_mem_rd_handler()
379 sc->vga_gc.gc_latch3 = sc->vga_ram[offset + 3*64*KB]; in vga_mem_rd_handler()
382 /* read mode 1 */ in vga_mem_rd_handler()
388 map_sel |= (offset & 1); in vga_mem_rd_handler()
389 offset &= ~1; in vga_mem_rd_handler()
393 offset += map_sel * 64*KB; in vga_mem_rd_handler()
413 * extended mode: base 0xa0000 size 128kb in vga_mem_wr_handler()
416 offset &= (128 * KB - 1); in vga_mem_wr_handler()
420 * EGA/VGA mode: base 0xa0000 size 64kb in vga_mem_wr_handler()
423 offset &= (64 * KB - 1); in vga_mem_wr_handler()
427 * monochrome text mode: base 0xb0000 size 32kb in vga_mem_wr_handler()
432 * color text mode and CGA: base 0xb8000 size 32kb in vga_mem_wr_handler()
435 offset &= (32 * KB - 1); in vga_mem_wr_handler()
457 m0 = (set_reset & 1) ? mask : 0x00; in vga_mem_wr_handler()
462 c0 = (enb_set_reset & 1) ? (c0 & ~mask) : (val & mask); in vga_mem_wr_handler()
473 m0 = set_reset & 1 ? 0xff : ~mask; in vga_mem_wr_handler()
478 c0 = enb_set_reset & 1 ? c0 & m0 : val & m0; in vga_mem_wr_handler()
484 m0 = set_reset & 1 ? mask : 0x00; in vga_mem_wr_handler()
489 c0 = enb_set_reset & 1 ? c0 | m0 : val | m0; in vga_mem_wr_handler()
495 m0 = set_reset & 1 ? mask : 0x00; in vga_mem_wr_handler()
500 c0 = enb_set_reset & 1 ? c0 ^ m0 : val ^ m0; in vga_mem_wr_handler()
507 case 1: in vga_mem_wr_handler()
508 /* write mode 1 */ in vga_mem_wr_handler()
516 m0 = (val & 1 ? 0xff : 0x00) & mask; in vga_mem_wr_handler()
532 m0 = (val & 1 ? 0xff : 0x00) | ~mask; in vga_mem_wr_handler()
543 m0 = (val & 1 ? 0xff : 0x00) & mask; in vga_mem_wr_handler()
554 m0 = (val & 1 ? 0xff : 0x00) & mask; in vga_mem_wr_handler()
575 m0 = (set_reset & 1 ? 0xff : 0x00) & mask; in vga_mem_wr_handler()
591 m0 = (set_reset & 1 ? 0xff : 0x00) | ~mask; in vga_mem_wr_handler()
602 m0 = (set_reset & 1 ? 0xff : 0x00) & mask; in vga_mem_wr_handler()
613 m0 = (set_reset & 1 ? 0xff : 0x00) & mask; in vga_mem_wr_handler()
628 if (offset & 1) { in vga_mem_wr_handler()
629 offset &= ~1; in vga_mem_wr_handler()
631 sc->vga_ram[offset + 1*64*KB] = c1; in vga_mem_wr_handler()
633 sc->vga_ram[offset + 3*64*KB] = c3; in vga_mem_wr_handler()
635 if (sc->vga_seq.seq_map_mask & 1) in vga_mem_wr_handler()
636 sc->vga_ram[offset + 0*64*KB] = c0; in vga_mem_wr_handler()
638 sc->vga_ram[offset + 2*64*KB] = c2; in vga_mem_wr_handler()
641 if (sc->vga_seq.seq_map_mask & 1) in vga_mem_wr_handler()
642 sc->vga_ram[offset + 0*64*KB] = c0; in vga_mem_wr_handler()
644 sc->vga_ram[offset + 1*64*KB] = c1; in vga_mem_wr_handler()
646 sc->vga_ram[offset + 2*64*KB] = c2; in vga_mem_wr_handler()
648 sc->vga_ram[offset + 3*64*KB] = c3; in vga_mem_wr_handler()
658 case 1: in vga_mem_handler()
663 vga_mem_wr_handler(addr + 1, *val >> 8, arg1); in vga_mem_handler()
667 vga_mem_wr_handler(addr + 1, *val >> 8, arg1); in vga_mem_handler()
673 vga_mem_wr_handler(addr + 1, *val >> 8, arg1); in vga_mem_handler()
684 case 1: in vga_mem_handler()
689 *val |= vga_mem_rd_handler(addr + 1, arg1) << 8; in vga_mem_handler()
693 *val |= vga_mem_rd_handler(addr + 1, arg1) << 8; in vga_mem_handler()
699 *val |= vga_mem_rd_handler(addr + 1, arg1) << 8; in vga_mem_handler()
924 // OpenBSD calls this with bytes = 1 in vga_port_in_handler()
934 return (-1); in vga_port_in_handler()
1079 sc->vga_atc.atc_flipflop ^= 1; in vga_port_out_handler()
1101 …val & SEQ_CMS_SA) >> SEQ_CMS_SA_SHIFT) * 2) + ((val & SEQ_CMS_SAH) >> SEQ_CMS_SAH_SHIFT)) * 8 * KB; in vga_port_out_handler()
1102 …val & SEQ_CMS_SB) >> SEQ_CMS_SB_SHIFT) * 2) + ((val & SEQ_CMS_SBH) >> SEQ_CMS_SBH_SHIFT)) * 8 * KB; in vga_port_out_handler()
1132 ((sc->vga_dac.dac_palette[3*sc->vga_dac.dac_wr_index + 0] & 0x1) << 1) | in vga_port_out_handler()
1134 (((sc->vga_dac.dac_palette[3*sc->vga_dac.dac_wr_index + 1] << 2) | in vga_port_out_handler()
1135 ((sc->vga_dac.dac_palette[3*sc->vga_dac.dac_wr_index + 1] & 0x1) << 1) | in vga_port_out_handler()
1136 (sc->vga_dac.dac_palette[3*sc->vga_dac.dac_wr_index + 1] & 0x1)) << 8) | in vga_port_out_handler()
1138 ((sc->vga_dac.dac_palette[3*sc->vga_dac.dac_wr_index + 2] & 0x1) << 1) | in vga_port_out_handler()
1175 sc->gc_image->vgamode = 1; in vga_port_out_handler()
1208 return (-1); in vga_port_out_handler()
1221 case 1: in vga_port_handler()
1224 error = vga_port_in_handler(ctx, in, port, 1, in vga_port_handler()
1231 error = vga_port_out_handler(ctx, in, port, 1, in vga_port_handler()
1238 error = vga_port_in_handler(ctx, in, port, 1, in vga_port_handler()
1243 error = vga_port_in_handler(ctx, in, port + 1, 1, in vga_port_handler()
1250 error = vga_port_out_handler(ctx, in, port, 1, in vga_port_handler()
1253 error =vga_port_out_handler(ctx, in, port + 1, 1, in vga_port_handler()
1259 return (-1); in vga_port_handler()
1272 sc = calloc(1, sizeof(struct vga_softc)); in vga_init()
1278 iop.size = 1; in vga_init()
1295 sc->mr.base = 640 * KB; in vga_init()
1296 sc->mr.size = 128 * KB; in vga_init()
1302 sc->vga_ram = malloc(256 * KB); in vga_init()
1303 memset(sc->vga_ram, 0, 256 * KB); in vga_init()
1318 ((sc->vga_dac.dac_palette[3*i + 0] & 0x1) << 1) | in vga_init()
1320 (((sc->vga_dac.dac_palette[3*i + 1] << 2) | in vga_init()
1321 ((sc->vga_dac.dac_palette[3*i + 1] & 0x1) << 1) | in vga_init()
1322 (sc->vga_dac.dac_palette[3*i + 1] & 0x1)) << 8) | in vga_init()
1324 ((sc->vga_dac.dac_palette[3*i + 2] & 0x1) << 1) | in vga_init()