forked from len0rd/rockbox
Revert last commit (accidentally committed the whole tree)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19095 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d42041043b
commit
59d4d2025c
12 changed files with 32 additions and 284 deletions
|
@ -143,8 +143,6 @@ iriverify.c
|
|||
iriver_flash.c
|
||||
#endif
|
||||
|
||||
gigabeat_flash.c
|
||||
|
||||
#endif /* iFP7xx */
|
||||
#if (LCD_WIDTH > 138) && (LCD_DEPTH > 1)
|
||||
/* Built for bitmap targets except H10 5/6gb, Archoses, iPod mini, mrobe100 and ifp*/
|
||||
|
|
|
@ -333,6 +333,8 @@ void cpu_timers(int cnt)
|
|||
|
||||
static int cpu_idle(int max)
|
||||
{
|
||||
int cnt, unit;
|
||||
|
||||
if (!(cpu.halt && IME)) return 0;
|
||||
if (R_IF & R_IE)
|
||||
{
|
||||
|
@ -351,7 +353,6 @@ static int cpu_idle(int max)
|
|||
return max;
|
||||
}
|
||||
|
||||
int cnt, unit;
|
||||
/* Figure out when the next timer interrupt will happen */
|
||||
unit = ((-R_TAC) & 3) << 1;
|
||||
cnt = (511 - cpu.tim + (1<<unit)) >> unit;
|
||||
|
|
|
@ -64,7 +64,7 @@ fb_data *vdest;
|
|||
static void updatepatpix(void) ICODE_ATTR;
|
||||
static void updatepatpix(void)
|
||||
{
|
||||
int i;
|
||||
int i, j;
|
||||
#if ((CONFIG_CPU != SH7034) && !defined(CPU_COLDFIRE))
|
||||
int k, a, c;
|
||||
#endif
|
||||
|
@ -73,12 +73,10 @@ static void updatepatpix(void)
|
|||
if (!anydirty) return;
|
||||
for (i = 0; i < 1024; i++)
|
||||
{
|
||||
int j;
|
||||
if (i == 384) i = 512;
|
||||
if (i == 896) break;
|
||||
if (!patdirty[i]) continue;
|
||||
patdirty[i] = 0;
|
||||
|
||||
for (j = 0; j < 8; j++)
|
||||
{
|
||||
#if CONFIG_CPU == SH7034
|
||||
|
@ -378,8 +376,8 @@ static void tilebuf(void)
|
|||
int base;
|
||||
byte *tilemap, *attrmap;
|
||||
int *tilebuf;
|
||||
const int *wrap;
|
||||
static const int wraptable[64] ICONST_ATTR =
|
||||
int *wrap;
|
||||
static int wraptable[64] =
|
||||
{
|
||||
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,-32
|
||||
|
@ -780,11 +778,11 @@ static void spr_enum(void)
|
|||
static void spr_scan(void) ICODE_ATTR;
|
||||
static void spr_scan(void)
|
||||
{
|
||||
int i;
|
||||
byte ns = NS;
|
||||
byte *src, *dest;
|
||||
int i, x;
|
||||
byte pal, b, ns = NS;
|
||||
byte *src, *dest, *bg, *pri;
|
||||
struct vissprite *vs;
|
||||
static byte bgdup[256] IBSS_ATTR;
|
||||
static byte bgdup[256];
|
||||
|
||||
if (!ns) return;
|
||||
|
||||
|
@ -793,8 +791,7 @@ static void spr_scan(void)
|
|||
|
||||
for (; ns; ns--, vs--)
|
||||
{
|
||||
int x = vs->x;
|
||||
|
||||
x = vs->x;
|
||||
if (x > 159) continue;
|
||||
if (x < -7) continue;
|
||||
if (x < 0)
|
||||
|
@ -810,25 +807,23 @@ static void spr_scan(void)
|
|||
if (x > 152) i = 160 - x;
|
||||
else i = 8;
|
||||
}
|
||||
|
||||
byte pal = vs->pal;
|
||||
|
||||
pal = vs->pal;
|
||||
if (vs->pri)
|
||||
{
|
||||
byte *bg = bgdup + (dest - BUF);
|
||||
bg = bgdup + (dest - BUF);
|
||||
while (i--)
|
||||
{
|
||||
byte b = src[i];
|
||||
b = src[i];
|
||||
if (b && !(bg[i]&3)) dest[i] = pal|b;
|
||||
}
|
||||
}
|
||||
else if (hw.cgb)
|
||||
{
|
||||
byte *bg = bgdup + (dest - BUF);
|
||||
byte *pri = PRI + (dest - BUF);
|
||||
bg = bgdup + (dest - BUF);
|
||||
pri = PRI + (dest - BUF);
|
||||
while (i--)
|
||||
{
|
||||
byte b = src[i];
|
||||
b = src[i];
|
||||
if (b && (!pri[i] || !(bg[i]&3)))
|
||||
dest[i] = pal|b;
|
||||
}
|
||||
|
|
|
@ -116,6 +116,9 @@ struct snd snd IBSS_ATTR;
|
|||
static void gbSoundChannel1(int *r, int *l)
|
||||
{
|
||||
int vol = S1.envol;
|
||||
|
||||
int freq = 0;
|
||||
|
||||
int value = 0;
|
||||
|
||||
if(S1.on && (S1.len || !S1.cont))
|
||||
|
@ -169,7 +172,7 @@ static void gbSoundChannel1(int *r, int *l)
|
|||
|
||||
if(S1.swlen<=0)
|
||||
{
|
||||
int freq = (((int)(R_NR14&7) << 8) | R_NR13);
|
||||
freq = (((int)(R_NR14&7) << 8) | R_NR13);
|
||||
|
||||
int updown = 1;
|
||||
|
||||
|
|
|
@ -44,29 +44,11 @@
|
|||
#include "rbunicode.h"
|
||||
#include "usb.h"
|
||||
#include "mmu-arm.h"
|
||||
#include "rtc.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
char version[] = APPSVERSION;
|
||||
|
||||
void shutdown(void)
|
||||
{
|
||||
/* We need to gracefully spin down the disk to prevent clicks. */
|
||||
if (ide_powered())
|
||||
{
|
||||
/* Make sure ATA has been initialized. */
|
||||
ata_init();
|
||||
|
||||
/* And put the disk into sleep immediately. */
|
||||
ata_sleepnow();
|
||||
}
|
||||
|
||||
_backlight_off();
|
||||
|
||||
power_off();
|
||||
}
|
||||
|
||||
void main(void)
|
||||
{
|
||||
unsigned char* loadbuffer;
|
||||
|
@ -74,67 +56,14 @@ void main(void)
|
|||
int rc;
|
||||
int(*kernel_entry)(void);
|
||||
|
||||
power_init();
|
||||
system_init();
|
||||
lcd_init();
|
||||
backlight_init();
|
||||
button_init();
|
||||
font_init();
|
||||
kernel_init(); /* Need the kernel to sleep */
|
||||
adc_init();
|
||||
|
||||
lcd_setfont(FONT_SYSFIXED);
|
||||
|
||||
if(!(GPGDAT&BUTTON_POWER) && charger_inserted())
|
||||
{
|
||||
while(!(GPGDAT&BUTTON_POWER) && charger_inserted())
|
||||
{
|
||||
char msg[20];
|
||||
if(charging_state())
|
||||
{
|
||||
snprintf(msg,sizeof(msg),"Charging");
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(msg,sizeof(msg),"Charge Complete");
|
||||
}
|
||||
reset_screen();
|
||||
lcd_putsxy( (LCD_WIDTH - (SYSFONT_WIDTH * strlen(msg))) / 2,
|
||||
(LCD_HEIGHT - SYSFONT_HEIGHT) / 2, msg);
|
||||
lcd_update();
|
||||
|
||||
#if defined(HAVE_RTC_ALARM)
|
||||
/* Check if the alarm went off while charging */
|
||||
if(rtc_check_alarm_flag())
|
||||
{
|
||||
GSTATUS4=1; /* Normally this is set in crt0.s */
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if(!(GPGDAT&BUTTON_POWER)
|
||||
#if defined(HAVE_RTC_ALARM)
|
||||
&& !GSTATUS4
|
||||
#endif
|
||||
)
|
||||
{
|
||||
shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
if(button_hold())
|
||||
{
|
||||
const char msg[] = "HOLD is enabled";
|
||||
reset_screen();
|
||||
lcd_putsxy( (LCD_WIDTH - (SYSFONT_WIDTH * strlen(msg))) / 2,
|
||||
(LCD_HEIGHT - SYSFONT_HEIGHT) / 2, msg);
|
||||
lcd_update();
|
||||
|
||||
sleep(2*HZ);
|
||||
|
||||
shutdown();
|
||||
}
|
||||
|
||||
power_init();
|
||||
usb_init();
|
||||
|
||||
/* Enter USB mode without USB thread */
|
||||
|
@ -159,7 +88,9 @@ void main(void)
|
|||
lcd_update();
|
||||
}
|
||||
|
||||
reset_screen();
|
||||
kernel_init();
|
||||
adc_init();
|
||||
button_init();
|
||||
|
||||
/* Show debug messages if button is pressed */
|
||||
if(button_read_device())
|
||||
|
|
|
@ -219,8 +219,6 @@ void audiohw_close(void)
|
|||
/* 2. Disable all output buffers. */
|
||||
wmcodec_write(PWRMGMT2, 0x0);
|
||||
|
||||
sleep(HZ);
|
||||
|
||||
/* 3. Switch off the power supplies. */
|
||||
wmcodec_write(PWRMGMT1, 0x0);
|
||||
}
|
||||
|
|
|
@ -10,9 +10,6 @@
|
|||
/* For Rolo and boot loader */
|
||||
#define MODEL_NUMBER 18
|
||||
|
||||
/* Define RTC alarm */
|
||||
#define HAVE_RTC_ALARM
|
||||
|
||||
/* define this if you use an ATA controller */
|
||||
#define CONFIG_STORAGE STORAGE_ATA
|
||||
|
||||
|
|
|
@ -49,8 +49,8 @@ vectors:
|
|||
/* Add some strings to detect the bootloader in flash and give it a version
|
||||
* number. (0x040A0028, 0x040A002C)
|
||||
*/
|
||||
.string "ROCKBOX\0"
|
||||
.string "R 03.00\0"
|
||||
.string "ROCKBOX"
|
||||
.word 0x0001
|
||||
|
||||
/*
|
||||
* Function: word_copy
|
||||
|
@ -99,18 +99,6 @@ start:
|
|||
cmp r0, #0xA0000
|
||||
bne poweron
|
||||
|
||||
/* Did an RTC event wake the player up? */
|
||||
|
||||
mov r2, #0x4A000000
|
||||
ldr r1, [r2]
|
||||
ands r1, r1, #0x40000000
|
||||
|
||||
/* Woke up with the alarm - store a flag in GSTATUS3 */
|
||||
ldrne r2, =0x560000b8
|
||||
movne r1, #0x01
|
||||
strne r1, [r2]
|
||||
bne poweron
|
||||
|
||||
/* Set GPG up to read power and menu status */
|
||||
ldr r2, =0x56000050
|
||||
ldr r1, [r2, #0x18]
|
||||
|
|
|
@ -32,45 +32,8 @@
|
|||
|
||||
bool __dbg_hw_info(void)
|
||||
{
|
||||
char buf[50];
|
||||
int line, button;
|
||||
|
||||
char reg=0, value=0;
|
||||
|
||||
lcd_clear_display();
|
||||
lcd_setfont(FONT_SYSFIXED);
|
||||
|
||||
while(1)
|
||||
{
|
||||
line=0;
|
||||
snprintf(buf, sizeof(buf), "reg: %08x value: %08x", reg, value);
|
||||
lcd_puts(0, line++, buf);
|
||||
|
||||
button = button_get_w_tmo(HZ/10);
|
||||
|
||||
if (button == BUTTON_UP)
|
||||
reg++;
|
||||
if (button == BUTTON_DOWN)
|
||||
reg--;
|
||||
|
||||
if (button == BUTTON_VOL_UP)
|
||||
value++;
|
||||
if (button == BUTTON_VOL_DOWN)
|
||||
value--;
|
||||
|
||||
if (button == BUTTON_A)
|
||||
{
|
||||
// LCD_SPI_start();
|
||||
// LCD_SPI_setreg(reg, value);
|
||||
// LCD_SPI_stop();
|
||||
}
|
||||
|
||||
lcd_update();
|
||||
|
||||
if (button == (DEBUG_CANCEL|BUTTON_REL))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool __dbg_ports(void)
|
||||
{
|
||||
|
|
|
@ -244,7 +244,7 @@ static void LCD_SPI_init(void)
|
|||
/* LCD init */
|
||||
void lcd_init_device(void)
|
||||
{
|
||||
#if 0//def BOOTLOADER
|
||||
#ifdef BOOTLOADER
|
||||
int i;
|
||||
/* When the Rockbox bootloader starts, we are changing framebuffer address,
|
||||
but we don't want what's shown on the LCD to change until we do an
|
||||
|
|
|
@ -71,11 +71,6 @@ void power_off(void)
|
|||
_buttonlight_off();
|
||||
sleep(HZ);
|
||||
|
||||
/* Do this to allow the drive to properly reset when player restarts
|
||||
* immediately without running OF shutdown.
|
||||
*/
|
||||
GPGCON&=~0x00300000;
|
||||
|
||||
/* Rockbox never properly shutdown the player. When the sleep bit is set
|
||||
* the player actually wakes up in some type of "zombie" state
|
||||
* because the shutdown routine is not set up properly. So far the
|
||||
|
@ -86,122 +81,6 @@ void power_off(void)
|
|||
CLKCON |=(1<<3);
|
||||
|
||||
reboot_point();
|
||||
|
||||
#if 0
|
||||
|
||||
GPBCON=0x00015450;
|
||||
GPBDAT=0x403;
|
||||
GPBUP=0x3FD;
|
||||
|
||||
GPCCON =0xAAA054A8;
|
||||
GPCDAT =0x0000038C;
|
||||
GPCUP =0xFFFF;
|
||||
|
||||
|
||||
GPDCON =0xAAA0AAA5;
|
||||
GPDDAT =0x00000300;
|
||||
GPDUP =0xFCFF;
|
||||
|
||||
|
||||
GPECON =0xAA8002AA;
|
||||
GPEDAT =0x0000FFED;
|
||||
GPEUP =0x3817;
|
||||
|
||||
GPFCON =0x00000a00;
|
||||
GPFDAT =0x000000F1;
|
||||
GPFUP =0x000000FF;
|
||||
|
||||
GPGCON =0x01401002;
|
||||
GPGDAT =0x00000180;
|
||||
GPGUP =0x0000FF7F;
|
||||
|
||||
GPHCON =0x001540A5;
|
||||
GPHDAT =0x000006FD;
|
||||
GPHUP =0x00000187;
|
||||
|
||||
// mine
|
||||
INTMSK =0xFFFFFFFF;
|
||||
EINTMASK=0x0FFFFEF0;
|
||||
EXTINT0 =0xFFFFFECF;
|
||||
EXTINT1 =0x07;
|
||||
//
|
||||
|
||||
// INTMSK=0xFFFFFFFF;
|
||||
// EINTMASK=0x00200000;
|
||||
|
||||
// GPHDAT=0x00000004;
|
||||
|
||||
// EXTINT0=~0x00000130;
|
||||
// INTMSK=(~0x00000130)+0x00000100;
|
||||
// GPGUP=0xFFFFFFFF;
|
||||
|
||||
//mine
|
||||
INTMSK =0xFFFFFFDE;
|
||||
//
|
||||
|
||||
SRCPND=0xFFFFFFFF;
|
||||
INTPND=0xFFFFFFFF;
|
||||
GSTATUS1=0x00000600;
|
||||
|
||||
ADCCON=0x00000004;
|
||||
|
||||
// MISCCR=MISCCR&(~0x703000)|0x603000;
|
||||
LCDCON1=0x00000000;
|
||||
LOCKTIME=0xFFFFFFFF;
|
||||
// REFRESH=REFRESH|0x00400000;
|
||||
|
||||
// MISCCR=MISCCR|0x000E0000;
|
||||
|
||||
// CLKCON=CLKCON|0x00004018;
|
||||
|
||||
/*
|
||||
* This next piece of code was taken from the linux 2.6.17 sources:
|
||||
* linux/arch/arm/mach-s3c2410/sleep.S
|
||||
*
|
||||
* Copyright (c) 2004 Simtec Electronics
|
||||
* Ben Dooks <ben@simtec.co.uk>
|
||||
*
|
||||
* Based on PXA/SA1100 sleep code by:
|
||||
* Nicolas Pitre, (c) 2002 Monta Vista Software Inc
|
||||
* Cliff Brake, (c) 2001
|
||||
*/
|
||||
|
||||
asm volatile
|
||||
(
|
||||
/* get REFRESH, MISCCR, and CLKCON (and ensure in TLB) */
|
||||
"ldr r4, =0x48000024 \n"
|
||||
"ldr r5, =0x56000080 \n"
|
||||
"ldr r6, =0x4C00000C \n"
|
||||
"ldr r7, [ r4 ] \n"
|
||||
"ldr r8, [ r5 ] \n"
|
||||
"ldr r9, [ r6 ] \n"
|
||||
|
||||
/* Setup register writes */
|
||||
"ldr r2, =0x006E3000 \n"
|
||||
"ldr r3, =0x00004018 \n"
|
||||
"orr r7, r7, #0x00400000 \n" /* SDRAM sleep command */
|
||||
"orr r8, r8, r2 \n" /* SDRAM power-down signals */
|
||||
"orr r9, r9, r3 \n" /* power down command */
|
||||
|
||||
/* first as a trial-run to load cache */
|
||||
"teq pc, #0 \n"
|
||||
"bl s3c2410_do_sleep \n"
|
||||
|
||||
/* now do it for real */
|
||||
"teq r0, r0 \n"
|
||||
"b s3c2410_do_sleep \n"
|
||||
|
||||
/* align next bit of code to cache line */
|
||||
".align 8 \n"
|
||||
"s3c2410_do_sleep: \n"
|
||||
"streq r7, [ r4 ] \n" /* SDRAM sleep command */
|
||||
"streq r8, [ r5 ] \n" /* SDRAM power-down config */
|
||||
"streq r3, [ r6 ] \n" /* CPU sleep */
|
||||
"1: \n"
|
||||
"beq 1b \n"
|
||||
"bx lr \n"
|
||||
);
|
||||
#endif
|
||||
}
|
||||
|
||||
#else /* SIMULATOR */
|
||||
|
|
|
@ -113,14 +113,9 @@ void system_reboot(void)
|
|||
|
||||
static void set_page_tables(void)
|
||||
{
|
||||
/* map every memory region to itself */
|
||||
map_section(0, 0, 0x1000, CACHE_NONE);
|
||||
|
||||
/* map RAM to 0 and enable caching for it */
|
||||
map_section(0x30000000, 0, 32, CACHE_ALL);
|
||||
|
||||
/* enable buffered writing for the framebuffer */
|
||||
map_section((int)FRAME, (int)FRAME, 1, BUFFERED);
|
||||
map_section(0, 0, 0x1000, CACHE_NONE); /* map every memory region to itself */
|
||||
map_section(0x30000000, 0, 32, CACHE_ALL); /* map RAM to 0 and enable caching for it */
|
||||
map_section((int)FRAME, (int)FRAME, 1, BUFFERED); /* enable buffered writing for the framebuffer */
|
||||
}
|
||||
|
||||
void memory_init(void) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue