aboutsummaryrefslogtreecommitdiff
path: root/defender.info
blob: 519fadbb175353ea2eca3ce61553440726afa619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
global {
	outputname "defender.ca65";
	inputname "defender.rom";
	startaddr $8000;
	cpu "6502";
	comments 4;
};

# code addresses
label { name "init_cart"; addr $8000; comment "cart_a_start points here. copy-protection setup prevents the game from starting if it's been >= 256 jiffies (~4 sec) since cold or warm start"; };
label { name "rtclok_ok"; addr $800b; };
label { name "init_work_ram"; addr $a268; };
label { name "start_game"; addr $8100; comment "..."; };
label { name "show_game_type"; addr $811f; comment "draw the text for e.g. ONE PLAYER EASY"; };
label { name "sgt_nextchar"; addr $813d; };
label { name "sgt_done"; addr $8147; };
label { name "draw_title_text"; addr $8259; comment "draw the text for DEFENDER/SELECT GAME AND PRESS THE START BUTTON"; };
label { name "draw_demo_text"; addr $895c; comment "draw the text for DEFENDER c 1982 ATARI, during the demo game"; };
label { name "ddt_draw"; addr $8963; };
label { name "ddt_nextchar"; addr $8980; };
label { name "ddt_done"; addr $898b; };
label { name "dtt_lo"; addr $8267; comment "lda #<title_text"; };
label { name "dtt_hi"; addr $826b; comment "lda #>title_text"; };
label { name "dtt_loop"; addr $8271; };
label { name "dtt_color"; addr $8279; comment "multicolor support. bytes with $Fn in the message set the color mask to nn."; };
label { name "dtt_print"; addr $8288; };
label { name "dtt_inc_ptr"; addr $828b; };
label { name "dtt_done"; addr $8294; };
label { name "read_consol"; addr $baa0; comment "see if start or select are pressed, set flags"; };
label { name "start_pressed"; addr $bac6; comment "user pressed start key, ignore if game is playing & not paused"; };
label { name "consol_done"; addr $bab4; comment "several code paths jump here instead of doing their own RTS"; };
label { name "ignore_start"; addr $bad1; comment "don't handle start key while game is playing & not paused"; };
label { name "handle_select"; addr $babc; };
label { name "select_pressed"; addr $bab5; comment "user pressed select key, ignore if game is playing & not paused"; };
label { name "vkeybd_handler"; addr $ba6d; comment "stuffed into VKEYBD in setup_vectors"; };
label { name "vkeybd_finish"; addr $ba98; comment "reset debounce counter and exit"; };
label { name "check_key_code"; addr $ba76; comment "keypress is debounced, see which key was hit"; };
label { name "esc_pressed"; addr $ba8f; comment "toggle pause mode, when game is playing"; };
label { name "space_pressed"; addr $ba89; comment "detonate smart bomb if any left, when game is playing"; };
label { name "other_key_pressed"; addr $ba83; comment "neither space nor esc was pressed. either some other key, or no key ($ff)"; };
label { name "dli_handler"; addr $ba46; comment "stuffed into VDSLST in setup_vectors"; };
label { name "top_dli_handler"; addr $ba59; comment "handle first DLI (VCOUNT == $10)"; };
label { name "bottom_dli_handler"; addr $ba4e; comment "handle 2nd DLI (VCOUNT == $6F)"; };
label { name "update_sound"; addr $8d27; comment "this is for 'event' sounds like explosions, not the 'drone' nor the engine noise"; };
label { name "us_ok"; addr $8d33; };
label { name "us_done"; addr $8d4a; };
label { name "ram_self_destruct_1"; addr $b47f; comment "copy protection, causes game to crash next time the player gets killed. called from several places in the code."; };
label { name "smartbomb_check"; addr $8b8a; comment "see if player pressed the space bar (spacebar_flag >= $80)"; };
label { name "ram_self_destruct_2"; addr $8b8e; comment "copy protection. if we're running from RAM, cause game to jump to the title screen, then refuse to start"; };
label { name "rom_ok"; addr $8ba3; comment "if we get here, we're running from ROM"; };
label { name "smartbomb_yes"; addr $8ba4; comment "see if we have any bombs left, if so, detonate"; };
label { name "clear_screen"; addr $b8a1; comment "zero out $2218 - $4017 (screen actually ends at $3fc7). the only place where ram above $3fff is accessed (written to, never read, so it's OK on a 16K Atari)"; };
label { name "next_level"; addr $83c9; comment "notice the check against $64? that's why we get stuck on level 99 over & over again"; };
label { name "level_ok"; addr $83d7; comment "ramp up the speed on odd-numbered levels"; };
label { name "set_game_type"; addr $80e6; };
label { name "update_title_colors"; addr $809a; comment "rotate colors"; };
label { name "update_title_sfx"; addr $80a6; comment "alter the drone sound's pitch"; };
label { name "tsi_show_gt"; addr $8092; };
label { name "tsi_wait_to_draw"; addr $8095; };
label { name "tsi_delay"; addr $80c8; };
label { name "tsi_check_start"; addr $80b7; };
label { name "title_screen_idle"; addr $8078; comment "play & fade the drone while we wait for the user to press select or start"; };
label { name "tsi_text"; addr $808f; comment "play & fade the drone while we wait for the user to press select or start"; };
label { name "init_title_screen"; addr $8031; };
label { name "init_drone"; addr $8d79; comment "start the drone sound you hear at the title screen & when starting/ending a level. Also silence channel 2 (the engine noise). In BASIC this would be: SOUND 1,0,0,0:SOUND 2,255,10,15:SOUND 3,254,10,15"; };
label { name "game_on"; addr $8369; comment "called when start button is pressed from title screen or pause mode"; };
label { name "protection_ok"; addr $811c; };
label { name "init_hardware"; addr $b889; };
label { name "init_screen_ptrs"; addr $b902; };
label { name "_isp_loop"; addr $b90e; };
label { name "fill_offset_index_table"; addr $b937; comment "fill $1a00-$1aff with repeating pattern 00 01 02 03 ..."; };
label { name "fill_pixel_mask_table"; addr $b94a; };
label { name "fill_hoffset_table"; addr $b95a; comment "fill horizontal offset table (if that's what it really is): 00 00 00 00 01 01 01 01 ... to 27 27 27 27, which repeats to the end of the page"; };
label { name "setup_display_list"; addr $b97d; comment "create display list at dlist_ram"; };
label { name "setup_vectors"; addr $b9d8; };
label { name "out_of_lives"; addr $b70e; };
label { name "player_died_same_level"; addr $b6cf; };
label { name "player_died_next_level"; addr $b6c1; comment "player collided with last enemy, cleared the level, but died"; };
label { name "start_player_death"; addr $b64c; comment "explosion animation, then bookkeeping"; };
label { name "flash_ship"; addr $b65c; comment "flash the ship's colors just before it explodes"; };
label { name "flash_wait_1"; addr $b660; };
label { name "flash_wait_2"; addr $b66f; };
label { name "flash_wait_3"; addr $b673; };
label { name "play_event_sound"; addr $8d4b; comment "play the sound pointed to by Y:A (lsb:msb), if another sound isn't already in progress (X is a priority I think)"; };
label { name "priority_ok"; addr $8d59; };
label { name "sound_not_busy"; addr $8d58; };
label { name "play_planet_explode"; addr $8e78; };
label { name "play_ship_died"; addr $8e6a; };
label { name "play_extra_life"; addr $8e5c; };
label { name "play_smartbomb"; addr $8e4e; };
label { name "play_distress"; addr $8e40; };
label { name "play_materialize"; addr $8e32; };
label { name "play_human_died"; addr $8e24; };
label { name "play_rescued"; addr $8e16; };
label { name "play_fall"; addr $8e08; };
label { name "play_lander_fire"; addr $8dfa; };
label { name "play_swarmer_taunt"; addr $8dec; };
label { name "play_mutant_taunt"; addr $8dde; };
label { name "play_pod_died"; addr $8dd0; };
label { name "play_baiter_died"; addr $8dc2; };
label { name "play_lander_died"; addr $8db4; };
label { name "play_swarmer_died"; addr $8da6; };
label { name "play_player_fire"; addr $8d98; };
label { name "play_silence"; addr $8d68; };
label { name "check_hyperspace"; addr $8881; comment "did the player press a key to use hyperspace?"; };
label { name "hyperspace_pressed"; addr $8886; comment "yes, he did"; };
label { name "hsp_loop"; addr $8899; };
label { name "hsp_check_demo"; addr $88ae; comment "don't ever kill the 'player' in demo mode (game_type==0)";  };
label { name "check_hyperspace_fatal"; addr $88b2; comment "kill player if RANDOM >= $AA (in other words, 33% of the time!)";  };
label { name "hsp_done"; addr $88bc; };
label { name "animate_starfield"; addr $a832; comment "XXX don't know how this works yet"; };
label { name "hyperspace_implosion"; addr $97e7; comment "looks like the ship explosion, but in reverse"; };
label { name "ship_explosion"; addr $97d9; comment "particles"; };
label { name "init_splosion"; addr $97f7; comment "calculate (ex|im)plosion particles for the player ship"; };
label { name "animate_explosion"; addr $9830; };
label { name "ae_loop"; addr $983d; };
label { name "animate_implosion"; addr $9868; };
label { name "ai_loop"; addr $9875; };
label { name "animate_splosion"; addr $9895; comment "called multiple times by animate_(im|ex)plosion. uses particles set up by init_splosion"; };
label { name "as_done"; addr $9961; };
label { name "is_loop"; addr $97f9; };
label { name "clear_scanner_draw_planet_and_humans"; addr $9e5e; comment "XXX don't know how this works yet"; };
label { name "draw_scanner_border_and_planet"; addr $9fb1; comment "XXX don't know how this works yet (the planet in the scanner here!)"; };
label { name "add_cursprite_points"; addr $a7ae; comment "add points to score based on what kind of enemy we killed. does not include points for rescued humans nor end-of-level bonus."; };
label { name "add_points"; addr $a7b2; comment "this entry point takes a sprite type in A, used for end-of-level bonus (and...?)"; };
label { name "draw_scores"; addr $9442; comment "draw score digits in the HUDs for both players (but not lives nor smartbombs)"; };
label { name "dsc_ok"; addr $9458; };
label { name "draw_score_2p"; addr $93e2; comment "draw current player's score in 2p mode. does nothing in 1p mode!"; };
label { name "ds2p_p1"; addr $9426; comment "draw player 1's score since he's the current player"; };
label { name "ds2_ok"; addr $93f8; };
label { name "print_number"; addr $9483; comment "print number in A, at current cursor pos. range 0-99 (0-$63). does division by 10. suppress leading zeroes if leading_zero_flag is clear."; };
label { name "pn_div10"; addr $9488; };
label { name "pn_div10_loop"; addr $948d; };
label { name "pn_draw"; addr $94b5; };
label { name "pn_skip"; addr $94b8; };
label { name "pn_div10_ok"; addr $949e; };
label { name "clear_score"; addr $93bc; comment "print 7 spaces over the current player's score. used to flash the score of the current player"; };
label { name "fs_set_y"; addr $93d2; };
label { name "fs_next_char"; addr $93d9; };
label { name "fs_done"; addr $93e1; };
label { name "copy_code_to_ram"; addr $a291; comment "copy is done because the code is self-modifying"; };
label { name "clr_ram_sprites_loop"; addr $a2aa; };
label { name "crsl_ok"; addr $a2b4; };
label { name "copy_ram_sprites_loop"; addr $a2c0; };
label { name "draw_sprite_left"; addr $aa7b; comment "draw left half of ship, enemy, projectile, bomb, human. copied to RAM at draw_sprite_left_copy and called there."; };
label { name "dsl_selfmod_lo"; addr $aa80; comment "modify operands of (the RAM copies of) instructions marked with HERE"; };
label { name "dsl_selfmod_hi"; addr $aa89; comment "modify operands of (the RAM copies of) instructions marked with HERE"; };
label { name "dsl_HERE_1"; addr $aabd; comment "operand gets modified"; };
label { name "dsl_HERE_2"; addr $aac7; comment "operand gets modified"; };
label { name "dsl_loop"; addr $aaaf; };
label { name "draw_sprite_right"; addr $aad7; comment "draw right half of ship, enemy, projectile, bomb, human. copied to RAM at draw_sprite_right_copy and called there."; };
label { name "dsr_selfmod_lo"; addr $aadc; comment "modify operands of (the RAM copies of) instructions marked with HERE"; };
label { name "dsr_selfmod_hi"; addr $aae5; comment "modify operands of (the RAM copies of) instructions marked with HERE"; };
label { name "dsr_HERE_1"; addr $ab13; comment "operand gets modified"; };
label { name "dsr_HERE_2"; addr $ab1d; comment "operand gets modified"; };
label { name "dsr_loop"; addr $ab05; };
label { name "draw_sprite_left_copy"; addr $1f00; size 128; comment "self-modifying RAM copy of draw_sprite_left"; };
label { name "draw_sprite_right_copy"; addr $1f80; size 128; comment "self-modifying RAM copy of draw_sprite_right"; };
label { name "read_trigger"; addr $861c; comment "TRIG0 or 1 depending on which player is playing"; };
label { name "store_trigger"; addr $8628; };
label { name "handle_trigger"; addr $99d0; comment "trigger was pressed, decide what (if anything) to do about it"; };
label { name "check_shot_table"; addr $99d4; comment "look for an empty slot. if the table is full (4 shots in progress, ignore this trigger press. otherwise, Y is the byte index of the empty slot ($00, $04, $08, or $0c)."; };
label { name "shoot"; addr $99e6; comment "fire player's laser in the direction he's facing"; };
label { name "delta_right"; addr $9a09; comment "delta for shot = 2"; };
label { name "delta_left"; addr $9a0e; comment "delta $FE aka -2"; };
label { name "shot_right"; addr $99f6; comment "start position for right-facing shot"; };
label { name "shot_left"; addr $99fc; comment "start position for left-facing shot"; };
label { name "set_start_pos"; addr $99ff; comment "set start and end to same pos"; };
label { name "set_delta"; addr $9a10; };
label { name "update_player_shots"; addr $9a17; comment "move and draw player shots. remove from table if they reach the end of the screen"; };
label { name "ups_found"; addr $9a2e; };
label { name "ups_store_x"; addr $9a48; };
label { name "ups_done"; addr $9a7f; };
label { name "ups_erase"; addr $9a80; };
label { name "start_explosion"; addr $9c1a; comment "enemy or humanoid explosions, *not* the player's ship"; };
label { name "smartbomb_flash"; addr $9c0d; comment "flash screen when bomb goes off (whether any enemies are on screen or not)"; };
label { name "sbf_loop"; addr $9c0f; };
label { name "spawn_sprite"; addr $abed; comment "XXX does this apply to humanoids too?"; };
label { name "nl_wtf"; addr $83cb; comment "this branch should never be taken (means level was $FF, but it's clamped to $63 below)"; };
label { name "nl_drone"; addr $83ea; };
label { name "nl_next_stars"; addr $83f8; };
label { name "nl_delay"; addr $8414; };
label { name "level_cleared"; addr $8427; comment "decide whether or not to resurrect dead humans"; };
label { name "dont_repopulate"; addr $843f; };
label { name "div_5_loop"; addr $842c; };
label { name "clear_enemy_explosions"; addr $845b; };
label { name "cex_loop"; addr $845f; };
label { name "prep_next_level"; addr $8465; comment "clean up game state, show prompt if in 2p mode"; };
label { name "pnl_store_trig"; addr $8478; comment "store either TRIG0 or TRIG1"; };
label { name "pnl_clear_player_shots"; addr $849a; };
label { name "check_consol"; addr $8503; comment "handle start/select keys during gameplay (ignore if not paused)"; };
label { name "cc_chk_start"; addr $8511; };
label { name "cc_chk_keyboard"; addr $851c; comment "in demo mode, pressing any key returns to the title screen"; };
label { name "check_paused"; addr $852a; };
label { name "wait_draw_ok"; addr $853f; };
label { name "check_spawn"; addr $854c; comment "see if it's time to spawn a lander wave or a baiter yet"; };
label { name "draw_p1_lives_and_bombs"; addr $86b0; comment "update HUD"; };
label { name "draw_p2_lives_and_bombs"; addr $8780; comment "update HUD"; };
label { name "move_ship"; addr $85c9; comment "only in non-demo game"; };
label { name "erase_ship"; addr $b588; comment "zero out memory to avoid leaving trails"; };
label { name "erase_sprite"; addr $ab2c; comment "zero out memory to avoid leaving trails"; };
label { name "erase_sprite_XXX"; addr $a786; comment "XXX wrapper for erase_sprite, dunno why yet"; };
label { name "erase_baiter_right_half"; addr $a561; comment "no other enemy is a double-wide sprite, is it?"; };
label { name "check_ship_collision"; addr $b5fb; comment "if hit, explode the ship and return with carry set. otherwise, return with carry clear."; };
label { name "not_invuln"; addr $b600; comment "bounding box is 20x10, with X offset 3 from actual ship position."; };
label { name "ni_cmp_abs_y"; addr $b60b; comment "if(abs(ship_y_pos - sprite_y) < 6) goto ship_collision;"; };
label { name "ni_cmp_abs_x"; addr $b61d; comment "if(abs(ship_x_pos - sprite_x) < 11) goto ship_collision;"; };
label { name "no_collision"; addr $b767; };
label { name "jmp_no_coll"; addr $b621; };
label { name "ship_collision"; addr $b624; comment "player ran into something"; };
label { name "no_swarmers"; addr $b64a; };
label { name "clear_baiters"; addr $b86d; comment "XXX I think this is correct, but disabling it doesn't do what I think it should"; };
label { name "clear_temp_enemies"; addr $b769; comment "remove baiters, enemy shots, bombs. called when the player dies."; };
label { name "destroy_planet"; addr $9e0a; comment "planet explosion sequence. doesn't set planet_dead_flag (that's done by the caller, after this returns)"; };
label { name "spawn_swarmers"; addr $a711; comment "called when a pod dies"; };
label { name "draw_ship"; addr $b5a1; comment "draw the player's ship (in playfield, or lives in HUD), but not the rocket exhaust"; };
label { name "erase_exhaust"; addr $9962; comment "erase the player's rocket exhaust"; };
label { name "erase_scanner_ship"; addr $a20c; comment "erase the player's ship (white cross) in the scanner"; };
label { name "draw_scanner_ship"; addr $a193; comment "draw the player's ship (white cross) in the scanner"; };
label { name "draw_scanner_sprite"; addr $a0af; comment "draw enemies/humanoids in scanner"; };
label { name "erase_scanner_sprite"; addr $a12d; comment "erase enemies/humanoids in scanner"; };
label { name "draw_sprite"; addr $a749; comment "draw enemies/humanoids in playfield. return with carry set if there's a ship collision (player died), else clear."; };
label { name "ship_exhaust"; addr $9986; comment "draw the player's rocket exhaust, if he's thrusting"; };
label { name "draw_smartbombs"; addr $8736; comment "draw smartbombs in the HUD, if any are left (max 3)"; };
label { name "smartbombs_ok"; addr $8744; comment "A holds number of visible bombs, 1 to 3"; };
label { name "check_extra_life"; addr $a7d6; comment "if score+1 rolled over $63 => 0, we passed 10K points. note that *all* changes to the score pass through here, so this check is always done."; };
label { name "aep_done"; addr $a7fa; };
label { name "read_joystick"; addr $adb0; comment "result in A and Y. notice it's inverted."; };
label { name "read_joystick_p2"; addr $adbf; };
label { name "check_horiz_move"; addr $ad01; comment "check for right (a&$08) or left (a&$04) movement. remember Y holds the result of read_joystick (inverted PORT(A|B) value)"; };
label { name "apply_thrust"; addr $ad41; };
label { name "check_ship_move"; addr $acee; comment "returns with carry clear if the ship moved, set if not. only checks one axis per call (vert or horiz). XXX magic constants and unknown locations used!"; };
label { name "check_vert_move"; addr $ad85; comment "check for down (a&$02) or up (a&$01) movement"; };
label { name "thrust_right"; addr $ad29; };
label { name "thrust_left"; addr $ad64; };
label { name "no_vert_move"; addr $ad98; comment "ship not moving up or down XXX how does this work?"; };
label { name "move_up"; addr $ad90; comment "XXX how does this work?"; };
label { name "move_down"; addr $ad94; comment "XXX how does this work?"; };
label { name "demo_logic"; addr $88bd; comment "animate the demo-game ship"; };
label { name "dl_hyperspace"; addr $894c; };
label { name "dl_smartbomb"; addr $8952; };
label { name "dl_done"; addr $8959; };
label { name "dl_down"; addr $891c; comment "move the ship down"; };
label { name "dl_vert_delta"; addr $88f0; comment "move the ship up or down, towards the sprite we're considering. actual movement ends up as the sum of all the calls here"; };
label { name "dl_vert_move"; addr $88dd; };
label { name "dl_vm_next"; addr $88e4; };
label { name "dl_trigger"; addr $8946; };
label { name "dl_check_move"; addr $88d1; comment "is it time to move the ship?"; };
label { name "dl_check_hyper"; addr $892b; };
label { name "printchar"; addr $972e; comment "print the DSCII text character in the A reg"; };
label { name "pch_done"; addr $9757; };
label { name "print_copyright"; addr $9758; comment "print copyright symbol ($c0). it's double-wide, so 2 glyphs"; };
label { name "print_crlf"; addr $9769; comment "print carriage return ($8d)"; };
label { name "print_space"; addr $9772; comment "print a space ($a0)"; };
label { name "print_digit"; addr $977b; comment "print a number ($b0-$ba)"; };
label { name "print_letter"; addr $978f; comment "print a letter ($c1-$db). does not call draw_glyph like you might expect."; };
label { name "draw_glyph"; addr $94bc; comment "draw the glyph at address (font + glyph_offset)"; };
label { name "pl_next_line"; addr $97a7; };
label { name "dg_next_line"; addr $94d5; };
label { name "print_end_level_msg"; addr $9642; comment "ATTACK WAVE n COMPLETED, BONUS x nnn"; };
label { name "aw_loop"; addr $9652; };
label { name "print_level"; addr $965d; };
label { name "completed_loop"; addr $9667; };
label { name "clamp_bonus"; addr $9672; comment "limit bonus multiplier to 5 (hundred, actually)"; };
label { name "print_bonus_mult"; addr $967a; comment "print 1st digit of bonus multiplier (range 1-5)"; };
label { name "print_bonus_00"; addr $9684; comment "print 00 after the 1-digit multiplier"; };
label { name "add_bonus"; addr $96a2; comment "add the bonus * multiplier to the score, for remaining humanoids"; };
label { name "ab_next_sprite"; addr $9698; };
label { name "calc_bonus_index"; addr $96c7; comment "A = 7 + (level < 6 ? level : 5); // index into score_points_table"; };
label { name "cbi_add7"; addr $96cf; comment "add 7 because that's where the bonus amounts start, in score_points_table"; };
label { name "save_p1_state"; addr $89b9; comment "save game state to p1_sav_* area"; };
label { name "sp1_loop"; addr $89bb; };
label { name "sp1_skip"; addr $89cb; };
label { name "sp2_loop"; addr $8a0f; };
label { name "sp2_skip"; addr $8a1f; };
label { name "lp1_loop"; addr $8a63; };
label { name "lp1_skip"; addr $8a73; };
label { name "lp2_loop"; addr $8ab7; };
label { name "lp2_skip"; addr $8ac7; };
label { name "save_p2_state"; addr $8a0d; comment "save game state to p2_sav_* area"; };
label { name "load_p1_state"; addr $8a61; comment "restore game state from p1_sav_* area"; };
label { name "load_p2_state"; addr $8ab5; comment "restore game state from p2_sav_* area"; };
label { name "p1_ok"; addr $84eb; };
label { name "prompt_screen_delay"; addr $84ee; comment "wait a while to let the next player get ready"; };
label { name "psd_loop"; addr $84f0; };
label { name "delay_loop"; addr $8874; comment "takes delay time in A. only ever called with A=$80 (delays a bit less than 3 frames) or A=$FF (almost 7 frames)"; };
label { name "dl_wait"; addr $8876; };
label { name "prompt_done"; addr $84ff; comment "either the prompt screen is finished, or we were in single-player mode & didn't need it"; };
label { name "print_p1_text"; addr $8b09; comment "print PLAYER ONE"; };
label { name "pp1_next"; addr $8b15; };
label { name "pp1_done"; addr $8b20; };
label { name "print_p2_text"; addr $8b3e; comment "print PLAYER TWO"; };
label { name "pp2_next"; addr $8b4a; };
label { name "pp2_done"; addr $8b55; };
label { name "clear_prompt_text"; addr $8b73; comment "print 40 spaces over the PLAYER (ONE|TWO) message"; };
label { name "cpt_next_char"; addr $8b7f; };
# not sure 'spawn' is quite the right word here
label { name "spawn_humanoid"; addr $aee6; comment "'spawn' not the right word. this does all the logic for humanoids (falling, hitting the ground)"; };
label { name "spawn_lander"; addr $b08e; };
label { name "spawn_mutant"; addr $b2f4; };
label { name "spawn_enemy_shot"; addr $9b86; };
label { name "spawn_bomber"; addr $b3f1; };
label { name "spawn_pod"; addr $b485; };
label { name "spawn_swarmer"; addr $b4a5; };
label { name "spawn_baiter"; addr $bad4; };
label { name "humanoid_falling"; addr $af6e; comment "called repeatedly while a humanoid is falling"; };
label { name "humanoid_carrying"; addr $aef4; comment "player carrying a humanoid"; };
label { name "humanoid_abducted"; addr $af5f; comment "lander carrying a humanoid"; };
label { name "baiter_check"; addr $bb7b; comment "decide whether to spawn a baiter"; };
label { name "bc_done"; addr $bba2; };
label { name "bc_spawn"; addr $bb8d; comment "yes, spawn it"; };
label { name "get_random"; addr $8cf2; comment "variant of an LFSR. could have just use 'lda RANDOM', this is likely an artifact of Baker's Apple II heritage. Returns 'random' number in A."; };
label { name "get_spawn_pos"; addr $8d0c; comment "pick a random, valid spot"; };
label { name "detonate_smartbomb"; addr $8bac; };
label { name "smartbomb_kill_stuff"; addr $8bd0; comment "kill every enemy on the screen"; };
label { name "kill_next"; addr $8bbd; };
label { name "sb_kill"; addr $8cc3; comment "kill one enemy"; };
label { name "start_enemy_explosion"; addr $9be7; comment "queue up an explosion, at first empty slot (or at last slot, if table is full)"; };
label { name "see_next"; addr $9be9; };
label { name "see_queue"; addr $9bf8; };
label { name "print_game_over"; addr $b81e; };
label { name "pgo_nextchar"; addr $b82a; };
label { name "pgo_delay"; addr $b835; };
label { name "pgo_delay_loop"; addr $b837; };
label { name "clear_player_shots"; addr $b7f1; comment "clear player_shots table and erase shot graphics. called when player dies or enters hyperspace"; };
label { name "cps_next"; addr $b7f3; };
label { name "cps_check"; addr $b7f8; comment "see if this shot exists"; };
label { name "cps_clear"; addr $b802; comment "shot exists, clear it"; };
label { name "cps_clear_loop"; addr $b814; };
label { name "preshift_sprite"; addr $ab9f; comment "create right-shifted copy of a sprite, 1-3 pixels, at sp_x+$10, sp_x+$20, sp_x+$30"; };
label { name "preshift_all_sprites"; addr $a370; comment "this is why sprites are copied to RAM: we precalculate right-shifted copies, to speed up drawing"; };
label { name "add_to_sprite_list"; addr $a4a5; comment "search for an empty slot. if found, add current_sprite to list, return with carry clear. if no empty slot, return with carry set."; };
label { name "asl_next"; addr $a4a7; };
label { name "asl_slot_found"; addr $a4b6; };
label { name "inertia_logic"; addr $8681; comment "XXX not fully understood, stubbing this out makes the ship turn on a dime"; };

# zp data addresses
label { name "invuln_flag"; addr $ed; comment "bit 7 set = ship collisions ignored... but also you can't clear a level. always set in demo game. temporarily set when the player's ship is exploding (to avoid further collisions killing it again while it's busy dying)"; };
label { name "ship_move_delay"; addr $93; comment "counts 0-$FF (XXX how often? per-frame?), ship only moves (?) when low 2 bits == 3 (?)"; };
label { name "animation_counter"; addr $85; comment "for animated sprites, used to decide which frame to draw"; };
label { name "ship_anim_counter"; addr $AA; comment "player's ship has its own animation counter"; };
label { name "glyph_color_mask"; addr $ee; comment "used by draw_glyph, $FF = color 3, all pixels 11 (like they're stored in the ROM), $55 and $AA for printing in colors 1 and 2."; };
label { name "current_player_shot"; addr $c2; comment "update_player_shots only updates one shot per call. this keeps track of which one, counts 0 4 8 $C."; };
label { name "scanner_colormask"; addr $a9; };
label { name "tmp_y"; addr $82; };
label { name "tmp_hoffset_l"; addr $83; };
label { name "tmp_hoffset_r"; addr $b8; };
label { name "tmp_height"; addr $84; };
label { name "tmp_ptr"; addr $e7; size 2; comment "used to point into screen memory by draw_glyph, also used for clearing sprite memory and blowing up the planet"; };
label { name "preshift_ptr"; addr $80; size 2; comment "argument to preshift_sprite"; };
label { name "random_seed"; addr $c6; size 3; comment "initialized to $f3 $12 $53 by init_cart"; };
label { name "landers_to_spawn"; addr $9b; comment "total # of landers to spawn, on this level. each wave is max(landers_to_spawn, 5) landers, until landers_to_spawn == 0."; };
label { name "enemy_count"; addr $9c; comment "total number of live enemies on level, not counting baiters."; };
label { name "baiter_count"; addr $9d; comment "count of baiters on level. also used for some other purpose XXX what?"; };
label { name "draw_ok_flag"; addr $ab; comment "bit 7 set = ok to write to screen ram (set by bottom_dli_handler, cleared by top_dli_handler)"; };
label { name "level_jiffies_lo"; addr $87; comment "init to 0 at start of level, increments every frame while game is playing"; };
label { name "level_jiffies_hi"; addr $f6; comment "init to 0 at start of level, increments every 256 frames while game is playing"; };
label { name "sprite_x"; addr $e3; comment "X position of sprite, for draw_sprite_(left|right)"; };
label { name "sprite_y"; addr $df; comment "Y position of sprite, for draw_sprite_(left|right)"; };
label { name "ship_direction"; addr $c5; comment "which way the ship is facing. 1 = right, $FF (-1) = left."; };
label { name "ship_delta"; addr $d5; comment "ship's movement, negative = left, 0 = stationary, positive = right. range -6 ($fa) to 6."; };
label { name "ship_y_pos"; addr $c4; comment "lower = higher on the screen, $20 = top, $b4 = bottom"; };
label { name "ship_x_pos"; addr $c3; comment "ship's visible X position on screen (not in the scanner). ranges $20 to $76"; };
label { name "ship_dead_flag"; addr $ef; comment "bit 7 set = collision with something that kills us (set by ship_collision)"; };
label { name "current_player"; addr $f1; comment "1 or 2 in 2-player games, always 1 in 1-player and demo"; };
label { name "trigger"; addr $a3; comment "shadow of TRIG0 or 1 depending on which player is playing"; };
label { name "current_sprite"; addr $f9; comment "0 = human. (lower 3 bits are word index into score_points_table)"; };
label { name "planet_dead_flag"; addr $a0; comment "bit 7 set = planet has exploded (no humans, all mutants)"; };
label { name "humanoid_count"; addr $a1; comment "initialized to $10, counts down to 0 as they die (but changing this in mid-level changes nothing, it changes right back!)"; };
label { name "hyperspace_flag"; addr $ae; comment "bit 7 set = player pressed hyperspace key"; };
label { name "spacebar_flag"; addr $ac; comment "bit 7 set = player pressed spacebar"; };
label { name "enemy_firing_freq"; addr $bb; comment "starts at $3f, $1f, $0f for easy/med/hard. shifts right at start of every other level, until it reaches $03 (and stays there forever)"; };
label { name "pause_flag"; addr $af; comment "00 = playing, $80 = paused while playing, $ff = not playing (title screen or game over)"; };
label { name "select_flag"; addr $b0; comment "bit 7 set = select was pressed"; };
label { name "start_flag"; addr $be; comment "bit 7 set = start was pressed"; };
label { name "last_kbcode"; addr $e0; comment "KBCODE gets saved here by check_key_code"; };
label { name "key_debounce_ctr"; addr $f0; comment "keypresses are ignored until this counts to $10"; };
label { name "sound_ptr"; addr $b2; size 2; comment "points to a list of AUDF, AUDC values"; };
label { name "sound_tempo"; addr $b5; comment "play_event_sound uses this to set cur_sound_tempo"; };
label { name "cur_sound_tempo"; addr $b4; comment "speed of currently-playing event sound"; };
label { name "cur_sound_timer"; addr $b6; comment "incremented each call to update_sound. when it reaches cur_sound_tempo, we increment sound_offset"; };
label { name "sound_offset"; addr $b1; comment "offset into sound_ptr list"; };
label { name "sound_priority"; addr $b7; comment "priority of currently-playing event sound"; };
label { name "protection_flag"; addr $f8; comment "bit 7 set = protection check failed, game will show title screen but refuse to start"; };
label { name "level"; addr $9a; comment "player 1 only?"; };
label { name "lives"; addr $9e; comment "player 1 only?"; };
label { name "smartbombs"; addr $a5; };
label { name "players"; addr $e2; comment "1 or 2 (1 in demo mode also)"; };
label { name "game_type"; addr $e1; comment "1-3 = 1p easy/med/hard, 4-6 = 2p e/m/h, 0 = demo"; };
label { name "drone_volume"; addr $bd; comment "initialized to $1f by init_drone, decrements to 0 during sound fade-out"; };
label { name "trampoline"; addr $a7; size 2; comment "indirect jmp vector"; };
label { name "screen_ptr"; addr $c0; size 2; comment "pointer to screen memory, used by print_letter, draw_glyph, draw_sprite_(left|right), etc"; };

# non-zp data addresses
label { name "enemy_explosion_table"; addr $052b; size 128; comment "4 bytes per entry, 32 entries"; };
label { name "splosion_particles"; addr $0400; size 256; comment "page full of random garbage, generated by init_splosion, used/altered by animate_plosion"; };
label { name "leading_zero_flag"; addr $0510; comment "bit 7 clear = skip leading zeroes in print_number. set = print leading zeroes ('01' instead of '1'"; };
label { name "plosion_x_start"; addr $0507; };
label { name "plosion_y_start"; addr $0508; };
label { name "plosion_x"; addr $0505; };
label { name "plosion_y"; addr $0506; };
label { name "inertia_counter"; addr $0d2d; comment "XXX"; };
label { name "exhaust_flag"; addr $0d2b; comment "bit 7 set = draw rocket exhaust"; };
label { name "return_carry_set"; addr $ad9e; };
label { name "thrust_ok"; addr $ad7e; };
label { name "return_right"; addr $ad5c; };
label { name "horiz_acceleration"; addr $0d2e; comment "XXX"; };
label { name "pixel_mask_table"; addr $1c00; size 256; comment "filled with repeating pattern c0 30 0c 03 c0 30 0c 03 ..."; };
label { name "offset_index_table"; addr $1a00; comment "filled with repeating pattern 00 01 02 03 00 01 02 03... basically a modulus 4 lookup"; };
label { name "pss_temp"; addr $0c4b; comment "16 bytes, used by preshift_sprite"; };
label { name "vert_horiz_flag"; addr $0d2c; comment "check_ship_move uses this, bit 0 clear = check for horizontal movement, set = vertical"; };
label { name "p2_sav_sprite_list"; addr $1800; size 256; };
label { name "p2_sav_score"; addr $19c0; size 4; };
label { name "p2_sav_planet_dead"; addr $19c4; };
label { name "p2_sav_fire_freq"; addr $19c5; };
label { name "p2_sav_lives"; addr $19c6; };
label { name "p2_sav_bombs"; addr $19c7; };
label { name "p2_sav_lander_wave_count"; addr $19c8; };
label { name "p2_sav_level"; addr $19c9; };
label { name "p1_sav_sprite_list"; addr $1600; size 256; };
label { name "p1_sav_score"; addr $17c0; size 4; };
label { name "p1_sav_planet_dead"; addr $79c4; };
label { name "p1_sav_fire_freq"; addr $17c5; };
label { name "p1_sav_lives"; addr $17c6; };
label { name "p1_sav_bombs"; addr $17c7; };
label { name "p1_sav_lander_wave_count"; addr $17c8; };
label { name "p1_sav_level"; addr $17c9; };
#label { name "player_shots"; addr $051a; size 16; comment "table of active shots, 4 entries, 4 bytes per entry: y pos, x start, x end, delta"; };
label { name "player_shots_y"; addr $051a; comment "table of active shots, 4 entries, 4 bytes per entry: y pos, x start, x end, delta"; };
label { name "player_shots_x_start"; addr $051b; };
label { name "player_shots_x_end"; addr $051c; };
label { name "player_shots_delta"; addr $051d; };
label { name "sprite_list"; addr $0aeb; size 256; comment "enemies, humanoids, everything alive & movable. 4 bytes per entry (XXX don't know what they mean yet)"; };
label { name "actor_list"; addr $0c6b; size 192; comment "6 bytes/entry, 32 entries max, sprites in sprite_list also an entry here XXX"; };
label { name "y_stash"; addr $0519; comment "temp, used by print_letter and draw_glyph"; };
label { name "cur_line"; addr $0513; comment "current line of glyph being drawn, used by print_letter and draw_glyph"; };
label { name "last_line"; addr $0514; comment "last line of glyph being drawn, used by print_letter and draw_glyph"; };
label { name "score"; addr $142f; size 4; comment "lsb first, binary base 100 (each byte ranges $00 to $63 (99 dec)"; };
#range { name "dlist_ram"; start $2000; end $20c6; type bytetable; comment "basically GR.15"; };
label { name "dlist_ram"; addr $2000; size $c7; comment "190 scanlines of GR.15 with 2 DLIs"; };
label { name "VDSLST"; addr $200; size 2; comment "DLI vector"; };
label { name "SDLSTL"; addr $230; comment "dlist start, lo byte"; };
label { name "SDLSTH"; addr $231; comment "dlist start, hi byte"; };
label { name "COLDST"; addr $244; };
label { name "screen_ram"; addr $2218; size 7600; comment "190 scanlines * 40 bytes/line = 7600 ($1db0) bytes"; };
label { name "screen_hi_ptrs"; addr $1e00; size 192; comment "pointers to the start of each scanline in screen memory (hi bytes)"; };
label { name "screen_lo_ptrs"; addr $1d00; size 192; comment "pointers to the start of each scanline in screen memory (lo bytes)"; };
label { name "horiz_offset_table"; addr $1b00; size 256; comment "coarse (byte) offset for each horizontal position, the 0th thru 39th byte on a scanline"; };
label { name "cursor_x"; addr $1439; comment "column where printchar will print next character (range 0-$27 I think)"; };
label { name "cursor_y"; addr $143a; comment "row where printchar will print next character (range XXX)"; };
label { name "cursor_line"; addr $0512; comment "cursor_x times 9, scanline where next char prints (range XXX)"; };
label { name "cursor_x_tmp"; addr $0515; };
label { name "glyph_offset"; addr $0516; comment "offset of glyph from start of font (0, 8, 16, 24, ...), used by draw_glyph"; };
label { name "level_initial_spawn"; addr $ae55; comment "at level start, spawn initial set of enemies"; };
label { name "spawn_bombers"; addr $ae61; comment "not sure what's up with location $c6 here"; };
label { name "spawn_pods"; addr $ae7d; };
label { name "spawn_landers"; addr $ae93; };
label { name "spb_loop"; addr $ae67; };
label { name "spp_loop"; addr $ae82; };
label { name "lis_done"; addr $aee5; };
label { name "spawn_lander_wave"; addr $ae98; comment "also called from outside level_initial_spawn, for subsequent waves"; };


# data tables
range { name "snd_silence"; start $8e86; end $93bb; type bytetable; comment "'heard' during title screen, and when nothing else is going on"; };
label { name "snd_extra_life"; addr $8fdc; comment "heard when player gets an extra life"; };
label { name "snd_materialize"; addr $8ece; comment "heard when player ship appears (start of level) or the next group of aliens appears"; };
label { name "snd_player_fire"; addr $8e8a; comment "heard when player fires a shot"; };
label { name "snd_smartbomb"; addr $9276; comment "heard when player detonates a smart bomb"; };
label { name "snd_distress"; addr $8f12; comment "heard when lander picks up a humanoid"; };
label { name "table_8f6f"; addr $8f6f; comment "this is in the middle of the sound effects, but it doesn't look like sound data (and doesn't sound like it either)"; };
label { name "snd_rescued"; addr $92e2; comment "heard when player catches or drops off a human, or when one lands safely on the ground"; };
label { name "snd_fall"; addr $90a2; comment "heard when a lander carrying a human is shot"; };
label { name "snd_lander_fire"; addr $9060; comment "heard when a lander fires a shot"; };
label { name "snd_planet_explode"; addr $9352; comment "heard when the last human dies and the planet asplodes"; };
label { name "snd_human_died"; addr $92b0; comment "heard when a human dies (is absorbed, shot, or falls too far)"; };
label { name "snd_player_died"; addr $9166; comment "heard when the player's ship explodes"; };
label { name "snd_lander_died"; addr $90da; comment "heard when we shoot a lander (or a bomber, same sound)"; };
label { name "snd_swarmer_taunt"; addr $901a; comment "heard when swarmers are in the area (like a bird call)"; };
label { name "snd_mutant_taunt"; addr $906a; comment "heard when a mutant is after you"; };
label { name "snd_pod_died"; addr $9208; comment "heard when a pod is killed and spawns a bunch of swarmers"; };
label { name "snd_baiter_died"; addr $91ac; comment "heard when a baiter is shot (temporary reprieve!)"; };
label { name "snd_swarmer_died"; addr $9120; comment "heard when a swarmer is shot"; };

range { name "scanner_border_table"; start $a0ab; end $a0ae; type bytetable; };
range { name "jump_table"; start $a582; end $a591; type addrtable; };
range { name "scanner_colormask_table"; start $a592; end $a5b1; type bytetable; };
range { name "attack_wave_text"; start $96d6; end $96ed; type bytetable; };
range { name "completed_text"; start $96ee; end $972d; type bytetable; };
range { name "game_type_table"; start $80f9; end $80ff; type bytetable; comment "game select table (7 entries: demo, 1p easy/med/hard, 2p easy/med/hard)"; };
range { name "game_type_text_ptrs"; start $8148; end $8155; type addrtable; comment "the strings these point to are 37 characters long, null-terminated, ASCII with high bit set (this game was ported from the Apple II, where ASCII normally has the high bit set)"; };
range { name "gttxt_demo"; start $8156; end $817a; type bytetable; comment "'   D E F E N D E R  G A M E  D E M O'"; };
range { name "gttxt_1p_easy"; start $817b; end $819f; type bytetable; comment "'      O N E  P L A Y E R  E A S Y   '"; };
range { name "gttxt_1p_normal"; start $81a0; end $81c4; type bytetable; comment "'    O N E  P L A Y E R  N O R M A L '"; };
range { name "gttxt_1p_hard"; start $81c5; end $81e9; type bytetable; comment "'      O N E  P L A Y E R  H A R D   '"; };
range { name "gttxt_2p_easy"; start $81ea; end $820e; type bytetable; comment "'      T W O  P L A Y E R  E A S Y   '"; };
range { name "gttxt_2p_normal"; start $820f; end $8233; type bytetable; comment "'    T W O  P L A Y E R  N O R M A L '"; };
range { name "gttxt_2p_hard"; start $8234; end $8258; type bytetable; comment "'      T W O  P L A Y E R  H A R D   '"; };
range { name "title_text"; start $8295; end $8328; type bytetable; comment "cF, c5 are color codes. 'cF             D E F E N D E RnlnlnlnlnlnlcF S E L E C T  G A M E  A N D  P R E S Snlnl      T H E  S T A R T  B U T T O Nnlnlnlnlc5         c)  1 9 8 2  A T A R I'"; };
range { name "table_8329"; start $8329; end $8368; type bytetable; comment "is this used at all?"; };
range { name "power_10_table"; start $9507; end $9509; type bytetable; comment "1, 10, 100 aka 10*0, 10*1, 10*2. used by print_number. last byte appears to never get read."; };
range { name "font"; start $950a; end $9641; type bytetable; comment "13 4x8 glyphs, 0 thru 9, space, left & right halves of copyright symbol. 2bpp, but only one color used (11). really 3x8 as rightmost column is blank (for spacing) in all glyphs. height is the full 8 (no blanks for spacing)."; };
label { name "font_letters"; addr $9572; comment "uppercase, 26 4x8 glyphs but no blank column for spacing (full 4x8). also J Q Z glyphs are graphics of some kind."; };
range { name "demo_text"; start $898f; end $89b8; type bytetable; comment "' D E F E N D E R    c 1982  A T A R I '"; };
range { name "game_over_text"; start $b844; end $b86c; type bytetable; comment "'           G A M E  O V E R             '"; };
range { name "player_one_text"; start $8b21; end $8b3d; type bytetable; comment "'          P L A Y E R  O N E'"; };
range { name "player_two_text"; start $8b56; end $8b72; type bytetable; comment "'          P L A Y E R  T W O'"; };
range { name "score_points_table"; start $a7fd; end $a816; type wordtable; comment "binary base 100. msb first (unlike score!). 0132 = 100*$01+$32 = 150 decimal. order: human (0), lander (150), mutant (150), enemy shot or bomber bomb (25, only by colliding with ship), bomber (250), pod (1000), swarmer (200), baiter (200), rest are bonus"; };
range { name "sprite_ram_addrs"; start $ab57; end $ab8e; type addrtable; comment "used by draw_sprite_(left|right)"; };
range { name "sprite_table_offsets"; start $ab8f; end $ab9e; type bytetable; comment "basically just a mul-by-16 table"; };
label { name "sprite_heights"; addr $ab97; comment "used to avoid drawing extra empty sprite rows, if they're shorter than full height"; };
range { name "accel_table"; start $ada0; end $adaf; type bytetable; comment "used for accelerating/decelarating the ship"; };
range { name "level_spawn_table"; start $ae49; end $ae54; type bytetable; comment "3 bytes per entry: # bombers, # pods, # landers per wave"; };
label { name "lst_pods"; addr $ae4a;};
label { name "lst_landers"; addr $ae4b;};
range { name "swarmer_spawn_y_offsets"; start $b568; end $b587; type bytetable; comment "XXX I *think* that's what this is"; };
range { name "filler_bba3"; start $bba3; end $bff9; type bytetable; };
range { name "sprom_humanoid"; start $a8b3; end $a8c2; type bytetable; comment "single-wide, non-animated, copied to $0d2f"; };
range { name "sprom_lander_1"; start $a8c3; end $a8d2; type bytetable; comment "single-wide, animated, copied to $0d6f"; };
range { name "sprom_lander_2"; start $a8d3; end $a8e2; type bytetable; comment "copied to $0daf"; };
range { name "sprom_mutant_1"; start $a8e3; end $a8f2; type bytetable; comment "single-wide, animated, copied to $0def"; };
range { name "sprom_mutant_2"; start $a8f3; end $a902; type bytetable; comment "copied to $0e2f"; };
range { name "sprom_rship_l_1"; start $a903; end $a912; type bytetable; comment "right-facing ship, double-wide, animated, copied to $0e6f"; };
range { name "sprom_rship_r_1"; start $a913; end $a922; type bytetable; comment "copied to $0eaf"; };
range { name "sprom_rship_l_2"; start $a923; end $a932; type bytetable; comment "copied to $0eef"; };
range { name "sprom_rship_r_2"; start $a933; end $a942; type bytetable; comment "copied to $0f2f"; };
range { name "sprom_lship_l_1"; start $a943; end $a952; type bytetable; comment "left-facing ship, double-wide, animated, copied to $0f6f"; };
range { name "sprom_lship_r_1"; start $a953; end $a962; type bytetable; comment "copied to $0faf"; };
range { name "sprom_lship_l_2"; start $a963; end $a972; type bytetable; comment "copied to $0fef"; };
range { name "sprom_lship_r_2"; start $a973; end $a982; type bytetable; comment "copied to $102f"; };
range { name "sprom_bullet"; start $a983; end $a992; type bytetable; comment "enemy shot, single-wide, non-animated, copied to $106f"; };
range { name "sprom_bomber_1"; start $a993; end $a9a2; type bytetable; comment "single-wide, animated, copied to $10af"; };
range { name "sprom_bomber_2"; start $a9a3; end $a9b2; type bytetable; comment "copied to $10ef"; };
range { name "sprom_xbomb"; start $a9b3; end $a9c2; type bytetable; comment "bomber's bomb, single-wide, non-animated, copied to $112f"; };
range { name "sprom_rflame_1"; start $a9c3; end $a9d2; type bytetable; comment "player's exhaust flame, right-facing, single-wide, animated, copied to $11ef"; };
range { name "sprom_rflame_2"; start $a9d3; end $a9e2; type bytetable; comment "copied to $122f"; };
range { name "sprom_lflame_1"; start $a9e3; end $a9f2; type bytetable; comment "player's exhaust flame, left-facing, single-wide, animated, copied to $116f"; };
range { name "sprom_lflame_2"; start $a9f3; end $aa02; type bytetable; comment "copied to $11af"; };
range { name "sprom_pod_1"; start $aa03; end $aa12; type bytetable; comment "single-wide, animated, copied to $126f"; };
range { name "sprom_pod_2"; start $aa13; end $aa22; type bytetable; comment "copied to $12af"; };
range { name "sprom_swarmer"; start $aa23; end $aa32; type bytetable; comment "single-wide, non-animated, copied to $12ef"; };
range { name "sprom_baiter_l"; start $aa33; end $aa42; type bytetable; comment "double-wide, non-animated, copied to $132f"; };
range { name "sprom_baiter_r"; start $aa43; end $aa52; type bytetable; comment "copied to $136f"; };
range { name "sprom_smartbomb_1"; start $aa53; end $aa62; type bytetable; comment "single-wide, animated, copied to $13af"; };
range { name "sprom_smartbomb_2"; start $aa63; end $aa72; type bytetable; comment "copied to $13ef"; };
range { name "table_aa73"; start $aa73; end $aa7a; type bytetable; comment "XXX what (if anything) is this used for?"; };
range { name "table_ae15"; start $ae15; end $ae16; type bytetable; };

# not used by defender ($9ffa-$9fff has code in it)
#range { name "cart_b_start"; start $9ffa; end $9ffb; type addrtable; };
#range { name "cart_b_present"; start $9ffc; end $9ffc; type bytetable; };
#range { name "cart_b_opts"; start $9ffd; end $9ffd; type bytetable; };
#range { name "cart_b_init"; start $9ffe; end $9fff; type addrtable; };

range { name "cart_a_start"; start $bffa; end $bffb; type addrtable; };
range { name "cart_a_present"; start $bffc; end $bffc; type bytetable; comment "0 = cart present"; };
range { name "cart_a_opts"; start $bffd; end $bffd; type bytetable; comment "no disk boot, yes init+start the cart, non-diagnostic"; };
range { name "cart_a_init"; start $bffe; end $bfff; type addrtable; };
label { name "sp_humanoid"; addr $0d2f; comment "ram copies of sprites. sp_x is the original sprite. sp_x+$10, sp_x+$20, sp_x+$30 are right-shifted copies, by 1/2/3 pixels respectively"; };
label { name "sp_lander_1"; addr $0d6f; };
label { name "sp_lander_2"; addr $0daf; };
label { name "sp_mutant_1"; addr $0def; };
label { name "sp_mutant_2"; addr $0e2f; };
label { name "sp_rship_l_1"; addr $0e6f; };
label { name "sp_rship_r_1"; addr $0eaf; };
label { name "sp_rship_l_2"; addr $0eef; };
label { name "sp_rship_r_2"; addr $0f2f; };
label { name "sp_lship_l_1"; addr $0f6f; };
label { name "sp_lship_r_1"; addr $0faf; };
label { name "sp_lship_l_2"; addr $0fef; };
label { name "sp_lship_r_2"; addr $102f; };
label { name "sp_bullet"; addr $106f; };
label { name "sp_bomber_1"; addr $10af; };
label { name "sp_bomber_2"; addr $10ef; };
label { name "sp_xbomb"; addr $112f; };
label { name "sp_rflame_1"; addr $11ef; };
label { name "sp_rflame_2"; addr $122f; };
label { name "sp_lflame_1"; addr $116f; };
label { name "sp_lflame_2"; addr $11af; };
label { name "sp_pod_1"; addr $126f; };
label { name "sp_pod_2"; addr $12af; };
label { name "sp_swarmer"; addr $12ef; };
label { name "sp_baiter_l"; addr $132f; };
label { name "sp_baiter_r"; addr $136f; };
label { name "sp_smartbomb_1"; addr $13af; };
label { name "sp_smartbomb_2"; addr $13ef; };

label { name "RTCLOK"; addr $12; size 3; };
label { name "POKMSK"; addr $10; };
label { name "ATRACT"; addr $4d; };
label { name "VKEYBD"; addr $0208; comment "=== page 2 OS equates"; };
label { name "VKEYBD_hi"; addr $0209; };
label { name "SDMCTL"; addr $022f; };
label { name "GPRIOR"; addr $026f; };
label { name "PCOLR0"; addr $02c0; };
label { name "PCOLR1"; addr $02c1; };
label { name "PCOLR2"; addr $02c2; };
label { name "PCOLR3"; addr $02c3; };
label { name "COLOR0"; addr $02c4; };
label { name "COLOR1"; addr $02c5; };
label { name "COLOR2"; addr $02c6; };
label { name "COLOR3"; addr $02c7; };
label { name "COLOR4"; addr $02c8; };
label { name "CHBAS"; addr $02f4; };
label { name "HPOSP3"; addr $d003; comment "=== GTIA equates"; };
label { name "HPOSM0"; addr $d004; };
label { name "HPOSM1"; addr $d005; };
label { name "HPOSM2"; addr $d006; };
label { name "HPOSM3"; addr $d007; };
label { name "SIZEP2"; addr $d00a; };
label { name "SIZEP3"; addr $d00b; };
label { name "SIZEM"; addr $d00c; };
label { name "TRIG0"; addr $d010; };
#label { name "GRAFM"; addr $d011; }; # PMG not used, but:
label { name "TRIG1"; addr $d011; };
label { name "COLPM0"; addr $d012; };
label { name "COLPM1"; addr $d013; };
label { name "COLPF0"; addr $d016; };
label { name "COLPF1"; addr $d017; };
label { name "COLPF2"; addr $d018; };
label { name "COLPF3"; addr $d019; };
label { name "COLBK"; addr $d01a; };
label { name "PRIOR"; addr $d01b; };
label { name "GRACTL"; addr $d01d; };
label { name "HITCLR"; addr $d01e; };
label { name "CONSOL"; addr $d01f; };
label { name "AUDF1"; addr $d200; comment "=== POKEY equates"; };
label { name "AUDC1"; addr $d201; };
label { name "AUDF2"; addr $d202; };
label { name "AUDC2"; addr $d203; };
label { name "AUDF3"; addr $d204; };
label { name "AUDC3"; addr $d205; };
label { name "AUDF4"; addr $d206; };
label { name "AUDC4"; addr $d207; };
label { name "AUDCTL"; addr $d208; };
label { name "KBCODE"; addr $d209; };
label { name "RANDOM"; addr $d20a; };
label { name "IRQEN"; addr $d20e; };
label { name "SKCTL"; addr $d20f; };
label { name "DMACTL"; addr $d400; comment "=== ANTIC equates"; };
label { name "DLISTL"; addr $d402; };
label { name "DLISTH"; addr $d403; };
label { name "HSCROL"; addr $d404; };
label { name "PMBASE"; addr $d407; };
label { name "CHBASE"; addr $d409; };
label { name "WSYNC"; addr $d40a; };
label { name "VCOUNT"; addr $d40b; };
label { name "NMIEN"; addr $d40e; };
#label { name "SETVBV"; addr $e45c; comment "=== OS equates"; };
#label { name "XITVBV"; addr $e462; };
label { name "PORTA"; addr $d300; comment "=== PIA equates"; };
label { name "PORTB"; addr $d301; };
label { name "PACTL"; addr $d302; };
label { name "PBCTL"; addr $d303; };