diff options
Diffstat (limited to 'www/example')
| -rw-r--r-- | www/example/Makefile | 40 | ||||
| -rw-r--r-- | www/example/README | 7 | ||||
| -rw-r--r-- | www/example/app.lds | 23 | ||||
| -rw-r--r-- | www/example/main.c | 102 | ||||
| -rw-r--r-- | www/example/start.s | 23 |
5 files changed, 0 insertions, 195 deletions
diff --git a/www/example/Makefile b/www/example/Makefile deleted file mode 100644 index 7d8f2fd..0000000 --- a/www/example/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -HPATH = /usr/local/sh-gcc/bin -CC = $(HPATH)/sh-elf-gcc -LD = $(HPATH)/sh-elf-ld -AR = $(HPATH)/sh-elf-ar -AS = $(HPATH)/sh-elf-as -OC = $(HPATH)/sh-elf-objcopy - -INCLUDES=-I. - -CFLAGS = -Os -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) -AFLAGS += -small -relax - -OBJS= start.o main.o - -%.o: %.s - $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $< - - -all : archos.mod # archos.asm - -main.o: main.c - -archos.elf : $(OBJS) app.lds - $(CC) -nostdlib -o archos.elf $(OBJS) -lgcc -Tapp.lds -Wl,-Map,archos.map - -archos.bin : archos.elf - $(OC) -O binary archos.elf archos.bin - -archos.asm: archos.bin - sh2d -sh1 archos.bin > archos.asm - -archos.mod : archos.bin - scramble archos.bin archos.mod - -dist: - tar czvf dist.tar.gz Makefile main.c start.s app.lds - -clean: - -rm -f *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~ - diff --git a/www/example/README b/www/example/README deleted file mode 100644 index ca8ea36..0000000 --- a/www/example/README +++ /dev/null @@ -1,7 +0,0 @@ -Rockbox example build ---------------------- - -These files are meant to show how to build a simple program for the Archos. - -Note that the display code only works on older machines (<4.50) so don't -look too hard on that. diff --git a/www/example/app.lds b/www/example/app.lds deleted file mode 100644 index 03bd1b2..0000000 --- a/www/example/app.lds +++ /dev/null @@ -1,23 +0,0 @@ -ENTRY(_start) -OUTPUT_FORMAT(elf32-sh) -SECTIONS -{ - .vectors 0x09000000 : - { - *(.vectors); - . = ALIGN(0x200); - *(.text.start) - *(.text) - *(.rodata) - } - - .bss : - { - _stack = . + 0x1000; - } - - .pad 0x0900C800 : - { - LONG(0); - } - } diff --git a/www/example/main.c b/www/example/main.c deleted file mode 100644 index 9188aaf..0000000 --- a/www/example/main.c +++ /dev/null @@ -1,102 +0,0 @@ -#define PBDR (*((volatile unsigned short *)0x05FFFFC2)) - -#define DC 1 -#define CS1 2 -#define SDA 4 -#define SCK 8 - -static const unsigned char ascii2lcd[] = { - 0x00,0x01,0x02,0x03,0x00,0x84,0x85,0x89, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0xec,0xe3,0xe2,0xe1,0xe0,0xdf,0x15,0x00, - 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, - 0x24,0x25,0x26,0x37,0x06,0x29,0x2a,0x2b, - 0x2c,0x2d,0x2e,0x2f,0x30,0x31,0x32,0x33, - 0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b, - 0x3c,0x3d,0x3e,0x3f,0x40,0x41,0x42,0x43, - 0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b, - 0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53, - 0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b, - 0x5c,0x5d,0x5e,0xa9,0x33,0xce,0x00,0x15, - 0x00,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b, - 0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73, - 0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b, - 0x7c,0x7d,0x7e,0x24,0x24,0x24,0x24,0x24, - 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, - 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, - 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, - 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, - 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, - 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, - 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, - 0x24,0x24,0x24,0x24,0x24,0x24,0x24,0x24, - 0x45,0x45,0x45,0x45,0x45,0x45,0x24,0x47, - 0x49,0x49,0x49,0x49,0x4d,0x4d,0x4d,0x4d, - 0x48,0x52,0x53,0x53,0x53,0x53,0x53,0x24, - 0x24,0x59,0x59,0x59,0x59,0x5d,0x24,0x24, - 0x65,0x65,0x65,0x65,0x65,0x65,0x24,0x67, - 0x69,0x69,0x69,0x69,0x6d,0x6d,0x6d,0x6d, - 0x73,0x72,0x73,0x73,0x73,0x73,0x73,0x24, - 0x24,0x79,0x79,0x79,0x79,0x7d,0x24,0x7d -}; - -void lcd_write(int byte, int data) -{ - int i; - char on,off; - - PBDR &= ~CS1; /* enable lcd chip select */ - - if ( data ) { - on=~(SDA|SCK); - off=SCK|DC; - } - else { - on=~(SDA|SCK|DC); - off=SCK; - } - /* clock out each bit, MSB first */ - for (i=0x80;i;i>>=1) - { - PBDR &= on; - if (i & byte) - PBDR |= SDA; - PBDR |= off; - } - - PBDR |= CS1; /* disable lcd chip select */ -} - -void lcd_printxy( char x, char y, unsigned char* string, int len ) -{ - int i; - lcd_write(0xb0+y*16+x,0); - for (i=0; string[i] && i<len; i++) - lcd_write(ascii2lcd[string[i]],1); -} - -int main(void) -{ - lcd_printxy(0,0,"Open Source",11); - - /* simple scroll */ - while (1) { - int i,j; - char* string = " Jukebox Jukebox "; - for ( i=0; i<11; i++ ) { - lcd_printxy(0,1,string+i,11); - for (j=0; j<600000; j++); - PBDR ^= 0x40; /* toggle LED (PB6) */ - } - } -} - -extern const void stack(void); - -const void* vectors[] __attribute__ ((section (".vectors"))) = -{ - main, /* Power-on reset */ - stack, /* Power-on reset (stack pointer) */ - main, /* Manual reset */ - stack /* Manual reset (stack pointer) */ -}; diff --git a/www/example/start.s b/www/example/start.s deleted file mode 100644 index fd4669d..0000000 --- a/www/example/start.s +++ /dev/null @@ -1,23 +0,0 @@ -! note: sh-1 has a "delay cycle" after every branch where you can -! execute another instruction "for free". - - .file "start.s" - .section .text.start - .extern _main - .extern _vectors - .extern _stack - .global _start - .align 2 - -_start: - mov.l 1f, r1 - mov.l 3f, r3 - mov.l 2f, r15 - jmp @r3 - ldc r1, vbr - nop - -1: .long _vectors -2: .long _stack -3: .long _main - .type _start,@function |