when frame buffer address is not specified, don't try to access.

This commit is contained in:
uch 1999-11-21 06:53:21 +00:00
parent 9a758aab34
commit 0816e8d336
1 changed files with 21 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: bicons.c,v 1.2 1999/11/02 10:33:05 takemura Exp $ */
/* $NetBSD: bicons.c,v 1.3 1999/11/21 06:53:21 uch Exp $ */
/*-
* Copyright (c) 1999
@ -33,6 +33,7 @@
* SUCH DAMAGE.
*
*/
#include "opt_vr41x1.h"
#define HALF_FONT
@ -98,7 +99,7 @@ struct {
#define FB_TABLE_SIZE (sizeof(fb_table)/sizeof(*fb_table))
static u_char *fb_vram = (unsigned char*)0xAA000000;
static u_char *fb_vram = 0;
static short fb_line_bytes = 0x50;
static u_char fb_clear_byte = 0;
short bicons_ypixel = 240;
@ -137,8 +138,14 @@ static void
draw_char(int x, int y, int c)
{
int i;
unsigned char* p = &fb_vram[(y * FONT_HEIGHT * fb_line_bytes) +
x * FONT_WIDTH * fb_oxel_bytes];
unsigned char* p;
if (!fb_vram) {
return;
}
p = &fb_vram[(y * FONT_HEIGHT * fb_line_bytes) +
x * FONT_WIDTH * fb_oxel_bytes];
for (i = 0; i < FONT_HEIGHT; i++) {
(*fb_put_oxel)(p, font_clR8x8_data[FONT_WIDTH * (FONT_HEIGHT * c + i)],
0xff);
@ -151,6 +158,9 @@ clear(int y, int height)
{
unsigned char *p;
if (!fb_vram) {
return;
}
TRACE(1, 2);
p = &fb_vram[y * fb_line_bytes];
TRACE(1, 3);
@ -168,6 +178,10 @@ static void
scroll(int y, int height, int d)
{
unsigned char *from, *to;
if (!fb_vram) {
return;
}
if (d < 0) {
from = &fb_vram[y * fb_line_bytes];
to = from + d * fb_line_bytes;
@ -229,7 +243,10 @@ bicons_printf(fmt, va_alist)
int
bicons_getc(dev_t dev)
{
#ifdef VR41X1
return vrkiu_getc();
#endif
return 0;
}
static void