gfxlib.c

来自「Ibmstb02500 miniboot 源码」· C语言 代码 · 共 572 行 · 第 1/2 页

C
572
字号
/* openbios/arch/pallas/gfxLib.c, stbbios *//*------------------------------------------------------------------------------+||       This source code has been made available to you by IBM on an AS-IS|       basis.  Anyone receiving this source is licensed under IBM|       copyrights to use it in any way he or she deems fit, including|       copying it, modifying it, compiling it, and redistributing it either|       with or without modifications.  No license under IBM patents or|       patent applications is to be implied by the copyright license.||       Any user of this software should understand that IBM cannot provide|       technical support for this software and will not be responsible for|       any consequences resulting from the use of this software.||       Any person who transfers this source code or any derivative work|       must include the IBM copyright notice, this paragraph, and the|       preceding two paragraphs in the transferred software.||       COPYRIGHT   I B M   CORPORATION 1995|       LICENSED MATERIAL  -  PROGRAM PROPERTY OF I B M|-------------------------------------------------------------------------------|-------------------------------------------------------------------------------||  File Name:   gfxLib.c||  Function:    STB OSD Boot logo support for Pallas||  Author:      Yang Yudong||  Change Activity-||  Date        Description of Change                                       BY|  ---------   ---------------------                                       ---|  27-Dec-01   Created                                                     YYD|  08-Jan-02   Added palette change routine                                YYD||------------------------------------------------------------------------------*/#undef DEBUG#include <ppcLib.h>#include <eval.h>#include <bootlogo.h>#include <string.h>extern nvram_t confdata;// public data structure that should be initialized by gfxLib.cstruct boot_logo_buffer_info boot_logo_buffer;#ifdef __GNUC__#pragma pack(1)#endifstruct gfx_palette{   unsigned char a, r, g, b;};struct pallas_osd_control_block{    // byte 0:3    unsigned z_reserved1: 1;                    // 0    unsigned c_subClutIndex: 3;                 // 1:3    unsigned z_reserved2: 10;                   // 4:13    unsigned cgs_transparentPixelsGray:1;       // 14    unsigned cg_undefinedColorsTransparent:1;   // 15    unsigned z_reserved3:2;                     // 16:17    unsigned a_pixelDataType:6;                 // 18:23    unsigned z_reserved4:6;                     // 24:29    unsigned a_flickerCorrectionControl:2;      // 30:31    // byte 4:7    unsigned z_reserved5:3;                     // 0:2    unsigned a_displayBufferHSize:13;           // 3:15    unsigned z_reserved6:3;                     // 16:18    unsigned a_displayBufferVSize:13;           // 19:31    // byte 8:11    unsigned z_reserved7:3;                     // 0:2    unsigned a_displayBufferHOffset:13;         // 3:15    unsigned z_reserved8:3;                     // 16:18    unsigned a_displayBufferVOffset:13;         // 19:31    // byte 12:15    unsigned z_reserved9:3;                     // 0:2    unsigned gsb_alphaWindowHSize:13;           // 3:15    unsigned z_reserved10:3;                    // 16:18    unsigned gsb_alphaWindowVSize:13;           // 19:31    // byte 16:19    unsigned z_reserved11:3;                    // 0:2    unsigned gsb_alphaWindowHOffset:13;         // 3:15    unsigned z_reserved12:3;                    // 16:18    unsigned gsb_alphaWindowVOffset:13;         // 19:31    // byte 20:23    unsigned z_reserved13:6;                    // 0:5    unsigned a_scrollPointer:26;                // 6:31, for cursor plane only 9:31    // byte 24:27    unsigned z_reserved14:28;                   // 0:27    unsigned c_scrollPointerFineControl:4;      // 28:31    // byte 28:31    unsigned z_reserved15:32;                   // 0:31    struct gfx_palette pal[256];   // palette data};#ifdef __GNUC__#pragma pack()#endifstatic struct pallas_osd_control_block osdcb_data = {    // byte 0:3    0, // unsigned z_reserved1: 1;                    // 0    0, // unsigned c_subClutIndex: 3;                 // 1:3    0, // unsigned z_reserved2: 10;                   // 4:13    0, // unsigned cgs_transparentPixelsGray:1;       // 14    1, // unsigned cg_undefinedColorsTransparent:1;   // 15    0, // unsigned z_reserved3:2;                     // 16:17    0, // 8bits argb color unsigned a_pixelDataType:6;                 // 18:23    0, // unsigned z_reserved4:6;                     // 24:29    0, // unsigned a_flickerCorrectionControl:2;      // 30:31    // byte 4:7    0,   // unsigned z_reserved5:3;                     // 0:2    640, // unsigned a_displayBufferHSize:13;           // 3:15    0,   // unsigned z_reserved6:3;                     // 16:18    440, // unsigned a_displayBufferVSize:13;           // 19:31    // byte 8:11    0,  // unsigned z_reserved7:3;                     // 0:2    30, // unsigned a_displayBufferHOffset:13;         // 3:15    0,  // unsigned z_reserved8:3;                     // 16:18    30, // unsigned a_displayBufferVOffset:13;         // 19:31    // byte 12:15    0, // unsigned z_reserved9:3;                     // 0:2    0, // unsigned gsb_alphaWindowHSize:13;           // 3:15    0, // unsigned z_reserved10:3;                    // 16:18    0, // unsigned gsb_alphaWindowVSize:13;           // 19:31    // byte 16:19    0,  // unsigned z_reserved11:3;                    // 0:2    30, // unsigned gsb_alphaWindowHOffset:13;         // 3:15    0,  // unsigned z_reserved12:3;                    // 16:18    30, // unsigned gsb_alphaWindowVOffset:13;         // 19:31    // byte 20:23    0, // unsigned z_reserved13:6;                    // 0:5    0, // unsigned a_scrollPointer:26;                // 6:31, for cursor plane only 9:31    // byte 24:27    0, // unsigned z_reserved14:28;                   // 0:27    0, // unsigned c_scrollPointerFineControl:4;      // 28:31    // byte 28:31    0, // unsigned z_reserved15:32;                   // 0:31    // palette block    {	    // from 000-215   216 color web safe palette	    { 0xff,   0xff,   0xff,   0xff },   //  000	    { 0xff,   0xff,   0xff,   0xcc },   //  001	    { 0xff,   0xff,   0xff,   0x99 },   //  002	    { 0xff,   0xff,   0xff,   0x66 },   //  003	    { 0xff,   0xff,   0xff,   0x33 },   //  004	    { 0xff,   0xff,   0xff,   0x00 },   //  005	    { 0xff,   0xff,   0xcc,   0xff },   //  006	    { 0xff,   0xff,   0xcc,   0xcc },   //  007	    { 0xff,   0xff,   0xcc,   0x99 },   //  008	    { 0xff,   0xff,   0xcc,   0x66 },   //  009	    { 0xff,   0xff,   0xcc,   0x33 },   //  010	    { 0xff,   0xff,   0xcc,   0x00 },   //  011	    { 0xff,   0xff,   0x99,   0xff },   //  012	    { 0xff,   0xff,   0x99,   0xcc },   //  013	    { 0xff,   0xff,   0x99,   0x99 },   //  014	    { 0xff,   0xff,   0x99,   0x66 },   //  015	    { 0xff,   0xff,   0x99,   0x33 },   //  016	    { 0xff,   0xff,   0x99,   0x00 },   //  017	    { 0xff,   0xff,   0x66,   0xff },   //  018	    { 0xff,   0xff,   0x66,   0xcc },   //  019	    { 0xff,   0xff,   0x66,   0x99 },   //  020	    { 0xff,   0xff,   0x66,   0x66 },   //  021	    { 0xff,   0xff,   0x66,   0x33 },   //  022	    { 0xff,   0xff,   0x66,   0x00 },   //  023	    { 0xff,   0xff,   0x33,   0xff },   //  024	    { 0xff,   0xff,   0x33,   0xcc },   //  025	    { 0xff,   0xff,   0x33,   0x99 },   //  026	    { 0xff,   0xff,   0x33,   0x66 },   //  027	    { 0xff,   0xff,   0x33,   0x33 },   //  028	    { 0xff,   0xff,   0x33,   0x00 },   //  029	    { 0xff,   0xff,   0x00,   0xff },   //  030	    { 0xff,   0xff,   0x00,   0xcc },   //  031	    { 0xff,   0xff,   0x00,   0x99 },   //  032	    { 0xff,   0xff,   0x00,   0x66 },   //  033	    { 0xff,   0xff,   0x00,   0x33 },   //  034	    { 0xff,   0xff,   0x00,   0x00 },   //  035	    { 0xff,   0xcc,   0xff,   0xff },   //  036	    { 0xff,   0xcc,   0xff,   0xcc },   //  037	    { 0xff,   0xcc,   0xff,   0x99 },   //  038	    { 0xff,   0xcc,   0xff,   0x66 },   //  039	    { 0xff,   0xcc,   0xff,   0x33 },   //  040	    { 0xff,   0xcc,   0xff,   0x00 },   //  041	    { 0xff,   0xcc,   0xcc,   0xff },   //  042	    { 0xff,   0xcc,   0xcc,   0xcc },   //  043	    { 0xff,   0xcc,   0xcc,   0x99 },   //  044	    { 0xff,   0xcc,   0xcc,   0x66 },   //  045	    { 0xff,   0xcc,   0xcc,   0x33 },   //  046	    { 0xff,   0xcc,   0xcc,   0x00 },   //  047	    { 0xff,   0xcc,   0x99,   0xff },   //  048	    { 0xff,   0xcc,   0x99,   0xcc },   //  049	    { 0xff,   0xcc,   0x99,   0x99 },   //  050	    { 0xff,   0xcc,   0x99,   0x66 },   //  051	    { 0xff,   0xcc,   0x99,   0x33 },   //  052	    { 0xff,   0xcc,   0x99,   0x00 },   //  053	    { 0xff,   0xcc,   0x66,   0xff },   //  054	    { 0xff,   0xcc,   0x66,   0xcc },   //  055	    { 0xff,   0xcc,   0x66,   0x99 },   //  056	    { 0xff,   0xcc,   0x66,   0x66 },   //  057	    { 0xff,   0xcc,   0x66,   0x33 },   //  058	    { 0xff,   0xcc,   0x66,   0x00 },   //  059	    { 0xff,   0xcc,   0x33,   0xff },   //  060	    { 0xff,   0xcc,   0x33,   0xcc },   //  061	    { 0xff,   0xcc,   0x33,   0x99 },   //  062	    { 0xff,   0xcc,   0x33,   0x66 },   //  063	    { 0xff,   0xcc,   0x33,   0x33 },   //  064	    { 0xff,   0xcc,   0x33,   0x00 },   //  065	    { 0xff,   0xcc,   0x00,   0xff },   //  066	    { 0xff,   0xcc,   0x00,   0xcc },   //  067	    { 0xff,   0xcc,   0x00,   0x99 },   //  068	    { 0xff,   0xcc,   0x00,   0x66 },   //  069	    { 0xff,   0xcc,   0x00,   0x33 },   //  070	    { 0xff,   0xcc,   0x00,   0x00 },   //  071	    { 0xff,   0x99,   0xff,   0xff },   //  072	    { 0xff,   0x99,   0xff,   0xcc },   //  073	    { 0xff,   0x99,   0xff,   0x99 },   //  074	    { 0xff,   0x99,   0xff,   0x66 },   //  075	    { 0xff,   0x99,   0xff,   0x33 },   //  076	    { 0xff,   0x99,   0xff,   0x00 },   //  077	    { 0xff,   0x99,   0xcc,   0xff },   //  078	    { 0xff,   0x99,   0xcc,   0xcc },   //  079	    { 0xff,   0x99,   0xcc,   0x99 },   //  080	    { 0xff,   0x99,   0xcc,   0x66 },   //  081	    { 0xff,   0x99,   0xcc,   0x33 },   //  082	    { 0xff,   0x99,   0xcc,   0x00 },   //  083	    { 0xff,   0x99,   0x99,   0xff },   //  084	    { 0xff,   0x99,   0x99,   0xcc },   //  085	    { 0xff,   0x99,   0x99,   0x99 },   //  086	    { 0xff,   0x99,   0x99,   0x66 },   //  087	    { 0xff,   0x99,   0x99,   0x33 },   //  088	    { 0xff,   0x99,   0x99,   0x00 },   //  089	    { 0xff,   0x99,   0x66,   0xff },   //  090	    { 0xff,   0x99,   0x66,   0xcc },   //  091	    { 0xff,   0x99,   0x66,   0x99 },   //  092	    { 0xff,   0x99,   0x66,   0x66 },   //  093	    { 0xff,   0x99,   0x66,   0x33 },   //  094	    { 0xff,   0x99,   0x66,   0x00 },   //  095	    { 0xff,   0x99,   0x33,   0xff },   //  096	    { 0xff,   0x99,   0x33,   0xcc },   //  097	    { 0xff,   0x99,   0x33,   0x99 },   //  098	    { 0xff,   0x99,   0x33,   0x66 },   //  099	    { 0xff,   0x99,   0x33,   0x33 },   //  100	    { 0xff,   0x99,   0x33,   0x00 },   //  101	    { 0xff,   0x99,   0x00,   0xff },   //  102	    { 0xff,   0x99,   0x00,   0xcc },   //  103	    { 0xff,   0x99,   0x00,   0x99 },   //  104	    { 0xff,   0x99,   0x00,   0x66 },   //  105	    { 0xff,   0x99,   0x00,   0x33 },   //  106	    { 0xff,   0x99,   0x00,   0x00 },   //  107	    { 0xff,   0x66,   0xff,   0xff },   //  108	    { 0xff,   0x66,   0xff,   0xcc },   //  109	    { 0xff,   0x66,   0xff,   0x99 },   //  110	    { 0xff,   0x66,   0xff,   0x66 },   //  111	    { 0xff,   0x66,   0xff,   0x33 },   //  112	    { 0xff,   0x66,   0xff,   0x00 },   //  113	    { 0xff,   0x66,   0xcc,   0xff },   //  114	    { 0xff,   0x66,   0xcc,   0xcc },   //  115	    { 0xff,   0x66,   0xcc,   0x99 },   //  116	    { 0xff,   0x66,   0xcc,   0x66 },   //  117	    { 0xff,   0x66,   0xcc,   0x33 },   //  118	    { 0xff,   0x66,   0xcc,   0x00 },   //  119	    { 0xff,   0x66,   0x99,   0xff },   //  120	    { 0xff,   0x66,   0x99,   0xcc },   //  121	    { 0xff,   0x66,   0x99,   0x99 },   //  122	    { 0xff,   0x66,   0x99,   0x66 },   //  123	    { 0xff,   0x66,   0x99,   0x33 },   //  124	    { 0xff,   0x66,   0x99,   0x00 },   //  125	    { 0xff,   0x66,   0x66,   0xff },   //  126	    { 0xff,   0x66,   0x66,   0xcc },   //  127	    { 0xff,   0x66,   0x66,   0x99 },   //  128	    { 0xff,   0x66,   0x66,   0x66 },   //  129	    { 0xff,   0x66,   0x66,   0x33 },   //  130	    { 0xff,   0x66,   0x66,   0x00 },   //  131	    { 0xff,   0x66,   0x33,   0xff },   //  132	    { 0xff,   0x66,   0x33,   0xcc },   //  133	    { 0xff,   0x66,   0x33,   0x99 },   //  134	    { 0xff,   0x66,   0x33,   0x66 },   //  135

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?