?? osd.c
字號:
/* SCCSID @(#)osd.c 1.15 6/4/98 */ #ifdef OSD#include "../mvd.h"#include "../common.h"#ifdef SHARE_DATA#include "../const.h"#endif#include "util.h"#include "osd.h"#include "display.h"#include "dispinfo.h"#include "../vcxi.h"#include "../vcd.h"#include "common1.h"#include "../fsosd.h"#ifdef OSD_COMPRESSextern void OSD_decompression (int, unsigned char *, unsigned char *, unsigned char *, unsigned short *);#endif /* OSD_COMPRESS */int OSD2_X,OSD2_Y,OSD2_W,OSD2_H;void EVD_OSD_init(void){ int i; OSD_on=0; VCD30_OSD_DRAM_START = evd_disp_info[disp_mode].OSD_start; mvd[vid_scn_osd_hstart] = OSD_hstart1 = evd_disp_info[disp_mode].OSD_X; mvd[vid_scn_osd_hend] = OSD_hend1 = evd_disp_info[disp_mode].OSD_X + evd_disp_info[disp_mode].OSD_W; if (vcx_scn_height == 288){ mvd[vid_scn_osd_vstart] = OSD_vstart1 = evd_disp_info[disp_mode].OSD_Y +2; mvd[vid_scn_osd_vend] = OSD_vend1 = OSD_vstart1 + evd_disp_info[disp_mode].OSD_H - 1; } else{ mvd[vid_scn_osd_vstart] = OSD_vstart1 = (evd_disp_info[disp_mode].OSD_Y )*13/16 + 5; mvd[vid_scn_osd_vend] = OSD_vend1 = OSD_vstart1 + evd_disp_info[disp_mode].OSD_H - 1; } mvd[vid_scn_osd_startstop] = 0x5560; mvd[vid_scn_osd_misc] = 0x44; mvd[vid_scn_osd_palette+ 0] = OSD_CLEAR; /* 7000,Background */ mvd[vid_scn_osd_palette+ 1] = (OSD_BLACK | 0xf); /* e00b,Edge */ mvd[vid_scn_osd_palette+ 2] = (OSD_GREEN | 0xb); /* 399f,Extra color */ mvd[vid_scn_osd_palette+ 3] = (OSD_WHITE | 0xf); /* 700f,Foreground */ mvd[vid_scn_osd_misc] = 0x40; mvd[vid_scn_osd_misc] = 0x01; ClrOsd(); if (disp_mode<2){ ClrOsd2(); } VCD30_OSD_TOTAL_AREAS = 1;}#ifdef BILINGUAL_OSDvoid OutputOsd(line, row, emsg, cmsg)char * cmsg;#elsevoid OutputOsd(line, row, emsg)#endif /* BILINGUAL_OSD */int line, row;char * emsg;{ int count; int head, offset, dest; int big; int linewidth = evd_disp_info[disp_mode].OSD_W/4; /* In BYTE */ unsigned char *msg;#ifdef BILINGUAL_OSD msg = (OSD_language == CHINESE_OSD) ? cmsg : emsg;#else msg = emsg;#endif /* Note, OSD_W is in pixels. Each pixel is 2b */ head = VCD30_OSD_DRAM_START * 4 + ((row-1) * linewidth * OSD_CHAR_HEIGHT/2) + (line-1)*6; offset = 0; count = 0; if (OSD2_Y < 82) { Close_OSD2(); } do { unsigned int ctmp = msg[count]; if (ctmp == 0) break; big = (ctmp >= FONT_CSTART); dest = head + (offset << 2) + (offset << 1); OSD_copy_one_char(ctmp, big, dest, (linewidth/4)); offset++; if (big) offset++; count++; } while (1); Open_OSD1();}void ClrOsd(void){ long pDst; unsigned int i, j; int tmp; tmp = (evd_disp_info[disp_mode].OSD_W>>4)*evd_disp_info[disp_mode].OSD_H; ClrOSD_comm(VCD30_OSD_DRAM_START,tmp);}void ClrOSD_comm(int addr, int len){ int j; int *p; p = (int*)dram(addr); for( j=0; j<len; j++){ *(int*)p=0; p++; }}void ClrOsd2(void){ int tmp; long pDst; unsigned int i, j; tmp = (evd_disp_info[disp_mode].OSD_H)*(evd_disp_info[disp_mode].OSD_W>>4); ClrOSD_comm(VCD30_OSD_DRAM_START+tmp,OSD_size-tmp);}void OSD2_rect(int x, int y, int w, int h){ long pDst; unsigned int i, j, k; int tmp, htmp; unsigned int mask = 0xa0000000; Close_OSD2(); OSD2_X = x; OSD2_Y = y; OSD2_W = w; OSD2_H = h; htmp = OSD2_comm(x,y,w,h); tmp = (evd_disp_info[disp_mode].OSD_H)*(evd_disp_info[disp_mode].OSD_W>>4); pDst = VCD30_OSD_DRAM_START+tmp; tmp = 0; for (k=0;k<(w&0x07);k++){ tmp |= mask; mask >>= 4; } for ( i= 0; i < htmp; i++){ for (j=0; j<w>>3; j++){ *(long*)dram(pDst)=0xaaaaaaaa; pDst++; } if (w&0x07){ *(long*)dram(pDst)=tmp; pDst++; } }}int OSD2_comm(int x, int y, int w, int h){ OSD_hstart2 = x<<1; OSD_hend2 = (x+(((w+7)>>3)<<3))<<1; /*to keep it DW boundary*/ if (vcx_scn_height == 240){ OSD_vstart2 = y*13/16+5; OSD_vend2 = (y+h-1)*13/16+5; return(h*13/16); } else{ OSD_vstart2 = y +2; OSD_vend2 = y+h-1 +2; return(h); }}void OSD2(int x, int y, int w, int h){ long pDst; unsigned int i, j; int tmp, htmp; if (y<82) { Close_OSD1(); } OSD2_comm(x,y,w,h);}void Close_OSD1(){ OSD1 = 0; ClrOsd();} void Close_OSD2(){ VCD30_OSD_TOTAL_AREAS = 1; ClrOsd2();}#if 0void Open_OSD1(){ OSD1 = 1;}void Open_OSD2(){ VCD30_OSD_TOTAL_AREAS = 2;}void Stop_OSD(){ OSD_on = 0;}void Start_OSD(){ OSD_on = 1;}#endif/* trans is 0-7: 0: trans, 7: overlay */void OSD_color(int color, int trans){ mvd[vid_scn_osd_startstop] = 0x5560; /* cr = 5, b = 21, e = 32 */ mvd[vid_scn_osd_misc] = 0x4; mvd[vid_scn_osd_palette+ 2] = (color | 0x8 | trans); /* 399f,Extra color */}#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -