home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 429.lha / Ball / BALL.ASM < prev    next >
Assembly Source File  |  1990-09-29  |  75KB  |  2,904 lines

  1. ;
  2. ;            BALL         by Ed Mackey
  3. ;                            440 Louella Ave.
  4. ;                            Wayne, PA 19087
  5.  
  6. ;  Here is the source code, assembled with Assempro by Abacus.
  7. ;  This is Public Domain.  Please don't change the credits, though.
  8.  
  9.        Include 'includes:IncludeMe'
  10.        Include 'includes:intuition.offsets'
  11.        Include 'includes:graphics.offsets'
  12.        Include 'includes:diskfont.offsets'
  13.        Include 'includes:dos.offsets'
  14.        Include 'includes:iff.offsets'
  15.        Include 'includes:exec/types.i'
  16.        Include 'includes:exec/lists.i'
  17.        Include 'includes:devices/audio.i'
  18.        Include 'includes:MemVars'
  19.  
  20.        ILABEL 'Includes:Amiga.L'
  21.  
  22.        INIT_AMIGA
  23.  
  24.        bsr     run
  25.  
  26.        EXIT_AMIGA
  27.  
  28. run:
  29.        move.l  EBase,a6
  30. ;       move.l  #Whole_Thing,d0
  31. ;       clr.l   d1
  32. ;       jsr     _LVOAllocMem(a6)  ;Some old code I got rid of
  33. ;       tst.l   d0
  34. ;       beq     MemKicked
  35.        move.l  #MyMem,d0   ;Now in BSS segment!
  36.        move.l  d0,MemPtr
  37.        move.l  d0,a1
  38.        lea     Board1,a0
  39.        move.l  #Whole_Thing,d0
  40.        jsr     _LVOCopyMem(a6)
  41.        sub.l   a1,a1
  42.        jsr     _LVOFindTask(a6)
  43.        move.l  d0,readreply+$10
  44.        lea     MyTask,a2
  45.        move.l  #7,d2
  46. PMT:   move.l  d0,(a2)
  47.        add.l   #64,a2
  48.        dbra    d2,PMT
  49.        move.l  d0,a1
  50.        move.l  #4,d0
  51.        jsr     _LVOSetTaskPri(a6) ;Runs smoother at pri +4
  52.        lea     readreply,a1
  53.        jsr     _LVOAddPort(a6)
  54.        lea     devio,a1
  55.        move.l  #1,d0    ;timer.
  56.        clr.l   d1
  57.        move.l  #readreply,port
  58.        move.w  #32,Tm_Length
  59.        move.w  #0,io
  60.        lea     timename,a0
  61.        jsr     _LVOOpenDevice(a6) ;get timer.device
  62.        tst.l   d0
  63.        bne     TimeKicked
  64.        bsr     openint      ;open intuition.library
  65.        beq     IntKicked    ;uh-oh.  Where's intuition?!?!
  66.        bsr     opendos
  67.        beq     DosKicked    ;dos.library and graphics.library
  68.        bsr     opengfx
  69.        beq     GfxKicked
  70.        move.l  EBase,a6
  71.        lea     MsgSig,a2    ;4 signals needed for 4 voices.
  72.        move.l  #3,d2
  73. ASP:   move.l  #-1,d0     ;Another Signal Please!
  74.        jsr     _LVOAllocSignal(a6)
  75.        move.b  d0,(a2)
  76.        add.l   #64,a2
  77.        cmp.b   #-1,d0
  78.        beq     SigKicked
  79.        dbra    d2,ASP
  80.        lea     Message,a1
  81.        move.l  #1,d0
  82.        clr.l   d1
  83.        move.l  #combops,AData
  84.        move.l  #1,Aud_Length
  85.        move.w  #0,AllocKey
  86.        move.l  #0,Unit
  87.        move.w  #ADCMD_ALLOCATE,Aud_Cmd
  88.        lea     audname,a0
  89.        jsr     _LVOOpenDevice(a6) ;open audio.device
  90.        tst.l   d0
  91.        bne     AudioKickedM
  92.        move    #-1,d0       ;init audio.device
  93.        bsr     playme       ;with opening sound effect
  94.        bsr     LoadScores
  95.        clr.l   Font
  96.        bsr     opendiskfont
  97.        beq     DiskFontKicked
  98.        move.l  fontbase,a6      ;look for font
  99.        lea     TextAttr,a0
  100.        jsr     _LVOOpenDiskFont(a6)
  101.        move.l  d0,Font
  102.        bsr     closediskfont
  103. DiskFontKicked:
  104.        bsr     openiff        ;get iff.library
  105.        beq     IffKicked
  106.        bsr     openscreen
  107.        beq     Screen3Kicked  ;allocate screens for graphics & game
  108.        move.l  d0,screen3hd
  109.        add.l   #184,d0
  110.        move.l  d0,bit3map
  111.        bsr     openscreen
  112.        beq     Screen2Kicked
  113.        move.l  d0,screen2hd
  114.        add.l   #184,d0
  115.        move.l  d0,bit2map
  116.        bsr     openscreen
  117.        beq     ScreenKicked
  118.        move.l  d0,screenhd
  119.        add.l   #184,d0
  120.        move.l  d0,bit1map
  121.        bsr     windopen     ;make my window.
  122.        beq     WindKicked
  123.        move.w  #0,PaddleX
  124.        move.l  windowhd,a0
  125.        move.l  50(a0),a0
  126.        move.l  a0,Rast
  127.        move.l  screenhd,a0
  128.        clr.l   d0
  129.        jsr     _LVOShowTitle(a6)  ;hide title bar
  130.        move.l  Rast,a1
  131.        move.l  #1,d0
  132.        move.l  gfxbase,a6
  133.        jsr     _LVOSetAPen(a6)
  134.        tst.l   Font
  135.        beq     OopsNoFont
  136.        move.l  Font,a0           ;install font, if it was there
  137.        move.l  Rast,a1
  138.        jsr     _LVOSetFont(a6)
  139. OopsNoFont:
  140.        lea     picname,a0     ;Some leftover code from the
  141.        bsr     OpenPic        ;"old days" when the IFFs were
  142.        beq     SpriteKicked   ;separate files on disk.
  143.        move.l  screen2hd,d0
  144.        bsr     pic2plane
  145.        beq     PicKicked
  146.        bsr     ClosePic
  147.        lea     pic2name,a0
  148.        bsr     OpenPic
  149.        beq     SpriteKicked
  150.        move.l  screen3hd,d0
  151.        bsr     pic2plane
  152.        beq     PicKicked
  153.        bsr     ClosePic
  154.        move.l  intbase,a6
  155.        move.l  windowhd,a0
  156.        lea     blkptr,a1
  157.        move.l  #1,d0
  158.        move.l  d0,d1
  159.        clr.l   d2
  160.        clr.l   d3
  161.        jsr     _LVOSetPointer(a6)  ;Get rid of that mouse pointer!
  162.        move.l  windowhd,a0
  163.        jsr     _LVOViewPortAddress(a6)  ;Why did I do this?
  164.        move.l  d0,ViewPort
  165.        move.l  d0,a0
  166.        move.l  gfxbase,a6
  167.        move.l  #32,d0
  168.        lea     ftable,a1
  169.        move.l  a1,a3
  170. ZZZ:   move    #0,(a3)+        ;Start black, then call FadeIn later.
  171.        cmp.l   #ftable+32,a3
  172.        bne     ZZZ
  173.        jsr     _LVOLoadRGB4(a6)
  174.        move.l  #5,d0
  175.        lea     ballsprite,a0
  176.        jsr     _LVOGetSprite(a6)  ;Let's get some sprites!
  177.        cmp.w   #-1,d0
  178.        bne     spOK
  179.        move.l  #-1,d0
  180.        lea     ballsprite,a0
  181.        jsr     _LVOGetSprite(a6)
  182.        cmp.w   #-1,d0
  183.        beq     SpriteKickedM
  184. spOK:  move.l  #-1,d0
  185.        lea     Las1Sprite,a0
  186.        jsr     _LVOGetSprite(a6)
  187.        cmp.w   #-1,d0
  188.        beq     Las1KickedM
  189.        move.l  #-1,d0
  190.        lea     Las2Sprite,a0
  191.        jsr     _LVOGetSprite(a6)
  192.        cmp.w   #-1,d0
  193.        beq     Las2KickedM
  194.        lea     devio,a1    ;first timer message.
  195.        move.w  #$9,Tm_Cmd
  196.        move.l  #0,secs
  197.        move.l  #16000,msecs
  198.        move.l  #readreply,port
  199.        move.w  #40,Tm_Length
  200.        move.w  #0,io
  201.        move.l  EBase,a6
  202.        jsr     _LVOSendIO(a6)
  203.        clr     d7
  204. NewGame:                       ;Main title screen
  205.        move    d7,-(sp)
  206.        bsr     clrscr
  207.        move.l  MemPtr,a0
  208.        lea     Board1,a1
  209.        move.l  #Whole_Thing,d0
  210.        move.l  EBase,a6
  211.        jsr     _LVOCopyMem(a6)  ;restore boards that were
  212.        move.l  MemPtr,a0        ;destroyed during previous game
  213.        lea     Pl2Boards,a1
  214.        move.l  #Whole_Thing,d0
  215.        jsr     _LVOCopyMem(a6)  ;and for player 2's boards
  216.        move.l  Rast,a1
  217.        clr.l   d0
  218.        move.l  #29,d1
  219.        move.l  gfxbase,a6
  220.        jsr     _LVOMove(a6)
  221.        move.l  #end_title2 - title2,d0
  222.        lea     title2,a0
  223.        move.l  Rast,a1
  224.        jsr     _LVOText(a6)
  225.        move.l  Rast,a1
  226.        clr.l   d0
  227.        move.l  #76,d1           ;put up a bunch of titles
  228.        jsr     _LVOMove(a6)
  229.        move.l  #end_instr - instr,d0
  230.        lea     instr,a0
  231.        move.l  Rast,a1
  232.        jsr     _LVOText(a6)
  233.        move.l  Rast,a1
  234.        clr.l   d0
  235.        move.l  #86,d1
  236.        jsr     _LVOMove(a6)
  237.        move.l  #end_instr2 - instr2,d0
  238.        lea     instr2,a0
  239.        move.l  Rast,a1
  240.        jsr     _LVOText(a6)
  241.        move.l  Rast,a1
  242.        clr.l   d0
  243.        move.l  #56,d1
  244.        jsr     _LVOMove(a6)
  245.        move.l  #end_Al - Al,d0
  246.        lea     Al,a0
  247.        move.l  Rast,a1
  248.        jsr     _LVOText(a6)
  249.        move.l  #18,d2
  250.        move.l  #10,d3
  251.        move.l  bit3map,a0
  252.        move.l  bit1map,a1
  253.        move.l  #173,d0
  254.        move.l  #152,d1
  255.        move.l  #143,d4
  256.        move.l  #31,d5
  257.        move.l  #$c0,d6
  258.        move.l  #$ff,d7
  259.        move.l  gfxbase,a6
  260.        jsr     _LVOBltBitMap(a6)  ;get that logo on there
  261.        clr     dx
  262.        move.w  #104,dy
  263.        move.l  #BonusCoords+4,a5
  264. NextBonus:
  265.        clr.l   d0
  266.        clr.l   d1
  267.        clr.l   d2
  268.        clr.l   d3
  269.        move.w  dx,d2
  270.        move.w  dy,d3
  271.        move.l  bit3map,a0
  272.        move.l  bit1map,a1
  273.        move.w  (a5)+,d0
  274.        move.w  (a5)+,d1
  275.        move.l  #16,d4
  276.        move.l  #14,d5
  277.        move.l  #$c0,d6
  278.        move.l  #$ff,d7
  279.        jsr     _LVOBltBitMap(a6)  ;show the bonuses
  280.        tst.w   dx
  281.        bne     Ych
  282.        move.w  #160,dx
  283.        bra     Zch
  284. Ych:   clr.w   dx
  285.        add.w   #15,dy
  286. Zch:   cmp.l   #end_BonusCoords,a5
  287.        bne     NextBonus
  288.        move.l  intbase,a6
  289.        move.l  Rast,a0
  290.        lea     BonusDescribe,a1
  291.        move.l  #20,d0
  292.        move.l  #107,d1
  293.        jsr     _LVOPrintIText(a6) ;show the names of the bonuses
  294.        bsr     FadeIn
  295.        clr     You_Cheated
  296.        clr     You_Cheated2       ;clear some flags
  297.        bsr     DumpMsgs
  298.        move    (sp)+,d7
  299.        cmp.b   #'2',d7
  300.        beq     Auto2
  301.        clr.l   d7
  302. TryMsgAgain:
  303.        move.l  windowhd,a0
  304.        move.l  86(a0),a0
  305.        move.l  EBase,a6
  306.        jsr     _LVOWaitPort(a6)    ;wait for message.
  307. GetMsgAgain:
  308.        move.l  windowhd,a0
  309.        move.l  86(a0),a0
  310.        move.l  EBase,a6
  311.        jsr     _LVOGetMsg(a6)    ;read in the message.
  312.        tst.l   d0
  313.        beq     PlayGame
  314.        move.l  d0,a5
  315.        move.l  20(a5),d6
  316.        move.l  d6,d0
  317.        and.l   #$200000,d0   ;User press a key?    (TITLE SCREEN)
  318.        cmp.l   #0,d0
  319.        beq     NotKey
  320.        move.b  25(a5),d0
  321.        cmp.b   #'Q',d0       ;Was it, 'Q'?
  322.        bne     NotQu
  323.        move    #-1,d7
  324.        bra     Rep2
  325. NotQu: cmp.b   #'2',d0       ;Was it, '2' for 2-Player game?
  326.        bne     NotKey
  327.        moveq   #2,d7
  328.        move    #2,PlayerUp
  329.        bra     Rep2
  330. NotKey:
  331.        move.l  d6,d0
  332.        and.l   #$8,d0
  333.        cmp.l   #0,d0
  334.        beq     Rep2
  335.        addq    #1,d7
  336.        clr     PlayerUp
  337. Rep2:  move.l  a5,a1
  338.        move.l  EBase,a6
  339.        jsr     _LVOReplyMsg(a6)
  340.        bra     GetMsgAgain
  341. Auto2:
  342.        moveq   #2,d7
  343.        move    #2,PlayerUp
  344. PlayGame:
  345.        cmp     #-1,d7
  346.        beq     ende
  347.        cmp     #2,d7
  348.        bne     TryMsgAgain
  349.        bsr     FadeOut        ;OK!  Let's play this thing
  350.        clr     You_Looped
  351.        clr     You_Looped2
  352.        clr.w   CurrentBoard
  353.        clr.w   CurrentBoard2
  354.        clr.l   P2Offset
  355.        move.w  #3,LivesLeft    ;have some lives, why don't you
  356.        move.w  #3,LivesLeft2
  357.        tst     PlayerUp
  358.        bne     NP2U4
  359.        move    #-1,LivesLeft2  ;(unless you're not playing, P2!)
  360. NP2U4: clr.l   Score
  361.        clr.l   Score2
  362.        move.l  screenhd,a4
  363.        move.w  $12(a4),d2
  364.        mulu    #279,d2
  365.        divu    #319,d2
  366.        cmp.w   #2,d2
  367.        bge     w1ok
  368.        move.l  #2,d2
  369. w1ok:  cmp.w   #275,d2
  370.        ble     w2ok
  371.        move.l  #275,d2
  372. w2ok:  sub.w   #2,d2
  373.        move.w  d2,PaddleX
  374.        subq.w  #4,CurrentBoard
  375.        subq.w  #4,CurrentBoard2
  376. DrawBoard:
  377.        clr     cylx        ;draw a nice board
  378.        clr     cyly
  379.        clr     cyln
  380.        bsr     clrscr
  381.        tst     PlayerUp
  382.        ble     OnePGame
  383.        clr.l   d1
  384.        move    PlayerUp,d1
  385.        cmp     #-1,LivesLeft2
  386.        beq     OPL                ;switch players?
  387.        move    CurrentBoard,d0
  388.        move    CurrentBoard2,CurrentBoard
  389.        move    d0,CurrentBoard2
  390.        move    You_Cheated,d0
  391.        move    You_Cheated2,You_Cheated
  392.        move    d0,You_Cheated2
  393.        move    You_Looped,d0
  394.        move    You_Looped2,You_Looped
  395.        move    d0,You_Looped2
  396.        move    LivesLeft,d0
  397.        move    LivesLeft2,LivesLeft
  398.        move    d0,LivesLeft2
  399.        move.l  Score,d0
  400.        move.l  Score2,Score
  401.        move.l  d0,Score2
  402.        move.l  #Pl2Boards,d0
  403.        sub.l   #Board1,d0
  404.        move.l  d0,P2Offset
  405.        cmp     #2,PlayerUp
  406.        bne     P2U1
  407.        clr.l   P2Offset
  408. P2U1:  move.l  #3,d1
  409.        sub     PlayerUp,d1
  410.        move    d1,PlayerUp
  411. OPL:   mulu    #29,d1
  412.        sub     #28,d1
  413.        move.l  #220,d0      ; D1: #1 = Player 1, #30 = Player 2
  414.        move.l  #116,d2
  415.        move.l  #86,d3
  416.        move.l  bit3map,a0
  417.        move.l  bit1map,a1
  418.        move.l  #88,d4
  419.        move.l  #28,d5
  420.        move.l  #$c0,d6
  421.        move.l  #$ff,d7
  422.        jsr     _LVOBltBitMap(a6)  ;Tell user: Player 1 or 2??
  423.        bsr     DumpMsgs
  424.        bsr     FadeIn
  425.        clr     d7
  426.        bsr     tloop             ;Wait for mouse button
  427.        bsr     FadeOut
  428.        move.l  gfxbase,a6
  429.        clr.l   d0
  430.        move.l  Rast,a1
  431.        jsr     _LVOSetRast(a6)
  432. OnePGame:
  433.        and     #$7fff,PlayerUp
  434.        addq.w  #4,CurrentBoard
  435.        lea     BoardList,a5
  436.        clr.l   d0
  437.        move.w  CurrentBoard,d0
  438.        move.l  (a5,d0),a5
  439.        cmp.l   #0,a5
  440.        bne     DBok
  441.        move.l  MemPtr,a0
  442.        lea     Board1,a1
  443.        cmp     #2,PlayerUp
  444.        bne     NP2U1
  445.        lea     Pl2Boards,a1
  446. NP2U1: move.l  #Whole_Thing,d0
  447.        move.l  EBase,a6
  448.        jsr     _LVOCopyMem(a6)  ;If player loops all the way
  449.        addq    #1,You_Looped    ;around, restore his boards,
  450.        clr.w   CurrentBoard     ;place on board 1, and
  451.        lea     Board1,a5        ;start handing out the funny <?>s!
  452. DBok:  move.l  a5,d0
  453.        add.l   P2Offset,d0
  454.        move.l  d0,a5
  455.        add.l   #420,d0
  456.        move.l  d0,End_Board
  457.        move    CurrentBoard,DeathRecover
  458.        subq    #4,DeathRecover
  459.        clr.l   d0
  460.        clr.l   d1
  461.        clr.l   d2
  462.        clr.l   d3
  463.        clr.l   d5
  464.        move.w  #0,BlocksLeft
  465.        move.l  gfxbase,a6
  466.        move.w  #0,dx
  467.        move.w  #8,dy
  468. NextBlock:
  469.        clr.l   d4
  470.        move.b  (a5)+,d4
  471.        tst.b   d4
  472.        beq     NoBlk
  473.        cmp.b   #6,d4
  474.        blt     BC1
  475.        addq.w  #2,BlocksLeft
  476. BC1:   cmp.b   #5,d4
  477.        bge     BC2
  478.        addq.w  #1,BlocksLeft
  479. BC2:   mulu    #4,d4
  480.        lea     BlockCoords,a0
  481.        move.w  0(a0,d4),d0
  482.        move.w  2(a0,d4),d1
  483.        move.w  dx,d2
  484.        move.w  dy,d3
  485.        move.l  bit2map,a0
  486.        move.l  bit1map,a1
  487.        move.w  #16,d4
  488.        move.w  #7,d5
  489.        move.l  #$c0,d6
  490.        move.l  #$ff,d7
  491.        jsr     _LVOBltBitMap(a6)  ;get them blocks on there
  492. NoBlk: move.w  dx,d2
  493.        add.w   #16,d2
  494.        cmp.w   #320,d2
  495.        blt     NBdxOK
  496.        clr.w   d2
  497.        addq.w  #7,dy
  498. NBdxOK:move.w  d2,dx
  499.        cmp.l   End_Board,a5
  500.        bne     NextBlock
  501. WarpIn:
  502.        move    #3,d0
  503.        bsr     playme
  504.        bsr     showscore      ;make a cool sound and fade in the
  505.        bsr     FadeIn         ;cool board.
  506.        lea     WarpInList,a5
  507.        clr     Got_Catch
  508.        clr     Got_Laser
  509.        clr     Got_Brick
  510.        clr     Got_Grav
  511.        clr     Got_Expand
  512.        move.w  #41,Paddle_Size
  513.        move.w  #19,Stuck
  514.        move.w  #1,dx
  515.        move.w  #-1,dy
  516.        move.w  #4,spx
  517.        move.w  #5,spy
  518.        move.w  #1,cx
  519.        move.w  #1,cy
  520.        move.w  #0,SCount
  521.        move.l  #7,BallSpeed
  522. WarpInCont:
  523.        lea     devio,a1
  524.        move.l  EBase,a6
  525.        jsr     _LVOWaitIO(a6)
  526.        lea     devio,a1
  527.        move.w  #$9,Tm_Cmd
  528.        move.l  #0,secs
  529.        move.l  #66668,msecs     ;Warp-in speed.
  530.        move.l  #readreply,port
  531.        move.w  #40,Tm_Length
  532.        move.w  #0,io
  533.        move.l  EBase,a6
  534.        jsr     _LVOSendIO(a6)
  535.        move.l  #187,d3
  536.        clr.l   d2
  537.        move.w  PaddleX,d2
  538.        move.l  bit2map,a0
  539.        move.l  bit1map,a1
  540.        move.l  #17,d0
  541.        move.l  #34,d1
  542.        move.l  #44,d4
  543.        move.l  #12,d5
  544.        move.l  #$c0,d6
  545.        move.l  #$ff,d7
  546.        move.l  gfxbase,a6
  547.        jsr     _LVOBltBitMap(a6)  ;do the "cool" warp-in thingie
  548.        move.l  Rast,a0
  549.        move.l  screenhd,a4
  550.        move.w  $12(a4),d2
  551.        mulu    #279,d2
  552.        divu    #319,d2
  553.        cmp.w   #2,d2
  554.        bge     w3ok
  555.        move.l  #2,d2
  556. w3ok:  cmp.w   #275,d2
  557.        ble     w4ok
  558.        move.l  #275,d2
  559. w4ok:  sub.w   #2,d2
  560.        move.w  d2,PaddleX
  561.        move.l  #187,d3
  562.        move.l  bit2map,a0
  563.        move.l  bit1map,a1
  564.        clr.l   d0
  565.        clr.l   d1
  566.        move.w  (a5)+,d0
  567.        move.w  (a5)+,d1
  568.        move.l  #44,d4
  569.        move.l  #12,d5
  570.        move.l  #$c0,d6
  571.        move.l  #$ff,d7
  572.        move.l  gfxbase,a6
  573.        jsr     _LVOBltBitMap(a6) ;erase your tracks
  574.        cmp.l   #end_list,a5
  575.        bne     WarpInCont
  576.        move.l  EBase,a6
  577. ExMsg: move.l  windowhd,a0
  578.        move.l  86(a0),a0
  579.        jsr     _LVOGetMsg(a6)    ;dump any leftover messages.
  580.        tst.l   d0
  581.        beq     fixpaddle   ;prepare the paddle.  branches to "loop"
  582.        move.l  d0,a1
  583.        jsr     _LVOReplyMsg(a6)
  584.        bra     ExMsg
  585. loop:
  586.        cmp     #-5,Lasy1
  587.        ble     NoML1
  588.        clr.l   d0
  589.        clr.l   d1
  590.        move    Lasx1,d0
  591.        move    Lasy1,d1
  592.        subq    #7,d1
  593.        move.l  d0,d2
  594.        move.l  d1,d3
  595.        addq    #1,d2
  596.        bsr     FB2
  597.        beq     NoHL1
  598.        move.w  #-5,d1
  599. NoHL1: move.l  ViewPort,a0
  600.        lea     Las1Sprite,a1
  601.        move.l  gfxbase,a6
  602.        jsr     _LVOMoveSprite(a6)   ;move those lasers
  603. NoML1  cmp     #-5,Lasy2
  604.        ble     NoML2
  605.        clr.l   d0
  606.        clr.l   d1
  607.        move    Lasx2,d0
  608.        move    Lasy2,d1
  609.        subq    #7,d1
  610.        move.l  d0,d2
  611.        move.l  d1,d3
  612.        addq    #1,d2
  613.        bsr     FB2
  614.        beq     NoHL2
  615.        move.w  #-5,d1
  616. NoHL2: move.l  ViewPort,a0
  617.        lea     Las2Sprite,a1
  618.        move.l  gfxbase,a6
  619.        jsr     _LVOMoveSprite(a6)  ;both of them
  620. NoML2: tst.b   cyln
  621.        beq     NoC
  622.        cmp.w   #184,cyly
  623.        bge     KilCyl
  624.        addq.w  #1,cyly
  625.        bsr     DrawCyl          ;Bonuses are also called
  626.        cmp.w   #176,cyly        ;"cylenders" because that's
  627.        blt     NoC              ;what they looked like
  628.        move.w  cylx,d0          ;in Arkanoid.
  629.        move.w  PaddleX,d1
  630.        add.w   #15,d0
  631.        cmp.w   d0,d1
  632.        bgt     NoC
  633.        sub.w   #15,d0
  634.        sub.w   Paddle_Size,d0
  635.        cmp.w   d0,d1
  636.        blt     NoC
  637.        clr.l   d3
  638.        move.b  cyln,d3    ;BINGO!!!  Caught a cylender!
  639.        add.l   #10,Score
  640.        movem.l d0-a6,-(sp)
  641.        bsr     ShowScore  ;show your new & improved score
  642.        move    #6,d0
  643.        bsr     playme
  644.        movem.l (sp)+,d0-a6
  645.        mulu    #4,d3
  646.        lea     CodeTable,a3  ;find out what the cyl does
  647.        move.l  (a3,d3),a2
  648.        jmp     (a2)
  649. CodeTable:
  650.        dc.l    Cyl_Null,Cyl_Slow,Cyl_Kill,Cyl_Break,Cyl_Life,Cyl_Laser
  651.        dc.l    Cyl_Expand,Cyl_Grav,Cyl_Brick,Cyl_Catch,Cyl_RemInde
  652. Cyl_Slow:
  653.        clr     Got_Grav
  654.        cmp.l   #5,BallSpeed
  655.        ble     KilCyl
  656.        sub.l   #4,BallSpeed
  657.        bra     KilCyl
  658. Cyl_Kill:
  659.        bra     YourDead    ;Simple enough!
  660. Cyl_Break:
  661.        add.l   #40,Score
  662.        or      #$8000,PlayerUp
  663.        bsr     FadeOut
  664.        bra     DrawBoard
  665. Cyl_Life:
  666.        addq.w  #1,LivesLeft
  667.        bsr     ShowScore
  668.        clr     Got_Catch
  669.        clr     Got_Brick
  670.        clr     Got_Laser
  671.        cmp     #-1,Stuck
  672.        beq     NStk2
  673.        move    d0,-(sp)
  674.        move    #8,d0
  675.        bsr     playme
  676.        move    (sp)+,d0
  677.        move.w  #-1,Stuck
  678. NStk2: clr     Got_Grav
  679.        bra     KilCyl
  680. Cyl_Laser:
  681.        move    #1,Got_Laser
  682.        bra     KilCyl
  683. Cyl_Expand:
  684.        cmp.w   #2,Got_Expand
  685.        bge     KilCyl
  686.        addq.w  #1,Got_Expand
  687.        move.w  Paddle_Size,d0
  688.        mulu    #2,d0
  689.        move.w  d0,Paddle_Size
  690.        cmp     #-1,Stuck
  691.        beq     KilCyl
  692.        move    d0,-(sp)
  693.        move    #8,d0
  694.        bsr     playme
  695.        move    (sp)+,d0
  696.        move.w  #-1,Stuck
  697.        bra     KilCyl
  698. Cyl_Grav:
  699.        move    #1,Got_Grav
  700.        bra     KilCyl
  701. Cyl_Brick:
  702.        move    #1,Got_Brick
  703.        bra     KilCyl
  704. Cyl_Catch:
  705.        move    #1,Got_Catch
  706.        bra     KilCyl
  707. Cyl_RemInde:
  708.        clr     ddx       ;this one is actually a bit complicated!
  709.        clr     ddy
  710. CRI2:  move.w  ddx,d2
  711.        move.w  ddy,d3
  712.        mulu    #20,d3
  713.        add.l   d3,d2
  714.        move.l  #BoardList,d3
  715.        add.w   CurrentBoard,d3
  716.        move.l  d3,a3
  717.        move.l  (a3),d3
  718.        add.l   P2Offset,d3
  719.        move.l  d3,a3
  720.        clr.l   d3
  721.        move.b  (a3,d2),d3
  722.        cmp.b   #5,d3
  723.        blt     CRInxt
  724.        cmp.b   #5,d3
  725.        bne     CRI3
  726.        clr.b   d3
  727.        bra     CRI4
  728. CRI3:  move.b  #3,d3
  729.        subq.w  #1,BlocksLeft
  730. CRI4:  move.b  d3,(a3,d2)
  731.        mulu    #4,d3
  732.        lea     BlockCoords,a0
  733.        move.w  0(a0,d3),d0
  734.        move.w  2(a0,d3),d1
  735.        move.w  ddx,d2
  736.        mulu    #16,d2
  737.        move.w  ddy,d3
  738.        mulu    #7,d3
  739.        add.w   #8,d3
  740.        move.l  bit2map,a0
  741.        move.l  bit1map,a1
  742.        move.w  #16,d4
  743.        move.w  #7,d5
  744.        move.l  #$c0,d6
  745.        move.l  #$ff,d7
  746.        move.l  gfxbase,a6
  747.        jsr     _LVOBltBitMap(a6)  ;fix those inde blocks
  748. CRInxt:addq.w  #1,ddx
  749.        cmp.w   #20,ddx
  750.        blt     CRI5
  751.        clr     ddx
  752.        addq.w  #1,ddy
  753. CRI5:  cmp.w   #21,ddy
  754.        blt     CRI2
  755. Cyl_Null:
  756. KilCyl:bsr     EraseCyl  ;erase the cyl you just caught
  757.        clr     cyly
  758.        clr     cylx
  759.        clr     cyln
  760.        bra     fixpaddle  ;and patch you up
  761. NoC:   cmp.w   #-1,Stuck
  762.        bne     NoAcelBall
  763.        move.l  BallSpeed,d7
  764.        addq.w  #1,SCount
  765.        cmp.w   #400,SCount      ;Ball Accelleration.
  766.        blt     NoSped
  767.        clr.w   SCount
  768.        addq.l  #1,BallSpeed
  769. NoSped:move.l  #0,d6
  770. BalLop:bsr     MoveBall
  771.        cmp     #0,d6
  772.        bne     YourDead     ;oops...  you dropped it!
  773.        dbra    d7,BalLop
  774.        bsr     UpDateBall
  775.        tst.w   BlocksLeft
  776.        ble     NewBoard
  777.        cmp.w   #-1,Stuck
  778.        bne     fixpaddle
  779. NoAcelBall:
  780.        lea     devio,a1
  781.        move.l  EBase,a6
  782.        jsr     _LVOWaitIO(a6)
  783.        lea     devio,a1
  784.        move.w  #$9,Tm_Cmd
  785.        move.l  #0,secs
  786.        move.l  #16667,msecs
  787.        move.l  #readreply,port
  788.        move.w  #40,Tm_Length
  789.        move.w  #0,io
  790.        move.l  EBase,a6
  791.        jsr     _LVOSendIO(a6)    ;wonderful timing doohickie
  792.        move.l  #0,d7
  793. loop2:
  794.        move.l  windowhd,a0
  795.        move.l  86(a0),a0
  796.        jsr     _LVOGetMsg(a6)    ;read in the message.
  797.        tst.l   d0
  798.        bne     ReadMsg
  799.        cmp     #0,d7
  800.        beq     loop
  801.        btst    #1,d7
  802.        bne     AbortGame
  803.        btst    #3,d7
  804.        bne     Pause
  805.        btst    #4,d7
  806.        bne     SelfDest   ;Thank you for pressing
  807.        btst    #2,d7      ;the Self-Destruct Button!
  808.        bne     fixpaddle
  809.        bra     loop
  810. ende:
  811.        bsr     FadeOut    ;Fun Finish For Fade Fans! (FFFFF)
  812.        lea     devio,a1
  813.        move.l  EBase,a6         ;we're leaving the whole prog here
  814.        jsr     _LVOWaitIO(a6)
  815.        clr.l   d0
  816.        move.w  SpL2n,d0
  817.        move.l  gfxbase,a6
  818.        jsr     _LVOFreeSprite(a6)  ;return all allocated resources
  819. Las2Kicked:
  820.        move.w  SpL1n,d0
  821.        move.l  gfxbase,a6
  822.        jsr     _LVOFreeSprite(a6)  ;in the opposite order
  823. Las1Kicked:
  824.        move.w  spnum,d0
  825.        move.l  gfxbase,a6
  826.        jsr     _LVOFreeSprite(a6)  ;that they were allocated in.
  827. SpriteKicked:
  828.        bsr     windclose
  829. WindKicked:
  830.        move.l  screenhd,a0
  831.        bsr     closescreen
  832. ScreenKicked:
  833.        move.l  screen2hd,a0
  834.        bsr     closescreen
  835. Screen2Kicked:
  836.        move.l  screen3hd,a0
  837.        bsr     closescreen
  838. Screen3Kicked:
  839.        bsr     closeiff      ;get rid of all this stuff
  840. IffKicked:
  841.        tst.l   Font
  842.        beq     FontKicked
  843.        move.l  gfxbase,a6    ;we don't need this font anymore
  844.        move.l  Font,a1
  845.        jsr     _LVOCloseFont(a6)
  846. FontKicked:
  847.        move.l  EBase,a6
  848.        move.l  #3,d2
  849. Ab:    move    d2,d0
  850.        mulu    #68,d0
  851.        lea     othermessages,a2
  852.        add.l   d0,a2
  853.        move.l  a2,a1
  854.        jsr     _LVOAbortIO(a6)   ;get rid of our audio.device
  855.        move.l  a2,a1
  856.        jsr     _LVOWaitIO(a6)
  857.        dbra    d2,Ab
  858.        move.l  #15,Unit
  859.        lea     Message,a1
  860.        jsr     _LVOCloseDevice(a6)
  861. AudioKicked:
  862.        move    #-1,d2
  863. SigKicked:
  864.        cmp     #3,d2
  865.        beq     SigsFree
  866.        addq    #1,d2
  867.        move    #3,d0
  868.        sub     d2,d0       ;free up these signals
  869.        mulu    #64,d0
  870.        lea     MsgSig,a0
  871.        add.l   d0,a0
  872.        clr.l   d0
  873.        move.b  (a0),d0
  874.        move.l  EBase,a6
  875.        jsr     _LVOFreeSignal(a6)
  876.        bra     SigKicked
  877. SigsFree:
  878.        bsr     closegfx
  879. GfxKicked:
  880.        tst.l   ErrPtr
  881.        beq     NoErr
  882.        bsr     ErrWindOpen     ;tell user if error occoured
  883.        beq     NoErr
  884.        move.l  windowhd,a0
  885.        move.l  86(a0),a0
  886.        move.l  EBase,a6
  887.        jsr     _LVOWaitPort(a6)    ;wait for message.
  888. NextMsg:
  889.        move.l  windowhd,a0
  890.        move.l  86(a0),a0
  891.        jsr     _LVOGetMsg(a6)    ;read in the message.
  892.        tst.l   d0
  893.        beq     NMMsgs
  894.        move.l  d0,a1
  895.        jsr     _LVOReplyMsg(a6)
  896.        bra     NextMsg
  897. NMMsgs:
  898.        bsr     WindClose
  899. NoErr: bsr     closedos
  900. DosKicked:
  901.        bsr     closeint
  902. IntKicked:
  903.        move.l  EBase,a6
  904.        lea     devio,a1
  905.        jsr     _LVOCloseDevice(a6)  ;close timer.device
  906.        lea     readreply,a1
  907.        jsr     _LVORemPort(a6)
  908. TimeKicked:
  909. ;       move.l  MemPtr,a1
  910. ;       move.l  #Whole_Thing,d0
  911. ;       move.l  EBase,a6
  912. ;       jsr     _LVOFreeMem(a6)     ;more old code
  913. MemKicked:
  914.        rts   ;that's all folks!  We're outta here!
  915. PicKicked:
  916.        bsr     ClosePic
  917.        bra     SpriteKicked
  918. SpriteKickedM:
  919.        move.l  #no_sprites,ErrPtr
  920.        bra     SpriteKicked
  921. Las1KickedM:
  922.        move.l  #no_sprites,ErrPtr   ;some little patches
  923.        bra     Las1Kicked
  924. Las2KickedM:
  925.        move.l  #no_sprites,ErrPtr   ;for telling the user about errors
  926.        bra     Las2Kicked
  927. AudioKickedM:
  928.        move.l  #no_audio,ErrPtr
  929.        bra     AudioKicked
  930. NewBoard:
  931.        add.l   #100,Score     ;a little patch for a new board
  932.        bsr     FadeOut
  933.        or      #$8000,PlayerUp
  934.        bra     DrawBoard
  935. clrscr:                     ;Clear the screen!
  936.        clr.l   d0           ;Affects d0,d1,a0,a1,a6 only.
  937.        clr.l   d1
  938.        move.w  #-4,d0
  939.        move.w  #-4,d1
  940.        move.l  gfxbase,a6
  941.        move.l  ViewPort,a0
  942.        lea     ballsprite,a1
  943.        jsr     _LVOMoveSprite(a6)  ;Yank ball off screen
  944.        clr.l   d0
  945.        move.l  Rast,a1
  946.        jsr     _LVOSetRast(a6)     ;Clear bitmap
  947.        clr.l   d0
  948.        clr.l   d1
  949.        move.w  #-5,d1
  950.        move.l  gfxbase,a6
  951.        move.l  ViewPort,a0
  952.        lea     Las1Sprite,a1
  953.        jsr     _LVOMoveSprite(a6)  ;Yank laser off screen
  954.        clr.l   d0
  955.        clr.l   d1
  956.        move.w  #-5,d1
  957.        move.l  ViewPort,a0
  958.        lea     Las2Sprite,a1
  959.        jsr     _LVOMoveSprite(a6)  ;Yank other laser off screen
  960.        rts
  961. EOGmessage:                  ;End-Of-Game messages for user
  962.        bsr     clrscr
  963.        cmp     #2,PlayerUp
  964.        bne     NoFixP
  965.        move    You_Cheated,d0
  966.        move    You_Cheated2,You_Cheated
  967.        move    d0,You_Cheated2
  968.        move.l  Score,d0
  969.        move.l  Score2,Score
  970.        move.l  d0,Score2
  971. NoFixP:lea     end_ScoreList,a5
  972.        tst     You_Cheated
  973.        beq     NCH1
  974.        clr.l   Score
  975. NCH1:  tst     You_Cheated2
  976.        beq     NCH2
  977.        clr.l   Score2
  978. NCH2:  clr.l   d0
  979.        clr     Mark1
  980.        clr     Mark2
  981.        move.w  -(a5),d0
  982.        move.l  Score,d6
  983.        move.l  #0,d7
  984.        cmp.l   d6,d0
  985.        blt     HighScore
  986.        move.l  Score2,d6
  987.        move    #1,d7
  988.        cmp.l   d6,d0
  989.        blt     HighScore
  990.        move.l  #6,d0
  991.        move.l  #169,d1
  992.        move.l  #95,d2
  993.        move.l  #20,d3
  994.        move.l  bit2map,a0
  995.        move.l  bit1map,a1
  996.        move.l  #129,d4
  997.        move.l  #28,d5
  998.        move.l  #$c0,d6
  999.        move.l  #$ff,d7
  1000.        move.l  gfxbase,a6
  1001.        jsr     _LVOBltBitMap(a6)  ;"Final Scores" message.
  1002.        move.l  #220,d0
  1003.        move.l  #1,d1
  1004.        move    #71,d2
  1005.        move    #72,d3
  1006.        move.l  bit3map,a0
  1007.        move.l  bit1map,a1
  1008.        move    #88,d4
  1009.        move    #57,d5
  1010.        jsr     _LVOBltBitMap(a6)  ;PLAYER 1 & 2
  1011.        move    #28,d5
  1012.        move.l  Score,d0
  1013.        lea     TexBuf,a5
  1014.        bsr     PrtNum
  1015.        move.l  Rast,a1
  1016.        move.l  a5,d3
  1017.        sub.l   #TexBuf,d3
  1018.        move.l  #187,d0
  1019.        move.l  #89,d1
  1020.        jsr     _LVOMove(a6)
  1021.        move.l  d3,d0
  1022.        lea     TexBuf,a0
  1023.        move.l  Rast,a1
  1024.        jsr     _LVOText(a6)
  1025.        tst     PlayerUp
  1026.        beq     NoS2
  1027.        move.l  Score2,d0
  1028.        lea     TexBuf,a5
  1029.        bsr     PrtNum
  1030.        move.l  Rast,a1
  1031.        move.l  a5,d3
  1032.        sub.l   #TexBuf,d3
  1033.        move.l  #187,d0
  1034.        move.l  #118,d1
  1035.        jsr     _LVOMove(a6)
  1036.        move.l  d3,d0
  1037.        lea     TexBuf,a0
  1038.        move.l  Rast,a1
  1039.        jsr     _LVOText(a6)
  1040. NoS2:  tst     You_Cheated
  1041.        beq     NoP1C
  1042.        move.l  #220,d0
  1043.        move.l  #59,d1
  1044.        move    #161,d2
  1045.        move    #72,d3
  1046.        move.l  bit3map,a0
  1047.        move.l  bit1map,a1
  1048.        jsr     _LVOBltBitMap(a6)  ;Tell Player 1: CHEATER!!
  1049. NoP1C: tst     You_Cheated2
  1050.        beq     NoP2C
  1051.        move.l  #220,d0
  1052.        move.l  #59,d1
  1053.        move    #161,d2
  1054.        move    #101,d3
  1055.        move.l  bit3map,a0
  1056.        move.l  bit1map,a1
  1057.        jsr     _LVOBltBitMap(a6)  ;Tell Player 2: CHEATER!!
  1058. NoP2C: bsr     DumpMsgs
  1059.        bsr     FadeIn
  1060.        clr     d7
  1061.        bsr     tloop             ;Wait for mouse button / key
  1062.        move    d7,-(sp)
  1063.        bsr     FadeOut
  1064.        move    (sp)+,d7
  1065.        cmp.b   #'2',d7
  1066.        beq     NewGame
  1067. HiScr: bsr     clrscr
  1068.        move.l  #136,d0
  1069.        move.l  #169,d1
  1070.        move.l  #95,d2
  1071.        move.l  #10,d3
  1072.        move.l  bit2map,a0
  1073.        move.l  bit1map,a1
  1074.        move.l  #129,d4
  1075.        move.l  #28,d5
  1076.        move.l  #$c0,d6
  1077.        move.l  #$ff,d7
  1078.        move.l  gfxbase,a6
  1079.        jsr     _LVOBltBitMap(a6)  ;"High Scores" message.
  1080.        tst     Mark2
  1081.        beq     NFM
  1082.        move    Mark1,d0
  1083.        cmp     Mark2,d0
  1084.        blt     NFM
  1085.        addq    #1,Mark1
  1086.        cmp     #15,Mark1
  1087.        ble     NFM
  1088.        clr     Mark1
  1089. NFM:   tst     Mark1
  1090.        beq     NHi1
  1091.        move.l  #87,d0
  1092.        move.l  #176,d1
  1093.        move    #235,d2
  1094.        move    Mark1,d3
  1095.        mulu    #10,d3
  1096.        add     #38,d3
  1097.        move.l  bit3map,a0
  1098.        move.l  bit1map,a1
  1099.        move    #42,d4
  1100.        move    #11,d5
  1101.        jsr     _LVOBltBitMap(a6)  ;Highlight Player 1's score
  1102. NHi1:  tst     Mark2
  1103.        beq     NHi2
  1104.        move.l  #87,d0
  1105.        move.l  #188,d1
  1106.        move    #235,d2
  1107.        move    Mark2,d3
  1108.        mulu    #10,d3
  1109.        add     #38,d3
  1110.        move.l  bit3map,a0
  1111.        move.l  bit1map,a1
  1112.        move    #42,d4
  1113.        move    #11,d5
  1114.        jsr     _LVOBltBitMap(a6)  ;Highlight Player 2's score
  1115. NHi2:  move.l  Rast,a1
  1116.        clr.l   d0
  1117.        jsr     _LVOSetDrMd(a6)
  1118.        lea     ScoreList,a4
  1119.        move.l  #14,d6
  1120.        move.l  #56,d7
  1121. NexNam:lea     texbuf,a5
  1122.        move.l  #19,d3
  1123. NexLet:move.b  (a4)+,(a5)+
  1124.        dbra    d3,NexLet
  1125.        move.l  #'    ',(a5)+
  1126.        clr.l   d0
  1127.        move.w  (a4)+,d0
  1128.        bsr     PrtNum
  1129.        move.l  a5,d3
  1130.        sub.l   #TexBuf,d3
  1131.        move.l  Rast,a1
  1132.        move.l  #44,d0
  1133.        move.l  d7,d1
  1134.        add.l   #10,d7
  1135.        jsr     _LVOMove(a6)
  1136.        move.l  d3,d0
  1137.        lea     TexBuf,a0
  1138.        move.l  Rast,a1
  1139.        jsr     _LVOText(a6)
  1140.        dbra    d6,NexNam
  1141.        move.l  Rast,a1
  1142.        move.l  #1,d0
  1143.        jsr     _LVOSetDrMd(a6)
  1144.        bsr     DumpMsgs
  1145.        bsr     FadeIn
  1146.        clr     d7
  1147.        bsr     tloop             ;Wait for mouse button / key
  1148.        move    d7,-(sp)
  1149.        bsr     FadeOut
  1150.        move    (sp)+,d7
  1151.        bra     NewGame
  1152. HighScore:   ;d6 = Score, d7 = Player (0=1, 1=2), a5 = pointer
  1153.        lea     Mark1,a0
  1154.        tst     d7
  1155.        beq     HS1a
  1156.        lea     Mark2,a0
  1157. HS1a:  and.l   #$ffff,d6
  1158.        move    #15,(a0)
  1159.        sub.l   #20,a5
  1160.        lea     end_ScoreList,a4
  1161. HS1:   move.w  -(a5),d0
  1162.        cmp.l   d6,d0
  1163.        bge     HS3
  1164.        subq    #1,(a0)
  1165.        move    d0,-(a4)
  1166.        move.l  #9,d5
  1167. HS2:   move    -(a5),-(a4)
  1168.        dbra    d5,HS2
  1169.        bra     HS1
  1170. HS3:   move    d6,-(a4)
  1171.        addq.l  #2,a5
  1172.        clr     Cpos
  1173.        move.l  d7,-(sp)
  1174.        move.l  a5,-(sp)
  1175.        mulu    #29,d7
  1176.        addq    #1,d7
  1177.        move.l  d7,d1
  1178.        move.l  #220,d0
  1179.        move.l  #116,d2
  1180.        move.l  #20,d3
  1181.        move.l  bit3map,a0
  1182.        move.l  bit1map,a1
  1183.        move.l  #88,d4
  1184.        move.l  #28,d5
  1185.        move.l  #$c0,d6
  1186.        move.l  #$ff,d7
  1187.        move.l  gfxbase,a6
  1188.        jsr     _LVOBltBitMap(a6)
  1189.        move.l  Rast,a1
  1190.        clr.l   d0
  1191.        move.l  #65,d1
  1192.        jsr     _LVOMove(a6)
  1193.        move.l  #end_ScrMsg-ScrMsg,d0
  1194.        lea     ScrMsg,a0
  1195.        move.l  Rast,a1
  1196.        jsr     _LVOText(a6)
  1197.        clr.l   d0
  1198.        move.l  #75,d1
  1199.        move.l  Rast,a1
  1200.        jsr     _LVOMove(a6)
  1201.        move    #'>_',TexBuf
  1202.        move.l  Rast,a1
  1203.        move.l  #2,d0
  1204.        lea     TexBuf,a0
  1205.        jsr     _LVOText(a6)
  1206.        bsr     FadeIn
  1207.        bsr     DumpMsgs
  1208.        move.l  (sp)+,a5
  1209. GetL:  clr     d7          ;Enter your name!
  1210.        bsr     tloop       ;You're on the list!
  1211.        cmp.b   #8,d7
  1212.        bne     NotD
  1213.        tst     Cpos
  1214.        beq     NotD
  1215.        subq    #1,Cpos
  1216.        move.l  Rast,a1
  1217.        move.l  #75,d1
  1218.        move    Cpos,d0
  1219.        mulu    #8,d0
  1220.        addq    #8,d0
  1221.        move.l  gfxbase,a6
  1222.        jsr     _LVOMove(a6)
  1223.        lea     texbuf,a0
  1224.        move.l  #2,d0
  1225.        move.l  Rast,a1
  1226.        move    #'_ ',(a0)
  1227.        jsr     _LVOText(a6)
  1228.        subq.l  #1,a5
  1229.        bra     GetL
  1230. NotD:  cmp.b   #13,d7
  1231.        beq     DoneName
  1232.        cmp.b   #10,d7
  1233.        beq     DoneName
  1234.        cmp     #32,d7
  1235.        blt     GetL
  1236.        cmp     #127,d7
  1237.        blt     HS4
  1238.        cmp     #160,d7
  1239.        blt     GetL
  1240. HS4:   cmp     #20,Cpos   ;Not enough room
  1241.        bge     GetL
  1242.        move.l  gfxbase,a6
  1243.        move.l  Rast,a1
  1244.        move.l  #75,d1
  1245.        move    Cpos,d0
  1246.        mulu    #8,d0
  1247.        addq    #8,d0
  1248.        jsr     _LVOMove(a6)
  1249.        move.l  #2,d0
  1250.        lea     texbuf,a0
  1251.        move.l  Rast,a1
  1252.        move.b  #'_',1(a0)
  1253.        move.b  d7,(a5)+
  1254.        move.b  d7,(a0)
  1255.        jsr     _LVOText(a6)
  1256.        addq    #1,Cpos
  1257.        bra     GetL
  1258. DoneName:
  1259.        cmp     #20,Cpos
  1260.        bge     Dok
  1261.        addq    #1,Cpos
  1262.        move.b  #32,(a5)+
  1263.        bra     DoneName
  1264. Dok:   bsr     FadeOut
  1265.        bsr     SaveScores
  1266.        bsr     clrscr
  1267.        move.l  (sp)+,d7
  1268.        tst     d7
  1269.        bne     HiScr
  1270.        lea     end_ScoreList,a5
  1271.        move.w  -(a5),d0
  1272.        move.l  Score2,d6
  1273.        move    #1,d7
  1274.        cmp.l   d6,d0
  1275.        blt     HighScore  ;Enter your name
  1276.        bra     HiScr      ;Show HighScore list
  1277. DumpMsgs:
  1278.        move.l  windowhd,a0
  1279.        move.l  86(a0),a0
  1280.        move.l  EBase,a6
  1281.        jsr     _LVOGetMsg(a6)    ;check for leftover messages.
  1282.        tst.l   d0
  1283.        beq     _rts           ;No more leftovers, look for real ones.
  1284.        move.l  d0,a1
  1285.        jsr     _LVOReplyMsg(a6)
  1286.        bra     DumpMsgs
  1287. Pause:
  1288.        move.l  windowhd,a0
  1289.        move.l  intbase,a6
  1290.        jsr     _LVOClearPointer(a6)  ;put back mouse pointer
  1291.        bsr     FadeOutGrey
  1292.        clr     d7
  1293. ploop:
  1294.        move.l  windowhd,a0
  1295.        move.l  86(a0),a0
  1296.        move.l  EBase,a6
  1297.        jsr     _LVOWaitPort(a6)    ;wait for message.
  1298. ploop2:
  1299.        move.l  windowhd,a0
  1300.        move.l  86(a0),a0
  1301.        jsr     _LVOGetMsg(a6)    ;read in the message.
  1302.        tst.l   d0
  1303.        bne     pReadMsg
  1304.        tst     d7
  1305.        beq     ploop
  1306.        bsr     FadeInGrey
  1307.        lea     ctable,a1
  1308.        move.l  #32,d0
  1309.        move.l  ViewPort,a0
  1310.        move.l  gfxbase,a6
  1311.        jsr     _LVOLoadRGB4(a6)
  1312.        move.l  windowhd,a0
  1313.        lea     blkptr,a1
  1314.        move.l  #1,d0
  1315.        move.l  d0,d1
  1316.        clr.l   d2
  1317.        clr.l   d3
  1318.        move.l  intbase,a6
  1319.        jsr     _LVOSetPointer(a6)  ;get rid of mouse pointer, again
  1320.        bsr     DumpMsgs
  1321.        bra     FixPaddle
  1322. pReadMsg:
  1323.        move.l  d0,a5
  1324.        move.l  20(a5),d6
  1325.        move.l  d6,d0
  1326.        and.l   #$200008,d0    ;User press a key?  (PAUSE MODE)
  1327.        cmp.l   #0,d0
  1328.        beq     pReply
  1329.        moveq   #1,d7
  1330. pReply:move.l  a5,a1
  1331.        jsr     _LVOReplyMsg(a6)
  1332.        bra     ploop2
  1333. tloop:
  1334.        move.l  windowhd,a0
  1335.        move.l  86(a0),a0
  1336.        move.l  EBase,a6
  1337.        jsr     _LVOWaitPort(a6)    ;wait for message.
  1338. tloop2:
  1339.        move.l  windowhd,a0
  1340.        move.l  86(a0),a0
  1341.        jsr     _LVOGetMsg(a6)    ;read in the message.
  1342.        tst.l   d0
  1343.        bne     tReadMsg
  1344.        tst     d7
  1345.        beq     tloop
  1346.        rts
  1347. tReadMsg:
  1348.        move.l  d0,a1
  1349.        move.l  20(a1),d0
  1350.        and.l   #$8,d0         ;User press a MB?  (PLAYER 1/2 SCREEN)
  1351.        tst.l   d0             ;                  (SCORES SCREEN)
  1352.        beq     tKey
  1353.        moveq   #1,d7
  1354.        bra     tReply
  1355. tKey:  move.l  20(a1),d0
  1356.        and.l   #$200000,d0    ;or a key?
  1357.        tst.l   d0
  1358.        beq     tReply
  1359.        move.b  25(a1),d7
  1360. tReply:jsr     _LVOReplyMsg(a6)
  1361.        bra     tloop2
  1362. ReadMsg:
  1363.        move.l  d0,a5
  1364.        move.l  20(a5),d6
  1365.        move.l  d6,d0
  1366.        and.l   #$200000,d0    ;User press a key?  (DURING GAME)
  1367.        cmp.l   #0,d0
  1368.        beq     NotClose
  1369.        move.b  25(a5),d0
  1370.        cmp.b   #'Q',d0        ;Was it, 'Q'?
  1371.        bne     NotQ
  1372.        bset    #1,d7
  1373.        bra     Reply
  1374. NotQ:  cmp.b   #$A9,d0        ;Was it the cheat key?   ;->
  1375.        bne     NotC1                     ;(shhh!)
  1376.        clr.l   Score
  1377.        move    #1,You_Cheated
  1378.        move    PaddleX,cylx
  1379.        add     #12,cylx
  1380.        move    #175,cyly
  1381.        move.b  #3,cyln
  1382.        bra     Reply
  1383. NotC1: cmp.b   #$B6,d0        ;Was it the OTHER cheat key??
  1384.        bne     NotC2                       ; 8->    (!!)
  1385.        clr.l   Score
  1386.        move    #1,You_Cheated
  1387.        move    #1,Got_Laser
  1388.        move    #1,Got_Brick
  1389.        move    #1,Got_Catch
  1390.        clr     Got_Grav
  1391.        move    PaddleX,cylx
  1392.        add     #12,cylx
  1393.        move    #175,cyly
  1394.        move.b  #10,cyln
  1395.        bra     Reply
  1396. NotC2: cmp.b   #27,d0         ;Was it ESC?
  1397.        bne     NotC3
  1398.        bset    #3,d7
  1399.        bra     Reply
  1400. NotC3: cmp.b   #$7f,d0        ;Was it DEL?
  1401.        bne     NotC4
  1402.        bset    #4,d7
  1403.        bra     Reply
  1404. NotC4: or.b    #'a'-'A',d0    ;Was it 'p' or 'P'?
  1405.        cmp.b   #'p',d0
  1406.        bne     NotClose
  1407.        bset    #3,d7
  1408.        bra     Reply
  1409. NotClose:
  1410.        move.l  d6,d0
  1411.        and.l   #$80000,d0
  1412.        tst.l   d0
  1413.        beq     NotInAct
  1414.        bset    #3,d7
  1415. NotInAct:
  1416.        move.l  d6,d0
  1417.        and.l   #$100010,d0
  1418.        tst.l   d0
  1419.        beq     NotFix
  1420.        bset    #2,d7
  1421. NotFix:
  1422.        move.l  d6,d0
  1423.        and.l   #$8,d0
  1424.        tst.l   d0
  1425.        beq     NotLetGo
  1426.        cmp.w   #-1,Stuck
  1427.        beq     NotStk
  1428.        move    d0,-(sp)
  1429.        move    #8,d0
  1430.        bsr     playme      ;release the ball from paddle
  1431.        move    (sp)+,d0
  1432.        move.w  #-1,Stuck
  1433. NotStk:bset    #2,d7
  1434.        tst     Got_Laser
  1435.        beq     NotLetGo
  1436.        movem.l d0-a6,-(sp)
  1437.        clr     d7
  1438.        tst     Lasy1
  1439.        bge     NoL1
  1440.        clr.l   d0
  1441.        move    #7,d7
  1442.        move.w  PaddleX,d0
  1443.        subq.w  #1,d0
  1444.        move.l  #181,d1
  1445.        move.l  gfxbase,a6
  1446.        move.l  ViewPort,a0
  1447.        lea     Las1Sprite,a1
  1448.        jsr     _LVOMoveSprite(a6)  ;shoot that laser!
  1449. NoL1:  tst     Lasy2
  1450.        bge     NoL2
  1451.        clr.l   d0
  1452.        move    #7,d7
  1453.        move.w  PaddleX,d0
  1454.        add.w   Paddle_Size,d0
  1455.        subq.w  #4,d0
  1456.        move.l  #181,d1
  1457.        move.l  gfxbase,a6
  1458.        move.l  ViewPort,a0
  1459.        lea     Las2Sprite,a1
  1460.        jsr     _LVOMoveSprite(a6)  ;shoot that other laser!
  1461. NoL2:  tst     d7
  1462.        beq     NoL12
  1463.        tst     Got_Brick
  1464.        bne     Hefty      ;Sound effect for laser depends on
  1465.        move    #10,d7     ;Brickthrough or not
  1466. Hefty: move    d7,d0          ;Hefty Hefty Hefty! Wimpy Wimpy Wimpy!!
  1467.        bsr     playme
  1468. NoL12: movem.l (sp)+,d0-a6
  1469. NotLetGo:
  1470.        bra     Reply
  1471. MoveBall:
  1472.        cmp.w   #-1,Stuck
  1473.        bne     ok5
  1474.        clr.l   d0
  1475.        clr.l   d1
  1476.        move.w  sx,d0
  1477.        move.w  sy,d1
  1478.        move.w  cx,d2
  1479.        subq.w  #1,d2
  1480.        move.w  d2,cx
  1481.        tst.w   d2
  1482.        bne     ok2
  1483.        add.w   dx,d0
  1484.        move.w  spx,cx
  1485.        clr.l   d4
  1486.        bsr     CheckBlock  ;did I hit something?  Duh...
  1487.        bne     Nok3
  1488.        cmp.w   #0,d0
  1489.        bgt     ok1
  1490.        move.w  #1,dx
  1491.        move    d0,-(sp)
  1492.        move    #9,d0
  1493.        bsr     playme
  1494.        move    (sp)+,d0
  1495. ok1:   cmp.w   #315,d0
  1496.        blt     ok2
  1497.        move    d0,-(sp)
  1498.        move    #9,d0
  1499.        bsr     playme
  1500.        move    (sp)+,d0
  1501.        move.w  #-1,dx
  1502.        bra     ok2
  1503. Nok3:  move.w  sx,d0
  1504.        neg.w   dx
  1505. ok2:   move.w  cy,d2
  1506.        subq.w  #1,d2
  1507.        move.w  d2,cy
  1508.        tst.w   d2
  1509.        bne     ok4
  1510.        add.w   dy,d1
  1511.        tst     Got_Grav
  1512.        beq     NoGrv
  1513.        movem.l d0-d1,-(sp)   ;silly gravity math
  1514.        move.w  #15,d0
  1515.        muls    #14,d1        ;(needs a lot of work, probably)
  1516.        divs    #200,d1
  1517.        sub     d1,d0         ;(follows no laws of physics!)
  1518.        move    d0,cy
  1519.        movem.l (sp)+,d0-d1
  1520.        bra     Grv
  1521. NoGrv: move.w  spy,cy
  1522. Grv:   clr.l   d4
  1523.        addq    #1,d4
  1524.        bsr     CheckBlock
  1525.        bne     Nok4
  1526.        cmp.w   #0,d1
  1527.        bgt     ok3
  1528.        move    d0,-(sp)
  1529.        move    #9,d0
  1530.        bsr     playme
  1531.        move    (sp)+,d0
  1532.        move.w  #1,dy
  1533.        bra     ok3
  1534. Nok4:  move.w  sy,d1
  1535.        neg.w   dy
  1536. ok3:   cmp.w   #186,d1
  1537.        bge     chkx
  1538. ok3b:  cmp.w   #196,d1
  1539.        blt     ok4
  1540.        move.w  #-1,dy
  1541.        move.l  #1,d6
  1542. ok4:   move.w  d0,sx
  1543.        move.w  d1,sy
  1544. ok5:   rts
  1545. UpDateBall:
  1546.        clr.l   d0
  1547.        clr.l   d1
  1548.        move.w  sx,d0
  1549.        move.w  sy,d1
  1550.        move.l  gfxbase,a6
  1551.        move.l  ViewPort,a0
  1552.        lea     ballsprite,a1
  1553.        jsr     _LVOMoveSprite(a6)  ;show ball's new position
  1554.        rts
  1555. Reply:
  1556.        move.l  a5,a1
  1557.        move.l  EBase,a6
  1558.        jsr     _LVOReplyMsg(a6)
  1559.        bra     Loop2
  1560. chkx:
  1561.        cmp.w   PaddleX,d0
  1562.        blt     ok3b
  1563.        clr.l   d2
  1564.        move.w  PaddleX,d2
  1565.        add.w   Paddle_Size,d2
  1566.        subq.w  #1,d2
  1567.        cmp.w   d2,d0
  1568.        bgt     ok3b
  1569.        move.w  dy,d2
  1570.        tst     d2
  1571.        ble     ok3b    ;Paddle: Don't bounce ball down!
  1572.        neg.w   dy
  1573.        move.w  d0,d2
  1574.        sub.w   PaddleX,d2
  1575.        tst     Got_Catch
  1576.        beq     NoCat
  1577.        move.l  d0,-(sp)
  1578.        clr     d0
  1579.        bsr     playme
  1580.        move.l  (sp)+,d0
  1581.        move.w  d2,Stuck       ;Catch feature.  Play the catch sound!
  1582.        bra     NoCatb
  1583. NoCat: move.l  d0,-(sp)
  1584.        move    #8,d0
  1585.        bsr     playme         ;Play the "Bonk" sound if you
  1586.        move.l  (sp)+,d0       ;can't catch the ball.
  1587. NoCatb:clr.l   d3
  1588.        move.w  Paddle_size,d3
  1589.        divu    #2,d3
  1590.        sub.w   d3,d2
  1591.        tst     d2
  1592.        bge     NoExt
  1593.        swap    d2
  1594.        move    #$ffff,d2
  1595.        swap    d2
  1596. NoExt: cmp     #1,Got_Expand
  1597.        bne     NoE3
  1598.        divs    #2,d2
  1599. NoE3:  cmp     #2,Got_Expand
  1600.        bne     NoE4
  1601.        divs    #4,d2
  1602. NoE4:  move.w  #1,dx
  1603.        tst.w   d2
  1604.        bge     NoAbs
  1605.        neg.w   d2
  1606.        neg.w   dx
  1607. NoAbs: and.l   #$ffff,d2
  1608.        clr.l   d3
  1609.        mulu    #3,d2
  1610.        divu    #5,d2
  1611.        move.w  #12,d3
  1612.        sub.w   d2,d3
  1613.        cmp.w   #3,d2
  1614.        bge     Notd20
  1615.        move.w  #3,d2
  1616. Notd20:move.w  d2,spy
  1617.        cmp.w   #2,d3
  1618.        bge     Notd30
  1619.        move.w  #2,d3
  1620. Notd30:move.w  d3,spx
  1621.        bra     ok4
  1622. CheckBlock:           ;Check if ball or laser hit something.
  1623.        clr.l   d2
  1624.        clr.l   d3
  1625.        move.w  d0,d2
  1626.        move.w  d1,d3
  1627.        tst     d4
  1628.        bne     FB1
  1629.        cmp.w   #1,dx
  1630.        bne     FB2
  1631.        addq.w  #3,d2
  1632.        bra     FB2
  1633. FB1:   cmp.w   #1,dy
  1634.        bne     FB2
  1635.        addq.w  #3,d3
  1636. FB2:   cmp.w   #155,d3  ;Laser hit starts here.
  1637.        bge     ok8
  1638.        cmp.w   #8,d3
  1639.        blt     ok8
  1640.        divu    #16,d2
  1641.        move.w  d2,ddx
  1642.        subq.w  #8,d3
  1643.        divu    #7,d3
  1644.        move.w  d3,ddy
  1645.        mulu    #20,d3
  1646.        add.l   d3,d2
  1647.        move.l  #BoardList,d3
  1648.        add.w   CurrentBoard,d3
  1649.        move.l  d3,a3
  1650.        move.l  (a3),d3
  1651.        add.l   P2Offset,d3
  1652.        move.l  d3,a3
  1653.        move.l  #BonusList,d3
  1654.        add.w   CurrentBoard,d3
  1655.        move.l  d3,a4
  1656.        move.l  (a4),a4
  1657.        clr.l   d3
  1658.        move.b  (a3,d2),d3
  1659.        tst.b   d3
  1660.        beq     _rts    ;Nothing here!  Just get to an RTS, any RTS.
  1661.        move.l  d0,-(sp)     ;<\
  1662.        move    #4,d0        ;  \
  1663.        cmp.b   #5,d3        ;   \
  1664.        bge     NB1b         ;    \
  1665.        clr.b   d3           ;     \
  1666.        move    #1,d0        ;      Stack Stuff!  Keep Together!!
  1667.        bra     NB1          ;     /
  1668. NB1b:  tst     Got_Brick    ;    /     (playing a sound)
  1669.        bne     NB1a         ;   /
  1670. NB1:   bsr     playme       ;  /
  1671. NB1a:  move.l  (sp)+,d0     ;</
  1672.        cmp.b   #5,d3
  1673.        ble     NB2
  1674.        move.b  #3,d3
  1675. NB2:   move.b  d3,(a3,d2)
  1676.        cmp.b   #5,d3
  1677.        beq     ok88
  1678.        move.l  d2,-(sp)
  1679.        move.l  BallSpeed,d2
  1680.        add.l   d2,Score
  1681.        move.l  (sp)+,d2
  1682.        subq.w  #1,BlocksLeft
  1683.        tst.b   d3      ;Multi-hit blocks don't release cyl's.
  1684.        bne     NB3
  1685.        tst.b   cyln
  1686.        bne     NB3
  1687.        move.b  (a4,d2),cyln
  1688.        move.w  ddx,d2
  1689.        mulu    #16,d2
  1690.        move.w  d2,cylx
  1691.        move.w  ddy,d2
  1692.        mulu    #7,d2
  1693.        add.w   #8,d2
  1694.        move.w  d2,cyly
  1695. NB3:   movem.l d0-d7/a0-a6,-(sp)
  1696.        mulu    #4,d3
  1697.        lea     BlockCoords,a0
  1698.        move.w  0(a0,d3),d0
  1699.        move.w  2(a0,d3),d1
  1700.        move.w  ddx,d2
  1701.        mulu    #16,d2
  1702.        move.w  ddy,d3
  1703.        mulu    #7,d3
  1704.        add.w   #8,d3
  1705.        move.l  bit2map,a0
  1706.        move.l  bit1map,a1
  1707.        move.w  #16,d4
  1708.        move.w  #7,d5
  1709.        move.l  #$c0,d6
  1710.        move.l  #$ff,d7
  1711.        move.l  gfxbase,a6
  1712.        jsr     _LVOBltBitMap(a6)  ;erase block, or put new one in place
  1713.        bsr     ShowScore          ;show new score
  1714.        movem.l (sp)+,d0-d7/a0-a6
  1715. ok88:  clr.l   d3
  1716.        move    Got_Brick,d3  ;Should we tell main prog we hit a
  1717.        xor     #1,d3         ;block?  Not if we have Brickthrough!!
  1718.        tst     d3
  1719.        rts
  1720. ok8:   move    #0,d3
  1721.        tst     d3
  1722.        rts
  1723. PrtNum:            ;PRTNUM -> ;Convert word integer to printable ASCII.
  1724.        move.l  #10000,d1      ;d0 = word to convert
  1725. Prt2:  divu    d1,d0          ;a5 = pointer to ASCII text buffer
  1726.        add     #$30,d0                        ;(i.e. TexBuf)
  1727.        move.b  d0,(a5)+
  1728.        clr     d0             ;d1 will be erased and used as scratch
  1729.        swap    d0
  1730.        divu    #10,d1         ;Leading zeros will be output:
  1731.        tst     d1             ; so $00A0 becomes 00160, etc.
  1732.        bne     Prt2
  1733.        rts                    ;End of PrtNum!  Now that didn't hurt,
  1734. ShowScore:                    ;did it?
  1735.        move.l  Score,d0
  1736.        lea     TexBuf,a5
  1737.        move.l  #' Sco',(a5)+  ;It says, " Score: ".
  1738.        move.l  #'re: ',(a5)+  ;Isn't this CUTE????
  1739.        bsr     PrtNum
  1740.        move.b  #' ',(a5)+
  1741.        move.l  #' Liv',(a5)+  ;Guess what it says now!
  1742.        move.l  #'es: ',(a5)+
  1743.        clr.l   d0
  1744.        move.w  LivesLeft,d0
  1745.        move.l  #10,d1
  1746.        bsr     Prt2
  1747.        move.l  Rast,a1
  1748.        clr.l   d0
  1749.        move.l  #7,d1
  1750.        move.l  gfxbase,a6
  1751.        jsr     _LVOMove(a6)
  1752.        move.l  #24,d0
  1753.        lea     TexBuf,a0
  1754.        move.l  Rast,a1
  1755.        jsr     _LVOText(a6)    ;show the dude his score.
  1756.        rts
  1757. DrawCyl:
  1758.        movem.l d0-d7/a0-a6,-(sp)
  1759.        clr.l   d0
  1760.        clr.l   d1       ;show one of these bonus thingies.
  1761.        clr.l   d2
  1762.        clr.l   d3
  1763.        clr.l   d4
  1764.        move.w  cylx,d2
  1765.        move.w  cyly,d3
  1766.        subq.w  #1,d3
  1767.        move.b  cyln,d4
  1768.        lea     BonusCoords,a5
  1769.        mulu    #4,d4
  1770.        move.w  (a5,d4),d0
  1771.        move.w  2(a5,d4),d1
  1772.        subq.w  #1,d1
  1773.        tst     You_Looped
  1774.        beq     NoQues
  1775.        cmp     #1,You_Looped
  1776.        bgt     Ques
  1777.        cmp     #155,cyly
  1778.        bgt     NoQues
  1779. Ques:  move    #243,d0     ;silly goofy <?> cyl.
  1780.        move    #131,d1
  1781. NoQues:move.l  bit3map,a0
  1782.        move.l  bit1map,a1
  1783.        move.l  #16,d4
  1784.        move.l  #15,d5   ;Cyl must be drawn at cyly - 1.
  1785.        move.l  #$c0,d6    ;(so it can erase its tracks!)
  1786.        move.l  #$ff,d7
  1787.        move.l  gfxbase,a6
  1788.        jsr     _LVOBltBitMap(a6) ;draw it.
  1789.        clr.l   d2
  1790.        clr.l   d3
  1791.        move.w  cyly,d3
  1792.        sub.w   #16,d3  ;8 above: 7 for block, 1 for erase line.
  1793.        divu    #7,d3
  1794.        swap    d3
  1795.        tst     d3
  1796.        bne     NoRedr
  1797.        swap    d3
  1798.        cmp     #21,d3
  1799.        bgt     NoRedr
  1800.        mulu    #20,d3       ;If cyl passes over a block, we
  1801.        move.w  cylx,d2      ;must find out what was there
  1802.        divu    #16,d2       ;and put it back.
  1803.        and.l   #$ffff,d2
  1804.        add.l   d3,d2
  1805.        move.l  #BoardList,d3
  1806.        add.w   CurrentBoard,d3
  1807.        move.l  d3,a3
  1808.        move.l  (a3),d3
  1809.        add.l   P2Offset,d3
  1810.        move.l  d3,a3
  1811.        clr.l   d3
  1812.        move.b  (a3,d2),d3
  1813.        tst.b   d3
  1814.        beq     NoRedr
  1815.        mulu    #4,d3
  1816.        lea     BlockCoords,a0
  1817.        move.w  (a0,d3),d0
  1818.        move.w  2(a0,d3),d1
  1819.        move.w  cylx,d2
  1820.        move.w  cyly,d3
  1821.        subq.w  #8,d3
  1822.        move.l  bit2map,a0
  1823.        move.l  bit1map,a1
  1824.        move.w  #16,d4
  1825.        move.w  #7,d5
  1826.        move.l  #$c0,d6
  1827.        move.l  #$ff,d7
  1828.        jsr     _LVOBltBitMap(a6)  ;we found out, now draw it!
  1829. NoRedr:movem.l (sp)+,d0-d7/a0-a6
  1830.        rts
  1831. EraseCyl:
  1832.        movem.l d0-d7/a0-a6,-(sp)
  1833.        clr.l   d2
  1834.        clr.l   d3
  1835.        move.w  cylx,d2         ;get rid of an un-needed cyl
  1836.        move.w  cyly,d3         ;from screen.
  1837.        move.l  #142,d0
  1838.        move.l  #154,d1
  1839.        move.l  bit3map,a0
  1840.        move.l  bit1map,a1
  1841.        move.l  #16,d4
  1842.        move.l  #14,d5
  1843.        move.l  #$c0,d6
  1844.        move.l  #$ff,d7
  1845.        move.l  gfxbase,a6
  1846.        jsr     _LVOBltBitMap(a6)
  1847.        movem.l (sp)+,d0-d7/a0-a6
  1848.        rts
  1849. AbortGame:
  1850.        clr     LivesLeft
  1851. SelfDest:
  1852.        move    #5,d0
  1853.        bsr     Playme  ;Boy, do I love this sound effect!
  1854.        bra     YDNS
  1855. YourDead:
  1856.        move    #2,d0
  1857.        bsr     playme
  1858. YDNS:  move.l  #183,d3
  1859.        clr.l   d2
  1860.        clr.l   d4
  1861.        move.w  PaddleX,d2
  1862.        move.w  #320,d1
  1863.        sub.w   Paddle_Size,d1
  1864.        cmp.w   d1,d2
  1865.        ble     Yup2
  1866.        move.w  d1,d2
  1867. Yup2:  move.l  bit2map,a0
  1868.        move.l  bit1map,a1
  1869.        move.l  #17,d0
  1870.        move.l  #34,d1
  1871.        move.w  Paddle_Size,d4
  1872.        move.l  #15,d5
  1873.        move.l  #$c0,d6
  1874.        move.l  #$ff,d7
  1875.        move.l  gfxbase,a6
  1876.        jsr     _LVOBltBitMap(a6) ;erase you!
  1877.        move.l  #183,d3
  1878.        move.l  Rast,a0
  1879.        move.l  screenhd,a5
  1880.        move.w  $12(a5),d2
  1881.        mulu    #279,d2
  1882.        divu    #319,d2
  1883.        move.w  d2,PaddleX
  1884.        bsr     WarpOut
  1885.        cmp.w   #0,LivesLeft
  1886.        beq     GameOver
  1887.        subq.w  #1,LivesLeft
  1888.        move.w  DeathRecover,CurrentBoard
  1889.        subq    #1,d1
  1890.        subq    #2,d3
  1891.        addq    #2,d5
  1892. BlowEmUpRealGood:     ;He blew up.  Yeah, he blew up good.  Yeah, he
  1893.        addq    #1,d3  ;blew up REAL GOOD!!!!
  1894.        subq    #1,d5
  1895.        movem.l d0-d7,-(sp)
  1896.        lea     devio,a1
  1897.        move.l  EBase,a6
  1898.        jsr     _LVOWaitIO(a6)
  1899.        lea     devio,a1
  1900.        move.w  #$9,Tm_Cmd
  1901.        move.l  #0,secs
  1902.        move.l  #16667,msecs
  1903.        move.l  #readreply,port
  1904.        move.w  #40,Tm_Length
  1905.        move.w  #0,io
  1906.        jsr     _LVOSendIO(a6)
  1907.        move.l  bit3map,a0
  1908.        move.l  bit1map,a1
  1909.        move.l  gfxbase,a6
  1910.        move.l  a7,a5          ;Check this move out.  I peek at
  1911.        movem.l (a5)+,d0-d7    ;what's on the stack without touching it!
  1912.        jsr     _LVOBltBitMap(a6)   ;<=- and now I'm blowing you up!
  1913.        movem.l (sp)+,d0-d7
  1914.        cmp     #1,d5
  1915.        bgt     BlowEmUpRealGood
  1916.        bsr     FadeOut
  1917.        jmp     DrawBoard
  1918. GameOver:                  ;You be dead.
  1919.        lea     devio,a1
  1920.        move.l  EBase,a6
  1921.        jsr     _LVOWaitIO(a6)
  1922.        lea     devio,a1
  1923.        move.w  #$9,Tm_Cmd
  1924.        move.l  #2,secs      ;Ending seconds.
  1925.        move.l  #0,msecs
  1926.        move.l  #readreply,port
  1927.        move.w  #40,Tm_Length
  1928.        move.w  #0,io
  1929.        move.l  EBase,a6
  1930.        jsr     _LVOSendIO(a6)
  1931.        lea     devio,a1
  1932.        move.l  EBase,a6
  1933.        jsr     _LVOWaitIO(a6)  ;wait for 'em.
  1934.        lea     devio,a1
  1935.        move.w  #$9,Tm_Cmd
  1936.        move.l  #0,secs      ;reset timer.
  1937.        move.l  #16667,msecs
  1938.        move.l  #readreply,port
  1939.        move.w  #40,Tm_Length
  1940.        move.w  #0,io
  1941.        move.l  EBase,a6
  1942.        jsr     _LVOSendIO(a6)
  1943.        bsr     FadeOut
  1944.        subq    #1,LivesLeft
  1945.        tst     LivesLeft2
  1946.        bge     DrawBoard
  1947.        bra     EOGmessage
  1948. WarpOut:                 ;WarpOut, i.e. BOOM!
  1949.        lea     WarpOutList,a5
  1950. WarpOutLoop:
  1951.        lea     devio,a1
  1952.        move.l  EBase,a6
  1953.        jsr     _LVOWaitIO(a6)
  1954.        lea     devio,a1
  1955.        move.w  #$9,Tm_Cmd
  1956.        move.l  #0,secs
  1957.        move.l  #66668,msecs     ;Warp-out speed.
  1958.        move.l  #readreply,port
  1959.        move.w  #40,Tm_Length
  1960.        move.w  #0,io
  1961.        move.l  EBase,a6
  1962.        jsr     _LVOSendIO(a6)
  1963.        clr.l   d2
  1964.        move.w  PaddleX,d2
  1965.        move.l  bit3map,a0
  1966.        move.l  bit1map,a1
  1967.        clr.l   d0
  1968.        clr.l   d1
  1969.        clr.l   d4
  1970.        clr.l   d5
  1971.        move.w  (a5)+,d0  ;src x
  1972.        move.w  (a5)+,d1  ;src y
  1973.        move.w  (a5)+,d4  ;size x
  1974.        move.w  (a5)+,d5  ;size y
  1975.        move.l  d4,d6
  1976.        sub.w   #40,d6
  1977.        divu    #2,d6
  1978.        move.l  #198,d3
  1979.        sub.w   d5,d3
  1980.        sub.w   d6,d2
  1981.        btst    #15,d2
  1982.        beq     Out2ok
  1983.        clr.l   d2
  1984. Out2ok:move.l  #320,d7
  1985.        sub.w   d4,d7
  1986.        cmp.w   d7,d2
  1987.        blt     Out1ok
  1988.        move.l  d7,d2
  1989. Out1ok:move.l  #$c0,d6
  1990.        move.l  #$ff,d7
  1991.        move.l  gfxbase,a6
  1992.        movem.l d0-d7,-(sp)
  1993.        jsr     _LVOBltBitMap(a6)  ;some nice flames on the screen
  1994.        move.l  a5,d0
  1995.        clr.l   d1
  1996.        move    LivesLeft,d1
  1997.        cmp     #4,d1
  1998.        ble     ZipZip
  1999.        move    #6,d1
  2000. ZipZip:mulu    #8,d1
  2001.        add.l   d1,d0
  2002.        move.l  d0,a4
  2003.        movem.l (sp)+,d0-d7
  2004.        cmp.l   #end_out_list,a4
  2005.        bne     WarpOutLoop
  2006.        rts
  2007. fixpaddle:                ;move and redraw paddle
  2008.        move.l  #183,d3
  2009.        clr.l   d2
  2010.        clr.l   d4
  2011.        move.w  PaddleX,d2
  2012.        move.w  #320,d1
  2013.        sub.w   Paddle_Size,d1
  2014.        cmp.w   d1,d2
  2015.        ble     Yup
  2016.        move.w  d1,d2
  2017. Yup:   move.l  bit2map,a0
  2018.        move.l  bit1map,a1
  2019.        move.l  #17,d0
  2020.        move.l  #34,d1
  2021.        move.w  Paddle_Size,d4
  2022.        move.l  #15,d5
  2023.        move.l  #$c0,d6
  2024.        move.l  #$ff,d7
  2025.        move.l  gfxbase,a6
  2026.        jsr     _LVOBltBitMap(a6)  ;erase old paddle
  2027.        move.l  #183,d3
  2028.        move.l  Rast,a0
  2029.        move.l  screenhd,a5
  2030.        move.w  $12(a5),d2
  2031.        move.w  #320,d1
  2032.        sub.w   Paddle_Size,d1
  2033.        mulu    d1,d2
  2034.        divu    #319,d2
  2035.        move.w  d2,PaddleX
  2036.        move.l  bit2map,a0
  2037.        move.l  bit1map,a1
  2038.        clr.l   d4                 ;computing new position
  2039.        move.l  #269,d0
  2040.        move.l  #88,d1
  2041.        cmp.w   #1,Got_Expand
  2042.        bne     NoE1
  2043.        move.w  #182,d0
  2044. NoE1:  cmp.w   #2,Got_Expand
  2045.        bne     NoE2
  2046.        move.w  #10,d0
  2047. NoE2:  tst     Got_Laser
  2048.        beq     NoLas
  2049.        move.w  #138,d1
  2050. NoLas: cmp.w   #-1,Stuck
  2051.        beq     NoCach
  2052.        sub.w   #16,d1
  2053. NoCach:move.w  Paddle_Size,d4
  2054.        move.l  #15,d5
  2055.        move.l  #$c0,d6
  2056.        move.l  #$ff,d7
  2057.        jsr     _LVOBltBitMap(a6)  ;draw new paddle
  2058.        cmp.w   #-1,Stuck
  2059.        beq     loop
  2060.        move.l  ViewPort,a0
  2061.        lea     ballsprite,a1
  2062.        clr.l   d0
  2063.        move.w  PaddleX,d0
  2064.        add.w   Stuck,d0
  2065.        move.l  #186,d1
  2066.        jsr     _LVOMoveSprite(a6)  ;move ball, if stuck to paddle
  2067.        bra     loop
  2068. FadeInGrey:
  2069.        move.l  #$0,d7      ;Now:  some fading routines!
  2070.        move.l  #1,d6
  2071.        move    #$333,d5
  2072.        move    #$d,a5
  2073.        bra     FO1
  2074. FadeOutGrey:
  2075.        move.l  #$c,d7
  2076.        move.l  #-1,d6
  2077.        move    #$333,d5
  2078.        move.l  #-1,a5
  2079.        bra     FO1
  2080. FadeIn:
  2081.        move.l  #$0,d7
  2082.        move.l  #1,d6
  2083.        clr     d5
  2084.        move    #$10,a5
  2085.        bra     FO1
  2086. FadeOut:
  2087.        move.l  #$f,d7
  2088.        move.l  #-1,d6
  2089.        clr     d5
  2090.        move.l  #-1,a5
  2091. FO1:   lea     ctable,a3
  2092.        lea     ftable,a4
  2093.        move    (a3)+,(a4)+  ;Leave color 0 alone.
  2094. FO2:   move    (a3)+,d2
  2095.        move    d2,d1
  2096.        move    d1,d0
  2097.        and     #$00f,d0
  2098.        and     #$0f0,d1
  2099.        and     #$f00,d2
  2100.        mulu    d7,d0
  2101.        divu    #$f,d0
  2102.        mulu    d7,d1
  2103.        divu    #$f,d1
  2104.        mulu    d7,d2
  2105.        divu    #$f,d2
  2106.        and     #$00f,d0
  2107.        and     #$0f0,d1
  2108.        and     #$f00,d2
  2109.        or      d0,d1
  2110.        or      d1,d2
  2111.        add     d5,d2
  2112.        move    d2,(a4)+
  2113.        cmp.l   #ftable+64,a4
  2114.        bne     FO2
  2115.        move.l  gfxbase,a6
  2116.        move.l  #32,d0
  2117.        move.l  ViewPort,a0
  2118.        lea     ftable,a1
  2119.        jsr     _LVOLoadRGB4(a6)  ;Fade away!
  2120.        lea     devio,a1
  2121.        move.l  EBase,a6
  2122.        jsr     _LVOWaitIO(a6)
  2123.        lea     devio,a1
  2124.        move.w  #$9,Tm_Cmd
  2125.        move.l  #0,secs
  2126.        move.l  #50001,msecs     ;Fade in/out speed.
  2127.        move.l  #readreply,port
  2128.        move.w  #40,Tm_Length
  2129.        move.w  #0,io
  2130.        move.l  EBase,a6
  2131.        jsr     _LVOSendIO(a6)
  2132.        add     d6,d7
  2133.        cmp     d7,a5
  2134.        bne     FO1
  2135.        rts
  2136. playme:                            ;Sound # in d0
  2137.        movem.l d0/d1/a0-a2/a6,-(sp)
  2138.        cmp     #-1,d0
  2139.        beq     FirstAudio        ;Main sound-playing routine
  2140.        move    d0,-(sp)
  2141.        mulu    #2,d0
  2142.        lea     sVoiceTable,a0           ;find out which voice for sound
  2143.        move    (a0,d0),d0
  2144.        mulu    #68,d0
  2145.        lea     othermessages,a2
  2146.        add.l   d0,a2
  2147.        move.l  EBase,a6
  2148.        tst     Self_Sound
  2149.        bne     WSS
  2150.        move.l  a2,a1
  2151.        jsr     _LVOAbortIO(a6)
  2152. WSS:   move.l  a2,a1
  2153.        jsr     _LVOWaitIO(a6)
  2154.        move    (sp)+,d0
  2155.        bra     AudOK
  2156. FirstAudio:
  2157.        move.l  #68,d0   ;68*4/4=68
  2158.        lea     othermessages,a2
  2159. Fab:   clr.l   (a2)+
  2160.        dbra    d0,Fab;ulous
  2161.        lea     Message,a2
  2162.        move    #3,d0
  2163. AudOK: move.w  #CMD_WRITE,Aud_Cmd-Message(a2)
  2164.        move.b  #ADIOF_PERVOL,Aud_Flags-Message(a2)
  2165.        clr     Self_Sound
  2166.        cmp     #5,d0
  2167.        bne     NSSS
  2168.        move    #1,Self_Sound
  2169. NSSS:  mulu    #4,d0
  2170.        lea     saddrTable,a0            ;find sound's address
  2171.        move.l  (a0,d0),34(a2)    ;AData
  2172.        lea     slenTable,a0             ;find sound's length
  2173.        move.l  (a0,d0),d1
  2174.        bclr    #0,d1                    ;(fix length if odd!)
  2175.        move.l  d1,38(a2)         ;Aud_Length
  2176.        lea     sperTable,a0             ;find sound's period
  2177.        lsr     #1,d0
  2178.        move.w  (a0,d0),42(a2)    ;Period
  2179.        lea     Message,a0
  2180.        cmp.l   a0,a2
  2181.        beq     All4
  2182.        move.l  a2,a1
  2183.        move.l  Device,a6
  2184.        jsr     -30(a6)    ;DEV_BEGINIO     Play it!
  2185. PD:    movem.l (sp)+,d0/d1/a0-a2/a6
  2186.        rts
  2187. All4:  move.l  d2,-(sp)
  2188.        move.l  #3,d2
  2189. All4b: move    d2,d0
  2190.        move.l  #1,d1
  2191.        lsl     d0,d1
  2192.        move.l  d1,Unit
  2193.        move    d0,d1
  2194.        mulu    #68,d0
  2195.        lea     othermessages,a2
  2196.        add.l   d0,a2
  2197.        mulu    #64,d1
  2198.        lea     MsgPort,a0
  2199.        add.l   d1,a0          ;initial sound needs more init stuff
  2200.        move.l  a0,14(a2)
  2201.        add.l   #256,a0
  2202.        move.l  a0,-(sp)
  2203.        lea     Message,a0
  2204.        move.l  a2,a1
  2205.        add.l   #20,a0
  2206.        add.l   #20,a1
  2207.        move.l  #48,d0
  2208.        move.l  EBase,a6
  2209.        jsr     _LVOCopyMem(a6)
  2210.        move.l  (sp)+,a0
  2211.        move.l  a0,62(a2)
  2212.        move.l  a2,a1
  2213.        move.l  Device,a6
  2214.        jsr     -30(a6)    ;DEV_BEGINIO
  2215.        dbra    d2,All4b
  2216.        move.l  (sp)+,d2
  2217.        bra     PD
  2218. opendos:
  2219.        move.l  EBase,a6
  2220.        lea     dosname,a1
  2221.        move.l  #0,d0
  2222.        jsr     _LVOopenlibrary(a6)  ;open dos.library
  2223.        move.l  d0,dosbase
  2224.        tst.l   d0
  2225.        rts
  2226. closedos:
  2227.        move.l  EBase,a6
  2228.        move.l  dosbase,a1
  2229.        jsr     _LVOcloselibrary(a6) ;close dos.library
  2230.        rts
  2231. openint:
  2232.        move.l  EBase,a6
  2233.        lea     intname,a1
  2234.        move.l  #0,d0
  2235.        jsr     _LVOopenlibrary(a6)  ;open intuition.library
  2236.        move.l  d0,intbase
  2237.        tst.l   d0
  2238.        rts
  2239. closeint:
  2240.        move.l  EBase,a6
  2241.        move.l  intbase,a1
  2242.        jsr     _LVOcloselibrary(a6) ;close intuition.library
  2243.        rts
  2244. opengfx:
  2245.        move.l  EBase,a6
  2246.        lea     gfxname,a1
  2247.        move.l  #0,d0
  2248.        jsr     _LVOopenlibrary(a6)  ;open graphics.library
  2249.        move.l  d0,gfxbase
  2250.        tst.l   d0
  2251.        rts
  2252. closegfx:
  2253.        move.l  EBase,a6
  2254.        move.l  gfxbase,a1
  2255.        jsr     _LVOcloselibrary(a6) ;close graphics.library
  2256.        rts
  2257. opendiskfont:
  2258.        move.l  EBase,a6
  2259.        lea     DiskFontName,a1
  2260.        move.l  #0,d0
  2261.        jsr     _LVOopenlibrary(a6)  ;open diskfont.library
  2262.        move.l  d0,fontbase
  2263.        tst.l   d0
  2264.        rts
  2265. closediskfont:
  2266.        move.l  EBase,a6
  2267.        move.l  fontbase,a1
  2268.        jsr     _LVOcloselibrary(a6) ;close diskfont.library
  2269.        rts
  2270. openiff:
  2271.        move.l  EBase,a6
  2272.        lea     iffname,a1
  2273.        move.l  #0,d0
  2274.        jsr     _LVOopenlibrary(a6)  ;open iff.library
  2275.        move.l  d0,iffbase
  2276.        tst.l   d0
  2277.        bne     _rts
  2278.        move.l  #no_iff,ErrPtr
  2279.        tst.l   d0
  2280. _rts:  rts
  2281. closeiff:
  2282.        move.l  EBase,a6
  2283.        move.l  iffbase,a1
  2284.        jsr     _LVOcloselibrary(a6) ;close iff.library
  2285.        rts
  2286. LoadScores:
  2287.        move.l  dosbase,a6
  2288.        move.l  #ScoreName,d1
  2289.        move.l  #MODE_OLD,d2
  2290.        jsr     _LVOOpen(a6)
  2291.        move.l  d0,scorehd
  2292.        tst.l   d0
  2293.        beq     _rts
  2294.        move.l  #end_ScoreList-ScoreList,d3
  2295.        move.l  #ScoreList,d2
  2296.        move.l  d0,d1
  2297.        jsr     _LVORead(a6)      ;Load high score list, if available
  2298.        move.l  scorehd,d1
  2299.        jsr     _LVOClose(a6)
  2300.        rts
  2301. SaveScores:
  2302.        move.l  dosbase,a6
  2303.        move.l  #ScoreName,d1
  2304.        move.l  #MODE_NEW,d2
  2305.        jsr     _LVOOpen(a6)
  2306.        move.l  d0,scorehd
  2307.        tst.l   d0
  2308.        beq     _rts
  2309.        move.l  #end_ScoreList-ScoreList,d3
  2310.        move.l  #ScoreList,d2
  2311.        move.l  d0,d1
  2312.        jsr     _LVOWrite(a6)   ;try to save high score list
  2313.        move.l  scorehd,d1
  2314.        jsr     _LVOClose(a6)
  2315.        rts
  2316. openpic:                  ;pic name must be in a0!
  2317.        move.l  iffbase,a6
  2318.        move.l  #pic,d0
  2319.        move.l  d0,pichd
  2320.        cmp.l   #pic2name,a0
  2321.        bne     GetCol
  2322.        move.l  #pic2,d0
  2323.        move.l  d0,pichd
  2324. ;       jsr     _LVOOpenIFF(a6)    ;Old stuff from when
  2325. ;       move.l  d0,pichd           ;the two IFFs were separate
  2326. ;       tst.l   d0                 ;files on the disk
  2327. ;       bne     GetCol
  2328. ;       move.l  #no_pic,ErrPtr
  2329. ;       bra     IffError
  2330. GetCol:lea     ctable,a0
  2331.        move.l  d0,a1
  2332.        jsr     _LVOGetColorTab(a6)
  2333.        tst.l   d0
  2334.        bne     _rts
  2335.        move.l  #no_color,ErrPtr
  2336.        bra     IffError
  2337. closepic:
  2338. ;       move.l  pichd,a1           ;more of the same
  2339. ;       move.l  iffbase,a6
  2340. ;       jsr     _LVOCloseIFF(a6)
  2341.        rts
  2342. pic2plane:                ;screenhd must be in d0!
  2343.        move.l  pichd,a1
  2344.        add.l   #184,d0
  2345.        move.l  d0,a0
  2346.        move.l  iffbase,a6
  2347.        jsr     _LVODecodePic(a6)
  2348.        tst.l   d0
  2349.        bne     _rts
  2350.        move.l  #no_decode,ErrPtr
  2351.        bra     IffError
  2352. IFFerror:
  2353.        move.l  iffbase,a6
  2354.        jsr     _LVOIffError(a6)
  2355. sorrybud:
  2356.        move.l  #0,d1
  2357.        tst.l   d1
  2358.        rts
  2359. openscreen:                 ;handle returned in d0.
  2360.        move.l  intbase,a6
  2361.        lea     screendef,a0
  2362.        jsr     _LVOOpenScreen(a6)
  2363.        tst.l   d0
  2364.        bne     _rts
  2365.        move.l  #no_screen,ErrPtr
  2366.        tst.l   d0
  2367.        rts
  2368. closescreen:                ;put handle in a0.
  2369.        move.l  intbase,a6
  2370.        jsr     _LVOCloseScreen(a6)
  2371.        rts
  2372. Errwindopen:
  2373.        move.l  intbase,a6
  2374.        lea     Errwinddef,a0
  2375.        jsr     _LVOopenwindow(a6)   ;make my error window.
  2376.        move.l  d0,windowhd
  2377.        tst.l   d0
  2378.        rts
  2379. windopen:
  2380.        move.l  intbase,a6
  2381.        lea     windowdef,a0
  2382.        jsr     _LVOopenwindow(a6)   ;make my window.
  2383.        move.l  d0,windowhd
  2384.        tst.l   d0
  2385.        bne     _rts
  2386.        move.l  #no_window,ErrPtr
  2387.        tst.l   d0
  2388.        rts
  2389. windclose:
  2390.        move.l  intbase,a6
  2391.        move.l  windowhd,a0
  2392.        jsr     _LVOclosewindow(a6)  ;close it.
  2393.        rts
  2394.  
  2395.        ;DATA section!!    (Still part of code hunk, because
  2396.        ;                   the data hunk goes in CHIP RAM!!)
  2397. timename:
  2398.        dc.b    'timer.device',0
  2399.        align
  2400. audname:
  2401.        dc.b    'audio.device',0
  2402.        align
  2403. Event:
  2404.        dc.b    0
  2405.        align
  2406. devio:
  2407.        dc.l    devio,devio
  2408.        dc.b    $20,0
  2409.        dc.l    0
  2410. port:
  2411.        dc.l    0
  2412. Tm_Length:
  2413.        dc.w    0
  2414.        dc.l    0,0  ;device,unit
  2415. Tm_Cmd:
  2416.        dc.w    0
  2417. io:
  2418.        dc.b    0,0
  2419. secs:
  2420.        dc.l    0
  2421. msecs:
  2422.        dc.l    0
  2423. readreply:
  2424.        blk.l   16,0
  2425. saddrTable:
  2426.        dc.l    s_Catch,s_Brick1,s_Exp1,s_WarpIn,s_Dink,s_ShiftQ
  2427.        dc.l    s_CylCatch1,s_Piew2,s_Bonk,s_Dink,s_Piew
  2428. slenTable:
  2429.        dc.l    ends_Catch-s_Catch,ends_Brick1-s_Brick1,ends_Exp1-s_Exp1
  2430.        dc.l    ends_WarpIn-s_WarpIn,ends_Dink-s_Dink
  2431.        dc.l    ends_ShiftQ-s_ShiftQ,ends_CylCatch1-s_CylCatch1
  2432.        dc.l    ends_Piew2-s_Piew2,ends_Bonk-s_Bonk,ends_Dink-s_Dink
  2433.        dc.l    ends_Piew-s_Piew
  2434. sperTable:   ;3579546/Saples_per_sec
  2435.        dc.w    167,334,428,428,428,390,214,600,334,284,214
  2436. sVoiceTable:
  2437.        dc.w    3,0,2,2,0,2,1,3,3,0,3    ;Voice Choice Table
  2438. CombOps:
  2439.        dc.b    15,0
  2440. Signal:
  2441.        dc.l    0
  2442. MsgPort:
  2443.        blk.b   15,0
  2444. MsgSig:
  2445.        dc.b    0
  2446. MyTask:
  2447.        blk.b   48,0
  2448. otherports:
  2449.        blk.b   64*7,0
  2450. Message:
  2451.        dc.l    0,0
  2452.        dc.b    $20,0
  2453.        dc.l    0
  2454.        dc.l    MsgPort
  2455. MsgLn: dc.w    68       ;Length
  2456. Device:
  2457.        dc.l    0
  2458. Unit:
  2459.        dc.l    0
  2460. Aud_Cmd:
  2461.        dc.w    0
  2462. Aud_Flags:
  2463.        dc.b    0
  2464. Aud_Error:
  2465.        dc.b    0
  2466. AllocKey:
  2467.        dc.w    0
  2468. AData:
  2469.        dc.l    0  ;body of sound
  2470. Aud_Length:
  2471.        dc.l    0  ;length of sound in bytes
  2472. Period:
  2473.        dc.w    0  ;period of sound
  2474. Volume:
  2475.        dc.w    64
  2476. Cycles:
  2477.        dc.w    1
  2478. WriteMsg:
  2479.        dc.l    0,0
  2480.        dc.b    0,0
  2481.        dc.l    0
  2482.        dc.l    otherports+192
  2483.        dc.w    20
  2484. screendef:
  2485.        dc.w    0,0,320,200,5
  2486.        dc.b    3,2
  2487.        dc.w    $2,15
  2488.        dc.l    0,title,0,0
  2489. windowdef:
  2490.        dc.w    0,0,320,200
  2491.        dc.b    0,1
  2492.        dc.l    $780018,$4031B40,0,0,0  ;Flag $40 = SIMPLE_REFRESH.
  2493. screenhd:dc.l  0,0
  2494.        dc.w    0,0,0,0,15     ;rest of windowdef
  2495. Errwinddef:
  2496.        dc.w    50,90,500,10
  2497.        dc.b    3,2
  2498.        dc.l    $200,$100e,0,0
  2499. ErrPtr:dc.l    0,0,0
  2500.        dc.w    0,0,0,0,1   ;rest of Errwinddef
  2501. no_iff:
  2502.        dc.b    "Error: Can't find LIBS:iff.library",0
  2503. no_pic:
  2504.        dc.b    "Error: Can't load BALL1.IFF & BALL2.IFF",0
  2505. no_sprites:
  2506.        dc.b    "Error: Can't allocate three sprites.",0
  2507. no_decode:
  2508.        dc.b    'Error: DecodePic() failed, IFF is invalid.',0
  2509. no_color:
  2510.        dc.b    'Error: GetColorTab() failed, IFF is invalid.',0
  2511. no_audio:
  2512.        dc.b    "Error: Can't open audio.device",0
  2513. no_screen:
  2514.        dc.b    "Error: Can't open custom screen",0
  2515. no_window:
  2516.        dc.b    "Error: Can't open main window",0
  2517. ScrMsg:
  2518.        dc.b    'WOW!  What a score!!  Type your name:'
  2519. end_ScrMsg:
  2520.        align
  2521. title:
  2522.        dc.b    '  >> BALL <<  by Ed Mackey',0
  2523.        align
  2524. title2:
  2525.        dc.b    '                     by Ed Mackey'
  2526. end_title2:
  2527.        align
  2528. instr:
  2529.        dc.b    ' Press mousebutton for one player,'
  2530. end_instr:
  2531.        align
  2532. instr2:
  2533.        dc.b    ' "2" for two, or SHIFT-Q to exit.'
  2534. end_instr2:
  2535.        align
  2536. Al:
  2537.        dc.b    '   Graphics by Al Mackey.'
  2538. end_Al:
  2539.        align
  2540. BonusDescribe:
  2541.        dc.b    12,0,1,0
  2542.        dc.w    0,0
  2543.        dc.l    0,asc1,tex2
  2544. asc1:
  2545.        dc.b    'Slow ball',0
  2546.        align
  2547. tex2:
  2548.        dc.b    9,0,1,0
  2549.        dc.w    160,0
  2550.        dc.l    0,asc2,tex3
  2551. asc2:
  2552.        dc.b    'Kill (you)',0
  2553.        align
  2554. tex3:
  2555.        dc.b    12,0,1,0
  2556.        dc.w    0,15
  2557.        dc.l    0,asc3,tex4
  2558. asc3:
  2559.        dc.b    'Next board',0
  2560.        align
  2561. tex4:
  2562.        dc.b    12,0,1,0
  2563.        dc.w    160,15
  2564.        dc.l    0,asc4,tex5
  2565. asc4:
  2566.        dc.b    'Free life',0
  2567.        align
  2568. tex5:
  2569.        dc.b    12,0,1,0
  2570.        dc.w    0,30
  2571.        dc.l    0,asc5,tex6
  2572. asc5:
  2573.        dc.b    'Lasers',0
  2574.        align
  2575. tex6:
  2576.        dc.b    26,0,1,0
  2577.        dc.w    160,30
  2578.        dc.l    0,asc6,tex7
  2579. asc6:
  2580.        dc.b    'Expand paddle',0
  2581.        align
  2582. tex7:
  2583.        dc.b    9,0,1,0
  2584.        dc.w    0,45
  2585.        dc.l    0,asc7,tex8
  2586. asc7:
  2587.        dc.b    'Gravity ball',0
  2588.        align
  2589. tex8:
  2590.        dc.b    12,0,1,0
  2591.        dc.w    160,45
  2592.        dc.l    0,asc8,tex9
  2593. asc8:
  2594.        dc.b    'Brickthrough',0
  2595.        align
  2596. tex9:
  2597.        dc.b    12,0,1,0
  2598.        dc.w    0,60
  2599.        dc.l    0,asc9,tex10
  2600. asc9:
  2601.        dc.b    'Catch ball',0
  2602.        align
  2603. tex10:
  2604.        dc.b    12,0,1,0
  2605.        dc.w    160,60
  2606.        dc.l    0,asc10,0
  2607. asc10:
  2608.        dc.b    'Remove Indestruct',0
  2609.        align
  2610. NameLength = 20     ;Use Cpos for Cursor Position when entering name.
  2611.        dc.w    -1 ;Marks top-of-scorelist.
  2612. ScoreList:
  2613.        dc.b    'BALL                ',0,200
  2614.        dc.b    'BALL    By          ',0,150
  2615.        dc.b    'BALL     Ed         ',0,100
  2616.        dc.b    'BALL      Mackey    ',0,50
  2617.        dc.b    'BALL                ',0,25
  2618.        dc.b    'BALL  Graphics      ',0,0
  2619.        dc.b    'BALL    By          ',0,0
  2620.        dc.b    'BALL     Al         ',0,0
  2621.        dc.b    'BALL      Mackey    ',0,0
  2622.        dc.b    'BALL                ',0,0
  2623.        dc.b    "BALL    Isn't       ",0,0
  2624.        dc.b    'BALL     that       ',0,0
  2625.        dc.b    'BALL      nice?     ',0,0
  2626.        dc.b    'BALL                ',0,0
  2627.        dc.b    'BALL                ',0,0
  2628. end_ScoreList:
  2629. WarpInList:
  2630.        dc.w    8,58, 57,58, 106,58, 154,58, 201,58, 248,58
  2631.        dc.w    8,107, 58,107, 106,107, 157,107, 203,107, 248,107
  2632.        dc.w    11,154, 59,154, 117,154, 179,154, 237,154, 17,34
  2633. end_list:
  2634. WarpOutList:   ;srcX, srcY, sizeX, sizeY
  2635.        dc.w    11,3,41,9, 59,3,41,9, 103,3,41,9, 147,3,41,9
  2636.        dc.w    9,22,56,47, 76,21,137,67, 16,100,137,67
  2637. end_out_list:
  2638. BlockCoords:
  2639.        dc.w    17,34, 206,11, 222,11, 206,18, 222,18
  2640.        dc.w    206,25, 222,25, 17,34
  2641. BonusCoords:
  2642.        dc.w    142,154, 297,102, 297,117, 297,132, 279,102, 279,117
  2643.        dc.w    279,132, 261,102, 261,117, 261,132, 243,117
  2644. end_BonusCoords:
  2645.        dc.w    0    ;Make sure label works.
  2646.  
  2647.        INCLUDE "Boards.include"
  2648.  
  2649. TextAttr:
  2650.        dc.l    FontName
  2651.        dc.w    8
  2652.        dc.b    0,0
  2653. FontName:
  2654.        dc.b    'ball.font',0
  2655.        align
  2656. ScoreName:
  2657.        dc.b    'Ball.scores',0
  2658.        align
  2659. DiskFontName:
  2660.        dc.b    'diskfont.library',0
  2661.        align
  2662. gfxname:
  2663.        dc.b    'graphics.library',0
  2664.        align
  2665. intname:
  2666.        dc.b    'intuition.library',0
  2667.        align
  2668. dosname:
  2669.        dc.b    'dos.library',0
  2670.        align
  2671. iffname:
  2672.        dc.b    'iff.library',0
  2673.        align
  2674. picname:
  2675.        dc.b    'BALL1.IFF',0
  2676.        align
  2677. pic2name:
  2678.        dc.b    'BALL2.IFF',0
  2679.        align
  2680. pic:
  2681.        IBYTES  'BALL1.IFF'
  2682.        align
  2683. pic2:
  2684.        IBYTES  'BALL2.IFF'
  2685.        align
  2686.  
  2687.        DATA    ;This part is all CHIP RAM stuff!!!!
  2688. blkptr:
  2689.        dc.l    0,0
  2690. ballsprite:
  2691.        dc.l    balldat
  2692.        dc.w    4
  2693. sx:    dc.w    0
  2694. sy:    dc.w    0
  2695. spnum: dc.w    -1
  2696. balldat:
  2697.        dc.w    0,0
  2698.        dc.w    %0110000000000000 , %0000000000000000
  2699.        dc.w    %1000000000000000 , %0111000000000000
  2700.        dc.w    %0011000000000000 , %1111000000000000
  2701.        dc.w    %0110000000000000 , %0110000000000000
  2702.        dc.w    0,0,0,0,0,0
  2703. Las1Sprite:
  2704.        dc.l    Las1Dat
  2705.        dc.w    5
  2706. Lasx1: dc.w    0
  2707. Lasy1: dc.w    0
  2708. SpL1n: dc.w    -1
  2709. Las1Dat:
  2710.        dc.w    0,0
  2711.        dc.w    %0100000000000000 , %0100000000000000
  2712.        dc.w    %1010000000000000 , %1110000000000000
  2713.        dc.w    %0100000000000000 , %1010000000000000
  2714.        dc.w    %1010000000000000 , %1110000000000000
  2715.        dc.w    %0100000000000000 , %0100000000000000
  2716.        dc.w    0,0,0,0,0,0
  2717. Las2Sprite:
  2718.        dc.l    Las2Dat
  2719.        dc.w    5
  2720. Lasx2: dc.w    0
  2721. Lasy2: dc.w    0
  2722. SpL2n: dc.w    -1
  2723. Las2Dat:
  2724.        dc.w    0,0
  2725.        dc.w    %0100000000000000 , %0100000000000000
  2726.        dc.w    %1010000000000000 , %1110000000000000
  2727.        dc.w    %0100000000000000 , %1010000000000000
  2728.        dc.w    %1010000000000000 , %1110000000000000
  2729.        dc.w    %0100000000000000 , %0100000000000000
  2730.        dc.w    0,0,0,0,0,0
  2731. s_Catch:
  2732.        IBYTES  'sys:audio/ballsounds/Catch.dump'
  2733. ends_catch:
  2734.        align
  2735. s_Brick1:
  2736.        IBYTES  'sys:audio/ballsounds/Brick1.dump'
  2737. ends_Brick1:
  2738.        align
  2739. s_Exp1:
  2740.        IBYTES  'sys:audio/ballsounds/Exp1.dump'
  2741. ends_Exp1:
  2742.        align
  2743. s_WarpIn:
  2744.        IBYTES  'sys:audio/ballsounds/WarpIn.dump'
  2745. ends_WarpIn:
  2746.        align
  2747. s_Dink:
  2748.        IBYTES  'sys:audio/ballsounds/Dink.dump'
  2749. ends_Dink:
  2750.        align
  2751. s_ShiftQ:
  2752.        IBYTES  'sys:audio/ballsounds/ShiftQ.dump'
  2753. ends_ShiftQ:
  2754.        align
  2755. s_CylCatch1:
  2756.        IBYTES  'sys:audio/ballsounds/CylCatch2.dump'
  2757. ends_CylCatch1:
  2758.        align
  2759. s_Piew2:
  2760.        IBYTES  'sys:audio/ballsounds/Laz-1.dump'
  2761. ends_Piew2:
  2762.        align
  2763. s_Bonk:
  2764.        IBYTES  'sys:audio/ballsounds/Bonk.dump'
  2765. ends_Bonk:
  2766.        align
  2767. s_Piew:
  2768.        IBYTES  'sys:audio/ballsounds/ES2.sd3.dump'
  2769. ends_Piew:
  2770.        align
  2771.  
  2772.        BSS     ;Danger: Uninitialized variable zone!
  2773. ctable:
  2774.        ds.w    64  ;More than required space, just to be sure!
  2775. ftable:
  2776.        ds.w    64
  2777. TexBuf:
  2778.        ds.b    80
  2779. Cpos:
  2780.        ds.w    1
  2781. P2Offset:
  2782.        ds.l    1
  2783. PaddleX:
  2784.        ds.w    1
  2785. CurrentBoard:
  2786.        ds.w    1
  2787. CurrentBoard2:
  2788.        ds.w    1
  2789. DeathRecover:
  2790.        ds.w    1
  2791. PlayerUp:
  2792.        ds.w    1  ;1 = Player 1, 2 = Player 2, 0 = One-Player game.
  2793. Stuck:
  2794.        ds.w    1
  2795. LivesLeft:
  2796.        ds.w    1
  2797. LivesLeft2:
  2798.        ds.w    1
  2799. Score:
  2800.        ds.l    1
  2801. Score2:
  2802.        ds.l    1
  2803. StickCounter:
  2804.        ds.w    1
  2805. BlocksLeft:
  2806.        ds.w    1
  2807. MemBlocksLeft:
  2808.        ds.w    1
  2809. You_Cheated:
  2810.        ds.w    1
  2811. You_Cheated2:
  2812.        ds.w    1
  2813. You_Looped:
  2814.        ds.w    1
  2815. You_Looped2:
  2816.        ds.w    1
  2817. Got_Catch:
  2818.        ds.w    1
  2819. Got_Laser:
  2820.        ds.w    1
  2821. Got_Brick:
  2822.        ds.w    1
  2823. Got_Grav:
  2824.        ds.w    1
  2825. Got_Expand:
  2826.        ds.w    1
  2827. Paddle_Size:
  2828.        ds.w    1
  2829. Mark1:
  2830.        ds.w    1
  2831. Mark2:
  2832.        ds.w    1
  2833. Self_Sound:
  2834.        ds.w    1
  2835. dx:
  2836.        ds.w    1
  2837. dy:
  2838.        ds.w    1
  2839. ddx:
  2840.        ds.w    1
  2841. ddy:
  2842.        ds.w    1
  2843. spx:
  2844.        ds.w    1
  2845. spy:
  2846.        ds.w    1
  2847. cx:
  2848.        ds.w    1
  2849. cy:
  2850.        ds.w    1
  2851. cylx:
  2852.        ds.w    1
  2853. cyly:
  2854.        ds.w    1
  2855. cyln:
  2856.        ds.w    1   ;Use as byte!
  2857. SCount:
  2858.        ds.w    1
  2859. BallSpeed:
  2860.        ds.l    1
  2861. Rast:
  2862.        ds.l    1
  2863. Font:
  2864.        ds.l    1
  2865. intbase:
  2866.        ds.l    1
  2867. fontbase:
  2868.        ds.l    1
  2869. dosbase:
  2870.        ds.l    1
  2871. iffbase:
  2872.        ds.l    1
  2873. pichd:
  2874.        ds.l    1
  2875. screen2hd:
  2876.        ds.l    1
  2877. screen3hd:
  2878.        ds.l    1
  2879. Scorehd:
  2880.        ds.l    1
  2881. MemPtr:
  2882.        ds.l    1
  2883. End_Board:
  2884.        ds.l    1
  2885. bit1map:
  2886.        ds.l    1
  2887. bit2map:
  2888.        ds.l    1
  2889. bit3map:
  2890.        ds.l    1
  2891. windowhd:
  2892.        ds.l    1
  2893. gfxbase:
  2894.        ds.l    1
  2895. ViewPort:
  2896.        ds.l    1
  2897. otherMessages:
  2898.        ds.b    68 * 4
  2899. Pl2Boards:
  2900.        ds.b    Whole_Thing
  2901. MyMem:
  2902.        ds.b    Whole_Thing
  2903.        END
  2904.