summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>1998-12-28 14:20:13 +0000
committerdes <des@FreeBSD.org>1998-12-28 14:20:13 +0000
commit4fe2aa5f70a5ff0a7a28432c980dc179e5cde417 (patch)
tree44470156f33c1df1f49830128afe0dcc383e77da
parent790434fad1fdf6cbdc8b4615491194ba5947d4cc (diff)
downloadFreeBSD-src-4fe2aa5f70a5ff0a7a28432c980dc179e5cde417.zip
FreeBSD-src-4fe2aa5f70a5ff0a7a28432c980dc179e5cde417.tar.gz
Save the palette in case syscons doesn't restore it properly.
Fix a minor overflow.
-rw-r--r--sys/dev/syscons/warp/warp_saver.c9
-rw-r--r--sys/modules/syscons/warp/warp_saver.c9
2 files changed, 12 insertions, 6 deletions
diff --git a/sys/dev/syscons/warp/warp_saver.c b/sys/dev/syscons/warp/warp_saver.c
index 138b8d4..238657d 100644
--- a/sys/dev/syscons/warp/warp_saver.c
+++ b/sys/dev/syscons/warp/warp_saver.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id$
+ * $Id: warp_saver.c,v 1.1 1998/12/27 22:03:09 des Exp $
*/
#include <sys/param.h>
@@ -47,6 +47,7 @@ static u_char *vid;
#define STARS (SPP*(1+2+4+8))
static int star[STARS];
+static u_char save_pal[768];
static u_char warp_pal[768] = {
0x00, 0x00, 0x00,
0x66, 0x66, 0x66,
@@ -61,7 +62,7 @@ warp_update(void)
{
int i, j, k, n;
- for (i = k = 1, n = SPP*8; i < 5; i++, n /= 2)
+ for (i = 1, k = 0, n = SPP*8; i < 5; i++, n /= 2)
for (j = 0; j < n; j++, k++) {
vid[star[k]] = 0;
star[k] += i;
@@ -85,10 +86,11 @@ warp_saver(int blank)
saved_mode = scp->mode;
scp->mode = M_VGA_CG320;
scp->status |= SAVER_RUNNING|GRAPHICS_MODE;
+ save_palette(scp, (char *)save_pal);
set_mode(scp);
+ load_palette(scp, (char *)warp_pal);
scrn_blanked++;
vid = (u_char *)Crtat;
- load_palette(scp, (char *)warp_pal);
splx(pl);
bzero(vid, SCRW*SCRH);
}
@@ -105,6 +107,7 @@ warp_saver(int blank)
scp->mode = saved_mode;
scp->status &= ~(SAVER_RUNNING|GRAPHICS_MODE);
set_mode(scp);
+ load_palette(scp, (char *)save_pal);
saved_mode = 0;
splx(pl);
}
diff --git a/sys/modules/syscons/warp/warp_saver.c b/sys/modules/syscons/warp/warp_saver.c
index 138b8d4..238657d 100644
--- a/sys/modules/syscons/warp/warp_saver.c
+++ b/sys/modules/syscons/warp/warp_saver.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id$
+ * $Id: warp_saver.c,v 1.1 1998/12/27 22:03:09 des Exp $
*/
#include <sys/param.h>
@@ -47,6 +47,7 @@ static u_char *vid;
#define STARS (SPP*(1+2+4+8))
static int star[STARS];
+static u_char save_pal[768];
static u_char warp_pal[768] = {
0x00, 0x00, 0x00,
0x66, 0x66, 0x66,
@@ -61,7 +62,7 @@ warp_update(void)
{
int i, j, k, n;
- for (i = k = 1, n = SPP*8; i < 5; i++, n /= 2)
+ for (i = 1, k = 0, n = SPP*8; i < 5; i++, n /= 2)
for (j = 0; j < n; j++, k++) {
vid[star[k]] = 0;
star[k] += i;
@@ -85,10 +86,11 @@ warp_saver(int blank)
saved_mode = scp->mode;
scp->mode = M_VGA_CG320;
scp->status |= SAVER_RUNNING|GRAPHICS_MODE;
+ save_palette(scp, (char *)save_pal);
set_mode(scp);
+ load_palette(scp, (char *)warp_pal);
scrn_blanked++;
vid = (u_char *)Crtat;
- load_palette(scp, (char *)warp_pal);
splx(pl);
bzero(vid, SCRW*SCRH);
}
@@ -105,6 +107,7 @@ warp_saver(int blank)
scp->mode = saved_mode;
scp->status &= ~(SAVER_RUNNING|GRAPHICS_MODE);
set_mode(scp);
+ load_palette(scp, (char *)save_pal);
saved_mode = 0;
splx(pl);
}
OpenPOWER on IntegriCloud