rem **************************************************************** rem * rem * ChipOff rem * rem * Example program by Duane Alan Hahn (Random Terrain) using rem * hints, tips, code snippets, and more from AtariAge members rem * such as batari, SeaGtGruff, RevEng, Robert M, Nukey Shay, rem * Atarius Maximus, jrok, supercat, GroovyBee, and bogax. rem * rem **************************************************************** rem * rem * Instructions: rem * rem * Use the joystick to move the paddle. Press fire button to rem * activate ball. Extra ball awarded every 1,000 points. rem * rem **************************************************************** rem * rem * Below is a list of Angles that you might need if you want rem * to make changes to this program: rem * rem * Angle X/COS Y/SIN rem * 05 1.494 0.130 rem * 10 1.477 0.261 rem * 15 1.449 0.388 rem * 20 1.410 0.513 rem * 25 1.359 0.634 rem * 30 1.299 0.750 rem * 35 1.228 0.861 rem * 40 1.149 0.964 rem * 45 1 1 rem * 50 0.964 1.149 rem * 55 0.861 1.228 rem * 60 0.750 1.299 rem * 65 0.634 1.359 rem * 70 0.513 1.410 rem * 75 0.388 1.449 rem * 80 0.261 1.477 rem * 85 0.130 1.494 rem * rem **************************************************************** rem ***************************************************************** rem * rem * Kernel options for this program. rem ` set kernel_options pfcolors rem ***************************************************************** rem * rem * Some multiplication operations require you to include rem * a module. rem ` include div_mul.asm rem ***************************************************************** rem * rem * This program has 2 banks (8k/4k = 2 banks). rem ` set romsize 8kSC rem ***************************************************************** rem * rem * Random numbers can slow down bankswitched games. rem * This will speed things up. rem ` set optimization inlinerand rem **************************************************************** rem * rem * Create aliases for variables. rem * rem **************************************************************** rem ` rem ` (You can have more than one alias for each variable.) rem ` rem ```````````````````````````````````````````````````````````````` rem ```````````````````````````````````````````````````````````````` rem ` 8.8 fixed point movement for the paddle. rem ` dim _Paddle_x = player0x.a rem ```````````````````````````````````````````````````````````````` rem ` 8.8 fixed point movement for the ball (missile0). rem ` dim _M_Ball_x = missile0x.b dim _M_Ball_y = missile0y.c rem ```````````````````````````````````````````````````````````````` rem ` 8.8 fixed point movement for the block destruction effect. rem ` dim _Block_Effect_y = bally.d rem ```````````````````````````````````````````````````````````````` rem ` Counts the number of blocks destroyed. rem ` dim _Block_Count = f rem ```````````````````````````````````````````````````````````````` rem ` Adds a slight bounce to the paddle when the ball hits it. rem ` dim _Paddle_Bounce_Counter = g rem ```````````````````````````````````````````````````````````````` rem ` Sound channel 0 duration and counter. rem ` dim _C0_Duration = i dim _C0_Counter = j rem ```````````````````````````````````````````````````````````````` rem ` Sound channel 1 duration and counter. rem ` dim _C1_Duration = k dim _C1_Counter = l rem ```````````````````````````````````````````````````````````````` rem ` Bits used to turn channel 0 sound efects off and on. rem ` dim _BitOp_C0 = m dim _Bit0_C0_Block1 = m dim _Bit1_C0_Block2 = m dim _Bit2_C0_Block3 = m dim _Bit3_C0_Block4 = m dim _Bit4_C0_Block5 = m dim _Bit5_C0_Extra_Ball = m rem ```````````````````````````````````````````````````````````````` rem ` Bits used to turn channel 1 sound efects off and on. rem ` dim _BitOp_C1 = n dim _Bit0_C1_Paddle = n dim _Bit1_C1_Walls = n dim _Bit2_C1_Lose_Ball = n dim _Bit3_C1_Game_Over = n dim _Bit4_C1_Start_Game = n dim _Bit5_C1_Ball_Appear = n rem ```````````````````````````````````````````````````````````````` rem ` Keeps the same block sound from playing twice in a row. rem ` dim _Sound_Memory = o rem ```````````````````````````````````````````````````````````````` rem ` Angles used by the ball (missile0). rem ` dim _Angle_x = p.q dim _Angle_y = r.s rem ```````````````````````````````````````````````````````````````` rem ` Converted ball coordinates for playfield. rem ` dim _pf_x = t dim _pf_y = u rem ```````````````````````````````````````````````````````````````` rem ` All-purpose bits for various jobs. rem ` dim _BitOp_All_Purpose_01 = v rem ```````````````````````````````````````````````````````````````` rem ` Fixes it so holding it down will not make it keep resetting. rem ` dim _Bit0_Reset_Restrainer = v rem ```````````````````````````````````````````````````````````````` rem ` One fire button press at a time. rem ` dim _Bit1_Joy0_Restrainer = v rem ```````````````````````````````````````````````````````````````` rem ` Makes sure only one block is destroyed at a time. rem ` dim _Bit2_Block_Hit = v rem ```````````````````````````````````````````````````````````````` rem ` Tells program when side border is hit. rem ` dim _Bit3_Side_Hit = v rem ```````````````````````````````````````````````````````````````` rem ` Left/right ball direction (missile0). rem ` dim _Bit5_Ball_Direction_x = v rem ```````````````````````````````````````````````````````````````` rem ` Up/down ball direction (missile0). rem ` dim _Bit6_Ball_Direction_y = v rem ```````````````````````````````````````````````````````````````` rem ` No ball until player presses fire button. rem ` dim _Bit7_New_Ball_Pause = v rem ```````````````````````````````````````````````````````````````` rem ` All-purpose bits for various jobs. rem ` dim _BitOp_All_Purpose_02 = w rem ```````````````````````````````````````````````````````````````` rem ` Game over bit. rem ` dim _Bit0_Game_is_Over = w rem ```````````````````````````````````````````````````````````````` rem ` Player cannot restart until the 2 second wait is over. rem ` dim _Bit1_Two_Seconds = w rem ```````````````````````````````````````````````````````````````` rem ` Score will flip between the current score and the high score rem ` every 2 seconds. rem ` dim _Bit2_Swap_Scores = w rem ```````````````````````````````````````````````````````````````` rem ` New game bit. rem ` dim _Bit3_New_Game = w rem ```````````````````````````````````````````````````````````````` rem ` Restrainer for ball size selection with Joystick. rem ` dim _Bit4_Stick0_Restrainer = w rem ```````````````````````````````````````````````````````````````` rem ` Makes better random numbers. rem ` dim rand16 = z rem ```````````````````````````````````````````````````````````````` rem ` Variable for score background color. rem ` dim scback = var0 rem ```````````````````````````````````````````````````````````````` rem ` All purpose counter. rem ` dim _Master_Counter = var1 rem ```````````````````````````````````````````````````````````````` rem ` Counters that slide the paddle a little after movement. rem ` dim _Slide_Left = var2 dim _Slide_Right = var3 rem ```````````````````````````````````````````````````````````````` rem ` Holds any extra lives. rem ` dim _Extra_Balls = var4 rem ```````````````````````````````````````````````````````````````` rem ` NUSIZ0 variable. rem ` dim _Number_and_Size0 = var5 rem ```````````````````````````````````````````````````````````````` rem ` Width of missile. rem ` dim _Missile_Width = var6 rem ```````````````````````````````````````````````````````````````` rem ` Converts 6 digit score to 3 sets of two digits. rem ` sc1 holds the 100 thousands and 10 thousands rem ` digits of the score. sc2 holds the thousands and rem ` hundreds digits of the score. sc3 holds the tens rem ` and ones digits of the score. rem ` dim sc1 = score dim sc2 = score+1 dim sc3 = score+2 rem ```````````````````````````````````````````````````````````````` rem ` Small paddle flag. rem ` dim _Bit0_Paddle_Size = var41 rem ```````````````````````````````````````````````````````````````` rem ` These could be used for other things using different rem ` aliases, but for now, they are used to temporarily remember rem ` the score for the score/high score flip during game over. rem ` dim _Temp_Score01 = var42 dim _Temp_Score02 = var43 dim _Temp_Score03 = var44 rem ```````````````````````````````````````````````````````````````` rem ` Remembers the high score until the game is turned off. rem ` Do not clear these. rem ` dim _High_Score01 = var45 dim _High_Score02 = var46 dim _High_Score03 = var47 rem ***************************************************************** rem * rem * Defines number of playfield rows. rem ` const pfres = 32 rem **************************************************************** rem * rem * Enables pfscore bars. rem ` const pfscore = 1 rem **************************************************************** rem * rem * The ball angles used in this program. rem * (Do not use a space before or after the equals sign.) rem ` def _20x=1.410 def _20y=0.513 def _30x=1.299 def _30y=0.750 def _45x=1 def _45y=1 def _55x=0.861 def _55y=1.228 rem **************************************************************** rem **************************************************************** rem * rem * Program Start/Restart rem * rem ` __Start_Restart rem **************************************************************** rem * rem * Gets colors and more. rem ` gosub __Color_Setup rem **************************************************************** rem * rem * Makes sure the program will not go over 262 when reset. rem ` drawscreen rem **************************************************************** rem * rem * Mutes volume of both sound channels. rem ` AUDV0 = 0 : AUDV1 = 0 rem **************************************************************** rem * rem * Clears 25 of the normal 26 variables (fastest way). rem ` 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 rem **************************************************************** rem * rem * Clears most of the old playfield variables (fastest way). rem ` var0 = 0 : var1 = 2 : var2 = 0 : var3 = 0 : var4 = 0 : var5 = 0 var6 = 0 : var7 = 0 : var8 = 0 : var9 = 0 : var10 = 0 : var11 = 0 var12 = 0 : var13 = 0 : var14 = 0 : var15 = 0 : var16 = 0 : var17 = 0 var18 = 0 : var19 = 0 : var20 = 0 : var21 = 0 : var22 = 0 : var23 = 0 var24 = 0 : var25 = 0 : var26 = 0 : var27 = 0 : var28 = 0 : var29 = 0 var30 = 0 : var31 = 0 : var32 = 0 : var33 = 0 : var34 = 0 : var35 = 0 var36 = 0 : var37 = 0 : var38 = 0 : var39 = 0 : var40 = 0 : var41 = 0 var42 = 0 : var43 = 0 : var44 = 0 rem **************************************************************** rem * rem * Clears the score. rem ` score = 0 rem **************************************************************** rem * rem * Fastest way to draw the Playfield. rem ` w000 = 255 : w001 = 255 : w002 = 255 : w003 = 255 w004 = 0 : w005 = 0 : w006 = 0 : w007 = 0 w008 = 0 : w009 = 0 : w010 = 0 : w011 = 0 w012 = 0 : w013 = 0 : w014 = 0 : w015 = 0 w016 = 255 : w017 = 255 : w018 = 255 : w019 = 255 w020 = 255 : w021 = 255 : w022 = 255 : w023 = 255 w024 = 255 : w025 = 255 : w026 = 255 : w027 = 255 w028 = 255 : w029 = 255 : w030 = 255 : w031 = 255 w032 = 255 : w033 = 255 : w034 = 255 : w035 = 255 w036 = 255 : w037 = 255 : w038 = 255 : w039 = 255 w040 = 255 : w041 = 255 : w042 = 255 : w043 = 255 w044 = 255 : w045 = 255 : w046 = 255 : w047 = 255 w048 = 255 : w049 = 255 : w050 = 255 : w051 = 255 w052 = 0 : w053 = 0 : w054 = 0 : w055 = 0 w056 = 0 : w057 = 0 : w058 = 0 : w059 = 0 w060 = 0 : w061 = 0 : w062 = 0 : w063 = 0 w064 = 0 : w065 = 0 : w066 = 0 : w067 = 0 w068 = 0 : w069 = 0 : w070 = 0 : w071 = 0 w072 = 0 : w073 = 0 : w074 = 0 : w075 = 0 w076 = 0 : w077 = 0 : w078 = 0 : w079 = 0 w080 = 0 : w081 = 0 : w082 = 0 : w083 = 0 w084 = 0 : w085 = 0 : w086 = 0 : w087 = 0 w088 = 0 : w089 = 0 : w090 = 0 : w091 = 0 w092 = 0 : w093 = 0 : w094 = 0 : w095 = 0 w096 = 0 : w097 = 0 : w098 = 0 : w099 = 0 w100 = 0 : w101 = 0 : w102 = 0 : w103 = 0 w104 = 0 : w105 = 0 : w106 = 0 : w107 = 0 w108 = 0 : w109 = 0 : w110 = 0 : w111 = 0 w112 = 0 : w113 = 0 : w114 = 0 : w115 = 0 w116 = 0 : w117 = 0 : w118 = 0 : w119 = 0 w120 = 0 : w121 = 0 : w122 = 0 : w123 = 0 rem **************************************************************** rem * rem * Creates shape of paddle. rem ` player0: %1111111 %1111111 end rem **************************************************************** rem * rem * Creates shape of right side border. rem ` player1: %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 %11110000 end rem **************************************************************** rem * rem * Sets up pfscore bars. rem ` pfscore1 = %01010101 : pfscore2 = 0 rem **************************************************************** rem * rem * Starting position of player0 (paddle) sprite. rem ` player0x = 71 : player0y = 90 rem **************************************************************** rem * rem * Starting position of player1 sprite (side border). rem ` player1x = 145 : player1y = 100 rem **************************************************************** rem * rem * Places missile0 on the screen (used as the ball). rem ` missile0x = 81 : missile0y = 52 rem **************************************************************** rem * rem * Defines missile0 height (missile0 used as the ball). rem ` missile0height = 1 rem **************************************************************** rem * rem * Defines missile1 position and height (side border). rem ` missile1x = 14 : missile1y = 100 : missile1height = 100 rem **************************************************************** rem * rem * Defines block effect size and makes sure it is off screen. rem ` CTRLPF = $31 : ballheight = 2 : ballx = 200 : bally = 200 rem **************************************************************** rem * rem * Sets repetition restrainer for the reset switch. rem * (Holding it down won't make it keep resetting.) rem ` _Bit0_Reset_Restrainer{0} = 1 rem **************************************************************** rem * rem * Sets repetition restrainer for the fire button. rem * (Holding it down won't make it keep repeating.) rem ` _Bit1_Joy0_Restrainer{1} = 1 rem **************************************************************** rem * rem * Turns on new new game bit. rem ` _Bit3_New_Game{3} = 1 rem **************************************************************** rem * rem * Sets variable for NUSIZ0. rem ` _Number_and_Size0 = $15 rem **************************************************************** rem * rem * Turns on new ball pause. rem ` _Bit7_New_Ball_Pause{7} = 1 rem **************************************************************** rem * rem * Sets up the game start sound. rem ` _BitOp_C1 = 0 : _C1_Duration = 1 : _C1_Counter = 0 : _Bit4_C1_Start_Game{4} = 1 rem **************************************************************** rem **************************************************************** rem * rem * Main Loop rem * rem ` __Main_Loop rem **************************************************************** rem * rem * New game section. rem * rem ```````````````````````````````````````````````````````````````` rem ` Skip if not a new game. rem ` if !_Bit3_New_Game{3} then goto __Skip_New_Game rem ```````````````````````````````````````````````````````````````` rem ` Paddle size selection. rem ` 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 rem ```````````````````````````````````````````````````````````````` rem ` If joystick not moved, clear the stick restrainer bit. rem ` if !joy0left && !joy0right then _Bit4_Stick0_Restrainer{4} = 0 rem ```````````````````````````````````````````````````````````````` rem ` If joystick already moved, skip. rem ` if _Bit4_Stick0_Restrainer{4} then goto __Skip_Missile0_Change rem ```````````````````````````````````````````````````````````````` rem ` Ball size selection. rem ` if joy0left then _Bit4_Stick0_Restrainer{4} = 1 : _Missile_Width = _Missile_Width - 1 : if _Missile_Width = 255 then _Missile_Width = 2 if joy0right then _Bit4_Stick0_Restrainer{4} = 1 : _Missile_Width = _Missile_Width + 1 : if _Missile_Width > 2 then _Missile_Width = 0 rem ```````````````````````````````````````````````````````````````` rem ` Changes ball size based on selection. rem ` if _Missile_Width = 0 then _Number_and_Size0 = _Number_and_Size0 & $0F : missile0height = 0 if _Missile_Width = 1 then _Number_and_Size0 = _Number_and_Size0 & $0F : _Number_and_Size0 = _Number_and_Size0 | $10 : missile0height = 1 if _Missile_Width = 2 then _Number_and_Size0 = _Number_and_Size0 & $0F : _Number_and_Size0 = _Number_and_Size0 | $20 : missile0height = 3 __Skip_Missile0_Change rem ```````````````````````````````````````````````````````````````` rem ` If fire button restrainer bit is on, skip. rem ` if _Bit1_Joy0_Restrainer{1} then __Skip_New_Game rem ```````````````````````````````````````````````````````````````` rem ` If fire button is pressed, turn off new game bit. rem ` if joy0fire then _Bit3_New_Game{3} = 0 __Skip_New_Game rem **************************************************************** rem * rem * If the new game bit is on, skip a lot of code. rem ` if _Bit3_New_Game{3} then goto __Return_from_Blocks rem **************************************************************** rem * rem * Paddle. rem * rem ```````````````````````````````````````````````````````````````` rem ` Sets paddle y position. rem ` player0y = 90 rem ```````````````````````````````````````````````````````````````` rem ` If paddle was hit by the ball, lower the paddle for a bit. rem ` if _Paddle_Bounce_Counter > 0 then _Paddle_Bounce_Counter = _Paddle_Bounce_Counter - 1 : player0y = 91 rem ```````````````````````````````````````````````````````````````` rem ` Moves the paddle if joystick is pressed left or right. rem ` if joy0left then _Slide_Left = 10 : _Paddle_x = _Paddle_x - 1.500 : if joy0fire then _Paddle_x = _Paddle_x - 1.500 if joy0right then _Slide_Right = 10 : _Paddle_x = _Paddle_x + 1.500 : if joy0fire then _Paddle_x = _Paddle_x + 1.500 rem ```````````````````````````````````````````````````````````````` rem ` If paddle was moved, slide it a bit. rem ` if _Slide_Left > 0 then _Slide_Left = _Slide_Left - 1 : _Paddle_x = _Paddle_x - 0.500 if _Slide_Right > 0 then _Slide_Right = _Slide_Right - 1 : _Paddle_x = _Paddle_x + 0.500 rem ```````````````````````````````````````````````````````````````` rem ` Limits paddle movement. rem ` if _Bit0_Paddle_Size{0} then goto __Skip_Small_Paddle_Limit if player0x < 14 then player0x = 14 if player0x > 128 then player0x = 128 goto __Skip_Large_Paddle_Limit __Skip_Small_Paddle_Limit if player0x < 12 then player0x = 12 if player0x > 112 then player0x = 112 __Skip_Large_Paddle_Limit rem **************************************************************** rem * rem * Paddle and ball (missile0) collision. rem * rem ```````````````````````````````````````````````````````````````` rem ` Skip this section if no collision. rem ` if !collision(player0,missile0) then goto __Skip_Paddle_Collision rem ```````````````````````````````````````````````````````````````` rem ` Turn on paddle collision sound effect. rem ` _BitOp_C1 = 0 : _C1_Duration = 1 : _C1_Counter = 0 : _Bit0_C1_Paddle{0} = 1 rem ```````````````````````````````````````````````````````````````` rem ` Reverse y direction of ball (missile0). rem ` _Bit6_Ball_Direction_y{6} = 0 rem ```````````````````````````````````````````````````````````````` rem ` Clears the block hit bit so the next hit will count. rem ` _Bit2_Block_Hit{2} = 0 rem ```````````````````````````````````````````````````````````````` rem ` Makes the paddle seem to bounce back. rem ` _Paddle_Bounce_Counter = 5 rem ```````````````````````````````````````````````````````````````` rem ` Prepares to find out where the ball hit the paddle. rem ` temp5 = missile0x - player0x rem ```````````````````````````````````````````````````````````````` rem ` Figures out if the ball should go left or right based on rem ` which side of the paddle the ball hit. rem ` _Bit5_Ball_Direction_x{5} = 0 if _Bit0_Paddle_Size{0} then goto __Skip_Small_Paddle_Angle rem ```````````````````````````````````````````````````````````````` rem ` If ball hits right side of small paddle, go right. rem ` if temp5 > 10 then _Bit5_Ball_Direction_x{5} = 1 rem ```````````````````````````````````````````````````````````````` rem ` Finds spot on the small paddle where the ball hit. rem ` if temp5 < 5 || temp5 > 16 then _Angle_x = _20x : _Angle_y = _20y : temp4 = 20 : goto __Skip_Paddle_Angle if temp5 < 7 || temp5 > 14 then _Angle_x = _30x : _Angle_y = _30y : temp4 = 30 : goto __Skip_Paddle_Angle if temp5 < 9 || temp5 > 12 then _Angle_x = _45x : _Angle_y = _45y : temp4 = 45 : goto __Skip_Paddle_Angle if temp5 < 13 then _Angle_x = _55x : _Angle_y = _55y : temp4 = 55 goto __Skip_Paddle_Angle __Skip_Small_Paddle_Angle rem ```````````````````````````````````````````````````````````````` rem ` If ball hits right side of large paddle, go right. rem ` if temp5 > 18 then _Bit5_Ball_Direction_x{5} = 1 rem ```````````````````````````````````````````````````````````````` rem ` Finds spot on the large paddle where the ball hit. rem ` if temp5 < 7 || temp5 > 31 then _Angle_x = _20x : _Angle_y = _20y : temp4 = 20 : goto __Skip_Paddle_Angle if temp5 < 12 || temp5 > 26 then _Angle_x = _30x : _Angle_y = _30y : temp4 = 30 : goto __Skip_Paddle_Angle if temp5 < 17 || temp5 > 21 then _Angle_x = _45x : _Angle_y = _45y : temp4 = 45 : goto __Skip_Paddle_Angle if temp5 < 22 then _Angle_x = _55x : _Angle_y = _55y : temp4 = 55 __Skip_Paddle_Angle __Skip_Paddle_Collision rem **************************************************************** rem * rem * Border bounce check. rem * rem ```````````````````````````````````````````````````````````````` rem ` If the new ball pause is on, skip. rem ` if _Bit7_New_Ball_Pause{7} then goto __Skip_missile0_to_pf_Collision rem ```````````````````````````````````````````````````````````````` rem ` Clear the side border hit bit. rem ` _Bit3_Side_Hit{3} = 0 rem ```````````````````````````````````````````````````````````````` rem ` If side border hit, turn on sound effect, reverse x rem ` direction, and turn on the side border hit bit. rem ` if missile0x < 18 then missile0x = 18 : _BitOp_C1=0 : _C1_Duration=1 : _C1_Counter=0 : _Bit1_C1_Walls{1}=1 : _Bit5_Ball_Direction_x = _Bit5_Ball_Direction_x ^ %00100000 : _Bit3_Side_Hit{3} = 1 temp5 = 145 - missile0height if missile0x > temp5 then missile0x = temp5 : _BitOp_C1=0 : _C1_Duration=1 : _C1_Counter=0 : _Bit1_C1_Walls{1}=1 : _Bit5_Ball_Direction_x = _Bit5_Ball_Direction_x ^ %00100000 : _Bit3_Side_Hit{3} = 1 rem ```````````````````````````````````````````````````````````````` rem ` If the game is over, skip bottom check. rem ` if _Bit0_Game_is_Over{0} then goto __Skip_Bottom_Check rem ```````````````````````````````````````````````````````````````` rem ` Unrem the line below to have the ball bounce back up. rem ` rem if missile0y > 93 then _Bit2_Block_Hit{2} = 0 : _Bit6_Ball_Direction_y = _Bit6_Ball_Direction_y ^ %01000000 : goto __Skip_Bottom_Check rem ```````````````````````````````````````````````````````````````` rem ` If the ball hasn't reached the bottom, skip ahead. rem ` if missile0y < 100 then goto __Skip_Bottom_Check rem ```````````````````````````````````````````````````````````````` rem ` Clears the block hit bit so the next hit will count. rem ` _Bit2_Block_Hit{2} = 0 rem ```````````````````````````````````````````````````````````````` rem ` Turn on new ball pause bit and restrain fire button. rem ` _Bit7_New_Ball_Pause{7} = 1 : _Bit1_Joy0_Restrainer{1} = 1 rem ```````````````````````````````````````````````````````````````` rem ` Turn on lose ball sound effect. rem ` _BitOp_C1 = 0 : _C1_Duration = 1 : _C1_Counter = 0 : _Bit2_C1_Lose_Ball{2} = 1 rem ```````````````````````````````````````````````````````````````` rem ` If there is a ball surplus, remove one of those and skip. rem ` if _Extra_Balls > 0 then _Extra_Balls = _Extra_Balls - 1 : goto __Skip_Castration rem ```````````````````````````````````````````````````````````````` rem ` If game is over, turn on game over sound effect, turn on rem ` game over bit, and check for high score. rem ` if pfscore1 = 0 then _BitOp_C1=0 : _Bit3_C1_Game_Over{3}=1 : _Bit0_Game_is_Over{0} = 1 : gosub __Check_High_Score : goto __Skip_missile0_to_pf_Collision rem ```````````````````````````````````````````````````````````````` rem ` Remove one of the extra balls shown on screen. rem ` pfscore1 = pfscore1/4 __Skip_Castration goto __Skip_missile0_to_pf_Collision __Skip_Bottom_Check rem ```````````````````````````````````````````````````````````````` rem ` If top border hit, clear the block hit bit, turn on sound rem ` effect, reverse y direction, and skip collision check. rem ` temp5 = missile0height + 3 if missile0y < temp5 then missile0y = temp5 : _Bit2_Block_Hit{2} = 0 : _BitOp_C1=0 : _C1_Duration=1 : _C1_Counter=0 : _Bit1_C1_Walls{1}=1 : _Bit6_Ball_Direction_y = _Bit6_Ball_Direction_y ^ %01000000 : goto __Skip_missile0_to_pf_Collision rem ```````````````````````````````````````````````````````````````` rem ` Skip collision check if ball hit the side border. rem ` if _Bit3_Side_Hit{3} then goto __Skip_missile0_to_pf_Collision rem **************************************************************** rem * rem * Ball/Playfield collision Check. rem * rem ```````````````````````````````````````````````````````````````` rem ` If a block has already been hit, skip this section. rem ` if _Bit2_Block_Hit{2} then goto __Skip_missile0_to_pf_Collision rem ```````````````````````````````````````````````````````````````` rem ` If there is no collision, skip this section. rem ` if !collision(playfield,missile0) then goto __Skip_missile0_to_pf_Collision rem ```````````````````````````````````````````````````````````````` rem ` Ball y (bally) coordinate conversion depends on rem ` direction. rem ` if !_Bit6_Ball_Direction_y{6} then _pf_y = (missile0y-missile0height)/3 : goto __Skip_Ball_y_Check _pf_y = missile0y/3 __Skip_Ball_y_Check rem ```````````````````````````````````````````````````````````````` rem ` Ball x (missile0x) coordinate conversion depends on rem ` direction. rem ` if !_Bit5_Ball_Direction_x{5} then _pf_x = (missile0x-17)/4 : goto __Skip_Ball_x_Check temp5 = 18 - missile0height : _pf_x = (missile0x-temp5)/4 __Skip_Ball_x_Check rem ```````````````````````````````````````````````````````````````` rem ` If a block is there, skip this subsection. rem ` if pfread(_pf_x,_pf_y) then goto __Skip_Read rem ```````````````````````````````````````````````````````````````` rem ` Gets colors and more. rem ` gosub __Color_Setup rem ```````````````````````````````````````````````````````````````` rem ` Keeps the program from going over 262. rem ` drawscreen rem ```````````````````````````````````````````````````````````````` rem ` Hunt for a nearby playfield pixel. rem ` if _Bit5_Ball_Direction_x{5} then goto __Skip_Read_01 if _pf_x > 0 then temp5 = _pf_x - 1 : if pfread(temp5,_pf_y) then _pf_x = _pf_x - 1 : goto __Skip_Read if _pf_x < 31 then temp5 = _pf_x + 1 : if pfread(temp5,_pf_y) then _pf_x = _pf_x + 1 : goto __Skip_Read goto __Skip_missile0_to_pf_Collision __Skip_Read_01 if _pf_x < 31 then temp5 = _pf_x + 1 : if pfread(temp5,_pf_y) then _pf_x = _pf_x + 1 : goto __Skip_Read if _pf_x > 0 then temp5 = _pf_x - 1 : if pfread(temp5,_pf_y) then _pf_x = _pf_x - 1 : goto __Skip_Read goto __Skip_missile0_to_pf_Collision __Skip_Read rem ```````````````````````````````````````````````````````````````` rem ` Makes sure only one block is destroyed at a time. rem ` _Bit2_Block_Hit{2} = 1 rem ```````````````````````````````````````````````````````````````` rem ` Remembers how many blocks have been hit. rem ` _Block_Count = _Block_Count + 1 rem ```````````````````````````````````````````````````````````````` rem ` Remembers the thousands digit. rem ` temp5 = (sc2 & $F0) rem ```````````````````````````````````````````````````````````````` rem ` Get points for destroyed block from data. rem ` dec temp4 = _Data_Points[_pf_y] rem ```````````````````````````````````````````````````````````````` rem ` Add points to score. rem ` score = score + temp4 rem ```````````````````````````````````````````````````````````````` rem ` Grabs the thousands digit. rem ` temp6 = (sc2 & $F0) rem ```````````````````````````````````````````````````````````````` rem ` If thousands digit has NOT changed, skip this part. rem ` if temp5 = temp6 then goto __Skip_Extra_Ball rem ```````````````````````````````````````````````````````````````` rem ` Turn on extra ball sound effect. rem ` _BitOp_C0 = 0 : _C0_Duration = 1 : _C0_Counter = 0 : _Bit5_C0_Extra_Ball{5} = 1 rem ```````````````````````````````````````````````````````````````` rem ` If extra ball indicator is full, remember the extra ball. rem ` if pfscore1 = %01010101 && _Extra_Balls < 255 then _Extra_Balls = _Extra_Balls + 1 : goto __Skip_Extra_Ball rem ```````````````````````````````````````````````````````````````` rem ` On screen indicator is not full. Add extra ball to it. rem ` pfscore1 = pfscore1*4|1 __Skip_Extra_Ball rem ```````````````````````````````````````````````````````````````` rem ` Reverse Ball y (missile0y) direction. rem ` _Bit6_Ball_Direction_y = _Bit6_Ball_Direction_y ^ %01000000 rem ```````````````````````````````````````````````````````````````` rem ` Delete pfpixel. rem ` pfpixel _pf_x _pf_y off rem ```````````````````````````````````````````````````````````````` rem ` Delete pfpixel to the left or right based on whether the rem ` currently deleted pfpixel was odd or even. rem ` if _pf_x{0} then temp4 = _pf_x - 1 : pfpixel temp4 _pf_y off : goto __Skip_Odd_Even temp4 = _pf_x + 1 : pfpixel temp4 _pf_y off : temp4 = _pf_x __Skip_Odd_Even rem ```````````````````````````````````````````````````````````````` rem ` Finds location for block destruction effect. rem ` ballx = (temp4 * 4) + 18 bally = _pf_y * 3 rem ```````````````````````````````````````````````````````````````` rem ` If extra ball bit is on, skip block destruction sound effect. rem ` if _Bit5_C0_Extra_Ball{5} then goto __Skip_missile0_to_pf_Collision rem ```````````````````````````````````````````````````````````````` rem ` Block destruction sound effect preparation. rem ` _BitOp_C0=0 : _C0_Duration=1 : _C0_Counter=0 rem ```````````````````````````````````````````````````````````````` rem ` Get random number for block sound effect. rem ` temp5 = (rand/128) + (rand/64) rem ```````````````````````````````````````````````````````````````` rem ` If last sound effect is same as current one, get new one. rem ` if _Sound_Memory = temp5 then temp5 = temp5 + 1 : if temp5 > 4 then temp5 = 0 rem ```````````````````````````````````````````````````````````````` rem ` Assigns sound effect. rem ` 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 rem ```````````````````````````````````````````````````````````````` rem ` Remembers sound effect so the same one won`t play next time. rem ` _Sound_Memory = temp5 __Skip_missile0_to_pf_Collision rem **************************************************************** rem * rem * If all blocks destroyed, get new blocks. rem ` if _Block_Count > 143 then goto __New_Blocks __Return_from_Blocks rem **************************************************************** rem * rem * The score will flip between the current score and rem * the high score every 2 seconds when the game is over. rem * rem ```````````````````````````````````````````````````````````````` rem ` if the game isn't over, skip this section. rem ` if !_Bit0_Game_is_Over{0} then goto __Skip_Flip rem ```````````````````````````````````````````````````````````````` rem ` Increments the counter. rem ` _Master_Counter = _Master_Counter + 1 rem ```````````````````````````````````````````````````````````````` rem ` If counter hasn't reached 2 seconds yet, skip this section. rem ` if _Master_Counter < 120 then goto __Skip_Flip rem ```````````````````````````````````````````````````````````````` rem ` Two seconds have gone by. Turn on two second bit. rem ` _Bit1_Two_Seconds{1} = 1 rem ```````````````````````````````````````````````````````````````` rem ` Clear the counter and flip the score swap bit. rem ` _Master_Counter = 0 : _Bit2_Swap_Scores{2} = !_Bit2_Swap_Scores{2} rem ```````````````````````````````````````````````````````````````` rem ` If the score swap bit is on, display the high score. rem ` if _Bit2_Swap_Scores{2} then scorecolor = $AC : sc1=_High_Score01 : sc2=_High_Score02 : sc3=_High_Score03 : goto __Skip_Flip rem ```````````````````````````````````````````````````````````````` rem ` If the score swap bit is off, display the current score. rem ` scorecolor = $3A : sc1=_Temp_Score01 : sc2=_Temp_Score02 : sc3=_Temp_Score03 __Skip_Flip rem **************************************************************** rem * rem * Fire button section. rem * rem ```````````````````````````````````````````````````````````````` rem ` If fire button not pressed, clear restrainer bit and skip. rem ` if !joy0fire then _Bit1_Joy0_Restrainer{1} = 0 : goto __Skip_Fire rem ```````````````````````````````````````````````````````````````` rem ` If fire button hasn't been released, skip this section. rem ` if _Bit1_Joy0_Restrainer{1} then goto __Skip_Fire rem ```````````````````````````````````````````````````````````````` rem ` Turn on fire button restrainer bit. rem ` _Bit1_Joy0_Restrainer{1} = 1 rem ```````````````````````````````````````````````````````````````` rem ` If game is not over, skip this little subsection. rem ` if !_Bit0_Game_is_Over{0} then goto __Skip_Game_Over rem ```````````````````````````````````````````````````````````````` rem ` If two seconds have gone by, reset the game. rem ` if _Bit1_Two_Seconds{1} then goto __Start_Restart goto __Skip_Fire __Skip_Game_Over rem ```````````````````````````````````````````````````````````````` rem ` If new ball pause is not on, skip this section. rem ` if !_Bit7_New_Ball_Pause{7} then goto __Skip_Fire rem ```````````````````````````````````````````````````````````````` rem ` Clears the new ball pause bit. rem ` _Bit7_New_Ball_Pause{7} = 0 rem ```````````````````````````````````````````````````````````````` rem ` Turns on ball appearance sound effect. rem ` _BitOp_C1 = 0 : _C1_Duration = 1 : _C1_Counter = 0 : _Bit5_C1_Ball_Appear{5} = 1 rem ```````````````````````````````````````````````````````````````` rem ` Starts ball (missile0x) at random position above paddle. rem ` missile0x = (rand/16) + player0x + 4 : if missile0x > 142 then missile0x = 140 rem ```````````````````````````````````````````````````````````````` rem ` Starting y position for ball (missile0y). rem ` missile0y = 52 rem ```````````````````````````````````````````````````````````````` rem ` Starting angle of ball. rem ` _Angle_x = _45x : _Angle_y = _45y rem ```````````````````````````````````````````````````````````````` rem ` Ball x (missile0x) starting direction is random. rem ` temp5 = (rand & %00100000) _Bit5_Ball_Direction_x = _Bit5_Ball_Direction_x ^ temp5 rem ```````````````````````````````````````````````````````````````` rem ` Bally (missile0y) starting direction is down. rem ` _Bit6_Ball_Direction_y{6} = 1 __Skip_Fire rem **************************************************************** rem * rem * Move the ball. rem * rem ```````````````````````````````````````````````````````````````` rem ` If new ball pause is on, skip this section. rem ` if _Bit7_New_Ball_Pause{7} then goto __Skip_Ball_Movement rem ```````````````````````````````````````````````````````````````` rem ` Move the ball left or right depending on direction bit. rem ` if !_Bit5_Ball_Direction_x{5} then _M_Ball_x = _M_Ball_x - _Angle_x if _Bit5_Ball_Direction_x{5} then _M_Ball_x = _M_Ball_x + _Angle_x rem ```````````````````````````````````````````````````````````````` rem ` Move the ball up or down depending on direction bit. rem ` if !_Bit6_Ball_Direction_y{6} then _M_Ball_y = _M_Ball_y - _Angle_y if _Bit6_Ball_Direction_y{6} then _M_Ball_y = _M_Ball_y + _Angle_y __Skip_Ball_Movement rem **************************************************************** rem * rem * Block destruction effect. rem * rem ```````````````````````````````````````````````````````````````` rem ` Move the real ball (shaped like a block) down the screen. rem ` if bally < 100 then _Block_Effect_y = _Block_Effect_y + 1.600 : if bally > 64 then bally = 200 rem **************************************************************** rem * rem * Gets colors and more. rem ` gosub __Color_Setup rem **************************************************************** rem * rem * Displays the screen. rem ` drawscreen rem **************************************************************** rem * rem * Go to another bank and see if any sounds should be playing. rem ` goto __Check_Sound bank2 __Done_Check_Sound rem **************************************************************** rem * rem * Reset Program: rem * rem * Any Atari 2600 program should restart when the reset switch rem * is pressed. It is part of the usual standards and procedures. rem * rem ```````````````````````````````````````````````````````````````` rem ` If the reset switch is not pressed, turn off restrainer and rem ` skip this section. rem ` if !switchreset then _Bit0_Reset_Restrainer{0} = 0 : goto __Skip_Main_Reset rem ```````````````````````````````````````````````````````````````` rem ` If the reset switch hasn`t been released, skip this section. rem ` if _Bit0_Reset_Restrainer{0} then goto __Skip_Main_Reset rem ```````````````````````````````````````````````````````````````` rem ` Restart the program. rem ` goto __Start_Restart __Skip_Main_Reset goto __Main_Loop rem **************************************************************** rem **************************************************************** rem * rem * New blocks. rem * rem ` __New_Blocks rem ```````````````````````````````````````````````````````````````` rem ` Gets colors and more. rem ` gosub __Color_Setup rem ```````````````````````````````````````````````````````````````` rem ` Keeps the program from going over 262. rem ` drawscreen rem ```````````````````````````````````````````````````````````````` rem ` Turns on new ball pause and fire button restrainer. rem ` _Bit7_New_Ball_Pause{7} = 1 : _Bit1_Joy0_Restrainer{1} = 1 rem ```````````````````````````````````````````````````````````````` rem ` Clears the block count variable and clears the block hit bit rem ` so the next hit will count. rem ` _Block_Count = 0 : _Bit2_Block_Hit{2} = 0 rem ```````````````````````````````````````````````````````````````` rem ` Moves the ball off the screen. rem ` missile0x = 200 : missile0y = 200 rem ```````````````````````````````````````````````````````````````` rem ` Draws the blocks. rem ` w016 = 255 : w017 = 255 : w018 = 255 : w019 = 255 w020 = 255 : w021 = 255 : w022 = 255 : w023 = 255 w024 = 255 : w025 = 255 : w026 = 255 : w027 = 255 w028 = 255 : w029 = 255 : w030 = 255 : w031 = 255 w032 = 255 : w033 = 255 : w034 = 255 : w035 = 255 w036 = 255 : w037 = 255 : w038 = 255 : w039 = 255 w040 = 255 : w041 = 255 : w042 = 255 : w043 = 255 w044 = 255 : w045 = 255 : w046 = 255 : w047 = 255 w048 = 255 : w049 = 255 : w050 = 255 : w051 = 255 goto __Return_from_Blocks rem **************************************************************** rem **************************************************************** rem * rem * Checks for a new high score. rem * rem ` __Check_High_Score rem ***************************************************************** rem * rem * Start high score test. rem ` if sc1 > _High_Score01 then goto __New_High_Score if sc1 < _High_Score01 then goto __Skip_High_Score rem ```````````````````````````````````````````````````````````````` rem ` First byte equal. Do the next test. rem ` if sc2 > _High_Score02 then goto __New_High_Score if sc2 < _High_Score02 then goto __Skip_High_Score rem ```````````````````````````````````````````````````````````````` rem ` Second byte equal. Do the next test. rem ` if sc3 > _High_Score03 then goto __New_High_Score if sc3 < _High_Score03 then goto __Skip_High_Score rem ```````````````````````````````````````````````````````````````` rem ` All bytes equal. Current score is the same as the high score. rem ` goto __Skip_High_Score __New_High_Score rem ```````````````````````````````````````````````````````````````` rem ` Save new high score. rem ` _High_Score01 = sc1 : _High_Score02 = sc2 : _High_Score03 = sc3 __Skip_High_Score rem **************************************************************** rem * rem * Setup for game over high score swap. rem * rem ```````````````````````````````````````````````````````````````` rem ` Clears the counter. rem ` _Master_Counter = 0 rem ```````````````````````````````````````````````````````````````` rem ` Temporarily remembers the score. rem ` _Temp_Score01 = sc1 : _Temp_Score02 = sc2 : _Temp_Score03 = sc3 return thisbank __Color_Setup rem **************************************************************** rem * rem * Playfield colors. rem ` pfcolors: $06 $06 $06 $06 $44 $46 $48 $1A $1C $1E $C6 $C8 $CA $9E $9C $9A $98 $96 $94 $92 $90 $00 $EE $EE $EE $12 $12 $12 $12 $12 $12 $12 $12 $12 end rem **************************************************************** rem * rem * Sets color of sprites and lives. rem ` COLUP0 = $0C : COLUP1 = $06 : pfscorecolor = $26 rem **************************************************************** rem * rem * Sets background color. rem ` COLUBK = 0 rem **************************************************************** rem * rem * Sets up size of missiles and sprites. rem ` NUSIZ0 = _Number_and_Size0 : NUSIZ1 = $20 rem **************************************************************** rem * rem * Sets color of the score if the game is not over. rem ` if !_Bit0_Game_is_Over{0} then scorecolor = $FA rem **************************************************************** rem * rem * Sets score background color. rem ` scback = $22 return thisbank rem **************************************************************** rem * rem * Points data for destroyed blocks. rem * rem ```````````````````````````````````````````````````````````````` rem ` All 144 blocks are worth 7,200 points. rem ` data _Data_Points $00, $00, $00, $00, $90, $80, $70, $60, $50, $40, $30, $20, $10, $00, $00, $00, $00 end bank 2 rem **************************************************************** rem **************************************************************** rem * rem * Sound effect check. rem * rem ` __Check_Sound rem **************************************************************** rem * rem * Checks to see if any sounds should be playing for Channel 0. rem * rem ```````````````````````````````````````````````````````````````` rem ` If sound effect is on, check for end of current note. rem ` if !_BitOp_C0 then goto __Sound_Return_Channel_0 _C0_Duration = _C0_Duration - 1 if _C0_Duration > 0 then goto __Sound_Return_Channel_0 rem ```````````````````````````````````````````````````````````````` rem ` Block destruction sound effect 01. rem ` if _Bit0_C0_Block1{0} then goto __C0_Sound_Effect_Block1 rem ```````````````````````````````````````````````````````````````` rem ` Block destruction sound effect 02. rem ` if _Bit1_C0_Block2{1} then goto __C0_Sound_Effect_Block2 rem ```````````````````````````````````````````````````````````````` rem ` Block destruction sound effect 03. rem ` if _Bit2_C0_Block3{2} then goto __C0_Sound_Effect_Block3 rem ```````````````````````````````````````````````````````````````` rem ` Block destruction sound effect 04. rem ` if _Bit3_C0_Block4{3} then goto __C0_Sound_Effect_Block4 rem ```````````````````````````````````````````````````````````````` rem ` Block destruction sound effect 05. rem ` if _Bit4_C0_Block5{4} then goto __C0_Sound_Block_05 rem ```````````````````````````````````````````````````````````````` rem ` Extra ball sound effect. rem ` if _Bit5_C0_Extra_Ball{5} then goto __C0_Sound_Extra_Ball __Sound_Return_Channel_0 rem **************************************************************** rem * rem * Checks to see if any sounds should be playing for Channel 1. rem * rem ```````````````````````````````````````````````````````````````` rem ` If sound effect is on, check for end of current note. rem ` if !_BitOp_C1 then goto __Sound_Return_Channel_1 _C1_Duration = _C1_Duration - 1 if _C1_Duration > 0 then goto __Sound_Return_Channel_1 rem ```````````````````````````````````````````````````````````````` rem ` Paddle hit sound effect. rem ` if _Bit0_C1_Paddle{0} then goto __C1_Sound_Effect_Paddle rem ```````````````````````````````````````````````````````````````` rem ` Wall hit sound effect. rem ` if _Bit1_C1_Walls{1} then goto __C1_Sound_Effect_Walls rem ```````````````````````````````````````````````````````````````` rem ` Lose Ball sound effect. rem ` if _Bit2_C1_Lose_Ball{2} then goto __C1_Sound_Effect_Lose_Ball rem ```````````````````````````````````````````````````````````````` rem ` Game over sound effect. rem ` if _Bit3_C1_Game_Over{3} then goto __C1_Sound_Effect_Game_Over rem ```````````````````````````````````````````````````````````````` rem ` Start game sound effect. rem ` if _Bit4_C1_Start_Game{4} then goto __C1_Sound_Effect_Start_Game rem ```````````````````````````````````````````````````````````````` rem ` Ball appear sound effect. rem ` if _Bit5_C1_Ball_Appear{5} then goto __C1_Sound_Effect_Ball_Appear __Sound_Return_Channel_1 goto __Done_Check_Sound bank1 rem **************************************************************** rem * rem * rem * Sound effect data starts here. rem * rem * rem **************************************************************** rem **************************************************************** rem * rem * Block destruction sound effect 01. rem ` __C0_Sound_Effect_Block1 rem ```````````````````````````````````````````````````````````````` rem ` Retrieve channel 0 data. rem ` temp4 = _Data_Sound_Block1[_C0_Counter] : _C0_Counter = _C0_Counter + 1 temp5 = _Data_Sound_Block1[_C0_Counter] : _C0_Counter = _C0_Counter + 1 temp6 = _Data_Sound_Block1[_C0_Counter] : _C0_Counter = _C0_Counter + 1 rem ```````````````````````````````````````````````````````````````` rem ` Check for end of data. rem ` if temp4 = 255 then goto __C0_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Play channel 0. rem ` AUDV0 = temp4 AUDC0 = temp5 AUDF0 = temp6 rem ```````````````````````````````````````````````````````````````` rem ` Set Duration. rem ` _C0_Duration = _Data_Sound_Block1[_C0_Counter] : _C0_Counter = _C0_Counter + 1 goto __Sound_Return_Channel_0 rem ```````````````````````````````````````````````````````````````` rem ` Sound effect data. rem ` 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 rem **************************************************************** rem * rem * Block destruction sound effect 02. rem ` __C0_Sound_Effect_Block2 rem ```````````````````````````````````````````````````````````````` rem ` Retrieve channel 0 data. rem ` temp4 = _Data_Sound_Block2[_C0_Counter] : _C0_Counter = _C0_Counter + 1 temp5 = _Data_Sound_Block2[_C0_Counter] : _C0_Counter = _C0_Counter + 1 temp6 = _Data_Sound_Block2[_C0_Counter] : _C0_Counter = _C0_Counter + 1 rem ```````````````````````````````````````````````````````````````` rem ` Check for end of data. rem ` if temp4 = 255 then goto __C0_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Play channel 0. rem ` AUDV0 = temp4 AUDC0 = temp5 AUDF0 = temp6 rem ```````````````````````````````````````````````````````````````` rem ` Set Duration. rem ` _C0_Duration = _Data_Sound_Block2[_C0_Counter] : _C0_Counter = _C0_Counter + 1 goto __Sound_Return_Channel_0 rem ```````````````````````````````````````````````````````````````` rem ` Sound effect data. rem ` 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 rem **************************************************************** rem * rem * Block destruction sound effect 03. rem ` __C0_Sound_Effect_Block3 rem ```````````````````````````````````````````````````````````````` rem ` Retrieve channel 0 data. rem ` temp4 = _Data_Sound_Block3[_C0_Counter] : _C0_Counter = _C0_Counter + 1 temp5 = _Data_Sound_Block3[_C0_Counter] : _C0_Counter = _C0_Counter + 1 temp6 = _Data_Sound_Block3[_C0_Counter] : _C0_Counter = _C0_Counter + 1 rem ```````````````````````````````````````````````````````````````` rem ` Check for end of data. rem ` if temp4 = 255 then goto __C0_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Play channel 0. rem ` AUDV0 = temp4 AUDC0 = temp5 AUDF0 = temp6 rem ```````````````````````````````````````````````````````````````` rem ` Set Duration. rem ` _C0_Duration = _Data_Sound_Block3[_C0_Counter] : _C0_Counter = _C0_Counter + 1 goto __Sound_Return_Channel_0 rem ```````````````````````````````````````````````````````````````` rem ` Sound effect data. rem ` 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 rem **************************************************************** rem * rem * Block destruction sound effect 04. rem ` __C0_Sound_Effect_Block4 rem ```````````````````````````````````````````````````````````````` rem ` Retrieve channel 0 data. rem ` temp4 = _Data_Sound_Block4[_C0_Counter] : _C0_Counter = _C0_Counter + 1 temp5 = _Data_Sound_Block4[_C0_Counter] : _C0_Counter = _C0_Counter + 1 temp6 = _Data_Sound_Block4[_C0_Counter] : _C0_Counter = _C0_Counter + 1 rem ```````````````````````````````````````````````````````````````` rem ` Check for end of data. rem ` if temp4 = 255 then goto __C0_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Play channel 0. rem ` AUDV0 = temp4 AUDC0 = temp5 AUDF0 = temp6 rem ```````````````````````````````````````````````````````````````` rem ` Set Duration. rem ` _C0_Duration = _Data_Sound_Block4[_C0_Counter] : _C0_Counter = _C0_Counter + 1 goto __Sound_Return_Channel_0 rem ```````````````````````````````````````````````````````````````` rem ` Sound effect data. rem ` 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 rem **************************************************************** rem * rem * Block destruction sound effect 05. rem ` __C0_Sound_Block_05 rem ```````````````````````````````````````````````````````````````` rem ` Retrieve channel 0 data. rem ` temp4 = _Data_Block05[_C0_Counter] : _C0_Counter = _C0_Counter + 1 temp5 = _Data_Block05[_C0_Counter] : _C0_Counter = _C0_Counter + 1 temp6 = _Data_Block05[_C0_Counter] : _C0_Counter = _C0_Counter + 1 rem ```````````````````````````````````````````````````````````````` rem ` Check for end of data. rem ` if temp4 = 255 then goto __C0_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Play channel 0. rem ` AUDV0 = temp4 AUDC0 = temp5 AUDF0 = temp6 rem ```````````````````````````````````````````````````````````````` rem ` Set Duration. rem ` _C0_Duration = _Data_Block05[_C0_Counter] : _C0_Counter = _C0_Counter + 1 goto __Sound_Return_Channel_0 rem ```````````````````````````````````````````````````````````````` rem ` Sound effect data. rem ` 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 rem **************************************************************** rem * rem * Extra ball sound effect. rem ` __C0_Sound_Extra_Ball rem ```````````````````````````````````````````````````````````````` rem ` Retrieve channel 0 data. rem ` temp4 = _Data_Extra_Ball[_C0_Counter] : _C0_Counter = _C0_Counter + 1 temp5 = _Data_Extra_Ball[_C0_Counter] : _C0_Counter = _C0_Counter + 1 temp6 = _Data_Extra_Ball[_C0_Counter] : _C0_Counter = _C0_Counter + 1 rem ```````````````````````````````````````````````````````````````` rem ` Check for end of data. rem ` if temp4 = 255 then goto __C0_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Play channel 0. rem ` AUDV0 = temp4 AUDC0 = temp5 AUDF0 = temp6 rem ```````````````````````````````````````````````````````````````` rem ` Set Duration. rem ` _C0_Duration = _Data_Extra_Ball[_C0_Counter] : _C0_Counter = _C0_Counter + 1 goto __Sound_Return_Channel_0 rem ```````````````````````````````````````````````````````````````` rem ` Sound effect data. rem ` 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 rem **************************************************************** rem * rem * Paddle hit sound effect. rem ` __C1_Sound_Effect_Paddle rem ```````````````````````````````````````````````````````````````` rem ` Retrieve channel 1 data. rem ` temp4 = _Data_Sound_Paddle[_C1_Counter] : _C1_Counter = _C1_Counter + 1 temp5 = _Data_Sound_Paddle[_C1_Counter] : _C1_Counter = _C1_Counter + 1 temp6 = _Data_Sound_Paddle[_C1_Counter] : _C1_Counter = _C1_Counter + 1 rem ```````````````````````````````````````````````````````````````` rem ` Check for end of data. rem ` if temp4 = 255 then goto __C1_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Play channel 1. rem ` AUDV1 = temp4 AUDC1 = temp5 AUDF1 = temp6 rem ```````````````````````````````````````````````````````````````` rem ` Set duration. rem ` _C1_Duration = _Data_Sound_Paddle[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 rem ```````````````````````````````````````````````````````````````` rem ` Sound effect data. rem ` 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 rem **************************************************************** rem * rem * Wall bash sound effect. rem ` __C1_Sound_Effect_Walls rem ```````````````````````````````````````````````````````````````` rem ` Retrieve channel 1 data. rem ` temp4 = _Data_Sound_Walls[_C1_Counter] : _C1_Counter = _C1_Counter + 1 temp5 = _Data_Sound_Walls[_C1_Counter] : _C1_Counter = _C1_Counter + 1 temp6 = _Data_Sound_Walls[_C1_Counter] : _C1_Counter = _C1_Counter + 1 rem ```````````````````````````````````````````````````````````````` rem ` Check for end of data. rem ` if temp4 = 255 then goto __C1_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Play channel 1. rem ` AUDV1 = temp4 AUDC1 = temp5 AUDF1 = temp6 rem ```````````````````````````````````````````````````````````````` rem ` Set duration. rem ` _C1_Duration = _Data_Sound_Walls[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 rem ```````````````````````````````````````````````````````````````` rem ` Sound effect data. rem ` 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 rem **************************************************************** rem * rem * Lose ball sound effect. rem ` __C1_Sound_Effect_Lose_Ball rem ```````````````````````````````````````````````````````````````` rem ` Retrieve channel 1 data. rem ` temp4 = _Data_Sound_Lose_Ball[_C1_Counter] : _C1_Counter = _C1_Counter + 1 temp5 = _Data_Sound_Lose_Ball[_C1_Counter] : _C1_Counter = _C1_Counter + 1 temp6 = _Data_Sound_Lose_Ball[_C1_Counter] : _C1_Counter = _C1_Counter + 1 rem ```````````````````````````````````````````````````````````````` rem ` Check for end of data. rem ` if temp4 = 255 then goto __C1_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Play channel 1. rem ` AUDV1 = temp4 AUDC1 = temp5 AUDF1 = temp6 rem ```````````````````````````````````````````````````````````````` rem ` Set duration. rem ` _C1_Duration = _Data_Sound_Lose_Ball[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 rem ```````````````````````````````````````````````````````````````` rem ` Sound effect data. rem ` 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 rem **************************************************************** rem * rem * Game over sound effect. rem ` __C1_Sound_Effect_Game_Over rem ```````````````````````````````````````````````````````````````` rem ` Retrieve channel 1 data. rem ` temp4 = _Data_Sound_Game_Over[_C1_Counter] : _C1_Counter = _C1_Counter + 1 temp5 = _Data_Sound_Game_Over[_C1_Counter] : _C1_Counter = _C1_Counter + 1 temp6 = _Data_Sound_Game_Over[_C1_Counter] : _C1_Counter = _C1_Counter + 1 rem ```````````````````````````````````````````````````````````````` rem ` Check for end of data. rem ` if temp4 = 255 then goto __C1_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Play channel 1. rem ` AUDV1 = temp4 AUDC1 = temp5 AUDF1 = temp6 rem ```````````````````````````````````````````````````````````````` rem ` Set duration. rem ` _C1_Duration = _Data_Sound_Game_Over[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 rem ```````````````````````````````````````````````````````````````` rem ` Sound effect data. rem ` 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 rem **************************************************************** rem * rem * Game start sound effect. rem ` __C1_Sound_Effect_Start_Game rem ```````````````````````````````````````````````````````````````` rem ` Retrieve channel 1 data. rem ` temp4 = _Data_Sound_Start_Game[_C1_Counter] : _C1_Counter = _C1_Counter + 1 temp5 = _Data_Sound_Start_Game[_C1_Counter] : _C1_Counter = _C1_Counter + 1 temp6 = _Data_Sound_Start_Game[_C1_Counter] : _C1_Counter = _C1_Counter + 1 rem ```````````````````````````````````````````````````````````````` rem ` Check for end of data. rem ` if temp4 = 255 then goto __C1_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Play channel 1. rem ` AUDV1 = temp4 AUDC1 = temp5 AUDF1 = temp6 rem ```````````````````````````````````````````````````````````````` rem ` Set duration. rem ` _C1_Duration = _Data_Sound_Start_Game[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 rem ```````````````````````````````````````````````````````````````` rem ` Sound effect data. rem ` 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 rem **************************************************************** rem * rem * Game start sound effect. rem ` __C1_Sound_Effect_Ball_Appear rem ```````````````````````````````````````````````````````````````` rem ` Retrieve channel 1 data. rem ` temp4 = _Data_Sound_Ball_Appear[_C1_Counter] : _C1_Counter = _C1_Counter + 1 temp5 = _Data_Sound_Ball_Appear[_C1_Counter] : _C1_Counter = _C1_Counter + 1 temp6 = _Data_Sound_Ball_Appear[_C1_Counter] : _C1_Counter = _C1_Counter + 1 rem ```````````````````````````````````````````````````````````````` rem ` Check for end of data. rem ` if temp4 = 255 then goto __C1_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Play channel 1. rem ` AUDV1 = temp4 AUDC1 = temp5 AUDF1 = temp6 rem ```````````````````````````````````````````````````````````````` rem ` Set duration. rem ` _C1_Duration = _Data_Sound_Ball_Appear[_C1_Counter] : _C1_Counter = _C1_Counter + 1 goto __Sound_Return_Channel_1 rem ```````````````````````````````````````````````````````````````` rem ` Sound effect data. rem ` 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 rem **************************************************************** rem * rem * Done with channel 0 sound. rem ` __C0_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Clear and set variables related to channel 0 sound. rem ` _C0_Duration = 1 : _C0_Counter = 0 : _BitOp_C0 = 0 : AUDV0=0 : goto __Sound_Return_Channel_0 rem **************************************************************** rem * rem * Done with channel 1 sound. rem ` __C1_Sound_Done_255 rem ```````````````````````````````````````````````````````````````` rem ` Clear and set variables related to channel 1 sound. rem ` _C1_Duration = 1 : _C1_Counter = 0 : _BitOp_C1 = 0 : AUDV1=0 : goto __Sound_Return_Channel_1 rem **************************************************************** rem * rem * Makes scback work so the score background can be changed. rem ` asm minikernel sta WSYNC lda scback sta COLUBK rts end