%% image breakout.pcx 640 480 %% font font_10x20 fixed_10x20 % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % Configuration script for the "Breakout" boot screen. % % Copyright (C) 2001-2002, Raphael Quinet % % This program is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % This program is distributed in the hope that it will be useful, % but WITHOUT ANY WARRANTY; without even the implied warranty of % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program; if not, write to the Free Software % Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. % % Revision history: % 2001-11-15 - (xray-blue.config) file derived from xray-green.config % 2002-01-04 - (penguins.config) file derived from xray-blue.config % 2002-01-12 - file derived from penguins.config % 2002-01-20 - first playable beta version (11 levels, no powerups yet) % % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % This script is based on those included in SuSE 7.2 and SuSE 7.3, modified % by Raphael Quinet. All graphics in breakout.pcx were created by Raphael % Quinet using the GIMP. % % Requires a patched version of lilo (version 21.6 or greater) that supports % graphical boot screens and callbacks for events. For more information, see: % http://www.gamers.org/~quinet/lilo/. % % Use mkbootmsg to compile this script: % /usr/sbin/mkbootmsg -c breakout.config breakout.boot % Make sure that the image file and the font file listed at the top of this % script are available when you run mkbootmsg. % % To install it and use it as a new boot screen, copy it in /boot (as root): % cp breakout.boot /boot % then insert the following line in /etc/lilo.conf: % message = /boot/breakout.boot % and finally run lilo to install it: % /sbin/lilo -v % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % some useful constants % % some key codes /keyEsc 0x011b def /keyEnter 0x1c0d def /keyUp 0x4800 def /keyDown 0x5000 def /keyPgUp 0x4900 def /keyPgDown 0x5100 def /keyLeft 0x4b00 def /keyRight 0x4d00 def /keyHome 0x4700 def /keyEnd 0x4f00 def /keyF1 0x3b00 def /keyF2 0x3c00 def /keyF3 0x3d00 def /keyF4 0x3e00 def /keyF5 0x3f00 def /keyF6 0x4000 def /keyF7 0x4100 def /keyF8 0x4200 def /keyF9 0x4300 def /keyF10 0x4400 def /keyStatus 0xff00 def /statusRShift 0x0001 def /statusLShift 0x0002 def /statusShiftM 0x0003 def /statusRCtrl 0x0004 def /statusLCtrl 0x0104 def /statusCtrlM 0x0104 def /statusRAlt 0x0008 def /statusLAlt 0x0208 def /statusAltM 0x0208 def % bios fonts /vga_8x8 1 def /vga_8x12 3 def /vga_8x16 5 def /true 0 0 eq def /false 0 0 ne def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % Compatibility with SuSE 7.2 (rmoveto was not supported in older mkbootmsg) % % ( dx dy ) => ( ) % /myrmoveto { currentpoint rot add rot rot add exch moveto } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % input event handling % % ( key ) ==> ( input_buffer action ) % % key % bit 0-7 ascii % bit 8-15 scan code % bit 16-32 status bits (ctrl, shift...) % % action % 0: ok, stay in input loop % 1: switch to text mode % 2: start linux % /KeyEvent { % timeout dup 0 eq { boot.ed 3 get 2 return } if dup 0xffff and /key exch def 16 shr 0xffff and /keystat exch def infobox.active { "" 3 return } if password.active { password.ed 3 get key keyEsc eq { 3 return } if key keyEnter eq { 3 return } if infobox.text.normal setcolor password.ed key edit.input 0 return } if % text buffer boot.ed 3 get key 0 eq { 0 return } if key keyEsc eq { 1 return } if key keyEnter eq { 2 return } if key keyF1 eq { drawhelp } if key keyF2 eq { /game.balls 3 def 1 newgamelevel } if % FIXME: debugging only key keyF5 eq { /debug.ball.type debug.ball.type 1 add 2 mod def debug.ball.type changeball } if % FIXME: debugging only key keyF6 eq { /debug.bat.type debug.bat.type 1 add 5 mod def debug.bat.type changebat } if % FIXME: debugging only key keyF7 eq { /game.balls 99 def game.currentlevel 1 add dup game.numlevels gt { pop 1 } if newgamelevel /game.active false def } if % FIXME: debugging only key keyF8 eq { /game.balls 10 def game.currentlevel 1 add dup game.numlevels gt { pop 1 } if newgamelevel } if key keyStatus eq { % move the bat (Right Shift = +dx, Left Shift = -dx) keystat statusRShift eq { /bat.dx 6 def } { keystat statusLShift eq { /bat.dx -6 def } { /bat.dx 0 def } ifelse } ifelse % launch the ball keystat statusCtrlM and 0 ne ball.captive and { /ball.captive false def } if } if key keyUp eq { menu.entry 0 gt { menu.entry 0 MenuSelect menu.entry menu.shift eq { /menu.shift menu.shift 1 sub def redrawmenu } if /menu.entry menu.entry 1 sub def menu.entry 1 MenuSelect boot.text.color setcolor boot.ed edit.hidecursor boot.ed menu.texts menu.entry get edit.init boot.ed ' ' edit.input } if 0 return } if key keyDown eq { menu.entry menu.texts length 1 sub lt { menu.entry 0 MenuSelect menu.visible.entries menu.entry menu.shift sub sub 1 eq { /menu.shift menu.shift 1 add def redrawmenu } if /menu.entry menu.entry 1 add def menu.entry 1 MenuSelect boot.text.color setcolor boot.ed edit.hidecursor boot.ed menu.texts menu.entry get edit.init boot.ed ' ' edit.input } if 0 return } if key keyPgUp eq { menu.entry 0 gt { menu.entry 0 MenuSelect /menu.entry 0 def menu.shift 0 ne { /menu.shift 0 def redrawmenu } if menu.entry 1 MenuSelect boot.text.color setcolor boot.ed edit.hidecursor boot.ed menu.texts menu.entry get edit.init boot.ed ' ' edit.input } if 0 return } if key keyPgDown eq { menu.entry menu.texts length 1 sub lt { menu.entry 0 MenuSelect /menu.entry menu.texts length 1 sub def menu.texts length menu.visible.entries sub dup menu.shift ne { /menu.shift exch def redrawmenu } { pop } ifelse menu.entry 1 MenuSelect boot.text.color setcolor boot.ed edit.hidecursor boot.ed menu.texts menu.entry get edit.init boot.ed ' ' edit.input } if 0 return } if boot.text.color setcolor boot.ed key edit.input 0 } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % ( array defaultentry ) == > ( ) /MenuInit { /menu.dentry exch def /menu.texts exch def /menu.shift 0 def /menu.visible.entries menu.texts length menu.max.entries min def % get index of default entry /menu.entry 0 def 0 1 menu.texts length 1 sub { dup menu.texts exch get menu.dentry eq { /menu.entry exch def exit } { pop } ifelse } for menu.entry menu.visible.entries sub 0 ge { /menu.shift menu.entry menu.texts length menu.visible.entries sub min def } if -1 -1 0 fillmode % draw a scrollbar if necessary menu.visible.entries menu.texts length lt { -1 -1 0 fillmode -1 settransparentcolor scrollbar.color setcolor scrollbar.pos moveto scrollbar.size fillrect % the two arrows are hidden below the screen at (630, 480) and (630, 497) scrollbar.pos moveto 630 480 10 13 image scrollbar.pos scrollbar.size exch pop add 13 sub moveto 630 497 10 13 image scrollbar.pos moveto frame.color dup scrollbar.size drawborder /menu.sb.x scrollbar.pos pop 1 add def /menu.sb.y scrollbar.pos exch pop 13 add def /menu.sb.width scrollbar.size pop 2 sub def /menu.sb.height scrollbar.size exch pop 26 sub def menu.sb.x menu.sb.y 1 sub moveto menu.sb.x menu.sb.width add menu.sb.y 1 sub lineto menu.sb.x menu.sb.y menu.sb.height add moveto menu.sb.x menu.sb.width add menu.sb.y menu.sb.height add lineto /menu.bar.width menu.bar.fullwidth scrollbar.size pop sub def } { /menu.bar.width menu.bar.fullwidth def } ifelse boot.options.color setcolor boot.options.pos moveto "Boot options:" show /boot.ed [ boot.text.pos exch 10 add exch 2 add over over moveto boot.ed.width boot.ed.height savescreen boot.buf boot.buf.size 0 0 0 ] def boot.text.color setcolor boot.ed menu.texts menu.entry get edit.init boot.ed ' ' edit.input redrawmenu menu.entry 1 MenuSelect % draw the timeout bar (bricks) on the screen redrawlevel 350 390 "Hit any key to cancel timeout" showhelptext 40 390 "Press F1 for help" showhelptext } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % ( ) == > ( ) % /redrawmenu { % draw a scrollbar if necessary menu.visible.entries menu.texts length lt { /menu.vsb.height1 menu.shift menu.sb.height mul menu.texts length div def /menu.vsb.height3 menu.texts length menu.visible.entries menu.shift add sub menu.sb.height mul menu.texts length div def -1 -1 0 fillmode scrollbar.color setcolor menu.sb.x menu.sb.y menu.vsb.height1 add moveto menu.sb.width menu.sb.height menu.vsb.height1 menu.vsb.height3 add sub fillrect menu.vsb.height1 0 ne { menu.sb.x menu.sb.y moveto currentpoint menu.sb.width menu.vsb.height1 image } if menu.vsb.height3 0 ne { menu.sb.x menu.sb.y menu.sb.height menu.vsb.height3 sub add moveto currentpoint menu.sb.width menu.vsb.height3 image } if } if menu.text.normal setcolor /x menu.start.x def /y menu.start.y def 0 1 menu.visible.entries 1 sub { x y moveto x y menu.bar.width menu.bar.height image x menu.text.xofs add y menu.text.yofs add moveto menu.texts exch menu.shift add get menuitemmap show /y y menu.item.height add def } for } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % ( entry status ) ==> ( ) % % status: % 0 not selected % 1 selected % /MenuSelect { /menu.status exch def /menu.idx over def menu.shift sub menu.item.height mul menu.start.y add menu.start.x exch moveto -1 -1 0 fillmode currentpoint menu.status 0 eq { currentpoint menu.bar.width menu.bar.height image } { menu.bar.color setcolor menu.bar.width menu.bar.height fillrect } ifelse moveto menu.text.xofs menu.text.yofs myrmoveto menu.status 0 eq { menu.text.normal } { menu.text.select } ifelse setcolor menu.texts menu.idx get menuitemmap show } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % ( text errorcode ) ==> ( ) % errorcode: % 0 normal info % 1 fatal error % /InfoBoxInit { /infobox.active true def /game.wasactive game.active def /game.active false def 0 eq { "Press a key to continue." } { "Press a key to reboot." } ifelse /infobox.ktext exch def /infobox.text exch def /infobox.width infobox.ktext strsize pop infobox.text strsize pop max 40 add def /infobox.height infobox.ktext strsize exch pop infobox.text strsize exch pop add 40 add def /infobox.x screen.size pop infobox.width sub 2 div def infobox.x infobox.y moveto /infobox.save infobox.width infobox.height savescreen def infobox.bg setcolor -1 -1 0 fillmode infobox.width infobox.height fillrect white black infobox.width infobox.height drawborder infobox.text.normal setcolor infobox.text infobox.x 20 add infobox.y 13 add moveto show infobox.x infobox.width infobox.ktext strsize pop sub 2 div add infobox.y infobox.height add infobox.ktext strsize exch pop sub 10 sub moveto currentpoint infobox.ktext show exch pop 7 sub infobox.x 35 add exch 6 { over } repeat frame.darkcolor setcolor moveto exch infobox.width 70 sub add exch lineto frame.lightcolor setcolor 1 add moveto 1 add exch infobox.width 70 sub add exch lineto } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % ( ) ==> ( ) /InfoBoxDone { /infobox.active false def infobox.x infobox.y moveto infobox.save dup restorescreen free /infobox.save 0 def /game.active game.wasactive def } def /infobox.active false def /game.wasactive false def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % Timeout is called 18.2 times per second until the timeout occurs % (time counts down from timeout to 0). % % ( timeout time ) ==> ( ) % /Timeout { dup 0 gt { over sub neg bricks.rows mul exch div /row exch def 0 1 bricks.cols 1 sub { /col exch def /brick row bricks.cols mul col add def bricks.array brick get dup 0 gt exch 10 lt and { bricks.array brick 15 put col bricks.src.w mul bricks.minx add row bricks.src.h mul bricks.miny add moveto 10 bricks.src.w mul bricks.src.x add bricks.src.y bricks.src.w bricks.src.h image } if } for } { % end of timeout (or key pressed) pop pop % clear the game area 0 newgamelevel } ifelse } def /timeout.last 0 % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % Timer is called 18.2 times per second (regardless of timeout) % It is used to animate several elements by copying hidden parts of % the image onto the screen. % % ( time ) ==> ( ) % /Timer { 2 mod 0 eq { updatelevel } if game.active { movebat redrawbat moveball redrawball debug.ballpos { white setcolor 330 444 moveto 330 444 310 20 image ball.y ball.x "x: %3d y: %3d" 100 textbuf snprintf 330 444 moveto textbuf show ball.dy ball.dx "dx: %3d dy: %3d" 100 textbuf snprintf 460 444 moveto textbuf show % fastmove.timer "t: %d" 100 textbuf snprintf % 580 444 moveto % textbuf show } if game.currentlevel 0 gt bricks.count 0 eq and { game.currentlevel 1 add dup game.numlevels gt { pop 1 } if newgamelevel } if } if } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % ( ) ==> ( ) % /movebat { % move the bat bat.dx 0 ne { /bat.x bat.x bat.dx add def bat.x bat.minx lt { /bat.x bat.minx def /bat.dx 0 def } if bat.x bat.maxx gt { /bat.x bat.maxx def /bat.dx 0 def } if % accel. bat.dx 0 gt { /bat.dx bat.dx 5 add 18 min def } if bat.dx 0 lt { /bat.dx bat.dx -5 add -18 max def } if } if bat.special.timer 0 gt { /bat.special.timer bat.special.timer 1 sub def bat.special.timer 0 eq { 0 changebat } if } if } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % ( ) ==> ( ) % /redrawbat { % draw the bat and erase its previous position bat.x bat.y moveto bat.src.x bat.src.y bat.src.w bat.src.h image bat.x bat.oldx gt { bat.oldx bat.y over over moveto bat.x bat.oldx sub 1 add bat.src.h image } if bat.x bat.oldx lt { bat.x bat.src.w add bat.y over over moveto bat.oldx bat.x sub 1 add bat.src.h image } if /bat.oldx bat.x def } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % ( ) ==> ( ) % /moveball { % if the ball sticks to the bat, ignore dx and dy ball.captive { /ball.x bat.src.w ball.src.w sub bat.dx sub 2 div bat.x add def /ball.y bat.y ball.src.h sub def /ball.dx bat.dx 2 div dup abs 0 eq { pop 1 } if def % release the ball after some seconds (10 if new ball, 3 if sticky bat) /ball.captive.timer ball.captive.timer 1 sub def ball.captive.timer 0 le { /ball.captive false def } if return } if % move the ball /ball.x ball.x ball.dx add def /ball.y ball.y ball.dy add def /fastmove.timer fastmove.timer 1 add def ball.x ball.maxx ge { % right wall ball.maxx ballbouncex } { ball.x ball.minx le { % left wall ball.minx ballbouncex } if } ifelse ball.y bat.bounce ge { % lost at the bottom of the screen ball.y ball.maxy gt { /game.balls game.balls 1 sub def % FIXME: end game if ball.count < 0 /ball.x bat.src.w ball.src.w sub bat.dx sub 2 div bat.x add def /ball.y bat.y ball.src.h sub def /ball.dx 1 def /ball.dy -10 def /ball.captive true def /ball.captive.timer 181 def /ball.destroy false def redrawball redrawscore redrawlevelinfo return } if % bounce on the bat ball.y bat.y bat.src.h add lt ball.x ball.src.w add bat.x ge and ball.x bat.x bat.src.w add le and { bat.sticky { /ball.x bat.src.w ball.src.w sub bat.dx sub 2 div bat.x add def /ball.y bat.y ball.src.h sub def /ball.dx 1 def /ball.dy -10 def /ball.captive true def /ball.captive.timer 54 def % highlight the bat briefly bat.x bat.y moveto bat.src.x bat.src.w add bat.src.y bat.src.w bat.src.h image return } { bat.bounce ballbouncey % the ball goes up now (dy < 0) /ball.dy ball.dy -3 min def % highlight the bat briefly bat.x bat.y moveto bat.src.x bat.src.w add bat.src.y bat.src.w bat.src.h image % small change to dx and dy if the bat was moving fast enough /ball.dx ball.dx bat.dx 5 div add def /ball.dy ball.dy bat.dx abs 10 div sub def % larger change to dx and dy if the bat was hit on the corner ball.x bat.x le { /ball.dx ball.dx -6 add def } if ball.x ball.src.w add bat.x bat.src.w add ge { /ball.dx ball.dx 6 add def } if % speed limits /ball.dx ball.dx 14 min -14 max def /ball.dy ball.dy -14 max def % reset the timer /fastmove.timer 0 def } ifelse } if } { ball.y ball.miny le { % top wall ball.miny ballbouncey } if % check for collision with the bricks ball.y bricks.miny ge ball.y bricks.maxy lt and { % ---------------------------------------- % % FIXME: this part of the code is wrong! % % ---------------------------------------- % % check for vertical collisions ball.dy 0 gt { % y -> y ball.dx 0 gt { % (x, y) (x+w, y) ball.x ball.y checkbounce { b.row bricks.src.h mul bricks.miny add ballbouncey } { ball.x ball.src.w add 1 sub ball.y checkbounce { b.row bricks.src.h mul bricks.miny add ballbouncey } if } ifelse } { % (x+w, y) (x, y) ball.x ball.src.w add 1 sub ball.y checkbounce { b.row bricks.src.h mul bricks.miny add ballbouncey } { ball.x ball.y checkbounce { b.row bricks.src.h mul bricks.miny add ballbouncey } if } ifelse } ifelse } { % y -> y+h ball.dx 0 gt { % (x, y+h) (x+w, y+h) ball.x ball.y ball.src.h add 1 sub checkbounce { b.row 1 add bricks.src.h mul 1 sub bricks.miny add ballbouncey } { ball.x ball.src.w add 1 sub ball.y ball.src.h add 1 sub checkbounce { b.row 1 add bricks.src.h mul 1 sub bricks.miny add ballbouncey } if } ifelse } { % (x+w, y+h) (x, y+h) ball.x ball.src.w add 1 sub ball.y ball.src.h add 1 sub checkbounce { b.row 1 add bricks.src.h mul 1 sub bricks.miny add ballbouncey } { ball.x ball.y ball.src.h add 1 sub checkbounce { b.row 1 add bricks.src.h mul 1 sub bricks.miny add ballbouncey } if } ifelse } ifelse } ifelse % check for horizontal collisions ball.dx 0 gt { % x -> x+w ball.dy 0 gt { % (x+w, y) (x+w, y+h) ball.x ball.src.w add 1 sub ball.y checkbounce { b.col 1 add bricks.src.w mul 1 sub bricks.minx add ballbouncex } { ball.x ball.src.w add 1 sub ball.y ball.src.h add 1 sub checkbounce { b.col 1 add bricks.src.w mul 1 sub bricks.minx add ballbouncex } if } ifelse } { % (x+w, y+h) (x+w, y) ball.x ball.src.w add 1 sub ball.y ball.src.h add 1 sub checkbounce { b.col 1 add bricks.src.w mul 1 sub bricks.minx add ballbouncex } { ball.x ball.src.w add 1 sub ball.y checkbounce { b.col 1 add bricks.src.w mul 1 sub bricks.minx add ballbouncex } if } ifelse } ifelse } { % x -> x ball.dy 0 gt { % (x, y) (x, y+h) ball.x ball.y checkbounce { b.col bricks.src.w mul bricks.minx add ballbouncex } { ball.x ball.y ball.src.h add 1 sub checkbounce { b.col bricks.src.w mul bricks.minx add ballbouncex } if } ifelse } { % (x, y+h) (x, y) ball.x ball.y ball.src.h add 1 sub checkbounce { b.col bricks.src.w mul bricks.minx add ballbouncex } { ball.x ball.y checkbounce { b.col bricks.src.w mul bricks.minx add ballbouncex } if } ifelse } ifelse } ifelse } if } ifelse } def /fastmove.timer 0 def /checkbounce { getbrickxy dup 0 gt { dup 10 ge { pop 15 setbrick } { dup 7 ge { 1 sub setbrick } { /game.score exch 10 mul game.score add def 0 setbrick /bricks.count bricks.count 1 sub def redrawscore } ifelse } ifelse redrawbrick % bounce true } { pop false } ifelse } def /ballbouncex { /ball.x exch 2 mul ball.x sub def /ball.dx ball.dx neg def } def /ballbouncey { /ball.y exch 2 mul ball.y sub def /ball.dy ball.dy neg def % slow down if the ball has been going fast for at least 3 seconds fastmove.timer 90 gt { /fastmove.timer 0 def ball.dx 0 gt { /ball.dx ball.dx 1 add def } { /ball.dx ball.dx -1 add def } ifelse /ball.dy ball.dy 1 add def } if } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % Get the type of the brick at coordinates (x, y). Update the variables % b.col and b.row that can be reused later to change the type of the brick. % % ( x y ) ==> ( brick_type ) % /getbrickxy { /b.row exch bricks.miny sub bricks.src.h div 0 max bricks.rows 1 sub min def /b.col exch bricks.minx sub bricks.src.w div 0 max bricks.cols 1 sub min def bricks.array b.row bricks.cols mul b.col add get % FIXME: debug % black setcolor % 20 300 moveto % 20 300 200 40 image % b.col b.row "row: %3d col: %3d" 100 textbuf snprintf % 20 300 moveto % textbuf show % dup "brick: %d" 100 textbuf snprintf % 20 320 moveto % textbuf show } def /b.row 0 def /b.col 0 def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % Change the type of the brick designated by b.col and b.row. % % ( brick_type ) ==> ( ) % /setbrick { bricks.array b.row bricks.cols mul b.col add rot put } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % Redraw the brick designated by b.col and b.row. % % ( ) ==> ( ) % /redrawbrick { b.col bricks.src.w mul bricks.minx add b.row bricks.src.h mul bricks.miny add over over moveto bricks.array b.row bricks.cols mul b.col add get dup 0 gt { exch pop exch pop bricks.src.w mul bricks.src.x add bricks.src.y } { pop } ifelse bricks.src.w bricks.src.h image } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % ( ) ==> ( ) % /redrawball { % draw the ball and erase its previous position ball.oldx ball.oldy over over moveto ball.src.w ball.src.h image ball.x ball.y moveto ball.src.x ball.src.y ball.src.w ball.src.h image /ball.oldx ball.x def /ball.oldy ball.y def } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % ( ) ==> ( ) % /redrawscore { 330 400 moveto 330 400 300 20 image game.score "Score: %06d" 100 textbuf snprintf 330 400 textbuf showhelptext bricks.count "Bricks: %d" 100 textbuf snprintf 520 400 textbuf showhelptext } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % ( ) ==> ( ) % /redrawlevelinfo { 330 420 moveto 330 420 300 20 image game.balls 10 le { game.balls 1 gt { 1 1 game.balls 1 sub { 1 sub 15 mul 330 add 425 moveto 0 ball.src.y ball.src.w ball.src.h image } for } if } { 330 425 moveto 0 ball.src.y ball.src.w ball.src.h image game.balls 1 sub "Balls: %d" 100 textbuf snprintf 345 420 textbuf showhelptext } ifelse game.currentlevel "Level: %d" 100 textbuf snprintf 520 420 textbuf showhelptext } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % ( label correct_password ) ==> ( ) % /PasswordInit { /password.key exch def pop /password.active true def password.x password.y moveto /password.save password.width password.height savescreen def infobox.bg setcolor -1 -1 0 fillmode password.width password.height fillrect white black password.width password.height drawborder infobox.text.normal setcolor password.x 20 add password.y 20 add moveto "Password: " show currentpoint exch 10 add exch over 1 sub over 2 sub moveto black white password.ed.width password.ed.height 4 add drawborder moveto infobox.text.normal setcolor /password.ed [ currentpoint password.ed.width password.ed.height savescreen password.buf password.buf.size 0 0 0 ] def % show only '*' currentfont 0x80 or setfont password.ed "" edit.init } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % ( password ) ==> ( error ) % % error: % true password ok % false wrong password % /PasswordDone { /password.active false def % make font visible again currentfont 0x7f and setfont password.x password.y moveto password.save dup restorescreen free password.key eq } def /password.active false def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % ( level ) == > ( ) % /newgamelevel { /game.currentlevel exch def /game.active false def game.currentlevel 0 gt { % game.currentlevel > 0: select the new level game.currentlevel game.numlevels le { game.levels game.currentlevel get } { game.levels 0 get } ifelse % copy the contents of the level into bricks.array 0 1 bricks.rows 1 sub { /row exch def 0 1 bricks.cols 1 sub { /col exch def /brick row bricks.cols mul col add def dup brick get bricks.array brick rot put } for } for pop } { % game.currentlevel <= 0: clear all the bricks 0 1 bricks.rows 1 sub { /row exch def 0 1 bricks.cols 1 sub { /col exch def /brick row bricks.cols mul col add def bricks.array brick 0 put } for } for } ifelse % clear the screen and draw the bricks redrawlevel % reset some variables /bat.x bat.minx bat.maxx add 2 div def 0 changebat /ball.x bat.src.w ball.src.w sub bat.dx sub 2 div bat.x add def /ball.y bat.y ball.src.h sub def /ball.dx 1 def /ball.dy -10 def /ball.captive true def /ball.captive.timer 181 def /ball.destroy false def /bat.oldx bat.x def /ball.oldx ball.x def /ball.oldy ball.y def game.currentlevel 0 gt { redrawscore redrawlevelinfo /game.active true def } { 355 390 "Press F2 to start a new game" showhelptext } ifelse } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % ( ) == > ( ) % /redrawlevel { % clear the screen game.minx game.miny over over moveto game.maxx game.minx sub 1 add game.maxy game.miny sub 1 add image % draw the bricks and count them /bricks.count 0 def 0 1 bricks.rows 1 sub { /row exch def 0 1 bricks.cols 1 sub { /col exch def bricks.array row bricks.cols mul col add get dup 0 gt { dup 10 lt { /bricks.count bricks.count 1 add def } if col bricks.src.w mul bricks.minx add row bricks.src.h mul bricks.miny add moveto bricks.src.w mul bricks.src.x add bricks.src.y bricks.src.w bricks.src.h image } { pop } ifelse } for } for } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % ( ) == > ( ) % /updatelevel { % redraw the gray bricks 0 1 bricks.rows 1 sub { /ul.row exch def 0 1 bricks.cols 1 sub { /ul.col exch def /ul.brick ul.row bricks.cols mul ul.col add def bricks.array ul.brick get dup 10 gt { 1 sub bricks.array over ul.brick exch put ul.col bricks.src.w mul bricks.minx add ul.row bricks.src.h mul bricks.miny add moveto bricks.src.w mul bricks.src.x add bricks.src.y bricks.src.w bricks.src.h image } if } for } for } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % ( ) == > ( ) % /drawhelp { infoarea.pos moveto infoarea.pos infoarea.size image 1 1 6 { /brick exch def infoarea.pos exch 10 add exch 8 sub brick 25 mul add moveto brick bricks.src.w mul bricks.src.x add bricks.src.y bricks.src.w bricks.src.h image infoarea.pos exch 50 add exch 10 sub brick 25 mul add brick 10 mul "%2d points" 100 textbuf snprintf textbuf showhelptext } for } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % ( x y text ) == > ( ) % /showhelptext { /helptext exch def /y exch def /x exch def help.text.color2 setcolor x 1 add y 1 add moveto helptext show help.text.color1 setcolor x y moveto helptext show } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % 0 - normal bat % 1 - sticky bat % 2 - large bat % 3 - small bat % 4 - laser bat - FIXME: not implemented yet % % ( bat_type ) == > ( ) % % /changebat { bat.src.w over 1 eq { exch pop % sticky bat /bat.src.x 100 def /bat.src.w 40 def /bat.sticky true def /bat.special.timer 543 def } { over 2 eq { exch pop % large bat /bat.src.x 180 def /bat.src.w 60 def /bat.sticky false def /bat.special.timer 543 def } { over 3 eq { exch pop % small bat /bat.src.x 300 def /bat.src.w 30 def /bat.sticky false def /bat.special.timer 543 def } { exch 4 eq { % laser bat /bat.src.x 360 def /bat.src.w 40 def /bat.sticky false def /bat.special.timer 543 def } { % normal bat /bat.src.x 20 def /bat.src.w 40 def /bat.sticky false def /bat.special.timer 0 def } ifelse } ifelse } ifelse } ifelse % try to keep the same position for the center of the bat /bat.maxx game.maxx bat.src.w sub def bat.src.w sub 2 div bat.x add bat.minx max bat.maxx min /bat.x exch def % erase the previous image of the bat game.minx bat.y over over moveto game.maxx game.minx sub 1 add bat.src.h image % release the ball if necessary ball.captive.timer 54 lt bat.sticky not and { /ball.captive false def } if } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % 0 - normal ball % 1 - "destroy" ball % % ( ball_type ) == > ( ) % /changeball { 1 eq { % "destroy" ball /ball.src.x 10 def /ball.destroy true def /ball.destroy.timer 271 def } { % normal ball /ball.src.x 0 def /ball.destroy false def /ball.destroy.timer 0 def } ifelse } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % Map the name of the menu item to a fancier name if possible. % % ( text ) == > ( new_text ) % /menuitemmap { dup "linux" eq { pop "Linux" return } if dup "failsafe" eq { pop "Linux - Safe Settings" return } if dup "textmode" eq { pop "Linux - Text Mode" return } if dup "oldlinux" eq { pop "Old Linux" return } if dup "test" eq { pop "Test" return } if dup "suse" eq { pop "SuSE" return } if dup "redhat" eq { pop "Red Hat" return } if dup "debian" eq { pop "Debian" return } if dup "dos" eq { pop "MS-DOS" return } if dup "esoe" eq { pop "Windows - ESOE" return } if dup "esde" eq { pop "Windows - ESDE" return } if dup "windows" eq over "win" eq or { pop "Windows" return } if dup "windows95" eq over "win95" eq or { pop "Windows 95" return } if dup "windows98" eq over "win98" eq or { pop "Windows 98" return } if dup "windowsme" eq over "winme" eq or { pop "Windows ME" return } if dup "windowsnt" eq over "winnt" eq or { pop "Windows NT" return } if dup "windows2k" eq over "win2k" eq or { pop "Windows 2000" return } if dup "windows2000" eq over "win2000" eq or { pop "Windows 2000" return } if dup "windowsxp" eq over "winxp" eq or { pop "Windows XP" return } if dup "memtest86" eq over "memtest" eq or { pop "Memory Test" return } if } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % ( color0 color1 width height ) ==> ( ) % /drawborder { currentpoint /db.y0 exch def /db.x0 exch def /db.y1 exch 1 sub db.y0 add def /db.x1 exch 1 sub db.x0 add def /db.col1 exch def /db.col0 exch def db.x0 db.y1 moveto db.col0 setcolor db.x0 db.y0 lineto db.x1 db.y0 lineto db.col1 setcolor db.x1 db.y1 lineto db.x0 db.y1 lineto } def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % Allocate and define a new color % % ( palette ) ==> ( color ) % /newcolor { image.colors newcolor.count add dup rot setpalette /newcolor.count newcolor.count 1 add def def } def /newcolor.count 0 def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - loadpalette 0 0 moveto 0 0 screen.size image font_10x20 1 add setfont /textbuf 100 malloc def /menu.text.xofs 10 def /menu.text.yofs 2 def /menu.item.height fontsize exch pop dup 2 div add def /infobox.y 160 def /black 0x000000 newcolor /white 0xffffff newcolor /menu.text.normal 0x0044cc newcolor /menu.text.select white def /menu.bar.color menu.text.normal def /scrollbar.color menu.text.normal def /frame.color menu.text.normal def /frame.darkcolor 0xff00ff newcolor /frame.lightcolor 0xffff00 newcolor /infobox.bg 0xccccdd newcolor /infobox.text.normal black def /boot.options.color white def /boot.text.color 0x16e2e2 newcolor /help.text.color1 boot.text.color def /help.text.color2 menu.text.normal def /menu.start.x 10 def /menu.start.y 30 def /menu.bar.fullwidth 299 def /menu.bar.width menu.bar.fullwidth def /menu.bar.height fontsize exch pop menu.text.yofs dup add add def /menu.max.entries 7 def /scrollbar.pos { 299 10 } def /scrollbar.size { 10 242 } def /boot.options.pos { 10 450 } def /boot.text.pos { 120 447 } def /boot.ed.width 435 def /boot.ed.height fontsize exch pop 2 add def /boot.buf.size 100 def /boot.buf boot.buf.size malloc def /password.width 250 def /password.height 60 def /password.y 200 def /password.x screen.size pop password.width sub 2 div def /password.buf.size 32 def /password.buf password.buf.size malloc def /password.ed.width 120 def /password.ed.height fontsize exch pop 2 add def /infoarea.pos { 10 262 } def /infoarea.size { 299 178 } def /game.active false def /game.currentlevel 0 def /game.score 0 def /game.hiscore 0 def /game.balls 0 def /game.minx 320 def /game.miny 10 def /game.maxx 628 def /game.maxy 439 def /bricks.src.x 0 def /bricks.src.y 480 def /bricks.src.w 30 def /bricks.src.h 15 def /bricks.rows 20 def /bricks.cols 10 def /bricks.minx 324 def /bricks.miny 14 def /bricks.maxy bricks.src.h bricks.rows mul bricks.miny add def /ball.src.x 0 def /ball.src.y 495 def /ball.src.w 10 def /ball.src.h 10 def /ball.minx game.minx def /ball.miny game.miny def /ball.maxx game.maxx ball.src.w sub def /ball.maxy game.maxy ball.src.h sub def /ball.x 0 def /ball.y 0 def /ball.captive true def /ball.captive.timer 0 def /ball.destroy false def /ball.destroy.timer 0 def /ball.dx 0 def /ball.dy 0 def /ball.oldx ball.x def /ball.oldy ball.y def /bat.src.x 20 def /bat.src.y 495 def /bat.src.w 40 def /bat.src.h 10 def /bat.minx game.minx def /bat.maxx game.maxx bat.src.w sub def /bat.x 460 def /bat.y 380 def /bat.bounce bat.y ball.src.h sub def /bat.dx 0 def /bat.oldx bat.x def /bat.sticky false def /bat.special.timer 0 def % initial level - used for timeout /bricks.array [ 0 0 0 0 0 3 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 3 0 0 0 0 0 ] def /bricks.count 0 def /game.levels [ [ % --- level 0 (error) --- 0 0 0 0 0 0 0 0 0 0 15 0 0 0 0 0 0 0 0 15 0 15 0 0 0 0 0 0 15 0 0 0 15 0 0 0 0 15 0 0 0 0 0 15 0 0 15 0 0 0 0 0 0 0 15 15 0 0 0 0 0 0 0 0 15 15 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 15 15 15 7 7 15 15 15 4 0 15 3 0 0 0 0 3 15 0 0 15 0 0 3 3 0 0 15 0 0 15 0 0 0 0 0 0 15 0 0 15 0 0 0 0 0 0 15 0 0 15 3 0 15 15 0 3 15 0 0 15 15 15 15 15 15 15 15 0 0 0 4 0 0 0 0 4 0 0 0 0 15 4 0 0 4 15 0 0 0 0 0 15 0 0 15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 3 ] [ % --- level 11 --- 0 0 0 0 0 0 0 0 0 0 0 15 15 15 15 15 15 15 15 0 0 0 0 0 0 0 0 0 0 0 0 4 4 4 4 4 4 4 4 0 0 4 4 4 4 4 4 4 4 0 0 0 0 0 0 0 0 0 0 0 0 15 15 15 15 15 15 15 15 0 0 1 1 1 1 1 1 1 1 0 0 0 2 2 2 2 2 2 0 0 0 0 0 3 3 3 3 0 0 0 0 0 0 0 4 4 0 0 0 0 15 0 0 0 0 0 0 0 0 15 4 15 0 0 0 0 0 0 15 4 3 4 15 0 0 0 0 15 4 3 0 3 4 15 0 0 15 4 3 0 0 0 3 4 7 7 4 3 0 0 0 0 0 3 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] ] def /game.numlevels 11 def % - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - % % OLD STUFF % % /updatespeed { % /ball.dx sintab512 ball.angle 450 add 360 mod get % ball.speed mul 512 div def % /ball.dy sintab512 ball.angle 360 add 360 mod get % ball.speed mul 512 div neg def % } def % % /sintab512 [ % 0 8 17 26 35 44 53 62 71 80 88 97 106 115 123 % 132 141 149 158 166 175 183 191 200 208 216 224 232 240 248 % 256 263 271 278 286 293 300 308 315 322 329 335 342 349 355 % 362 368 374 380 386 392 397 403 408 414 419 424 429 434 438 % 443 447 452 456 460 464 467 471 474 477 481 484 486 489 492 % 494 496 498 500 502 504 505 507 508 509 510 510 511 511 511 % 512 511 511 511 510 510 509 508 507 505 504 502 500 498 496 % 494 492 489 486 484 481 477 474 471 467 464 460 456 452 447 % 443 438 434 429 424 419 414 408 403 397 392 386 380 374 368 % 362 355 349 342 335 329 322 315 308 300 293 286 278 271 263 % 255 248 240 232 224 216 208 200 191 183 175 166 158 149 141 % 132 123 115 106 97 88 80 71 62 53 44 35 26 17 8 % 0 -8 -17 -26 -35 -44 -53 -62 -71 -80 -88 -97 -106 -115 -123 % -132 -141 -149 -158 -166 -175 -183 -191 -200 -208 -216 -224 -232 -240 -248 % -256 -263 -271 -278 -286 -293 -300 -308 -315 -322 -329 -335 -342 -349 -355 % -362 -368 -374 -380 -386 -392 -397 -403 -408 -414 -419 -424 -429 -434 -438 % -443 -447 -452 -456 -460 -464 -467 -471 -474 -477 -481 -484 -486 -489 -492 % -494 -496 -498 -500 -502 -504 -505 -507 -508 -509 -510 -510 -511 -511 -511 % -512 -511 -511 -511 -510 -510 -509 -508 -507 -505 -504 -502 -500 -498 -496 % -494 -492 -489 -486 -484 -481 -477 -474 -471 -467 -464 -460 -456 -452 -447 % -443 -438 -434 -429 -424 -419 -414 -408 -403 -397 -392 -386 -380 -374 -368 % -362 -355 -349 -342 -335 -329 -322 -315 -308 -300 -293 -286 -278 -271 -263 % -255 -248 -240 -232 -224 -216 -208 -200 -191 -183 -175 -166 -158 -149 -141 % -132 -123 -115 -106 -97 -88 -80 -71 -62 -53 -44 -35 -26 -17 -8 % ] def /debug.bat.type 0 def /debug.ball.type 0 def /debug.ballpos false def