📄 osdmenu.lst
字号:
241 1 len=strlen(struct_InputSelection[i].Name);
242 1 WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(0+title)+OSD_INFO_SUB_X, struct_InputSelection[i].Name, len
- );
243 1
244 1 // Display ColorSystem
245 1 #if defined( SUPPORT_PC ) || defined( SUPPORT_DTV )
246 1 i = GetInputSelection();
247 1 if( i==PC || i==DTV ){
248 2 len=strlen(GetPCInputSourceName());
249 2 WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(1+title)+OSD_INFO_SUB_X, GetPCInputSourceName(), len );
250 2 }
251 1 else
252 1 #endif
253 1 {
254 2 len=strlen(struct_VInputStd[GetVInputStdInx()].Name);
255 2 WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(1+title)+OSD_INFO_SUB_X, struct_VInputStd[GetVInputStdInx(
-)].Name, len );
256 2 }
257 1
258 1 #if defined( SUPPORT_PC ) || defined( SUPPORT_DTV )
259 1 //IHF
260 1 MeasureAndWait(3);
261 1 #endif
262 1
263 1 ltoa_K(IHF, mstr, 1);
264 1 len=strlen(mstr);
265 1 WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(2+title)+OSD_INFO_SUB_X, mstr, len );
266 1
267 1 utoa(IVF,mstr,10);
268 1 len=strlen(mstr);
269 1 WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(3+title)+OSD_INFO_SUB_X, mstr, len );
270 1
271 1 //FWRev
272 1 i = ReadEEP(EEP_FWREV_MAJOR);
273 1 mstr[0] = i + '0';
274 1 mstr[1] = '.';
275 1 i = ReadEEP(EEP_FWREV_MINOR);
276 1 mstr[2] = (i/0x10) + '0';
277 1 mstr[3] = (i%0x10) + '0';
278 1 mstr[4] = '\0';
279 1
280 1 WriteStringToAddr(OSDMENU_SUBADDR+MENU_WIDTH*(4+title)+OSD_INFO_SUB_X, mstr, 4 );
281 1
282 1 }
283
284
285 //********************************************************************
286 //
287 // Functions for BAR.
288 //
289 //********************************************************************
290 #define VOLBAR_LENGTH 21+3
291 void DisplayVolumebar(BYTE val)
292 {
293 1 CODE BYTE BAR_ROM_TABLE[] = {
294 1 0x01, // ...
295 1 0x02,0x02, // |..
296 1 0x05,0x05, // ||.
297 1 0x03, // |
298 1 0x04, // |||
299 1 };
300 1
C51 COMPILER V7.50 OSDMENU 04/01/2008 15:02:25 PAGE 6
301 1 BYTE i;
302 1 BYTE Bar_str[VOLBAR_LENGTH]={ 0x04, 0x04, 0x04, 0x04, 0x04,
303 1 0x04, 0x04, 0x04, 0x04, 0x04,
304 1 0x04, 0x04, 0x04, 0x04, 0x04,
305 1 0x04, 0x04, 0x04, 0x04, 0x04, 0x03,' ',' ',' ' };
306 1 WORD addr;
307 1
308 1 if(val < 100)
309 1 {
310 2 Bar_str[val/5] = BAR_ROM_TABLE[val%5];
311 2 for(i = val/5 + 1; i < 20; i++)
312 2 Bar_str[i] = BAR_ROM_TABLE[0];
313 2 }
314 1
315 1 if( Bar_str[0] == 0x01 ) Bar_str[0] = 0x02; // |..
316 1
317 1 // Number
318 1 Bar_str[23] = val % 10 + '0'; val /= 10;
319 1 Bar_str[22] = val % 10 + '0'; val /= 10;
320 1 Bar_str[21] = val + '0';
321 1 if( Bar_str[21] == '0' ) Bar_str[21] = ' ';
322 1
323 1 addr = OSDMENU_BARADDR + 1 + VOLBAR_LENGTH; //
324 1
325 1 WriteStringToAddr(addr, Bar_str, VOLBAR_LENGTH );
326 1
327 1 }
328
329 BYTE Get_cursor_item(BYTE id)
330 {
331 1 BYTE i=NIL, tid;
332 1
333 1 #ifdef DEBUG_OSD
dPrintf("\r\n++(Get_cursor_item) id:%d", (WORD)id);
#endif
336 1
337 1
338 1 switch ( id ) {
339 2 case INPUTSELECTION: tid = GetInputSelection();
340 2 break;
341 2
342 2 default: return 0;// The first one
343 2 }
344 1
345 1 i = GetTargetChild( tid );
346 1
347 1 if( i==NIL ) { //couldn't find
348 2 dPuts("___Couldn't find cursor!!");
349 2 i=0;
350 2 }
351 1
352 1 #ifdef DEBUG_OSD
dPrintf("___Cursor:%d\r\n__(GetDefaultForChoiceMenu)", (WORD)i);
#endif
355 1
356 1 return i;
357 1 }
358
359 //==================================================================================================
360 // Func: DisplayOSDMenuOneItem
361 //
362 //
C51 COMPILER V7.50 OSDMENU 04/01/2008 15:02:25 PAGE 7
363 void DisplayOSDMenuOneItem( winno, CODE_P struct DefineMenu *DMp, BYTE x, BYTE y, BYTE NOTViewflag )
364 {
365 1 BYTE i,j,k,IconColor;
366 1 WORD addr;
367 1 CODE_P BYTE *Str;
368 1 CODE BYTE RightSign_str[]= { 0x1c,' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',0 };// RIGHT mark
369 1
370 1 #ifdef DEBUG_OSD
dPrintf("\r\n++(DisplayOSDMenuOneItem) ");
#endif
373 1
374 1 if( cur_osdwin == OSDMENU_TOPWIN) addr = OSDMENU_MAINADDR;
375 1 else addr = OSDMENU_SUBADDR;
376 1
377 1 addr = addr + x + y*MenuFormat->width;
378 1
379 1 #ifdef DEBUG_OSD
dPrintf("\r\nStartaddr:%d", addr);
#endif
382 1
383 1 if( DMp->IconColor !=NIL ) { // Draw Icon
384 2 //if(OnChangingValue) IconColor = BG_COLOR_BLACK|CH_COLOR_WHITE|EXTENDED_COLOR;
385 2 //else
386 2 IconColor = DMp->IconColor;
387 2
388 2 Str = DMp->Icon;
389 2 j=strlen(Str);
390 2 WriteStringToAddr(addr, Str, j);
391 2
392 2 x += ICON_CH_SZ;
393 2 }
394 1
395 1 if( DMp->DescColor !=NIL ) { // Draw Desc.
396 2
397 2 Str = DMp->Desc[OSDLang];
398 2 j=strlen(Str);
399 2
400 2 for( i=0,k=0; i<j; i++ )
401 2 if( *(Str+i) == ROMFONT || *(Str+i) == RAMFONT ) k++;
402 2
403 2 #ifdef DEBUG_OSD
dPrintf("\r\naddr:%d x:%d y:%d MenuFormat->width:%d", addr, (WORD)x, (WORD)y, (WORD)MenuFormat->width );
#endif
406 2
407 2 WriteStringToAddr(addr, Str, j);
408 2
409 2 if( (j-k ) < MAX_DESC )
410 2 ClearDataCnt(addr+j-k, MAX_DESC-j+k);
411 2
412 2 addr+=MAX_DESC;
413 2
414 2 }
415 1
416 1 if( OSDMenuLevel < 3) // Main Menu Item.
417 1 if ( NOTViewflag==1 ) return; // In case of not need diplay contents. ex, BAR windows, top menu display.
418 1
419 1 // Menu contents view
420 1 /*if( x < (MenuFormat->width) )
421 1 if( x < (MAX_DESC + ICON_CH_SZ) ){
422 1 //x+=2;
423 1 ClearDataCnt(addr, 2);
424 1 addr+=2;
C51 COMPILER V7.50 OSDMENU 04/01/2008 15:02:25 PAGE 8
425 1 }*/
426 1
427 1 switch (DMp->Type ) {
428 2 case BAR: // Draw Bar and Number value
429 2 DisplayViewBar( addr, GetItemValue(DMp->Id));
430 2 break;
431 2
432 2 case NUMBER: // Draw Number value
433 2 {
434 3 CODE_P BYTE *ptr;
435 3 ptr = DMp->TypeData;
436 3 switch ( DMp->Id ) {
437 4 #if defined( PAL_TV )
438 4 case MANUAL_TUNE_CHANNEL:
439 4 WriteStringToAddr(addr, RightSign_str, BARNUM_LENGTH);
440 4 break;
441 4 #endif
442 4 default:
443 4 DrawNum( addr, (CODE_P struct NumType *)ptr, GetItemValue(DMp->Id) );
444 4 break;
445 4 }
446 3 }
447 2 break;
448 2 case ENUM_STRING:
449 2 {
450 3 CODE_P BYTE *ptr;
451 3
452 3 ptr = DMp->TypeData;
453 3 DrawStringByLang( addr, (CODE_P struct EnumType *)ptr, GetItemValue(DMp->Id) );
454 3
455 3 }
456 2 break;
457 2
458 2 case NUMBER_STRING:
459 2 case CHOICEMENU:
460 2 case OSDMENU:
461 2 case ACTION:
462 2 WriteStringToAddr(addr, RightSign_str, BARNUM_LENGTH);
463 2 break;
464 2
465 2 }
466 1
467 1 }
468
469 void ClearCursor(void)
470 {
471 1 //BYTE cursor_x;
472 1 BYTE cursor_y;
473 1 WORD addr;
474 1
475 1 if( cursor_item==NIL )
476 1 return;
477 1
478 1 //cursor_x = MenuFormat->CursorStart;
479 1 cursor_y = cursor_item + ( MenuFormat->TitleColor ==NIL ? 0 : 1 );
480 1 if( cur_osdwin == 4 ) addr = 0;
481 1 else addr = 10;
482 1 addr += cursor_y*MenuFormat->width;
483 1 DrawAttrCnt(addr, DEFAULT_COLOR, MenuFormat->width );
484 1
485 1 }
486
C51 COMPILER V7.50 OSDMENU 04/01/2008 15:02:25 PAGE 9
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -