/* **********************************************************************
Copyright (c) 2002-2013 Beyond Innovation Technology Co., Ltd
All rights are reserved. Reproduction in whole or in parts is
prohibited without the prior written consent of the copyright owner.
----------------------------------------------------------------------
Software License Agreement
The software supplied herewith by Beyond Innovation Technology Co., Ltd
(the "Company") is intended and supplied to you, the Company's
customer, for use solely and exclusively on BiTEK products.
The software is owned by the Company and/or its supplier, and is
protected under applicable copyright laws. All rights are reserved.
Any use in violation of the foregoing restrictions may subject the
user to criminal sanctions under applicable laws, as well as to
civil liability for the breach of the terms and conditions of this
license.
THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTIES,
WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE COMPANY SHALL NOT,
IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
----------------------------------------------------------------------
Module: VP.C - Video Processor.
Purpose: Implementation of VP module.
Version: 0.01 06:37PM 2013/03/16
Compiler: Keil 8051 C Compiler v9.52
Reference:
----------------------------------------------------------------------
Modification:
v0.01 06:37PM 2013/03/16 Jeffrey Chang
Reason:
1. Original.
Solution:
********************************************************************** */
#define _VP_C_
/* ------------------------------------
Header Files
------------------------------------ */
#include "bit1618c.h"
#include "bitek.h"
#include "common.h"
#include "eeprom.h"
#include "osd.h"
#include "timer.h"
#include "vp.h"
/* ------------------------------------
Macro Definitions
------------------------------------ */
/* ------------------------------------
Type Definitions
------------------------------------ */
/* ------------------------------------
Variables Definitions
------------------------------------ */
// SJA1301_GM024ANAZNTZ33: 聖傑_BIT1618C+GM-024ANAZNT-Z-33_2013_0820_05_CVBS.bin
// VP
UB8 CODE abVP_00A_0E4[] = {
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
/* 0 */ 0x12,0x94,0xFC,0xA9,0x89,0x80, // 0x00E[5]=0 (BCLK=XCLK)
/* 1 */ 0x00,0x00,0x00,0x00,0x22,0x00,0x04,0x00,0x0A,0x2D,0x4D,0x30,0xCB,0x49,0x22,0x05,
/* 2 */ 0x08,0xE9,0x00,0x49,0x00,0x00,0x00,0x00,0x18,0x00,0x01,0x20,0x00,0x00,0x00,0x00,
/* 3 */ 0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x01,0x17,0x80,0x17,0x13,0x40,0x00,0x07,0x00,
/* 4 */ 0x00,0x3F,0x3F,0x84,0xE0,0x08,0x5F,0x7A,0x30,0x17,0x3E,0x10,0x53,0x7B,0x30,0x17,
/* 5 */ 0x17,0x10,0x40,0x58,0x88,0xC3,0xC3,0x20,0x80,0x23,0x2D,0x4D,0x30,0xA7,0x27,0x30,
/* 6 */ 0x0F,0xF8,0x01,0x20,0x00,0x03,0x00,0x00,0x00,0x00,0x08,0x88,0x06,0x00,0x01,0x03,
/* 7 */ 0x00,0xB0,0x00,0x80,0x6C,0xF1,0x30,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x2D,0xBA,
/* 8 */ 0x33,0xBD,0xD5,0x03,0x00,0xC0,0xFD,0x7E,0x00,0x03,0x09,0xD9,0x37,0x01,0x0A,0xC6,
/* 9 */ 0xC2,0x02,0xFB,0x00,0x00,0x00,0xA4,0x03,0x00,0x7B,0x7B,0xFF,0xAC,0xF2,0x04,0xB3,
/* A */ 0x04,0x04,0x00,0x40,0x22,0x78,0x80,0x00,0x00,0x00,0x0D,0x0D,0x00,0x88,0xA0,0x40,
/* B */ 0x19,0x8D,0x85,0xEA,0xA4,0x32,0x7F,0x31,0x80,0xFE,0x40,0x32,0x00,0x08,0x00,0x00,
/* C */ 0x4D,0xFB,0x71,0x80,0xC3,0x92,0x9B,0x01,0x9B,0x01,0x92,0x81,0x00,0xD0,0x00,0x00,
/* D */ 0x00,0x10,0x80,0x5E,0x8D,0x04,0x04,0x00,0x00,0x00,0x15,0x00,0x3F,0x8E,0xD0,0x8F,
/* E */ 0x03,0x00,0x00,0x00,0x02
};
UB8 CODE abVP_130_1FF[] = {
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
/*13 */ 0x80,0x80,0x80,0x80,0x80,0x80,0xC6,0x39,0x30,0x80,0x80,0x80,0xC0,0x02,0x40,0x40, // 0x138[7]=0 Gamma OFF
/*14 */ 0x04,0xAA,0x38,0xC2,0xCC,0x2B,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*15 */ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x08, // 0x15C and 0x15F
/*16 */ 0x00,0x0B,0x80,0x40,0x1C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20, // MSF_SRC(0x164[6:5]) = TOUT (00), MSF_TOUT(0x164[1])=0, 0x161=003h
/*17 */ 0x00,0x00,0x00,0x08,0x00,0x00,0x05,0x04,0x00,0x00,0x00,0x00,0x00,0x3F,0x00,0x10,
/*18 */ 0x11,0x47,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x00,0x00,0x00,0x00,0x00,// For BIT1618A platform
/*19 */ 0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x0B,0x7A,0x08,0x0B,0x7A,0x08,0x0A,0xFE,
/*1A */ 0x00,0x0A,0x09,0x20,0x00,0x00,0x00,0x02,0x02,0x00,0xFF,0x0F,0x10,0x00,0x00,0x00,
/*1B */ 0x00,0x00,0x52,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*1C */ 0x00,0x0A,0x47,0x5F,0x06,0x39,0x31,0xFF,0x00,0x07,0x1F,0x03,0x51,0xE8,0x54,0xC2,
/*1D */ 0x01,0x9B,0x01,0x9B,0x00,0x85,0xA9,0x58,0xB0,0x00,0xB7,0x19,0x3F,0x63,0xD8,0x37,
/*1E */ 0x04,0x00,0x00,0x00,0x00,0x0F,0xE0,0x58,0x9C,0x99,0x22,0x00,0x00,0x00,0x01,0x00,
/*1F */ 0x80,0x80,0xFF,0x00,0x00,0x00,0x00,0x00,0x89,0x00,0x00,0x00,0x00,0x4B,0xFF,0x46,
};
// PORT
UB8 CODE abPORT_0E7_0FE[] = {
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
/* E */ 0x88,0x01,0x00,0x00,0x03,0x00,0x00,0x00,0x00,
/* F */ 0x00,0x00,0x00,0x00,0x00,0x00,0x12,0x02,0x80,0x00,0x80,0x00,0x02,0x04,0x00 // For BIT1618A platform
};
#if 0
// AT070TN94: BIT1618C_AT070TN94_Y2_20130319_03.bin
// VP
UB8 CODE abVP_00A_0E4[] = {
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
// 0 */ 0x12,0x81,0xFC,0xA9,0xA9,0x00,
/* 0 */ 0x12,0x84,0xFC,0xA9,0x89,0x00, // 0x00E[5]=0 (BCLK=XCLK)
/* 1 */ 0x00,0x00,0x00,0x00,0x22,0x00,0x00,0x00,0x0A,0x25,0x45,0x30,0xF8,0x6C,0x33,0x05,
/* 2 */ 0x08,0x99,0x00,0x49,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x20,0x00,0x00,0x00,0x00,
/* 3 */ 0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x01,0x17,0x80,0x17,0x03,0x40,0x00,0x07,0x00,
/* 4 */ 0x00,0x3F,0x3F,0x84,0xE0,0x08,0xAA,0x7A,0x30,0x17,0x3E,0x10,0xA0,0x70,0x30,0x17,
/* 5 */ 0x17,0x10,0x40,0x58,0x88,0x43,0x43,0x20,0x80,0x23,0x2D,0x4D,0x30,0xA7,0x27,0x30,
/* 6 */ 0x18,0xF8,0x01,0x20,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x88,0x06,0x00,0x01,0x03,
/* 7 */ 0x6C,0xD8,0x30,0x88,0x6C,0xF1,0x30,0x6C,0x00,0x00,0x00,0x00,0x00,0x00,0x09,0xE0,
/* 8 */ 0x8F,0xA4,0xA0,0x03,0x40,0xC0,0x77,0x2C,0x20,0x03,0x17,0x00,0x00,0x00,0x14,0xFB,
/* 9 */ 0x00,0x00,0xFB,0x00,0x00,0x00,0xA4,0x03,0x00,0x7B,0x7B,0xFF,0x94,0xC6,0x40,0x00,
/* A */ 0xE2,0x0A,0x22,0x10,0x22,0x78,0x80,0x00,0x00,0x00,0x0D,0x0D,0x00,0x88,0xA0,0x40,
/* B */ 0x19,0x8D,0x85,0xC0,0x89,0x32,0x7F,0x31,0x80,0xFE,0x40,0x32,0x00,0x08,0x00,0x00,
/* C */ 0x4D,0xFF,0x71,0x80,0xC3,0x92,0x9B,0x01,0x9B,0x01,0x92,0x81,0x80,0x50,0x00,0x00,
/* D */ 0x00,0x10,0x80,0x5E,0x9D,0x04,0x04,0x00,0x00,0x00,0x15,0x00,0x3F,0x8E,0xD0,0x8F,
/* E */ 0x03,0x00,0x00,0x00,0x02
};
UB8 CODE abVP_130_1FF[] = {
// 0 1 2 3 4 5 6 7 8 9 A B C D E F
//13 */ 0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0xB0,0x80,0x80,0x80,0xC0,0x02,0x40,0x40,
/*13 */ 0x80,0x80,0x80,0x80,0x80,0x80,0x00,0x00,0x30,0x80,0x80,0x80,0xC0,0x02,0x40,0x40, // 0x138[7]=0 Gamma OFF
/*14 */ 0x04,0x8A,0x38,0xA0,0xCC,0x7C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/*15 */ 0x00,0x00,0x00,0x00,