summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/winiss.pl
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2016-11-20 15:16:41 -0500
committerFranklin Wei <frankhwei536@gmail.com>2016-11-24 16:23:09 -0500
commit56c9984511f016eab7e1278ba9e40d88bb59a162 (patch)
tree1bfa6d3aeb3bf2a6ffec71387ac073cd0b8b2a51 /apps/plugins/puzzles/winiss.pl
parent29648f817677b84c03c2bcfe89eb8cf53653e7db (diff)
downloadrockbox-puzzles.zip
rockbox-puzzles.tar.gz
rockbox-puzzles.tar.bz2
rockbox-puzzles.tar.xz
[WIP] Port of Simon Tatham's Puzzle Collectionpuzzles
Original revision: 5123b1bf68777ffa86e651f178046b26a87cf2d9 MIT Licensed. Some games still crash and others are unplayable due to issues with controls. Still need a "real" polygon filling algorithm. The following games are at least partially broken for various reasons: Cube: crash with certain settings Galaxies: crash Inertia: crash Keen: input issues Loopy: weird stuff happens Map: crash on input Mines: weird stuff happens on target Palisade: input issues Signpost: crash on input Solo: input issues Towers: input and drawing issues Train Tracks: drawing issues Twiddle: weird animation on target Undead: input and drawing issues Unequal: input and drawing issues Untangle: input issues All in all, about 40% of the games are at least partially broken. Change-Id: I7c69b6860ab115f973c8d76799502e9bb3d52368
Diffstat (limited to 'apps/plugins/puzzles/winiss.pl')
-rwxr-xr-xapps/plugins/puzzles/winiss.pl79
1 files changed, 79 insertions, 0 deletions
diff --git a/apps/plugins/puzzles/winiss.pl b/apps/plugins/puzzles/winiss.pl
new file mode 100755
index 0000000..eca02d3
--- /dev/null
+++ b/apps/plugins/puzzles/winiss.pl
@@ -0,0 +1,79 @@
+#!/usr/bin/perl
+
+# Perl script to generate an Inno Setup installer script for
+# Puzzles. This has to be scripted so that it can read gamedesc.txt
+# and automatically adjust to the current available set of puzzles.
+
+# Usage:
+#
+# $ ./winiss.pl 20140922.sdfsdf gamedesc.txt > puzzles.iss
+#
+# where the first argument is the version number which will be encoded
+# in the installer's version indicators. The first component of that
+# version number will be expected to be a YYYYMMDD-format date.
+
+use warnings;
+use Time::Local;
+
+$ver = shift @ARGV;
+
+# Parse the date out of $ver, and convert it into an integer number of
+# days since an arbitrary epoch. This number is used for the Windows
+# version resource (which wants a monotonic 16-bit integer). The epoch
+# is chosen so that the first build using this date-based mechanism
+# has a higher number than the last build in which that number was
+# derived from a Subversion revision.
+die "bad date format" if $ver !~ /^(\d{4})(\d{2})(\d{2})/;
+$date = timegm(0,0,0,$3,$2-1,$1);
+$integer_date = int($date / 86400) - 6000;
+
+$desc = shift @ARGV;
+open DESC, "<", $desc;
+while (<DESC>) {
+ chomp;
+ @_ = split /:/;
+ push @exes, $_[1];
+ $names{$_[1]} = $_[2];
+}
+close DESC;
+
+print '; -*- no -*-'."\n";
+print ';'."\n";
+print '; -- Inno Setup installer script for Puzzles.'."\n";
+print ''."\n";
+print '[Setup]'."\n";
+print 'AppName=Simon Tatham\'s Portable Puzzle Collection'."\n";
+print 'AppVerName=Puzzles version '.$ver."\n";
+print 'VersionInfoTextVersion=Version '.$ver."\n";
+print 'AppVersion=r'.$ver."\n";
+print 'VersionInfoVersion=0.0.'.$integer_date.'.0'."\n";
+print 'AppPublisher=Simon Tatham'."\n";
+print 'AppPublisherURL=http://www.chiark.greenend.org.uk/~sgtatham/puzzles/'."\n";
+print 'DefaultDirName={pf}\Simon Tatham\'s Portable Puzzle Collection'."\n";
+print 'DefaultGroupName=Simon Tatham\'s Puzzles'."\n";
+# print 'SetupIconFile=fixmethinkoneup.ico'."\n";
+# print 'UninstallDisplayIcon={app}\fixmethinkoneup.exe'."\n";
+print 'ChangesAssociations=no'."\n";
+print 'Compression=zip/9'."\n";
+print 'AllowNoIcons=yes'."\n";
+print 'OutputBaseFilename=installer'."\n";
+print ''."\n";
+print '[Files]'."\n";
+for $exe (@exes) {
+ print 'Source: "'.$exe.'"; DestDir: "{app}"; Flags: promptifolder replacesameversion uninsrestartdelete'."\n";
+}
+print 'Source: "website.url"; DestDir: "{app}"; Flags: uninsrestartdelete'."\n";
+print 'Source: "puzzles.chm"; DestDir: "{app}"; Flags: uninsrestartdelete'."\n";
+print 'Source: "puzzles.hlp"; DestDir: "{app}"; Flags: uninsrestartdelete'."\n";
+print 'Source: "puzzles.cnt"; DestDir: "{app}"; Flags: uninsrestartdelete'."\n";
+print 'Source: "LICENCE"; DestDir: "{app}"; Flags: uninsrestartdelete'."\n";
+print ''."\n";
+print '[Icons]'."\n";
+for $exe (@exes) {
+ print 'Name: "{group}\\'.$names{$exe}.'"; Filename: "{app}\\'.$exe.'"'."\n";
+}
+print '; We have to fall back from the .chm to the older .hlp file on some Windows'."\n";
+print '; versions.'."\n";
+print 'Name: "{group}\Puzzles Manual"; Filename: "{app}\puzzles.chm"; MinVersion: 4.1,5.0'."\n";
+print 'Name: "{group}\Puzzles Manual"; Filename: "{app}\puzzles.hlp"; OnlyBelowVersion: 4.1,5.0'."\n";
+print 'Name: "{group}\Puzzles Web Site"; Filename: "{app}\website.url"'."\n";