summaryrefslogtreecommitdiff
path: root/utils/AMS/hacking/test.S
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2008-10-01 23:19:14 +0000
committerDave Chapman <dave@dchapman.com>2008-10-01 23:19:14 +0000
commit2c096e463dbdca6ad1d470301709ac83aa84677d (patch)
treed0e09e259fb04fda09df4dfb81e78beb01137b7a /utils/AMS/hacking/test.S
parentcaeaf7693076a404e6f7f68ea13eb63ef58e8b37 (diff)
downloadrockbox-2c096e463dbdca6ad1d470301709ac83aa84677d.tar.gz
rockbox-2c096e463dbdca6ad1d470301709ac83aa84677d.zip
It turns out that in-place UCL decompression isn't as easy as we thought, so we copy the OF to an unused part of RAM before decompressing it. This works - I have successfully patched m300a-1.1.17A.bin and installed on my Clip with this code. Thanks to Rafael Carre (funman) for the actual patch.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18679 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/AMS/hacking/test.S')
-rw-r--r--utils/AMS/hacking/test.S24
1 files changed, 22 insertions, 2 deletions
diff --git a/utils/AMS/hacking/test.S b/utils/AMS/hacking/test.S
index 2e1796fcef..79d23deb6a 100644
--- a/utils/AMS/hacking/test.S
+++ b/utils/AMS/hacking/test.S
@@ -27,10 +27,30 @@ start:
27loop: subs r1, r1, #1 27loop: subs r1, r1, #1
28 bne loop 28 bne loop
29 29
30 /* Call the ucl decompress function, which will branch to 0x0 30 /* First copy the compressed firmware to unused RAM */
31 on completion */ 31
32 ldr r0, ucl_start /* Source */ 32 ldr r0, ucl_start /* Source */
33 ldr r1, ucl_size /* Source length */ 33 ldr r1, ucl_size /* Source length */
34
35 mov r2, #0x40000 /* Destination end */
36 sub r2, r2, r1
37
38memcpy:
39 ldrb r3, [r0]
40 strb r3, [r2]
41 adds r0, r0, #1
42 adds r2, r2, #1
43 cmp r2, #0x40000 /* Stop when we reached dest_end */
44 bne memcpy
45
46 sub r0, r2, r1 /* Point to the compressed firmware */
47
48 /* Call the ucl decompress function, which will branch to 0x0 */
49 /* on completion */
50
34 mov r2, #0 /* Destination */ 51 mov r2, #0 /* Destination */
52
35 ldr r3, ucl_unpack 53 ldr r3, ucl_unpack
36 bx r3 54 bx r3
55
56 /* never reached */