mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-26 01:50:16 +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:
parent
40f795391d
commit
39f01f763e
4216
src/FastDelegate.h
4216
src/FastDelegate.h
File diff suppressed because it is too large
Load Diff
62
src/cpu.cpp
62
src/cpu.cpp
@ -1,11 +1,11 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include "jz4740.h"
|
#include "jz4740.h"
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
|
|
||||||
inline int sdram_convert(unsigned int pllin,unsigned int *sdram_freq)
|
inline int sdram_convert(unsigned int pllin,unsigned int *sdram_freq)
|
||||||
{
|
{
|
||||||
register unsigned int ns, tmp;
|
register unsigned int ns, tmp;
|
||||||
@ -20,9 +20,9 @@ inline int sdram_convert(unsigned int pllin,unsigned int *sdram_freq)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pll_init(unsigned int clock)
|
void pll_init(unsigned int clock)
|
||||||
{
|
{
|
||||||
register unsigned int cfcr, plcr1;
|
register unsigned int cfcr, plcr1;
|
||||||
unsigned int sdramclock = 0;
|
unsigned int sdramclock = 0;
|
||||||
int n2FR[33] = {
|
int n2FR[33] = {
|
||||||
@ -44,8 +44,8 @@ void pll_init(unsigned int clock)
|
|||||||
pllout2 = (cfcr & CPM_CPCCR_PCS) ? clock : (clock / 2);
|
pllout2 = (cfcr & CPM_CPCCR_PCS) ? clock : (clock / 2);
|
||||||
|
|
||||||
/* Init UHC clock */
|
/* Init UHC clock */
|
||||||
// REG_CPM_UHCCDR = pllout2 / 48000000 - 1;
|
// REG_CPM_UHCCDR = pllout2 / 48000000 - 1;
|
||||||
jz_cpmregl[0x6C>>2] = pllout2 / 48000000 - 1;
|
jz_cpmregl[0x6C>>2] = pllout2 / 48000000 - 1;
|
||||||
|
|
||||||
nf = clock * 2 / CFG_EXTAL;
|
nf = clock * 2 / CFG_EXTAL;
|
||||||
plcr1 = ((nf - 2) << CPM_CPPCR_PLLM_BIT) | /* FD */
|
plcr1 = ((nf - 2) << CPM_CPPCR_PLLM_BIT) | /* FD */
|
||||||
@ -56,43 +56,43 @@ void pll_init(unsigned int clock)
|
|||||||
|
|
||||||
/* init PLL */
|
/* init PLL */
|
||||||
// REG_CPM_CPCCR = cfcr;
|
// REG_CPM_CPCCR = cfcr;
|
||||||
// REG_CPM_CPPCR = plcr1;
|
// REG_CPM_CPPCR = plcr1;
|
||||||
jz_cpmregl[0] = cfcr;
|
jz_cpmregl[0] = cfcr;
|
||||||
jz_cpmregl[0x10>>2] = plcr1;
|
jz_cpmregl[0x10>>2] = plcr1;
|
||||||
|
|
||||||
sdram_convert(clock,&sdramclock);
|
sdram_convert(clock,&sdramclock);
|
||||||
if(sdramclock > 0)
|
if(sdramclock > 0)
|
||||||
{
|
{
|
||||||
// REG_EMC_RTCOR = sdramclock;
|
// REG_EMC_RTCOR = sdramclock;
|
||||||
// REG_EMC_RTCNT = sdramclock;
|
// REG_EMC_RTCNT = sdramclock;
|
||||||
jz_emcregs[0x8C>>1] = sdramclock;
|
jz_emcregs[0x8C>>1] = sdramclock;
|
||||||
jz_emcregs[0x88>>1] = sdramclock;
|
jz_emcregs[0x88>>1] = sdramclock;
|
||||||
|
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
printf("sdram init fail!\n");
|
printf("sdram init fail!\n");
|
||||||
while(1);
|
while(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void jz_cpuspeed(unsigned clockspeed)
|
void jz_cpuspeed(unsigned clockspeed)
|
||||||
{
|
{
|
||||||
if (clockspeed >= 200 && clockspeed <= 430)
|
if (clockspeed >= 200 && clockspeed <= 430)
|
||||||
{
|
{
|
||||||
jz_dev = open("/dev/mem", O_RDWR);
|
jz_dev = open("/dev/mem", O_RDWR);
|
||||||
if(jz_dev)
|
if(jz_dev)
|
||||||
{
|
{
|
||||||
jz_cpmregl=(unsigned long *)mmap(0, 0x80, PROT_READ|PROT_WRITE, MAP_SHARED, jz_dev, 0x10000000);
|
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_emcregl=(unsigned long *)mmap(0, 0x90, PROT_READ|PROT_WRITE, MAP_SHARED, jz_dev, 0x13010000);
|
||||||
jz_emcregs=(unsigned short *)jz_emcregl;
|
jz_emcregs=(unsigned short *)jz_emcregl;
|
||||||
pll_init(clockspeed*1000000);
|
pll_init(clockspeed*1000000);
|
||||||
munmap((void *)jz_cpmregl, 0x80);
|
munmap((void *)jz_cpmregl, 0x80);
|
||||||
munmap((void *)jz_emcregl, 0x90);
|
munmap((void *)jz_emcregl, 0x90);
|
||||||
close(jz_dev);
|
close(jz_dev);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
printf("failed opening /dev/mem \n");
|
printf("failed opening /dev/mem \n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
18
src/cpu.h
18
src/cpu.h
@ -1,24 +1,24 @@
|
|||||||
#ifndef CPU_H
|
#ifndef CPU_H
|
||||||
#define CPU_H
|
#define CPU_H
|
||||||
|
|
||||||
/* Define this to the CPU frequency */
|
/* Define this to the CPU frequency */
|
||||||
#define CPU_FREQ 336000000 /* CPU clock: 336 MHz */
|
#define CPU_FREQ 336000000 /* CPU clock: 336 MHz */
|
||||||
#define CFG_EXTAL 12000000 /* EXT clock: 12 Mhz */
|
#define CFG_EXTAL 12000000 /* EXT clock: 12 Mhz */
|
||||||
|
|
||||||
// SDRAM Timings, unit: ns
|
// SDRAM Timings, unit: ns
|
||||||
#define SDRAM_TRAS 45 /* RAS# Active Time */
|
#define SDRAM_TRAS 45 /* RAS# Active Time */
|
||||||
#define SDRAM_RCD 20 /* RAS# to CAS# Delay */
|
#define SDRAM_RCD 20 /* RAS# to CAS# Delay */
|
||||||
#define SDRAM_TPC 20 /* RAS# Precharge Time */
|
#define SDRAM_TPC 20 /* RAS# Precharge Time */
|
||||||
#define SDRAM_TRWL 7 /* Write Latency 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 */
|
//#define SDRAM_TREF 7812 /* Refresh period: 8192 refresh cycles/64ms */
|
||||||
|
|
||||||
static unsigned long jz_dev;
|
static unsigned long jz_dev;
|
||||||
static volatile unsigned long *jz_cpmregl, *jz_emcregl;
|
static volatile unsigned long *jz_cpmregl, *jz_emcregl;
|
||||||
volatile unsigned short *jz_emcregs;
|
volatile unsigned short *jz_emcregs;
|
||||||
|
|
||||||
void jz_cpuspeed(unsigned clockspeed);
|
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);
|
inline int sdram_convert(unsigned int pllin,unsigned int *sdram_freq);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
10424
src/jz4740.h
10424
src/jz4740.h
File diff suppressed because it is too large
Load Diff
@ -1,47 +1,47 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
#include "selectordetector.h"
|
#include "selectordetector.h"
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
SelectorDetector::SelectorDetector() {
|
SelectorDetector::SelectorDetector() {
|
||||||
//ctor
|
//ctor
|
||||||
useSelectorBackground = false;
|
useSelectorBackground = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectorDetector::SelectorDetector(const string &config) {
|
SelectorDetector::SelectorDetector(const string &config) {
|
||||||
useSelectorBackground = false;
|
useSelectorBackground = false;
|
||||||
readSelectorConfig(config);
|
readSelectorConfig(config);
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectorDetector::~SelectorDetector() {
|
SelectorDetector::~SelectorDetector() {
|
||||||
//dtor
|
//dtor
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SelectorDetector::readSelectorConfig(const string &config) {
|
bool SelectorDetector::readSelectorConfig(const string &config) {
|
||||||
if (fileExists(config)) {
|
if (fileExists(config)) {
|
||||||
ifstream inf(config.c_str(), ios_base::in);
|
ifstream inf(config.c_str(), ios_base::in);
|
||||||
if (inf.is_open()) {
|
if (inf.is_open()) {
|
||||||
string line;
|
string line;
|
||||||
while (getline(inf, line, '\n')) {
|
while (getline(inf, line, '\n')) {
|
||||||
string::size_type pos = line.find("=");
|
string::size_type pos = line.find("=");
|
||||||
string name = trim(line.substr(0,pos));
|
string name = trim(line.substr(0,pos));
|
||||||
string value = trim(line.substr(pos+1,line.length()));
|
string value = trim(line.substr(pos+1,line.length()));
|
||||||
|
|
||||||
if (name=="cmdLine") application = value;
|
if (name=="cmdLine") application = value;
|
||||||
else if (name=="baseDir") filePath = value;
|
else if (name=="baseDir") filePath = value;
|
||||||
else if (name=="fileFilter"){
|
else if (name=="fileFilter"){
|
||||||
if(filters.empty())
|
if(filters.empty())
|
||||||
filters = value;
|
filters = value;
|
||||||
else
|
else
|
||||||
filters += ("," + value);
|
filters += ("," + value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
inf.close();
|
inf.close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,58 +1,58 @@
|
|||||||
#ifndef SELECTORDETECTOR_H
|
#ifndef SELECTORDETECTOR_H
|
||||||
#define SELECTORDETECTOR_H
|
#define SELECTORDETECTOR_H
|
||||||
|
|
||||||
/* This class is for handling applications that use Kounch's Selector, to correctly import their settings to GMenu
|
/* 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.
|
* It provides interfaces to examine the dge file to detect Selector and from there, parse the config files.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#Selector configuration file
|
#Selector configuration file
|
||||||
#Version 1.0
|
#Version 1.0
|
||||||
|
|
||||||
#selector-language english (and it doesn't work, crap)
|
#selector-language english (and it doesn't work, crap)
|
||||||
langCode=EN // ignore
|
langCode=EN // ignore
|
||||||
layoutCode=0 // ignore
|
layoutCode=0 // ignore
|
||||||
|
|
||||||
selectRectangle=2 // ignore
|
selectRectangle=2 // ignore
|
||||||
|
|
||||||
#Full path to skin files
|
#Full path to skin files
|
||||||
skinPath=./ // use possibly
|
skinPath=./ // use possibly
|
||||||
|
|
||||||
#command line
|
#command line
|
||||||
cmdLine=./race // USE
|
cmdLine=./race // USE
|
||||||
|
|
||||||
#path to base directory for file explorer
|
#path to base directory for file explorer
|
||||||
baseDir=/boot/local/gmenu2x/roms/ngpc/ // USE
|
baseDir=/boot/local/gmenu2x/roms/ngpc/ // USE
|
||||||
|
|
||||||
#File filters // USE
|
#File filters // USE
|
||||||
fileFilter=ngp
|
fileFilter=ngp
|
||||||
fileFilter=ngc
|
fileFilter=ngc
|
||||||
fileFilter=npc
|
fileFilter=npc
|
||||||
*/
|
*/
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
class SelectorDetector
|
class SelectorDetector
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SelectorDetector();
|
SelectorDetector();
|
||||||
SelectorDetector(const string &config);
|
SelectorDetector(const string &config);
|
||||||
~SelectorDetector();
|
~SelectorDetector();
|
||||||
|
|
||||||
bool readSelectorConfig(const string &config);
|
bool readSelectorConfig(const string &config);
|
||||||
|
|
||||||
string getApplication(){return application;}
|
string getApplication(){return application;}
|
||||||
string getFilePath(){return filePath;}
|
string getFilePath(){return filePath;}
|
||||||
string getFilters(){return filters;}
|
string getFilters(){return filters;}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool useSelectorBackground;
|
bool useSelectorBackground;
|
||||||
string application;
|
string application;
|
||||||
string filePath;
|
string filePath;
|
||||||
string filters;
|
string filters;
|
||||||
//bool isSelectorGPE(const string &gpe);
|
//bool isSelectorGPE(const string &gpe);
|
||||||
//string getSelectorConfig(const string &gpe); // Looks in the GPE for the location of the selectorconfig
|
//string getSelectorConfig(const string &gpe); // Looks in the GPE for the location of the selectorconfig
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SELECTORDETECTOR_H
|
#endif // SELECTORDETECTOR_H
|
||||||
|
@ -1,43 +1,43 @@
|
|||||||
#ifndef SFONTPLUS_H
|
#ifndef SFONTPLUS_H
|
||||||
#define SFONTPLUS_H
|
#define SFONTPLUS_H
|
||||||
|
|
||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define SFONTPLUS_CHARSET "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~¡¿ÀÁÈÉÌÍÒÓÙÚÝÄËÏÖÜŸÂÊÎÔÛÅÃÕÑÆÇČĎĚĽĹŇÔŘŔŠŤŮŽàáèéìíòóùúýäëïöüÿâêîôûåãõñæçčďěľĺňôřŕšťžůðßÐÞþАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюяØøąćęłńśżźĄĆĘŁŃŚŻŹ"
|
#define SFONTPLUS_CHARSET "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~¡¿ÀÁÈÉÌÍÒÓÙÚÝÄËÏÖÜŸÂÊÎÔÛÅÃÕÑÆÇČĎĚĽĹŇÔŘŔŠŤŮŽàáèéìíòóùúýäëïöüÿâêîôûåãõñæçčďěľĺňôřŕšťžůðßÐÞþАБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюяØøąćęłńśżźĄĆĘŁŃŚŻŹ"
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
typedef unsigned int uint;
|
typedef unsigned int uint;
|
||||||
#endif
|
#endif
|
||||||
using std::vector;
|
using std::vector;
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
class SFontPlus {
|
class SFontPlus {
|
||||||
private:
|
private:
|
||||||
Uint32 getPixel(Sint32 x, Sint32 y);
|
Uint32 getPixel(Sint32 x, Sint32 y);
|
||||||
|
|
||||||
SDL_Surface *surface;
|
SDL_Surface *surface;
|
||||||
vector<uint> charpos;
|
vector<uint> charpos;
|
||||||
string characters;
|
string characters;
|
||||||
uint height, lineHeight;
|
uint height, lineHeight;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SFontPlus();
|
SFontPlus();
|
||||||
SFontPlus(SDL_Surface *font);
|
SFontPlus(SDL_Surface *font);
|
||||||
SFontPlus(const string &font);
|
SFontPlus(const string &font);
|
||||||
~SFontPlus();
|
~SFontPlus();
|
||||||
|
|
||||||
bool utf8Code(unsigned char c);
|
bool utf8Code(unsigned char c);
|
||||||
|
|
||||||
void initFont(SDL_Surface *font, const string &characters = SFONTPLUS_CHARSET);
|
void initFont(SDL_Surface *font, const string &characters = SFONTPLUS_CHARSET);
|
||||||
void initFont(const string &font, const string &characters = SFONTPLUS_CHARSET);
|
void initFont(const string &font, const string &characters = SFONTPLUS_CHARSET);
|
||||||
void freeFont();
|
void freeFont();
|
||||||
|
|
||||||
void write(SDL_Surface *s, const string &text, int x, int y);
|
void write(SDL_Surface *s, const string &text, int x, int y);
|
||||||
|
|
||||||
uint getTextWidth(const string &text);
|
uint getTextWidth(const string &text);
|
||||||
uint getHeight();
|
uint getHeight();
|
||||||
uint getLineHeight();
|
uint getLineHeight();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* SFONTPLUS_H */
|
#endif /* SFONTPLUS_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user