;*************************************************************** ; ; Tone Toy 2008 (Code redone on 2019y_12m_28d) ; ; 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. ; ; Super-duper extra special thanks to SeaGtGruff. ; ; Special thanks to Atarius Maximus, Fort Apocalypse, ; MausGames, and batari. ; ;``````````````````````````````````````````````````````````````` ; ; Instructions are on my web site: ; ; https://www.randomterrain.com/atari-2600-memories-program-tone-toy-2008.html ; ;``````````````````````````````````````````````````````````````` ; ; If this program will not compile for you, get the latest ; version of batari Basic: ; ; http://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#gettingstarted ; ;*************************************************************** ;*************************************************************** ; ; Kernel setup. ; includesfile multisprite_bankswitch.inc set kernel multisprite set romsize 8k ;*************************************************************** ; ; Variable aliases go here (DIMs). ; ; You can have more than one alias for each variable. ; If you use different aliases for bit operations, ; it's easier to understand and remember what they do. ; ; I start variable aliases with one underscore so I won't ; have to worry that I might be using bB keywords by mistake. ; I also start labels with two underscores for the same ; reason. The second underscore also makes labels stand out ; so I can tell at a glance that they are labels and not ; variables. ; ; Use bit operations any time you need a simple off/on ; variable. One variable essentially becomes 8 smaller ; variables when you use bit operations. ; ; I start my bit aliases with "_Bit" then follow that ; with the bit number from 0 to 7, then another underscore ; and the name. Example: _Bit0_Reset_Restrainer ; ;``````````````````````````````````````````````````````````````` ; Sound register variables. ; dim _Ch0_Volume = a dim _Ch0_Tone = b dim _Ch0_Frequency = c dim _Ch1_Volume = d dim _Ch1_Tone = e dim _Ch1_Frequency = f ;``````````````````````````````````````````````````````````````` ; Variable for moving up and down to select the registers. ; dim _Register_Selection = g ;``````````````````````````````````````````````````````````````` ; Timer for double click. ; dim _Timer = h ;``````````````````````````````````````````````````````````````` ; Up/down selection delay counter. (Selecting a register is slowed down.) ; dim _UD_Delay_Counter = i ;``````````````````````````````````````````````````````````````` ; Slows certain things down a little. ; dim _Small_Delay = j ;``````````````````````````````````````````````````````````````` ; Bits for loop locking. ; dim _BitOp_01 = x dim _Bit0_Ch0_Vol_L_Lock = x dim _Bit1_Ch0_Vol_R_Lock = x dim _Bit2_Ch0_Freq_L_Lock = x dim _Bit3_Ch0_Freq_R_Lock = x dim _Bit4_Ch1_Vol_L_Lock = x dim _Bit5_Ch1_Vol_R_Lock = x dim _Bit6_Ch1_Freq_L_Lock = x dim _Bit7_Ch1_Freq_R_Lock = x ;``````````````````````````````````````````````````````````````` ; All-purpose bits for various jobs. ; dim _BitOp_02 = y dim _Bit0_Reset_Restrainer = y dim _Bit1_1st_Click = y dim _Bit2_2nd_Click = y dim _Bit3_Finish_Double_Click = y dim _Bit4_Double_Click_Happened = y dim _Bit5_Dec_Hex_Switch = y dim _Bit6_Select_Restrainer = y dim _Bit7_FireButton_SlowDown = y ;*************************************************************** ; ; Double click speed (how much time you have between clicks). ; [The c stands for constant.] ; const _c_Double_Click_Speed = 15 ;*************************************************************** ;*************************************************************** ; ; PROGRAM START/RESTART ; ; __Start_Restart ;*************************************************************** ; ; Mutes volume of both sound channels. ; AUDV0 = 0 : AUDV1 = 0 ;*************************************************************** ; ; Clears all normal variables. ; 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 : z = 0 ;*************************************************************** ; ; Sets playfield vertical resolution of around 88 rows. ; pfheight = 0 ;*************************************************************** ; ; Sets up the playfield. ; playfield: ................ ................ ...........XXXXX ...........XXXXX ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XXXXX ...........XXXXX ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XXXXX ...........XXXXX ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XXXXX ...........XXXXX ................ ................ ................ ................ ...........XXXXX ...........XXXXX ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XXXXX ...........XXXXX ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XXXXX ...........XXXXX ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XX... ...........XXXXX ...........XXXXX end ;*************************************************************** ; ; Sets the heights for the shared sprite trick by SeaGtGruff. ; player0height = 6 : player1height = 6 : player2height = 6 : player3height = 6 : player4height = 6 : player5height = 6 ;*************************************************************** ; ; Sets register variables. ; _Ch0_Volume = 8 : _Ch1_Volume = 8 _Ch0_Tone = 0 : _Ch1_Tone = 0 _Ch0_Frequency = 12 : _Ch1_Frequency = 12 ;*************************************************************** ; ; Turns off double click timer (200 = off). ; _Timer = 200 ;*************************************************************** ; ; Sets background color, playfield pixel color, and score color. ; COLUBK = $C2 : COLUPF = $C6 : scorecolor = $C2 ;*************************************************************** ; ; Sets sprite positions. ; player5x = 82 : player4x = 82 : player3x = 82 : player2x = 82 : player1x = 82 player5y = 81 : player4y = 68 : player3y = 55 : player2y = 36 : player1y = 23 : player0x = 74 : player0y = 12 ;*************************************************************** ; ; Sets sprite colors (1 - 5). ; COLUP5 = $AC : COLUP2 = $AC COLUP4 = $CA : _COLUP1 = $CA COLUP3 = $FC ;*************************************************************** ; ; Doubles the size of sprites 1 - 5 ; _NUSIZ1 = $15 : NUSIZ2 = $15 : NUSIZ3 = $15 : NUSIZ4 = $15 : NUSIZ5 = $15 ;*************************************************************** ; ; Sets ball's position and width (double size). ; ballx = 71 : bally = 80 : CTRLPF = $15 ;*************************************************************** ; ; Sets horizontal position of missiles. ; ; missile0x=71 : missile1x=71 ;*************************************************************** ; ; Restrains the reset switch for the main loop. ; ; This bit fixes it so the reset switch becomes inactive if ; it hasn't been released after being pressed once. ; _Bit0_Reset_Restrainer{0} = 1 ;*************************************************************** ;*************************************************************** ; ; MAIN LOOP (MAKES THE PROGRAM GO) ; ; __Main_Loop ;*************************************************************** ; ; Sets color and size of sprite0. ; COLUP0 = $FC : NUSIZ0 = $15 ;*************************************************************** ; ; Timer section. ; ;``````````````````````````````````````````````````````````````` ; Skips this section if timer is off (200 = off). ; if _Timer = 200 then goto __Skip_Timer ;``````````````````````````````````````````````````````````````` ; Increases the timer. ; _Timer = _Timer + 1 ;``````````````````````````````````````````````````````````````` ; Skips rest of section if timer is not at the limit. ; if _Timer < _c_Double_Click_Speed then goto __Skip_Timer ;``````````````````````````````````````````````````````````````` ; Time ran out! Turns off timer and clears double click bits. ; _Timer = 200 _Bit1_1st_Click{1} = 0 : _Bit2_2nd_Click{2} = 0 : _Bit3_Finish_Double_Click{3} = 0 __Skip_Timer ;*************************************************************** ; ; Double click section. ; ;``````````````````````````````````````````````````````````````` ; Fire button ON subsection. ; ; Skips subsection if fire button is off or finish bit is on. ; if !joy0fire || _Bit3_Finish_Double_Click{3} then goto __Skip_DC_Fire_01 ;``````````````````````````````````````````````````````````````` ; First click check (fire button ON). ; ; If 2nd click bit is OFF and 1st click bit is OFF, turns on ; the 1st click bit and restarts the timer. ; if !_Bit2_2nd_Click{2} && !_Bit1_1st_Click{1} then _Bit1_1st_Click{1} = 1 : _Timer = 0 ;``````````````````````````````````````````````````````````````` ; Second click check (fire button ON). ; ; If the 2nd click bit is ON, clears the 2nd click bit, turns ; on the finish bit and restarts the timer. ; if _Bit2_2nd_Click{2} then _Bit2_2nd_Click{2} = 0 : _Bit3_Finish_Double_Click{3} = 1 : _Timer = 0 __Skip_DC_Fire_01 ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ;``````````````````````````````````````````````````````````````` ; Fire button OFF subsection. ; ; Skips subsection if fire button is on. ; if joy0fire then goto __Skip_DC_Fire_02 ;``````````````````````````````````````````````````````````````` ; First click done check (fire button OFF). ; ; If 1st click bit is ON, clears the 1st click bit, turns on ; the 2nd click bit, and restarts the timer. ; if _Bit1_1st_Click{1} then _Bit1_1st_Click{1} = 0 : _Bit2_2nd_Click{2} = 1 : _Timer = 0 ;``````````````````````````````````````````````````````````````` ; Double click finish check (fire button OFF). ; ; If finish bit is OFF, skips finish of double click. ; if !_Bit3_Finish_Double_Click{3} then goto __Skip_DC_Fire_02 ;``````````````````````````````````````````````````````````````` ; Finish bit is on, so the it's the end of the double click. ; ; Turns off the double click bits and turns off the timer. ; _Bit3_Finish_Double_Click{3} = 0 : _Bit1_1st_Click{1} = 0 : _Bit2_2nd_Click{2} = 0 : _Timer = 200 ;``````````````````````````````````````````````````````````````` ; Turns on double click happened bit. ; _Bit4_Double_Click_Happened{4} = 1 __Skip_DC_Fire_02 ;*************************************************************** ; ; Double click loops section. ; ;``````````````````````````````````````````````````````````````` ; Adds one to the small delay counter. ; _Small_Delay = _Small_Delay + 1 ;``````````````````````````````````````````````````````````````` ; Resets sprites when double click locks are off. ; if !_Bit0_Ch0_Vol_L_Lock{0} && !_Bit1_Ch0_Vol_R_Lock{1} then player5x = 82 if !_Bit2_Ch0_Freq_L_Lock{2} && !_Bit3_Ch0_Freq_R_Lock{3} then player3x = 82 if !_Bit4_Ch1_Vol_L_Lock{4} && !_Bit5_Ch1_Vol_R_Lock{5} then player2x = 82 if !_Bit6_Ch1_Freq_L_Lock{6} && !_Bit7_Ch1_Freq_R_Lock{7} then player0x = 74 ;``````````````````````````````````````````````````````````````` ; Skips double click locks when counter is below the limit. ; (if _Small_Delay > 1 then do it). ; if _Small_Delay < 2 then goto __Skip_DC_Loop_Delay01 ;``````````````````````````````````````````````````````````````` ; Left and right double click channel 0 frequency lock checks. ; if _Bit2_Ch0_Freq_L_Lock{2} then _Ch0_Frequency=_Ch0_Frequency-1 : player3x = 50 : if _Ch0_Frequency > 200 then _Ch0_Frequency = 31 if _Bit3_Ch0_Freq_R_Lock{3} then _Ch0_Frequency=_Ch0_Frequency+1 : player3x = 110 : if _Ch0_Frequency > 31 then _Ch0_Frequency = 0 ;``````````````````````````````````````````````````````````````` ; Left and right double click channel 1 frequency lock checks. ; if _Bit6_Ch1_Freq_L_Lock{6} then _Ch1_Frequency=_Ch1_Frequency-1 : player0x=42 : if _Ch1_Frequency > 200 then _Ch1_Frequency = 31 if _Bit7_Ch1_Freq_R_Lock{7} then _Ch1_Frequency=_Ch1_Frequency+1 : player0x=102 : if _Ch1_Frequency > 31 then _Ch1_Frequency = 0 __Skip_DC_Loop_Delay01 ;``````````````````````````````````````````````````````````````` ; Skips double click locks when counter is below the limit. ; (if _Small_Delay > 2 then do it). ; if _Small_Delay < 3 then goto __Skip_DC_Loop_Delay02 ;``````````````````````````````````````````````````````````````` ; Left and right double click channel 0 volume lock checks. ; if _Bit0_Ch0_Vol_L_Lock{0} then _Ch0_Volume = _Ch0_Volume - 1 : player5x = 50 : if _Ch0_Volume > 200 then _Ch0_Volume = 15 if _Bit1_Ch0_Vol_R_Lock{1} then _Ch0_Volume = _Ch0_Volume + 1 : player5x = 110 : if _Ch0_Volume > 15 then _Ch0_Volume = 0 ;``````````````````````````````````````````````````````````````` ; Left and right double click channel 1 volume lock checks. ; if _Bit4_Ch1_Vol_L_Lock{4} then _Ch1_Volume=_Ch1_Volume-1 : player2x=50 : if _Ch1_Volume > 200 then _Ch1_Volume = 15 if _Bit5_Ch1_Vol_R_Lock{5} then _Ch1_Volume=_Ch1_Volume+1 : player2x=110 : if _Ch1_Volume > 15 then _Ch1_Volume = 0 __Skip_DC_Loop_Delay02 ;``````````````````````````````````````````````````````````````` ; Resets small delay counter when limit is reached. ; if _Small_Delay > 2 then _Small_Delay = 0 ;*************************************************************** ; ; Register selection section. ; ;``````````````````````````````````````````````````````````````` ; Adds one to the up/down delay counter. ; _UD_Delay_Counter = _UD_Delay_Counter + 1 ;``````````````````````````````````````````````````````````````` ; Selects a new register if joystick is moved up or down. ; if joy0up then if _UD_Delay_Counter > 10 then _UD_Delay_Counter = 0 : _Register_Selection = _Register_Selection - 1 : if _Register_Selection > 200 then _Register_Selection = 5 if joy0down then if _UD_Delay_Counter > 10 then _UD_Delay_Counter = 0 : _Register_Selection = _Register_Selection + 1 : if _Register_Selection > 5 then _Register_Selection = 0 __Skip_Register_Selection ;*************************************************************** ; ; Jumps to the selected register section. ; on _Register_Selection goto __Ch0_Vol __Ch0_Tone __Ch0_Freq __Ch1_Vol __Ch1_Tone __Ch1_Freq __Return_From_Selected_Register ;*************************************************************** ; ; Fire button slowdown of register value change. ; ;``````````````````````````````````````````````````````````````` ; Turns off slowdown bit. ; _Bit7_FireButton_SlowDown{7} = 0 ;``````````````````````````````````````````````````````````````` ; If fire button is pressed, slowdown bit is turned on. ; if joy0fire then _Bit7_FireButton_SlowDown{7} = 1 ;*************************************************************** ; ; Sets volume, tone, and frequency of both channels. ; AUDV0 = _Ch0_Volume : AUDC0 = _Ch0_Tone : AUDF0 = _Ch0_Frequency AUDV1 = _Ch1_Volume : AUDC1 = _Ch1_Tone : AUDF1 = _Ch1_Frequency ;*************************************************************** ; ; Select switch check. ; ; (Switches between decimal and hexadecimal numbers.) ; ;``````````````````````````````````````````````````````````````` ; Sets select counter to maximum and skips this section if ; the select switch is not pressed. ; if !switchselect then _Bit6_Select_Restrainer{6} = 0 : goto __Done_Select ;``````````````````````````````````````````````````````````````` ; Skips section if select switch is being pressed. ; if _Bit6_Select_Restrainer{6} then goto __Done_Select ;``````````````````````````````````````````````````````````````` ; Turns on the select switch bit. ; _Bit6_Select_Restrainer{6} = 1 ;``````````````````````````````````````````````````````````````` ; Switches between decimal and hexadecimal numbers. ; _Bit5_Dec_Hex_Switch{5} = !_Bit5_Dec_Hex_Switch{5} __Done_Select ;*************************************************************** ; ; Number style. ; ;``````````````````````````````````````````````````````````````` ; Grabs decimal numbers from bank 2 if dec/hex bit is off. ; if !_Bit5_Dec_Hex_Switch{5} then goto __Decimal_Numbers bank2 ;``````````````````````````````````````````````````````````````` ; Grabs hexadecimal numbers from bank 2 if dec/hex bit is on. ; if _Bit5_Dec_Hex_Switch{5} then goto __Hexadecimal_Numbers bank2 __Return_From_Number_Grab ;*************************************************************** ; ; Reset switch check and end of main loop. ; ; 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, turns off reset ; restrainer bit and jumps to beginning of main loop. ; if !switchreset then _Bit0_Reset_Restrainer{0} = 0 : goto __Main_Loop ;``````````````````````````````````````````````````````````````` ; If reset switch hasn't been released after being pressed, ; program jumps to beginning of main loop. ; if _Bit0_Reset_Restrainer{0} then goto __Main_Loop ;``````````````````````````````````````````````````````````````` ; Reset pressed correctly, so the the program is restarted. ; goto __Start_Restart ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ;``````````````````````````````````````````````````````````````` ; ; END OF MAIN LOOP ; ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ;``````````````````````````````````````````````````````````````` ;*************************************************************** ;*************************************************************** ; ; Channel 0 volume section. ; __Ch0_Vol ;``````````````````````````````````````````````````````````````` ; Indicator moves to the left of channel 0 volume. ; bally = 80 : missile0y = 80 : missile1y = 79 ;``````````````````````````````````````````````````````````````` ; Skips ahead if joystick moved left or right. ; if joy0left || joy0right then goto __Skip_Ch0_Vol_LR ;``````````````````````````````````````````````````````````````` ; If double click bit is on and joystick wasn't moved left or ; right, the left and right lock bits are turned off, double ; click bit is turned off, and sprite is moved to the middle. ; if _Bit4_Double_Click_Happened{4} then _Bit0_Ch0_Vol_L_Lock{0} = 0 : _Bit1_Ch0_Vol_R_Lock{1} = 0 : _Bit4_Double_Click_Happened{4} = 0 : player5x = 82 __Skip_Ch0_Vol_LR ;``````````````````````````````````````````````````````````````` ; If joystick is moved left and double click bit is on, left ; lock bit is turned on, right lock bit is turned off, and ; double click bit is turned off. ; if joy0left && _Bit4_Double_Click_Happened{4} then _Bit0_Ch0_Vol_L_Lock{0} = 1 : _Bit1_Ch0_Vol_R_Lock{1} = 0 : _Bit4_Double_Click_Happened{4} = 0 ;``````````````````````````````````````````````````````````````` ; If joystick is moved right and double click bit is on, right ; lock bit is turned on, left lock bit is turned off, and ; double click bit is turned off. ; if joy0right && _Bit4_Double_Click_Happened{4} then _Bit1_Ch0_Vol_R_Lock{1} = 1 : _Bit0_Ch0_Vol_L_Lock{0} = 0 : _Bit4_Double_Click_Happened{4} = 0 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if fire button slow down bit is on ; and if up/down delay counter isn't at the limit. ; if _Bit7_FireButton_SlowDown{7} then if _UD_Delay_Counter < 11 then goto __Return_From_Selected_Register ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if fire button slow down bit is off ; and small delay counter isn't at limit. ; if !_Bit7_FireButton_SlowDown{7} then if _Small_Delay < 2 then goto __Return_From_Selected_Register ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if left or right lock bits are on. ; if _Bit0_Ch0_Vol_L_Lock{0} || _Bit1_Ch0_Vol_R_Lock{1} then goto __Return_From_Selected_Register ;``````````````````````````````````````````````````````````````` ; Subtracts one from volume and clears up/down delay counter if ; joystick is moved left (also limits the range). ; if joy0left then _Ch0_Volume = _Ch0_Volume - 1 : _UD_Delay_Counter = 0 : if _Ch0_Volume > 200 then _Ch0_Volume = 15 ;``````````````````````````````````````````````````````````````` ; Adds one to volume and clears up/down delay counter if ; joystick is moved right (also limits the range). ; if joy0right then _Ch0_Volume = _Ch0_Volume + 1 : _UD_Delay_Counter = 0 : if _Ch0_Volume > 15 then _Ch0_Volume = 0 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop. ; goto __Return_From_Selected_Register ;*************************************************************** ;*************************************************************** ; ; Channel 0 tone section. ; __Ch0_Tone ;``````````````````````````````````````````````````````````````` ; Indicator moves to the left of channel 0 tone. ; bally = 67 : missile0y = 67 : missile1y = 66 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if up/down delay counter isn't at ; the limit. ; if _UD_Delay_Counter < 11 then goto __Return_From_Selected_Register ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ;``````````````````````````````````````````````````````````````` ; Skips ahead if joystick not moved left. ; if !joy0left then goto __Skip_Ch0_Tone_JLeft _UD_Delay_Counter = 0 ;``````````````````````````````````````````````````````````````` ; Subtracts one from channel 0 tone variable. ; _Ch0_Tone = _Ch0_Tone - 1 ;``````````````````````````````````````````````````````````````` ; Limits the range of channel 0 tone variable. ; if _Ch0_Tone > 200 then _Ch0_Tone = 15 ;``````````````````````````````````````````````````````````````` ; Cuts out redundant tones for channel 0 tone variable. ; if _Ch0_Tone = 5 then _Ch0_Tone = 4 if _Ch0_Tone = 11 then _Ch0_Tone = 8 if _Ch0_Tone = 13 then _Ch0_Tone = 12 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop. ; goto __Return_From_Selected_Register __Skip_Ch0_Tone_JLeft ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ;``````````````````````````````````````````````````````````````` ; Returns to main loop if joystick not moved right. ; if !joy0right then goto __Return_From_Selected_Register _UD_Delay_Counter = 0 ;``````````````````````````````````````````````````````````````` ; Adds one to channel 0 tone variable. ; _Ch0_Tone= _Ch0_Tone + 1 ;``````````````````````````````````````````````````````````````` ; Limits the range of channel 0 tone variable. ; if _Ch0_Tone > 15 then _Ch0_Tone = 0 ;``````````````````````````````````````````````````````````````` ; Cuts out redundant tones for channel 0 tone variable. ; if _Ch0_Tone = 5 then _Ch0_Tone = 6 if _Ch0_Tone = 9 then _Ch0_Tone = 12 if _Ch0_Tone = 13 then _Ch0_Tone = 14 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop. ; goto __Return_From_Selected_Register ;*************************************************************** ;*************************************************************** ; ; Channel 0 frequency section. ; __Ch0_Freq ;``````````````````````````````````````````````````````````````` ; Indicator moves to the left of channel 0 frequency. ; bally = 54 : missile0y = 54 : missile1y = 53 ;``````````````````````````````````````````````````````````````` ; Skips ahead if joystick moved left or right. ; if joy0left || joy0right then goto __Skip_Ch0_Freq_LR ;``````````````````````````````````````````````````````````````` ; Turn off loop locks check. ; If double click bit is on and joystick wasn't moved left or ; right, the left and right lock bits are turned off, double ; click bit is turned off, and sprite is moved to the middle. ; if _Bit4_Double_Click_Happened{4} then _Bit2_Ch0_Freq_L_Lock{2} = 0 : _Bit3_Ch0_Freq_R_Lock{3} = 0 : _Bit4_Double_Click_Happened{4} = 0 : player3x = 82 __Skip_Ch0_Freq_LR ;``````````````````````````````````````````````````````````````` ; Lock loop left check. ; If joystick is moved left and double click bit is on, left ; lock bit is turned on, right lock bit is turned off, and ; double click bit is turned off. ; if joy0left && _Bit4_Double_Click_Happened{4} then _Bit2_Ch0_Freq_L_Lock{2} = 1 : _Bit3_Ch0_Freq_R_Lock{3} = 0: _Bit4_Double_Click_Happened{4} = 0 ;``````````````````````````````````````````````````````````````` ; Lock loop right check. ; If joystick is moved right and double click bit is on, right ; lock bit is turned on, left lock bit is turned off, and ; double click bit is turned off. ; if joy0right && _Bit4_Double_Click_Happened{4} then _Bit3_Ch0_Freq_R_Lock{3} = 1 : _Bit2_Ch0_Freq_L_Lock{2} = 0 : _Bit4_Double_Click_Happened{4} = 0 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if fire button slow down bit is on ; and if up/down delay counter isn't at the limit. ; if _Bit7_FireButton_SlowDown{7} then if _UD_Delay_Counter < 11 then goto __Return_From_Selected_Register ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if fire button slow down bit is off ; and small delay counter isn't at limit. ; if !_Bit7_FireButton_SlowDown{7} then if _Small_Delay < 1 then goto __Return_From_Selected_Register ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if left or right lock bits are on. ; if _Bit2_Ch0_Freq_L_Lock{2} || _Bit3_Ch0_Freq_R_Lock{3} then goto __Return_From_Selected_Register ;``````````````````````````````````````````````````````````````` ; Subtracts one from frequency and clears up/down delay counter if ; joystick is moved left (also limits the range). ; if joy0left then _Ch0_Frequency = _Ch0_Frequency - 1 : _UD_Delay_Counter = 0 : if _Ch0_Frequency > 200 then _Ch0_Frequency = 31 ;``````````````````````````````````````````````````````````````` ; Adds one to frequency and clears up/down delay counter if ; joystick is moved right (also limits the range). ; if joy0right then _Ch0_Frequency = _Ch0_Frequency + 1 : _UD_Delay_Counter=0 : if _Ch0_Frequency > 31 then _Ch0_Frequency = 0 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop. ; goto __Return_From_Selected_Register ;*************************************************************** ;*************************************************************** ; ; Channel 1 volume section. ; __Ch1_Vol ;``````````````````````````````````````````````````````````````` ; Indicator moves to the left of channel 1 volume. ; bally = 35 : missile0y = 35 : missile1y = 34 ;``````````````````````````````````````````````````````````````` ; Skips ahead if joystick moved left or right. ; if joy0left || joy0right then goto __Skip_Ch1_Vol_LR ;``````````````````````````````````````````````````````````````` ; Turn off loop locks check. ; If double click bit is on and joystick wasn't moved left or ; right, the left and right lock bits are turned off, double ; click bit is turned off, and sprite is moved to the middle. ; if _Bit4_Double_Click_Happened{4} then _Bit4_Ch1_Vol_L_Lock{4} = 0 : _Bit5_Ch1_Vol_R_Lock{5} = 0 : player2x=82 : _Bit4_Double_Click_Happened{4} = 0 __Skip_Ch1_Vol_LR ;``````````````````````````````````````````````````````````````` ; Lock loop left check. ; If joystick is moved left and double click bit is on, left ; lock bit is turned on, right lock bit is turned off, and ; double click bit is turned off. ; if joy0left && _Bit4_Double_Click_Happened{4} then _Bit4_Ch1_Vol_L_Lock{4} = 1 :_Bit5_Ch1_Vol_R_Lock{5} = 0 : _Bit4_Double_Click_Happened{4} = 0 ;``````````````````````````````````````````````````````````````` ; Lock loop right check. ; If joystick is moved right and double click bit is on, right ; lock bit is turned on, left lock bit is turned off, and ; double click bit is turned off. ; if joy0right && _Bit4_Double_Click_Happened{4} then _Bit5_Ch1_Vol_R_Lock{5} = 1 : _Bit4_Ch1_Vol_L_Lock{4} = 0 : _Bit4_Double_Click_Happened{4} = 0 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if fire button slow down bit is on ; and if up/down delay counter isn't at the limit. ; if _Bit7_FireButton_SlowDown{7} then if _UD_Delay_Counter < 11 then goto __Return_From_Selected_Register ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if fire button slow down bit is off ; and small delay counter isn't at limit. ; if !_Bit7_FireButton_SlowDown{7} then if _Small_Delay < 2 then goto __Return_From_Selected_Register ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if left or right lock bits are on. ; if _Bit4_Ch1_Vol_L_Lock{4} || _Bit5_Ch1_Vol_R_Lock{5} then goto __Return_From_Selected_Register ;``````````````````````````````````````````````````````````````` ; Subtracts one from volume and clears up/down delay counter if ; joystick is moved left (also limits the range). ; if joy0left then _Ch1_Volume = _Ch1_Volume - 1 : _UD_Delay_Counter = 0 : if _Ch1_Volume > 200 then _Ch1_Volume = 15 ;``````````````````````````````````````````````````````````````` ; Adds one to volume and clears up/down delay counter if ; joystick is moved right (also limits the range). ; if joy0right then _Ch1_Volume = _Ch1_Volume + 1 : _UD_Delay_Counter = 0 : if _Ch1_Volume > 15 then _Ch1_Volume = 0 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop. ; goto __Return_From_Selected_Register ;*************************************************************** ;*************************************************************** ; ; Channel 1 tone section. ; __Ch1_Tone ;``````````````````````````````````````````````````````````````` ; Indicator moves to the left of channel 1 tone. ; bally = 22 : missile0y = 22 : missile1y = 21 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if up/down delay counter isn't at ; the limit. ; if _UD_Delay_Counter < 11 then goto __Return_From_Selected_Register ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ;``````````````````````````````````````````````````````````````` ; Skips ahead if joystick not moved left. ; if !joy0left then goto __Skip_Ch1_Tone_JLeft _UD_Delay_Counter = 0 ;``````````````````````````````````````````````````````````````` ; Subtracts one from channel 1 tone variable. ; _Ch1_Tone = _Ch1_Tone - 1 ;``````````````````````````````````````````````````````````````` ; Limits the range of channel 1 tone variable. ; if _Ch1_Tone > 200 then _Ch1_Tone = 15 ;``````````````````````````````````````````````````````````````` ; Cuts out redundant tones for channel 1 tone variable. ; if _Ch1_Tone = 5 then _Ch1_Tone = 4 if _Ch1_Tone = 11 then _Ch1_Tone = 8 if _Ch1_Tone = 13 then _Ch1_Tone = 12 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop. ; goto __Return_From_Selected_Register __Skip_Ch1_Tone_JLeft ;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ;``````````````````````````````````````````````````````````````` ; Returns to main loop if joystick not moved right. ; if !joy0right then goto __Return_From_Selected_Register _UD_Delay_Counter = 0 ;``````````````````````````````````````````````````````````````` ; Adds one to channel 1 tone variable. ; _Ch1_Tone= _Ch1_Tone + 1 ;``````````````````````````````````````````````````````````````` ; Limits the range of channel 1 tone variable. ; if _Ch1_Tone > 15 then _Ch1_Tone = 0 ;``````````````````````````````````````````````````````````````` ; Cuts out redundant tones for channel 1 tone variable. ; if _Ch1_Tone = 5 then _Ch1_Tone = 6 if _Ch1_Tone = 9 then _Ch1_Tone = 12 if _Ch1_Tone = 13 then _Ch1_Tone = 14 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop. ; goto __Return_From_Selected_Register ;*************************************************************** ;*************************************************************** ; ; Channel 1 frequency section. ; __Ch1_Freq ;``````````````````````````````````````````````````````````````` ; Indicator moves to the left of channel 1 frequency. ; bally = 9 : missile0y = 9 : missile1y = 8 ;``````````````````````````````````````````````````````````````` ; Skips ahead if joystick moved left or right. ; if joy0left || joy0right then goto __Skip_Ch1_Freq_LR ;``````````````````````````````````````````````````````````````` ; Turn off loop locks check. ; If double click bit is on and joystick wasn't moved left or ; right, the left and right lock bits are turned off, double ; click bit is turned off, and sprite is moved to the middle. ; if _Bit4_Double_Click_Happened{4} then _Bit6_Ch1_Freq_L_Lock{6} = 0 : _Bit7_Ch1_Freq_R_Lock{7} = 0 : player0x=74 : _Bit4_Double_Click_Happened{4} = 0 __Skip_Ch1_Freq_LR ;``````````````````````````````````````````````````````````````` ; Lock loop left check. ; If joystick is moved left and double click bit is on, left ; lock bit is turned on, right lock bit is turned off, and ; double click bit is turned off. ; if joy0left && _Bit4_Double_Click_Happened{4} then _Bit6_Ch1_Freq_L_Lock{6} = 1 : _Bit7_Ch1_Freq_R_Lock{7} = 0 : _Bit4_Double_Click_Happened{4} = 0 ;``````````````````````````````````````````````````````````````` ; Lock loop right check. ; If joystick is moved right and double click bit is on, right ; lock bit is turned on, left lock bit is turned off, and ; double click bit is turned off. ; if joy0right && _Bit4_Double_Click_Happened{4} then _Bit7_Ch1_Freq_R_Lock{7} = 1 : _Bit6_Ch1_Freq_L_Lock{6} = 0 : _Bit4_Double_Click_Happened{4} = 0 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if fire button slow down bit is on ; and if up/down delay counter isn't at the limit. ; if _Bit7_FireButton_SlowDown{7} then if _UD_Delay_Counter < 11 then goto __Return_From_Selected_Register ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if fire button slow down bit is off ; and if small delay counter isn't at limit. ; if !_Bit7_FireButton_SlowDown{7} then if _Small_Delay < 1 then goto __Return_From_Selected_Register ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop if left or right lock bits are on. ; if _Bit6_Ch1_Freq_L_Lock{6} || _Bit7_Ch1_Freq_R_Lock{7} then goto __Return_From_Selected_Register ;``````````````````````````````````````````````````````````````` ; Subtracts one from frequency and clears up/down delay counter if ; joystick is moved left (also limits the range). ; if joy0left then _Ch1_Frequency = _Ch1_Frequency - 1 : _UD_Delay_Counter = 0 : if _Ch1_Frequency > 200 then _Ch1_Frequency = 31 ;``````````````````````````````````````````````````````````````` ; Adds one to frequency and clears up/down delay counter if ; joystick is moved right (also limits the range). ; if joy0right then _Ch1_Frequency = _Ch1_Frequency + 1 : _UD_Delay_Counter = 0 : if _Ch1_Frequency > 31 then _Ch1_Frequency = 0 ;``````````````````````````````````````````````````````````````` ; Jumps back to main loop. ; goto __Return_From_Selected_Register bank 2 ;*************************************************************** ; ; Decimal numbers section. ; ; This trick by SeaGtGruff allows all sprites to share the ; same sprite data. The strip of numbers from 0 to 31 was too ; long to fit in one chunk of sprite data, so two chunks had to ; be used. Pointer data is read that tells the program where ; to look for the current number that needs to be displayed in ; each sprite. ; __Decimal_Numbers player5pointerlo = _Data_p0Lo_DecHex[_Ch0_Volume] : player5pointerhi = _Data_p0hi_Dec[_Ch0_Volume] player4pointerlo = _Data_p0Lo_DecHex[_Ch0_Tone] : player4pointerhi = _Data_p0hi_Dec[_Ch0_Tone] player3pointerlo = _Data_p0Lo_DecHex[_Ch0_Frequency] : player3pointerhi = _Data_p0hi_Dec[_Ch0_Frequency] player2pointerlo = _Data_p0Lo_DecHex[_Ch1_Volume] : player2pointerhi = _Data_p0hi_Dec[_Ch1_Volume] player1pointerlo = _Data_p0Lo_DecHex[_Ch1_Tone] : player1pointerhi = _Data_p0hi_Dec[_Ch1_Tone] player0pointerlo = _Data_p0Lo_DecHex[_Ch1_Frequency] - 1 : player0pointerhi = _Data_p0hi_Dec[_Ch1_Frequency] goto __Skip_Hexadecimal ;*************************************************************** ; ; Hexadecimal numbers section. ; ; This trick by SeaGtGruff allows all sprites to share the ; same sprite data. The strip of numbers from $00 to $1F was ; too long to fit in one chunk of sprite data, so two chunks ; had to be used. Pointer data is read that tells the program ; where to look for the current number that needs to be ; displayed in each sprite. ; __Hexadecimal_Numbers player5pointerlo = _Data_p0Lo_DecHex[_Ch0_Volume] : player5pointerhi = _Data_p0hi_Hex[_Ch0_Volume] player4pointerlo = _Data_p0Lo_DecHex[_Ch0_Tone] : player4pointerhi = _Data_p0hi_Hex[_Ch0_Tone] player3pointerlo = _Data_p0Lo_DecHex[_Ch0_Frequency] : player3pointerhi = _Data_p0hi_Hex[_Ch0_Frequency] player2pointerlo = _Data_p0Lo_DecHex[_Ch1_Volume] : player2pointerhi = _Data_p0hi_Hex[_Ch1_Volume] player1pointerlo = _Data_p0Lo_DecHex[_Ch1_Tone] : player1pointerhi = _Data_p0hi_Hex[_Ch1_Tone] player0pointerlo = _Data_p0Lo_DecHex[_Ch1_Frequency] - 1 : player0pointerhi = _Data_p0hi_Hex[_Ch1_Frequency] __Skip_Hexadecimal ;*************************************************************** ; ; Displays the screen. ; drawscreen ;*************************************************************** ; ; Jumps back to the main loop in bank 1. ; goto __Return_From_Number_Grab bank1 ;*************************************************************** ;*************************************************************** ; ; Shared sprite data (decimal numbers 0 - 31). ; player0: %00001110 %00001010 %00001010 %00001010 %00001110 %00000000 %00001110 %00000100 %00000100 %00001100 %00000100 %00000000 %00001110 %00001000 %00001110 %00000010 %00001110 %00000000 %00001110 %00000010 %00000110 %00000010 %00001110 %00000000 %00000010 %00000010 %00001110 %00001010 %00001010 %00000000 %00001110 %00000010 %00001110 %00001000 %00001110 %00000000 %00001110 %00001010 %00001110 %00001000 %00001110 %00000000 %00000010 %00000010 %00000010 %00000010 %00001110 %00000000 %00001110 %00001010 %00001110 %00001010 %00001110 %00000000 %00000010 %00000010 %00001110 %00001010 %00001110 %00000000 %11101110 %01001010 %01001010 %11001010 %01001110 %00000000 %11101110 %01000100 %01000100 %11001100 %01000100 %00000000 %11101110 %01001000 %01001110 %11000010 %01001110 %00000000 %11101110 %01000010 %01000110 %11000010 %01001110 %00000000 %11100010 %01000010 %01001110 %11001010 %01001010 %00000000 %11101110 %01000010 %01001110 %11001000 %01001110 %00000000 %11101110 %01001010 %01001110 %11001000 %01001110 %00000000 %11100010 %01000010 %01000010 %11000010 %01001110 %00000000 %11101110 %01001010 %01001110 %11001010 %01001110 %00000000 %11100010 %01000010 %01001110 %11001010 %01001110 %00000000 %11101110 %10001010 %11101010 %00101010 %11101110 %00000000 %11101110 %10000100 %11100100 %00101100 %11100100 %00000000 %11101110 %10001000 %11101110 %00100010 %11101110 %00000000 %11101110 %10000010 %11100110 %00100010 %11101110 %00000000 %11100010 %10000010 %11101110 %00101010 %11101010 %00000000 %11101110 %10000010 %11101110 %00101000 %11101110 %00000000 %11101110 %10001010 %11101110 %00101000 %11101110 end player0: %11100010 %10000010 %11100010 %00100010 %11101110 %00000000 %11101110 %10001010 %11101110 %00101010 %11101110 %00000000 %11100010 %10000010 %11101110 %00101010 %11101110 %00000000 %11101110 %00101010 %01101010 %00101010 %11101110 %00000000 %11101110 %00100100 %01100100 %00101100 %11100100 end ;*************************************************************** ;*************************************************************** ; ; Data for the lo decimal and hexadecimal pointers. ; data _Data_p0Lo_DecHex 91,97,103,109,115,121,127,133,139,145,151,157,163,169,175,181 187,193,199,205,211,217,223,229,235,241,247,91,97,103,109,115 end ;*************************************************************** ;*************************************************************** ; ; Data for the hi decimal pointers. ; data _Data_p0hi_Dec $f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6 $f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f7,$f7,$f7,$f7,$f7 end ;*************************************************************** ;*************************************************************** ; ; Shared sprite data (hexadecimal numbers $00 - $1F). ; player0: %11101110 %10101010 %10101010 %10101010 %11101110 %00000000 %11101110 %10100100 %10100100 %10101100 %11100100 %00000000 %11101110 %10101000 %10101110 %10100010 %11101110 %00000000 %11101110 %10100010 %10100110 %10100010 %11101110 %00000000 %11100010 %10100010 %10101110 %10101010 %11101010 %00000000 %11101110 %10100010 %10101110 %10101000 %11101110 %00000000 %11101110 %10101010 %10101110 %10101000 %11101110 %00000000 %11100010 %10100010 %10100010 %10100010 %11101110 %00000000 %11101110 %10101010 %10101110 %10101010 %11101110 %00000000 %11100010 %10100010 %10101110 %10101010 %11101110 %00000000 %11101010 %10101010 %10101110 %10101010 %11100100 %00000000 %11101100 %10101010 %10101100 %10101010 %11101100 %00000000 %11100110 %10101000 %10101000 %10101000 %11100110 %00000000 %11101100 %10101010 %10101010 %10101010 %11101100 %00000000 %11101110 %10101000 %10101110 %10101000 %11101110 %00000000 %11101000 %10101000 %10101110 %10101000 %11101110 %00000000 %11101110 %01001010 %01001010 %11001010 %01001110 %00000000 %11101110 %01000100 %01000100 %11001100 %01000100 %00000000 %11101110 %01001000 %01001110 %11000010 %01001110 %00000000 %11101110 %01000010 %01000110 %11000010 %01001110 %00000000 %11100010 %01000010 %01001110 %11001010 %01001010 %00000000 %11101110 %01000010 %01001110 %11001000 %01001110 %00000000 %11101110 %01001010 %01001110 %11001000 %01001110 %00000000 %11100010 %01000010 %01000010 %11000010 %01001110 %00000000 %11101110 %01001010 %01001110 %11001010 %01001110 %00000000 %11100010 %01000010 %01001110 %11001010 %01001110 %00000000 %11101010 %01001010 %01001110 %11001010 %01000100 end player0: %11101100 %01001010 %01001100 %11001010 %01001100 %00000000 %11100110 %01001000 %01001000 %11001000 %01000110 %00000000 %11101100 %01001010 %01001010 %11001010 %01001100 %00000000 %11101110 %01001000 %01001110 %11001000 %01001110 %00000000 %11101000 %01001000 %01001110 %11001000 %01001110 end ;*************************************************************** ;*************************************************************** ; ; Data for the hexadecimal hi pointers. ; data _Data_p0hi_Hex $f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8 $f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f9,$f9,$f9,$f9,$f9 end ;*************************************************************** ;*************************************************************** ; ; Tips from SeaGtGruff (adapted by Random Terrain). ; ; Additional code might cause sprite tables to get pushed ; higher into memory. if that happens, you can look at the ; .lst file to find the new numbers to use in the hi data. ; ; If you are using Visual batari Basic, go to the Settings page ; and make sure "Clean Up Post Compilation Files" is unselected. ; ; After you compile your bB program and it generates a listing, ; open the .lst file in NotePad or NotePad++ or whatever you ; use and search for "player0:" statements. Look for something ; that looks similar to this: ; ; 5831 2504 .L0196 ; player0: ; 5832 2504 ; 5833 2504 a2 5a LDX #playerL0196_0 ; 5836 250a 85 a3 STA player0pointerhi ; 5837 250c a9 a2 LDA #162 ; 5838 250e 85 b0 STA player0height ; 5839 2510 .L0197 ; player0: ; 5840 2510 ; 5841 2510 a2 5a LDX #playerL0197_0 ; 5844 2516 85 a3 STA player0pointerhi ; 5845 2518 a9 1e LDA #30 ; 5846 251a 85 b0 STA player0height ; ; Then you want to see what the program is setting ; player0pointerhi to. You actually need to look at the line ; immediately before that, where the program is loading the ; accumulator. For the first chunk of sprite data: ; ; 5835 2508 a9 f6 LDA #>playerL0196_0 ; 5836 250a 85 a3 STA player0pointerhi ; ; For the second chunk of sprite data: ; ; 5843 2514 a9 f7 LDA #>playerL0197_0 ; 5844 2516 85 a3 STA player0pointerhi ; ; The important part is where the machine code is, in the ; middle of the line. For the first LDA instruction, the ; machine code is "a9 f6," and for the second LDA instruction ; it's "a9 f7." The "a9" is the machine code that means "LDA #" ; (load the accumulator with a number), and the other part is ; the hi-byte (or page number) of the address where the sprite ; table starts -- in this case, "f6" for the first sprite table, ; and "f7" for the second sprite table. ; ; Now you put them in your hi data table with a "$" in front of ; each number: ; ; data _Data_p0hi_Dec ; $f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6 ; $f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f6,$f7,$f7,$f7,$f7,$f7 ; end ; ; Since this program has another set of sprite data for ; hexadecimal numbers, just search for the next "player0:" ; area and repeat the process: ; ; 5943 2562 .L0200 ; player0: ; 5944 2562 ; 5945 2562 a2 5a LDX #playerL0200_0 ; 5948 2568 85 a3 STA player0pointerhi ; 5949 256a a9 a2 LDA #162 ; 5950 256c 85 b0 STA player0height ; 5951 256e .L0201 ; player0: ; 5952 256e ; 5953 256e a2 5a LDX #playerL0201_0 ; 5956 2574 85 a3 STA player0pointerhi ; 5957 2576 a9 1e LDA #30 ; 5958 2578 85 b0 STA player0height ; ; In this case, "f8" for the third sprite table, and "f9" for ; the fourth sprite table: ; ; data _Data_p0hi_Hex ; $f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8 ; $f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f8,$f9,$f9,$f9,$f9,$f9 ; end ; ;***************************************************************