2 Copyright 2004-2005 Chris Tallon
4 This file is part of VOMP.
6 VOMP is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 VOMP is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with VOMP; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
37 if (initted) return 0;
40 FILE* fp = fopen("/proc/mtd", "r");
43 Log::getInstance()->log("MTD", Log::DEBUG, "Could not open /proc/mtd");
49 char mtdNumberChar = '\0';
53 fgets(buffer, 1023, fp);
54 if (strstr(buffer, "HCW MediaMVP VPD"))
56 mtdNumberChar = buffer[3];
61 if (mtdNumberChar == '\0')
63 Log::getInstance()->log("MTD", Log::DEBUG, "Failed to find correct /dev/mtdX device");
68 strcpy(buffer, "/dev/mtd");
69 strncat(buffer, &mtdNumberChar, 1);
70 Log::getInstance()->log("MTD", Log::DEBUG, "Located MTD device: %s", buffer);
75 if ((fd = open(buffer, O_RDONLY)) < 0)
77 Log::getInstance()->log("MTD", Log::DEBUG, "Open fail");
82 if (read(fd, data, 8192) < 8192)
84 Log::getInstance()->log("MTD", Log::DEBUG, "Read fail");
96 int MtdMVP::shutdown()
98 if (!initted) return 0;
103 short MtdMVP::getPALorNTSC()
109 short MtdMVP::getAspect()
114 short MtdMVP::getFlicker()
119 short MtdMVP::getBootLogoOutput()
124 short MtdMVP::getBootLogoDisplayVideoLeft()
129 short MtdMVP::getBootLogoDisplayVideoUpper()
134 short MtdMVP::getBootLogoDisplayVideoWidth()
139 short MtdMVP::getBootLogoDisplayVideoHeight()
146 Log* logger = Log::getInstance();
148 logger->log("MTD", Log::DEBUG, "Mode: %i", getPALorNTSC());
149 logger->log("MTD", Log::DEBUG, "Aspect: %i", getAspect());
150 logger->log("MTD", Log::DEBUG, "Flicker: %i", getFlicker());
151 logger->log("MTD", Log::DEBUG, "Bootlogo output: %i", getBootLogoOutput());
152 logger->log("MTD", Log::DEBUG, "Bootlogo display video left: %i", getBootLogoDisplayVideoLeft());
153 logger->log("MTD", Log::DEBUG, "Bootlogo display video upper: %i", getBootLogoDisplayVideoUpper());
154 logger->log("MTD", Log::DEBUG, "Bootlogo display video width: %i", getBootLogoDisplayVideoWidth());
155 logger->log("MTD", Log::DEBUG, "Bootlogo display video height: %i", getBootLogoDisplayVideoHeight());