📄 lcd_osd.lst
字号:
291 1
292 1 Data[0] = (indicate == 3) ? length * 3 + 3 : length + 3;
C51 COMPILER V6.20c LCD_OSD 04/15/2004 12:59:12 PAGE 6
293 1 Data[1] = BURST;
294 1 Data[2] = OSD_DATA_92;
295 1 Data[3] = value;
296 1 Data[4] = 0;
297 1 RTDWrite(Data);
298 1
299 1 }
300
301 void OSD_Slider(unsigned char row, unsigned char col, unsigned char length, unsigned char value, unsigned
-char range,
302 unsigned char color, unsigned char color_slider)
303 {
304 1 unsigned int idata usStart_Addr;
305 1 unsigned char idata ucTemp;
306 1 unsigned int bound;
307 1
308 1 usStart_Addr = FONT_SELECT_ADDRESS;
309 1
310 1 for(ucTemp = 1; ucTemp < row+1; ucTemp ++)
311 1 usStart_Addr += Row_Info[0][ucTemp];
312 1
313 1 length = length -5;
314 1 bound = ((length-2)*6 + 2*3) * value;
315 1
316 1 // Set color
317 1 Data[0] = 6;
318 1 Data[1] = Y_INC;
319 1 Data[2] = OSD_ADDR_MSB_90;
320 1 Data[3] = (unsigned char)((((usStart_Addr + col) >>8 ) & 0x0f ) | 0x90);
321 1 Data[4] = (unsigned char)( (usStart_Addr + col) & 0x00ff);
322 1 Data[5] = (color << 4) & 0xf0;
323 1 Data[6] = 0;
324 1 RTDWrite(Data);
325 1
326 1 Data[0] = 5;
327 1 Data[1] = N_INC;
328 1 Data[2] = OSD_DATA_92;
329 1 Data[3] = (color << 4) & 0xf0;
330 1 Data[4] = (color << 4) & 0xf0;
331 1 Data[5] = 0;
332 1 RTDWrite(Data);
333 1
334 1 OSD_Line(row,col+5,12,((color_slider<<4) & 0xf0),2);
335 1 Data[0] = 6;
336 1 Data[1] = Y_INC;
337 1 Data[2] = OSD_ADDR_MSB_90;
338 1
339 1 Data[6] = 0;
340 1
341 1 for (row = 0; row < length; row++)
342 1 {
343 2 Data[3] = (unsigned char)((((usStart_Addr + col + row + 5) >> 8 ) & 0x0f ) | 0x50);
344 2 Data[4] = (unsigned char)( (usStart_Addr + col + row + 5) & 0x00ff);
345 2
346 2 if( row == 0 || row == (length-1) )
347 2 {
348 3 if( bound )
349 3 {
350 4 if( bound >= (range*3) )
351 4 {
352 5 Data[5] = (row==0) ? 0x13 : 0x1e;
353 5 bound = bound - range*3;
C51 COMPILER V6.20c LCD_OSD 04/15/2004 12:59:12 PAGE 7
354 5 }
355 4 else
356 4 {
357 5 color = (bound << 4) / (range*3);
358 5 bound = 0;
359 5
360 5 if (4 > color)
361 5 Data[5] = (row==0) ? 0x10 : 0x1b;
362 5 else if (8 > color)
363 5 Data[5] = (row==0) ? 0x11 : 0x1c;
364 5 else if (12 > color)
365 5 Data[5] = (row==0) ? 0x12 : 0x1d;
366 5 else
367 5 Data[5] = (row==0) ? 0x13 : 0x1e;
368 5 }
369 4 }
370 3 else
371 3 {
372 4 Data[5] = (row==0) ? 0x10 : 0x1b;
373 4 }
374 3 }
375 2 else
376 2 {
377 3 if( bound )
378 3 {
379 4 if( bound >= (range*6) )
380 4 {
381 5 Data[5] = 0x1a;
382 5 bound = bound - range*6;
383 5 }
384 4 else
385 4 {
386 5 color = (bound << 4) / (range*6);
387 5 bound = 0;
388 5
389 5 if (1 > color)
390 5 Data[5] = 0x14;
391 5 else if (4 > color)
392 5 Data[5] = 0x15;
393 5 else if (6 > color)
394 5 Data[5] = 0x16;
395 5 else if (9 > color)
396 5 Data[5] = 0x17;
397 5 else if (11 > color)
398 5 Data[5] = 0x18;
399 5 else if (14 > color)
400 5 Data[5] = 0x19;
401 5 else
402 5 Data[5] = 0x1a;
403 5 }
404 4 }
405 3 else
406 3 {
407 4 Data[5] = 0x14;
408 4 }
409 3
410 3 }
411 2
412 2 RTDWrite(Data);
413 2
414 2 }
415 1
C51 COMPILER V6.20c LCD_OSD 04/15/2004 12:59:12 PAGE 8
416 1 range = value / 10;
417 1 row = value - (range * 10); // x1
418 1 color = range / 10; // x100
419 1 range = range - (color * 10); // x10
420 1
421 1 row = row + 0x01;
422 1 range = (range || color) ? range + 0x01 : 0x00;
423 1 color = color ? color + 0x01 : 0x00;
424 1
425 1 Data[0] = 5;
426 1 Data[1] = Y_INC;
427 1 Data[2] = OSD_ADDR_MSB_90;
428 1 Data[3] = (unsigned char)((((usStart_Addr + col) >>8 ) & 0x0f ) | 0x50);
429 1 Data[4] = (unsigned char)( (usStart_Addr + col ) & 0x00ff);
430 1 Data[5] = 0;
431 1 RTDWrite(Data);
432 1
433 1 Data[0] = 6;
434 1 Data[1] = N_INC;
435 1 Data[2] = OSD_DATA_92;
436 1 Data[3] = color; // Number x100
437 1 Data[4] = range; // Number x10
438 1 Data[5] = row; // Number x1
439 1 Data[6] = 0;
440 1 RTDWrite(Data);
441 1
442 1 }
443
444
445 void Init_Page(unsigned char index)
446 {
447 1 index = index;
448 1 OSD_Position(OSD_ENABLE);
449 1 OSD_Clear(5, 11, 15, 1); //Need to be modified case by case.
450 1 if( ucOSD_Page_Index == 1)
451 1 RTDOSDW(OSD_Window_Setting);
452 1 }
453
454 void Show_Osd_Page(unsigned char Page_Num,unsigned char* Page_Attr,unsigned char OSD_Table_Num)
455 {
456 1 Init_Page(Page_Num);
457 1 RTDOSDW(Page_All_Atb);
458 1 RTDOSDW(OSD_PAGE_All_TABLE[0][stGUD1.FUNCTION & 0x07]);
459 1 RTDOSDW(Page_Attr);
460 1 RTDOSDW(OSD_PAGE_TABLE[OSD_Table_Num][stGUD1.FUNCTION & 0x07]);
461 1 Show_Mode();
462 1 }
463
464 void OSD_Clear(unsigned char row_start, unsigned char height, unsigned char col_start, unsigned char width
-)
465 {
466 1 width = width;
467 1 if (height)
468 1 {
469 2 do
470 2 {
471 3 OSD_Line(row_start, col_start, Row_Info[0][row_start+1], 0x00, 3);
472 3 //OSD_Line(row_start, col_start, width, 0x00, 3);
473 3 row_start++;
474 3 }
475 2 while (--height);
476 2 }
C51 COMPILER V6.20c LCD_OSD 04/15/2004 12:59:12 PAGE 9
477 1 }
478
479 void Bright_Contrast_Adjust(unsigned char* variable,unsigned char Key)
480 {
481 1 if (NOTIFY_RIGHT_KEY == Key)
482 1 {
483 2 if (100 <= *variable)
484 2 return;
485 2
486 2 if (KEY_TURBO_ENABLE > ucKey_Issued)
487 2 *variable = 100 > *variable ? *variable + 1 : 100;
488 2 else
489 2 *variable = 99 > *variable ? *variable + 2 : 100;
490 2 }
491 1 else
492 1 {
493 2 if (0 == *variable)
494 2 return;
495 2
496 2 if (KEY_TURBO_ENABLE > ucKey_Issued)
497 2 *variable = 0 < *variable ? *variable - 1 : 0;
498 2 else
499 2 *variable = 1 < *variable ? *variable - 2 : 0;
500 2 }
501 1 }
502
503 void Osd_Change_Item(unsigned char Pess_Key,unsigned char Item_Num)
504 {
505 1 if (ucOSD_Item_Index0)
506 1 {
507 2 // Select and highlight the next/previous item
508 2 //OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
509 2 // , 0, 0, 14, 251, 0, 1, 0);
510 2 if (NOTIFY_RIGHT_KEY == Pess_Key)
511 2 ucOSD_Item_Index0 = (Item_Num == ucOSD_Item_Index0) ? 1 : (ucOSD_Item_Index0 + 1);
512 2 else
513 2 ucOSD_Item_Index0 = (1 == ucOSD_Item_Index0) ? Item_Num : (ucOSD_Item_Index0 - 1);
514 2
515 2 // Move window 6
516 2 OSD_Window( 6, 150, 282, (54 + (ucOSD_Item_Index0-1)*(29+4)), (84 + (ucOSD_Item_Index0-1)*(29+4))
517 2 , 1, 1, 14, 251, 0, 1, 25);
518 2 }
519 1 else
520 1 {
521 2 // Change to next/previous main page
522 2 //OSD_Window( 5, 150, 282, (54 + (ucOSD_Page_Index-1)*(29+4)), (84 + (ucOSD_Page_Index-1)*(29+4))
523 2 // , 0, 0, 14, 251, 0, 1, 0);
524 2 if (NOTIFY_RIGHT_KEY == Pess_Key)
525 2 ucOSD_Page_Index = GetNextPageIdx(ucOSD_Page_Index);
526 2 else
527 2 ucOSD_Page_Index = GetPrevPageIdx(ucOSD_Page_Index);
528 2 }
529 1 }
530
531 void Show_Mode(void)
532 {
533 1 unsigned int idata usStart_Addr;
534 1 unsigned char idata ucTemp;
535 1
536 1 OSD_Line(3, 12, 15, 0, 1); // Attribute
537 1 usStart_Addr = FONT_SELECT_ADDRESS;
538 1
C51 COMPILER V6.20c LCD_OSD 04/15/2004 12:59:12 PAGE 10
539 1 //The address of the first character Cn1 in Row n = FONT_SELECT_ADDRESS + Row0_length + Row1_length +...+
-Row(n-1)_length
540 1 for(ucTemp = 1; ucTemp < 3+1; ucTemp ++)
541 1 usStart_Addr += Row_Info[0][ucTemp];
542 1
543 1 Data[0] = 5;
544 1 Data[1] = Y_INC;
545 1 Data[2] = OSD_ADDR_MSB_90;
546 1 Data[3] = (unsigned char)( (((usStart_Addr + 12) & 0x0fff) >> 8 ) | 0x50);
547 1 Data[4] = (unsigned char)( (usStart_Addr + 12) & 0x00ff);
548 1 Data[5] = 0;
549 1 RTDWrite(Data);
550 1
551 1
552 1
553 1 switch (ucMode_Curr)
554 1 {
555 2 /*
556 2 case MODE_NOSIGNAL: // NO SIGNAL
557 2 OSD_Line(11, 2, 24, CHINESE_T <= (stGUD1.FUNCTION & 0x07) ? 0x80 | COLOR_BLUE : COLOR_BLUE, 0);
558 2
559 2 if ((SOURCE_VGA == (stGUD1.INPUT_SOURCE & 0x07)) && (VGA_ONLINE != bVGA_CONNECT))
560 2 RTDOSDW(OSD_REMK_TABLE[0][stGUD1.FUNCTION & 0x07]);
561 2 else
562 2 RTDOSDW(OSD_REMK_TABLE[1][stGUD1.FUNCTION & 0x07]);
563 2 break;
564 2
565 2 case MODE_UNDEFINED0:
566 2 case MODE_UNDEFINED1:
567 2 case MODE_NOSUPPORT:
568 2 OSD_Line(11, 2, 24, CHINESE_T <= (stGUD1.FUNCTION & 0x07) ? 0x80 | COLOR_BLUE : COLOR_BLUE, 0);
569 2 RTDOSDW(OSD_REMK_TABLE[2][stGUD1.FUNCTION & 0x07]);
570 2 break;
571 2
572 2 case MODE_VIDEO60HZ: // NTSC 60HZ
573 2 OSD_Line(11, 2, 24, COLOR_BLUE, 0); // Set characters to blue
574 2 RTDCodeW(Remark_Mode);
575 2
576 2 switch(ucAV_Mode)
577 2 {
578 2 case 0x01: RTDCodeW(Remark_V60_0); break;
579 2 case 0x11: RTDCodeW(Remark_V60_1); break;
580 2 case 0x21: RTDCodeW(Remark_V60_2); break;
581 2 case 0x31: RTDCodeW(Remark_V60_3); break;
582 2 case 0x41: RTDCodeW(Remark_V60_4); break;
583 2 case 0x03: RTDCodeW(Remark_V60_5); break;
584 2 }
585 2 break;
586 2
587 2 case MODE_VIDEO50HZ: // PAL 50HZ
588 2 OSD_Line(11, 2, 24, COLOR_BLUE, 0); // Set characters to blue
589 2 RTDCodeW(Remark_Mode);
590 2
591 2 switch(ucAV_Mode)
592 2 {
593 2 case 0x02: RTDCodeW(Remark_V50_0); break;
594 2 case 0x12: RTDCodeW(Remark_V50_1); break;
595 2 case 0x22: RTDCodeW(Remark_V50_2); break;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -