summaryrefslogtreecommitdiff
path: root/com32/lib/sys/vesacon_write.c
diff options
context:
space:
mode:
Diffstat (limited to 'com32/lib/sys/vesacon_write.c')
-rw-r--r--com32/lib/sys/vesacon_write.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/com32/lib/sys/vesacon_write.c b/com32/lib/sys/vesacon_write.c
index f0fc845f..e85aba88 100644
--- a/com32/lib/sys/vesacon_write.c
+++ b/com32/lib/sys/vesacon_write.c
@@ -61,7 +61,6 @@ static struct ansi_ops op = {
};
static struct term_info ti = {
- .cols = TEXT_PIXEL_COLS / FONT_WIDTH,
.disabled = 0,
.ts = &ts,
.op = &op
@@ -71,6 +70,20 @@ static struct term_info ti = {
reinitialization. */
static int vesacon_counter = 0;
+static struct {
+ int x, y;
+} vesacon_resolution = {
+ .x = DEFAULT_VESA_X_SIZE,
+ .y = DEFAULT_VESA_Y_SIZE,
+};
+
+/* Set desired resolution - requires a full close/open cycle */
+void vesacon_set_resolution(int x, int y)
+{
+ vesacon_resolution.x = x;
+ vesacon_resolution.y = y;
+}
+
/* Common setup */
int __vesacon_open(struct file_info *fp)
{
@@ -84,7 +97,7 @@ int __vesacon_open(struct file_info *fp)
ti.cols = 80;
} else {
/* Switch mode */
- if (__vesacon_init()) {
+ if (__vesacon_init(vesacon_resolution.x, vesacon_resolution.y)) {
vesacon_counter = -1;
return EAGAIN;
}
@@ -92,6 +105,7 @@ int __vesacon_open(struct file_info *fp)
/* Initial state */
__ansi_init(&ti);
ti.rows = __vesacon_text_rows;
+ ti.cols = __vesacon_text_cols;
}
} else if (vesacon_counter == -1) {
return EAGAIN;