From 67195aad96f99a716273859b48c6aafbf7a6e20d Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Sat, 21 Feb 2004 01:47:02 +0000 Subject: [PATCH] Add real video base address instead of computed one (with bounds) --- second/console.c | 10 +++++++++- second/console.h | 2 +- second/glue.S | 18 ++++++++++++------ second/glue.h | 2 +- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/second/console.c b/second/console.c index c96a2a1..0020022 100644 --- a/second/console.c +++ b/second/console.c @@ -8,9 +8,11 @@ #include "glue.h" #include "console.h" +#include "MMU.h" typedef struct console_handler { + unsigned char* video; unsigned char* base; unsigned long row_bytes; /* in bytes */ unsigned long depth; /* 8, 16 or 32 */ @@ -284,7 +286,8 @@ console_init() &console.row_bytes, &console.width, &console.height, - &console.depth); + &console.depth, + (unsigned long*)&console.video); console.pos_x = 0; console.pos_y = 0; @@ -382,3 +385,8 @@ unsigned long console_get_height() { return console.height; } + +unsigned long console_get_video() +{ + return (unsigned long)console.video; +} diff --git a/second/console.h b/second/console.h index 81422fc..a5dde6c 100644 --- a/second/console.h +++ b/second/console.h @@ -17,6 +17,6 @@ extern unsigned long console_get_videobase(); extern unsigned long console_get_row_bytes(); extern unsigned long console_get_depth(); extern unsigned long console_get_width(); -extern unsigned long console_get_height(); +extern unsigned long console_get_video(); #endif diff --git a/second/glue.S b/second/glue.S index e263f44..c10e129 100644 --- a/second/glue.S +++ b/second/glue.S @@ -16,7 +16,7 @@ * void * glue_display_properties(unsigned long *base, unsigned long *row_bytes, * unsigned long *width, unsigned long *height, - * unsigned long *depth) + * unsigned long *depth, unsigned long* video) */ glue_display_properties: @@ -28,9 +28,9 @@ glue_display_properties: link.w %a6,#-4 movm.l #0x3c,-(%sp) - move.l 8(%a6),%a3 - move.l 12(%a6),%a5 - move.l 24(%a6),%a4 + move.l 28(%a6),%a3 /* unsigned long *video */ + move.l 12(%a6),%a5 /* unsigned long *row_bytes */ + move.l 24(%a6),%a4 /* unsigned long *depth */ /* hdl = LMGetMainDevice(); */ @@ -59,7 +59,7 @@ glue_display_properties: tst.l (%a0) jbeq .exit - /* *base = (unsigned char *)pm->baseAddr; */ + /* *video = (unsigned char *)pm->baseAddr; */ move.l -4(%a6),%a0 move.l (%a0),(%a3) @@ -104,7 +104,13 @@ glue_display_properties: move.l %d0,(%a4) .not_15: - /* (*base) += pm->bounds.top * *row_bytes; */ + /* (*base) = (*video) */ + + move.l (%a3),%d0 + move.l 8(%a6),%a3 /* unsigned long *base */ + move.l %d0,(%a3) + + /* (*base) = (*video) + pm->bounds.top * *row_bytes; */ move.l -4(%a6),%a0 move.w 6(%a0),%d0 diff --git a/second/glue.h b/second/glue.h index 54e1ff8..42895d5 100644 --- a/second/glue.h +++ b/second/glue.h @@ -7,5 +7,5 @@ extern void glue_display_properties(unsigned long *base, unsigned long *row_bytes, unsigned long *width, unsigned long *height, - unsigned long *depth); + unsigned long *depth, unsigned long *video); extern int Gestalt(unsigned long selector, long * response);