1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-22 12:24:38 +02:00

Convert source files to UNIX newlines.

Most of the files were already using LF (UNIX) newlines but some were using CRLF (Windows) newlines.
This commit is contained in:
Maarten ter Huurne 2010-06-18 03:09:00 +02:00
parent 40f795391d
commit 39f01f763e
7 changed files with 7508 additions and 7508 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
#include <stdlib.h>
#include <stdio.h>
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
#include <unistd.h>
#include <fcntl.h>
#include "jz4740.h"
#include "cpu.h"
#include "cpu.h"
inline int sdram_convert(unsigned int pllin,unsigned int *sdram_freq)
{
register unsigned int ns, tmp;
@ -20,9 +20,9 @@ inline int sdram_convert(unsigned int pllin,unsigned int *sdram_freq)
return 0;
}
void pll_init(unsigned int clock)
{
void pll_init(unsigned int clock)
{
register unsigned int cfcr, plcr1;
unsigned int sdramclock = 0;
int n2FR[33] = {
@ -44,8 +44,8 @@ void pll_init(unsigned int clock)
pllout2 = (cfcr & CPM_CPCCR_PCS) ? clock : (clock / 2);
/* Init UHC clock */
// REG_CPM_UHCCDR = pllout2 / 48000000 - 1;
jz_cpmregl[0x6C>>2] = pllout2 / 48000000 - 1;
// REG_CPM_UHCCDR = pllout2 / 48000000 - 1;
jz_cpmregl[0x6C>>2] = pllout2 / 48000000 - 1;
nf = clock * 2 / CFG_EXTAL;
plcr1 = ((nf - 2) << CPM_CPPCR_PLLM_BIT) | /* FD */
@ -56,43 +56,43 @@ void pll_init(unsigned int clock)
/* init PLL */
// REG_CPM_CPCCR = cfcr;
// REG_CPM_CPPCR = plcr1;
jz_cpmregl[0] = cfcr;
jz_cpmregl[0x10>>2] = plcr1;
// REG_CPM_CPPCR = plcr1;
jz_cpmregl[0] = cfcr;
jz_cpmregl[0x10>>2] = plcr1;
sdram_convert(clock,&sdramclock);
if(sdramclock > 0)
{
// REG_EMC_RTCOR = sdramclock;
// REG_EMC_RTCNT = sdramclock;
jz_emcregs[0x8C>>1] = sdramclock;
jz_emcregs[0x88>>1] = sdramclock;
// REG_EMC_RTCNT = sdramclock;
jz_emcregs[0x8C>>1] = sdramclock;
jz_emcregs[0x88>>1] = sdramclock;
}else
{
printf("sdram init fail!\n");
while(1);
}
}
void jz_cpuspeed(unsigned clockspeed)
{
}
}
void jz_cpuspeed(unsigned clockspeed)
{
if (clockspeed >= 200 && clockspeed <= 430)
{
jz_dev = open("/dev/mem", O_RDWR);
if(jz_dev)
{
jz_cpmregl=(unsigned long *)mmap(0, 0x80, PROT_READ|PROT_WRITE, MAP_SHARED, jz_dev, 0x10000000);
jz_emcregl=(unsigned long *)mmap(0, 0x90, PROT_READ|PROT_WRITE, MAP_SHARED, jz_dev, 0x13010000);
jz_emcregs=(unsigned short *)jz_emcregl;
pll_init(clockspeed*1000000);
munmap((void *)jz_cpmregl, 0x80);
munmap((void *)jz_emcregl, 0x90);
{
jz_cpmregl=(unsigned long *)mmap(0, 0x80, PROT_READ|PROT_WRITE, MAP_SHARED, jz_dev, 0x10000000);
jz_emcregl=(unsigned long *)mmap(0, 0x90, PROT_READ|PROT_WRITE, MAP_SHARED, jz_dev, 0x13010000);
jz_emcregs=(unsigned short *)jz_emcregl;
pll_init(clockspeed*1000000);
munmap((void *)jz_cpmregl, 0x80);
munmap((void *)jz_emcregl, 0x90);
close(jz_dev);
}
else
printf("failed opening /dev/mem \n");
}
}
}

View File

@ -1,24 +1,24 @@
#ifndef CPU_H
#define CPU_H
/* Define this to the CPU frequency */
#define CPU_FREQ 336000000 /* CPU clock: 336 MHz */
#define CFG_EXTAL 12000000 /* EXT clock: 12 Mhz */
/* Define this to the CPU frequency */
#define CPU_FREQ 336000000 /* CPU clock: 336 MHz */
#define CFG_EXTAL 12000000 /* EXT clock: 12 Mhz */
// SDRAM Timings, unit: ns
#define SDRAM_TRAS 45 /* RAS# Active Time */
#define SDRAM_RCD 20 /* RAS# to CAS# Delay */
#define SDRAM_TPC 20 /* RAS# Precharge Time */
#define SDRAM_TRWL 7 /* Write Latency Time */
#define SDRAM_TREF 15625 /* Refresh period: 4096 refresh cycles/64ms */
#define SDRAM_TREF 15625 /* Refresh period: 4096 refresh cycles/64ms */
//#define SDRAM_TREF 7812 /* Refresh period: 8192 refresh cycles/64ms */
static unsigned long jz_dev;
static volatile unsigned long *jz_cpmregl, *jz_emcregl;
static unsigned long jz_dev;
static volatile unsigned long *jz_cpmregl, *jz_emcregl;
volatile unsigned short *jz_emcregs;
void jz_cpuspeed(unsigned clockspeed);
void pll_init(unsigned int clock);
void pll_init(unsigned int clock);
inline int sdram_convert(unsigned int pllin,unsigned int *sdram_freq);
#endif

10424
src/jz4740.h

File diff suppressed because it is too large Load Diff

View File

@ -1,47 +1,47 @@
#include <iostream>
#include <fstream>
#include "selectordetector.h"
#include "utilities.h"
using namespace std;
SelectorDetector::SelectorDetector() {
//ctor
useSelectorBackground = false;
}
SelectorDetector::SelectorDetector(const string &config) {
useSelectorBackground = false;
readSelectorConfig(config);
}
SelectorDetector::~SelectorDetector() {
//dtor
}
bool SelectorDetector::readSelectorConfig(const string &config) {
if (fileExists(config)) {
ifstream inf(config.c_str(), ios_base::in);
if (inf.is_open()) {
string line;
while (getline(inf, line, '\n')) {
string::size_type pos = line.find("=");
string name = trim(line.substr(0,pos));
string value = trim(line.substr(pos+1,line.length()));
if (name=="cmdLine") application = value;
else if (name=="baseDir") filePath = value;
else if (name=="fileFilter"){
if(filters.empty())
filters = value;
else
filters += ("," + value);
}
}
inf.close();
return true;
}
}
return false;
}
#include <iostream>
#include <fstream>
#include "selectordetector.h"
#include "utilities.h"
using namespace std;
SelectorDetector::SelectorDetector() {
//ctor
useSelectorBackground = false;
}
SelectorDetector::SelectorDetector(const string &config) {
useSelectorBackground = false;
readSelectorConfig(config);
}
SelectorDetector::~SelectorDetector() {
//dtor
}
bool SelectorDetector::readSelectorConfig(const string &config) {
if (fileExists(config)) {
ifstream inf(config.c_str(), ios_base::in);
if (inf.is_open()) {
string line;
while (getline(inf, line, '\n')) {
string::size_type pos = line.find("=");
string name = trim(line.substr(0,pos));
string value = trim(line.substr(pos+1,line.length()));
if (name=="cmdLine") application = value;
else if (name=="baseDir") filePath = value;
else if (name=="fileFilter"){
if(filters.empty())
filters = value;
else
filters += ("," + value);
}
}
inf.close();
return true;
}
}
return false;
}

View File

@ -1,58 +1,58 @@
#ifndef SELECTORDETECTOR_H
#define SELECTORDETECTOR_H
/* This class is for handling applications that use Kounch's Selector, to correctly import their settings to GMenu
* It provides interfaces to examine the dge file to detect Selector and from there, parse the config files.
*/
/*
#Selector configuration file
#Version 1.0
#selector-language english (and it doesn't work, crap)
langCode=EN // ignore
layoutCode=0 // ignore
selectRectangle=2 // ignore
#Full path to skin files
skinPath=./ // use possibly
#command line
cmdLine=./race // USE
#path to base directory for file explorer
baseDir=/boot/local/gmenu2x/roms/ngpc/ // USE
#File filters // USE
fileFilter=ngp
fileFilter=ngc
fileFilter=npc
*/
#include <string>
using std::string;
class SelectorDetector
{
public:
SelectorDetector();
SelectorDetector(const string &config);
~SelectorDetector();
bool readSelectorConfig(const string &config);
string getApplication(){return application;}
string getFilePath(){return filePath;}
string getFilters(){return filters;}
private:
bool useSelectorBackground;
string application;
string filePath;
string filters;
//bool isSelectorGPE(const string &gpe);
//string getSelectorConfig(const string &gpe); // Looks in the GPE for the location of the selectorconfig
};
#endif // SELECTORDETECTOR_H
#ifndef SELECTORDETECTOR_H
#define SELECTORDETECTOR_H
/* This class is for handling applications that use Kounch's Selector, to correctly import their settings to GMenu
* It provides interfaces to examine the dge file to detect Selector and from there, parse the config files.
*/
/*
#Selector configuration file
#Version 1.0
#selector-language english (and it doesn't work, crap)
langCode=EN // ignore
layoutCode=0 // ignore
selectRectangle=2 // ignore
#Full path to skin files
skinPath=./ // use possibly
#command line
cmdLine=./race // USE
#path to base directory for file explorer
baseDir=/boot/local/gmenu2x/roms/ngpc/ // USE
#File filters // USE
fileFilter=ngp
fileFilter=ngc
fileFilter=npc
*/
#include <string>
using std::string;
class SelectorDetector
{
public:
SelectorDetector();
SelectorDetector(const string &config);
~SelectorDetector();
bool readSelectorConfig(const string &config);
string getApplication(){return application;}
string getFilePath(){return filePath;}
string getFilters(){return filters;}
private:
bool useSelectorBackground;
string application;
string filePath;
string filters;
//bool isSelectorGPE(const string &gpe);
//string getSelectorConfig(const string &gpe); // Looks in the GPE for the location of the selectorconfig
};
#endif // SELECTORDETECTOR_H

View File

@ -1,43 +1,43 @@
#ifndef SFONTPLUS_H
#define SFONTPLUS_H
#include <SDL.h>
#include <string>
#include <vector>
#define SFONTPLUS_CHARSET "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~¡¿ÀÁÈÉÌÍÒÓÙÚÝÄËÏÖÜŸÂÊÎÔÛÅÃÕÑÆÇČĎĚĽĹŇÔŘŔŠŤŮŽàáèéìíòóùúýäëïöüÿâêîôûåãõñæçčďěľĺňôřŕšťžůðßÐÞþАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюяØøąćęłńśżźĄĆĘŁŃŚŻŹ"
#ifdef _WIN32
typedef unsigned int uint;
#endif
using std::vector;
using std::string;
class SFontPlus {
private:
Uint32 getPixel(Sint32 x, Sint32 y);
SDL_Surface *surface;
vector<uint> charpos;
string characters;
uint height, lineHeight;
public:
SFontPlus();
SFontPlus(SDL_Surface *font);
SFontPlus(const string &font);
~SFontPlus();
bool utf8Code(unsigned char c);
void initFont(SDL_Surface *font, const string &characters = SFONTPLUS_CHARSET);
void initFont(const string &font, const string &characters = SFONTPLUS_CHARSET);
void freeFont();
void write(SDL_Surface *s, const string &text, int x, int y);
uint getTextWidth(const string &text);
uint getHeight();
uint getLineHeight();
};
#endif /* SFONTPLUS_H */
#ifndef SFONTPLUS_H
#define SFONTPLUS_H
#include <SDL.h>
#include <string>
#include <vector>
#define SFONTPLUS_CHARSET "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~¡¿ÀÁÈÉÌÍÒÓÙÚÝÄËÏÖÜŸÂÊÎÔÛÅÃÕÑÆÇČĎĚĽĹŇÔŘŔŠŤŮŽàáèéìíòóùúýäëïöüÿâêîôûåãõñæçčďěľĺňôřŕšťžůðßÐÞþАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюяØøąćęłńśżźĄĆĘŁŃŚŻŹ"
#ifdef _WIN32
typedef unsigned int uint;
#endif
using std::vector;
using std::string;
class SFontPlus {
private:
Uint32 getPixel(Sint32 x, Sint32 y);
SDL_Surface *surface;
vector<uint> charpos;
string characters;
uint height, lineHeight;
public:
SFontPlus();
SFontPlus(SDL_Surface *font);
SFontPlus(const string &font);
~SFontPlus();
bool utf8Code(unsigned char c);
void initFont(SDL_Surface *font, const string &characters = SFONTPLUS_CHARSET);
void initFont(const string &font, const string &characters = SFONTPLUS_CHARSET);
void freeFont();
void write(SDL_Surface *s, const string &text, int x, int y);
uint getTextWidth(const string &text);
uint getHeight();
uint getLineHeight();
};
#endif /* SFONTPLUS_H */