mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-26 01:06:16 +02:00
Removed spaces at end of lines in source files.
No actual content was changed in this commit.
This commit is contained in:
parent
39f01f763e
commit
d3b094e1b5
File diff suppressed because it is too large
Load Diff
32
src/cpu.cpp
32
src/cpu.cpp
@ -1,5 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
@ -9,18 +9,18 @@
|
||||
inline int sdram_convert(unsigned int pllin,unsigned int *sdram_freq)
|
||||
{
|
||||
register unsigned int ns, tmp;
|
||||
|
||||
|
||||
ns = 1000000000 / pllin;
|
||||
/* Set refresh registers */
|
||||
tmp = SDRAM_TREF/ns;
|
||||
tmp = tmp/64 + 1;
|
||||
if (tmp > 0xff) tmp = 0xff;
|
||||
*sdram_freq = tmp;
|
||||
*sdram_freq = tmp;
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
void pll_init(unsigned int clock)
|
||||
{
|
||||
register unsigned int cfcr, plcr1;
|
||||
@ -35,8 +35,8 @@ void pll_init(unsigned int clock)
|
||||
int nf, pllout2;
|
||||
|
||||
cfcr = CPM_CPCCR_CLKOEN |
|
||||
(n2FR[div[0]] << CPM_CPCCR_CDIV_BIT) |
|
||||
(n2FR[div[1]] << CPM_CPCCR_HDIV_BIT) |
|
||||
(n2FR[div[0]] << CPM_CPCCR_CDIV_BIT) |
|
||||
(n2FR[div[1]] << CPM_CPCCR_HDIV_BIT) |
|
||||
(n2FR[div[2]] << CPM_CPCCR_PDIV_BIT) |
|
||||
(n2FR[div[3]] << CPM_CPCCR_MDIV_BIT) |
|
||||
(n2FR[div[4]] << CPM_CPCCR_LDIV_BIT);
|
||||
@ -52,44 +52,44 @@ void pll_init(unsigned int clock)
|
||||
(0 << CPM_CPPCR_PLLN_BIT) | /* RD=0, NR=2 */
|
||||
(0 << CPM_CPPCR_PLLOD_BIT) | /* OD=0, NO=1 */
|
||||
(0x20 << CPM_CPPCR_PLLST_BIT) | /* PLL stable time */
|
||||
CPM_CPPCR_PLLEN; /* enable PLL */
|
||||
CPM_CPPCR_PLLEN; /* enable PLL */
|
||||
|
||||
/* init PLL */
|
||||
// REG_CPM_CPCCR = cfcr;
|
||||
// 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;
|
||||
// REG_EMC_RTCNT = sdramclock;
|
||||
jz_emcregs[0x8C>>1] = sdramclock;
|
||||
jz_emcregs[0x88>>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);
|
||||
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);
|
||||
munmap((void *)jz_cpmregl, 0x80);
|
||||
munmap((void *)jz_emcregl, 0x90);
|
||||
close(jz_dev);
|
||||
}
|
||||
else
|
||||
|
@ -10,12 +10,12 @@
|
||||
#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;
|
||||
volatile unsigned short *jz_emcregs;
|
||||
volatile unsigned short *jz_emcregs;
|
||||
|
||||
void jz_cpuspeed(unsigned clockspeed);
|
||||
void pll_init(unsigned int clock);
|
||||
|
@ -112,7 +112,7 @@ void GMenu2X::gp2x_deinit() {
|
||||
gp2x_memregs[0x290C>>1]=640;
|
||||
close(gp2x_mem);
|
||||
}
|
||||
|
||||
|
||||
if (f200) ts.deinit();*/
|
||||
#endif
|
||||
if (batteryHandle) fclose(batteryHandle);
|
||||
@ -743,7 +743,7 @@ void GMenu2X::setBacklight(int val)
|
||||
{
|
||||
stringstream valsstr;
|
||||
string valstr = "";
|
||||
if (val < 10)
|
||||
if (val < 10)
|
||||
valsstr << "00";
|
||||
else if (val < 100)
|
||||
valsstr << "0" ;
|
||||
@ -789,7 +789,7 @@ int GMenu2X::main() {
|
||||
int drawn_frames = 0;
|
||||
string fps = "";
|
||||
#endif
|
||||
|
||||
|
||||
IconButton btnContextMenu(this,"skin:imgs/menu.png");
|
||||
btnContextMenu.setPosition(resX-38, bottomBarIconY);
|
||||
btnContextMenu.setAction(MakeDelegate(this, &GMenu2X::contextMenu));
|
||||
@ -880,7 +880,7 @@ int GMenu2X::main() {
|
||||
|
||||
if(input[ACTION_A] )
|
||||
helpDisplayed = ! helpDisplayed;
|
||||
|
||||
|
||||
if (helpDisplayed) {
|
||||
s->box(10,50,300,143, skinConfColors[COLOR_MESSAGE_BOX_BG]);
|
||||
s->rectangle( 12,52,296,helpBoxHeight,
|
||||
@ -894,7 +894,7 @@ int GMenu2X::main() {
|
||||
s->write( font, tr["SELECT: Show contextual menu"], 20, 155 );
|
||||
s->write( font, tr["START: Show options menu"], 20, 170 );
|
||||
if (fwType=="open2x") s->write( font, tr["X: Toggle speaker mode"], 20, 185 );
|
||||
|
||||
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -1841,7 +1841,7 @@ int GMenu2X::getVolume() {
|
||||
int basevolume = -1;
|
||||
mixer = open("/dev/mixer", O_RDONLY);
|
||||
if(mixer)
|
||||
{
|
||||
{
|
||||
if (ioctl(mixer, SOUND_MIXER_READ_VOLUME, &basevolume) == -1) {
|
||||
fprintf(stderr, "Failed opening mixer for read - VOLUME\n");
|
||||
}
|
||||
@ -1864,7 +1864,7 @@ void GMenu2X::setVolume(int vol) {
|
||||
}
|
||||
close(mixer);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void GMenu2X::setVolumeScaler(int scale) {
|
||||
|
@ -130,14 +130,14 @@ void InputManager::setActionsCount(int count) {
|
||||
|
||||
void InputManager::update() {
|
||||
SDL_JoystickUpdate();
|
||||
|
||||
|
||||
events.clear();
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event)) {
|
||||
SDL_Event evcopy = event;
|
||||
events.push_back(evcopy);
|
||||
}
|
||||
|
||||
|
||||
Uint32 tick = SDL_GetTicks();
|
||||
for (uint x=0; x<actions.size(); x++) {
|
||||
actions[x] = false;
|
||||
|
30
src/jz4740.h
30
src/jz4740.h
@ -711,7 +711,7 @@
|
||||
#define DMAC_DCCSR_CT (1 << 1) /* count terminated */
|
||||
#define DMAC_DCCSR_EN (1 << 0) /* channel enable bit */
|
||||
|
||||
// DMA channel command register
|
||||
// DMA channel command register
|
||||
#define DMAC_DCMD_SAI (1 << 23) /* source address increment */
|
||||
#define DMAC_DCMD_DAI (1 << 22) /* dest address increment */
|
||||
#define DMAC_DCMD_RDIL_BIT 16 /* request detection interval length */
|
||||
@ -2688,7 +2688,7 @@
|
||||
//
|
||||
//////////////////////////////////////////////////////////
|
||||
|
||||
/*
|
||||
/*
|
||||
* p is the port number (0,1,2,3)
|
||||
* o is the pin offset (0-31) inside the port
|
||||
* n is the absolute number of a pin (0-127), regardless of the port
|
||||
@ -2716,7 +2716,7 @@ do { \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* D0 ~ D31, A0 ~ A16, DCS#, RAS#, CAS#, CKE#,
|
||||
* D0 ~ D31, A0 ~ A16, DCS#, RAS#, CAS#, CKE#,
|
||||
* RDWE#, CKO#, WE0#, WE1#, WE2#, WE3#
|
||||
*/
|
||||
#define __gpio_as_sdram_32bit() \
|
||||
@ -2735,7 +2735,7 @@ do { \
|
||||
//#ifdef JZ4740_PAVO
|
||||
#ifdef JZ4740_4740
|
||||
/*
|
||||
* D0 ~ D15, A0 ~ A16, DCS#, RAS#, CAS#, CKE#,
|
||||
* D0 ~ D15, A0 ~ A16, DCS#, RAS#, CAS#, CKE#,
|
||||
* RDWE#, CKO#, WE0#, WE1#, WE2#, WE3#
|
||||
*/
|
||||
#define __gpio_as_sdram_16bit() \
|
||||
@ -2756,7 +2756,7 @@ do { \
|
||||
//#ifdef JZ4740_VIRGO
|
||||
#ifdef JZ4740_4720
|
||||
/*
|
||||
* D0 ~ D15, A0 ~ A16, DCS#, RAS#, CAS#, CKE#,
|
||||
* D0 ~ D15, A0 ~ A16, DCS#, RAS#, CAS#, CKE#,
|
||||
* RDWE#, CKO#, WE0#, WE1#, WE2#, WE3#
|
||||
*/
|
||||
#define __gpio_as_sdram_16bit() \
|
||||
@ -2776,7 +2776,7 @@ do { \
|
||||
|
||||
#ifdef JZ4740_4725
|
||||
/*
|
||||
* D0 ~ D15, A0 ~ A16, DCS#, RAS#, CAS#, CKE#,
|
||||
* D0 ~ D15, A0 ~ A16, DCS#, RAS#, CAS#, CKE#,
|
||||
* RDWE#, CKO#, WE0#, WE1#, WE2#, WE3#
|
||||
*/
|
||||
#define __jz4725__gpio_as_sdram_16bit() \
|
||||
@ -3378,7 +3378,7 @@ static __inline__ unsigned int __cpm_get_pllout(void)
|
||||
unsigned long m, n, no, pllout;
|
||||
unsigned long cppcr = REG_CPM_CPPCR;
|
||||
unsigned long od[4] = {1, 2, 2, 4};
|
||||
|
||||
|
||||
if ((cppcr & CPM_CPPCR_PLLEN) && !(cppcr & CPM_CPPCR_PLLBP))
|
||||
{
|
||||
m = __cpm_get_pllm() + 2;
|
||||
@ -3388,7 +3388,7 @@ static __inline__ unsigned int __cpm_get_pllout(void)
|
||||
}
|
||||
else
|
||||
pllout = JZ_EXTAL;
|
||||
|
||||
|
||||
return pllout;
|
||||
}
|
||||
|
||||
@ -3879,7 +3879,7 @@ do { \
|
||||
REG_AIC_ACCR1 |= AC97_PCM_XS_L_FRONT | AC97_PCM_XS_R_FRONT; \
|
||||
} while(0)
|
||||
|
||||
/* In fact, only stereo is support now. */
|
||||
/* In fact, only stereo is support now. */
|
||||
#define __ac97_set_rs_none() ( REG_AIC_ACCR1 &= ~AIC_ACCR1_RS_MASK )
|
||||
#define __ac97_set_rs_mono() \
|
||||
do { \
|
||||
@ -3985,7 +3985,7 @@ do { \
|
||||
#define __aic_write_tfifo(v) ( REG_AIC_DR = (v) )
|
||||
#define __aic_read_rfifo() ( REG_AIC_DR )
|
||||
|
||||
#define __aic_internal_codec() ( REG_AIC_FR |= AIC_FR_ICDC )
|
||||
#define __aic_internal_codec() ( REG_AIC_FR |= AIC_FR_ICDC )
|
||||
#define __aic_external_codec() ( REG_AIC_FR &= ~AIC_FR_ICDC )
|
||||
|
||||
#define AIC_FR_LSMP (1 << 6)
|
||||
@ -4369,7 +4369,7 @@ do { \
|
||||
#define __ssi_set_lsb() ( REG_SSI_CR1 |= SSI_CR1_LFST )
|
||||
|
||||
#define __ssi_set_frame_length(n) \
|
||||
REG_SSI_CR1 = (REG_SSI_CR1 & ~SSI_CR1_FLEN_MASK) | (((n) - 2) << 4)
|
||||
REG_SSI_CR1 = (REG_SSI_CR1 & ~SSI_CR1_FLEN_MASK) | (((n) - 2) << 4)
|
||||
|
||||
/* n = 1 - 16 */
|
||||
#define __ssi_set_microwire_command_length(n) \
|
||||
@ -4631,7 +4631,7 @@ do { \
|
||||
#define __lcd_panel_white() ( REG_LCD_CFG |= LCD_CFG_WHITE )
|
||||
#define __lcd_panel_black() ( REG_LCD_CFG &= ~LCD_CFG_WHITE )
|
||||
|
||||
/* n=1,2,4,8 for single mono-STN
|
||||
/* n=1,2,4,8 for single mono-STN
|
||||
* n=4,8 for dual mono-STN
|
||||
*/
|
||||
#define __lcd_set_panel_datawidth(n) \
|
||||
@ -4843,7 +4843,7 @@ do{ \
|
||||
REG_RTC_RSR; \
|
||||
})
|
||||
//while(0)
|
||||
|
||||
|
||||
#define __rtc_set_second(v) \
|
||||
do{ \
|
||||
while(!__rtc_write_ready()); \
|
||||
@ -4857,7 +4857,7 @@ do{ \
|
||||
REG_RTC_RSAR; \
|
||||
}while(0)
|
||||
|
||||
|
||||
|
||||
#define __rtc_set_alarm_second(v) \
|
||||
do{ \
|
||||
while(!__rtc_write_ready()); \
|
||||
@ -4894,7 +4894,7 @@ do{ \
|
||||
|
||||
#define __rtc_get_nc1Hz_val() \
|
||||
( (REG_RTC_RGR & RTC_RGR_NC1HZ_MASK) >> RTC_RGR_NC1HZ_BIT )
|
||||
|
||||
|
||||
#define __rtc_set_nc1Hz_val(v) \
|
||||
do{ \
|
||||
while(!__rtc_write_ready()); \
|
||||
|
@ -237,7 +237,7 @@ bool LinkApp::save() {
|
||||
if (ivolume>0 ) f << "volume=" << ivolume << endl;
|
||||
//G
|
||||
if (igamma!=0 ) f << "gamma=" << igamma << endl;
|
||||
if (ibacklight!=0 ) f << "backlight=" << ibacklight << endl;
|
||||
if (ibacklight!=0 ) f << "backlight=" << ibacklight << endl;
|
||||
if (selectordir!="" ) f << "selectordir=" << selectordir << endl;
|
||||
if (selectorbrowser ) f << "selectorbrowser=true" << endl;
|
||||
if (selectorfilter!="" ) f << "selectorfilter=" << selectorfilter << endl;
|
||||
|
@ -65,7 +65,7 @@ int MessageBox::exec() {
|
||||
Surface bg(gmenu2x->s);
|
||||
//Darken background
|
||||
bg.box(0, 0, gmenu2x->resX, gmenu2x->resY, 0,0,0,200);
|
||||
|
||||
|
||||
SDL_Rect box;
|
||||
box.h = gmenu2x->font->getHeight()*3 +4;
|
||||
box.w = gmenu2x->font->getTextWidth(text) + 24 + (gmenu2x->sc[icon] != NULL ? 37 : 0);
|
||||
@ -87,9 +87,9 @@ int MessageBox::exec() {
|
||||
if (buttons[i] != "") {
|
||||
buttonPositions[i].y = box.y+box.h-4;
|
||||
buttonPositions[i].w = btnX;
|
||||
|
||||
|
||||
btnX = gmenu2x->drawButtonRight(&bg, buttonLabels[i], buttons[i], btnX, buttonPositions[i].y);
|
||||
|
||||
|
||||
buttonPositions[i].x = btnX;
|
||||
buttonPositions[i].w = buttonPositions[i].x-btnX-6;
|
||||
}
|
||||
@ -113,7 +113,7 @@ int MessageBox::exec() {
|
||||
gmenu2x->input.update();
|
||||
for (uint i=0; i<buttons.size(); i++)
|
||||
if (buttons[i]!="" && gmenu2x->input[i]) result = i;
|
||||
|
||||
|
||||
usleep(LOOP_DELAY);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user