From d15bb0c4fa9a89576d8cacc544e713346535555f Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sun, 26 Feb 2023 20:00:18 +0100 Subject: [PATCH] [Platform] [PC-98] Graphics GDC initialization I've copy-pasted this snippet so many times, it's time it gets a proper home. Part of P0232, funded by [Anonymous]. --- platform/x86real/pc98/graph.cpp | 18 ++++++++++++++++++ platform/x86real/pc98/graph.hpp | 5 +++++ 2 files changed, 23 insertions(+) create mode 100644 platform/x86real/pc98/graph.cpp create mode 100644 platform/x86real/pc98/graph.hpp diff --git a/platform/x86real/pc98/graph.cpp b/platform/x86real/pc98/graph.cpp new file mode 100644 index 00000000..c56589c9 --- /dev/null +++ b/platform/x86real/pc98/graph.cpp @@ -0,0 +1,18 @@ +#include "platform.h" +#include "x86real.h" +#include "platform/x86real/pc98/graph.hpp" + +void graph_show_16color_400line(void) +{ + // Enter 400-line mode + _AH = 0x42; + _CH = 0xC0; + geninterrupt(0x18); + + // Enter 16-color mode + outportb(0x6A, 1); + + // Show VRAM + _AH = 0x40; + geninterrupt(0x18); +} diff --git a/platform/x86real/pc98/graph.hpp b/platform/x86real/pc98/graph.hpp new file mode 100644 index 00000000..600afb8f --- /dev/null +++ b/platform/x86real/pc98/graph.hpp @@ -0,0 +1,5 @@ +// Generic graphics layer functions +// -------------------------------- + +// Puts the graphics GDC into the common 16-color 640×400 graphics mode. +void graph_show_16color_400line(void);