📄 extosdlib.h
字号:
BYTE Direction;
} ST_OSD_SLIDER_CTRL;
typedef struct ST_OSD_SLIDER2BPP_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
ST_OSD_UNI_CONTROL_CHARS ControlCharSet;
WORD Associate;
BYTE Direction;
} ST_OSD_SLIDER2BPP_CTRL;
typedef struct ST_OSD_VERTICALSLIDER_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
ST_OSD_UNI_CONTROL_CHARS ControlCharSet;
WORD Associate;
BYTE Direction;
} ST_OSD_VERTICALSLIDER_CTRL;
typedef struct ST_OSD_VERTICALSLIDERBUTTON_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
ST_OSD_UNI_CONTROL_CHARS ControlCharSet;
WORD Associate;
BYTE Direction;
} ST_OSD_VERTICALSLIDERBUTTON_CTRL;
typedef ST_OSD_VERTICALSLIDERBUTTON_CTRL ST_OSD_VERTICALSLIDERBUTTON2BPP_CTRL;
typedef ST_OSD_VERTICALSLIDER_CTRL ST_OSD_VERTICALSLIDER2BPP_CTRL;
typedef struct ST_OSD_SLIDERBUTTON_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
ST_OSD_UNI_CONTROL_CHARS ControlCharSet;
WORD Associate;
BYTE Direction;
} ST_OSD_SLIDERBUTTON_CTRL;
typedef struct ST_OSD_SLIDERBUTTON2BPP_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
ST_OSD_UNI_CONTROL_CHARS ControlCharSet;
WORD Associate;
BYTE Direction;
} ST_OSD_SLIDERBUTTON2BPP_CTRL;
typedef struct ST_OSD_USED_GLYPH_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
BYTE Horizontal : 2;
BYTE Vertical : 2;
ST_OSD_UNI_USED_GLYPHS UsedGlyphs;
} ST_OSD_USED_GLYPH_CTRL;
typedef struct ST_OSD_STATICTEXT_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
BYTE Horizontal : 2;
BYTE Vertical : 2;
ST_OSD_UNI_TEXT Text;
} ST_OSD_STATICTEXT_CTRL;
typedef struct ST_OSD_DYNAMICTEXT_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
BYTE Horizontal : 2;
BYTE Vertical : 2;
ST_OSD_UNI_USED_GLYPHS UsedGlyphs;
WORD AssociatePtrSegment;
WORD AssociatePtrOffset;
} ST_OSD_DYNAMICTEXT_CTRL;
typedef ST_OSD_STATICTEXT_CTRL ST_OSD_TEXTBUTTON_CTRL;
typedef ST_OSD_STATICTEXT_CTRL ST_OSD_THREECOLORTEXTBUTTON_CTRL;
typedef struct ST_OSD_LONGVALUE_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
BYTE Horizontal : 2;
BYTE Vertical : 2;
ST_OSD_UNI_USED_GLYPHS UsedGlyphs;
WORD Associate;
SWORD MinValue;
SWORD MaxValue;
} ST_OSD_LONGVALUE_CTRL;
typedef struct ST_OSD_LONGVALUEBUTTON_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
BYTE Horizontal : 2;
BYTE Vertical : 2;
ST_OSD_UNI_USED_GLYPHS UsedGlyphs;
WORD Associate;
SWORD MinValue;
SWORD MaxValue;
} ST_OSD_LONGVALUEBUTTON_CTRL;
typedef struct ST_OSD_NONPROPLONGVALUE_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
ST_OSD_UNI_CONTROL_CHARS ControlCharSet;
WORD Associate;
SWORD MinValue;
SWORD MaxValue;
BYTE Horizontal;
BYTE Vertical;
} ST_OSD_NONPROPLONGVALUE_CTRL;
typedef struct ST_OSD_NONPROPLONGVALUEBUTTON_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
ST_OSD_UNI_CONTROL_CHARS ControlCharSet;
WORD Associate;
SWORD MinValue;
SWORD MaxValue;
} ST_OSD_NONPROPLONGVALUEBUTTON_CTRL;
typedef struct ST_OSD_TABCONTROL_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
ST_OSD_UNI_CONTROL_CHARS ControlChars;
BYTE TabNum;
BYTE TabButtonRegion_XSize;
BYTE TabButtonRegion_YSize;
} ST_OSD_TABCONTROL_CTRL;
typedef struct ST_OSD_SHADOW_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
ST_OSD_UNI_CONTROL_CHARS ControlCharSet;
BYTE FixToCorner;
} ST_OSD_SHADOW_CTRL;
typedef struct ST_OSD_TIMINGINFO_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
BYTE Horizontal : 2;
BYTE Vertical : 2;
ST_OSD_UNI_USED_GLYPHS UsedGlyphs;
} ST_OSD_TIMINGINFO_CTRL;
typedef struct ST_OSD_FRAME_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
ST_OSD_UNI_CONTROL_CHARS ControlCharSet;
} ST_OSD_FRAME_CTRL;
typedef ST_OSD_FRAME_CTRL ST_OSD_FRAME2BPP_CTRL;
typedef ST_OSD_FRAME_CTRL ST_OSD_TABFRAME_CTRL;
typedef ST_OSD_FRAME_CTRL ST_OSD_TABFRAME2BPP_CTRL;
typedef struct ST_OSD_RECTANGLE_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
BYTE ROM * Colors;
} ST_OSD_RECTANGLE_CTRL;
typedef ST_OSD_RECTANGLE_CTRL ST_OSD_RECTANGLEBUTTON_CTRL;
#endif
// must be outside of tile support #ifdef, because it is used in the lib
typedef struct ST_OSD_TILE_CTRLStruct
{
BYTE XPos;
BYTE YPos;
BYTE XSize;
BYTE YSize;
WORD Address;
BYTE TileId;
BYTE DialogId;
BYTE ColorAttrib;
WORD ChrTbl2Bpp;
WORD ChrTbl1Bpp;
} ST_OSD_TILE_CTRL;
extern ST_OSD_TILE_CTRL ROM* xdata g_CurrentTiles[];
extern BYTE ROM B_TILE_SUPPORT;
//************************* typical osd controls ABOVE
//************************* Tiles
void GetActionOperandUnmodified (void);
//************************* Tiles ABOVE
//************************ Control specific function prototypes
void EraseControl();
void LoadColors();
void LoadControlChars();
void DrawDialog();
void LoadBitmap();
void DrawBitmap();
void SelectBitmapButton();
void DrawStaticText();
void SelectTextButton();
void UnselectTextButton();
void DisableThreeColorTextButton();
void DrawDynamicText ();
void DrawTabControl();
void SelectTabControl();
void UnselectTabControl();
void DrawShadow();
void DrawSlider();
void SelectSliderButton();
void DrawVerticalSlider();
void SelectVerticalSliderButton();
void DrawResolutionTimingInfo();
void DrawTimingInfo();
void DrawVFreqTimingInfo();
void DrawTruncatedTimingInfo();
void DrawVFreqTruncatedTimingInfo();
void DrawHFreqTruncatedTimingInfo();
void DrawHFreqTimingInfo();
void DrawLongValue();
void SelectLongValueButton();
void DrawNonPropLongValue();
void SelectNonPropLongValueButton();
void DrawFrame();
void SelectTabFrame();
void DrawRectangle();
void SelectRectangleButton();
extern xdata BYTE g_CurrentDialogColorAttr;
#define DecState gm_DecState
//************************ Control specific function prototypes ABOVE
//**************** primitives prototypes ******************************
extern BYTE ROM FontX;
extern BYTE ROM FontY;
#define SRAM_SIZE 10240
#define BYTES_PER_LINE_1BPP 2
#define SPACE_INDEX (0xFF)
extern BYTE ROM * ROM GlyphTblSet[]; // to be removed
extern BYTE xdata GM_CHIP[];
#define REG_ADDR_START GM_CHIP
// This macro enables the OSD rotation. All necessary code to support
// osd flip left/right will be included
//#define OSD_FLIP_SUPPORTED
// This macro enables the mirrored OSD
//#define OSD_MIRROR_SUPPORTED
// Define appropriate memory space for local variables
// Local variables of primitives are declared as LOCAL <type> LOCALMEM <var>
#define LOCAL idata
#define LOCALMEM
// Memory space for font/icon/control data
#define CTRLDATA ROM
// Buffer used for decompression
#define UNCOMPRESS_BUFFER ((BYTE *)&u_UnPack)
//typedef void CCF_ACCESS_FUNC(BYTE * data B_Value);
//extern xdata CCF_ACCESS_FUNC ROM* CFFAccessFuncTable[];
// Character blink On/Off periods. set these appropriately
#define BlinkOnPeriod 1
#define BlinkOffPeriod 1
// Osd direction
#define OsdNormal 0
#define OsdMirror 1
#define OsdFlipLeft 2
#define OsdFlipRight 3
// Text direction
#define Horizontal_Print 0
#define Vertical_Print 1
void OsdC_Init(void);
void OsdC_SetDirection(BYTE dir);
void SelectRectangle(BYTE rectId);
void OsdC_RectSetup(BYTE rectWidth, BYTE rectHeight, WORD AddrFont1BPP, WORD AddrFont2BPP, WORD AddrCCF );
void OsdC_PositionOsd (BYTE xOsd, BYTE yOsd, BYTE xSizeOsd, BYTE ySizeOsd, BYTE xRect, BYTE yRect, BYTE Stretch);
void OsdC_Show(void);
void OsdC_Hide(void);
void OsdC_OsdTransparency(BYTE value);
void OsdC_LoadColor(BYTE CTRLDATA* pntTbl, BYTE size, BYTE index_Table);
BYTE CTRLDATA *OsdC_FindGlyphHdr(BYTE glphTbl, BYTE glyph, BYTE number );
BYTE OsdC_GetNumGlyphs(BYTE glphTbl, BYTE glyph);
void OsdC_FillRect(BYTE xPos, BYTE yPos, BYTE width, BYTE height, BYTE charIndex, BYTE colorAttr);
void OsdC_Highlight(BYTE flag, BYTE color, WORD xPos, WORD yPos, WORD width, WORD height);
void OsdC_SetWinBkgnd(BYTE idWindow, BYTE color, WORD xPixel, WORD yPixel, WORD width, WORD height);
void OsdC_ClrWinBkgnd(BYTE idWindow);
void OsdC_PutChar(BYTE xPos, BYTE yPos, BYTE index);
void OsdC_SetAttr(BYTE xPos, BYTE yPos, BYTE attribute);
void OsdC_PutString(BYTE xPos, BYTE yPos, BYTE mode, BYTE size, BYTE *pntString);
void OsdC_FillRect_Attrib(BYTE xPos, BYTE yPos, BYTE width, BYTE height, BYTE attribute);
void OsdC_FillRect_Char(BYTE xPos, BYTE yPos, BYTE width, BYTE height, BYTE character);
void OsdC_SetIcon_Attrib(BYTE xPos, BYTE yPos, BYTE width , BYTE height, BYTE CTRLDATA* pntTbl, WORD mask);
void OsdC_DrawIcon(BYTE xPos, BYTE yPos, BYTE width, BYTE height, BYTE *pntTbl, BYTE *pColorAttrib, BYTE flags);
void OsdC_LoadIconCompressed(BYTE tblType, BYTE indexTable, BYTE CTRLDATA *pSrc);
void OsdC_LoadIcon(BYTE tbl_Bpp , BYTE index_Table, WORD size, BYTE CTRLDATA* pntTbl);
void OsdC_LoadGlyph(BYTE lang, BYTE glyph, BYTE hwCharIndex );
void OsdC_LoadFontData(BYTE tblType, WORD addressTbl, WORD blockSize, BYTE *ptrData);
void OsdC_Render(BYTE *glyph_string, BYTE *hrdw_string);
void OsdC_CCFFill(WORD startAddr, WORD howManyWords, WORD fillValue);
void OsdC_LoadBitMapCompressed(BYTE CTRLDATA *src, BYTE CTRLDATA* p_HwIndexes, BYTE CTRLDATA* p_ColorAttributes, BYTE nAttribs);
void LoadBitMapByte(BYTE B_Value);
void OsdC_Render16x16(BYTE *glyph_string, BYTE *hrdw_string);
void OsdC_Render16xXX(BYTE *glyph_string, BYTE *hrdw_string);
void OsdC_RenderGeneric(BYTE *glyph_string, BYTE *hrdw_string);
// color states and attributes
#define CATTR_BPP_MASK 0x01
#define CATTR_GetBPP(attr) ((attr & CATTR_BPP_MASK)? 2 : 1)
BYTE ROM * CM_GetAttrsPtr (BYTE ROM * ColorMap, BYTE CSIndex);
BYTE ROM * CM_LoadColors (BYTE ROM* ColorMap, BYTE CSIndex);
BYTE ROM * CM_GetCSPtr (BYTE ROM *ColorMap, BYTE CSIndex);
#define UseHwHighlight(csPtr) ((csPtr)[0] & 0x02)
#define CM_GetNAttrs(ColorMap) (ColorMap [0])
// HW Indices properties
extern pdata BYTE HWI_Properties[];
#define HWI_LEN HWI_Properties[0] // length
#define HWI_IDX HWI_Properties[1] // index to the first hw_index
#define HWI_TO HWI_Properties[2] // top offset
#define HWI_LO HWI_Properties[3] // left offset
#define HWI_TEST_H(hw_indices) (hw_indices[0]&0x40)
#define HWI_TEST_C(hw_indices) (hw_indices[0]&0x20)
void HWI_GetProperties(BYTE *hw_indices);
// app functions used by osd lib
/*
BriefDesc : Hardware Indexes Compression
Consecutive_ID : 6078
Submitter : VeniaminK
Veniamin code
*/
void FindLanfOffsets(WORD *glyph_offset, WORD *hrdw_offset, BYTE ROM*glyph_indices,
BYTE **hrdw_indices);
/*
End Veniamin Code
*/
void RenderStubCopySubFragData(BYTE ROM*fragData);
void RenderStubCopyMainFragData(BYTE ROM*fragData);
BYTE gmp_FlickerStatusModified(SDWORD fsVal, BYTE ROM *fsCtrl );
//*************** some definitions for osd state machine
#define SAT_CB_00_EVT_MASK (BIT3 | BIT4 | BIT5)
#define SAT_CB_00_ACT_MASK (BIT0 | BIT1 | BIT2)
#define SAT_CB_10_EVT_MASK (BIT2 | BIT3 | BIT4 | BIT5)
#define SAT_CB_10_CND_MASK (BIT0 | BIT1)
#define SAT_CB_11_MAC_MASK (BIT2 | BIT3 | BIT4)
#define SAT_CB_11_CND_MASK (BIT0 | BIT1)
#define SAT_CB_11_ATREF (BIT5)
#define SAT_CB_11_ATREF_MASK (BIT4 | BIT3 | BIT2 | BIT1 | BIT0)
#define SAT_CB_MASK (BIT7 | BIT6)
#define Fit_00(Event,Action) (((Event) << SAT_CB_00_EVT_SHIFT) | (Action))
#define Fit_10(Event,CndCtrl) (((Event) << SAT_CB_10_EVT_SHIFT) | (CndCtrl))
#define Fit_11(CndCtrl, MultiActn) (((MultiActn) << SAT_CB_11_MAC_SHIFT) | (CndCtrl))
#endif//#ifndef __EXTOSDLIB_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -