summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2012-10-06 15:30:56 (GMT)
committer Daniel Silverstone <dsilvers@digital-scurf.org>2012-10-06 15:30:56 (GMT)
commit0431978d40ba1881ed098a4c1964a668179d5254 (patch)
tree2f0d3f06818a766741382f8805fe23c1a758925d
parenta28b0131b4da7a89db3be14c89bd0c943c47fb35 (diff)
downloadsqueeze-0431978d40ba1881ed098a4c1964a668179d5254.tar.gz
squeeze-0431978d40ba1881ed098a4c1964a668179d5254.tar.bz2
More hacking
-rw-r--r--.gitignore1
-rw-r--r--Makefile17
-rw-r--r--makeheader.pl24
-rw-r--r--unsqueeze.s12
4 files changed, 43 insertions, 11 deletions
diff --git a/.gitignore b/.gitignore
index 6415d22..0c05832 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@
squeeze
unsqueeze1.h
unsqrm1.h
+*.bin
diff --git a/Makefile b/Makefile
index 0c7e481..317fb0e 100644
--- a/Makefile
+++ b/Makefile
@@ -6,22 +6,29 @@ all: squeeze
SDK_PATH = /opt/netsurf/arm-unknown-riscos/cross/bin/
PERL ?= perl
+export PERL
MAKEHEADER = $(PERL) makeheader.pl
clean:
$(RM) squeeze squeeze.o unsqueeze.o unsqrm.o
- $(RM) unsqueeze1.h unsqrm1.h
+ $(RM) unsqueeze1.h unsqrm1.h unsqueeze.bin unsqrm.bin
squeeze: squeeze.o
squeeze.o: squeeze.c unsqueeze1.h unsqrm1.h
-unsqrm1.h: unsqrm.o
- $(MAKEHEADER) $< $@
+unsqrm1.h: unsqrm.bin
+ $(MAKEHEADER) unsqueeze_base unsqueeze_limit unsqueeze_end $< $@
-unsqueeze1.h: unsqueeze.o
- $(MAKEHEADER) $< $@
+unsqueeze1.h: unsqueeze.bin
+ $(MAKEHEADER) UnSqueeze_UnSqueezeBase '' UnSqueeze_UnSqueezeLimit $< $@
+
+unsqueeze.bin: unsqueeze.o
+ arm-unknown-riscos-objcopy -O binary -j 'M2$$$$Code' $< $@
+
+unsqrm.bin: unsqrm.o
+ arm-unknown-riscos-objcopy -O binary -j unsqueeze $< $@
%.o:%.s
$(SDK_PATH)asasm -o $@ -elf -32 $<
diff --git a/makeheader.pl b/makeheader.pl
new file mode 100644
index 0000000..2e2c426
--- a/dev/null
+++ b/makeheader.pl
@@ -0,0 +1,24 @@
+#!/usr/bin/perl -w
+
+use strict;
+
+my ($basename, $midname, $endname, $infilename, $outfilename) = @ARGV;
+
+my $perl = $ENV{PERL};
+
+my $output_text = `$perl bin2c.pl THINGY < $infilename`;
+
+$output_text =~ s/THINGY\[\]/$basename\[\]/;
+
+$output_text =~ s/unsigned int THINGY_len = (\d+)/unsigned char $endname = $basename + $1/;
+
+my $repltext = "unsigned char $midname = $endname - 4;";
+$repltext = "" if ($midname eq '');
+
+$output_text =~ s/int THINGY_mtime = \d+;/$repltext/;
+
+open JELLY, ">", $outfilename;
+
+print JELLY $output_text;
+
+close JELLY;
diff --git a/unsqueeze.s b/unsqueeze.s
index 85e0dc2..7c1cbee 100644
--- a/unsqueeze.s
+++ b/unsqueeze.s
@@ -458,11 +458,11 @@ runImage
; Entry point to PROCEDURE FindUnSqueezeCode
; Parameters: base: [FP,#-20]/R0 limit: [FP,#-16]/R1
-|UnSqueeze_FindUnSqueezeCode|
- ADR R2, |UnSqueeze_UnSqueezeBase|
- STR R2, [R0]
- ADR R2, |UnSqueeze_UnSqueezeLimit|
- STR R2, [R1]
- MOV PC, LR
+;|UnSqueeze_FindUnSqueezeCode|
+; ADR R2, |UnSqueeze_UnSqueezeBase|
+; STR R2, [R0]
+; ADR R2, |UnSqueeze_UnSqueezeLimit|
+; STR R2, [R1]
+; MOV PC, LR
END