aboutsummaryrefslogtreecommitdiff
path: root/sys/modules/splash
diff options
context:
space:
mode:
authorKazutaka YOKOTA <yokota@FreeBSD.org>1999-02-05 11:52:13 +0000
committerKazutaka YOKOTA <yokota@FreeBSD.org>1999-02-05 11:52:13 +0000
commit1c27745f73af9ebb06283900182f82dbe8dae5ce (patch)
tree1325529e1a21497dec3bd519b75534879f69aeba /sys/modules/splash
parent533601dc35379a93943b9f516060f47a7e8438fa (diff)
downloadsrc-1c27745f73af9ebb06283900182f82dbe8dae5ce.tar.gz
src-1c27745f73af9ebb06283900182f82dbe8dae5ce.zip
- Don't assume the line length in the video memory is always the same as
the screen width. - Store the current video mode information in the `video_adapter' struct. - The size of the `v_offscreensize' field in the VESA mode information block is u_int16, not u_int8.
Notes
Notes: svn path=/head/; revision=43664
Diffstat (limited to 'sys/modules/splash')
-rw-r--r--sys/modules/splash/bmp/splash_bmp.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/modules/splash/bmp/splash_bmp.c b/sys/modules/splash/bmp/splash_bmp.c
index ac547dca3923..71e25784720e 100644
--- a/sys/modules/splash/bmp/splash_bmp.c
+++ b/sys/modules/splash/bmp/splash_bmp.c
@@ -24,7 +24,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: splash_bmp.c,v 1.4 1999/01/21 18:29:33 yokota Exp $
+ * $Id: splash_bmp.c,v 1.5 1999/01/26 10:00:02 yokota Exp $
*/
#include <sys/param.h>
@@ -216,14 +216,14 @@ fill(BMP_INFO *info, int x, int y, int xsize, int ysize)
int p;
banksize = info->adp->va_window_size;
- bank = (info->swidth*y + x)/banksize;
+ bank = (info->adp->va_line_width*y + x)/banksize;
window = (u_char *)info->adp->va_window;
(*vidsw[info->adp->va_index]->set_win_org)(info->adp, bank*banksize);
while (ysize > 0) {
- p = (info->swidth*y + x)%banksize;
+ p = (info->adp->va_line_width*y + x)%banksize;
for (; (p + xsize <= banksize) && ysize > 0; --ysize, ++y) {
generic_bzero(window + p, xsize);
- p += info->swidth;
+ p += info->adp->va_line_width;
}
if (ysize <= 0)
break;
@@ -267,11 +267,11 @@ bmp_SetPix(BMP_INFO *info, int x, int y, u_char val)
* because 0,0 is bottom-left for DIB, we have to convert.
*/
sofs = ((info->height - (y+1) + (info->sheight - info->height) / 2)
- * info->swidth) + x + (info->swidth - info->width) / 2;
+ * info->adp->va_line_width);
switch(info->sdepth) {
case 1:
- sofs = sofs >> 3; /* correct for depth */
+ sofs += ((x + (info->swidth - info->width) / 2) >> 3);
bofs = x & 0x7; /* offset within byte */
val &= 1; /* mask pixel value */
@@ -282,7 +282,7 @@ bmp_SetPix(BMP_INFO *info, int x, int y, u_char val)
/* XXX only correct for non-interleaved modes */
case 4:
- sofs = sofs >> 1; /* correct for depth */
+ sofs += ((x + (info->swidth - info->width) / 2) >> 1);
bofs = x & 0x1; /* offset within byte */
val &= 0xf; /* mask pixel value */
@@ -292,6 +292,7 @@ bmp_SetPix(BMP_INFO *info, int x, int y, u_char val)
break;
case 8:
+ sofs += x + (info->swidth - info->width) / 2;
newbank = sofs/info->adp->va_window_size;
if (info->bank != newbank) {
(*vidsw[info->adp->va_index]->set_win_org)(info->adp, newbank*info->adp->va_window_size);