freemyipod r144 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r143‎ | r144 | r145 >
Date:22:32, 15 August 2010
Author:theseven
Status:new
Tags:
Comment:
Add an iLoader script command to execute emBIOS apps
Modified paths:
  • /apps/iloader/main.c (modified) (history)
  • /apps/iloader/themes/oobe (deleted) (history)
  • /apps/iloader/tools/compileconfig.py (modified) (history)

Diff [purge]

Index: apps/iloader/tools/compileconfig.py
@@ -22,27 +22,28 @@
2323 #
2424
2525
26 -# 0 = nop
27 -# 1 = terminate
28 -# 2 = undefined
29 -# 3 = readflash <addr> <*filename>
30 -# 4 = readfile <addr> <*filename>
31 -# 5 = script <baseaddr> <entrypoint>
32 -# 6 = error <*addr>
33 -# 7 = jmp <*addr>
34 -# 8 = button <*addrcenter> <*addrright> <*addrleft> <*addrplay> <*addrmenu> <timeout>
35 -# 9 = menu <*entries> <selected> <*addrright> <*addrleft> <*addrplay> <*addrmenu> <timeout>
36 -# a = fillrect <x> <y> <width> <height> <color>
37 -# b = text <x> <y> <fgcolor> <bgcolor> <*text>
38 -# c = displaybmp <x> <y> <addr>
39 -# d = blit
40 -# e = backlight <state> <brightness> <fade>
41 -# f = poweroff
 26+# 00 = nop
 27+# 01 = terminate
 28+# 02 = cputs <*text>
 29+# 03 = readflash <addr> <*filename>
 30+# 04 = readfile <addr> <*filename>
 31+# 05 = script <baseaddr> <entrypoint>
 32+# 06 = error <*addr>
 33+# 07 = jmp <*addr>
 34+# 08 = button <*addrcenter> <*addrright> <*addrleft> <*addrplay> <*addrmenu> <timeout>
 35+# 09 = menu <*entries> <selected> <*addrright> <*addrleft> <*addrplay> <*addrmenu> <timeout>
 36+# 0a = fillrect <x> <y> <width> <height> <color>
 37+# 0b = text <x> <y> <fgcolor> <bgcolor> <*text>
 38+# 0c = displaybmp <x> <y> <addr>
 39+# 0d = blit
 40+# 0e = backlight <state> <brightness> <fade>
 41+# 0f = poweroff
4242 # 10 = rbchecksum <addr>
4343 # 11 = sleep <microseconds>
4444 # 12 = clockgate <gateid> <onoff>
4545 # 13 = exec <addr>
4646 # 14 = unpackucl <src> <dest>
 47+# 15 = execembiosapp <addr> <terminate>
4748
4849 # <*text> <x> <y> <fgcolor> <bgcolor> <fgactive> <bgactive> <*addr>
4950
@@ -55,6 +56,7 @@
5657 exit(2)
5758
5859 opcodes = {"terminate": (1, 0), \
 60+ "readflash": (2, 1), \
5961 "readflash": (3, 2), \
6062 "readfile": (4, 2), \
6163 "script": (5, 2), \
@@ -73,6 +75,7 @@
7476 "clockgate": (18, 2), \
7577 "exec": (19, 1), \
7678 "unpackucl": (20, 2), \
 79+ "execembiosapp": (21, 2), \
7780 ".word": (-1, 1), \
7881 ".ascii": (-2, 1), \
7982 ".menuentry": (-3, 8)}
Index: apps/iloader/main.c
@@ -189,6 +189,11 @@
190190 cputs(1, "iLoader terminated on user's behalf\n");
191191 return;
192192
 193+ case 0x2:
 194+ cputs(1, &((char*)config)[config[pc + 1]]);
 195+ pc += 2;
 196+ break;
 197+
193198 case 0x3:
194199 filename = &((char*)config)[config[pc + 2]];
195200 size = bootflash_filesize(filename);
@@ -428,6 +433,12 @@
429434 else pc += 3;
430435 break;
431436
 437+ case 0x15:
 438+ execimage((void*)config[pc + 1]);
 439+ if (config[pc + 2]) return;
 440+ else pc += 3;
 441+ break;
 442+
432443 default:
433444 fallbackcfg();
434445 pc = 0x22;
Index: apps/iloader/themes/oobe/oobe
Property changes on: apps/iloader/themes/oobe/oobe
___________________________________________________________________
Deleted: svn:ignore
## -1,4 +0,0 ##
435 -iloader.cfg
436 -iloader.cfg.ucl
437 -notheme.ucl
438 -welcome.ucl
Index: apps/iloader/themes/oobe/source/welcome.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: apps/iloader/themes/oobe/source/welcome.png
Property changes on: apps/iloader/themes/oobe/source/welcome.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
439 -application/octet-stream
\ No newline at end of property
Index: apps/iloader/themes/oobe/source/notheme.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: apps/iloader/themes/oobe/source/notheme.png
Property changes on: apps/iloader/themes/oobe/source/notheme.png
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
440 -application/octet-stream
\ No newline at end of property
Index: apps/iloader/themes/oobe/source/welcome.psd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: apps/iloader/themes/oobe/source/welcome.psd
Property changes on: apps/iloader/themes/oobe/source/welcome.psd
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
441 -application/octet-stream
\ No newline at end of property
Index: apps/iloader/themes/oobe/source/notheme.psd
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: apps/iloader/themes/oobe/source/notheme.psd
Property changes on: apps/iloader/themes/oobe/source/notheme.psd
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
442 -application/octet-stream
\ No newline at end of property
Index: apps/iloader/themes/oobe/source/iloader.conf
@@ -1,34 +0,0 @@
2 -# nothing center right center+right left center+left left+right center+left+right
3 -.word(notheme) .word(notheme) .word(notheme) .word(ibugger) .word(notheme) .word(diagmode) .word(notheme) .word(notheme)
4 -.word(diskmode) .word(diskmode) .word(notheme) .word(notheme) .word(notheme) .word(notheme) .word(notheme) .word(notheme) # +play
5 -.word(notheme) .word(notheme) .word(notheme) .word(notheme) .word(notheme) .word(notheme) .word(notheme) .word(notheme) # +menu
6 -.word(notheme) .word(notheme) .word(notheme) .word(notheme) .word(notheme) .word(notheme) .word(notheme) .word(notheme) # +play+menu
7 -
8 -# error handler
9 -.word(0xffffffff)
10 -
11 -diskmode:
12 - readflash(0x08000000, "diskmode")
13 - backlight(1, 55, 10)
14 - exec(0x08000000)
15 -
16 -ibugger:
17 - terminate()
18 -
19 -diagmode:
20 - backlight(1, 177, 32)
21 - readflash(0x08000000, "diagmode")
22 - exec(0x08000000)
23 -
24 -notheme:
25 - readflash(0x08000000, "bmwelcom")
26 - displaybmp(0, 0, 0x08000000)
27 - blit()
28 - backlight(1, 177, 32)
29 - button(nothememenu, nothememenu, nothememenu, diskmode, 0xffffffff, 3000000)
30 - readfile(0x08000000, "bmnothem")
31 - displaybmp(0, 0, 0x08000000)
32 - blit()
33 -nothememenu:
34 - button(nothememenu, nothememenu, nothememenu, diskmode, 0xffffffff, 30000000)
35 - poweroff()
Index: apps/iloader/themes/oobe/source/welcome.bmp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: apps/iloader/themes/oobe/source/welcome.bmp
Property changes on: apps/iloader/themes/oobe/source/welcome.bmp
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
36 -application/octet-stream
\ No newline at end of property
Index: apps/iloader/themes/oobe/source/notheme.bmp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: apps/iloader/themes/oobe/source/notheme.bmp
Property changes on: apps/iloader/themes/oobe/source/notheme.bmp
___________________________________________________________________
Deleted: svn:mime-type
## -1 +0,0 ##
37 -application/octet-stream
\ No newline at end of property
Index: apps/iloader/themes/oobe/Makefile
@@ -1,36 +0,0 @@
2 -NAME ?= oobe
3 -
4 -ILOADER = ../..
5 -ASSETPATH = oobe
6 -SOURCEPATH = source
7 -
8 -UCL2E10SINGLEBLK = ucl2e10singleblk
9 -COMPILECONFIG = python $(ILOADER)/tools/compileconfig.py
10 -ZIP = zip -r
11 -
12 -CONFIG = $(ASSETPATH)/iloader.cfg
13 -CONFIGUCL = $(ASSETPATH)/iloader.cfg.ucl
14 -CONFIGSRC = $(SOURCEPATH)/iloader.conf
15 -ASSETS = $(ASSETPATH)/welcome.ucl $(ASSETPATH)/notheme.ucl
16 -
17 -all: $(CONFIGUCL) $(ASSETS)
18 -
19 -$(CONFIGUCL): $(CONFIG)
20 - @echo [UCL] $<
21 - @$(UCL2E10SINGLEBLK) $< $@
22 -
23 -$(CONFIG): $(CONFIGSRC)
24 - @echo [CCONF] $<
25 - @$(COMPILECONFIG) $< $@
26 -
27 -$(ASSETPATH)/%.ucl: $(SOURCEPATH)/%.bmp
28 - @echo [UCL] $<
29 - @$(UCL2E10SINGLEBLK) $< $@
30 -
31 -.PHONY: all clean dist
32 -
33 -clean:
34 - @$(RM) $(CONFIG) $(ASSETS) $(CONFIGUCL)
35 -
36 -dist: all
37 - @$(RM) $(CONFIG) $(ASSETS)