;*************************************************************** ; ; ChipOff ; ; Example program by Duane Alan Hahn (Random Terrain) using ; hints, tips, code snippets, and more from AtariAge members ; such as batari, SeaGtGruff, RevEng, Robert M, Nukey Shay, ; Atarius Maximus, jrok, supercat, GroovyBee, and bogax. ; ;*************************************************************** ; ; Objects: ; ; The left side border is missile0. The right side border is ; missile1. Paddle is player0. The bouncing ball is player1. ; Each token that drops is the actual ball which uses the ; playfield colors. The block destruction effect is player2 ; (virtual sprite). Player2 must be the same color as the ; right border or the color change will show up in the border. ; ;*************************************************************** ;**************************************************************** ; ; Kernel options for this program. ; set kernel DPC+ set tv ntsc set kernel_options collision(playfield,player1) set dpcspritemax 4 goto __Bank_2 bank2 asm minikernel ldx _Score_Background stx COLUBK rts end bank 2 temp1=temp1 __Bank_2 ;**************************************************************** ; ; Random numbers can slow down bankswitched games. ; This will speed things up. ; set optimization inlinerand ;*************************************************************** ; ; 01 Variable aliases go here (DIMs). ; ; You can have more than one alias for each variable. ; ;``````````````````````````````````````````````````````````````` ;``````````````````````````````````````````````````````````````` ; 8.8 fixed point movement for the paddle. ; dim _Paddle_x = player0x.a ;``````````````````````````````````````````````````````````````` ; 8.8 fixed point movement for the ball (player1). ; dim _p1_Ball_x = player1x.b dim _p1_Ball_y = player1y.c ;``````````````````````````````````````````````````````````````` ; 8.8 fixed point movement for the block destruction effect. ; dim _Dropped_Token_y = bally.d ;``````````````````````````````````````````````````````````````` ; Counts the number of blocks destroyed. ; dim _Block_Count = e ;``````````````````````````````````````````````````````````````` ; Adds a slight bounce to the paddle when the ball hits it. ; dim _Paddle_Bounce_Counter = f ;``````````````````````````````````````````````````````````````` ; Sound channel 0 duration and counter. ; dim _C0_Duration = g dim _C0_Counter = h ;``````````````````````````````````````````````````````````````` ; Sound channel 1 duration and counter. ; dim _C1_Duration = i dim _C1_Counter = j ;``````````````````````````````````````````````````````````````` ;``````````````````````````````````````````````````````````````` ; Bits used to turn channel 0 sound effects off and on. ; dim _BitOp_C0 = k dim _Bit0_C0_Block1 = k dim _Bit1_C0_Block2 = k dim _Bit2_C0_Block3 = k dim _Bit3_C0_Block4 = k dim _Bit4_C0_Block5 = k dim _Bit5_C0_Extra_Ball = k ;``````````````````````````````````````````````````````````````` ;``````````````````````````````````````````````````````````````` ; Bits used to turn channel 1 sound effects off and on (set 1). ; dim _BitOp_C1 = l dim _Bit0_C1_Paddle = l dim _Bit1_C1_Walls = l dim _Bit2_C1_Lose_Ball = l dim _Bit3_C1_Game_Over = l dim _Bit4_C1_Start_Game = l dim _Bit5_C1_Ball_Appear = l dim _Bit6_C1_Bad_Token = l dim _Bit7_C1_Good_Token = l ;``````````````````````````````````````````````````````````````` ;``````````````````````````````````````````````````````````````` ; Bits used to turn channel 1 sound effects off and on (set 2). ; dim _BitOp_C1S2 = NUSIZ7 dim _Bit0_C1_Good_Lost = NUSIZ7 dim _Bit1_C1_Good_Got = NUSIZ7 dim _Bit2_C1_Bad_Got = NUSIZ7 dim _Bit3_C1_Guidance = NUSIZ7 ;``````````````````````````````````````````````````````````````` ; Keeps the same block sound from playing twice in a row. ; dim _Sound_Memory = m ;``````````````````````````````````````````````````````````````` ; Angles used by the ball (player1). ; dim _Angle_x = n.o dim _Angle_y = p.q ;``````````````````````````````````````````````````````````````` ; Converted ball coordinates for playfield. ; dim _pf_x = r dim _pf_y = s ;``````````````````````````````````````````````````````````````` ;``````````````````````````````````````````````````````````````` ; Fixes it so holding it down will not make it keep resetting. ; dim _Bit0_Reset_Restrainer = t ;``````````````````````````````````````````````````````````````` ; One fire button press at a time. ; dim _Bit1_Joy0_Restrainer = t ;``````````````````````````````````````````````````````````````` ; Makes sure only one block is destroyed at a time. ; dim _Bit2_Block_Hit = t ;``````````````````````````````````````````````````````````````` ; Left/right ball direction (player1). 0 is left and 1 is right. ; dim _Bit5_Ball_Direction_x = t ;``````````````````````````````````````````````````````````````` ; Up/down ball direction (missile0). ; dim _Bit6_Ball_Direction_y = t ;``````````````````````````````````````````````````````````````` ; No ball until player presses fire button. ; dim _Bit7_New_Ball_Pause = t ;``````````````````````````````````````````````````````````````` ;``````````````````````````````````````````````````````````````` ; Game over bit. ; dim _Bit0_Game_is_Over = u ;``````````````````````````````````````````````````````````````` ; Player cannot restart until the 2 second wait is over. ; dim _Bit1_Two_Seconds = u ;``````````````````````````````````````````````````````````````` ; Score will flip between the current score and the high score ; every 2 seconds. ; dim _Bit2_Swap_Scores = u ;``````````````````````````````````````````````````````````````` ; New game bit. ; dim _Bit3_New_Game = u ;``````````````````````````````````````````````````````````````` ; Restrainer for ball size selection with Joystick. ; dim _Bit4_Stick0_Restrainer = u ;``````````````````````````````````````````````````````````````` ; Bit for bonus item. ; dim _Bit5_Bonus_Item = u ;``````````````````````````````````````````````````````````````` ; Bit for bad item. ; dim _Bit6_Bad_Item = u ;``````````````````````````````````````````````````````````````` ; One fire button press at a time. ; dim _Bit7_Guide_Stick_Moved = u ;``````````````````````````````````````````````````````````````` ; Animation counters. ; dim _Master_Counter = v dim _Frame_Counter = w ;``````````````````````````````````````````````````````````````` ; Other counters. ; dim _Game_Over_Counter = x dim _Guidance_Counter = y ;``````````````````````````````````````````````````````````````` ; Counters that slide the paddle a little after movement. ; dim _Slide_Counter = z.var0 dim _Slide_Limit = var1 ;``````````````````````````````````````````````````````````````` ; Holds any extra lives. ; dim _Extra_Balls = var2 ;``````````````````````````````````````````````````````````````` ; NUSIZ0 variable. ; dim _Number_and_Size0 = var3 ;``````````````````````````````````````````````````````````````` ; Width of missile. ; dim _Ball_Height = var4 ;``````````````````````````````````````````````````````````````` ;``````````````````````````````````````````````````````````````` ; Small paddle flag. ; dim _Bit0_Paddle_Size = var5 ;``````````````````````````````````````````````````````````````` ; Paddle slide left. ; dim _Bit1_Slide_Left = var5 ;``````````````````````````````````````````````````````````````` ; Paddle slide right. ; dim _Bit2_Slide_Right = var5 ;``````````````````````````````````````````````````````````````` ; Guide button bit. Tells program when guidance meter is used. ; dim _Bit3_Guide_Button = var5 ;``````````````````````````````````````````````````````````````` ; Guide button bit. Tells program when guidance meter is used. ; dim _Bit4_Extra_Guidance = var5 ;``````````````````````````````````````````````````````````````` ; Token color. ; dim _Token_Color = var6 ;``````````````````````````````````````````````````````````````` ; Token color memory. ; dim _Token_Mem = var7 ;``````````````````````````````````````````````````````````````` ; Token Counter. ; dim _Token_Counter = var8 ;``````````````````````````````````````````````````````````````` ; Speed Counter. ; dim _Speed_Counter = player7height ;``````````````````````````````````````````````````````````````` ; Counter for extra guidance. ; dim _Token_Guidance_Counter = player7y ;``````````````````````````````````````````````````````````````` ; Remembers if guidance meter is full. ; dim _Extra_Guidance = player7x ;``````````````````````````````````````````````````````````````` ; Score background. ; dim _Score_Background = player6height ;``````````````````````````````````````````````````````````````` ; Used for cycling the score background color. ; dim _Cycle_Guidance_Counter = NUSIZ6 ;``````````````````````````````````````````````````````````````` ; Converts 6 digit score to 3 sets of two digits. ; sc1 holds the 100 thousands and 10 thousands ; digits of the score. sc2 holds the thousands and ; hundreds digits of the score. sc3 holds the tens ; and ones digits of the score. ; dim sc1 = score dim sc2 = score+1 dim sc3 = score+2 ;``````````````````````````````````````````````````````````````` ; Temporarily remembers the score for the score/high score ; flip during game over. ; dim _Temp_Score01 = player5height dim _Temp_Score02 = NUSIZ5 dim _Temp_Score03 = player5y ;``````````````````````````````````````````````````````````````` ; My temp variables that can be reused in different sections. ; dim _My_Temp1 = player8x dim _My_Temp2 = player8y dim _My_Temp3 = NUSIZ8 ;``````````````````````````````````````````````````````````````` ; Remembers the high score until the game is turned off. ; Do not clear these. ; dim _High_Score01 = player9x dim _High_Score02 = player9y dim _High_Score03 = NUSIZ9 ;*************************************************************** ; ; Enables pfscore bars. ; const pfscore = 1 ;*************************************************************** ; ; The ball angles used in this program. ; (Do not use a space before or after the equals sign.) ; def _20x=1.870 def _20y=0.708 def _30x=1.714 def _30y=1.028 def _45x=1.414 def _45y=1.412 def _55x=1.138 def _55y=1.644 def _70x=0.754 def _70y=2.172 def _50x=1.266 def _50y=1.546 def _25x=0.850 def _25y=1.808 def _60x=1.134 def _60y=1.998 ;*************************************************************** ; ; High score variables cleared only once at beginning. ; Do not clear these anywhere else in the code. ; _High_Score01 = 0 : _High_Score02 = 0 : _High_Score03 = 0 ;*************************************************************** ;*************************************************************** ; ; 02 Program Start/Restart ; ; __Start_Restart ;*************************************************************** ; ; Gets colors and more. ; gosub __Color_Setup ;*************************************************************** ; ; Makes sure the program will not go over 262 when reset. ; drawscreen ;*************************************************************** ; ; Mutes volume of both sound channels. ; AUDV0 = 0 : AUDV1 = 0 ;*************************************************************** ; ; Clears variables (fastest way). ; a = 0 : b = 0 : c = 0 : d = 0 : e = 0 : f = 0 : g = 0 : h = 0 : i = 0 j = 0 : k = 0 : l = 0 : m = 0 : n = 0 : o = 0 : p = 0 : q = 0 : r = 0 s = 0 : t = 0 : u = 0 : v = 0 : w = 0 : x = 0 : y = 0 var0 = 0 : var1 = 0 : var2 = 0 : var3 = 0 : var4 = 0 var5 = 0 : var6 = 0 : var7 = 0 : var8 = 0 player5x = 0 : player5y = 0 : NUSIZ5 = 0 : player5height = 0 player6x = 0 : player6y = 0 : NUSIZ6 = 0 : player6height = 0 player7x = 0 : player7y = 0 : NUSIZ7 = 0 : player7height = 0 player8x = 0 : player8y = 0 : NUSIZ8 = 0 : player8height = 0 rem player9x = 0 : player9y = 0 : NUSIZ9 = 0 : player9height = 0 ;*************************************************************** ; ; Clears the score. ; score = 0 ;*************************************************************** ; ; Playfield. ; playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ ................................ ................................ ................................ ................................ ................................ ................................ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ end ;*************************************************************** ; ; Background colors. ; bkcolors: $00 end ;*************************************************************** ; ; Creates shape of paddle. ; player0: %1111111 %1111111 %1111111 %1111111 end player0color: $08 $08 $08 $08 end player2color: $08 $08 $08 $08 end player2: %11111111 %11111111 %11111111 %11111111 end ;*************************************************************** ; ; Sets up pfscore bars. ; pfscore1 = %01010101 : pfscore2 = %11111111 ;*************************************************************** ; ; Starting position of player0 (paddle) sprite. ; player0x = 71 : player0y = 163 ;*************************************************************** ; ; Starting position of player2 sprite (destruction effect). ; player2x = 0 : player2y = 220 ;*************************************************************** ; ; Places player1 on the screen (used as the ball). ; player1x = 81 : player1y = 77 ;*************************************************************** ; ; Defines missile positions and heights (side borders). ; missile0x = 13 : missile1x = 145 missile0y = 0 : missile1y = 0 missile0height = 175 : missile1height = 175 ;*************************************************************** ; ; Defines block effect size and makes sure it is off screen. ; CTRLPF = $31 : ballheight = 5 : ballx = 200 : bally = 200 ;*************************************************************** ; ; Sets repetition restrainer for the reset switch. ; (Holding it down won't make it keep resetting.) ; _Bit0_Reset_Restrainer{0} = 1 ;*************************************************************** ; ; Sets repetition restrainer for the fire button. ; (Holding it down won't make it keep repeating.) ; _Bit1_Joy0_Restrainer{1} = 1 ;*************************************************************** ; ; Turns on new new game bit. ; _Bit3_New_Game{3} = 1 ;*************************************************************** ; ; Sets variable for NUSIZ0. ; _Number_and_Size0 = $25 ;*************************************************************** ; ; Turns on new ball pause. ; _Bit7_New_Ball_Pause{7} = 1 ;*************************************************************** ; ; Sets up the game start sound. ; _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : _C1_Counter = 0 : _C1_Duration = 1 : _Bit4_C1_Start_Game{4} = 1 ;*************************************************************** ; ; Sets up default ball height. ; _Ball_Height = 2 ;*************************************************************** ; ; Sets up missile1 size. ; _NUSIZ1 = $20 : NUSIZ2 = $20 : NUSIZ3 = $20 ;*************************************************************** ; ; Sets up score background color. ; _Score_Background = $22 ;*************************************************************** ; ; Sets up score colors. ; scorecolors: $2E $2E $2A $2A $28 $28 $26 $26 end ;*************************************************************** ;*************************************************************** ; ; 03 Main Loop ; ; __Main_Loop ;*************************************************************** ; ; 04 New game section. ; ;``````````````````````````````````````````````````````````````` ; Skip if not a new game. ; if !_Bit3_New_Game{3} then goto __Skip_New_Game ;``````````````````````````````````````````````````````````````` ; Paddle size selection. ; if joy0up then _Bit0_Paddle_Size{0} = 0 : player0x = 71 : _Number_and_Size0 = _Number_and_Size0 & $F0 : _Number_and_Size0 = _Number_and_Size0 | $05 if joy0down then _Bit0_Paddle_Size{0} = 1 : player0x = 62 : _Number_and_Size0 = _Number_and_Size0 & $F0 : _Number_and_Size0 = _Number_and_Size0 | $07 ;``````````````````````````````````````````````````````````````` ; If joystick not moved, clear the stick restrainer bit. ; if !joy0left && !joy0right then _Bit4_Stick0_Restrainer{4} = 0 ;``````````````````````````````````````````````````````````````` ; If joystick already moved, skip. ; if _Bit4_Stick0_Restrainer{4} then goto __Skip_Ball_Size_Change ;``````````````````````````````````````````````````````````````` ; Ball size selection. ; if joy0left then _Bit4_Stick0_Restrainer{4} = 1 : _Ball_Height = _Ball_Height / 2 : if _Ball_Height = %00000001 then _Ball_Height = %00001000 if joy0right then _Bit4_Stick0_Restrainer{4} = 1 : _Ball_Height = _Ball_Height * 2 : if _Ball_Height = %00010000 then _Ball_Height = %00000010 ;``````````````````````````````````````````````````````````````` ; Changes ball size based on selection. ; if _Ball_Height = 2 then gosub __Ball0 if _Ball_Height = 4 then gosub __Ball1 if _Ball_Height = 8 then gosub __Ball2 __Skip_Ball_Size_Change ;``````````````````````````````````````````````````````````````` ; If fire button restrainer bit is on, skip. ; if _Bit1_Joy0_Restrainer{1} then goto __Skip_New_Game ;``````````````````````````````````````````````````````````````` ; If fire button is pressed, turn off new game bit. ; if joy0fire then _Bit3_New_Game{3} = 0 __Skip_New_Game ;*************************************************************** ; ; 05 If the new game bit is on, skip a lot of code. ; if _Bit3_New_Game{3} then goto __Return_from_Blocks ;*************************************************************** ; ; 06 Paddle movement. ; ;``````````````````````````````````````````````````````````````` ; Sets paddle y position. ; player0y = 163 ;``````````````````````````````````````````````````````````````` ; If paddle was hit by the ball, lower the paddle for a bit. ; if _Paddle_Bounce_Counter > 0 then _Paddle_Bounce_Counter = _Paddle_Bounce_Counter - 1 : player0y = 165 ;``````````````````````````````````````````````````````````````` ; Moves the paddle if joystick is pressed left or right. ; if joy0left then _Bit1_Slide_Left{1} = 1 : _Bit2_Slide_Right{2} = 0 : _Slide_Counter = 1.7 : _Slide_Limit = 0 : _Paddle_x = _Paddle_x - 2.000 : goto __Skip_Slide if joy0right then _Bit2_Slide_Right{2} = 1 : _Bit1_Slide_Left{1} = 0 : _Slide_Counter = 1.7 : _Slide_Limit = 0 : _Paddle_x = _Paddle_x + 2.000 : goto __Skip_Slide rem ```````````````````````````````````````````````````````````````` rem ` Slide the paddle. rem ` if _Slide_Limit > 16 then _Bit1_Slide_Left{1} = 0 : _Bit2_Slide_Right{2} = 0 : goto __Skip_Slide _Slide_Counter = _Slide_Counter - 0.100 _Slide_Limit = _Slide_Limit + 1 if _Bit1_Slide_Left{1} then _Paddle_x = _Paddle_x - _Slide_Counter if _Bit2_Slide_Right{2} then _Paddle_x = _Paddle_x + _Slide_Counter __Skip_Slide ;``````````````````````````````````````````````````````````````` ; Limits paddle movement. ; if _Bit0_Paddle_Size{0} then goto __Skip_Small_Paddle_Limit if _Paddle_x < 13 then _Paddle_x = 13 if _Paddle_x > 127 then _Paddle_x = 127 goto __Skip_Large_Paddle_Limit __Skip_Small_Paddle_Limit if _Paddle_x < 11 then _Paddle_x = 11 if _Paddle_x > 111 then _Paddle_x = 111 __Skip_Large_Paddle_Limit ;*************************************************************** ; ; 07 Paddle and ball collision. ; ;``````````````````````````````````````````````````````````````` ; Skip this section if no collision. ; if !collision(player0,player1) then goto __Skip_Paddle_Collision ;``````````````````````````````````````````````````````````````` ; Decrements the speed counter. ; if _Speed_Counter then _Speed_Counter = _Speed_Counter - 1 ;``````````````````````````````````````````````````````````````` ; If bad token is falling, skip sound effect. ; if _Bit6_C1_Bad_Token{6} then goto __Skip_Paddle_Sound ;``````````````````````````````````````````````````````````````` ; If good token is falling, skip sound effect. ; if _Bit7_C1_Good_Token{7} then goto __Skip_Paddle_Sound ;``````````````````````````````````````````````````````````````` ; If good token lost sound is on, skip sound effect. ; if _Bit0_C1_Good_Lost{0} then goto __Skip_Paddle_Sound ;``````````````````````````````````````````````````````````````` ; If good token collision sound is on, skip sound effect. ; if _Bit1_C1_Good_Got{1} then goto __Skip_Paddle_Sound ;``````````````````````````````````````````````````````````````` ; If bad token collision sound is on, skip sound effect. ; if _Bit2_C1_Bad_Got{2} then goto __Skip_Paddle_Sound ;``````````````````````````````````````````````````````````````` ; If guidance sound is on, skip sound effect. ; if _Bit3_C1_Guidance{3} then goto __Skip_Paddle_Sound ;``````````````````````````````````````````````````````````````` ; Turn on paddle collision sound effect. ; _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : _C1_Counter = 0 : _C1_Duration = 1 : _Bit0_C1_Paddle{0} = 1 __Skip_Paddle_Sound ;``````````````````````````````````````````````````````````````` ; Reverse y direction of ball (missile0). ; _Bit6_Ball_Direction_y{6} = 0 ;``````````````````````````````````````````````````````````````` ; Clears the block hit bit so the next hit will count. ; _Bit2_Block_Hit{2} = 0 ;``````````````````````````````````````````````````````````````` ; Makes the paddle seem to bounce back. ; _Paddle_Bounce_Counter = 5 ;``````````````````````````````````````````````````````````````` ; Prepares to find out where the ball hit the paddle. ; _My_Temp1 = player1x - player0x ;``````````````````````````````````````````````````````````````` ; Figures out if the ball should go left or right based on ; which side of the paddle the ball hit. ; _Bit5_Ball_Direction_x{5} = 0 if _Bit0_Paddle_Size{0} then goto __Skip_Small_Paddle_Angle ;``````````````````````````````````````````````````````````````` ; If ball hits right side of small paddle, go right. ; if _My_Temp1 > 10 then _Bit5_Ball_Direction_x{5} = 1 ;``````````````````````````````````````````````````````````````` ; Finds spot on the small paddle where the ball hit. ; if _My_Temp1 < 5 || _My_Temp1 > 16 then _Angle_x = _20x : _Angle_y = _20y : goto __Skip_Paddle_Angle if _My_Temp1 < 7 || _My_Temp1 > 14 then _Angle_x = _30x : _Angle_y = _30y : goto __Skip_Paddle_Angle if _My_Temp1 < 9 || _My_Temp1 > 12 then _Angle_x = _45x : _Angle_y = _45y : goto __Skip_Paddle_Angle if _My_Temp1 < 13 then _Angle_x = _60x : _Angle_y = _60y goto __Skip_Paddle_Angle __Skip_Small_Paddle_Angle ;``````````````````````````````````````````````````````````````` ; If ball hits right side of large paddle, go right. ; if _My_Temp1 > 18 then _Bit5_Ball_Direction_x{5} = 1 ;``````````````````````````````````````````````````````````````` ; Finds spot on the large paddle where the ball hit. ; if _My_Temp1 < 7 || _My_Temp1 > 31 then _Angle_x = _20x : _Angle_y = _20y : goto __Skip_Paddle_Angle if _My_Temp1 < 12 || _My_Temp1 > 26 then _Angle_x = _30x : _Angle_y = _30y : goto __Skip_Paddle_Angle if _My_Temp1 < 17 || _My_Temp1 > 21 then _Angle_x = _45x : _Angle_y = _45y : goto __Skip_Paddle_Angle if _My_Temp1 < 22 then _Angle_x = _60x : _Angle_y = _60y __Skip_Paddle_Angle __Skip_Paddle_Collision ;*************************************************************** ; ; 08 Border bounce check. ; ;``````````````````````````````````````````````````````````````` ; If the new ball pause is on, skip. ; if _Bit7_New_Ball_Pause{7} then goto __Skip_missile0_to_pf_Collision ;``````````````````````````````````````````````````````````````` ; If side border hit, turn on sound effect, reverse x ; direction, and turn on the side border hit bit. ; if player1x < 16 then player1x = 16 : _Bit5_Ball_Direction_x = _Bit5_Ball_Direction_x ^ %00100000 : goto __Activate_Wall_Hit_Sound _My_Temp1 = 144 - (_Ball_Height/2) if player1x > _My_Temp1 then player1x = _My_Temp1 : _Bit5_Ball_Direction_x = _Bit5_Ball_Direction_x ^ %00100000 : goto __Activate_Wall_Hit_Sound goto __Skip_Wall_Sound __Activate_Wall_Hit_Sound ;``````````````````````````````````````````````````````````````` ; If bad token is falling, skip sound effect. ; if _Bit6_C1_Bad_Token{6} then goto __Skip_Wall_Sound ;``````````````````````````````````````````````````````````````` ; If good token is falling, skip sound effect. ; if _Bit7_C1_Good_Token{7} then goto __Skip_Wall_Sound ;``````````````````````````````````````````````````````````````` ; If good token lost sound is on, skip sound effect. ; if _Bit0_C1_Good_Lost{0} then goto __Skip_Wall_Sound ;``````````````````````````````````````````````````````````````` ; If good token collision sound is on, skip sound effect. ; if _Bit1_C1_Good_Got{1} then goto __Skip_Wall_Sound ;``````````````````````````````````````````````````````````````` ; If bad token collision sound is on, skip sound effect. ; if _Bit2_C1_Bad_Got{2} then goto __Skip_Wall_Sound ;``````````````````````````````````````````````````````````````` ; If guidance sound is on, skip sound effect. ; if _Bit3_C1_Guidance{3} then goto __Skip_Wall_Sound ;``````````````````````````````````````````````````````````````` ; Turn on block destruction sound effect. ; _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : _C1_Counter = 0 : _C1_Duration = 1 : _Bit1_C1_Walls{1} = 1 __Skip_Wall_Sound ;``````````````````````````````````````````````````````````````` ; If the game is over, skip bottom check. ; if _Bit0_Game_is_Over{0} then goto __Skip_Bottom_Check ;``````````````````````````````````````````````````````````````` ; Unrem the line below to have the ball bounce back up for testing. ; rem if player1y > 175 then _Bit2_Block_Hit{2} = 0 : _Bit6_Ball_Direction_y = _Bit6_Ball_Direction_y ^ %01000000 : goto __Skip_Bottom_Check ;``````````````````````````````````````````````````````````````` ; If the ball hasn't reached the bottom, skip ahead. ; if player1y < 180 then goto __Skip_Bottom_Check ;``````````````````````````````````````````````````````````````` ; Clears the block hit bit so the next hit will count. ; _Bit2_Block_Hit{2} = 0 ;``````````````````````````````````````````````````````````````` ; Clears the dive-bomb fast ball. ; _Speed_Counter = 0 ;``````````````````````````````````````````````````````````````` ; Turn on new ball pause bit and restrain fire button. ; _Bit7_New_Ball_Pause{7} = 1 : _Bit1_Joy0_Restrainer{1} = 1 ;``````````````````````````````````````````````````````````````` ; Turn on lose ball sound effect. ; _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : _C1_Counter = 0 : _C1_Duration = 1 : _Bit2_C1_Lose_Ball{2} = 1 ;``````````````````````````````````````````````````````````````` ; If there is a ball surplus, remove one of those and skip. ; if _Extra_Balls > 0 then _Extra_Balls = _Extra_Balls - 1 : goto __Skip_Castration ;``````````````````````````````````````````````````````````````` ; If game is over, turn on game over sound effect, turn on ; game over bit, and check for high score. ; if pfscore1 then goto __Skip_Game_Over_Test _BitOp_C1=0 : _BitOp_C1S2 = 0 _Bit3_C1_Game_Over{3} = 1 : _Bit0_Game_is_Over{0} = 1 goto __Check_High_Score __Skip_Game_Over_Test ;``````````````````````````````````````````````````````````````` ; Remove one of the extra balls shown on screen. ; pfscore1 = pfscore1/4 __Skip_Castration goto __Skip_missile0_to_pf_Collision __Skip_Bottom_Check ;``````````````````````````````````````````````````````````````` ; If top border hit, clear the block hit bit, turn on sound ; effect, reverse y direction, and skip collision check. ; if player1y < 4 then player1y = 4 : _Bit2_Block_Hit{2} = 0 : _Bit6_Ball_Direction_y = _Bit6_Ball_Direction_y ^ %01000000 : goto __Activate_Wall_Hit_Sound2 goto __Skip_Border_Check __Activate_Wall_Hit_Sound2 ;``````````````````````````````````````````````````````````````` ; Turn on block destruction sound effect. ; _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : _C1_Counter = 0 : _C1_Duration = 1 : _Bit1_C1_Walls{1} = 1 goto __Skip_missile0_to_pf_Collision __Skip_Border_Check ;*************************************************************** ; ; 09 Ball/Playfield collision check. ; ;``````````````````````````````````````````````````````````````` ; If a block has already been hit, skip this section. ; if _Bit2_Block_Hit{2} then goto __Skip_missile0_to_pf_Collision ;``````````````````````````````````````````````````````````````` ; If there is no collision, skip this section. ; if !collision(playfield,player1) then goto __Skip_missile0_to_pf_Collision ;``````````````````````````````````````````````````````````````` ; Ball y (player1y) coordinate conversion depends on direction. ; if !_Bit6_Ball_Direction_y{6} then _pf_y = (player1y)/4 : goto __Skip_Ball_y_Check _pf_y = (player1y + _Ball_Height)/4 __Skip_Ball_y_Check ;``````````````````````````````````````````````````````````````` ; Ball x (player1x) coordinate conversion depends on direction. ; if !_Bit5_Ball_Direction_x{5} then _pf_x = (player1x-17)/4 : goto __Skip_Ball_x_Check _My_Temp1 = _Ball_Height/2 : _My_Temp2 = 18 - _My_Temp1 : _pf_x = (player1x-_My_Temp2)/4 __Skip_Ball_x_Check ;``````````````````````````````````````````````````````````````` ; If a block is there, skip this subsection. ; if pfread(_pf_x,_pf_y) then goto __Skip_Read_02 ;``````````````````````````````````````````````````````````````` ; Gets colors and more. ; gosub __Color_Setup ;``````````````````````````````````````````````````````````````` ; Keeps the program from going over 262. ; drawscreen ;``````````````````````````````````````````````````````````````` ; Hunt for a nearby playfield pixel. ; if _Bit5_Ball_Direction_x{5} then goto __Skip_Read_01 if _pf_x > 0 then _My_Temp1 = _pf_x - 1 : if pfread(_My_Temp1,_pf_y) then _pf_x = _pf_x - 1 : goto __Skip_Read_02 if _pf_x < 31 then _My_Temp1 = _pf_x + 1 : if pfread(_My_Temp1,_pf_y) then _pf_x = _pf_x + 1 : goto __Skip_Read_02 goto __Make_Scrape_Sound __Skip_Read_01 if _pf_x < 31 then _My_Temp1 = _pf_x + 1 : if pfread(_My_Temp1,_pf_y) then _pf_x = _pf_x + 1 : goto __Skip_Read_02 if _pf_x > 0 then _My_Temp1 = _pf_x - 1 : if pfread(_My_Temp1,_pf_y) then _pf_x = _pf_x - 1 : goto __Skip_Read_02 __Make_Scrape_Sound ;``````````````````````````````````````````````````````````````` ; If bad token is falling, skip sound effect. ; if _Bit6_C1_Bad_Token{6} then goto __Skip_Scrape_Sound ;``````````````````````````````````````````````````````````````` ; If good token is falling, skip sound effect. ; if _Bit7_C1_Good_Token{7} then goto __Skip_Scrape_Sound ;``````````````````````````````````````````````````````````````` ; If good token lost sound is on, skip sound effect. ; if _Bit0_C1_Good_Lost{0} then goto __Skip_Scrape_Sound ;``````````````````````````````````````````````````````````````` ; If good token collision sound is on, skip sound effect. ; if _Bit1_C1_Good_Got{1} then goto __Skip_Scrape_Sound ;``````````````````````````````````````````````````````````````` ; If bad token collision sound is on, skip sound effect. ; if _Bit2_C1_Bad_Got{2} then goto __Skip_Scrape_Sound ;``````````````````````````````````````````````````````````````` ; If guidance sound is on, skip sound effect. ; if _Bit3_C1_Guidance{3} then goto __Skip_Scrape_Sound ;``````````````````````````````````````````````````````````````` ; Ball is scraping side of block. Turn on sound. ; _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : _C1_Counter = 0 : _C1_Duration = 1 : _Bit5_C1_Ball_Appear{5} = 1 __Skip_Scrape_Sound goto __Skip_missile0_to_pf_Collision __Skip_Read_02 ;``````````````````````````````````````````````````````````````` ; Makes sure only one block is destroyed at a time. ; _Bit2_Block_Hit{2} = 1 ;``````````````````````````````````````````````````````````````` ; Remembers how many blocks have been hit. ; _Block_Count = _Block_Count + 1 ;``````````````````````````````````````````````````````````````` ; Increment Token Counter. ; _Token_Counter = _Token_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Remembers the thousands digit. ; _My_Temp1 = (sc2 & $F0) ;``````````````````````````````````````````````````````````````` ; Get points for destroyed block from data. ; dec _My_Temp3 = _Data_Points[_pf_y] ;``````````````````````````````````````````````````````````````` ; Add points to score. ; score = score + _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Grabs the thousands digit. ; _My_Temp2 = (sc2 & $F0) ;``````````````````````````````````````````````````````````````` ; If thousands digit has NOT changed, skip this part. ; if _My_Temp1 = _My_Temp2 then goto __Skip_Extra_Ball ;``````````````````````````````````````````````````````````````` ; Turn on extra ball sound effect. ; _BitOp_C0 = 0 : _C0_Duration = 1 : _C0_Counter = 0 : _Bit5_C0_Extra_Ball{5} = 1 ;``````````````````````````````````````````````````````````````` ; If extra ball indicator is full, remember the extra ball. ; if pfscore1 = %01010101 && _Extra_Balls < 255 then _Extra_Balls = _Extra_Balls + 1 : goto __Skip_Extra_Ball ;``````````````````````````````````````````````````````````````` ; On screen indicator is not full. Add extra ball to it. ; pfscore1 = pfscore1*4|1 __Skip_Extra_Ball ;``````````````````````````````````````````````````````````````` ; Reverse Ball y (player1y) direction. ; _Bit6_Ball_Direction_y = _Bit6_Ball_Direction_y ^ %01000000 ;``````````````````````````````````````````````````````````````` ; Delete pfpixel. ; pfpixel _pf_x _pf_y off ;``````````````````````````````````````````````````````````````` ; Delete pfpixel to the left or right based on whether the ; currently deleted pfpixel was odd or even. ; if _pf_x{0} then _My_Temp1 = _pf_x - 1 : pfpixel _My_Temp1 _pf_y off : goto __Skip_Odd_Even _My_Temp1 = _pf_x + 1 : pfpixel _My_Temp1 _pf_y off : _My_Temp1 = _pf_x __Skip_Odd_Even ;``````````````````````````````````````````````````````````````` ; Finds location for block destruction effect. ; player2x = (_My_Temp1 * 4) + 16 player2y = _pf_y * 4 ;``````````````````````````````````````````````````````````````` ; Block destruction animation setup. ; _Frame_Counter = 0 player2: %11111111 %11111111 %11111111 %11111111 end ;``````````````````````````````````````````````````````````````` ; If a token is on the screen, skip. ; if bally < 171 then goto __Skip_Token_Drop ;``````````````````````````````````````````````````````````````` ; If 2 blocks haven't been destroyed since last token, skip. ; if _Token_Counter < 3 then goto __Skip_Token_Drop ;``````````````````````````````````````````````````````````````` ; If 8 blocks have been destroyed since last token, drop a ; token. ; if _Token_Counter > 7 then goto __Drop_Token ;``````````````````````````````````````````````````````````````` ; There is a 25 percent chance that a token will drop between ; 2 and 8 blocks destroyed since the last token. ; _My_Temp3 = rand if _My_Temp3 > 63 then goto __Skip_Token_Drop __Drop_Token ;``````````````````````````````````````````````````````````````` ; Clear Token counter. ; _Token_Counter = 0 ;``````````````````````````````````````````````````````````````` ; Token location setup. ; ballx = (_My_Temp1 * 4) + 17 bally = (_pf_y * 4) + 3 ;``````````````````````````````````````````````````````````````` ; If last token was faster ball, make it be points. ; if _Token_Mem = 1 then _Token_Color = 2 : goto __Skip_Token_Choice ;``````````````````````````````````````````````````````````````` ; Determines which kind of token will fall. ; ; 1 = red (faster ball) ; 2 = yellow (points) ; ; There is a 70 percent chance that the token will be points. ; _Token_Color = 1 _My_Temp3 = rand if _My_Temp3 < 179 then _Token_Color = 2 ;``````````````````````````````````````````````````````````````` ; Changes colors for token. ; gosub __Color_Setup __Skip_Token_Choice ;``````````````````````````````````````````````````````````````` ; Remembers type of token. ; _Token_Mem = _Token_Color __Skip_Token_Drop ;``````````````````````````````````````````````````````````````` ; If extra ball bit is on, skip block destruction sound effect. ; if _Bit5_C0_Extra_Ball{5} then goto __Skip_missile0_to_pf_Collision ;``````````````````````````````````````````````````````````````` ; Block destruction sound effect preparation. ; _BitOp_C0=0 : _C0_Duration=1 : _C0_Counter=0 ;``````````````````````````````````````````````````````````````` ; Get random number for block sound effect. ; _My_Temp1 = (rand/128) + (rand/64) ;``````````````````````````````````````````````````````````````` ; If last sound effect is same as current one, get new one. ; if _Sound_Memory = _My_Temp1 then _My_Temp1 = _My_Temp1 + 1 : if _My_Temp1 > 4 then _My_Temp1 = 0 ;``````````````````````````````````````````````````````````````` ; Assigns sound effect. ; if _Sound_Memory = 0 then _Bit0_C0_Block1{0} = 1 if _Sound_Memory = 1 then _Bit1_C0_Block2{1} = 1 if _Sound_Memory = 2 then _Bit2_C0_Block3{2} = 1 if _Sound_Memory = 3 then _Bit3_C0_Block4{3} = 1 if _Sound_Memory = 4 then _Bit4_C0_Block5{4} = 1 ;``````````````````````````````````````````````````````````````` ; Remembers sound effect so the same one won`t play next time. ; _Sound_Memory = _My_Temp1 __Skip_missile0_to_pf_Collision ;*************************************************************** ; ; 10 If all blocks destroyed, get new blocks. ; if _Block_Count > 143 then goto __New_Blocks __Return_from_Blocks goto __Continue_Code bank3 __Return_From_Code ;*************************************************************** ; ; Gets colors and more. ; gosub __Color_Setup ;*************************************************************** ; ; Playfield resolution. ; DF6FRACINC = 0 : DF4FRACINC = 128 DF0FRACINC = 64 : DF1FRACINC = 64 : DF2FRACINC = 64 : DF3FRACINC = 64 ;*************************************************************** ; ; 18 Displays the screen. ; drawscreen ;*************************************************************** ; ; 19 Check sound in other bank. ; ; Go to another bank and see if any sounds should be playing. ; goto __Check_Sound bank4 __Done_Check_Sound ;*************************************************************** ; ; 20 Reset Program: ; ; Any Atari 2600 program should restart when the reset switch ; is pressed. It is part of the usual standards and procedures. ; ;``````````````````````````````````````````````````````````````` ; If the reset switch is not pressed, turn off restrainer and ; skip this section. ; if !switchreset then _Bit0_Reset_Restrainer{0} = 0 : goto __Skip_Main_Reset ;``````````````````````````````````````````````````````````````` ; If the reset switch hasn`t been released, skip this section. ; if _Bit0_Reset_Restrainer{0} then goto __Skip_Main_Reset ;``````````````````````````````````````````````````````````````` ; Restart the program. ; goto __Start_Restart __Skip_Main_Reset goto __Main_Loop ;*************************************************************** ;*************************************************************** ; ; 21 New blocks. ; ; __New_Blocks ;``````````````````````````````````````````````````````````````` ; Gets colors and more. ; gosub __Color_Setup ;``````````````````````````````````````````````````````````````` ; Keeps the program from going over 262. ; drawscreen ;``````````````````````````````````````````````````````````````` ; Turns on new ball pause and fire button restrainer. ; _Bit7_New_Ball_Pause{7} = 1 : _Bit1_Joy0_Restrainer{1} = 1 ;``````````````````````````````````````````````````````````````` ; Clears the block count variable and clears the block hit bit ; so the next hit will count. ; _Block_Count = 0 : _Bit2_Block_Hit{2} = 0 ;``````````````````````````````````````````````````````````````` ; Moves the ball off the screen. ; player1x = 200 : player1y = 200 ;``````````````````````````````````````````````````````````````` ; Draws the blocks. ; playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ ................................ ................................ ................................ ................................ ................................ ................................ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ end goto __Return_from_Blocks ;*************************************************************** ;*************************************************************** ; ; 22 Checks for a new high score. ; ; __Check_High_Score ;**************************************************************** ; ; Start high score test. ; if sc1 > _High_Score01 then goto __New_High_Score if sc1 < _High_Score01 then goto __Skip_High_Score ;``````````````````````````````````````````````````````````````` ; First byte equal. Do the next test. ; if sc2 > _High_Score02 then goto __New_High_Score if sc2 < _High_Score02 then goto __Skip_High_Score ;``````````````````````````````````````````````````````````````` ; Second byte equal. Do the next test. ; if sc3 > _High_Score03 then goto __New_High_Score if sc3 < _High_Score03 then goto __Skip_High_Score ;``````````````````````````````````````````````````````````````` ; All bytes equal. Current score is the same as the high score. ; goto __Skip_High_Score __New_High_Score ;``````````````````````````````````````````````````````````````` ; Save new high score. ; _High_Score01 = sc1 : _High_Score02 = sc2 : _High_Score03 = sc3 __Skip_High_Score ;*************************************************************** ;*************************************************************** ; ; 23 Setup for game over high score swap. ; ;``````````````````````````````````````````````````````````````` ; Clears the counter. ; _Game_Over_Counter = 0 ;``````````````````````````````````````````````````````````````` ; Temporarily remembers the score. ; _Temp_Score01 = sc1 : _Temp_Score02 = sc2 : _Temp_Score03 = sc3 goto __Skip_missile0_to_pf_Collision ;*************************************************************** ;*************************************************************** ; ; 24 Color setup. ; ; __Color_Setup on _Token_Color goto __0_Color __1_Color __2_Color __2_Color __0_Color ;*************************************************************** ; ; Playfield colors. ; pfcolors: $08 $00 $00 $00 $00 $00 $00 $00 $64 $66 $68 $2A $2C $2E $56 $58 $5A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A $2A end goto __Skip_Color_Setup __1_Color ;*************************************************************** ; ; Playfield colors. ; pfcolors: $08 $00 $00 $00 $00 $00 $00 $00 $64 $66 $68 $2A $2C $2E $56 $58 $5A $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 $64 end goto __Skip_Color_Setup __2_Color ;*************************************************************** ; ; Playfield colors. ; pfcolors: $08 $00 $00 $00 $00 $00 $00 $00 $64 $66 $68 $2A $2C $2E $56 $58 $5A $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC $BC end __Skip_Color_Setup ;*************************************************************** ; ; Sets color of missiles and lives. ; COLUM0 = $08 : COLUM1 = $08 : pfscorecolor = $26 ;*************************************************************** ; ; Makes missiles go up to the top. ; ENAM0{1}=1 : ENAM1{1}=1 COLUP0 = 0 : COLUP1 = 0 ;*************************************************************** ; ; Sets up size of missiles and sprites. ; NUSIZ0 = _Number_and_Size0 ;*************************************************************** ; ; Sets color of the score if the game is not over. ; if !_Bit0_Game_is_Over{0} then scorecolors: $2E $2E $2A $2A $28 $28 $26 $26 end return thisbank __Ball0 player1: %10000000 %10000000 end player1color: $08 $08 end return thisbank __Ball1 player1: %11000000 %11000000 %11000000 %11000000 end player1color: $08 $08 $08 $08 end return thisbank __Ball2 player1: %01100000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %01100000 end player1color: $08 $08 $08 $08 $08 $08 $08 $08 end return thisbank ;*************************************************************** ; ; Points data for destroyed blocks. ; ;``````````````````````````````````````````````````````````````` ; All 144 blocks are worth 7,200 points. ; data _Data_Points $00, $00, $00, $00, $00, $00, $00, $00, $90, $80, $70, $60, $50, $40, $30, $20, $10, $00, $00, $00, $00 end bank 3 temp1=temp1 __Continue_Code ;*************************************************************** ; ; 11 Score flip. ; The score will flip between the current score and ; the high score every 2 seconds when the game is over. ; ;``````````````````````````````````````````````````````````````` ; if the game isn't over, skip this section. ; if !_Bit0_Game_is_Over{0} then goto __Skip_Flip ;``````````````````````````````````````````````````````````````` ; Increments the counter. ; _Game_Over_Counter = _Game_Over_Counter + 1 ;``````````````````````````````````````````````````````````````` ; If counter hasn't reached 2 seconds yet, skip this section. ; if _Game_Over_Counter < 120 then goto __Skip_Flip ;``````````````````````````````````````````````````````````````` ; Two seconds have gone by. Turn on two second bit. ; _Bit1_Two_Seconds{1} = 1 ;``````````````````````````````````````````````````````````````` ; Clear the counter and flip the score swap bit. ; _Game_Over_Counter = 0 : _Bit2_Swap_Scores{2} = !_Bit2_Swap_Scores{2} ;``````````````````````````````````````````````````````````````` ; If the score swap bit is on, display the high score. ; if !_Bit2_Swap_Scores{2} then goto __Skip_Swap_01 sc1 = _High_Score01 : sc2 = _High_Score02 : sc3 = _High_Score03 scorecolors: $9E $9E $9A $9A $98 $98 $96 $96 end goto __Skip_Flip __Skip_Swap_01 ;``````````````````````````````````````````````````````````````` ; If the score swap bit is off, display the current score. ; sc1 = _Temp_Score01 : sc2 = _Temp_Score02 : sc3 = _Temp_Score03 scorecolors: $4E $4E $4A $4A $48 $48 $46 $46 end __Skip_Flip ;*************************************************************** ; ; 12 Fire button section. ; ;``````````````````````````````````````````````````````````````` ; If fire button not pressed, clear restrainer bit and skip. ; if !joy0fire then _Bit1_Joy0_Restrainer{1} = 0 : goto __Skip_Fire ;``````````````````````````````````````````````````````````````` ; If fire button hasn't been released, skip this section. ; if _Bit1_Joy0_Restrainer{1} then goto __Skip_Fire ;``````````````````````````````````````````````````````````````` ; Turns on fire button restrainer bit. ; _Bit1_Joy0_Restrainer{1} = 1 ;``````````````````````````````````````````````````````````````` ; Sets guidance meter bits and variable. ; _Bit7_Guide_Stick_Moved{7} = 0 : _Guidance_Counter = 0 if !joy0left && !joy0right then _Bit3_Guide_Button{3} = 1 ;``````````````````````````````````````````````````````````````` ; If game is not over, skip this little subsection. ; if !_Bit0_Game_is_Over{0} then goto __Skip_Game_Over ;``````````````````````````````````````````````````````````````` ; If two seconds have gone by, reset the game. ; if _Bit1_Two_Seconds{1} then goto __Start_Restart bank2 goto __Skip_Fire __Skip_Game_Over ;``````````````````````````````````````````````````````````````` ; If new ball pause is not on, skip this section. ; if !_Bit7_New_Ball_Pause{7} then goto __Skip_Fire ;``````````````````````````````````````````````````````````````` ; Clears the new ball pause bit. ; _Bit7_New_Ball_Pause{7} = 0 ;``````````````````````````````````````````````````````````````` ; Turns on ball appearance sound effect. ; _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : _C1_Counter = 0 : _C1_Duration = 1 : _Bit5_C1_Ball_Appear{5} = 1 ;``````````````````````````````````````````````````````````````` ; Starts ball (player1x) at random position above paddle. ; player1x = (rand/16) + player0x + 4 : if player1x > 142 then player1x = 140 ;``````````````````````````````````````````````````````````````` ; Starting y position for ball (player1y). ; player1y = 77 ;``````````````````````````````````````````````````````````````` ; Starting angle of ball. ; _Angle_x = _45x : _Angle_y = _45y ;``````````````````````````````````````````````````````````````` ; Ball x (player1x) starting direction is random. ; _My_Temp1 = (rand & %00100000) _Bit5_Ball_Direction_x = _Bit5_Ball_Direction_x ^ _My_Temp1 ;``````````````````````````````````````````````````````````````` ; Bally (player1y) starting direction is down. ; _Bit6_Ball_Direction_y{6} = 1 goto __Skip_Fire __Skip_Fire ;*************************************************************** ; ; 13 Guidance Meter. ; ;``````````````````````````````````````````````````````````````` ; If pause is on, skip this section. ; if _Bit7_New_Ball_Pause{7} then goto __Skip_Fire2 ;``````````````````````````````````````````````````````````````` ; If ball has just been released from pause, skip this section. ; if _Bit5_C1_Ball_Appear{5} then _Bit7_Guide_Stick_Moved{7} = 0 : _Guidance_Counter = 30 : goto __Skip_Fire2 ;``````````````````````````````````````````````````````````````` ; If guidance meter is empty, skip this section. ; if !pfscore2 then _Bit7_Guide_Stick_Moved{7} = 0 : _Guidance_Counter = 20 : goto __Skip_Fire2 ;``````````````````````````````````````````````````````````````` ; If joystick not moved left or right, skip to guide test. ; if !joy0left && !joy0right then goto __Guide_Test ;``````````````````````````````````````````````````````````````` ; If joystick was moving left or right when the fire button ; was pressed, skip this section. ; if !_Bit3_Guide_Button{3} then goto __Skip_Fire2 ;``````````````````````````````````````````````````````````````` ; Joystick has moved left or right, skip guide test. ; goto __Skip_Guide_Stick_Test __Guide_Test ;``````````````````````````````````````````````````````````````` ; If joystick has previously moved left or right and the fire ; button was previously pressed, clear variables and dec the ; guidance meter. ; if _Bit7_Guide_Stick_Moved{7} && _Bit3_Guide_Button{3} then _Bit7_Guide_Stick_Moved{7} = 0 : _Bit3_Guide_Button{3} = 0 : _Guidance_Counter = 30 : goto __Dec_Guidance_Meter goto __Skip_Fire2 __Skip_Guide_Stick_Test ;``````````````````````````````````````````````````````````````` ; Sets stick movement bit for guidance meter. ; _Bit7_Guide_Stick_Moved{7} = 1 ;``````````````````````````````````````````````````````````````` ; If guidance counter hits the limit, skip this section. ; if _Guidance_Counter > 19 then _Bit7_Guide_Stick_Moved{7} = 0 : _Bit3_Guide_Button{3} = 0 : goto __Skip_Fire2 ;``````````````````````````````````````````````````````````````` ; Increases guidance counter. ; _Guidance_Counter = _Guidance_Counter + 1 ;``````````````````````````````````````````````````````````````` ; If counter hasn't hit limit, skip ahead to nudge ball. ; if _Guidance_Counter < 20 then goto __Guide_Ball ;``````````````````````````````````````````````````````````````` ; Counter hit limit, so skip this section. ; goto __Skip_Fire2 __Dec_Guidance_Meter ;``````````````````````````````````````````````````````````````` ; Turns on guidance sound effect. ; _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : _C1_Counter = 0 : _C1_Duration = 1 : _Bit3_C1_Guidance{3} = 1 ;``````````````````````````````````````````````````````````````` ; If there is a guidance surplus, remove one and skip. ; if _Extra_Guidance > 0 then _Extra_Guidance = _Extra_Guidance - 1 : goto __Skip_Fire2 ;``````````````````````````````````````````````````````````````` ; Decrements one notch from the guidance meter. ; pfscore2 = pfscore2/2 goto __Skip_Fire2 __Guide_Ball ;``````````````````````````````````````````````````````````````` ; If joystick is moved left, move the ball left. If the ball ; was going right, move it left one more time. ; if joy0left then _p1_Ball_x = _p1_Ball_x - 0.400 : if _Bit5_Ball_Direction_x{5} then _p1_Ball_x = _p1_Ball_x - 0.400 ;``````````````````````````````````````````````````````````````` ; If joystick is moved right, move the ball right. If the ball ; was going left, move it right one more time. ; if joy0right then _p1_Ball_x = _p1_Ball_x + 0.400 : if !_Bit5_Ball_Direction_x{5} then _p1_Ball_x = _p1_Ball_x + 0.400 ;``````````````````````````````````````````````````````````````` ; Keeps the ball from going too far left. ; if _p1_Ball_x < 16 then player1x = 16 ;``````````````````````````````````````````````````````````````` ; Keeps the ball from going too far right. ; _My_Temp1 = 142 - (_Ball_Height/2) if _p1_Ball_x > _My_Temp1 then player1x = _My_Temp1 __Skip_Fire2 ;*************************************************************** ; ; 14 Move the ball. ; ;``````````````````````````````````````````````````````````````` ; If new ball pause is on, skip this section. ; if _Bit7_New_Ball_Pause{7} then goto __Skip_Ball_Movement ;``````````````````````````````````````````````````````````````` ; Move the ball left or right depending on direction bit. ; if !_Bit5_Ball_Direction_x{5} then _p1_Ball_x = _p1_Ball_x - _Angle_x if _Bit5_Ball_Direction_x{5} then _p1_Ball_x = _p1_Ball_x + _Angle_x ;``````````````````````````````````````````````````````````````` ; Move the ball up or down depending on direction bit. ; if !_Bit6_Ball_Direction_y{6} then _p1_Ball_y = _p1_Ball_y - _Angle_y : if _Speed_Counter && player1y > 70 then _p1_Ball_y = _p1_Ball_y - _Angle_y if _Bit6_Ball_Direction_y{6} then _p1_Ball_y = _p1_Ball_y + _Angle_y : if _Speed_Counter && player1y > 70 then _p1_Ball_y = _p1_Ball_y + _Angle_y __Skip_Ball_Movement ;*************************************************************** ; ; 15 Block destruction effect (player2 shrinks). ; ;``````````````````````````````````````````````````````````````` ; If player2y isn't on the screen, skip this section. ; if player2y > 180 then goto __Skip_Destruction ;``````````````````````````````````````````````````````````````` ; Increment the master counter. ; _Master_Counter = _Master_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Slows down animation. ; if _Master_Counter < 3 then goto __Skip_Frame_Counter ;``````````````````````````````````````````````````````````````` ; Gets animation frame. ; on _Frame_Counter goto __0 __1 __2 __3 __Destruction_Return ;``````````````````````````````````````````````````````````````` ; Increase frame counter and clear master counter. ; _Frame_Counter = _Frame_Counter + 1 : _Master_Counter = 0 ;``````````````````````````````````````````````````````````````` ; if animation is over, move sprite off screen. ; if _Frame_Counter > 3 then player2y = 220 __Skip_Frame_Counter __Skip_Destruction ;*************************************************************** ; ; 16 Move dropped token. ; ;``````````````````````````````````````````````````````````````` ; Move the real ball (shaped like a block) down the screen. ; if bally > 170 then goto __Skip_Token_Movement ;``````````````````````````````````````````````````````````````` ; Move token. ; _Dropped_Token_y = _Dropped_Token_y + 0.900 if _Bit2_C1_Lose_Ball{2} then goto __Skip_Token_Sound if _Bit3_C1_Game_Over{3} then goto __Skip_Token_Sound ;``````````````````````````````````````````````````````````````` ; Make bad token dropping sound if bad token on screen. ; if !_Bit6_C1_Bad_Token{6} && _Token_Color = 1 then _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : _C1_Counter = 0 : _C1_Duration = 1 : _Bit6_C1_Bad_Token{6} = 1 ;``````````````````````````````````````````````````````````````` ; Make good token dropping sound if good token on screen. ; if !_Bit7_C1_Good_Token{7} && _Token_Color = 2 then _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : _C1_Counter = 0 : _C1_Duration = 1 : _Bit7_C1_Good_Token{7} = 1 __Skip_Token_Sound ;``````````````````````````````````````````````````````````````` ; If token on screen, skip this section. ; if bally < 171 then goto __Skip_Token_Movement ;``````````````````````````````````````````````````````````````` ; Good token missed, so make good token lost sound. ; if _Token_Color = 2 then _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : _C1_Counter = 0 : _C1_Duration = 1 : _Bit0_C1_Good_Lost{0} = 1 ;``````````````````````````````````````````````````````````````` ; Move token off screen and clear token variable. ; bally = 220 : _Token_Color = 0 __Skip_Token_Movement ;*************************************************************** ; ; 17 Token collision. ; ;``````````````````````````````````````````````````````````````` ; If paddle does not touch a token, skip this section. ; if !collision(ball,player0) then goto __Skip_Token_Collision ;``````````````````````````````````````````````````````````````` ; If bad token touched, speed up ball and turn on sound. ; if _Token_Color = 1 then _Speed_Counter = 7 : _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : _C1_Counter = 0 : _C1_Duration = 1 : _Bit2_C1_Bad_Got{2} = 1 ;``````````````````````````````````````````````````````````````` ; If anything other than good token, skip this section. ; if _Token_Color <> 2 then goto __Skip_Token_Extra_Ball ;``````````````````````````````````````````````````````````````` ; Turn on good token collision with paddle sound effect. ; _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : _C1_Counter = 0 : _C1_Duration = 1 : _Bit1_C1_Good_Got{1} = 1 ;``````````````````````````````````````````````````````````````` ; Increments token guidance counter. ; _Token_Guidance_Counter = _Token_Guidance_Counter + 1 ;``````````````````````````````````````````````````````````````` ; If counter hasn't reached limit, skip extra guidance. ; if _Token_Guidance_Counter < 5 then goto __Skip_Extra_Guidance ;``````````````````````````````````````````````````````````````` ; Clear the token guidance counter and color cycle variable. ; _Token_Guidance_Counter = 0 : _Cycle_Guidance_Counter = 0 ;``````````````````````````````````````````````````````````````` ; Turn on bit for score background color cycle. ; _Bit4_Extra_Guidance{4} = 1 ;``````````````````````````````````````````````````````````````` ; If guidance meter is full, remember the extra. ; if pfscore1 = %11111111 && _Extra_Guidance < 255 then _Extra_Guidance = _Extra_Guidance + 1 : goto __Skip_Extra_Guidance ;``````````````````````````````````````````````````````````````` ; On screen guidance meter is not full. Add to it. ; pfscore2 = pfscore2*2|1 __Skip_Extra_Guidance ;``````````````````````````````````````````````````````````````` ; Remembers the thousands digit. ; _My_Temp1 = (sc2 & $F0) ;``````````````````````````````````````````````````````````````` ; Add points to score. ; score = score + 200 ;``````````````````````````````````````````````````````````````` ; Grabs the thousands digit. ; _My_Temp2 = (sc2 & $F0) ;``````````````````````````````````````````````````````````````` ; If thousands digit has NOT changed, skip this part. ; if _My_Temp1 = _My_Temp2 then goto __Skip_Token_Extra_Ball ;``````````````````````````````````````````````````````````````` ; Turn on extra ball sound effect. ; _BitOp_C0 = 0 : _C0_Duration = 1 : _C0_Counter = 0 : _Bit5_C0_Extra_Ball{5} = 1 ;``````````````````````````````````````````````````````````````` ; If extra ball indicator is full, remember the extra ball. ; if pfscore1 = %01010101 && _Extra_Balls < 255 then _Extra_Balls = _Extra_Balls + 1 : goto __Skip_Token_Extra_Ball ;``````````````````````````````````````````````````````````````` ; On screen indicator is not full. Add extra ball to it. ; pfscore1 = pfscore1*4|1 __Skip_Token_Extra_Ball ;``````````````````````````````````````````````````````````````` ; Get rid of the token and clear token color. ; bally = 220 : _Token_Color = 0 __Skip_Token_Collision if !_Bit4_Extra_Guidance{4} then goto _Skip_GM_Color_Cycle _My_Temp1 = _Data_Guidance_Color_Cycle[_Cycle_Guidance_Counter] if _My_Temp1 = 255 then _Bit4_Extra_Guidance{4} = 0 : _Score_Background = $22 : goto _Skip_GM_Color_Cycle _Score_Background = _My_Temp1 _Cycle_Guidance_Counter = _Cycle_Guidance_Counter + 1 _Skip_GM_Color_Cycle goto __Return_From_Code bank2 __0 player2: %01111110 %01111110 %01111110 %01111110 end goto __Destruction_Return __1 player2: %00000000 %01111110 %01111110 %00000000 end goto __Destruction_Return __2 player2: %00000000 %00111100 %00111100 %00000000 end goto __Destruction_Return __3 player2: %00000000 %00000000 %00000000 %00000000 end goto __Destruction_Return data _Data_Guidance_Color_Cycle $D0,$D2,$D4,$D6,$D8,$DA,$DC,$DE,$DC,$DA,$D8,$D6,$D4,$D2 $D0,$D2,$D4,$D6,$D8,$DA,$DC,$DE,$DC,$DA,$D8,$D6,$D4,$D2 $D0,$50,$50,$52,$54,$56,$58,255 end bank 4 temp1=temp1 ;*************************************************************** ;*************************************************************** ; ; 25 Sound effect check. ; ; __Check_Sound ;*************************************************************** ; ; Checks to see if any sounds should be playing for Channel 0. ; ;``````````````````````````````````````````````````````````````` ; If sound effect is on, check for end of current note. ; if !_BitOp_C0 then goto __Sound_Return_Channel_0 _C0_Duration = _C0_Duration - 1 if _C0_Duration > 0 then goto __Sound_Return_Channel_0 ;``````````````````````````````````````````````````````````````` ; Block destruction sound effect 01. ; if _Bit0_C0_Block1{0} then goto __C0_Sound_Effect_Block1 ;``````````````````````````````````````````````````````````````` ; Block destruction sound effect 02. ; if _Bit1_C0_Block2{1} then goto __C0_Sound_Effect_Block2 ;``````````````````````````````````````````````````````````````` ; Block destruction sound effect 03. ; if _Bit2_C0_Block3{2} then goto __C0_Sound_Effect_Block3 ;``````````````````````````````````````````````````````````````` ; Block destruction sound effect 04. ; if _Bit3_C0_Block4{3} then goto __C0_Sound_Effect_Block4 ;``````````````````````````````````````````````````````````````` ; Block destruction sound effect 05. ; if _Bit4_C0_Block5{4} then goto __C0_Sound_Block_05 ;``````````````````````````````````````````````````````````````` ; Extra ball sound effect. ; if _Bit5_C0_Extra_Ball{5} then goto __C0_Sound_Extra_Ball __Sound_Return_Channel_0 ;*************************************************************** ; ; Checks to see if any sounds should be playing for Channel 1. ; ;``````````````````````````````````````````````````````````````` ; If sound effect is on, check for end of current note. ; if !_BitOp_C1 && !_BitOp_C1S2 then goto __Sound_Return_Channel_1 _C1_Duration = _C1_Duration - 1 if _C1_Duration > 0 then goto __Sound_Return_Channel_1 ;``````````````````````````````````````````````````````````````` ; Paddle hit sound effect. ; if _Bit0_C1_Paddle{0} then goto __C1_Sound_Effect_Paddle ;``````````````````````````````````````````````````````````````` ; Wall hit sound effect. ; if _Bit1_C1_Walls{1} then goto __C1_Sound_Effect_Walls ;``````````````````````````````````````````````````````````````` ; Lose Ball sound effect. ; if _Bit2_C1_Lose_Ball{2} then goto __C1_Sound_Effect_Lose_Ball ;``````````````````````````````````````````````````````````````` ; Game over sound effect. ; if _Bit3_C1_Game_Over{3} then goto __C1_Sound_Effect_Game_Over ;``````````````````````````````````````````````````````````````` ; Start game sound effect. ; if _Bit4_C1_Start_Game{4} then goto __C1_Sound_Effect_Start_Game ;``````````````````````````````````````````````````````````````` ; Ball appear sound effect. ; if _Bit5_C1_Ball_Appear{5} then goto __C1_Sound_Effect_Ball_Appear ;``````````````````````````````````````````````````````````````` ; Bad token falling sound effect. ; if _Bit6_C1_Bad_Token{6} then goto __C1_Sound_Effect_Bad_Token ;``````````````````````````````````````````````````````````````` ; Good token falling sound effect. ; if _Bit7_C1_Good_Token{7} then goto __C1_Sound_Effect_Good_Token ;``````````````````````````````````````````````````````````````` ; Good token lost. ; if _Bit0_C1_Good_Lost{0} then goto __C1_Sound_Effect_Good_Lost ;``````````````````````````````````````````````````````````````` ; Good token collision with paddle. ; if _Bit1_C1_Good_Got{1} then goto __C1_Sound_Effect_Good_Got ;``````````````````````````````````````````````````````````````` ; Bad token collision with paddle. ; if _Bit2_C1_Bad_Got{2} then goto __C1_Sound_Effect_Bad_Got ;``````````````````````````````````````````````````````````````` ; Guidance meter used. ; if _Bit3_C1_Guidance{3} then goto __C1_Sound_Effect_Guidance __Sound_Return_Channel_1 goto __Done_Check_Sound bank2 ;*************************************************************** ; ; ; Sound effect data starts here. ; ; ;*************************************************************** ;*************************************************************** ; ; Block destruction sound effect 01. _Bit0_C0_Block1{0} ; __C0_Sound_Effect_Block1 ;``````````````````````````````````````````````````````````````` ; Retrieve channel 0 data. ; _My_Temp1 = _Data_Sound_Block1[_C0_Counter] : _C0_Counter = _C0_Counter + 1 _My_Temp2 = _Data_Sound_Block1[_C0_Counter] : _C0_Counter = _C0_Counter + 1 _My_Temp3 = _Data_Sound_Block1[_C0_Counter] : _C0_Counter = _C0_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C0_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 0. ; AUDV0 = _My_Temp1 AUDC0 = _My_Temp2 AUDF0 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set Duration. ; _C0_Duration = _Data_Sound_Block1[_C0_Counter] : _C0_Counter = _C0_Counter + 1 goto __Sound_Return_Channel_0 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Sound_Block1 12,4,23 1 11,4,15 1 10,4,23 1 9,4,15 1 8,4,23 1 7,4,15 1 6,4,23 1 5,4,15 1 4,4,23 1 3,4,15 1 2,4,23 1 1,4,15 1 255 end ;*************************************************************** ; ; Block destruction sound effect 02. _Bit1_C0_Block2{1} ; __C0_Sound_Effect_Block2 ;``````````````````````````````````````````````````````````````` ; Retrieve channel 0 data. ; _My_Temp1 = _Data_Sound_Block2[_C0_Counter] : _C0_Counter = _C0_Counter + 1 _My_Temp2 = _Data_Sound_Block2[_C0_Counter] : _C0_Counter = _C0_Counter + 1 _My_Temp3 = _Data_Sound_Block2[_C0_Counter] : _C0_Counter = _C0_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C0_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 0. ; AUDV0 = _My_Temp1 AUDC0 = _My_Temp2 AUDF0 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set Duration. ; _C0_Duration = _Data_Sound_Block2[_C0_Counter] : _C0_Counter = _C0_Counter + 1 goto __Sound_Return_Channel_0 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Sound_Block2 12,4,29 1 11,4,19 1 10,4,29 1 9,4,19 1 8,4,29 1 7,4,19 1 6,4,29 1 5,4,19 1 4,4,29 1 3,4,19 1 2,4,29 1 1,4,19 1 255 end ;*************************************************************** ; ; Block destruction sound effect 03. _Bit2_C0_Block3{2} ; __C0_Sound_Effect_Block3 ;``````````````````````````````````````````````````````````````` ; Retrieve channel 0 data. ; _My_Temp1 = _Data_Sound_Block3[_C0_Counter] : _C0_Counter = _C0_Counter + 1 _My_Temp2 = _Data_Sound_Block3[_C0_Counter] : _C0_Counter = _C0_Counter + 1 _My_Temp3 = _Data_Sound_Block3[_C0_Counter] : _C0_Counter = _C0_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C0_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 0. ; AUDV0 = _My_Temp1 AUDC0 = _My_Temp2 AUDF0 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set Duration. ; _C0_Duration = _Data_Sound_Block3[_C0_Counter] : _C0_Counter = _C0_Counter + 1 goto __Sound_Return_Channel_0 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Sound_Block3 12,4,27 1 11,4,23 1 10,4,27 1 9,4,23 1 8,4,27 1 7,4,23 1 6,4,27 1 5,4,23 1 4,4,27 1 3,4,23 1 2,4,27 1 1,4,23 1 255 end ;*************************************************************** ; ; Block destruction sound effect 04. _Bit3_C0_Block4{3} ; __C0_Sound_Effect_Block4 ;``````````````````````````````````````````````````````````````` ; Retrieve channel 0 data. ; _My_Temp1 = _Data_Sound_Block4[_C0_Counter] : _C0_Counter = _C0_Counter + 1 _My_Temp2 = _Data_Sound_Block4[_C0_Counter] : _C0_Counter = _C0_Counter + 1 _My_Temp3 = _Data_Sound_Block4[_C0_Counter] : _C0_Counter = _C0_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C0_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 0. ; AUDV0 = _My_Temp1 AUDC0 = _My_Temp2 AUDF0 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set Duration. ; _C0_Duration = _Data_Sound_Block4[_C0_Counter] : _C0_Counter = _C0_Counter + 1 goto __Sound_Return_Channel_0 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Sound_Block4 12,4,31 1 11,4,24 1 10,4,31 1 9,4,24 1 8,4,31 1 7,4,24 1 6,4,31 1 5,4,24 1 4,4,31 1 3,4,24 1 2,4,31 1 1,4,24 1 255 end ;*************************************************************** ; ; Block destruction sound effect 05. _Bit4_C0_Block5{4} ; __C0_Sound_Block_05 ;``````````````````````````````````````````````````````````````` ; Retrieve channel 0 data. ; _My_Temp1 = _Data_Block05[_C0_Counter] : _C0_Counter = _C0_Counter + 1 _My_Temp2 = _Data_Block05[_C0_Counter] : _C0_Counter = _C0_Counter + 1 _My_Temp3 = _Data_Block05[_C0_Counter] : _C0_Counter = _C0_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C0_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 0. ; AUDV0 = _My_Temp1 AUDC0 = _My_Temp2 AUDF0 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set Duration. ; _C0_Duration = _Data_Block05[_C0_Counter] : _C0_Counter = _C0_Counter + 1 goto __Sound_Return_Channel_0 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Block05 12,4,24 1 11,4,20 1 10,4,24 1 9,4,20 1 8,4,24 1 7,4,20 1 6,4,24 1 5,4,20 1 4,4,24 1 3,4,20 1 2,4,24 1 1,4,20 1 255 end ;*************************************************************** ; ; Extra ball sound effect. _Bit5_C0_Extra_Ball{5} ; __C0_Sound_Extra_Ball ;``````````````````````````````````````````````````````````````` ; Retrieve channel 0 data. ; _My_Temp1 = _Data_Extra_Ball[_C0_Counter] : _C0_Counter = _C0_Counter + 1 _My_Temp2 = _Data_Extra_Ball[_C0_Counter] : _C0_Counter = _C0_Counter + 1 _My_Temp3 = _Data_Extra_Ball[_C0_Counter] : _C0_Counter = _C0_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C0_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 0. ; AUDV0 = _My_Temp1 AUDC0 = _My_Temp2 AUDF0 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set Duration. ; _C0_Duration = _Data_Extra_Ball[_C0_Counter] : _C0_Counter = _C0_Counter + 1 goto __Sound_Return_Channel_0 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Extra_Ball 12,4,24 1 11,4,20 1 10,4,24 1 9,4,20 1 8,4,24 1 7,4,20 1 6,4,24 1 5,4,20 1 4,4,24 1 3,4,20 1 2,4,24 1 1,4,20 1 2,4,20 1 4,4,20 1 8,4,20 1 4,4,20 1 2,4,20 1 2,4,18 1 4,4,18 1 8,4,18 1 4,4,18 1 2,4,18 1 2,4,16 1 4,4,16 1 8,4,16 1 4,4,16 1 2,4,16 1 2,4,13 1 4,4,13 1 8,4,13 1 4,4,13 1 2,4,13 1 4,4,13 1 2,4,13 8 255 end ;*************************************************************** ; ; Paddle hit sound effect. _Bit0_C1_Paddle{0} ; __C1_Sound_Effect_Paddle ;``````````````````````````````````````````````````````````````` ; Retrieve channel 1 data. ; _My_Temp1 = _Data_Sound_Paddle[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp2 = _Data_Sound_Paddle[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp3 = _Data_Sound_Paddle[_C1_Counter] : _C1_Counter = _C1_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C1_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 1. ; AUDV1 = _My_Temp1 AUDC1 = _My_Temp2 AUDF1 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set duration. ; _C1_Duration = _Data_Sound_Paddle[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Sound_Paddle 12,14,30 1 12,8,30 1 12,14,0 1 10,8,6 1 7,14,2 1 8,8,30 1 5,14,4 1 6,8,6 1 4,8,30 1 2,14,6 2 2,8,6 1 2,8,30 4 255 end ;*************************************************************** ; ; Wall bash sound effect. _Bit1_C1_Walls{1} ; __C1_Sound_Effect_Walls ;``````````````````````````````````````````````````````````````` ; Retrieve channel 1 data. ; _My_Temp1 = _Data_Sound_Walls[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp2 = _Data_Sound_Walls[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp3 = _Data_Sound_Walls[_C1_Counter] : _C1_Counter = _C1_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C1_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 1. ; AUDV1 = _My_Temp1 AUDC1 = _My_Temp2 AUDF1 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set duration. ; _C1_Duration = _Data_Sound_Walls[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Sound_Walls 10,8,30 1 8,8,6 1 6,8,30 1 5,8,6 1 4,8,30 1 3,8,6 1 2,8,30 4 255 end ;*************************************************************** ; ; Lose ball sound effect. _Bit2_C1_Lose_Ball{2} ; __C1_Sound_Effect_Lose_Ball ;``````````````````````````````````````````````````````````````` ; Retrieve channel 1 data. ; _My_Temp1 = _Data_Sound_Lose_Ball[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp2 = _Data_Sound_Lose_Ball[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp3 = _Data_Sound_Lose_Ball[_C1_Counter] : _C1_Counter = _C1_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C1_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 1. ; AUDV1 = _My_Temp1 AUDC1 = _My_Temp2 AUDF1 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set duration. ; _C1_Duration = _Data_Sound_Lose_Ball[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Sound_Lose_Ball 2,14,3 1 4,14,3 1 6,14,3 1 8,14,3 8 2,14,3 8 0,0,0 4 2,14,5 1 4,14,5 1 6,14,5 1 8,14,5 12 2,14,5 8 255 end ;*************************************************************** ; ; Game over sound effect. _Bit3_C1_Game_Over{3} ; __C1_Sound_Effect_Game_Over ;``````````````````````````````````````````````````````````````` ; Retrieve channel 1 data. ; _My_Temp1 = _Data_Sound_Game_Over[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp2 = _Data_Sound_Game_Over[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp3 = _Data_Sound_Game_Over[_C1_Counter] : _C1_Counter = _C1_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C1_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 1. ; AUDV1 = _My_Temp1 AUDC1 = _My_Temp2 AUDF1 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set duration. ; _C1_Duration = _Data_Sound_Game_Over[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Sound_Game_Over 8,14,2 2 2,14,2 8 0,0,0 2 8,14,1 2 2,14,1 8 0,0,0 1 8,14,3 2 2,14,3 8 0,0,0 1 8,14,4 2 2,14,4 8 0,0,0 4 8,14,5 12 2,14,5 8 255 end ;*************************************************************** ; ; Game start sound effect. _Bit4_C1_Start_Game{4} ; __C1_Sound_Effect_Start_Game ;``````````````````````````````````````````````````````````````` ; Retrieve channel 1 data. ; _My_Temp1 = _Data_Sound_Start_Game[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp2 = _Data_Sound_Start_Game[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp3 = _Data_Sound_Start_Game[_C1_Counter] : _C1_Counter = _C1_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C1_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 1. ; AUDV1 = _My_Temp1 AUDC1 = _My_Temp2 AUDF1 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set duration. ; _C1_Duration = _Data_Sound_Start_Game[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Sound_Start_Game 8,14,2 2 2,14,2 8 0,0,0 2 8,14,1 2 2,14,1 8 0,0,0 1 8,14,3 2 2,14,3 8 0,0,0 1 8,14,1 2 2,14,1 8 0,0,0 1 8,14,2 2 2,14,2 8 255 end ;*************************************************************** ; ; Ball appearance sound effect. _Bit5_C1_Ball_Appear{5} ; __C1_Sound_Effect_Ball_Appear ;``````````````````````````````````````````````````````````````` ; Retrieve channel 1 data. ; _My_Temp1 = _Data_Sound_Ball_Appear[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp2 = _Data_Sound_Ball_Appear[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp3 = _Data_Sound_Ball_Appear[_C1_Counter] : _C1_Counter = _C1_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C1_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 1. ; AUDV1 = _My_Temp1 AUDC1 = _My_Temp2 AUDF1 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set duration. ; _C1_Duration = _Data_Sound_Ball_Appear[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Sound_Ball_Appear 2,8,9 1 4,8,8 1 6,8,7 1 8,8,6 1 6,8,5 1 4,8,4 1 2,8,3 1 255 end ;*************************************************************** ; ; Bad token falling. _Bit6_C1_Bad_Token{6} ; __C1_Sound_Effect_Bad_Token ;``````````````````````````````````````````````````````````````` ; Retrieve channel 1 data. ; _My_Temp1 = _Data_Bad_Token[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp2 = _Data_Bad_Token[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp3 = _Data_Bad_Token[_C1_Counter] : _C1_Counter = _C1_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C1_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 1. ; AUDV1 = _My_Temp1 AUDC1 = _My_Temp2 AUDF1 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set duration. ; _C1_Duration = _Data_Bad_Token[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Bad_Token 2,6,22 1 4,6,20 1 6,6,22 1 8,6,20 1 6,6,22 1 4,6,20 1 2,6,22 1 4,6,20 1 6,6,22 1 8,6,20 1 6,6,22 1 4,6,20 1 2,6,22 8 0,0,0 10 255 end ;*************************************************************** ; ; Good token falling. _Bit7_C1_Good_Token{7} ; __C1_Sound_Effect_Good_Token ;``````````````````````````````````````````````````````````````` ; Retrieve channel 1 data. ; _My_Temp1 = _Data_Good_Token[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp2 = _Data_Good_Token[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp3 = _Data_Good_Token[_C1_Counter] : _C1_Counter = _C1_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C1_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 1. ; AUDV1 = _My_Temp1 AUDC1 = _My_Temp2 AUDF1 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set duration. ; _C1_Duration = _Data_Good_Token[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Good_Token 2,12,3 1 3,12,4 1 4,12,3 1 3,12,5 1 2,12,4 1 3,12,6 1 4,12,5 1 3,12,7 1 2,12,6 1 3,12,8 1 4,12,7 1 3,12,9 1 2,12,10 1 3,12,9 1 4,12,11 1 3,12,10 1 4,12,12 1 3,12,11 1 2,12,12 1 3,12,10 1 4,12,11 1 3,12,9 1 2,12,10 1 3,12,8 1 4,12,9 1 3,12,7 1 2,12,8 1 3,12,6 1 4,12,7 1 3,12,5 1 2,12,6 1 3,12,4 1 4,12,5 1 3,12,3 1 2,12,4 1 0,0,0 10 255 end ;*************************************************************** ; ; Good token lost. _Bit0_C1_Good_Lost{0} ; __C1_Sound_Effect_Good_Lost ;``````````````````````````````````````````````````````````````` ; Retrieve channel 1 data. ; _My_Temp1 = _Data_Good_Lost[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp2 = _Data_Good_Lost[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp3 = _Data_Good_Lost[_C1_Counter] : _C1_Counter = _C1_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C1_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 1. ; AUDV1 = _My_Temp1 AUDC1 = _My_Temp2 AUDF1 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set duration. ; _C1_Duration = _Data_Good_Lost[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Good_Lost 8,6,10 1 6,6,10 1 4,6,10 2 2,6,10 8 8,6,13 1 6,6,13 1 4,6,13 2 2,6,13 8 255 end ;*************************************************************** ; ; Good token collected. _Bit1_C1_Good_Got{1} ; __C1_Sound_Effect_Good_Got ;``````````````````````````````````````````````````````````````` ; Retrieve channel 1 data. ; _My_Temp1 = _Data_Good_Got[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp2 = _Data_Good_Got[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp3 = _Data_Good_Got[_C1_Counter] : _C1_Counter = _C1_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C1_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 1. ; AUDV1 = _My_Temp1 AUDC1 = _My_Temp2 AUDF1 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set duration. ; _C1_Duration = _Data_Good_Got[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Good_Got 8,12,23 1 4,12,23 1 2,12,23 1 6,12,23 1 2,12,23 3 8,12,19 1 4,12,19 1 2,12,19 1 6,12,19 1 2,12,19 3 8,12,14 1 4,12,14 1 2,12,14 1 6,12,14 1 2,12,14 8 255 end ;*************************************************************** ; ; Bad token collected. _Bit2_C1_Bad_Got{2} ; __C1_Sound_Effect_Bad_Got ;``````````````````````````````````````````````````````````````` ; Retrieve channel 1 data. ; _My_Temp1 = _Data_Bad_Got[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp2 = _Data_Bad_Got[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp3 = _Data_Bad_Got[_C1_Counter] : _C1_Counter = _C1_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C1_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 1. ; AUDV1 = _My_Temp1 AUDC1 = _My_Temp2 AUDF1 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set duration. ; _C1_Duration = _Data_Bad_Got[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Bad_Got 2,8,12 1 5,8,31 1 6,8,13 1 7,8,30 1 8,8,14 1 9,8,29 1 10,8,15 1 11,8,28 1 12,8,16 1 11,8,27 1 10,8,17 1 9,8,26 1 8,8,18 1 7,8,25 1 6,8,20 1 5,8,24 1 4,8,21 1 3,8,23 1 2,8,22 1 2,8,31 8 255 end ;*************************************************************** ; ; Guidance meter used. _Bit3_C1_Guidance{3} ; __C1_Sound_Effect_Guidance ;``````````````````````````````````````````````````````````````` ; Retrieve channel 1 data. ; _My_Temp1 = _Data_Guidance_Used[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp2 = _Data_Guidance_Used[_C1_Counter] : _C1_Counter = _C1_Counter + 1 _My_Temp3 = _Data_Guidance_Used[_C1_Counter] : _C1_Counter = _C1_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Check for end of data. ; if _My_Temp1 = 255 then goto __C1_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Play channel 1. ; AUDV1 = _My_Temp1 AUDC1 = _My_Temp2 AUDF1 = _My_Temp3 ;``````````````````````````````````````````````````````````````` ; Set duration. ; _C1_Duration = _Data_Guidance_Used[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 ;``````````````````````````````````````````````````````````````` ; Sound effect data. ; data _Data_Guidance_Used 2,15,5 1 2,15,6 1 4,15,5 1 2,15,6 1 6,15,5 1 2,15,6 1 8,15,5 1 2,15,6 1 6,15,5 1 2,15,6 1 4,15,5 1 2,15,6 1 2,15,5 2 255 end ;*************************************************************** ; ; Done with channel 0 sound. ; __C0_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Clear and set variables related to channel 0 sound. ; _C0_Duration = 1 : _C0_Counter = 0 : _BitOp_C0 = 0 : AUDV0=0 : goto __Sound_Return_Channel_0 ;*************************************************************** ; ; Done with channel 1 sound. ; __C1_Sound_Done_255 ;``````````````````````````````````````````````````````````````` ; Clear and set variables related to channel 1 sound. ; _C1_Duration = 1 : _C1_Counter = 0 : _BitOp_C1 = 0 : _BitOp_C1S2 = 0 : AUDV1=0 : goto __Sound_Return_Channel_1 bank 5 temp1=temp1 bank 6 temp1=temp1