NT4/private/ntos/fw/mips/jxbmp.c
2020-09-30 17:12:29 +02:00

130 lines
2.0 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*++
Copyright (c) 1992 Microsoft Corporation
Module Name:
jxbmp.c
Abstract:
This program outputs a BMP file to the screen.
Author:
David M. Robinson (davidro) 7-July-1992
Revision History:
--*/
#include "fwp.h"
#include "windef.h"
#include "wingdi.h"
#include "selfmap.h"
#define VIDEO_MEMORY ((PUCHAR)VIDEO_MEMORY_VIRTUAL_BASE)
//
// External defines.
//
extern ULONG FwBmpHeight;
extern ULONG FwBmpWidth;
extern UCHAR FwBmp[];
extern ULONG FwForegroundColor;
extern ULONG FwBackgroundColor;
extern ULONG DisplayWidth;
extern ULONG FrameSize;
VOID
FwOutputBitmap (
PULONG Destination,
ULONG Width,
ULONG Height,
PUCHAR Bitmap
)
/*++
Routine Description:
This routine displays a bitmap on the video screen with the current
color and video attributes.
Arguments:
Destination - The destination address (lower right corner) of the location
to display the bitmap.
Width - The width of the bitmap in pixels.
Height - The height of the bitmap in pixels.
Bitmap - A pointer to the bitmap.
Multiple - A scaling factor.
Return Value:
None.
--*/
{
ULONG I, J, K, L, M;
PUCHAR Pixel;
CHAR Color;
CHAR Character;
ULONG Count;
Pixel = (PUCHAR)(Destination) - Width;
Count = 0;
for ( I = 0 ; I < Height ; I++ ) {
for ( J = 0 ; J < Width ; J++ ) {
if (Count-- == 0) {
Count = (*Bitmap & 0x7f) - 1;
Color = (*Bitmap++ & 0x80) ? FwForegroundColor : FwBackgroundColor;
}
*Pixel++ = Color;
}
Pixel -= (DisplayWidth + Width);
}
return;
}
VOID
JxBmp(
VOID
)
/*++
Routine Description:
This routine reads a bitmap from the PROM and displays it on the screen.
Arguments:
None.
Return Value:
None.
--*/
{
PULONG Destination;
Destination = (PULONG)(VIDEO_MEMORY + FrameSize);
FwOutputBitmap(Destination, FwBmpWidth, FwBmpHeight, FwBmp);
}