|
Revision 2, 2.1 kB
(checked in by nextime, 2 years ago)
|
Initial import, branching from morphix svn
|
| Line | |
|---|
| 1 |
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|---|
| 2 |
% |
|---|
| 3 |
% Boot loader splash code. |
|---|
| 4 |
% |
|---|
| 5 |
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|---|
| 9 |
% Some global vars. |
|---|
| 10 |
|
|---|
| 11 |
% Boot loader splash areas to uncover. |
|---|
| 12 |
% |
|---|
| 13 |
/bsplash.areas [ |
|---|
| 14 |
[ 214 161 209 145 true ] |
|---|
| 15 |
[ 62 67 140 40 false ] |
|---|
| 16 |
[ 275 19 190 48 false ] |
|---|
| 17 |
[ 466 98 138 46 false ] |
|---|
| 18 |
[ 498 237 106 50 false ] |
|---|
| 19 |
[ 395 347 179 75 false ] |
|---|
| 20 |
[ 147 405 188 60 false ] |
|---|
| 21 |
[ 32 325 138 46 false ] |
|---|
| 22 |
[ 78 144 76 133 false ] |
|---|
| 23 |
] def |
|---|
| 24 |
|
|---|
| 25 |
% start value |
|---|
| 26 |
/rand.start time def |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|---|
| 30 |
% Generate pseudo random number. |
|---|
| 31 |
% Good enough for boot loader splash screen. |
|---|
| 32 |
% |
|---|
| 33 |
% ( ) ==> ( int ) |
|---|
| 34 |
% |
|---|
| 35 |
/rand { |
|---|
| 36 |
rand.start 59 mul 97 add 0x7fffffff and |
|---|
| 37 |
/rand.start over def |
|---|
| 38 |
} def |
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|---|
| 42 |
% Show boot loader splash. |
|---|
| 43 |
% |
|---|
| 44 |
% ( ) ==> ( ) |
|---|
| 45 |
% |
|---|
| 46 |
/bsplash.show { |
|---|
| 47 |
currentimage |
|---|
| 48 |
|
|---|
| 49 |
"splash.pcx" findfile setimage loadpalette |
|---|
| 50 |
/max_image_colors max_image_colors image.colors max def |
|---|
| 51 |
|
|---|
| 52 |
0 0 moveto currentpoint 1 1 image getpixel setcolor screen.size fillrect |
|---|
| 53 |
|
|---|
| 54 |
% 7 0xffffff setpalette |
|---|
| 55 |
% 0 0 moveto 0 0 image.size image |
|---|
| 56 |
|
|---|
| 57 |
% center image |
|---|
| 58 |
image.size screen.size exch 4 -1 roll sub 2 div 3 1 roll exch sub 2 div |
|---|
| 59 |
/bsplash.y exch def |
|---|
| 60 |
/bsplash.x exch def |
|---|
| 61 |
|
|---|
| 62 |
bsplash.areas 0 get |
|---|
| 63 |
dup 0 get over 1 get moveto currentpoint bsplash.x bsplash.y rmoveto |
|---|
| 64 |
2 index 2 get 3 index 3 get 5 -1 roll pop image |
|---|
| 65 |
500000 usleep |
|---|
| 66 |
|
|---|
| 67 |
{ |
|---|
| 68 |
bsplash.areas rand over length mod get |
|---|
| 69 |
dup 4 get { |
|---|
| 70 |
pop |
|---|
| 71 |
} { |
|---|
| 72 |
dup 0 get over 1 get moveto currentpoint bsplash.x bsplash.y rmoveto |
|---|
| 73 |
2 index 2 get 3 index 3 get 5 -1 roll 4 true put image |
|---|
| 74 |
50000 usleep |
|---|
| 75 |
} ifelse |
|---|
| 76 |
|
|---|
| 77 |
true |
|---|
| 78 |
0 1 bsplash.areas length 1 sub { |
|---|
| 79 |
bsplash.areas exch get 4 get and |
|---|
| 80 |
} for |
|---|
| 81 |
{ exit } if |
|---|
| 82 |
} loop |
|---|
| 83 |
|
|---|
| 84 |
setimage |
|---|
| 85 |
} def |
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
|---|
| 89 |
% Just wait. |
|---|
| 90 |
% |
|---|
| 91 |
% ( ) ==> ( ) |
|---|
| 92 |
% |
|---|
| 93 |
/bsplash.done { |
|---|
| 94 |
3000000 usleep |
|---|
| 95 |
} def |
|---|
| 96 |
|
|---|
| 97 |
|
|---|