Skip to content

Commit 1780e8f

Browse files
committed
Fix colours in Mode 15 and Mode 31.
1 parent 5c442a1 commit 1780e8f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/vga/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,13 @@ impl RenderEngine {
257257
let line_start = unsafe { base_ptr.add(offset) };
258258
// Get a pointer into our scan-line buffer
259259
let mut scan_line_buffer_ptr = scan_line_buffer.pixel_ptr();
260-
let black_pixel = RGBColour(VIDEO_PALETTE[0].load(Ordering::Relaxed));
261-
let white_pixel = RGBColour(VIDEO_PALETTE[1].load(Ordering::Relaxed));
262260
if is_double {
261+
let white_pixel = RGBColour(
262+
VIDEO_PALETTE[TextForegroundColour::White as usize].load(Ordering::Relaxed),
263+
);
264+
let black_pixel = RGBColour(
265+
VIDEO_PALETTE[TextForegroundColour::Black as usize].load(Ordering::Relaxed),
266+
);
263267
// double-width mode.
264268
// sixteen RGB pixels (eight pairs) per byte
265269
let white_pair = RGBPair::from_pixels(white_pixel, white_pixel);

0 commit comments

Comments
 (0)