diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-01-31 22:27:20 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-01-31 22:27:20 +0000 |
commit | b3d803fe584c051d9ef8f2d83345d98135a74b8e (patch) | |
tree | 8d57e195975e0a6be72cec9792f6218cf356b5d0 /sys/arch/amiga/dev/grf_rt.c | |
parent | 4a6fd694a9decb0a2fb0110036e730bf5ffc05df (diff) |
from netbsd: Unify mode support across gfx boards. (Ignatios Souvatzis)
Diffstat (limited to 'sys/arch/amiga/dev/grf_rt.c')
-rw-r--r-- | sys/arch/amiga/dev/grf_rt.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/sys/arch/amiga/dev/grf_rt.c b/sys/arch/amiga/dev/grf_rt.c index bc96d60a844..4103c6238d8 100644 --- a/sys/arch/amiga/dev/grf_rt.c +++ b/sys/arch/amiga/dev/grf_rt.c @@ -1,4 +1,4 @@ -/* $NetBSD: grf_rt.c,v 1.22 1995/02/23 19:14:46 chopps Exp $ */ +/* $NetBSD: grf_rt.c,v 1.23 1996/01/28 19:19:12 chopps Exp $ */ /* * Copyright (c) 1993 Markus Wild @@ -901,11 +901,35 @@ rt_getvmode (gp, vm) vm->disp_width = md->MW; vm->disp_height = md->MH; vm->depth = md->DEP; - vm->hblank_start = md->HBS; - vm->hblank_stop = md->HBE; - vm->hsync_start = md->HSS; - vm->hsync_stop = md->HSE; - vm->htotal = md->HT; + + /* + * From observation of the monitor definition table above, I guess that + * the horizontal timings are in units of longwords. Hence, I get the + * pixels by multiplication with 32 and division by the depth. + * The text modes, apparently marked by depth == 4, are even more wierd. + * According to a comment above, they are computed from a depth==8 mode + * (thats for us: * 32 / 8) by applying another factor of 4 / font width. + * Reverse applying the latter formula most of the constants cancel + * themselves and we are left with a nice (* font width). + * That is, internal timings are in units of longwords for graphics + * modes, or in units of characters widths for text modes. + * We better don't WRITE modes until this has been real live checked. + * - Ignatios Souvatzis + */ + + if (md->DEP == 4) { + vm->hblank_start = md->HBS * 32 / md->DEP; + vm->hblank_stop = md->HBE * 32 / md->DEP; + vm->hsync_start = md->HSS * 32 / md->DEP; + vm->hsync_stop = md->HSE * 32 / md->DEP; + vm->htotal = md->HT * 32 / md->DEP; + } else { + vm->hblank_start = md->HBS * md->FX; + vm->hblank_stop = md->HBE * md->FX; + vm->hsync_start = md->HSS * md->FX; + vm->hsync_stop = md->HSE * md->FX; + vm->htotal = md->HT * md->FX; + } vm->vblank_start = md->VBS; vm->vblank_stop = md->VBE; vm->vsync_start = md->VSS; |