summaryrefslogtreecommitdiffstats
path: root/private/ntos/fw/mips/jxbmp.c
blob: aaba50cbfac20bd2f22bc1750ae47fff93c29655 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
/*++

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);

}