Ejemplo n.º 1
0
void VL_MemToLatch(
    const Uint8* source,
    int width,
    int height,
    int dest)
{
    int dst_pitch = vga_scale * width;
    int base_offset = vl_get_offset(dest);

    for (int p = 0; p < 4; ++p) {
        for (int h = 0; h < height; ++h) {
            for (int w = p; w < width; w += 4) {
                Uint8 pixel = *source++;

                int offset = base_offset +
                    vga_scale * ((vga_scale * h * width) + w);

                for (int s = 0; s < vga_scale; ++s) {
                    std::uninitialized_fill_n(
                        &vga_memory[offset], vga_scale, pixel);

                    offset += dst_pitch;
                }
            }
        }
    }
}
Ejemplo n.º 2
0
Uint8 vl_get_pixel(
    int base_offset,
    int x,
    int y)
{
    return vga_memory[vl_get_offset(base_offset, x, y)];
}
Ejemplo n.º 3
0
void JM_VGALinearFill(
    int start,
    int length,
    Uint8 fill)
{
    std::uninitialized_fill_n(
        &vga_memory[vl_get_offset(start)],
        vga_scale * vga_scale * 4 * length,
        fill);
}
Ejemplo n.º 4
0
void R_DrawSLSColumn()
{
    int base_offset = vl_get_offset(bufferofs) + dc_x;

    for (int i = 0; i < dc_length; ++i) {
        int offset = base_offset + ((dc_y + dc_dy + i) * vga_width);
        Uint8 pixel_index = vga_memory[offset];
        Uint8 pixel = shadingtable[0x1000 | pixel_index];
        vga_memory[offset] = pixel;
    }
}
Ejemplo n.º 5
0
void VL_LatchToScreen(
    int source,
    int width,
    int height,
    int x,
    int y)
{
    int src_pitch = vga_scale * 4 * width;
    int src_offset = vl_get_offset(source);
    int dst_offset = vl_get_offset(bufferofs, x, y);

    for (int h = 0; h < height; ++h) {
        for (int s = 0; s < vga_scale; ++s) {
            std::uninitialized_copy(
                &vga_memory[src_offset],
                &vga_memory[src_offset + src_pitch],
                &vga_memory[dst_offset]);

            src_offset += src_pitch;
            dst_offset += vga_width;
        }
    }
}
Ejemplo n.º 6
0
void VL_Plot(
    int x,
    int y,
    Uint8 color)
{
    int offset = vl_get_offset(bufferofs, x, y);

    for (int i = 0; i < vga_scale; ++i) {
        std::uninitialized_fill_n(
            &vga_memory[offset], vga_scale, color);

        offset += vga_width;
    }
}
Ejemplo n.º 7
0
static void generic_draw_column(DrawMode draw_mode)
{
    int fraction = dc_frac;

    Uint8* source = dc_seg + dc_source;
    int base_offset = vl_get_offset(bufferofs) + dc_x;

    for (int i = 0; i < dc_length; ++i) {
        Uint8 pixel;
        Uint8 pixel_index = source[fraction >> 16];

        if (draw_mode == DRAW_LIGHTED)
            pixel = shadingtable[pixel_index];
        else
            pixel = pixel_index;

        int offset = base_offset + ((dc_y + dc_dy + i) * vga_width);
        vga_memory[offset] = pixel;

        fraction += dc_iscale;
    }
}
Ejemplo n.º 8
0
void VL_Bar(
    int x,
    int y,
    int width,
    int height,
    Uint8 color)
{
    width *= vga_scale;
    height *= vga_scale;

    int offset = vl_get_offset(bufferofs, x, y);

    if (x == 0 && width == vga_width) {
        int count = height * vga_width;
        std::uninitialized_fill_n(&vga_memory[offset], count, color);
    } else {
        for (int i = 0; i < height; ++i) {
            std::uninitialized_fill_n(&vga_memory[offset], width, color);
            offset += vga_width;
        }
    }
}