diff options
Diffstat (limited to 'wps/wpsbuild.pl')
-rwxr-xr-x | wps/wpsbuild.pl | 87 |
1 files changed, 72 insertions, 15 deletions
diff --git a/wps/wpsbuild.pl b/wps/wpsbuild.pl index e9e5c29a30..7378f30b32 100755 --- a/wps/wpsbuild.pl +++ b/wps/wpsbuild.pl | |||
@@ -32,9 +32,18 @@ my $cppdef = $target; | |||
32 | my @depthlist = ( 16, 8, 4, 2, 1 ); | 32 | my @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 |
35 | my $req_size; | ||
36 | my $req_g_wps; | ||
37 | my $req_t; | ||
38 | my $req_t_wps; | ||
35 | my $wps; | 39 | my $wps; |
36 | my $wps_prefix; | 40 | my $wps_prefix; |
41 | my $sbs_prefix; | ||
37 | my $rwps; | 42 | my $rwps; |
43 | my $sbs; | ||
44 | my $sbs_w_size; | ||
45 | my $rsbs; | ||
46 | my $rsbs_w_size; | ||
38 | my $width; | 47 | my $width; |
39 | my $height; | 48 | my $height; |
40 | my $font; | 49 | my $font; |
@@ -42,9 +51,6 @@ my $fgcolor; | |||
42 | my $bgcolor; | 51 | my $bgcolor; |
43 | my $statusbar; | 52 | my $statusbar; |
44 | my $author; | 53 | my $author; |
45 | my $req_g; | ||
46 | my $req_g_wps; | ||
47 | my $req_t_wps; | ||
48 | my $backdrop; | 54 | my $backdrop; |
49 | my $lineselectstart; | 55 | my $lineselectstart; |
50 | my $lineselectend; | 56 | my $lineselectend; |
@@ -191,12 +197,26 @@ sub copywps | |||
191 | my $dir; | 197 | my $dir; |
192 | my @filelist; | 198 | my @filelist; |
193 | my $file; | 199 | my $file; |
200 | my $__sb; | ||
194 | 201 | ||
195 | if($wpslist =~ /(.*)WPSLIST/) { | 202 | if($wpslist =~ /(.*)WPSLIST/) { |
196 | $dir = $1; | 203 | $dir = $1; |
197 | # system("cp $dir/$wps .rockbox/wps/"); | 204 | $__sb = $sbs_prefix . "." . $req_size . ".sbs"; |
198 | #print "$req_t_wps $req_g_wps\n"; | 205 | #print "$req_t_wps $req_g_wps $sbs_prefix\n"; |
206 | #print "$dir/$__sb\n"; | ||
199 | 207 | ||
208 | # system("cp $dir/$wps .rockbox/wps/"); | ||
209 | # check for <name>.WIDTHxHEIGHTxDEPTH.sbs | ||
210 | if (-e "$dir/$__sb") { | ||
211 | system("cp $dir/$__sb $rbdir/wps/$sbs"); | ||
212 | } | ||
213 | # check for <name>.WIDTHxHEIGHTxDEPTH.<model>.sbs and overwrite the | ||
214 | # previous sb if needed | ||
215 | $__sb = $sbs_prefix . "." . $req_size . "." . $modelname . ".sbs"; | ||
216 | if (-e "$dir/$__sb") { | ||
217 | system("cp $dir/$__sb $rbdir/wps/$sbs"); | ||
218 | } | ||
219 | |||
200 | if (-e "$dir/$req_t_wps" ) { | 220 | if (-e "$dir/$req_t_wps" ) { |
201 | system("cp $dir/$req_t_wps $rbdir/wps/$wps"); | 221 | system("cp $dir/$req_t_wps $rbdir/wps/$wps"); |
202 | 222 | ||
@@ -210,9 +230,9 @@ sub copywps | |||
210 | close(WPSFILE); | 230 | close(WPSFILE); |
211 | 231 | ||
212 | if ($#filelist >= 0) { | 232 | if ($#filelist >= 0) { |
213 | if (-e "$dir/$wps_prefix/$req_g") { | 233 | if (-e "$dir/$wps_prefix/$req_size") { |
214 | foreach $file (@filelist) { | 234 | foreach $file (@filelist) { |
215 | system("cp $dir/$wps_prefix/$req_g/$file $rbdir/wps/$wps_prefix/"); | 235 | system("cp $dir/$wps_prefix/$req_size/$file $rbdir/wps/$wps_prefix/"); |
216 | } | 236 | } |
217 | } | 237 | } |
218 | elsif (-e "$dir/$wps_prefix") { | 238 | elsif (-e "$dir/$wps_prefix") { |
@@ -235,7 +255,7 @@ sub copywps | |||
235 | 255 | ||
236 | sub buildcfg { | 256 | sub buildcfg { |
237 | my $cfg = $wps; | 257 | my $cfg = $wps; |
238 | my @out; | 258 | my @out; |
239 | 259 | ||
240 | $cfg =~ s/\.(r|)wps/.cfg/; | 260 | $cfg =~ s/\.(r|)wps/.cfg/; |
241 | 261 | ||
@@ -247,6 +267,20 @@ sub buildcfg { | |||
247 | wps: /$rbdir/wps/$wps | 267 | wps: /$rbdir/wps/$wps |
248 | MOO | 268 | MOO |
249 | ; | 269 | ; |
270 | if(defined($sbs)) { | ||
271 | if ($sbs eq '') { | ||
272 | push @out, "sbs: -\n"; | ||
273 | } else { | ||
274 | push @out, "sbs: /$rbdir/wps/$sbs\n"; | ||
275 | } | ||
276 | } | ||
277 | if(defined($sbs) && $has_remote) { | ||
278 | if ($rsbs eq '') { | ||
279 | push @out, "rsbs: -\n"; | ||
280 | } else { | ||
281 | push @out, "rsbs: /$rbdir/wps/$rsbs\n"; | ||
282 | } | ||
283 | } | ||
250 | if($font) { | 284 | if($font) { |
251 | push @out, "font: /$rbdir/fonts/$font\n"; | 285 | push @out, "font: /$rbdir/fonts/$font\n"; |
252 | } | 286 | } |
@@ -264,7 +298,7 @@ MOO | |||
264 | } | 298 | } |
265 | if(defined($backdrop)) { | 299 | if(defined($backdrop)) { |
266 | if ($backdrop eq '') { | 300 | if ($backdrop eq '') { |
267 | push @out, "backdrop:\n"; | 301 | push @out, "backdrop: -\n"; |
268 | } else { | 302 | } else { |
269 | # clip resolution from filename | 303 | # clip resolution from filename |
270 | $backdrop =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//; | 304 | $backdrop =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//; |
@@ -338,6 +372,8 @@ while(<WPS>) { | |||
338 | undef $wps; | 372 | undef $wps; |
339 | undef $wps_prefix; | 373 | undef $wps_prefix; |
340 | undef $rwps; | 374 | undef $rwps; |
375 | undef $sbs; | ||
376 | undef $rsbs; | ||
341 | undef $width; | 377 | undef $width; |
342 | undef $height; | 378 | undef $height; |
343 | undef $font; | 379 | undef $font; |
@@ -386,23 +422,24 @@ while(<WPS>) { | |||
386 | foreach my $d (@depthlist) { | 422 | foreach my $d (@depthlist) { |
387 | next if ($d > $rdepth); | 423 | next if ($d > $rdepth); |
388 | 424 | ||
389 | $req_g = $rwidth . "x" . $rheight . "x" . $d; | 425 | $req_size = $rwidth . "x" . $rheight . "x" . $d; |
390 | 426 | ||
391 | # check for model specific wps | 427 | # check for model specific wps |
392 | $req_g_wps = $wps_prefix . "." . $req_g . "." . $modelname . ".wps"; | 428 | $req_g_wps = $wps_prefix . "." . $req_size . "." . $modelname . ".wps"; |
393 | last if (-e "$wpsdir/$req_g_wps"); | 429 | last if (-e "$wpsdir/$req_g_wps"); |
394 | 430 | ||
395 | $req_g_wps = $wps_prefix . "." . $req_g . ".wps"; | 431 | # check for normal wps (with WIDTHxHEIGHTxDEPTH) |
432 | $req_g_wps = $wps_prefix . "." . $req_size . ".wps"; | ||
396 | last if (-e "$wpsdir/$req_g_wps"); | 433 | last if (-e "$wpsdir/$req_g_wps"); |
397 | 434 | ||
398 | if ($isrwps) { | 435 | if ($isrwps) { |
399 | $req_g = $req_g . "." . $main_width . "x" . $main_height . "x" . "$main_depth"; | 436 | $req_size = $req_size . "." . $main_width . "x" . $main_height . "x" . "$main_depth"; |
400 | 437 | ||
401 | $req_g_wps = $wps_prefix . "." . $req_g . ".wps"; | 438 | $req_g_wps = $wps_prefix . "." . $req_size . ".wps"; |
402 | last if (-e "$wpsdir/$req_g_wps"); | 439 | last if (-e "$wpsdir/$req_g_wps"); |
403 | } | 440 | } |
404 | } | 441 | } |
405 | $req_t_wps = $wps_prefix . ".txt" . ".wps"; | 442 | $req_t_wps = $wps_prefix . $req_t . ".wps"; |
406 | 443 | ||
407 | #print "LCD: $wps wants $width x $height\n"; | 444 | #print "LCD: $wps wants $width x $height\n"; |
408 | #print "LCD: is $rwidth x $rheight\n"; | 445 | #print "LCD: is $rwidth x $rheight\n"; |
@@ -454,6 +491,20 @@ while(<WPS>) { | |||
454 | elsif($l =~ /^RWPS\.${main_width}x${main_height}x$main_depth: *(.*)/i) { | 491 | elsif($l =~ /^RWPS\.${main_width}x${main_height}x$main_depth: *(.*)/i) { |
455 | $rwps = $1; | 492 | $rwps = $1; |
456 | } | 493 | } |
494 | elsif($l =~ /^SBS: *(.*)/i) { | ||
495 | $sbs = $sbs_prefix = $1; | ||
496 | $sbs_prefix =~ s/\.(r|)sbs//; | ||
497 | } | ||
498 | elsif($l =~ /^SBS\.${main_width}x${main_height}x$main_depth: *(.*)/i) { | ||
499 | $sbs = $sbs_prefix = $1; | ||
500 | $sbs_prefix =~ s/\.(r|)sbs//; | ||
501 | } | ||
502 | elsif($l =~ /^RSBS: *(.*)/i) { | ||
503 | $rsbs = $1; | ||
504 | } | ||
505 | elsif($l =~ /^RSBS\.${main_width}x${main_height}x$main_depth: *(.*)/i) { | ||
506 | $rsbs = $1; | ||
507 | } | ||
457 | elsif($l =~ /^Author: *(.*)/i) { | 508 | elsif($l =~ /^Author: *(.*)/i) { |
458 | $author = $1; | 509 | $author = $1; |
459 | } | 510 | } |
@@ -526,9 +577,15 @@ while(<WPS>) { | |||
526 | elsif($l =~ /^ui viewport: *(.*)/i) { | 577 | elsif($l =~ /^ui viewport: *(.*)/i) { |
527 | $listviewport = $1; | 578 | $listviewport = $1; |
528 | } | 579 | } |
580 | elsif($l =~ /^ui viewport\.${main_width}x${main_height}x$main_depth: *(.*)/i) { | ||
581 | $listviewport = $1; | ||
582 | } | ||
529 | elsif($l =~ /^remote ui viewport: *(.*)/i) { | 583 | elsif($l =~ /^remote ui viewport: *(.*)/i) { |
530 | $remotelistviewport = $1; | 584 | $remotelistviewport = $1; |
531 | } | 585 | } |
586 | elsif($l =~ /^remote ui viewport\.${main_width}x${main_height}x$main_depth: *(.*)/i) { | ||
587 | $remotelistviewport = $1; | ||
588 | } | ||
532 | else{ | 589 | else{ |
533 | #print "Unknown line: $l!\n"; | 590 | #print "Unknown line: $l!\n"; |
534 | } | 591 | } |