⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gdi.c

📁 车载电子影音系统dvd播放系统原程序代码
💻 C
📖 第 1 页 / 共 5 页
字号:
// Graphic Device Interface Module Source File

// 05302003 Brian0.84a-2nd, update DRAM variable locations, add Top/Bottom for RISC reference 

#define GDI_MAIN_FILE

#include "winav.h"
#include "utl.h"
#include "comutl.h"
#include "w99av.h"
#include "hal.h"
#include "osd.h"
#include "gdi.h"
#include "cc.h"
#include "setup.h" // Brian1.24

// Alan2.36 modifies the following lines
#ifdef SUPPORT_UNICODE
#include <string.h>
#else
#ifndef SYSTEM_8051
#include <string.h>
#endif
#endif

#define USE_BERR

// Brian2.39
// Normal OSD use line 0~97
// Must skip some line between linked OSD region for performance issue, say 2 lines 98, 99, 
// Pseudo OSD use line 100~469
#define PSEUDO_REGION_START_LINE    100
#define PSEUDO_REGION_END_LINE      443 // if too big, Progressive ?? JPEG OSD will be abnormal //459 //469
#define PSEUDO_REGION_HEIGHT        (PSEUDO_REGION_END_LINE-PSEUDO_REGION_START_LINE+1) //344 //370 

//*** END_LINE max 262 for NTSC, and 312 for PAL


extern void mySleep(DWORD t);

// #define NO_GDI

// Brian0.84a-2nd, update DRAM variable locations, add Top/Bottom for RISC reference
#define CT908_DRAM_REG_BASE_TOP 0x016C  // DRAM variable, tell RISC region 0 top address
#define CT908_DRAM_REG_BASE_BOT 0x016D  // DRAM variable, tell RISC region 0 bottom address

//#define GDI_CLEAR_REGION_BY_WRITE_DRAM    // Clear the whole region by writing DRAM directly

#ifndef NO_GDI

#define SETUP_ICON_USE_ONE_BMP
#define SPEAKER_HIGHLIGHT_WITH_RECTANGLE

//#define GDI_EMULATION // define this to use S/W to emulate the GDI operation

// Alan2.36 support unicode
#ifdef SUPPORT_UNICODE

WORD _GDI_TranslateChar(WORD wChar);

WORD _wGDITempString[GDI_STRING_LENGTH+1];
WORD _wSmallIndex, _wBigIndex, _wHalfIndex;

WORD code __wCharWHTable[]=
{
#include "CharInfo.txt"
};

WORD code __wReferenceTable[]=
{
#include "RefTable.txt"
};

WORD code __wUnicodeTable[]=
{
#include "CodeTable.txt"
};
#endif

#ifdef GDI_EMULATION

BYTE code FontData[]=
{

#include "Eng_2bit.txt" // 0~1, A~Z, a~z

};
#endif

DWORD code Palette_0[]=    // Palette 0 data, it will be put at palette entry 254, 255
{                          // the purposr is to make sure palette entry 255 is transparency
1,                          // one DWORD entry, 
0x00000000                  // bit 19 indicate Mix_Enable
};

// Brian1.20
#if (!defined(REMOVE_SETUP_ICON)) || (!defined(REMOVE_SETUP_SPEAKER_TEST))

DWORD code Palette_Setup[]=    // Palette 1 data, for Setup icon bitmap
{
#include "bmp/PalSetup.txt"                  // bit 8/24 indicate Mix_Enable
};
#endif

DWORD code Palette_Button[]=    // Palette 2 data, for button bitmap
{
#include "bmp/PalButtn.txt"                  // bit 8/24 indicate Mix_Enable
};

#ifndef NO_SCREEN_SAVER // Brian1.20
// Brian0.91, Screen saver palette
DWORD code Palette_ScreenSaver[]=    // Palette 4 data, for button bitmap
{
//alex2.34,baseline saver for porable 
//Brian2.37 //alex2.37,change baseline_saver as Support_Mini_Screen_Saver
#ifdef  SUPPORT_MINI_SCREEN_SAVER

#include "Palette.ico"    

#else //#ifdef  SUPPORT_MINI_SCREEN_SAVER

// Brian0.91, Screen saver palette
#include "Palette.txt"                  // bit 8/24 indicate Mix_Enable

#endif //#ifdef  SUPPORT_MINI_SCREEN_SAVER

};
#endif

GDI_REGION_INFO code __RegionList[NUMBER_OF_REGION] =    // declare the region list
{
                    {   // region ID 0
                        GDI_REGION_WIDTH, GDI_REGION_HEIGHT,        // width, height
                        // Brian0.86, 4-bit OSD
#ifdef GDI_4_BIT_OSD
                        1,              // 0: 4 colors, 1: 16 colors, 2: 256 colors
#else
                        2,
#endif
                        REGION_T_ADDR0+(GDI_REGION_WIDTH>>2)-4,  // region top field address in DRAM
                        REGION_B_ADDR0+(GDI_REGION_WIDTH>>2)-4  // region bottom field address in DRAM
                    },
                    {   // region ID 1
                        GDI_REGION_WIDTH, GDI_REGION_HEIGHT,        // width, height
                        2,              // 0: 4 colors, 1: 16 colors, 2: 256 colors
                        REGION_T_ADDR1+(GDI_REGION_WIDTH>>2)-4,  // region top field address in DRAM
                        REGION_B_ADDR1+(GDI_REGION_WIDTH>>2)-4  // region bottom field address in DRAM
                    },
                    {   // region ID 2, resource database
                        GDI_REGION_WIDTH, GDI_REGION_2_HEIGHT,        // width 640, height 200
                        2,              // 0: 4 colors, 1: 16 colors, 2: 256 colors
                        REGION_T_ADDR2+(GDI_REGION_WIDTH>>2)-4,  // region top field address in DRAM
                        REGION_B_ADDR2+(GDI_REGION_WIDTH>>2)-4  // region bottom field address in DRAM
                    },

                    // Brian0.85
                    // During region initialization stage,  the OSD must be enabled, so the GXA command could work.
                    // Since the OSD is on, we need a region for display purpose, and we should write DRAM data directly to clear this region first
                    {   // region ID 3, dummy region
                        GDI_REGION_3_WIDTH, GDI_REGION_3_HEIGHT,        // width 4, height 2 
                        2,              // 0: 4 colors, 1: 16 colors, 2: 256 colors
                        REGION_T_ADDR3,  // region top field address in DRAM
                        REGION_T_ADDR3 //REGION_B_ADDR3  // region bottom field address in DRAM
                    }


};

GDI_PLANE_INFO code    _Plane =    // declare the plane 
                       {
                            PLANE_T_ADDR,    
                            PLANE_B_ADDR,
                            PLANE_T_SIZE,
                            PLANE_B_SIZE,
                            PLANE_PAL_ADDR
                        };

GDI_PALETTE_INFO code   __PaletteList[] =  // declare the palette list
                        {   // palette ID 0
                            {255, PAL_ADDR, Palette_0},        // palette entry 255
#if (!defined(REMOVE_SETUP_ICON)) || (!defined(REMOVE_SETUP_SPEAKER_TEST))
                            {0, PAL_ADDR, Palette_Setup},        // start from DWORD entry 0
#else
                            {255, PAL_ADDR, Palette_0},        // palette entry 255, just to keep the sequence in the list
#endif
                            {0, PAL_ADDR, Palette_Button},        // start from DWORD entry 0
                            // Brian0.86, 4-bit OSD
                            {15, PAL_ADDR, Palette_0}             // palette entry 15
#ifndef NO_SCREEN_SAVER // Brian1.20
                            ,        
                            {0,   PAL_ADDR, Palette_ScreenSaver}    // Brian0.91, start from entry 0
#endif
                        };


//#else //#ifndef GDI_EMULATION

//Brian0.84p, move Setup Icons to GDI2.c

/*
DWORD code _aIconLanguageNormal[]=
{
#include "bmp/LangNorm.txt"
};
DWORD code _aIconScreenNormal[]=
{
#include "bmp/ScrnNorm.txt"
};

DWORD code _aIconAudioNormal[]=
{
#include "bmp/AudiNorm.txt"
};


DWORD code _aIconCustomNormal[]=
{
#include "bmp/CustNorm.txt"
};


DWORD code _aIconExitNormal[]=
{
#include "bmp/ExitNorm.txt"
};
*/

#ifndef SETUP_ICON_USE_ONE_BMP

DWORD code _aIconLanguageOver[]=
{
#include "bmp/LangOver.txt"
};

DWORD code _aIconLanguageDown[]=
{
#include "bmp/LangDown.txt"
};

DWORD code _aIconScreenOver[]=
{
#include "bmp/ScrnOver.txt"
};

DWORD code _aIconScreenDown[]=
{
#include "bmp/ScrnDown.txt"
};

DWORD code _aIconAudioOver[]=
{
#include "bmp/AudiOver.txt"
};

DWORD code _aIconAudioDown[]=
{
#include "bmp/AudiDown.txt"
};

DWORD code _aIconCustomOver[]=
{
#include "bmp/CustOver.txt"
};

DWORD code _aIconCustomDown[]=
{
#include "bmp/CustDown.txt"
};

DWORD code _aIconExitOver[]=
{
#include "bmp/ExitOver.txt"
};

#endif // #ifndef SETUP_ICON_USE_ONE_BMP

// Brian0.84p, move to GDI2.c
/*
DWORD code _aButton120x40Normal[]=
{
#include "bmp/120x40_N.txt"
};

DWORD code _aButton120x40Disable[]=
{
#include "bmp/120x40_D.txt"
};

DWORD code _aButton120x40Highlight[]=
{
#include "bmp/120x40_H.txt"
};

DWORD code _aButton40x40Normal[]=
{
#include "bmp/40x40_N.txt"
};

DWORD code _aButton40x40Disable[]=
{
#include "bmp/40x40_D.txt"
};

DWORD code _aButton40x40Highlight[]=
{
#include "bmp/40x40_H.txt"
};

*/


// Brian0.84p, move to GDI1.c
/*
DWORD code _aImageSpeaker[]=
{
#include "bmp/speaker.txt"
};
*/

#ifndef SPEAKER_HIGHLIGHT_WITH_RECTANGLE 

DWORD code _aImageSpeakerLeft[]=
{
#include "bmp/spkr_L.txt"
};

DWORD code _aImageSpeakerRight[]=
{
#include "bmp/spkr_R.txt"
};

DWORD code _aImageSpeakerLS[]=
{
#include "bmp/spkr_LS.txt"
};

DWORD code _aImageSpeakerRS[]=
{
#include "bmp/spkr_RS.txt"
};

DWORD code _aImageSpeakerCenter[]=
{
#include "bmp/spkr_C.txt"
};

DWORD code _aImageSpeakerSW[]=
{
#include "bmp/spkr_SW.txt"
};

#endif //#ifndef SPEAKER_HIGHLIGHT_WITH_RECTANGLE

//#endif //#ifndef GDI_EMULATION

BYTE    __bTextFgColor;
BYTE    __bTextBgColor;
BYTE    __bShadowColor_1;
BYTE    __bShadowColor_2;

//BYTE    _bGDIInit=0; // Brian2.31, remove it, no one reference


#ifdef GDI_EMULATION

#define BUF_SIZE (512*4)
unsigned char buf1[BUF_SIZE];

void _DownloadTable(void);

BYTE    __bPixelBuffer[704];
DWORD   _dwGDITemp2;
#endif

BYTE    _bGDITemp;
//Alan2.36 add one more variable for unicode support
#ifdef SUPPORT_UNICODE
BYTE    _bGDITemp2;
#endif
WORD    _wGDITemp;
//Alan2.36 add one more variable for unicode support
#ifdef SUPPORT_UNICODE
WORD    _wGDITemp2;

⌨️ 快捷键说明

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