⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vt1622.cc

📁 Linux下比较早的基于命令行的DVD播放器
💻 CC
字号:
//// Copyright (c) 2004 by Istv醤 V醨adi//// This file is part of dxr3Player, a DVD player written specifically // for the DXR3 (aka Hollywood+) decoder card, but now handles other// hardware as well. These files contain a (mostly) user-space driver // for the Unichrome board found on Via's EPIA motherboards.//// The information for implementing this driver has been gathered// from the following sources://// - The DirectFB Unichrome driver//   Copyright (c) 2003 Andreas Robinson, All rights reserved.//// - Andreas Robinson's MPEG-2 decoder for the Unichrome board.//   Copyright (c) 2003 Andreas Robinson, All rights reserved.//// - Via's Unichrome Framebuffer driver//   Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved.//   Copyright 2001-2003 S3 Graphics, Inc. All Rights Reserved.// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.//// This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.//// You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA//------------------------------------------------------------------------------#include "VT1622.h"#include "IO.h"#include "ModeInfoTemplate.h"#include "util/Log.h"//------------------------------------------------------------------------------using unichrome::IO;using unichrome::ModeInfoTemplate;using unichrome::Mode;using unichrome::VT1622;//------------------------------------------------------------------------------namespace {/** * Mode info structure. */struct ModeInfoVT1622 : public ModeInfoTemplate<ModeInfoVT1622> {public:    /**     * The number of TV registers.     */    static const size_t numTVRegisters = 75;    /**     * Structure describing a single TV register.     */    struct TVRegister    {        /// The subaddress of the register        unsigned char subAddress;        /// The value of the register        unsigned char value;    };    /**     * The array of mode infos. This must be defined for each     * different mode info.     */    static ModeInfoVT1622 modeInfos[];    /**     * Find the mode info for the given mode.     */    static ModeInfoVT1622* find(const Mode& mode);public:    /**     * The TV registers. There should be numTVRegisters of them.     */    const TVRegister* tvRegisters;    /**     * Construct a ModeInfo structure with the given parameters.     */    ModeInfoVT1622(const Mode& mode, const TVRegister* tvRegisters);};inline ModeInfoVT1622::ModeInfoVT1622(const Mode& mode,                           const TVRegister* tvRegisters) :    ModeInfoTemplate<ModeInfoVT1622>(mode),    tvRegisters(tvRegisters){}//------------------------------------------------------------------------------// TV registers for PAL mode.ModeInfoVT1622::TVRegister palTVRegisters[ModeInfoVT1622::numTVRegisters] = {    {0x00, 0x04}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0xa6},     {0x04, 0x00}, {0x05, 0x00}, {0x06, 0x10}, {0x07, 0x10},     {0x08, 0x7d}, {0x09, 0x32}, {0x0a, 0x60}, {0x0b, 0x00},     {0x0c, 0x57}, {0x0d, 0x46}, {0x0e, 0x0f}, {0x0f, 0x00},     {0x10, 0x00}, {0x11, 0x00}, {0x12, 0xec}, {0x13, 0x15},     {0x14, 0xdc}, {0x15, 0x28}, {0x16, 0x2d}, {0x17, 0x77},     {0x18, 0x66}, {0x19, 0x2d}, {0x1a, 0xee}, {0x1b, 0x03},     {0x1c, 0x0a}, {0x1d, 0x80}, {0x1e, 0x00}, {0x1f, 0x84},     {0x20, 0x13}, {0x21, 0x0c}, {0x22, 0x04}, {0x23, 0x7b},     {0x24, 0x48}, {0x25, 0x64}, {0x26, 0x30}, {0x27, 0x93},     {0x28, 0x49}, {0x29, 0x5f}, {0x2a, 0x15}, {0x2b, 0xa5},     {0x2c, 0x23}, {0x2d, 0x77}, {0x2e, 0xff}, {0x2f, 0x00},         {0x4a, 0xe7}, {0x4b, 0x45}, {0x4c, 0x04}, {0x4d, 0x00},     {0x4e, 0x00}, {0x4f, 0x45}, {0x50, 0xe7}, {0x51, 0xcf},     {0x52, 0x23}, {0x53, 0x57}, {0x54, 0x02}, {0x55, 0x1f},     {0x56, 0x80}, {0x57, 0x75}, {0x58, 0x23}, {0x59, 0x89},     {0x5a, 0xc7}, {0x5b, 0xf1}, {0x5c, 0xff}, {0x5d, 0x05},     {0x5e, 0xd7}, {0x5f, 0x80}, {0x60, 0x03}, {0x61, 0x00},     {0x62, 0x00}, {0x63, 0xbf}, {0x64, 0x03}};// TV registers for NTSC mode.ModeInfoVT1622::TVRegister ntscTVRegisters[ModeInfoVT1622::numTVRegisters] = {    {0x00, 0x04}, {0x01, 0x00}, {0x02, 0x00}, {0x03, 0x02},     {0x04, 0x03}, {0x05, 0x00}, {0x06, 0x10}, {0x07, 0x18},     {0x08, 0x28}, {0x09, 0x09}, {0x0a, 0x5b}, {0x0b, 0x17},     {0x0c, 0x46}, {0x0d, 0x41}, {0x0e, 0x0f}, {0x0f, 0x00},     {0x10, 0x00}, {0x11, 0x00}, {0x12, 0xee}, {0x13, 0x0d},     {0x14, 0xa0}, {0x15, 0x38}, {0x16, 0x1d}, {0x17, 0x66},     {0x18, 0x66}, {0x19, 0x24}, {0x1a, 0xee}, {0x1b, 0x03},     {0x1c, 0x02}, {0x1d, 0x80}, {0x1e, 0x00}, {0x1f, 0x85},     {0x20, 0x11}, {0x21, 0x08}, {0x22, 0x04}, {0x23, 0x75},     {0x24, 0x00}, {0x25, 0x5a}, {0x26, 0x31}, {0x27, 0x95},     {0x28, 0x51}, {0x29, 0x00}, {0x2a, 0x00}, {0x2b, 0xaa},     {0x2c, 0x2b}, {0x2d, 0x7a}, {0x2e, 0xdb}, {0x2f, 0x00},         {0x4a, 0xe4}, {0x4b, 0x69}, {0x4c, 0x04}, {0x4d, 0x00},     {0x4e, 0x00}, {0x4f, 0x40}, {0x50, 0x1f}, {0x51, 0xcf},     {0x52, 0x23}, {0x53, 0x0c}, {0x54, 0x02}, {0x55, 0x1f},     {0x56, 0xcf}, {0x57, 0x76}, {0x58, 0x23}, {0x59, 0x88},     {0x5a, 0xc9}, {0x5b, 0xef}, {0x5c, 0xff}, {0x5d, 0x05},     {0x5e, 0x00}, {0x5f, 0x00}, {0x60, 0x00}, {0x61, 0x00},     {0x62, 0x00}, {0x63, 0x1f}, {0x64, 0x03}};ModeInfoVT1622 ModeInfoVT1622::modeInfos[] = {    ModeInfoVT1622(Mode(PAL), palTVRegisters),    ModeInfoVT1622(Mode(NTSC), ntscTVRegisters)};ModeInfoVT1622* ModeInfoVT1622::find(const Mode& mode){    size_t index = 0;    return ModeInfoTemplate<ModeInfoVT1622>::find(mode, modeInfos,                                                  sizeof(modeInfos)/sizeof(ModeInfoVT1622),                                                  index);}}//------------------------------------------------------------------------------//------------------------------------------------------------------------------VT1622::VT1622(IO& io) :    TVEncoder(io){    Log::debug("unichrome::VT1622: TV encoder is a VT1622\n");}//------------------------------------------------------------------------------void VT1622::setMode(const Mode& mode){    const ModeInfoVT1622* modeInfo = ModeInfoVT1622::find(mode);    if (modeInfo==0) return;        io.i2c.enable();    // Reset TV    io.i2c.write(I2C_ADDR_TVENCODER, 0x1d, 0x00);    io.i2c.write(I2C_ADDR_TVENCODER, 0x1d, 0x80);    for(size_t i = 0; i<ModeInfoVT1622::numTVRegisters; ++i) {        io.i2c.write(I2C_ADDR_TVENCODER,                     modeInfo->tvRegisters[i].subAddress,                     modeInfo->tvRegisters[i].value);    }    // Enable all composite and S-Video outputs    io.i2c.write(I2C_ADDR_TVENCODER, 0x0e, 0x00);}    //------------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -