summaryrefslogtreecommitdiff
path: root/wps/wpsbuild.pl
diff options
context:
space:
mode:
Diffstat (limited to 'wps/wpsbuild.pl')
-rwxr-xr-xwps/wpsbuild.pl70
1 files changed, 14 insertions, 56 deletions
diff --git a/wps/wpsbuild.pl b/wps/wpsbuild.pl
index 04e2846025..e9e5c29a30 100755
--- a/wps/wpsbuild.pl
+++ b/wps/wpsbuild.pl
@@ -32,18 +32,9 @@ my $cppdef = $target;
32my @depthlist = ( 16, 8, 4, 2, 1 ); 32my @depthlist = ( 16, 8, 4, 2, 1 );
33 33
34# These parameters are filled in as we parse wpslist 34# These parameters are filled in as we parse wpslist
35my $req_size;
36my $req_g_wps;
37my $req_t;
38my $req_t_wps;
39my $wps; 35my $wps;
40my $wps_prefix; 36my $wps_prefix;
41my $sb_prefix;
42my $rwps; 37my $rwps;
43my $sb;
44my $sb_w_size;
45my $rsb;
46my $rsb_w_size;
47my $width; 38my $width;
48my $height; 39my $height;
49my $font; 40my $font;
@@ -51,6 +42,9 @@ my $fgcolor;
51my $bgcolor; 42my $bgcolor;
52my $statusbar; 43my $statusbar;
53my $author; 44my $author;
45my $req_g;
46my $req_g_wps;
47my $req_t_wps;
54my $backdrop; 48my $backdrop;
55my $lineselectstart; 49my $lineselectstart;
56my $lineselectend; 50my $lineselectend;
@@ -197,26 +191,12 @@ sub copywps
197 my $dir; 191 my $dir;
198 my @filelist; 192 my @filelist;
199 my $file; 193 my $file;
200 my $__sb;
201 194
202 if($wpslist =~ /(.*)WPSLIST/) { 195 if($wpslist =~ /(.*)WPSLIST/) {
203 $dir = $1; 196 $dir = $1;
204 $__sb = $sb_prefix . "." . $req_size . ".sb";
205 print "$req_t_wps $req_g_wps $sb_prefix\n";
206 print "$dir/$__sb\n";
207
208# system("cp $dir/$wps .rockbox/wps/"); 197# system("cp $dir/$wps .rockbox/wps/");
209 # check for <name>.WIDTHxHEIGHTxDEPTH.sb 198 #print "$req_t_wps $req_g_wps\n";
210 if (-e "$dir/$__sb") { 199
211 system("cp $dir/$__sb $rbdir/wps/$sb");
212 }
213 # check for <name>.WIDTHxHEIGHTxDEPTH.<model>.sb and overwrite the
214 # previous sb if needed
215 $__sb = $sb_prefix . "." . $req_size . "." . $modelname . ".sb";
216 if (-e "$dir/$__sb") {
217 system("cp $dir/$__sb $rbdir/wps/$sb");
218 }
219
220 if (-e "$dir/$req_t_wps" ) { 200 if (-e "$dir/$req_t_wps" ) {
221 system("cp $dir/$req_t_wps $rbdir/wps/$wps"); 201 system("cp $dir/$req_t_wps $rbdir/wps/$wps");
222 202
@@ -230,9 +210,9 @@ sub copywps
230 close(WPSFILE); 210 close(WPSFILE);
231 211
232 if ($#filelist >= 0) { 212 if ($#filelist >= 0) {
233 if (-e "$dir/$wps_prefix/$req_size") { 213 if (-e "$dir/$wps_prefix/$req_g") {
234 foreach $file (@filelist) { 214 foreach $file (@filelist) {
235 system("cp $dir/$wps_prefix/$req_size/$file $rbdir/wps/$wps_prefix/"); 215 system("cp $dir/$wps_prefix/$req_g/$file $rbdir/wps/$wps_prefix/");
236 } 216 }
237 } 217 }
238 elsif (-e "$dir/$wps_prefix") { 218 elsif (-e "$dir/$wps_prefix") {
@@ -255,7 +235,7 @@ sub copywps
255 235
256sub buildcfg { 236sub buildcfg {
257 my $cfg = $wps; 237 my $cfg = $wps;
258 my @out; 238 my @out;
259 239
260 $cfg =~ s/\.(r|)wps/.cfg/; 240 $cfg =~ s/\.(r|)wps/.cfg/;
261 241
@@ -358,8 +338,6 @@ while(<WPS>) {
358 undef $wps; 338 undef $wps;
359 undef $wps_prefix; 339 undef $wps_prefix;
360 undef $rwps; 340 undef $rwps;
361 undef $sb;
362 undef $rsb;
363 undef $width; 341 undef $width;
364 undef $height; 342 undef $height;
365 undef $font; 343 undef $font;
@@ -408,24 +386,23 @@ while(<WPS>) {
408 foreach my $d (@depthlist) { 386 foreach my $d (@depthlist) {
409 next if ($d > $rdepth); 387 next if ($d > $rdepth);
410 388
411 $req_size = $rwidth . "x" . $rheight . "x" . $d; 389 $req_g = $rwidth . "x" . $rheight . "x" . $d;
412 390
413 # check for model specific wps 391 # check for model specific wps
414 $req_g_wps = $wps_prefix . "." . $req_size . "." . $modelname . ".wps"; 392 $req_g_wps = $wps_prefix . "." . $req_g . "." . $modelname . ".wps";
415 last if (-e "$wpsdir/$req_g_wps"); 393 last if (-e "$wpsdir/$req_g_wps");
416 394
417 # check for normal wps (with WIDTHxHEIGHTxDEPTH) 395 $req_g_wps = $wps_prefix . "." . $req_g . ".wps";
418 $req_g_wps = $wps_prefix . "." . $req_size . ".wps";
419 last if (-e "$wpsdir/$req_g_wps"); 396 last if (-e "$wpsdir/$req_g_wps");
420 397
421 if ($isrwps) { 398 if ($isrwps) {
422 $req_size = $req_size . "." . $main_width . "x" . $main_height . "x" . "$main_depth"; 399 $req_g = $req_g . "." . $main_width . "x" . $main_height . "x" . "$main_depth";
423 400
424 $req_g_wps = $wps_prefix . "." . $req_size . ".wps"; 401 $req_g_wps = $wps_prefix . "." . $req_g . ".wps";
425 last if (-e "$wpsdir/$req_g_wps"); 402 last if (-e "$wpsdir/$req_g_wps");
426 } 403 }
427 } 404 }
428 $req_t_wps = $wps_prefix . $req_t . ".wps"; 405 $req_t_wps = $wps_prefix . ".txt" . ".wps";
429 406
430 #print "LCD: $wps wants $width x $height\n"; 407 #print "LCD: $wps wants $width x $height\n";
431 #print "LCD: is $rwidth x $rheight\n"; 408 #print "LCD: is $rwidth x $rheight\n";
@@ -477,19 +454,6 @@ while(<WPS>) {
477 elsif($l =~ /^RWPS\.${main_width}x${main_height}x$main_depth: *(.*)/i) { 454 elsif($l =~ /^RWPS\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
478 $rwps = $1; 455 $rwps = $1;
479 } 456 }
480 elsif($l =~ /^SB: *(.*)/i) {
481 $sb = $sb_prefix = $1;
482 $sb_prefix =~ s/\.(r|)sb//;
483 }
484 elsif($l =~ /^SB\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
485 $sb = $1;
486 }
487 elsif($l =~ /^RSB: *(.*)/i) {
488 $rsb = $1;
489 }
490 elsif($l =~ /^RSB\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
491 $rsb = $1;
492 }
493 elsif($l =~ /^Author: *(.*)/i) { 457 elsif($l =~ /^Author: *(.*)/i) {
494 $author = $1; 458 $author = $1;
495 } 459 }
@@ -562,15 +526,9 @@ while(<WPS>) {
562 elsif($l =~ /^ui viewport: *(.*)/i) { 526 elsif($l =~ /^ui viewport: *(.*)/i) {
563 $listviewport = $1; 527 $listviewport = $1;
564 } 528 }
565 elsif($l =~ /^ui viewport\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
566 $listviewport = $1;
567 }
568 elsif($l =~ /^remote ui viewport: *(.*)/i) { 529 elsif($l =~ /^remote ui viewport: *(.*)/i) {
569 $remotelistviewport = $1; 530 $remotelistviewport = $1;
570 } 531 }
571 elsif($l =~ /^remote ui viewport\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
572 $remotelistviewport = $1;
573 }
574 else{ 532 else{
575 #print "Unknown line: $l!\n"; 533 #print "Unknown line: $l!\n";
576 } 534 }