From 78a8014571e50c3029b634fa8da3941e9b7bfe1d Mon Sep 17 00:00:00 2001 From: des Date: Fri, 5 Feb 1999 12:40:16 +0000 Subject: [PATCH] Followup to yokota's last commit: - va_mode_flags -> va_info.vi_flags - scanline width may be different from screen width --- sys/dev/syscons/daemon/daemon_saver.c | 4 ++-- sys/dev/syscons/logo/logo_saver.c | 15 ++++++++------- sys/dev/syscons/snake/snake_saver.c | 4 ++-- sys/dev/syscons/star/star_saver.c | 4 ++-- sys/modules/syscons/daemon/daemon_saver.c | 4 ++-- sys/modules/syscons/logo/logo_saver.c | 15 ++++++++------- sys/modules/syscons/snake/snake_saver.c | 4 ++-- sys/modules/syscons/star/star_saver.c | 4 ++-- 8 files changed, 28 insertions(+), 26 deletions(-) diff --git a/sys/dev/syscons/daemon/daemon_saver.c b/sys/dev/syscons/daemon/daemon_saver.c index 09f6caf36189..423e6c70451d 100644 --- a/sys/dev/syscons/daemon/daemon_saver.c +++ b/sys/dev/syscons/daemon/daemon_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: daemon_saver.c,v 1.13 1999/01/11 03:18:45 yokota Exp $ + * $Id: daemon_saver.c,v 1.14 1999/01/17 14:25:08 yokota Exp $ */ #include @@ -199,7 +199,7 @@ daemon_saver(video_adapter_t *adp, int blank) int min, max; if (blank) { - if (adp->va_mode_flags & V_INFO_GRAPHICS) + if (adp->va_info.vi_flags & V_INFO_GRAPHICS) return EAGAIN; if (blanked == 0) { window = (u_short *)adp->va_window; diff --git a/sys/dev/syscons/logo/logo_saver.c b/sys/dev/syscons/logo/logo_saver.c index 1db8dcc496b6..c55b565de2ad 100644 --- a/sys/dev/syscons/logo/logo_saver.c +++ b/sys/dev/syscons/logo/logo_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: logo_saver.c,v 1.3 1999/01/11 03:18:49 yokota Exp $ + * $Id: logo_saver.c,v 1.4 1999/01/16 10:20:16 des Exp $ */ #include @@ -37,7 +37,7 @@ #include static u_char *vid; -static int banksize, scrmode, scrw, scrh; +static int banksize, scrmode, bpsl, scrw, scrh; static int blanked; #include "logo.c" @@ -47,25 +47,25 @@ logo_blit(video_adapter_t *adp, int x, int y) { int d, l, o, p; - for (o = 0, p = y * scrw + x; p > banksize; p -= banksize) + for (o = 0, p = y * bpsl + x; p > banksize; p -= banksize) o += banksize; set_origin(adp, o); for (d = 0; d < sizeof logo_img; d += logo_w) { if (p + logo_w < banksize) { bcopy(logo_img + d, vid + p, logo_w); - p += scrw; + p += bpsl; } else if (p < banksize) { l = banksize - p; bcopy(logo_img + d, vid + p, l); set_origin(adp, (o += banksize)); bcopy(logo_img + d + l, vid, logo_w - l); - p += scrw - banksize; + p += bpsl - banksize; } else { p -= banksize; set_origin(adp, (o += banksize)); bcopy(logo_img + d, vid + p, logo_w); - p += scrw; + p += bpsl; } } } @@ -100,8 +100,9 @@ logo_saver(video_adapter_t *adp, int blank) set_video_mode(adp, scrmode, logo_pal, 0); blanked++; vid = (u_char *)adp->va_window; + bpsl = adp->va_line_width; splx(pl); - for (i = 0; i < scrw*scrh; i += banksize) { + for (i = 0; i < bpsl*scrh; i += banksize) { set_origin(adp, i); bzero(vid, banksize); } diff --git a/sys/dev/syscons/snake/snake_saver.c b/sys/dev/syscons/snake/snake_saver.c index 642e6b15b309..ef64741942ea 100644 --- a/sys/dev/syscons/snake/snake_saver.c +++ b/sys/dev/syscons/snake/snake_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: snake_saver.c,v 1.21 1999/01/11 03:18:52 yokota Exp $ + * $Id: snake_saver.c,v 1.22 1999/01/17 14:25:19 yokota Exp $ */ #include @@ -58,7 +58,7 @@ snake_saver(video_adapter_t *adp, int blank) #define savs messagep if (blank) { - if (adp->va_mode_flags & V_INFO_GRAPHICS) + if (adp->va_info.vi_flags & V_INFO_GRAPHICS) return EAGAIN; if (blanked <= 0) { window = (u_short *)adp->va_window; diff --git a/sys/dev/syscons/star/star_saver.c b/sys/dev/syscons/star/star_saver.c index 463a0ae0f3f8..aaa23fbde073 100644 --- a/sys/dev/syscons/star/star_saver.c +++ b/sys/dev/syscons/star/star_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: star_saver.c,v 1.18 1999/01/11 03:18:53 yokota Exp $ + * $Id: star_saver.c,v 1.19 1999/01/17 14:25:19 yokota Exp $ */ #include @@ -58,7 +58,7 @@ star_saver(video_adapter_t *adp, int blank) static u_short stars[NUM_STARS][2]; if (blank) { - if (adp->va_mode_flags & V_INFO_GRAPHICS) + if (adp->va_info.vi_flags & V_INFO_GRAPHICS) return EAGAIN; if (!blanked) { window = (u_short *)adp->va_window; diff --git a/sys/modules/syscons/daemon/daemon_saver.c b/sys/modules/syscons/daemon/daemon_saver.c index 09f6caf36189..423e6c70451d 100644 --- a/sys/modules/syscons/daemon/daemon_saver.c +++ b/sys/modules/syscons/daemon/daemon_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: daemon_saver.c,v 1.13 1999/01/11 03:18:45 yokota Exp $ + * $Id: daemon_saver.c,v 1.14 1999/01/17 14:25:08 yokota Exp $ */ #include @@ -199,7 +199,7 @@ daemon_saver(video_adapter_t *adp, int blank) int min, max; if (blank) { - if (adp->va_mode_flags & V_INFO_GRAPHICS) + if (adp->va_info.vi_flags & V_INFO_GRAPHICS) return EAGAIN; if (blanked == 0) { window = (u_short *)adp->va_window; diff --git a/sys/modules/syscons/logo/logo_saver.c b/sys/modules/syscons/logo/logo_saver.c index 1db8dcc496b6..c55b565de2ad 100644 --- a/sys/modules/syscons/logo/logo_saver.c +++ b/sys/modules/syscons/logo/logo_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: logo_saver.c,v 1.3 1999/01/11 03:18:49 yokota Exp $ + * $Id: logo_saver.c,v 1.4 1999/01/16 10:20:16 des Exp $ */ #include @@ -37,7 +37,7 @@ #include static u_char *vid; -static int banksize, scrmode, scrw, scrh; +static int banksize, scrmode, bpsl, scrw, scrh; static int blanked; #include "logo.c" @@ -47,25 +47,25 @@ logo_blit(video_adapter_t *adp, int x, int y) { int d, l, o, p; - for (o = 0, p = y * scrw + x; p > banksize; p -= banksize) + for (o = 0, p = y * bpsl + x; p > banksize; p -= banksize) o += banksize; set_origin(adp, o); for (d = 0; d < sizeof logo_img; d += logo_w) { if (p + logo_w < banksize) { bcopy(logo_img + d, vid + p, logo_w); - p += scrw; + p += bpsl; } else if (p < banksize) { l = banksize - p; bcopy(logo_img + d, vid + p, l); set_origin(adp, (o += banksize)); bcopy(logo_img + d + l, vid, logo_w - l); - p += scrw - banksize; + p += bpsl - banksize; } else { p -= banksize; set_origin(adp, (o += banksize)); bcopy(logo_img + d, vid + p, logo_w); - p += scrw; + p += bpsl; } } } @@ -100,8 +100,9 @@ logo_saver(video_adapter_t *adp, int blank) set_video_mode(adp, scrmode, logo_pal, 0); blanked++; vid = (u_char *)adp->va_window; + bpsl = adp->va_line_width; splx(pl); - for (i = 0; i < scrw*scrh; i += banksize) { + for (i = 0; i < bpsl*scrh; i += banksize) { set_origin(adp, i); bzero(vid, banksize); } diff --git a/sys/modules/syscons/snake/snake_saver.c b/sys/modules/syscons/snake/snake_saver.c index 642e6b15b309..ef64741942ea 100644 --- a/sys/modules/syscons/snake/snake_saver.c +++ b/sys/modules/syscons/snake/snake_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: snake_saver.c,v 1.21 1999/01/11 03:18:52 yokota Exp $ + * $Id: snake_saver.c,v 1.22 1999/01/17 14:25:19 yokota Exp $ */ #include @@ -58,7 +58,7 @@ snake_saver(video_adapter_t *adp, int blank) #define savs messagep if (blank) { - if (adp->va_mode_flags & V_INFO_GRAPHICS) + if (adp->va_info.vi_flags & V_INFO_GRAPHICS) return EAGAIN; if (blanked <= 0) { window = (u_short *)adp->va_window; diff --git a/sys/modules/syscons/star/star_saver.c b/sys/modules/syscons/star/star_saver.c index 463a0ae0f3f8..aaa23fbde073 100644 --- a/sys/modules/syscons/star/star_saver.c +++ b/sys/modules/syscons/star/star_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: star_saver.c,v 1.18 1999/01/11 03:18:53 yokota Exp $ + * $Id: star_saver.c,v 1.19 1999/01/17 14:25:19 yokota Exp $ */ #include @@ -58,7 +58,7 @@ star_saver(video_adapter_t *adp, int blank) static u_short stars[NUM_STARS][2]; if (blank) { - if (adp->va_mode_flags & V_INFO_GRAPHICS) + if (adp->va_info.vi_flags & V_INFO_GRAPHICS) return EAGAIN; if (!blanked) { window = (u_short *)adp->va_window;