1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-11-22 17:41:52 +02:00

Removed spaces at end of lines in source files.

No actual content was changed in this commit.
This commit is contained in:
Maarten ter Huurne 2010-06-18 03:12:58 +02:00
parent 39f01f763e
commit d3b094e1b5
8 changed files with 202 additions and 202 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
#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>
@ -9,18 +9,18 @@
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;
ns = 1000000000 / pllin; ns = 1000000000 / pllin;
/* Set refresh registers */ /* Set refresh registers */
tmp = SDRAM_TREF/ns; tmp = SDRAM_TREF/ns;
tmp = tmp/64 + 1; tmp = tmp/64 + 1;
if (tmp > 0xff) tmp = 0xff; if (tmp > 0xff) tmp = 0xff;
*sdram_freq = tmp; *sdram_freq = tmp;
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;
@ -35,8 +35,8 @@ void pll_init(unsigned int clock)
int nf, pllout2; int nf, pllout2;
cfcr = CPM_CPCCR_CLKOEN | cfcr = CPM_CPCCR_CLKOEN |
(n2FR[div[0]] << CPM_CPCCR_CDIV_BIT) | (n2FR[div[0]] << CPM_CPCCR_CDIV_BIT) |
(n2FR[div[1]] << CPM_CPCCR_HDIV_BIT) | (n2FR[div[1]] << CPM_CPCCR_HDIV_BIT) |
(n2FR[div[2]] << CPM_CPCCR_PDIV_BIT) | (n2FR[div[2]] << CPM_CPCCR_PDIV_BIT) |
(n2FR[div[3]] << CPM_CPCCR_MDIV_BIT) | (n2FR[div[3]] << CPM_CPCCR_MDIV_BIT) |
(n2FR[div[4]] << CPM_CPCCR_LDIV_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_PLLN_BIT) | /* RD=0, NR=2 */
(0 << CPM_CPPCR_PLLOD_BIT) | /* OD=0, NO=1 */ (0 << CPM_CPPCR_PLLOD_BIT) | /* OD=0, NO=1 */
(0x20 << CPM_CPPCR_PLLST_BIT) | /* PLL stable time */ (0x20 << CPM_CPPCR_PLLST_BIT) | /* PLL stable time */
CPM_CPPCR_PLLEN; /* enable PLL */ CPM_CPPCR_PLLEN; /* enable PLL */
/* 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

View File

@ -10,12 +10,12 @@
#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);

View File

@ -112,7 +112,7 @@ void GMenu2X::gp2x_deinit() {
gp2x_memregs[0x290C>>1]=640; gp2x_memregs[0x290C>>1]=640;
close(gp2x_mem); close(gp2x_mem);
} }
if (f200) ts.deinit();*/ if (f200) ts.deinit();*/
#endif #endif
if (batteryHandle) fclose(batteryHandle); if (batteryHandle) fclose(batteryHandle);
@ -743,7 +743,7 @@ void GMenu2X::setBacklight(int val)
{ {
stringstream valsstr; stringstream valsstr;
string valstr = ""; string valstr = "";
if (val < 10) if (val < 10)
valsstr << "00"; valsstr << "00";
else if (val < 100) else if (val < 100)
valsstr << "0" ; valsstr << "0" ;
@ -789,7 +789,7 @@ int GMenu2X::main() {
int drawn_frames = 0; int drawn_frames = 0;
string fps = ""; string fps = "";
#endif #endif
IconButton btnContextMenu(this,"skin:imgs/menu.png"); IconButton btnContextMenu(this,"skin:imgs/menu.png");
btnContextMenu.setPosition(resX-38, bottomBarIconY); btnContextMenu.setPosition(resX-38, bottomBarIconY);
btnContextMenu.setAction(MakeDelegate(this, &GMenu2X::contextMenu)); btnContextMenu.setAction(MakeDelegate(this, &GMenu2X::contextMenu));
@ -880,7 +880,7 @@ int GMenu2X::main() {
if(input[ACTION_A] ) if(input[ACTION_A] )
helpDisplayed = ! helpDisplayed; helpDisplayed = ! helpDisplayed;
if (helpDisplayed) { if (helpDisplayed) {
s->box(10,50,300,143, skinConfColors[COLOR_MESSAGE_BOX_BG]); s->box(10,50,300,143, skinConfColors[COLOR_MESSAGE_BOX_BG]);
s->rectangle( 12,52,296,helpBoxHeight, 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["SELECT: Show contextual menu"], 20, 155 );
s->write( font, tr["START: Show options menu"], 20, 170 ); s->write( font, tr["START: Show options menu"], 20, 170 );
if (fwType=="open2x") s->write( font, tr["X: Toggle speaker mode"], 20, 185 ); if (fwType=="open2x") s->write( font, tr["X: Toggle speaker mode"], 20, 185 );
} }
#ifdef DEBUG #ifdef DEBUG
@ -1841,7 +1841,7 @@ int GMenu2X::getVolume() {
int basevolume = -1; int basevolume = -1;
mixer = open("/dev/mixer", O_RDONLY); mixer = open("/dev/mixer", O_RDONLY);
if(mixer) if(mixer)
{ {
if (ioctl(mixer, SOUND_MIXER_READ_VOLUME, &basevolume) == -1) { if (ioctl(mixer, SOUND_MIXER_READ_VOLUME, &basevolume) == -1) {
fprintf(stderr, "Failed opening mixer for read - VOLUME\n"); fprintf(stderr, "Failed opening mixer for read - VOLUME\n");
} }
@ -1864,7 +1864,7 @@ void GMenu2X::setVolume(int vol) {
} }
close(mixer); close(mixer);
} }
} }
void GMenu2X::setVolumeScaler(int scale) { void GMenu2X::setVolumeScaler(int scale) {

View File

@ -130,14 +130,14 @@ void InputManager::setActionsCount(int count) {
void InputManager::update() { void InputManager::update() {
SDL_JoystickUpdate(); SDL_JoystickUpdate();
events.clear(); events.clear();
SDL_Event event; SDL_Event event;
while (SDL_PollEvent(&event)) { while (SDL_PollEvent(&event)) {
SDL_Event evcopy = event; SDL_Event evcopy = event;
events.push_back(evcopy); events.push_back(evcopy);
} }
Uint32 tick = SDL_GetTicks(); Uint32 tick = SDL_GetTicks();
for (uint x=0; x<actions.size(); x++) { for (uint x=0; x<actions.size(); x++) {
actions[x] = false; actions[x] = false;

View File

@ -711,7 +711,7 @@
#define DMAC_DCCSR_CT (1 << 1) /* count terminated */ #define DMAC_DCCSR_CT (1 << 1) /* count terminated */
#define DMAC_DCCSR_EN (1 << 0) /* channel enable bit */ #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_SAI (1 << 23) /* source address increment */
#define DMAC_DCMD_DAI (1 << 22) /* dest address increment */ #define DMAC_DCMD_DAI (1 << 22) /* dest address increment */
#define DMAC_DCMD_RDIL_BIT 16 /* request detection interval length */ #define DMAC_DCMD_RDIL_BIT 16 /* request detection interval length */
@ -2688,7 +2688,7 @@
// //
////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////
/* /*
* p is the port number (0,1,2,3) * p is the port number (0,1,2,3)
* o is the pin offset (0-31) inside the port * o is the pin offset (0-31) inside the port
* n is the absolute number of a pin (0-127), regardless of the port * n is the absolute number of a pin (0-127), regardless of the port
@ -2716,7 +2716,7 @@ do { \
} while (0) } while (0)
/* /*
* D0 ~ D31, A0 ~ A16, DCS#, RAS#, CAS#, CKE#, * D0 ~ D31, A0 ~ A16, DCS#, RAS#, CAS#, CKE#,
* RDWE#, CKO#, WE0#, WE1#, WE2#, WE3# * RDWE#, CKO#, WE0#, WE1#, WE2#, WE3#
*/ */
#define __gpio_as_sdram_32bit() \ #define __gpio_as_sdram_32bit() \
@ -2735,7 +2735,7 @@ do { \
//#ifdef JZ4740_PAVO //#ifdef JZ4740_PAVO
#ifdef JZ4740_4740 #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# * RDWE#, CKO#, WE0#, WE1#, WE2#, WE3#
*/ */
#define __gpio_as_sdram_16bit() \ #define __gpio_as_sdram_16bit() \
@ -2756,7 +2756,7 @@ do { \
//#ifdef JZ4740_VIRGO //#ifdef JZ4740_VIRGO
#ifdef JZ4740_4720 #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# * RDWE#, CKO#, WE0#, WE1#, WE2#, WE3#
*/ */
#define __gpio_as_sdram_16bit() \ #define __gpio_as_sdram_16bit() \
@ -2776,7 +2776,7 @@ do { \
#ifdef JZ4740_4725 #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# * RDWE#, CKO#, WE0#, WE1#, WE2#, WE3#
*/ */
#define __jz4725__gpio_as_sdram_16bit() \ #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 m, n, no, pllout;
unsigned long cppcr = REG_CPM_CPPCR; unsigned long cppcr = REG_CPM_CPPCR;
unsigned long od[4] = {1, 2, 2, 4}; unsigned long od[4] = {1, 2, 2, 4};
if ((cppcr & CPM_CPPCR_PLLEN) && !(cppcr & CPM_CPPCR_PLLBP)) if ((cppcr & CPM_CPPCR_PLLEN) && !(cppcr & CPM_CPPCR_PLLBP))
{ {
m = __cpm_get_pllm() + 2; m = __cpm_get_pllm() + 2;
@ -3388,7 +3388,7 @@ static __inline__ unsigned int __cpm_get_pllout(void)
} }
else else
pllout = JZ_EXTAL; pllout = JZ_EXTAL;
return pllout; return pllout;
} }
@ -3879,7 +3879,7 @@ do { \
REG_AIC_ACCR1 |= AC97_PCM_XS_L_FRONT | AC97_PCM_XS_R_FRONT; \ REG_AIC_ACCR1 |= AC97_PCM_XS_L_FRONT | AC97_PCM_XS_R_FRONT; \
} while(0) } 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_none() ( REG_AIC_ACCR1 &= ~AIC_ACCR1_RS_MASK )
#define __ac97_set_rs_mono() \ #define __ac97_set_rs_mono() \
do { \ do { \
@ -3985,7 +3985,7 @@ do { \
#define __aic_write_tfifo(v) ( REG_AIC_DR = (v) ) #define __aic_write_tfifo(v) ( REG_AIC_DR = (v) )
#define __aic_read_rfifo() ( REG_AIC_DR ) #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_external_codec() ( REG_AIC_FR &= ~AIC_FR_ICDC )
#define AIC_FR_LSMP (1 << 6) #define AIC_FR_LSMP (1 << 6)
@ -4369,7 +4369,7 @@ do { \
#define __ssi_set_lsb() ( REG_SSI_CR1 |= SSI_CR1_LFST ) #define __ssi_set_lsb() ( REG_SSI_CR1 |= SSI_CR1_LFST )
#define __ssi_set_frame_length(n) \ #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 */ /* n = 1 - 16 */
#define __ssi_set_microwire_command_length(n) \ #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_white() ( REG_LCD_CFG |= LCD_CFG_WHITE )
#define __lcd_panel_black() ( 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 * n=4,8 for dual mono-STN
*/ */
#define __lcd_set_panel_datawidth(n) \ #define __lcd_set_panel_datawidth(n) \
@ -4843,7 +4843,7 @@ do{ \
REG_RTC_RSR; \ REG_RTC_RSR; \
}) })
//while(0) //while(0)
#define __rtc_set_second(v) \ #define __rtc_set_second(v) \
do{ \ do{ \
while(!__rtc_write_ready()); \ while(!__rtc_write_ready()); \
@ -4857,7 +4857,7 @@ do{ \
REG_RTC_RSAR; \ REG_RTC_RSAR; \
}while(0) }while(0)
#define __rtc_set_alarm_second(v) \ #define __rtc_set_alarm_second(v) \
do{ \ do{ \
while(!__rtc_write_ready()); \ while(!__rtc_write_ready()); \
@ -4894,7 +4894,7 @@ do{ \
#define __rtc_get_nc1Hz_val() \ #define __rtc_get_nc1Hz_val() \
( (REG_RTC_RGR & RTC_RGR_NC1HZ_MASK) >> RTC_RGR_NC1HZ_BIT ) ( (REG_RTC_RGR & RTC_RGR_NC1HZ_MASK) >> RTC_RGR_NC1HZ_BIT )
#define __rtc_set_nc1Hz_val(v) \ #define __rtc_set_nc1Hz_val(v) \
do{ \ do{ \
while(!__rtc_write_ready()); \ while(!__rtc_write_ready()); \

View File

@ -237,7 +237,7 @@ bool LinkApp::save() {
if (ivolume>0 ) f << "volume=" << ivolume << endl; if (ivolume>0 ) f << "volume=" << ivolume << endl;
//G //G
if (igamma!=0 ) f << "gamma=" << igamma << endl; 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 (selectordir!="" ) f << "selectordir=" << selectordir << endl;
if (selectorbrowser ) f << "selectorbrowser=true" << endl; if (selectorbrowser ) f << "selectorbrowser=true" << endl;
if (selectorfilter!="" ) f << "selectorfilter=" << selectorfilter << endl; if (selectorfilter!="" ) f << "selectorfilter=" << selectorfilter << endl;

View File

@ -65,7 +65,7 @@ int MessageBox::exec() {
Surface bg(gmenu2x->s); Surface bg(gmenu2x->s);
//Darken background //Darken background
bg.box(0, 0, gmenu2x->resX, gmenu2x->resY, 0,0,0,200); bg.box(0, 0, gmenu2x->resX, gmenu2x->resY, 0,0,0,200);
SDL_Rect box; SDL_Rect box;
box.h = gmenu2x->font->getHeight()*3 +4; box.h = gmenu2x->font->getHeight()*3 +4;
box.w = gmenu2x->font->getTextWidth(text) + 24 + (gmenu2x->sc[icon] != NULL ? 37 : 0); box.w = gmenu2x->font->getTextWidth(text) + 24 + (gmenu2x->sc[icon] != NULL ? 37 : 0);
@ -87,9 +87,9 @@ int MessageBox::exec() {
if (buttons[i] != "") { if (buttons[i] != "") {
buttonPositions[i].y = box.y+box.h-4; buttonPositions[i].y = box.y+box.h-4;
buttonPositions[i].w = btnX; buttonPositions[i].w = btnX;
btnX = gmenu2x->drawButtonRight(&bg, buttonLabels[i], buttons[i], btnX, buttonPositions[i].y); btnX = gmenu2x->drawButtonRight(&bg, buttonLabels[i], buttons[i], btnX, buttonPositions[i].y);
buttonPositions[i].x = btnX; buttonPositions[i].x = btnX;
buttonPositions[i].w = buttonPositions[i].x-btnX-6; buttonPositions[i].w = buttonPositions[i].x-btnX-6;
} }
@ -113,7 +113,7 @@ int MessageBox::exec() {
gmenu2x->input.update(); gmenu2x->input.update();
for (uint i=0; i<buttons.size(); i++) for (uint i=0; i<buttons.size(); i++)
if (buttons[i]!="" && gmenu2x->input[i]) result = i; if (buttons[i]!="" && gmenu2x->input[i]) result = i;
usleep(LOOP_DELAY); usleep(LOOP_DELAY);
} }