COMPUTE!’s First Book of Atari Games / 1983 / PAGE 129

Chiseler

John Scarborough

Who writes arcade-quality games? John Scarborough is nineteen years old and learned machine language from a book. He wrote “Chiseler” on an Atari 400 with 16K, a cassette recorder, and an Assembler Editor cartridge. He didn’t even have a full memory map. It doesn’t take a college education or years of experience. It just takes patience, careful design, and love for what the computer can do. A little wizardry doesn’t hurt, either.

It seems like an easy enough job. Four boards are laid out in front of you, and your task is to chisel them away To help you, you have five sets of four chisels each. And not just ordinary tools — these chisels will hurl themselves at the boards and chip away strips of wood at a pretty reckless speed.

But it isn’t as easy as it sounds. Your chisels also hurl themselves away from the boards each time they strike, and if you don’t catch them and bounce them back, they’ll get away for good. And you’ll soon discover that every time you get rid of one board, another appears in its place.

The only way you can keep going on the job is either to be incredibly quick at catching chisels, or to get as many chisels as possible behind the new board when it appears. If you can trap them there, you can sit back and watch while they do the work for you. But don’t doze off — you never know when they’ll escape again, and you’ll be back to work.

This is an arcade-speed game, but don’t worry if you aren’t an accomplished arcader. “Chiseler” begins at a slow enough speed that a beginner can pick it up pretty well. But it keeps its challenge, no matter how good you get.

You’ll need a paddle controller. The game doesn’t require any cartridges to play, but you will need either BASIC or an Assembler Editor to enter the program the first time.

Entering Chiseler

There are two ways to enter and SAVE Chiseler. If you have an Assembler Editor, you can use it and the assembly listing, or you can use the “Machine Language Editor (MLX)” program found in Appendix C and the DATA listing. If you don’t have an Assembler Editor, then you must use the MLX program to enter the DATA statements. It is important that those who use the MLX program read the article that accompanies it. When you use the MLX program, it may seem like extra work at first to have to type in two programs, but you’ll save time later when you end up with a virtually error-free program.

Starting Up

Once you have entered the game and saved it on cassette or disk, you can start one of two ways.

If you entered the game from BASIC using MLX, then the game was saved as an autoboot program. If you have it on cassette, just remove all cartridges, put the cassette in the recorder, and turn on the computer while holding down the START button. You will hear one beep. Push PLAY on the recorder, then RETURN on the computer keyboard. The game will load in automatically. If Chiseler is on disk, turn on the disk drive, put in the disk, and turn on the computer.

If you entered the game with an Assembler Editor, then Chiseler must be loaded from the assembler cartridge or DOS.

From the assembler cartridge, use the LOAD command. Then the debug command G2800 will start the game.

If you created a binary file with MLX, then you must LOAD from the DOS menu. Choose option L, Binary Load. Enter the filename, then select M, RUN at $2800.

How to Play the Game

Chiseler comes up with two side walls and a back wall, with four colored boards stretching across from side to side. When you press the paddle trigger, the first of four chisels will come at you. You must move your paddle at the bottom of the screen to catch the chisel and hurl it back at the boards. It will bounce off the first board and come back toward the bottom of the screen.

Meanwhile, another chisel will start down toward you. If you catch it — and keep the first one going as well — two more chisels will come. As soon as you miss one chisel, new chisels will stop appearing, and you will never have more than four chisels at a time.

You will notice that as each chisel strikes the board, a thin strip of wood disappears. When all the wood is chipped away at one point, the chisels can get behind the first board, and start bouncing back and forth between the first and second boards. This can be repeated with every board.

When the last bit of a board has been destroyed, a new board will appear in its place. Try to have your chisel strike the last strip of wood from above, so the chisel will bounce back up on the screen and be trapped behind the new board. Then you can relax and watch the chisel do your work for you — until it breaks through again and starts coming back at you.

When the last chisel has got by you, that turn is over. To start the next turn, press the paddle trigger. Four new chisels will be launched. You get a total of five turns.

Scoring

Each strip of wood in the first board is worth one point; each in the second is worth two; in the third, three; and in the fourth, four.

Speed

Every time a new board is put in place, the chisels on the screen speed up slightly. The more new boards, the faster the chisels. After a while, it gets going faster than human dexterity can handle. But try to handle it, because if you let the chisels get by you, they don’t start slowly again on the next turn — they keep every bit of the speed they’ve built up.

Chisel Control

If the chisel strikes on the right half of your paddle, it will bounce off at an angle toward the right. If it strikes on the left half, it will bounce off toward the left. When you first start, youll probably feel lucky to catch the chisel at all. But quite soon you’ll start getting some finesse, and the chisels will go pretty much where you want them.

Entering Chiseler from BASIC with the Machine Language Editor: MLX

The last program in this book is the Machine Language Editor: MLX. It isn’t a game — it’s a utility to make sure that entering this long machine language program is easy and accurate.

MLX prompts you by asking for the program’s starting address: enter 8192. Then MLX will prompt you again for the ending address: enter 11136. Finally it will ask for the RUN/initialization address: enter 10240. Start entering numbers exactly as they appear in this listing.

The seventh number on every line is a test number. When you enter that, MLX uses it to check to see if every number was entered correctly on that line. If it was, you will be prompted to enter the next line. If there was a mistake, you will hear a beep and you will be prompted to enter the same set of numbers again.

Entering Chiseler with the Assembler Editor

If you aren’t a machine language programmer, don’t worry. Just enter the program from BASIC with MLX. This listing is included for those who are learning machine language for their Atari’s 6502 microprocessor. Instead of an inscrutable list of numbers, you can read the actual commands — with many remarks (which don’t have to be entered), explaining exactly what is going on in every part of the program.

If you’ve ever felt the urge to get inside the arcade machine and see how Pac-Man or Super Breakout achieves those dazzling effects, this listing is for you. Once you have actually gone through the process of making the computer do tricks just by loading the right numbers into the Accumulator and the X and Y registers, performing the right operations on them, and then storing them into the right locations in memory, you’ll realize that putting together a fantastic arcade game isn’t such a mystery after all. You’ve got it right within your reach.

This program was written entirely in machine language, using the Assembler Editor cartridge. It can be assembled in a computer with only 16K of memory, then saved as a single program on cassette. To accomplish this, the program is divided into six subdivisions. This enables the 16K computer owner to assemble the programs without having to worry about running out of memory for the source code. Each unit must be typed in and assembled independently. This shouldn’t be too monotonous if you read the remarks as you type. After all six have been assembled, the object code can be SAVED to cassette with this command:

SAVE#C:<2000,2B80

To retrieve the object code from cassette, enter

LOAD#C:<2000,2B80

These commands are utilized exactly like CLOAD and CSAVE.

Then the command DEBUG, followed by G2800, will start the game.

Program 5-1. Chiseler Using MLX

8192:162,000,169,000,157,000,232
8198:060,232,224,008,208,248,218
8204:169,255,157,000,060,232,117
8210:224,016,208,248,169,000,115
8216:133,176,169,062,133,177,106
8222:160,000,169,000,145,176,168
8228:200,208,251,166,177,232,246
8234:134,177,224,063,240,238,094
8240:169,034,141,006,062,169,117
8246:033,141,007,062,169,044,254
8252:141,008,062,141,009,062,227
8258:169,013,141,011,062,169,119
8264:016,141,013,062,141,023,212
8270:062,141,024,062,141,025,021
8276:062,141,026,062,141,027,031
8282:062,162,000,189,201,006,198
8288:157,033,062,232,224,005,041
8294:208,245,169,000,133,176,009
8300:169,062,133,177,160,042,083
8306:169,001,145,176,200,192,229
8312:059,208,249,160,062,169,003
8318:001,145,176,152,024,105,217
8324:016,168,169,001,145,176,039
8330:152,024,105,004,168,056,135
8336:201,241,144,233,166,177,026
8342:232,134,177,224,064,240,197
8348:005,160,006,076,125,032,048
8354:169,001,141,242,062,141,150
8360:002,063,169,000,133,176,199
8366:169,062,133,177,160,103,210
8372:162,068,138,145,176,232,077
8378:200,224,083,208,247,160,028
8384:163,162,147,138,145,176,099
8390:232,200,224,162,208,247,191
8396:160,223,162,098,138,145,106
8402:176,232,200,224,113,208,083
8408:247,169,063,133,177,160,141
8414:027,162,177,138,145,176,023
8420:232,200,224,192,208,247,251
8426:169,032,133,178,169,060,207
8432:133,179,160,000,152,145,241
8438:178,200,208,251,169,061,033
8444:133,179,169,000,145,178,032
8450:200,192,224,208,249,169,220
8456:032,133,178,169,060,133,201
8462:179,160,000,177,178,208,148
8468:008,200,192,120,208,247,227
8474:032,000,034,169,152,133,034
8480:178,160,000,177,178,208,165
8486:008,200,192,120,208,247,245
8492:032,049,034,169,016,133,221
8498:178,169,061,133,179,160,162
8504:000,177,178,208,008,200,059
8510:192,120,208,247,032,060,153
8516:034,169,136,133,178,160,110
8522:000,177,178,208,008,200,077
8528:192,120,208,247,032,071,182
8534:034,096,000,000,000,000,216
8540:000,000,000,000,000,000,092
8546:000,000,000,000,000,000,098
8552:000,000,000,000,000,000,104
8558:000,000,000,000,000,000,110
8564:000,000,000,000,000,000,116
8570:000,000,000,000,000,000,122
8576:000,000,000,000,000,000,128
8582:000,000,000,000,000,000,134
8588:000,000,000,000,000,000,140
8594:000,000,000,000,000,000,146
8600:000,000,000,000,000,000,152
8606:000,000,000,000,000,000,158
8612:000,000,000,000,000,000,164
8618:000,000,000,000,000,000,170
8624:000,000,000,000,000,000,176
8630:000,000,000,000,000,000,182
8636:000,000,000,000,000,000,188
8642:000,000,000,000,000,000,194
8648:000,000,000,000,000,000,200
8654:000,000,000,000,000,000,206
8660:000,000,000,000,000,000,212
8666:000,000,000,000,000,000,218
8672:000,000,000,000,000,000,224
8678:000,000,000,000,000,000,230
8684:000,000,000,000,000,000,236
8690:000,000,000,000,000,000,242
8696:000,000,000,000,000,000,248
8702:000,000,169,032,133,178,254
8708:169,060,133,179,160,000,193
8714:177,178,208,034,200,192,231
8720:120,208,247,160,000,169,152
8726:255,145,178,200,192,120,088
8732:208,249,169,041,141,210,022
8738:006,173,209,006,201,001,118
8744:240,006,056,233,001,141,205
8750:209,006,096,169,152,133,043
8756:178,169,060,133,179,076,079
8762:008,034,169,016,133,178,084
8768:169,061,133,179,076,008,178
8774:034,169,136,133,178,169,121
8780:061,133,179,076,008,034,055
8786:000,000,000,000,000,000,082
8792:000,000,000,000,000,000,088
8798:000,000,000,000,000,000,094
8804:000,000,000,000,000,000,100
8810:000,000,000,000,000,000,106
8816:000,000,000,000,000,000,112
8822:000,000,000,000,000,000,118
8828:000,000,000,000,000,000,124
8834:000,000,000,000,000,000,130
8840:000,000,000,000,000,000,136
8846:000,000,000,000,000,000,142
8852:000,000,000,000,000,000,148
8858:000,000,000,000,000,000,154
8864:000,000,000,000,000,000,160
8870:000,000,000,000,000,000,166
8876:000,000,000,000,000,000,172
8882:000,000,000,000,000,000,178
8888:000,000,000,000,000,000,184
8894:000,000,000,000,000,000,190
8900:000,000,000,000,000,000,196
8906:000,000,000,000,000,000,202
8912:000,000,000,000,000,000,208
8918:000,000,000,000,000,000,214
8924:000,000,000,000,000,000,220
8930:000,000,000,000,000,000,226
8936:000,000,000,000,000,000,232
8942:000,000,000,000,000,000,238
8948:000,000,000,000,000,000,244
8954:000,000,000,000,000,000,250
8960:169,062,141,047,002,169,078
8966:001,141,008,208,169,239,004
8972:141,192,002,169,015,141,160
8978:193,002,141,194,002,141,179
8984:195,002,141,199,002,169,220
8990:048,141,007,212,169,003,098
8996:141,029,208,169,000,133,204
9002:180,169,048,133,181,160,145
9008:000,152,145,180,200,208,165
9014:251,166,181,232,134,181,175
9020:224,056,208,242,169,255,190
9026:141,196,052,141,197,052,077
9032:141,198,052,169,255,141,004
9038:221,052,141,222,052,141,139
9044:223,052,169,000,141,196,097
9050:006,141,197,006,141,198,011
9056:006,141,199,006,169,001,106
9062:141,175,006,162,000,173,247
9068:010,210,056,201,075,144,036
9074:248,024,201,186,176,243,168
9080:157,176,006,232,224,004,151
9086:208,235,162,000,169,047,179
9092:157,180,006,169,112,157,145
9098:171,006,232,224,004,208,215
9104:241,162,000,173,010,210,172
9110:041,001,157,184,006,232,003
9116:224,004,208,243,162,000,229
9122:169,001,157,188,006,232,147
9128:224,004,208,246,162,000,244
9134:169,001,157,164,006,232,135
9140:224,004,208,246,173,112,123
9146:002,074,024,105,070,141,090
9152:160,006,169,255,056,237,051
9158:160,006,056,201,177,144,174
9164:002,169,177,141,000,208,133
9170:141,163,006,096,000,000,104
9176:000,000,000,000,000,000,216
9182:000,000,000,000,000,000,222
9188:000,000,000,000,000,000,228
9194:000,000,000,000,000,000,234
9200:000,000,000,000,000,000,240
9206:000,000,000,000,000,000,246
9212:000,000,000,000,174,162,076
9218:006,189,164,006,208,001,064
9224:096,189,184,006,208,012,191
9230:189,176,006,056,233,001,163
9236:157,176,006,076,035,036,250
9242:189,176,006,024,105,001,015
9248:157,176,006,189,188,006,242
9254:208,012,189,180,006,056,177
9260:233,001,157,180,006,076,185
9266:061,036,189,180,006,024,034
9272:105,001,157,180,006,189,182
9278:180,006,056,201,219,144,100
9284:044,208,009,173,175,006,171
9290:056,233,001,141,175,006,174
9296:169,001,141,199,006,189,017
9302:180,006,201,252,208,021,186
9308:169,000,224,003,208,006,190
9314:141,199,002,076,107,036,147
9320:157,193,002,169,000,157,014
9326:164,006,096,189,188,006,247
9332:208,003,076,228,036,189,088
9338:180,006,201,193,240,004,178
9344:201,218,208,096,189,176,192
9350:006,056,205,163,006,144,202
9356:087,056,233,016,024,205,249
9362:163,006,176,078,173,199,173
9368:006,208,029,162,001,189,235
9374:195,006,208,017,169,001,242
9380:157,195,006,173,175,006,108
9386:024,105,001,141,175,006,110
9392:076,184,036,232,224,004,164
9398:208,229,174,162,006,169,106
9404:000,157,188,006,169,017,213
9410:141,000,210,189,176,006,148
9416:056,233,005,141,160,006,033
9422:173,163,006,056,205,160,201
9428:006,144,008,169,000,157,184
9434:184,006,076,228,036,169,149
9440:001,157,184,006,189,176,169
9446:006,201,072,208,010,169,128
9452:001,157,184,006,169,029,014
9458:141,002,210,189,176,006,198
9464:201,190,208,010,169,000,002
9470:157,184,006,169,029,141,172
9476:002,210,189,180,006,201,024
9482:047,208,010,169,001,157,090
9488:188,006,169,029,141,002,039
9494:210,189,176,006,157,001,249
9500:208,189,180,006,133,182,158
9506:224,003,208,005,169,051,182
9512:076,047,037,138,024,105,211
9518:053,133,183,160,000,152,215
9524:145,182,200,224,003,208,246
9530:005,169,003,076,066,037,158
9536:169,192,145,182,200,145,073
9542:182,200,145,182,200,169,124
9548:000,145,182,096,000,000,243
9554:000,000,000,000,000,000,082
9560:000,000,000,000,000,000,088
9566:000,000,000,000,000,000,094
9572:000,000,000,000,000,000,100
9578:000,000,000,000,000,000,106
9584:000,000,000,000,000,000,112
9590:000,000,000,000,000,000,118
9596:000,000,000,000,000,000,124
9602:000,000,000,000,000,000,130
9608:000,000,000,000,000,000,136
9614:000,000,000,000,000,000,142
9620:000,000,000,000,000,000,148
9626:000,000,000,000,000,000,154
9632:000,000,000,000,000,000,160
9638:000,000,000,000,000,000,166
9644:000,000,000,000,000,000,172
9650:000,000,000,000,000,000,178
9656:000,000,000,000,000,000,184
9662:000,000,000,000,000,000,190
9668:000,000,000,000,000,000,196
9674:000,000,000,000,000,000,202
9680:000,000,000,000,000,000,208
9686:000,000,000,000,000,000,214
9692:000,000,000,000,000,000,220
9698:000,000,000,000,000,000,226
9704:000,000,000,000,000,000,232
9710:000,000,000,000,000,000,238
9716:000,000,000,000,000,000,244
9722:000,000,000,000,000,000,250
9728:174,162,006,189,171,006,196
9734:240,007,056,233,001,157,188
9740:171,006,096,189,180,006,148
9746:056,201,062,144,047,024,040
9752:201,070,176,003,076,071,109
9758:038,056,201,086,144,034,077
9764:024,201,094,176,003,076,098
9770:084,038,056,201,110,144,163
9776:021,024,201,118,176,003,079
9782:076,097,038,056,201,134,144
9788:144,008,024,201,142,176,243
9794:003,076,110,038,096,169,046
9800:070,141,170,006,169,004,120
9806:032,123,038,076,170,038,043
9812:169,094,141,170,006,169,065
9818:019,032,123,038,076,170,036
9824:038,169,118,141,170,006,226
9830:169,034,032,123,038,076,062
9836:170,038,169,142,141,170,170
9842:006,169,049,032,123,038,019
9848:076,170,038,141,169,006,208
9854:169,080,141,194,006,189,137
9860:176,006,024,205,194,006,231
9866:176,011,173,170,006,056,218
9872:253,180,006,141,168,006,130
9878:096,173,194,006,024,105,236
9884:008,141,194,006,172,169,078
9890:006,200,140,169,006,076,247
9896:131,038,173,169,006,024,197
9902:201,032,176,011,169,000,251
9908:133,178,169,060,133,179,008
9914:076,203,038,169,000,133,037
9920:178,169,061,133,179,173,061
9926:169,006,056,233,032,173,099
9932:169,006,010,010,010,072,225
9938:174,162,006,189,188,006,167
9944:240,011,104,024,105,008,196
9950:056,237,168,006,076,237,234
9956:038,104,024,105,008,056,051
9962:237,168,006,168,177,178,144
9968:208,001,096,169,000,145,091
9974:178,173,200,006,141,004,180
9980:210,032,007,033,032,000,054
9986:042,174,162,006,169,009,052
9992:157,171,006,189,188,006,213
9998:208,006,169,001,157,188,231
10004:006,096,169,000,157,188,124
10010:006,096,000,000,000,000,128
10016:000,000,000,000,000,000,032
10022:000,000,000,000,000,000,038
10028:000,000,000,000,000,000,044
10034:000,000,000,000,000,000,050
10040:000,000,000,000,000,000,056
10046:000,000,072,138,072,169,001
10052:008,162,056,141,010,212,145
10058:141,022,208,142,023,208,050
10064:169,224,141,009,212,169,236
10070:112,141,000,002,104,170,103
10076:104,064,000,000,000,000,004
10082:000,000,000,000,000,000,098
10088:000,000,000,000,000,000,104
10094:000,000,072,138,072,152,032
10100:072,169,152,162,120,160,183
10106:056,141,010,212,141,022,192
10112:208,142,023,208,140,024,105
10118:208,169,060,141,009,212,165
10124:169,224,141,000,002,104,012
10130:168,104,170,104,064,000,244
10136:000,000,000,000,000,000,152
10142:000,000,000,000,000,000,158
10148:000,000,000,000,000,000,164
10154:000,000,000,000,000,000,170
10160:000,000,000,000,000,000,176
10166:000,000,000,000,000,000,182
10172:000,000,000,000,000,000,188
10178:000,000,000,000,000,000,194
10184:000,000,000,000,000,000,200
10190:000,000,000,000,000,000,206
10196:000,000,000,000,000,000,212
10202:000,000,000,000,000,000,218
10208:072,138,072,169,088,162,157
10214:216,141,010,212,141,023,205
10220:208,142,024,208,169,064,027
10226:141,000,002,104,170,104,251
10232:064,000,000,000,000,000,056
10238:000,000,032,000,043,162,235
10244:000,169,080,157,201,006,105
10250:232,224,005,208,248,169,072
10256:000,141,008,210,169,001,033
10262:141,192,006,169,020,141,179
10268:209,006,032,000,032,032,083
10274:000,035,169,000,141,210,077
10280:006,169,166,141,001,210,221
10286:141,003,210,169,170,141,112
10292:005,210,141,007,210,169,026
10298:000,141,000,210,141,002,040
10304:210,141,004,210,141,006,008
10310:210,032,184,035,173,124,060
10316:002,208,248,169,001,141,077
10322:195,006,169,000,133,176,249
10328:169,062,133,177,173,192,226
10334:006,024,105,016,160,013,162
10340:145,176,174,210,006,240,027
10346:012,202,142,210,006,169,079
10352:060,141,006,210,076,124,217
10358:040,169,000,141,006,210,172
10364:169,000,133,077,141,000,132
10370:210,141,002,210,141,004,070
10376:210,169,000,141,162,006,056
10382:032,119,041,032,000,036,146
10388:032,000,038,162,001,142,011
10394:162,006,189,195,006,240,184
10400:009,032,119,041,032,000,137
10406:036,032,000,038,162,002,180
10412:142,162,006,189,195,006,104
10418:240,009,032,119,041,032,139
10424:000,036,032,000,038,162,196
10430:003,142,162,006,189,195,119
10436:006,240,009,032,119,041,131
10442:032,000,036,032,000,038,084
10448:173,199,006,240,126,162,090
10454:000,189,164,006,208,008,021
10460:232,224,004,208,246,076,186
10466:241,040,189,195,006,208,081
10472:106,232,224,004,208,233,215
10478:076,241,040,173,192,006,198
10484:201,005,208,063,169,006,128
10490:133,176,169,062,133,177,076
10496:160,000,169,039,145,176,177
10502:200,169,033,145,176,200,161
10508:169,045,145,176,200,169,148
10514:037,145,176,200,200,169,177
10520:047,145,176,200,169,054,047
10526:145,176,200,169,037,145,134
10532:176,200,169,050,145,176,184
10538:032,184,035,173,031,208,193
10544:201,006,208,246,076,015,032
10550:040,032,184,035,173,031,037
10556:208,201,006,208,003,076,250
10562:015,040,173,124,002,208,116
10568:238,174,192,006,232,142,032
10574:192,006,032,000,035,174,005
10580:209,006,142,211,006,032,178
10586:184,035,173,031,208,201,154
10592:006,208,003,076,015,040,188
10598:160,160,136,208,253,174,169
10604:211,006,202,142,211,006,118
10610:208,229,076,084,040,189,172
10616:180,006,024,201,080,176,019
10622:011,169,072,141,200,006,213
10628:169,005,141,213,006,096,250
10634:024,201,100,176,011,169,051
10640:108,141,200,006,169,004,004
10646:141,213,006,096,024,201,063
10652:128,176,011,169,144,141,157
10658:200,006,169,003,141,213,126
10664:006,096,169,217,141,200,229
10670:006,169,002,141,213,006,199
10676:096,000,000,000,000,000,020
10682:000,000,000,000,000,000,186
10688:000,000,000,000,000,000,192
10694:000,000,000,000,000,000,198
10700:000,000,000,000,000,000,204
10706:000,000,000,000,000,000,210
10712:000,000,000,000,000,000,216
10718:000,000,000,000,000,000,222
10724:000,000,000,000,000,000,228
10730:000,000,000,000,000,000,234
10736:000,000,000,000,000,000,240
10742:000,000,000,000,000,000,246
10748:000,000,000,000,169,000,165
10754:133,176,169,062,133,177,084
10760:174,213,006,202,142,213,190
10766:006,240,006,032,024,042,108
10772:076,008,042,096,174,175,079
10778:006,138,072,032,038,042,098
10784:104,170,202,208,246,096,034
10790:160,027,177,176,201,025,036
10796:208,009,169,016,145,176,255
10802:136,192,022,208,241,024,105
10808:105,001,145,176,169,033,173
10814:141,207,006,169,023,141,237
10820:208,006,172,207,006,177,076
10826:176,056,233,064,172,208,215
10832:006,056,209,176,144,023,182
10838:208,039,172,208,006,200,151
10844:140,208,006,172,207,006,063
10850:200,140,207,006,192,038,113
10856:208,220,076,127,042,162,171
10862:000,160,023,177,176,024,158
10868:105,064,157,201,006,232,113
10874:200,192,028,208,242,160,128
10880:033,162,000,189,201,006,207
10886:145,176,200,232,224,005,092
10892:208,245,096,000,000,000,177
10898:000,000,000,000,000,000,146
10904:000,000,000,000,000,000,152
10910:000,000,000,000,000,000,158
10916:000,000,000,000,000,000,164
10922:000,000,000,000,000,000,170
10928:000,000,000,000,000,000,176
10934:000,000,000,000,000,000,182
10940:000,000,000,000,000,000,188
10946:000,000,000,000,000,000,194
10952:000,000,000,000,000,000,200
10958:000,000,000,000,000,000,206
10964:000,000,000,000,000,000,212
10970:000,000,000,000,000,000,218
10976:000,000,000,000,000,000,224
10982:000,000,000,000,000,000,230
10988:000,000,000,000,000,000,236
10994:000,000,000,000,000,000,242
11000:000,000,000,000,000,000,248
11006:000,000,169,112,141,000,164
11012:006,141,001,006,169,198,013
11018:141,002,006,169,000,141,213
11024:003,006,169,062,141,004,145
11030:006,169,134,141,005,006,227
11036:169,006,141,006,006,141,241
11042:007,006,141,008,006,141,087
11048:009,006,141,010,006,169,125
11054:134,141,011,006,169,006,001
11060:162,000,157,012,006,232,109
11066:224,017,208,248,169,065,221
11072:141,029,006,169,000,141,038
11078:030,006,169,006,141,031,197
11084:006,169,000,141,047,002,185
11090:141,048,002,169,006,141,077
11096:049,002,169,064,141,000,001
11102:002,169,039,141,001,002,192
11108:169,192,141,014,212,169,229
11114:034,141,047,002,096,000,170
11120:000,000,000,000,000,000,112
11126:000,000,000,000,000,000,118
11132:000,000,000,000,000,000,124
Note: The listing below is incomplete. The code for BALLCT, BRKCNT, and SCRCNT were omitted.

Program 5-2a. Chiseler Using Assembler Editor — Program Control

10 ;
20 ;PROGRAM CONTROL
30 ;
40  *=$2800
50 PTRGST=$6C2
60 BALOFS=$6A2
70 BALLNB=$6C0
80 PDLCNT=$23B8
90 LAUNCH=$6C3
0100 STIMER=53279
0110 BRKFRQ=$6C8
0120 PTRIG0=$27C
0130 ATRACT=$4D
0140 BALLS=$6AF
0150 NOMORE=$6C7
0160 BALIFE=$6A4
0170 SCRCNT=$2A00
0180 SCRNPL=$B0
0190 SCRNPH=$B1
0200 BALSPD=$6D1
0210 HIGH1=$6C9
0220 RSTFRQ=$6D2
0230 TMPDLY=$6D3
0240 BL1VPS=$6B4
0250 AUDCTL=$D208
0260 BRKVAL=$6D5
0270 STDLST=$2B00
0280 SETPLF=$2000
0290 SETPMG=$2300
0300 BALLCT=$2400
0310 BRKCNT=$2600
0320 ;
0330 ;SET UP DISPLAY LIST
0340  JSR STDLST
0350 ;
0360 ;SET HIGH SCORE EQUAL TO 00000
0370  LDX #0
0380  LDA #$50
0390 CLRHGH STA HIGH1,X
0400  INX
0410  CPX #5
0420  BNE CLRHGH
0430 ;
0440 ;THIS IS THE INTRODUCTION TO
0450 ;THE MAIN LOOP
0460 ;
0470 ;SET THE AUDIO CONTROL
0480 START LDA #0
0490  STA AUDCTL
0500 ;
0510 ;SET BALL NUMBER TO 1
0520  LDA #1
0530  STA BALLNB
0540 ;
0550 ;SET BALL SPEED
0560  LDA #20
0570  STA BALSPD
0580 ;
0590 ;SET PLAYFIELD
0600  JSR SETPLF
0610 ;
0620 ;SET P/M GRAPHICS
0630  JSR SETPMG
0640 ;
0650 ;CLEAR BRICK RESET FREQUENCY
0660  LDA #0
0670  STA RSTFRQ
0680 ;
0690 ;SET AUDIO CONTROL
0700  LDA #$A6
0710  STA $D201
0720  STA $D203
0730  LDA #$AA
0740  STA $D205
0750  STA $D207
0760 ;
0770 ;MAKE SURE FREQUENCY IS OFF
0780  LDA #0
0790  STA $D200
0800  STA $D202
0810  STA $D204
0820  STA $D206
0830 ;
0840 ;WAIT FOR PADDLE TRIGGER
0850 TRGCNT JSR PDLCNT
0860  LDA PTRIG0
0870  BNE TRGCNT
0880 ;
0890 ;SHOW THAT BALL 1
0900 ;HAS BEEN LAUNCHED
0910  LDA #1
0920  STA LAUNCH
0930 ;
0940 ;THE MAIN LOOP
0950 ;
0960 ;SET SCREEN POINTER TO $3E00
0970 MAINLP LDA #$0
0980  STA SCRNPL
0990  LDA #$3E
1000  STA SCRNPH
1010 ;
1020 ;DISPLAY BALL NUMBER
1030  LDA BALLNB
1040  CLC
1050  ADC #$10
1060  LDY #$D         ;DISPLAY
1070  STA (SCRNPL),Y ;BALL NUMBER
1080 ;
1090 ;IF A BLOCK HAS RECENTLY BEEN
1100 ;RESET, THEN PRODUCE SOUND
1110  LDX RSTFRQ
1120  BEQ NOSND
1130  DEX
1140  STX RSTFRQ
1150  LDA #$3C
1160  STA $D206
1170  JMP FIXATC
1180 NOSND LDA #0
1190  STA $D206
1200 ;
1210 ;INHIBIT ATTRACT MODE
1220 FIXATC LDA #0
1230  STA ATRACT
1240 ;
1250 ;TURN OFF FREQUENCY
1260  STA $D200
1270  STA $D202
1280  STA $D204
1290 ;
1300 ;ENABLE BALL 1 CONTROL
1310 BALCNT LDA #0
1320  STA BALOFS
1330 ;
1340 ;UPDATE BALL 1'S STATUS
1350  JSR GETFRQ
1360  JSR BALLCT
1370  JSR BRKCNT
1380 ;
1390 ;ENABLE BALL 2 CONTROL
1400  LDX #1
1410  STX BALOFS
1420 ;
1430 ;HAS BALL 2 BEEN LAUNCHED?
1440  LDA LAUNCH,X
1450  BEQ CHKLN2
1460 ;
1470 ;IF SO, THEN UPDATE ITS STATUS
1480  JSR GETFRQ
1490  JSR BALLCT
1500  JSR BRKCNT
1510 ;
1520 ;FOLLOW THE SAME PROCEDURE FOR
1530 ;BALLS THREE AND FOUR
1540 CHKLN2 LDX #2
1550  STX BALOFS
1560  LDA LAUNCH,X
1570  BEQ CHKLN3
1580  JSR GETFRQ
1590  JSR BALLCT
1600  JSR BRKCNT
1610 CHKLN3 LDX #3
1620  STX BALOFS
1630  LDA LAUNCH,X
1640  BEQ CHKEND
1650  JSR GETFRQ
1660  JSR BALLCT
1670  JSR BRKCNT
1680 ;
1690 ;CHECK IF ANY BALLS
1700 ;ARE STILL ALIVE
1710 CHKEND LDA NOMORE
1720  BEQ DELAY
1730  LDX #0
1740 LFECHK LDA BALIFE,X
1750  BNE CHKVOD
1760  INX
1770  CPX #4
1780  BNE LFECHK
1790  JMP DEAD
1800 CHKVOD LDA LAUNCH,X
1810  BNE DELAY
1820  INX
1830  CPX #4
1840  BNE LFECHK
1850  JMP DEAD
1860 DEAD LDA BALLNB
1870  CMP #5
1880  BNE GTPTRG
1890 ;
1900 ;ALL BALLS ARE DEAD
1910 ;DISPLAY "GAME OVER"
1920  LDA #$6
1930  STA SCRNPL
1940  LDA #$3E
1950  STA SCRNPH
1960  LDY #0
1970 GMEOVR LDA #$27 ;G
1980  STA (SCRNPL),Y
1990  INY
2000  LDA #$21 ;A
2010  STA (SCRNPL),Y
2020  INY
2030  LDA #$2D ;M
2040  STA (SCRNPL),Y
2050  INY
2060  LDA #$25 ;E
2070  STA (SCRNPL),Y
2080  INY
2090  INY
2100  LDA #$2F ;O
2110  STA (SCRNPL),Y
2120  INY
2130  LDA #$36 ;V
2140  STA (SCRNPL),Y
2150  INY
2160  LDA #$25 ;E
2170  STA (SCRNPL),Y
2180  INY
2190  LDA #$32 ;R
2200  STA (SCRNPL),Y
2210 ;
2220 ;WAIT FOR USER TO PRESS START
2230 CHKSTM JSR PDLCNT
2240  LDA STIMER
2250  CMP #6
2260  BNE CHKSTM
2270 ;
2280 ;START OVER
2290  JMP START
2300 ;
2310 ;ALL BALLS ARE DEAD, BUT NOT
2320 ;ALL BALL SETS
2330 ;WAIT FOR TRIGGER OR START KEY
2340 GTPTRG JSR PDLCNT
2350  LDA STIMER
2360  CMP #6
2370  BNE TRIGER
2380 ;
2390 ;START OVER
2400  JMP START
2410 TRIGER LDA PTRIG0
2420  BNE GTPTRG
2430 ;
2440 ;INCREMENT BALL NUMBER
2450  LDX BALLNB
2460  INX
2470  STX BALLNB
2480 ;
2490 ;RESET
2500  JSR SETPMG
2510 ;
2520 ;DELAY PROGRAM EXECUTION
2530 DELAY LDX BALSPD
2540  STX TMPDLY
2550 DLY1
2560  JSR PDLCNT
2570  LDA STIMER
2580  CMP #6
2590  BNE CNTDLY
2600  JMP START
2610 CNTDLY LDY #$A0
2620 DLY2 DEY
2630  BNE DLY2
2640  LDX TMPDLY
2650  DEX
2660  STX TMPDLY
2670  BNE DLY1
2680 ;
2690 ;EXECUTE MAIN LOOP AGAIN
2700  JMP MAINLP
2710 ;
2720 ;SET BRICK FREQUENCY
2730 ;AND BRICK VALUE
2740 GETFRQ LDA BL1VPS,X
2750  CLC
2760  CMP #$50
2770  BCS FRQ2
2780  LDA #$48
2790  STA BRKFRQ
2800  LDA #5 ;ADD 1 TO COMPENSATE
2810  STA BRKVAL ;FOR OFFSET
2820  RTS 
2830 FRQ2 CLC
2840  CMP #$64
2850  BCS FRQ3
2860  LDA #$6C
2870  STA BRKFRQ
2880  LDA #4
2890  STA BRKVAL
2900  RTS
2910 FRQ3 CLC
2920  CMP #$80
2930  BCS FRQ4
2940  LDA #$90
2950  STA BRKFRQ
2960  LDA #3
2970  STA BRKVAL
2980  RTS
2990 FRQ4 LDA #$D9
3000  STA BRKFRQ
3010  LDA #2
3020  STA BRKVAL
3030  RTS

Program 5-2b. Chiseler Using Assembler Editor — Display Setup

10 ;
20 ;SET UP THE DISPLAY LIST
30 ;
40  *=$2B00
50
60 ;BLANK THE TOP 16 SCAN LINES
70  LDA #$70
80  STA $600
90  STA $601
0100 ;
0110 ;SET UP 1 LINE OF IR MODE 6 (BASIC
0120 ;MODE 1), ENABLE DISPLAY LIST
0130 ;INTERRUPT AND LOAD THE MEMORY
0140 ;SCAN COUNTER WITH $3E00
0150  LDA #$C6
0160  STA $602
0170  LDA #$00
0180  STA $603
0190  LDA #$3E
0200  STA $604
0210 ;
0220 ;SET UP 1 LINE OF IR MODE 1 AND
0230 ;ENABLE 2ND DLI
0240  LDA #$86
0250  STA $605
0260 ;
0270 ;SET UP 5 LINES OF IR MODE 1
0280  LDA #$6
0290  STA $606
0300  STA $607
0310  STA $608
0320  STA $609
0330  STA $60A
0340 ;
0350 ;SET UP 1 LINE OF IR MODE 1 AND
0360 ;ENABLE 3RD DLI
0370  LDA #$86
0380  STA $60B
0390 ;
0400 ;SET UP 17 LINES OF IR MODE 1
0410  LDA #$6
0420  LDX #0
0430 MODE17 STA $60C,X
0440  INX
0450  CPX #17
0460  BNE MODE17
0470 ;
0480 ;WAIT FOR VERTICAL BLANK, THEN
0490 ;EXECUTE DISPLAY LIST AGAIN
0500  LDA #$41
0510  STA $61D
0520  LDA #$00
0530  STA $61E
0540  LDA #$6
0550  STA $61F
0560 DLISTL=$230
0570 DLISTH=$231
0580 DMACTL=$22F
0590 NMIEN=$D40E
0600 DLILOW=$200
0610 DLIHGH=$201
0620 ;DISABLE DMA
0630  LDA #0
0640  STA DMACTL
0650 ;
0660 ;INFORM ANTIC OF DISPLAY LIST
0670 ;LOCATION
0680  STA DLISTL
0690  LDA #$6
0700  STA DLISTH
0710 ;
0720 ;INFORM ANTIC OF DISPLAY LIST
0730 ;INTERRUPT LOCATION
0740  LDA #$40
0750  STA DLILOW
0760  LDA #$27
0770  STA DLIHGH
0780 ;
0790 ;ENABLE DISPLAY LIST INTERUPTS
0800  LDA #$C0
0810  STA NMIEN
0820 ;
0830 ;ENABLE DMA
0840  LDA #$22
0850  STA DMACTL
0860  RTS

Program 5-2c. Chiseler Using Assembler Editor — Display List Interrupts

10 ;
20 ;DISPLAY LIST INTERRUPTS
30 ;
40 DLILOW=$200
50 CHBASE=$D409
60 WSYNC=$D40A
70 COLPF0=$D016
80 COLPF1=$D017
90 COLPF2=$D018
0100 ;
0110 ;THIS DLI WILL AFFECT
0120 ;THE SECOND MODE LINE
0130  *=$2740
0140 ;
0150 ;SAVE REGISTERS
0160  PHA
0170  TXA
0180  PHA
0190 ;
0200 ;SET COLPF0 (SCORE) TO GREY
0210 ;AND COLPF1 (HIGH) TO RED
0220  LDA #$08
0230  LDX #$38
0240  STA WSYNC
0250  STA COLPF0
0260  STX COLPF1
0270 ;
0280 ;ENABLE STANDARD CHBASE
0290  LDA #$E0
0300  STA CHBASE
0310 ;
0320 ;ENABLE 2ND DLI
0330  LDA #$70
0340  STA DLILOW
0350 ;
0360 ;RESTORE REGISTERS
0370  PLA
0380  TAX
0390  PLA
0400 ;
0410 ;RETURN FROM INTERRUPT
0420  RTI
0430 ;
0440 ;THIS DLI WILL AFFECT
0450 ;MODE LINES 2-6
0460  *=$2770
0470  PHA
0480  TXA
0490  PHA
0500  TYA
0510  PHA
0520 ;
0530 ;SET COLPF0 (WALLS) TO LIGHT BLUE
0540 ;SET COLPF1 (BLOCK 1) TO BLUE
0550 ;SET COLPF2 (BLOCK 2) TO RED
0560  LDA #$98
0570  LDX #$78
0580  LDY #$38
0590  STA WSYNC
0600  STA COLPF0
0610  STX COLPF1
0620  STY COLPF2
0630 ;
0640 ;CHANGE CHARACTER BASE TO $3CE0
0650  LDA #$3C
0660  STA CHBASE
0670 ;
0680 ;ENABLE 3RD DLI
0690  LDA #$E0
0700  STA DLILOW
0710  PLA
0720  TAY
0730  PLA
0740  TAX
0750  PLA
0760  RTI
0770 ;
0780 ;THIS DLI WILL AFFECT
0790 ;MODE LINES 8-24
0800  *=$27E0
0810  PHA
0820  TXA
0830  PHA
0840 ;
0850 ;SET COLPF0 (BLOCK 3) TO VIOLET
0860 ;AND COLPF1 (BLOCK 4) TO YELLOW -
0870 ;GREEN
0880  LDA #$58
0890  LDX #$D8
0900  STA WSYNC
0910  STA COLPF1
0920  STX COLPF2
0930 ;
0940 ;ENABLE 1ST DLI
0950  LDA #$40
0960  STA DLILOW
0970  PLA
0980  TAX
0990  PLA
1000  RTI

Program 5-2d. Chiseler Using Assembler Editor — Playfield Setup

10 ;
20 ;SET PLAYFIELD
30 ;
40  *=$2000
50 NEWCHB=$3C00
60 SCRNPL=$B0
70 SCRNPH=$B1
80 CHBSPL=$B2
90 CHBSPH=$B3
0100 FILRW1=$2200
0110 FILRW2=$2231
0120 FILRW3=$223C
0130 FILRW4=$2247
0140 HIGH1=$6C9
0150 ;
0160 ;SET CHAR TO A BLANK SPACE
0170  LDX #0
0180  LDA #$0
0190 SBLANK STA NEWCHB,X
0200  INX
0210  CPX #8
0220  BNE SBLANK
0230 ;
0240 ;SET CHAR 1 TO A SOLID SPACE
0250  LDA #$FF
0260 SSOLID STA NEWCHB,X
0270  INX
0280  CPX #16
0290  BNE SSOLID
0300 ;
0310 ;SCRNPL POINTS TO THE
0320 ;SCREEN MEMORY REGION
0330  LDA #$00
0340  STA SCRNPL
0350  LDA #$3E
0360  STA SCRNPH
0370 ;
0380 ;CLEAR SCREEN MEMORY REGION
0390 CLRSMR LDY #0
0400  LDA #0
0410 STRSMR STA (SCRNPL),Y
0420  INY
0430  BNE STRSMR
0440  LDX SCRNPH
0450  INX
0460  STX SCRNPH
0470  CPX #$3F ;SCREEN MEMORY
0480  BEQ CLRSMR
0490 ;
0500 ;PRINT "BALL - 0" ON TOP LINE
0510  LDA #$22 ;B
0520  STA $3E06
0530  LDA #$21 ;A
0540  STA $3E07
0550  LDA #$2C ;L
0560  STA $3E08 ;L
0570  STA $3E09
0580  LDA #$D ;-
0590  STA $3E0B
0600  LDA #$10 ;0
0610 ;
0620 ;DISPLAY SCORE (00000)
0630  STA $3E0D
0640  STA $3E17
0650  STA $3E18
0660  STA $3E19
0670  STA $3E1A
0680  STA $3E1B
0690 ;
0700 ;DISPLAY HIGH (XXXXX)
0710  LDX #0
0720 DSPHGH LDA HIGH1,X
0730  STA $3E21,X
0740  INX
0750  CPX #5
0760  BNE DSPHGH
0770 ;
0780 ;RESET SCREEN MEMORY POINTER
0790  LDA #$0
0800  STA SCRNPL
0810  LDA #$3E
0820  STA SCRNPH
0830 ;
0840 ;DRAW TOP WALL
0850  LDY #$2A
0860  LDA #1
0870 DRWTOP STA (SCRNPL),Y
0880  INY
0890  CPY #$3B
0900  BNE DRWTOP
0910 ;
0920 ;DRAW LEFT AND RIGHT WALLS
0930 DRWALS LDY #$3E
0940 DRWLFT LDA #1
0950  STA (SCRNPL),Y
0960  TYA
0970  CLC
0980  ADC #16
0990  TAY
1000  LDA #1
1010 DRWRGT STA (SCRNPL),Y
1020  TYA
1030  CLC
1040  ADC #4
1050  TAY
1060  SEC
1070  CMP #$F1
1080  BCC DRWLFT
1090  LDX SCRNPH
1100  INX
1110  STX SCRNPH
1120  CPX #$40
1130  BEQ TWOMOR
1140  LDY #6
1150  JMP DRWLFT
1160 ;
1170 ;PERFECT WALL
1180 TWOMOR LDA #$1
1190  STA $3EF2
1200  STA $3F02
1210  LDA #$0
1220  STA SCRNPL
1230  LDA #$3E
1240  STA SCRNPH
1250 ;
1260 ;LOAD EACH BRICK ROW WITH
1270 ;15 DISTINCT CHARACTERS
1280 ;
1290 ;ROW 1 GETS CHARS 4-12
1300 ;(#$40 IS ADDED FOR COLPF1)
1310  LDY #$67
1320  LDX #$44
1330 FIXRW1 TXA
1340  STA (SCRNPL),Y
1350  INX
1360  INY
1370  CPX #$53
1380  BNE FIXRW1
1390 ;
1400 ;ROW 2 GETS CHARS 13-21
1410 ;(#$80 IS ADDED FOR COLPF2)
1420  LDY #$A3
1430  LDX #$93
1440 FIXRW2 TXA
1450  STA (SCRNPL),Y
1460  INX
1470  INY
1480  CPX #$A2
1490  BNE FIXRW2
1500 ;
1510 ;ROW 3 USES CHARS 22-30
1520 ;(ADD #$40 FOR COLPF1)
1530  LDY #$DF
1540  LDX #$62
1550 FIXRW3 TXA
1560  STA (SCRNPL),Y
1570  INX
1580  INY
1590  CPX #$71
1600  BNE FIXRW3
1610  LDA #$3F
1620  STA SCRNPH
1630 ;
1640 ;ROW 4 USES CHARS 31-3F
1650 ;(ADD #$80 FOR COLPF2)
1660  LDY #$1B
1670  LDX #$B1
1680 FIXRW4 TXA
1690  STA (SCRNPL),Y
1700  INX
1710  INY
1720  CPX #$C0
1730  BNE FIXRW4
1740 ;
1750 ;CLEAR CHARACTER, BASE
1760 ;FROM $3C20-3DFF
1770  LDA #$20
1780  STA CHBSPL
1790  LDA #$3C
1800  STA CHBSPH
1810  LDY #0
1820  TYA
1830 CLRCHB STA (CHBSPL),Y
1840  INY
1850  BNE CLRCHB
1860  LDA #$3D
1870  STA CHBSPH
1880  LDA #0
1890 CHBTWO STA (CHBSPL),Y
1900  INY
1910  CPY #$E0
1920  BNE CHBTWO
1930 ;
1940 ;CHECK IF ANY ROWS HAVE BEEN
1950 ;CLEARED. IF THEY HAVE, THEN
1960 ;RESET THEM
1970 CHKRW1 LDA #$20
1980  STA CHBSPL
1990  LDA #$3C
2000  STA CHBSPH
2010  LDY #0
2020 GETRW1 LDA (CHBSPL),Y
2030  BNE CHKRW2
2040  INY
2050  CPY #120 ;CHECK 120 BRICKS
2060  BNE GETRW1
2070  JSR FILRW1
2080 CHKRW2 LDA #$98
2090  STA CHBSPL
2100  LDY #0
2110 GETRW2 LDA (CHBSPL),Y
2120  BNE CHKRW3
2130  INY
2140  CPY #120
2150  BNE GETRW2
2160  JSR FILRW2
2170 CHKRW3 LDA #$10
2180  STA CHBSPL
2190  LDA #$3D
2200  STA CHBSPH
2210  LDY #0
2220 GETRW3 LDA (CHBSPL),Y
2230  BNE CHKRW4
2240  INY
2250  CPY #120
2260  BNE GETRW3
2270  JSR FILRW3
2280 CHKRW4 LDA #$88
2290  STA CHBSPL
2300  LDY #0
2310 GETRW4 LDA (CHBSPL),Y
2320  BNE FINISH
2330  INY
2340  CPY #120
2350  BNE GETRW4
2360  JSR FILRW4
2370 FINISH RTS

Program 5-2e. Chiseler Using Assembler Editor — Reset Brick Rows

10 ;
20 ;SHOULD BRICK ROWS BE RESET?
30 ;
40  *=$2200
50 CHBSPL=$B2
60 CHBSPH=$B3
70 BALSPD=$6D1
80 RSTFRQ=$6D2
90 ;
0100 ;MAKE CHARACTER BASE POINTER
0110 ;POINT TO BRICK ROW 1
0120 BRKROW LDA #$20
0130  STA CHBSPL
0140  LDA #$3C
0150  STA CHBSPH
0160 ;
0170 ;IS BRICK ROW CLEAR?
0180 SETY LDY #$0
0190 CHKROW LDA (CHBSPL),Y
0200 ;
0210 ;IF NOT THEN RETURN
0220  BNE NOTCLR
0230  INY
0240  CPY #$78
0250  BNE CHKROW
0260 ;
0270 ;IF SO, THEN REFILL BRICK ROW
0280  LDY #$0
0290  LDA #$FF
0300 FILROW STA (CHBSPL),Y
0310  INY
0320  CPY #$78
0330  BNE FILROW
0340 ;
0350 ;PRODUCE SOUND TO CORRESPOND
0360 ;WITH RESET
0370  LDA #$29
0380  STA RSTFRQ
0390 ;
0400 ;SPEED UP BALLS
0410  LDA BALSPD
0420  CMP #1
0430  BEQ NOTCLR
0440  SEC
0450  SBC #1
0460  STA BALSPD
0470 NOTCLR RTS
0480 ;
0490 ;MAKE CHARACTER BASE POINTER
0500 ;POINT TO BRICK ROW 2
0510 BRKRW2 LDA #$98
0520  STA CHBSPL
0530  LDA #$3C
0540  STA CHBSPH
0550  JMP SETY
0560 ;
0570 ;MAKE CHARACTER BASE POINTER
0580 ;POINT TO BRICK ROW 3
0590 BRKRW3 LDA #$10
0600  STA CHBSPL
0610  LDA #$3D
0620  STA CHBSPH
0630  JMP SETY
0640 ;
0650 ;MAKE CHARACTER BASE POINTER
0660 ;POINT TO BRICK ROW 4
0670 BRKRW4 LDA #$88
0680  STA CHBSPL
0690  LDA #$3D
0700  STA CHBSPH
0710  JMP SETY

Program 5-2f. Chiseler Using Assembler Editor — Player/Missile Graphics

10 ;
20 ;SET PLAYER/MISSILE GRAPHICS
30 ;
40  *=$2300
50 PMBASE=$D407
60 PMBSPL=$B4
70 PMBSPH=$B5
80 GRACTL=$D01D
90 DMACTL=$22F
0100 SIZEP0=$D008
0110 COLPM0=$2C0
0120 COLPM1=$2C1
0130 COLPM2=$2C2
0140 COLPM3=$2C3
0150 COLPF3=$2C7
0160 NMIEN=$D40E
0170 PADDL0=$270
0180 HPOSP0=$D000
0190 RANDOM=$D20A
0200 TEMP=$6A0
0210 PDLHPS=$6A3
0220 BALLS=$6AF
0230 NOMORE=$6C7
0240 LAUNCH=$6C3
0250 AVOID=$6AB
0260 BALIFE=$6A4
0270 BL1HPS=$6B0
0280 BL1VPS=$6B4
0290 BL1HDR=$6B8
0300 BL1VDR=$6BC
0310 ;
0320 ;ENABLE PLAYER/MISSILE DMA
0330  LDA #62
0340  STA DMACTL
0350 ;
0360 ;SET PLAYER (PADDLE)
0370 ;TO DOUBLE WIDTH
0380  LDA #1
0390  STA SIZEP0
0400 ;
0410 ;COLOR PADDLE ORANGE-GREEN
0420  LDA #$EF
0430  STA COLPM0
0440 ;
0450 ;COLOR BALLS WHITE
0460  LDA #$F
0470  STA COLPM1
0480  STA COLPM2
0490  STA COLPM3
0500  STA COLPF3
0510 ;
0520 ;SET P/M BASE TO $3000
0530  LDA #$30
0540  STA PMBASE
0550 ;
0560 ;ENABLE PLAYER/MISSILE GRAPHICS
0570  LDA #3
0580  STA GRACTL
0590 ;
0600 ;CLEAR P/M GRAPHICS TABLE
0610  LDA #$0
0620  STA PMBSPL
0630  LDA #$30
0640  STA PMBSPH
0650  LDY #0
0660  TYA
0670 CLRPMB STA (PMBSPL),Y
0680  INY
0690  BNE CLRPMB
0700  LDX PMBSPH
0710  INX
0720  STX PMBSPH
0730  CPX #$38
0740  BNE CLRPMB
0750 ;
0760 ;DRAW PADDLE
0770  LDA #$FF
0780  STA $34C4
0790  STA $34C5
0800  STA $34C6
0810  LDA #$FF
0820  STA $34DD
0830  STA $34DE
0840  STA $34DF
0850 ;
0860 ;MAKE SURE BALLS DON'T LAUNCH
0870 ;BEFORE THEIR TIME IS DUE
0880  LDA #0
0890  STA $6C4 ;LAUNCH+1
0900  STA $6C5
0910  STA $6C6
0920 ;
0930 ;WHEN NOMORE=1, NO MORE BALLS
0940 ;WILL BE LAUNCHED. NOMORE WILL
0950 ;BE SET TO 1 WHEN USER MISSES
0960 ;A BALL
0970  STA NOMORE
0980 ;
0990 ;BALLS HOLDS THE NUMBER OF BALLS
1000 ;ON THE FIELD AT ONE TIME
1010 ;THIS WILL BE INITIALIZED TO
1020  LDA #1
1030  STA BALLS
1040 ;
1050 ;SET EACH BALL TO A RANDOM
1060 ;HORIZONTAL POSITION
1070 ;BETWEEN #$4B AND #$BA
1080  LDX #0
1090 RNDHPS LDA RANDOM
1100  SEC
1110  CMP #$4B
1120  BCC RNDHPS
1130  CLC
1140  CMP #$BA
1150  BCS RNDHPS
1160  STA BL1HPS,X
1170  INX
1180  CPX #4
1190  BNE RNDHPS
1200 ;
1210 ;SET EACH BALL'S VERTICAL
1220 ;POSITION TO TOP OF FIELD
1230  LDX #0
1240 FIXVPS LDA #$2F
1250  STA BL1 VPS,X
1260 ;
1270 ;BALLS MUST AVOID BRICKS
1280 ;UNTIL THEY HIT THE PADDLE
1290  LDA #$70
1300  STA AVOID,X
1310  INX
1320  CPX #4
1330  BNE FIXVPS
1340 ;
1350 ;SET EACH BALL TO A RANDOM
1360 ;HORIZONTAL DIRECTION
1370  LDX #0
1380 RNDHDR LDA RANDOM
1390  AND #1
1400  STA BL1HDR,X
1410  INX
1420  CPX #4
1430  BNE RNDHDR
1440 ;
1450 ;ALL BALLS MUST MOVE DOWN
1460 ;WHEN THEY ARE LAUNCHED
1470  LDX #0
1480 FIXVDR LDA #1
1490  STA BL1VDR,X
1500  INX
1510  CPX #4
1520  BNE FIXVDR
1530 ;
1540 ;GIVE EACH BALL LIFE
1550  LDX #0
1560 ACTVTE LDA #1
1570  STA BALIFE,X
1580  INX
1590  CPX #4
1600  BNE ACTVTE
1610 ;HORIZONTAL PADDLE POSITION
1620 ;MUST CORRESPOND TO PADDLE
1630 PDLCNT LDA PADDL0
1640  LSR A
1650  CLC
1660  ADC #$46
1670  STA TEMP
1680  LDA #$FF
1690  SEC
1700  SBC TEMP
1710  SEC
1720  CMP #$B1
1730  BCC STRHPS
1740  LDA #$B1
1750 STRHPS STA HPOSP0
1760 ;
1770 ;THE POSITION OF THE PADDLE
1780 ;WILL BE NEEDED LATER
1790  STA PDLHPS
1800  RTS