aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/syscons/fire
diff options
context:
space:
mode:
authorPhilip Paeps <philip@FreeBSD.org>2007-02-21 12:27:12 +0000
committerPhilip Paeps <philip@FreeBSD.org>2007-02-21 12:27:12 +0000
commit0754972c5c72adff156ec736d2f4ebc57776e1ae (patch)
tree8f2df30a1e9c79b8e09d7dc29d55cee093923b96 /sys/dev/syscons/fire
parent9fad4c2a128e0db65a32641d74158bb00269b082 (diff)
Notes
Diffstat (limited to 'sys/dev/syscons/fire')
-rw-r--r--sys/dev/syscons/fire/fire_saver.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/syscons/fire/fire_saver.c b/sys/dev/syscons/fire/fire_saver.c
index 0bc031cad7cb1..de60a20a58f9b 100644
--- a/sys/dev/syscons/fire/fire_saver.c
+++ b/sys/dev/syscons/fire/fire_saver.c
@@ -52,6 +52,12 @@
#define GREEN(n) ((n) * 3 + 1)
#define BLUE(n) ((n) * 3 + 2)
+#define SET_ORIGIN(adp, o) do { \
+ int oo = o; \
+ if (oo != last_origin) \
+ set_origin(adp, last_origin = oo); \
+ } while (0)
+
static u_char *buf;
static u_char *vid;
static int banksize, scrmode, bpsl, scrw, scrh;
@@ -63,6 +69,7 @@ fire_update(video_adapter_t *adp)
{
int x, y;
int o, p;
+ int last_origin = -1;
/* make a new bottom line */
for (x = 0, y = scrh; x < scrw; x++)
@@ -87,12 +94,12 @@ fire_update(video_adapter_t *adp)
p -= banksize;
o += banksize;
}
- set_origin(adp, o);
+ SET_ORIGIN(adp, o);
if (p + scrw < banksize) {
bcopy(buf + y * scrw, vid + p, scrw);
} else {
bcopy(buf + y * scrw, vid + p, banksize - p);
- set_origin(adp, o + banksize);
+ SET_ORIGIN(adp, o + banksize);
bcopy(buf + y * scrw + (banksize - p), vid,
scrw - (banksize - p));
p -= banksize;