******************************************************************************** * Elite for the Apple II * * Copyright 1985 David Braben and Ian Bell * * * * ** THIS IS A WORK IN PROGRESS ** * * (large sections of the code are uncommented) * * * ******************************************************************************** * This file was assembled from the two main game files and descrambled. See * * the 6502disassembly site for a full explanation. * ******************************************************************************** * Disassembly by Andy McFadden, using 6502bench SourceGen v1.6. * * Last updated 2020/07/16 * * * * The disassembly of the platform-neutral code is based heavily on the work of * * others: * * Paul Brink's commented BBC Micro sources * * Kroc Camen's C64 project: https://github.com/Kroc/elite-harmless * * * * And of course thanks to Ian Bell for sharing the original BBC Micro sources. * ******************************************************************************** EOR_FLIGHT .eq $23 {const} ;EOR value for flight text tokens EOR_DOCKED .eq $57 {const} ;EOR value for docked text tokens rng_state .eq $02 {addr/4} INWK .eq $0c {addr/9} polyobj_xpos_lo .eq $0c polyobj_ypos_lo .eq $0f polyobj_zpos_lo .eq $12 polyobj_zpos_mi .eq $13 polyobj_zpos_hi .eq $14 polyobj_mox2_hi .eq $1a polyobj_vertex_lo .eq $27 polyobj_roll .eq $29 polyobj_pitch .eq $2a polyobj_vis .eq $2b polyobj_attack .eq $2c tmp_ptr2 .eq $2d {addr/2} text_hposn .eq $34 ;text horizontal position (0-30) text_vposn .eq $36 ;text vertical position (0-23) text_mod_flags .eq $37 ;$80=conv upper, $40=conv lower, $ff=discard hull_ptr .eq $5a {addr/2} polyobj_ptr .eq $5c {addr/2} ecm_active_flag? .eq $6a ;initially $20, counts down missile_thing? .eq $7f input_raw_key .eq $80 ;last key hit ($01-7f), or $00 if none cmd_throttle_down .eq $81 ;bool 00/ff: throttle-down cmd cmd_throttle_up .eq $82 ;bool 00/ff: throttle-up cmd cmd_roll_left .eq $83 ;bool 00/ff: roll-left cmd cmd_roll_right .eq $84 ;bool 00/ff: roll-right cmd cmd_pitch_down .eq $85 ;bool 00/ff: pitch-down cmd cmd_pitch_up .eq $86 ;bool 00/ff: pitch-up cmd cmd_fire_laser .eq $87 ;bool 00/ff: fire-laser cmd cmd_energy_bomb .eq $88 ;bool 00/ff: energy bomb cmd cmd_escape_cap .eq $89 ;bool 00/ff: escape capsule cmd cmd_targ_mssl .eq $8a ;bool 00/ff: target missile cmd cmd_unarm_mssl .eq $8b ;bool 00/ff: un-arm missile cmd cmd_fire_mssl .eq $8c ;bool 00/ff: fire missile cmd_ecm .eq $8d ;bool 00/ff: ECM cmd cmd_local_jump .eq $8e ;bool 00/ff: local jump cmd cmd_dock_on .eq $8f ;bool 00/ff: dock comp on cmd cmd_dock_off .eq $90 ;bool 00/ff: dock comp off cmd player_speed .eq $a9 ;player's current forward speed displayed_screen .eq $b3 ;0 for space view, various for other screens docked_flag .eq $ba ;bool 00/ff: are we currently docked? display_mode_flag .eq $cd ;bool (hi bit): showing text screen? roll_velocity .eq $d1 pitch_velocity .eq $d2 BUFFER_0100 .eq $0100 PLAYER_STATE? .eq $0241 {addr/55} computer_dock_flag .eq $026c ;bool 00/ff: is docking computer driving? player_ecm_active? .eq $026d witch_space_flag .eq $026e ;flag for witch space main_dec2_thing? .eq $0273 player_laser_temp .eq $0274 ;laser temperature lcoord_swap_flag .eq $027d ;bool 00/ff: did we swap start/end? intro_parameter? .eq $0284 player_credits .eq $0298 {addr/4} ;current credits, in big-endian order player_fuel .eq $029c ;0-70 ship_state1? .eq $029d ship_state2? .eq $029e cargo_capacity? .eq $02a5 player_cargo .eq $02a6 {addr/16} ;items in player cargo bay have_ecm .eq $02b7 ;bool 00/ff: ship has ECM device have_fuel_scoop .eq $02b8 ;bool 00/ff: ship has fuel scoop have_energy_bomb .eq $02b9 ;00/7f/ff? have_energy_unit .eq $02ba ;bool 00/ff: ship has energy unit have_docking_comp .eq $02bb ;bool 00/ff: ship has docking computer have_galactic_hyper .eq $02bc ;bool 00/ff: ship has galactic jump have_escape_pod .eq $02bd ;bool 00/ff: escape pod equipped? kill_score_rem .eq $02c1 ;kill score remainder missile_armed_flag? .eq $02c2 player_fug_inno .eq $02c3 ;player fugitive / innocent status kill_score .eq $02d6 {addr/2} ;number of kills in_flight_msg_token .eq $02dc ;flight token for briefly-shown messages NMIVEC .eq $03fb {addr/3} xcoords? .eq $0400 {addr/256} ycoords? .eq $0500 {addr/256} SCRNHOLE5 .eq $06f8 {addr/8} ;text page 1 screen holes data_buffer .eq $0800 {addr/256} ;used for RWTS et.al. KBD .eq $c000 ;R last key pressed + 128 KBDSTRB .eq $c010 ;RW keyboard strobe SPKR .eq $c030 ;RW toggle speaker TXTCLR .eq $c050 ;RW display graphics TXTSET .eq $c051 ;RW display text MIXCLR .eq $c052 ;RW display full screen TXTPAGE1 .eq $c054 ;RW display page 1 HIRES .eq $c057 ;RW display hi-res graphics BUTN0 .eq $c061 ;R switch input 0 / open-apple BUTN1 .eq $c062 ;R switch input 1 / closed-apple PADDL0 .eq $c064 ;R analog input 0 PTRIG .eq $c070 ;RW analog input reset IWM_PH0_OFF .eq $c080 ;IWM phase 0 off ROMIN .eq $c081 ;RWx2 read ROM, write RAM bank 2 IWM_MOTOR_OFF .eq $c088 ;IWM motor off IWM_MOTOR_ON .eq $c089 ;IWM motor on IWM_DRIVE_1 .eq $c08a ;IWM select drive 1 LCBANK1 .eq $c08b ;RWx2 read/write RAM bank 1 IWM_Q6_OFF .eq $c08c ;IWM read IWM_Q6_ON .eq $c08d ;IWM WP-sense IWM_Q7_OFF .eq $c08e ;IWM WP-sense/read IWM_Q7_ON .eq $c08f ;IWM write .org $0a00 ; ; This is executed when ELA is BRUN. It attempts to do an unnecessary (and ; possibly unsuccessful) copy of some data to the language card, and then exits. ; My guess is this is left over from a loader used during development that ; copied stuff into the LC, loaded everything else, then memory-moved the LC ; contents on top of DOS. ; ; This area is used for data storage once the game starts. ; ]src_ptr .var $00 {addr/2} ]dst_ptr .var $02 {addr/2} 0a00: ad 54 c0 L0A00 lda TXTPAGE1 0a03: ad 52 c0 lda MIXCLR 0a06: ad 57 c0 lda HIRES 0a09: ad 50 c0 lda TXTCLR 0a0c: a5 00 lda ]src_ptr 0a0e: 48 pha 0a0f: a5 01 lda ]src_ptr+1 0a11: 48 pha 0a12: a5 02 lda ]dst_ptr 0a14: 48 pha 0a15: a5 03 lda ]dst_ptr+1 0a17: 48 pha 0a18: ad 8b c0 lda LCBANK1 ;read/write LC bank 1 -- not guaranteed to 0a1b: a9 00 lda #$00 ; write-enable since it's not touched twice 0a1d: 85 00 sta ]src_ptr 0a1f: a9 40 lda #$40 0a21: 85 01 sta ]src_ptr+1 0a23: a9 00 lda #$00 0a25: 85 02 sta ]dst_ptr 0a27: a9 d0 lda #$d0 0a29: 85 03 sta ]dst_ptr+1 0a2b: a0 00 ldy #$00 0a2d: a2 30 ldx #$30 0a2f: b1 00 L0A2F lda (]src_ptr),y 0a31: 91 02 sta (]dst_ptr),y 0a33: c8 iny 0a34: d0 f9 bne L0A2F 0a36: e6 01 inc ]src_ptr+1 0a38: e6 03 inc ]dst_ptr+1 0a3a: ca dex 0a3b: d0 f2 bne L0A2F 0a3d: ad 81 c0 lda ROMIN 0a40: 68 pla 0a41: 85 03 sta ]dst_ptr+1 0a43: 68 pla 0a44: 85 02 sta ]dst_ptr 0a46: 68 pla 0a47: 85 01 sta ]src_ptr+1 0a49: 68 pla 0a4a: 85 00 sta ]src_ptr 0a4c: 60 rts 0a4d: 20 20 45 51+ .junk 17 ; Storage for disk access code. 0a5e: 44 rwts_track .dd1 $44 0a5f: 30 rwts_sector .dd1 $30 rwts_current_track 0a60: 35 .dd1 $35 0a61: 30 rwts_ts_track .dd1 $30 0a62: 3a rwts_ts_sector .dd1 $3a rwts_alloc_track 0a63: 45 .dd1 $45 rwts_alloc_sector 0a64: 51 .dd1 $51 0a65: 55 57 rwts_delay_ctr .dd2 $5755 0a67: 26 rwts_retry_2 .dd1 $26 0a68: 44 rwts_retry_1 .dd1 $44 0a69: 30 rwts_slot .dd1 $30 rwts_find_slot_flag 0a6a: 35 .dd1 $35 rwts_saved_stack 0a6b: 30 .dd1 $30 rwts_addr_fields 0a6c: 3a .dd1 $3a 0a6d: 45 rwts_addr_sect .dd1 $45 0a6e: 51 rwts_addr_track .dd1 $51 0a6f: 55 57 26 44+ .junk 109 ; ; Saved games are 110 bytes. ; ; The file actually spans 114 bytes, because the first 4 bytes of the file are ; unused (would be the 'B' file header). The next 106 bytes are scrambled with ; the RNG, and the last 4 bytes hold the RNG seed. ; ; The code copies 76 bytes from +20 ($14-5F). ; 0adc: e9 32 20 20+ scram_save_data .junk 106 0b46: 74 79 0d 07 scram_rng_seed .junk 4 0b4a: ee 33 2e 53+ .junk 22 ; ; A set of null-terminated strings that have been tokenized and EORed with $23 ; (the $00 string terminators are not EORed). Strings may recursively refer to ; other strings. ; ; For example: ; 03 60 6b a9 77 00 --> 20 43 48 8a 54 --> "[$80] C H AR T" ; ; See PrintFlightToken @ $7144 for an explanation of the mechanism. ; ; Note there are two occurrences of $23 in the table, which become token $00 ; (prints the cash balance). This prevents us from trivially EORing the table ; to plaintext. ; 0b60: 4c 32 24 00+ flight_text .bulk $4c,$32,$24,$00,$03,$60,$6b,$a9,$77,$00,$64,$6c,$b5,$71,$6d,$6e + $b1,$77,$00,$67,$b2,$62,$32,$20,$00,$af,$b5,$6d,$77,$ba,$7a,$2f + $00,$70,$7a,$70,$bf,$6e,$00,$73,$bd,$a6,$00,$21,$03,$a8,$71,$68 + $66,$77,$03,$85,$70,$00,$af,$67,$ab,$77,$bd,$a3,$00,$62,$64,$bd + $60,$76,$6f,$77,$76,$b7,$6f,$00,$bd,$60,$6b,$03,$00,$62,$b5,$b7 + $a0,$03,$00,$73,$6c,$ba,$03,$00,$a8,$af,$6f,$7a,$03,$00,$76,$6d + $6a,$77,$00,$75,$6a,$66,$74,$03,$00,$b9,$b8,$b4,$77,$7a,$00,$b8 + $a9,$60,$6b,$7a,$00,$65,$66,$76,$67,$a3,$00,$6e,$76,$6f,$b4,$0e + $81,$00,$ae,$60,$77,$b2,$ba,$9a,$00,$d8,$6e,$76,$6d,$be,$77,$00 + $60,$bc,$65,$bb,$b3,$62,$60,$7a,$00,$67,$66,$6e,$6c,$60,$b7,$60 + $7a,$00,$60,$ba,$73,$ba,$b2,$66,$03,$e8,$b2,$66,$00,$70,$6b,$6a + $73,$00,$73,$dd,$67,$76,$60,$77,$00,$03,$b6,$70,$b3,$00,$6b,$76 + $6e,$b8,$03,$60,$6c,$6f,$bc,$6a,$a3,$00,$6b,$7a,$73,$b3,$70,$73 + $62,$a6,$03,$00,$70,$6b,$ba,$77,$03,$e9,$82,$00,$ae,$e8,$b8,$a6 + $00,$73,$6c,$73,$76,$6f,$b2,$6a,$bc,$00,$64,$dd,$70,$70,$03,$99 + $6a,$75,$6a,$77,$7a,$00,$66,$60,$bc,$6c,$6e,$7a,$00,$03,$6f,$6a + $64,$6b,$77,$03,$7a,$66,$a9,$70,$00,$bf,$60,$6b,$0d,$a2,$b5,$6f + $00,$60,$62,$70,$6b,$00,$03,$a5,$2c,$6a,$bc,$00,$59,$82,$22,$00 + $77,$a9,$a0,$77,$03,$6f,$6c,$e8,$00,$49,$03,$69,$62,$6e,$6e,$bb + $00,$71,$b8,$a0,$00,$70,$77,$00,$93,$03,$6c,$65,$03,$00,$70,$66 + $2c,$00,$03,$60,$a9,$64,$6c,$25,$00,$66,$b9,$6a,$73,$00,$65,$6c + $6c,$67,$00,$bf,$7b,$b4,$6f,$aa,$00,$b7,$ae,$6c,$62,$60,$b4,$b5 + $70,$00,$70,$b6,$b5,$70,$00,$6f,$6a,$b9,$ba,$0c,$74,$af,$aa,$00 + $6f,$76,$7b,$76,$bd,$aa,$00,$6d,$a9,$60,$6c,$b4,$60,$70,$00,$d8 + $73,$76,$77,$b3,$70,$00,$a8,$60,$6b,$af,$b3,$7a,$00,$62,$6f,$6f + $6c,$7a,$70,$00,$65,$6a,$ad,$a9,$6e,$70,$00,$65,$76,$71,$70,$00 + $6e,$af,$b3,$a3,$70,$00,$64,$6c,$6f,$67,$00,$73,$6f,$b2,$af,$76 + $6e,$00,$a0,$6e,$0e,$e8,$bc,$aa,$00,$a3,$6a,$b1,$03,$5c,$70,$00 + $2f,$12,$13,$23,$16,$23,$00,$03,$60,$71,$00,$6f,$a9,$a0,$00,$65 + $6a,$b3,$a6,$00,$70,$a8,$2c,$00,$64,$ad,$b1,$00,$71,$bb,$00,$7a + $66,$2c,$6c,$74,$00,$61,$6f,$76,$66,$00,$61,$b6,$60,$68,$00,$35 + $00,$70,$6f,$6a,$6e,$7a,$00,$61,$76,$64,$0e,$66,$7a,$bb,$00,$6b + $ba,$6d,$bb,$00,$61,$bc,$7a,$00,$65,$b2,$00,$65,$76,$71,$71,$7a + $00,$dd,$67,$b1,$77,$00,$65,$dd,$64,$00,$6f,$6a,$a7,$71,$67,$00 + $6f,$6c,$61,$e8,$b3,$00,$a5,$71,$67,$00,$6b,$76,$6e,$b8,$6c,$6a + $67,$00,$65,$66,$6f,$af,$66,$00,$af,$70,$66,$60,$77,$00,$88,$b7 + $ae,$ab,$00,$60,$6c,$6e,$00,$d8,$6e,$b8,$67,$b3,$00,$03,$67,$aa + $77,$dd,$7a,$bb,$00,$71,$6c,$00,$8d,$03,$03,$93,$2f,$03,$99,$03 + $03,$03,$8d,$03,$85,$03,$65,$ba,$03,$70,$62,$a2,$2f,$29,$00,$65 + $71,$bc,$77,$00,$ad,$a9,$00,$a2,$65,$77,$00,$bd,$64,$6b,$77,$00 + $5a,$6f,$6c,$74,$24,$00,$40,$32,$df,$02,$00,$66,$7b,$77,$b7,$03 + $00,$73,$76,$6f,$70,$66,$98,$00,$b0,$62,$6e,$98,$00,$65,$76,$66 + $6f,$00,$6e,$be,$70,$6a,$a2,$00,$c0,$ed,$03,$61,$62,$7a,$00,$66 + $0d,$60,$0d,$6e,$0d,$86,$00,$45,$44,$70,$00,$45,$4b,$70,$00,$4a + $03,$70,$60,$6c,$6c,$73,$70,$00,$aa,$60,$62,$73,$66,$03,$73,$6c + $67,$00,$5a,$61,$6c,$6e,$61,$00,$5a,$8d,$00,$67,$6c,$60,$68,$af + $64,$03,$f4,$00,$59,$03,$9e,$00,$6e,$6a,$6f,$6a,$77,$a9,$7a,$03 + $98,$00,$6e,$af,$af,$64,$03,$98,$00,$e6,$19,$23,$00,$af,$d8,$af + $64,$03,$49,$00,$b1,$b3,$64,$7a,$03,$00,$64,$62,$b6,$60,$b4,$60 + $00,$50,$03,$6c,$6d,$00,$62,$2c,$00,$26,$a2,$64,$a3,$03,$e8,$b2 + $ab,$19,$00,$df,$03,$27,$2f,$2f,$2f,$25,$3c,$03,$86,$2a,$21,$2f + $9e,$86,$2a,$20,$2f,$60,$bc,$ae,$b4,$bc,$2a,$00,$6a,$bf,$6e,$00 + $00,$6f,$6f,$00,$b7,$b4,$6d,$64,$19,$00,$03,$bc,$03,$00,$2f,$2b + $ec,$6e,$b1,$77,$19,$25,$00,$60,$a2,$b8,$00,$6c,$65,$65,$b1,$67 + $b3,$00,$65,$76,$64,$6a,$b4,$b5,$00,$6b,$a9,$6e,$a2,$70,$70,$00 + $6e,$6c,$e8,$6f,$7a,$03,$35,$00,$8f,$00,$88,$00,$62,$61,$6c,$b5 + $03,$88,$00,$d8,$73,$66,$77,$b1,$77,$00,$67,$b8,$a0,$dd,$ab,$00 + $67,$66,$62,$67,$6f,$7a,$00,$0e,$0e,$0e,$0e,$03,$66,$03,$6f,$03 + $6a,$03,$77,$03,$66,$03,$0e,$0e,$0e,$0e,$00,$73,$ad,$70,$b1,$77 + $00,$2b,$64,$62,$6e,$66,$03,$6c,$b5,$71,$00,$00 0f1c: 00 32 37 3e .bulk $00,$32,$37,$3e ;junk? ; ; Table of sines. The 32 entries are computed with: ; ; entry[i] = round(sin(i / 32.0 * PI) * 255) ; 0f20: 00 19 32 4a+ sine_table .bulk $00,$19,$32,$4a,$62,$79,$8e,$a2,$b5,$c6,$d5,$e2,$ed,$f5,$fb,$ff + $ff,$ff,$fb,$f5,$ed,$e2,$d5,$c6,$b5,$a2,$8e,$79,$62,$4a,$32,$19 ; ; A set of null-terminated tokenized strings used for messages while docked. ; All of the data has been EORed with $57. ; ; See PrintDockedStr @ $4b6e. ; 0f40: 57 5e 5c 56+ docked_text .bulk $57,$5e,$5c,$56,$5f,$77,$a6,$04,$1c,$77,$16,$14,$be,$04,$04,$77 + $1a,$12,$b6,$80,$5d,$55,$66,$79,$77,$c2,$80,$65,$79,$77,$04,$16 + $ad,$77,$cd,$77,$53,$80,$64,$79,$77,$13,$12,$11,$16,$02,$1b,$03 + $77,$56,$1d,$16,$1a,$ba,$88,$55,$80,$63,$79,$77,$12,$0f,$8c,$80 + $57,$57,$57,$14,$18,$1a,$07,$12,$ac,$ac,$88,$77,$b6,$1a,$15,$a3 + $6d,$57,$e7,$3a,$9d,$39,$e6,$57,$77,$77,$c2,$77,$56,$7f,$0e,$78 + $19,$7e,$68,$55,$5b,$5b,$57,$07,$a5,$04,$04,$77,$04,$07,$16,$be + $77,$aa,$77,$11,$1e,$a5,$7b,$cd,$79,$5b,$5b,$57,$cd,$70,$04,$9f + $57,$5b,$56,$8b,$b2,$10,$b3,$77,$12,$1b,$1e,$03,$12,$77,$1e,$1e + $77,$11,$1e,$b2,$57,$40,$59,$55,$10,$a5,$8a,$a7,$10,$04,$82,$e5 + $44,$1e,$77,$a0,$10,$87,$1a,$18,$1a,$a1,$03,$77,$18,$11,$77,$e4 + $05,$77,$01,$b3,$02,$8f,$b2,$77,$ac,$1a,$12,$9b,$00,$12,$77,$00 + $8e,$1b,$13,$77,$1b,$1e,$1c,$12,$77,$e4,$9e,$13,$18,$87,$1b,$8c + $03,$b2,$77,$1d,$18,$15,$77,$11,$aa,$77,$bb,$9b,$c4,$98,$77,$e4 + $77,$8d,$12,$77,$1f,$12,$a5,$9d,$16,$85,$1a,$18,$13,$12,$1b,$7b + $77,$c4,$44,$14,$88,$89,$05,$1e,$14,$03,$aa,$7b,$77,$12,$a9,$1e + $07,$93,$00,$1e,$b5,$87,$03,$18,$07,$77,$8d,$14,$05,$8a,$85,$04 + $1f,$1e,$12,$1b,$13,$77,$10,$a1,$a3,$a2,$aa,$9b,$02,$19,$11,$aa + $03,$02,$19,$a2,$12,$1b,$0e,$77,$8c,$70,$04,$77,$a0,$a1,$77,$89 + $18,$1b,$a1,$9b,$41,$8c,$77,$00,$a1,$03,$77,$1a,$1e,$04,$04,$94 + $11,$05,$18,$1a,$77,$8e,$05,$77,$98,$77,$0e,$b9,$13,$77,$88,$77 + $44,$b1,$a3,$77,$11,$1e,$ad,$77,$1a,$88,$b5,$04,$77,$16,$10,$18 + $e5,$4b,$9b,$e4,$05,$77,$1a,$1e,$04,$04,$1e,$88,$7b,$77,$04,$1f + $8e,$1b,$13,$77,$e4,$77,$13,$12,$14,$1e,$13,$12,$9e,$16,$14,$be + $07,$03,$77,$8c,$7b,$77,$1e,$04,$9e,$8d,$12,$1c,$e5,$13,$ba,$03 + $05,$18,$0e,$77,$c3,$98,$9b,$e4,$77,$16,$a5,$77,$14,$16,$02,$ac + $88,$93,$b5,$a2,$77,$88,$1b,$0e,$77,$51,$22,$52,$04,$77,$00,$8b + $1b,$77,$07,$a1,$8a,$af,$03,$12,$77,$c4,$19,$12,$00,$77,$04,$1f + $1e,$12,$1b,$13,$04,$e5,$b5,$a2,$77,$c4,$44,$14,$88,$89,$05,$1e + $14,$03,$aa,$9d,$11,$8c,$03,$93,$00,$1e,$b5,$77,$a8,$77,$51,$3b + $52,$e6,$55,$5f,$10,$18,$18,$13,$77,$1b,$02,$14,$1c,$7b,$77,$cd + $83,$41,$57,$4e,$5e,$40,$59,$55,$77,$77,$a2,$03,$a1,$ac,$88,$82 + $79,$77,$44,$00,$12,$77,$1f,$16,$ad,$77,$19,$12,$93,$18,$11,$77 + $e4,$05,$77,$8d,$05,$01,$1e,$14,$ba,$77,$16,$10,$16,$a7,$9b,$1e + $11,$77,$e4,$77,$00,$8e,$1b,$13,$77,$a0,$77,$bc,$77,$10,$18,$18 + $13,$77,$16,$04,$9e,$10,$18,$9e,$44,$be,$a3,$a6,$77,$e4,$77,$00 + $8b,$1b,$77,$a0,$77,$15,$05,$1e,$12,$11,$ab,$9b,$1e,$11,$77,$04 + $02,$14,$be,$04,$04,$11,$02,$1b,$7b,$77,$e4,$77,$00,$8b,$1b,$77 + $a0,$77,$00,$12,$1b,$1b,$77,$a5,$00,$b9,$13,$ab,$83,$4f,$57,$7f + $44,$14,$7e,$92,$77,$66,$6e,$6f,$62,$57,$15,$0e,$92,$57,$42,$c6 + $9f,$4d,$57,$4e,$5e,$40,$59,$55,$77,$77,$14,$88,$10,$af,$03,$02 + $ae,$ac,$88,$04,$77,$cd,$76,$5b,$5b,$b5,$a3,$12,$5a,$77,$00,$8b + $1b,$77,$b3,$00,$16,$0e,$04,$77,$a0,$87,$07,$ae,$be,$77,$11,$aa + $77,$e4,$77,$a7,$84,$9b,$a8,$13,$77,$b8,$0e,$a0,$77,$bc,$88,$a3 + $77,$b5,$a8,$77,$e4,$77,$b5,$a7,$1c,$79,$79,$83,$4f,$57,$11,$8f + $b2,$13,$57,$b4,$03,$8f,$b2,$57,$00,$12,$1b,$1b,$77,$1c,$b4,$00 + $19,$57,$11,$16,$1a,$18,$bb,$57,$b4,$03,$ab,$57,$ad,$05,$0e,$57 + $1a,$8b,$13,$1b,$0e,$57,$1a,$18,$89,$57,$a5,$16,$04,$88,$8f,$1b + $0e,$57,$57,$f2,$57,$25,$57,$10,$a5,$a2,$57,$01,$16,$89,$57,$07 + $a7,$1c,$57,$55,$20,$77,$21,$5a,$77,$ee,$16,$ac,$88,$04,$57,$cb + $04,$57,$22,$57,$d7,$77,$11,$aa,$ba,$03,$04,$57,$18,$be,$a8,$04 + $57,$04,$1f,$0e,$19,$ba,$04,$57,$04,$8b,$1b,$a7,$ba,$04,$57,$b8 + $03,$94,$03,$af,$a6,$ac,$88,$04,$57,$b7,$a2,$1f,$94,$18,$11,$77 + $33,$57,$b7,$ad,$77,$11,$aa,$77,$33,$57,$11,$18,$18,$13,$77,$15 + $b2,$19,$13,$a3,$04,$57,$03,$8e,$05,$1e,$89,$04,$57,$07,$18,$8a + $05,$0e,$57,$a6,$04,$14,$18,$04,$57,$3b,$57,$00,$b3,$1c,$94,$c9 + $57,$14,$af,$15,$57,$15,$a2,$57,$b7,$15,$89,$57,$45,$57,$a0,$04 + $8a,$57,$07,$ae,$10,$02,$ab,$57,$af,$01,$16,$10,$ab,$57,$14,$02 + $05,$04,$ab,$57,$04,$14,$8e,$05,$10,$ab,$57,$26,$77,$14,$1e,$01 + $8b,$77,$00,$b9,$57,$3f,$77,$08,$77,$37,$04,$57,$16,$77,$3f,$77 + $a6,$8d,$16,$8d,$57,$26,$77,$12,$b9,$b5,$a9,$16,$1c,$ba,$57,$26 + $77,$bc,$ae,$05,$77,$16,$14,$ac,$01,$8c,$0e,$57,$f8,$0a,$77,$09 + $57,$c4,$46,$77,$08,$77,$37,$57,$f8,$96,$04,$70,$77,$35,$77,$34 + $57,$55,$2d,$5a,$57,$f8,$3c,$77,$3b,$57,$1d,$02,$1e,$be,$57,$15 + $af,$19,$13,$0e,$57,$00,$a2,$a3,$57,$15,$a5,$00,$57,$10,$b9,$10 + $b2,$77,$15,$ae,$89,$a3,$04,$57,$45,$57,$46,$77,$37,$57,$46,$77 + $45,$57,$46,$77,$3f,$57,$3f,$77,$45,$57,$11,$8f,$02,$b7,$bb,$57 + $12,$0f,$18,$ac,$14,$57,$1f,$18,$18,$07,$0e,$57,$02,$b6,$04,$02 + $b3,$57,$12,$0f,$14,$8c,$a7,$10,$57,$14,$02,$1e,$04,$a7,$12,$57 + $19,$1e,$10,$1f,$03,$77,$1b,$1e,$11,$12,$57,$14,$16,$04,$1e,$b4 + $04,$57,$04,$8c,$77,$14,$18,$1a,$04,$57,$55,$2d,$5a,$57,$54,$57 + $c4,$c6,$77,$54,$57,$c4,$c5,$77,$54,$57,$c3,$c6,$57,$c3,$c5,$57 + $04,$88,$77,$18,$11,$87,$15,$8c,$14,$1f,$57,$04,$14,$8e,$19,$13 + $a5,$1b,$57,$15,$ae,$14,$1c,$10,$02,$b9,$13,$57,$05,$18,$10,$02 + $12,$57,$00,$1f,$aa,$ba,$88,$77,$a0,$8a,$b2,$77,$1f,$12,$16,$13 + $93,$11,$ae,$07,$77,$12,$b9,$70,$13,$77,$1c,$19,$16,$ad,$57,$19 + $77,$02,$19,$a5,$b8,$05,$1c,$8f,$b2,$57,$77,$15,$aa,$a7,$10,$57 + $77,$13,$02,$1b,$1b,$57,$77,$03,$12,$a6,$18,$bb,$57,$77,$a5,$01 + $18,$1b,$03,$a7,$10,$57,$c6,$57,$c5,$57,$07,$ae,$be,$57,$1b,$8c + $03,$b2,$77,$c6,$57,$13,$02,$1a,$07,$57,$1e,$77,$1f,$12,$b9,$87 + $25,$77,$b7,$18,$1c,$94,$98,$77,$16,$07,$07,$12,$b9,$93,$a2,$86 + $57,$0e,$12,$16,$1f,$7b,$77,$1e,$77,$1f,$12,$b9,$87,$25,$77,$98 + $77,$b2,$11,$03,$86,$87,$77,$00,$1f,$1e,$b2,$77,$15,$16,$14,$1c + $57,$10,$8a,$77,$e4,$05,$77,$1e,$05,$88,$77,$16,$04,$04,$77,$18 + $01,$a3,$77,$03,$18,$86,$57,$bc,$1a,$12,$77,$24,$85,$98,$77,$00 + $16,$04,$77,$8d,$a1,$77,$a2,$86,$57,$03,$05,$0e,$86,$57,$57,$57 + $57,$57,$00,$16,$04,$07,$57,$1a,$18,$b5,$57,$10,$05,$02,$15,$57 + $a8,$03,$57,$45,$57,$07,$18,$8a,$57,$b9,$03,$04,$77,$10,$af,$13 + $02,$a2,$12,$57,$0e,$16,$1c,$57,$04,$19,$16,$8b,$57,$04,$1b,$02 + $10,$57,$03,$05,$18,$07,$1e,$14,$b3,$57,$13,$a1,$8d,$57,$af,$a7 + $57,$1e,$1a,$07,$a1,$8a,$af,$15,$b2,$57,$12,$0f,$02,$a0,$af,$19 + $03,$57,$11,$02,$19,$19,$0e,$57,$00,$12,$1e,$05,$13,$57,$02,$b6 + $04,$02,$b3,$57,$89,$af,$19,$b0,$57,$07,$12,$14,$02,$1b,$1e,$b9 + $57,$11,$a5,$a9,$a1,$03,$57,$18,$14,$14,$16,$04,$1e,$88,$b3,$57 + $02,$19,$07,$a5,$a6,$14,$03,$8f,$b2,$57,$13,$a5,$16,$13,$11,$02 + $1b,$57,$fc,$57,$0b,$77,$0c,$77,$11,$aa,$77,$32,$57,$db,$e5,$32 + $57,$31,$77,$15,$0e,$77,$30,$57,$db,$77,$15,$02,$03,$77,$d9,$57 + $77,$16,$38,$77,$27,$57,$07,$1b,$a8,$8a,$57,$00,$aa,$1b,$13,$57 + $b5,$12,$77,$57,$b5,$1e,$04,$77,$57,$b7,$16,$13,$85,$cd,$57,$5e + $5c,$56,$5f,$57,$13,$05,$1e,$ad,$57,$77,$14,$a2,$16,$b7,$10,$02 + $12,$57,$1e,$a8,$57,$44,$14,$18,$1a,$1a,$a8,$13,$a3,$57,$3f,$57 + $1a,$8e,$19,$03,$16,$a7,$57,$ab,$1e,$15,$b2,$57,$03,$a5,$12,$57 + $04,$07,$18,$03,$03,$ab,$57,$2f,$57,$2e,$57,$36,$18,$1e,$13,$57 + $28,$57,$29,$57,$a8,$14,$1e,$a1,$03,$57,$12,$0f,$be,$07,$ac,$88 + $b3,$57,$12,$14,$be,$19,$03,$05,$1e,$14,$57,$a7,$10,$af,$a7,$ab + $57,$25,$57,$1c,$8b,$1b,$a3,$57,$13,$12,$16,$13,$1b,$0e,$57,$12 + $01,$8b,$57,$b2,$b5,$b3,$57,$01,$1e,$14,$1e,$18,$bb,$57,$8c,$04 + $77,$57,$5a,$59,$44,$57,$79,$5b,$58,$57,$77,$a8,$13,$77,$57,$0e + $8e,$57,$07,$b9,$1c,$94,$1a,$8a,$a3,$04,$57,$13,$bb,$03,$77,$14 + $b7,$02,$13,$04,$57,$1e,$be,$77,$a0,$05,$10,$04,$57,$05,$18,$14 + $1c,$77,$11,$aa,$b8,$ac,$88,$04,$57,$01,$18,$1b,$14,$16,$b4,$ba + $57,$07,$1b,$a8,$03,$57,$03,$02,$1b,$1e,$07,$57,$15,$a8,$a8,$16 + $57,$14,$aa,$19,$57,$45,$00,$12,$ab,$57,$45,$57,$46,$77,$45,$57 + $46,$77,$3f,$57,$a7,$1f,$16,$bd,$03,$a8,$03,$57,$e8,$57,$a7,$10 + $77,$57,$ab,$77,$57,$77,$13,$79,$15,$af,$a0,$19,$77,$71,$77,$1e + $79,$a0,$1b,$1b,$57,$57,$57,$77,$19,$16,$1a,$12,$68,$77,$57,$77 + $03,$18,$77,$57,$77,$1e,$04,$77,$57,$00,$16,$04,$77,$ae,$89,$77 + $8d,$a1,$77,$a2,$77,$44,$57,$79,$5b,$77,$44,$57,$13,$18,$14,$1c + $ab,$57,$56,$7f,$0e,$78,$19,$7e,$68,$57,$04,$1f,$1e,$07,$57,$77 + $16,$77,$57,$77,$a3,$05,$1e,$bb,$57,$77,$19,$12,$00,$77,$57,$55 + $77,$1f,$a3,$77,$b8,$1d,$ba,$03,$0e,$70,$04,$77,$04,$07,$16,$be + $77,$19,$16,$01,$0e,$5a,$57,$e6,$5f,$56,$77,$77,$1a,$ba,$04,$16 + $b0,$77,$a1,$13,$04,$57,$77,$cd,$77,$53,$7b,$77,$1e,$77,$5a,$16 + $1a,$55,$77,$14,$16,$07,$03,$16,$a7,$77,$4c,$77,$5a,$18,$11,$84 + $57,$57,$58,$77,$02,$19,$1c,$b4,$00,$19,$77,$c6,$57,$5e,$5f,$40 + $56,$77,$a7,$14,$18,$1a,$94,$1a,$ba,$04,$16,$b0,$57,$14,$02,$05 + $05,$02,$b5,$a3,$04,$57,$11,$18,$04,$13,$0e,$1c,$12,$77,$04,$1a + $0e,$b5,$12,$57,$11,$aa,$03,$ba,$a9,$12,$57,$9c,$a5,$ba,$a6,$be + $57,$1e,$04,$77,$a0,$1b,$1e,$12,$01,$ab,$9e,$1f,$16,$ad,$77,$1d + $02,$1a,$07,$ab,$9e,$c3,$10,$b3,$16,$0f,$0e,$57,$4e,$5e,$4a,$59 + $55,$10,$18,$18,$13,$77,$13,$16,$0e,$77,$cd,$77,$53,$9b,$1e,$5a + $77,$16,$1a,$77,$44,$16,$10,$a1,$03,$77,$44,$15,$ae,$1c,$12,$77 + $18,$11,$77,$44,$19,$16,$01,$b3,$77,$44,$a7,$03,$12,$1b,$b2,$10 + $a1,$be,$9b,$16,$04,$77,$e4,$77,$1c,$b4,$00,$7b,$77,$c4,$44,$19 + $16,$01,$0e,$77,$1f,$16,$ad,$77,$a0,$a1,$77,$1c,$12,$12,$07,$94 + $c4,$44,$b5,$b9,$10,$18,$1e,$13,$04,$77,$18,$11,$11,$77,$e4,$05 + $77,$16,$04,$04,$77,$8e,$03,$77,$a7,$77,$13,$12,$12,$07,$77,$04 + $07,$16,$be,$77,$11,$aa,$77,$b8,$19,$0e,$77,$0e,$12,$b9,$04,$77 + $b4,$00,$79,$77,$44,$00,$12,$1b,$1b,$77,$c4,$04,$8c,$02,$16,$ac + $88,$77,$1f,$16,$04,$77,$14,$1f,$a8,$10,$ab,$9b,$8e,$05,$77,$15 + $18,$0e,$04,$77,$b9,$12,$77,$a5,$16,$13,$0e,$77,$11,$aa,$87,$07 + $02,$04,$1f,$77,$05,$1e,$10,$1f,$03,$9e,$c4,$1f,$18,$1a,$12,$77 + $04,$0e,$04,$03,$12,$1a,$77,$18,$11,$77,$b5,$18,$8d,$77,$1a,$02 + $05,$13,$a3,$a3,$04,$9b,$4f,$5e,$4a,$1e,$5a,$77,$1f,$16,$ad,$77 + $18,$15,$03,$16,$a7,$93,$c4,$13,$12,$11,$a1,$be,$77,$07,$ae,$19 + $04,$77,$11,$aa,$77,$b5,$12,$1e,$05,$77,$44,$1f,$1e,$ad,$77,$44 + $00,$aa,$1b,$13,$04,$9b,$c4,$a0,$8a,$b2,$04,$77,$1c,$b4,$00,$77 + $00,$12,$70,$ad,$77,$10,$18,$03,$77,$bc,$1a,$12,$b5,$94,$15,$02 + $03,$77,$b4,$03,$77,$00,$1f,$a2,$9b,$1e,$11,$77,$44,$1e,$77,$03 + $af,$19,$04,$1a,$8c,$77,$c4,$07,$ae,$19,$04,$9e,$8e,$05,$77,$15 + $16,$8d,$77,$88,$77,$44,$bd,$a5,$af,$77,$b5,$12,$0e,$70,$1b,$1b + $77,$a7,$03,$a3,$be,$07,$03,$77,$c4,$03,$05,$a8,$04,$1a,$1e,$04 + $04,$1e,$88,$79,$77,$44,$1e,$77,$19,$12,$ab,$87,$98,$9e,$b8,$1c + $12,$77,$c4,$05,$02,$19,$9b,$e4,$70,$a5,$77,$12,$b2,$14,$03,$ab + $9b,$c4,$07,$ae,$19,$04,$77,$16,$a5,$77,$02,$19,$1e,$07,$02,$1b + $8d,$77,$14,$18,$13,$93,$00,$1e,$b5,$a7,$77,$c3,$03,$05,$a8,$04 + $1a,$1e,$04,$04,$1e,$88,$9b,$5f,$e4,$77,$00,$8b,$1b,$77,$a0,$77 + $07,$16,$1e,$13,$9b,$77,$77,$77,$77,$44,$10,$18,$18,$13,$77,$1b + $02,$14,$1c,$77,$cd,$83,$4f,$57,$4e,$5e,$4a,$5f,$59,$5a,$44,$00 + $12,$1b,$1b,$77,$13,$88,$12,$77,$cd,$9b,$e4,$77,$1f,$16,$ad,$77 + $8d,$05,$01,$93,$02,$04,$77,$00,$12,$1b,$1b,$e5,$00,$12,$77,$04 + $1f,$b3,$1b,$77,$a5,$1a,$12,$1a,$15,$a3,$9b,$00,$12,$77,$13,$1e + $13,$77,$b4,$03,$77,$12,$0f,$07,$12,$14,$03,$77,$c4,$44,$b5,$b9 + $10,$18,$1e,$13,$04,$9e,$11,$a7,$13,$77,$8e,$03,$77,$16,$15,$8e + $03,$77,$e4,$9b,$11,$aa,$77,$c4,$1a,$18,$1a,$a1,$03,$77,$07,$b2 + $16,$8d,$77,$16,$14,$be,$07,$03,$77,$c3,$44,$19,$16,$01,$0e,$77 + $51,$25,$52,$77,$16,$04,$77,$07,$16,$0e,$1a,$a1,$03,$83,$4f,$57 + $16,$a5,$77,$e4,$77,$04,$02,$a5,$68,$57,$04,$1f,$a5,$00,$57,$a0 + $16,$89,$57,$15,$1e,$04,$88,$57,$04,$19,$16,$1c,$12,$57,$00,$18 + $1b,$11,$57,$b2,$18,$07,$b9,$13,$57,$14,$a2,$57,$1a,$88,$1c,$12 + $0e,$57,$10,$18,$a2,$57,$11,$1e,$04,$1f,$57,$3d,$77,$3e,$57,$46 + $77,$2f,$77,$2c,$57,$f8,$3c,$77,$2e,$77,$2c,$57,$2b,$77,$2a,$57 + $3d,$77,$3e,$57,$1a,$12,$a2,$57,$14,$02,$03,$1b,$8a,$57,$89,$12 + $16,$1c,$57,$15,$02,$05,$10,$a3,$04,$57,$bc,$02,$07,$57,$1e,$be + $57,$1a,$02,$13,$57,$0d,$a3,$18,$7a,$44,$10,$57,$01,$16,$14,$02 + $02,$1a,$57,$46,$77,$02,$1b,$03,$af,$57,$1f,$18,$14,$1c,$12,$0e + $57,$14,$05,$1e,$14,$1c,$8a,$57,$1c,$b9,$a2,$12,$57,$07,$18,$b7 + $57,$03,$a1,$19,$1e,$04,$57,$5b,$49,$77,$a3,$05,$aa,$57 1a5e: d3 96 24 1c+ text_stuff1? .bulk $d3,$96,$24,$1c,$fd,$4f,$35,$76,$64,$20,$44,$a4,$dc,$6a,$10,$a2 + $03,$6b,$1a,$c0,$b8,$05,$65,$c1,$29 1a77: 01 80 00 00+ text_stuff2? .bulk $01,$80,$00,$00,$00,$01,$01,$01,$01,$82,$01,$01,$01,$01,$01,$01 + $01,$01,$01,$01,$01,$01,$01,$02,$01,$82,$90 ; ; More strings in "docked" format. Index 0-26. ; 1a92: 57 c4 14 18+ ext_docked_text .bulk $57,$c4,$14,$18,$b7,$19,$1e,$89,$04,$77,$1f,$12,$a5,$77,$1f,$16 + $ad,$77,$01,$1e,$18,$1b,$a2,$ab,$55,$77,$a7,$03,$a3,$10,$b3,$16 + $14,$ac,$14,$77,$14,$b7,$19,$94,$07,$05,$18,$03,$18,$14,$18,$1b + $5a,$e5,$04,$1f,$8e,$1b,$13,$77,$a0,$77,$16,$01,$18,$1e,$13,$ab + $57,$c4,$14,$88,$89,$05,$1e,$14,$03,$aa,$77,$9c,$a5,$ba,$a6,$be + $7b,$77,$cd,$57,$16,$77,$25,$77,$b7,$18,$1c,$94,$98,$77,$b2,$11 + $03,$77,$1f,$12,$a5,$87,$00,$1f,$1e,$b2,$77,$15,$16,$14,$1c,$79 + $77,$1b,$18,$18,$1c,$93,$15,$8e,$19,$13,$77,$11,$aa,$77,$b9,$12 + $b1,$57,$0e,$12,$07,$7b,$87,$25,$85,$98,$77,$1f,$16,$13,$87,$10 + $b3,$16,$14,$ac,$14,$77,$1f,$0e,$07,$a3,$13,$05,$1e,$ad,$77,$11 + $8c,$03,$93,$1f,$12,$a5,$79,$77,$bb,$93,$8c,$77,$03,$18,$18,$57 + $c3,$77,$25,$77,$98,$77,$13,$12,$1f,$0e,$07,$93,$1f,$12,$a5,$77 + $11,$05,$18,$1a,$77,$b4,$00,$1f,$12,$a5,$7b,$77,$04,$02,$19,$77 + $04,$1c,$1e,$1a,$1a,$ab,$e5,$1d,$02,$1a,$07,$ab,$79,$77,$1e,$77 + $1f,$12,$b9,$77,$8c,$77,$00,$a1,$03,$9e,$a7,$bd,$a0,$57,$24,$77 + $98,$77,$00,$a1,$03,$77,$11,$aa,$77,$1a,$12,$77,$a2,$77,$16,$bb + $b9,$79,$77,$1a,$0e,$77,$ae,$04,$a3,$04,$77,$13,$1e,$13,$19,$70 + $03,$77,$12,$01,$a1,$77,$04,$14,$af,$03,$14,$1f,$77,$c4,$24,$57 + $18,$1f,$77,$13,$12,$b9,$77,$1a,$12,$77,$0e,$ba,$79,$87,$11,$05 + $1e,$10,$1f,$03,$11,$02,$1b,$77,$05,$18,$10,$02,$12,$77,$00,$1e + $b5,$77,$00,$1f,$a2,$77,$1e,$77,$a0,$1b,$1e,$12,$ad,$77,$e4,$77 + $07,$12,$18,$07,$b2,$77,$14,$b3,$1b,$87,$b2,$16,$13,$77,$07,$18 + $89,$a3,$1e,$aa,$77,$04,$1f,$18,$03,$77,$02,$07,$77,$b7,$03,$04 + $77,$18,$11,$77,$b5,$18,$8d,$77,$a0,$16,$89,$1b,$0e,$77,$07,$1e + $af,$03,$ba,$e5,$00,$a1,$03,$9e,$bb,$b2,$05,$1e,$57,$e4,$77,$14 + $a8,$77,$03,$16,$14,$1c,$b2,$77,$c4,$3f,$77,$24,$77,$1e,$11,$77 + $e4,$77,$1b,$1e,$1c,$12,$79,$77,$1f,$12,$70,$04,$77,$a2,$77,$aa + $b9,$af,$57,$56,$14,$18,$1a,$94,$bc,$88,$6d,$77,$12,$1b,$8c,$12 + $77,$1e,$1e,$57,$23,$57,$23,$57,$23,$57,$23,$57,$23,$57,$23,$57 + $23,$57,$23,$57,$23,$57,$23,$57,$23,$57,$23,$57,$23,$57,$15,$18 + $0e,$77,$16,$a5,$77,$e4,$77,$a7,$77,$c4,$00,$05,$88,$10,$77,$10 + $b3,$16,$0f,$0e,$76,$57,$b5,$a3,$12,$70,$04,$87,$a5,$b3,$77,$24 + $77,$07,$1e,$af,$03,$12,$77,$8e,$03,$77,$b5,$a3,$12,$57,$c4,$96 + $04,$77,$18,$11,$77,$3a,$77,$16,$a5,$77,$bc,$77,$16,$b8,$0d,$a7 + $10,$1b,$0e,$77,$07,$05,$1e,$1a,$1e,$ac,$ad,$77,$b5,$a2,$77,$b5 + $12,$0e,$77,$89,$8b,$1b,$77,$b5,$a7,$1c,$77,$44,$7d,$7d,$7d,$7d + $7d,$77,$7d,$7d,$7d,$7d,$7d,$7d,$9d,$77,$64,$13,$57,$56,$00,$12 + $1b,$14,$18,$1a,$12,$9e,$77,$c4,$8d,$ad,$19,$03,$12,$a1,$b5,$77 + $10,$16,$ae,$0f,$0e,$76,$57 1cf9: 2e 54 72 69+ .str ‘.Tribbl’ ;trouble? 1d00: 00 00 00 00+ font_glyphs .bulk $00,$00,$00,$00,$00,$00,$00,$00,$38,$38,$38,$38,$00,$38,$00,$00 + $36,$36,$24,$12,$00,$00,$00,$00,$80,$24,$7e,$24,$7e,$24,$80,$00 + $08,$3e,$02,$3e,$20,$3e,$08,$00,$42,$25,$12,$08,$24,$52,$21,$00 + $0c,$16,$02,$04,$2a,$12,$2c,$00,$18,$18,$10,$08,$00,$00,$00,$00 + $38,$1c,$0e,$0e,$0e,$1c,$38,$00,$0e,$1c,$38,$38,$38,$1c,$0e,$00 + $22,$1c,$36,$1c,$22,$00,$00,$00,$00,$08,$08,$3e,$08,$08,$00,$00 + $00,$00,$00,$00,$18,$18,$10,$08,$00,$00,$00,$7e,$7e,$00,$00,$00 + $00,$00,$00,$00,$18,$18,$00,$00,$60,$70,$38,$1c,$0e,$06,$00,$00 + $1e,$33,$3b,$3f,$37,$33,$1e,$00,$0c,$0e,$0f,$0c,$0c,$0c,$3f,$00 + $1e,$33,$30,$18,$0c,$06,$3f,$00,$1e,$33,$30,$1c,$30,$33,$1e,$00 + $38,$3c,$36,$33,$3f,$30,$30,$00,$3f,$03,$03,$1f,$30,$33,$1e,$00 + $1c,$06,$03,$1f,$33,$33,$1e,$00,$3f,$33,$18,$0c,$0c,$0c,$0c,$00 + $1e,$33,$33,$1e,$33,$33,$1e,$00,$1e,$33,$33,$3e,$30,$18,$0c,$00 + $00,$18,$18,$00,$18,$18,$00,$00,$00,$18,$18,$00,$18,$18,$10,$08 + $10,$18,$1c,$1e,$1c,$18,$10,$00,$00,$00,$7e,$00,$7e,$00,$00,$00 + $04,$0c,$1c,$3c,$1c,$0c,$04,$00,$3c,$7e,$62,$30,$18,$00,$18,$00 + $90,$88,$b6,$ff,$ff,$ff,$be,$b6,$1e,$33,$33,$3f,$33,$33,$33,$00 + $1f,$33,$33,$1f,$33,$33,$1f,$00,$1e,$33,$03,$03,$03,$33,$1e,$00 + $0f,$1b,$33,$33,$33,$1b,$0f,$00,$1e,$33,$03,$1f,$03,$33,$1e,$00 + $1e,$33,$03,$1f,$03,$03,$03,$00,$1e,$33,$03,$3b,$33,$33,$1e,$00 + $33,$33,$33,$3f,$33,$33,$33,$00,$3f,$0c,$0c,$0c,$0c,$0c,$3f,$00 + $30,$30,$30,$30,$33,$33,$1e,$00,$33,$1b,$0f,$07,$0f,$1b,$33,$00 + $03,$03,$03,$03,$03,$03,$3f,$00,$33,$3f,$33,$33,$33,$33,$33,$00 + $33,$33,$37,$3b,$33,$33,$33,$00,$1e,$33,$33,$33,$33,$33,$1e,$00 + $1f,$33,$33,$1f,$03,$03,$03,$00,$1e,$33,$33,$37,$3b,$33,$1e,$00 + $1f,$33,$33,$1f,$0f,$1b,$33,$00,$1e,$33,$03,$1e,$30,$33,$1e,$00 + $3f,$0c,$0c,$0c,$0c,$0c,$0c,$00,$33,$33,$33,$33,$33,$33,$1e,$00 + $33,$33,$33,$33,$33,$1e,$0c,$00,$33,$33,$33,$33,$33,$3f,$33,$00 + $33,$33,$1e,$0c,$1e,$33,$33,$00,$33,$33,$33,$1e,$0c,$0c,$0c,$00 + $3f,$30,$18,$0c,$06,$03,$3f,$00,$1e,$1e,$06,$06,$1e,$1e,$00,$00 + $06,$0e,$1c,$38,$70,$60,$00,$00,$78,$78,$60,$60,$78,$78,$00,$00 + $08,$1c,$3e,$7f,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7f,$00 + $18,$18,$08,$10,$00,$00,$00,$00,$00,$00,$1e,$30,$3e,$33,$3e,$00 + $03,$03,$1f,$33,$33,$33,$1f,$00,$00,$00,$1e,$33,$03,$33,$1e,$00 + $30,$30,$3e,$33,$33,$33,$3e,$00,$00,$00,$1e,$33,$3f,$03,$1e,$00 + $1c,$36,$06,$1f,$06,$06,$06,$00,$00,$00,$1e,$33,$33,$3e,$30,$1e + $03,$03,$1f,$33,$33,$33,$33,$00,$0c,$00,$0c,$0c,$0c,$0c,$0c,$00 + $30,$00,$30,$30,$30,$30,$33,$1e,$03,$03,$33,$1b,$0f,$1b,$33,$00 + $0c,$0c,$0c,$0c,$0c,$0c,$0c,$00,$00,$00,$3e,$6b,$6b,$63,$63,$00 + $00,$00,$1e,$33,$33,$33,$33,$00,$00,$00,$1e,$33,$33,$33,$1e,$00 + $00,$00,$1e,$33,$33,$1f,$03,$03,$00,$00,$1e,$33,$33,$3e,$30,$30 + $00,$00,$1e,$33,$03,$03,$03,$00,$00,$00,$3e,$03,$1e,$30,$1f,$00 + $06,$06,$1f,$06,$06,$36,$1c,$00,$00,$00,$33,$33,$33,$33,$1e,$00 + $00,$00,$33,$33,$33,$1e,$0c,$00,$00,$00,$63,$63,$6b,$6b,$3e,$00 + $00,$00,$33,$1e,$0c,$1e,$33,$00,$00,$00,$33,$33,$33,$3e,$30,$1e + $00,$00,$3f,$18,$0c,$06,$3f,$00,$f0,$98,$98,$9c,$98,$98,$f0,$80 + $18,$18,$18,$18,$18,$18,$18,$18,$0e,$18,$18,$38,$18,$18,$0e,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; ; The title screen remains for the entire game -- only the viewport is erased. ; 2000: c0 aa d5 aa+ title_screen .bulk $c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$00,$00,$c0,$80,$80,$80,$80,$d5,$aa,$f7 + $ee,$dd,$bb,$d4,$aa,$d5,$aa,$d5,$aa,$c5,$aa,$d5,$a2,$d5,$aa,$d5 + $aa,$d5,$aa,$f6,$ee,$dd,$ab,$d5,$aa,$95,$80,$80,$80,$a0,$80,$00 + $c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$80,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$80,$aa,$f7 + $ee,$dd,$bb,$90,$88,$84,$80,$80,$80,$80,$aa,$d5,$80,$80,$80,$80 + $a0,$90,$88,$f6,$ee,$dd,$bb,$d7,$aa,$85,$80,$80,$80,$a0,$80,$00 + $c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$a0,$85,$80,$d0,$80,$85,$a8,$81 + $a0,$c5,$82,$d0,$a2,$81,$a0,$85,$a0,$d1,$80,$d0,$a8,$81,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$80,$80,$d5 + $ea,$dd,$bb,$84,$82,$d9,$bb,$f7,$ee,$dd,$a8,$95,$ee,$dd,$bb,$f7 + $8e,$c1,$a0,$f6,$ee,$dd,$ab,$d5,$82,$80,$80,$80,$80,$a0,$80,$00 + $c0,$00,$00,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$88,$00,$00,$90,$00 + $00,$04,$00,$00,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$f0,$81,$8b,$f8,$c0,$85,$bc,$c1 + $f0,$e7,$8a,$f9,$b3,$85,$70,$c5,$80,$9e,$8a,$f8,$ac,$81,$82,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d0,$aa,$d5,$aa,$95,$a8,$d5,$a0,$d5,$aa + $d5,$82,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$00,$00,$00,$00,$00,$81,$00,$00,$00,$88,$00,$00,$84 + $20,$00,$00,$81,$00,$04,$a0,$00,$00,$84,$00,$a0,$00,$00,$94,$00 + $00,$04,$00,$00,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$82,$d4,$aa,$d5,$aa,$f5,$aa,$d5,$ab,$d7 + $ea,$d5,$ba,$d5,$aa,$d5,$aa,$d7,$aa,$dd,$aa,$f5,$aa,$d5,$aa,$c1 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$00,$a0,$d0,$80,$c0,$80,$c0,$80,$c0,$a0,$81,$80 + $c1,$8a,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$82,$00 + $00,$00,$00,$81,$00,$00,$00,$c0,$00,$00,$00,$00,$82,$00,$90,$00 + $00,$00,$00,$00,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$c0,$aa,$dd,$bb,$d7,$ee,$dd,$ba,$f7,$ee,$dd,$8b,$f0 + $ee,$dd,$bb,$f7,$ee,$dd,$83,$f0,$ee,$dd,$bb,$f7,$ee,$dd,$bb,$d5 + $aa,$95,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d0,$a0,$d4,$a8,$c1,$82,$c0,$80,$c0,$a8,$d1,$82 + $85,$88,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$00,$00,$00,$00,$00,$81,$84,$00,$00,$00,$81,$00,$00 + $00,$00,$00,$81,$00,$00,$00,$00,$00,$81,$00,$00,$a0,$00,$90,$00 + $00,$00,$00,$00,$15,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$a0,$d5,$bb,$f7,$ee,$dd,$bb,$c7,$a0,$c4,$82,$c5 + $8a,$c4,$bb,$f7,$a2,$d0,$a2,$c1,$a2,$84,$b2,$f7,$ee,$dd,$ab,$f7 + $ae,$85,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d1,$a2,$d4,$a8,$d1,$a2,$c4,$88,$d1,$a2,$c5,$8a + $95,$a2,$c4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$00,$00,$00,$00,$00,$81,$00,$00,$c1,$00,$00,$00,$00 + $00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$82,$81,$00,$00,$90,$00 + $00,$00,$00,$00,$15,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$aa,$d5,$bb,$f7,$ee,$dd,$83,$c4,$aa,$d5,$aa,$d5 + $aa,$91,$80,$81,$88,$d5,$aa,$d5,$aa,$d5,$a2,$e0,$ee,$dd,$bb,$f7 + $aa,$d5,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$8a,$91,$aa,$d4,$88,$d1,$a2,$c4,$88,$d1,$a2,$d5,$88 + $d5,$a2,$d5,$a8,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$90,$00 + $00,$00,$00,$00,$01,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$d5,$aa,$d5 + $ba,$f7,$ae,$80,$80,$80,$80,$80,$80,$c0,$aa,$d5,$82,$80,$80,$80 + $80,$80,$80,$dc,$bb,$f7,$ae,$dd,$ab,$d5,$80,$80,$80,$a0,$80,$00 + $c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$80,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$c0,$aa,$dd + $bb,$f7,$ae,$94,$8a,$e5,$ee,$dd,$bb,$97,$aa,$d5,$b8,$f7,$ee,$dd + $a3,$d1,$a8,$dc,$bb,$f7,$ee,$dd,$aa,$81,$80,$80,$80,$a0,$80,$00 + $c0,$00,$00,$00,$00,$00,$00,$00,$c1,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$88,$84,$a4,$90,$00 + $00,$00,$00,$00,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$a0,$81,$80,$d0,$80,$85,$a8,$81 + $a0,$85,$8a,$d0,$82,$85,$a0,$85,$a0,$d1,$80,$d0,$a8,$81,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$a5,$a5,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$28,$51,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$88,$00,$00,$90,$00 + $00,$00,$00,$00,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$f0,$81,$8f,$f8,$f3,$c7,$fc,$df + $f0,$e1,$a3,$f9,$f0,$81,$f8,$c7,$80,$98,$8f,$f8,$fc,$87,$82,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$85,$aa,$d0,$8a,$d4,$8a,$d4,$8a,$d4,$a0,$95,$a8 + $d5,$a2,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$d0,$88,$81,$00,$00,$00,$00,$81,$00,$00,$c0,$82,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$c0,$82,$a0,$00,$85,$94,$00 + $00,$00,$00,$c0,$82,$a4,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$c0,$aa,$d4,$ab,$d5,$ae,$dd,$ab,$f5,$ea,$dd + $aa,$d7,$ee,$dd,$aa,$d7,$ea,$dd,$aa,$d5,$aa,$dd,$aa,$d7,$aa,$95 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$00,$a0,$d0,$80,$d0,$80,$c0,$80,$c0,$a0,$81,$a0 + $c1,$8a,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$d0,$a8,$81,$00,$00,$00,$00,$81,$90,$00,$00,$00,$00,$00,$00 + $00,$00,$08,$10,$00,$00,$00,$00,$00,$00,$00,$00,$88,$00,$90,$00 + $00,$00,$00,$00,$04,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$c0,$aa,$f5,$ee,$dd,$ba,$f7,$ea,$dd,$bb,$f7,$8e,$c1 + $80,$f7,$ee,$dd,$bb,$81,$82,$99,$bb,$f7,$ee,$d5,$bb,$f7,$ee,$d5 + $aa,$95,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$a8,$81,$00,$00,$00,$00,$81,$90,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$88,$00,$90,$00 + $00,$00,$00,$00,$10,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$a8,$d5,$ee,$dd,$bb,$f7,$ee,$c5,$a2,$c4,$a2,$c5 + $8a,$e4,$ee,$dd,$a3,$d0,$a2,$c5,$a2,$c4,$e2,$dd,$bb,$f7,$ea,$dd + $ab,$81,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$c5,$a8,$d1,$a2,$c5,$88,$d1,$a2,$c4,$a8,$d1,$aa + $c5,$88,$d1,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$d0,$a2,$00,$00,$00,$00,$00,$81,$00,$00,$94,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$88,$00,$00,$00,$90,$00 + $00,$00,$00,$00,$10,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$aa,$d5,$ee,$dd,$bb,$f7,$a2,$c4,$aa,$d5,$aa,$d5 + $aa,$90,$a2,$c5,$88,$d4,$aa,$d5,$aa,$d5,$a2,$c4,$bb,$f7,$ee,$dd + $aa,$95,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$8a,$d5,$aa,$c4,$aa,$d5,$aa,$d5,$8a,$d5,$aa + $d4,$a8,$d5,$a2,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$00 + $20,$45,$00,$51,$22,$05,$00,$00,$00,$00,$00,$00,$00,$00,$90,$00 + $00,$00,$00,$00,$11,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$d5,$aa,$f5 + $ea,$dd,$bb,$f7,$ee,$dd,$bb,$f7,$ee,$c5,$aa,$d5,$e2,$dd,$bb,$f7 + $ee,$dd,$bb,$f7,$ee,$dd,$bb,$f7,$aa,$d5,$80,$80,$80,$a0,$80,$00 + $c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$80,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$00,$00,$80,$00 + $80,$80,$80,$80,$00,$00,$80,$80,$80,$80,$80,$80,$00,$00,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$c0,$aa,$f5 + $ee,$dd,$bb,$94,$8a,$c5,$bb,$f7,$ee,$9d,$aa,$d5,$ec,$dd,$bb,$f7 + $a2,$d1,$a8,$f6,$ee,$dd,$bb,$d5,$aa,$80,$80,$80,$80,$a0,$80,$00 + $c0,$28,$51,$00,$00,$00,$00,$00,$91,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$88,$81,$00,$91,$00 + $00,$00,$00,$c0,$a2,$a5,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$a0,$81,$80,$d0,$80,$85,$a8,$81 + $a0,$95,$88,$d0,$8a,$84,$a0,$85,$a0,$d1,$82,$90,$aa,$81,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$a5,$a5,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$08,$11,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$88,$a2,$90,$92,$00 + $00,$00,$00,$c0,$82,$a1,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$f0,$e7,$8c,$f8,$f3,$c7,$fc,$ff + $f2,$f9,$a3,$fd,$fc,$81,$f8,$d7,$f0,$81,$8f,$f9,$f0,$c7,$82,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$85,$aa,$d5,$8a,$d4,$8a,$d4,$8a,$d4,$aa,$95,$a8 + $d5,$aa,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$88,$81,$00,$00,$00,$00,$81,$00,$00,$90,$00,$00,$00,$81 + $00,$00,$00,$81,$00,$00,$00,$81,$00,$00,$88,$a0,$81,$00,$91,$00 + $00,$00,$00,$c0,$88,$a1,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$d4,$aa,$d5,$ae,$d5,$bb,$f5,$aa,$dd,$bb,$f7 + $ea,$dd,$bb,$d7,$ee,$dd,$aa,$f7,$aa,$dd,$ab,$f7,$ea,$dd,$aa,$95 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$80,$a0,$d0,$80,$d4,$a0,$d5,$a0,$c1,$a0,$81,$a8 + $c1,$88,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$a0,$00,$00,$00,$00,$00,$81,$90,$00,$00,$00,$c0,$00,$00 + $00,$00,$00,$81,$00,$00,$00,$00,$82,$00,$00,$00,$88,$00,$90,$00 + $00,$00,$00,$00,$05,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$aa,$d5,$bb,$d7,$ee,$dd,$bb,$f7,$ee,$9d,$80,$e5 + $c8,$dd,$bb,$f7,$ee,$91,$a3,$81,$ec,$c1,$bb,$f7,$ee,$dd,$bb,$d5 + $aa,$95,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$a0,$00,$00,$00,$00,$00,$81,$90,$00,$00,$a0,$00,$00,$00 + $00,$00,$00,$81,$00,$00,$00,$00,$00,$84,$00,$00,$88,$00,$90,$00 + $00,$00,$00,$00,$15,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$aa,$d5,$ba,$f7,$ee,$dd,$bb,$c7,$a2,$c4,$a2,$c5 + $8a,$c5,$bb,$f7,$a2,$d1,$a2,$c5,$a2,$c4,$b2,$f7,$ee,$dd,$bb,$f7 + $aa,$81,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d1,$aa,$d4,$a8,$d1,$a2,$c4,$a8,$d1,$a2,$c5,$8a + $95,$a2,$c4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$a2,$00,$00,$00,$00,$00,$81,$00,$00,$c0,$00,$00,$00,$00 + $00,$00,$00,$81,$00,$00,$00,$00,$00,$c0,$82,$00,$00,$00,$90,$00 + $00,$00,$00,$00,$15,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$aa,$d5,$bb,$f7,$ee,$dd,$a3,$d4,$aa,$d5,$aa,$d5 + $aa,$94,$a2,$c5,$a8,$d4,$aa,$d5,$aa,$d5,$aa,$e4,$ee,$dd,$bb,$f7 + $aa,$85,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$a2,$d4,$aa,$d1,$aa,$d5,$a8,$d1,$a2,$d4,$aa + $d1,$a2,$c4,$a8,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$30,$7e,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$00 + $20,$40,$00,$41,$20,$00,$00,$00,$00,$00,$00,$00,$00,$00,$90,$00 + $00,$00,$00,$00,$11,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$d5,$aa,$dd + $ab,$f7,$ee,$dd,$bb,$f7,$ee,$dd,$bb,$87,$aa,$d5,$b0,$f7,$ee,$dd + $bb,$f7,$ee,$dd,$bb,$f7,$ee,$dd,$aa,$d5,$80,$80,$80,$a0,$80,$00 + $c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$d0,$82,$80,$aa,$80,$a0,$80 + $a0,$81,$80,$d0,$80,$80,$80,$81,$80,$d4,$82,$c0,$80,$81,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$80,$aa,$dd + $bb,$f7,$ae,$84,$82,$e1,$ee,$dd,$bb,$97,$aa,$d5,$b8,$f7,$ee,$dd + $83,$c1,$a0,$dc,$bb,$f7,$ae,$d5,$8a,$80,$80,$80,$80,$a0,$80,$00 + $c0,$08,$10,$00,$00,$00,$00,$00,$85,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$a8,$00,$85,$95,$00 + $00,$00,$00,$c0,$a0,$a4,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$a0,$81,$80,$d0,$80,$85,$a8,$81 + $a0,$95,$88,$d0,$8a,$84,$a0,$85,$a0,$c1,$82,$90,$aa,$80,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$a5,$a5,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$08,$51,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$88,$00,$00,$90,$00 + $00,$00,$00,$c0,$88,$a1,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$c0,$ff,$8c,$f9,$7f,$c7,$fc,$ff + $f2,$f9,$a3,$fd,$fc,$81,$f8,$d7,$f2,$81,$8f,$f9,$f3,$c7,$82,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$80,$a0,$c0,$80,$c0,$80,$c0,$80,$c0,$80,$81,$80 + $81,$80,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$d0,$88,$81,$00,$00,$00,$00,$81,$00,$00,$85,$a2,$c4,$88,$91 + $a2,$c4,$88,$90,$a2,$c4,$88,$90,$a2,$c4,$a0,$81,$81,$85,$91,$00 + $00,$00,$00,$c0,$88,$a1,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$d5,$aa,$d5,$bb,$d5,$ee,$dd,$ab,$f7,$ee,$dd + $aa,$d7,$ee,$dd,$ba,$f7,$ee,$dd,$ab,$f5,$ae,$dd,$bb,$d7,$ae,$95 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$c0,$aa,$d0,$80,$d0,$a0,$d5,$a0,$c1,$a0,$81,$a0 + $c1,$88,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$a0,$00,$00,$00,$00,$00,$81,$84,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$a0,$00,$90,$00 + $00,$00,$00,$00,$04,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$aa,$d5,$ee,$dd,$ba,$f7,$ee,$dd,$83,$96,$82,$85 + $88,$f7,$ee,$dd,$bb,$91,$a0,$c1,$b8,$e0,$ee,$dd,$bb,$f7,$ee,$d5 + $aa,$d5,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$a0,$00,$00,$00,$00,$00,$81,$c0,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$8a,$00,$90,$00 + $00,$00,$00,$00,$01,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$c0,$aa,$d5,$ea,$dd,$bb,$f7,$ae,$c0,$a2,$c4,$a2,$d5 + $8a,$e5,$ee,$dd,$a3,$d1,$aa,$c5,$a2,$c4,$82,$dc,$bb,$f7,$ee,$dd + $aa,$81,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$c4,$aa,$d1,$a2,$d5,$a8,$d5,$a2,$c5,$a8,$d1,$aa + $c4,$aa,$95,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$d0,$a2,$00,$00,$00,$00,$00,$81,$00,$00,$00,$a8,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$94,$00,$00,$00,$00,$90,$00 + $00,$00,$00,$00,$10,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$a8,$d5,$ee,$dd,$bb,$f7,$a2,$d5,$aa,$d5,$aa,$d5 + $aa,$c5,$a2,$c5,$a2,$d5,$aa,$d5,$aa,$d5,$aa,$c5,$bb,$f7,$ee,$dd + $ab,$85,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$a2,$c4,$8a,$91,$a2,$d4,$88,$d1,$a2,$c4,$8a,$95,$a2 + $d4,$8a,$91,$a2,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$d0,$aa,$81,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$00 + $20,$41,$00,$41,$20,$01,$00,$00,$00,$00,$00,$00,$00,$00,$90,$00 + $00,$00,$00,$00,$15,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$d4,$aa,$f7 + $ee,$dd,$bb,$f7,$ee,$dd,$bb,$f7,$ee,$9d,$aa,$d5,$ec,$dd,$bb,$f7 + $ee,$dd,$bb,$f7,$ee,$dd,$bb,$f7,$aa,$95,$80,$80,$80,$a0,$80,$00 + $c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$d4,$82,$c0,$aa,$81,$a8,$81 + $a0,$91,$80,$d0,$88,$80,$80,$81,$80,$d5,$82,$d0,$a2,$85,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$80,$aa,$f5 + $ee,$dd,$bb,$84,$82,$d9,$bb,$f7,$ee,$9d,$aa,$d5,$ec,$dd,$bb,$f7 + $8e,$c1,$a0,$f6,$ee,$dd,$ab,$d5,$8a,$80,$80,$80,$80,$a0,$80,$00 + $c0,$28,$51,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$a8,$00,$00,$94,$00 + $00,$00,$00,$c0,$a2,$a4,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$a0,$c1,$82,$d0,$80,$85,$a8,$81 + $a0,$95,$88,$d0,$8a,$84,$a0,$85,$a0,$c5,$8a,$90,$88,$80,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$a5,$a5,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$28,$41,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$c0 + $a8,$c4,$a2,$95,$a2,$91,$82,$00,$00,$00,$00,$88,$00,$00,$90,$00 + $00,$00,$00,$c0,$8a,$a1,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$c0,$9f,$83,$e5,$ff,$d1,$fe,$ff + $f2,$99,$a8,$fd,$8c,$80,$ca,$d1,$c2,$ff,$83,$f9,$f3,$d7,$8a,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$00,$a0,$c0,$80,$c0,$80,$c0,$80,$c0,$80,$81,$80 + $81,$80,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$88,$81,$00,$00,$00,$00,$81,$00,$a0,$00,$00,$00,$a0,$00 + $00,$00,$00,$81,$00,$00,$00,$84,$00,$00,$00,$84,$85,$a0,$90,$00 + $00,$00,$00,$c0,$88,$a1,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$aa,$d5,$aa,$d5,$ee,$d5,$bb,$f7,$ea,$dd,$bb,$f7 + $ee,$dd,$ba,$f7,$ea,$dd,$bb,$f7,$ae,$dd,$ab,$f7,$ea,$dd,$ab,$85 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$c0,$aa,$d0,$a0,$d0,$a0,$d5,$a0,$c1,$a0,$c1,$a0 + $c1,$8a,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$a0,$00,$00,$00,$00,$00,$81,$c4,$88,$91,$a2,$c4,$88,$91 + $a2,$c4,$c8,$90,$a2,$c4,$88,$91,$a2,$c4,$88,$91,$82,$00,$90,$00 + $00,$00,$00,$00,$04,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$a8,$d5,$bb,$f7,$ea,$dd,$bb,$f7,$a2,$9c,$82,$85 + $ca,$dd,$bb,$f7,$ee,$d1,$a0,$c1,$ac,$c4,$bb,$f7,$ee,$dd,$bb,$d5 + $aa,$d5,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$a0,$00,$00,$00,$00,$00,$81,$c0,$00,$00,$88,$00,$00,$00 + $00,$00,$00,$81,$00,$00,$00,$00,$00,$90,$00,$00,$82,$00,$90,$00 + $00,$00,$00,$00,$15,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$c0,$aa,$d5,$aa,$f7,$ee,$dd,$bb,$c4,$a2,$c4,$aa,$d5 + $8a,$85,$b8,$97,$a0,$d1,$aa,$d5,$a2,$c4,$a2,$f6,$ee,$dd,$bb,$f7 + $aa,$95,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d1,$aa,$d4,$a8,$d1,$a2,$c5,$a8,$d1,$a2,$c5,$8a + $95,$aa,$c5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$a2,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$85,$00,$00 + $00,$00,$00,$81,$00,$00,$00,$00,$a8,$00,$00,$00,$00,$00,$90,$00 + $00,$00,$00,$00,$15,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$a8,$d5,$bb,$f7,$ee,$dd,$83,$d5,$aa,$d5,$aa,$d5 + $aa,$c5,$a8,$95,$a2,$d5,$aa,$d5,$aa,$d5,$aa,$e1,$ee,$dd,$bb,$f7 + $aa,$85,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$88,$d1,$a2,$d4,$88,$d5,$a2,$c4,$88,$d1,$a2,$d4,$88 + $d1,$a2,$c4,$a8,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$aa,$00,$00,$00,$00,$00,$85,$00,$00,$00,$00,$00,$00,$00 + $20,$40,$00,$41,$20,$00,$00,$00,$00,$00,$00,$00,$00,$00,$94,$00 + $00,$00,$00,$00,$10,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$d0,$aa,$dd + $bb,$f7,$ee,$81,$80,$80,$80,$80,$80,$80,$a0,$85,$80,$80,$80,$80 + $80,$80,$c0,$dd,$bb,$f7,$ee,$dd,$aa,$85,$80,$80,$80,$a0,$80,$00 + $c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$d5,$8a,$d0,$aa,$85,$a8,$81 + $a0,$d1,$80,$d0,$a8,$80,$a0,$85,$80,$95,$8a,$d0,$a2,$85,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$80,$a8,$d5 + $bb,$f7,$ae,$84,$82,$f1,$ee,$dd,$bb,$97,$aa,$d5,$b8,$f7,$ee,$dd + $8b,$c1,$a0,$dc,$bb,$f7,$ae,$d5,$8a,$80,$80,$80,$80,$a0,$80,$00 + $c0,$08,$40,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$a8,$00,$85,$94,$00 + $00,$00,$00,$00,$a2,$a5,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$b0,$d1,$8a,$d8,$80,$85,$ac,$81 + $f0,$95,$88,$f8,$8a,$84,$b0,$85,$80,$85,$8a,$98,$aa,$80,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$95,$a9,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$08,$51,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$85 + $02,$00,$00,$00,$00,$40,$88,$85,$00,$00,$00,$88,$00,$85,$90,$00 + $00,$04,$00,$c0,$82,$a1,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$9f,$a3,$95,$bf,$d5,$fa,$df + $c2,$81,$aa,$e5,$a8,$c1,$ea,$d5,$82,$fe,$a3,$e5,$c0,$d1,$8a,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$00,$a0,$c0,$80,$c0,$80,$c0,$80,$c0,$80,$81,$80 + $81,$80,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$a0,$00,$00,$00,$00,$00,$81,$00,$88,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$90,$d4,$aa,$95,$00 + $00,$04,$00,$c0,$82,$a4,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$aa,$f5,$aa,$d5,$ba,$d5,$ee,$dd,$bb,$f7,$ee,$dd + $bb,$d7,$ee,$dd,$ba,$f7,$ee,$dd,$bb,$f5,$ae,$dd,$bb,$d7,$ae,$d5 + $80,$84,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$c0,$aa,$d0,$a0,$d0,$a0,$c5,$a0,$c1,$a0,$c1,$a0 + $c1,$8a,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$d0,$a0,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$90,$83,$00,$00,$00,$00,$00,$00,$00,$00,$a0,$00,$90,$00 + $00,$00,$00,$00,$15,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$a0,$d5,$ee,$dd,$ba,$f7,$ee,$dd,$a3,$96,$8a,$85 + $8a,$f7,$ee,$dd,$bb,$d1,$a0,$d1,$b0,$e4,$ee,$dd,$bb,$f7,$ae,$d5 + $aa,$95,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$d0,$a0,$00,$00,$00,$00,$00,$81,$00,$8a,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$c0,$00,$00,$90,$00 + $00,$00,$00,$00,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$c0,$aa,$f5,$ae,$dd,$bb,$f7,$ae,$c4,$a2,$d5,$aa,$d5 + $aa,$85,$ec,$9d,$a0,$d5,$aa,$d5,$aa,$c5,$a2,$dc,$bb,$f7,$ee,$dd + $ab,$d5,$82,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d4,$8a,$d5,$aa,$d4,$a8,$d5,$a2,$c5,$a8,$d5,$aa + $d4,$88,$95,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$a2,$81,$00,$00,$00,$00,$81,$00,$00,$00,$00,$c0,$82,$00 + $00,$00,$00,$00,$00,$00,$00,$d0,$00,$00,$00,$00,$00,$00,$90,$00 + $00,$00,$00,$00,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$a0,$d5,$ee,$dd,$bb,$f7,$8e,$d5,$aa,$d5,$aa,$d5 + $aa,$d1,$a8,$95,$8a,$d5,$aa,$d5,$aa,$d5,$aa,$d9,$bb,$f7,$ee,$dd + $aa,$81,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$a2,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$90,$00,$00,$00,$00,$00,$00,$91,$00,$00,$00,$00,$00,$00,$00 + $20,$45,$0a,$41,$20,$05,$00,$00,$00,$00,$00,$00,$00,$00,$91,$00 + $00,$00,$00,$00,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$c0,$aa,$f7 + $ee,$dd,$bb,$d1,$aa,$d5,$aa,$d5,$aa,$d5,$82,$c1,$aa,$d5,$aa,$d5 + $aa,$d5,$8a,$f7,$ee,$dd,$bb,$f7,$aa,$85,$80,$80,$80,$a0,$80,$00 + $c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$95,$8a,$d0,$a2,$85,$a8,$81 + $a0,$d1,$80,$d0,$a8,$80,$a0,$85,$80,$81,$8a,$d0,$a0,$85,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$80,$a0,$d5 + $ee,$dd,$bb,$84,$82,$d9,$bb,$f7,$ee,$9d,$a8,$95,$ec,$dd,$bb,$f7 + $8e,$c1,$a0,$f6,$ee,$dd,$ab,$d5,$8a,$80,$80,$80,$80,$a0,$80,$00 + $c0,$08,$50,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$a8,$00,$00,$90,$44 + $08,$11,$22,$c0,$a2,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$b0,$c1,$8a,$d8,$80,$85,$ac,$81 + $f0,$95,$88,$f8,$8a,$84,$b0,$85,$80,$95,$8a,$98,$aa,$81,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$95,$a9,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$00,$00,$00,$00,$00,$81,$00,$00,$00,$00,$90,$8a,$90 + $00,$00,$00,$81,$00,$00,$88,$c0,$82,$00,$00,$88,$00,$00,$90,$00 + $22,$44,$08,$c0,$88,$a5,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$00,$a0,$95,$a8,$d5,$aa,$d5,$aa,$d5 + $8a,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$82,$d5,$a0,$d5,$aa,$dd,$aa,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d0,$aa,$c5,$aa,$d5,$a0,$d1,$a0,$d5,$8a + $c1,$8a,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$10,$08,$04,$02,$41,$81,$00,$82,$00,$00,$00,$88,$00 + $00,$40,$00,$81,$02,$00,$00,$90,$00,$00,$00,$c0,$00,$00,$90,$00 + $22,$44,$08,$00,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$c0,$aa,$dd,$ab,$d5,$ee,$dd,$ba,$f7,$ee,$dd,$bb,$f7 + $ee,$dd,$bb,$d7,$ee,$dd,$bb,$f7,$ae,$dd,$bb,$f5,$ee,$dd,$bb,$d5 + $82,$85,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$c0,$aa,$d0,$a0,$c1,$80,$c0,$a0,$c1,$a0,$c1,$82 + $c1,$8a,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$10,$20,$40,$00,$01,$81,$84,$00,$00,$00,$84,$00,$00 + $00,$00,$60,$0f,$00,$00,$00,$00,$a0,$00,$00,$00,$00,$00,$90,$00 + $00,$00,$00,$00,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$d5,$bb,$f7,$ee,$dd,$bb,$f7,$a2,$80,$8a,$85 + $ca,$dd,$bb,$f7,$ee,$d1,$a0,$d1,$80,$c4,$bb,$f7,$ee,$dd,$ab,$d5 + $ae,$85,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$10,$08,$04,$02,$01,$81,$00,$88,$91,$a2,$c4,$88,$91 + $a2,$c4,$88,$91,$a2,$c4,$88,$91,$a2,$c4,$88,$91,$00,$00,$90,$00 + $00,$00,$00,$00,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$aa,$d5,$bb,$f7,$ee,$dd,$bb,$c4,$a2,$d5,$aa,$d5 + $aa,$c1,$88,$90,$82,$d5,$aa,$d5,$aa,$c5,$a2,$f6,$ee,$dd,$bb,$f7 + $aa,$d5,$82,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$8a,$d1,$aa,$d4,$a8,$d1,$a2,$d5,$a8,$d1,$a2,$c5,$88 + $95,$aa,$c4,$a8,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$10,$08,$10,$20,$00,$81,$00,$00,$00,$00,$00,$a0,$91 + $00,$00,$00,$81,$00,$00,$a2,$81,$00,$00,$00,$00,$00,$00,$90,$00 + $00,$00,$00,$00,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$d5,$bb,$f7,$ee,$dd,$8b,$d4,$aa,$d5,$aa,$d5 + $aa,$d1,$aa,$d5,$8a,$d5,$aa,$d5,$aa,$d5,$aa,$f0,$ee,$dd,$ba,$d7 + $aa,$81,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$8a,$d5,$a2,$d5,$a2,$d5,$aa,$d4,$8a,$d5,$8a,$d5,$8a + $d5,$aa,$d5,$88,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$00,$00,$00,$00,$00,$c1,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$a0,$90,$00 + $00,$00,$00,$00,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$80,$aa,$dd + $bb,$f7,$ee,$d1,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5 + $aa,$d5,$ca,$dd,$bb,$f7,$ee,$dd,$aa,$85,$80,$80,$80,$a0,$80,$00 + $c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$a0,$85,$88,$d0,$a2,$85,$a8,$81 + $a0,$d1,$82,$d0,$a8,$81,$a0,$85,$a0,$91,$88,$d0,$a8,$85,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$80,$80,$80,$80,$80,$a0,$d5 + $ba,$f7,$ae,$84,$82,$f1,$ee,$dd,$bb,$f7,$a8,$95,$bb,$f7,$ee,$dd + $8b,$c1,$a0,$dc,$bb,$f7,$aa,$d5,$82,$80,$80,$80,$80,$a0,$80,$00 + $c0,$00,$00,$50,$2a,$55,$2a,$55,$81,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$88,$00,$85,$90,$55 + $2a,$55,$2a,$05,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$80,$b0,$81,$8b,$d8,$c0,$85,$bc,$81 + $f0,$9f,$8a,$f8,$8f,$85,$70,$c5,$80,$9e,$8a,$f8,$ac,$81,$80,$80 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$95,$a9,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$50,$2a,$55,$2a,$55,$81,$00,$00,$00,$00,$85,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$a0,$81,$00,$a8,$00,$85,$90,$55 + $2a,$55,$2a,$05,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$80,$80,$d4,$aa,$d5,$ae,$d5,$aa,$f5,$aa,$dd + $aa,$d5,$aa,$d5,$aa,$d5,$ea,$d5,$8a,$d5,$aa,$dd,$aa,$d7,$aa,$81 + $80,$80,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d0,$aa,$c5,$aa,$d5,$a0,$d1,$a0,$d5,$8a + $c1,$8a,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$50,$2a,$55,$2a,$55,$81,$c0,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$82,$00,$90,$55 + $2a,$55,$2a,$05,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$d0,$aa,$f7,$ae,$d5,$ba,$f7,$ea,$dd,$bb,$f7,$ae,$dc + $bb,$d7,$ee,$dd,$bb,$f7,$ee,$dd,$bb,$f7,$ee,$d5,$bb,$f7,$ae,$d5 + $aa,$85,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$c0,$a0,$d4,$a0,$c1,$80,$c0,$a0,$c1,$a8,$c1,$82 + $81,$00,$d4,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$50,$2a,$55,$2a,$55,$81,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$a0,$00,$90,$55 + $2a,$55,$2a,$05,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$d5,$ee,$dd,$bb,$f7,$ee,$85,$a0,$c0,$8a,$c5 + $8a,$e0,$ee,$dd,$83,$d0,$a2,$d1,$82,$84,$e0,$dd,$bb,$f7,$ae,$d5 + $ab,$85,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$50,$2a,$55,$2a,$55,$81,$00,$a0,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$84,$00,$00,$90,$55 + $2a,$55,$2a,$05,$00,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$aa,$d5,$ee,$dd,$bb,$f7,$ae,$c4,$a2,$d5,$aa,$d5 + $aa,$d1,$8c,$99,$8a,$d5,$aa,$d5,$aa,$c5,$a2,$dc,$bb,$f7,$ee,$dd + $ab,$d5,$82,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$c4,$88,$95,$a2,$d4,$88,$d1,$a2,$c4,$8a,$95,$a2 + $d4,$a8,$95,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$00,$00,$50,$2a,$55,$2a,$55,$81,$00,$00,$00,$00,$00,$00,$00 + $8a,$d1,$88,$c5,$a8,$c4,$00,$00,$00,$00,$00,$00,$00,$00,$90,$55 + $2a,$55,$2a,$05,$01,$a0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $c0,$80,$80,$80,$80,$d5,$ee,$dd,$bb,$f7,$ae,$d4,$aa,$d5,$aa,$d5 + $aa,$d1,$aa,$d5,$8a,$d5,$aa,$d5,$aa,$d5,$aa,$dc,$bb,$f7,$ea,$d5 + $aa,$85,$80,$80,$80,$a0,$80,$00,$c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$80,$00 + $c0,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa,$d5,$aa + $d5,$aa,$d5,$aa,$d5,$aa,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 ; ; Original game entry point. ; 4000: 4c 6d 45 OriginalEntry jmp EarlyInit ; ; Three 256-byte tables, used to compute multiplication and division. ; 4003: 08 00 20 32+ math_table1 .bulk $08,$00,$20,$32,$40,$4a,$52,$59,$60,$65,$6a,$6e,$72,$76,$79,$7d + $80,$82,$85,$87,$8a,$8c,$8e,$90,$92,$94,$96,$98,$99,$9b,$9d,$9e + $a0,$a1,$a2,$a4,$a5,$a6,$a7,$a9,$aa,$ab,$ac,$ad,$ae,$af,$b0,$b1 + $b2,$b3,$b4,$b5,$b6,$b7,$b8,$b9,$b9,$ba,$bb,$bc,$bd,$bd,$be,$bf + $c0,$c0,$c1,$c2,$c2,$c3,$c4,$c4,$c5,$c6,$c6,$c7,$c7,$c8,$c9,$c9 + $ca,$ca,$cb,$cc,$cc,$cd,$cd,$ce,$ce,$cf,$cf,$d0,$d0,$d1,$d1,$d2 + $d2,$d3,$d3,$d4,$d4,$d5,$d5,$d5,$d6,$d6,$d7,$d7,$d8,$d8,$d9,$d9 + $d9,$da,$da,$db,$db,$db,$dc,$dc,$dd,$dd,$dd,$de,$de,$de,$df,$df + $e0,$e0,$e0,$e1,$e1,$e1,$e2,$e2,$e2,$e3,$e3,$e3,$e4,$e4,$e4,$e5 + $e5,$e5,$e6,$e6,$e6,$e7,$e7,$e7,$e7,$e8,$e8,$e8,$e9,$e9,$e9,$ea + $ea,$ea,$ea,$eb,$eb,$eb,$ec,$ec,$ec,$ec,$ed,$ed,$ed,$ed,$ee,$ee + $ee,$ee,$ef,$ef,$ef,$ef,$f0,$f0,$f0,$f1,$f1,$f1,$f1,$f1,$f2,$f2 + $f2,$f2,$f3,$f3,$f3,$f3,$f4,$f4,$f4,$f4,$f5,$f5,$f5,$f5,$f5,$f6 + $f6,$f6,$f6,$f7,$f7,$f7,$f7,$f7,$f8,$f8,$f8,$f8,$f9,$f9,$f9,$f9 + $f9,$fa,$fa,$fa,$fa,$fa,$fb,$fb,$fb,$fb,$fb,$fc,$fc,$fc,$fc,$fc + $fd,$fd,$fd,$fd,$fd,$fd,$fe,$fe,$fe,$fe,$fe,$ff,$ff,$ff,$ff,$ff 4103: 03 00 00 b8+ math_table2 .bulk $03,$00,$00,$b8,$00,$4d,$b8,$d6,$00,$70,$4d,$b4,$b8,$6a,$d6,$05 + $00,$cc,$70,$ef,$4d,$8e,$b4,$c1,$b8,$9a,$6a,$28,$d6,$75,$05,$89 + $00,$6c,$cc,$23,$70,$b4,$ef,$22,$4d,$71,$8e,$a4,$b4,$bd,$c1,$bf + $b8,$ac,$9a,$85,$6a,$4b,$28,$01,$d6,$a7,$75,$3f,$05,$c9,$89,$46 + $00,$b7,$6c,$1d,$cc,$79,$23,$cb,$70,$13,$b4,$52,$ef,$8a,$22,$b9 + $4d,$e0,$71,$00,$8e,$1a,$a4,$2d,$b4,$39,$bd,$40,$c1,$41,$bf,$3c + $b8,$32,$ac,$24,$9a,$10,$85,$f8,$6a,$db,$4b,$ba,$28,$95,$01,$6c + $d6,$3f,$a7,$0e,$75,$da,$3f,$a2,$05,$67,$c9,$29,$89,$e8,$46,$a3 + $00,$5c,$b7,$12,$6c,$c5,$1d,$75,$cc,$23,$79,$ce,$23,$77,$cb,$1e + $70,$c2,$13,$64,$b4,$03,$52,$a1,$ef,$3d,$8a,$d6,$22,$6e,$b9,$03 + $4d,$97,$e0,$29,$71,$b9,$00,$47,$8e,$d4,$1a,$5f,$a4,$e8,$2d,$70 + $b4,$f7,$39,$7b,$bd,$ff,$40,$81,$c1,$01,$41,$80,$bf,$fe,$3c,$7a + $b8,$f5,$32,$6f,$ac,$e8,$24,$5f,$9a,$d5,$10,$4a,$85,$be,$f8,$31 + $6a,$a3,$db,$13,$4b,$83,$ba,$f1,$28,$5f,$95,$cb,$01,$36,$6c,$a1 + $d6,$0a,$3f,$73,$a7,$db,$0e,$42,$75,$a7,$da,$0c,$3f,$71,$a2,$d4 + $05,$36,$67,$98,$c9,$f9,$29,$59,$89,$b8,$e8,$17,$46,$75,$a3,$d2 4203: 01 01 01 01+ math_table3 .bulk $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01 + $01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01 + $02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02,$02 + $02,$02,$02,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03,$03 + $04,$04,$04,$04,$04,$04,$04,$04,$04,$04,$04,$05,$05,$05,$05,$05 + $05,$05,$05,$06,$06,$06,$06,$06,$06,$06,$07,$07,$07,$07,$07,$07 + $08,$08,$08,$08,$08,$08,$09,$09,$09,$09,$09,$0a,$0a,$0a,$0a,$0b + $0b,$0b,$0b,$0c,$0c,$0c,$0c,$0d,$0d,$0d,$0e,$0e,$0e,$0e,$0f,$0f + $10,$10,$10,$11,$11,$11,$12,$12,$13,$13,$13,$14,$14,$15,$15,$16 + $16,$17,$17,$18,$18,$19,$19,$1a,$1a,$1b,$1c,$1c,$1d,$1d,$1e,$1f + $20,$20,$21,$22,$22,$23,$24,$25,$26,$26,$27,$28,$29,$2a,$2b,$2c + $2d,$2e,$2f,$30,$31,$32,$33,$34,$35,$36,$38,$39,$3a,$3b,$3d,$3e + $40,$41,$42,$44,$45,$47,$48,$4a,$4c,$4d,$4f,$51,$52,$54,$56,$58 + $5a,$5c,$5e,$60,$62,$64,$67,$69,$6b,$6d,$70,$72,$75,$77,$7a,$7d + $80,$82,$85,$88,$8b,$8e,$91,$94,$98,$9b,$9e,$a2,$a5,$a9,$ad,$b1 + $b5,$b8,$bd,$c1,$c5,$c9,$ce,$d2,$d7,$db,$e0,$e5,$ea,$ef,$f5,$fa 4303: 01 02 03 04+ mod7_table .bulk $01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02 + $03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04 + $05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06 + $00,$01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01 + $02,$03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02,$03 + $04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04,$05 + $06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00 + $01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02 + $03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04 + $05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06 + $00,$01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01 + $02,$03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02,$03 + $04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04,$05 + $06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00 + $01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02 + $03,$04,$05,$06,$00,$01,$02,$03,$04,$05,$06,$00,$01,$02,$03,$04 4403: 01 01 01 01+ div7_table .bulk $01,$01,$01,$01,$01,$01,$02,$02,$02,$02,$02,$02,$02,$03,$03,$03 + $03,$03,$03,$03,$04,$04,$04,$04,$04,$04,$04,$05,$05,$05,$05,$05 + $05,$05,$06,$06,$06,$06,$06,$06,$06,$07,$07,$07,$07,$07,$07,$07 + $08,$08,$08,$08,$08,$08,$08,$09,$09,$09,$09,$09,$09,$09,$0a,$0a + $0a,$0a,$0a,$0a,$0a,$0b,$0b,$0b,$0b,$0b,$0b,$0b,$0c,$0c,$0c,$0c + $0c,$0c,$0c,$0d,$0d,$0d,$0d,$0d,$0d,$0d,$0e,$0e,$0e,$0e,$0e,$0e + $0e,$0f,$0f,$0f,$0f,$0f,$0f,$0f,$10,$10,$10,$10,$10,$10,$10,$11 + $11,$11,$11,$11,$11,$11,$12,$12,$12,$12,$12,$12,$12,$13,$13,$13 + $13,$13,$13,$13,$14,$14,$14,$14,$14,$14,$14,$15,$15,$15,$15,$15 + $15,$15,$16,$16,$16,$16,$16,$16,$16,$17,$17,$17,$17,$17,$17,$17 + $18,$18,$18,$18,$18,$18,$18,$19,$19,$19,$19,$19,$19,$19,$1a,$1a + $1a,$1a,$1a,$1a,$1a,$1b,$1b,$1b,$1b,$1b,$1b,$1b,$1c,$1c,$1c,$1c + $1c,$1c,$1c,$1d,$1d,$1d,$1d,$1d,$1d,$1d,$1e,$1e,$1e,$1e,$1e,$1e + $1e,$1f,$1f,$1f,$1f,$1f,$1f,$1f,$20,$20,$20,$20,$20,$20,$20,$21 + $21,$21,$21,$21,$21,$21,$22,$22,$22,$22,$22,$22,$22,$23,$23,$23 + $23,$23,$23,$23,$24,$24,$24,$24,$24,$24,$24,$25,$25,$25,$25,$25 ; ; For custom RWTS: convert 6-bit value to 8-bit disk byte. ; 4503: 96 97 9a 9b+ rwts_encode62 .bulk $96,$97,$9a,$9b,$9d,$9e,$9f,$a6,$a7,$ab,$ac,$ad,$ae,$af,$b2,$b3 + $b4,$b5,$b6,$b7,$b9,$ba,$bb,$bc,$bd,$be,$bf,$cb,$cd,$ce,$cf,$d3 + $d6,$d7,$d9,$da,$db,$dc,$dd,$de,$df,$e5,$e6,$e7,$e9,$ea,$eb,$ec + $ed,$ee,$ef,$f2,$f3,$f4,$f5,$f6,$f7,$f9,$fa,$fb,$fc,$fd,$fe,$ff 4543: 00 00 00 00+ L4543 .fill 14,$00 ;? (read/write) 4551: 00 00 00 00+ color_indices .fill 6,$00 ; sound_disab_flag 4557: 00 .dd1 $00 ;bool 00/ff: is sound disabled? ; ; Game settings toggled during pause mode. ; ptb_kbd_dampening 4558: 00 .dd1 $00 ;bool 00/ff: pause 'D': keyboard dampening enabled? 4559: 00 ptb_kbd_recent .dd1 $00 ;bool 00/ff: pause 'A': disable recentering 455a: 00 ptb_pausecmd_x? .dd1 $00 ;bool 00/ff: pause 'X': ? odd things 455b: 00 ptb_kbd_flash .dd1 $00 ;bool 00/ff: pause 'F': flash hostiles on radar 455c: 00 ptb_joy_y_flip .dd1 $00 ;bool 00/ff: pause 'Y': joy y_axis flipped? ptb_joy_axis_flip 455d: 00 .dd1 $00 ;bool 00/ff: pause 'J': joy both axes flipped? 455e: 00 ptb_joy_enab .dd1 $00 ;bool 00/ff: pause 'K': joystick enabled? 455f: 00 ptb_lower_case .dd1 $00 ;bool 00/ff: pause 'U': lower-case allowed? 4560: 00 ptb_pausecmd_t .dd1 $00 ;bool 00/ff: pause 'T': disk vs. tape (not for A2) ; 4561: 00 unused_thing1 .dd1 $00 ;written twice, never read joystick_found_nr 4562: 0b .dd1 $0b ;set to $FF if paddles exist by unref'd SEC3 code ; ; Key commands. These map 1:1 with the state toggles above, starting at $4558. ; 4563: 44 pause_key_cmds .dd1 ‘D’ 4564: 41 .dd1 ‘A’ 4565: 58 .dd1 ‘X’ 4566: 46 .dd1 ‘F’ 4567: 59 .dd1 ‘Y’ 4568: 4a .dd1 ‘J’ 4569: 4b .dd1 ‘K’ 456a: 55 .dd1 ‘U’ 456b: 54 .dd1 ‘T’ 456c: 60 .junk 1 ;unused ; ; Early initialization, no longer needed. ; • Clear variables ]src_ptr .var $0a {addr/2} ]dst_ptr .var $31 {addr/2} ]XX12 .var $74 {addr/6} ]des_sub .var $d0 {addr/1} 456d: a9 00 EarlyInit lda #$00 ;copy SCRN from $200-9ff to $2000-27ff 456f: 85 0a sta ]src_ptr 4571: a9 02 lda #$02 4573: 85 0b sta ]src_ptr+1 4575: a9 00 lda #$00 4577: 85 31 sta ]dst_ptr 4579: a9 20 lda #$20 457b: 85 32 sta ]dst_ptr+1 457d: a2 07 ldx #$07 457f: a0 00 ldy #$00 4581: b1 0a L4581 lda (]src_ptr),y 4583: 91 31 sta (]dst_ptr),y 4585: c8 iny 4586: d0 f9 bne L4581 4588: e6 0b inc ]src_ptr+1 458a: e6 32 inc ]dst_ptr+1 458c: ca dex 458d: 10 f2 bpl L4581 458f: 20 9f 45 jsr Descramble ;descramble the code NOTE: START HERE ; ; Start here to bypass the no-longer-needed copy of SCRN and the descrambler. ; (The original start is $4000.) ; 4592: a9 30 NewEntry lda #$30 ;late patch to joystick code? 4594: 8d 42 83 sta _set_by_init+1 4597: ea nop 4598: ea nop 4599: 20 0f 96 jsr InitSystem 459c: 4c b9 7e jmp InitGame ; ; Most of the code is scrambled when loaded from disk. This de-scrambles it. ; 459f: a9 e9 Descramble lda #$e9 ;check for end when Y=E9 45a1: 8d 41 02 sta PLAYER_STATE? ; so last byte we tweak is $xxEA 45a4: a9 45 lda #$45 ;stop when we hit $45E9 45a6: 8d 42 02 sta PLAYER_STATE?+1 45a9: a9 bf lda #$bf ;first byte is $BFFE 45ab: a0 fe ldy #$fe 45ad: a2 15 ldx #$15 ;initial sub value 45af: 20 c2 45 jsr :DoDescram 45b2: a9 5f lda #$5f 45b4: 8d 41 02 sta PLAYER_STATE? 45b7: a9 0b lda #$0b ;stop when we hit $B5F 45b9: 8d 42 02 sta PLAYER_STATE?+1 45bc: a9 1f lda #$1f ;start at $1FFF 45be: a0 ff ldy #$ff 45c0: a2 69 ldx #$69 ;initial value 45c2: 86 d0 :DoDescram stx ]des_sub 45c4: 85 0b sta ]src_ptr+1 45c6: a9 00 lda #$00 45c8: 85 0a sta ]src_ptr 45ca: b1 0a :DesLoop lda (]src_ptr),y ;get old value 45cc: 38 sec 45cd: e5 d0 sbc ]des_sub ;subtract rolling sub 45cf: 91 0a sta (]src_ptr),y ;store it 45d1: 85 d0 sta ]des_sub ;update rolling sub 45d3: 98 tya ;Y == 0? 45d4: d0 02 bne :NoDec ;not yet 45d6: c6 0b dec ]src_ptr+1 ;yes, dec high byte 45d8: 88 :NoDec dey ;advance 45d9: cc 41 02 cpy PLAYER_STATE? ;do we need to check for done? 45dc: d0 ec bne :DesLoop ;not here 45de: a5 0b lda ]src_ptr+1 ;check the ptr high byte 45e0: cd 42 02 cmp PLAYER_STATE?+1 ;reached the end? 45e3: d0 e5 bne :DesLoop ;not yet 45e5: 60 rts 45e6: b7 aa 45 23 .junk 4 45ea: 20 c4 7a GOIN jsr RES2 ;BBC .GOIN 45ed: 20 41 5d jsr DrawOctagonRings 45f0: a9 00 lda #$00 45f2: 85 a9 sta player_speed 45f4: 8d 74 02 sta player_laser_temp 45f7: 85 69 sta $69 45f9: a9 ff lda #$ff 45fb: 85 d4 sta $d4 45fd: 85 d5 sta $d5 45ff: 85 d6 sta $d6 4601: a0 2c ldy #$2c 4603: 20 96 63 jsr LongDelay 4606: ad 8f 02 lda $028f 4609: 29 03 and #$03 460b: d0 0e bne L461B 460d: ad d7 02 lda kill_score+1 4610: f0 54 beq L4666 4612: ad 9e 02 lda ship_state2? 4615: 4a lsr A 4616: d0 4e bne L4666 4618: 4c fa 62 jmp L62FA 461b: c9 03 L461B cmp #$03 461d: d0 03 bne L4622 461f: 4c e9 62 jmp L62E9 4622: ad 9e 02 L4622 lda ship_state2? 4625: c9 02 cmp #$02 4627: d0 3d bne L4666 4629: ad 8f 02 lda $028f 462c: 29 0f and #$0f 462e: c9 02 cmp #$02 4630: d0 0a bne L463C 4632: ad d7 02 lda kill_score+1 4635: c9 05 cmp #$05 4637: 90 2d bcc L4666 4639: 4c b7 62 jmp L62B7 463c: c9 06 L463C cmp #$06 463e: d0 11 bne L4651 4640: ad 90 02 lda $0290 4643: c9 d7 cmp #$d7 4645: d0 1f bne L4666 4647: ad 91 02 lda $0291 464a: c9 54 cmp #$54 464c: d0 18 bne L4666 464e: 4c c7 62 jmp L62C7 4651: c9 0a L4651 cmp #$0a 4653: d0 11 bne L4666 4655: ad 90 02 lda $0290 4658: c9 3f cmp #$3f 465a: d0 0a bne L4666 465c: ad 91 02 lda $0291 465f: c9 48 cmp #$48 4661: d0 03 bne L4666 4663: 4c d5 62 jmp L62D5 4666: 4c 2d 7f L4666 jmp L7F2D 4669: a9 28 78 8d+ .junk 25 ;unreferenced code? ; ; Updates pitch / roll. ; UpdateShipControls 4682: ad 00 08 lda data_buffer 4685: 85 02 sta rng_state 4687: a6 d1 ldx roll_velocity 4689: 20 da 61 jsr L61DA 468c: 20 da 61 jsr L61DA 468f: 8a txa 4690: 49 80 eor #$80 4692: a8 tay 4693: 29 80 and #$80 4695: 85 6c sta $6c 4697: 86 d1 stx roll_velocity 4699: 49 80 eor #$80 469b: 85 6d sta $6d 469d: 98 tya 469e: 10 05 bpl L46A5 46a0: 49 ff eor #$ff 46a2: 18 clc 46a3: 69 01 adc #$01 46a5: 4a L46A5 lsr A 46a6: 4a lsr A 46a7: c9 08 cmp #$08 46a9: b0 01 bcs L46AC 46ab: 4a lsr A 46ac: 85 6b L46AC sta $6b 46ae: 05 6c ora $6c 46b0: 85 b9 sta $b9 46b2: a6 d2 ldx pitch_velocity 46b4: 20 da 61 jsr L61DA 46b7: 8a txa 46b8: 49 80 eor #$80 46ba: a8 tay 46bb: 29 80 and #$80 46bd: 86 d2 stx pitch_velocity 46bf: 85 a8 sta $a8 46c1: 49 80 eor #$80 46c3: 85 a7 sta $a7 46c5: 98 tya 46c6: 10 02 bpl L46CA 46c8: 49 ff eor #$ff NOTE: C64 $1f15 (code_1D81.asm) 46ca: 69 04 L46CA adc #$04 46cc: 4a lsr A 46cd: 4a lsr A 46ce: 4a lsr A 46cf: 4a lsr A 46d0: c9 03 cmp #$03 46d2: b0 01 bcs L46D5 46d4: 4a lsr A 46d5: 85 67 L46D5 sta $67 46d7: 05 a7 ora $a7 46d9: 85 66 sta $66 46db: a5 82 lda cmd_throttle_up 46dd: f0 08 beq :NotThrotUp 46df: a5 a9 lda player_speed 46e1: c9 28 cmp #$28 46e3: b0 02 bcs :NotThrotUp 46e5: e6 a9 inc player_speed 46e7: a5 81 :NotThrotUp lda cmd_throttle_down 46e9: f0 06 beq :NotThrotDn 46eb: c6 a9 dec player_speed 46ed: d0 02 bne :NotThrotDn 46ef: e6 a9 inc player_speed 46f1: a5 8b :NotThrotDn lda cmd_unarm_mssl 46f3: 2d c2 02 and missile_armed_flag? 46f6: f0 0d beq :NotUnarmMsl 46f8: a0 08 ldy #$08 46fa: 20 e6 75 jsr L75E6 46fd: 20 52 95 jsr Noise1? 4700: a9 00 lda #$00 4702: 8d 71 02 sta PLAYER_STATE?+48 4705: a5 7f :NotUnarmMsl lda missile_thing? 4707: 10 11 bpl :NotTargMsl 4709: a5 8a lda cmd_targ_mssl 470b: f0 0d beq :NotTargMsl 470d: ae c2 02 ldx missile_armed_flag? 4710: f0 08 beq :NotTargMsl 4712: 8d 71 02 sta PLAYER_STATE?+48 4715: a0 0c ldy #$0c 4717: 20 35 a0 jsr DrawIndicator? 471a: a5 8c :NotTargMsl lda cmd_fire_mssl 471c: f0 07 beq :NotFireMsl 471e: a5 7f lda missile_thing? 4720: 30 44 bmi :NotEcm 4722: 20 3a 5c jsr L5C3A 4725: a5 88 :NotFireMsl lda cmd_energy_bomb 4727: f0 0d beq :NoBomb 4729: ad b9 02 lda have_energy_bomb 472c: 30 08 bmi :NoBomb 472e: 0e b9 02 asl have_energy_bomb 4731: f0 03 beq :NoBomb 4733: 20 0c 4b jsr DetonateBomb? 4736: a5 90 :NoBomb lda cmd_dock_off 4738: f0 05 beq :NotDockOff 473a: a9 00 lda #$00 473c: 8d 6c 02 sta computer_dock_flag 473f: a5 89 :NotDockOff lda cmd_escape_cap ;trying to eject? 4741: 2d bd 02 and have_escape_pod ;...with the appropriate equipment? 4744: f0 08 beq :InWitch ;nope 4746: ad 6e 02 lda witch_space_flag ;are we in witch space? 4749: d0 03 bne :InWitch ;yes, no escape 474b: 4c 24 57 jmp EjectEscape 474e: a5 8e :InWitch lda cmd_local_jump ;check 'J' key 4750: f0 03 beq :NotJump 4752: 20 8f 83 jsr LocalJump 4755: a5 8d :NotJump lda cmd_ecm ;check 'E' key 4757: 2d b7 02 and have_ecm ;do we have an ECM? 475a: f0 0a beq :NotEcm ;no 475c: a5 6a lda ecm_active_flag? ;any ECM active? 475e: d0 06 bne :NotEcm ;yes 4760: ce 6d 02 dec player_ecm_active? 4763: 20 0f a0 jsr ActivateEcm 4766: a5 8f :NotEcm lda cmd_dock_on ;check 'C' key 4768: 2d bb 02 and have_docking_comp 476b: f0 03 beq L4770 476d: 8d 6c 02 sta computer_dock_flag 4770: a9 00 L4770 lda #$00 4772: 85 7e sta $7e 4774: 85 aa sta $aa 4776: a5 a9 lda player_speed 4778: 4a lsr A 4779: 66 aa ror $aa 477b: 4a lsr A 477c: 66 aa ror $aa 477e: 85 ab sta $ab 4780: ad 73 02 lda main_dec2_thing? 4783: d0 2b bne L47B0 4785: a5 87 lda cmd_fire_laser 4787: f0 27 beq L47B0 4789: ad 74 02 lda player_laser_temp 478c: c9 f2 cmp #$f2 478e: b0 20 bcs L47B0 4790: ae 72 02 ldx PLAYER_STATE?+49 4793: bd 9f 02 lda $029f,x 4796: f0 18 beq L47B0 4798: 48 pha 4799: 29 7f and #$7f 479b: 85 7e sta $7e 479d: 8d 70 02 sta PLAYER_STATE?+47 47a0: 20 c7 95 jsr MakeNoise5? 47a3: 20 17 62 jsr L6217 47a6: 68 pla 47a7: 10 02 bpl L47AB 47a9: a9 00 lda #$00 47ab: 29 fa L47AB and #$fa 47ad: 8d 73 02 sta main_dec2_thing? 47b0: a2 00 L47B0 ldx #$00 47b2: 86 b0 L47B2 stx $b0 47b4: bd 41 02 lda PLAYER_STATE?,x 47b7: d0 03 bne L47BC 47b9: 4c 7a 49 jmp L497A 47bc: 85 b8 L47BC sta $b8 47be: 20 7d 63 jsr GetInfo 47c1: a0 24 ldy #$24 47c3: b1 5c L47C3 lda (polyobj_ptr),y 47c5: 99 0c 00 sta polyobj_xpos_lo,y 47c8: 88 dey 47c9: 10 f8 bpl L47C3 47cb: a5 b8 lda $b8 47cd: 30 2d bmi L47FC 47cf: 0a asl A 47d0: a8 tay 47d1: b9 fe a2 lda hull_addr_lo,y 47d4: 85 5a sta hull_ptr 47d6: b9 ff a2 lda hull_addr_hi,y 47d9: 85 5b sta hull_ptr+1 47db: ad b9 02 lda have_energy_bomb 47de: 10 1c bpl L47FC 47e0: c0 04 cpy #$04 47e2: f0 18 beq L47FC 47e4: c0 3a cpy #$3a 47e6: f0 14 beq L47FC 47e8: c0 3e cpy #$3e 47ea: b0 10 bcs L47FC 47ec: a5 2b lda polyobj_vis 47ee: 29 20 and #$20 47f0: d0 0a bne L47FC 47f2: 06 2b asl polyobj_vis 47f4: 38 sec 47f5: 66 2b ror polyobj_vis 47f7: a6 b8 ldx $b8 47f9: 20 2d 95 jsr CountKill 47fc: 20 5e 90 L47FC jsr MVEIT 47ff: a0 24 ldy #$24 4801: b9 0c 00 L4801 lda polyobj_xpos_lo,y 4804: 91 5c sta (polyobj_ptr),y 4806: 88 dey 4807: 10 f8 bpl L4801 4809: a5 2b lda polyobj_vis 480b: 29 a0 and #$a0 480d: 20 20 7e jsr L7E20 4810: d0 51 bne L4863 4812: a5 0c lda polyobj_xpos_lo 4814: 05 0f ora polyobj_ypos_lo 4816: 05 12 ora polyobj_zpos_lo 4818: 30 49 bmi L4863 481a: a6 b8 ldx $b8 481c: 30 45 bmi L4863 481e: e0 02 cpx #$02 4820: f0 44 beq L4866 4822: 29 c0 and #$c0 4824: d0 3d bne L4863 4826: e0 01 cpx #$01 4828: f0 39 beq L4863 482a: ad b8 02 lda have_fuel_scoop 482d: 25 11 and INWK+5 482f: 10 71 bpl L48A2 4831: e0 05 cpx #$05 4833: f0 0e beq L4843 4835: a0 00 ldy #$00 ;fuel scoop / debris info in hull def 4837: b1 5a lda (hull_ptr),y 4839: 4a lsr A ;get high nibble (fuel scoop info) 483a: 4a lsr A 483b: 4a lsr A 483c: 4a lsr A 483d: f0 63 beq L48A2 483f: 69 01 adc #$01 4841: d0 05 bne L4848 4843: 20 7c 7b L4843 jsr GetRandom 4846: 29 07 and #$07 4848: 20 e3 63 L4848 jsr L63E3 484b: a0 4e ldy #$4e 484d: b0 41 bcs L4890 484f: ac f0 02 ldy $02f0 4852: 79 a6 02 adc player_cargo,y 4855: 99 a6 02 sta player_cargo,y 4858: 98 tya 4859: 69 d0 adc #$d0 ;Food, Textiles, ... 485b: 20 05 85 jsr PrintMessageBriefly 485e: 06 30 asl $30 4860: 38 sec 4861: 66 30 ror $30 4863: 4c b1 48 L4863 jmp L48B1 4866: ad 49 08 L4866 lda data_buffer+73 4869: 29 04 and #$04 486b: d0 1a bne L4887 486d: a5 1a lda polyobj_mox2_hi 486f: c9 d6 cmp #$d6 4871: 90 14 bcc L4887 4873: 20 74 82 jsr L8274 4876: a5 70 lda $70 4878: c9 59 cmp #$59 487a: 90 0b bcc L4887 487c: a5 1c lda $1c 487e: 29 7f and #$7f 4880: c9 50 cmp #$50 4882: 90 03 bcc L4887 4884: 4c ea 45 GOIN_jmp jmp GOIN 4887: a5 a9 L4887 lda player_speed 4889: c9 05 cmp #$05 488b: 90 0d bcc L489A 488d: 4c 3f 7e jmp GameOver? 4890: 20 6f 95 L4890 jsr MakeNoise2? 4893: 06 2b asl polyobj_vis 4895: 38 sec 4896: 66 2b ror polyobj_vis 4898: d0 17 bne L48B1 489a: a9 01 L489A lda #$01 489c: 85 a9 sta player_speed 489e: a9 05 lda #$05 48a0: d0 09 bne L48AB 48a2: 06 2b L48A2 asl polyobj_vis 48a4: 38 sec 48a5: 66 2b ror polyobj_vis 48a7: a5 2f lda $2f 48a9: 38 sec 48aa: 6a ror A 48ab: 20 b4 74 L48AB jsr L74B4 48ae: 20 6f 95 jsr MakeNoise2? 48b1: a5 30 L48B1 lda $30 48b3: 10 03 bpl L48B8 48b5: 20 83 a2 jsr SCAN 48b8: a5 b3 L48B8 lda displayed_screen 48ba: d0 6f bne L492B 48bc: 20 c2 93 jsr L93C2 48bf: 20 d3 5b jsr L5BD3 48c2: 90 64 bcc L4928 48c4: ad 71 02 lda PLAYER_STATE?+48 48c7: f0 0a beq L48D3 48c9: 20 94 95 jsr MakeNoise3? 48cc: a6 b0 ldx $b0 48ce: a0 14 ldy #$14 48d0: 20 e8 75 jsr L75E8 48d3: a5 7e L48D3 lda $7e 48d5: f0 51 beq L4928 48d7: a2 0f ldx #$0f 48d9: 20 4e 95 jsr L954E 48dc: a5 b8 lda $b8 48de: c9 02 cmp #$02 48e0: f0 41 beq L4923 48e2: c9 1f cmp #$1f 48e4: 90 0a bcc L48F0 48e6: a5 7e lda $7e 48e8: c9 17 cmp #$17 48ea: d0 37 bne L4923 48ec: 46 7e lsr $7e 48ee: 46 7e lsr $7e 48f0: a5 2f L48F0 lda $2f 48f2: 38 sec 48f3: e5 7e sbc $7e 48f5: b0 2a bcs L4921 48f7: 06 2b asl polyobj_vis 48f9: 38 sec 48fa: 66 2b ror polyobj_vis 48fc: a5 b8 lda $b8 48fe: c9 07 cmp #$07 4900: d0 10 bne L4912 4902: a5 7e lda $7e 4904: c9 32 cmp #$32 4906: d0 0a bne L4912 4908: 20 7c 7b jsr GetRandom 490b: a2 08 ldx #$08 490d: 29 03 and #$03 490f: 20 c0 4a jsr L4AC0 4912: a0 04 L4912 ldy #$04 4914: 20 b3 4a jsr L4AB3 4917: a0 05 ldy #$05 4919: 20 b3 4a jsr L4AB3 491c: a6 b8 ldx $b8 491e: 20 2d 95 jsr CountKill 4921: 85 2f L4921 sta $2f 4923: a5 b8 L4923 lda $b8 4925: 20 59 5c jsr L5C59 4928: 20 3e 88 L4928 jsr DrawObject 492b: a0 23 L492B ldy #$23 492d: a5 2f lda $2f 492f: 91 5c sta (polyobj_ptr),y 4931: a5 30 lda $30 4933: 30 2d bmi :NoBounty 4935: a5 2b lda polyobj_vis 4937: 10 2c bpl L4965 4939: 29 20 and #$20 493b: f0 28 beq L4965 493d: a5 30 lda $30 493f: 29 40 and #$40 4941: 0d c3 02 ora player_fug_inno 4944: 8d c3 02 sta player_fug_inno 4947: ad 77 02 lda PLAYER_STATE?+54 494a: 0d 6e 02 ora witch_space_flag ;no bounties in witch space 494d: d0 13 bne :NoBounty 494f: a0 0a ldy #$0a ;bounty value, low 4951: b1 5a lda (hull_ptr),y 4953: f0 0d beq :NoBounty ;(shouldn't we check the high byte?) 4955: aa tax 4956: c8 iny ;bounty value, high 4957: b1 5a lda (hull_ptr),y 4959: a8 tay 495a: 20 57 6e jsr AddCredits 495d: a9 00 lda #$00 ;invalid token? 495f: 20 05 85 jsr PrintMessageBriefly ;(should display current cash) 4962: 4c 7d 79 :NoBounty jmp L797D 4965: a5 b8 L4965 lda $b8 4967: 30 05 bmi L496E 4969: 20 13 7e jsr L7E13 496c: 90 f4 bcc :NoBounty 496e: a0 1f L496E ldy #$1f 4970: a5 2b lda polyobj_vis 4972: 91 5c sta (polyobj_ptr),y 4974: a6 b0 ldx $b0 4976: e8 inx 4977: 4c b2 47 jmp L47B2 497a: ad b9 02 L497A lda have_energy_bomb 497d: 10 0b bpl L498A 497f: 20 00 4b jsr L4B00 4982: 0e b9 02 asl have_energy_bomb 4985: 30 03 bmi L498A 4987: 20 ce 4a jsr DrawBombAnim 498a: a5 b6 L498A lda $b6 498c: 29 07 and #$07 498e: d0 66 bne L49F6 4990: a6 d6 ldx $d6 4992: 10 0e bpl L49A2 4994: a6 d5 ldx $d5 4996: 20 39 74 jsr L7439 4999: 86 d5 stx $d5 499b: a6 d4 ldx $d4 499d: 20 39 74 jsr L7439 49a0: 86 d4 stx $d4 49a2: 38 L49A2 sec 49a3: ad ba 02 lda have_energy_unit 49a6: 65 d6 adc $d6 49a8: b0 02 bcs L49AC 49aa: 85 d6 sta $d6 49ac: ad 6e 02 L49AC lda witch_space_flag 49af: d0 42 bne L49F3 49b1: a5 b6 lda $b6 49b3: 29 1f and #$1f 49b5: d0 48 bne L49FF 49b7: ad 4c 02 lda PLAYER_STATE?+11 49ba: d0 37 bne L49F3 49bc: a8 tay 49bd: 20 61 52 jsr L5261 49c0: d0 31 bne L49F3 49c2: a2 1c ldx #$1c 49c4: bd 00 08 L49C4 lda data_buffer,x 49c7: 95 0c sta polyobj_xpos_lo,x 49c9: ca dex 49ca: 10 f8 bpl L49C4 49cc: e8 inx 49cd: a0 09 ldy #$09 49cf: 20 3e 52 jsr L523E 49d2: d0 1f bne L49F3 49d4: a2 03 ldx #$03 49d6: a0 0b ldy #$0b 49d8: 20 3e 52 jsr L523E 49db: d0 16 bne L49F3 49dd: a2 06 ldx #$06 49df: a0 0d ldy #$0d 49e1: 20 3e 52 jsr L523E 49e4: d0 0d bne L49F3 49e6: a9 c0 lda #$c0 49e8: 20 15 7e jsr L7E15 49eb: 90 06 bcc L49F3 49ed: 20 5b 78 jsr L785B 49f0: 20 fe 74 jsr L74FE 49f3: 4c 7b 4a L49F3 jmp L4A7B 49f6: ad 6e 02 L49F6 lda witch_space_flag 49f9: d0 f8 bne L49F3 49fb: a5 b6 lda $b6 49fd: 29 1f and #$1f 49ff: c9 0a L49FF cmp #$0a 4a01: d0 2d bne L4A30 4a03: a9 32 lda #$32 4a05: c5 d6 cmp $d6 4a07: 90 04 bcc L4A0D 4a09: 0a asl A 4a0a: 20 05 85 jsr PrintMessageBriefly 4a0d: a0 ff L4A0D ldy #$ff 4a0f: 8c 7c 02 sty lcoord_swap_flag-1 4a12: c8 iny 4a13: 20 5f 52 jsr L525F 4a16: d0 63 bne L4A7B 4a18: 20 6d 52 jsr L526D 4a1b: b0 5e bcs L4A7B 4a1d: e9 24 sbc #$24 4a1f: 90 0c bcc L4A2D 4a21: 85 ae sta $ae 4a23: 20 45 87 jsr TwoByteSqrt 4a26: a5 ad lda $ad 4a28: 8d 7c 02 sta lcoord_swap_flag-1 4a2b: d0 4e bne L4A7B 4a2d: 4c 3f 7e L4A2D jmp GameOver? 4a30: c9 0f L4A30 cmp #$0f 4a32: d0 09 bne L4A3D 4a34: ad 6c 02 lda computer_dock_flag 4a37: f0 42 beq L4A7B 4a39: a9 7b lda #$7b 4a3b: d0 3b bne L4A78 4a3d: c9 14 L4A3D cmp #$14 4a3f: d0 3a bne L4A7B 4a41: a9 1e lda #$1e 4a43: 8d 6f 02 sta PLAYER_STATE?+46 4a46: ad 4c 02 lda PLAYER_STATE?+11 4a49: d0 30 bne L4A7B 4a4b: a0 25 ldy #$25 4a4d: 20 61 52 jsr L5261 4a50: d0 29 bne L4A7B 4a52: 20 6d 52 jsr L526D 4a55: 49 ff eor #$ff 4a57: 69 1e adc #$1e 4a59: 8d 6f 02 sta PLAYER_STATE?+46 4a5c: b0 cf bcs L4A2D 4a5e: c9 e0 cmp #$e0 4a60: 90 19 bcc L4A7B 4a62: ad b8 02 lda have_fuel_scoop 4a65: f0 14 beq L4A7B 4a67: a5 ab lda $ab 4a69: 4a lsr A 4a6a: 6d 9c 02 adc player_fuel 4a6d: c9 46 cmp #$46 4a6f: 90 02 bcc L4A73 4a71: a9 46 lda #$46 4a73: 8d 9c 02 L4A73 sta player_fuel 4a76: a9 a0 lda #$a0 ;"Fuel Scoops On" 4a78: 20 05 85 L4A78 jsr PrintMessageBriefly 4a7b: ad 70 02 L4A7B lda PLAYER_STATE?+47 4a7e: f0 0f beq L4A8F 4a80: ad 73 02 lda main_dec2_thing? 4a83: c9 08 cmp #$08 4a85: b0 08 bcs L4A8F 4a87: 20 36 62 jsr L6236 4a8a: a9 00 lda #$00 4a8c: 8d 70 02 sta PLAYER_STATE?+47 4a8f: ad 6d 02 L4A8F lda player_ecm_active? 4a92: f0 05 beq L4A99 4a94: 20 3c 74 jsr L743C 4a97: f0 10 beq L4AA9 4a99: a5 6a L4A99 lda ecm_active_flag? 4a9b: f0 0f beq L4AAC 4a9d: a0 14 ldy #$14 4a9f: 09 c0 ora #$c0 4aa1: aa tax 4aa2: 20 ae 95 jsr MakeNoise4? 4aa5: c6 6a dec ecm_active_flag? 4aa7: d0 03 bne L4AAC 4aa9: 20 12 95 L4AA9 jsr L9512 4aac: a5 b3 L4AAC lda displayed_screen 4aae: d0 1d bne L4ACD 4ab0: 4c 45 50 jmp L5045 4ab3: 20 7c 7b L4AB3 jsr GetRandom 4ab6: 10 15 bpl L4ACD 4ab8: 98 tya 4ab9: aa tax 4aba: a0 00 ldy #$00 4abc: 31 5a and (hull_ptr),y 4abe: 29 0f and #$0f 4ac0: 85 bd L4AC0 sta $bd 4ac2: f0 09 beq L4ACD 4ac4: a9 00 L4AC4 lda #$00 4ac6: 20 9e 5c jsr LaunchObject1 4ac9: c6 bd dec $bd 4acb: d0 f7 bne L4AC4 4acd: 60 L4ACD rts ; Energy bomb detonations draw a jagged horizontal line several times while ; making noises. 4ace: a5 b3 DrawBombAnim lda displayed_screen ;check which view we're showing 4ad0: d0 2d bne :NotSpace ;not space, bail 4ad2: a0 01 ldy #$01 4ad4: ad 3c 4b lda L4B3C 4ad7: 85 74 sta ]XX12 4ad9: ad 46 4b lda L4B46 4adc: 85 75 sta ]XX12+1 4ade: 20 06 96 :Loop jsr MakeNoise7? 4ae1: a5 74 lda ]XX12 4ae3: 85 6e sta $6e 4ae5: a5 75 lda ]XX12+1 4ae7: 85 6f sta $6f 4ae9: b9 3c 4b lda L4B3C,y 4aec: 85 70 sta $70 4aee: 85 74 sta ]XX12 4af0: b9 46 4b lda L4B46,y 4af3: 85 71 sta $71 4af5: 85 75 sta ]XX12+1 4af7: 20 64 9c jsr DrawLine 4afa: c8 iny 4afb: c0 0a cpy #$0a 4afd: 90 df bcc :Loop 4aff: 60 :NotSpace rts 4b00: 20 03 4b L4B00 jsr L4B03 4b03: 20 06 4b L4B03 jsr L4B06 4b06: 20 e9 95 L4B06 jsr MakeNoise6? 4b09: 20 ce 4a jsr DrawBombAnim 4b0c: a0 00 DetonateBomb? ldy #$00 4b0e: 20 7c 7b :Loop jsr GetRandom 4b11: 29 7f and #$7f 4b13: 69 03 adc #$03 4b15: 99 46 4b sta L4B46,y 4b18: 8a txa 4b19: 29 1f and #$1f 4b1b: 18 clc 4b1c: 79 32 4b adc L4B32,y 4b1f: 99 3c 4b sta L4B3C,y 4b22: c8 iny 4b23: c0 0a cpy #$0a ;set 10 values 4b25: 90 e7 bcc :Loop 4b27: a2 00 ldx #$00 4b29: 8e 45 4b stx L4B3C+9 4b2c: ca dex 4b2d: 8e 3c 4b stx L4B3C 4b30: b0 9c bcs DrawBombAnim 4b32: e0 e0 c0 a0+ L4B32 .bulk $e0,$e0,$c0,$a0,$80,$60,$40,$20,$00,$00 4b3c: 00 00 00 00+ L4B3C .bulk $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 4b46: 00 00 00 00+ L4B46 .bulk $00,$00,$00,$00,$00,$00,$00,$00,$00,$00 PrintNavyCapName 4b50: a9 d9 lda #$d9 ;Curruthers, Fosdyke Smythe, Fortesque 4b52: d0 02 bne L4B56 4b54: a9 dc PrintDockDcPlus lda #$dc ;"last seen" / "believed to have jumped" 4b56: 18 L4B56 clc 4b57: 6d 9e 02 adc ship_state2? 4b5a: d0 12 bne PrintDockedStr ; ; Prints a string from the extended set of docked messages. ; • Clear variables ]token_ptr .var $5e {addr/2} PrintExtDockedStr 4b5c: 48 pha ;preserve A-reg 4b5d: aa tax 4b5e: 98 tya 4b5f: 48 pha ;preserve Y-reg 4b60: a5 5e lda ]token_ptr 4b62: 48 pha 4b63: a5 5f lda ]token_ptr+1 4b65: 48 pha 4b66: a9 92 lda #<ext_docked_text 4b68: 85 5e sta ]token_ptr 4b6a: a9 1a lda #>ext_docked_text 4b6c: d0 10 bne PrintDocked2 NOTE: C64 $2390 (code_1D81.asm) BBC .DETOK3 (docked code) ; ; Print a message from a tokenized string while docked. ; ; On entry: ; A-reg: message index ; ; On exit: ; A-reg and Y-reg preserved ; 4b6e: 48 PrintDockedStr pha ;preserve A-reg 4b6f: aa tax 4b70: 98 tya ;preserve Y-reg 4b71: 48 pha 4b72: a5 5e lda ]token_ptr ;preserve pointer 4b74: 48 pha ;(because of recursion) 4b75: a5 5f lda ]token_ptr+1 4b77: 48 pha 4b78: a9 40 lda #<docked_text ;search docked text table 4b7a: 85 5e sta ]token_ptr 4b7c: a9 0f lda #>docked_text ; X-reg has message index. 4b7e: 85 5f PrintDocked2 sta ]token_ptr+1 4b80: a0 00 ldy #$00 4b82: b1 5e L4B82 lda (]token_ptr),y ;get data 4b84: 49 57 eor #EOR_DOCKED ;decrypt it 4b86: d0 03 bne :NotEnd ;not end of string, branch 4b88: ca dex ;dec index 4b89: f0 07 beq :GotString ;found the one we want 4b8b: c8 :NotEnd iny 4b8c: d0 f4 bne L4B82 4b8e: e6 5f inc ]token_ptr+1 4b90: d0 f0 bne L4B82 4b92: c8 :GotString iny ;move to start of string 4b93: d0 02 bne :NoInc 4b95: e6 5f inc ]token_ptr+1 4b97: b1 5e :NoInc lda (]token_ptr),y ;get token 4b99: 49 57 eor #EOR_DOCKED ;decrypt 4b9b: f0 06 beq :StrEnd ;end of string, branch 4b9d: 20 ad 4b jsr PrintDockedToken 4ba0: 4c 92 4b jmp :GotString 4ba3: 68 :StrEnd pla ;restore pointer 4ba4: 85 5f sta ]token_ptr+1 4ba6: 68 pla 4ba7: 85 5e sta ]token_ptr 4ba9: 68 pla 4baa: a8 tay ;restore Y-reg 4bab: 68 pla ;restore A-reg 4bac: 60 rts ; ; Print a "docked" text token: ; $00: invalid ; $01-1f: format token (invokes function) ; $20-5a: ASCII ; $5b-80: planet description tokens ; $81-d6: message index 0-55 ; $d7-ff: digrams ; ; On entry: ; A-reg: token to print ; ; Y-reg is preserved. ; PrintDockedToken 4bad: c9 20 cmp #$20 4baf: 90 48 bcc PrintDockedFmt 4bb1: 2c 29 55 bit txt_flight_flag ;flight string mode on? 4bb4: 10 10 bpl :DoDocked ;no 4bb6: aa tax ;yes, handle as flight string 4bb7: 98 tya 4bb8: 48 pha 4bb9: a5 5e lda ]token_ptr 4bbb: 48 pha 4bbc: a5 5f lda ]token_ptr+1 4bbe: 48 pha 4bbf: 8a txa 4bc0: 20 44 71 jsr PrintFlightToken 4bc3: 4c 16 4c jmp Restore5ePtr 4bc6: c9 5b :DoDocked cmp #‘[’ ;<= 'Z'? 4bc8: 90 18 bcc PrintDockedChar ;yes, print plain character 4bca: c9 81 cmp #$81 4bcc: 90 51 bcc PrintPlanetDescToken? 4bce: c9 d7 cmp #$d7 ;is it a digram? 4bd0: 90 9c bcc PrintDockedStr ;no, canned string 4bd2: e9 d7 sbc #$d7 ;get digram index 4bd4: 0a asl A 4bd5: 48 pha 4bd6: aa tax 4bd7: bd 26 4d lda docked_digram_tab,x 4bda: 20 e2 4b jsr PrintDockedChar 4bdd: 68 pla 4bde: aa tax 4bdf: bd 27 4d lda docked_digram_tab+1,x 4be2: c9 41 PrintDockedChar cmp #‘A’ ;is it a number or punctuation? 4be4: 90 10 bcc :DoPrintChar ;yes, don't mess with it 4be6: 2c 2c 55 bit text_ucase_flag ;upper-case flag set? 4be9: 30 05 bmi :MakeUpper ;yes, make it upper 4beb: 2c 28 55 bit txt_lcase_flag ;lower-case flag set? 4bee: 30 03 bmi :MakeLower ;yes, make it lower 4bf0: 0d 27 55 :MakeUpper ora text_ucase_mask 4bf3: 2d 2d 55 :MakeLower and text_lcase_mask 4bf6: 4c 33 55 :DoPrintChar jmp PrintChar 4bf9: aa PrintDockedFmt tax ;A-reg holds $01-1f 4bfa: 98 tya ;preserve Y-reg 4bfb: 48 pha 4bfc: a5 5e lda ]token_ptr ;preserve $5e/5f 4bfe: 48 pha 4bff: a5 5f lda ]token_ptr+1 4c01: 48 pha 4c02: 8a txa 4c03: 0a asl A ;double it 4c04: aa tax 4c05: bd e4 4c lda token_print_funcs-2,x ;get address of function to call 4c08: 8d 14 4c sta :_CallAddr+1 4c0b: bd e5 4c lda token_print_funcs-1,x 4c0e: 8d 15 4c sta :_CallAddr+2 4c11: 8a txa 4c12: 4a lsr A 4c13: 20 33 55 :_CallAddr jsr PrintChar ;call it 4c16: 68 Restore5ePtr pla ;restore $5e/5f 4c17: 85 5f sta ]token_ptr+1 4c19: 68 pla 4c1a: 85 5e sta ]token_ptr 4c1c: 68 pla ;restore Y-reg 4c1d: a8 tay 4c1e: 60 rts PrintPlanetDescToken? 4c1f: 85 0a sta $0a ;$5b-80 4c21: 98 tya 4c22: 48 pha 4c23: a5 5e lda ]token_ptr 4c25: 48 pha 4c26: a5 5f lda ]token_ptr+1 4c28: 48 pha 4c29: 20 7c 7b jsr GetRandom 4c2c: aa tax 4c2d: a9 00 lda #$00 4c2f: e0 33 cpx #$33 4c31: 69 00 adc #$00 4c33: e0 66 cpx #$66 4c35: 69 00 adc #$00 4c37: e0 99 cpx #$99 4c39: 69 00 adc #$00 4c3b: e0 cc cpx #$cc 4c3d: a6 0a ldx $0a 4c3f: 7d 42 63 adc planet_desc_adj-91,x 4c42: 20 6e 4b jsr PrintDockedStr 4c45: 4c 16 4c jmp Restore5ePtr 4c48: a9 00 ClearUcaseMask lda #$00 4c4a: 2c bit ▼ title_screen+169 4c4b: a9 20 SetUcaseMask lda #$20 4c4d: 8d 27 55 sta text_ucase_mask 4c50: a9 00 lda #$00 4c52: 8d 2c 55 sta text_ucase_flag 4c55: 60 rts 4c56: a9 06 T4C56 lda #$06 4c58: 85 34 sta text_hposn 4c5a: a9 ff lda #$ff 4c5c: 8d 28 55 sta txt_lcase_flag 4c5f: 60 rts 4c60: a9 01 T4C60 lda #$01 4c62: 85 34 sta text_hposn 4c64: 4c b9 94 jmp PrintFlightHud? 4c67: a9 80 SetUpperMask? lda #$80 4c69: 8d 2c 55 sta text_ucase_flag 4c6c: a9 20 lda #$20 4c6e: 8d 27 55 sta text_ucase_mask 4c71: 60 rts SetFlightTokFlag 4c72: a9 80 lda #$80 4c74: 85 37 sta text_mod_flags 4c76: a9 ff lda #$ff 4c78: 2c bit: ▼ player_speed ClearFlightTokFlag 4c79: a9 00 lda #$00 4c7b: 8d 29 55 sta txt_flight_flag 4c7e: 60 rts 4c7f: a9 80 SetBufferFlag lda #$80 4c81: 2c bit: ▼ player_speed 4c82: a9 00 ClearBufferFlag lda #$00 4c84: 8d 2a 55 sta txt_buffer_flag 4c87: 0a asl A ;now A-reg=0 either way 4c88: 8d 2b 55 sta txt_buffer_index ;set index=0 4c8b: 60 rts 4c8c: a5 37 PrintSpeciesIan lda text_mod_flags 4c8e: 29 bf and #$bf 4c90: 85 37 sta text_mod_flags 4c92: a9 03 lda #$03 ;selected planet 4c94: 20 44 71 jsr PrintFlightToken 4c97: ae 2b 55 ldx txt_buffer_index 4c9a: b5 ff lda <BUFFER_0100-1,x ;check the last letter 4c9c: 20 ce 4c jsr IsVowel ;is it a vowel? 4c9f: 90 03 bcc :NotVowel ;no 4ca1: ce 2b 55 dec txt_buffer_index ;yes, back up one 4ca4: a9 99 :NotVowel lda #$99 ;"-ian" suffix, e.g. "fubarian" 4ca6: 4c 6e 4b jmp PrintDockedStr 4ca9: 20 c8 4c RandomName? jsr LcaseDF? 4cac: 20 7c 7b jsr GetRandom ;random number of digrams 4caf: 29 03 and #$03 4cb1: a8 tay 4cb2: 20 7c 7b :More jsr GetRandom ;random digram 4cb5: 29 3e and #$3e 4cb7: aa tax 4cb8: bd 28 4d lda docked_digram_tab+2,x 4cbb: 20 e2 4b jsr PrintDockedChar 4cbe: bd 29 4d lda docked_digram_tab+3,x 4cc1: 20 e2 4b jsr PrintDockedChar 4cc4: 88 dey 4cc5: 10 eb bpl :More 4cc7: 60 rts 4cc8: a9 df LcaseDF? lda #$df 4cca: 8d 2d 55 sta text_lcase_mask 4ccd: 60 rts ; ; Returns with carry set if A-reg holds A/E/I/O/U. ; 4cce: 09 20 IsVowel ora #$20 ;convert to lower 4cd0: c9 61 cmp #‘a’ 4cd2: f0 11 beq L4CE5 4cd4: c9 65 cmp #‘e’ 4cd6: f0 0d beq L4CE5 4cd8: c9 69 cmp #‘i’ 4cda: f0 09 beq L4CE5 4cdc: c9 6f cmp #‘o’ 4cde: f0 05 beq L4CE5 4ce0: c9 75 cmp #‘u’ 4ce2: f0 01 beq L4CE5 4ce4: 18 clc 4ce5: 60 L4CE5 rts token_print_funcs 4ce6: 48 4c .dd2 ClearUcaseMask ;$01 4ce8: 4b 4c .dd2 SetUcaseMask ;$02 4cea: 44 71 .dd2 PrintFlightToken ;$03 - print flight token $03 4cec: 44 71 .dd2 PrintFlightToken ;$04 - print flight token $04 4cee: 79 4c .dd2 ClearFlightTokFlag ;$05 4cf0: 72 4c .dd2 SetFlightTokFlag ;$06 4cf2: 33 55 .dd2 PrintChar ;$07 [beep] 4cf4: 56 4c .dd2 T4C56 ;$08 - htab 6, set lcase flag 4cf6: 60 4c .dd2 T4C60 ;$09 - print flight HUD text? 4cf8: 33 55 .dd2 PrintChar ;$0a (LF) 4cfa: a9 4e .dd2 T4EA9 ;$0b - clears screen?? (first part of disk access menu str) 4cfc: 33 55 .dd2 PrintChar ;$0c (FF) 4cfe: 67 4c .dd2 SetUpperMask? ;$0d 4d00: 7f 4c .dd2 SetBufferFlag ;$0e 4d02: 82 4c .dd2 ClearBufferFlag ;$0f 4d04: 31 55 .dd2 PrintCharA ;$10 - print 'A' 4d06: 8c 4c .dd2 PrintSpeciesIan ;$11 - print species + "-ian" 4d08: a9 4c .dd2 RandomName? ;$12 - random set of digrams 4d0a: c8 4c .dd2 LcaseDF? ;$13 4d0c: 33 55 .dd2 PrintChar ;$14 (Ctrl+T) 4d0e: 1e a2 .dd2 ClearLines? ;$15 4d10: 60 63 .dd2 WaitKeyDrawHud ;$16 4d12: 68 63 .dd2 Vposn9_SetMask ;$17 4d14: 72 63 .dd2 WaitForKey ;$18 - wait for key 4d16: 56 63 .dd2 PrintIncomingMessage ;$19 4d18: b4 80 .dd2 InputName ;$1a 4d1a: 50 4b .dd2 PrintNavyCapName ;$1b 4d1c: 54 4b .dd2 PrintDockDcPlus ;$1c 4d1e: 6b 63 .dd2 Vposn5_SetMask ;$1d 4d20: ff 80 .dd2 PrintDiskTape 4d22: 08 81 .dd2 PrintTapeDisk 4d24: 33 55 .dd2 PrintChar ;$20 ; Digrams used in docked string construction and planet descriptions. This ; defines 13 pairs, although the planet description code skips the first one. ; The code accepts a value from $00-28, so we use entries $00-1a in the flight ; digram table as well. ; ; 00 fflf 04 IT 08 ON 0c NO ; 01 AB 05 IL 09 LO ; 02 OU 06 ET 0a NU ; 03 SE 07 ST 0b TH docked_digram_tab 4d26: 0c .dd1 $0c 4d27: 0a .dd1 $0a 4d28: 41 42 4f 55+ .str ‘ABOUSEITILETSTONLONUTHNO’ ; Digrams used in flight string construction: ; ; 00 AL 08 US 10 ER 18 ED ; 01 LE 09 ES 11 AT 19 OR ; 02 XE 0a AR 12 EN 1a QU ; 03 GE 0b MA 13 BE 1b AN ; 04 ZA 0c IN 14 RA 1c TE ; 05 CE 0d DI 15 LA 1d IS ; 06 BI 0e RE 16 VE 1e RI ; 07 SO 0f A? 17 TI 1f ON ; ; For example, "HARMLESS" would be 48 8a 4d 81 53 53 (H AR M LE S S). Strings ; are EORed with $23 (to make them harder to find?). flight_digram_tab 4d40: 41 4c 4c 45+ .str ‘ALLEXEGEZACEBISOUSESARMAINDIREA?ERATENBERALAVETIEDORQUANTEISRI’ + ‘ON’ 4d80: 3a 30 2e 45+ L4D80 .str ‘:0.E.’ 4d85: 6a 61 6d 65+ commander_name .str ‘jameson’ 4d8c: 0d 00 00 00+ save_game_state .bulk $0d,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 + $00,$00,$00,$00,$00,$00,$10,$0f,$11,$00,$03,$1c,$0e,$00,$00,$0a + $00,$11,$3a,$07,$09,$08,$00,$00,$00,$00,$80,$00 4dd8: 00 00 00 00+ scramble_thing? .fill 22,$00 ; Default save-game data. 4dee: 3a 30 2e 45+ .str ‘:0.E.’ commander_jameson 4df3: 4a 41 4d 45+ .str ‘JAMESON’,$0d 4dfb: 00 .dd1 $00 4dfc: 14 .dd1 $14 4dfd: ad .dd1 $ad 4dfe: 4a .dd1 $4a 4dff: 5a .dd1 $5a 4e00: 48 .dd1 $48 4e01: 02 .dd1 $02 4e02: 53 .dd1 $53 4e03: b7 .dd1 $b7 4e04: 00 .dd1 $00 4e05: 00 .dd1 $00 4e06: 03 .dd1 $03 4e07: e8 .dd1 $e8 4e08: 46 .dd1 $46 4e09: 00 .dd1 $00 4e0a: 00 .dd1 $00 4e0b: 0f .dd1 $0f 4e0c: 00 00 00 00+ .fill 5,$00 4e11: 16 .dd1 $16 4e12: 00 00 00 00+ .fill 28,$00 4e2e: 03 .dd1 $03 4e2f: 00 .dd1 $00 4e30: 10 .dd1 $10 4e31: 0f .dd1 $0f 4e32: 11 .dd1 $11 4e33: 00 .dd1 $00 4e34: 03 .dd1 $03 4e35: 1c .dd1 $1c 4e36: 0e .dd1 $0e 4e37: 00 .dd1 $00 4e38: 00 .dd1 $00 4e39: 0a .dd1 $0a 4e3a: 00 .dd1 $00 4e3b: 11 .dd1 $11 4e3c: 3a .dd1 $3a 4e3d: 07 .dd1 $07 4e3e: 09 .dd1 $09 4e3f: 08 .dd1 $08 4e40: 00 .dd1 $00 4e41: 00 .dd1 $00 4e42: 00 .dd1 $00 4e43: 00 .dd1 $00 4e44: 80 .dd1 $80 4e45: aa .dd1 $aa 4e46: 27 .dd1 $27 4e47: 03 .dd1 $03 4e48: 00 00 00 00+ .fill 13,$00 ; end of data 4e55: 00 .dd1 $00 4e56: 00 .dd1 $00 4e57: 00 .dd1 $00 4e58: 00 L4E58 .dd1 $00 4e59: 10 .dd1 $10 4e5a: 10 .dd1 $10 4e5b: 14 14 14 14+ .fill 6,$14 4e61: 0c 0c 0c 0c+ .fill 6,$0c 4e67: 14 .dd1 $14 4e68: 0c 0c 0c 0c+ .fill 7,$0c 4e6f: 10 .dd1 $10 4e70: 0c 0c 0c 0c+ .fill 5,$0c 4e75: 18 .dd1 $18 4e76: 0c .dd1 $0c 4e77: 0c .dd1 $0c 4e78: 00 .dd1 $00 4e79: 0c .dd1 $0c 4e7a: 00 .dd1 $00 4e7b: 00 .dd1 $00 4e7c: 00 .dd1 $00 4e7d: 00 .dd1 $00 4e7e: 00 L4E7E .dd1 $00 4e7f: 08 L4E7F .dd1 $08 4e80: 25 .dd1 $25 4e81: 08 .dd1 $08 4e82: 4a .dd1 $4a 4e83: 08 .dd1 $08 4e84: 6f .dd1 $6f 4e85: 08 .dd1 $08 4e86: 94 .dd1 $94 4e87: 08 .dd1 $08 4e88: b9 .dd1 $b9 4e89: 08 .dd1 $08 4e8a: de .dd1 $de 4e8b: 08 .dd1 $08 4e8c: 03 .dd1 $03 4e8d: 09 .dd1 $09 4e8e: 28 .dd1 $28 4e8f: 09 .dd1 $09 4e90: a2 27 L4E90 ldx #$27 4e92: bd 80 04 L4E92 lda xcoords?+128,x 4e95: c9 a0 cmp #$a0 4e97: f0 05 beq L4E9E 4e99: a9 ad lda #$ad 4e9b: 9d 00 05 sta ycoords?,x 4e9e: ca L4E9E dex 4e9f: 10 f1 bpl L4E92 4ea1: 60 rts 4ea2: 2c 10 c0 ClearKbdStrb bit KBDSTRB 4ea5: 60 rts PrintFlightTokLine 4ea6: 20 44 71 jsr PrintFlightToken 4ea9: a5 cd T4EA9 lda display_mode_flag ;text or hi-res? 4eab: 30 e3 bmi L4E90 ;text, branch 4ead: a9 13 lda #19 4eaf: d0 05 bne :DrawHorizontalLine 4eb1: a9 .dd1 $a9 4eb2: 17 .dd1 $17 4eb3: 20 0e 64 IncTextDrawLine jsr IncTextVposn :DrawHorizontalLine 4eb6: 85 6f sta $6f 4eb8: a9 10 lda #$10 4eba: 85 35 sta $35 4ebc: a2 00 ldx #$00 4ebe: 86 6e stx $6e 4ec0: ca dex 4ec1: 86 70 stx $70 4ec3: 4c 90 9e jmp DrawHorizLine ;draw horizontal line 4ec6: 20 78 78 L4EC6 jsr L7878 4ec9: 84 6f sty $6f 4ecb: a9 00 lda #$00 4ecd: 99 00 06 sta $0600,y 4ed0: 4c 90 9e jmp DrawHorizLine NOTE: this • Clear variables ]saved_y .var $06 {addr/1} ]row_mod8 .var $07 {addr/1} ]row_div8 .var $08 {addr/1} ]hptr .var $0a {addr/2} ]what_is_this? .var $b4 {addr/1} 4ed3: 20 68 60 L4ED3 jsr ADD 4ed6: 85 63 sta $63 4ed8: 8a txa 4ed9: 99 ef 06 sta $06ef,y 4edc: a5 6e L4EDC lda $6e 4ede: 10 05 bpl L4EE5 4ee0: 49 7f eor #$7f 4ee2: 18 clc 4ee3: 69 01 adc #$01 4ee5: 49 80 L4EE5 eor #$80 4ee7: aa tax 4ee8: a5 6f lda $6f 4eea: 29 7f and #$7f 4eec: c9 44 cmp #$44 4eee: b0 6b bcs :Return 4ef0: a5 6f lda $6f 4ef2: 10 04 bpl L4EF8 4ef4: 49 7f eor #$7f 4ef6: 69 01 adc #$01 4ef8: 85 d0 L4EF8 sta $d0 4efa: a9 45 lda #$45 4efc: e5 d0 sbc $d0 ; ; Draws a 2x2 white block, i.e a rect that covers xc,yc to xc+1,yc-1. ; ; Seems to be used to draw the stars on the galactic chart. ; ; On entry: ; A-reg: Y-coord ; X-reg: X-coord ; $b4: ? ; ; On exit: ; Y-reg preserved ; 4efe: 84 06 DrawStar? sty ]saved_y ;preserve Y-reg 4f00: 85 0b sta ]hptr+1 ;store row here temporarily 4f02: 4a lsr A ;divide by 8 4f03: 4a lsr A 4f04: 4a lsr A 4f05: 85 08 sta ]row_div8 4f07: a8 tay 4f08: b9 14 9c lda hires_line_lo,y ;set hi-res row address, low byte 4f0b: 85 0a sta ]hptr 4f0d: a5 0b lda ]hptr+1 ;now fix the high byte 4f0f: 29 07 and #$07 ;compute mod 8 4f11: 85 07 sta ]row_mod8 4f13: 0a asl A ;multiply by 4 4f14: 0a asl A 4f15: 79 2c 9c adc hires_line_hi,y ;set hi-res address, high byte 4f18: 85 0b sta ]hptr+1 4f1a: bd 03 43 lda mod7_table,x ;get col pixel 4f1d: 0a asl A ;x2 4f1e: a4 b4 ldy ]what_is_this? 4f20: 30 02 bmi :NegB4 4f22: 69 0e adc #14 4f24: c0 50 :NegB4 cpy #80 4f26: bc 03 44 ldy div7_table,x ;get col byte 4f29: aa tax 4f2a: b0 1c bcs :DrawLast 4f2c: bd 6f 4f lda hi_res_2pixel2,x ;blend first byte 4f2f: 51 0a eor (]hptr),y 4f31: 91 0a sta (]hptr),y 4f33: bd 70 4f lda hi_res_2pixel2+1,x ;anything in second byte? 4f36: f0 06 beq :Skip2 ;no, skip that one 4f38: c8 iny ;yes, blend second byte 4f39: 51 0a eor (]hptr),y 4f3b: 91 0a sta (]hptr),y 4f3d: 88 dey ;back up 4f3e: a5 07 :Skip2 lda ]row_mod8 ;at top of 8-row section? 4f40: f0 1a beq :CalcRow ;yes, do the bigger calculation 4f42: a5 0b lda ]hptr+1 ;move up one row 4f44: e9 03 sbc #$03 4f46: 85 0b sta ]hptr+1 4f48: bd 6f 4f :DrawLast lda hi_res_2pixel2,x ;blend first byte 4f4b: 51 0a eor (]hptr),y 4f4d: 91 0a sta (]hptr),y 4f4f: bd 70 4f lda hi_res_2pixel2+1,x ;anything in second byte? 4f52: f0 05 beq :Done ;no, done 4f54: c8 iny ;yes, blend second byte 4f55: 51 0a eor (]hptr),y 4f57: 91 0a sta (]hptr),y 4f59: a4 06 :Done ldy ]saved_y 4f5b: 60 :Return rts 4f5c: 86 07 :CalcRow stx ]row_mod8 ;preserve X-reg 4f5e: a6 08 ldx ]row_div8 ;move up one row 4f60: bd 13 9c lda hires_line_lo-1,x 4f63: 85 0a sta ]hptr 4f65: bd 4b 9c lda hires_line_hi2-1,x 4f68: 85 0b sta ]hptr+1 4f6a: a6 07 ldx ]row_mod8 ;restore X-reg 4f6c: 4c 48 4f jmp :DrawLast ; Two pixels, stored in two bytes so we don't have to special-case the ends. 4f6f: 03 00 hi_res_2pixel2 .bulk $03,$00 4f71: 06 00 .bulk $06,$00 4f73: 0c 00 .bulk $0c,$00 4f75: 18 00 .bulk $18,$00 4f77: 30 00 .bulk $30,$00 4f79: 60 00 .bulk $60,$00 4f7b: 40 01 .bulk $40,$01 ; Same thing, but three pixels. 4f7d: 07 00 .bulk $07,$00 4f7f: 0e 00 .bulk $0e,$00 4f81: 1c 00 .bulk $1c,$00 4f83: 38 00 .bulk $38,$00 4f85: 70 00 .bulk $70,$00 4f87: 60 01 .bulk $60,$01 4f89: 40 03 .bulk $40,$03 4f8b: 8a L4F8B txa 4f8c: 65 46 adc $46 4f8e: 85 9e sta $9e 4f90: a5 47 lda $47 4f92: 65 d0 adc $d0 4f94: 85 9f sta $9f 4f96: a5 bc lda $bc 4f98: f0 12 beq L4FAC 4f9a: e6 bc inc $bc 4f9c: a4 91 L4F9C ldy $91 4f9e: a9 ff lda #$ff 4fa0: d9 ff 04 cmp ycoords?-1,y 4fa3: f0 69 beq L500E 4fa5: 99 00 05 sta ycoords?,y 4fa8: e6 91 inc $91 4faa: d0 62 bne L500E 4fac: a5 98 L4FAC lda $98 4fae: 85 6e sta $6e 4fb0: a5 99 lda $99 4fb2: 85 6f sta $6f 4fb4: a5 9a lda $9a 4fb6: 85 70 sta $70 4fb8: a5 9b lda $9b 4fba: 85 71 sta $71 4fbc: a5 9c lda $9c 4fbe: 85 72 sta $72 4fc0: a5 9d lda $9d 4fc2: 85 73 sta $73 4fc4: a5 9e lda $9e 4fc6: 85 74 sta $74 4fc8: a5 9f lda $9f 4fca: 85 75 sta $75 4fcc: 20 d2 8e jsr ClipLine 4fcf: b0 cb bcs L4F9C 4fd1: ad 7d 02 lda lcoord_swap_flag 4fd4: f0 10 beq :NoSwap 4fd6: a5 6e lda $6e 4fd8: a4 70 ldy $70 4fda: 85 70 sta $70 4fdc: 84 6e sty $6e 4fde: a5 6f lda $6f 4fe0: a4 71 ldy $71 4fe2: 85 71 sta $71 4fe4: 84 6f sty $6f 4fe6: a4 91 :NoSwap ldy $91 4fe8: b9 ff 04 lda ycoords?-1,y 4feb: c9 ff cmp #$ff 4fed: d0 0b bne L4FFA 4fef: a5 6e lda $6e 4ff1: 99 00 04 sta xcoords?,y 4ff4: a5 6f lda $6f 4ff6: 99 00 05 sta ycoords?,y 4ff9: c8 iny 4ffa: a5 70 L4FFA lda $70 4ffc: 99 00 04 sta xcoords?,y 4fff: a5 71 lda $71 5001: 99 00 05 sta ycoords?,y 5004: c8 iny 5005: 84 91 sty $91 5007: 20 64 9c jsr DrawLine 500a: a5 b5 lda $b5 500c: d0 8e bne L4F9C 500e: a5 9c L500E lda $9c 5010: 85 98 sta $98 5012: a5 9d lda $9d 5014: 85 99 sta $99 5016: a5 9e lda $9e 5018: 85 9a sta $9a 501a: a5 9f lda $9f 501c: 85 9b sta $9b 501e: a5 bd lda $bd 5020: 18 clc 5021: 65 bf adc $bf 5023: 85 bd sta $bd 5025: 60 rts 5026: a4 e2 L5026 ldy $e2 5028: be e2 06 L5028 ldx $06e2,y 502b: b9 c8 06 lda $06c8,y 502e: 85 6f sta $6f 5030: 99 e2 06 sta $06e2,y 5033: 8a txa 5034: 85 6e sta $6e 5036: 99 c8 06 sta $06c8,y 5039: b9 fc 06 lda SCRNHOLE5+4,y 503c: 85 b4 sta ]what_is_this? 503e: 20 dc 4e jsr L4EDC 5041: 88 dey 5042: d0 e4 bne L5028 5044: 60 rts 5045: ae 72 02 L5045 ldx PLAYER_STATE?+49 5048: f0 09 beq L5053 504a: ca dex 504b: d0 03 bne L5050 504d: 4c 3f 51 jmp L513F 5050: 4c 94 5d L5050 jmp L5D94 5053: a4 e2 L5053 ldy $e2 5055: 20 c7 60 L5055 jsr DV42 5058: a5 ae lda $ae 505a: 46 31 lsr $31 505c: 6a ror A 505d: 46 31 lsr $31 505f: 6a ror A 5060: 09 01 ora #$01 5062: 85 ad sta $ad 5064: b9 09 07 lda $0709,y 5067: e5 aa sbc $aa 5069: 99 09 07 sta $0709,y 506c: b9 fc 06 lda SCRNHOLE5+4,y 506f: 85 b4 sta ]what_is_this? 5071: e5 ab sbc $ab 5073: 99 fc 06 sta SCRNHOLE5+4,y 5076: 20 3c 5f jsr L5F3C 5079: 85 63 sta $63 507b: a5 31 lda $31 507d: 79 ef 06 adc $06ef,y 5080: 85 62 sta $62 5082: 85 ae sta $ae 5084: a5 6f lda $6f 5086: 65 63 adc $63 5088: 85 63 sta $63 508a: 85 af sta $af 508c: b9 c8 06 lda $06c8,y 508f: 85 6e sta $6e 5091: 20 41 5f jsr L5F41 5094: 85 61 sta $61 5096: a5 31 lda $31 5098: 79 d5 06 adc $06d5,y 509b: 85 60 sta $60 509d: a5 6e lda $6e 509f: 65 61 adc $61 50a1: 85 61 sta $61 50a3: 45 6d eor $6d 50a5: 20 e6 5e jsr MLS1 50a8: 20 68 60 jsr ADD 50ab: 85 63 sta $63 50ad: 86 62 stx $62 50af: 45 6c eor $6c 50b1: 20 de 5e jsr MLS2 50b4: 20 68 60 jsr ADD 50b7: 85 61 sta $61 50b9: 86 60 stx $60 50bb: a6 67 ldx $67 50bd: a5 63 lda $63 50bf: 45 a8 eor $a8 50c1: 20 e8 5e jsr MULTS 50c4: 85 ad sta $ad 50c6: 20 e3 5f jsr MUT2 50c9: 06 31 asl $31 50cb: 2a rol A 50cc: 85 d0 sta $d0 50ce: a9 00 lda #$00 50d0: 6a ror A 50d1: 05 d0 ora $d0 50d3: 20 68 60 jsr ADD 50d6: 85 61 sta $61 50d8: 8a txa 50d9: 99 d5 06 sta $06d5,y 50dc: a5 62 lda $62 50de: 85 ae sta $ae 50e0: a5 63 lda $63 50e2: 85 af sta $af 50e4: a9 00 lda #$00 50e6: 85 31 sta $31 50e8: a5 66 lda $66 50ea: 49 80 eor #$80 50ec: 20 d3 4e jsr L4ED3 50ef: a5 61 lda $61 50f1: 85 6e sta $6e 50f3: 99 c8 06 sta $06c8,y 50f6: 29 7f and #$7f 50f8: c9 78 cmp #$78 50fa: b0 20 bcs L511C 50fc: a5 63 lda $63 50fe: 99 e2 06 sta $06e2,y 5101: 85 6f sta $6f 5103: 29 7f and #$7f 5105: c9 78 cmp #$78 5107: b0 13 bcs L511C 5109: b9 fc 06 lda SCRNHOLE5+4,y 510c: c9 10 cmp #$10 510e: 90 0c bcc L511C 5110: 85 b4 sta ]what_is_this? 5112: 20 dc 4e L5112 jsr L4EDC 5115: 88 dey 5116: f0 03 beq L511B 5118: 4c 55 50 jmp L5055 511b: 60 L511B rts 511c: 20 7c 7b L511C jsr GetRandom 511f: 09 04 ora #$04 5121: 85 6f sta $6f 5123: 99 e2 06 sta $06e2,y 5126: 20 7c 7b jsr GetRandom 5129: 09 08 ora #$08 512b: 85 6e sta $6e 512d: 99 c8 06 sta $06c8,y 5130: 20 7c 7b jsr GetRandom 5133: 09 90 ora #$90 5135: 99 fc 06 sta SCRNHOLE5+4,y 5138: 85 b4 sta ]what_is_this? 513a: a5 6f lda $6f 513c: 4c 12 51 jmp L5112 513f: a4 e2 L513F ldy $e2 5141: 20 c7 60 L5141 jsr DV42 5144: a5 ae lda $ae 5146: 46 31 lsr $31 5148: 6a ror A 5149: 46 31 lsr $31 514b: 6a ror A 514c: 09 01 ora #$01 514e: 85 ad sta $ad 5150: b9 c8 06 lda $06c8,y 5153: 85 6e sta $6e 5155: 20 41 5f jsr L5F41 5158: 85 61 sta $61 515a: b9 d5 06 lda $06d5,y 515d: e5 31 sbc $31 515f: 85 60 sta $60 5161: a5 6e lda $6e 5163: e5 61 sbc $61 5165: 85 61 sta $61 5167: 20 3c 5f jsr L5F3C 516a: 85 63 sta $63 516c: b9 ef 06 lda $06ef,y 516f: e5 31 sbc $31 5171: 85 62 sta $62 5173: 85 ae sta $ae 5175: a5 6f lda $6f 5177: e5 63 sbc $63 5179: 85 63 sta $63 517b: 85 af sta $af 517d: b9 09 07 lda $0709,y 5180: 65 aa adc $aa 5182: 99 09 07 sta $0709,y 5185: b9 fc 06 lda SCRNHOLE5+4,y 5188: 85 b4 sta ]what_is_this? 518a: 65 ab adc $ab 518c: 99 fc 06 sta SCRNHOLE5+4,y 518f: a5 61 lda $61 5191: 45 6c eor $6c 5193: 20 e6 5e jsr MLS1 5196: 20 68 60 jsr ADD 5199: 85 63 sta $63 519b: 86 62 stx $62 519d: 45 6d eor $6d 519f: 20 de 5e jsr MLS2 51a2: 20 68 60 jsr ADD 51a5: 85 61 sta $61 51a7: 86 60 stx $60 51a9: a5 63 lda $63 51ab: 45 a8 eor $a8 51ad: a6 67 ldx $67 51af: 20 e8 5e jsr MULTS 51b2: 85 ad sta $ad 51b4: a5 61 lda $61 51b6: 85 af sta $af 51b8: 49 80 eor #$80 51ba: 20 e7 5f jsr MUT1 51bd: 06 31 asl $31 51bf: 2a rol A 51c0: 85 d0 sta $d0 51c2: a9 00 lda #$00 51c4: 6a ror A 51c5: 05 d0 ora $d0 51c7: 20 68 60 jsr ADD 51ca: 85 61 sta $61 51cc: 8a txa 51cd: 99 d5 06 sta $06d5,y 51d0: a5 62 lda $62 51d2: 85 ae sta $ae 51d4: a5 63 lda $63 51d6: 85 af sta $af 51d8: a9 00 lda #$00 51da: 85 31 sta $31 51dc: a5 66 lda $66 51de: 20 d3 4e jsr L4ED3 51e1: a5 61 lda $61 51e3: 85 6e sta $6e 51e5: 99 c8 06 sta $06c8,y 51e8: a5 63 lda $63 51ea: 99 e2 06 sta $06e2,y 51ed: 85 6f sta $6f 51ef: 29 7f and #$7f 51f1: c9 6e cmp #$6e 51f3: b0 13 bcs L5208 51f5: b9 fc 06 lda SCRNHOLE5+4,y 51f8: c9 a0 cmp #$a0 51fa: b0 0c bcs L5208 51fc: 85 b4 sta ]what_is_this? 51fe: 20 dc 4e L51FE jsr L4EDC 5201: 88 dey 5202: f0 03 beq L5207 5204: 4c 41 51 jmp L5141 5207: 60 L5207 rts 5208: 20 7c 7b L5208 jsr GetRandom 520b: 29 7f and #$7f 520d: 69 0a adc #$0a 520f: 99 fc 06 sta SCRNHOLE5+4,y 5212: 85 b4 sta ]what_is_this? 5214: 4a lsr A 5215: b0 14 bcs L522B 5217: 4a lsr A 5218: a9 fc lda #$fc 521a: 6a ror A 521b: 85 6e sta $6e 521d: 99 c8 06 sta $06c8,y 5220: 20 7c 7b jsr GetRandom 5223: 85 6f sta $6f 5225: 99 e2 06 sta $06e2,y 5228: 4c fe 51 jmp L51FE 522b: 20 7c 7b L522B jsr GetRandom 522e: 85 6e sta $6e 5230: 99 c8 06 sta $06c8,y 5233: 4a lsr A 5234: a9 e6 lda #$e6 5236: 6a ror A 5237: 85 6f sta $6f 5239: 99 e2 06 sta $06e2,y 523c: d0 c0 bne L51FE 523e: b9 0c 00 L523E lda polyobj_xpos_lo,y 5241: 0a asl A 5242: 85 7b sta $7b 5244: b9 0d 00 lda INWK+1,y 5247: 2a rol A 5248: 85 7c sta $7c 524a: a9 00 lda #$00 524c: 6a ror A 524d: 85 7d sta $7d 524f: 20 78 53 jsr L5378 5252: 95 0e sta INWK+2,x 5254: a4 7b ldy $7b 5256: 94 0c sty polyobj_xpos_lo,x 5258: a4 7c ldy $7c 525a: 94 0d sty INWK+1,x 525c: 29 7f and #$7f 525e: 60 rts 525f: a9 00 L525F lda #$00 5261: 19 02 08 L5261 ora data_buffer+2,y 5264: 19 05 08 ora data_buffer+5,y 5267: 19 08 08 ora data_buffer+8,y 526a: 29 7f and #$7f 526c: 60 rts 526d: b9 01 08 L526D lda data_buffer+1,y 5270: 20 32 5f jsr L5F32 5273: 85 ae sta $ae 5275: b9 04 08 lda data_buffer+4,y 5278: 20 32 5f jsr L5F32 527b: 65 ae adc $ae 527d: b0 0c bcs L528B 527f: 85 ae sta $ae 5281: b9 07 08 lda data_buffer+7,y 5284: 20 32 5f jsr L5F32 5287: 65 ae adc $ae 5289: 90 02 bcc L528D 528b: a9 ff L528B lda #$ff 528d: 60 L528D rts 528e: a9 cd L528E lda #$cd ;"DOCKED" 5290: 20 6e 4b jsr PrintDockedStr 5293: 20 e4 a0 jsr OutputFF 5296: 4c d6 52 jmp L52D6 5299: a2 09 :HiKillScore ldx #$09 ;start at "Elite" 529b: c9 19 cmp #$19 ;>= $1900? 529d: b0 5e bcs :PrintRating2 ;yes, done 529f: ca dex 52a0: c9 0a cmp #$0a ;>= $0a00? 52a2: b0 59 bcs :PrintRating2 ;yes, Deadly 52a4: ca dex 52a5: c9 02 cmp #$02 ;>= $0200? 52a7: b0 54 bcs :PrintRating2 ;yes, Dangerous 52a9: ca dex ;reduce to merely "Competent" 52aa: d0 51 bne :PrintRating2 ;(always) ShipStatusScreen 52ac: a9 08 lda #$08 52ae: 20 11 64 jsr L6411 52b1: 20 9e 6a jsr L6A9E 52b4: a9 07 lda #$07 52b6: 85 34 sta text_hposn 52b8: a9 7e lda #$7e ;(multi-line commander / system / "condition:") 52ba: 20 a6 4e jsr PrintFlightTokLine 52bd: a9 0f lda #$0f ;? 52bf: a4 ba ldy docked_flag 52c1: d0 cb bne L528E 52c3: a9 e6 lda #$e6 ;"Green" 52c5: ac 6b 02 ldy PLAYER_STATE?+42 52c8: be 43 02 ldx PLAYER_STATE?+2,y 52cb: f0 06 beq L52D3 52cd: a4 d6 ldy $d6 52cf: c0 80 cpy #$80 52d1: 69 01 adc #$01 ;"Red" 52d3: 20 39 71 L52D3 jsr PrintTokFF 52d6: a9 7d L52D6 lda #$7d ;"$$$$$$.0 Cr Legal Status:" 52d8: 20 73 64 jsr PrintTokSpc 52db: a9 13 lda #$13 ;"Clean" 52dd: ac c3 02 ldy player_fug_inno 52e0: f0 04 beq L52E6 52e2: c0 32 cpy #$32 52e4: 69 01 adc #$01 ;"Offender" 52e6: 20 39 71 L52E6 jsr PrintTokFF 52e9: a9 10 lda #$10 ;"Rating:" 52eb: 20 73 64 jsr PrintTokSpc ; Compute player rating. 52ee: ad d7 02 lda kill_score+1 ;kill score >= 256? 52f1: d0 a6 bne :HiKillScore ;yes, use different function 52f3: aa tax ;X-reg=0 52f4: ad d6 02 lda kill_score ;set X-reg to log2(score)-2 52f7: 4a lsr A ;divide by 4 52f8: 4a lsr A 52f9: e8 L52F9 inx ;inc result until dividing by 2 yields zero 52fa: 4a lsr A ;$00-07=1, $08-0F=2, $10-$1f=3, etc. 52fb: d0 fc bne L52F9 ;Harmless to Competent 52fd: 8a :PrintRating2 txa 52fe: 18 clc 52ff: 69 15 adc #$15 ;"Harmless" - 1 5301: 20 39 71 jsr PrintTokFF 5304: a9 12 lda #$12 ;"EQUIPMENT:" 5306: 20 70 53 jsr PrintTokFFHposn 5309: ad bd 02 lda have_escape_pod 530c: f0 05 beq L5313 530e: a9 70 lda #$70 ;"Escape Pod" 5310: 20 70 53 jsr PrintTokFFHposn 5313: ad b8 02 L5313 lda have_fuel_scoop 5316: f0 05 beq L531D 5318: a9 6f lda #$6f ;"Fuel Scoops" 531a: 20 70 53 jsr PrintTokFFHposn 531d: ad b7 02 L531D lda have_ecm 5320: f0 05 beq L5327 5322: a9 6c lda #$6c ;"E.C.M. System" 5324: 20 70 53 jsr PrintTokFFHposn 5327: a9 71 L5327 lda #$71 5329: 85 c0 sta $c0 532b: a8 L532B tay 532c: be 48 02 ldx PLAYER_STATE?+7,y 532f: f0 03 beq L5334 5331: 20 70 53 jsr PrintTokFFHposn 5334: e6 c0 L5334 inc $c0 5336: a5 c0 lda $c0 5338: c9 75 cmp #$75 533a: 90 ef bcc L532B 533c: a2 00 ldx #$00 533e: 86 bd L533E stx $bd 5340: bc 9f 02 ldy $029f,x 5343: f0 23 beq L5368 5345: 8a txa 5346: 18 clc 5347: 69 60 adc #$60 5349: 20 73 64 jsr PrintTokSpc 534c: a9 67 lda #$67 534e: a6 bd ldx $bd 5350: bc 9f 02 ldy $029f,x 5353: c0 8f cpy #$8f 5355: d0 02 bne L5359 5357: a9 68 lda #$68 5359: c0 97 L5359 cpy #$97 535b: d0 02 bne L535F 535d: a9 75 lda #$75 535f: c0 32 L535F cpy #$32 5361: d0 02 bne L5365 5363: a9 76 lda #$76 5365: 20 70 53 L5365 jsr PrintTokFFHposn 5368: a6 bd L5368 ldx $bd 536a: e8 inx 536b: e0 04 cpx #$04 536d: 90 cf bcc L533E 536f: 60 rts 5370: 20 39 71 PrintTokFFHposn jsr PrintTokFF 5373: a9 06 lda #$06 5375: 85 34 sta text_hposn 5377: 60 rts 5378: a5 7d L5378 lda $7d 537a: 85 af sta $af 537c: 29 80 and #$80 537e: 85 d0 sta $d0 5380: 55 0e eor INWK+2,x 5382: 30 18 bmi L539C 5384: a5 7b lda $7b 5386: 18 clc 5387: 75 0c adc polyobj_xpos_lo,x 5389: 85 7b sta $7b 538b: a5 7c lda $7c 538d: 75 0d adc INWK+1,x 538f: 85 7c sta $7c 5391: a5 7d lda $7d 5393: 75 0e adc INWK+2,x 5395: 29 7f and #$7f 5397: 05 d0 ora $d0 5399: 85 7d sta $7d 539b: 60 rts 539c: a5 af L539C lda $af 539e: 29 7f and #$7f 53a0: 85 af sta $af 53a2: b5 0c lda polyobj_xpos_lo,x 53a4: 38 sec 53a5: e5 7b sbc $7b 53a7: 85 7b sta $7b 53a9: b5 0d lda INWK+1,x 53ab: e5 7c sbc $7c 53ad: 85 7c sta $7c 53af: b5 0e lda INWK+2,x 53b1: 29 7f and #$7f 53b3: e5 af sbc $af 53b5: 09 80 ora #$80 53b7: 45 d0 eor $d0 53b9: 85 7d sta $7d 53bb: b0 16 bcs L53D3 53bd: a9 01 lda #$01 53bf: e5 7b sbc $7b 53c1: 85 7b sta $7b 53c3: a9 00 lda #$00 53c5: e5 7c sbc $7c 53c7: 85 7c sta $7c 53c9: a9 00 lda #$00 53cb: e5 7d sbc $7d 53cd: 29 7f and #$7f 53cf: 05 d0 ora $d0 53d1: 85 7d sta $7d 53d3: 60 L53D3 rts 53d4: b5 0d L53D4 lda INWK+1,x 53d6: 29 7f and #$7f 53d8: 4a lsr A 53d9: 85 d0 sta $d0 53db: b5 0c lda polyobj_xpos_lo,x 53dd: 38 sec 53de: e5 d0 sbc $d0 53e0: 85 ae sta $ae 53e2: b5 0d lda INWK+1,x 53e4: e9 00 sbc #$00 53e6: 85 af sta $af 53e8: b9 0c 00 lda polyobj_xpos_lo,y 53eb: 85 31 sta $31 53ed: b9 0d 00 lda INWK+1,y 53f0: 29 80 and #$80 53f2: 85 d0 sta $d0 53f4: b9 0d 00 lda INWK+1,y 53f7: 29 7f and #$7f 53f9: 4a lsr A 53fa: 66 31 ror $31 53fc: 4a lsr A 53fd: 66 31 ror $31 53ff: 4a lsr A 5400: 66 31 ror $31 5402: 4a lsr A 5403: 66 31 ror $31 5405: 05 d0 ora $d0 5407: 45 c5 eor $c5 5409: 86 ad stx $ad 540b: 20 68 60 jsr ADD 540e: 85 7b sta $7b 5410: 86 7a stx $7a 5412: a6 ad ldx $ad 5414: b9 0d 00 lda INWK+1,y 5417: 29 7f and #$7f 5419: 4a lsr A 541a: 85 d0 sta $d0 541c: b9 0c 00 lda polyobj_xpos_lo,y 541f: 38 sec 5420: e5 d0 sbc $d0 5422: 85 ae sta $ae 5424: b9 0d 00 lda INWK+1,y 5427: e9 00 sbc #$00 5429: 85 af sta $af 542b: b5 0c lda polyobj_xpos_lo,x 542d: 85 31 sta $31 542f: b5 0d lda INWK+1,x 5431: 29 80 and #$80 5433: 85 d0 sta $d0 5435: b5 0d lda INWK+1,x 5437: 29 7f and #$7f 5439: 4a lsr A 543a: 66 31 ror $31 543c: 4a lsr A 543d: 66 31 ror $31 543f: 4a lsr A 5440: 66 31 ror $31 5442: 4a lsr A 5443: 66 31 ror $31 5445: 05 d0 ora $d0 5447: 49 80 eor #$80 5449: 45 c5 eor $c5 544b: 86 ad stx $ad 544d: 20 68 60 jsr ADD 5450: 99 0d 00 sta INWK+1,y 5453: 96 0c stx polyobj_xpos_lo,y 5455: a6 ad ldx $ad 5457: a5 7a lda $7a 5459: 95 0c sta polyobj_xpos_lo,x 545b: a5 7b lda $7b 545d: 95 0d sta INWK+1,x 545f: 60 rts num_format_thing? 5460: 48 76 e8 00 .bulk $48,$76,$e8,$00 5464: a9 03 PrintNumInX? lda #$03 5466: a0 00 L5466 ldy #$00 5468: 85 ac L5468 sta $ac 546a: a9 00 lda #$00 546c: 85 7a sta $7a 546e: 85 7b sta $7b 5470: 84 7c sty $7c 5472: 86 7d stx $7d 5474: a2 0b PrintNumber? ldx #$0b 5476: 86 d0 stx $d0 5478: 08 php 5479: 90 04 bcc L547F 547b: c6 d0 dec $d0 547d: c6 ac dec $ac 547f: a9 0b L547F lda #$0b 5481: 38 sec 5482: 85 b2 sta $b2 5484: e5 ac sbc $ac 5486: 85 ac sta $ac 5488: e6 ac inc $ac 548a: a0 00 ldy #$00 548c: 84 af sty $af 548e: 4c d0 54 jmp L54D0 5491: 06 7d L5491 asl $7d 5493: 26 7c rol $7c 5495: 26 7b rol $7b 5497: 26 7a rol $7a 5499: 26 af rol $af 549b: a2 03 ldx #$03 549d: b5 7a L549D lda $7a,x 549f: 95 6e sta $6e,x 54a1: ca dex 54a2: 10 f9 bpl L549D 54a4: a5 af lda $af 54a6: 85 72 sta $72 54a8: 06 7d asl $7d 54aa: 26 7c rol $7c 54ac: 26 7b rol $7b 54ae: 26 7a rol $7a 54b0: 26 af rol $af 54b2: 06 7d asl $7d 54b4: 26 7c rol $7c 54b6: 26 7b rol $7b 54b8: 26 7a rol $7a 54ba: 26 af rol $af 54bc: 18 clc 54bd: a2 03 ldx #$03 54bf: b5 7a L54BF lda $7a,x 54c1: 75 6e adc $6e,x 54c3: 95 7a sta $7a,x 54c5: ca dex 54c6: 10 f7 bpl L54BF 54c8: a5 72 lda $72 54ca: 65 af adc $af 54cc: 85 af sta $af 54ce: a0 00 ldy #$00 54d0: a2 03 L54D0 ldx #$03 54d2: 38 sec 54d3: b5 7a L54D3 lda $7a,x 54d5: fd 60 54 sbc num_format_thing?,x 54d8: 95 6e sta $6e,x 54da: ca dex 54db: 10 f6 bpl L54D3 54dd: a5 af lda $af 54df: e9 17 sbc #$17 54e1: 85 72 sta $72 54e3: 90 11 bcc L54F6 54e5: a2 03 ldx #$03 54e7: b5 6e L54E7 lda $6e,x 54e9: 95 7a sta $7a,x 54eb: ca dex 54ec: 10 f9 bpl L54E7 54ee: a5 72 lda $72 54f0: 85 af sta $af 54f2: c8 iny 54f3: 4c d0 54 jmp L54D0 54f6: 98 L54F6 tya 54f7: d0 0c bne L5505 54f9: a5 d0 lda $d0 54fb: f0 08 beq L5505 54fd: c6 ac dec $ac 54ff: 10 0e bpl L550F 5501: a9 20 lda #$20 5503: d0 07 bne L550C 5505: a0 00 L5505 ldy #$00 5507: 84 d0 sty $d0 5509: 18 clc 550a: 69 30 adc #$30 550c: 20 33 55 L550C jsr PrintChar 550f: c6 d0 L550F dec $d0 5511: 10 02 bpl L5515 5513: e6 d0 inc $d0 5515: c6 b2 L5515 dec $b2 5517: 30 0d bmi L5526 5519: d0 08 bne L5523 551b: 28 plp 551c: 90 05 bcc L5523 551e: a9 2e lda #$2e 5520: 20 33 55 jsr PrintChar 5523: 4c 91 54 L5523 jmp L5491 5526: 60 L5526 rts 5527: 20 text_ucase_mask .dd1 $20 5528: ff txt_lcase_flag .dd1 $ff 5529: 00 txt_flight_flag .dd1 $00 552a: 00 txt_buffer_flag .dd1 $00 txt_buffer_index 552b: 00 .dd1 $00 552c: 00 text_ucase_flag .dd1 $00 552d: ff text_lcase_mask .dd1 $ff 552e: a9 .dd1 $a9 552f: 0c .dd1 $0c 5530: 2c .dd1 $2c 5531: a9 41 PrintCharA lda #‘A’ NOTE: C64 $2f24 (code_2A84.asm) ; ; Print a character. ; ; On entry: ; A-reg: ASCII value ; ; • Clear variables ]saved_x .var $0a {addr/1} 5533: 86 0a PrintChar stx ]saved_x ;preserve X-reg 5535: a2 ff ldx #$ff ;disable lower-case transform 5537: 8e 2d 55 stx text_lcase_mask 553a: c9 2e cmp #‘.’ 553c: f0 11 beq :SetFlag 553e: c9 3a cmp #‘:’ 5540: f0 0d beq :SetFlag 5542: c9 0a cmp #$0a ;LF 5544: f0 09 beq :SetFlag 5546: c9 0c cmp #$0c ;newline 5548: f0 05 beq :SetFlag 554a: c9 20 cmp #$20 ;space 554c: f0 01 beq :SetFlag 554e: e8 inx ;X=0, clearing flag 554f: 8e 28 55 :SetFlag stx txt_lcase_flag 5552: a6 0a ldx ]saved_x 5554: 2c 2a 55 bit txt_buffer_flag ;using buffered printing? 5557: 30 03 bmi :Buffered ;yes, write to buffer 5559: 4c e6 a0 jmp OutputChar ;no, output directly 555c: 2c 2a 55 :Buffered bit txt_buffer_flag 555f: 70 04 bvs L5565 5561: c9 0c cmp #$0c ;newline? 5563: f0 0d beq L5572 5565: ae 2b 55 L5565 ldx txt_buffer_index 5568: 9d 00 01 sta BUFFER_0100,x ;text buffer 556b: a6 0a ldx ]saved_x 556d: ee 2b 55 inc txt_buffer_index 5570: 18 clc 5571: 60 rts 5572: 8a L5572 txa 5573: 48 pha 5574: 98 tya 5575: 48 pha 5576: ae 2b 55 L5576 ldx txt_buffer_index 5579: f0 78 beq L55F3 557b: e0 1f cpx #$1f 557d: 90 71 bcc L55F0 557f: 46 0b lsr $0b 5581: a5 0b L5581 lda $0b 5583: 30 04 bmi L5589 5585: a9 40 lda #$40 5587: 85 0b sta $0b 5589: a0 1d L5589 ldy #$1d 558b: ad 1e 01 L558B lda $011e 558e: c9 20 cmp #$20 5590: f0 2d beq L55BF 5592: 88 L5592 dey 5593: 30 ec bmi L5581 5595: f0 ea beq L5581 5597: b9 00 01 lda BUFFER_0100,y 559a: c9 20 cmp #$20 559c: d0 f4 bne L5592 559e: 06 0b asl $0b 55a0: 30 f0 bmi L5592 55a2: 84 0a sty ]saved_x 55a4: ac 2b 55 ldy txt_buffer_index 55a7: b9 00 01 L55A7 lda BUFFER_0100,y 55aa: 99 01 01 sta $0101,y 55ad: 88 dey 55ae: c4 0a cpy ]saved_x 55b0: b0 f5 bcs L55A7 55b2: ee 2b 55 inc txt_buffer_index 55b5: d9 00 01 L55B5 cmp BUFFER_0100,y 55b8: d0 d1 bne L558B 55ba: 88 dey 55bb: 10 f8 bpl L55B5 55bd: 30 c2 bmi L5581 55bf: a2 1e L55BF ldx #$1e 55c1: 20 e3 55 jsr L55E3 55c4: a9 0c lda #$0c 55c6: 20 e6 a0 jsr OutputChar 55c9: ad 2b 55 lda txt_buffer_index 55cc: e9 1e sbc #$1e 55ce: 8d 2b 55 sta txt_buffer_index 55d1: aa tax 55d2: f0 1f beq L55F3 55d4: a0 00 ldy #$00 55d6: e8 inx 55d7: b9 1f 01 L55D7 lda $011f,y 55da: 99 00 01 sta BUFFER_0100,y 55dd: c8 iny 55de: ca dex 55df: d0 f6 bne L55D7 55e1: f0 93 beq L5576 55e3: a0 00 L55E3 ldy #$00 55e5: b9 00 01 L55E5 lda BUFFER_0100,y 55e8: 20 e6 a0 jsr OutputChar 55eb: c8 iny 55ec: ca dex 55ed: d0 f6 bne L55E5 55ef: 60 rts 55f0: 20 e3 55 L55F0 jsr L55E3 55f3: 8e 2b 55 L55F3 stx txt_buffer_index 55f6: 68 pla 55f7: a8 tay 55f8: 68 pla 55f9: aa tax 55fa: a9 0c lda #$0c 55fc: 2c bit ▼ $07a9 55fd: a9 07 PrintBell lda #$07 55ff: 4c e6 a0 jmp OutputChar 5602: a0 00 DrawHud? ldy #$00 5604: a9 d2 lda #$d2 5606: 85 7a sta $7a 5608: a2 14 ldx #$14 560a: a5 b6 lda $b6 560c: 29 08 and #$08 560e: 2d 5b 45 and ptb_kbd_flash 5611: f0 02 beq L5615 5613: a2 0c ldx #$0c 5615: 86 7c L5615 stx $7c 5617: a5 a9 lda player_speed 5619: 20 71 56 jsr L5671 561c: a9 0c lda #$0c 561e: 85 35 sta $35 5620: a5 6b lda $6b 5622: 4a lsr A 5623: 24 6d bit $6d 5625: 20 c4 56 jsr L56C4 5628: a5 67 lda $67 562a: 0a asl A 562b: 24 a7 bit $a7 562d: 20 c4 56 jsr L56C4 5630: a5 d6 lda $d6 5632: 4a lsr A 5633: 85 7b L5633 sta $7b 5635: 20 71 56 jsr L5671 5638: a5 7b lda $7b 563a: 38 sec 563b: e9 20 sbc #$20 563d: b0 02 bcs L5641 563f: a9 00 lda #$00 5641: c0 07 L5641 cpy #$07 5643: d0 ee bne L5633 5645: a9 10 lda #$10 5647: 85 7a sta $7a 5649: a5 d4 lda $d4 564b: 20 6e 56 jsr L566E 564e: a5 d5 lda $d5 5650: 20 6e 56 jsr L566E 5653: ad 9c 02 lda player_fuel 5656: 20 70 56 jsr L5670 5659: ad 7c 02 lda lcoord_swap_flag-1 565c: 20 6e 56 jsr L566E 565f: ad 6f 02 lda PLAYER_STATE?+46 5662: 20 6e 56 jsr L566E 5665: ad 74 02 lda player_laser_temp 5668: 20 6e 56 jsr L566E 566b: 4c 45 74 jmp L7445 566e: 4a L566E lsr A 566f: 4a lsr A 5670: 4a L5670 lsr A 5671: c9 20 L5671 cmp #$20 5673: 90 02 bcc L5677 5675: a9 1f lda #$1f 5677: be 0a 57 L5677 ldx L570A,y 567a: d9 fd 56 cmp L56FD,y 567d: 90 03 bcc L5682 567f: be 17 57 ldx L5717,y 5682: e0 ff L5682 cpx #$ff 5684: d0 03 bne L5689 5686: a6 7c ldx $7c 5688: 18 clc 5689: c8 L5689 iny 568a: 48 pha 568b: d9 43 45 cmp L4543,y 568e: d0 06 bne L5696 5690: 8a txa 5691: d9 de 02 cmp $02de,y 5694: f0 2c beq L56C2 5696: 8a L5696 txa 5697: be de 02 ldx $02de,y 569a: 99 de 02 sta $02de,y 569d: b9 43 45 lda L4543,y 56a0: 20 aa 56 jsr L56AA 56a3: be de 02 ldx $02de,y 56a6: 68 pla 56a7: 99 43 45 sta L4543,y 56aa: 86 35 L56AA stx $35 56ac: be ef 56 ldx L56F0-1,y 56af: 86 6f stx $6f 56b1: a6 7a ldx $7a 56b3: 86 6e stx $6e 56b5: 18 clc 56b6: 65 7a adc $7a 56b8: 29 fe and #$fe 56ba: 85 70 sta $70 56bc: 20 bf 56 jsr L56BF 56bf: 4c 8b 9e L56BF jmp DrawDoubleHorizLine 56c2: 68 L56C2 pla 56c3: 60 L56C3 rts 56c4: 10 05 L56C4 bpl L56CB 56c6: 49 ff eor #$ff 56c8: 18 clc 56c9: 69 01 adc #$01 56cb: c8 L56CB iny 56cc: 18 clc 56cd: 69 e0 adc #$e0 56cf: d9 43 45 cmp L4543,y 56d2: f0 ef beq L56C3 56d4: 48 pha 56d5: b9 43 45 lda L4543,y 56d8: f0 03 beq L56DD 56da: 20 e1 56 jsr L56E1 56dd: 68 L56DD pla 56de: 99 43 45 sta L4543,y 56e1: 85 6e L56E1 sta $6e 56e3: b9 ef 56 lda L56F0-1,y 56e6: 85 6f sta $6f 56e8: 18 clc 56e9: 69 06 adc #$06 56eb: 85 71 sta $71 56ed: 4c 62 9f jmp DrawVerticalLine 56f0: 89 L56F0 .dd1 $89 56f1: 90 .dd1 $90 56f2: 98 .dd1 $98 56f3: b9 b1 a9 a1 .str “91)!” 56f7: 89 .dd1 $89 56f8: 91 .dd1 $91 56f9: 99 .dd1 $99 56fa: b1 .dd1 $b1 56fb: a1 .dd1 $a1 56fc: a9 .dd1 $a9 56fd: 1c L56FD .dd1 $1c 56fe: 00 .dd1 $00 56ff: 00 .dd1 $00 5700: 10 .dd1 $10 5701: 00 .dd1 $00 5702: 00 .dd1 $00 5703: 00 .dd1 $00 5704: 08 .dd1 $08 5705: 08 .dd1 $08 5706: 00 .dd1 $00 5707: 08 .dd1 $08 5708: 18 .dd1 $18 5709: 18 .dd1 $18 570a: 0c L570A .dd1 $0c 570b: 0c .dd1 $0c 570c: 0c .dd1 $0c 570d: ff .dd1 $ff 570e: 04 .dd1 $04 570f: 04 .dd1 $04 5710: 04 .dd1 $04 5711: ff .dd1 $ff 5712: ff .dd1 $ff 5713: 08 .dd1 $08 5714: ff .dd1 $ff 5715: 10 .dd1 $10 5716: 10 .dd1 $10 5717: ff L5717 .dd1 $ff 5718: 0c .dd1 $0c 5719: 0c .dd1 $0c 571a: 04 04 04 04+ .fill 6,$04 5720: 08 .dd1 $08 5721: 08 .dd1 $08 5722: ff .dd1 $ff 5723: ff .dd1 $ff ; BBC .ESCAPE "your Escape capsule launch" 5724: 20 c4 7a EjectEscape jsr RES2 5727: a2 0b ldx #11 ;Cobra Mk III 5729: 86 b8 stx $b8 572b: 20 14 5c jsr FRS1 572e: b0 05 bcs :Es1 5730: a2 18 ldx #$18 5732: 20 14 5c jsr FRS1 5735: a9 08 :Es1 lda #$08 ;"modest speed" 5737: 85 27 sta polyobj_vertex_lo 5739: a9 c2 lda #$c2 ;"rotz, pitch counter" 573b: 85 2a sta polyobj_pitch 573d: 4a lsr A 573e: 85 2c sta polyobj_attack 5740: 20 5e 90 L5740 jsr MVEIT 5743: 20 3e 88 jsr DrawObject 5746: c6 2c dec polyobj_attack 5748: d0 f6 bne L5740 574a: 20 83 a2 jsr SCAN 574d: a9 00 lda #$00 ;"zero-out cargo, including gems" 574f: a2 10 ldx #$10 ;"start at alien items" 5751: 9d a6 02 L5751 sta player_cargo,x 5754: ca dex 5755: 10 fa bpl L5751 5757: 8d c3 02 sta player_fug_inno ;zero out fugitive status 575a: 8d bd 02 sta have_escape_pod ;no more escape pod 575d: a9 46 lda #70 ;max fuel allowed = 70 575f: 8d 9c 02 sta player_fuel 5762: 4c 84 48 jmp GOIN_jmp 5765: a9 0e L5765 lda #$0e 5767: 20 6e 4b jsr PrintDockedStr 576a: 20 60 69 jsr L6960 576d: 20 93 6a jsr L6A93 5770: a9 00 lda #$00 5772: 85 c1 sta $c1 5774: 20 7f 4c L5774 jsr SetBufferFlag 5777: 20 af 70 jsr :PrintSelPlanet 577a: ae 2b 55 ldx txt_buffer_index 577d: b5 11 lda INWK+5,x 577f: c9 0d cmp #$0d 5781: d0 0d bne L5790 5783: ca L5783 dex 5784: b5 11 lda INWK+5,x 5786: 09 20 ora #$20 5788: dd 00 01 cmp BUFFER_0100,x 578b: f0 f6 beq L5783 578d: 8a txa 578e: 30 15 bmi L57A5 5790: 20 18 64 L5790 jsr L6418 5793: e6 c1 inc $c1 5795: d0 dd bne L5774 5797: 20 9e 6a jsr L6A9E 579a: 20 60 69 jsr L6960 579d: 20 52 95 jsr Noise1? 57a0: a9 d7 lda #$d7 57a2: 4c 6e 4b jmp PrintDockedStr 57a5: a5 95 L57A5 lda $95 57a7: 85 e0 sta $e0 57a9: a5 93 lda $93 57ab: 85 e1 sta $e1 57ad: 20 9e 6a jsr L6A9E 57b0: 20 60 69 jsr L6960 57b3: 20 82 4c jsr ClearBufferFlag 57b6: 4c ef 7d jmp ShowDistToPlanet 57b9: a5 0c L57B9 lda polyobj_xpos_lo 57bb: 05 0f ora polyobj_ypos_lo 57bd: 05 12 ora polyobj_zpos_lo 57bf: d0 05 bne L57C6 57c1: a9 50 lda #$50 57c3: 20 b4 74 jsr L74B4 57c6: a2 04 L57C6 ldx #$04 57c8: d0 61 bne L582B ; BBC .TA34 "Tactics, missile attacking player, from TA18" 57ca: a9 00 L57CA lda #$00 57cc: 20 20 7e jsr L7E20 57cf: f0 03 beq L57D4 57d1: 4c 00 59 jmp L5900 57d4: 20 2e 58 L57D4 jsr L582E 57d7: 20 6f 95 jsr MakeNoise2? 57da: a9 fa lda #$fa 57dc: 4c b4 74 jmp L74B4 57df: a5 6a L57DF lda ecm_active_flag? 57e1: d0 d6 bne L57B9 57e3: a5 2c lda polyobj_attack 57e5: 0a asl A 57e6: 30 e2 bmi L57CA 57e8: 4a lsr A 57e9: aa tax 57ea: bd 7e 4e lda L4E7E,x 57ed: 85 5e sta $5e 57ef: bd 7f 4e lda L4E7F,x 57f2: 20 15 5b jsr L5B15 57f5: a5 3a lda $3a 57f7: 05 3d ora $3d 57f9: 05 40 ora $40 57fb: 29 7f and #$7f 57fd: 05 39 ora $39 57ff: 05 3c ora $3c 5801: 05 3f ora $3f 5803: d0 2f bne L5834 5805: a5 2c lda polyobj_attack 5807: c9 82 cmp #$82 5809: f0 ae beq L57B9 580b: a0 1f ldy #$1f 580d: b1 5e lda ($5e),y 580f: 2c 3c 58 bit L583B+1 5812: d0 04 bne L5818 5814: 09 80 ora #$80 5816: 91 5e sta ($5e),y 5818: a5 0c L5818 lda polyobj_xpos_lo 581a: 05 0f ora polyobj_ypos_lo 581c: 05 12 ora polyobj_zpos_lo 581e: d0 05 bne L5825 5820: a9 50 lda #$50 5822: 20 b4 74 jsr L74B4 5825: a5 2c L5825 lda polyobj_attack 5827: 29 7f and #$7f 5829: 4a lsr A 582a: aa tax 582b: 20 2d 95 L582B jsr CountKill 582e: 06 2b L582E asl polyobj_vis 5830: 38 sec 5831: 66 2b ror polyobj_vis 5833: 60 L5833 rts 5834: 20 7c 7b L5834 jsr GetRandom 5837: c9 10 cmp #$10 5839: b0 07 bcs L5842 583b: a0 20 L583B ldy #$20 583d: b1 5e lda ($5e),y 583f: 4a lsr A 5840: b0 03 bcs L5845 5842: 4c 09 59 L5842 jmp L5909 5845: 4c 0f a0 L5845 jmp ActivateEcm ; BBC .TACTICS 5848: a9 03 TACTICS lda #$03 584a: 85 c4 sta $c4 584c: a9 04 lda #$04 584e: 85 c5 sta $c5 5850: a9 16 lda #$16 5852: 85 be sta $be 5854: e0 01 cpx #$01 5856: f0 87 beq L57DF 5858: e0 02 cpx #$02 585a: d0 2e bne L588A 585c: a5 30 lda $30 585e: 29 04 and #$04 5860: d0 13 bne L5875 5862: ad 54 02 lda PLAYER_STATE?+19 5865: d0 cc bne L5833 5867: 20 7c 7b jsr GetRandom 586a: c9 fd cmp #$fd 586c: 90 c5 bcc L5833 586e: 29 01 and #$01 5870: 69 08 adc #$08 5872: aa tax 5873: d0 10 bne L5885 5875: 20 7c 7b L5875 jsr GetRandom 5878: c9 f0 cmp #$f0 587a: 90 b7 bcc L5833 587c: ad 5a 02 lda PLAYER_STATE?+25 587f: c9 04 cmp #$04 5881: b0 40 bcs L58C3 5883: a2 10 ldx #$10 5885: a9 f1 L5885 lda #$f1 5887: 4c 9e 5c jmp LaunchObject1 588a: e0 0f L588A cpx #$0f 588c: d0 1c bne L58AA 588e: 20 7c 7b jsr GetRandom 5891: c9 c8 cmp #$c8 5893: 90 2e bcc L58C3 5895: a2 00 ldx #$00 5897: 86 2c stx polyobj_attack 5899: a2 24 ldx #$24 589b: 86 30 stx $30 589d: 29 03 and #$03 589f: 69 11 adc #$11 58a1: aa tax 58a2: 20 85 58 jsr L5885 58a5: a9 00 lda #$00 58a7: 85 2c sta polyobj_attack 58a9: 60 rts 58aa: a0 0e L58AA ldy #$0e 58ac: a5 2f lda $2f 58ae: d1 5a cmp (hull_ptr),y 58b0: b0 02 bcs L58B4 58b2: e6 2f inc $2f 58b4: e0 1e L58B4 cpx #$1e 58b6: d0 0c bne L58C4 58b8: ad 67 02 lda PLAYER_STATE?+38 58bb: d0 07 bne L58C4 58bd: 46 2c lsr polyobj_attack 58bf: 06 2c asl polyobj_attack 58c1: 46 27 lsr polyobj_vertex_lo 58c3: 60 L58C3 rts 58c4: 20 7c 7b L58C4 jsr GetRandom 58c7: a5 30 lda $30 58c9: 4a lsr A 58ca: 90 04 bcc L58D0 58cc: e0 32 cpx #$32 58ce: b0 f3 bcs L58C3 58d0: 4a L58D0 lsr A 58d1: 90 0f bcc L58E2 58d3: ae c3 02 ldx player_fug_inno 58d6: e0 28 cpx #$28 58d8: 90 08 bcc L58E2 58da: a5 30 lda $30 58dc: 09 04 ora #$04 58de: 85 30 sta $30 58e0: 4a lsr A 58e1: 4a lsr A 58e2: 4a L58E2 lsr A 58e3: b0 0d bcs L58F2 58e5: 4a lsr A 58e6: 4a lsr A 58e7: 90 03 bcc L58EC 58e9: 4c 50 5a jmp L5A50 58ec: 20 74 82 L58EC jsr L8274 58ef: 4c 40 5a jmp L5A40 58f2: 4a L58F2 lsr A 58f3: 90 0b bcc L5900 58f5: ad 4c 02 lda PLAYER_STATE?+11 58f8: f0 06 beq L5900 58fa: a5 2c lda polyobj_attack 58fc: 29 81 and #$81 58fe: 85 2c sta polyobj_attack 5900: a2 08 L5900 ldx #$08 5902: b5 0c L5902 lda polyobj_xpos_lo,x 5904: 95 38 sta $38,x 5906: ca dex 5907: 10 f9 bpl L5902 5909: 20 83 82 L5909 jsr L8283 590c: a0 0a ldy #$0a 590e: 20 49 60 jsr TAS3 5911: 85 bd sta $bd 5913: a5 b8 lda $b8 5915: c9 01 cmp #$01 5917: d0 03 bne L591C 5919: 4c df 59 jmp L59DF 591c: c9 0e L591C cmp #$0e 591e: d0 15 bne L5935 5920: 20 7c 7b jsr GetRandom 5923: c9 c8 cmp #$c8 5925: 90 0e bcc L5935 5927: 20 7c 7b jsr GetRandom 592a: a2 17 ldx #$17 592c: c9 64 cmp #$64 592e: b0 02 bcs L5932 5930: a2 11 ldx #$11 5932: 4c 85 58 L5932 jmp L5885 5935: 20 7c 7b L5935 jsr GetRandom 5938: c9 fa cmp #$fa 593a: 90 07 bcc L5943 593c: 20 7c 7b jsr GetRandom 593f: 09 68 ora #$68 5941: 85 29 sta polyobj_roll 5943: a0 0e L5943 ldy #$0e 5945: b1 5a lda (hull_ptr),y 5947: 4a lsr A 5948: c5 2f cmp $2f 594a: 90 4c bcc L5998 594c: 4a lsr A 594d: 4a lsr A 594e: c5 2f cmp $2f 5950: 90 1f bcc L5971 5952: 20 7c 7b jsr GetRandom 5955: c9 e6 cmp #$e6 5957: 90 18 bcc L5971 5959: a6 b8 ldx $b8 595b: bd 3f a3 lda hull_NEWB-1,x ;has escape pod? 595e: 10 11 bpl L5971 ;no 5960: a5 30 lda $30 5962: 29 f0 and #$f0 5964: 85 30 sta $30 5966: a0 24 ldy #$24 5968: 91 5c sta (polyobj_ptr),y 596a: a9 00 lda #$00 596c: 85 2c sta polyobj_attack 596e: 4c 9a 5c jmp LaunchEscape 5971: a5 2b L5971 lda polyobj_vis 5973: 29 07 and #$07 5975: f0 21 beq L5998 5977: 85 d0 sta $d0 5979: 20 7c 7b jsr GetRandom 597c: 29 1f and #$1f 597e: c5 d0 cmp $d0 5980: b0 16 bcs L5998 5982: a5 6a lda ecm_active_flag? 5984: d0 12 bne L5998 5986: c6 2b dec polyobj_vis 5988: a5 b8 lda $b8 ;check ship type 598a: c9 1d cmp #29 ;Thargoid? 598c: d0 07 bne :NotThargoid 598e: a2 1e ldx #30 ;launch Thargon 5990: a5 2c lda polyobj_attack 5992: 4c 9e 5c jmp LaunchObject1 5995: 4c 1c 95 :NotThargoid jmp LaunchMissile NOTE: BBC .TA3 ; "Good energy > max/2" 5998: a9 00 L5998 lda #$00 599a: 20 20 7e jsr L7E20 599d: 29 e0 and #$e0 599f: d0 27 bne :NoLaser 59a1: a6 bd ldx $bd 59a3: e0 a0 cpx #$a0 59a5: 90 21 bcc :NoLaser 59a7: a0 13 ldy #$13 ;00LLLMMM laser/missile data for hull 59a9: b1 5a lda (hull_ptr),y 59ab: 29 f8 and #$f8 ;keep laser power 59ad: f0 19 beq :NoLaser 59af: a5 2b lda polyobj_vis 59b1: 09 40 ora #$40 ;set bit 6 (laser firing at player) 59b3: 85 2b sta polyobj_vis 59b5: e0 a3 cpx #$a3 59b7: 90 0f bcc :NoLaser 59b9: b1 5a lda (hull_ptr),y 59bb: 4a lsr A 59bc: 20 b4 74 jsr L74B4 59bf: c6 28 dec $28 59c1: a5 6a lda ecm_active_flag? 59c3: d0 68 bne L5A2D 59c5: 20 c7 95 jsr MakeNoise5? 59c8: a5 13 :NoLaser lda polyobj_zpos_mi 59ca: c9 03 cmp #$03 59cc: b0 08 bcs L59D6 59ce: a5 0d lda INWK+1 59d0: 05 10 ora INWK+4 59d2: 29 fe and #$fe 59d4: f0 12 beq L59E8 59d6: 20 7c 7b L59D6 jsr GetRandom 59d9: 09 80 ora #$80 59db: c5 2c cmp polyobj_attack 59dd: b0 09 bcs L59E8 59df: 20 69 5b L59DF jsr L5B69 59e2: a5 bd lda $bd 59e4: 49 80 eor #$80 59e6: 85 bd L59E6 sta $bd 59e8: a0 10 L59E8 ldy #$10 59ea: 20 49 60 jsr TAS3 59ed: aa tax 59ee: 49 80 eor #$80 59f0: 29 80 and #$80 59f2: 85 2a sta polyobj_pitch 59f4: 8a txa 59f5: 0a asl A 59f6: c5 c5 cmp $c5 59f8: 90 06 bcc L5A00 59fa: a5 c4 lda $c4 59fc: 05 2a ora polyobj_pitch 59fe: 85 2a sta polyobj_pitch 5a00: a5 29 L5A00 lda polyobj_roll 5a02: 0a asl A 5a03: c9 20 cmp #$20 5a05: b0 1a bcs L5A21 5a07: a0 16 ldy #$16 5a09: 20 49 60 jsr TAS3 5a0c: aa tax 5a0d: 45 2a eor polyobj_pitch 5a0f: 29 80 and #$80 5a11: 49 80 eor #$80 5a13: 85 29 sta polyobj_roll 5a15: 8a txa 5a16: 0a asl A 5a17: c5 c5 cmp $c5 5a19: 90 06 bcc L5A21 5a1b: a5 c4 lda $c4 5a1d: 05 29 ora polyobj_roll 5a1f: 85 29 sta polyobj_roll 5a21: a5 bd L5A21 lda $bd 5a23: 30 09 bmi L5A2E 5a25: c5 be cmp $be 5a27: 90 05 bcc L5A2E 5a29: a9 03 lda #$03 5a2b: 85 28 sta $28 5a2d: 60 L5A2D rts 5a2e: 29 7f L5A2E and #$7f 5a30: c9 12 cmp #$12 5a32: 90 0b bcc L5A3F 5a34: a9 ff lda #$ff 5a36: a6 b8 ldx $b8 5a38: e0 01 cpx #$01 5a3a: d0 01 bne L5A3D 5a3c: 0a asl A 5a3d: 85 28 L5A3D sta $28 5a3f: 60 L5A3F rts 5a40: a0 0a L5A40 ldy #$0a 5a42: 20 49 60 jsr TAS3 5a45: c9 98 cmp #$98 5a47: 90 04 bcc L5A4D 5a49: a2 00 ldx #$00 5a4b: 86 c5 stx $c5 5a4d: 4c e6 59 L5A4D jmp L59E6 5a50: a9 06 L5A50 lda #$06 5a52: 85 c5 sta $c5 5a54: 4a lsr A 5a55: 85 c4 sta $c4 5a57: a9 1d lda #$1d 5a59: 85 be sta $be 5a5b: ad 4c 02 lda PLAYER_STATE?+11 5a5e: d0 03 bne L5A63 5a60: 4c ec 58 L5A60 jmp L58EC 5a63: 20 0f 5b L5A63 jsr L5B0F 5a66: a5 3a lda $3a 5a68: 05 3d ora $3d 5a6a: 05 40 ora $40 5a6c: 29 7f and #$7f 5a6e: d0 f0 bne L5A60 5a70: 20 a6 82 jsr L82A6 5a73: a5 ad lda $ad 5a75: 85 7a sta $7a 5a77: 20 83 82 jsr L8283 5a7a: a0 0a ldy #$0a 5a7c: 20 47 5b jsr L5B47 5a7f: 30 25 bmi L5AA6 5a81: c9 23 cmp #$23 5a83: 90 21 bcc L5AA6 5a85: a0 0a ldy #$0a 5a87: 20 49 60 jsr TAS3 5a8a: c9 a2 cmp #$a2 5a8c: b0 32 bcs L5AC0 5a8e: a5 7a lda $7a 5a90: c9 9d cmp #$9d 5a92: 90 04 bcc L5A98 5a94: a5 b8 lda $b8 5a96: 30 28 bmi L5AC0 5a98: 20 69 5b L5A98 jsr L5B69 5a9b: 20 40 5a jsr L5A40 5a9e: a2 00 L5A9E ldx #$00 5aa0: 86 28 stx $28 5aa2: e8 inx 5aa3: 86 27 stx polyobj_vertex_lo 5aa5: 60 rts 5aa6: 20 0f 5b L5AA6 jsr L5B0F 5aa9: 20 7c 5b jsr L5B7C 5aac: 20 7c 5b jsr L5B7C 5aaf: 20 83 82 jsr L8283 5ab2: 20 69 5b jsr L5B69 5ab5: 4c 40 5a jmp L5A40 5ab8: e6 28 L5AB8 inc $28 5aba: a9 7f lda #$7f 5abc: 85 29 sta polyobj_roll 5abe: d0 45 bne L5B05 5ac0: a2 00 L5AC0 ldx #$00 5ac2: 86 c5 stx $c5 5ac4: 86 2a stx polyobj_pitch 5ac6: a5 b8 lda $b8 5ac8: 10 20 bpl L5AEA 5aca: 45 6e eor $6e 5acc: 45 6f eor $6f 5ace: 0a asl A 5acf: a9 02 lda #$02 5ad1: 6a ror A 5ad2: 85 29 sta polyobj_roll 5ad4: a5 6e lda $6e 5ad6: 0a asl A 5ad7: c9 0c cmp #$0c 5ad9: b0 c3 bcs L5A9E 5adb: a5 6f lda $6f 5add: 0a asl A 5ade: a9 02 lda #$02 5ae0: 6a ror A 5ae1: 85 2a sta polyobj_pitch 5ae3: a5 6f lda $6f 5ae5: 0a asl A 5ae6: c9 0c cmp #$0c 5ae8: b0 b4 bcs L5A9E 5aea: 86 29 L5AEA stx polyobj_roll 5aec: a5 22 lda $22 5aee: 85 6e sta $6e 5af0: a5 24 lda $24 5af2: 85 6f sta $6f 5af4: a5 26 lda $26 5af6: 85 70 sta $70 5af8: a0 10 ldy #$10 5afa: 20 47 5b jsr L5B47 5afd: 0a asl A 5afe: c9 42 cmp #$42 5b00: b0 b6 bcs L5AB8 5b02: 20 9e 5a jsr L5A9E 5b05: a5 42 L5B05 lda $42 5b07: d0 05 bne L5B0E 5b09: 06 30 asl $30 5b0b: 38 sec 5b0c: 66 30 ror $30 5b0e: 60 L5B0E rts 5b0f: a9 25 L5B0F lda #$25 5b11: 85 5e sta $5e 5b13: a9 08 lda #$08 5b15: 85 5f L5B15 sta $5f 5b17: a0 02 ldy #$02 5b19: 20 23 5b jsr L5B23 5b1c: a0 05 ldy #$05 5b1e: 20 23 5b jsr L5B23 5b21: a0 08 ldy #$08 5b23: b1 5e L5B23 lda ($5e),y 5b25: 49 80 eor #$80 5b27: 85 7d sta $7d 5b29: 88 dey 5b2a: b1 5e lda ($5e),y 5b2c: 85 7c sta $7c 5b2e: 88 dey 5b2f: b1 5e lda ($5e),y 5b31: 85 7b sta $7b 5b33: 84 ac sty $ac 5b35: a6 ac ldx $ac 5b37: 20 78 53 jsr L5378 5b3a: a4 ac ldy $ac 5b3c: 95 3a sta $3a,x 5b3e: a5 7c lda $7c 5b40: 95 39 sta $39,x 5b42: a5 7b lda $7b 5b44: 95 38 sta $38,x 5b46: 60 rts 5b47: be 25 08 L5B47 ldx data_buffer+37,y 5b4a: 86 ad stx $ad 5b4c: a5 6e lda $6e 5b4e: 20 3f 60 jsr MULT12 5b51: be 27 08 ldx data_buffer+39,y 5b54: 86 ad stx $ad 5b56: a5 6f lda $6f 5b58: 20 65 60 jsr MAD 5b5b: 85 af sta $af 5b5d: 86 ae stx $ae 5b5f: be 29 08 ldx data_buffer+41,y 5b62: 86 ad stx $ad 5b64: a5 70 lda $70 5b66: 4c 65 60 jmp MAD 5b69: a5 6e L5B69 lda $6e 5b6b: 49 80 eor #$80 5b6d: 85 6e sta $6e 5b6f: a5 6f lda $6f 5b71: 49 80 eor #$80 5b73: 85 6f sta $6f 5b75: a5 70 lda $70 5b77: 49 80 eor #$80 5b79: 85 70 sta $70 5b7b: 60 rts 5b7c: 20 7f 5b L5B7C jsr L5B7F 5b7f: ad 2f 08 L5B7F lda data_buffer+47 5b82: a2 00 ldx #$00 5b84: 20 94 5b jsr L5B94 5b87: ad 31 08 lda data_buffer+49 5b8a: a2 03 ldx #$03 5b8c: 20 94 5b jsr L5B94 5b8f: ad 33 08 lda data_buffer+51 5b92: a2 06 ldx #$06 5b94: 0a L5B94 asl A 5b95: 85 ae sta $ae 5b97: a9 00 lda #$00 5b99: 6a ror A 5b9a: 49 80 eor #$80 5b9c: 55 3a eor $3a,x 5b9e: 30 0b bmi L5BAB 5ba0: a5 ae lda $ae 5ba2: 75 38 adc $38,x 5ba4: 95 38 sta $38,x 5ba6: 90 02 bcc L5BAA 5ba8: f6 39 inc $39,x 5baa: 60 L5BAA rts 5bab: b5 38 L5BAB lda $38,x 5bad: 38 sec 5bae: e5 ae sbc $ae 5bb0: 95 38 sta $38,x 5bb2: b5 39 lda $39,x 5bb4: e9 00 sbc #$00 5bb6: 95 39 sta $39,x 5bb8: b0 f0 bcs L5BAA 5bba: b5 38 lda $38,x 5bbc: 49 ff eor #$ff 5bbe: 69 01 adc #$01 5bc0: 95 38 sta $38,x 5bc2: b5 39 lda $39,x 5bc4: 49 ff eor #$ff 5bc6: 69 00 adc #$00 5bc8: 95 39 sta $39,x 5bca: b5 3a lda $3a,x 5bcc: 49 80 eor #$80 5bce: 95 3a sta $3a,x 5bd0: 4c aa 5b jmp L5BAA 5bd3: 18 L5BD3 clc 5bd4: a5 14 lda polyobj_zpos_hi 5bd6: d0 39 bne L5C11 5bd8: a5 b8 lda $b8 5bda: 30 35 bmi L5C11 5bdc: a5 2b lda polyobj_vis 5bde: 29 20 and #$20 5be0: 05 0d ora INWK+1 5be2: 05 10 ora INWK+4 5be4: d0 2b bne L5C11 5be6: a5 0c lda polyobj_xpos_lo 5be8: 20 32 5f jsr L5F32 5beb: 85 af sta $af 5bed: a5 31 lda $31 5bef: 85 ae sta $ae 5bf1: a5 0f lda polyobj_ypos_lo 5bf3: 20 32 5f jsr L5F32 5bf6: aa tax 5bf7: a5 31 lda $31 5bf9: 65 ae adc $ae 5bfb: 85 ae sta $ae 5bfd: 8a txa 5bfe: 65 af adc $af 5c00: b0 10 bcs L5C12 5c02: 85 af sta $af 5c04: a0 02 ldy #$02 5c06: b1 5a lda (hull_ptr),y 5c08: c5 af cmp $af 5c0a: d0 05 bne L5C11 5c0c: 88 dey 5c0d: b1 5a lda (hull_ptr),y 5c0f: c5 ae cmp $ae 5c11: 60 L5C11 rts 5c12: 18 L5C12 clc 5c13: 60 rts ; BBC .FRS1 "escape capsule Launched, see Cobra Mk3 ahead, or player missile ; launch." 5c14: 20 14 7b FRS1 jsr ZeroInfo 5c17: a9 1c lda #$1c 5c19: 85 0f sta polyobj_ypos_lo 5c1b: 4a lsr A 5c1c: 85 12 sta polyobj_zpos_lo 5c1e: a9 80 lda #$80 5c20: 85 11 sta INWK+5 5c22: a5 7f lda missile_thing? 5c24: 0a asl A 5c25: 09 80 ora #$80 5c27: 85 2c sta polyobj_attack 5c29: a9 60 L5C29 lda #$60 5c2b: 85 1a sta polyobj_mox2_hi 5c2d: 09 80 ora #$80 5c2f: 85 22 sta $22 5c31: a5 a9 lda player_speed 5c33: 2a rol A 5c34: 85 27 sta polyobj_vertex_lo 5c36: 8a txa 5c37: 4c 45 75 jmp L7545 5c3a: a2 01 L5C3A ldx #$01 5c3c: 20 14 5c jsr FRS1 5c3f: 90 54 bcc PrintMslJammed 5c41: a6 7f ldx missile_thing? 5c43: 20 7d 63 jsr GetInfo 5c46: bd 41 02 lda PLAYER_STATE?,x 5c49: 20 59 5c jsr L5C59 5c4c: a0 00 ldy #$00 5c4e: 20 e6 75 jsr L75E6 5c51: ce c2 02 dec missile_armed_flag? 5c54: a0 78 ldy #$78 5c56: 20 58 95 jsr MakeNoise1? 5c59: c9 02 L5C59 cmp #$02 5c5b: f0 2f beq L5C8C 5c5d: a0 24 ldy #$24 5c5f: b1 5c lda (polyobj_ptr),y 5c61: 29 20 and #$20 5c63: f0 03 beq L5C68 5c65: 20 8c 5c jsr L5C8C 5c68: a0 20 L5C68 ldy #$20 5c6a: b1 5c lda (polyobj_ptr),y 5c6c: f0 a3 beq L5C11 5c6e: 09 80 ora #$80 5c70: 91 5c sta (polyobj_ptr),y 5c72: a0 1c ldy #$1c 5c74: a9 02 lda #$02 5c76: 91 5c sta (polyobj_ptr),y 5c78: 0a asl A 5c79: a0 1e ldy #$1e 5c7b: 91 5c sta (polyobj_ptr),y 5c7d: a5 b8 lda $b8 5c7f: c9 0b cmp #$0b 5c81: 90 08 bcc L5C8B 5c83: a0 24 ldy #$24 5c85: b1 5c lda (polyobj_ptr),y 5c87: 09 04 ora #$04 5c89: 91 5c sta (polyobj_ptr),y 5c8b: 60 L5C8B rts 5c8c: ad 49 08 L5C8C lda data_buffer+73 5c8f: 09 04 ora #$04 5c91: 8d 49 08 sta data_buffer+73 5c94: 60 rts 5c95: a9 c9 PrintMslJammed lda #$c9 ;"Missile Jammed" 5c97: 4c 05 85 jmp PrintMessageBriefly 5c9a: a2 03 LaunchEscape ldx #3 ;Escape Capsule 5c9c: a9 fe LaunchObject lda #$fe 5c9e: 85 06 LaunchObject1 sta $06 5ca0: 8a txa ;X-reg = ship type (e.g. #30 = Thargon) 5ca1: 48 pha 5ca2: a5 5a lda hull_ptr 5ca4: 48 pha 5ca5: a5 5b lda hull_ptr+1 5ca7: 48 pha 5ca8: a5 5c lda polyobj_ptr 5caa: 48 pha 5cab: a5 5d lda polyobj_ptr+1 5cad: 48 pha 5cae: a0 24 ldy #$24 5cb0: b9 0c 00 L5CB0 lda polyobj_xpos_lo,y 5cb3: 99 00 01 sta BUFFER_0100,y 5cb6: b1 5c lda (polyobj_ptr),y 5cb8: 99 0c 00 sta polyobj_xpos_lo,y 5cbb: 88 dey 5cbc: 10 f2 bpl L5CB0 5cbe: a5 b8 lda $b8 5cc0: c9 02 cmp #$02 5cc2: d0 1d bne L5CE1 5cc4: 8a txa 5cc5: 48 pha 5cc6: a9 20 lda #$20 5cc8: 85 27 sta polyobj_vertex_lo 5cca: a2 00 ldx #$00 5ccc: a5 16 lda $16 5cce: 20 20 5d jsr L5D20 5cd1: a2 03 ldx #$03 5cd3: a5 18 lda $18 5cd5: 20 20 5d jsr L5D20 5cd8: a2 06 ldx #$06 5cda: a5 1a lda polyobj_mox2_hi 5cdc: 20 20 5d jsr L5D20 5cdf: 68 pla 5ce0: aa tax 5ce1: a5 06 L5CE1 lda $06 5ce3: 85 2c sta polyobj_attack 5ce5: 46 29 lsr polyobj_roll 5ce7: 06 29 asl polyobj_roll 5ce9: 8a txa 5cea: c9 09 cmp #$09 5cec: b0 16 bcs L5D04 5cee: c9 04 cmp #$04 5cf0: 90 12 bcc L5D04 5cf2: 48 pha 5cf3: 20 7c 7b jsr GetRandom 5cf6: 0a asl A 5cf7: 85 2a sta polyobj_pitch 5cf9: 8a txa 5cfa: 29 0f and #$0f 5cfc: 85 27 sta polyobj_vertex_lo 5cfe: a9 ff lda #$ff 5d00: 6a ror A 5d01: 85 29 sta polyobj_roll 5d03: 68 pla 5d04: 20 45 75 L5D04 jsr L7545 5d07: 68 pla 5d08: 85 5d sta polyobj_ptr+1 5d0a: 68 pla 5d0b: 85 5c sta polyobj_ptr 5d0d: a2 24 ldx #$24 5d0f: bd 00 01 L5D0F lda BUFFER_0100,x 5d12: 95 0c sta polyobj_xpos_lo,x 5d14: ca dex 5d15: 10 f8 bpl L5D0F 5d17: 68 pla 5d18: 85 5b sta hull_ptr+1 5d1a: 68 pla 5d1b: 85 5a sta hull_ptr 5d1d: 68 pla 5d1e: aa tax 5d1f: 60 rts 5d20: 0a L5D20 asl A 5d21: 85 ae sta $ae 5d23: a9 00 lda #$00 5d25: 6a ror A 5d26: 4c 0a 92 jmp L920A 5d29: a9 ff L5D29 lda #$ff 5d2b: 85 07 :Loop sta $07 5d2d: aa tax 5d2e: a0 5a ldy #$5a 5d30: 20 ae 95 jsr MakeNoise4? 5d33: a5 07 lda $07 5d35: e9 0a sbc #$0a 5d37: c9 aa cmp #$aa 5d39: b0 f0 bcs :Loop 5d3b: a9 04 lda #$04 5d3d: 20 4b 5d jsr DrawRing 5d40: 60 rts ; ; Draws the octagon ring animation for dock / undock. ; DrawOctagonRings 5d41: a0 00 ldy #$00 5d43: 20 58 95 jsr MakeNoise1? 5d46: 20 58 95 jsr MakeNoise1? 5d49: a9 08 lda #$08 ;octagon rings 5d4b: 85 bf DrawRing sta $bf 5d4d: a5 b3 lda displayed_screen 5d4f: 48 pha 5d50: a9 00 lda #$00 5d52: 20 b9 94 jsr PrintFlightHud? 5d55: 68 pla 5d56: 85 b3 sta displayed_screen 5d58: a2 80 L5D58 ldx #$80 5d5a: 86 38 stx $38 5d5c: a2 44 ldx #$44 5d5e: 86 46 stx $46 5d60: a2 00 ldx #$00 5d62: 86 c0 stx $c0 5d64: 86 39 stx $39 5d66: 86 47 stx $47 5d68: 20 74 5d :RingLoop jsr :DrawOneRing 5d6b: e6 c0 inc $c0 5d6d: a6 c0 ldx $c0 5d6f: e0 08 cpx #$08 5d71: d0 f5 bne :RingLoop 5d73: 60 rts 5d74: a5 c0 :DrawOneRing lda $c0 5d76: 29 07 and #$07 5d78: 18 clc 5d79: 69 08 adc #$08 5d7b: 85 7a sta $7a 5d7d: a0 0a L5D7D ldy #$0a 5d7f: 20 58 95 jsr MakeNoise1? 5d82: a9 01 lda #$01 5d84: 85 91 sta $91 5d86: 20 ba 77 jsr L77BA 5d89: 06 7a asl $7a 5d8b: b0 06 bcs :Return 5d8d: a5 7a lda $7a 5d8f: c9 a0 cmp #$a0 5d91: 90 ea bcc L5D7D 5d93: 60 :Return rts 5d94: a9 00 L5D94 lda #$00 5d96: e0 02 cpx #$02 5d98: 6a ror A 5d99: 85 c4 sta $c4 5d9b: 49 80 eor #$80 5d9d: 85 c5 sta $c5 5d9f: 20 4d 5e jsr L5E4D 5da2: a4 e2 ldy $e2 5da4: b9 fc 06 L5DA4 lda SCRNHOLE5+4,y 5da7: 85 b4 sta $b4 5da9: 4a lsr A 5daa: 4a lsr A 5dab: 4a lsr A 5dac: 20 ca 60 jsr L60CA 5daf: a5 31 lda $31 5db1: 85 cf sta $cf 5db3: 45 c5 eor $c5 5db5: 85 af sta $af 5db7: b9 d5 06 lda $06d5,y 5dba: 85 31 sta $31 5dbc: b9 c8 06 lda $06c8,y 5dbf: 85 6e sta $6e 5dc1: 20 68 60 jsr ADD 5dc4: 85 af sta $af 5dc6: 86 ae stx $ae 5dc8: b9 e2 06 lda $06e2,y 5dcb: 85 6f sta $6f 5dcd: 45 a7 eor $a7 5dcf: a6 67 ldx $67 5dd1: 20 e8 5e jsr MULTS 5dd4: 20 68 60 jsr ADD 5dd7: 86 60 stx $60 5dd9: 85 61 sta $61 5ddb: be ef 06 ldx $06ef,y 5dde: 86 ae stx $ae 5de0: a6 6f ldx $6f 5de2: 86 af stx $af 5de4: a6 67 ldx $67 5de6: 45 a8 eor $a8 5de8: 20 e8 5e jsr MULTS 5deb: 20 68 60 jsr ADD 5dee: 86 62 stx $62 5df0: 85 63 sta $63 5df2: a6 6b ldx $6b 5df4: 45 6c eor $6c 5df6: 20 e8 5e jsr MULTS 5df9: 85 ad sta $ad 5dfb: a5 60 lda $60 5dfd: 85 ae sta $ae 5dff: a5 61 lda $61 5e01: 85 af sta $af 5e03: 49 80 eor #$80 5e05: 20 65 60 jsr MAD 5e08: 85 61 sta $61 5e0a: 8a txa 5e0b: 99 d5 06 sta $06d5,y 5e0e: a5 62 lda $62 5e10: 85 ae sta $ae 5e12: a5 63 lda $63 5e14: 85 af sta $af 5e16: 20 65 60 jsr MAD 5e19: 85 af sta $af 5e1b: 86 ae stx $ae 5e1d: a9 00 lda #$00 5e1f: 85 31 sta $31 5e21: a5 b9 lda $b9 5e23: 20 d3 4e jsr L4ED3 5e26: a5 61 lda $61 5e28: 99 c8 06 sta $06c8,y 5e2b: 85 6e sta $6e 5e2d: 29 7f and #$7f 5e2f: 49 7f eor #$7f 5e31: c5 cf cmp $cf 5e33: 90 33 bcc L5E68 5e35: f0 31 beq L5E68 5e37: a5 63 lda $63 5e39: 99 e2 06 sta $06e2,y 5e3c: 85 6f sta $6f 5e3e: 29 7f and #$7f 5e40: c9 74 cmp #$74 5e42: b0 37 bcs L5E7B 5e44: 20 dc 4e L5E44 jsr L4EDC 5e47: 88 dey 5e48: f0 03 beq L5E4D 5e4a: 4c a4 5d jmp L5DA4 5e4d: a5 b9 L5E4D lda $b9 5e4f: 45 c4 eor $c4 5e51: 85 b9 sta $b9 5e53: a5 6c lda $6c 5e55: 45 c4 eor $c4 5e57: 85 6c sta $6c 5e59: 49 80 eor #$80 5e5b: 85 6d sta $6d 5e5d: a5 a7 lda $a7 5e5f: 45 c4 eor $c4 5e61: 85 a7 sta $a7 5e63: 49 80 eor #$80 5e65: 85 a8 sta $a8 5e67: 60 rts 5e68: 20 7c 7b L5E68 jsr GetRandom 5e6b: 85 6f sta $6f 5e6d: 99 e2 06 sta $06e2,y 5e70: a9 73 lda #$73 5e72: 05 c4 ora $c4 5e74: 85 6e sta $6e 5e76: 99 c8 06 sta $06c8,y 5e79: d0 11 bne L5E8C 5e7b: 20 7c 7b L5E7B jsr GetRandom 5e7e: 85 6e sta $6e 5e80: 99 c8 06 sta $06c8,y 5e83: a9 6e lda #$6e 5e85: 05 6d ora $6d 5e87: 85 6f sta $6f 5e89: 99 e2 06 sta $06e2,y 5e8c: 20 7c 7b L5E8C jsr GetRandom 5e8f: 09 08 ora #$08 5e91: 85 b4 sta $b4 5e93: 99 fc 06 sta SCRNHOLE5+4,y 5e96: d0 ac bne L5E44 5e98: 85 7a L5E98 sta $7a 5e9a: 85 7b sta $7b 5e9c: 85 7c sta $7c 5e9e: 85 7d sta $7d 5ea0: 18 clc 5ea1: 60 rts 5ea2: 85 ae L5EA2 sta $ae 5ea4: 29 7f and #$7f 5ea6: 85 7c sta $7c 5ea8: a5 ad lda $ad 5eaa: 29 7f and #$7f 5eac: f0 ea beq L5E98 5eae: 38 sec 5eaf: e9 01 sbc #$01 5eb1: 85 d0 sta $d0 5eb3: a5 32 lda $32 5eb5: 46 7c lsr $7c 5eb7: 6a ror A 5eb8: 85 7b sta $7b 5eba: a5 31 lda $31 5ebc: 6a ror A 5ebd: 85 7a sta $7a 5ebf: a9 00 lda #$00 5ec1: a2 18 ldx #$18 5ec3: 90 02 L5EC3 bcc L5EC7 5ec5: 65 d0 adc $d0 5ec7: 6a L5EC7 ror A 5ec8: 66 7c ror $7c 5eca: 66 7b ror $7b 5ecc: 66 7a ror $7a 5ece: ca dex 5ecf: d0 f2 bne L5EC3 5ed1: 85 d0 sta $d0 5ed3: a5 ae lda $ae 5ed5: 45 ad eor $ad 5ed7: 29 80 and #$80 5ed9: 05 d0 ora $d0 5edb: 85 7d sta $7d 5edd: 60 rts ; ".MLS2 &27BE assign from stars R.S = XX(0to1), and P.A = A.alp1 (alp1+<32)" 5ede: a6 60 MLS2 ldx $60 5ee0: 86 ae stx $ae 5ee2: a6 61 ldx $61 5ee4: 86 af stx $af 5ee6: a6 6b MLS1 ldx $6b ; ".MULTS &27CA P.A =A*P(P+<32)" 5ee8: 86 31 MULTS stx $31 5eea: aa tax 5eeb: 29 80 and #$80 5eed: 85 d0 sta $d0 5eef: 8a txa 5ef0: 29 7f and #$7f 5ef2: f0 37 beq L5F2B 5ef4: aa tax 5ef5: ca dex 5ef6: 86 06 stx $06 5ef8: a9 00 lda #$00 5efa: 46 31 lsr $31 5efc: 90 02 bcc L5F00 5efe: 65 06 adc $06 5f00: 6a L5F00 ror A 5f01: 66 31 ror $31 5f03: 90 02 bcc L5F07 5f05: 65 06 adc $06 5f07: 6a L5F07 ror A 5f08: 66 31 ror $31 5f0a: 90 02 bcc L5F0E 5f0c: 65 06 adc $06 5f0e: 6a L5F0E ror A 5f0f: 66 31 ror $31 5f11: 90 02 bcc L5F15 5f13: 65 06 adc $06 5f15: 6a L5F15 ror A 5f16: 66 31 ror $31 5f18: 90 02 bcc L5F1C 5f1a: 65 06 adc $06 5f1c: 6a L5F1C ror A 5f1d: 66 31 ror $31 5f1f: 4a lsr A 5f20: 66 31 ror $31 5f22: 4a lsr A 5f23: 66 31 ror $31 5f25: 4a lsr A 5f26: 66 31 ror $31 5f28: 05 d0 ora $d0 5f2a: 60 rts 5f2b: 85 32 L5F2B sta $32 5f2d: 85 31 sta $31 5f2f: 60 rts 5f30: 29 7f L5F30 and #$7f 5f32: 85 31 L5F32 sta $31 5f34: aa tax 5f35: d0 12 bne L5F49 5f37: 18 L5F37 clc 5f38: 86 31 stx $31 5f3a: 8a txa 5f3b: 60 rts 5f3c: b9 e2 06 L5F3C lda $06e2,y 5f3f: 85 6f sta $6f 5f41: 29 7f L5F41 and #$7f 5f43: 85 31 sta $31 5f45: a6 ad L5F45 ldx $ad 5f47: f0 ee beq L5F37 5f49: ca L5F49 dex 5f4a: 86 d0 stx $d0 5f4c: a9 00 lda #$00 5f4e: aa tax 5f4f: 46 31 lsr $31 5f51: 90 02 bcc L5F55 5f53: 65 d0 adc $d0 5f55: 6a L5F55 ror A 5f56: 66 31 ror $31 5f58: 90 02 bcc L5F5C 5f5a: 65 d0 adc $d0 5f5c: 6a L5F5C ror A 5f5d: 66 31 ror $31 5f5f: 90 02 bcc L5F63 5f61: 65 d0 adc $d0 5f63: 6a L5F63 ror A 5f64: 66 31 ror $31 5f66: 90 02 bcc L5F6A 5f68: 65 d0 adc $d0 5f6a: 6a L5F6A ror A 5f6b: 66 31 ror $31 5f6d: 90 02 bcc L5F71 5f6f: 65 d0 adc $d0 5f71: 6a L5F71 ror A 5f72: 66 31 ror $31 5f74: 90 02 bcc L5F78 5f76: 65 d0 adc $d0 5f78: 6a L5F78 ror A 5f79: 66 31 ror $31 5f7b: 90 02 bcc L5F7F 5f7d: 65 d0 adc $d0 5f7f: 6a L5F7F ror A 5f80: 66 31 ror $31 5f82: 90 02 bcc L5F86 5f84: 65 d0 adc $d0 5f86: 6a L5F86 ror A 5f87: 66 31 ror $31 5f89: 60 rts ; ".FMLTU2 &283D for CIRCLE2, A=K*sin(X)/256unsg" 5f8a: 29 1f FMLTU2 and #$1f 5f8c: aa tax 5f8d: bd 20 0f lda sine_table,x 5f90: 85 ad sta $ad 5f92: a5 7a lda $7a ; ".FMLTU &2847 A=A*Q/256unsg fast multiply" 5f94: 86 31 FMLTU stx $31 5f96: 85 ca sta $ca 5f98: aa tax 5f99: f0 1e beq L5FB9 5f9b: bd 03 41 lda math_table2,x 5f9e: a6 ad ldx $ad 5fa0: f0 15 beq L5FB7 5fa2: 18 clc 5fa3: 7d 03 41 adc math_table2,x 5fa6: bd 03 40 lda math_table1,x 5fa9: a6 ca ldx $ca 5fab: 7d 03 40 adc math_table1,x 5fae: 90 07 bcc L5FB7 5fb0: aa tax 5fb1: bd 03 42 lda math_table3,x 5fb4: a6 31 ldx $31 5fb6: 60 rts 5fb7: a9 00 L5FB7 lda #$00 5fb9: a6 31 L5FB9 ldx $31 5fbb: 60 rts ; ".MLTU AP(2)= AP* Xunsg(EOR P)" 5fbc: 86 ad MLTU2 stx $ad 5fbe: 49 ff MLTU2_2 eor #$ff 5fc0: 4a lsr A 5fc1: 85 32 sta $32 5fc3: a9 00 lda #$00 5fc5: a2 10 ldx #$10 5fc7: 66 31 ror $31 5fc9: b0 0b L5FC9 bcs :MU21 5fcb: 65 ad adc $ad 5fcd: 6a ror A 5fce: 66 32 ror $32 5fd0: 66 31 ror $31 5fd2: ca dex 5fd3: d0 f4 bne L5FC9 5fd5: 60 rts 5fd6: 4a :MU21 lsr A 5fd7: 66 32 ror $32 5fd9: 66 31 ror $31 5fdb: ca dex 5fdc: d0 eb bne L5FC9 5fde: 60 rts 5fdf: a6 6b unref_MUT3 ldx $6b 5fe1: 86 31 stx $31 5fe3: a6 61 MUT2 ldx $61 5fe5: 86 af stx $af 5fe7: a6 60 MUT1 ldx $60 5fe9: 86 ae stx $ae 5feb: aa MULT1 tax 5fec: 29 7f and #$7f 5fee: 4a lsr A 5fef: 85 31 sta $31 5ff1: 8a txa 5ff2: 45 ad eor $ad 5ff4: 29 80 and #$80 5ff6: 85 d0 sta $d0 5ff8: a5 ad lda $ad 5ffa: 29 7f and #$7f 5ffc: f0 3e beq L603C 5ffe: aa tax 5fff: ca dex 6000: 86 06 stx $06 6002: a9 00 lda #$00 6004: aa tax 6005: 90 02 bcc L6009 6007: 65 06 adc $06 6009: 6a L6009 ror A 600a: 66 31 ror $31 600c: 90 02 bcc L6010 600e: 65 06 adc $06 6010: 6a L6010 ror A 6011: 66 31 ror $31 6013: 90 02 bcc L6017 6015: 65 06 adc $06 6017: 6a L6017 ror A 6018: 66 31 ror $31 601a: 90 02 bcc L601E 601c: 65 06 adc $06 601e: 6a L601E ror A 601f: 66 31 ror $31 6021: 90 02 bcc L6025 6023: 65 06 adc $06 6025: 6a L6025 ror A 6026: 66 31 ror $31 6028: 90 02 bcc L602C 602a: 65 06 adc $06 602c: 6a L602C ror A 602d: 66 31 ror $31 602f: 90 02 bcc L6033 6031: 65 06 adc $06 6033: 6a L6033 ror A 6034: 66 31 ror $31 6036: 4a lsr A 6037: 66 31 ror $31 6039: 05 d0 ora $d0 603b: 60 rts 603c: 85 31 L603C sta $31 603e: 60 rts ; ".MULT12 &28D4 R.S = Q * A visited quite often" 603f: 20 eb 5f MULT12 jsr MULT1 6042: 85 af sta $af 6044: a5 31 lda $31 6046: 85 ae sta $ae 6048: 60 rts 6049: b6 0c TAS3 ldx polyobj_xpos_lo,y 604b: 86 ad stx $ad 604d: a5 6e lda $6e 604f: 20 3f 60 jsr MULT12 6052: b6 0e ldx INWK+2,y 6054: 86 ad stx $ad 6056: a5 6f lda $6f 6058: 20 65 60 jsr MAD 605b: 85 af sta $af 605d: 86 ae stx $ae 605f: b6 10 ldx INWK+4,y 6061: 86 ad stx $ad 6063: a5 70 lda $70 ; ".MAD &28FC Multiply and Add X.A = Q*A + R.S" 6065: 20 eb 5f MAD jsr MULT1 ; ".ADD &28FF X.A = P.A + R.S" 6068: 85 06 ADD sta $06 606a: 29 80 and #$80 606c: 85 d0 sta $d0 606e: 45 af eor $af 6070: 30 0d bmi MU8 6072: a5 ae lda $ae 6074: 18 clc 6075: 65 31 adc $31 6077: aa tax 6078: a5 af lda $af 607a: 65 06 adc $06 607c: 05 d0 ora $d0 607e: 60 rts 607f: a5 af MU8 lda $af 6081: 29 7f and #$7f 6083: 85 ac sta $ac 6085: a5 31 lda $31 6087: 38 sec 6088: e5 ae sbc $ae 608a: aa tax 608b: a5 06 lda $06 608d: 29 7f and #$7f 608f: e5 ac sbc $ac 6091: b0 0e bcs :MU9 6093: 85 ac sta $ac 6095: 8a txa 6096: 49 ff eor #$ff 6098: 69 01 adc #$01 609a: aa tax 609b: a9 00 lda #$00 609d: e5 ac sbc $ac 609f: 09 80 ora #$80 60a1: 45 d0 :MU9 eor $d0 60a3: 60 rts 60a4: 86 ad TIS1 stx $ad 60a6: 49 80 eor #$80 60a8: 20 65 60 jsr MAD 60ab: aa tax 60ac: 29 80 and #$80 60ae: 85 d0 sta $d0 60b0: 8a txa 60b1: 29 7f and #$7f 60b3: a2 fe ldx #$fe 60b5: 86 06 stx $06 60b7: 0a DVL3 asl A 60b8: c9 60 cmp #$60 60ba: 90 02 bcc DV4 60bc: e9 60 sbc #$60 60be: 26 06 DV4 rol $06 60c0: b0 f5 bcs DVL3 60c2: a5 06 lda $06 60c4: 05 d0 ora $d0 60c6: 60 rts ; ".DV42 &295E travel step of dust particle front/rear" 60c7: b9 fc 06 DV42 lda SCRNHOLE5+4,y 60ca: 85 ad L60CA sta $ad 60cc: a5 a9 lda player_speed 60ce: 0a L60CE asl A 60cf: 85 31 sta $31 60d1: a9 00 lda #$00 60d3: 2a rol A 60d4: c5 ad cmp $ad 60d6: 90 02 bcc L60DA 60d8: e5 ad sbc $ad 60da: 26 31 L60DA rol $31 60dc: 2a rol A 60dd: c5 ad cmp $ad 60df: 90 02 bcc L60E3 60e1: e5 ad sbc $ad 60e3: 26 31 L60E3 rol $31 60e5: 2a rol A 60e6: c5 ad cmp $ad 60e8: 90 02 bcc L60EC 60ea: e5 ad sbc $ad 60ec: 26 31 L60EC rol $31 60ee: 2a rol A 60ef: c5 ad cmp $ad 60f1: 90 02 bcc L60F5 60f3: e5 ad sbc $ad 60f5: 26 31 L60F5 rol $31 60f7: 2a rol A 60f8: c5 ad cmp $ad 60fa: 90 02 bcc L60FE 60fc: e5 ad sbc $ad 60fe: 26 31 L60FE rol $31 6100: 2a rol A 6101: c5 ad cmp $ad 6103: 90 02 bcc L6107 6105: e5 ad sbc $ad 6107: 26 31 L6107 rol $31 6109: 2a rol A 610a: c5 ad cmp $ad 610c: 90 02 bcc L6110 610e: e5 ad sbc $ad 6110: 26 31 L6110 rol $31 6112: 2a rol A 6113: c5 ad cmp $ad 6115: 90 02 bcc L6119 6117: e5 ad sbc $ad 6119: 26 31 L6119 rol $31 611b: a2 00 ldx #$00 611d: 85 ca sta $ca 611f: aa tax 6120: f0 19 beq L613B 6122: bd 03 41 lda math_table2,x 6125: a6 ad ldx $ad 6127: 38 sec 6128: fd 03 41 sbc math_table2,x 612b: a6 ca ldx $ca 612d: bd 03 40 lda math_table1,x 6130: a6 ad ldx $ad 6132: fd 03 40 sbc math_table1,x 6135: b0 07 bcs L613E 6137: aa tax 6138: bd 03 42 lda math_table3,x 613b: 85 ae L613B sta $ae 613d: 60 rts 613e: a9 ff L613E lda #$ff 6140: 85 ae sta $ae 6142: 60 rts 6143: 85 33 L6143 sta $33 6145: a5 12 lda polyobj_zpos_lo 6147: 09 01 ora #$01 6149: 85 ad sta $ad 614b: a5 13 lda polyobj_zpos_mi 614d: 85 ae sta $ae 614f: a5 14 lda polyobj_zpos_hi 6151: 85 af sta $af 6153: a5 31 lda $31 6155: 09 01 ora #$01 6157: 85 31 sta $31 6159: a5 33 lda $33 615b: 45 af eor $af 615d: 29 80 and #$80 615f: 85 d0 sta $d0 6161: a0 00 ldy #$00 6163: a5 33 lda $33 6165: 29 7f and #$7f 6167: c9 40 L6167 cmp #$40 6169: b0 08 bcs L6173 616b: 06 31 asl $31 616d: 26 32 rol $32 616f: 2a rol A 6170: c8 iny 6171: d0 f4 bne L6167 6173: 85 33 L6173 sta $33 6175: a5 af lda $af 6177: 29 7f and #$7f 6179: 88 L6179 dey 617a: 06 ad asl $ad 617c: 26 ae rol $ae 617e: 2a rol A 617f: 10 f8 bpl L6179 6181: 85 ad sta $ad 6183: a9 fe lda #$fe 6185: 85 ae sta $ae 6187: a5 33 lda $33 6189: 0a L6189 asl A 618a: b0 0d bcs L6199 618c: c5 ad cmp $ad 618e: 90 02 bcc L6192 6190: e5 ad sbc $ad 6192: 26 ae L6192 rol $ae 6194: b0 f3 bcs L6189 6196: 4c a2 61 jmp L61A2 6199: e5 ad L6199 sbc $ad 619b: 38 sec 619c: 26 ae rol $ae 619e: b0 e9 bcs L6189 61a0: a5 ae lda $ae 61a2: a9 00 L61A2 lda #$00 61a4: 85 7b sta $7b 61a6: 85 7c sta $7c 61a8: 85 7d sta $7d 61aa: 98 tya 61ab: 10 1e bpl L61CB 61ad: a5 ae lda $ae 61af: 0a L61AF asl A 61b0: 26 7b rol $7b 61b2: 26 7c rol $7c 61b4: 26 7d rol $7d 61b6: c8 iny 61b7: d0 f6 bne L61AF 61b9: 85 7a sta $7a 61bb: a5 7d lda $7d 61bd: 05 d0 ora $d0 61bf: 85 7d sta $7d 61c1: 60 rts 61c2: a5 ae L61C2 lda $ae 61c4: 85 7a sta $7a 61c6: a5 d0 lda $d0 61c8: 85 7d sta $7d 61ca: 60 rts 61cb: f0 f5 L61CB beq L61C2 61cd: a5 ae lda $ae 61cf: 4a L61CF lsr A 61d0: 88 dey 61d1: d0 fc bne L61CF 61d3: 85 7a sta $7a 61d5: a5 d0 lda $d0 61d7: 85 7d sta $7d 61d9: 60 rts ; ".cntr &29FF center ship indicators" 61da: ad 6c 02 L61DA lda computer_dock_flag 61dd: d0 05 bne L61E4 61df: ad 58 45 lda ptb_kbd_dampening 61e2: d0 0c bne L61F0 61e4: 8a L61E4 txa 61e5: 10 03 bpl L61EA 61e7: ca dex 61e8: 30 06 bmi L61F0 61ea: e8 L61EA inx 61eb: d0 03 bne L61F0 61ed: ca dex 61ee: f0 fa beq L61EA 61f0: 60 L61F0 rts 61f1: 85 d0 L61F1 sta $d0 61f3: 8a txa 61f4: 18 clc 61f5: 65 d0 adc $d0 61f7: aa tax 61f8: 90 02 bcc L61FC 61fa: a2 ff ldx #$ff 61fc: 10 10 L61FC bpl L620E 61fe: a5 d0 L61FE lda $d0 6200: 60 rts 6201: 85 d0 REDU2 sta $d0 6203: 8a txa 6204: 38 sec 6205: e5 d0 sbc $d0 6207: aa tax 6208: b0 02 bcs L620C 620a: a2 01 ldx #$01 620c: 10 f0 L620C bpl L61FE 620e: ad 59 45 L620E lda ptb_kbd_recent 6211: d0 eb bne L61FE 6213: a2 80 ldx #$80 6215: 30 e7 bmi L61FE 6217: 20 7c 7b L6217 jsr GetRandom 621a: 29 07 and #$07 621c: 69 40 adc #$40 621e: 8d 7a 02 sta $027a 6221: 20 7c 7b jsr GetRandom 6224: 29 07 and #$07 6226: 69 7c adc #$7c 6228: 8d 79 02 sta $0279 622b: ad 74 02 lda player_laser_temp 622e: 69 08 adc #$08 6230: 8d 74 02 sta player_laser_temp 6233: 20 3c 74 jsr L743C 6236: a5 b3 L6236 lda displayed_screen 6238: d0 b6 bne L61F0 623a: a9 20 lda #$20 623c: a0 e0 ldy #$e0 623e: 20 45 62 jsr L6245 6241: a9 30 lda #$30 6243: a0 d0 ldy #$d0 6245: 85 70 L6245 sta $70 6247: ad 79 02 lda $0279 624a: 85 6e sta $6e 624c: ad 7a 02 lda $027a 624f: 85 6f sta $6f 6251: a9 87 lda #$87 6253: 85 71 sta $71 6255: 20 64 9c jsr DrawLine 6258: ad 79 02 lda $0279 625b: 85 6e sta $6e 625d: ad 7a 02 lda $027a 6260: 85 6f sta $6f 6262: 84 70 sty $70 6264: a9 87 lda #$87 6266: 85 71 sta $71 6268: 4c 64 9c jmp DrawLine 626b: a5 de L626B lda $de 626d: 05 df ora $df 626f: d0 38 bne L62A9 6271: a5 ba lda docked_flag 6273: 10 34 bpl L62A9 6275: a0 00 ldy #$00 6277: b9 5d 1a L6277 lda text_stuff1?-1,y 627a: c5 b4 cmp $b4 627c: d0 28 bne L62A6 627e: b9 77 1a lda text_stuff2?,y 6281: 29 7f and #$7f 6283: cd 9e 02 cmp ship_state2? 6286: d0 1e bne L62A6 6288: b9 77 1a lda text_stuff2?,y 628b: 30 0c bmi L6299 628d: ad 8f 02 lda $028f 6290: 4a lsr A 6291: 90 16 bcc L62A9 6293: 20 7f 4c jsr SetBufferFlag 6296: a9 01 lda #$01 6298: 2c bit ▼ LB0A6+3 6299: a9 b0 L6299 lda #$b0 ;0d 0e 13: set ucase flags; turn buffering on; ? 629b: 20 ad 4b jsr PrintDockedToken 629e: 98 tya 629f: 20 5c 4b jsr PrintExtDockedStr 62a2: a9 b1 lda #$b1 ;. [ff], turn buffering off 62a4: d0 0e bne :PrintStr 62a6: 88 L62A6 dey 62a7: d0 ce bne L6277 62a9: a2 03 L62A9 ldx #$03 62ab: b5 94 L62AB lda $94,x 62ad: 95 02 sta rng_state,x 62af: ca dex 62b0: 10 f9 bpl L62AB 62b2: a9 05 lda #$05 62b4: 4c 6e 4b :PrintStr jmp PrintDockedStr ;buffered: <thing> IS <thing>. 62b7: ad 8f 02 L62B7 lda $028f 62ba: 09 04 ora #$04 62bc: 8d 8f 02 sta $028f 62bf: a9 0b lda #$0b 62c1: 20 6e 4b L62C1 jsr PrintDockedStr 62c4: 4c 2d 7f jmp L7F2D 62c7: ad 8f 02 L62C7 lda $028f 62ca: 29 f0 and #$f0 62cc: 09 0a ora #$0a 62ce: 8d 8f 02 sta $028f 62d1: a9 de lda #$de 62d3: d0 ec bne L62C1 62d5: ad 8f 02 L62D5 lda $028f 62d8: 09 04 ora #$04 62da: 8d 8f 02 sta $028f 62dd: a9 02 lda #$02 62df: 8d ba 02 sta have_energy_unit 62e2: ee d7 02 inc kill_score+1 62e5: a9 df lda #$df 62e7: d0 d8 bne L62C1 62e9: 4e 8f 02 L62E9 lsr $028f 62ec: 0e 8f 02 asl $028f 62ef: a2 50 ldx #$50 62f1: a0 c3 ldy #$c3 62f3: 20 57 6e jsr AddCredits 62f6: a9 0f lda #$0f 62f8: d0 c7 L62F8 bne L62C1 62fa: 4e 8f 02 L62FA lsr $028f 62fd: 38 sec 62fe: 2e 8f 02 rol $028f 6301: 20 56 63 jsr PrintIncomingMessage 6304: 20 14 7b jsr ZeroInfo 6307: a9 1f lda #$1f 6309: 85 b8 sta $b8 630b: 20 45 75 jsr L7545 630e: a9 01 lda #$01 6310: 85 34 sta text_hposn 6312: 85 13 sta polyobj_zpos_mi 6314: a9 0d lda #$0d 6316: 20 b9 94 jsr PrintFlightHud? 6319: a9 40 lda #$40 631b: 85 b6 sta $b6 631d: a2 7f L631D ldx #$7f 631f: 86 29 stx polyobj_roll 6321: 86 2a stx polyobj_pitch 6323: 20 3e 88 jsr DrawObject 6326: 20 5e 90 jsr MVEIT 6329: c6 b6 dec $b6 632b: d0 f0 bne L631D 632d: 46 0c L632D lsr polyobj_xpos_lo 632f: e6 12 inc polyobj_zpos_lo 6331: f0 1a beq L634D 6333: e6 12 inc polyobj_zpos_lo 6335: f0 16 beq L634D 6337: a6 0f ldx polyobj_ypos_lo 6339: e8 inx 633a: e0 50 cpx #$50 633c: 90 02 bcc L6340 633e: a2 50 ldx #$50 6340: 86 0f L6340 stx polyobj_ypos_lo 6342: 20 3e 88 jsr DrawObject 6345: 20 5e 90 jsr MVEIT 6348: c6 b6 dec $b6 634a: 4c 2d 63 jmp L632D 634d: e6 13 L634D inc polyobj_zpos_mi 634f: 20 63 63 jsr L6363 6352: a9 0a lda #$0a 6354: d0 a2 bne L62F8 PrintIncomingMessage 6356: a9 d8 lda #$d8 6358: 20 6e 4b jsr PrintDockedStr 635b: a0 64 ldy #$64 635d: 4c 96 63 jmp LongDelay 6360: 20 72 63 WaitKeyDrawHud jsr WaitForKey 6363: a9 01 L6363 lda #$01 6365: 4c b9 94 jmp PrintFlightHud? 6368: a9 09 Vposn9_SetMask lda #$09 636a: 2c bit ▼ ycoords?+169 636b: a9 05 Vposn5_SetMask lda #$05 636d: 85 36 sta text_vposn 636f: 4c 67 4c jmp SetUpperMask? ; ; Wait until a key is hit. Pending input will be discarded. ; ; On exit: ; A-reg: key hit ; (commands set as well) ; 6372: 20 1f 83 WaitForKey jsr CheckForInput ;check for pending input 6375: d0 fb bne WaitForKey ;if key available, discard and retry 6377: 20 1f 83 jsr CheckForInput ;check for pending input 637a: f0 f6 beq WaitForKey ;wait until one is available 637c: 60 rts 637d: 8a GetInfo txa 637e: 0a asl A 637f: a8 tay 6380: b9 7e 4e lda L4E7E,y 6383: 85 5c sta polyobj_ptr 6385: b9 7f 4e lda L4E7F,y 6388: 85 5d sta polyobj_ptr+1 638a: 60 rts 638b: a2 01 L638B ldx #$01 638d: bd 90 02 L638D lda $0290,x 6390: 95 e0 sta $e0,x 6392: ca dex 6393: 10 f8 bpl L638D 6395: 60 rts 6396: 20 7e a0 LongDelay jsr Delay 6399: 88 dey 639a: d0 fa bne LongDelay 639c: 60 rts 639d: 10 15 1a 1f+ planet_desc_adj .bulk $10,$15,$1a,$1f,$9b,$a0,$2e,$a5,$24,$29,$3d,$33,$38,$aa,$42,$47 + $4c,$51,$56,$8c,$60,$65,$87,$82,$5b,$6a,$b4,$b9,$be,$e1,$e6,$eb + $f0,$f5,$fa,$73,$78,$7d 63c3: 4a L63C3 lsr A 63c4: 85 08 L63C4 sta $08 63c6: 4a lsr A 63c7: 4a lsr A 63c8: 38 sec 63c9: e5 08 sbc $08 63cb: 49 ff eor #$ff 63cd: 69 01 adc #$01 63cf: 60 rts 63d0: 20 c4 63 L63D0 jsr L63C4 63d3: 69 20 adc #$20 63d5: 60 rts 63d6: 85 6e L63D6 sta $6e 63d8: a9 13 lda #$13 63da: 85 6f sta $6f 63dc: a9 73 lda #$73 63de: 85 71 sta $71 63e0: 4c 62 9f jmp DrawVerticalLine 63e3: 8d f0 02 L63E3 sta $02f0 63e6: a9 01 lda #$01 63e8: 48 L63E8 pha 63e9: a2 0c ldx #$0c 63eb: ec f0 02 cpx $02f0 63ee: 90 0e bcc L63FE 63f0: 7d a6 02 L63F0 adc player_cargo,x 63f3: ca dex 63f4: 10 fa bpl L63F0 63f6: 6d c0 02 adc kill_score_rem-1 63f9: cd a5 02 cmp cargo_capacity? 63fc: 68 pla 63fd: 60 rts 63fe: ac f0 02 L63FE ldy $02f0 6401: 79 a6 02 adc player_cargo,y 6404: c9 c8 cmp #$c8 6406: 68 pla 6407: 60 rts 6408: 85 34 L6408 sta text_hposn 640a: 60 rts 640b: 85 36 L640B sta text_vposn 640d: 60 rts 640e: e6 36 IncTextVposn inc text_vposn 6410: 60 rts 6411: 20 b9 94 L6411 jsr PrintFlightHud? 6414: 4c a2 4e jmp ClearKbdStrb 6417: 60 .dd1 $60 6418: 20 1b 64 L6418 jsr L641B 641b: 20 1e 64 L641B jsr L641E 641e: a5 92 L641E lda $92 6420: 18 clc 6421: 65 94 adc $94 6423: aa tax 6424: a5 93 lda $93 6426: 65 95 adc $95 6428: a8 tay 6429: a5 94 lda $94 642b: 85 92 sta $92 642d: a5 95 lda $95 642f: 85 93 sta $93 6431: a5 97 lda $97 6433: 85 95 sta $95 6435: a5 96 lda $96 6437: 85 94 sta $94 6439: 18 clc 643a: 8a txa 643b: 65 94 adc $94 643d: 85 96 sta $96 643f: 98 tya 6440: 65 95 adc $95 6442: 85 97 sta $97 6444: 60 rts 6445: a5 de L6445 lda $de 6447: 05 df ora $df 6449: d0 03 bne L644E 644b: e6 36 inc text_vposn 644d: 60 rts 644e: a9 bf L644E lda #$bf ;"Distance" 6450: 20 3f 71 jsr PrintFlightTokCol 6453: a6 de ldx $de 6455: a4 df ldy $df 6457: 38 sec 6458: 20 14 6c jsr Print4XloYhi 645b: a9 c3 lda #$c3 ;"Light Years" PrintFlightTokNL 645d: 20 44 71 jsr PrintFlightToken 6460: e6 36 IncTextVpos1 inc text_vposn 6462: a9 80 L6462 lda #$80 6464: 85 37 sta text_mod_flags 6466: a9 0c PrintFF lda #$0c ;newline (technically form feed) 6468: 4c 44 71 jmp PrintFlightToken 646b: a9 ad L646B lda #$ad ;"Mainly" 646d: 20 44 71 jsr PrintFlightToken 6470: 4c a9 64 jmp L64A9 6473: 20 44 71 PrintTokSpc jsr PrintFlightToken 6476: 4c a1 6c jmp PrintSpace NOTE: C64 $6AA1 (code_6A00.asm) ; ; Planetary information screen. ; SystemDataScreen 6479: a9 01 lda #$01 647b: 20 11 64 jsr L6411 647e: a9 09 lda #$09 6480: 20 08 64 jsr L6408 6483: a9 a3 lda #$a3 6485: 20 a6 4e jsr PrintFlightTokLine 6488: 20 60 64 jsr IncTextVpos1 648b: 20 45 64 jsr L6445 648e: a9 c2 lda #$c2 ;"Economy" 6490: 20 3f 71 jsr PrintFlightTokCol 6493: a5 d7 lda $d7 6495: 18 clc 6496: 69 01 adc #$01 6498: 4a lsr A 6499: c9 02 cmp #$02 649b: f0 ce beq L646B 649d: a5 d7 lda $d7 649f: 90 03 bcc L64A4 64a1: e9 05 sbc #$05 64a3: 18 clc 64a4: 69 aa L64A4 adc #$aa ;"Rich" 64a6: 20 44 71 jsr PrintFlightToken 64a9: a5 d7 L64A9 lda $d7 64ab: 4a lsr A 64ac: 4a lsr A 64ad: 18 clc 64ae: 69 a8 adc #$a8 64b0: 20 5d 64 jsr PrintFlightTokNL 64b3: a9 a2 lda #$a2 ;"Government" 64b5: 20 3f 71 jsr PrintFlightTokCol 64b8: a5 d8 lda $d8 64ba: 18 clc 64bb: 69 b1 adc #$b1 64bd: 20 5d 64 jsr PrintFlightTokNL 64c0: a9 c4 lda #$c4 ;"Tech Level" 64c2: 20 3f 71 jsr PrintFlightTokCol 64c5: a6 d9 ldx $d9 64c7: e8 inx 64c8: 18 clc 64c9: 20 64 54 jsr PrintNumInX? 64cc: 20 60 64 jsr IncTextVpos1 64cf: a9 c0 lda #$c0 ;"Population" 64d1: 20 3f 71 jsr PrintFlightTokCol 64d4: 38 sec 64d5: a6 da ldx $da 64d7: 20 64 54 jsr PrintNumInX? 64da: a9 c6 lda #$c6 64dc: 20 5d 64 jsr PrintFlightTokNL 64df: a9 28 lda #$28 ;"(" 64e1: 20 44 71 jsr PrintFlightToken 64e4: a5 96 lda $96 64e6: 30 08 bmi L64F0 64e8: a9 bc lda #$bc ;"Human Colonial" 64ea: 20 44 71 jsr PrintFlightToken 64ed: 4c 2c 65 jmp L652C 64f0: a5 97 L64F0 lda $97 64f2: 4a lsr A 64f3: 4a lsr A 64f4: 48 pha 64f5: 29 07 and #$07 64f7: c9 03 cmp #$03 64f9: b0 05 bcs L6500 64fb: 69 e3 adc #$e3 64fd: 20 73 64 jsr PrintTokSpc 6500: 68 L6500 pla 6501: 4a lsr A 6502: 4a lsr A 6503: 4a lsr A 6504: c9 06 cmp #$06 6506: b0 05 bcs L650D 6508: 69 e6 adc #$e6 650a: 20 73 64 jsr PrintTokSpc 650d: a5 95 L650D lda $95 650f: 45 93 eor $93 6511: 29 07 and #$07 6513: 85 a1 sta $a1 6515: c9 06 cmp #$06 6517: b0 05 bcs L651E 6519: 69 ec adc #$ec 651b: 20 73 64 jsr PrintTokSpc 651e: a5 97 L651E lda $97 6520: 29 03 and #$03 6522: 18 clc 6523: 65 a1 adc $a1 6525: 29 07 and #$07 6527: 69 f2 adc #$f2 ;Rodent, Frog, Lizard, ... 6529: 20 44 71 jsr PrintFlightToken 652c: a9 53 L652C lda #$53 ;"S" 652e: 20 44 71 jsr PrintFlightToken 6531: a9 29 lda #$29 ;")" 6533: 20 5d 64 jsr PrintFlightTokNL 6536: a9 c1 lda #$c1 ;"Gross Productivity" 6538: 20 3f 71 jsr PrintFlightTokCol 653b: a6 dc ldx $dc 653d: a4 dd ldy $dd 653f: 20 13 6c jsr L6C13 6542: 20 a1 6c jsr PrintSpace 6545: a9 00 lda #$00 6547: 85 37 sta text_mod_flags 6549: a9 4d lda #$4d ;"M" 654b: 20 44 71 jsr PrintFlightToken 654e: a9 e2 lda #$e2 ;"Cr" 6550: 20 5d 64 jsr PrintFlightTokNL 6553: a9 fa lda #$fa ;"Average Radius" 6555: 20 3f 71 jsr PrintFlightTokCol 6558: a5 97 lda $97 655a: a6 95 ldx $95 655c: 29 0f and #$0f 655e: 18 clc 655f: 69 0b adc #$0b 6561: a8 tay 6562: 20 14 6c jsr Print4XloYhi 6565: 20 a1 6c jsr PrintSpace 6568: a9 6b lda #‘k’ 656a: 20 33 55 jsr PrintChar 656d: a9 6d lda #‘m’ 656f: 20 33 55 jsr PrintChar 6572: 20 60 64 jsr IncTextVpos1 6575: 4c 6b 62 jmp L626B 6578: 60 .dd1 $60 ; BBC .TT24 "Calculate system Data" 6579: a5 93 L6579 lda $93 657b: 29 07 and #$07 657d: 85 d7 sta $d7 657f: a5 94 lda $94 6581: 4a lsr A 6582: 4a lsr A 6583: 4a lsr A 6584: 29 07 and #$07 6586: 85 d8 sta $d8 6588: 4a lsr A 6589: d0 06 bne L6591 658b: a5 d7 lda $d7 658d: 09 02 ora #$02 658f: 85 d7 sta $d7 6591: a5 d7 L6591 lda $d7 6593: 49 07 eor #$07 6595: 18 clc 6596: 85 d9 sta $d9 6598: a5 95 lda $95 659a: 29 03 and #$03 659c: 65 d9 adc $d9 659e: 85 d9 sta $d9 65a0: a5 d8 lda $d8 65a2: 4a lsr A 65a3: 65 d9 adc $d9 65a5: 85 d9 sta $d9 65a7: 0a asl A 65a8: 0a asl A 65a9: 65 d7 adc $d7 65ab: 65 d8 adc $d8 65ad: 69 01 adc #$01 65af: 85 da sta $da 65b1: a5 d7 lda $d7 65b3: 49 07 eor #$07 65b5: 69 03 adc #$03 65b7: 85 31 sta $31 65b9: a5 d8 lda $d8 65bb: 69 04 adc #$04 65bd: 85 ad sta $ad 65bf: 20 45 5f jsr L5F45 65c2: a5 da lda $da 65c4: 85 ad sta $ad 65c6: 20 45 5f jsr L5F45 65c9: 06 31 asl $31 65cb: 2a rol A 65cc: 06 31 asl $31 65ce: 2a rol A 65cf: 06 31 asl $31 65d1: 2a rol A 65d2: 85 dd sta $dd 65d4: a5 31 lda $31 65d6: 85 dc sta $dc 65d8: 60 rts ; BBC .TT22 "Long range galactic chart" GalacticChartScreen 65d9: a9 40 lda #$40 65db: 20 b9 94 jsr PrintFlightHud? 65de: a9 07 lda #$07 65e0: 85 34 sta text_hposn 65e2: 20 93 6a jsr L6A93 65e5: a9 c7 lda #$c7 ;"Galactic Chart #" 65e7: 20 44 71 jsr PrintFlightToken 65ea: a9 12 lda #$12 65ec: 20 b3 4e jsr IncTextDrawLine 65ef: a9 74 lda #$74 65f1: 85 6f sta $6f 65f3: a9 1f lda #$1f 65f5: 85 6e sta $6e 65f7: a9 e4 lda #$e4 65f9: 85 70 sta $70 65fb: 20 90 9e jsr DrawHorizLine 65fe: a9 1e lda #$1e 6600: 20 d6 63 jsr L63D6 6603: a9 e2 lda #$e2 6605: 20 d6 63 jsr L63D6 6608: 20 c0 66 jsr L66C0 660b: a2 00 ldx #$00 660d: 86 b0 L660D stx $b0 660f: a5 95 lda $95 6611: 20 d0 63 jsr L63D0 6614: aa tax 6615: a9 ff lda #$ff 6617: 85 b4 sta $b4 6619: a5 93 lda $93 661b: 20 c3 63 jsr L63C3 661e: 18 clc 661f: 69 13 adc #$13 6621: 20 fe 4e jsr DrawStar? 6624: 20 18 64 jsr L6418 6627: a6 b0 ldx $b0 6629: e8 inx 662a: d0 e1 bne L660D 662c: a5 e0 lda $e0 662e: 20 d0 63 jsr L63D0 6631: 85 a1 sta $a1 6633: a5 e1 lda $e1 6635: 20 c3 63 jsr L63C3 6638: 85 a2 sta $a2 663a: a9 04 lda #$04 663c: 85 a3 sta $a3 663e: a9 08 lda #$08 6640: 85 35 sta $35 6642: a9 13 L6642 lda #$13 6644: a6 b3 ldx displayed_screen 6646: 10 02 bpl L664A 6648: a9 00 lda #$00 664a: 85 a6 L664A sta $a6 664c: a5 a1 lda $a1 664e: 38 sec 664f: e5 a3 sbc $a3 6651: 24 b3 bit displayed_screen 6653: 30 06 bmi L665B 6655: c9 22 cmp #$22 6657: b0 02 bcs L665B 6659: a9 22 lda #$22 665b: 85 6e L665B sta $6e 665d: a5 a1 lda $a1 665f: 18 clc 6660: 69 02 adc #$02 6662: 65 a3 adc $a3 6664: 24 b3 bit displayed_screen 6666: 30 06 bmi L666E 6668: c9 e0 cmp #$e0 666a: 90 02 bcc L666E 666c: a9 e0 lda #$e0 666e: 85 70 L666E sta $70 6670: a5 a2 lda $a2 6672: 18 clc 6673: 65 a6 adc $a6 6675: 85 6f sta $6f 6677: 20 90 9e jsr DrawHorizLine 667a: a5 a2 lda $a2 667c: 38 sec 667d: e5 a3 sbc $a3 667f: b0 02 bcs L6683 6681: a9 00 lda #$00 6683: 18 L6683 clc 6684: 65 a6 adc $a6 6686: 85 6f sta $6f 6688: a5 a2 lda $a2 668a: 18 clc 668b: 65 a3 adc $a3 668d: 65 a6 adc $a6 668f: c9 73 cmp #$73 6691: 90 06 bcc L6699 6693: a6 b3 ldx displayed_screen 6695: 30 02 bmi L6699 6697: a9 73 lda #$73 6699: 85 71 L6699 sta $71 669b: a5 a1 lda $a1 669d: 85 6e sta $6e 669f: 4c 62 9f jmp DrawVerticalLine 66a2: a9 69 L66A2 lda #$69 66a4: 85 a1 sta $a1 66a6: a9 4b lda #$4b 66a8: 85 a2 sta $a2 66aa: a9 10 lda #$10 66ac: 85 a3 sta $a3 66ae: a9 08 lda #$08 66b0: 85 35 sta $35 66b2: 20 42 66 jsr L6642 66b5: ad 9c 02 lda player_fuel 66b8: 20 c4 63 jsr L63C4 66bb: 85 7a sta $7a 66bd: 4c ef 66 jmp L66EF 66c0: a5 b3 L66C0 lda displayed_screen 66c2: 30 de bmi L66A2 66c4: ad 9c 02 lda player_fuel 66c7: 4a lsr A 66c8: 20 c3 63 jsr L63C3 66cb: 85 7a sta $7a 66cd: ad 90 02 lda $0290 66d0: 20 d0 63 jsr L63D0 66d3: 85 a1 sta $a1 66d5: ad 91 02 lda $0291 66d8: 20 c3 63 jsr L63C3 66db: 85 a2 sta $a2 66dd: a9 07 lda #$07 66df: 85 a3 sta $a3 66e1: a9 08 lda #$08 66e3: 85 35 sta $35 66e5: 20 42 66 jsr L6642 66e8: a5 a2 lda $a2 66ea: 18 clc 66eb: 69 13 adc #$13 66ed: 85 a2 sta $a2 66ef: a5 a1 L66EF lda $a1 66f1: 85 38 sta $38 66f3: a5 a2 lda $a2 66f5: 85 46 sta $46 66f7: a2 00 ldx #$00 66f9: 86 47 stx $47 66fb: 86 39 stx $39 66fd: e8 inx 66fe: 86 91 stx $91 6700: a2 02 ldx #$02 6702: 86 bf stx $bf 6704: 4c ba 77 jmp L77BA 6707: a9 02 DockBuyCargo lda #$02 6709: 20 11 64 jsr L6411 670c: 20 b7 6c jsr L6CB7 670f: a9 80 lda #$80 6711: 85 37 sta text_mod_flags 6713: a9 00 lda #$00 6715: 8d f0 02 sta $02f0 6718: 20 25 6c L6718 jsr L6C25 671b: ad ee 02 lda $02ee 671e: d0 0f bne L672F 6720: 4c 95 67 jmp L6795 6723: a0 b0 L6723 ldy #$b0 6725: 20 a1 6c L6725 jsr PrintSpace 6728: 98 tya 6729: 20 1b 6c jsr PrintTokQu 672c: 20 f0 6f jsr L6FF0 672f: 20 1e a2 L672F jsr ClearLines? 6732: a9 cc lda #$cc ;"Quantity Of" 6734: 20 44 71 jsr PrintFlightToken 6737: ad f0 02 lda $02f0 673a: 18 clc 673b: 69 d0 adc #$d0 ;Food, Textiles, Radioactives, ... 673d: 20 44 71 jsr PrintFlightToken 6740: a9 2f lda #$2f ;"/" 6742: 20 44 71 jsr PrintFlightToken 6745: 20 94 6c jsr L6C94 6748: a9 3f lda #$3f ;"?" 674a: 20 44 71 jsr PrintFlightToken 674d: 20 66 64 jsr PrintFF 6750: a2 00 ldx #$00 6752: 86 ae stx $ae 6754: a2 0c ldx #$0c 6756: 86 06 stx $06 6758: 20 b5 67 jsr L67B5 675b: b0 c6 bcs L6723 675d: 85 31 sta $31 675f: 20 e8 63 jsr L63E8 6762: a0 ce ldy #$ce 6764: a5 ae lda $ae 6766: f0 02 beq L676A 6768: b0 bb bcs L6725 676a: ad ed 02 L676A lda $02ed 676d: 85 ad sta $ad 676f: 20 78 6e jsr L6E78 6772: 20 30 6e jsr SubCredits 6775: a0 c5 ldy #$c5 6777: 90 ac bcc L6725 6779: ac f0 02 ldy $02f0 677c: a5 ae lda $ae 677e: 48 pha 677f: 18 clc 6780: 79 a6 02 adc player_cargo,y 6783: 99 a6 02 sta player_cargo,y 6786: b9 c4 02 lda $02c4,y 6789: 38 sec 678a: e5 ae sbc $ae 678c: 99 c4 02 sta $02c4,y 678f: 68 pla 6790: f0 03 beq L6795 6792: 20 e8 6f jsr L6FE8 6795: ad f0 02 L6795 lda $02f0 6798: 18 clc 6799: 69 05 adc #$05 679b: 20 0b 64 jsr L640B 679e: a9 00 lda #$00 67a0: 20 08 64 jsr L6408 67a3: ee f0 02 inc $02f0 67a6: ad f0 02 lda $02f0 67a9: c9 11 cmp #$11 67ab: b0 03 bcs L67B0 67ad: 4c 18 67 jmp L6718 67b0: a9 30 L67B0 lda #$30 67b2: 4c 0d 7d jmp FromGameInit 67b5: a2 00 L67B5 ldx #$00 67b7: 86 ae stx $ae 67b9: a2 0c ldx #$0c 67bb: 86 06 stx $06 67bd: 20 e5 84 L67BD jsr GetInput1? 67c0: a6 ae ldx $ae 67c2: d0 08 bne L67CC 67c4: c9 59 cmp #$59 67c6: f0 35 beq L67FD 67c8: c9 4e cmp #$4e 67ca: f0 3c beq L6808 67cc: 85 ad L67CC sta $ad 67ce: 38 sec 67cf: e9 30 sbc #$30 67d1: 90 27 bcc L67FA 67d3: c9 0a cmp #$0a 67d5: b0 d9 bcs L67B0 67d7: 85 af sta $af 67d9: a5 ae lda $ae 67db: c9 1a cmp #$1a 67dd: b0 1b bcs L67FA 67df: 0a asl A 67e0: 85 d0 sta $d0 67e2: 0a asl A 67e3: 0a asl A 67e4: 65 d0 adc $d0 67e6: 65 af adc $af 67e8: 85 ae sta $ae 67ea: cd ee 02 cmp $02ee 67ed: f0 02 beq L67F1 67ef: b0 09 bcs L67FA 67f1: a5 ad L67F1 lda $ad 67f3: 20 33 55 jsr PrintChar 67f6: c6 06 dec $06 67f8: d0 c3 bne L67BD 67fa: a5 ae L67FA lda $ae 67fc: 60 rts 67fd: 20 33 55 L67FD jsr PrintChar 6800: ad ee 02 lda $02ee 6803: 85 ae sta $ae 6805: 4c fa 67 jmp L67FA 6808: 20 33 55 L6808 jsr PrintChar 680b: a9 00 lda #$00 680d: 85 ae sta $ae 680f: 4c fa 67 jmp L67FA 6812: 20 66 64 L6812 jsr PrintFF 6815: a9 b0 lda #$b0 6817: 20 1b 6c jsr PrintTokQu 681a: 20 f0 6f jsr L6FF0 681d: ac f0 02 ldy $02f0 6820: 4c 3f 68 jmp L683F 6823: a9 04 DockSellCargo lda #$04 6825: 20 11 64 jsr L6411 6828: a9 0a lda #$0a 682a: 20 08 64 jsr L6408 682d: a9 cd lda #$cd ;"Sell" 682f: 20 44 71 jsr PrintFlightToken 6832: a9 ce lda #$ce ;"Cargo" 6834: 20 a6 4e jsr PrintFlightTokLine 6837: 20 66 64 jsr PrintFF 683a: a0 00 L683A ldy #$00 683c: 8c f0 02 L683C sty $02f0 683f: be a6 02 L683F ldx player_cargo,y 6842: f0 68 beq L68AC 6844: 98 tya 6845: 0a asl A 6846: 0a asl A 6847: a8 tay 6848: b9 9c 85 lda MarketData+1,y 684b: 85 a2 sta $a2 684d: 8a txa 684e: 48 pha 684f: 20 62 64 jsr L6462 6852: 18 clc 6853: ad f0 02 lda $02f0 6856: 69 d0 adc #$d0 ;Food, Textiles, Radioactives, ... 6858: 20 44 71 jsr PrintFlightToken 685b: a9 0e lda #$0e 685d: 20 08 64 jsr L6408 6860: 68 pla 6861: aa tax 6862: 8d ee 02 sta $02ee 6865: 18 clc 6866: 20 64 54 jsr PrintNumInX? 6869: 20 94 6c jsr L6C94 686c: a5 b3 lda displayed_screen 686e: c9 04 cmp #$04 6870: d0 3a bne L68AC 6872: a9 cd lda #$cd ;"Sell" 6874: 20 44 71 jsr PrintFlightToken 6877: a9 ce lda #$ce ;"(Y/N)?" 6879: 20 6e 4b jsr PrintDockedStr 687c: 20 b5 67 jsr L67B5 687f: f0 2b beq L68AC 6881: b0 8f bcs L6812 6883: ad f0 02 lda $02f0 6886: a2 ff ldx #$ff 6888: 86 37 stx text_mod_flags 688a: 20 25 6c jsr L6C25 688d: ac f0 02 ldy $02f0 6890: b9 a6 02 lda player_cargo,y 6893: 38 sec 6894: e5 ae sbc $ae 6896: 99 a6 02 sta player_cargo,y 6899: a5 ae lda $ae 689b: 85 31 sta $31 689d: ad ed 02 lda $02ed 68a0: 85 ad sta $ad 68a2: 20 78 6e jsr L6E78 68a5: 20 57 6e jsr AddCredits 68a8: a9 00 lda #$00 68aa: 85 37 sta text_mod_flags 68ac: ac f0 02 L68AC ldy $02f0 68af: c8 iny 68b0: c0 11 cpy #$11 68b2: 90 88 bcc L683C 68b4: a5 b3 lda displayed_screen 68b6: c9 04 cmp #$04 68b8: d0 06 bne L68C0 68ba: 20 f0 6f jsr L6FF0 68bd: 4c b0 67 jmp L67B0 68c0: 20 62 64 L68C0 jsr L6462 68c3: ad bf 02 lda $02bf 68c6: 0d c0 02 ora kill_score_rem-1 68c9: d0 01 bne L68CC 68cb: 60 L68CB rts 68cc: 18 L68CC clc 68cd: a9 00 lda #$00 68cf: ae bf 02 ldx $02bf 68d2: ac c0 02 ldy kill_score_rem-1 68d5: 20 68 54 jsr L5468 68d8: 20 7c 7b jsr GetRandom 68db: 29 03 and #$03 68dd: 18 clc 68de: 69 6f adc #$6f 68e0: 20 6e 4b jsr PrintDockedStr 68e3: a9 c6 lda #$c6 68e5: 20 6e 4b jsr PrintDockedStr 68e8: ad c0 02 lda kill_score_rem-1 68eb: d0 06 bne L68F3 68ed: ae bf 02 ldx $02bf 68f0: ca dex 68f1: f0 d8 beq L68CB 68f3: a9 73 L68F3 lda #$73 68f5: 4c 33 55 jmp PrintChar 68f8: a9 08 CargoListScreen lda #$08 68fa: 20 11 64 jsr L6411 68fd: a9 0b lda #$0b 68ff: 20 08 64 jsr L6408 6902: a9 a4 lda #$a4 ;"Inventory" 6904: 20 5d 64 jsr PrintFlightTokNL 6907: 20 a9 4e jsr T4EA9 690a: 20 10 71 jsr :PrintFuelCash 690d: ad a5 02 lda cargo_capacity? ;do we have the cargo bay expander? 6910: c9 1a cmp #26 6912: 90 05 bcc L6919 6914: a9 6b lda #$6b ;"Large Cargo Bay" 6916: 20 44 71 jsr PrintFlightToken 6919: 4c 3a 68 L6919 jmp L683A 691c: 20 44 71 YN_unref jsr PrintFlightToken 691f: a9 ce lda #$ce ;"(Y/N)?" 6921: 20 6e 4b jsr PrintDockedStr 6924: 20 e5 84 jsr GetInput1? 6927: 09 20 ora #$20 6929: c9 79 cmp #‘y’ 692b: f0 05 beq L6932 692d: a9 6e lda #‘n’ 692f: 4c 33 55 jmp PrintChar 6932: 20 33 55 L6932 jsr PrintChar 6935: 38 sec 6936: 60 rts 6937: 8a L6937 txa 6938: 48 pha 6939: 88 dey 693a: 98 tya 693b: 49 ff eor #$ff 693d: 48 pha 693e: 20 7e a0 jsr Delay 6941: 20 60 69 jsr L6960 6944: 68 pla 6945: 85 a4 sta $a4 6947: a5 e1 lda $e1 6949: 20 7d 69 jsr L697D 694c: a5 a5 lda $a5 694e: 85 e1 sta $e1 6950: 85 a2 sta $a2 6952: 68 pla 6953: 85 a4 sta $a4 6955: a5 e0 lda $e0 6957: 20 7d 69 jsr L697D 695a: a5 a5 lda $a5 695c: 85 e0 sta $e0 695e: 85 a1 sta $a1 6960: a9 08 L6960 lda #$08 6962: 85 35 sta $35 6964: a5 b3 lda displayed_screen 6966: 30 26 bmi L698E 6968: a5 e0 lda $e0 696a: 20 d0 63 jsr L63D0 696d: 85 a1 sta $a1 696f: a5 e1 lda $e1 6971: 20 c3 63 jsr L63C3 6974: 85 a2 sta $a2 6976: a9 04 lda #$04 6978: 85 a3 sta $a3 697a: 4c 42 66 jmp L6642 697d: 85 a5 L697D sta $a5 697f: 18 clc 6980: 65 a4 adc $a4 6982: a6 a4 ldx $a4 6984: 30 03 bmi L6989 6986: 90 03 bcc L698B 6988: 60 rts 6989: 90 02 L6989 bcc L698D 698b: 85 a5 L698B sta $a5 698d: 60 L698D rts 698e: a5 e0 L698E lda $e0 6990: 38 sec 6991: ed 90 02 sbc $0290 6994: c9 1d cmp #$1d 6996: 90 04 bcc L699C 6998: c9 e3 cmp #$e3 699a: 90 f1 bcc L698D 699c: 0a L699C asl A 699d: 0a asl A 699e: 18 clc 699f: 69 8c adc #$8c 69a1: 20 c4 63 jsr L63C4 69a4: 85 a1 sta $a1 69a6: a5 e1 lda $e1 69a8: 38 sec 69a9: ed 91 02 sbc $0291 69ac: c9 23 cmp #$23 69ae: 90 04 bcc L69B4 69b0: c9 e6 cmp #$e6 69b2: 90 d9 bcc L698D 69b4: 0a L69B4 asl A 69b5: 18 clc 69b6: 69 63 adc #$63 69b8: 20 c4 63 jsr L63C4 69bb: 85 a2 sta $a2 69bd: a9 08 lda #$08 69bf: 85 a3 sta $a3 69c1: a9 08 lda #$08 69c3: 85 35 sta $35 69c5: 4c 42 66 jmp L6642 LocalChartScreen 69c8: a9 80 lda #$80 69ca: 20 b9 94 jsr PrintFlightHud? 69cd: a9 07 lda #$07 69cf: 85 34 sta text_hposn 69d1: a9 be lda #$be ;"Short Range Chart" 69d3: 20 a6 4e jsr PrintFlightTokLine 69d6: 20 c0 66 jsr L66C0 69d9: 20 60 69 jsr L6960 69dc: 20 93 6a jsr L6A93 69df: a9 00 lda #$00 69e1: 85 c1 sta $c1 69e3: a2 18 ldx #$18 69e5: 95 0c L69E5 sta polyobj_xpos_lo,x 69e7: ca dex 69e8: 10 fb bpl L69E5 69ea: a5 95 L69EA lda $95 69ec: 38 sec 69ed: ed 90 02 sbc $0290 69f0: b0 04 bcs L69F6 69f2: 49 ff eor #$ff 69f4: 69 01 adc #$01 69f6: c9 1d L69F6 cmp #$1d 69f8: b0 63 bcs L6A5D 69fa: a5 93 lda $93 69fc: 38 sec 69fd: ed 91 02 sbc $0291 6a00: b0 04 bcs L6A06 6a02: 49 ff eor #$ff 6a04: 69 01 adc #$01 6a06: c9 28 L6A06 cmp #$28 6a08: b0 53 bcs L6A5D 6a0a: a5 95 lda $95 6a0c: 38 sec 6a0d: ed 90 02 sbc $0290 6a10: 0a asl A 6a11: 0a asl A 6a12: 69 8c adc #$8c 6a14: 20 c4 63 jsr L63C4 6a17: 85 74 sta $74 6a19: 4a lsr A 6a1a: 4a lsr A 6a1b: 4a lsr A 6a1c: 18 clc 6a1d: 69 01 adc #$01 6a1f: 85 34 sta text_hposn 6a21: a5 93 lda $93 6a23: 38 sec 6a24: ed 91 02 sbc $0291 6a27: 0a asl A 6a28: 69 63 adc #$63 6a2a: 20 c4 63 jsr L63C4 6a2d: 85 46 sta $46 6a2f: 4a lsr A 6a30: 4a lsr A 6a31: 4a lsr A 6a32: a8 tay 6a33: b6 0c ldx polyobj_xpos_lo,y 6a35: f0 0b beq L6A42 6a37: c8 iny 6a38: b6 0c ldx polyobj_xpos_lo,y 6a3a: f0 06 beq L6A42 6a3c: 88 dey 6a3d: 88 dey 6a3e: b6 0c ldx polyobj_xpos_lo,y 6a40: d0 29 bne L6A6B 6a42: 84 36 L6A42 sty text_vposn 6a44: c0 03 cpy #$03 6a46: 90 40 bcc L6A88 6a48: c0 11 cpy #$11 6a4a: b0 3c bcs L6A88 6a4c: 98 tya 6a4d: 48 pha 6a4e: a5 95 lda $95 6a50: 20 f1 6a jsr L6AF1 6a53: 68 pla 6a54: a8 tay 6a55: a5 df lda $df 6a57: d0 2f bne L6A88 6a59: a5 de lda $de 6a5b: c9 46 cmp #$46 6a5d: b0 29 L6A5D bcs L6A88 6a5f: a9 ff lda #$ff 6a61: 99 0c 00 sta polyobj_xpos_lo,y 6a64: a9 80 lda #$80 6a66: 85 37 sta text_mod_flags 6a68: 20 af 70 jsr :PrintSelPlanet 6a6b: a9 00 L6A6B lda #$00 6a6d: 85 39 sta $39 6a6f: 85 47 sta $47 6a71: 85 7b sta $7b 6a73: a5 74 lda $74 6a75: 85 38 sta $38 6a77: a5 97 lda $97 6a79: 29 01 and #$01 6a7b: 69 02 adc #$02 6a7d: 85 7a sta $7a 6a7f: 20 28 74 jsr L7428 6a82: 20 7b 76 jsr L767B 6a85: 20 28 74 jsr L7428 6a88: 20 18 64 L6A88 jsr L6418 6a8b: e6 c1 inc $c1 6a8d: f0 03 beq L6A92 6a8f: 4c ea 69 jmp L69EA 6a92: 60 L6A92 rts 6a93: a2 05 L6A93 ldx #$05 6a95: bd 92 02 L6A95 lda $0292,x 6a98: 95 92 sta $92,x 6a9a: ca dex 6a9b: 10 f8 bpl L6A95 6a9d: 60 rts 6a9e: 20 93 6a L6A9E jsr L6A93 6aa1: a0 7f ldy #$7f 6aa3: 84 d0 sty $d0 6aa5: a9 00 lda #$00 6aa7: 85 ac sta $ac 6aa9: a5 95 L6AA9 lda $95 6aab: 38 sec 6aac: e5 e0 sbc $e0 6aae: b0 04 bcs L6AB4 6ab0: 49 ff eor #$ff 6ab2: 69 01 adc #$01 6ab4: 4a L6AB4 lsr A 6ab5: 85 af sta $af 6ab7: a5 93 lda $93 6ab9: 38 sec 6aba: e5 e1 sbc $e1 6abc: b0 04 bcs L6AC2 6abe: 49 ff eor #$ff 6ac0: 69 01 adc #$01 6ac2: 4a L6AC2 lsr A 6ac3: 18 clc 6ac4: 65 af adc $af 6ac6: c5 d0 cmp $d0 6ac8: b0 0f bcs L6AD9 6aca: 85 d0 sta $d0 6acc: a2 05 ldx #$05 6ace: b5 92 L6ACE lda $92,x 6ad0: 95 a1 sta $a1,x 6ad2: ca dex 6ad3: 10 f9 bpl L6ACE 6ad5: a5 ac lda $ac 6ad7: 85 b4 sta $b4 6ad9: 20 18 64 L6AD9 jsr L6418 6adc: e6 ac inc $ac 6ade: d0 c9 bne L6AA9 6ae0: a2 05 ldx #$05 6ae2: b5 a1 L6AE2 lda $a1,x 6ae4: 95 92 sta $92,x 6ae6: ca dex 6ae7: 10 f9 bpl L6AE2 6ae9: a5 93 lda $93 6aeb: 85 e1 sta $e1 6aed: a5 95 lda $95 6aef: 85 e0 sta $e0 6af1: 38 L6AF1 sec 6af2: ed 90 02 sbc $0290 6af5: b0 04 bcs L6AFB 6af7: 49 ff eor #$ff 6af9: 69 01 adc #$01 6afb: 20 32 5f L6AFB jsr L5F32 6afe: 85 7b sta $7b 6b00: a5 31 lda $31 6b02: 85 7a sta $7a 6b04: a5 93 lda $93 6b06: 38 sec 6b07: ed 91 02 sbc $0291 6b0a: b0 04 bcs L6B10 6b0c: 49 ff eor #$ff 6b0e: 69 01 adc #$01 6b10: 4a L6B10 lsr A 6b11: 20 32 5f jsr L5F32 6b14: 48 pha 6b15: a5 31 lda $31 6b17: 18 clc 6b18: 65 7a adc $7a 6b1a: 85 ad sta $ad 6b1c: 68 pla 6b1d: 65 7b adc $7b 6b1f: 90 02 bcc L6B23 6b21: a9 ff lda #$ff 6b23: 85 ae L6B23 sta $ae 6b25: 20 45 87 jsr TwoByteSqrt 6b28: a5 ad lda $ad 6b2a: 0a asl A 6b2b: a2 00 ldx #$00 6b2d: 86 df stx $df 6b2f: 26 df rol $df 6b31: 0a asl A 6b32: 26 df rol $df 6b34: 85 de sta $de 6b36: 4c 79 65 jmp L6579 6b39: 20 1e a2 L6B39 jsr ClearLines? 6b3c: a9 0f lda #$0f 6b3e: 20 08 64 jsr L6408 6b41: a9 cd lda #$cd 6b43: 4c 6e 4b jmp PrintDockedStr 6b46: a5 ba L6B46 lda docked_flag 6b48: d0 ef bne L6B39 6b4a: a5 69 lda $69 6b4c: f0 01 beq L6B4F 6b4e: 60 rts 6b4f: a5 80 L6B4F lda input_raw_key 6b51: c9 47 cmp #$47 6b53: f0 5a beq L6BAF 6b55: a5 b3 lda displayed_screen 6b57: f0 50 beq L6BA9 6b59: 29 c0 and #$c0 6b5b: d0 01 bne L6B5E 6b5d: 60 rts 6b5e: 20 5b 70 L6B5E jsr L705B 6b61: a5 de L6B61 lda $de 6b63: 05 df ora $df 6b65: d0 01 bne L6B68 6b67: 60 rts 6b68: a2 05 L6B68 ldx #$05 6b6a: b5 92 L6B6A lda $92,x 6b6c: 9d fb 02 sta $02fb,x 6b6f: ca dex 6b70: 10 f8 bpl L6B6A 6b72: a9 07 lda #$07 6b74: 85 34 sta text_hposn 6b76: a9 16 lda #$16 6b78: a4 cd ldy display_mode_flag 6b7a: 30 02 bmi L6B7E 6b7c: a9 10 lda #$10 6b7e: 85 36 L6B7E sta text_vposn 6b80: a9 00 lda #$00 6b82: 85 37 sta text_mod_flags 6b84: a9 bd lda #$bd ;"Hyperspace" 6b86: 20 44 71 jsr PrintFlightToken 6b89: a5 df lda $df 6b8b: d0 07 bne L6B94 6b8d: ad 9c 02 lda player_fuel 6b90: c5 de cmp $de 6b92: b0 03 bcs L6B97 6b94: 4c 19 6c L6B94 jmp PrintRangeQu 6b97: a9 2d L6B97 lda #$2d ;"-" 6b99: 20 44 71 jsr PrintFlightToken 6b9c: 20 af 70 jsr :PrintSelPlanet 6b9f: a9 0f lda #$0f 6ba1: 85 69 L6BA1 sta $69 6ba3: 85 68 sta $68 6ba5: aa tax 6ba6: 4c 03 6c jmp L6C03 6ba9: 20 9e 6a L6BA9 jsr L6A9E 6bac: 4c 61 6b jmp L6B61 6baf: ae bc 02 L6BAF ldx have_galactic_hyper 6bb2: f0 24 beq L6BD8 6bb4: e8 inx 6bb5: 8e bc 02 stx have_galactic_hyper 6bb8: 8e c3 02 stx player_fug_inno 6bbb: a9 02 lda #$02 6bbd: 20 a1 6b jsr L6BA1 6bc0: a2 05 ldx #$05 6bc2: ee 9e 02 inc ship_state2? 6bc5: ad 9e 02 lda ship_state2? 6bc8: 29 f7 and #$f7 6bca: 8d 9e 02 sta ship_state2? 6bcd: bd 92 02 L6BCD lda $0292,x 6bd0: 0a asl A 6bd1: 3e 92 02 rol $0292,x 6bd4: ca dex 6bd5: 10 f6 bpl L6BCD 6bd7: a9 lda ▼ #$60 6bd8: 60 L6BD8 rts 6bd9: 85 e0 sta $e0 6bdb: 85 e1 sta $e1 6bdd: 20 f2 6d jsr LaunchOrLook 6be0: 20 9e 6a jsr L6A9E 6be3: a2 05 ldx #$05 6be5: b5 92 L6BE5 lda $92,x 6be7: 9d fb 02 sta $02fb,x 6bea: ca dex 6beb: 10 f8 bpl L6BE5 6bed: a2 00 ldx #$00 6bef: 86 de stx $de 6bf1: 86 df stx $df 6bf3: a9 74 lda #$74 ;"Galactic Hyperspace" 6bf5: 20 05 85 jsr PrintMessageBriefly 6bf8: a5 e0 L6BF8 lda $e0 6bfa: 8d 90 02 sta $0290 6bfd: a5 e1 lda $e1 6bff: 8d 91 02 sta $0291 6c02: 60 rts 6c03: a9 01 L6C03 lda #$01 6c05: 20 08 64 jsr L6408 6c08: 20 0b 64 jsr L640B 6c0b: a0 00 ldy #$00 6c0d: 18 clc 6c0e: a9 03 lda #$03 6c10: 4c 68 54 jmp L5468 6c13: 18 L6C13 clc 6c14: a9 05 Print4XloYhi lda #$05 6c16: 4c 68 54 jmp L5468 6c19: a9 ca PrintRangeQu lda #$ca ;"Range" 6c1b: 20 44 71 PrintTokQu jsr PrintFlightToken 6c1e: a9 3f lda #$3f ;"?" 6c20: 4c 44 71 jmp PrintFlightToken 6c23: 68 L6C23 pla 6c24: 60 rts 6c25: 48 L6C25 pha 6c26: 85 a5 sta $a5 6c28: 0a asl A 6c29: 0a asl A 6c2a: 85 a1 sta $a1 6c2c: ad 6e 02 lda witch_space_flag 6c2f: d0 f2 bne L6C23 6c31: a9 01 lda #$01 6c33: 85 34 sta text_hposn 6c35: 68 pla 6c36: 69 d0 adc #$d0 ;Food, Textiles, Radioactives, ... 6c38: 20 44 71 jsr PrintFlightToken 6c3b: a9 0e lda #$0e 6c3d: 85 34 sta text_hposn 6c3f: a6 a1 ldx $a1 6c41: bd 9c 85 lda MarketData+1,x 6c44: 85 a2 sta $a2 6c46: ad d5 02 lda kill_score-1 6c49: 3d 9e 85 and MarketData+3,x 6c4c: 18 clc 6c4d: 7d 9b 85 adc MarketData,x 6c50: 8d ed 02 sta $02ed 6c53: 20 94 6c jsr L6C94 6c56: 20 f1 6c jsr L6CF1 6c59: a5 a2 lda $a2 6c5b: 30 08 bmi L6C65 6c5d: ad ed 02 lda $02ed 6c60: 65 a4 adc $a4 6c62: 4c 6b 6c jmp L6C6B 6c65: ad ed 02 L6C65 lda $02ed 6c68: 38 sec 6c69: e5 a4 sbc $a4 6c6b: 8d ed 02 L6C6B sta $02ed 6c6e: 85 31 sta $31 6c70: a9 00 lda #$00 6c72: 20 7b 6e jsr L6E7B 6c75: 38 sec 6c76: 20 14 6c jsr Print4XloYhi 6c79: a4 a5 ldy $a5 6c7b: a9 05 lda #$05 6c7d: be c4 02 ldx $02c4,y 6c80: 8e ee 02 stx $02ee 6c83: 18 clc 6c84: f0 06 beq L6C8C 6c86: 20 66 54 jsr L5466 6c89: 4c 94 6c jmp L6C94 6c8c: a9 19 L6C8C lda #$19 6c8e: 85 34 sta text_hposn 6c90: a9 2d lda #$2d 6c92: d0 0f bne L6CA3 6c94: a5 a2 L6C94 lda $a2 6c96: 29 60 and #$60 6c98: f0 0c beq L6CA6 6c9a: c9 20 cmp #$20 6c9c: f0 0f beq L6CAD 6c9e: 20 b2 6c jsr L6CB2 6ca1: a9 20 PrintSpace lda #$20 ;" " 6ca3: 4c 44 71 L6CA3 jmp PrintFlightToken 6ca6: a9 74 L6CA6 lda #$74 6ca8: 20 33 55 jsr PrintChar 6cab: 90 f4 bcc PrintSpace 6cad: a9 6b L6CAD lda #$6b 6caf: 20 33 55 jsr PrintChar 6cb2: a9 67 L6CB2 lda #$67 6cb4: 4c 33 55 jmp PrintChar 6cb7: a9 11 L6CB7 lda #$11 6cb9: 85 34 sta text_hposn 6cbb: a9 ff lda #$ff 6cbd: d0 e4 bne L6CA3 LocalMarketScreen 6cbf: a9 10 lda #$10 6cc1: 20 11 64 jsr L6411 6cc4: a9 05 lda #$05 6cc6: 85 34 sta text_hposn 6cc8: a9 a7 lda #$a7 ;"[cur-planet] Market Prices" 6cca: 20 a6 4e jsr PrintFlightTokLine 6ccd: a9 03 lda #$03 6ccf: 85 36 sta text_vposn 6cd1: 20 b7 6c jsr L6CB7 6cd4: a9 06 lda #$06 6cd6: 85 36 sta text_vposn 6cd8: a9 00 lda #$00 6cda: 8d f0 02 sta $02f0 6cdd: a2 80 L6CDD ldx #$80 6cdf: 86 37 stx text_mod_flags 6ce1: 20 25 6c jsr L6C25 6ce4: e6 36 inc text_vposn 6ce6: ee f0 02 inc $02f0 6ce9: ad f0 02 lda $02f0 6cec: c9 11 cmp #$11 6cee: 90 ed bcc L6CDD 6cf0: 60 rts 6cf1: a5 a2 L6CF1 lda $a2 6cf3: 29 1f and #$1f 6cf5: ac ef 02 ldy $02ef 6cf8: 85 a3 sta $a3 6cfa: 18 clc 6cfb: a9 00 lda #$00 6cfd: 8d d4 02 sta $02d4 6d00: 88 L6D00 dey 6d01: 30 05 bmi L6D08 6d03: 65 a3 adc $a3 6d05: 4c 00 6d jmp L6D00 6d08: 85 a4 L6D08 sta $a4 6d0a: 60 rts 6d0b: 20 .dd1 $20 6d0c: 9e .dd1 $9e 6d0d: 6a .dd1 $6a 6d0e: 20 f8 6b L6D0E jsr L6BF8 6d11: a2 05 ldx #$05 6d13: bd fb 02 L6D13 lda $02fb,x 6d16: 9d f5 02 sta $02f5,x 6d19: ca dex 6d1a: 10 f7 bpl L6D13 6d1c: e8 inx 6d1d: 8e 76 02 stx PLAYER_STATE?+53 6d20: a5 d7 lda $d7 6d22: 8d ef 02 sta $02ef 6d25: a5 d9 lda $d9 6d27: 8d f2 02 sta $02f2 6d2a: a5 d8 lda $d8 6d2c: 8d f1 02 sta $02f1 6d2f: 20 7c 7b jsr GetRandom 6d32: 8d d5 02 sta kill_score-1 6d35: a2 00 ldx #$00 6d37: 86 c0 stx $c0 6d39: bd 9c 85 L6D39 lda MarketData+1,x 6d3c: 85 a2 sta $a2 6d3e: 20 f1 6c jsr L6CF1 6d41: bd 9e 85 lda MarketData+3,x 6d44: 2d d5 02 and kill_score-1 6d47: 18 clc 6d48: 7d 9d 85 adc MarketData+2,x 6d4b: a4 a2 ldy $a2 6d4d: 30 06 bmi L6D55 6d4f: 38 sec 6d50: e5 a4 sbc $a4 6d52: 4c 58 6d jmp L6D58 6d55: 18 L6D55 clc 6d56: 65 a4 adc $a4 6d58: 10 02 L6D58 bpl L6D5C 6d5a: a9 00 lda #$00 6d5c: a4 c0 L6D5C ldy $c0 6d5e: 29 3f and #$3f 6d60: 99 c4 02 sta $02c4,y 6d63: c8 iny 6d64: 98 tya 6d65: 85 c0 sta $c0 6d67: 0a asl A 6d68: 0a asl A 6d69: aa tax 6d6a: c9 3f cmp #$3f 6d6c: 90 cb bcc L6D39 6d6e: 60 rts 6d6f: 20 5a 7b L6D6F jsr L7B5A 6d72: a9 ff lda #$ff 6d74: 85 2c sta polyobj_attack 6d76: a9 1d lda #$1d 6d78: 20 45 75 jsr L7545 6d7b: a9 1e lda #$1e 6d7d: 4c 45 75 jmp L7545 6d80: 4e 9d 02 L6D80 lsr ship_state1? 6d83: 38 sec 6d84: 2e 9d 02 rol ship_state1? 6d87: a9 03 L6D87 lda #$03 6d89: 20 b9 94 jsr PrintFlightHud? 6d8c: 20 29 5d jsr L5D29 6d8f: 20 c4 7a jsr RES2 6d92: 8c 6e 02 sty witch_space_flag 6d95: 20 6f 6d L6D95 jsr L6D6F 6d98: a9 02 lda #$02 6d9a: cd 67 02 cmp PLAYER_STATE?+38 6d9d: b0 f6 bcs L6D95 6d9f: 85 e2 sta $e2 6da1: a2 00 ldx #$00 6da3: 20 5e 94 jsr SetViewDirection 6da6: ad 91 02 lda $0291 6da9: 49 1f eor #$1f 6dab: 8d 91 02 sta $0291 6dae: 60 rts 6daf: 60 L6DAF rts 6db0: ad 9c 02 L6DB0 lda player_fuel 6db3: 38 sec 6db4: e5 de sbc $de 6db6: b0 02 bcs L6DBA 6db8: a9 00 lda #$00 6dba: 8d 9c 02 L6DBA sta player_fuel 6dbd: a5 b3 lda displayed_screen 6dbf: d0 06 bne L6DC7 6dc1: 20 b9 94 jsr PrintFlightHud? 6dc4: 20 29 5d jsr L5D29 6dc7: 20 1f 83 L6DC7 jsr CheckForInput 6dca: c9 09 cmp #$09 6dcc: d0 05 bne L6DD3 6dce: ad 5a 45 lda ptb_pausecmd_x? 6dd1: 30 ad bmi L6D80 6dd3: 20 7c 7b L6DD3 jsr GetRandom 6dd6: c9 fd cmp #$fd 6dd8: b0 ad bcs L6D87 6dda: 20 0e 6d jsr L6D0E 6ddd: 20 c4 7a jsr RES2 6de0: 20 79 73 jsr L7379 6de3: a5 b3 lda displayed_screen 6de5: 29 3f and #$3f 6de7: d0 c6 bne L6DAF 6de9: 20 bb 94 jsr L94BB 6dec: a5 b3 lda displayed_screen 6dee: d0 38 bne L6E28 6df0: e6 b3 inc displayed_screen 6df2: a6 ba LaunchOrLook ldx docked_flag ;are we docked? 6df4: f0 2b beq :SetFrontView ;no, branch 6df6: 20 41 5d jsr DrawOctagonRings ;launch from dock 6df9: 20 c4 7a jsr RES2 6dfc: 20 9e 6a jsr L6A9E 6dff: e6 14 inc polyobj_zpos_hi 6e01: 20 66 73 jsr L7366 6e04: a9 80 lda #$80 6e06: 85 14 sta polyobj_zpos_hi 6e08: e6 13 inc polyobj_zpos_mi 6e0a: 20 fe 74 jsr L74FE 6e0d: a9 0c lda #$0c 6e0f: 85 a9 sta player_speed 6e11: 20 07 7e jsr CountIllegalCargo 6e14: 0d c3 02 ora player_fug_inno 6e17: 8d c3 02 sta player_fug_inno 6e1a: a9 ff lda #$ff 6e1c: 85 b3 sta displayed_screen 6e1e: 20 58 5d jsr L5D58 6e21: a2 00 :SetFrontView ldx #$00 ;clear docked flag 6e23: 86 ba stx docked_flag 6e25: 4c 5e 94 jmp SetViewDirection ;set view to forward 6e28: 30 03 L6E28 bmi L6E2D 6e2a: 4c d9 65 jmp GalacticChartScreen 6e2d: 4c c8 69 L6E2D jmp LocalChartScreen ; ; Subtract credits from player's account. ; ; On entry: ; X-reg: low part ; Y-reg: high part 6e30: 86 06 SubCredits stx $06 6e32: ad 9b 02 lda player_credits+3 6e35: 38 sec 6e36: e5 06 sbc $06 6e38: 8d 9b 02 sta player_credits+3 6e3b: 84 06 sty $06 6e3d: ad 9a 02 lda player_credits+2 6e40: e5 06 sbc $06 6e42: 8d 9a 02 sta player_credits+2 6e45: ad 99 02 lda player_credits+1 6e48: e9 00 sbc #$00 6e4a: 8d 99 02 sta player_credits+1 6e4d: ad 98 02 lda player_credits 6e50: e9 00 sbc #$00 6e52: 8d 98 02 sta player_credits 6e55: b0 20 bcs :Return ;always? ; ; Add credits to player's account. ; ; On entry: ; X-reg: low part ; Y-reg: high part 6e57: 8a AddCredits txa 6e58: 18 clc 6e59: 6d 9b 02 adc player_credits+3 6e5c: 8d 9b 02 sta player_credits+3 6e5f: 98 tya 6e60: 6d 9a 02 adc player_credits+2 6e63: 8d 9a 02 sta player_credits+2 6e66: ad 99 02 lda player_credits+1 6e69: 69 00 adc #$00 6e6b: 8d 99 02 sta player_credits+1 6e6e: ad 98 02 lda player_credits 6e71: 69 00 adc #$00 6e73: 8d 98 02 sta player_credits 6e76: 18 clc 6e77: 60 :Return rts 6e78: 20 45 5f L6E78 jsr L5F45 6e7b: 06 31 L6E7B asl $31 6e7d: 2a rol A 6e7e: 06 31 asl $31 6e80: 2a rol A 6e81: a8 tay 6e82: a6 31 ldx $31 6e84: 60 rts 6e85: 4c 2d 7f L6E85 jmp L7F2D 6e88: a9 20 DockEquipShip lda #$20 6e8a: 20 11 64 jsr L6411 6e8d: a9 0c lda #$0c 6e8f: 85 34 sta text_hposn 6e91: a9 cf lda #$cf 6e93: 20 73 64 jsr PrintTokSpc 6e96: a9 b9 lda #$b9 ;"Ship" 6e98: 20 a6 4e jsr PrintFlightTokLine 6e9b: a9 80 lda #$80 6e9d: 85 37 sta text_mod_flags 6e9f: 20 0e 64 jsr IncTextVposn 6ea2: ad f2 02 lda $02f2 6ea5: 18 clc 6ea6: 69 03 adc #$03 6ea8: c9 0c cmp #$0c 6eaa: 90 02 bcc L6EAE 6eac: a9 0e lda #$0e 6eae: 85 ad L6EAE sta $ad 6eb0: 8d ee 02 sta $02ee 6eb3: e6 ad inc $ad 6eb5: a9 46 lda #$46 6eb7: 38 sec 6eb8: ed 9c 02 sbc player_fuel 6ebb: 0a asl A 6ebc: 8d 93 70 sta equip_prices 6ebf: a2 01 ldx #$01 6ec1: 86 b5 L6EC1 stx $b5 6ec3: 20 66 64 jsr PrintFF 6ec6: a6 b5 ldx $b5 6ec8: 18 clc 6ec9: 20 64 54 jsr PrintNumInX? 6ecc: 20 a1 6c jsr PrintSpace 6ecf: a5 b5 lda $b5 6ed1: 18 clc 6ed2: 69 68 adc #$68 ;Beam Laser, Fuel, Missile, ... 6ed4: 20 44 71 jsr PrintFlightToken 6ed7: a5 b5 lda $b5 6ed9: 20 08 70 jsr L7008 6edc: 38 sec 6edd: a9 19 lda #$19 6edf: 85 34 sta text_hposn 6ee1: a9 06 lda #$06 6ee3: 20 68 54 jsr L5468 6ee6: a6 b5 ldx $b5 6ee8: e8 inx 6ee9: e4 ad cpx $ad 6eeb: 90 d4 bcc L6EC1 6eed: 20 1e a2 jsr ClearLines? 6ef0: a9 7f lda #$7f 6ef2: 20 1b 6c jsr PrintTokQu 6ef5: 20 b5 67 jsr L67B5 6ef8: f0 8b beq L6E85 6efa: b0 89 bcs L6E85 6efc: e9 00 sbc #$00 6efe: 48 pha 6eff: a9 02 lda #$02 6f01: 85 34 sta text_hposn 6f03: e6 36 inc text_vposn 6f05: 68 pla 6f06: 48 pha 6f07: 20 f8 6f jsr L6FF8 6f0a: 68 pla 6f0b: d0 05 bne :NotFuel 6f0d: a2 46 ldx #$46 ;A-reg=0 -> fuel 6f0f: 8e 9c 02 stx player_fuel 6f12: c9 01 :NotFuel cmp #$01 ;missile? 6f14: d0 12 bne :NotMissile 6f16: ae c2 02 ldx missile_armed_flag? 6f19: e8 inx 6f1a: a0 7c ldy #$7c 6f1c: e0 05 cpx #$05 6f1e: b0 4a bcs L6F6A 6f20: 8e c2 02 stx missile_armed_flag? 6f23: 20 29 7b jsr L7B29 6f26: a9 01 lda #$01 6f28: a0 6b :NotMissile ldy #$6b 6f2a: c9 02 cmp #$02 ;large cargo bay? 6f2c: d0 0a bne :NotLCB 6f2e: a2 25 ldx #$25 6f30: ec a5 02 cpx cargo_capacity? 6f33: f0 35 beq L6F6A 6f35: 8e a5 02 stx cargo_capacity? 6f38: c9 03 :NotLCB cmp #$03 ;ECM system? 6f3a: d0 09 bne :NotEcm 6f3c: c8 iny 6f3d: ae b7 02 ldx have_ecm 6f40: d0 28 bne L6F6A 6f42: ce b7 02 dec have_ecm 6f45: c9 04 :NotEcm cmp #$04 ;extra pulse lasers? 6f47: d0 0a bne :NotPulse 6f49: 20 15 70 jsr PrintLaserInfo? 6f4c: a9 0f lda #$0f 6f4e: 20 67 70 jsr L7067 6f51: a9 04 lda #$04 6f53: c9 05 :NotPulse cmp #$05 ;extra beam lasers? 6f55: d0 08 bne :NotBeam 6f57: 20 15 70 jsr PrintLaserInfo? 6f5a: a9 8f lda #$8f 6f5c: 20 67 70 jsr L7067 6f5f: a0 6f :NotBeam ldy #$6f 6f61: c9 06 cmp #$06 ;fuel scoops? 6f63: d0 20 bne :NotScoop 6f65: ae b8 02 ldx have_fuel_scoop 6f68: f0 18 beq L6F82 6f6a: 84 7a L6F6A sty $7a 6f6c: 20 0b 70 jsr L700B 6f6f: 20 57 6e jsr AddCredits 6f72: a5 7a lda $7a 6f74: 20 73 64 jsr PrintTokSpc 6f77: a9 1f lda #$1f ;"Present" 6f79: 20 44 71 jsr PrintFlightToken 6f7c: 20 f0 6f L6F7C jsr L6FF0 6f7f: 4c 2d 7f jmp L7F2D 6f82: ce b8 02 L6F82 dec have_fuel_scoop 6f85: c8 :NotScoop iny 6f86: c9 07 cmp #$07 ;escape pod? 6f88: d0 08 bne :NotEscape 6f8a: ae bd 02 ldx have_escape_pod 6f8d: d0 db bne L6F6A 6f8f: ce bd 02 dec have_escape_pod 6f92: c8 :NotEscape iny 6f93: c9 08 cmp #$08 ;energy bomb? 6f95: d0 0a bne :NotBomb 6f97: ae b9 02 ldx have_energy_bomb 6f9a: d0 ce bne L6F6A 6f9c: a2 7f ldx #$7f 6f9e: 8e b9 02 stx have_energy_bomb 6fa1: c8 :NotBomb iny 6fa2: c9 09 cmp #$09 ;energy unit? 6fa4: d0 08 bne :NotEnergy 6fa6: ae ba 02 ldx have_energy_unit 6fa9: d0 bf bne L6F6A 6fab: ee ba 02 inc have_energy_unit 6fae: c8 :NotEnergy iny 6faf: c9 0a cmp #$0a ;docking computer? 6fb1: d0 08 bne :NotDockComp 6fb3: ae bb 02 ldx have_docking_comp 6fb6: d0 b2 bne L6F6A 6fb8: ce bb 02 dec have_docking_comp 6fbb: c8 :NotDockComp iny 6fbc: c9 0b cmp #$0b ;galactic hyperspace? 6fbe: d0 08 bne :NotGalHyper 6fc0: ae bc 02 ldx have_galactic_hyper 6fc3: d0 a5 bne L6F6A 6fc5: ce bc 02 dec have_galactic_hyper 6fc8: c8 :NotGalHyper iny 6fc9: c9 0c cmp #$0c ;military laser? 6fcb: d0 08 bne L6FD5 6fcd: 20 15 70 jsr PrintLaserInfo? 6fd0: a9 97 lda #$97 6fd2: 20 67 70 jsr L7067 6fd5: c8 L6FD5 iny 6fd6: c9 0d cmp #$0d ;mining laser? 6fd8: d0 08 bne L6FE2 6fda: 20 15 70 jsr PrintLaserInfo? 6fdd: a9 32 lda #$32 6fdf: 20 67 70 jsr L7067 6fe2: 20 e8 6f L6FE2 jsr L6FE8 6fe5: 4c 88 6e jmp DockEquipShip 6fe8: 20 a1 6c L6FE8 jsr PrintSpace 6feb: a9 77 lda #$77 ;"Cash: $$$$$$.0 Cr" 6fed: 20 73 64 jsr PrintTokSpc 6ff0: 20 52 95 L6FF0 jsr Noise1? 6ff3: a0 19 ldy #$19 6ff5: 4c 96 63 jmp LongDelay 6ff8: 20 0b 70 L6FF8 jsr L700B 6ffb: 20 30 6e jsr SubCredits 6ffe: b0 14 bcs L7014 7000: a9 c5 lda #$c5 ;"Cash" 7002: 20 1b 6c jsr PrintTokQu 7005: 4c 7c 6f jmp L6F7C 7008: 38 L7008 sec 7009: e9 01 sbc #$01 700b: 0a L700B asl A 700c: a8 tay 700d: be 93 70 ldx equip_prices,y 7010: b9 94 70 lda equip_prices+1,y 7013: a8 tay 7014: 60 L7014 rts 7015: ad f2 02 PrintLaserInfo? lda $02f2 7018: c9 08 cmp #$08 701a: 90 05 bcc L7021 701c: a9 20 lda #$20 701e: 20 b9 94 jsr PrintFlightHud? 7021: a9 10 L7021 lda #$10 7023: a8 tay 7024: 85 36 sta text_vposn 7026: a9 0c L7026 lda #$0c 7028: 85 34 sta text_hposn 702a: 98 tya 702b: 18 clc 702c: 69 20 adc #$20 702e: 20 73 64 jsr PrintTokSpc 7031: a5 36 lda text_vposn 7033: 18 clc 7034: 69 50 adc #$50 ;P, Q, R, ... 7036: 20 44 71 jsr PrintFlightToken 7039: e6 36 inc text_vposn 703b: a4 36 ldy text_vposn 703d: c0 14 cpy #$14 703f: 90 e5 bcc L7026 7041: 20 1e a2 jsr ClearLines? 7044: a9 af L7044 lda #$af ;"View" 7046: 20 1b 6c jsr PrintTokQu 7049: 20 e5 84 jsr GetInput1? 704c: 38 sec 704d: e9 30 sbc #$30 704f: c9 04 cmp #$04 7051: 90 06 bcc L7059 7053: 20 1e a2 jsr ClearLines? 7056: 4c 44 70 jmp L7044 7059: aa L7059 tax 705a: 60 rts 705b: 20 60 69 L705B jsr L6960 705e: 20 9e 6a jsr L6A9E 7061: 20 60 69 jsr L6960 7064: 4c 1e a2 jmp ClearLines? 7067: 85 06 L7067 sta $06 7069: bd 9f 02 lda $029f,x 706c: f0 1f beq L708D 706e: a0 04 ldy #$04 7070: c9 0f cmp #$0f 7072: f0 0e beq L7082 7074: a0 05 ldy #$05 7076: c9 8f cmp #$8f 7078: f0 08 beq L7082 707a: a0 0c ldy #$0c 707c: c9 97 cmp #$97 707e: f0 02 beq L7082 7080: a0 0d ldy #$0d 7082: 86 b4 L7082 stx $b4 7084: 98 tya 7085: 20 0b 70 jsr L700B 7088: 20 57 6e jsr AddCredits 708b: a6 b4 ldx $b4 708d: a5 06 L708D lda $06 708f: 9d 9f 02 sta $029f,x 7092: 60 rts 7093: 01 00 equip_prices .dd2 1 ;fuel (updated for quantity currently in ship) 7095: 2c 01 .dd2 300 ;Missile (30.0 Cr) 7097: a0 0f .dd2 4000 ;Large Cargo Bay (400.0 Cr) 7099: 70 17 .dd2 6000 ;E.C.M. System 709b: a0 0f .dd2 4000 ;Pulse Laser 709d: 10 27 .dd2 10000 ;Beam Laser 709f: 82 14 .dd2 5250 ;Fuel Scoop 70a1: 10 27 .dd2 10000 ;Escape Pod 70a3: 28 23 .dd2 9000 ;Energy Bomb 70a5: 98 3a .dd2 15000 ;Energy Unit 70a7: 10 27 .dd2 10000 ;Docking Computers 70a9: 50 c3 .dd2 50000 ;Galactic Hyperdrive 70ab: 60 ea .dd2 60000 ;Military Laser 70ad: 40 1f .dd2 8000 ;Mining Laser 70af: a2 05 :PrintSelPlanet ldx #$05 70b1: b5 92 L70B1 lda $92,x 70b3: 95 a1 sta $a1,x 70b5: ca dex 70b6: 10 f9 bpl L70B1 70b8: a0 03 ldy #$03 70ba: 24 92 bit $92 70bc: 70 01 bvs L70BF 70be: 88 dey 70bf: 84 d0 L70BF sty $d0 70c1: a5 97 L70C1 lda $97 70c3: 29 1f and #$1f 70c5: f0 05 beq L70CC 70c7: 09 80 ora #$80 70c9: 20 44 71 jsr PrintFlightToken 70cc: 20 1e 64 L70CC jsr L641E 70cf: c6 d0 dec $d0 70d1: 10 ee bpl L70C1 70d3: a2 05 ldx #$05 70d5: b5 a1 L70D5 lda $a1,x 70d7: 95 92 sta $92,x 70d9: ca dex 70da: 10 f9 bpl L70D5 70dc: 60 rts 70dd: a0 00 :PrintCmdrName ldy #$00 70df: b9 87 02 L70DF lda $0287,y 70e2: c9 0d cmp #$0d 70e4: f0 06 beq L70EC 70e6: 20 33 55 jsr PrintChar 70e9: c8 iny 70ea: d0 f3 bne L70DF 70ec: 60 L70EC rts 70ed: 2c 6e 02 :PrintCurPlanet bit witch_space_flag 70f0: 30 15 bmi L7107 70f2: 20 f8 70 jsr L70F8 70f5: 20 af 70 jsr :PrintSelPlanet 70f8: a2 05 L70F8 ldx #$05 70fa: b5 92 L70FA lda $92,x 70fc: bc f5 02 ldy $02f5,x 70ff: 9d f5 02 sta $02f5,x 7102: 94 92 sty $92,x 7104: ca dex 7105: 10 f3 bpl L70FA 7107: 60 L7107 rts 7108: 18 :PrintGalNum clc 7109: ae 9e 02 ldx ship_state2? 710c: e8 inx 710d: 4c 64 54 jmp PrintNumInX? 7110: a9 69 :PrintFuelCash lda #$69 ;"Fuel" 7112: 20 3f 71 jsr PrintFlightTokCol ;":" 7115: ae 9c 02 ldx player_fuel 7118: 38 sec 7119: 20 64 54 jsr PrintNumInX? 711c: a9 c3 lda #$c3 ;" Light Years" 711e: 20 39 71 jsr PrintTokFF 7121: a9 77 lda #$77 ;"Cash:" + account balance 7123: d0 1f bne PrintFlightToken 7125: a2 03 :PrintCash ldx #$03 7127: bd 98 02 L7127 lda player_credits,x 712a: 95 7a sta $7a,x 712c: ca dex 712d: 10 f8 bpl L7127 712f: a9 09 lda #$09 7131: 85 ac sta $ac 7133: 38 sec 7134: 20 74 54 jsr PrintNumber? 7137: a9 e2 lda #$e2 ;" Cr" 7139: 20 44 71 PrintTokFF jsr PrintFlightToken 713c: 4c 66 64 jmp PrintFF ; ; Prints a flight token, followed by a ':'. ; PrintFlightTokCol 713f: 20 44 71 jsr PrintFlightToken 7142: a9 3a PrintColon lda #‘:’ NOTE: C64 $777e (code_6A00.asm) BBC .TT27 (flight code) ; ; Prints a flight string token. This can be a single letter, a variable, a ; string expansion, or a meta command. ; ; See also https://xania.org/201406/elites-crazy-string-format ; ; Values: ; $00-0d: special values, e.g. current cash on hand ; $0e-1f: canned messages 128-145 ; $20-5f: ASCII ; $60-7f: canned messages 96-127 ; $80-9f: flight digram ; $a0-ff: canned messages 0-95 ; ; On entry: ; A-reg: token (already "decrypted") ; PrintFlightToken 7144: aa tax 7145: f0 de beq :PrintCash ;token=0: print account balance 7147: 30 75 bmi :PrintCanOrDigram ;token >= 128, branch 7149: ca dex 714a: f0 bc beq :PrintGalNum ;token=1: print galaxy number 714c: ca dex 714d: f0 9e beq :PrintCurPlanet ;token=2: print current planet name 714f: ca dex 7150: d0 03 bne :Not0123 7152: 4c af 70 jmp :PrintSelPlanet ;token=3: print selected planet name 7155: ca :Not0123 dex 7156: f0 85 beq :PrintCmdrName ;token=4: commander name 7158: ca dex 7159: f0 b5 beq :PrintFuelCash ;token=5: fuel, followed by cash 715b: ca dex 715c: d0 05 bne :Not456 715e: a9 80 lda #$80 ;token=6: set text flags to $80 7160: 85 37 sta text_mod_flags 7162: 60 rts 7163: ca :Not456 dex 7164: ca dex 7165: d0 03 bne :Not8 7167: 86 37 stx text_mod_flags ;token=8: set text flags to $00 7169: 60 rts 716a: ca :Not8 dex 716b: f0 38 beq :PrintMidColon ;token=9: hposn to col 21, output ':' 716d: c9 60 cmp #$60 ;original token >= $60? 716f: b0 67 bcs PrintCannedMsg ;yes, print canned message 7171: c9 0e cmp #$0e ;< $0e (7/9/a/b/c/d)? 7173: 90 04 bcc :HandleLo ;yes, print as text (bell, LF, CR, etc) 7175: c9 20 cmp #$20 ;< $20 ($0e-$1f)? 7177: 90 28 bcc :Handle0e_1f ;yes, print as canned 7179: a6 37 :HandleLo ldx text_mod_flags ;get the flags 717b: f0 3e beq :DoPrint2 ;none set, print it 717d: 30 11 bmi L7190 ;high bit set 717f: 24 37 bit text_mod_flags ;check bit 6 (convert-to-lower) 7181: 70 31 bvs :PrintAndClear6 ;bit 7 clear, bit 6 set; print upper then clear bit 6 7183: c9 41 L7183 cmp #‘A’ ;< 'A'? 7185: 90 06 bcc :DoPrint1 7187: c9 5b cmp #‘[’ ;> 'Z'? 7189: b0 02 bcs :DoPrint1 718b: 69 20 adc #$20 ;convert to lower case 718d: 4c 33 55 :DoPrint1 jmp PrintChar 7190: 24 37 L7190 bit text_mod_flags 7192: 70 18 bvs :Bit76Set 7194: c9 41 cmp #‘A’ ;< 'A'? 7196: 90 23 bcc :DoPrint2 ;just print it 7198: 48 pha 7199: 8a txa ;get text_mod_flags 719a: 09 40 ora #$40 ;set bit 6, so next char is lower case 719c: 85 37 sta text_mod_flags 719e: 68 pla 719f: d0 ec bne :DoPrint1 ;(always) 71a1: 69 72 :Handle0e_1f adc #$72 ;add $72 (now $80-91) 71a3: d0 33 bne PrintCannedMsg ;(always) 71a5: a9 15 :PrintMidColon lda #21 71a7: 85 34 sta text_hposn 71a9: 4c 42 71 jmp PrintColon 71ac: e0 ff :Bit76Set cpx #$ff ;both flags set; is it just $ff? 71ae: f0 63 beq :Done ;yes, print nothing 71b0: c9 41 cmp #‘A’ ;>= 'A'? 71b2: b0 cf bcs L7183 ;conv lower 71b4: 48 :PrintAndClear6 pha ;preserve A-reg 71b5: 8a txa ;get text_mod_flags 71b6: 29 bf and #$bf ;clear bit 6 in the text flags 71b8: 85 37 sta text_mod_flags 71ba: 68 pla 71bb: 4c 33 55 :DoPrint2 jmp PrintChar :PrintCanOrDigram 71be: c9 a0 cmp #$a0 ;outside digram range? 71c0: b0 14 bcs :CannedStr ;yes, it's a canned string 71c2: 29 7f and #$7f ;no, pull two chars out of digram table 71c4: 0a asl A ; using token value -128 as index 71c5: a8 tay 71c6: b9 40 4d lda flight_digram_tab,y ;first char 71c9: 20 44 71 jsr PrintFlightToken ;print (recursively) 71cc: b9 41 4d lda flight_digram_tab+1,y ;second char 71cf: c9 3f cmp #‘?’ ;one entry ends with '?' 71d1: f0 40 beq :Done ;do nothing 71d3: 4c 44 71 jmp PrintFlightToken ;print (tail recursion) • Clear variables ]data_ptr .var $5e {addr/2} 71d6: e9 a0 :CannedStr sbc #$a0 ;reduce to canned message index ; ; Prints a string from the canned flight message table. The table is filled ; with null-terminated strings, so we need to scan forward to find the one we ; want. ; ; On entry: ; A-reg: message index ; 71d8: aa PrintCannedMsg tax ;save A-reg 71d9: a9 60 lda #<flight_text 71db: 85 5e sta ]data_ptr 71dd: a9 0b lda #>flight_text 71df: 85 5f sta ]data_ptr+1 71e1: a0 00 ldy #$00 71e3: 8a txa ;restore A-reg 71e4: f0 13 beq :PrintStrLoop ;special case entry 0 71e6: b1 5e :ScanLoop lda (]data_ptr),y ;get byte from compressed text 71e8: f0 07 beq :StringEnd ;found zero terminator 71ea: c8 iny ;advance ptr 71eb: d0 f9 bne :ScanLoop 71ed: e6 5f inc ]data_ptr+1 71ef: d0 f5 bne :ScanLoop ;(always) 71f1: c8 :StringEnd iny ;advance string ptr 71f2: d0 02 bne :NoInc 71f4: e6 5f inc ]data_ptr+1 71f6: ca :NoInc dex ;dec string index 71f7: d0 ed bne :ScanLoop ;haven't found the right one yet 71f9: 98 :PrintStrLoop tya 71fa: 48 pha ;save current data pointer 71fb: a5 5f lda ]data_ptr+1 71fd: 48 pha 71fe: b1 5e lda (]data_ptr),y ;get token 7200: 49 23 eor #EOR_FLIGHT ;"decrypt" value 7202: 20 44 71 jsr PrintFlightToken ;process it 7205: 68 pla ;restore data ptr 7206: 85 5f sta ]data_ptr+1 7208: 68 pla 7209: a8 tay 720a: c8 iny ;advance to next char 720b: d0 02 bne :NoInc 720d: e6 5f inc ]data_ptr+1 720f: b1 5e :NoInc lda (]data_ptr),y ;get next token 7211: d0 e6 bne :PrintStrLoop ;if not end of string, loop 7213: 60 :Done rts 7214: a2 .dd1 $a2 7215: 39 .dd1 $39 7216: b5 .dd1 $b5 7217: 00 .dd1 $00 7218: b4 .dd1 $b4 7219: 00 .dd1 $00 721a: 95 .dd1 $95 721b: 00 .dd1 $00 721c: 94 .dd1 $94 721d: 00 .dd1 $00 721e: e8 .dd1 $e8 721f: d0 .dd1 $d0 7220: f5 .dd1 $f5 7221: 60 .dd1 $60 7222: a5 2b L7222 lda polyobj_vis 7224: 09 a0 ora #$a0 7226: 85 2b sta polyobj_vis 7228: 60 rts 7229: a5 2b DoExplosion? lda polyobj_vis 722b: 29 40 and #$40 722d: f0 03 beq L7232 722f: 20 8f 72 jsr L728F 7232: a5 12 L7232 lda polyobj_zpos_lo 7234: 85 d0 sta $d0 7236: a5 13 lda polyobj_zpos_mi 7238: c9 20 cmp #$20 723a: 90 04 bcc L7240 723c: a9 fe lda #$fe 723e: d0 08 bne L7248 7240: 06 d0 L7240 asl $d0 7242: 2a rol A 7243: 06 d0 asl $d0 7245: 2a rol A 7246: 38 sec 7247: 2a rol A 7248: 85 ad L7248 sta $ad 724a: a0 01 ldy #$01 724c: b1 2d lda (tmp_ptr2),y 724e: 8d 01 03 sta $0301 7251: 69 04 adc #$04 7253: b0 cd bcs L7222 7255: 91 2d sta (tmp_ptr2),y 7257: 20 ce 60 jsr L60CE 725a: a5 31 lda $31 725c: c9 1c cmp #$1c 725e: 90 04 bcc L7264 7260: a9 fe lda #$fe 7262: d0 09 bne L726D 7264: 06 ae L7264 asl $ae 7266: 2a rol A 7267: 06 ae asl $ae 7269: 2a rol A 726a: 06 ae asl $ae 726c: 2a rol A 726d: 88 L726D dey 726e: 91 2d sta (tmp_ptr2),y 7270: a5 2b lda polyobj_vis 7272: 29 bf and #$bf 7274: 85 2b sta polyobj_vis 7276: 29 08 and #$08 7278: f0 99 beq :Done 727a: a0 02 ldy #$02 727c: b1 2d lda (tmp_ptr2),y 727e: a8 tay 727f: b9 f9 00 L727F lda $00f9,y 7282: 91 2d sta (tmp_ptr2),y 7284: 88 dey 7285: c0 06 cpy #$06 7287: d0 f6 bne L727F 7289: a5 2b lda polyobj_vis 728b: 09 40 ora #$40 728d: 85 2b sta polyobj_vis 728f: a0 00 L728F ldy #$00 7291: b1 2d lda (tmp_ptr2),y 7293: 85 ad sta $ad 7295: c8 iny 7296: b1 2d lda (tmp_ptr2),y 7298: 10 02 bpl L729C 729a: 49 ff eor #$ff 729c: 4a L729C lsr A 729d: 4a lsr A 729e: 4a lsr A 729f: 4a lsr A 72a0: 09 01 ora #$01 72a2: 85 ac sta $ac 72a4: c8 iny 72a5: b1 2d lda (tmp_ptr2),y 72a7: 85 bb sta $bb 72a9: a5 03 lda rng_state+1 72ab: 48 pha 72ac: a0 06 ldy #$06 72ae: a2 03 L72AE ldx #$03 72b0: c8 L72B0 iny 72b1: b1 2d lda (tmp_ptr2),y 72b3: 95 38 sta $38,x 72b5: ca dex 72b6: 10 f8 bpl L72B0 72b8: 84 bd sty $bd 72ba: a0 02 ldy #$02 72bc: c8 L72BC iny 72bd: b1 2d lda (tmp_ptr2),y 72bf: 45 bd eor $bd 72c1: 99 ff ff sta $ffff,y 72c4: c0 06 cpy #$06 72c6: d0 f4 bne L72BC 72c8: a4 ac ldy $ac 72ca: 84 be sty $be 72cc: 18 L72CC clc 72cd: a5 02 lda rng_state 72cf: 2a rol A 72d0: aa tax 72d1: 65 04 adc rng_state+2 72d3: 85 02 sta rng_state 72d5: 86 04 stx rng_state+2 72d7: a5 03 lda rng_state+1 72d9: aa tax 72da: 65 05 adc rng_state+3 72dc: 85 03 sta rng_state+1 72de: 86 05 stx rng_state+3 72e0: 29 0c and #$0c 72e2: 09 10 ora #$10 72e4: 85 35 sta $35 72e6: a5 39 lda $39 72e8: 85 ae sta $ae 72ea: a5 38 lda $38 72ec: 20 31 73 jsr L7331 72ef: d0 29 bne L731A 72f1: e0 87 cpx #$87 72f3: b0 25 bcs L731A 72f5: 86 6f stx $6f 72f7: a5 3b lda $3b 72f9: 85 ae sta $ae 72fb: a5 3a lda $3a 72fd: 20 31 73 jsr L7331 7300: d0 05 bne L7307 7302: a5 6f lda $6f 7304: 20 bb 9f jsr DrawColorPixel 7307: c6 be L7307 dec $be 7309: 10 c1 bpl L72CC 730b: a4 bd ldy $bd 730d: c4 bb cpy $bb 730f: 90 9d bcc L72AE 7311: 68 pla 7312: 85 03 sta rng_state+1 7314: ad 06 08 lda data_buffer+6 7317: 85 05 sta rng_state+3 7319: 60 rts 731a: 18 L731A clc 731b: a5 02 lda rng_state 731d: 2a rol A 731e: aa tax 731f: 65 04 adc rng_state+2 7321: 85 02 sta rng_state 7323: 86 04 stx rng_state+2 7325: a5 03 lda rng_state+1 7327: aa tax 7328: 65 05 adc rng_state+3 732a: 85 03 sta rng_state+1 732c: 86 05 stx rng_state+3 732e: 4c 07 73 jmp L7307 7331: 85 af L7331 sta $af 7333: 18 clc 7334: a5 02 lda rng_state 7336: 2a rol A 7337: aa tax 7338: 65 04 adc rng_state+2 733a: 85 02 sta rng_state 733c: 86 04 stx rng_state+2 733e: a5 03 lda rng_state+1 7340: aa tax 7341: 65 05 adc rng_state+3 7343: 85 03 sta rng_state+1 7345: 86 05 stx rng_state+3 7347: 2a rol A 7348: b0 0b bcs L7355 734a: 20 94 5f jsr FMLTU 734d: 65 ae adc $ae 734f: aa tax 7350: a5 af lda $af 7352: 69 00 adc #$00 7354: 60 rts 7355: 20 94 5f L7355 jsr FMLTU 7358: 85 d0 sta $d0 735a: a5 ae lda $ae 735c: e5 d0 sbc $d0 735e: aa tax 735f: a5 af lda $af 7361: e9 00 sbc #$00 7363: 60 rts 7364: 00 .dd1 $00 7365: 02 .dd1 $02 7366: 20 29 7b L7366 jsr L7B29 7369: a9 7f lda #$7f 736b: 85 29 sta polyobj_roll 736d: 85 2a sta polyobj_pitch 736f: ad f2 02 lda $02f2 7372: 29 02 and #$02 7374: 09 80 ora #$80 7376: 4c 45 75 jmp L7545 7379: ad bf 02 L7379 lda $02bf 737c: f0 1e beq L739C 737e: a9 00 lda #$00 7380: 8d a6 02 sta player_cargo 7383: 8d ac 02 sta player_cargo+6 7386: 20 7c 7b jsr GetRandom 7389: 29 0f and #$0f 738b: 6d bf 02 adc $02bf 738e: 09 04 ora #$04 7390: 2a rol A 7391: 8d bf 02 sta $02bf 7394: 2e c0 02 rol kill_score_rem-1 7397: 10 03 bpl L739C 7399: 6e c0 02 ror kill_score_rem-1 739c: 4e c3 02 L739C lsr player_fug_inno 739f: 20 14 7b jsr ZeroInfo 73a2: a5 93 lda $93 73a4: 29 03 and #$03 73a6: 69 03 adc #$03 73a8: 85 14 sta polyobj_zpos_hi 73aa: 6a ror A 73ab: 85 0e sta INWK+2 73ad: 85 11 sta INWK+5 73af: 20 66 73 jsr L7366 73b2: a5 95 lda $95 73b4: 29 07 and #$07 73b6: 09 81 ora #$81 73b8: 85 14 sta polyobj_zpos_hi 73ba: a5 97 lda $97 73bc: 29 03 and #$03 73be: 85 0e sta INWK+2 73c0: 85 0d sta INWK+1 73c2: a9 00 lda #$00 73c4: 85 29 sta polyobj_roll 73c6: 85 2a sta polyobj_pitch 73c8: a9 81 lda #$81 73ca: 20 45 75 jsr L7545 73cd: a5 b3 L73CD lda displayed_screen 73cf: d0 22 bne L73F3 73d1: a4 e2 L73D1 ldy $e2 73d3: 20 7c 7b L73D3 jsr GetRandom 73d6: 09 08 ora #$08 73d8: 99 fc 06 sta SCRNHOLE5+4,y 73db: 85 b4 sta $b4 73dd: 20 7c 7b jsr GetRandom 73e0: 99 c8 06 sta $06c8,y 73e3: 85 6e sta $6e 73e5: 20 7c 7b jsr GetRandom 73e8: 99 e2 06 sta $06e2,y 73eb: 85 6f sta $6f 73ed: 20 dc 4e jsr L4EDC 73f0: 88 dey 73f1: d0 e0 bne L73D3 73f3: a2 00 L73F3 ldx #$00 73f5: bd 41 02 L73F5 lda PLAYER_STATE?,x 73f8: f0 23 beq L741D 73fa: 30 1e bmi L741A 73fc: 85 b8 sta $b8 73fe: 20 7d 63 jsr GetInfo 7401: a0 1f ldy #$1f 7403: b1 5c L7403 lda (polyobj_ptr),y 7405: 99 0c 00 sta polyobj_xpos_lo,y 7408: 88 dey 7409: 10 f8 bpl L7403 740b: 86 b0 stx $b0 740d: 20 83 a2 jsr SCAN 7410: a6 b0 ldx $b0 7412: a0 1f ldy #$1f 7414: b1 5c lda (polyobj_ptr),y 7416: 29 a7 and #$a7 7418: 91 5c sta (polyobj_ptr),y 741a: e8 L741A inx 741b: d0 d8 bne L73F5 741d: a2 00 L741D ldx #$00 741f: 86 91 stx $91 7421: ca dex 7422: 8e 00 04 stx xcoords? 7425: 8e 00 05 stx ycoords? 7428: a0 c7 L7428 ldy #$c7 742a: a9 00 lda #$00 742c: 99 00 06 L742C sta $0600,y 742f: 88 dey 7430: d0 fa bne L742C 7432: 88 dey 7433: 84 d3 sty $d3 7435: 60 rts 7436: 60 .dd1 $60 7437: ca L7437 dex 7438: 60 rts 7439: e8 L7439 inx 743a: f0 fb beq L7437 743c: c6 d6 L743C dec $d6 743e: 08 php 743f: d0 02 bne L7443 7441: e6 d6 inc $d6 7443: 28 L7443 plp 7444: 60 rts 7445: 20 a4 74 L7445 jsr L74A4 7448: ad 4c 02 lda PLAYER_STATE?+11 744b: d0 31 bne L747E 744d: 20 74 82 jsr L8274 7450: 4c 81 74 jmp L7481 7453: 0a L7453 asl A 7454: aa tax 7455: a9 00 lda #$00 7457: 6a ror A 7458: a8 tay 7459: a9 14 lda #$14 745b: 85 ad sta $ad 745d: 8a txa 745e: 20 ce 60 jsr L60CE 7461: a6 31 ldx $31 7463: 98 tya 7464: 30 03 bmi L7469 7466: a0 00 ldy #$00 7468: 60 rts 7469: a0 ff L7469 ldy #$ff 746b: 8a txa 746c: 49 ff eor #$ff 746e: aa tax 746f: e8 inx 7470: 60 L7470 rts 7471: a2 08 L7471 ldx #$08 7473: bd 25 08 L7473 lda data_buffer+37,x 7476: 95 38 sta $38,x 7478: ca dex 7479: 10 f8 bpl L7473 747b: 4c 83 82 jmp L8283 747e: 20 71 74 L747E jsr L7471 7481: a5 6e L7481 lda $6e 7483: 20 53 74 jsr L7453 7486: 8a txa 7487: 69 c3 adc #$c3 7489: 8d dd 02 sta $02dd 748c: a5 6f lda $6f 748e: 20 53 74 jsr L7453 7491: 86 d0 stx $d0 7493: a9 94 lda #$94 7495: e5 d0 sbc $d0 7497: 8d de 02 sta $02de 749a: a9 60 lda #$60 749c: a6 70 ldx $70 749e: 10 01 bpl L74A1 74a0: 4a lsr A 74a1: 8d 43 45 L74A1 sta L4543 74a4: ad 43 45 L74A4 lda L4543 74a7: f0 c7 beq L7470 74a9: 85 b4 sta $b4 74ab: ad de 02 lda $02de 74ae: ae dd 02 ldx $02dd 74b1: 4c fe 4e jmp DrawStar? 74b4: 85 d0 L74B4 sta $d0 74b6: a2 00 ldx #$00 74b8: a0 08 ldy #$08 74ba: b1 5c lda (polyobj_ptr),y 74bc: 30 0f bmi L74CD 74be: a5 d4 lda $d4 74c0: e5 d0 sbc $d0 74c2: 90 03 bcc L74C7 74c4: 85 d4 sta $d4 74c6: 60 rts 74c7: a2 00 L74C7 ldx #$00 74c9: 86 d4 stx $d4 74cb: 90 0d bcc L74DA 74cd: a5 d5 L74CD lda $d5 74cf: e5 d0 sbc $d0 74d1: 90 03 bcc L74D6 74d3: 85 d5 sta $d5 74d5: 60 rts 74d6: a2 00 L74D6 ldx #$00 74d8: 86 d5 stx $d5 74da: 65 d6 L74DA adc $d6 74dc: 85 d6 sta $d6 74de: f0 02 beq L74E2 74e0: b0 03 bcs L74E5 74e2: 4c 3f 7e L74E2 jmp GameOver? 74e5: 20 6f 95 L74E5 jsr MakeNoise2? 74e8: 4c 60 85 jmp OUCH 74eb: bd 01 08 L74EB lda data_buffer+1,x 74ee: 95 38 sta $38,x 74f0: bd 02 08 lda data_buffer+2,x 74f3: a8 tay 74f4: 29 7f and #$7f 74f6: 95 39 sta $39,x 74f8: 98 tya 74f9: 29 80 and #$80 74fb: 95 3a sta $3a,x 74fd: 60 rts 74fe: 20 19 a0 L74FE jsr LA019 7501: a2 81 ldx #$81 7503: 86 2c stx polyobj_attack 7505: a2 00 ldx #$00 7507: 86 2a stx polyobj_pitch 7509: 86 30 stx $30 750b: 8e 42 02 stx PLAYER_STATE?+1 750e: ca dex 750f: 86 29 stx polyobj_roll 7511: a2 0a ldx #$0a 7513: 20 dd 75 jsr L75DD 7516: 20 dd 75 jsr L75DD 7519: 20 dd 75 jsr L75DD 751c: ad b7 7e lda saved_station_addr 751f: 8d 02 a3 sta station_addr 7522: ad b8 7e lda saved_station_addr+1 7525: 8d 03 a3 sta station_addr+1 7528: ad f2 02 lda $02f2 752b: c9 0a cmp #$0a 752d: 90 0c bcc L753B 752f: ad 3e a3 lda dodo_addr 7532: 8d 02 a3 sta station_addr 7535: ad 3f a3 lda dodo_addr+1 7538: 8d 03 a3 sta station_addr+1 753b: a9 00 L753B lda #$00 753d: 85 2d sta tmp_ptr2 753f: a9 06 lda #$06 7541: 85 2e sta tmp_ptr2+1 7543: a9 02 lda #$02 7545: 85 d0 L7545 sta $d0 7547: a2 00 ldx #$00 7549: bd 41 02 L7549 lda PLAYER_STATE?,x 754c: f0 07 beq L7555 754e: e8 inx 754f: e0 08 cpx #$08 7551: 90 f6 bcc L7549 7553: 18 L7553 clc 7554: 60 L7554 rts NOTE: BBC .NW1 7555: 20 7d 63 L7555 jsr GetInfo 7558: a5 d0 lda $d0 ;ship type 755a: 30 52 bmi L75AE 755c: 0a asl A 755d: a8 tay 755e: b9 ff a2 lda hull_addr_hi,y 7561: f0 f0 beq L7553 7563: 85 5b sta hull_ptr+1 7565: b9 fe a2 lda hull_addr_lo,y 7568: 85 5a sta hull_ptr 756a: c0 04 cpy #$04 756c: f0 30 beq L759E 756e: a0 05 ldy #$05 7570: b1 5a lda (hull_ptr),y 7572: 85 06 sta $06 7574: ad f3 02 lda $02f3 7577: 38 sec 7578: e5 06 sbc $06 757a: 85 2d sta tmp_ptr2 757c: ad f4 02 lda $02f4 757f: e9 00 sbc #$00 7581: 85 2e sta tmp_ptr2+1 7583: a5 2d lda tmp_ptr2 7585: e5 5c sbc polyobj_ptr 7587: a8 tay 7588: a5 2e lda tmp_ptr2+1 758a: e5 5d sbc polyobj_ptr+1 758c: 90 c6 bcc L7554 758e: d0 04 bne L7594 7590: c0 25 cpy #$25 7592: 90 c0 bcc L7554 7594: a5 2d L7594 lda tmp_ptr2 7596: 8d f3 02 sta $02f3 7599: a5 2e lda tmp_ptr2+1 759b: 8d f4 02 sta $02f4 759e: a0 0e L759E ldy #$0e 75a0: b1 5a lda (hull_ptr),y 75a2: 85 2f sta $2f 75a4: a0 13 ldy #$13 ;00LLLMMM laser|missile from hull 75a6: b1 5a lda (hull_ptr),y 75a8: 29 07 and #$07 ;lower 3 bits are number of missiles 75aa: 85 2b sta polyobj_vis 75ac: a5 d0 lda $d0 ;get ship type 75ae: 9d 41 02 L75AE sta PLAYER_STATE?,x 75b1: aa tax 75b2: 30 12 bmi L75C6 75b4: e0 0f cpx #$0f 75b6: f0 08 beq L75C0 75b8: e0 03 cpx #$03 75ba: 90 07 bcc L75C3 75bc: e0 0b cpx #$0b 75be: b0 03 bcs L75C3 75c0: ee 6b 02 L75C0 inc PLAYER_STATE?+42 75c3: fe 4a 02 L75C3 inc PLAYER_STATE?+9,x 75c6: a4 d0 L75C6 ldy $d0 75c8: b9 3f a3 lda hull_NEWB-1,y 75cb: 29 6f and #$6f 75cd: 05 30 ora $30 75cf: 85 30 sta $30 75d1: a0 24 ldy #$24 75d3: b9 0c 00 L75D3 lda polyobj_xpos_lo,y 75d6: 91 5c sta (polyobj_ptr),y 75d8: 88 dey 75d9: 10 f8 bpl L75D3 75db: 38 sec 75dc: 60 rts 75dd: b5 0c L75DD lda polyobj_xpos_lo,x 75df: 49 80 eor #$80 75e1: 95 0c sta polyobj_xpos_lo,x 75e3: e8 inx 75e4: e8 inx 75e5: 60 rts 75e6: a2 ff L75E6 ldx #$ff 75e8: 86 7f L75E8 stx missile_thing? 75ea: ae c2 02 ldx missile_armed_flag? 75ed: 20 35 a0 jsr DrawIndicator? 75f0: 8c 71 02 sty PLAYER_STATE?+48 75f3: 60 rts 75f4: 04 .dd1 $04 75f5: 00 .dd1 $00 75f6: 00 .dd1 $00 75f7: 00 .dd1 $00 75f8: 00 .dd1 $00 75f9: a5 0c L75F9 lda polyobj_xpos_lo 75fb: 85 31 sta $31 75fd: a5 0d lda INWK+1 75ff: 85 32 sta $32 7601: a5 0e lda INWK+2 7603: 20 e3 78 jsr L78E3 7606: b0 28 bcs L7630 7608: a5 7a lda $7a 760a: 69 80 adc #$80 760c: 85 38 sta $38 760e: 8a txa 760f: 69 00 adc #$00 7611: 85 39 sta $39 7613: a5 0f lda polyobj_ypos_lo 7615: 85 31 sta $31 7617: a5 10 lda INWK+4 7619: 85 32 sta $32 761b: a5 11 lda INWK+5 761d: 49 80 eor #$80 761f: 20 e3 78 jsr L78E3 7622: b0 0c bcs L7630 7624: a5 7a lda $7a 7626: 69 44 adc #$44 7628: 85 46 sta $46 762a: 8a txa 762b: 69 00 adc #$00 762d: 85 47 sta $47 762f: 18 clc 7630: 60 L7630 rts 7631: a5 b8 L7631 lda $b8 ;ship type 7633: 4a lsr A ;bit 0 -> carry 7634: b0 03 bcs L7639 ;sun has bit 0 set 7636: 4c 17 78 jmp DrawSunOrPlanet ;wipe planet 7639: 4c 5b 78 L7639 jmp L785B ;wipe sun ; Draw planet or sun. ; ; BBC .PLANET (flight code). 763c: a5 14 Planet? lda polyobj_zpos_hi 763e: c9 30 cmp #$30 7640: b0 ef bcs L7631 ;far away, branch 7642: 05 13 ora polyobj_zpos_mi 7644: f0 eb beq L7631 ;very close, branch 7646: 20 f9 75 jsr L75F9 ;"Project K+INWK(x,y)/z to K3,K4 for center to screen" 7649: b0 e6 bcs L7631 764b: a9 60 lda #$60 ;radius hi 764d: 85 32 sta $32 764f: a9 00 lda #$00 ;radius lo 7651: 85 31 sta $31 7653: 20 43 61 jsr L6143 ;"divide 3bytes by 2, K = P(2).A/INWK_z" 7656: a5 7b lda $7b 7658: f0 04 beq L765E 765a: a9 f8 lda #$f8 765c: 85 7a sta $7a 765e: a5 b8 L765E lda $b8 ;ship type 7660: 4a lsr A ;sun has bit 0 set 7661: 90 03 bcc :Planet ;planet 7663: 4c 7b 76 jmp L767B ;sun 7666: 20 17 78 :Planet jsr DrawSunOrPlanet 7669: 4c a0 77 jmp L77A0 766c: 4c 5b 78 L766C jmp L785B 766f: 8a L766F txa 7670: 49 ff eor #$ff 7672: 18 clc 7673: 69 01 adc #$01 7675: aa tax 7676: a9 ff L7676 lda #$ff 7678: 4c c3 76 jmp L76C3 767b: a9 14 L767B lda #$14 767d: 85 35 sta $35 767f: a9 01 lda #$01 7681: 85 d3 sta $d3 7683: 20 a9 78 jsr L78A9 7686: b0 e4 bcs L766C 7688: a9 00 lda #$00 768a: a6 7a ldx $7a 768c: e0 60 cpx #$60 768e: 2a rol A 768f: e0 28 cpx #$28 7691: 2a rol A 7692: e0 10 cpx #$10 7694: 2a rol A 7695: 85 bd sta $bd 7697: a5 cc lda $cc 7699: a6 33 ldx $33 769b: d0 0a bne L76A7 769d: c5 32 cmp $32 769f: 90 06 bcc L76A7 76a1: a5 32 lda $32 76a3: d0 02 bne L76A7 76a5: a9 01 lda #$01 76a7: 85 bb L76A7 sta $bb 76a9: a5 cc lda $cc 76ab: 38 sec 76ac: e5 46 sbc $46 76ae: aa tax 76af: a9 00 lda #$00 76b1: e5 47 sbc $47 76b3: 30 ba bmi L766F 76b5: d0 08 bne L76BF 76b7: e8 inx 76b8: ca dex 76b9: f0 bb beq L7676 76bb: e4 7a cpx $7a 76bd: 90 04 bcc L76C3 76bf: a6 7a L76BF ldx $7a 76c1: a9 00 lda #$00 76c3: 86 5e L76C3 stx ]data_ptr 76c5: 85 5f sta ]data_ptr+1 76c7: a5 7a lda $7a 76c9: 20 32 5f jsr L5F32 76cc: 85 c7 sta $c7 76ce: a5 31 lda $31 76d0: 85 c6 sta $c6 76d2: a4 cc ldy $cc 76d4: a5 64 lda $64 76d6: 85 62 sta $62 76d8: a5 65 lda $65 76da: 85 63 sta $63 76dc: c4 bb L76DC cpy $bb 76de: f0 0b beq L76EB 76e0: b9 00 06 lda $0600,y 76e3: f0 03 beq L76E8 76e5: 20 c6 4e jsr L4EC6 76e8: 88 L76E8 dey 76e9: d0 f1 bne L76DC 76eb: a5 5e L76EB lda ]data_ptr 76ed: 20 32 5f jsr L5F32 76f0: 85 d0 sta $d0 76f2: a5 c6 lda $c6 76f4: 38 sec 76f5: e5 31 sbc $31 76f7: 85 ad sta $ad 76f9: a5 c7 lda $c7 76fb: e5 d0 sbc $d0 76fd: 85 ae sta $ae 76ff: 84 6f sty $6f 7701: 20 45 87 jsr TwoByteSqrt 7704: a4 6f ldy $6f 7706: 20 7c 7b jsr GetRandom 7709: 25 bd and $bd 770b: 18 clc 770c: 65 ad adc $ad 770e: 90 02 bcc L7712 7710: a9 ff lda #$ff 7712: be 00 06 L7712 ldx $0600,y 7715: 99 00 06 sta $0600,y 7718: f0 4a beq L7764 771a: a5 64 lda $64 771c: 85 62 sta $62 771e: a5 65 lda $65 7720: 85 63 sta $63 7722: 8a txa 7723: 20 78 78 jsr L7878 7726: a5 6e lda $6e 7728: 85 60 sta $60 772a: a5 70 lda $70 772c: 85 61 sta $61 772e: a5 38 lda $38 7730: 85 62 sta $62 7732: a5 39 lda $39 7734: 85 63 sta $63 7736: b9 00 06 lda $0600,y 7739: 20 78 78 jsr L7878 773c: b0 0b bcs L7749 773e: a5 70 lda $70 7740: a6 60 ldx $60 7742: 86 70 stx $70 7744: 85 60 sta $60 7746: 20 90 9e jsr DrawHorizLine 7749: a5 60 L7749 lda $60 774b: 85 6e sta $6e 774d: a5 61 lda $61 774f: 85 70 sta $70 7751: 20 90 9e L7751 jsr DrawHorizLine 7754: 88 L7754 dey 7755: f0 3f beq L7796 7757: a5 5f lda ]data_ptr+1 7759: d0 1d bne L7778 775b: c6 5e dec ]data_ptr 775d: d0 8c bne L76EB 775f: c6 5f dec ]data_ptr+1 7761: 4c eb 76 L7761 jmp L76EB 7764: a6 38 L7764 ldx $38 7766: 86 62 stx $62 7768: a6 39 ldx $39 776a: 86 63 stx $63 776c: 20 78 78 jsr L7878 776f: 90 e0 bcc L7751 7771: a9 00 lda #$00 7773: 99 00 06 sta $0600,y 7776: f0 dc beq L7754 7778: a6 5e L7778 ldx ]data_ptr 777a: e8 inx 777b: 86 5e stx ]data_ptr 777d: e4 7a cpx $7a 777f: 90 e0 bcc L7761 7781: f0 de beq L7761 7783: a5 64 lda $64 7785: 85 62 sta $62 7787: a5 65 lda $65 7789: 85 63 sta $63 778b: b9 00 06 L778B lda $0600,y 778e: f0 03 beq L7793 7790: 20 c6 4e jsr L4EC6 7793: 88 L7793 dey 7794: d0 f5 bne L778B 7796: 18 L7796 clc 7797: a5 38 lda $38 7799: 85 64 sta $64 779b: a5 39 lda $39 779d: 85 65 sta $65 779f: 60 L779F rts 77a0: 20 a9 78 L77A0 jsr L78A9 77a3: b0 fa bcs L779F 77a5: a9 00 lda #$00 77a7: 8d 00 04 sta xcoords? 77aa: a6 7a ldx $7a 77ac: a9 08 lda #$08 77ae: e0 08 cpx #$08 77b0: 90 06 bcc L77B8 77b2: 4a lsr A 77b3: e0 3c cpx #$3c 77b5: 90 01 bcc L77B8 77b7: 4a lsr A 77b8: 85 bf L77B8 sta $bf 77ba: a2 ff L77BA ldx #$ff 77bc: 86 bc stx $bc 77be: e8 inx 77bf: 86 bd stx $bd 77c1: a5 bd L77C1 lda $bd 77c3: 20 8a 5f jsr FMLTU2 77c6: a2 00 ldx #$00 77c8: 86 d0 stx $d0 77ca: a6 bd ldx $bd 77cc: e0 21 cpx #$21 77ce: 90 0d bcc L77DD 77d0: 49 ff eor #$ff 77d2: 69 00 adc #$00 77d4: aa tax 77d5: a9 ff lda #$ff 77d7: 69 00 adc #$00 77d9: 85 d0 sta $d0 77db: 8a txa 77dc: 18 clc 77dd: 65 38 L77DD adc $38 77df: 85 9c sta $9c 77e1: a5 39 lda $39 77e3: 65 d0 adc $d0 77e5: 85 9d sta $9d 77e7: a5 bd lda $bd 77e9: 18 clc 77ea: 69 10 adc #$10 77ec: 20 8a 5f jsr FMLTU2 77ef: aa tax 77f0: a9 00 lda #$00 77f2: 85 d0 sta $d0 77f4: a5 bd lda $bd 77f6: 69 0f adc #$0f 77f8: 29 3f and #$3f 77fa: c9 21 cmp #$21 77fc: 90 0d bcc L780B 77fe: 8a txa 77ff: 49 ff eor #$ff 7801: 69 00 adc #$00 7803: aa tax 7804: a9 ff lda #$ff 7806: 69 00 adc #$00 7808: 85 d0 sta $d0 780a: 18 clc 780b: 20 8b 4f L780B jsr L4F8B 780e: c9 41 cmp #$41 7810: b0 03 bcs L7815 7812: 4c c1 77 jmp L77C1 7815: 18 L7815 clc 7816: 60 rts ; This is called by the code that draws big circles (sun / planet). 7817: ac 00 04 DrawSunOrPlanet ldy xcoords? 781a: d0 35 bne L7851 781c: c4 91 :Loop cpy $91 781e: b0 31 bcs L7851 7820: b9 00 05 lda ycoords?,y 7823: c9 ff cmp #$ff 7825: f0 1b beq L7842 7827: 85 71 sta $71 7829: b9 00 04 lda xcoords?,y 782c: 85 70 sta $70 782e: 20 64 9c jsr DrawLine 7831: c8 iny 7832: ad 7d 02 lda lcoord_swap_flag 7835: d0 e5 bne :Loop 7837: a5 70 lda $70 7839: 85 6e sta $6e 783b: a5 71 lda $71 783d: 85 6f sta $6f 783f: 4c 1c 78 jmp :Loop 7842: c8 L7842 iny 7843: b9 00 04 lda xcoords?,y 7846: 85 6e sta $6e 7848: b9 00 05 lda ycoords?,y 784b: 85 6f sta $6f 784d: c8 iny 784e: 4c 1c 78 jmp :Loop 7851: a9 01 L7851 lda #$01 7853: 85 91 sta $91 7855: a9 ff lda #$ff 7857: 8d 00 04 sta xcoords? 785a: 60 L785A rts 785b: a5 d3 L785B lda $d3 785d: 30 fb bmi L785A 785f: a5 64 lda $64 7861: 85 62 sta $62 7863: a5 65 lda $65 7865: 85 63 sta $63 7867: a0 87 ldy #$87 7869: b9 00 06 L7869 lda $0600,y 786c: f0 03 beq L7871 786e: 20 c6 4e jsr L4EC6 7871: 88 L7871 dey 7872: d0 f5 bne L7869 7874: 88 dey 7875: 84 d3 sty $d3 7877: 60 rts 7878: 85 d0 L7878 sta $d0 787a: 18 clc 787b: 65 62 adc $62 787d: 85 70 sta $70 787f: a5 63 lda $63 7881: 69 00 adc #$00 7883: 30 1d bmi L78A2 7885: f0 04 beq L788B 7887: a9 ff lda #$ff 7889: 85 70 sta $70 788b: a5 62 L788B lda $62 788d: 38 sec 788e: e5 d0 sbc $d0 7890: 85 6e sta $6e 7892: a5 63 lda $63 7894: e9 00 sbc #$00 7896: d0 02 bne L789A 7898: 18 clc 7899: 60 rts 789a: 10 06 L789A bpl L78A2 789c: a9 00 lda #$00 789e: 85 6e sta $6e 78a0: 18 clc 78a1: 60 rts 78a2: a9 00 L78A2 lda #$00 78a4: 99 00 06 sta $0600,y 78a7: 38 sec 78a8: 60 rts 78a9: a5 38 L78A9 lda $38 78ab: 18 clc 78ac: 65 7a adc $7a 78ae: a5 39 lda $39 78b0: 69 00 adc #$00 78b2: 30 2d bmi L78E1 78b4: a5 38 lda $38 78b6: 38 sec 78b7: e5 7a sbc $7a 78b9: a5 39 lda $39 78bb: e9 00 sbc #$00 78bd: 30 02 bmi L78C1 78bf: d0 20 bne L78E1 78c1: a5 46 L78C1 lda $46 78c3: 18 clc 78c4: 65 7a adc $7a 78c6: 85 32 sta $32 78c8: a5 47 lda $47 78ca: 69 00 adc #$00 78cc: 30 13 bmi L78E1 78ce: 85 33 sta $33 78d0: a5 46 lda $46 78d2: 38 sec 78d3: e5 7a sbc $7a 78d5: aa tax 78d6: a5 47 lda $47 78d8: e9 00 sbc #$00 78da: 30 2a bmi L7906 78dc: d0 03 bne L78E1 78de: e4 cc cpx $cc 78e0: 60 rts 78e1: 38 L78E1 sec 78e2: 60 rts 78e3: 20 43 61 L78E3 jsr L6143 78e6: a5 7d lda $7d 78e8: 29 7f and #$7f 78ea: 05 7c ora $7c 78ec: d0 f3 bne L78E1 78ee: a6 7b ldx $7b 78f0: e0 04 cpx #$04 78f2: b0 13 bcs L7907 78f4: a5 7d lda $7d 78f6: 10 0f bpl L7907 78f8: a5 7a lda $7a 78fa: 49 ff eor #$ff 78fc: 69 01 adc #$01 78fe: 85 7a sta $7a 7900: 8a txa 7901: 49 ff eor #$ff 7903: 69 00 adc #$00 7905: aa tax 7906: 18 L7906 clc 7907: 60 L7907 rts 7908: 20 e7 84 L7908 jsr GetInput? 790b: c9 59 cmp #$59 790d: f0 f8 beq L7907 790f: c9 4e cmp #$4e 7911: d0 f5 bne L7908 7913: 18 clc 7914: 60 rts ; ; Processes all input. Flight controls update appropriate values in zero page. ; Non-flight keys are returned in the caller. ; ; On exit: ; A-reg: non-flight key hit, or $00 if none ; 7915: a5 b3 GetGameInput lda displayed_screen ;looking at space? 7917: d0 05 bne L791E ;no, branch 7919: 20 25 84 jsr HandleFlightInput 791c: 8a txa 791d: 60 rts 791e: 20 25 84 L791E jsr HandleFlightInput 7921: ad 5e 45 lda ptb_joy_enab 7924: f0 11 beq L7937 7926: a5 d2 lda pitch_velocity 7928: 20 68 79 jsr L7968 792b: a8 tay 792c: a5 d1 lda roll_velocity 792e: 49 ff eor #$ff 7930: 20 68 79 jsr L7968 7933: aa tax 7934: a5 80 lda input_raw_key 7936: 60 rts 7937: a9 00 L7937 lda #$00 7939: 85 8c sta cmd_fire_mssl 793b: 85 8e sta cmd_local_jump 793d: a5 80 lda input_raw_key 793f: a2 00 ldx #$00 7941: a0 00 ldy #$00 7943: c9 08 cmp #$08 7945: f0 04 beq L794B 7947: c9 4a cmp #$4a 7949: d0 01 bne L794C 794b: ca L794B dex 794c: c9 15 L794C cmp #$15 794e: f0 04 beq L7954 7950: c9 4b cmp #$4b 7952: d0 01 bne L7955 7954: e8 L7954 inx 7955: c9 0a L7955 cmp #$0a 7957: f0 04 beq L795D 7959: c9 4d cmp #$4d 795b: d0 01 bne L795E 795d: 88 L795D dey 795e: c9 0b L795E cmp #$0b 7960: f0 04 beq L7966 7962: c9 49 cmp #$49 7964: d0 01 bne L7967 7966: c8 L7966 iny 7967: 60 L7967 rts 7968: 4a L7968 lsr A 7969: 4a lsr A 796a: 4a lsr A 796b: 4a lsr A 796c: 4a lsr A 796d: 69 00 adc #$00 796f: e9 03 sbc #$03 7971: 60 rts 7972: a5 31 L7972 lda $31 7974: 8d f3 02 sta $02f3 7977: a5 32 lda $32 7979: 8d f4 02 sta $02f4 797c: 60 rts 797d: a6 b0 L797D ldx $b0 797f: 20 d6 79 jsr L79D6 7982: a6 b0 ldx $b0 7984: 4c b2 47 jmp L47B2 7987: 20 14 7b L7987 jsr ZeroInfo 798a: 20 28 74 jsr L7428 798d: 8d 42 02 sta PLAYER_STATE?+1 7990: 8d 4c 02 sta PLAYER_STATE?+11 7993: 20 19 a0 jsr LA019 7996: a9 06 lda #$06 7998: 85 11 sta INWK+5 799a: a9 81 lda #$81 799c: 4c 45 75 jmp L7545 799f: a2 ff L799F ldx #$ff 79a1: e8 L79A1 inx 79a2: bd 41 02 lda PLAYER_STATE?,x 79a5: f0 cb beq L7972 79a7: c9 01 cmp #$01 79a9: d0 f6 bne L79A1 79ab: 8a txa 79ac: 0a asl A 79ad: a8 tay 79ae: b9 7e 4e lda L4E7E,y 79b1: 85 0a sta $0a 79b3: b9 7f 4e lda L4E7F,y 79b6: 85 0b sta $0b 79b8: a0 20 ldy #$20 79ba: b1 0a lda ($0a),y 79bc: 10 e3 bpl L79A1 79be: 29 7f and #$7f 79c0: 4a lsr A 79c1: c5 c0 cmp $c0 79c3: 90 dc bcc L79A1 79c5: f0 09 beq L79D0 79c7: e9 01 sbc #$01 79c9: 0a asl A 79ca: 09 80 ora #$80 79cc: 91 0a sta ($0a),y 79ce: d0 d1 bne L79A1 79d0: a9 00 L79D0 lda #$00 79d2: 91 0a sta ($0a),y 79d4: f0 cb beq L79A1 79d6: 86 c0 L79D6 stx $c0 79d8: a5 7f lda missile_thing? 79da: c5 c0 cmp $c0 79dc: d0 0a bne L79E8 79de: a0 08 ldy #$08 79e0: 20 e6 75 jsr L75E6 79e3: a9 c8 lda #$c8 ;"Target Lost" 79e5: 20 05 85 jsr PrintMessageBriefly 79e8: a4 c0 L79E8 ldy $c0 79ea: be 41 02 ldx PLAYER_STATE?,y 79ed: e0 02 cpx #$02 79ef: f0 96 beq L7987 79f1: e0 1f cpx #$1f 79f3: d0 0b bne L7A00 79f5: ad 8f 02 lda $028f 79f8: 09 02 ora #$02 79fa: 8d 8f 02 sta $028f 79fd: ee d7 02 inc kill_score+1 7a00: e0 0f L7A00 cpx #$0f 7a02: f0 08 beq L7A0C 7a04: e0 03 cpx #$03 7a06: 90 07 bcc L7A0F 7a08: e0 0b cpx #$0b 7a0a: b0 03 bcs L7A0F 7a0c: ce 6b 02 L7A0C dec PLAYER_STATE?+42 7a0f: de 4a 02 L7A0F dec PLAYER_STATE?+9,x 7a12: a6 c0 ldx $c0 7a14: a0 05 ldy #$05 7a16: b1 5a lda (hull_ptr),y 7a18: a0 21 ldy #$21 7a1a: 18 clc 7a1b: 71 5c adc (polyobj_ptr),y 7a1d: 85 31 sta $31 7a1f: c8 iny 7a20: b1 5c lda (polyobj_ptr),y 7a22: 69 00 adc #$00 7a24: 85 32 sta $32 7a26: e8 L7A26 inx 7a27: bd 41 02 lda PLAYER_STATE?,x 7a2a: 9d 40 02 sta PLAYER_STATE?-1,x 7a2d: d0 03 bne L7A32 7a2f: 4c 9f 79 jmp L799F 7a32: 0a L7A32 asl A 7a33: a8 tay 7a34: b9 fe a2 lda hull_addr_lo,y 7a37: 85 0a sta $0a 7a39: b9 ff a2 lda hull_addr_hi,y 7a3c: 85 0b sta $0b 7a3e: a0 05 ldy #$05 7a40: b1 0a lda ($0a),y 7a42: 85 d0 sta $d0 7a44: a5 31 lda $31 7a46: 38 sec 7a47: e5 d0 sbc $d0 7a49: 85 31 sta $31 7a4b: a5 32 lda $32 7a4d: e9 00 sbc #$00 7a4f: 85 32 sta $32 7a51: 8a txa 7a52: 0a asl A 7a53: a8 tay 7a54: b9 7e 4e lda L4E7E,y 7a57: 85 0a sta $0a 7a59: b9 7f 4e lda L4E7F,y 7a5c: 85 0b sta $0b 7a5e: a0 24 ldy #$24 7a60: b1 0a lda ($0a),y 7a62: 91 5c sta (polyobj_ptr),y 7a64: 88 dey 7a65: b1 0a lda ($0a),y 7a67: 91 5c sta (polyobj_ptr),y 7a69: 88 dey 7a6a: b1 0a lda ($0a),y 7a6c: 85 7b sta $7b 7a6e: a5 32 lda $32 7a70: 91 5c sta (polyobj_ptr),y 7a72: 88 dey 7a73: b1 0a lda ($0a),y 7a75: 85 7a sta $7a 7a77: a5 31 lda $31 7a79: 91 5c sta (polyobj_ptr),y 7a7b: 88 dey 7a7c: b1 0a L7A7C lda ($0a),y 7a7e: 91 5c sta (polyobj_ptr),y 7a80: 88 dey 7a81: 10 f9 bpl L7A7C 7a83: a5 0a lda $0a 7a85: 85 5c sta polyobj_ptr 7a87: a5 0b lda $0b 7a89: 85 5d sta polyobj_ptr+1 7a8b: a4 d0 ldy $d0 7a8d: 88 L7A8D dey 7a8e: b1 7a lda ($7a),y 7a90: 91 31 sta ($31),y 7a92: 98 tya 7a93: d0 f8 bne L7A8D 7a95: f0 8f beq L7A26 7a97: ae 9e 02 L7A97 ldx ship_state2? 7a9a: ca dex 7a9b: d0 0e bne L7AAB 7a9d: ad 90 02 lda $0290 7aa0: c9 90 cmp #$90 7aa2: d0 07 bne L7AAB 7aa4: ad 91 02 lda $0291 7aa7: c9 21 cmp #$21 7aa9: f0 01 beq L7AAC 7aab: 18 L7AAB clc 7aac: 60 L7AAC rts ; C64 _83ca "clear ships slots and some other data?" 7aad: 20 11 81 ClearStuff? jsr ZeroPlayerState ;leaves $00 in A-reg 7ab0: a2 06 ldx #$06 7ab2: 95 66 L7AB2 sta $66,x ;pitch, roll, ... 7ab4: ca dex 7ab5: 10 fb bpl L7AB2 7ab7: 8e 5c 45 stx ptb_joy_y_flip ;store $FF 7aba: 8a txa 7abb: 85 ba sta docked_flag 7abd: a2 02 ldx #$02 7abf: 95 d4 L7ABF sta $d4,x 7ac1: ca dex 7ac2: 10 fb bpl L7ABF 7ac4: a9 0c RES2 lda #$0c ;BBC .RES2 7ac6: 85 e2 sta $e2 7ac8: a2 ff ldx #$ff 7aca: 8e 00 04 stx xcoords? 7acd: 8e 00 05 stx ycoords? 7ad0: 86 7f stx missile_thing? 7ad2: a9 80 lda #$80 7ad4: 85 d2 sta pitch_velocity 7ad6: 85 6c sta $6c 7ad8: 85 a7 sta $a7 7ada: 0a asl A 7adb: 85 66 sta $66 7add: 85 67 sta $67 7adf: 85 6d sta $6d 7ae1: 85 a8 sta $a8 7ae3: 85 b6 sta $b6 7ae5: a9 03 lda #$03 7ae7: 85 a9 sta player_speed 7ae9: 85 b9 sta $b9 7aeb: 85 6b sta $6b 7aed: a9 00 lda #$00 7aef: 85 cb sta $cb 7af1: a9 87 lda #$87 7af3: 85 cc sta $cc 7af5: ad 4c 02 lda PLAYER_STATE?+11 7af8: f0 03 beq L7AFD 7afa: 20 19 a0 jsr LA019 7afd: a5 6a L7AFD lda ecm_active_flag? 7aff: f0 03 beq L7B04 7b01: 20 12 95 jsr L9512 7b04: 20 f3 73 L7B04 jsr L73F3 7b07: 20 11 81 jsr ZeroPlayerState 7b0a: a9 5f lda #$5f 7b0c: 8d f3 02 sta $02f3 7b0f: a9 0b lda #$0b 7b11: 8d f4 02 sta $02f4 7b14: a0 24 ZeroInfo ldy #$24 ;BBC ZINF 7b16: a9 00 lda #$00 7b18: 99 0c 00 L7B18 sta polyobj_xpos_lo,y 7b1b: 88 dey 7b1c: 10 fa bpl L7B18 7b1e: a9 60 lda #$60 7b20: 85 1e sta $1e 7b22: 85 22 sta $22 7b24: 09 80 ora #$80 7b26: 85 1a sta polyobj_mox2_hi 7b28: 60 rts 7b29: a2 04 L7B29 ldx #$04 7b2b: ec c2 02 L7B2B cpx missile_armed_flag? 7b2e: f0 09 beq L7B39 7b30: a0 00 ldy #$00 7b32: 20 35 a0 jsr DrawIndicator? 7b35: ca dex 7b36: d0 f3 bne L7B2B 7b38: 60 rts 7b39: a0 08 L7B39 ldy #$08 7b3b: 20 35 a0 jsr DrawIndicator? 7b3e: ca dex 7b3f: d0 f8 bne L7B39 7b41: 60 rts 7b42: a5 b3 L7B42 lda displayed_screen 7b44: d0 0e bne L7B54 7b46: ad dc 02 lda in_flight_msg_token 7b49: 20 05 85 jsr PrintMessageBriefly 7b4c: a9 00 lda #$00 7b4e: 8d 77 02 sta PLAYER_STATE?+54 7b51: 4c c7 7b jmp L7BC7 7b54: 20 1e a2 L7B54 jsr ClearLines? 7b57: 4c c7 7b jmp L7BC7 7b5a: 20 14 7b L7B5A jsr ZeroInfo 7b5d: 20 7c 7b jsr GetRandom 7b60: 85 06 sta $06 7b62: 29 80 and #$80 7b64: 85 0e sta INWK+2 7b66: 8a txa 7b67: 29 80 and #$80 7b69: 85 11 sta INWK+5 7b6b: a9 19 lda #$19 7b6d: 85 0d sta INWK+1 7b6f: 85 10 sta INWK+4 7b71: 85 13 sta polyobj_zpos_mi 7b73: 8a txa 7b74: c9 f5 cmp #$f5 7b76: 2a rol A 7b77: 09 c0 ora #$c0 7b79: 85 2c sta polyobj_attack 7b7b: 18 SaveScramble? clc NOTE: C64 $84AF (code_6A00.asm) ; ; Generate a random number. ; ; Used for various things, notably the programmatically generated planet data. ; ; On exit: ; A-reg: random number (0-255) ; 7b7c: a5 02 GetRandom lda rng_state 7b7e: 2a rol A 7b7f: aa tax 7b80: 65 04 adc rng_state+2 7b82: 85 02 sta rng_state 7b84: 86 04 stx rng_state+2 7b86: a5 03 lda rng_state+1 7b88: aa tax 7b89: 65 05 adc rng_state+3 7b8b: 85 03 sta rng_state+1 7b8d: 86 05 stx rng_state+3 7b8f: 60 rts 7b90: 20 7c 7b L7B90 jsr GetRandom 7b93: 4a lsr A 7b94: 85 2c sta polyobj_attack 7b96: 85 29 sta polyobj_roll 7b98: 26 2b rol polyobj_vis 7b9a: 29 1f and #$1f 7b9c: 09 10 ora #$10 7b9e: 85 27 sta polyobj_vertex_lo 7ba0: 20 7c 7b jsr GetRandom 7ba3: 30 0a bmi L7BAF 7ba5: a5 2c lda polyobj_attack 7ba7: 09 c0 ora #$c0 ;active | target 7ba9: 85 2c sta polyobj_attack 7bab: a2 10 ldx #$10 7bad: 86 30 stx $30 7baf: 29 02 L7BAF and #$02 7bb1: 69 0b adc #$0b 7bb3: c9 0f cmp #$0f 7bb5: f0 03 beq L7BBA 7bb7: 20 45 75 jsr L7545 7bba: 20 82 46 L7BBA jsr UpdateShipControls 7bbd: ce 77 02 dec PLAYER_STATE?+54 7bc0: f0 80 beq L7B42 7bc2: 10 03 bpl L7BC7 7bc4: ee 77 02 inc PLAYER_STATE?+54 7bc7: c6 b6 L7BC7 dec $b6 7bc9: f0 03 beq L7BCE 7bcb: 4c e1 7c :MainLoop_jmp jmp MainLoop 7bce: ad 6e 02 L7BCE lda witch_space_flag ;in witch space? 7bd1: d0 f8 bne :MainLoop_jmp ;yes, skip this 7bd3: 20 7c 7b jsr GetRandom 7bd6: c9 23 cmp #$23 7bd8: b0 55 bcs L7C2F 7bda: ad 6b 02 lda PLAYER_STATE?+42 7bdd: c9 03 cmp #$03 7bdf: b0 4e bcs L7C2F 7be1: 20 14 7b jsr ZeroInfo 7be4: a9 26 lda #$26 7be6: 85 13 sta polyobj_zpos_mi 7be8: 20 7c 7b jsr GetRandom 7beb: 85 0c sta polyobj_xpos_lo 7bed: 86 0f stx polyobj_ypos_lo 7bef: 29 80 and #$80 7bf1: 85 0e sta INWK+2 7bf3: 8a txa 7bf4: 29 80 and #$80 7bf6: 85 11 sta INWK+5 7bf8: 26 0d rol INWK+1 7bfa: 26 0d rol INWK+1 7bfc: 20 7c 7b jsr GetRandom 7bff: 70 8f bvs L7B90 7c01: 09 6f ora #$6f 7c03: 85 29 sta polyobj_roll 7c05: ad 4c 02 lda PLAYER_STATE?+11 7c08: d0 25 bne L7C2F 7c0a: 8a txa 7c0b: b0 08 bcs L7C15 7c0d: 29 1f and #$1f 7c0f: 09 10 ora #$10 7c11: 85 27 sta polyobj_vertex_lo 7c13: 90 04 bcc L7C19 7c15: 09 7f L7C15 ora #$7f 7c17: 85 2a sta polyobj_pitch 7c19: 20 7c 7b L7C19 jsr GetRandom 7c1c: c9 fc cmp #$fc 7c1e: 90 06 bcc L7C26 7c20: a9 0f lda #$0f 7c22: 85 2c sta polyobj_attack 7c24: d0 06 bne L7C2C 7c26: c9 0a L7C26 cmp #$0a 7c28: 29 01 and #$01 7c2a: 69 05 adc #$05 7c2c: 20 45 75 L7C2C jsr L7545 7c2f: ad 4c 02 L7C2F lda PLAYER_STATE?+11 7c32: f0 03 beq L7C37 7c34: 4c e1 7c L7C34 jmp MainLoop 7c37: 20 07 7e L7C37 jsr CountIllegalCargo 7c3a: 0a asl A 7c3b: ae 5a 02 ldx PLAYER_STATE?+25 7c3e: f0 03 beq L7C43 7c40: 0d c3 02 ora player_fug_inno 7c43: 85 d0 L7C43 sta $d0 7c45: 20 5a 7b jsr L7B5A 7c48: c9 88 cmp #$88 7c4a: f0 26 beq L7C72 7c4c: c5 d0 cmp $d0 7c4e: b0 05 bcs L7C55 7c50: a9 10 lda #$10 7c52: 20 45 75 jsr L7545 7c55: ad 5a 02 L7C55 lda PLAYER_STATE?+25 7c58: d0 da bne L7C34 7c5a: ce 76 02 dec PLAYER_STATE?+53 7c5d: 10 d5 bpl L7C34 7c5f: ee 76 02 inc PLAYER_STATE?+53 7c62: ad 8f 02 lda $028f 7c65: 29 0c and #$0c 7c67: c9 08 cmp #$08 7c69: d0 0a bne L7C75 7c6b: 20 7c 7b jsr GetRandom 7c6e: c9 c8 cmp #$c8 7c70: 90 03 bcc L7C75 7c72: 20 6f 6d L7C72 jsr L6D6F 7c75: 20 7c 7b L7C75 jsr GetRandom 7c78: ac f1 02 ldy $02f1 7c7b: f0 0b beq L7C88 7c7d: c9 5a cmp #$5a 7c7f: b0 b3 bcs L7C34 7c81: 29 07 and #$07 7c83: cd f1 02 cmp $02f1 7c86: 90 ac bcc L7C34 7c88: 20 5a 7b L7C88 jsr L7B5A 7c8b: c9 64 cmp #$64 7c8d: b0 36 bcs L7CC5 7c8f: ee 76 02 inc PLAYER_STATE?+53 7c92: 29 03 and #$03 7c94: 69 18 adc #$18 7c96: a8 tay 7c97: 20 97 7a jsr L7A97 7c9a: 90 11 bcc L7CAD 7c9c: a9 f9 lda #$f9 7c9e: 85 2c sta polyobj_attack 7ca0: ad 8f 02 lda $028f 7ca3: 29 03 and #$03 7ca5: 4a lsr A 7ca6: 90 05 bcc L7CAD 7ca8: 0d 69 02 ora PLAYER_STATE?+40 7cab: f0 10 beq L7CBD 7cad: a9 04 L7CAD lda #$04 7caf: 85 30 sta $30 7cb1: 20 7c 7b jsr GetRandom 7cb4: c9 c8 cmp #$c8 7cb6: 2a rol A 7cb7: 09 c0 ora #$c0 7cb9: 85 2c sta polyobj_attack 7cbb: 98 tya 7cbc: 2c bit ▼ font_glyphs+$2a9 7cbd: a9 1f L7CBD lda #$1f 7cbf: 20 45 75 jsr L7545 7cc2: 4c e1 7c jmp MainLoop 7cc5: 29 03 L7CC5 and #$03 7cc7: 8d 76 02 sta PLAYER_STATE?+53 7cca: 85 b5 sta $b5 7ccc: 20 7c 7b L7CCC jsr GetRandom 7ccf: 85 d0 sta $d0 7cd1: 20 7c 7b jsr GetRandom 7cd4: 25 d0 and $d0 7cd6: 29 07 and #$07 7cd8: 69 11 adc #$11 7cda: 20 45 75 jsr L7545 7cdd: c6 b5 dec $b5 7cdf: 10 eb bpl L7CCC NOTE: "main loop?" C64 $8627 (code_6A00.asm) BBC .MLOOP (flight) ; ; This appears to be the main game play loop while in space. ; ; The BBC Micro and C64 versions are similar but different. For example, the ; C64 version has additional code to handle "trumbles" (a non-infringing species ; of tribble). ; 7ce1: a2 ff MainLoop ldx #$ff ;reset the stack pointer 7ce3: 9a txs 7ce4: ae 74 02 ldx player_laser_temp ;cool the lasers 7ce7: f0 03 beq :Cold 7ce9: ce 74 02 dec player_laser_temp 7cec: ae 73 02 :Cold ldx main_dec2_thing? 7cef: f0 07 beq :Was0 7cf1: ca dex 7cf2: f0 01 beq :Was1 7cf4: ca dex 7cf5: 8e 73 02 :Was1 stx main_dec2_thing? 7cf8: 20 02 56 :Was0 jsr DrawHud? 7cfb: a5 b3 lda displayed_screen ;viewing space? 7cfd: f0 0b beq :NoDelay ;yes 7cff: 2d 5a 45 and ptb_pausecmd_x? 7d02: 4a lsr A ;check the low bit (set for planet info screen?) 7d03: b0 05 bcs :NoDelay ;set, don't delay 7d05: a0 02 ldy #$02 ;this seems to slow things down when you're in 7d07: 20 96 63 jsr LongDelay ; space but not looking at space 7d0a: 20 15 79 :NoDelay jsr GetGameInput 7d0d: 20 1a 7d FromGameInit jsr HandleNonFlightKey 7d10: a5 ba lda docked_flag ;docked? 7d12: f0 03 beq :CheckStuff ;no, check some stuff 7d14: 4c e1 7c jmp MainLoop 7d17: 4c ba 7b :CheckStuff jmp L7BBA NOTE: key handlers for screen selection HandleNonFlightKey 7d1a: c9 39 cmp #‘9’ 7d1c: d0 03 bne :Not9 7d1e: 4c ac 52 jmp ShipStatusScreen 7d21: c9 35 :Not9 cmp #‘5’ 7d23: d0 03 bne :Not5 7d25: 4c d9 65 jmp GalacticChartScreen 7d28: c9 36 :Not5 cmp #‘6’ 7d2a: d0 03 bne :Not6 7d2c: 4c c8 69 jmp LocalChartScreen 7d2f: c9 37 :Not6 cmp #‘7’ 7d31: d0 06 bne :Not7 7d33: 20 9e 6a jsr L6A9E 7d36: 4c 79 64 jmp SystemDataScreen 7d39: c9 30 :Not7 cmp #‘0’ 7d3b: d0 03 bne :Not0 7d3d: 4c f8 68 jmp CargoListScreen 7d40: c9 38 :Not0 cmp #‘8’ 7d42: d0 03 bne :Not8 7d44: 4c bf 6c jmp LocalMarketScreen 7d47: c9 31 :Not8 cmp #‘1’ 7d49: d0 03 bne :Not1 7d4b: 4c f2 6d jmp LaunchOrLook 7d4e: 24 ba :Not1 bit docked_flag ;are we docked? 7d50: 10 24 bpl :NotDocked ;no, skip these 7d52: c9 34 cmp #‘4’ 7d54: d0 03 bne :Not4 7d56: 4c 88 6e jmp DockEquipShip ;equip ship 7d59: c9 32 :Not4 cmp #‘2’ 7d5b: d0 03 bne :Not2 7d5d: 4c 07 67 jmp DockBuyCargo 7d60: c9 49 :Not2 cmp #‘I’ 7d62: d0 0b bne L7D6F 7d64: 20 31 81 jsr FileAccessMenu 7d67: 90 03 bcc L7D6C 7d69: 4c f8 7e jmp L7EF8 7d6c: 4c 2d 7f L7D6C jmp L7F2D 7d6f: c9 33 L7D6F cmp #‘3’ 7d71: d0 1a bne L7D8D 7d73: 4c 23 68 jmp DockSellCargo 7d76: c9 32 :NotDocked cmp #‘2’ 7d78: f0 0e beq :View2 7d7a: c9 33 cmp #‘3’ 7d7c: f0 07 beq :View3 7d7e: c9 34 cmp #‘4’ 7d80: d0 0b bne L7D8D 7d82: a2 03 ldx #$03 7d84: 2c bit ▼ $02a2 7d85: a2 02 :View3 ldx #$02 7d87: 2c bit ▼ $01a2 7d88: a2 01 :View2 ldx #$01 7d8a: 4c 5e 94 jmp SetViewDirection 7d8d: a5 80 L7D8D lda input_raw_key 7d8f: c9 48 cmp #‘H’ 7d91: d0 03 bne :NotH 7d93: 4c 46 6b jmp L6B46 ;hyperspace 7d96: c9 47 :NotH cmp #‘G’ 7d98: d0 03 bne :NotG 7d9a: 4c 46 6b jmp L6B46 ;intergalactic travel 7d9d: c9 44 :NotG cmp #‘D’ 7d9f: f0 4e beq ShowDistToPlanet 7da1: c9 46 cmp #‘F’ 7da3: d0 0d bne :NotF ; 'F': find planet by name (while looking at charts) 7da5: a5 ba lda docked_flag 7da7: f0 45 beq L7DEE 7da9: a5 b3 lda displayed_screen 7dab: 29 c0 and #$c0 7dad: f0 3f beq L7DEE 7daf: 4c 65 57 jmp L5765 7db2: 85 06 :NotF sta $06 7db4: a5 b3 lda displayed_screen 7db6: 29 c0 and #$c0 7db8: f0 16 beq L7DD0 7dba: a5 69 lda $69 7dbc: d0 12 bne L7DD0 7dbe: a5 06 lda $06 7dc0: c9 4f cmp #$4f 7dc2: d0 09 bne L7DCD 7dc4: 20 60 69 jsr L6960 7dc7: 20 8b 63 jsr L638B 7dca: 4c 60 69 jmp L6960 7dcd: 20 37 69 L7DCD jsr L6937 7dd0: a5 69 L7DD0 lda $69 7dd2: f0 1a beq L7DEE 7dd4: c6 68 dec $68 7dd6: d0 16 bne L7DEE 7dd8: a6 69 ldx $69 7dda: ca dex 7ddb: 20 03 6c jsr L6C03 7dde: a9 05 lda #$05 7de0: 85 68 sta $68 7de2: a6 69 ldx $69 7de4: 20 03 6c jsr L6C03 7de7: c6 69 dec $69 7de9: d0 03 bne L7DEE 7deb: 4c b0 6d jmp L6DB0 7dee: 60 L7DEE rts ; 'D' key hit (distance to system under crosshairs) ShowDistToPlanet 7def: a5 b3 lda displayed_screen 7df1: 29 c0 and #$c0 7df3: f0 f9 beq L7DEE 7df5: 20 5b 70 jsr L705B 7df8: 20 af 70 jsr :PrintSelPlanet 7dfb: a9 80 lda #$80 7dfd: 85 37 sta text_mod_flags 7dff: a9 0c lda #$0c 7e01: 20 33 55 jsr PrintChar 7e04: 4c 45 64 jmp L6445 ; BBC .BAD "Legal status from Cargo scan" CountIllegalCargo 7e07: ad a9 02 lda player_cargo+3 ;slaves 7e0a: 18 clc 7e0b: 6d ac 02 adc player_cargo+6 ;narcotics 7e0e: 0a asl A ;double penalty for slaves/narcotics 7e0f: 6d b0 02 adc player_cargo+10 ;firearms 7e12: 60 rts 7e13: a9 e0 L7E13 lda #$e0 7e15: c5 0d L7E15 cmp INWK+1 7e17: 90 06 bcc L7E1F 7e19: c5 10 cmp INWK+4 7e1b: 90 02 bcc L7E1F 7e1d: c5 13 cmp polyobj_zpos_mi 7e1f: 60 L7E1F rts 7e20: 05 0d L7E20 ora INWK+1 7e22: 05 10 ora INWK+4 7e24: 05 13 ora polyobj_zpos_mi 7e26: 60 rts 7e27: 00 L7E27 .dd1 $00 7e28: ce .dd1 $ce 7e29: 27 .dd1 $27 7e2a: 7e .dd1 $7e 7e2b: a2 .dd1 $a2 7e2c: ff .dd1 $ff 7e2d: 9a .dd1 $9a 7e2e: 20 .dd1 $20 7e2f: 67 .dd1 $67 7e30: 82 .dd1 $82 7e31: a8 .dd1 $a8 7e32: a9 .dd1 $a9 7e33: 07 .dd1 $07 7e34: 20 .dd1 $20 7e35: e6 a0 c8 b1+ .str “f H1}Px” 7e3c: 4c .dd1 $4c 7e3d: de .dd1 $de 7e3e: 7e .dd1 $7e 7e3f: a0 d2 GameOver? ldy #$d2 7e41: 20 71 95 jsr L9571 7e44: 20 c4 7a jsr RES2 7e47: 06 a9 asl player_speed 7e49: 06 a9 asl player_speed 7e4b: a9 00 lda #$00 7e4d: 20 b9 94 jsr PrintFlightHud? 7e50: 20 d1 73 jsr L73D1 7e53: a9 0c lda #$0c 7e55: 85 34 sta text_hposn 7e57: 85 36 sta text_vposn 7e59: a9 92 lda #$92 ;"GAME OVER" 7e5b: 20 d8 71 jsr PrintCannedMsg 7e5e: 20 5a 7b L7E5E jsr L7B5A 7e61: 4a lsr A 7e62: 4a lsr A 7e63: 85 0c sta polyobj_xpos_lo 7e65: a0 00 ldy #$00 7e67: 84 0d sty INWK+1 7e69: 84 10 sty INWK+4 7e6b: 84 13 sty polyobj_zpos_mi 7e6d: 84 2c sty polyobj_attack 7e6f: 88 dey 7e70: 84 b6 sty $b6 7e72: 49 2a eor #$2a 7e74: 85 0f sta polyobj_ypos_lo 7e76: 09 50 ora #$50 7e78: 85 12 sta polyobj_zpos_lo 7e7a: 8a txa 7e7b: 29 8f and #$8f 7e7d: 85 29 sta polyobj_roll 7e7f: a0 40 ldy #$40 7e81: 8c 73 02 sty main_dec2_thing? 7e84: 38 sec 7e85: 6a ror A 7e86: 29 87 and #$87 7e88: 85 2a sta polyobj_pitch 7e8a: a2 05 ldx #$05 7e8c: ad 07 a3 lda plate_addr+1 7e8f: f0 03 beq L7E94 7e91: 90 01 bcc L7E94 7e93: ca dex 7e94: 20 29 5c L7E94 jsr L5C29 7e97: 20 7c 7b jsr GetRandom 7e9a: 29 80 and #$80 7e9c: a0 1f ldy #$1f 7e9e: 91 5c sta (polyobj_ptr),y 7ea0: ad 45 02 lda PLAYER_STATE?+4 7ea3: f0 b9 beq L7E5E 7ea5: a9 00 lda #$00 7ea7: 85 a9 sta player_speed 7ea9: 20 82 46 jsr UpdateShipControls 7eac: 20 82 46 L7EAC jsr UpdateShipControls 7eaf: ce 73 02 dec main_dec2_thing? 7eb2: d0 f8 bne L7EAC 7eb4: 4c d8 7e jmp RestartGame saved_station_addr 7eb7: 88 .dd1 $88 7eb8: 88 .dd1 $88 NOTE: C64 $8863 (code_6A00.asm) - loader entry point ; ; Finishes initialization and falls into the welcome screen. ; 7eb9: a2 1d InitGame ldx #$1d 7ebb: a9 00 lda #$00 7ebd: 9d 43 45 :Loop sta L4543,x ;zero out $4543-4560 7ec0: ca dex ;(pause-mode toggles + other stuff) 7ec1: 10 fa bpl :Loop 7ec3: ad 02 a3 lda station_addr 7ec6: 8d b7 7e sta saved_station_addr 7ec9: ad 03 a3 lda station_addr+1 7ecc: 8d b8 7e sta saved_station_addr+1 7ecf: 20 4a 80 jsr InitPlayerData ;reset player save data to default 7ed2: a2 ff ldx #$ff ;reset system stack 7ed4: 9a txs 7ed5: 20 ad 7a jsr ClearStuff? ; ; Welcome screen. We get here after initialization completes, or when ESC is ; hit in the pause menu. ; 7ed8: a2 ff RestartGame ldx #$ff 7eda: 9a txs 7edb: 20 c4 7a jsr RES2 7ede: 20 69 82 jsr ResetInputs 7ee1: a9 03 lda #$03 7ee3: 85 34 sta text_hposn NOTE: ship displayed at start set here 7ee5: a2 0b ldx #11 ;11 == Cobra Mk III 7ee7: a9 06 lda #$06 ;"Load New Commander (Y/N)?" 7ee9: a0 fa ldy #$fa 7eeb: 20 66 7f jsr GameStartScreen 7eee: e0 59 cpx #‘Y’ 7ef0: d0 06 bne L7EF8 7ef2: 20 36 7f jsr L7F36 7ef5: 20 31 81 jsr FileAccessMenu 7ef8: 20 36 7f L7EF8 jsr L7F36 7efb: 20 29 7b jsr L7B29 7efe: a9 07 lda #$07 ;"Press space or fire, commander." 7f00: a2 11 ldx #17 ;17 = Sidewinder 7f02: a0 4b ldy #$4b 7f04: 20 66 7f jsr GameStartScreen 7f07: 20 8b 63 jsr L638B 7f0a: 20 9e 6a jsr L6A9E 7f0d: 20 f8 6b jsr L6BF8 7f10: a2 05 ldx #$05 7f12: b5 92 L7F12 lda $92,x 7f14: 9d f5 02 sta $02f5,x 7f17: ca dex 7f18: 10 f8 bpl L7F12 7f1a: e8 inx 7f1b: 8e 76 02 stx PLAYER_STATE?+53 7f1e: a5 d7 lda $d7 7f20: 8d ef 02 sta $02ef 7f23: a5 d9 lda $d9 7f25: 8d f2 02 sta $02f2 7f28: a5 d8 lda $d8 7f2a: 8d f1 02 sta $02f1 7f2d: a9 ff L7F2D lda #$ff 7f2f: 85 ba sta docked_flag 7f31: a9 39 lda #$39 7f33: 4c 0d 7d jmp FromGameInit 7f36: a2 54 L7F36 ldx #$54 7f38: bd 84 4d L7F38 lda commander_name-1,x 7f3b: 9d 86 02 sta $0286,x 7f3e: ca dex 7f3f: d0 f7 bne L7F38 7f41: 86 b3 stx displayed_screen 7f43: 20 29 80 L7F43 jsr L8029 7f46: cd d9 4d cmp scramble_thing?+1 7f49: d0 f8 bne L7F43 7f4b: 49 a9 eor #$a9 7f4d: aa tax 7f4e: ad 9d 02 lda ship_state1? 7f51: ec d7 4d cpx scramble_thing?-1 7f54: f0 02 beq L7F58 7f56: 09 80 ora #$80 7f58: 09 08 L7F58 ora #$08 7f5a: 8d 9d 02 sta ship_state1? 7f5d: 20 37 80 jsr L8037 7f60: cd d8 4d cmp scramble_thing? 7f63: d0 de bne L7F43 7f65: 60 rts 7f66: 8c 84 02 GameStartScreen sty intro_parameter? ;Z distance? 7f69: 48 pha ;docked string token; save for later 7f6a: 86 b8 stx $b8 ;ship type 7f6c: a9 ff lda #$ff 7f6e: 8d 61 45 sta unused_thing1 7f71: 20 ad 7a jsr ClearStuff? 7f74: a9 00 lda #$00 7f76: 8d 61 45 sta unused_thing1 7f79: 20 69 82 jsr ResetInputs 7f7c: a9 0d lda #$0d 7f7e: 20 b9 94 jsr PrintFlightHud? 7f81: a9 00 lda #$00 7f83: 85 b3 sta displayed_screen 7f85: a9 60 lda #$60 7f87: 85 1a sta polyobj_mox2_hi 7f89: a9 60 lda #$60 7f8b: 85 13 sta polyobj_zpos_mi 7f8d: a2 7f ldx #$7f 7f8f: 86 29 stx polyobj_roll 7f91: 86 2a stx polyobj_pitch 7f93: e8 inx 7f94: 86 37 stx text_mod_flags ;set to $80 7f96: a5 b8 lda $b8 7f98: 20 45 75 jsr L7545 7f9b: a9 06 lda #$06 7f9d: 85 34 sta text_hposn 7f9f: a9 1e lda #$1e ;"---- E L I T E ----" 7fa1: 20 39 71 jsr PrintTokFF 7fa4: a9 0a lda #$0a 7fa6: 20 33 55 jsr PrintChar 7fa9: a9 06 lda #$06 7fab: 85 34 sta text_hposn 7fad: ad 5a 45 lda ptb_pausecmd_x? ;check pause-X flag 7fb0: f0 05 beq :NotX ;not set, branch 7fb2: a9 0d lda #$0d ;"By D.Braben & I.Bell" 7fb4: 20 6e 4b jsr PrintDockedStr ;draw a second copy of author's names 7fb7: ad 27 7e :NotX lda L7E27 7fba: f0 15 beq L7FD1 7fbc: ee 27 7e inc L7E27 7fbf: a9 07 lda #$07 7fc1: 85 34 sta text_hposn 7fc3: a9 09 lda #$09 7fc5: 85 36 sta text_vposn 7fc7: a0 00 ldy #$00 7fc9: 20 e6 a0 :loop jsr OutputChar 7fcc: c8 iny 7fcd: b1 fd lda ($fd),y 7fcf: d0 f8 bne :loop 7fd1: a0 00 L7FD1 ldy #$00 7fd3: 84 a9 sty player_speed 7fd5: 8c 5e 45 sty ptb_joy_enab 7fd8: a9 0e lda #14 7fda: 85 36 sta text_vposn 7fdc: a9 01 lda #1 7fde: 85 34 sta text_hposn 7fe0: 68 pla ;A=reg = $06 or $07 7fe1: 20 6e 4b jsr PrintDockedStr 7fe4: a9 03 lda #$03 7fe6: 85 34 sta text_hposn 7fe8: a9 0c lda #$0c ;"(C) D.Braben & I.Bell 1985" 7fea: 20 6e 4b jsr PrintDockedStr 7fed: a9 0c lda #$0c 7fef: 85 be sta $be 7ff1: a9 05 lda #$05 7ff3: 85 b6 sta $b6 ; Animate the ship. 7ff5: a5 13 :WaitLoop lda polyobj_zpos_mi 7ff7: c9 01 cmp #$01 7ff9: f0 02 beq :NoDec 7ffb: c6 13 dec polyobj_zpos_mi 7ffd: 20 5e 90 :NoDec jsr MVEIT 8000: ae 84 02 ldx intro_parameter? 8003: 86 12 stx polyobj_zpos_lo 8005: a5 b6 lda $b6 ;? 8007: 29 03 and #$03 ;? 8009: a9 00 lda #$00 800b: 85 0c sta polyobj_xpos_lo 800d: 85 0f sta polyobj_ypos_lo 800f: 20 3e 88 jsr DrawObject 8012: 20 1f 83 jsr CheckForInput 8015: c6 b6 dec $b6 8017: ad 61 c0 lda BUTN0 ;check to see if either joystick button was hit 801a: 0d 62 c0 ora BUTN1 801d: 2d 62 45 and joystick_found_nr ;ignore if joystick not found earlier (which it never 8020: 30 03 bmi EnableJoystick ; (is, because the code to find it isn't called) 8022: 90 d1 bcc :WaitLoop ;no key hit, loop 8024: 60 rts 8025: ce 5e 45 EnableJoystick dec ptb_joy_enab 8028: 60 rts 8029: a2 49 L8029 ldx #$49 802b: 18 clc 802c: 8a txa 802d: 7d 8c 4d L802D adc save_game_state,x 8030: 5d 8d 4d eor save_game_state+1,x 8033: ca dex 8034: d0 f7 bne L802D 8036: 60 rts 8037: a2 49 L8037 ldx #$49 8039: 18 clc 803a: 8a txa 803b: 86 d0 L803B stx $d0 803d: 45 d0 eor $d0 803f: 6a ror A 8040: 7d 8c 4d adc save_game_state,x 8043: 5d 8d 4d eor save_game_state+1,x 8046: ca dex 8047: d0 f2 bne L803B 8049: 60 rts 804a: a0 61 InitPlayerData ldy #97 804c: b9 f3 4d :Loop lda commander_jameson,y 804f: 99 85 4d sta commander_name,y 8052: 88 dey 8053: 10 f7 bpl :Loop 8055: a0 07 ldy #$07 8057: 8c ea 81 sty LoadSavedGame-1 805a: 60 rts 805b: a2 00 L805B ldx #$00 805d: b5 11 L805D lda INWK+5,x 805f: c9 0d cmp #$0d 8061: f0 08 beq L806B 8063: 9d 43 96 sta disk_filename,x 8066: e8 inx 8067: e0 07 cpx #$07 8069: 90 f2 bcc L805D 806b: a9 20 L806B lda #$20 806d: 9d 43 96 L806D sta disk_filename,x 8070: e8 inx 8071: e0 1e cpx #$1e 8073: 90 f8 bcc L806D 8075: 60 rts 8076: a2 07 L8076 ldx #$07 8078: ad e9 81 lda L81E9 807b: 8d ea 81 sta LoadSavedGame-1 807e: b5 11 L807E lda INWK+5,x 8080: 9d 85 4d sta commander_name,x 8083: ca dex 8084: 10 f8 bpl L807E 8086: a2 07 L8086 ldx #$07 8088: bd 85 4d L8088 lda commander_name,x 808b: 95 11 sta INWK+5,x 808d: ca dex 808e: 10 f8 bpl L8088 8090: 60 rts 8091: a2 04 L8091 ldx #$04 8093: bd 80 4d L8093 lda L4D80,x 8096: 95 0c sta polyobj_xpos_lo,x 8098: ca dex 8099: 10 f8 bpl L8093 809b: a9 07 lda #$07 809d: 8d fc 80 sta max_cmdr_name_len 80a0: a9 08 lda #$08 80a2: 20 6e 4b jsr PrintDockedStr 80a5: 20 b4 80 jsr InputName 80a8: a9 09 lda #$09 80aa: 8d fc 80 sta max_cmdr_name_len 80ad: 98 tya 80ae: f0 d6 beq L8086 80b0: 8c e9 81 sty L81E9 80b3: 60 rts ; ; Enter a name, for the commander or a planet. ; 80b4: a0 08 InputName ldy #$08 80b6: 20 96 63 jsr LongDelay 80b9: 20 a2 4e jsr ClearKbdStrb 80bc: a0 00 ldy #$00 80be: 20 e5 84 :Loop jsr GetInput1? 80c1: c9 0d cmp #$0d ;enter 80c3: f0 23 beq :Accept 80c5: c9 1b cmp #$1b ;esc 80c7: f0 27 beq :Cancel 80c9: c9 7f cmp #$7f ;delete 80cb: f0 25 beq :Backspace 80cd: cc fc 80 cpy max_cmdr_name_len 80d0: b0 0f bcs :BadKey 80d2: cd fd 80 cmp cmdr_name_min_char 80d5: 90 0a bcc :BadKey 80d7: cd fe 80 cmp cmdr_name_max_char 80da: b0 05 bcs :BadKey 80dc: 99 11 00 sta INWK+5,y 80df: c8 iny 80e0: 2c bit ▼ $07a9 80e1: a9 07 :BadKey lda #$07 ;bell 80e3: 20 e6 a0 L80E3 jsr OutputChar 80e6: 90 d6 bcc :Loop ;(always?) 80e8: 99 11 00 :Accept sta INWK+5,y 80eb: a9 0c lda #$0c 80ed: 4c e6 a0 jmp OutputChar 80f0: 38 :Cancel sec 80f1: 60 rts 80f2: 98 :Backspace tya ;already at start of name? 80f3: f0 ec beq :BadKey ;yes, just beep 80f5: 88 dey 80f6: a9 7f lda #$7f ;print a DEL 80f8: d0 e9 bne L80E3 ;(always) 80fa: 11 .dd1 $11 80fb: 00 .dd1 $00 max_cmdr_name_len 80fc: 09 .dd1 $09 ;max 9 chars cmdr_name_min_char 80fd: 21 .dd1 ‘!’ cmdr_name_max_char 80fe: 7b .dd1 ‘{’ 80ff: a9 03 PrintDiskTape lda #$03 ;"tape" 8101: 18 clc 8102: 6d 60 45 adc ptb_pausecmd_t ;--> 3 or 2 8105: 4c 6e 4b jmp PrintDockedStr 8108: a9 02 PrintTapeDisk lda #$02 ;"disk" 810a: 38 sec 810b: ed 60 45 sbc ptb_pausecmd_t ;--> 2 or 3 810e: 4c 6e 4b jmp PrintDockedStr 8111: a2 37 ZeroPlayerState ldx #55 8113: a9 00 lda #$00 8115: 9d 41 02 :Loop sta PLAYER_STATE?,x 8118: ca dex 8119: 10 fa bpl :Loop 811b: 60 rts 811c: 60 .dd1 $60 811d: a2 .dd1 $a2 811e: 0c .dd1 $0c 811f: 20 .dd1 $20 8120: 23 .dd1 $23 8121: 81 .dd1 $81 8122: ca .dd1 $ca 8123: a0 .dd1 $a0 8124: 00 .dd1 $00 8125: 84 .dd1 $84 8126: 0a .dd1 $0a 8127: a9 .dd1 $a9 8128: 00 .dd1 $00 8129: 86 .dd1 $86 812a: 0b .dd1 $0b 812b: 91 .dd1 $91 812c: 0a .dd1 $0a 812d: c8 .dd1 $c8 812e: d0 .dd1 $d0 812f: fb .dd1 $fb 8130: 60 .dd1 $60 NOTE: disk access menu • Clear variables ]txt_ptr .var $6e {addr/2} 8131: a9 01 FileAccessMenu lda #$01 ;"disk access menu ..." 8133: 20 6e 4b jsr PrintDockedStr 8136: 20 e7 84 jsr GetInput? 8139: c9 31 cmp #‘1’ 813b: f0 1a beq LoadGame 813d: c9 32 cmp #‘2’ 813f: f0 21 beq SaveGame 8141: c9 33 cmp #‘3’ 8143: d0 10 bne :Return 8145: a9 e0 lda #$e0 ;reset to default game 8147: 20 6e 4b jsr PrintDockedStr 814a: 20 08 79 jsr L7908 814d: 90 06 bcc :Return 814f: 20 4a 80 jsr InitPlayerData 8152: 4c 36 7f jmp L7F36 8155: 18 :Return clc 8156: 60 rts 8157: 20 91 80 LoadGame jsr L8091 815a: 20 eb 81 jsr LoadSavedGame 815d: 20 76 80 jsr L8076 8160: 38 sec 8161: 60 rts 8162: 20 91 80 SaveGame jsr L8091 8165: 20 76 80 jsr L8076 8168: 4e d8 02 lsr $02d8 816b: a9 04 lda #$04 816d: 20 6e 4b jsr PrintDockedStr 8170: a2 4c ldx #$4c 8172: bd 8f 02 :Loop lda $028f,x 8175: 9d 8d 4d sta save_game_state+1,x 8178: ca dex 8179: 10 f7 bpl :Loop 817b: 20 37 80 jsr L8037 817e: 8d d8 4d sta scramble_thing? 8181: 20 29 80 jsr L8029 8184: 8d d9 4d sta scramble_thing?+1 8187: 48 pha 8188: 09 80 ora #$80 818a: 85 7a sta $7a 818c: 4d 9d 02 eor ship_state1? 818f: 85 7c sta $7c 8191: 4d 9a 02 eor player_credits+2 8194: 85 7b sta $7b 8196: 49 5a eor #$5a 8198: 4d d7 02 eor kill_score+1 819b: 85 7d sta $7d 819d: 18 clc 819e: 20 74 54 jsr PrintNumber? 81a1: 20 66 64 jsr PrintFF 81a4: 20 66 64 jsr PrintFF 81a7: 68 pla 81a8: 49 a9 eor #$a9 81aa: 8d d7 4d sta scramble_thing?-1 81ad: 20 5b 80 jsr L805B 81b0: a0 4c ldy #$4c 81b2: b9 8d 4d :Loop lda save_game_state+1,y 81b5: 99 f0 0a sta scram_save_data+20,y 81b8: 88 dey 81b9: 10 f7 bpl :Loop 81bb: 20 81 96 jsr DiskSaveGame 81be: b0 08 bcs :SaveFail 81c0: 20 36 7f jsr L7F36 81c3: 20 e7 84 jsr GetInput? 81c6: 18 clc 81c7: 60 rts 81c8: 0a :SaveFail asl A ;error code in A-reg (1-5) 81c9: aa tax 81ca: bd 5b 82 lda disk_err_msgs-2,x 81cd: 85 6e sta ]txt_ptr 81cf: bd 5c 82 lda disk_err_msgs-1,x 81d2: 85 6f sta ]txt_ptr+1 81d4: a0 00 ldy #$00 81d6: b1 6e :Loop lda (]txt_ptr),y 81d8: f0 06 beq :StrEnd 81da: 20 33 55 jsr PrintChar 81dd: c8 iny 81de: d0 f6 bne :Loop 81e0: 20 52 95 :StrEnd jsr Noise1? 81e3: 20 e7 84 jsr GetInput? 81e6: 4c 31 81 jmp FileAccessMenu 81e9: 07 L81E9 .dd1 $07 81ea: 07 .dd1 $07 81eb: 20 5b 80 LoadSavedGame jsr L805B 81ee: 20 61 96 jsr DiskLoadGame 81f1: b0 d5 bcs :SaveFail 81f3: 20 d3 9b jsr UnscrambleSaveData 81f6: ad f0 0a lda scram_save_data+20 81f9: 30 0d bmi L8208 81fb: a0 4c ldy #$4c 81fd: b9 f0 0a :Loop lda scram_save_data+20,y 8200: 99 8d 4d sta save_game_state+1,y 8203: 88 dey 8204: 10 f7 bpl :Loop 8206: 38 sec 8207: 60 rts 8208: a9 09 L8208 lda #$09 820a: 20 6e 4b jsr PrintDockedStr 820d: 20 e7 84 jsr GetInput? 8210: 4c 31 81 jmp FileAccessMenu 8213: 44 49 53 4b+ T8213 .zstr ‘DISK WRITE PROTECTED’ 8228: 44 49 53 4b+ T8228 .zstr ‘DISK FULL’ 8232: 43 41 54 41+ T8232 .zstr ‘CATALOG FULL’ 823f: 44 49 53 4b+ T823F .zstr ‘DISK I/O ERROR’ 824e: 46 49 4c 45+ T824E .zstr ‘FILE NOT FOUND’ 825d: 13 82 disk_err_msgs .dd2 T8213 825f: 28 82 .dd2 T8228 8261: 32 82 .dd2 T8232 8263: 3f 82 .dd2 T823F 8265: 4e 82 .dd2 T824E 8267: 60 .dd1 $60 8268: 60 .dd1 $60 8269: a9 00 ResetInputs lda #$00 826b: a2 10 ldx #$10 826d: 95 80 L826D sta input_raw_key,x 826f: ca dex 8270: 10 fb bpl L826D 8272: 60 rts 8273: 60 .dd1 $60 8274: a2 00 L8274 ldx #$00 8276: 20 eb 74 jsr L74EB 8279: a2 03 ldx #$03 827b: 20 eb 74 jsr L74EB 827e: a2 06 ldx #$06 8280: 20 eb 74 jsr L74EB 8283: a5 38 L8283 lda $38 8285: 05 3b ora $3b 8287: 05 3e ora $3e 8289: 09 01 ora #$01 828b: 85 41 sta $41 828d: a5 39 lda $39 828f: 05 3c ora $3c 8291: 05 3f ora $3f 8293: 06 41 L8293 asl $41 8295: 2a rol A 8296: b0 0e bcs L82A6 8298: 06 38 asl $38 829a: 26 39 rol $39 829c: 06 3b asl $3b 829e: 26 3c rol $3c 82a0: 06 3e asl $3e 82a2: 26 3f rol $3f 82a4: 90 ed bcc L8293 82a6: a5 39 L82A6 lda $39 82a8: 4a lsr A 82a9: 05 3a ora $3a 82ab: 85 6e sta ]txt_ptr 82ad: a5 3c lda $3c 82af: 4a lsr A 82b0: 05 3d ora $3d 82b2: 85 6f sta ]txt_ptr+1 82b4: a5 3f lda $3f 82b6: 4a lsr A 82b7: 05 40 ora $40 82b9: 85 70 sta $70 82bb: a5 6e L82BB lda ]txt_ptr 82bd: 20 30 5f jsr L5F30 82c0: 85 ae sta $ae 82c2: a5 31 lda $31 82c4: 85 ad sta $ad 82c6: a5 6f lda ]txt_ptr+1 82c8: 20 30 5f jsr L5F30 82cb: 85 d0 sta $d0 82cd: a5 31 lda $31 82cf: 65 ad adc $ad 82d1: 85 ad sta $ad 82d3: a5 d0 lda $d0 82d5: 65 ae adc $ae 82d7: 85 ae sta $ae 82d9: a5 70 lda $70 82db: 20 30 5f jsr L5F30 82de: 85 d0 sta $d0 82e0: a5 31 lda $31 82e2: 65 ad adc $ad 82e4: 85 ad sta $ad 82e6: a5 d0 lda $d0 82e8: 65 ae adc $ae 82ea: 85 ae sta $ae 82ec: 20 45 87 jsr TwoByteSqrt 82ef: a5 6e lda ]txt_ptr 82f1: 20 81 86 jsr L8681 82f4: 85 6e sta ]txt_ptr 82f6: a5 6f lda ]txt_ptr+1 82f8: 20 81 86 jsr L8681 82fb: 85 6f sta ]txt_ptr+1 82fd: a5 70 lda $70 82ff: 20 81 86 jsr L8681 8302: 85 70 sta $70 8304: 60 rts ; ; Reads a paddle. ; ; On entry: ; X-reg: paddle # (0 or 1) ; ; On exit: ; X-reg: (unchanged) ; Y-reg: paddle reading ; A-reg: paddle reading (possibly modified) ; 8305: bd 64 c0 ReadPaddle lda PADDL0,x 8308: 30 fb bmi ReadPaddle ;let it settle 830a: ac 70 c0 ldy PTRIG ;reset the timer 830d: a0 00 ldy #$00 830f: ea nop 8310: ea nop 8311: bd 64 c0 :Loop lda PADDL0,x ;test current value 8314: 10 04 bpl :Done ;done 8316: c8 iny 8317: d0 f8 bne :Loop 8319: 88 dey 831a: 98 :Done tya 831b: 4d 5d 45 eor ptb_joy_axis_flip ;invert both axes 831e: 60 rts ; ; Checks for input from the keyboard and/or joystick. ; ; On exit: ; $80: key hit, or $00 if none ; A-reg/X-reg: same as $80 ; $81-90: bool 00/ff: command N issued ; P-flags set (N/V/Z) according to Acc, (C) set if key was hit ; 831f: 98 CheckForInput tya 8320: 48 pha 8321: 20 69 82 jsr ResetInputs 8324: 18 clc 8325: ad 00 c0 lda KBD ;was a key hit? 8328: 10 14 bpl :NoKeyHit ;no, check the next thing 832a: 2c 10 c0 bit KBDSTRB ;clear input 832d: 29 7f and #$7f ;clear hi bit 832f: 85 80 sta input_raw_key ;save for later 8331: a2 10 ldx #$10 8333: dd e5 83 :CheckKey cmp flight_key_cmds-1,x ;does it match one of the flight control keys? 8336: d0 02 bne :NotMatch ;no, branch 8338: d6 80 dec input_raw_key,x ;set $8x to $FF to indicate key hit 833a: ca :NotMatch dex 833b: d0 f6 bne :CheckKey 833d: 38 sec ;set carry to indicate key hit 833e: ad 5e 45 :NoKeyHit lda ptb_joy_enab 8341: 10 15 _set_by_init bpl :NoPaddle ;init code changes branch to $30==$8373 8343: ae 6c 02 ldx computer_dock_flag ;is computer driving the ship? 8346: d0 10 bne :NoPaddle ;yup, ignore the joystick 8348: 20 05 83 jsr ReadPaddle ;read X axis 834b: 49 ff eor #$ff ;invert 834d: 85 d1 sta roll_velocity 834f: e8 inx ;X-reg=1 8350: 20 05 83 jsr ReadPaddle ;read Y axis 8353: 4d 5c 45 eor ptb_joy_y_flip 8356: 85 d2 sta pitch_velocity 8358: a9 ff :NoPaddle lda #$ff 835a: 2c 61 c0 bit BUTN0 ;button 0 hit? 835d: 10 0b bpl :NotBtn0 ;nope 835f: 2c 62 c0 bit BUTN1 ;button 1 hit? 8362: 10 04 bpl :OnlyBtn1 ;nope 8364: 85 81 sta cmd_throttle_down ;both buttons == throttle down 8366: 30 09 bmi :Cont ;(always) 8368: 85 87 :OnlyBtn1 sta cmd_fire_laser ;fire lasers 836a: 2c 62 c0 :NotBtn0 bit BUTN1 ;button 1 hit? 836d: 10 02 bpl :Cont 836f: 85 82 sta cmd_throttle_up ;increase throttle 8371: a5 b3 :Cont lda displayed_screen ;something that disables commands? :NoJoyBranchHere 8373: f0 14 beq :Done ;not set 8375: a9 00 lda #$00 ;clear all commands 8377: 85 88 sta cmd_energy_bomb 8379: 85 89 sta cmd_escape_cap 837b: 85 8a sta cmd_targ_mssl 837d: 85 8b sta cmd_unarm_mssl 837f: 85 8c sta cmd_fire_mssl 8381: 85 8d sta cmd_ecm 8383: 85 8e sta cmd_local_jump 8385: 85 8f sta cmd_dock_on 8387: 85 90 sta cmd_dock_off 8389: 68 :Done pla 838a: a8 tay 838b: a5 80 lda input_raw_key 838d: aa tax 838e: 60 rts 838f: ae 6b 02 LocalJump ldx PLAYER_STATE?+42 8392: bd 43 02 lda PLAYER_STATE?+2,x 8395: 0d 4c 02 ora PLAYER_STATE?+11 8398: 0d 6e 02 ora witch_space_flag 839b: d0 45 bne L83E2 839d: ac 08 08 ldy data_buffer+8 83a0: 30 08 bmi L83AA 83a2: a8 tay 83a3: 20 61 52 jsr L5261 83a6: c9 02 cmp #$02 83a8: 90 38 bcc L83E2 83aa: ac 2d 08 L83AA ldy data_buffer+45 83ad: 30 09 bmi L83B8 83af: a0 25 ldy #$25 83b1: 20 5f 52 jsr L525F 83b4: c9 02 cmp #$02 83b6: 90 2a bcc L83E2 83b8: a9 81 L83B8 lda #$81 83ba: 85 af sta $af 83bc: 85 ae sta $ae 83be: 85 31 sta $31 83c0: ad 08 08 lda data_buffer+8 83c3: 20 68 60 jsr ADD 83c6: 8d 08 08 sta data_buffer+8 83c9: ad 2d 08 lda data_buffer+45 83cc: 20 68 60 jsr ADD 83cf: 8d 2d 08 sta data_buffer+45 83d2: a9 01 lda #$01 83d4: 85 b3 sta displayed_screen 83d6: 85 b6 sta $b6 83d8: 4a lsr A 83d9: 8d 76 02 sta PLAYER_STATE?+53 83dc: ae 72 02 ldx PLAYER_STATE?+49 83df: 4c 5e 94 jmp SetViewDirection 83e2: 4c 52 95 L83E2 jmp Noise1? 83e5: 60 .junk 1 ; ; Flight-control keys. When pressed, the corresponding zero-page location is ; set to true. ; 83e6: 2f flight_key_cmds .dd1 ‘/’ ;$81 throttle down 83e7: 20 .dd1 ‘ ’ ;$82 throttle up 83e8: 2c .dd1 ‘,’ ;$83 roll left 83e9: 2e .dd1 ‘.’ ;$84 roll right 83ea: 58 .dd1 ‘X’ ;$85 pitch down 83eb: 53 .dd1 ‘S’ ;$86 pitch up 83ec: 41 .dd1 ‘A’ ;$87 fire lasers 83ed: 42 .dd1 ‘B’ ;$88 energy bomb 83ee: 1b .dd1 $1b ;$89 escape capsule 83ef: 54 .dd1 ‘T’ ;$8a target missile 83f0: 55 .dd1 ‘U’ ;$8b un-arm missile 83f1: 4d .dd1 ‘M’ ;$8c fire missile 83f2: 45 .dd1 ‘E’ ;$8d ECM 83f3: 4a .dd1 ‘J’ ;$8e in-system jump 83f4: 43 .dd1 ‘C’ ;$8f docking computer on 83f5: 50 .dd1 ‘P’ ;$90 docking computer off 83f6: a2 00 2c 00+ .junk 14 ;unreferenced code? ; ; Check to see if a pause-mode key has been hit. If so, update the toggle ; value. ; ; On entry: ; Y-reg: entry to check (0-8) ; CheckPauseToggles 8404: 8a txa 8405: d9 63 45 cmp pause_key_cmds,y ;does it match the Nth entry? 8408: d0 19 bne :Bail ;no 840a: b9 58 45 lda ptb_kbd_dampening,y ;yes, flip the state of that variable 840d: 49 ff eor #$ff 840f: 99 58 45 sta ptb_kbd_dampening,y 8412: 10 03 bpl :SwitchOff 8414: 20 fd 55 jsr PrintBell ;chirp 8417: 20 fd 55 :SwitchOff jsr PrintBell ;twice when enabled 841a: 98 tya ;preserve Y-reg 841b: 48 pha 841c: a0 14 ldy #$14 841e: 20 96 63 jsr LongDelay 8421: 68 pla ;restore Y-reg 8422: a8 tay 8423: 60 :Bail rts 8424: 60 .dd1 $60 NOTE: flight input handling HandleFlightInput 8425: 20 1f 83 jsr CheckForInput 8428: ad 6c 02 lda computer_dock_flag 842b: f0 5a beq L8487 842d: 20 14 7b jsr ZeroInfo 8430: a9 60 lda #$60 8432: 85 1a sta polyobj_mox2_hi 8434: 09 80 ora #$80 8436: 85 22 sta $22 8438: 85 b8 sta $b8 843a: a5 a9 lda player_speed 843c: 85 27 sta polyobj_vertex_lo 843e: 20 50 5a jsr L5A50 8441: a5 27 lda polyobj_vertex_lo 8443: c9 16 cmp #$16 8445: 90 02 bcc L8449 8447: a9 16 lda #$16 8449: 85 a9 L8449 sta player_speed 844b: a9 ff lda #$ff 844d: a2 01 ldx #$01 844f: a4 28 ldy $28 8451: f0 06 beq L8459 8453: 30 02 bmi L8457 8455: a2 02 ldx #$02 8457: 95 80 L8457 sta input_raw_key,x 8459: a9 80 L8459 lda #$80 845b: a2 03 ldx #$03 845d: 06 29 asl polyobj_roll 845f: f0 12 beq L8473 8461: 90 02 bcc L8465 8463: a2 04 ldx #$04 8465: 24 29 L8465 bit polyobj_roll 8467: 10 06 bpl L846F 8469: a9 40 lda #$40 846b: 85 d1 sta roll_velocity 846d: a9 00 lda #$00 846f: 95 80 L846F sta input_raw_key,x 8471: a5 d1 lda roll_velocity 8473: 85 d1 L8473 sta roll_velocity 8475: a9 80 lda #$80 8477: a2 05 ldx #$05 8479: 06 2a asl polyobj_pitch 847b: f0 08 beq L8485 847d: b0 02 bcs L8481 847f: a2 06 ldx #$06 8481: 95 80 L8481 sta input_raw_key,x 8483: a5 d2 lda pitch_velocity 8485: 85 d2 L8485 sta pitch_velocity 8487: a6 d1 L8487 ldx roll_velocity 8489: a9 14 lda #$14 848b: a4 83 ldy cmd_roll_left 848d: f0 03 beq L8492 848f: 20 f1 61 jsr L61F1 8492: a4 84 L8492 ldy cmd_roll_right 8494: f0 03 beq L8499 8496: 20 01 62 jsr REDU2 8499: 86 d1 L8499 stx roll_velocity 849b: a6 d2 ldx pitch_velocity 849d: a4 85 ldy cmd_pitch_down 849f: f0 03 beq L84A4 84a1: 20 01 62 jsr REDU2 84a4: a4 86 L84A4 ldy cmd_pitch_up 84a6: f0 03 beq L84AB 84a8: 20 f1 61 jsr L61F1 84ab: 86 d2 L84AB stx pitch_velocity 84ad: a6 80 ldx input_raw_key 84af: 86 80 stx input_raw_key 84b1: e0 3d cpx #‘=’ ;pause key? 84b3: d0 2f bne :Done NOTE: pause key handler 84b5: 20 7e a0 :PauseMode jsr Delay 84b8: 20 1f 83 jsr CheckForInput 84bb: e0 51 cpx #‘Q’ ;is it a 'Q'? 84bd: d0 07 bne L84C6 84bf: a2 ff ldx #$ff ;yes, disable sound 84c1: 8e 57 45 stx sound_disab_flag 84c4: a2 51 ldx #‘Q’ ;continue with 'Q' 84c6: a0 00 L84C6 ldy #$00 84c8: 20 04 84 :TogLoop jsr CheckPauseToggles ;DAXFYJKUT 84cb: c8 iny 84cc: c0 09 cpy #$09 84ce: d0 f8 bne :TogLoop 84d0: e0 53 cpx #‘S’ ;is it 'S'? 84d2: d0 05 bne L84D9 84d4: a9 00 lda #$00 ;yes, enable sound 84d6: 8d 57 45 sta sound_disab_flag 84d9: e0 1b L84D9 cpx #$1b ;ESC? 84db: d0 03 bne L84E0 84dd: 4c d8 7e jmp RestartGame 84e0: e0 2d L84E0 cpx #‘-’ ;unpause? 84e2: d0 d1 bne :PauseMode ;no, keep going 84e4: 60 :Done rts 84e5: 84 b1 GetInput1? sty $b1 84e7: a0 02 GetInput? ldy #$02 84e9: 20 96 63 jsr LongDelay 84ec: 20 1f 83 jsr CheckForInput 84ef: d0 f6 bne GetInput? 84f1: 20 1f 83 L84F1 jsr CheckForInput 84f4: f0 fb beq L84F1 84f6: a4 b1 ldy $b1 84f8: aa tax 84f9: 60 :Return rts 84fa: 8e 77 02 L84FA stx PLAYER_STATE?+54 84fd: 48 pha 84fe: ad dc 02 lda in_flight_msg_token 8501: 20 53 85 jsr L8553 8504: 68 pla PrintMessageBriefly 8505: 48 pha 8506: a9 0f lda #$0f 8508: a6 b3 ldx displayed_screen 850a: f0 06 beq L8512 850c: 20 1e a2 jsr ClearLines? 850f: a9 19 lda #$19 8511: 2c bit ▼ title_screen+$1685 8512: 85 36 L8512 sta text_vposn 8514: a2 00 ldx #$00 8516: 86 37 stx text_mod_flags 8518: a5 ce lda $ce 851a: 85 34 sta text_hposn 851c: 68 pla 851d: a0 14 ldy #$14 851f: ec 77 02 cpx PLAYER_STATE?+54 8522: d0 d6 bne L84FA 8524: 8c 77 02 sty PLAYER_STATE?+54 8527: 8d dc 02 sta in_flight_msg_token 852a: a9 c0 lda #$c0 852c: 8d 2a 55 sta txt_buffer_flag 852f: ad 78 02 lda $0278 8532: 4a lsr A 8533: a9 00 lda #$00 8535: 90 02 bcc L8539 8537: a9 0a lda #$0a 8539: 8d 2b 55 L8539 sta txt_buffer_index 853c: ad dc 02 lda in_flight_msg_token 853f: 20 44 71 jsr PrintFlightToken 8542: a9 20 lda #$20 8544: 38 sec 8545: ed 2b 55 sbc txt_buffer_index 8548: 4a lsr A 8549: 85 ce sta $ce 854b: 85 34 sta text_hposn 854d: 20 82 4c jsr ClearBufferFlag 8550: ad dc 02 lda in_flight_msg_token 8553: 20 44 71 L8553 jsr PrintFlightToken 8556: 4e 78 02 lsr $0278 8559: 90 9e bcc :Return 855b: a9 fd lda #$fd ;"Destroyed" 855d: 4c 44 71 jmp PrintFlightToken NOTE: C64 $906a (code_6A00.asm) BBC .OUCH &45ea ; Shield depleted, losing cargo / equipment. 8560: 20 7c 7b OUCH jsr GetRandom 8563: 30 94 bmi :Return ;50% chance of nothing lost 8565: e0 16 cpx #22 ;max equipment 8567: b0 90 bcs :Return ;number too high, nothing lost 8569: bd a6 02 lda player_cargo,x ;check cargo 856c: f0 8b beq :Return ;don't have that, nothing lost 856e: ad 77 02 lda PLAYER_STATE?+54 ;"delay printing already going on" 8571: d0 86 bne :Return 8573: a0 03 ldy #$03 8575: 8c 78 02 sty $0278 8578: 9d a6 02 sta player_cargo,x ;A-reg=0 from above 857b: e0 11 cpx #17 ;cargo is 0-16, ECM=17 is first equipment 857d: b0 06 bcs :EquipLost 857f: 8a txa ;cargo is lost; get item name 8580: 69 d0 adc #$d0 ;token $d0 = "Food" 8582: 4c 05 85 jmp PrintMessageBriefly 8585: f0 0a :EquipLost beq :LostEcm ;X=17, ECM lost 8587: e0 12 cpx #18 ;is it a fuel scoop? 8589: f0 0b beq :LostScoop ;yes 858b: 8a txa 858c: 69 5d adc #$5d ;$5d+19 = $70 "Escape Pod" 858e: 4c 05 85 jmp PrintMessageBriefly 8591: a9 6c :LostEcm lda #$6c ;"E.C.M. System" 8593: 4c 05 85 jmp PrintMessageBriefly 8596: a9 6f :LostScoop lda #$6f ;"Fuel Scoops" 8598: 4c 05 85 jmp PrintMessageBriefly ; Market price info. ; ; BBC: "base_price, gradient sign+5bits, base_quantity, mask, units 2bits" 859b: 13 82 06 01 MarketData .bulk $13,$82,$06,$01 ;Food 859f: 14 81 0a 03 .bulk $14,$81,$0a,$03 ;Textiles 85a3: 41 83 02 07 .bulk $41,$83,$02,$07 ;Radioactives 85a7: 28 85 e2 1f .bulk $28,$85,$e2,$1f ;Slaves 85ab: 53 85 fb 0f .bulk $53,$85,$fb,$0f ;Liquor/Wines 85af: c4 08 36 03 .bulk $c4,$08,$36,$03 ;Luxuries 85b3: eb 1d 08 78 .bulk $eb,$1d,$08,$78 ;Narcotics 85b7: 9a 0e 38 03 .bulk $9a,$0e,$38,$03 ;Computers 85bb: 75 06 28 07 .bulk $75,$06,$28,$07 ;Machinery 85bf: 4e 01 11 1f .bulk $4e,$01,$11,$1f ;Alloys 85c3: 7c 0d 1d 07 .bulk $7c,$0d,$1d,$07 ;Firearms 85c7: b0 89 dc 3f .bulk $b0,$89,$dc,$3f ;Furs 85cb: 20 81 35 03 .bulk $20,$81,$35,$03 ;Minerals 85cf: 61 a1 42 07 .bulk $61,$a1,$42,$07 ;Gold 85d3: ab a2 37 1f .bulk $ab,$a2,$37,$1f ;Platinum 85d7: 2d c1 fa 0f .bulk $2d,$c1,$fa,$0f ;Gem-Stones 85db: 35 0f c0 07 .bulk $35,$0f,$c0,$07 ;Alien Items 85df: 98 L85DF tya 85e0: a0 02 ldy #$02 85e2: 20 ae 86 jsr L86AE 85e5: 85 20 sta $20 85e7: 4c 27 86 jmp L8627 85ea: aa L85EA tax 85eb: a5 6f lda ]txt_ptr+1 85ed: 29 60 and #$60 85ef: f0 ee beq L85DF 85f1: a9 02 lda #$02 85f3: 20 ae 86 jsr L86AE 85f6: 85 1e sta $1e 85f8: 4c 27 86 jmp L8627 85fb: a5 16 L85FB lda $16 85fd: 85 6e sta ]txt_ptr 85ff: a5 18 lda $18 8601: 85 6f sta ]txt_ptr+1 8603: a5 1a lda polyobj_mox2_hi 8605: 85 70 sta $70 8607: 20 bb 82 jsr L82BB 860a: a5 6e lda ]txt_ptr 860c: 85 16 sta $16 860e: a5 6f lda ]txt_ptr+1 8610: 85 18 sta $18 8612: a5 70 lda $70 8614: 85 1a sta polyobj_mox2_hi 8616: a0 04 ldy #$04 8618: a5 6e lda ]txt_ptr 861a: 29 60 and #$60 861c: f0 cc beq L85EA 861e: a2 02 ldx #$02 8620: a9 00 lda #$00 8622: 20 ae 86 jsr L86AE 8625: 85 1c sta $1c 8627: a5 1c L8627 lda $1c 8629: 85 6e sta ]txt_ptr 862b: a5 1e lda $1e 862d: 85 6f sta ]txt_ptr+1 862f: a5 20 lda $20 8631: 85 70 sta $70 8633: 20 bb 82 jsr L82BB 8636: a5 6e lda ]txt_ptr 8638: 85 1c sta $1c 863a: a5 6f lda ]txt_ptr+1 863c: 85 1e sta $1e 863e: a5 70 lda $70 8640: 85 20 sta $20 8642: a5 18 lda $18 8644: 85 ad sta $ad 8646: a5 20 lda $20 8648: 20 3f 60 jsr MULT12 864b: a6 1a ldx polyobj_mox2_hi 864d: a5 1e lda $1e 864f: 20 a4 60 jsr TIS1 8652: 49 80 eor #$80 8654: 85 22 sta $22 8656: a5 1c lda $1c 8658: 20 3f 60 jsr MULT12 865b: a6 16 ldx $16 865d: a5 20 lda $20 865f: 20 a4 60 jsr TIS1 8662: 49 80 eor #$80 8664: 85 24 sta $24 8666: a5 1e lda $1e 8668: 20 3f 60 jsr MULT12 866b: a6 18 ldx $18 866d: a5 1c lda $1c 866f: 20 a4 60 jsr TIS1 8672: 49 80 eor #$80 8674: 85 26 sta $26 8676: a9 00 lda #$00 8678: a2 0e ldx #$0e 867a: 95 15 L867A sta $15,x 867c: ca dex 867d: ca dex 867e: 10 fa bpl L867A 8680: 60 rts 8681: a8 L8681 tay 8682: 29 7f and #$7f 8684: c5 ad cmp $ad 8686: b0 20 bcs L86A8 8688: a2 fe ldx #$fe 868a: 86 d0 stx $d0 868c: 0a L868C asl A 868d: c5 ad cmp $ad 868f: 90 02 bcc L8693 8691: e5 ad sbc $ad 8693: 26 d0 L8693 rol $d0 8695: b0 f5 bcs L868C 8697: a5 d0 lda $d0 8699: 4a lsr A 869a: 4a lsr A 869b: 85 d0 sta $d0 869d: 4a lsr A 869e: 65 d0 adc $d0 86a0: 85 d0 sta $d0 86a2: 98 tya 86a3: 29 80 and #$80 86a5: 05 d0 ora $d0 86a7: 60 rts 86a8: 98 L86A8 tya 86a9: 29 80 and #$80 86ab: 09 60 ora #$60 86ad: 60 rts 86ae: 85 33 L86AE sta $33 86b0: b5 16 lda $16,x 86b2: 85 ad sta $ad 86b4: b5 1c lda $1c,x 86b6: 20 3f 60 jsr MULT12 86b9: b6 16 ldx $16,y 86bb: 86 ad stx $ad 86bd: b9 1c 00 lda $001c,y 86c0: 20 65 60 jsr MAD 86c3: 86 31 stx $31 86c5: a4 33 ldy $33 86c7: b6 16 ldx $16,y 86c9: 86 ad stx $ad 86cb: 49 80 eor #$80 86cd: 85 32 sta $32 86cf: 45 ad eor $ad 86d1: 29 80 and #$80 86d3: 85 d0 sta $d0 86d5: a9 00 lda #$00 86d7: a2 10 ldx #$10 86d9: 06 31 asl $31 86db: 26 32 rol $32 86dd: 06 ad asl $ad 86df: 46 ad lsr $ad 86e1: 2a L86E1 rol A 86e2: c5 ad cmp $ad 86e4: 90 02 bcc L86E8 86e6: e5 ad sbc $ad 86e8: 26 31 L86E8 rol $31 86ea: 26 32 rol $32 86ec: ca dex 86ed: d0 f2 bne L86E1 86ef: a5 31 lda $31 86f1: 05 d0 ora $d0 86f3: 60 rts 86f4: 02 .dd1 $02 86f5: 0f .dd1 $0f 86f6: 31 32 33 34+ .str ‘12345678901234567’ 8707: 20 f9 75 DrawShipAsPoint jsr L75F9 870a: 05 39 ora $39 870c: d0 1a bne L8728 870e: a5 46 lda $46 8710: c9 86 cmp #$86 8712: b0 14 bcs L8728 8714: 20 31 87 jsr L8731 8717: a5 46 lda $46 8719: 18 clc 871a: 69 01 adc #$01 871c: 20 31 87 jsr L8731 871f: a9 08 lda #$08 8721: 05 2b ora polyobj_vis 8723: 85 2b sta polyobj_vis 8725: 4c fa 8f jmp DrawDot 8728: a9 f7 L8728 lda #$f7 872a: 25 2b and polyobj_vis 872c: 85 2b sta polyobj_vis 872e: 4c fa 8f jmp DrawDot 8731: 85 6f L8731 sta ]txt_ptr+1 8733: 85 71 sta $71 8735: a5 38 lda $38 8737: 85 6e sta ]txt_ptr 8739: 18 clc 873a: 69 03 adc #$03 873c: 90 02 bcc L8740 873e: a9 ff lda #$ff 8740: 85 70 L8740 sta $70 8742: 4c 21 90 jmp DrawTwoThings? ; "Q=SQR(RQ) two-byte square root, R is hi, Q is lo" • Clear variables ]XX16? .var $48 {addr/6} ]XX15? .var $6e {addr/6} ]q_val .var $ad {addr/1} ]r_val .var $ae {addr/1} ]s_val .var $af {addr/1} ]t_val .var $d0 {addr/1} 8745: a4 ae TwoByteSqrt ldy ]r_val 8747: a5 ad lda ]q_val 8749: 85 af sta ]s_val 874b: a2 00 ldx #$00 874d: 86 ad stx ]q_val 874f: a9 08 lda #$08 8751: 85 d0 sta ]t_val 8753: e4 ad L8753 cpx ]q_val 8755: 90 0e bcc L8765 8757: d0 04 bne L875D 8759: c0 40 cpy #$40 875b: 90 08 bcc L8765 875d: 98 L875D tya 875e: e9 40 sbc #$40 8760: a8 tay 8761: 8a txa 8762: e5 ad sbc ]q_val 8764: aa tax 8765: 26 ad L8765 rol ]q_val 8767: 06 af asl ]s_val 8769: 98 tya 876a: 2a rol A 876b: a8 tay 876c: 8a txa 876d: 2a rol A 876e: aa tax 876f: 06 af asl ]s_val 8771: 98 tya 8772: 2a rol A 8773: a8 tay 8774: 8a txa 8775: 2a rol A 8776: aa tax 8777: c6 d0 dec ]t_val 8779: d0 d8 bne L8753 877b: 60 rts ; "R=A*256/Q byte from remainder of division" ; The BBC implementation was iterative. It appears to have been replaced with a ; table lookup. 877c: c5 ad BFRDIV cmp ]q_val ;"is A >= Q ?" 877e: b0 3f bcs :TooBig ;"if yes, answer too big for 1 byte, R=$FF" 8780: 85 ca sta $ca 8782: aa tax 8783: f0 19 beq L879E 8785: bd 03 41 lda math_table2,x 8788: a6 ad ldx ]q_val 878a: 38 sec 878b: fd 03 41 sbc math_table2,x 878e: a6 ca ldx $ca 8790: bd 03 40 lda math_table1,x 8793: a6 ad ldx ]q_val 8795: fd 03 40 sbc math_table1,x 8798: b0 25 bcs :TooBig 879a: aa tax 879b: bd 03 42 lda math_table3,x 879e: 85 ae L879E sta ]r_val 87a0: 60 rts ; Original implementation of BFRDIV, not referenced. 87a1: b0 1c :unref_BFRDIV bcs :TooBig 87a3: a2 fe ldx #$fe 87a5: 86 ae stx ]r_val 87a7: 0a L87A7 asl A 87a8: b0 0b bcs L87B5 87aa: c5 ad cmp ]q_val 87ac: 90 02 bcc L87B0 87ae: e5 ad sbc ]q_val 87b0: 26 ae L87B0 rol ]r_val 87b2: b0 f3 bcs L87A7 87b4: 60 rts 87b5: e5 ad L87B5 sbc ]q_val 87b7: 38 sec 87b8: 26 ae rol ]r_val 87ba: b0 eb bcs L87A7 87bc: a5 ae lda ]r_val 87be: 60 rts 87bf: a9 ff :TooBig lda #$ff 87c1: 85 ae sta ]r_val 87c3: 60 rts ; Single-byte add/subtract. ; ; .LL38 BADD "(Sign S)A = R + Q*(Sign from A^S)" ; ; On entry: ; $AE: R ; $AD: Q ; A-reg: sign bit to apply to Q ; ; On exit: ; A-reg: result ; $AF: S (sign bit of result) 87c4: 45 af ByteAddSub eor ]s_val ;check A^S (subtracting neg value -> add) 87c6: 30 06 bmi :Subtract ;negative, do subtraction 87c8: a5 ad lda ]q_val ;add values; sign in S is already correct 87ca: 18 clc 87cb: 65 ae adc ]r_val 87cd: 60 rts 87ce: a5 ae :Subtract lda ]r_val ;compute R-Q 87d0: 38 sec 87d1: e5 ad sbc ]q_val 87d3: 90 02 bcc :FixSign ;went negative 87d5: 18 clc 87d6: 60 rts 87d7: 48 :FixSign pha 87d8: a5 af lda ]s_val 87da: 49 80 eor #$80 87dc: 85 af sta ]s_val 87de: 68 pla 87df: 49 ff eor #$ff 87e1: 69 01 adc #$01 87e3: 60 rts ; ; Computes the dot product of two vectors. Mathematically, the dot product of ; [A,B,C] and [X,Y,Z] is A*X + B*Y + C*Z. The value is the cosine of the angle ; between the vectors. ; ; "XX12=XX15.XX16 each vector is 16-bit x,y,z" ; 87e4: a2 00 DotProduct ldx #$00 87e6: a0 00 ldy #$00 87e8: a5 6e L87E8 lda ]XX15? 87ea: 85 ad sta ]q_val 87ec: b5 48 lda ]XX16?,x 87ee: 20 94 5f jsr FMLTU 87f1: 85 d0 sta ]t_val 87f3: a5 6f lda ]XX15?+1 87f5: 55 49 eor ]XX16?+1,x 87f7: 85 af sta ]s_val 87f9: a5 70 lda ]XX15?+2 87fb: 85 ad sta ]q_val 87fd: b5 4a lda ]XX16?+2,x 87ff: 20 94 5f jsr FMLTU 8802: 85 ad sta ]q_val 8804: a5 d0 lda ]t_val 8806: 85 ae sta ]r_val 8808: a5 71 lda ]XX15?+3 880a: 55 4b eor ]XX16?+3,x 880c: 20 c4 87 jsr ByteAddSub 880f: 85 d0 sta ]t_val 8811: a5 72 lda ]XX15?+4 8813: 85 ad sta ]q_val 8815: b5 4c lda ]XX16?+4,x 8817: 20 94 5f jsr FMLTU 881a: 85 ad sta ]q_val 881c: a5 d0 lda ]t_val 881e: 85 ae sta ]r_val 8820: a5 73 lda ]XX15?+5 8822: 55 4d eor ]XX16?+5,x 8824: 20 c4 87 jsr ByteAddSub 8827: 99 74 00 sta $0074,y 882a: a5 af lda ]s_val 882c: 99 75 00 sta $0075,y 882f: c8 iny 8830: c8 iny 8831: 8a txa 8832: 18 clc 8833: 69 06 adc #$06 8835: aa tax 8836: c9 11 cmp #$11 8838: 90 ae bcc L87E8 883a: 60 rts 883b: 4c 3c 76 :HandlePlanet jmp Planet? NOTE: display object C64 $9a86 (code_9900.asm) BBC .LL9 $488C (flight code) • Clear variables ]INWK_xlo .var $0c {addr/1} ]INWK_xhi .var $0d {addr/1} ]INWK_ylo .var $0f {addr/1} ]INWK_yhi .var $10 {addr/1} ]INWK_zlo .var $12 {addr/1} ]INWK_zhi .var $13 {addr/1} ]polyobj_face_vis .var $38 {addr/9} ]face_ptr .var $5e {addr/2} ]normal_x .var $74 {addr/1} ]nx_sign_flag .var $75 {addr/1} ]normal_y .var $76 {addr/1} ]ny_sign_flag .var $77 {addr/1} ]normal_z .var $78 {addr/1} ]nz_sign_flag .var $79 {addr/1} ]scale .var $b2 {addr/1} ;XX17 ]ship_type .var $b8 {addr/1} ]xx4_visibility .var $c0 {addr/1} ]item_xcount .var $c1 {addr/1} ;BBC:XX20 ]tmp .var $d0 {addr/1} 883e: a5 b8 DrawObject lda ]ship_type ;ship type 8840: 30 f9 bmi :HandlePlanet ;planet has high bit set 8842: a9 1f lda #$1f 8844: 85 c0 sta ]xx4_visibility ;set visibility to max 8846: a0 01 ldy #$01 8848: 84 c2 sty $c2 884a: 88 dey ;Y-reg=0 884b: a9 08 lda #$08 884d: 24 2b bit polyobj_vis 884f: d0 03 bne L8854 8851: a9 00 lda #$00 ;visibility:display 8853: 2c bit ▼ title_screen+$db1 8854: b1 2d L8854 lda (tmp_ptr2),y 8856: 85 c3 sta $c3 8858: a5 30 lda $30 885a: 30 46 bmi CheckVisDrawDot 885c: a9 20 lda #$20 ;mask bit 5 (exploding) 885e: 24 2b bit polyobj_vis 8860: d0 2d bne :Explode? ;bit 5 set, explosion ongoing 8862: 10 2b bpl :Explode? ;bit 7 clear, start blowing up 8864: 05 2b ora polyobj_vis 8866: 29 3f and #%00111111 ;visibility:(exploding|firing) ^ $FF 8868: 85 2b sta polyobj_vis 886a: a9 00 lda #$00 886c: a0 1c ldy #$1c 886e: 91 5c sta (polyobj_ptr),y 8870: a0 1e ldy #$1e 8872: 91 5c sta (polyobj_ptr),y 8874: 20 a2 88 jsr CheckVisDrawDot 8877: a0 01 ldy #$01 8879: a9 12 lda #$12 887b: 91 2d sta (tmp_ptr2),y 887d: a0 07 ldy #$07 ;hull explosion count 887f: b1 5a lda (hull_ptr),y 8881: a0 02 ldy #$02 8883: 91 2d sta (tmp_ptr2),y 8885: c8 L8885 iny 8886: 20 7c 7b jsr GetRandom 8889: 91 2d sta (tmp_ptr2),y 888b: c0 06 cpy #$06 ;"bytes 3to6 = random bytes for seed" 888d: d0 f6 bne L8885 888f: a5 14 :Explode? lda polyobj_zpos_hi ;sign of Z coord 8891: 10 1d bpl :ObjInFront 8893: a5 2b :TestRemove? lda polyobj_vis 8895: 29 20 and #$20 ;ongoing explosion? 8897: f0 09 beq CheckVisDrawDot 8899: a5 2b lda polyobj_vis 889b: 29 f7 and #$f7 889d: 85 2b sta polyobj_vis 889f: 4c 29 72 jmp DoExplosion? 88a2: a9 08 CheckVisDrawDot lda #$08 88a4: 24 2b bit polyobj_vis 88a6: f0 07 beq L88AF 88a8: 45 2b eor polyobj_vis 88aa: 85 2b sta polyobj_vis 88ac: 4c fa 8f jmp DrawDot 88af: 60 L88AF rts ; Object in front of player (.LL10). ; (Looks like INWK has transformed center point of object?) 88b0: a5 13 :ObjInFront lda ]INWK_zhi 88b2: c9 c0 cmp #$c0 ;far in front? 88b4: b0 dd bcs :TestRemove? ;test to remove object 88b6: a5 0c lda ]INWK_xlo 88b8: c5 12 cmp ]INWK_zlo 88ba: a5 0d lda ]INWK_xhi 88bc: e5 13 sbc ]INWK_zhi ;gives angle to object 88be: b0 d3 bcs :TestRemove? 88c0: a5 0f lda ]INWK_ylo 88c2: c5 12 cmp ]INWK_zlo 88c4: a5 10 lda ]INWK_yhi 88c6: e5 13 sbc ]INWK_zhi 88c8: b0 c9 bcs :TestRemove? 88ca: a0 06 ldy #$06 ;+$06 gun vertex 88cc: b1 5a lda (hull_ptr),y 88ce: aa tax ;vertex index in X-reg 88cf: a9 ff lda #$ff ;flag that vertex 88d1: 9d 00 01 sta BUFFER_0100,x 88d4: 9d 01 01 sta $0101,x ; Compute XX4 visibility. 88d7: a5 12 lda ]INWK_zlo ;take Z value 88d9: 85 d0 sta ]tmp ;low in tmp, high in A-reg 88db: a5 13 lda ]INWK_zhi 88dd: 4a lsr A ;divide by 4 88de: 66 d0 ror ]tmp 88e0: 4a lsr A 88e1: 66 d0 ror ]tmp 88e3: 4a lsr A 88e4: 66 d0 ror ]tmp 88e6: 4a lsr A 88e7: d0 0a bne :Far ;still bits in high byte, it's far away 88e9: a5 d0 lda ]tmp ;only bits in low byte now 88eb: 6a ror A ;(plus one in the carry flag) 88ec: 4a lsr A 88ed: 4a lsr A 88ee: 4a lsr A ;8 shifts, /256, == high byte? 88ef: 85 c0 sta ]xx4_visibility ;update visibility 88f1: 10 11 bpl DrawWireframe? ;(always) 88f3: a0 0d :Far ldy #$0d ;+13 LOD distance (becomes a dot) 88f5: b1 5a lda (hull_ptr),y 88f7: c5 13 cmp ]INWK_zhi 88f9: b0 09 bcs DrawWireframe? 88fb: a9 20 lda #$20 ;mask exploding bit 88fd: 25 2b and polyobj_vis 88ff: d0 03 bne DrawWireframe? ;exploding do the draw 8901: 4c 07 87 jmp DrawShipAsPoint ;too far, just draw a point ; "Draw wireframe (including nodes exploding)" (.LL17) 8904: a2 05 DrawWireframe? ldx #$05 ;"load rotmat into XX16" 8906: b5 21 L8906 lda $21,x 8908: 95 48 sta $48,x ;"XX16,X" 890a: b5 1b lda $1b,x 890c: 95 4e sta $4e,x ;"XX16+6,X" 890e: b5 15 lda $15,x 8910: 95 54 sta $54,x ;"XX16+12,X" 8912: ca dex 8913: 10 f1 bpl L8906 8915: a9 c5 lda #197 ;"comment here about NORM" 8917: 85 ad sta $ad 8919: a0 10 ldy #$10 891b: b9 48 00 L891B lda $0048,y 891e: 0a asl A 891f: b9 49 00 lda $0049,y 8922: 2a rol A 8923: 20 7c 87 jsr BFRDIV ;R=A*256/197 8926: a6 ae ldx $ae 8928: 96 48 stx $48,y 892a: 88 dey 892b: 88 dey 892c: 10 ed bpl L891B 892e: a2 08 ldx #$08 ;"load craft coords into XX18" 8930: b5 0c L8930 lda ]INWK_xlo,x 8932: 95 98 sta $98,x 8934: ca dex 8935: 10 f9 bpl L8930 8937: a9 ff lda #$ff ;"last normal is always visible" 8939: 85 47 sta $47 893b: a0 0c ldy #$0c ;+$0c face count 893d: a5 2b lda polyobj_vis 893f: 29 20 and #$20 ;are we exploding (bit 5)? 8941: f0 12 beq ComputeVis ;no, not all faces are visible 8943: b1 5a lda (hull_ptr),y ;get face count * 4 8945: 4a lsr A ;divide by 4 8946: 4a lsr A 8947: aa tax 8948: a9 ff lda #$ff ;mark visible 894a: 95 38 :Loop sta ]polyobj_face_vis,x ;on all faces 894c: ca dex 894d: 10 fb bpl :Loop 894f: e8 inx 8950: 86 c0 stx ]xx4_visibility ;set to zero 8952: 4c c8 8a :DoTranspose jmp TransposeMatrix? NOTE: visibility test C64 $9b8b (code_9900.asm) BBC .EE29 (flight code) ]scal_norm_x .var $6e {addr/1} ]scal_norm_y .var $70 {addr/1} ]x_lo .var $98 {addr/1} ]x_hi .var $99 {addr/1} ]y_lo .var $9b {addr/1} ]y_hi .var $9c {addr/1} ]z_lo .var $9e {addr/1} ]z_hi .var $9f {addr/1} ]scal_norm_z .var $ae {addr/1} ]s_val .var $af {addr/1} 8955: b1 5a ComputeVis lda (hull_ptr),y ;Y-reg=$0c: face count * 4 8957: f0 f9 beq :DoTranspose ;no faces 8959: 85 c1 sta ]item_xcount 895b: a0 12 ldy #$12 ;+$12 "scaling of normals" 895d: b1 5a lda (hull_ptr),y ;normals scaled by 2^Q% 895f: aa tax 8960: a5 9f lda ]z_hi ;get z_hi 8962: a8 tay ;is high byte zero? 8963: f0 0f beq :ObjClose ;yes, object close/small 8965: e8 :ScaleLoop inx 8966: 46 9c lsr ]y_hi 8968: 66 9b ror ]y_lo 896a: 46 99 lsr ]x_hi 896c: 66 98 ror ]x_lo 896e: 4a lsr A 896f: 66 9e ror ]z_lo 8971: a8 tay ;have we reduced z_hi to 0? 8972: d0 f1 bne :ScaleLoop ;no, keep going 8974: 86 b2 :ObjClose stx ]scale 8976: a5 a0 lda $a0 8978: 85 73 sta $73 897a: a5 98 lda ]x_lo 897c: 85 6e sta ]scal_norm_x 897e: a5 9a lda $9a 8980: 85 6f sta $6f 8982: a5 9b lda ]y_lo 8984: 85 70 sta ]scal_norm_y 8986: a5 9d lda $9d 8988: 85 71 sta $71 898a: a5 9e lda ]z_lo 898c: 85 72 sta $72 898e: 20 e4 87 jsr DotProduct 8991: a5 74 lda ]normal_x 8993: 85 98 sta ]x_lo 8995: a5 75 lda ]nx_sign_flag 8997: 85 9a sta $9a 8999: a5 76 lda ]normal_y 899b: 85 9b sta ]y_lo 899d: a5 77 lda ]ny_sign_flag 899f: 85 9d sta $9d 89a1: a5 78 lda ]normal_z 89a3: 85 9e sta ]z_lo 89a5: a5 79 lda ]nz_sign_flag 89a7: 85 a0 sta $a0 89a9: a0 04 ldy #$04 ;+4 face data offset low byte 89ab: b1 5a lda (hull_ptr),y 89ad: 18 clc 89ae: 65 5a adc hull_ptr 89b0: 85 5e sta ]face_ptr 89b2: a0 11 ldy #$11 ;+11 face data offset high byte 89b4: b1 5a lda (hull_ptr),y 89b6: 65 5b adc hull_ptr+1 89b8: 85 5f sta ]face_ptr+1 ; Iterate through all normals (BBC .LL86). 89ba: a0 00 ldy #$00 89bc: b1 5e :FaceLoop lda (]face_ptr),y ;get 1st byte (flags) from face data 89be: 85 75 sta ]nx_sign_flag 89c0: 29 1f and #%00011111 ;low 5 bits are the always-visible limit 89c2: c5 c0 cmp ]xx4_visibility ;compare to distance 89c4: b0 0f bcs :CheckNormVis ;cutoff >= dist; might not be visible; check normal 89c6: 98 tya ;face entry offset 89c7: 4a lsr A ;divide by 4 to get face index 89c8: 4a lsr A 89c9: aa tax 89ca: a9 ff lda #$ff 89cc: 95 38 sta ]polyobj_face_vis,x ;mark face as visible 89ce: 98 tya ;advance to next face 89cf: 69 04 adc #$04 89d1: a8 tay 89d2: 4c c1 8a jmp :NearEnd 89d5: a5 75 :CheckNormVis lda ]nx_sign_flag ;unpack sign flags 89d7: 0a asl A 89d8: 85 77 sta ]ny_sign_flag 89da: 0a asl A 89db: 85 79 sta ]nz_sign_flag 89dd: c8 iny 89de: b1 5e lda (]face_ptr),y ;extract face normal vector 89e0: 85 74 sta ]normal_x 89e2: c8 iny 89e3: b1 5e lda (]face_ptr),y 89e5: 85 76 sta ]normal_y 89e7: c8 iny 89e8: b1 5e lda (]face_ptr),y 89ea: 85 78 sta ]normal_z 89ec: a6 b2 ldx ]scale 89ee: e0 04 cpx #$04 89f0: 90 23 bcc :Small 89f2: a5 98 lda ]x_lo 89f4: 85 6e sta ]scal_norm_x 89f6: a5 9a lda $9a 89f8: 85 6f sta $6f 89fa: a5 9b lda ]y_lo 89fc: 85 70 sta ]scal_norm_y 89fe: a5 9d lda $9d 8a00: 85 71 sta $71 8a02: a5 9e lda ]z_lo 8a04: 85 72 sta $72 8a06: a5 a0 lda $a0 8a08: 85 73 sta $73 8a0a: 4c 73 8a jmp L8A73 8a0d: 46 98 :Ovflw lsr ]x_lo 8a0f: 46 9e lsr ]z_lo 8a11: 46 9b lsr ]y_lo ; Divide normal vector components by 4. 8a13: a2 01 ldx #$01 ;scale=1 8a15: a5 74 :Small lda ]normal_x ;BBC .LL92 8a17: 85 6e sta ]scal_norm_x 8a19: a5 76 lda ]normal_y 8a1b: 85 70 sta ]scal_norm_y 8a1d: a5 78 lda ]normal_z 8a1f: ca dex ;scale-- 8a20: 30 08 bmi :ScaleDone ;scale done, branch 8a22: 46 6e :DownShift lsr ]scal_norm_x 8a24: 46 70 lsr ]scal_norm_y 8a26: 4a lsr A 8a27: ca dex 8a28: 10 f8 bpl :DownShift 8a2a: 85 ae :ScaleDone sta ]scal_norm_z 8a2c: a5 79 lda ]nz_sign_flag 8a2e: 85 af sta ]s_val 8a30: a5 9e lda ]z_lo 8a32: 85 ad sta $ad 8a34: a5 a0 lda $a0 8a36: 20 c4 87 jsr ByteAddSub 8a39: b0 d2 bcs :Ovflw 8a3b: 85 72 sta $72 8a3d: a5 af lda ]s_val 8a3f: 85 73 sta $73 8a41: a5 6e lda ]scal_norm_x 8a43: 85 ae sta ]scal_norm_z 8a45: a5 75 lda ]nx_sign_flag 8a47: 85 af sta ]s_val 8a49: a5 98 lda ]x_lo 8a4b: 85 ad sta $ad 8a4d: a5 9a lda $9a 8a4f: 20 c4 87 jsr ByteAddSub 8a52: b0 b9 bcs :Ovflw 8a54: 85 6e sta ]scal_norm_x 8a56: a5 af lda ]s_val 8a58: 85 6f sta $6f 8a5a: a5 70 lda ]scal_norm_y 8a5c: 85 ae sta ]scal_norm_z 8a5e: a5 77 lda ]ny_sign_flag 8a60: 85 af sta ]s_val 8a62: a5 9b lda ]y_lo 8a64: 85 ad sta $ad 8a66: a5 9d lda $9d 8a68: 20 c4 87 jsr ByteAddSub 8a6b: b0 a0 bcs :Ovflw 8a6d: 85 70 sta ]scal_norm_y 8a6f: a5 af lda ]s_val 8a71: 85 71 sta $71 ; "calculate 3D dot product XX12 . XX15 for (x,y,z)" .LL89 8a73: a5 74 L8A73 lda ]normal_x 8a75: 85 ad sta $ad 8a77: a5 6e lda ]scal_norm_x 8a79: 20 94 5f jsr FMLTU ;"A=A*Q/256unsg" 8a7c: 85 d0 sta ]tmp 8a7e: a5 75 lda ]nx_sign_flag 8a80: 45 6f eor $6f 8a82: 85 af sta ]s_val 8a84: a5 76 lda ]normal_y 8a86: 85 ad sta $ad 8a88: a5 70 lda ]scal_norm_y 8a8a: 20 94 5f jsr FMLTU 8a8d: 85 ad sta $ad 8a8f: a5 d0 lda ]tmp 8a91: 85 ae sta ]scal_norm_z 8a93: a5 77 lda ]ny_sign_flag 8a95: 45 71 eor $71 8a97: 20 c4 87 jsr ByteAddSub 8a9a: 85 d0 sta ]tmp 8a9c: a5 78 lda ]normal_z 8a9e: 85 ad sta $ad 8aa0: a5 72 lda $72 8aa2: 20 94 5f jsr FMLTU 8aa5: 85 ad sta $ad 8aa7: a5 d0 lda ]tmp 8aa9: 85 ae sta ]scal_norm_z 8aab: a5 73 lda $73 8aad: 45 79 eor ]nz_sign_flag 8aaf: 20 c4 87 jsr ByteAddSub 8ab2: 48 pha ;"push xdot+ydot+zdot" 8ab3: 98 tya 8ab4: 4a lsr A 8ab5: 4a lsr A 8ab6: aa tax ;normal index 8ab7: 68 pla 8ab8: 24 af bit ]s_val 8aba: 30 02 bmi L8ABE ;"if -ve then keep acc" 8abc: a9 00 lda #$00 ;"else face not visible" 8abe: 95 38 L8ABE sta ]polyobj_face_vis,x 8ac0: c8 iny 8ac1: c4 c1 :NearEnd cpy ]item_xcount ;done with faces? (BBC .LL88) 8ac3: b0 03 bcs TransposeMatrix? 8ac5: 4c bc 89 jmp :FaceLoop TransposeMatrix? 8ac8: a4 4a ldy $4a ;transpose matrix (BBC .LL42) 8aca: a6 4b ldx $4b 8acc: a5 4e lda $4e 8ace: 85 4a sta $4a 8ad0: a5 4f lda $4f 8ad2: 85 4b sta $4b 8ad4: 84 4e sty $4e 8ad6: 86 4f stx $4f 8ad8: a4 4c ldy $4c 8ada: a6 4d ldx $4d 8adc: a5 54 lda $54 8ade: 85 4c sta $4c 8ae0: a5 55 lda $55 8ae2: 85 4d sta $4d 8ae4: 84 54 sty $54 8ae6: 86 55 stx $55 8ae8: a4 52 ldy $52 8aea: a6 53 ldx $53 8aec: a5 56 lda $56 8aee: 85 52 sta $52 8af0: a5 57 lda $57 8af2: 85 53 sta $53 8af4: 84 56 sty $56 8af6: 86 57 stx $57 ; Read vertices. ]tmp .var $31 {addr/1} ]vertex_ptr .var $5e {addr/2} ]vertex_x .var $6e {addr/1} ]vx_sign_flag .var $6f {addr/1} ]vertex_y .var $70 {addr/1} ]vy_sign_flag .var $71 {addr/1} ]vertex_z .var $72 {addr/1} ]vz_sign_flag .var $73 {addr/1} ]count_v6 .var $b2 {addr/1} ]count .var $bd {addr/1} ;CNT ]vertex_flags .var $d0 {addr/1} 8af8: a0 08 ldy #$08 ;+8 number of vertices * 6 8afa: b1 5a lda (hull_ptr),y 8afc: 85 c1 sta ]item_xcount 8afe: a5 5a lda hull_ptr ;vertices start right after hull header 8b00: 18 clc 8b01: 69 14 adc #20 ;which is 20 bytes 8b03: 85 5e sta ]vertex_ptr 8b05: a5 5b lda hull_ptr+1 8b07: 69 00 adc #$00 8b09: 85 5f sta ]vertex_ptr+1 8b0b: a0 00 ldy #$00 8b0d: 84 bd sty ]count 8b0f: 84 b2 L8B0F sty ]count_v6 8b11: b1 5e lda (]vertex_ptr),y 8b13: 85 6e sta ]vertex_x 8b15: c8 iny 8b16: b1 5e lda (]vertex_ptr),y 8b18: 85 70 sta ]vertex_y 8b1a: c8 iny 8b1b: b1 5e lda (]vertex_ptr),y 8b1d: 85 72 sta ]vertex_z 8b1f: c8 iny 8b20: b1 5e lda (]vertex_ptr),y 8b22: 85 d0 sta ]vertex_flags 8b24: 29 1f and #%00011111 ;mask visibility 8b26: c5 c0 cmp ]xx4_visibility ;is visible? 8b28: 90 2e bcc :Next ;no, skip it 8b2a: c8 iny 8b2b: b1 5e lda (]vertex_ptr),y ;get first two faces 8b2d: 85 31 sta ]tmp 8b2f: 29 0f and #$0f ;face 1 8b31: aa tax 8b32: b5 38 lda ]polyobj_face_vis,x ;face visibility index 8b34: d0 25 bne :IsVisible ;vertex is visible if any face visible 8b36: a5 31 lda ]tmp ;shift to get face 2 8b38: 4a lsr A 8b39: 4a lsr A 8b3a: 4a lsr A 8b3b: 4a lsr A 8b3c: aa tax 8b3d: b5 38 lda ]polyobj_face_vis,x ;check visibility 8b3f: d0 1a bne :IsVisible 8b41: c8 iny 8b42: b1 5e lda (]vertex_ptr),y ;get second pair of faces 8b44: 85 31 sta ]tmp 8b46: 29 0f and #$0f ;face 3 8b48: aa tax 8b49: b5 38 lda ]polyobj_face_vis,x 8b4b: d0 0e bne :IsVisible 8b4d: a5 31 lda ]tmp ;face 4 8b4f: 4a lsr A 8b50: 4a lsr A 8b51: 4a lsr A 8b52: 4a lsr A 8b53: aa tax 8b54: b5 38 lda ]polyobj_face_vis,x 8b56: d0 03 bne :IsVisible 8b58: 4c d0 8c :Next jmp UpdateCounts 8b5b: a5 d0 :IsVisible lda ]vertex_flags ;.LL49 8b5d: 85 6f sta ]vx_sign_flag 8b5f: 0a asl A 8b60: 85 71 sta ]vy_sign_flag 8b62: 0a asl A 8b63: 85 73 sta ]vz_sign_flag 8b65: 20 e4 87 jsr DotProduct 8b68: a5 0e lda INWK+2 8b6a: 85 70 sta ]vertex_y 8b6c: 45 75 eor ]nx_sign_flag 8b6e: 30 10 bmi L8B80 8b70: 18 clc 8b71: a5 74 lda ]normal_x 8b73: 65 0c adc ]INWK_xlo 8b75: 85 6e sta ]vertex_x 8b77: a5 0d lda ]INWK_xhi 8b79: 69 00 adc #$00 8b7b: 85 6f sta ]vx_sign_flag 8b7d: 4c a3 8b jmp L8BA3 8b80: a5 0c L8B80 lda ]INWK_xlo 8b82: 38 sec 8b83: e5 74 sbc ]normal_x 8b85: 85 6e sta ]vertex_x 8b87: a5 0d lda ]INWK_xhi 8b89: e9 00 sbc #$00 8b8b: 85 6f sta ]vx_sign_flag 8b8d: b0 14 bcs L8BA3 8b8f: 49 ff eor #$ff 8b91: 85 6f sta ]vx_sign_flag 8b93: a9 01 lda #$01 8b95: e5 6e sbc ]vertex_x 8b97: 85 6e sta ]vertex_x 8b99: 90 02 bcc L8B9D 8b9b: e6 6f inc ]vx_sign_flag 8b9d: a5 70 L8B9D lda ]vertex_y 8b9f: 49 80 eor #$80 8ba1: 85 70 sta ]vertex_y 8ba3: a5 11 L8BA3 lda INWK+5 8ba5: 85 73 sta ]vz_sign_flag 8ba7: 45 77 eor ]ny_sign_flag 8ba9: 30 10 bmi L8BBB 8bab: 18 clc 8bac: a5 76 lda ]normal_y 8bae: 65 0f adc ]INWK_ylo 8bb0: 85 71 sta ]vy_sign_flag 8bb2: a5 10 lda ]INWK_yhi 8bb4: 69 00 adc #$00 8bb6: 85 72 sta ]vertex_z 8bb8: 4c e0 8b jmp L8BE0 8bbb: a5 0f L8BBB lda ]INWK_ylo 8bbd: 38 sec 8bbe: e5 76 sbc ]normal_y 8bc0: 85 71 sta ]vy_sign_flag 8bc2: a5 10 lda ]INWK_yhi 8bc4: e9 00 sbc #$00 8bc6: 85 72 sta ]vertex_z 8bc8: b0 16 bcs L8BE0 8bca: 49 ff eor #$ff 8bcc: 85 72 sta ]vertex_z 8bce: a5 71 lda ]vy_sign_flag 8bd0: 49 ff eor #$ff 8bd2: 69 01 adc #$01 8bd4: 85 71 sta ]vy_sign_flag 8bd6: a5 73 lda ]vz_sign_flag 8bd8: 49 80 eor #$80 8bda: 85 73 sta ]vz_sign_flag 8bdc: 90 02 bcc L8BE0 8bde: e6 72 inc ]vertex_z 8be0: a5 79 L8BE0 lda ]nz_sign_flag 8be2: 30 4a bmi L8C2E 8be4: a5 78 lda ]normal_z 8be6: 18 clc 8be7: 65 12 adc ]INWK_zlo 8be9: 85 d0 sta ]vertex_flags 8beb: a5 13 lda ]INWK_zhi 8bed: 69 00 adc #$00 8bef: 85 ac sta $ac 8bf1: 4c 4d 8c jmp L8C4D 8bf4: a6 ad L8BF4 ldx $ad 8bf6: f0 1c beq L8C14 8bf8: a2 00 ldx #$00 8bfa: 4a L8BFA lsr A 8bfb: e8 inx 8bfc: c5 ad cmp $ad 8bfe: b0 fa bcs L8BFA 8c00: 86 af stx ]s_val 8c02: 20 7c 87 jsr BFRDIV 8c05: a6 af ldx ]s_val 8c07: a5 ae lda ]scal_norm_z 8c09: 0a L8C09 asl A 8c0a: 26 ac rol $ac 8c0c: 30 06 bmi L8C14 8c0e: ca dex 8c0f: d0 f8 bne L8C09 8c11: 85 ae sta ]scal_norm_z 8c13: 60 rts 8c14: a9 32 L8C14 lda #$32 8c16: 85 ae sta ]scal_norm_z 8c18: 85 ac sta $ac 8c1a: 60 rts 8c1b: a9 80 L8C1B lda #$80 8c1d: 38 sec 8c1e: e5 ae sbc ]scal_norm_z 8c20: 9d 00 01 sta BUFFER_0100,x 8c23: e8 inx 8c24: a9 00 lda #$00 8c26: e5 ac sbc $ac 8c28: 9d 00 01 sta BUFFER_0100,x 8c2b: 4c 8d 8c jmp L8C8D 8c2e: a5 12 L8C2E lda ]INWK_zlo 8c30: 38 sec 8c31: e5 78 sbc ]normal_z 8c33: 85 d0 sta ]vertex_flags 8c35: a5 13 lda ]INWK_zhi 8c37: e9 00 sbc #$00 8c39: 85 ac sta $ac 8c3b: 90 08 bcc L8C45 8c3d: d0 0e bne L8C4D 8c3f: a5 d0 lda ]vertex_flags 8c41: c9 04 cmp #$04 8c43: b0 08 bcs L8C4D 8c45: a9 00 L8C45 lda #$00 8c47: 85 ac sta $ac 8c49: a9 04 lda #$04 8c4b: 85 d0 sta ]vertex_flags 8c4d: a5 ac L8C4D lda $ac 8c4f: 05 6f ora ]vx_sign_flag 8c51: 05 72 ora ]vertex_z 8c53: f0 0f beq L8C64 8c55: 46 6f lsr ]vx_sign_flag 8c57: 66 6e ror ]vertex_x 8c59: 46 72 lsr ]vertex_z 8c5b: 66 71 ror ]vy_sign_flag 8c5d: 46 ac lsr $ac 8c5f: 66 d0 ror ]vertex_flags 8c61: 4c 4d 8c jmp L8C4D 8c64: a5 d0 L8C64 lda ]vertex_flags 8c66: 85 ad sta $ad 8c68: a5 6e lda ]vertex_x 8c6a: c5 ad cmp $ad 8c6c: 90 06 bcc L8C74 8c6e: 20 f4 8b jsr L8BF4 8c71: 4c 77 8c jmp L8C77 8c74: 20 7c 87 L8C74 jsr BFRDIV 8c77: a6 bd L8C77 ldx ]count 8c79: a5 70 lda ]vertex_y 8c7b: 30 9e bmi L8C1B 8c7d: a5 ae lda ]scal_norm_z 8c7f: 18 clc 8c80: 69 80 adc #$80 8c82: 9d 00 01 sta BUFFER_0100,x 8c85: e8 inx 8c86: a5 ac lda $ac 8c88: 69 00 adc #$00 8c8a: 9d 00 01 sta BUFFER_0100,x 8c8d: 8a L8C8D txa 8c8e: 48 pha 8c8f: a9 00 lda #$00 8c91: 85 ac sta $ac 8c93: a5 d0 lda ]vertex_flags 8c95: 85 ad sta $ad 8c97: a5 71 lda ]vy_sign_flag 8c99: c5 ad cmp $ad 8c9b: 90 19 bcc L8CB6 8c9d: 20 f4 8b jsr L8BF4 8ca0: 4c b9 8c jmp L8CB9 8ca3: a9 44 L8CA3 lda #$44 8ca5: 18 clc 8ca6: 65 ae adc ]scal_norm_z 8ca8: 9d 00 01 sta BUFFER_0100,x 8cab: e8 inx 8cac: a9 00 lda #$00 8cae: 65 ac adc $ac 8cb0: 9d 00 01 sta BUFFER_0100,x 8cb3: 4c d0 8c jmp UpdateCounts 8cb6: 20 7c 87 L8CB6 jsr BFRDIV 8cb9: 68 L8CB9 pla 8cba: aa tax 8cbb: e8 inx 8cbc: a5 73 lda ]vz_sign_flag 8cbe: 30 e3 bmi L8CA3 8cc0: a9 44 lda #$44 8cc2: 38 sec 8cc3: e5 ae sbc ]scal_norm_z 8cc5: 9d 00 01 sta BUFFER_0100,x 8cc8: e8 inx 8cc9: a9 00 lda #$00 8ccb: e5 ac sbc $ac 8ccd: 9d 00 01 sta BUFFER_0100,x 8cd0: 18 UpdateCounts clc ;BBC .LL50 8cd1: a5 bd lda ]count ;advance count by 4 8cd3: 69 04 adc #$04 8cd5: 85 bd sta ]count 8cd7: a5 b2 lda ]count_v6 ;and other count by 6 8cd9: 69 06 adc #$06 8cdb: a8 tay 8cdc: b0 07 bcs L8CE5 8cde: c5 c1 cmp ]item_xcount 8ce0: b0 03 bcs L8CE5 8ce2: 4c 0f 8b jmp L8B0F 8ce5: a5 2b L8CE5 lda polyobj_vis ;display/exploding state|missiles 8ce7: 29 20 and #$20 ;check bit 5 8ce9: f0 09 beq L8CF4 ;no explosion, branch 8ceb: a5 2b lda polyobj_vis 8ced: 09 08 ora #$08 ;"set bit3 to erase old line" 8cef: 85 2b sta polyobj_vis 8cf1: 4c 29 72 jmp DoExplosion? ]x0_lo .var $6e {addr/1} ]x0_hi .var $6f {addr/1} ]y0_lo .var $70 {addr/1} ]y0_hi .var $71 {addr/1} ]x1_lo .var $72 {addr/1} ]x1_hi .var $73 {addr/1} ]y1_lo .var $74 {addr/1} ]y1_hi .var $75 {addr/1} 8cf4: a0 09 L8CF4 ldy #$09 ;+$09 number of edges 8cf6: b1 5a lda (hull_ptr),y 8cf8: 85 c1 sta ]item_xcount 8cfa: a9 08 lda #$08 8cfc: 05 2b ora polyobj_vis 8cfe: 85 2b sta polyobj_vis 8d00: a0 00 ldy #$00 8d02: 84 b2 sty ]count_v6 8d04: 24 2b bit polyobj_vis ;check bit 6 8d06: 50 3f bvc L8D47 ;bit 6 clear (laser not firing) 8d08: a5 2b lda polyobj_vis 8d0a: 29 bf and #$bf ;clear bit 6 8d0c: 85 2b sta polyobj_vis 8d0e: a0 06 ldy #$06 ;+$06 gun vertex 8d10: b1 5a lda (hull_ptr),y 8d12: a8 tay 8d13: be 00 01 ldx BUFFER_0100,y 8d16: 86 6e stx ]x0_lo 8d18: e8 inx 8d19: f0 2c beq L8D47 8d1b: be 01 01 ldx $0101,y 8d1e: 86 6f stx ]x0_hi 8d20: e8 inx 8d21: f0 24 beq L8D47 8d23: be 02 01 ldx $0102,y 8d26: 86 70 stx ]y0_lo 8d28: be 03 01 ldx $0103,y 8d2b: 86 71 stx ]y0_hi 8d2d: a9 00 lda #$00 8d2f: 85 72 sta ]x1_lo 8d31: 85 73 sta ]x1_hi 8d33: 85 75 sta ]y1_hi 8d35: a5 12 lda ]INWK_zlo 8d37: 85 74 sta ]y1_lo 8d39: a5 0e lda INWK+2 8d3b: 10 02 bpl L8D3F 8d3d: c6 72 dec ]x1_lo 8d3f: 20 d2 8e L8D3F jsr ClipLine 8d42: b0 03 bcs L8D47 8d44: 20 21 90 jsr DrawTwoThings? NOTE: BBC .LL170 (flight code) ; Calculate new lines. • Clear variables ]edge_ptr .var $5e {addr/2} ]max_lines .var $bd {addr/1} 8d47: a0 03 L8D47 ldy #$03 ;+$03 offset to edges low byte 8d49: 18 clc 8d4a: b1 5a lda (hull_ptr),y 8d4c: 65 5a adc hull_ptr 8d4e: 85 5e sta ]edge_ptr 8d50: a0 10 ldy #$10 ;+$10 offset to edges high byte 8d52: b1 5a lda (hull_ptr),y 8d54: 65 5b adc hull_ptr+1 8d56: 85 5f sta ]edge_ptr+1 8d58: a0 05 ldy #$05 ;+$05 (4 * maxlines) + 1 8d5a: b1 5a lda (hull_ptr),y 8d5c: 85 bd sta ]max_lines 8d5e: a0 00 :CountVis ldy #$00 ;count visible edges 8d60: b1 5e lda (]edge_ptr),y ;get visibility 8d62: c5 c0 cmp $c0 8d64: 90 4f bcc :NotVis ;not visible 8d66: c8 iny 8d67: b1 5e lda (]edge_ptr),y ;edge data byte 8d69: 85 31 sta $31 8d6b: 29 0f and #$0f ;face 1 8d6d: aa tax 8d6e: b5 38 lda $38,x ;check visibility 8d70: d0 0b bne :IsVis ;visible if either face is visible 8d72: a5 31 lda $31 8d74: 4a lsr A 8d75: 4a lsr A 8d76: 4a lsr A 8d77: 4a lsr A 8d78: aa tax 8d79: b5 38 lda $38,x 8d7b: f0 38 beq :NotVis 8d7d: c8 :IsVis iny 8d7e: b1 5e lda (]edge_ptr),y ;get index of first vertex 8d80: aa tax 8d81: bd 00 01 lda BUFFER_0100,x 8d84: 85 6e sta $6e 8d86: bd 01 01 lda $0101,x 8d89: 85 6f sta $6f 8d8b: bd 02 01 lda $0102,x 8d8e: 85 70 sta $70 8d90: bd 03 01 lda $0103,x 8d93: 85 71 sta $71 8d95: c8 iny 8d96: b1 5e lda (]edge_ptr),y ;get index of second vertex 8d98: aa tax 8d99: bd 00 01 lda BUFFER_0100,x 8d9c: 85 72 sta $72 8d9e: bd 02 01 lda $0102,x 8da1: 85 74 sta $74 8da3: bd 03 01 lda $0103,x 8da6: 85 75 sta $75 8da8: bd 01 01 lda $0101,x 8dab: 85 73 sta $73 8dad: 20 d9 8e jsr ClipLine1 8db0: b0 03 bcs :NotVis 8db2: 20 21 90 jsr DrawTwoThings? 8db5: a5 c2 :NotVis lda $c2 8db7: c5 bd cmp ]max_lines 8db9: b0 13 bcs L8DCE 8dbb: a5 5e lda ]edge_ptr 8dbd: 18 clc 8dbe: 69 04 adc #$04 8dc0: 85 5e sta ]edge_ptr 8dc2: 90 02 bcc L8DC6 8dc4: e6 5f inc ]edge_ptr+1 8dc6: e6 b2 L8DC6 inc $b2 8dc8: a4 b2 ldy $b2 8dca: c4 c1 cpy $c1 8dcc: 90 90 bcc :CountVis 8dce: 4c fa 8f L8DCE jmp DrawDot 8dd1: a5 6f L8DD1 lda $6f 8dd3: 10 17 bpl L8DEC 8dd5: 85 af sta $af 8dd7: 20 4b 8e jsr L8E4B 8dda: 8a txa 8ddb: 18 clc 8ddc: 65 70 adc $70 8dde: 85 70 sta $70 8de0: 98 tya 8de1: 65 71 adc $71 8de3: 85 71 sta $71 8de5: a9 00 lda #$00 8de7: 85 6e sta $6e 8de9: 85 6f sta $6f 8deb: aa tax 8dec: f0 19 L8DEC beq L8E07 8dee: 85 af sta $af 8df0: c6 af dec $af 8df2: 20 4b 8e jsr L8E4B 8df5: 8a txa 8df6: 18 clc 8df7: 65 70 adc $70 8df9: 85 70 sta $70 8dfb: 98 tya 8dfc: 65 71 adc $71 8dfe: 85 71 sta $71 8e00: a2 ff ldx #$ff 8e02: 86 6e stx $6e 8e04: e8 inx 8e05: 86 6f stx $6f 8e07: a5 71 L8E07 lda $71 8e09: 10 1a bpl L8E25 8e0b: 85 af sta $af 8e0d: a5 70 lda $70 8e0f: 85 ae sta $ae 8e11: 20 7a 8e jsr L8E7A 8e14: 8a txa 8e15: 18 clc 8e16: 65 6e adc $6e 8e18: 85 6e sta $6e 8e1a: 98 tya 8e1b: 65 6f adc $6f 8e1d: 85 6f sta $6f 8e1f: a9 00 lda #$00 8e21: 85 70 sta $70 8e23: 85 71 sta $71 8e25: a5 70 L8E25 lda $70 8e27: 38 sec 8e28: e9 88 sbc #$88 8e2a: 85 ae sta $ae 8e2c: a5 71 lda $71 8e2e: e9 00 sbc #$00 8e30: 85 af sta $af 8e32: 90 16 bcc L8E4A 8e34: 20 7a 8e jsr L8E7A 8e37: 8a txa 8e38: 18 clc 8e39: 65 6e adc $6e 8e3b: 85 6e sta $6e 8e3d: 98 tya 8e3e: 65 6f adc $6f 8e40: 85 6f sta $6f 8e42: a9 87 lda #$87 8e44: 85 70 sta $70 8e46: a9 00 lda #$00 8e48: 85 71 sta $71 8e4a: 60 L8E4A rts 8e4b: a5 6e L8E4B lda $6e 8e4d: 85 ae sta $ae 8e4f: 20 b6 8e jsr L8EB6 8e52: 48 pha 8e53: a6 d0 ldx $d0 8e55: d0 2b bne L8E82 8e57: a9 00 L8E57 lda #$00 8e59: aa tax 8e5a: a8 tay 8e5b: 46 af lsr $af 8e5d: 66 ae ror $ae 8e5f: 06 ad asl $ad 8e61: 90 09 bcc L8E6C 8e63: 8a L8E63 txa 8e64: 18 clc 8e65: 65 ae adc $ae 8e67: aa tax 8e68: 98 tya 8e69: 65 af adc $af 8e6b: a8 tay 8e6c: 46 af L8E6C lsr $af 8e6e: 66 ae ror $ae 8e70: 06 ad asl $ad 8e72: b0 ef bcs L8E63 8e74: d0 f6 bne L8E6C 8e76: 68 pla 8e77: 10 30 bpl L8EA9 8e79: 60 rts 8e7a: 20 b6 8e L8E7A jsr L8EB6 8e7d: 48 pha 8e7e: a6 d0 ldx $d0 8e80: d0 d5 bne L8E57 8e82: a9 ff L8E82 lda #$ff 8e84: a8 tay 8e85: 0a asl A 8e86: aa tax 8e87: 06 ae L8E87 asl $ae 8e89: 26 af rol $af 8e8b: a5 af lda $af 8e8d: b0 04 bcs L8E93 8e8f: c5 ad cmp $ad 8e91: 90 0b bcc L8E9E 8e93: e5 ad L8E93 sbc $ad 8e95: 85 af sta $af 8e97: a5 ae lda $ae 8e99: e9 00 sbc #$00 8e9b: 85 ae sta $ae 8e9d: 38 sec 8e9e: 8a L8E9E txa 8e9f: 2a rol A 8ea0: aa tax 8ea1: 98 tya 8ea2: 2a rol A 8ea3: a8 tay 8ea4: b0 e1 bcs L8E87 8ea6: 68 pla 8ea7: 30 0c bmi L8EB5 8ea9: 8a L8EA9 txa 8eaa: 49 ff eor #$ff 8eac: 69 01 adc #$01 8eae: aa tax 8eaf: 98 tya 8eb0: 49 ff eor #$ff 8eb2: 69 00 adc #$00 8eb4: a8 tay 8eb5: 60 L8EB5 rts 8eb6: a6 76 L8EB6 ldx $76 8eb8: 86 ad stx $ad 8eba: a5 af lda $af 8ebc: 10 11 bpl L8ECF 8ebe: a9 00 lda #$00 8ec0: 38 sec 8ec1: e5 ae sbc $ae 8ec3: 85 ae sta $ae 8ec5: a5 af lda $af 8ec7: 48 pha 8ec8: 49 ff eor #$ff 8eca: 69 00 adc #$00 8ecc: 85 af sta $af 8ece: 68 pla 8ecf: 45 77 L8ECF eor $77 8ed1: 60 rts NOTE: BBC .LL145/CLIP (flight) ; ; Clips a line to the viewport. ; ; Looks like it's performing midpoint subdivision. ; ; Viewport area appears to be 256x135. ; ; On entry: ; $6e/6f: x0 ; $70/71: y0 ; $72/73: x1 ; $74/75: y1 ; ; On exit: ; $6e: clipped x0 ; $6f: clipped y0 ; $70: clipped x1 ; $71: clipped y1 ; • Clear variables ]x0_lo .var $6e {addr/1} ]x0_hi .var $6f {addr/1} ]y0_lo .var $70 {addr/1} ]y0_hi .var $71 {addr/1} ]x1_lo .var $72 {addr/1} ]x1_hi .var $73 {addr/1} ]y1_lo .var $74 {addr/1} ]y1_hi .var $75 {addr/1} ]yclip .var $b5 {addr/1} 8ed2: a9 00 ClipLine lda #$00 8ed4: 8d 7d 02 sta lcoord_swap_flag 8ed7: a5 73 lda ]x1_hi 8ed9: a2 87 ClipLine1 ldx #135 ;viewport height 8edb: 05 75 ora ]y1_hi 8edd: d0 06 bne :SkipYcReset 8edf: e4 74 cpx ]y1_lo 8ee1: 90 02 bcc :SkipYcReset 8ee3: a2 00 ldx #$00 8ee5: 86 b5 :SkipYcReset stx ]yclip 8ee7: a5 6f lda ]x0_hi 8ee9: 05 71 ora ]y0_hi 8eeb: d0 1c bne L8F09 8eed: a9 87 lda #135 ;viewport height 8eef: c5 70 cmp ]y0_lo 8ef1: 90 16 bcc L8F09 8ef3: a5 b5 lda ]yclip 8ef5: d0 10 bne L8F07 8ef7: a5 70 L8EF7 lda ]y0_lo ;copy *_lo to outputs 8ef9: 85 6f sta ]x0_hi 8efb: a5 72 lda ]x1_lo 8efd: 85 70 sta ]y0_lo 8eff: a5 74 lda ]y1_lo 8f01: 85 71 sta ]y0_hi 8f03: 18 clc ;valid to plot 8f04: 60 rts 8f05: 38 :NotVisible sec ;clipped line not visible 8f06: 60 rts 8f07: 46 b5 L8F07 lsr ]yclip ;yclip = ymid 8f09: a5 b5 L8F09 lda ]yclip 8f0b: 10 2f bpl L8F3C 8f0d: a5 6f lda ]x0_hi 8f0f: 25 73 and ]x1_hi 8f11: 30 f2 bmi :NotVisible 8f13: a5 71 lda ]y0_hi 8f15: 25 75 and ]y1_hi 8f17: 30 ec bmi :NotVisible 8f19: a6 6f ldx ]x0_hi 8f1b: ca dex 8f1c: 8a txa 8f1d: a6 73 ldx ]x1_hi 8f1f: ca dex 8f20: 86 76 stx $76 8f22: 05 76 ora $76 8f24: 10 df bpl :NotVisible 8f26: a5 70 lda ]y0_lo 8f28: c9 88 cmp #$88 8f2a: a5 71 lda ]y0_hi 8f2c: e9 00 sbc #$00 8f2e: 85 76 sta $76 8f30: a5 74 lda ]y1_lo 8f32: c9 88 cmp #$88 8f34: a5 75 lda ]y1_hi 8f36: e9 00 sbc #$00 8f38: 05 76 ora $76 8f3a: 10 c9 bpl :NotVisible 8f3c: 98 L8F3C tya 8f3d: 48 pha 8f3e: a5 72 lda ]x1_lo 8f40: 38 sec 8f41: e5 6e sbc ]x0_lo 8f43: 85 76 sta $76 8f45: a5 73 lda ]x1_hi 8f47: e5 6f sbc ]x0_hi 8f49: 85 77 sta $77 8f4b: a5 74 lda ]y1_lo 8f4d: 38 sec 8f4e: e5 70 sbc ]y0_lo 8f50: 85 78 sta $78 8f52: a5 75 lda ]y1_hi 8f54: e5 71 sbc ]y0_hi 8f56: 85 79 sta $79 8f58: 45 77 eor $77 8f5a: 85 af sta $af 8f5c: a5 79 lda $79 8f5e: 10 0d bpl L8F6D 8f60: a9 00 lda #$00 8f62: 38 sec 8f63: e5 78 sbc $78 8f65: 85 78 sta $78 8f67: a9 00 lda #$00 8f69: e5 79 sbc $79 8f6b: 85 79 sta $79 8f6d: a5 77 L8F6D lda $77 8f6f: 10 0b bpl L8F7C 8f71: 38 sec 8f72: a9 00 lda #$00 8f74: e5 76 sbc $76 8f76: 85 76 sta $76 8f78: a9 00 lda #$00 8f7a: e5 77 sbc $77 8f7c: aa L8F7C tax 8f7d: d0 04 bne L8F83 8f7f: a6 79 ldx $79 8f81: f0 0a beq L8F8D 8f83: 4a L8F83 lsr A 8f84: 66 76 ror $76 8f86: 46 79 lsr $79 8f88: 66 78 ror $78 8f8a: 4c 7c 8f jmp L8F7C 8f8d: 86 d0 L8F8D stx $d0 8f8f: a5 76 lda $76 8f91: c5 78 cmp $78 8f93: 90 0a bcc L8F9F 8f95: 85 ad sta $ad 8f97: a5 78 lda $78 8f99: 20 7c 87 jsr BFRDIV 8f9c: 4c aa 8f jmp L8FAA 8f9f: a5 78 L8F9F lda $78 8fa1: 85 ad sta $ad 8fa3: a5 76 lda $76 8fa5: 20 7c 87 jsr BFRDIV 8fa8: c6 d0 dec $d0 8faa: a5 ae L8FAA lda $ae 8fac: 85 76 sta $76 8fae: a5 af lda $af 8fb0: 85 77 sta $77 8fb2: a5 b5 lda ]yclip 8fb4: f0 02 beq L8FB8 8fb6: 10 13 bpl L8FCB 8fb8: 20 d1 8d L8FB8 jsr L8DD1 8fbb: a5 b5 lda ]yclip 8fbd: 10 32 bpl L8FF1 8fbf: a5 6f lda ]x0_hi 8fc1: 05 71 ora ]y0_hi 8fc3: d0 31 bne L8FF6 8fc5: a5 70 lda ]y0_lo 8fc7: c9 88 cmp #$88 8fc9: b0 2b bcs L8FF6 8fcb: a6 6e L8FCB ldx ]x0_lo 8fcd: a5 72 lda ]x1_lo 8fcf: 85 6e sta ]x0_lo 8fd1: 86 72 stx ]x1_lo 8fd3: a5 73 lda ]x1_hi 8fd5: a6 6f ldx ]x0_hi 8fd7: 86 73 stx ]x1_hi 8fd9: 85 6f sta ]x0_hi 8fdb: a6 70 ldx ]y0_lo 8fdd: a5 74 lda ]y1_lo 8fdf: 85 70 sta ]y0_lo 8fe1: 86 74 stx ]y1_lo 8fe3: a5 75 lda ]y1_hi 8fe5: a6 71 ldx ]y0_hi 8fe7: 86 75 stx ]y1_hi 8fe9: 85 71 sta ]y0_hi 8feb: 20 d1 8d jsr L8DD1 8fee: ce 7d 02 dec lcoord_swap_flag 8ff1: 68 L8FF1 pla 8ff2: a8 tay 8ff3: 4c f7 8e jmp L8EF7 8ff6: 68 L8FF6 pla 8ff7: a8 tay 8ff8: 38 sec 8ff9: 60 rts • Clear variables ]screen_x0 .var $6e {addr/1} ]screen_y0 .var $6f {addr/1} ]screen_x1 .var $70 {addr/1} ]screen_y1 .var $71 {addr/1} 8ffa: a4 c2 DrawDot ldy $c2 8ffc: c4 c3 :Loop cpy $c3 8ffe: b0 1a bcs :Done 9000: b1 2d lda (tmp_ptr2),y 9002: c8 iny 9003: 85 6e sta ]screen_x0 9005: b1 2d lda (tmp_ptr2),y 9007: c8 iny 9008: 85 6f sta ]screen_y0 900a: b1 2d lda (tmp_ptr2),y 900c: c8 iny 900d: 85 70 sta ]screen_x1 900f: b1 2d lda (tmp_ptr2),y 9011: c8 iny 9012: 85 71 sta ]screen_y1 9014: 20 64 9c jsr DrawLine 9017: 4c fc 8f jmp :Loop 901a: a5 c2 :Done lda $c2 901c: a0 00 ldy #$00 901e: 91 2d sta (tmp_ptr2),y 9020: 60 :Return rts 9021: a4 c2 DrawTwoThings? ldy $c2 9023: c4 c3 cpy $c3 9025: 08 php 9026: a2 03 ldx #$03 9028: b5 6e :CopyLoop lda ]screen_x0,x 902a: 95 74 sta $74,x 902c: ca dex 902d: 10 f9 bpl :CopyLoop 902f: 20 64 9c jsr DrawLine 9032: b1 2d lda (tmp_ptr2),y 9034: 85 6e sta ]screen_x0 9036: a5 74 lda $74 9038: 91 2d sta (tmp_ptr2),y 903a: c8 iny 903b: b1 2d lda (tmp_ptr2),y 903d: 85 6f sta ]screen_y0 903f: a5 75 lda $75 9041: 91 2d sta (tmp_ptr2),y 9043: c8 iny 9044: b1 2d lda (tmp_ptr2),y 9046: 85 70 sta ]screen_x1 9048: a5 76 lda $76 904a: 91 2d sta (tmp_ptr2),y 904c: c8 iny 904d: b1 2d lda (tmp_ptr2),y 904f: 85 71 sta ]screen_y1 9051: a5 77 lda $77 9053: 91 2d sta (tmp_ptr2),y 9055: c8 iny 9056: 84 c2 sty $c2 9058: 28 plp 9059: b0 c5 bcs :Return 905b: 4c 64 9c jmp DrawLine NOTE: BBC .MVEIT 905e: a5 2b MVEIT lda polyobj_vis 9060: 29 a0 and #$a0 9062: d0 25 bne L9089 9064: a5 b6 lda $b6 9066: 45 b0 eor $b0 9068: 29 0f and #$0f 906a: d0 03 bne L906F 906c: 20 fb 85 jsr L85FB 906f: a6 b8 L906F ldx $b8 9071: 10 03 bpl L9076 9073: 4c fb 92 jmp L92FB 9076: a5 2c L9076 lda polyobj_attack 9078: 10 0f bpl L9089 907a: e0 01 cpx #$01 907c: f0 08 beq L9086 907e: a5 b6 lda $b6 9080: 45 b0 eor $b0 9082: 29 07 and #$07 9084: d0 03 bne L9089 9086: 20 48 58 L9086 jsr TACTICS 9089: 20 83 a2 L9089 jsr SCAN 908c: a5 27 lda polyobj_vertex_lo 908e: 0a asl A 908f: 0a asl A 9090: 85 ad sta $ad 9092: a5 16 lda $16 9094: 29 7f and #$7f 9096: 20 94 5f jsr FMLTU 9099: 85 ae sta $ae 909b: a5 16 lda $16 909d: a2 00 ldx #$00 909f: 20 08 92 jsr L9208 90a2: a5 18 lda $18 90a4: 29 7f and #$7f 90a6: 20 94 5f jsr FMLTU 90a9: 85 ae sta $ae 90ab: a5 18 lda $18 90ad: a2 03 ldx #$03 90af: 20 08 92 jsr L9208 90b2: a5 1a lda polyobj_mox2_hi 90b4: 29 7f and #$7f 90b6: 20 94 5f jsr FMLTU 90b9: 85 ae sta $ae 90bb: a5 1a lda polyobj_mox2_hi 90bd: a2 06 ldx #$06 90bf: 20 08 92 jsr L9208 90c2: a5 27 lda polyobj_vertex_lo 90c4: 18 clc 90c5: 65 28 adc $28 90c7: 10 02 bpl L90CB 90c9: a9 00 lda #$00 90cb: a0 0f L90CB ldy #$0f ;max speed 90cd: d1 5a cmp (hull_ptr),y ;get from hull definition 90cf: 90 02 bcc :NotMax 90d1: b1 5a lda (hull_ptr),y ;cap it at max 90d3: 85 27 :NotMax sta polyobj_vertex_lo 90d5: a9 00 lda #$00 90d7: 85 28 sta $28 90d9: a6 6b ldx $6b 90db: a5 0c lda polyobj_xpos_lo 90dd: 49 ff eor #$ff 90df: 85 31 sta $31 90e1: a5 0d lda INWK+1 90e3: 20 bc 5f jsr MLTU2 90e6: 85 33 sta $33 90e8: a5 6d lda $6d 90ea: 45 0e eor INWK+2 90ec: a2 03 ldx #$03 90ee: 20 c6 92 jsr L92C6 90f1: 85 c9 sta $c9 90f3: a5 32 lda $32 90f5: 85 c7 sta $c7 90f7: 49 ff eor #$ff 90f9: 85 31 sta $31 90fb: a5 33 lda $33 90fd: 85 c8 sta $c8 90ff: a6 67 ldx $67 9101: 20 bc 5f jsr MLTU2 9104: 85 33 sta $33 9106: a5 c9 lda $c9 9108: 45 a7 eor $a7 910a: a2 06 ldx #$06 910c: 20 c6 92 jsr L92C6 910f: 85 14 sta polyobj_zpos_hi 9111: a5 32 lda $32 9113: 85 12 sta polyobj_zpos_lo 9115: 49 ff eor #$ff 9117: 85 31 sta $31 9119: a5 33 lda $33 911b: 85 13 sta polyobj_zpos_mi 911d: 20 be 5f jsr MLTU2_2 9120: 85 33 sta $33 9122: a5 c9 lda $c9 9124: 85 11 sta INWK+5 9126: 45 a7 eor $a7 9128: 45 14 eor polyobj_zpos_hi 912a: 10 0f bpl L913B 912c: a5 32 lda $32 912e: 65 c7 adc $c7 9130: 85 0f sta polyobj_ypos_lo 9132: a5 33 lda $33 9134: 65 c8 adc $c8 9136: 85 10 sta INWK+4 9138: 4c 5b 91 jmp L915B 913b: a5 c7 L913B lda $c7 913d: e5 32 sbc $32 913f: 85 0f sta polyobj_ypos_lo 9141: a5 c8 lda $c8 9143: e5 33 sbc $33 9145: 85 10 sta INWK+4 9147: b0 12 bcs L915B 9149: a9 01 lda #$01 914b: e5 0f sbc polyobj_ypos_lo 914d: 85 0f sta polyobj_ypos_lo 914f: a9 00 lda #$00 9151: e5 10 sbc INWK+4 9153: 85 10 sta INWK+4 9155: a5 11 lda INWK+5 9157: 49 80 eor #$80 9159: 85 11 sta INWK+5 915b: a6 6b L915B ldx $6b 915d: a5 0f lda polyobj_ypos_lo 915f: 49 ff eor #$ff 9161: 85 31 sta $31 9163: a5 10 lda INWK+4 9165: 20 bc 5f jsr MLTU2 9168: 85 33 sta $33 916a: a5 6c lda $6c 916c: 45 11 eor INWK+5 916e: a2 00 ldx #$00 9170: 20 c6 92 jsr L92C6 9173: 85 0e sta INWK+2 9175: a5 33 lda $33 9177: 85 0d sta INWK+1 9179: a5 32 lda $32 917b: 85 0c sta polyobj_xpos_lo 917d: a5 a9 L917D lda player_speed 917f: 85 ae sta $ae 9181: a9 80 lda #$80 9183: a2 06 ldx #$06 9185: 20 0a 92 jsr L920A 9188: a5 b8 lda $b8 918a: 29 81 and #$81 918c: c9 81 cmp #$81 918e: d0 01 bne L9191 9190: 60 rts 9191: a0 09 L9191 ldy #$09 9193: 20 5f 92 jsr L925F 9196: a0 0f ldy #$0f 9198: 20 5f 92 jsr L925F 919b: a0 15 ldy #$15 919d: 20 5f 92 jsr L925F 91a0: a5 2a lda polyobj_pitch 91a2: 29 80 and #$80 91a4: 85 c5 sta $c5 91a6: a5 2a lda polyobj_pitch 91a8: 29 7f and #$7f 91aa: f0 1d beq L91C9 91ac: c9 7f cmp #$7f 91ae: e9 00 sbc #$00 91b0: 05 c5 ora $c5 91b2: 85 2a sta polyobj_pitch 91b4: a2 0f ldx #$0f 91b6: a0 09 ldy #$09 91b8: 20 d4 53 jsr L53D4 91bb: a2 11 ldx #$11 91bd: a0 0b ldy #$0b 91bf: 20 d4 53 jsr L53D4 91c2: a2 13 ldx #$13 91c4: a0 0d ldy #$0d 91c6: 20 d4 53 jsr L53D4 91c9: a5 29 L91C9 lda polyobj_roll 91cb: 29 80 and #$80 91cd: 85 c5 sta $c5 91cf: a5 29 lda polyobj_roll 91d1: 29 7f and #$7f 91d3: f0 1d beq L91F2 91d5: c9 7f cmp #$7f 91d7: e9 00 sbc #$00 91d9: 05 c5 ora $c5 91db: 85 29 sta polyobj_roll 91dd: a2 0f ldx #$0f 91df: a0 15 ldy #$15 91e1: 20 d4 53 jsr L53D4 91e4: a2 11 ldx #$11 91e6: a0 17 ldy #$17 91e8: 20 d4 53 jsr L53D4 91eb: a2 13 ldx #$13 91ed: a0 19 ldy #$19 91ef: 20 d4 53 jsr L53D4 91f2: a5 2b L91F2 lda polyobj_vis 91f4: 29 a0 and #$a0 91f6: d0 09 bne L9201 91f8: a5 2b lda polyobj_vis 91fa: 09 10 ora #$10 91fc: 85 2b sta polyobj_vis 91fe: 4c 83 a2 jmp SCAN 9201: a5 2b L9201 lda polyobj_vis 9203: 29 ef and #$ef 9205: 85 2b sta polyobj_vis 9207: 60 rts 9208: 29 80 L9208 and #$80 920a: 0a L920A asl A 920b: 85 af sta $af 920d: a9 00 lda #$00 920f: 6a ror A 9210: 85 d0 sta $d0 9212: 46 af lsr $af 9214: 55 0e eor INWK+2,x 9216: 30 15 bmi L922D 9218: a5 ae lda $ae 921a: 75 0c adc polyobj_xpos_lo,x 921c: 95 0c sta polyobj_xpos_lo,x 921e: a5 af lda $af 9220: 75 0d adc INWK+1,x 9222: 95 0d sta INWK+1,x 9224: b5 0e lda INWK+2,x 9226: 69 00 adc #$00 9228: 05 d0 ora $d0 922a: 95 0e sta INWK+2,x 922c: 60 rts 922d: b5 0c L922D lda polyobj_xpos_lo,x 922f: 38 sec 9230: e5 ae sbc $ae 9232: 95 0c sta polyobj_xpos_lo,x 9234: b5 0d lda INWK+1,x 9236: e5 af sbc $af 9238: 95 0d sta INWK+1,x 923a: b5 0e lda INWK+2,x 923c: 29 7f and #$7f 923e: e9 00 sbc #$00 9240: 09 80 ora #$80 9242: 45 d0 eor $d0 9244: 95 0e sta INWK+2,x 9246: b0 16 bcs L925E 9248: a9 01 lda #$01 924a: f5 0c sbc polyobj_xpos_lo,x 924c: 95 0c sta polyobj_xpos_lo,x 924e: a9 00 lda #$00 9250: f5 0d sbc INWK+1,x 9252: 95 0d sta INWK+1,x 9254: a9 00 lda #$00 9256: f5 0e sbc INWK+2,x 9258: 29 7f and #$7f 925a: 05 d0 ora $d0 925c: 95 0e sta INWK+2,x 925e: 60 L925E rts 925f: a5 b9 L925F lda $b9 9261: 85 ad sta $ad 9263: b6 0e ldx INWK+2,y 9265: 86 ae stx $ae 9267: b6 0f ldx polyobj_ypos_lo,y 9269: 86 af stx $af 926b: b6 0c ldx polyobj_xpos_lo,y 926d: 86 31 stx $31 926f: b9 0d 00 lda INWK+1,y 9272: 49 80 eor #$80 9274: 20 65 60 jsr MAD 9277: 99 0f 00 sta polyobj_ypos_lo,y 927a: 96 0e stx INWK+2,y 927c: 86 31 stx $31 927e: b6 0c ldx polyobj_xpos_lo,y 9280: 86 ae stx $ae 9282: b6 0d ldx INWK+1,y 9284: 86 af stx $af 9286: b9 0f 00 lda polyobj_ypos_lo,y 9289: 20 65 60 jsr MAD 928c: 99 0d 00 sta INWK+1,y 928f: 96 0c stx polyobj_xpos_lo,y 9291: 86 31 stx $31 9293: a5 66 lda $66 9295: 85 ad sta $ad 9297: b6 0e ldx INWK+2,y 9299: 86 ae stx $ae 929b: b6 0f ldx polyobj_ypos_lo,y 929d: 86 af stx $af 929f: b6 10 ldx INWK+4,y 92a1: 86 31 stx $31 92a3: b9 11 00 lda INWK+5,y 92a6: 49 80 eor #$80 92a8: 20 65 60 jsr MAD 92ab: 99 0f 00 sta polyobj_ypos_lo,y 92ae: 96 0e stx INWK+2,y 92b0: 86 31 stx $31 92b2: b6 10 ldx INWK+4,y 92b4: 86 ae stx $ae 92b6: b6 11 ldx INWK+5,y 92b8: 86 af stx $af 92ba: b9 0f 00 lda polyobj_ypos_lo,y 92bd: 20 65 60 jsr MAD 92c0: 99 11 00 sta INWK+5,y 92c3: 96 10 stx INWK+4,y 92c5: 60 rts 92c6: a8 L92C6 tay 92c7: 55 0e eor INWK+2,x 92c9: 30 0f bmi L92DA 92cb: a5 32 lda $32 92cd: 18 clc 92ce: 75 0c adc polyobj_xpos_lo,x 92d0: 85 32 sta $32 92d2: a5 33 lda $33 92d4: 75 0d adc INWK+1,x 92d6: 85 33 sta $33 92d8: 98 tya 92d9: 60 rts 92da: b5 0c L92DA lda polyobj_xpos_lo,x 92dc: 38 sec 92dd: e5 32 sbc $32 92df: 85 32 sta $32 92e1: b5 0d lda INWK+1,x 92e3: e5 33 sbc $33 92e5: 85 33 sta $33 92e7: 90 04 bcc L92ED 92e9: 98 tya 92ea: 49 80 eor #$80 92ec: 60 rts 92ed: a9 01 L92ED lda #$01 92ef: e5 32 sbc $32 92f1: 85 32 sta $32 92f3: a9 00 lda #$00 92f5: e5 33 sbc $33 92f7: 85 33 sta $33 92f9: 98 tya 92fa: 60 rts 92fb: a5 b9 L92FB lda $b9 92fd: 49 80 eor #$80 92ff: 85 ad sta $ad 9301: a5 0c lda polyobj_xpos_lo 9303: 85 31 sta $31 9305: a5 0d lda INWK+1 9307: 85 32 sta $32 9309: a5 0e lda INWK+2 930b: 20 a2 5e jsr L5EA2 930e: a2 03 ldx #$03 9310: 20 78 53 jsr L5378 9313: a5 7b lda $7b 9315: 85 c7 sta $c7 9317: 85 31 sta $31 9319: a5 7c lda $7c 931b: 85 c8 sta $c8 931d: 85 32 sta $32 931f: a5 66 lda $66 9321: 85 ad sta $ad 9323: a5 7d lda $7d 9325: 85 c9 sta $c9 9327: 20 a2 5e jsr L5EA2 932a: a2 06 ldx #$06 932c: 20 78 53 jsr L5378 932f: a5 7b lda $7b 9331: 85 31 sta $31 9333: 85 12 sta polyobj_zpos_lo 9335: a5 7c lda $7c 9337: 85 32 sta $32 9339: 85 13 sta polyobj_zpos_mi 933b: a5 7d lda $7d 933d: 85 14 sta polyobj_zpos_hi 933f: 49 80 eor #$80 9341: 20 a2 5e jsr L5EA2 9344: a5 7d lda $7d 9346: 29 80 and #$80 9348: 85 d0 sta $d0 934a: 45 c9 eor $c9 934c: 30 18 bmi L9366 934e: a5 7a lda $7a 9350: 18 clc 9351: 65 c6 adc $c6 9353: a5 7b lda $7b 9355: 65 c7 adc $c7 9357: 85 0f sta polyobj_ypos_lo 9359: a5 7c lda $7c 935b: 65 c8 adc $c8 935d: 85 10 sta INWK+4 935f: a5 7d lda $7d 9361: 65 c9 adc $c9 9363: 4c 99 93 jmp L9399 9366: a5 7a L9366 lda $7a 9368: 38 sec 9369: e5 c6 sbc $c6 936b: a5 7b lda $7b 936d: e5 c7 sbc $c7 936f: 85 0f sta polyobj_ypos_lo 9371: a5 7c lda $7c 9373: e5 c8 sbc $c8 9375: 85 10 sta INWK+4 9377: a5 c9 lda $c9 9379: 29 7f and #$7f 937b: 85 31 sta $31 937d: a5 7d lda $7d 937f: 29 7f and #$7f 9381: e5 31 sbc $31 9383: 85 31 sta $31 9385: b0 12 bcs L9399 9387: a9 01 lda #$01 9389: e5 0f sbc polyobj_ypos_lo 938b: 85 0f sta polyobj_ypos_lo 938d: a9 00 lda #$00 938f: e5 10 sbc INWK+4 9391: 85 10 sta INWK+4 9393: a9 00 lda #$00 9395: e5 31 sbc $31 9397: 09 80 ora #$80 9399: 45 d0 L9399 eor $d0 939b: 85 11 sta INWK+5 939d: a5 b9 lda $b9 939f: 85 ad sta $ad 93a1: a5 0f lda polyobj_ypos_lo 93a3: 85 31 sta $31 93a5: a5 10 lda INWK+4 93a7: 85 32 sta $32 93a9: a5 11 lda INWK+5 93ab: 20 a2 5e jsr L5EA2 93ae: a2 00 ldx #$00 93b0: 20 78 53 jsr L5378 93b3: a5 7b lda $7b 93b5: 85 0c sta polyobj_xpos_lo 93b7: a5 7c lda $7c 93b9: 85 0d sta INWK+1 93bb: a5 7d lda $7d 93bd: 85 0e sta INWK+2 93bf: 4c 7d 91 jmp L917D 93c2: ae 72 02 L93C2 ldx PLAYER_STATE?+49 93c5: f0 33 beq L93FA 93c7: ca dex 93c8: d0 31 bne L93FB 93ca: a5 0e lda INWK+2 93cc: 49 80 eor #$80 93ce: 85 0e sta INWK+2 93d0: a5 14 lda polyobj_zpos_hi 93d2: 49 80 eor #$80 93d4: 85 14 sta polyobj_zpos_hi 93d6: a5 16 lda $16 93d8: 49 80 eor #$80 93da: 85 16 sta $16 93dc: a5 1a lda polyobj_mox2_hi 93de: 49 80 eor #$80 93e0: 85 1a sta polyobj_mox2_hi 93e2: a5 1c lda $1c 93e4: 49 80 eor #$80 93e6: 85 1c sta $1c 93e8: a5 20 lda $20 93ea: 49 80 eor #$80 93ec: 85 20 sta $20 93ee: a5 22 lda $22 93f0: 49 80 eor #$80 93f2: 85 22 sta $22 93f4: a5 26 lda $26 93f6: 49 80 eor #$80 93f8: 85 26 sta $26 93fa: 60 L93FA rts 93fb: a9 00 L93FB lda #$00 93fd: e0 02 cpx #$02 93ff: 6a ror A 9400: 85 c5 sta $c5 9402: 49 80 eor #$80 9404: 85 c4 sta $c4 9406: a5 0c lda polyobj_xpos_lo 9408: a6 12 ldx polyobj_zpos_lo 940a: 85 12 sta polyobj_zpos_lo 940c: 86 0c stx polyobj_xpos_lo 940e: a5 0d lda INWK+1 9410: a6 13 ldx polyobj_zpos_mi 9412: 85 13 sta polyobj_zpos_mi 9414: 86 0d stx INWK+1 9416: a5 0e lda INWK+2 9418: 45 c4 eor $c4 941a: aa tax 941b: a5 14 lda polyobj_zpos_hi 941d: 45 c5 eor $c5 941f: 85 0e sta INWK+2 9421: 86 14 stx polyobj_zpos_hi 9423: a0 09 ldy #$09 9425: 20 2f 94 jsr L942F 9428: a0 0f ldy #$0f 942a: 20 2f 94 jsr L942F 942d: a0 15 ldy #$15 942f: b9 0c 00 L942F lda polyobj_xpos_lo,y 9432: b6 10 ldx INWK+4,y 9434: 99 10 00 sta INWK+4,y 9437: 96 0c stx polyobj_xpos_lo,y 9439: b9 0d 00 lda INWK+1,y 943c: 45 c4 eor $c4 943e: aa tax 943f: b9 11 00 lda INWK+5,y 9442: 45 c5 eor $c5 9444: 99 0d 00 sta INWK+1,y 9447: 96 11 stx INWK+5,y 9449: 60 :Return rts 944a: 8e 72 02 L944A stx PLAYER_STATE?+49 944d: 20 b9 94 jsr PrintFlightHud? 9450: 20 7d 94 jsr L947D 9453: ad b9 02 lda have_energy_bomb 9456: 10 03 bpl L945B 9458: 20 ce 4a jsr DrawBombAnim 945b: 4c cd 73 L945B jmp L73CD NOTE: BBC .LOOK1 ; ; Set the view direction (forward/left/right/back). ; ; On entry: ; X-reg: direction (0=front, 1=rear, 2=left, 3=right) ; SetViewDirection 945e: a9 00 lda #$00 9460: a4 b3 ldy displayed_screen 9462: d0 e6 bne L944A 9464: ec 72 02 cpx PLAYER_STATE?+49 9467: f0 e0 beq :Return ;view unchanged 9469: 8e 72 02 stx PLAYER_STATE?+49 946c: 20 b9 94 jsr PrintFlightHud? 946f: 20 26 50 jsr L5026 9472: ad b9 02 lda have_energy_bomb 9475: 10 03 bpl L947A 9477: 20 ce 4a jsr DrawBombAnim 947a: 20 f3 73 L947A jsr L73F3 947d: ac 72 02 L947D ldy PLAYER_STATE?+49 9480: b9 9f 02 lda $029f,y 9483: f0 c4 beq :Return 9485: a0 00 ldy #$00 9487: c9 0f cmp #$0f 9489: f0 0b beq L9496 948b: c8 iny 948c: c9 8f cmp #$8f 948e: f0 06 beq L9496 9490: c8 iny 9491: c9 97 cmp #$97 9493: f0 01 beq L9496 9495: c8 iny 9496: b9 b1 94 L9496 lda L94B1,y 9499: 85 35 sta $35 949b: a9 80 lda #$80 949d: 85 a1 sta $a1 949f: a9 2c lda #$2c 94a1: 85 a2 sta $a2 94a3: a9 14 lda #$14 94a5: 85 a3 sta $a3 94a7: 20 42 66 jsr L6642 94aa: a9 0a lda #$0a 94ac: 85 a3 sta $a3 94ae: 4c 42 66 jmp L6642 94b1: 10 L94B1 .dd1 $10 94b2: 14 .dd1 $14 94b3: 0c .dd1 $0c 94b4: 0c .dd1 $0c 94b5: 04 .dd1 $04 94b6: 14 .dd1 $14 94b7: 08 .dd1 $08 94b8: 0c .dd1 $0c 94b9: 85 b3 PrintFlightHud? sta displayed_screen 94bb: 20 4b 4c L94BB jsr SetUcaseMask 94be: a9 00 lda #$00 94c0: 85 91 sta $91 94c2: a9 80 lda #$80 94c4: 85 37 sta text_mod_flags 94c6: 8d 28 55 sta txt_lcase_flag 94c9: a9 01 lda #$01 94cb: 85 34 sta text_hposn 94cd: 85 36 sta text_vposn 94cf: 20 97 a1 jsr LA197 94d2: a5 cd lda display_mode_flag 94d4: 30 03 bmi L94D9 94d6: 20 28 74 jsr L7428 94d9: a9 00 L94D9 lda #$00 94db: 8d 70 02 sta PLAYER_STATE?+47 94de: 8d 77 02 sta PLAYER_STATE?+54 94e1: 8d 78 02 sta $0278 94e4: a6 69 ldx $69 94e6: f0 03 beq L94EB 94e8: 20 03 6c jsr L6C03 94eb: a9 01 L94EB lda #$01 94ed: 85 36 sta text_vposn 94ef: a5 b3 lda displayed_screen 94f1: d0 14 bne L9507 94f3: a9 0b lda #11 94f5: 85 34 sta text_hposn 94f7: ad 72 02 lda PLAYER_STATE?+49 94fa: 09 60 ora #$60 ;"Front"/"Rear"/"Left"/"Right" 94fc: 20 44 71 jsr PrintFlightToken 94ff: 20 a1 6c jsr PrintSpace 9502: a9 af lda #$af ;"View" 9504: 20 44 71 jsr PrintFlightToken 9507: a2 01 L9507 ldx #$01 9509: 86 34 stx text_hposn 950b: 86 36 stx text_vposn 950d: ca dex 950e: 86 37 stx text_mod_flags ;flags=0 9510: 60 rts 9511: 60 L9511 rts 9512: a9 00 L9512 lda #$00 9514: 85 6a sta ecm_active_flag? 9516: 8d 6d 02 sta player_ecm_active? 9519: 4c 13 a0 jmp LA013 ; BBC .SFRMIS ; "Spawn missile with ai=#$FE max but no ecm" 951c: a2 01 LaunchMissile ldx #1 ;missile 951e: 20 9c 5c jsr LaunchObject 9521: 90 ee bcc L9511 9523: a9 78 lda #$78 ;"Incoming Missile" 9525: 20 05 85 jsr PrintMessageBriefly 9528: a0 32 ldy #$32 952a: 4c 58 95 jmp MakeNoise1? 952d: ad c1 02 CountKill lda kill_score_rem 9530: 18 clc 9531: 7d 5f a3 adc kill_score_lo-1,x 9534: 8d c1 02 sta kill_score_rem 9537: ad d6 02 lda kill_score 953a: 7d 7f a3 adc kill_score_hi-1,x 953d: 8d d6 02 sta kill_score 9540: 90 08 bcc :NoInc 9542: ee d7 02 inc kill_score+1 9545: a9 65 lda #$65 ;"Right On Commander!" 9547: 20 05 85 jsr PrintMessageBriefly ;(prints every 256 kill-scores) 954a: a0 37 :NoInc ldy #$37 954c: d0 23 bne L9571 954e: a0 0f L954E ldy #$0f 9550: d0 1f bne L9571 9552: a0 63 Noise1? ldy #$63 9554: a2 ff ldx #$ff 9556: d0 40 bne MakeNoise31? 9558: 2c 57 45 MakeNoise1? bit sound_disab_flag 955b: 30 50 bmi :Return 955d: ad 30 c0 L955D lda SPKR ;click 9560: 20 7c 7b jsr GetRandom 9563: ca L9563 dex 9564: ea nop 9565: ea nop 9566: d0 fb bne L9563 9568: 88 dey 9569: d0 f2 bne L955D 956b: ad 30 c0 lda SPKR 956e: 60 rts 956f: a0 28 MakeNoise2? ldy #$28 9571: 2c 57 45 L9571 bit sound_disab_flag 9574: 30 37 bmi :Return 9576: a2 32 ldx #$32 9578: 86 08 stx $08 957a: ad 30 c0 L957A lda SPKR 957d: e6 08 inc $08 957f: a6 08 ldx $08 9581: ca L9581 dex 9582: ea nop 9583: ea nop 9584: d0 fb bne L9581 9586: 20 7c 7b jsr GetRandom 9589: ca L9589 dex 958a: ea nop 958b: d0 fc bne L9589 958d: 88 dey 958e: d0 ea bne L957A 9590: ad 30 c0 lda SPKR 9593: 60 rts 9594: a0 1e MakeNoise3? ldy #$1e 9596: a2 6e ldx #$6e 9598: 2c 57 45 MakeNoise31? bit sound_disab_flag 959b: 30 10 bmi :Return 959d: 86 08 stx $08 959f: ad 30 c0 L959F lda SPKR 95a2: a6 08 ldx $08 95a4: ca L95A4 dex 95a5: d0 fd bne L95A4 95a7: 88 dey 95a8: d0 f5 bne L959F 95aa: ad 30 c0 lda SPKR 95ad: 60 :Return rts 95ae: 2c 57 45 MakeNoise4? bit sound_disab_flag 95b1: 30 fa bmi :Return 95b3: 86 08 stx $08 95b5: ad 30 c0 L95B5 lda SPKR 95b8: c6 08 dec $08 95ba: a6 08 ldx $08 95bc: ca L95BC dex 95bd: ea nop 95be: d0 fc bne L95BC 95c0: 88 dey 95c1: d0 f2 bne L95B5 95c3: ad 30 c0 lda SPKR 95c6: 60 rts 95c7: a0 0b MakeNoise5? ldy #$0b 95c9: a2 96 ldx #$96 95cb: 2c 57 45 bit sound_disab_flag 95ce: 30 dd bmi :Return 95d0: 86 08 stx $08 95d2: ad 30 c0 L95D2 lda SPKR 95d5: e6 08 inc $08 95d7: e6 08 inc $08 95d9: a6 08 ldx $08 95db: ca L95DB dex 95dc: d0 fd bne L95DB 95de: 88 dey 95df: d0 f1 bne L95D2 95e1: ad 30 c0 lda SPKR 95e4: 60 rts 95e5: a0 .dd1 $a0 95e6: 0b .dd1 $0b 95e7: a2 .dd1 $a2 95e8: 82 .dd1 $82 95e9: 2c 57 45 MakeNoise6? bit sound_disab_flag 95ec: 30 bf bmi :Return 95ee: a0 19 ldy #$19 95f0: ad 30 c0 L95F0 lda SPKR 95f3: 20 7c 7b jsr GetRandom 95f6: 29 1f and #$1f 95f8: 09 e0 ora #$e0 95fa: aa tax 95fb: ca L95FB dex 95fc: ea nop 95fd: d0 fc bne L95FB 95ff: 88 dey 9600: d0 ee bne L95F0 9602: ad 30 c0 lda SPKR 9605: 60 rts 9606: 2c 57 45 MakeNoise7? bit sound_disab_flag 9609: 30 03 bmi L960E 960b: ad 30 c0 lda SPKR 960e: 60 L960E rts ; ; Initialize some basic things: show the hi-res screen, zero out variable ; storage, etc. ; • Clear variables ]ptr .var $0a {addr/2} 960f: 20 e2 a2 InitSystem jsr ShowHiRes 9612: a9 08 lda #$08 ;set ptr to $800 9614: 85 0b sta ]ptr+1 9616: a2 02 ldx #$02 ;erase two pages ($800-9FF) 9618: a9 00 lda #$00 961a: 85 0a sta ]ptr 961c: a8 tay ;A/Y to zero 961d: 91 0a :Loop sta (]ptr),y 961f: c8 iny 9620: d0 fb bne :Loop 9622: e6 0b inc ]ptr+1 9624: ca dex 9625: d0 f6 bne :Loop 9627: 99 00 02 L9627 sta $0200,y ;clear $200-2ff 962a: 88 dey 962b: d0 fa bne L9627 962d: a9 41 lda #$41 ;set NMI vector for some reason 962f: 8d fc 03 sta NMIVEC+1 9632: a9 96 lda #$96 9634: 8d fd 03 sta NMIVEC+2 9637: a9 93 lda #$93 ;line ~18 9639: 85 36 sta text_vposn 963b: a9 a0 lda #$a0 963d: 85 37 sta text_mod_flags 963f: 78 sei ;disable interrupts 9640: 60 rts 9641: 58 .dd1 $58 9642: 40 .dd1 $40 NOTE: disk I/O routines 9643: 43 4f 4d 4d+ disk_filename .str ‘COMMANDER ’ 9661: ba DiskLoadGame tsx 9662: 8e 6b 0a stx rwts_saved_stack 9665: 20 13 97 jsr DiskFindFile 9668: a9 05 lda #$05 966a: b0 14 bcs :Return 966c: 20 dc 97 jsr DiskLoadTSList 966f: 20 04 98 jsr DiskReadSector 9672: a0 00 ldy #$00 ;copy data to scrambled-save area 9674: b9 04 08 :Loop lda data_buffer+4,y ;start at offset +4 to skip 'B' header 9677: 99 dc 0a sta scram_save_data,y 967a: c8 iny 967b: c0 6e cpy #$6e ;length of saved-game data 967d: d0 f5 bne :Loop 967f: 18 clc 9680: 60 :Return rts 9681: 20 9d 9b DiskSaveGame jsr ScrambleSaveData 9684: ba tsx 9685: 8e 6b 0a stx rwts_saved_stack 9688: 20 13 97 jsr DiskFindFile 968b: 90 73 bcc :FoundFile ; File doesn't exist, create it. 968d: 20 c4 97 jsr L97C4 9690: a9 02 lda #$02 9692: b0 ec bcs :Return 9694: 20 16 97 jsr DiskFindEmpty ;find an empty slot (returned in Y-reg) 9697: a9 03 lda #$03 9699: b0 e5 bcs :Return ;return with err 3 (cat full) if we failed 969b: ad 61 0a lda rwts_ts_track ;set track/sector for file T/S list 969e: 99 00 08 sta data_buffer,y 96a1: ad 62 0a lda rwts_ts_sector 96a4: 99 01 08 sta data_buffer+1,y 96a7: a9 04 lda #$04 ;type 'B' 96a9: 99 02 08 sta data_buffer+2,y 96ac: a9 02 lda #$02 ;length in sectors = $0002 96ae: 99 21 08 sta data_buffer+33,y 96b1: a9 00 lda #$00 96b3: 99 22 08 sta data_buffer+34,y 96b6: aa tax ;X-reg=0 96b7: bd 43 96 :Loop lda disk_filename,x ;copy filename 96ba: 09 80 ora #$80 ;set high ASCII 96bc: 99 03 08 sta data_buffer+3,y 96bf: c8 iny 96c0: e8 inx 96c1: e0 1e cpx #30 96c3: d0 f2 bne :Loop 96c5: 20 07 98 jsr DiskWriteSector ;write the catalog sector 96c8: 20 c4 97 jsr L97C4 96cb: 20 07 98 jsr DiskWriteSector 96ce: a9 00 lda #$00 96d0: a8 tay 96d1: 99 00 08 L96D1 sta data_buffer,y 96d4: c8 iny 96d5: d0 fa bne L96D1 96d7: ad 63 0a lda rwts_alloc_track 96da: 8d 0c 08 sta data_buffer+12 96dd: ad 64 0a lda rwts_alloc_sector 96e0: 8d 0d 08 sta data_buffer+13 96e3: ad 61 0a lda rwts_ts_track 96e6: 8d 5e 0a sta rwts_track 96e9: ad 62 0a lda rwts_ts_sector 96ec: 8d 5f 0a sta rwts_sector 96ef: 20 07 98 jsr DiskWriteSector 96f2: ad 63 0a lda rwts_alloc_track 96f5: 8d 5e 0a sta rwts_track 96f8: ad 64 0a lda rwts_alloc_sector 96fb: 8d 5f 0a sta rwts_sector 96fe: 10 03 bpl L9703 9700: 20 dc 97 :FoundFile jsr DiskLoadTSList 9703: a0 00 L9703 ldy #$00 9705: b9 dc 0a L9705 lda scram_save_data,y 9708: 99 04 08 sta data_buffer+4,y 970b: c8 iny 970c: c0 6e cpy #$6e 970e: d0 f5 bne L9705 9710: 4c 07 98 jmp DiskWriteSector ; ; Finds an entry with a matching filename in the disk catalog. ; • Clear variables ]max_tries .var $6e {addr/1} ]chksum .var $6f {addr/1} ]max_retry .var $70 {addr/1} 9713: 18 DiskFindFile clc 9714: 90 01 bcc :DiskFindCommon ; ; Finds the first empty or deleted slot in the catalog. ; 9716: 38 DiskFindEmpty sec 9717: 6e 6a 0a :DiskFindCommon ror rwts_find_slot_flag ;set high bit to carry flag 971a: 20 fa 97 jsr DiskReadVtoc ;load the VTOC 971d: ad 01 08 :GetCatSect lda data_buffer+1 ;T/S of first catalog sector 9720: 8d 5e 0a sta rwts_track 9723: ad 02 08 lda data_buffer+2 9726: 8d 5f 0a sta rwts_sector 9729: 20 04 98 jsr DiskReadSector ;read sector 972c: a0 0b ldy #11 ;first cat entry at +11 972e: b9 00 08 :CheckEntry lda data_buffer,y ;+0 is unused/deleted flag 9731: 2c 6a 0a bit rwts_find_slot_flag ;are we looking for an empty slot? 9734: 10 09 bpl :FindFile ;no, branch 9736: aa tax ;see if entry is unused 9737: f0 23 beq :Done ;yes, bail out 9739: c9 ff cmp #$ff ;deleted file? 973b: f0 1f beq :Done ;yes, bail out 973d: d0 21 bne :TryNext 973f: aa :FindFile tax ;empty slot? 9740: f0 2a beq :Fail ;yes, assume end of catalog 9742: c9 ff cmp #$ff ;deleted file? 9744: f0 1a beq :TryNext ;yes, try next slot 9746: 98 tya 9747: 48 pha ;save offset 9748: a2 00 ldx #$00 974a: b9 03 08 :StrCmp lda data_buffer+3,y ;filename starts at +3 974d: 29 7f and #$7f ;normalize high bit 974f: dd 43 96 cmp disk_filename,x ;compare to desired filename 9752: d0 0a bne :NoMatch 9754: c8 iny 9755: e8 inx 9756: e0 1e cpx #30 ;filenames are 30 chars long 9758: d0 f0 bne :StrCmp ;not done yet 975a: 68 pla ;success; restore slot offset 975b: a8 tay 975c: 18 :Done clc 975d: 60 rts 975e: 68 :NoMatch pla ;restore offset 975f: a8 tay 9760: 98 :TryNext tya 9761: 18 clc 9762: 69 23 adc #35 ;advance to next entry (35 bytes each) 9764: a8 tay 9765: d0 c7 bne :CheckEntry 9767: ad 01 08 lda data_buffer+1 ;is there another catalog sector? 976a: d0 b1 bne :GetCatSect ;yes, try that one 976c: 38 :Fail sec 976d: 60 rts ]sector .var $6e {addr/1} DiskAllocateSector 976e: a9 00 lda #$00 9770: 85 6e sta ]sector 9772: f0 03 beq L9777 ;(always) 9774: ad 31 08 L9774 lda data_buffer+49 ;+$31 direction of allocation 9777: 18 L9777 clc 9778: 6d 30 08 adc data_buffer+48 ;+$30 last track where sectors were allocated 977b: f0 09 beq L9786 977d: cd 34 08 cmp data_buffer+52 ;+$34 number of tracks per disk 9780: 90 12 bcc L9794 9782: a9 ff lda #$ff 9784: d0 08 bne L978E 9786: a5 6e L9786 lda ]sector 9788: d0 38 bne L97C2 978a: a9 01 lda #$01 978c: 85 6e sta ]sector 978e: 8d 31 08 L978E sta data_buffer+49 9791: 18 clc 9792: 69 11 adc #$11 9794: 8d 30 08 L9794 sta data_buffer+48 9797: 0a asl A 9798: 0a asl A 9799: a8 tay 979a: a2 10 ldx #$10 979c: b9 38 08 lda data_buffer+56,y ;+$38 volume bitmap 979f: d0 08 bne L97A9 97a1: c8 iny 97a2: a2 08 ldx #$08 97a4: b9 38 08 lda data_buffer+56,y 97a7: f0 cb beq L9774 97a9: 86 6e L97A9 stx ]sector 97ab: a2 00 ldx #$00 97ad: e8 L97AD inx 97ae: c6 6e dec ]sector 97b0: 2a rol A 97b1: 90 fa bcc L97AD 97b3: 18 clc 97b4: 6a L97B4 ror A 97b5: ca dex 97b6: d0 fc bne L97B4 97b8: 99 38 08 sta data_buffer+56,y 97bb: ae 30 08 ldx data_buffer+48 ;track 97be: a4 6e ldy ]sector ;sector 97c0: 18 clc 97c1: 60 rts 97c2: 38 L97C2 sec 97c3: 60 rts 97c4: 20 fa 97 L97C4 jsr DiskReadVtoc 97c7: 20 6e 97 jsr DiskAllocateSector 97ca: b0 0f bcs L97DB 97cc: 8e 61 0a stx rwts_ts_track 97cf: 8c 62 0a sty rwts_ts_sector 97d2: 20 6e 97 jsr DiskAllocateSector 97d5: 8e 63 0a stx rwts_alloc_track ;T/S list track/sector 97d8: 8c 64 0a sty rwts_alloc_sector 97db: 60 L97DB rts ; ; Load a file's T/S list into memory. ; ; On entry: ; data buffer holds the catalog sector ; Y-reg: offset to entry in catalog ; ; On exit: ; rwts_track: first entry from T/S list ; rwts_sector: first entry from T/S list ; Y-reg: $0C (offset of first entry) ; 97dc: b9 00 08 DiskLoadTSList lda data_buffer,y 97df: 8d 5e 0a sta rwts_track 97e2: b9 01 08 lda data_buffer+1,y 97e5: 8d 5f 0a sta rwts_sector 97e8: 20 04 98 jsr DiskReadSector ;read T/S list 97eb: a0 0c ldy #$0c ;offset of first entry in list 97ed: b9 00 08 lda data_buffer,y 97f0: 8d 5e 0a sta rwts_track 97f3: b9 01 08 lda data_buffer+1,y 97f6: 8d 5f 0a sta rwts_sector 97f9: 60 rts ; ; Read the disk VTOC. ; 97fa: a9 11 DiskReadVtoc lda #17 ;disk VTOC (T17 S0) 97fc: 8d 5e 0a sta rwts_track 97ff: a9 00 lda #0 9801: 8d 5f 0a sta rwts_sector ;fall through to read routine ; ; Reads the requested track/sector. ; ; Assumes slot 6 drive 1. ; ; On entry: ; rwts_track: track to read ; rwts_sector: sector to read ; 9804: 18 DiskReadSector clc ;C=0 -> read 9805: 90 01 bcc :RWCommon 9807: 38 DiskWriteSector sec ;C=1 -> write 9808: 08 :RWCommon php ;save flags for later 9809: a9 60 lda #$60 ;assume slot 6 980b: 8d 69 0a sta rwts_slot 980e: a9 02 lda #$02 9810: 8d 68 0a sta rwts_retry_1 9813: a9 04 lda #$04 9815: 8d 67 0a sta rwts_retry_2 9818: a9 d8 lda #$d8 981a: 8d 66 0a sta rwts_delay_ctr+1 981d: ae 69 0a ldx rwts_slot 9820: bd 8e c0 lda IWM_Q7_OFF,x ;configure read mode 9823: bd 8c c0 lda IWM_Q6_OFF,x 9826: a0 08 ldy #$08 ;repeat 8x 9828: bd 8c c0 :ChkChange lda IWM_Q6_OFF,x ;get pending byte 982b: 48 pha 982c: 68 pla 982d: 48 pha 982e: 68 pla 982f: cd 00 01 cmp BUFFER_0100 ;stall for 18 cycles 9832: dd 8c c0 cmp IWM_Q6_OFF,x ;has the data changed? 9835: d0 03 bne :DidChange ;yes, good to go 9837: 88 dey 9838: d0 ee bne :ChkChange ;try again 983a: 08 :DidChange php ;preserve Z flag 983b: bd 89 c0 lda IWM_MOTOR_ON,x ;start the disk spinning 983e: bd 8a c0 lda IWM_DRIVE_1,x ;select drive 1 9841: 28 plp ;restore Z flag 9842: 08 php 9843: d0 0b bne :DidChange2 9845: a0 07 ldy #$07 ;call delay function 7x 9847: 20 aa 9a :DelayLoop jsr DiskDelay ;first call delays by whatever is in A-reg 984a: 88 dey ;subsequent calls delay by A=0 (256 iterations) 984b: d0 fa bne :DelayLoop 984d: ae 69 0a ldx rwts_slot ;reload X-reg (trashed by delay func) 9850: ad 5e 0a :DidChange2 lda rwts_track 9853: 20 4c 9a jsr DiskSeekToTrack ;seek to target track 9856: 28 plp ;restore Z flag 9857: d0 14 bne :DidChange3 9859: ac 66 0a ldy rwts_delay_ctr+1 985c: 10 0f bpl :DidChange3 985e: a0 12 :Loop1 ldy #$12 ;let's wait some more 9860: 88 :Loop2 dey 9861: d0 fd bne :Loop2 9863: ee 65 0a inc rwts_delay_ctr 9866: d0 f6 bne :Loop1 9868: ee 66 0a inc rwts_delay_ctr+1 986b: d0 f1 bne :Loop1 986d: 28 :DidChange3 plp ;restore initial flags 986e: 08 php 986f: 90 03 bcc :ReadHeader 9871: 20 d5 9a jsr DiskEncode62 ;for writing, perform 6&2 encoding 9874: a0 30 :ReadHeader ldy #$30 9876: 84 70 sty ]max_retry 9878: ae 69 0a :ReadHdrLoop ldx rwts_slot 987b: 20 ee 99 jsr DiskReadNextAddr ;find the next address field 987e: 90 21 bcc :HdrOk 9880: c6 70 :TryNextSector dec ]max_retry 9882: 10 f4 bpl :ReadHdrLoop 9884: ce 68 0a :DecRetry1 dec rwts_retry_1 9887: f0 5d beq :Fail ; Something went wrong. Try to reset. 9889: a9 04 lda #$04 988b: 8d 67 0a sta rwts_retry_2 988e: a9 60 lda #$60 9890: 8d 60 0a sta rwts_current_track 9893: a9 00 lda #$00 ;seek to track 0 9895: 20 4c 9a jsr DiskSeekToTrack 9898: ad 5e 0a :SeekToTrack lda rwts_track ;seek to desired track 989b: 20 4c 9a jsr DiskSeekToTrack 989e: 4c 74 98 jmp :ReadHeader ;try again 98a1: ac 6e 0a :HdrOk ldy rwts_addr_track ;get the track we read from addr header 98a4: cc 5e 0a cpy rwts_track ;does it match where we think we are? 98a7: f0 19 beq :GoodTrack ;yes, branch 98a9: ce 67 0a dec rwts_retry_2 98ac: d0 ea bne :SeekToTrack 98ae: f0 d4 beq :DecRetry1 ;(always) 98b0: a9 01 10 34+ .junk 6 98b6: ae 6b 0a :ReturnErr ldx rwts_saved_stack 98b9: 9a txs 98ba: ae 69 0a ldx rwts_slot 98bd: bc 88 c0 ldy IWM_MOTOR_OFF,x ;turn drive off 98c0: 38 sec ;indicate error (code in A-reg) 98c1: 60 rts 98c2: ac 5f 0a :GoodTrack ldy rwts_sector ;get desired sector number 98c5: b9 23 9b lda rwts_sect_skew,y ;convert to physical 98c8: cd 6d 0a cmp rwts_addr_sect ;is this what we found? 98cb: d0 b3 bne :TryNextSector ;no, keep looking 98cd: 28 plp ;check status flags 98ce: b0 0d bcs :DoWrite ;C=1, writing 98d0: 20 f9 98 jsr DiskReadSectData ;C=0, reading 98d3: 08 php ;push flags -- WARNING a failed read will switch us 98d4: b0 aa bcs :TryNextSector ; to write mode! 98d6: 28 plp 98d7: 20 00 9b jsr DiskDecode62 98da: 4c ef 98 jmp :Done 98dd: 20 63 99 :DoWrite jsr DiskWriteSectData 98e0: 90 0d bcc :Done 98e2: a9 01 lda #$01 98e4: 10 d0 bpl :ReturnErr ;(always) 98e6: a9 04 :Fail lda #$04 98e8: ae 6b 0a ldx rwts_saved_stack 98eb: 9a txs 98ec: 38 sec 98ed: b0 03 bcs :MotorOff 98ef: a9 00 :Done lda #$00 98f1: 18 clc 98f2: ae 69 0a :MotorOff ldx rwts_slot 98f5: bc 88 c0 ldy IWM_MOTOR_OFF,x 98f8: 60 rts ; ; Reads the sector data header and contents. ; ; This appears to be identical to the DOS 3.3 READ routine ($B8DC). ; ; On entry: ; X-reg: slot * 16 ; ; On exit: ; C=0 on success, C=1 on failure ; ]bits .var $6e {addr/1} DiskReadSectData 98f9: a0 20 ldy #$20 98fb: 88 L98FB dey 98fc: f0 61 beq :Fail 98fe: bd 8c c0 :RdLoop lda IWM_Q6_OFF,x ;look for data prologue (D5 AA AD) 9901: 10 fb bpl :RdLoop 9903: 49 d5 L9903 eor #$d5 9905: d0 f4 bne L98FB 9907: ea nop 9908: bd 8c c0 :RdLoop lda IWM_Q6_OFF,x 990b: 10 fb bpl :RdLoop 990d: c9 aa cmp #$aa 990f: d0 f2 bne L9903 9911: a0 56 ldy #86 ;want 86 bytes of 2/2/2 data 9913: bd 8c c0 :RdLoop lda IWM_Q6_OFF,x 9916: 10 fb bpl :RdLoop 9918: c9 ad cmp #$ad 991a: d0 e7 bne L9903 ; Got the header, read the sector data. 991c: a9 00 lda #$00 991e: 88 :ReadTwosLoop dey 991f: 84 6e sty ]bits 9921: bc 8c c0 :RdLoop ldy IWM_Q6_OFF,x 9924: 10 fb bpl :RdLoop 9926: 59 9d 9a eor :TrackStep+2,y 9929: a4 6e ldy ]bits 992b: 99 00 0a sta L0A00,y 992e: d0 ee bne :ReadTwosLoop 9930: 84 6e :ReadSixesLoop sty ]bits ;want 256 bytes of 6-bit data 9932: bc 8c c0 :RdLoop ldy IWM_Q6_OFF,x 9935: 10 fb bpl :RdLoop 9937: 59 9d 9a eor rwts_decode62-150,y 993a: a4 6e ldy ]bits 993c: 99 00 09 sta $0900,y 993f: c8 iny 9940: d0 ee bne :ReadSixesLoop 9942: bc 8c c0 :RdLoop ldy IWM_Q6_OFF,x 9945: 10 fb bpl :RdLoop 9947: d9 9d 9a cmp rwts_decode62-150,y 994a: d0 13 bne :Fail 994c: bd 8c c0 :RdLoop lda IWM_Q6_OFF,x ;look for data epilogue (DE AA) 994f: 10 fb bpl :RdLoop 9951: c9 de cmp #$de 9953: d0 0a bne :Fail 9955: ea nop 9956: bd 8c c0 :RdLoop lda IWM_Q6_OFF,x 9959: 10 fb bpl :RdLoop 995b: c9 aa cmp #$aa 995d: f0 02 beq L9961 995f: 38 :Fail sec 9960: 60 rts 9961: 18 L9961 clc 9962: 60 rts ; ; Writes the sector data header and contents. This appears to be identical to ; the DOS 3.3 WRITE routine ($B82A). ; ; IMPORTANT: most of this code is timing-critical and must fit on a single page, ; because branching across a page boundary costs an extra cycle. ; ; On entry: ; X-reg: slot * 16 ; • Clear variables ]last_val .var $6e {addr/1} ]slot .var $6f {addr/1} DiskWriteSectData 9963: 38 sec ;set in case of write-protect failure 9964: 86 6f stx ]slot 9966: bd 8d c0 lda IWM_Q6_ON,x ;check write protect 9969: bd 8e c0 lda IWM_Q7_OFF,x 996c: 30 7c bmi :Done 996e: ad 00 0a lda L0A00 9971: 85 6e sta ]last_val 9973: a9 ff lda #$ff ;sync bytes 9975: 9d 8f c0 sta IWM_Q7_ON,x ;write first 9978: 1d 8c c0 ora IWM_Q6_OFF,x 997b: 48 pha 997c: 68 pla 997d: ea nop 997e: a0 04 ldy #$04 ;write 5 more 9980: 48 :Loop pha 9981: 68 pla 9982: 20 1a 9b jsr DiskWriteByte2 9985: 88 dey 9986: d0 f8 bne :Loop 9988: a9 d5 lda #$d5 ;write data prologue 998a: 20 19 9b jsr DiskWriteByte 998d: a9 aa lda #$aa 998f: 20 19 9b jsr DiskWriteByte 9992: a9 ad lda #$ad 9994: 20 19 9b jsr DiskWriteByte 9997: 98 tya 9998: a0 56 ldy #$56 999a: d0 03 bne :SkipFwd ;(always) 999c: b9 00 0a :Loop1 lda L0A00,y ;get data 999f: 59 ff 09 :SkipFwd eor L0A00-1,y ;exclusive-or with prev 99a2: aa tax 99a3: bd 03 45 lda rwts_encode62,x ;get 6&2 value 99a6: a6 6f ldx ]slot 99a8: 9d 8d c0 sta IWM_Q6_ON,x 99ab: bd 8c c0 lda IWM_Q6_OFF,x 99ae: 88 dey 99af: d0 eb bne :Loop1 99b1: a5 6e lda ]last_val 99b3: ea nop 99b4: 59 00 09 :Loop2 eor $0900,y 99b7: aa tax 99b8: bd 03 45 lda rwts_encode62,x 99bb: ae 69 0a ldx rwts_slot 99be: 9d 8d c0 sta IWM_Q6_ON,x 99c1: bd 8c c0 lda IWM_Q6_OFF,x 99c4: b9 00 09 lda $0900,y 99c7: c8 iny 99c8: d0 ea bne :Loop2 99ca: aa tax 99cb: bd 03 45 lda rwts_encode62,x ;get the last one 99ce: a6 6f ldx ]slot 99d0: 20 1c 9b jsr DiskWriteByte3 ;write it 99d3: a9 de lda #$de ;write the data epilogue 99d5: 20 19 9b jsr DiskWriteByte 99d8: a9 aa lda #$aa 99da: 20 19 9b jsr DiskWriteByte 99dd: a9 eb lda #$eb 99df: 20 19 9b jsr DiskWriteByte 99e2: a9 ff lda #$ff 99e4: 20 19 9b jsr DiskWriteByte 99e7: bd 8e c0 lda IWM_Q7_OFF,x ;turn off write mode 99ea: bd 8c c0 :Done lda IWM_Q6_OFF,x ;turn on read mode 99ed: 60 rts ; ; Reads the header from the next address field to pass by. ; ; Appears to be the same as the RDADR routine in DOS 3.3 ($B944). ; • Clear variables ]max_tries .var $6e {addr/1} ]chksum .var $6f {addr/1} DiskReadNextAddr 99ee: a0 fc ldy #$fc ;3 * 256 + 3 = 771 attempts 99f0: 84 6e sty ]max_tries 99f2: c8 :Retry iny 99f3: d0 04 bne :RdLoop 99f5: e6 6e inc ]max_tries 99f7: f0 51 beq :Fail 99f9: bd 8c c0 :RdLoop lda IWM_Q6_OFF,x ;read a byte 99fc: 10 fb bpl :RdLoop 99fe: c9 d5 :CheckD5 cmp #$d5 ;look for D5 AA 96 9a00: d0 f0 bne :Retry 9a02: ea nop 9a03: bd 8c c0 :RdLoop lda IWM_Q6_OFF,x ;got D5, look for AA 9a06: 10 fb bpl :RdLoop 9a08: c9 aa cmp #$aa 9a0a: d0 f2 bne :CheckD5 9a0c: a0 03 ldy #$03 ;set Y-reg=3 (read 4 bytes) 9a0e: bd 8c c0 :RdLoop lda IWM_Q6_OFF,x 9a11: 10 fb bpl :RdLoop 9a13: c9 96 cmp #$96 9a15: d0 e7 bne :CheckD5 ;note carry is set when byte matches 9a17: a9 00 lda #$00 ;init checksum 9a19: 85 6f :HdrFieldLoop sta ]chksum 9a1b: bd 8c c0 :RdLoop lda IWM_Q6_OFF,x ;read odd bits 9a1e: 10 fb bpl :RdLoop ;A-reg=1a1c1e1g 9a20: 2a rol A ;A-reg=a1c1e1g1 9a21: 85 6e sta ]max_tries ;re-use as temp var 9a23: bd 8c c0 :RdLoop lda IWM_Q6_OFF,x ;read even bits 9a26: 10 fb bpl :RdLoop ;A-reg=1b1d1f1h 9a28: 25 6e and ]max_tries ;merge: A-reg=abcdefgh 9a2a: 99 6c 0a sta rwts_addr_fields,y 9a2d: 45 6f eor ]chksum 9a2f: 88 dey 9a30: 10 e7 bpl :HdrFieldLoop 9a32: a8 tay 9a33: d0 15 bne :Fail 9a35: bd 8c c0 :RdLoop lda IWM_Q6_OFF,x ;look for epilogue DE AA 9a38: 10 fb bpl :RdLoop 9a3a: c9 de cmp #$de 9a3c: d0 0c bne :Fail 9a3e: ea nop 9a3f: bd 8c c0 :RdLoop lda IWM_Q6_OFF,x 9a42: 10 fb bpl :RdLoop 9a44: c9 aa cmp #$aa 9a46: d0 02 bne :Fail 9a48: 18 clc 9a49: 60 rts 9a4a: 38 :Fail sec 9a4b: 60 rts ; ; Seek to desired track. Essentially the same as SEEKABS in DOS 3.3 ($B9A0). ; ; On entry: ; A-reg: whole track number (0-34) ; X-reg: slot number * 16 ; ; • Clear variables ]slot .var $6e {addr/1} ]target_track .var $6f {addr/1} ]htrack_count .var $70 {addr/1} ]cur_track .var $71 {addr/1} 9a4c: 86 6e DiskSeekToTrack stx ]slot ;save slot index 9a4e: 0a asl A ;double track number (half-tracks) 9a4f: cd 60 0a cmp rwts_current_track ;already there? 9a52: f0 55 beq :Return ;yes, bail 9a54: 85 6f sta ]target_track 9a56: a9 00 lda #$00 9a58: 85 70 sta ]htrack_count ; Update the current track number to point to the next half-track. 9a5a: ad 60 0a :SeekLoop lda rwts_current_track 9a5d: 85 71 sta ]cur_track ;compute delta between current and target 9a5f: 38 sec 9a60: e5 6f sbc ]target_track 9a62: f0 33 beq :Finish ;we're there, finish up 9a64: b0 07 bcs :MovingIn ;current is larger, branch 9a66: 49 ff eor #$ff ;make positive; note we implicitly subtract 1 9a68: ee 60 0a inc rwts_current_track ;moving toward outside of disk 9a6b: 90 05 bcc :Cont ;(always) 9a6d: 69 fe :MovingIn adc #$fe ;carry is set, so this adds $FF (subtracts 1) 9a6f: ce 60 0a dec rwts_current_track 9a72: c5 70 :Cont cmp ]htrack_count 9a74: 90 02 bcc L9A78 9a76: a5 70 lda ]htrack_count 9a78: c9 0c L9A78 cmp #$0c ;after 12 iterations, don't update Y-reg 9a7a: b0 01 bcs :NoUpdateY 9a7c: a8 tay 9a7d: 38 :NoUpdateY sec 9a7e: 20 9b 9a jsr :TrackStep 9a81: b9 bd 9a lda seek_delay0,y 9a84: 20 aa 9a jsr DiskDelay ;pause to let head move 9a87: a5 71 lda ]cur_track ;previous track 9a89: 18 clc 9a8a: 20 9e 9a jsr :TrackStep2 ;move head, call with carry clear 9a8d: b9 c9 9a lda seek_delay1,y 9a90: 20 aa 9a jsr DiskDelay ;pause to let head move 9a93: e6 70 inc ]htrack_count 9a95: d0 c3 bne :SeekLoop ;(always) 9a97: 20 aa 9a :Finish jsr DiskDelay 9a9a: 18 clc ; Turn on the appropriate stepper motor. Phase is determined by the target ; track and the carry flag. 9a9b: ad 60 0a :TrackStep lda rwts_current_track 9a9e: 29 03 :TrackStep2 and #$03 9aa0: 2a rol A 9aa1: 05 6e ora ]slot 9aa3: aa tax 9aa4: bd 80 c0 lda IWM_PH0_OFF,x 9aa7: a6 6e ldx ]slot 9aa9: 60 :Return rts ; Arm move delay routine. Delays for the specified number of 100usec intervals ; (A-reg). ; ; Timing-critical, must not span a page boundary. 9aaa: a2 11 DiskDelay ldx #$11 9aac: ca :Loop1 dex 9aad: d0 fd bne :Loop1 9aaf: ee 65 0a inc rwts_delay_ctr 9ab2: d0 03 bne :Loop2 9ab4: ee 66 0a inc rwts_delay_ctr+1 9ab7: 38 :Loop2 sec 9ab8: e9 01 sbc #$01 9aba: d0 ee bne DiskDelay 9abc: 60 rts 9abd: 01 30 28 24+ seek_delay0 .bulk $01,$30,$28,$24,$20,$1e,$1d,$1c,$1c,$1c,$1c,$1c 9ac9: 70 2c 26 22+ seek_delay1 .bulk $70,$2c,$26,$22,$1f,$1e,$1d,$1c,$1c,$1c,$1c,$1c ; ; Encodes 256 bytes into 6&2 format. ; ; Same as DOS 3.3 PRENIBBLE routine ($B800). ; 9ad5: a2 00 DiskEncode62 ldx #$00 9ad7: a0 02 ldy #$02 9ad9: 88 :Loop dey 9ada: b9 00 08 lda data_buffer,y 9add: 4a lsr A 9ade: 3e 00 0a rol L0A00,x 9ae1: 4a lsr A 9ae2: 3e 00 0a rol L0A00,x 9ae5: 99 00 09 sta $0900,y 9ae8: e8 inx 9ae9: e0 56 cpx #$56 9aeb: 90 ec bcc :Loop 9aed: a2 00 ldx #$00 9aef: 98 tya 9af0: d0 e7 bne :Loop 9af2: a2 55 ldx #$55 9af4: bd 00 0a :Loop lda L0A00,x 9af7: 29 3f and #$3f 9af9: 9d 00 0a sta L0A00,x 9afc: ca dex 9afd: 10 f5 bpl :Loop 9aff: 60 rts ; ; Decodes 342 bytes of 6&2 data to 256 bytes. ; ; Same as DOS 3.3 POSTNIBBLE routine ($B8C2). ; 9b00: a0 00 DiskDecode62 ldy #$00 9b02: a2 56 :Loop1 ldx #$56 9b04: ca :Loop2 dex 9b05: 30 fb bmi :Loop1 9b07: b9 00 09 lda $0900,y ;raw data buffer 9b0a: 5e 00 0a lsr L0A00,x ;twos buffer 9b0d: 2a rol A 9b0e: 5e 00 0a lsr L0A00,x ;twos buffer 9b11: 2a rol A 9b12: 99 00 08 sta data_buffer,y ;cooked data buffer 9b15: c8 iny 9b16: d0 ec bne :Loop2 9b18: 60 rts 9b19: 18 DiskWriteByte clc 9b1a: 48 DiskWriteByte2 pha 9b1b: 68 pla 9b1c: 9d 8d c0 DiskWriteByte3 sta IWM_Q6_ON,x 9b1f: 1d 8c c0 ora IWM_Q6_OFF,x 9b22: 60 rts 9b23: 00 0d 0b 09+ rwts_sect_skew .bulk $00,$0d,$0b,$09,$07,$05,$03,$01,$0e,$0c,$0a,$08,$06,$04,$02,$0f 9b33: 00 01 98 99+ rwts_decode62 .bulk $00,$01,$98,$99,$02,$03,$9c,$04,$05,$06,$a0,$a1,$a2,$a3,$a4,$a5 + $07,$08,$a8,$a9,$aa,$09,$0a,$0b,$0c,$0d,$b0,$b1,$0e,$0f,$10,$11 + $12,$13,$b8,$14,$15,$16,$17,$18,$19,$1a,$c0,$c1,$c2,$c3,$c4,$c5 + $c6,$c7,$c8,$c9,$ca,$1b,$cc,$1c,$1d,$1e,$d0,$d1,$d2,$1f,$d4,$d5 + $20,$21,$d8,$22,$23,$24,$25,$26,$27,$28,$e0,$e1,$e2,$e3,$e4,$29 + $2a,$2b,$e8,$2c,$2d,$2e,$2f,$30,$31,$32,$f0,$f1,$33,$34,$35,$36 + $37,$38,$f8,$39,$3a,$3b,$3c,$3d,$3e,$3f ; ; Scrambles save-game data. Updates the RNG state and records it to the game ; file, then uses it to scramble the data. ; ScrambleSaveData 9b9d: ad d8 4d lda scramble_thing? 9ba0: 45 02 eor rng_state 9ba2: 85 02 sta rng_state 9ba4: 8d 46 0b sta scram_rng_seed 9ba7: 49 a5 eor #$a5 9ba9: 09 11 ora #$11 9bab: 45 03 eor rng_state+1 9bad: 85 03 sta rng_state+1 9baf: 8d 47 0b sta scram_rng_seed+1 9bb2: 45 04 eor rng_state+2 9bb4: 49 f8 eor #$f8 9bb6: 85 04 sta rng_state+2 9bb8: 8d 48 0b sta scram_rng_seed+2 9bbb: 45 05 eor rng_state+3 9bbd: 49 12 eor #$12 9bbf: 85 05 sta rng_state+3 9bc1: 8d 49 0b sta scram_rng_seed+3 9bc4: a0 69 DoScrambleSave ldy #$69 9bc6: 20 7b 7b L9BC6 jsr SaveScramble? 9bc9: 59 dc 0a eor scram_save_data,y 9bcc: 99 dc 0a sta scram_save_data,y 9bcf: 88 dey 9bd0: 10 f4 bpl L9BC6 9bd2: 60 rts UnscrambleSaveData 9bd3: a0 03 ldy #$03 9bd5: b9 46 0b L9BD5 lda scram_rng_seed,y ;restore the RNG seed 9bd8: 99 02 00 sta rng_state,y 9bdb: 88 dey 9bdc: 10 f7 bpl L9BD5 9bde: 30 e4 bmi DoScrambleSave ;twice to undo 9be0: 01 02 04 08+ hi_res_pixel .bulk $01,$02,$04,$08,$10,$20,$40 9be7: 83 86 8c 98+ hi_res_2pixel .bulk $83,$86,$8c,$98,$b0,$e0,$c0 9bee: 83 87 8f 9f+ rt_end_pixels .bulk $83,$87,$8f,$9f,$bf,$ff,$ff 9bf5: ff fe fc f8+ lf_end_pixels .bulk $ff,$fe,$fc,$f8,$f0,$e0,$c0 ; ; Low byte of the address of a row on the text screen. The high byte is ; computed directly. ; ; Values are offset by 2 because the text and hi-res text appear in the same ; places, and we need to leave room for the hi-res window frame.. ; 9bfc: 02 82 02 82+ text_addr_lo .bulk $02,$82,$02,$82,$02,$82,$02,$82,$2a,$aa,$2a,$aa,$2a,$aa,$2a,$aa + $52,$d2,$52,$d2,$52,$d2,$52,$d2 ; ; Hi-res row base address table. This only has the entries for every 8th line, ; because you can trivially add $400 for the next 7. ; 9c14: 00 80 00 80+ hires_line_lo .bulk $00,$80,$00,$80,$00,$80,$00,$80,$28,$a8,$28,$a8,$28,$a8,$28,$a8 + $50,$d0,$50,$d0,$50,$d0,$50,$d0 9c2c: 20 20 21 21+ hires_line_hi .bulk $20,$20,$21,$21,$22,$22,$23,$23,$20,$20,$21,$21,$22,$22,$23,$23 + $20,$20,$21,$21,$22,$22,$23,$23 9c44: 20 20 20 20+ .str ‘ ’ 9c4c: 3c 3c 3d 3d+ hires_line_hi2 .bulk $3c,$3c,$3d,$3d,$3e,$3e,$3f,$3f,$3c,$3c,$3d,$3d,$3e,$3e,$3f,$3f + $3c,$3c,$3d,$3d,$3e,$3e,$3f,$3f NOTE: line drawing code ; ; Draws a line. Pixels are XORed. The end coordinate is exclusive, to avoid a ; situation where we draw then erase every vertex with an even number of edges. ; ; On entry: ; $6e/6f: x0,y0 ; $70/71: x1,y1 ; ; On exit: ; Y-reg preserved ; • Clear variables ]row_div8 .var $06 {addr/1} ]row_mod8 .var $07 {addr/1} ]hptr .var $0a {addr/2} ]delta_x .var $31 {addr/1} ]x0 .var $6e {addr/1} ]y0 .var $6f {addr/1} ]x1 .var $70 {addr/1} ]y1 .var $71 {addr/1} ]delta_y .var $ad {addr/1} ]pixel_mask .var $ae {addr/1} ]err_term .var $af {addr/1} ]saved_y .var $b1 {addr/1} ]saved_x .var $d0 {addr/1} 9c64: 84 b1 DrawLine sty ]saved_y 9c66: a9 80 lda #$80 ;init line error to 1/2 9c68: 85 af sta ]err_term 9c6a: 0a asl A ;A-reg=0 and C=1 9c6b: 8d 7d 02 sta lcoord_swap_flag 9c6e: a5 70 lda ]x1 ;compute deltaX 9c70: e5 6e sbc ]x0 9c72: b0 05 bcs :PosX 9c74: 49 ff eor #$ff ;was < 0, negate 9c76: 69 01 adc #$01 9c78: 38 sec 9c79: 85 31 :PosX sta ]delta_x 9c7b: a5 71 lda ]y1 ;compute deltaY 9c7d: e5 6f sbc ]y0 9c7f: b0 04 bcs :PosY 9c81: 49 ff eor #$ff ;was < 0, negate 9c83: 69 01 adc #$01 9c85: 85 ad :PosY sta ]delta_y 9c87: c5 31 cmp ]delta_x ;mostly horizontal? 9c89: 90 03 bcc DrawLineHorizDom ;yes, branch 9c8b: 4c 8f 9d jmp DrawLineVertDom ; Draw a horizontally-dominant line. DrawLineHorizDom 9c8e: a6 6e ldx ]x0 ;is X0 on the left? 9c90: e4 70 cpx ]x1 9c92: 90 12 bcc :NoSwap ;yes, render as-is 9c94: ce 7d 02 dec lcoord_swap_flag ;set flag (to $FF) 9c97: a5 70 lda ]x1 ;swap X0,Y0 with X1,Y1 to ensure that we're 9c99: 85 6e sta ]x0 ; drawing from left to right 9c9b: 86 70 stx ]x1 9c9d: aa tax 9c9e: a5 71 lda ]y1 9ca0: a4 6f ldy ]y0 9ca2: 85 6f sta ]y0 9ca4: 84 71 sty ]y1 9ca6: a5 6f :NoSwap lda ]y0 ;divide Y0 by 8 9ca8: 4a lsr A 9ca9: 4a lsr A 9caa: 4a lsr A 9cab: 85 06 sta ]row_div8 9cad: a8 tay 9cae: b9 14 9c lda hires_line_lo,y ;look up base address, low byte 9cb1: 85 0a sta ]hptr ;set low byte of address 9cb3: a5 6f lda ]y0 ;get Y0 again 9cb5: 29 07 and #$07 ;compute Y0 mod 8 9cb7: 85 07 sta ]row_mod8 9cb9: 0a asl A ;multiply by 4 9cba: 0a asl A 9cbb: 79 2c 9c adc hires_line_hi,y ;add to the base address, high byte 9cbe: 85 0b sta ]hptr+1 ;set high byte of address 9cc0: bc 03 43 ldy mod7_table,x ;get X0 mod 7 (bit offset within byte) 9cc3: b9 e0 9b lda hi_res_pixel,y ;convert to pixel mask 9cc6: 85 ae sta ]pixel_mask 9cc8: bc 03 44 ldy div7_table,x ;get X0 divided by 7 (byte offset) 9ccb: a6 ad ldx ]delta_y ;check delta Y 9ccd: d0 03 bne :NotHoriz ;nonzero, so not a horizontal line 9ccf: 8a txa ;A-reg=0 9cd0: f0 1d beq :CheckDir ;(always) ; Compute error term adjustment (deltaX / deltaY). This takes about 35 cycles, ; but reduces the cost per pixel, making it a win for longer lines. ; ; For example, if deltaX=$0e and deltaY=$19, the result is $8e. This ; corresponds to 14/25=0.56. (255 * 0.56 = 142.8 = $8e). 9cd2: bd 03 41 :NotHoriz lda math_table2,x 9cd5: a6 31 ldx ]delta_x 9cd7: 38 sec 9cd8: fd 03 41 sbc math_table2,x 9cdb: a6 ad ldx ]delta_y 9cdd: bd 03 40 lda math_table1,x 9ce0: a6 31 ldx ]delta_x 9ce2: fd 03 40 sbc math_table1,x 9ce5: 90 04 bcc L9CEB 9ce7: a9 ff lda #$ff 9ce9: d0 04 bne :CheckDir ;(always) 9ceb: aa L9CEB tax 9cec: bd 03 42 lda math_table3,x ; Setup complete, draw lines moving up or down. (This is usually done with a ; simple bit of self-modifying code; here two separate routines are used.) 9cef: 85 ad :CheckDir sta ]delta_y ;set initial value 9cf1: 38 sec 9cf2: a6 31 ldx ]delta_x 9cf4: e8 inx 9cf5: a5 71 lda ]y1 9cf7: e5 6f sbc ]y0 ;is y1 > y0? (why not CMP?) 9cf9: b0 47 bcs :MoveDown ;yes, so we're moving downward 9cfb: ad 7d 02 lda lcoord_swap_flag ;are we starting at the end? 9cfe: d0 07 bne :SkipFirst ;yes, skip first pixel 9d00: ca dex ;DEX so we stop before the last pixel 9d01: a5 ae :UpLoop lda ]pixel_mask ;XOR pixel with screen value 9d03: 51 0a eor (]hptr),y 9d05: 91 0a sta (]hptr),y 9d07: 06 ae :SkipFirst asl ]pixel_mask ;moving right, so pixel value moves left 9d09: 10 05 bpl :SameByte ;didn't shift into high bit, branch 9d0b: a9 01 lda #$01 ;we hit $80, so start over at $01 9d0d: 85 ae sta ]pixel_mask 9d0f: c8 iny ;advance to next byte 9d10: a5 af :SameByte lda ]err_term ;update error term 9d12: 65 ad adc ]delta_y ;(carry cleared by pixel-mask ASL) 9d14: 85 af sta ]err_term 9d16: 90 0a bcc :SameLine ;didn't roll, still on same line 9d18: c6 07 dec ]row_mod8 ;decrement mod8 counter 9d1a: 30 0c bmi :UpdateAddr8 ;rolled, do bigger calculation 9d1c: a5 0b lda ]hptr+1 ;within a set of 8 lines we can just subtract 4 9d1e: e9 04 sbc #$04 ; from the high byte 9d20: 85 0b sta ]hptr+1 9d22: ca :SameLine dex ;done yet? 9d23: d0 dc bne :UpLoop ;no, keep going 9d25: a4 b1 ldy ]saved_y ;restore Y-reg 9d27: 60 rts 9d28: a9 07 :UpdateAddr8 lda #$07 ;reset the mod8 counter 9d2a: 85 07 sta ]row_mod8 9d2c: 86 d0 stx ]saved_x 9d2e: a6 06 ldx ]row_div8 ;advance the divided-by-8 row value 9d30: ca dex 9d31: 86 06 stx ]row_div8 9d33: bd 14 9c lda hires_line_lo,x ;get the address 9d36: 85 0a sta ]hptr 9d38: bd 4c 9c lda hires_line_hi2,x ;we're at an 8-line boundary, so no need to 9d3b: a6 d0 ldx ]saved_x ; add anything here 9d3d: 85 0b sta ]hptr+1 9d3f: 4c 22 9d jmp :SameLine ;back to it 9d42: a5 07 :MoveDown lda ]row_mod8 ;this acts as a counter, so the distance to the next 9d44: 49 07 eor #$07 ; 8-line boundary is (7 - row_mod8) 9d46: 85 07 sta ]row_mod8 ; which we can compute with a simple EOR ; (See :UpLoop -- this is the same code, just moving downward.) 9d48: ad 7d 02 lda lcoord_swap_flag 9d4b: f0 07 beq L9D54 9d4d: ca dex 9d4e: a5 ae :DnLoop lda ]pixel_mask 9d50: 51 0a eor (]hptr),y 9d52: 91 0a sta (]hptr),y 9d54: 06 ae L9D54 asl ]pixel_mask 9d56: 10 05 bpl L9D5D 9d58: a9 01 lda #$01 9d5a: 85 ae sta ]pixel_mask 9d5c: c8 iny 9d5d: a5 af L9D5D lda ]err_term 9d5f: 65 ad adc ]delta_y 9d61: 85 af sta ]err_term 9d63: 90 0a bcc L9D6F 9d65: c6 07 dec ]row_mod8 9d67: 30 0c bmi L9D75 9d69: a5 0b lda ]hptr+1 9d6b: 69 03 adc #$03 9d6d: 85 0b sta ]hptr+1 9d6f: ca L9D6F dex 9d70: d0 dc bne :DnLoop 9d72: a4 b1 ldy ]saved_y 9d74: 60 rts 9d75: a9 07 L9D75 lda #$07 9d77: 85 07 sta ]row_mod8 9d79: 86 d0 stx ]saved_x 9d7b: a6 06 ldx ]row_div8 9d7d: e8 inx 9d7e: 86 06 stx ]row_div8 9d80: bd 14 9c lda hires_line_lo,x 9d83: 85 0a sta ]hptr 9d85: bd 2c 9c lda hires_line_hi,x 9d88: 85 0b sta ]hptr+1 9d8a: a6 d0 ldx ]saved_x 9d8c: 4c 6f 9d jmp L9D6F ; Draw a vertically-dominant line. 9d8f: a4 6f DrawLineVertDom ldy ]y0 ;is Y0 on the bottom? 9d91: 98 tya 9d92: a6 6e ldx ]x0 9d94: c4 71 cpy ]y1 9d96: b0 11 bcs :NoSwap ;yes, render as-is 9d98: ce 7d 02 dec lcoord_swap_flag ;set flag (to $FF) 9d9b: a5 70 lda ]x1 ;swap X0,Y0 with X1,Y1 to ensure that we're 9d9d: 85 6e sta ]x0 ; drawing from bottom to top 9d9f: 86 70 stx ]x1 9da1: aa tax 9da2: a5 71 lda ]y1 9da4: 85 6f sta ]y0 9da6: 84 71 sty ]y1 9da8: a8 tay 9da9: 4a :NoSwap lsr A ;divide Y0 by 8 9daa: 4a lsr A 9dab: 4a lsr A 9dac: 85 06 sta ]row_div8 9dae: a8 tay 9daf: b9 14 9c lda hires_line_lo,y ;look up base address, low byte 9db2: 85 0a sta ]hptr ;set low byte of address 9db4: a5 6f lda ]y0 ;get Y0 again 9db6: 29 07 and #$07 ;compute Y0 mod 8 9db8: 85 07 sta ]row_mod8 9dba: 0a asl A ;multiply by 4 9dbb: 0a asl A 9dbc: 79 2c 9c adc hires_line_hi,y ;add to the base address, high byte 9dbf: 85 0b sta ]hptr+1 ;set high byte of address 9dc1: bc 03 43 ldy mod7_table,x ;get X0 mod 7 (bit offset within byte) 9dc4: b9 e0 9b lda hi_res_pixel,y ;convert to pixel mask 9dc7: 85 ae sta ]pixel_mask 9dc9: bc 03 44 ldy div7_table,x ;get X0 divided by 7 (byte offset) 9dcc: a6 31 ldx ]delta_x ;check delta X 9dce: f0 1f beq :IsVert ;it's zero, this is a vertical line ; Compute error term adjustment (deltaY / deltaX). Takes about 35 cycles. 9dd0: bd 03 41 lda math_table2,x 9dd3: a6 ad ldx ]delta_y 9dd5: 38 sec 9dd6: fd 03 41 sbc math_table2,x 9dd9: a6 31 ldx ]delta_x 9ddb: bd 03 40 lda math_table1,x 9dde: a6 ad ldx ]delta_y 9de0: fd 03 40 sbc math_table1,x 9de3: 90 04 bcc L9DE9 9de5: a9 ff lda #$ff 9de7: d0 04 bne L9DED 9de9: aa L9DE9 tax 9dea: bd 03 42 lda math_table3,x ; Setup complete, draw lines toward left or right. 9ded: 85 31 L9DED sta ]delta_x ;set initial value 9def: 38 :IsVert sec 9df0: a6 ad ldx ]delta_y 9df2: e8 inx 9df3: a5 70 lda ]x1 9df5: e5 6e sbc ]x0 ;is x1 < x0? 9df7: 90 49 bcc :RightToLeft ;yes, draw right to left 9df9: 18 clc 9dfa: ad 7d 02 lda lcoord_swap_flag ;are we starting at the end? 9dfd: f0 07 beq :SkipFirst ;yes, skip first pixel 9dff: ca dex ;DEX so we stop before the last pixel 9e00: a5 ae :RightLoop lda ]pixel_mask ;XOR pixel with screen value 9e02: 51 0a eor (]hptr),y 9e04: 91 0a sta (]hptr),y 9e06: c6 07 :SkipFirst dec ]row_mod8 ;decrement mod8 counter 9e08: 30 1e bmi L9E28 ;rolled, do bigger calculation 9e0a: a5 0b lda ]hptr+1 ;within a set of 8 lines we can just subtract 4 9e0c: e9 03 sbc #$03 ; from the high byte 9e0e: 85 0b sta ]hptr+1 ;(should've gone top-down; carry would be clear) 9e10: 18 clc 9e11: a5 af L9E11 lda ]err_term ;update error term 9e13: 65 31 adc ]delta_x 9e15: 85 af sta ]err_term 9e17: 90 09 bcc :SameCol ;didn't roll, still in same pixel column 9e19: 06 ae asl ]pixel_mask ;moving right, so shift left 9e1b: 10 05 bpl :SameCol ;still in same byte, branch 9e1d: a9 01 lda #$01 ;new byte, reset pixel mask 9e1f: 85 ae sta ]pixel_mask 9e21: c8 iny ;and advance to next byte 9e22: ca :SameCol dex ;done yet? 9e23: d0 db bne :RightLoop ;no, keep going 9e25: a4 b1 ldy ]saved_y ;restore Y-reg 9e27: 60 rts 9e28: a9 07 L9E28 lda #$07 9e2a: 85 07 sta ]row_mod8 9e2c: 86 d0 stx ]saved_x 9e2e: a6 06 ldx ]row_div8 9e30: ca dex 9e31: 86 06 stx ]row_div8 9e33: bd 14 9c lda hires_line_lo,x 9e36: 85 0a sta ]hptr 9e38: bd 4c 9c lda hires_line_hi2,x 9e3b: a6 d0 ldx ]saved_x 9e3d: 85 0b sta ]hptr+1 9e3f: 4c 11 9e jmp L9E11 9e42: ad 7d 02 :RightToLeft lda lcoord_swap_flag 9e45: f0 07 beq L9E4E 9e47: ca dex 9e48: a5 ae :LeftLoop lda ]pixel_mask 9e4a: 51 0a eor (]hptr),y 9e4c: 91 0a sta (]hptr),y 9e4e: c6 07 L9E4E dec ]row_mod8 9e50: 30 1f bmi L9E71 9e52: a5 0b lda ]hptr+1 9e54: e9 03 sbc #$03 9e56: 85 0b sta ]hptr+1 9e58: 18 clc 9e59: a5 af L9E59 lda ]err_term 9e5b: 65 31 adc ]delta_x 9e5d: 85 af sta ]err_term 9e5f: 90 0a bcc L9E6B 9e61: 46 ae lsr ]pixel_mask ;moving left, shift right 9e63: 90 06 bcc L9E6B ;didn't shift mask into carry, still good 9e65: a9 40 lda #$40 9e67: 85 ae sta ]pixel_mask 9e69: 88 dey 9e6a: 18 clc 9e6b: ca L9E6B dex 9e6c: d0 da bne :LeftLoop 9e6e: a4 b1 ldy ]saved_y 9e70: 60 :Return rts 9e71: a9 07 L9E71 lda #$07 9e73: 85 07 sta ]row_mod8 9e75: 86 d0 stx ]saved_x 9e77: a6 06 ldx ]row_div8 9e79: ca dex 9e7a: 86 06 stx ]row_div8 9e7c: bd 14 9c lda hires_line_lo,x 9e7f: 85 0a sta ]hptr 9e81: bd 4c 9c lda hires_line_hi2,x 9e84: a6 d0 ldx ]saved_x 9e86: 85 0b sta ]hptr+1 9e88: 4c 59 9e jmp L9E59 DrawDoubleHorizLine 9e8b: 20 8e 9e jsr :DrawDoubleInc ;draw a line then fall through to draw another 9e8e: e6 6f :DrawDoubleInc inc ]y0 NOTE: color horiz/vert line functions ; ; Draws a horizontal line in color. ; ; As with the other line drawing routines, the end point is exclusive (last ; point not plotted). ; ; On entry: ; $35: color index ($00-18, even values only) ; $6e: x0 ; $6f: y0 ; $70: x1 ; ; On exit: ; Y-reg preserved ; • Clear variables ]color0 .var $06 {addr/1} ]color1 .var $07 {addr/1} ]pixel_tmp .var $09 {addr/1} ]hptr .var $0a {addr/2} ]color_index .var $35 {addr/1} ]x0 .var $6e {addr/1} ]y0 .var $6f {addr/1} ]x1 .var $70 {addr/1} ]byte_count .var $ae {addr/1} ]saved_y .var $b1 {addr/1} 9e90: 84 b1 DrawHorizLine sty ]saved_y ;preserve Y-reg 9e92: a5 6e lda ]x0 ;strip low bit from X0 9e94: 29 fe and #$fe 9e96: 85 6e sta ]x0 9e98: aa tax ;hold X0 in X-reg 9e99: a5 70 lda ]x1 ;strip low bit from X1 9e9b: 29 fe and #$fe 9e9d: 85 70 sta ]x1 9e9f: c5 6e cmp ]x0 ;is x1 > x0? 9ea1: f0 cd beq :Return ;actually, x1==x0, nothing to do 9ea3: b0 03 bcs L9EA8 ;yes, so we're moving left to right; branch 9ea5: 86 70 stx ]x1 ;swap X0 with X1 9ea7: aa tax ;get X0 (was X1) in X-reg 9ea8: a5 6f L9EA8 lda ]y0 ;get row 9eaa: 4a lsr A ;divide by 8 9eab: 4a lsr A 9eac: 4a lsr A 9ead: a8 tay 9eae: b9 14 9c lda hires_line_lo,y ;base address for 8-line section 9eb1: 85 0a sta ]hptr ;save low byte 9eb3: a5 6f lda ]y0 ;compute Y-coord mod 8 9eb5: 29 07 and #$07 9eb7: 0a asl A ;multiply by 4 9eb8: 0a asl A 9eb9: 79 2c 9c adc hires_line_hi,y ;compute hi-res address, high byte 9ebc: 85 0b sta ]hptr+1 9ebe: bd 03 44 lda div7_table,x ;compute X coord / 7 9ec1: 29 01 and #$01 ;mask off all but low bit for odd/even 9ec3: 05 35 ora ]color_index ;merge with color index 9ec5: a8 tay 9ec6: b9 46 9f lda color_masks,y ;get color pixel masks 9ec9: 85 06 sta ]color0 9ecb: b9 47 9f lda color_masks+1,y 9ece: 85 07 sta ]color1 9ed0: a4 70 ldy ]x1 ;get end coordinate 9ed2: b9 01 44 lda div7_table-2,y ;compute (X1 - 2) / 7 (we don't plot last point) 9ed5: bc 03 43 ldy mod7_table,x ;compute X0 mod 7 9ed8: 38 sec 9ed9: fd 03 44 sbc div7_table,x ;(X1 - 2) / 7 - (X0 / 7) 9edc: 85 ae sta ]byte_count ;this is number of bytes we will update 9ede: b9 f5 9b lda lf_end_pixels,y ;get pixels for start of line 9ee1: 25 06 and ]color0 ;apply color mask 9ee3: bc 03 44 ldy div7_table,x ;get byte offset (X0 / 7) 9ee6: a6 ae ldx ]byte_count ;check if line fits in single byte 9ee8: f0 55 beq :SwapColor ;it does, swap the color and jump to end-of-line 9eea: 85 09 sta ]pixel_tmp 9eec: b1 0a lda (]hptr),y ;blend with screen contents 9eee: 29 7f and #$7f ;but don't touch the high bit 9ef0: 45 09 eor ]pixel_tmp 9ef2: 91 0a sta (]hptr),y 9ef4: c8 iny ;advance to next byte 9ef5: ca dex ;decrement counter 9ef6: f0 18 beq :EndOfLine ;if zero, go handle the rightmost byte ; Do the "middle" bytes. The color alternates, so we do two at a time. 9ef8: b1 0a :WholeByteLoop lda (]hptr),y 9efa: 29 7f and #$7f 9efc: 45 07 eor ]color1 9efe: 91 0a sta (]hptr),y 9f00: c8 iny 9f01: ca dex ;done? 9f02: f0 39 beq :FinishWith0 ;yes; use color0 for end 9f04: b1 0a lda (]hptr),y 9f06: 29 7f and #$7f 9f08: 45 06 eor ]color0 9f0a: 91 0a sta (]hptr),y 9f0c: c8 iny 9f0d: ca dex ;done? 9f0e: d0 e8 bne :WholeByteLoop ;not yet 9f10: a5 07 :EndOfLine lda ]color1 ;use color1 for end 9f12: a6 70 :EndOfLine1 ldx ]x1 9f14: bc 01 43 ldy mod7_table-2,x ;get bit column for last pixel (-2 because we don't 9f17: c0 06 cpy #$06 ; plot the last pixel, and color pixels are 2 bits) 9f19: 39 ee 9b and rt_end_pixels,y ;merge pixels with right-end mask 9f1c: bc 01 44 ldy div7_table-2,x ;get byte position for last pixel 9f1f: 85 09 sta ]pixel_tmp 9f21: b1 0a lda (]hptr),y ;blend with screen contents 9f23: 29 7f and #$7f 9f25: 45 09 eor ]pixel_tmp 9f27: 91 0a sta (]hptr),y 9f29: 90 0f bcc :Done ;if not in pixel column 6, we're done 9f2b: a9 81 lda #$81 ;need to update the first pixel in the next byte 9f2d: 25 06 and ]color0 ; mask the color 9f2f: c8 iny 9f30: 85 09 sta ]pixel_tmp 9f32: b1 0a lda (]hptr),y ;blend with screen contents 9f34: 29 7f and #$7f 9f36: 45 09 eor ]pixel_tmp 9f38: 91 0a sta (]hptr),y 9f3a: a4 b1 :Done ldy ]saved_y 9f3c: 60 rts 9f3d: a5 06 :FinishWith0 lda ]color0 9f3f: a6 07 :SwapColor ldx ]color1 9f41: 86 06 stx ]color0 9f43: 4c 12 9f jmp :EndOfLine1 9f46: 00 00 color_masks .bulk $00,$00 9f48: 00 00 .bulk $00,$00 9f4a: 55 2a .bulk $55,$2a 9f4c: 55 00 .bulk $55,$00 9f4e: 2a 55 .bulk $2a,$55 9f50: 2a 00 .bulk $2a,$00 9f52: 7f 7f .bulk $7f,$7f 9f54: 7f 00 .bulk $7f,$00 9f56: d5 aa .bulk $d5,$aa 9f58: d5 00 .bulk $d5,$00 9f5a: aa d5 .bulk $aa,$d5 9f5c: aa 00 .bulk $aa,$00 9f5e: aa aa .bulk $aa,$aa 9f60: aa 00 .bulk $aa,$00 ; ; Draws a vertical line, in color. ; ; On entry: ; $6e: x0 ; $6f: y0 ; $71: y1 ; ; On exit: ; Y-reg preserved ; ]row_div8 .var $06 {addr/1} ]row_mod8 .var $07 {addr/1} ]pixel_mask1 .var $08 {addr/1} ]y1 .var $71 {addr/1} ]pixel_mask0 .var $ae {addr/1} ]saved_x .var $d0 {addr/1} DrawVerticalLine 9f62: 84 b1 sty ]saved_y ;preserve Y 9f64: a5 6f lda ]y0 9f66: c5 71 cmp ]y1 ;y0 >= y1? 9f68: b0 05 bcs :NoSwap ;yes, branch 9f6a: a4 71 ldy ]y1 ;no, swap 9f6c: 85 71 sta ]y1 9f6e: 98 tya 9f6f: a6 6e :NoSwap ldx ]x0 9f71: 20 bb 9f jsr DrawColorPixel ;draw pixel at X0,Y0 9f74: a5 6f lda ]y0 ;compute deltaY 9f76: 38 sec 9f77: e5 71 sbc ]y1 9f79: f0 23 beq :Done 9f7b: aa tax 9f7c: e8 inx 9f7d: 4c 90 9f jmp :NextLine ; Continue drawing the line, using the pixel masks set up for the first pixel. 9f80: a5 ae :DrawLoop lda ]pixel_mask0 ;blend first byte 9f82: 51 0a eor (]hptr),y 9f84: 91 0a sta (]hptr),y 9f86: a5 08 lda ]pixel_mask1 ;do we straddle the byte boundary? 9f88: f0 06 beq :NextLine ;no, skip 2nd byte 9f8a: c8 iny ;advance to next byte column 9f8b: 51 0a eor (]hptr),y ;blend 9f8d: 91 0a sta (]hptr),y 9f8f: 88 dey ;back up 9f90: c6 07 :NextLine dec ]row_mod8 ;decrement local 8 count 9f92: 30 0d bmi :Recalc8 ;rolled, recompute 9f94: a5 0b lda ]hptr+1 ;update row address by simply subtracting 9f96: 38 sec ; four from the high byte 9f97: e9 04 sbc #$04 9f99: 85 0b sta ]hptr+1 9f9b: ca :Cont dex ;decrement count 9f9c: d0 e2 bne :DrawLoop 9f9e: a4 b1 :Done ldy ]saved_y 9fa0: 60 rts 9fa1: a9 07 :Recalc8 lda #$07 ;reset local 8 count 9fa3: 85 07 sta ]row_mod8 9fa5: 86 d0 stx ]saved_x ;preserve X-reg 9fa7: a6 06 ldx ]row_div8 ;update 8-line section index 9fa9: ca dex 9faa: 86 06 stx ]row_div8 9fac: bd 14 9c lda hires_line_lo,x ;compute new row address 9faf: 85 0a sta ]hptr 9fb1: bd 4c 9c lda hires_line_hi2,x 9fb4: a6 d0 ldx ]saved_x 9fb6: 85 0b sta ]hptr+1 9fb8: 4c 9b 9f jmp :Cont ; ; Draws a color (two-bit) pixel. ; ; On entry: ; X-reg: x0 ; A-reg: y0 ; ; On exit: ; $ae: pixel mask 0 ; $08: pixel mask 1 ; 9fbb: 85 6f DrawColorPixel sta ]y0 ;divide y0 by 8 9fbd: 4a lsr A 9fbe: 4a lsr A 9fbf: 4a lsr A 9fc0: 85 06 sta ]row_div8 9fc2: a8 tay 9fc3: b9 14 9c lda hires_line_lo,y ;set hi-res address, low byte 9fc6: 85 0a sta ]hptr 9fc8: a5 6f lda ]y0 ;compute y0 mod 8 9fca: 29 07 and #$07 9fcc: 85 07 sta ]row_mod8 9fce: 0a asl A ;multiply by 4 9fcf: 0a asl A 9fd0: 79 2c 9c adc hires_line_hi,y ;compute hi-res address, high byte 9fd3: 85 0b sta ]hptr+1 9fd5: bc 03 43 ldy mod7_table,x ;compute x0 mod 7 9fd8: a9 00 lda #$00 ;init mask to zero 9fda: c0 06 cpy #$06 ;at right edge of byte (2-pixel straddles bytes)? 9fdc: d0 02 bne L9FE0 ;no 9fde: a9 81 lda #$81 ;yes, use nonzero mask 9fe0: 85 08 L9FE0 sta ]pixel_mask1 9fe2: b9 e7 9b lda hi_res_2pixel,y ;get two-pixel pattern for this offset 9fe5: 85 ae sta ]pixel_mask0 9fe7: bd 03 44 lda div7_table,x ;compute X0 / 7 9fea: 29 01 and #$01 ;get odd/even bit 9fec: 05 35 ora ]color_index ;merge with color index 9fee: a8 tay 9fef: b9 47 9f lda color_masks+1,y ;get the color mask for the second byte 9ff2: 25 08 and ]pixel_mask1 ;and it with the mask (so we keep either the leftmost 9ff4: 85 08 sta ]pixel_mask1 ; pixel, or no pixels) 9ff6: b9 46 9f lda color_masks,y ;get color mask for first byte 9ff9: 25 ae and ]pixel_mask0 ;merge with two-pixel mask 9ffb: 85 ae sta ]pixel_mask0 9ffd: bc 03 44 ldy div7_table,x ;compute X0 / 7 (byte column) a000: 51 0a eor (]hptr),y ;blend with screen contents a002: 91 0a sta (]hptr),y a004: a5 08 lda ]pixel_mask1 ;do we need to do the second byte? a006: f0 06 beq :Done ;no a008: c8 iny ;yes, advance to next byte a009: 51 0a eor (]hptr),y ; and blend with screen contents a00b: 91 0a sta (]hptr),y a00d: 88 dey a00e: 60 :Done rts a00f: a9 20 ActivateEcm lda #$20 a011: 85 6a sta ecm_active_flag? a013: a9 2a LA013 lda #$2a a015: a2 38 ldx #$38 a017: d0 04 bne LA01D a019: a9 2d LA019 lda #$2d a01b: a2 c0 ldx #$c0 a01d: 85 31 LA01D sta $31 a01f: a9 a0 lda #$a0 a021: 85 32 sta $32 a023: a9 16 lda #$16 a025: 85 36 sta text_vposn a027: 4c 4c a1 jmp LA14C a02a: 7f 7f 07 7f+ .junk 11 a035: 98 DrawIndicator? tya a036: 48 pha a037: 20 3e a0 jsr LA03E a03a: 68 pla a03b: 9d 51 45 sta color_indices,x a03e: bd 51 45 LA03E lda color_indices,x a041: f0 39 beq LA07C a043: 85 35 sta ]color_index a045: bd 60 a0 lda hud_xcoords-1,x a048: 85 6e sta ]x0 a04a: 18 clc a04b: 69 06 adc #$06 a04d: 85 70 sta ]x1 a04f: 8a txa a050: 48 pha a051: a9 b8 lda #184 a053: 85 6f sta ]y0 a055: 20 8b 9e jsr DrawDoubleHorizLine ;draw 4 lines total a058: 20 8b 9e jsr DrawDoubleHorizLine a05b: 68 pla a05c: aa tax a05d: 98 tya a05e: a0 00 ldy #$00 a060: 60 rts a061: 28 20 18 10+ hud_xcoords .bulk $28,$20,$18,$10,$20,$ff,$ff,$c9,$80,$90,$04,$a9,$07,$18,$60,$c9 + $20,$b0,$08,$c9,$0d,$f0,$04,$c9,$15,$d0,$f0 a07c: 18 LA07C clc a07d: 60 rts a07e: 48 Delay pha a07f: 8a txa a080: 48 pha a081: 98 tya a082: 48 pha a083: a0 0f ldy #$0f a085: a2 00 ldx #$00 a087: ca LA087 dex a088: d0 fd bne LA087 a08a: 88 dey a08b: d0 fa bne LA087 a08d: 68 pla a08e: a8 tay a08f: 68 pla a090: aa tax a091: 68 pla a092: 60 rts NOTE: text screen and HRCG output functions a093: c9 7b Unref1? cmp #$7b a095: b0 0d bcs LA0A4 a097: c9 0d cmp #$0d a099: 90 09 bcc LA0A4 a09b: d0 49 bne OutputChar a09d: a9 0c lda #$0c a09f: 20 e6 a0 jsr OutputChar a0a2: a9 0d lda #$0d a0a4: 18 LA0A4 clc a0a5: 60 rts a0a6: 20 94 95 CtrlGBeep jsr MakeNoise3? a0a9: 4c 32 a1 jmp LA132 a0ac: 24 cd LA0AC bit display_mode_flag a0ae: 10 08 bpl LA0B8 a0b0: 20 a9 a1 jsr ClearTextScreen a0b3: a5 38 lda $38 a0b5: 4c f4 a0 jmp LA0F4 a0b8: 20 e3 a1 LA0B8 jsr ClearViewportArea a0bb: a5 38 lda $38 a0bd: 4c f4 a0 jmp LA0F4 ; ; Print a char to the text screen. ; ; The sloppy upper-case conversion screws up text entry, e.g. if you type ; "[]<del>" for the commander name it comes out ";=_". ; a0c0: 2c 5f 45 PrintTextChar bit ptb_lower_case ;lower-case mode enabled? a0c3: 30 06 bmi :LowerOkay ;yes, it's fine a0c5: c9 5b cmp #‘[’ ;is it lower case letter (or [\]^_)? a0c7: 90 02 bcc :LowerOkay ;no, leave it a0c9: e9 20 sbc #$20 ;yes, convert to upper case a0cb: 09 80 :LowerOkay ora #$80 a0cd: 48 pha a0ce: b9 fc 9b lda text_addr_lo,y a0d1: 85 0a sta ]hptr a0d3: 98 tya a0d4: 29 07 and #$07 ;compute the high byte a0d6: 4a lsr A a0d7: 18 clc a0d8: 69 04 adc #$04 a0da: 85 0b sta ]hptr+1 a0dc: 8a txa a0dd: a8 tay a0de: 68 pla a0df: 91 0a sta (]hptr),y a0e1: 4c 30 a1 jmp LA130 a0e4: a9 0c OutputFF lda #$0c a0e6: 85 38 OutputChar sta $38 a0e8: 8c 86 02 sty $0286 a0eb: 8e 85 02 stx $0285 a0ee: a4 37 ldy text_mod_flags a0f0: c0 ff cpy #$ff a0f2: f0 3e beq LA132 a0f4: c9 07 LA0F4 cmp #$07 ;Ctrl+G? a0f6: f0 ae beq CtrlGBeep ;yes, beep a0f8: c9 20 cmp #$20 a0fa: b0 10 bcs LA10C a0fc: c9 0a cmp #$0a a0fe: f0 04 beq LA104 a100: a2 01 LA100 ldx #$01 a102: 86 34 stx text_hposn a104: c9 0d LA104 cmp #$0d a106: f0 2a beq LA132 a108: e6 36 inc text_vposn a10a: d0 26 bne LA132 a10c: a6 34 LA10C ldx text_hposn a10e: e0 1f cpx #31 a110: 90 05 bcc :HposnOkay a112: 20 00 a1 jsr LA100 a115: a6 34 ldx text_hposn a117: a4 36 :HposnOkay ldy text_vposn a119: c0 18 cpy #24 ;off bottom of screen? a11b: b0 8f bcs LA0AC ;yes, do something a11d: 24 cd bit display_mode_flag a11f: 30 9f bmi PrintTextChar a121: 48 pha ;save char to print a122: a5 34 lda text_hposn ;get text horizontal position a124: 0a asl A ;multiply by 7 and add 13 a125: 0a asl A a126: 0a asl A a127: 69 0d adc #$0d a129: e5 34 sbc text_hposn a12b: aa tax a12c: 68 pla a12d: 20 3c a1 jsr PrintHiresChar a130: e6 34 LA130 inc text_hposn a132: ac 86 02 LA132 ldy $0286 a135: ae 85 02 ldx $0285 a138: a5 38 lda $38 a13a: 18 clc a13b: 60 rts ; ; Print a character on the hi-res screen. ; ; Unlike most HRCGs, the horizontal offset is specified in pixels, and the glyph ; is bit-shifted in place. ; ; On entry: ; A-reg: char to print ($20-7f) ; X-reg: pixel offset to print at ; • Clear variables ]first_col .var $06 {addr/1} ]saved_y .var $07 {addr/1} ]glyph_hi .var $08 {addr/1} ]hptr .var $0a {addr/2} ]glyph_ptr .var $31 {addr/2} ]pixel_index .var $33 {addr/1} a13c: a0 1c PrintHiresChar ldy #>font_glyphs-$100 ;start at -$100 because we INY later a13e: 0a asl A ;multiply char by 4 a13f: 0a asl A a140: 90 02 bcc LA144 ;branch if char value < $40 (numbers/symbols) a142: a0 1e ldy #>font_glyphs+$100 ;letters, start at $1Exx instead a144: 0a LA144 asl A ;multiply by 2 (8 bytes per glyph) a145: 90 01 bcc LA148 ;branch if char [00,1f] (not expected) or [40,5f] a147: c8 iny ;char is [20,3f] or [60,7f], add one a148: 85 31 LA148 sta ]glyph_ptr a14a: 84 32 sty ]glyph_ptr+1 a14c: a4 36 LA14C ldy text_vposn ;get hi-res row address a14e: b9 14 9c lda hires_line_lo,y a151: 85 0a sta ]hptr a153: b9 2c 9c lda hires_line_hi,y a156: 85 0b sta ]hptr+1 a158: bc 03 43 ldy mod7_table,x ;get hi-res column and pixel index a15b: 84 33 sty ]pixel_index a15d: bc 03 44 ldy div7_table,x a160: 84 06 sty ]first_col a162: a0 00 ldy #$00 ;prepare glyph data a164: a9 00 :GlyphLoop lda #$00 a166: 85 08 sta ]glyph_hi a168: b1 31 lda (]glyph_ptr),y ;get byte for this row a16a: a6 33 ldx ]pixel_index a16c: c9 80 :ShiftLoop cmp #$80 ;shift it over, stepping across the high bit a16e: 26 08 rol ]glyph_hi a170: ca dex a171: 30 04 bmi LA177 a173: 0a asl A a174: 4c 6c a1 jmp :ShiftLoop a177: 29 7f LA177 and #$7f ;clear high bit a179: 18 clc a17a: 84 07 sty ]saved_y a17c: a4 06 ldy ]first_col ;blend first half onto display a17e: 51 0a eor (]hptr),y a180: 91 0a sta (]hptr),y a182: c8 iny a183: a5 08 lda ]glyph_hi ;blend second half a185: 51 0a eor (]hptr),y a187: 91 0a sta (]hptr),y a189: a4 07 ldy ]saved_y a18b: a5 0b lda ]hptr+1 ;update hi-res address a18d: 69 04 adc #$04 a18f: 85 0b sta ]hptr+1 a191: c8 iny a192: c0 08 cpy #$08 ;are we done (glyph height = 8)? a194: d0 ce bne :GlyphLoop ;not yet a196: 60 rts a197: a5 b3 LA197 lda displayed_screen a199: f0 23 beq ClearAndDrawFrame a19b: c9 0d cmp #$0d a19d: f0 1f beq ClearAndDrawFrame a19f: 29 c0 and #$c0 a1a1: d0 1b bne ClearAndDrawFrame a1a3: 20 a9 a1 jsr ClearTextScreen a1a6: 4c f1 a2 jmp ShowText ; ; Erases $400-7ff to $A0 (high-ASCII space character). Tramples screen holes. ; • Clear variables ]ptr .var $0a {addr/2} a1a9: a0 00 ClearTextScreen ldy #$00 a1ab: a2 04 ldx #$04 a1ad: 84 0a sty ]ptr a1af: 86 0b stx ]ptr+1 a1b1: a9 a0 lda #“ ” a1b3: 91 0a :Loop sta (]ptr),y a1b5: c8 iny a1b6: d0 fb bne :Loop a1b8: e6 0b inc ]ptr+1 a1ba: ca dex a1bb: d0 f6 bne :Loop a1bd: 60 rts ClearAndDrawFrame a1be: 20 e3 a1 jsr ClearViewportArea a1c1: 20 c8 a1 jsr DrawWindowTopLine a1c4: 20 e2 a2 jsr ShowHiRes a1c7: 60 rts ]color_index .var $35 {addr/1} ]x0 .var $6e {addr/1} ]y0 .var $6f {addr/1} ]x1 .var $70 {addr/1} DrawWindowTopLine a1c8: a2 00 ldx #$00 ;draw from 0,0 to 255,0 a1ca: 86 6e stx ]x0 a1cc: 86 6f stx ]y0 a1ce: ca dex a1cf: 86 70 stx ]x1 a1d1: a9 10 lda #$10 ;blue a1d3: 85 35 sta ]color_index a1d5: 20 90 9e jsr DrawHorizLine a1d8: a9 aa lda #$aa a1da: 8d 01 20 sta title_screen+1 ;unnecessary a1dd: a9 aa lda #$aa a1df: 8d 25 20 sta title_screen+37 ;needed because lines don't set the last pixel a1e2: 60 rts ClearViewportArea a1e3: a0 10 ldy #16 ;clear lines 0-16 a1e5: 20 55 a2 :Loop jsr DrawFrameClearLine a1e8: 88 dey a1e9: 10 fa bpl :Loop a1eb: c8 iny ;Y=0 a1ec: 84 34 sty text_hposn a1ee: 84 36 sty text_vposn a1f0: 60 rts a1f1: a0 00 84 0a+ .junk 45 ;unreferenced code? a21e: a9 00 ClearLines? lda #$00 a220: 8d 77 02 sta PLAYER_STATE?+54 a223: 8d 78 02 sta $0278 a226: 20 40 a2 jsr Vposn21_Hposn1 a229: a9 ff lda #$ff a22b: 8d 28 55 sta txt_lcase_flag a22e: a9 80 lda #$80 a230: 85 37 sta text_mod_flags a232: a5 cd lda display_mode_flag ;text mode? a234: 10 13 bpl ClearLinesHiRes ;no, do on hi-res screen a236: a9 20 lda #$20 ;print 64 spaces a238: a2 40 ldx #$40 a23a: 20 e6 a0 :Loop jsr OutputChar a23d: ca dex a23e: d0 fa bne :Loop a240: a9 15 Vposn21_Hposn1 lda #21 a242: 85 36 sta text_vposn a244: a9 01 lda #1 a246: 85 34 sta text_hposn a248: 60 rts • Clear variables ]counter .var $07 {addr/1} ]hptr .var $0a {addr/2} a249: a0 0f ClearLinesHiRes ldy #15 ;clear text line 15 a24b: 84 36 sty text_vposn a24d: a9 01 lda #$01 a24f: 85 34 sta text_hposn a251: 20 55 a2 jsr DrawFrameClearLine a254: c8 iny ;clear text line 16 ; ; Clears 8 lines on the hi-res screen (equivalent to one line on the text ; screen), drawing the sides of the viewport window frame. ; ; On entry: ; Y-reg: text line (0-23) ; ; On exit: ; Y-reg: preserved ; DrawFrameClearLine a255: a9 08 lda #$08 ;clear 8 hi-res lines a257: 85 07 sta ]counter a259: be 14 9c ldx hires_line_lo,y ;set hi-res base address a25c: 86 0a stx ]hptr a25e: be 2c 9c ldx hires_line_hi,y a261: 98 tya ;preserve Y-reg a262: 48 pha a263: 86 0b :RowLoop stx ]hptr+1 a265: a9 a0 lda #$a0 ;one pixel + high bit set on right edge a267: a0 25 ldy #37 ;37 bytes in the middle a269: 91 0a :MidLoop sta (]hptr),y ;set (not blend) a26b: a9 00 lda #$00 ;middle bytes are zero a26d: 88 dey a26e: d0 f9 bne :MidLoop a270: a9 c0 lda #$c0 ;one pixel + high bit set on left edge a272: 91 0a sta (]hptr),y ;store that a274: c8 iny ;move back one right a275: 0a asl A ;just the high bit this time a276: 91 0a sta (]hptr),y ;set that a278: e8 inx ;add 4 to the high byte of the address a279: e8 inx a27a: e8 inx a27b: e8 inx a27c: c6 07 dec ]counter ;are we done? a27e: d0 e3 bne :RowLoop ;no, keep going a280: 68 pla ;restore Y-reg a281: a8 tay a282: 60 LA282 rts a283: a5 2b SCAN lda polyobj_vis a285: 29 10 and #$10 a287: f0 f9 beq LA282 a289: a6 b8 ldx $b8 a28b: 30 f5 bmi LA282 a28d: bd 58 4e lda L4E58,x a290: 85 35 sta $35 a292: a5 0d lda INWK+1 a294: 05 10 ora INWK+4 a296: 05 13 ora polyobj_zpos_mi a298: 29 c0 and #$c0 a29a: d0 e6 bne LA282 a29c: a5 0d lda INWK+1 a29e: 18 clc a29f: a6 0e ldx INWK+2 a2a1: 10 05 bpl LA2A8 a2a3: 49 ff eor #$ff a2a5: 69 01 adc #$01 a2a7: 18 clc a2a8: 69 7d LA2A8 adc #$7d a2aa: 29 fe and #$fe a2ac: 85 6e sta $6e a2ae: aa tax a2af: ca dex a2b0: ca dex a2b1: a5 13 lda polyobj_zpos_mi a2b3: 4a lsr A a2b4: 4a lsr A a2b5: 18 clc a2b6: a4 14 ldy polyobj_zpos_hi a2b8: 10 03 bpl LA2BD a2ba: 49 ff eor #$ff a2bc: 38 sec a2bd: 69 5b LA2BD adc #$5b a2bf: 49 ff eor #$ff a2c1: 85 71 sta $71 a2c3: a5 10 lda INWK+4 a2c5: 4a lsr A a2c6: 18 clc a2c7: a4 11 ldy INWK+5 a2c9: 30 03 bmi LA2CE a2cb: 49 ff eor #$ff a2cd: 38 sec a2ce: 65 71 LA2CE adc $71 a2d0: c9 92 cmp #$92 a2d2: b0 02 bcs LA2D6 a2d4: a9 92 lda #$92 a2d6: c9 bf LA2D6 cmp #$bf a2d8: 90 02 bcc LA2DC a2da: a9 be lda #$be a2dc: 20 bb 9f LA2DC jsr DrawColorPixel a2df: 4c 62 9f jmp DrawVerticalLine ; ; Set the display to hi-res page 1. ; a2e2: ad 54 c0 ShowHiRes lda TXTPAGE1 a2e5: ad 52 c0 lda MIXCLR a2e8: ad 57 c0 lda HIRES a2eb: ad 50 c0 lda TXTCLR a2ee: 46 cd lsr display_mode_flag ;clears high bit a2f0: 60 rts ; ; Set the display to show text page 1. ; a2f1: ad 54 c0 ShowText lda TXTPAGE1 a2f4: ad 51 c0 lda TXTSET a2f7: 38 sec a2f8: 66 cd ror display_mode_flag ;sets high bit a2fa: 60 rts a2fb: 83 6f 63 .junk 3 NOTE: hull definitions ; ; Addresses of hull definitions, indexed by object type (1-32). Entry 0 is not ; used, and entry 32 isn't used in most contexts: the space station entry (#2) ; will point to either the Coriolis or Dodecahedron station definition depending ; on which exists in the current system. ; a2fe: 6f hull_addr_lo .junk 1 a2ff: 75 hull_addr_hi .junk 1 a300: a0 a3 .dd2 hull_missile ;1 a302: 9e a4 station_addr .dd2 hull_coriolis a304: ba a5 .dd2 hull_escape ;3 a306: 0e a6 plate_addr .dd2 hull_plate a308: 4e a6 .dd2 hull_cargo a30a: f6 a6 .dd2 hull_boulder a30c: 98 a7 .dd2 hull_asteroid a30e: 6e a8 .dd2 hull_splinter a310: aa a8 .dd2 hull_shuttle a312: dc a9 .dd2 hull_transporter a314: be ab .dd2 hull_cobra_mk3 ;11 a316: 46 ad .dd2 hull_python a318: 38 ae .dd2 hull_boa a31a: 2e af .dd2 hull_anaconda a31c: 30 b0 .dd2 hull_asteroid2 a31e: 7a b0 .dd2 hull_viper a320: 54 b1 .dd2 hull_sidewinder ;17 (first pirate) a322: fc b1 .dd2 hull_mamba a324: 2a b3 .dd2 hull_krait a326: 10 b4 .dd2 hull_adder a328: 40 b5 .dd2 hull_gecko a32a: 04 b6 .dd2 hull_cobra_mk1 a32c: ca b6 .dd2 hull_worm a32e: 7a b7 .dd2 hull_cobra3_pir a330: 36 b8 .dd2 hull_asp_mk2 a332: 60 b9 .dd2 hull_python_pir a334: b6 b9 .dd2 hull_ferdelance a336: d0 ba .dd2 hull_moray a338: a8 bb .dd2 hull_thargoid ;29 a33a: c4 bc .dd2 hull_thargon ;30 a33c: 30 bd .dd2 hull_constrictor a33e: 32 be dodo_addr .dd2 hull_dodo ; ; Hull characteristics, one per ship type. Indexing is from <table-1>, so the ; first byte is for ship type #1 (missile). ; ; This appears to be what the BBC disasm refers to as "NEWB": ; 0000 0001: trader ; 0000 0010: hunter ; 0000 0100: angry ; 0000 1000: pirate ; 0001 0000: ? ; 0010 0000: innocent ; 0100 0000: cop ; 1000 0000: has escape pod a340: 00 00 01 00+ hull_NEWB .bulk $00,$00,$01,$00,$00,$00,$00,$00,$21,$61,$a0,$a0,$a0,$a1,$a1,$c2 + $0c,$8c,$8c,$8c,$0c,$8c,$05,$8c,$8c,$8c,$82,$0c,$0c,$04,$04,$00 ; ; Kill value. Added to kill score when a ship is destroyed by shooting it with ; a laser or missile (but not an energy bomb). ; ; In the BBC Micro version everything was worth one point (equivalent to $0100 ; here). In C64/Apple II the value can vary. ; ; Indexed by ship type (1-31), starting with type #1 (missile). a360: 95 00 10 0a+ kill_score_lo .bulk $95,$00,$10,$0a,$0a,$06,$08,$0a,$10,$11,$ea,$aa,$d5,$00,$55,$1a + $55,$80,$55,$5a,$55,$aa,$32,$2a,$15,$2a,$40,$c0,$aa,$21,$55,$00 a380: 00 00 00 00+ kill_score_hi .bulk $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$00,$00 + $00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$00,$02,$00,$05,$00 ******************************************************************************** * 3D mesh definitions. * * * * Hull definitions start with a 20-byte header, and are followed by a list of * * vertices. In most cases this is followed by the edges and faces, but for * * some ships the edge/face data from another mesh is used. * * * * Using the Escape Capsule as an example: * * * * +00 $20 ;high nibble is scoop info, low nibble is debris spin info * * +01 $0100 ;two-byte missile lock data * * +03 $2c ;low byte of offset to edge data * * +04 $44 ;low byte of offset to face data * * +05 $1d ;(4 * maxlines + 1) for ship lines stack * * +06 $00 ;gun vertex * 4 * * +07 $16 ;explosion count, e.g. $2A = 4*n+6 * * +08 $18 ;vertex count * 6 (byte count) * * +09 $06 ;edge count * * +0a $0000 ;bounty value (in 0.1 Cr) * * +0c $10 ;face count * 4 (byte count) * * +0d $08 ;LOD distance; past this it's just drawn as a dot * * +0e $11 ;energy (hit points) * * +0f $08 ;speed * * +10 $00 ;high byte of offset to edge data * * +11 $00 ;high byte of offset to face data * * +12 $04 ;down-scaling of normals (larger value -> smaller ship) * * +13 $00 ;00LLLMMM laser power and missile count * * * * Vertices: * * +0/1/2: unsigned X/Y/Z value * * +3: flags XYZV VVVV * * X/Y/Z = 1 if coordinate value is negative * * VVVVV = visibility cutoff * * +4/5: four face indexes (one per nibble), for visibility test * * (if fewer than 4 are relevant, one is repeated) * * .bulk $07,$00,$24,$9f, $12,$33 ;-$07, $00, $24 / faces 1,2,3 * * .bulk $07,$0e,$0c,$ff, $02,$33 ;-$07,-$0e,-$0c / faces 0,2,3 * * .bulk $07,$0e,$0c,$bf, $01,$33 ;-$07, $0e,-$0c / faces 0,1,3 * * .bulk $15,$00,$00,$1f, $01,$22 ; $15, $00, $00 / faces 0,1,2 * * * * Edges: * * +0: flags 000V VVVV * * VVVVV = visibility cutoff * * +1: two face indices (one per nibble), for visibility test * * +2/3: vertex index * 4 * * .bulk $1f,$23,$00,$04 ;vertices 0,1 / faces 2,3 * * .bulk $1f,$03,$04,$08 ;vertices 1,2 / faces 0,3 * * .bulk $1f,$01,$08,$0c ;vertices 2,3 / faces 0,1 * * .bulk $1f,$12,$0c,$00 ;vertices 3,0 / faces 1,2 * * .bulk $1f,$13,$00,$08 ;vertices 0,2 / faces 1,3 * * .bulk $1f,$02,$0c,$04 ;vertices 3,1 / faces 0,2 * * * * Faces: * * +0: flags: XYZV VVVV * * X/Y/Z = 1 if coordinate value is negative * * VVVVV = always-visible cutoff * * +1/2/3: face normal x/y/z * * .bulk $3f,$34,$00,$7a ; $34, $00,-$7a * * .bulk $1f,$27,$67,$1e ; $27, $67, $1e * * .bulk $5f,$27,$67,$1e ; $27,-$67, $1e * * .bulk $9f,$70,$00,$00 ;-$70, $00, $00 * * * * Mesh definitions are commonly structured as a list of vertices and a list of * * faces, where each face is a list of vertex indices. This works differently. * * * * There is still a list of vertices, but what's drawn is a list of edges. * * Each vertex has a set of 1-4 associated faces, and each edge has a set of 1- * * 2 associated faces. Each face is just a normal vector used to determine * * visibility for backface removal. For each vertex and edge, if at least one * * associated face is visible, the item is considered visible. * * * * This arrangement allows the code to quickly discard vertices that aren't * * part of a visible edge. It also provides a way for edges that aren't part * * of a face, e.g. the prongs on the Krait, to be excluded: if the two nearby * * faces aren't visible, the prong isn't drawn. (It's not perfect, but at * * 280x192 you'll never notice.) * * * * If the ship is very far away, it's not drawn. If it's closer but still too * * far to have a distinct shape, determined by the Level of Detail (LOD) value, * * it's drawn as a dot. When it's close enough to see clearly, the distance is * * compared to the 5-bit visibility limit that is encoded into each vertex and * * edge. If the distance is greater than the limit, the element is not drawn. * * This provides a second LOD test, allowing fine details (like the cabin * * window on the Krait) to be excluded while the ship is still far away. * * * * The visibility limit works differently for faces: if the ship is outside the * * visibility limit, the face is *always* visible, regardless of backface * * tests. You can see this used on the "plate / alloys" hull, which has a * * single face that is always visible (limit=0). * ******************************************************************************** a3a0: 00 hull_missile .dd1 $00 a3a1: 40 06 .dd2 $0640 a3a3: 7a .dd1 $7a ;edge data offset low a3a4: da .dd1 $da a3a5: 55 .dd1 $55 a3a6: 00 .dd1 $00 a3a7: 0a .dd1 $0a a3a8: 66 .dd1 $66 ;vertex count * 6 (byte count) a3a9: 18 .dd1 $18 ;edge count a3aa: 00 00 .dd2 0 a3ac: 24 .dd1 $24 ;face count * 4 (byte count) a3ad: 0e .dd1 $0e a3ae: 02 .dd1 2 a3af: 2c .dd1 44 a3b0: 00 .dd1 $00 a3b1: 00 .dd1 $00 a3b2: 02 .dd1 $02 a3b3: 00 .dd1 %00000000 a3b4: 00 00 44 1f+ .bulk $00,$00,$44,$1f,$10,$32 ;vertices a3ba: 08 08 24 5f+ .bulk $08,$08,$24,$5f,$21,$54 a3c0: 08 08 24 1f+ .bulk $08,$08,$24,$1f,$32,$74 a3c6: 08 08 24 9f+ .bulk $08,$08,$24,$9f,$30,$76 a3cc: 08 08 24 df+ .bulk $08,$08,$24,$df,$10,$65 a3d2: 08 08 2c 3f+ .bulk $08,$08,$2c,$3f,$74,$88 a3d8: 08 08 2c 7f+ .bulk $08,$08,$2c,$7f,$54,$88 a3de: 08 08 2c ff+ .bulk $08,$08,$2c,$ff,$65,$88 a3e4: 08 08 2c bf+ .bulk $08,$08,$2c,$bf,$76,$88 a3ea: 0c 0c 2c 28+ .bulk $0c,$0c,$2c,$28,$74,$88 a3f0: 0c 0c 2c 68+ .bulk $0c,$0c,$2c,$68,$54,$88 a3f6: 0c 0c 2c e8+ .bulk $0c,$0c,$2c,$e8,$65,$88 a3fc: 0c 0c 2c a8+ .bulk $0c,$0c,$2c,$a8,$76,$88 a402: 08 08 0c a8+ .bulk $08,$08,$0c,$a8,$76,$77 a408: 08 08 0c e8+ .bulk $08,$08,$0c,$e8,$65,$66 a40e: 08 08 0c 28+ .bulk $08,$08,$0c,$28,$74,$77 a414: 08 08 0c 68+ .bulk $08,$08,$0c,$68,$54,$55 a41a: 1f 21 00 04 .bulk $1f,$21,$00,$04 ;edges a41e: 1f 32 00 08 .bulk $1f,$32,$00,$08 a422: 1f 30 00 0c .bulk $1f,$30,$00,$0c a426: 1f 10 00 10 .bulk $1f,$10,$00,$10 a42a: 1f 24 04 08 .bulk $1f,$24,$04,$08 a42e: 1f 51 04 10 .bulk $1f,$51,$04,$10 a432: 1f 60 0c 10 .bulk $1f,$60,$0c,$10 a436: 1f 73 08 0c .bulk $1f,$73,$08,$0c a43a: 1f 74 08 14 .bulk $1f,$74,$08,$14 a43e: 1f 54 04 18 .bulk $1f,$54,$04,$18 a442: 1f 65 10 1c .bulk $1f,$65,$10,$1c a446: 1f 76 0c 20 .bulk $1f,$76,$0c,$20 a44a: 1f 86 1c 20 .bulk $1f,$86,$1c,$20 a44e: 1f 87 14 20 .bulk $1f,$87,$14,$20 a452: 1f 84 14 18 .bulk $1f,$84,$14,$18 a456: 1f 85 18 1c .bulk $1f,$85,$18,$1c a45a: 08 85 18 28 .bulk $08,$85,$18,$28 a45e: 08 87 14 24 .bulk $08,$87,$14,$24 a462: 08 87 20 30 .bulk $08,$87,$20,$30 a466: 08 85 1c 2c .bulk $08,$85,$1c,$2c a46a: 08 74 24 3c .bulk $08,$74,$24,$3c a46e: 08 54 28 40 .bulk $08,$54,$28,$40 a472: 08 76 30 34 .bulk $08,$76,$30,$34 a476: 08 65 2c 38 .bulk $08,$65,$2c,$38 a47a: 9f 40 00 10 .bulk $9f,$40,$00,$10 ;faces a47e: 5f 00 40 10 .bulk $5f,$00,$40,$10 a482: 1f 40 00 10 .bulk $1f,$40,$00,$10 a486: 1f 00 40 10 .bulk $1f,$00,$40,$10 a48a: 1f 20 00 00 .bulk $1f,$20,$00,$00 a48e: 5f 00 20 00 .bulk $5f,$00,$20,$00 a492: 9f 20 00 00 .bulk $9f,$20,$00,$00 a496: 1f 00 20 00 .bulk $1f,$00,$20,$00 a49a: 3f 00 00 b0 .bulk $3f,$00,$00,$b0 ; Coriolis space station. a49e: 00 hull_coriolis .dd1 $00 a49f: 00 64 .dd2 $6400 a4a1: 74 .dd1 $74 a4a2: e4 .dd1 $e4 a4a3: 59 .dd1 $59 a4a4: 00 .dd1 $00 a4a5: 36 .dd1 $36 a4a6: 60 .dd1 $60 a4a7: 1c .dd1 $1c a4a8: 00 00 .dd2 0 a4aa: 38 .dd1 $38 a4ab: 78 .dd1 $78 a4ac: f0 .dd1 240 a4ad: 00 .dd1 0 a4ae: 00 .dd1 $00 a4af: 00 .dd1 $00 a4b0: 00 .dd1 $00 a4b1: 06 .dd1 %00000110 a4b2: a0 00 a0 1f+ .bulk $a0,$00,$a0,$1f,$10,$62 ;vertices a4b8: 00 a0 a0 1f+ .bulk $00,$a0,$a0,$1f,$20,$83 a4be: a0 00 a0 9f+ .bulk $a0,$00,$a0,$9f,$30,$74 a4c4: 00 a0 a0 5f+ .bulk $00,$a0,$a0,$5f,$10,$54 a4ca: a0 a0 00 5f+ .bulk $a0,$a0,$00,$5f,$51,$a6 a4d0: a0 a0 00 1f+ .bulk $a0,$a0,$00,$1f,$62,$b8 a4d6: a0 a0 00 9f+ .bulk $a0,$a0,$00,$9f,$73,$c8 a4dc: a0 a0 00 df+ .bulk $a0,$a0,$00,$df,$54,$97 a4e2: a0 00 a0 3f+ .bulk $a0,$00,$a0,$3f,$a6,$db a4e8: 00 a0 a0 3f+ .bulk $00,$a0,$a0,$3f,$b8,$dc a4ee: a0 00 a0 bf+ .bulk $a0,$00,$a0,$bf,$97,$dc a4f4: 00 a0 a0 7f+ .bulk $00,$a0,$a0,$7f,$95,$da a4fa: 0a 1e a0 5e+ .bulk $0a,$1e,$a0,$5e,$00,$00 a500: 0a 1e a0 1e+ .bulk $0a,$1e,$a0,$1e,$00,$00 a506: 0a 1e a0 9e+ .bulk $0a,$1e,$a0,$9e,$00,$00 a50c: 0a 1e a0 de+ .bulk $0a,$1e,$a0,$de,$00,$00 a512: 1f 10 00 0c .bulk $1f,$10,$00,$0c ;edges a516: 1f 20 00 04 .bulk $1f,$20,$00,$04 a51a: 1f 30 04 08 .bulk $1f,$30,$04,$08 a51e: 1f 40 08 0c .bulk $1f,$40,$08,$0c a522: 1f 51 0c 10 .bulk $1f,$51,$0c,$10 a526: 1f 61 00 10 .bulk $1f,$61,$00,$10 a52a: 1f 62 00 14 .bulk $1f,$62,$00,$14 a52e: 1f 82 14 04 .bulk $1f,$82,$14,$04 a532: 1f 83 04 18 .bulk $1f,$83,$04,$18 a536: 1f 73 08 18 .bulk $1f,$73,$08,$18 a53a: 1f 74 08 1c .bulk $1f,$74,$08,$1c a53e: 1f 54 0c 1c .bulk $1f,$54,$0c,$1c a542: 1f da 20 2c .bulk $1f,$da,$20,$2c a546: 1f db 20 24 .bulk $1f,$db,$20,$24 a54a: 1f dc 24 28 .bulk $1f,$dc,$24,$28 a54e: 1f d9 28 2c .bulk $1f,$d9,$28,$2c a552: 1f a5 10 2c .bulk $1f,$a5,$10,$2c a556: 1f a6 10 20 .bulk $1f,$a6,$10,$20 a55a: 1f b6 14 20 .bulk $1f,$b6,$14,$20 a55e: 1f b8 14 24 .bulk $1f,$b8,$14,$24 a562: 1f c8 18 24 .bulk $1f,$c8,$18,$24 a566: 1f c7 18 28 .bulk $1f,$c7,$18,$28 a56a: 1f 97 1c 28 .bulk $1f,$97,$1c,$28 a56e: 1f 95 1c 2c .bulk $1f,$95,$1c,$2c a572: 1e 00 30 34 .bulk $1e,$00,$30,$34 a576: 1e 00 34 38 .bulk $1e,$00,$34,$38 a57a: 1e 00 38 3c .bulk $1e,$00,$38,$3c a57e: 1e 00 3c 30 .bulk $1e,$00,$3c,$30 a582: 1f 00 00 a0 .bulk $1f,$00,$00,$a0 ;faces a586: 5f 6b 6b 6b .bulk $5f,$6b,$6b,$6b a58a: 1f 6b 6b 6b .bulk $1f,$6b,$6b,$6b a58e: 9f 6b 6b 6b .bulk $9f,$6b,$6b,$6b a592: df 6b 6b 6b .bulk $df,$6b,$6b,$6b a596: 5f 00 a0 00 .bulk $5f,$00,$a0,$00 a59a: 1f a0 00 00 .bulk $1f,$a0,$00,$00 a59e: 9f a0 00 00 .bulk $9f,$a0,$00,$00 a5a2: 1f 00 a0 00 .bulk $1f,$00,$a0,$00 a5a6: ff 6b 6b 6b .bulk $ff,$6b,$6b,$6b a5aa: 7f 6b 6b 6b .bulk $7f,$6b,$6b,$6b a5ae: 3f 6b 6b 6b .bulk $3f,$6b,$6b,$6b a5b2: bf 6b 6b 6b .bulk $bf,$6b,$6b,$6b a5b6: 3f 00 00 a0 .bulk $3f,$00,$00,$a0 ; Escape capsule. a5ba: 20 hull_escape .dd1 $20 a5bb: 00 01 .dd2 $0100 a5bd: 2c .dd1 $2c a5be: 44 .dd1 $44 a5bf: 1d .dd1 $1d a5c0: 00 .dd1 $00 a5c1: 16 .dd1 $16 a5c2: 18 .dd1 $18 a5c3: 06 .dd1 $06 a5c4: 00 00 .dd2 0 a5c6: 10 .dd1 $10 a5c7: 08 .dd1 $08 a5c8: 11 .dd1 17 a5c9: 08 .dd1 8 a5ca: 00 .dd1 $00 a5cb: 00 .dd1 $00 a5cc: 04 .dd1 $04 a5cd: 00 .dd1 %00000000 a5ce: 07 00 24 9f+ .bulk $07,$00,$24,$9f,$12,$33 ;vertices a5d4: 07 0e 0c ff+ .bulk $07,$0e,$0c,$ff,$02,$33 a5da: 07 0e 0c bf+ .bulk $07,$0e,$0c,$bf,$01,$33 a5e0: 15 00 00 1f+ .bulk $15,$00,$00,$1f,$01,$22 a5e6: 1f 23 00 04 .bulk $1f,$23,$00,$04 ;edges a5ea: 1f 03 04 08 .bulk $1f,$03,$04,$08 a5ee: 1f 01 08 0c .bulk $1f,$01,$08,$0c a5f2: 1f 12 0c 00 .bulk $1f,$12,$0c,$00 a5f6: 1f 13 00 08 .bulk $1f,$13,$00,$08 a5fa: 1f 02 0c 04 .bulk $1f,$02,$0c,$04 a5fe: 3f 34 00 7a .bulk $3f,$34,$00,$7a ;faces a602: 1f 27 67 1e .bulk $1f,$27,$67,$1e a606: 5f 27 67 1e .bulk $5f,$27,$67,$1e a60a: 9f 70 00 00 .bulk $9f,$70,$00,$00 ; Plate, alloys. a60e: 80 hull_plate .dd1 $80 a60f: 64 00 .dd2 $0064 a611: 2c .dd1 $2c a612: 3c .dd1 $3c a613: 15 .dd1 $15 a614: 00 .dd1 $00 a615: 0a .dd1 $0a a616: 18 .dd1 $18 a617: 04 .dd1 $04 a618: 00 00 .dd2 0 a61a: 04 .dd1 $04 a61b: 05 .dd1 $05 a61c: 10 .dd1 16 a61d: 10 .dd1 16 a61e: 00 .dd1 $00 a61f: 00 .dd1 $00 a620: 03 .dd1 $03 a621: 00 .dd1 %00000000 a622: 0f 16 09 ff+ .bulk $0f,$16,$09,$ff,$ff,$ff ;vertices a628: 0f 26 09 bf+ .bulk $0f,$26,$09,$bf,$ff,$ff a62e: 13 20 0b 14+ .bulk $13,$20,$0b,$14,$ff,$ff a634: 0a 2e 06 54+ .bulk $0a,$2e,$06,$54,$ff,$ff a63a: 1f ff 00 04 .bulk $1f,$ff,$00,$04 ;edges a63e: 10 ff 04 08 .bulk $10,$ff,$04,$08 a642: 14 ff 08 0c .bulk $14,$ff,$08,$0c a646: 10 ff 0c 00 .bulk $10,$ff,$0c,$00 a64a: 00 00 00 00 .bulk $00,$00,$00,$00 ;faces (always visible) ; Cargo canister. a64e: 00 hull_cargo .dd1 $00 a64f: 90 01 .dd2 $0190 a651: 50 .dd1 $50 a652: 8c .dd1 $8c a653: 35 .dd1 $35 a654: 00 .dd1 $00 a655: 12 .dd1 $12 a656: 3c .dd1 $3c a657: 0f .dd1 $0f a658: 00 00 .dd2 0 a65a: 1c .dd1 $1c a65b: 0c .dd1 $0c a65c: 11 .dd1 17 a65d: 0f .dd1 15 a65e: 00 .dd1 $00 a65f: 00 .dd1 $00 a660: 02 .dd1 $02 a661: 00 .dd1 %00000000 a662: 18 10 00 1f+ .bulk $18,$10,$00,$1f,$10,$55 ;vertices a668: 18 05 0f 1f+ .bulk $18,$05,$0f,$1f,$10,$22 a66e: 18 0d 09 5f+ .bulk $18,$0d,$09,$5f,$20,$33 a674: 18 0d 09 7f+ .bulk $18,$0d,$09,$7f,$30,$44 a67a: 18 05 0f 3f+ .bulk $18,$05,$0f,$3f,$40,$55 a680: 18 10 00 9f+ .bulk $18,$10,$00,$9f,$51,$66 a686: 18 05 0f 9f+ .bulk $18,$05,$0f,$9f,$21,$66 a68c: 18 0d 09 df+ .bulk $18,$0d,$09,$df,$32,$66 a692: 18 0d 09 ff+ .bulk $18,$0d,$09,$ff,$43,$66 a698: 18 05 0f bf+ .bulk $18,$05,$0f,$bf,$54,$66 a69e: 1f 10 00 04 .bulk $1f,$10,$00,$04 ;edges a6a2: 1f 20 04 08 .bulk $1f,$20,$04,$08 a6a6: 1f 30 08 0c .bulk $1f,$30,$08,$0c a6aa: 1f 40 0c 10 .bulk $1f,$40,$0c,$10 a6ae: 1f 50 00 10 .bulk $1f,$50,$00,$10 a6b2: 1f 51 00 14 .bulk $1f,$51,$00,$14 a6b6: 1f 21 04 18 .bulk $1f,$21,$04,$18 a6ba: 1f 32 08 1c .bulk $1f,$32,$08,$1c a6be: 1f 43 0c 20 .bulk $1f,$43,$0c,$20 a6c2: 1f 54 10 24 .bulk $1f,$54,$10,$24 a6c6: 1f 61 14 18 .bulk $1f,$61,$14,$18 a6ca: 1f 62 18 1c .bulk $1f,$62,$18,$1c a6ce: 1f 63 1c 20 .bulk $1f,$63,$1c,$20 a6d2: 1f 64 20 24 .bulk $1f,$64,$20,$24 a6d6: 1f 65 24 14 .bulk $1f,$65,$24,$14 a6da: 1f 60 00 00 .bulk $1f,$60,$00,$00 ;faces a6de: 1f 00 29 1e .bulk $1f,$00,$29,$1e a6e2: 5f 00 12 30 .bulk $5f,$00,$12,$30 a6e6: 5f 00 33 00 .bulk $5f,$00,$33,$00 a6ea: 7f 00 12 30 .bulk $7f,$00,$12,$30 a6ee: 3f 00 29 1e .bulk $3f,$00,$29,$1e a6f2: 9f 60 00 00 .bulk $9f,$60,$00,$00 ; Boulder. a6f6: 00 hull_boulder .dd1 $00 a6f7: 84 03 .dd2 $0384 a6f9: 3e .dd1 $3e a6fa: 7a .dd1 $7a a6fb: 31 .dd1 $31 a6fc: 00 .dd1 $00 a6fd: 0e .dd1 $0e a6fe: 2a .dd1 $2a a6ff: 0f .dd1 $0f a700: 01 00 .dd2 1 ;bounty (1) a702: 28 .dd1 $28 a703: 14 .dd1 $14 a704: 14 .dd1 20 a705: 1e .dd1 30 a706: 00 .dd1 $00 a707: 00 .dd1 $00 a708: 02 .dd1 $02 a709: 00 .dd1 %00000000 a70a: 12 25 0b bf+ .bulk $12,$25,$0b,$bf,$01,$59 ;vertices a710: 1e 07 0c 1f+ .bulk $1e,$07,$0c,$1f,$12,$56 a716: 1c 07 0c 7f+ .bulk $1c,$07,$0c,$7f,$23,$67 a71c: 02 00 27 3f+ .bulk $02,$00,$27,$3f,$34,$78 a722: 1c 22 1e bf+ .bulk $1c,$22,$1e,$bf,$04,$89 a728: 05 0a 0d 5f+ .bulk $05,$0a,$0d,$5f,$ff,$ff a72e: 14 11 1e 3f+ .bulk $14,$11,$1e,$3f,$ff,$ff a734: 1f 15 00 04 .bulk $1f,$15,$00,$04 ;edges a738: 1f 26 04 08 .bulk $1f,$26,$04,$08 a73c: 1f 37 08 0c .bulk $1f,$37,$08,$0c a740: 1f 48 0c 10 .bulk $1f,$48,$0c,$10 a744: 1f 09 10 00 .bulk $1f,$09,$10,$00 a748: 1f 01 00 14 .bulk $1f,$01,$00,$14 a74c: 1f 12 04 14 .bulk $1f,$12,$04,$14 a750: 1f 23 08 14 .bulk $1f,$23,$08,$14 a754: 1f 34 0c 14 .bulk $1f,$34,$0c,$14 a758: 1f 04 10 14 .bulk $1f,$04,$10,$14 a75c: 1f 59 00 18 .bulk $1f,$59,$00,$18 a760: 1f 56 04 18 .bulk $1f,$56,$04,$18 a764: 1f 67 08 18 .bulk $1f,$67,$08,$18 a768: 1f 78 0c 18 .bulk $1f,$78,$0c,$18 a76c: 1f 89 10 18 .bulk $1f,$89,$10,$18 a770: df 0f 03 08 .bulk $df,$0f,$03,$08 ;faces a774: 9f 07 0c 1e .bulk $9f,$07,$0c,$1e a778: 5f 20 2f 18 .bulk $5f,$20,$2f,$18 a77c: ff 03 27 07 .bulk $ff,$03,$27,$07 a780: ff 05 04 01 .bulk $ff,$05,$04,$01 a784: 1f 31 54 08 .bulk $1f,$31,$54,$08 a788: 3f 70 15 15 .bulk $3f,$70,$15,$15 a78c: 7f 4c 23 52 .bulk $7f,$4c,$23,$52 a790: 3f 16 38 89 .bulk $3f,$16,$38,$89 a794: 3f 28 6e 26 .bulk $3f,$28,$6e,$26 ; Asteroid. a798: 00 hull_asteroid .dd1 $00 a799: 00 19 .dd2 $1900 a79b: 4a .dd1 $4a a79c: 9e .dd1 $9e a79d: 45 .dd1 $45 a79e: 00 .dd1 $00 a79f: 22 .dd1 $22 a7a0: 36 .dd1 $36 a7a1: 15 .dd1 $15 a7a2: 05 00 .dd2 5 ;bounty (5) a7a4: 38 .dd1 $38 a7a5: 32 .dd1 $32 a7a6: 3c .dd1 60 a7a7: 1e .dd1 30 a7a8: 00 .dd1 $00 a7a9: 00 .dd1 $00 a7aa: 01 .dd1 $01 a7ab: 00 .dd1 %00000000 a7ac: 00 50 00 1f+ .bulk $00,$50,$00,$1f,$ff,$ff ;vertices a7b2: 50 0a 00 df+ .bulk $50,$0a,$00,$df,$ff,$ff a7b8: 00 50 00 5f+ .bulk $00,$50,$00,$5f,$ff,$ff a7be: 46 28 00 5f+ .bulk $46,$28,$00,$5f,$ff,$ff a7c4: 3c 32 00 1f+ .bulk $3c,$32,$00,$1f,$65,$dc a7ca: 32 00 3c 1f+ .bulk $32,$00,$3c,$1f,$ff,$ff a7d0: 28 00 46 9f+ .bulk $28,$00,$46,$9f,$10,$32 a7d6: 00 1e 4b 3f+ .bulk $00,$1e,$4b,$3f,$ff,$ff a7dc: 00 32 3c 7f+ .bulk $00,$32,$3c,$7f,$98,$ba a7e2: 1f 72 00 04 .bulk $1f,$72,$00,$04 ;edges a7e6: 1f d6 00 10 .bulk $1f,$d6,$00,$10 a7ea: 1f c5 0c 10 .bulk $1f,$c5,$0c,$10 a7ee: 1f b4 08 0c .bulk $1f,$b4,$08,$0c a7f2: 1f a3 04 08 .bulk $1f,$a3,$04,$08 a7f6: 1f 32 04 18 .bulk $1f,$32,$04,$18 a7fa: 1f 31 08 18 .bulk $1f,$31,$08,$18 a7fe: 1f 41 08 14 .bulk $1f,$41,$08,$14 a802: 1f 10 14 18 .bulk $1f,$10,$14,$18 a806: 1f 60 00 14 .bulk $1f,$60,$00,$14 a80a: 1f 54 0c 14 .bulk $1f,$54,$0c,$14 a80e: 1f 20 00 18 .bulk $1f,$20,$00,$18 a812: 1f 65 10 14 .bulk $1f,$65,$10,$14 a816: 1f a8 04 20 .bulk $1f,$a8,$04,$20 a81a: 1f 87 04 1c .bulk $1f,$87,$04,$1c a81e: 1f d7 00 1c .bulk $1f,$d7,$00,$1c a822: 1f dc 10 1c .bulk $1f,$dc,$10,$1c a826: 1f c9 0c 1c .bulk $1f,$c9,$0c,$1c a82a: 1f b9 0c 20 .bulk $1f,$b9,$0c,$20 a82e: 1f ba 08 20 .bulk $1f,$ba,$08,$20 a832: 1f 98 1c 20 .bulk $1f,$98,$1c,$20 a836: 1f 09 42 51 .bulk $1f,$09,$42,$51 ;faces a83a: 5f 09 42 51 .bulk $5f,$09,$42,$51 a83e: 9f 48 40 1f .bulk $9f,$48,$40,$1f a842: df 40 49 2f .bulk $df,$40,$49,$2f a846: 5f 2d 4f 41 .bulk $5f,$2d,$4f,$41 a84a: 1f 87 0f 23 .bulk $1f,$87,$0f,$23 a84e: 1f 26 4c 46 .bulk $1f,$26,$4c,$46 a852: bf 42 3b 27 .bulk $bf,$42,$3b,$27 a856: ff 43 0f 50 .bulk $ff,$43,$0f,$50 a85a: 7f 42 0e 4b .bulk $7f,$42,$0e,$4b a85e: ff 46 50 28 .bulk $ff,$46,$50,$28 a862: 7f 3a 66 33 .bulk $7f,$3a,$66,$33 a866: 3f 51 09 43 .bulk $3f,$51,$09,$43 a86a: 3f 2f 5e 3f .bulk $3f,$2f,$5e,$3f ; Splinter, rock. ; ; Header seems broken (but matches C64 def) ; edges offset = $fd78 --> A5E6 == escape pod edges ; faces offset = $0044 --> A8B2 == hull_shuttle header ; ; The data parses as valid, but the backface removal fails at some angles. a86e: b0 hull_splinter .dd1 $b0 a86f: 00 01 .dd2 $0100 a871: 78 .dd1 $78 ;edge offset lo a872: 44 .dd1 $44 ;face offset lo a873: 1d .dd1 $1d a874: 00 .dd1 $00 a875: 16 .dd1 $16 a876: 18 .dd1 $18 ;vertex count = 4 * 6 a877: 06 .dd1 $06 ;edge count = 6 a878: 00 00 .dd2 0 a87a: 10 .dd1 $10 ;face count = 4 * 4 a87b: 08 .dd1 $08 a87c: 14 .dd1 20 a87d: 0a .dd1 10 a87e: fd .dd1 $fd ;edge offset hi a87f: 00 .dd1 $00 ;face offset hi a880: 05 .dd1 $05 a881: 00 .dd1 %00000000 a882: 18 19 10 df+ .bulk $18,$19,$10,$df,$12,$33 ;vertices a888: 00 0c 0a 3f+ .bulk $00,$0c,$0a,$3f,$02,$33 a88e: 0b 06 02 5f+ .bulk $0b,$06,$02,$5f,$01,$33 a894: 0c 2a 07 1f+ .bulk $0c,$2a,$07,$1f,$01,$22 a89a: 1f 23 00 04 .bulk $1f,$23,$00,$04 ;looks like edge data (but not used) a89e: 1f 03 04 08 .bulk $1f,$03,$04,$08 a8a2: 1f 01 08 0c .bulk $1f,$01,$08,$0c a8a6: 1f 12 0c 00 .bulk $1f,$12,$0c,$00 ; Shuttle. a8aa: 0f hull_shuttle .dd1 $0f a8ab: c4 09 .dd2 $09c4 a8ad: 86 .dd1 $86 a8ae: fe .dd1 $fe a8af: 71 .dd1 $71 a8b0: 00 .dd1 $00 a8b1: 26 .dd1 $26 a8b2: 72 .dd1 $72 a8b3: 1e .dd1 $1e a8b4: 00 00 .dd2 0 a8b6: 34 .dd1 $34 a8b7: 16 .dd1 $16 a8b8: 20 .dd1 32 a8b9: 08 .dd1 8 a8ba: 00 .dd1 $00 a8bb: 00 .dd1 $00 a8bc: 02 .dd1 $02 a8bd: 00 .dd1 %00000000 a8be: 00 11 17 5f+ .bulk $00,$11,$17,$5f,$ff,$ff ;vertices a8c4: 11 00 17 9f+ .bulk $11,$00,$17,$9f,$ff,$ff a8ca: 00 12 17 1f+ .bulk $00,$12,$17,$1f,$ff,$ff a8d0: 12 00 17 1f+ .bulk $12,$00,$17,$1f,$ff,$ff a8d6: 14 14 1b ff+ .bulk $14,$14,$1b,$ff,$12,$39 a8dc: 14 14 1b bf+ .bulk $14,$14,$1b,$bf,$34,$59 a8e2: 14 14 1b 3f+ .bulk $14,$14,$1b,$3f,$56,$79 a8e8: 14 14 1b 7f+ .bulk $14,$14,$1b,$7f,$17,$89 a8ee: 05 00 1b 30+ .bulk $05,$00,$1b,$30,$99,$99 a8f4: 00 02 1b 70+ .bulk $00,$02,$1b,$70,$99,$99 a8fa: 05 00 1b a9+ .bulk $05,$00,$1b,$a9,$99,$99 a900: 00 03 1b 29+ .bulk $00,$03,$1b,$29,$99,$99 a906: 00 09 23 50+ .bulk $00,$09,$23,$50,$0a,$bc a90c: 03 01 1f 47+ .bulk $03,$01,$1f,$47,$ff,$02 ;v13 ($34) a912: 04 0b 19 08+ .bulk $04,$0b,$19,$08,$01,$f4 a918: 0b 04 19 08+ .bulk $0b,$04,$19,$08,$a1,$3f a91e: 03 01 1f c7+ .bulk $03,$01,$1f,$c7,$6b,$23 ;v16 ($40) a924: 03 0b 19 88+ .bulk $03,$0b,$19,$88,$f8,$c0 a92a: 0a 04 19 88+ .bulk $0a,$04,$19,$88,$4f,$18 a930: 1f 02 00 04 .bulk $1f,$02,$00,$04 ;edges a934: 1f 4a 04 08 .bulk $1f,$4a,$04,$08 a938: 1f 6b 08 0c .bulk $1f,$6b,$08,$0c a93c: 1f 8c 00 0c .bulk $1f,$8c,$00,$0c a940: 1f 18 00 1c .bulk $1f,$18,$00,$1c a944: 18 12 00 10 .bulk $18,$12,$00,$10 a948: 1f 23 04 10 .bulk $1f,$23,$04,$10 a94c: 18 34 04 14 .bulk $18,$34,$04,$14 a950: 1f 45 08 14 .bulk $1f,$45,$08,$14 a954: 0c 56 08 18 .bulk $0c,$56,$08,$18 a958: 1f 67 0c 18 .bulk $1f,$67,$0c,$18 a95c: 18 78 0c 1c .bulk $18,$78,$0c,$1c a960: 1f 39 10 14 .bulk $1f,$39,$10,$14 a964: 1f 59 14 18 .bulk $1f,$59,$14,$18 a968: 1f 79 18 1c .bulk $1f,$79,$18,$1c a96c: 1f 19 10 1c .bulk $1f,$19,$10,$1c a970: 10 0c 00 30 .bulk $10,$0c,$00,$30 a974: 10 0a 04 30 .bulk $10,$0a,$04,$30 a978: 10 ab 08 30 .bulk $10,$ab,$08,$30 a97c: 10 bc 0c 30 .bulk $10,$bc,$0c,$30 a980: 10 99 20 24 .bulk $10,$99,$20,$24 a984: 07 99 24 28 .bulk $07,$99,$24,$28 a988: 09 99 28 2c .bulk $09,$99,$28,$2c a98c: 07 99 20 2c .bulk $07,$99,$20,$2c a990: 05 bb 34 38 .bulk $05,$bb,$34,$38 ;window 1 a994: 08 bb 38 3c .bulk $08,$bb,$38,$3c a998: 07 bb 34 3c .bulk $07,$bb,$34,$3c a99c: 05 aa 40 44 .bulk $05,$aa,$40,$44 ;window 2 a9a0: 08 aa 44 48 .bulk $08,$aa,$44,$48 a9a4: 07 aa 40 48 .bulk $07,$aa,$40,$48 a9a8: df 37 37 28 .bulk $df,$37,$37,$28 ;faces a9ac: 5f 00 4a 04 .bulk $5f,$00,$4a,$04 a9b0: df 33 33 17 .bulk $df,$33,$33,$17 a9b4: 9f 4a 00 04 .bulk $9f,$4a,$00,$04 a9b8: 9f 33 33 17 .bulk $9f,$33,$33,$17 a9bc: 1f 00 4a 04 .bulk $1f,$00,$4a,$04 a9c0: 1f 33 33 17 .bulk $1f,$33,$33,$17 a9c4: 1f 4a 00 04 .bulk $1f,$4a,$00,$04 a9c8: 5f 33 33 17 .bulk $5f,$33,$33,$17 a9cc: 3f 00 00 6b .bulk $3f,$00,$00,$6b a9d0: 9f 29 29 5a .bulk $9f,$29,$29,$5a ;face 10 a9d4: 1f 29 29 5a .bulk $1f,$29,$29,$5a a9d8: 5f 37 37 28 .bulk $5f,$37,$37,$28 ; Transporter. hull_transporter a9dc: 00 .dd1 $00 a9dd: c4 09 .dd2 $09c4 a9df: f2 .dd1 $f2 a9e0: aa .dd1 $aa a9e1: 95 .dd1 $95 a9e2: 30 .dd1 $30 a9e3: 1a .dd1 $1a a9e4: de .dd1 $de a9e5: 2e .dd1 $2e a9e6: 00 00 .dd2 0 a9e8: 38 .dd1 $38 a9e9: 10 .dd1 $10 a9ea: 20 .dd1 32 a9eb: 0a .dd1 10 a9ec: 00 .dd1 $00 a9ed: 01 .dd1 $01 a9ee: 02 .dd1 $02 a9ef: 00 .dd1 %00000000 a9f0: 00 0a 1a 3f+ .bulk $00,$0a,$1a,$3f,$06,$77 ;vertices a9f6: 19 04 1a bf+ .bulk $19,$04,$1a,$bf,$01,$77 a9fc: 1c 03 1a ff+ .bulk $1c,$03,$1a,$ff,$01,$22 aa02: 19 08 1a ff+ .bulk $19,$08,$1a,$ff,$02,$33 aa08: 1a 08 1a 7f+ .bulk $1a,$08,$1a,$7f,$03,$44 aa0e: 1d 03 1a 7f+ .bulk $1d,$03,$1a,$7f,$04,$55 aa14: 1a 04 1a 3f+ .bulk $1a,$04,$1a,$3f,$05,$66 aa1a: 00 06 0c 13+ .bulk $00,$06,$0c,$13,$ff,$ff aa20: 1e 01 0c df+ .bulk $1e,$01,$0c,$df,$17,$89 aa26: 21 08 0c df+ .bulk $21,$08,$0c,$df,$12,$39 aa2c: 21 08 0c 5f+ .bulk $21,$08,$0c,$5f,$34,$5a aa32: 1e 01 0c 5f+ .bulk $1e,$01,$0c,$5f,$56,$ab aa38: 0b 02 1e df+ .bulk $0b,$02,$1e,$df,$89,$cd aa3e: 0d 08 1e df+ .bulk $0d,$08,$1e,$df,$39,$dd aa44: 0e 08 1e 5f+ .bulk $0e,$08,$1e,$5f,$3a,$dd aa4a: 0b 02 1e 5f+ .bulk $0b,$02,$1e,$5f,$ab,$cd aa50: 05 06 02 87+ .bulk $05,$06,$02,$87,$77,$77 ;decoration vertices, face 7 aa56: 12 03 02 87+ .bulk $12,$03,$02,$87,$77,$77 aa5c: 05 07 07 a7+ .bulk $05,$07,$07,$a7,$77,$77 aa62: 12 04 07 a7+ .bulk $12,$04,$07,$a7,$77,$77 aa68: 0b 06 0e a7+ .bulk $0b,$06,$0e,$a7,$77,$77 aa6e: 0b 05 07 a7+ .bulk $0b,$05,$07,$a7,$77,$77 aa74: 05 07 0e 27+ .bulk $05,$07,$0e,$27,$66,$66 ;decoration vertices, face 6 aa7a: 12 04 0e 27+ .bulk $12,$04,$0e,$27,$66,$66 aa80: 0b 05 07 27+ .bulk $0b,$05,$07,$27,$66,$66 aa86: 05 06 03 27+ .bulk $05,$06,$03,$27,$66,$66 aa8c: 12 03 03 27+ .bulk $12,$03,$03,$27,$66,$66 aa92: 0b 04 08 07+ .bulk $0b,$04,$08,$07,$66,$66 aa98: 0b 05 03 27+ .bulk $0b,$05,$03,$27,$66,$66 aa9e: 10 08 0d e6+ .bulk $10,$08,$0d,$e6,$33,$33 aaa4: 10 08 10 c6+ .bulk $10,$08,$10,$c6,$33,$33 aaaa: 11 08 0d 66+ .bulk $11,$08,$0d,$66,$33,$33 aab0: 11 08 10 46+ .bulk $11,$08,$10,$46,$33,$33 aab6: 0d 03 1a e8+ .bulk $0d,$03,$1a,$e8,$00,$00 aabc: 0d 03 1a 68+ .bulk $0d,$03,$1a,$68,$00,$00 aac2: 09 03 1a 25+ .bulk $09,$03,$1a,$25,$00,$00 aac8: 08 03 1a a5+ .bulk $08,$03,$1a,$a5,$00,$00 aace: 1f 07 00 04 .bulk $1f,$07,$00,$04 ;edges aad2: 1f 01 04 08 .bulk $1f,$01,$04,$08 aad6: 1f 02 08 0c .bulk $1f,$02,$08,$0c aada: 1f 03 0c 10 .bulk $1f,$03,$0c,$10 aade: 1f 04 10 14 .bulk $1f,$04,$10,$14 aae2: 1f 05 14 18 .bulk $1f,$05,$14,$18 aae6: 1f 06 00 18 .bulk $1f,$06,$00,$18 aaea: 10 67 00 1c .bulk $10,$67,$00,$1c aaee: 1f 17 04 20 .bulk $1f,$17,$04,$20 aaf2: 0b 12 08 24 .bulk $0b,$12,$08,$24 aaf6: 1f 23 0c 24 .bulk $1f,$23,$0c,$24 aafa: 1f 34 10 28 .bulk $1f,$34,$10,$28 aafe: 0b 45 14 28 .bulk $0b,$45,$14,$28 ab02: 1f 56 18 2c .bulk $1f,$56,$18,$2c ab06: 11 78 1c 20 .bulk $11,$78,$1c,$20 ab0a: 11 19 20 24 .bulk $11,$19,$20,$24 ab0e: 11 5a 28 2c .bulk $11,$5a,$28,$2c ab12: 11 6b 1c 2c .bulk $11,$6b,$1c,$2c ab16: 13 bc 1c 3c .bulk $13,$bc,$1c,$3c ab1a: 13 8c 1c 30 .bulk $13,$8c,$1c,$30 ab1e: 10 89 20 30 .bulk $10,$89,$20,$30 ab22: 1f 39 24 34 .bulk $1f,$39,$24,$34 ab26: 1f 3a 28 38 .bulk $1f,$3a,$28,$38 ab2a: 10 ab 2c 3c .bulk $10,$ab,$2c,$3c ab2e: 1f 9d 30 34 .bulk $1f,$9d,$30,$34 ab32: 1f 3d 34 38 .bulk $1f,$3d,$34,$38 ab36: 1f ad 38 3c .bulk $1f,$ad,$38,$3c ab3a: 1f cd 30 3c .bulk $1f,$cd,$30,$3c ab3e: 07 77 40 44 .bulk $07,$77,$40,$44 ;deco: vertices 16-21, face 7 ab42: 07 77 48 4c .bulk $07,$77,$48,$4c ; (5 edges, "IB") ab46: 07 77 4c 50 .bulk $07,$77,$4c,$50 ab4a: 07 77 48 50 .bulk $07,$77,$48,$50 ab4e: 07 77 50 54 .bulk $07,$77,$50,$54 ab52: 07 66 58 5c .bulk $07,$66,$58,$5c ;deco: vertices 22-28, face 6 ab56: 07 66 5c 60 .bulk $07,$66,$5c,$60 ; (7 edges, "DB") ab5a: 07 66 60 58 .bulk $07,$66,$60,$58 ab5e: 07 66 64 68 .bulk $07,$66,$64,$68 ab62: 07 66 68 6c .bulk $07,$66,$68,$6c ab66: 07 66 64 6c .bulk $07,$66,$64,$6c ab6a: 07 66 6c 70 .bulk $07,$66,$6c,$70 ;(end of decorations) ab6e: 06 33 74 78 .bulk $06,$33,$74,$78 ab72: 06 33 7c 80 .bulk $06,$33,$7c,$80 ab76: 08 00 84 88 .bulk $08,$00,$84,$88 ab7a: 05 00 88 8c .bulk $05,$00,$88,$8c ab7e: 05 00 8c 90 .bulk $05,$00,$8c,$90 ab82: 05 00 90 84 .bulk $05,$00,$90,$84 ab86: 3f 00 00 67 .bulk $3f,$00,$00,$67 ;faces ab8a: bf 6f 30 07 .bulk $bf,$6f,$30,$07 ab8e: ff 69 3f 15 .bulk $ff,$69,$3f,$15 ab92: 5f 00 22 00 .bulk $5f,$00,$22,$00 ab96: 7f 69 3f 15 .bulk $7f,$69,$3f,$15 ab9a: 3f 6f 30 07 .bulk $3f,$6f,$30,$07 ab9e: 1f 08 20 03 .bulk $1f,$08,$20,$03 ;face 6 normal [$08,$20,$03] aba2: 9f 08 20 03 .bulk $9f,$08,$20,$03 ;face 7 normal [-$08,$20,$03] aba6: 93 08 22 0b .bulk $93,$08,$22,$0b abaa: 9f 4b 20 4f .bulk $9f,$4b,$20,$4f abae: 1f 4b 20 4f .bulk $1f,$4b,$20,$4f abb2: 13 08 22 0b .bulk $13,$08,$22,$0b abb6: 1f 00 26 11 .bulk $1f,$00,$26,$11 abba: 1f 00 00 79 .bulk $1f,$00,$00,$79 ; Cobra MK-III. abbe: 03 hull_cobra_mk3 .dd1 $03 abbf: 41 23 .dd2 $2341 abc1: bc .dd1 $bc abc2: 54 .dd1 $54 abc3: 9d .dd1 $9d abc4: 54 .dd1 $54 ;gun vertex (v21) abc5: 2a .dd1 $2a abc6: a8 .dd1 $a8 ;vertex count * 6 abc7: 26 .dd1 $26 ;edge count abc8: 00 00 .dd2 0 abca: 34 .dd1 $34 ;face count * 4 abcb: 32 .dd1 $32 abcc: 96 .dd1 150 ;health abcd: 1c .dd1 28 ;max speed abce: 00 .dd1 $00 abcf: 01 .dd1 $01 abd0: 01 .dd1 $01 abd1: 13 .dd1 %00010011 ;00LLLMMM abd2: 20 00 4c 1f+ .bulk $20,$00,$4c,$1f,$ff,$ff ;vertices abd8: 20 00 4c 9f+ .bulk $20,$00,$4c,$9f,$ff,$ff abde: 00 1a 18 1f+ .bulk $00,$1a,$18,$1f,$ff,$ff abe4: 78 03 08 ff+ .bulk $78,$03,$08,$ff,$73,$aa abea: 78 03 08 7f+ .bulk $78,$03,$08,$7f,$84,$cc abf0: 58 10 28 bf+ .bulk $58,$10,$28,$bf,$ff,$ff abf6: 58 10 28 3f+ .bulk $58,$10,$28,$3f,$ff,$ff abfc: 80 08 28 7f+ .bulk $80,$08,$28,$7f,$98,$cc ac02: 80 08 28 ff+ .bulk $80,$08,$28,$ff,$97,$aa ac08: 00 1a 28 3f+ .bulk $00,$1a,$28,$3f,$65,$99 ac0e: 20 18 28 ff+ .bulk $20,$18,$28,$ff,$a9,$bb ac14: 20 18 28 7f+ .bulk $20,$18,$28,$7f,$b9,$cc ac1a: 24 08 28 b4+ .bulk $24,$08,$28,$b4,$99,$99 ac20: 08 0c 28 b4+ .bulk $08,$0c,$28,$b4,$99,$99 ac26: 08 0c 28 34+ .bulk $08,$0c,$28,$34,$99,$99 ac2c: 24 08 28 34+ .bulk $24,$08,$28,$34,$99,$99 ac32: 24 0c 28 74+ .bulk $24,$0c,$28,$74,$99,$99 ac38: 08 10 28 74+ .bulk $08,$10,$28,$74,$99,$99 ac3e: 08 10 28 f4+ .bulk $08,$10,$28,$f4,$99,$99 ac44: 24 0c 28 f4+ .bulk $24,$0c,$28,$f4,$99,$99 ac4a: 00 00 4c 06+ .bulk $00,$00,$4c,$06,$b0,$bb ac50: 00 00 5a 1f+ .bulk $00,$00,$5a,$1f,$b0,$bb ac56: 50 06 28 e8+ .bulk $50,$06,$28,$e8,$99,$99 ac5c: 50 06 28 a8+ .bulk $50,$06,$28,$a8,$99,$99 ac62: 58 00 28 a6+ .bulk $58,$00,$28,$a6,$99,$99 ac68: 50 06 28 28+ .bulk $50,$06,$28,$28,$99,$99 ac6e: 58 00 28 26+ .bulk $58,$00,$28,$26,$99,$99 ac74: 50 06 28 68+ .bulk $50,$06,$28,$68,$99,$99 ac7a: 1f b0 00 04 .bulk $1f,$b0,$00,$04 ;edges ac7e: 1f c4 00 10 .bulk $1f,$c4,$00,$10 ac82: 1f a3 04 0c .bulk $1f,$a3,$04,$0c ac86: 1f a7 0c 20 .bulk $1f,$a7,$0c,$20 ac8a: 1f c8 10 1c .bulk $1f,$c8,$10,$1c ac8e: 1f 98 18 1c .bulk $1f,$98,$18,$1c ac92: 1f 96 18 24 .bulk $1f,$96,$18,$24 ac96: 1f 95 14 24 .bulk $1f,$95,$14,$24 ac9a: 1f 97 14 20 .bulk $1f,$97,$14,$20 ac9e: 1f 51 08 14 .bulk $1f,$51,$08,$14 aca2: 1f 62 08 18 .bulk $1f,$62,$08,$18 aca6: 1f 73 0c 14 .bulk $1f,$73,$0c,$14 acaa: 1f 84 10 18 .bulk $1f,$84,$10,$18 acae: 1f 10 04 08 .bulk $1f,$10,$04,$08 acb2: 1f 20 00 08 .bulk $1f,$20,$00,$08 acb6: 1f a9 20 28 .bulk $1f,$a9,$20,$28 acba: 1f b9 28 2c .bulk $1f,$b9,$28,$2c acbe: 1f c9 1c 2c .bulk $1f,$c9,$1c,$2c acc2: 1f ba 04 28 .bulk $1f,$ba,$04,$28 acc6: 1f cb 00 2c .bulk $1f,$cb,$00,$2c acca: 1d 31 04 14 .bulk $1d,$31,$04,$14 acce: 1d 42 00 18 .bulk $1d,$42,$00,$18 acd2: 06 b0 50 54 .bulk $06,$b0,$50,$54 acd6: 14 99 30 34 .bulk $14,$99,$30,$34 acda: 14 99 48 4c .bulk $14,$99,$48,$4c acde: 14 99 38 3c .bulk $14,$99,$38,$3c ace2: 14 99 40 44 .bulk $14,$99,$40,$44 ace6: 13 99 3c 40 .bulk $13,$99,$3c,$40 acea: 11 99 38 44 .bulk $11,$99,$38,$44 acee: 13 99 34 48 .bulk $13,$99,$34,$48 acf2: 13 99 30 4c .bulk $13,$99,$30,$4c acf6: 1e 65 08 24 .bulk $1e,$65,$08,$24 acfa: 06 99 58 60 .bulk $06,$99,$58,$60 acfe: 06 99 5c 60 .bulk $06,$99,$5c,$60 ad02: 08 99 58 5c .bulk $08,$99,$58,$5c ad06: 06 99 64 68 .bulk $06,$99,$64,$68 ad0a: 06 99 68 6c .bulk $06,$99,$68,$6c ad0e: 08 99 64 6c .bulk $08,$99,$64,$6c ad12: 1f 00 3e 1f .bulk $1f,$00,$3e,$1f ;faces ad16: 9f 12 37 10 .bulk $9f,$12,$37,$10 ad1a: 1f 12 37 10 .bulk $1f,$12,$37,$10 ad1e: 9f 10 34 0e .bulk $9f,$10,$34,$0e ad22: 1f 10 34 0e .bulk $1f,$10,$34,$0e ad26: 9f 0e 2f 00 .bulk $9f,$0e,$2f,$00 ad2a: 1f 0e 2f 00 .bulk $1f,$0e,$2f,$00 ad2e: 9f 3d 66 00 .bulk $9f,$3d,$66,$00 ad32: 1f 3d 66 00 .bulk $1f,$3d,$66,$00 ad36: 3f 00 00 50 .bulk $3f,$00,$00,$50 ad3a: df 07 2a 09 .bulk $df,$07,$2a,$09 ad3e: 5f 00 1e 06 .bulk $5f,$00,$1e,$06 ad42: 5f 07 2a 09 .bulk $5f,$07,$2a,$09 ; Python. ad46: 05 hull_python .dd1 $05 ad47: 00 19 .dd2 $1900 ad49: 56 .dd1 $56 ad4a: be .dd1 $be ad4b: 59 .dd1 $59 ad4c: 00 .dd1 $00 ad4d: 2a .dd1 $2a ad4e: 42 .dd1 $42 ad4f: 1a .dd1 $1a ad50: 00 00 .dd2 0 ad52: 34 .dd1 $34 ad53: 28 .dd1 $28 ad54: fa .dd1 250 ad55: 14 .dd1 20 ad56: 00 .dd1 $00 ad57: 00 .dd1 $00 ad58: 00 .dd1 $00 ad59: 1b .dd1 %00011011 ad5a: 00 00 e0 1f+ .bulk $00,$00,$e0,$1f,$10,$32 ;vertices ad60: 00 30 30 1f+ .bulk $00,$30,$30,$1f,$10,$54 ad66: 60 00 10 3f+ .bulk $60,$00,$10,$3f,$ff,$ff ad6c: 60 00 10 bf+ .bulk $60,$00,$10,$bf,$ff,$ff ad72: 00 30 20 3f+ .bulk $00,$30,$20,$3f,$54,$98 ad78: 00 18 70 3f+ .bulk $00,$18,$70,$3f,$89,$cc ad7e: 30 00 70 bf+ .bulk $30,$00,$70,$bf,$b8,$cc ad84: 30 00 70 3f+ .bulk $30,$00,$70,$3f,$a9,$cc ad8a: 00 30 30 5f+ .bulk $00,$30,$30,$5f,$32,$76 ad90: 00 30 20 7f+ .bulk $00,$30,$20,$7f,$76,$ba ad96: 00 18 70 7f+ .bulk $00,$18,$70,$7f,$ba,$cc ad9c: 1f 32 00 20 .bulk $1f,$32,$00,$20 ;edges ada0: 1f 20 00 0c .bulk $1f,$20,$00,$0c ada4: 1f 31 00 08 .bulk $1f,$31,$00,$08 ada8: 1f 10 00 04 .bulk $1f,$10,$00,$04 adac: 1f 59 08 10 .bulk $1f,$59,$08,$10 adb0: 1f 51 04 08 .bulk $1f,$51,$04,$08 adb4: 1f 37 08 20 .bulk $1f,$37,$08,$20 adb8: 1f 40 04 0c .bulk $1f,$40,$04,$0c adbc: 1f 62 0c 20 .bulk $1f,$62,$0c,$20 adc0: 1f a7 08 24 .bulk $1f,$a7,$08,$24 adc4: 1f 84 0c 10 .bulk $1f,$84,$0c,$10 adc8: 1f b6 0c 24 .bulk $1f,$b6,$0c,$24 adcc: 07 88 0c 14 .bulk $07,$88,$0c,$14 add0: 07 bb 0c 28 .bulk $07,$bb,$0c,$28 add4: 07 99 08 14 .bulk $07,$99,$08,$14 add8: 07 aa 08 28 .bulk $07,$aa,$08,$28 addc: 1f a9 08 1c .bulk $1f,$a9,$08,$1c ade0: 1f b8 0c 18 .bulk $1f,$b8,$0c,$18 ade4: 1f c8 14 18 .bulk $1f,$c8,$14,$18 ade8: 1f c9 14 1c .bulk $1f,$c9,$14,$1c adec: 1f ac 1c 28 .bulk $1f,$ac,$1c,$28 adf0: 1f cb 18 28 .bulk $1f,$cb,$18,$28 adf4: 1f 98 10 14 .bulk $1f,$98,$10,$14 adf8: 1f ba 24 28 .bulk $1f,$ba,$24,$28 adfc: 1f 54 04 10 .bulk $1f,$54,$04,$10 ae00: 1f 76 20 24 .bulk $1f,$76,$20,$24 ae04: 9f 1b 28 0b .bulk $9f,$1b,$28,$0b ;faces ae08: 1f 1b 28 0b .bulk $1f,$1b,$28,$0b ae0c: df 1b 28 0b .bulk $df,$1b,$28,$0b ae10: 5f 1b 28 0b .bulk $5f,$1b,$28,$0b ae14: 9f 13 26 00 .bulk $9f,$13,$26,$00 ae18: 1f 13 26 00 .bulk $1f,$13,$26,$00 ae1c: df 13 26 00 .bulk $df,$13,$26,$00 ae20: 5f 13 26 00 .bulk $5f,$13,$26,$00 ae24: bf 19 25 0b .bulk $bf,$19,$25,$0b ae28: 3f 19 25 0b .bulk $3f,$19,$25,$0b ae2c: 7f 19 25 0b .bulk $7f,$19,$25,$0b ae30: ff 19 25 0b .bulk $ff,$19,$25,$0b ae34: 3f 00 00 70 .bulk $3f,$00,$00,$70 ; Boa. ae38: 05 hull_boa .dd1 $05 ae39: 24 13 .dd2 $1324 ae3b: 62 .dd1 $62 ae3c: c2 .dd1 $c2 ae3d: 5d .dd1 $5d ae3e: 00 .dd1 $00 ae3f: 26 .dd1 $26 ae40: 4e .dd1 $4e ae41: 18 .dd1 $18 ae42: 00 00 .dd2 0 ae44: 34 .dd1 $34 ae45: 28 .dd1 $28 ae46: fa .dd1 250 ae47: 18 .dd1 24 ae48: 00 .dd1 $00 ae49: 00 .dd1 $00 ae4a: 00 .dd1 $00 ae4b: 1c .dd1 %00011100 ae4c: 00 00 5d 1f+ .bulk $00,$00,$5d,$1f,$ff,$ff ;vertices ae52: 00 28 57 38+ .bulk $00,$28,$57,$38,$02,$33 ae58: 26 19 63 78+ .bulk $26,$19,$63,$78,$01,$44 ae5e: 26 19 63 f8+ .bulk $26,$19,$63,$f8,$12,$55 ae64: 26 28 3b bf+ .bulk $26,$28,$3b,$bf,$23,$69 ae6a: 26 28 3b 3f+ .bulk $26,$28,$3b,$3f,$03,$6b ae70: 3e 00 43 3f+ .bulk $3e,$00,$43,$3f,$04,$8b ae76: 18 41 4f 7f+ .bulk $18,$41,$4f,$7f,$14,$8a ae7c: 18 41 4f ff+ .bulk $18,$41,$4f,$ff,$15,$7a ae82: 3e 00 43 bf+ .bulk $3e,$00,$43,$bf,$25,$79 ae88: 00 07 6b 36+ .bulk $00,$07,$6b,$36,$02,$aa ae8e: 0d 09 6b 76+ .bulk $0d,$09,$6b,$76,$01,$aa ae94: 0d 09 6b f6+ .bulk $0d,$09,$6b,$f6,$12,$cc ae9a: 1f 6b 00 14 .bulk $1f,$6b,$00,$14 ;edges ae9e: 1f 8a 00 1c .bulk $1f,$8a,$00,$1c aea2: 1f 79 00 24 .bulk $1f,$79,$00,$24 aea6: 1d 69 00 10 .bulk $1d,$69,$00,$10 aeaa: 1d 8b 00 18 .bulk $1d,$8b,$00,$18 aeae: 1d 7a 00 20 .bulk $1d,$7a,$00,$20 aeb2: 1f 36 10 14 .bulk $1f,$36,$10,$14 aeb6: 1f 0b 14 18 .bulk $1f,$0b,$14,$18 aeba: 1f 48 18 1c .bulk $1f,$48,$18,$1c aebe: 1f 1a 1c 20 .bulk $1f,$1a,$1c,$20 aec2: 1f 57 20 24 .bulk $1f,$57,$20,$24 aec6: 1f 29 10 24 .bulk $1f,$29,$10,$24 aeca: 18 23 04 10 .bulk $18,$23,$04,$10 aece: 18 03 04 14 .bulk $18,$03,$04,$14 aed2: 18 25 0c 24 .bulk $18,$25,$0c,$24 aed6: 18 15 0c 20 .bulk $18,$15,$0c,$20 aeda: 18 04 08 18 .bulk $18,$04,$08,$18 aede: 18 14 08 1c .bulk $18,$14,$08,$1c aee2: 16 02 04 28 .bulk $16,$02,$04,$28 aee6: 16 01 08 2c .bulk $16,$01,$08,$2c aeea: 16 12 0c 30 .bulk $16,$12,$0c,$30 aeee: 0e 0c 28 2c .bulk $0e,$0c,$28,$2c aef2: 0e 1c 2c 30 .bulk $0e,$1c,$2c,$30 aef6: 0e 2c 30 28 .bulk $0e,$2c,$30,$28 aefa: 3f 2b 25 3c .bulk $3f,$2b,$25,$3c ;faces aefe: 7f 00 2d 59 .bulk $7f,$00,$2d,$59 af02: bf 2b 25 3c .bulk $bf,$2b,$25,$3c af06: 1f 00 28 00 .bulk $1f,$00,$28,$00 af0a: 7f 3e 20 14 .bulk $7f,$3e,$20,$14 af0e: ff 3e 20 14 .bulk $ff,$3e,$20,$14 af12: 1f 00 17 06 .bulk $1f,$00,$17,$06 af16: df 17 0f 09 .bulk $df,$17,$0f,$09 af1a: 5f 17 0f 09 .bulk $5f,$17,$0f,$09 af1e: 9f 1a 0d 0a .bulk $9f,$1a,$0d,$0a af22: 5f 00 1f 0c .bulk $5f,$00,$1f,$0c af26: 1f 1a 0d 0a .bulk $1f,$1a,$0d,$0a af2a: 2e 00 00 6b .bulk $2e,$00,$00,$6b ; Anaconda. af2e: 07 hull_anaconda .dd1 $07 af2f: 10 27 .dd2 $2710 af31: 6e .dd1 $6e af32: d2 .dd1 $d2 af33: 5d .dd1 $5d af34: 30 .dd1 $30 af35: 2e .dd1 $2e af36: 5a .dd1 $5a af37: 19 .dd1 $19 af38: 00 00 .dd2 0 af3a: 30 .dd1 $30 af3b: 24 .dd1 $24 af3c: fc .dd1 252 af3d: 0e .dd1 14 af3e: 00 .dd1 $00 af3f: 00 .dd1 $00 af40: 01 .dd1 $01 af41: 3f .dd1 %00111111 af42: 00 07 3a 3e+ .bulk $00,$07,$3a,$3e,$01,$55 ;vertices af48: 2b 0d 25 fe+ .bulk $2b,$0d,$25,$fe,$01,$22 af4e: 1a 2f 03 fe+ .bulk $1a,$2f,$03,$fe,$02,$33 af54: 1a 2f 03 7e+ .bulk $1a,$2f,$03,$7e,$03,$44 af5a: 2b 0d 25 7e+ .bulk $2b,$0d,$25,$7e,$04,$55 af60: 00 30 31 3e+ .bulk $00,$30,$31,$3e,$15,$66 af66: 45 0f 0f be+ .bulk $45,$0f,$0f,$be,$12,$77 af6c: 2b 27 28 df+ .bulk $2b,$27,$28,$df,$23,$88 af72: 2b 27 28 5f+ .bulk $2b,$27,$28,$5f,$34,$99 af78: 45 0f 0f 3e+ .bulk $45,$0f,$0f,$3e,$45,$aa af7e: 2b 35 17 bf+ .bulk $2b,$35,$17,$bf,$ff,$ff af84: 45 01 20 df+ .bulk $45,$01,$20,$df,$27,$88 af8a: 00 00 fe 1f+ .bulk $00,$00,$fe,$1f,$ff,$ff af90: 45 01 20 5f+ .bulk $45,$01,$20,$5f,$49,$aa af96: 2b 35 17 3f+ .bulk $2b,$35,$17,$3f,$ff,$ff af9c: 1e 01 00 04 .bulk $1e,$01,$00,$04 ;edges afa0: 1e 02 04 08 .bulk $1e,$02,$04,$08 afa4: 1e 03 08 0c .bulk $1e,$03,$08,$0c afa8: 1e 04 0c 10 .bulk $1e,$04,$0c,$10 afac: 1e 05 00 10 .bulk $1e,$05,$00,$10 afb0: 1d 15 00 14 .bulk $1d,$15,$00,$14 afb4: 1d 12 04 18 .bulk $1d,$12,$04,$18 afb8: 1d 23 08 1c .bulk $1d,$23,$08,$1c afbc: 1d 34 0c 20 .bulk $1d,$34,$0c,$20 afc0: 1d 45 10 24 .bulk $1d,$45,$10,$24 afc4: 1e 16 14 28 .bulk $1e,$16,$14,$28 afc8: 1e 17 18 28 .bulk $1e,$17,$18,$28 afcc: 1e 27 18 2c .bulk $1e,$27,$18,$2c afd0: 1e 28 1c 2c .bulk $1e,$28,$1c,$2c afd4: 1f 38 1c 30 .bulk $1f,$38,$1c,$30 afd8: 1f 39 20 30 .bulk $1f,$39,$20,$30 afdc: 1e 49 20 34 .bulk $1e,$49,$20,$34 afe0: 1e 4a 24 34 .bulk $1e,$4a,$24,$34 afe4: 1e 5a 24 38 .bulk $1e,$5a,$24,$38 afe8: 1e 56 14 38 .bulk $1e,$56,$14,$38 afec: 1e 6b 28 38 .bulk $1e,$6b,$28,$38 aff0: 1f 7b 28 30 .bulk $1f,$7b,$28,$30 aff4: 1f 78 2c 30 .bulk $1f,$78,$2c,$30 aff8: 1f 9a 30 34 .bulk $1f,$9a,$30,$34 affc: 1f ab 30 38 .bulk $1f,$ab,$30,$38 b000: 7e 00 33 31 .bulk $7e,$00,$33,$31 ;faces b004: be 33 12 57 .bulk $be,$33,$12,$57 b008: fe 4d 39 13 .bulk $fe,$4d,$39,$13 b00c: 5f 00 5a 10 .bulk $5f,$00,$5a,$10 b010: 7e 4d 39 13 .bulk $7e,$4d,$39,$13 b014: 3e 33 12 57 .bulk $3e,$33,$12,$57 b018: 3e 00 6f 14 .bulk $3e,$00,$6f,$14 b01c: 9f 61 48 18 .bulk $9f,$61,$48,$18 b020: df 6c 44 22 .bulk $df,$6c,$44,$22 b024: 5f 6c 44 22 .bulk $5f,$6c,$44,$22 b028: 1f 61 48 18 .bulk $1f,$61,$48,$18 b02c: 1f 00 5e 12 .bulk $1f,$00,$5e,$12 ; Crewed asteroid. ; ; The vertices for this one match hull_asteroid, and it shares the actual ; edge/face data: hull_asteroid: ; ; edges at +$F7B2 = $A7E2 = asteroid edges ; faces at +$F806 = $A836 = asteroid faces ; ; The only differences are in the ship characteristics: this has 3x the health ; of an Asteroid, and has a pair of missiles. The flags indicate that it has an ; escape pod and is a trader. b030: 07 hull_asteroid2 .dd1 $07 b031: 00 19 .dd2 $1900 b033: b2 .dd1 $b2 b034: 06 .dd1 $06 b035: 45 .dd1 $45 b036: 00 .dd1 $00 b037: 32 .dd1 $32 b038: 36 .dd1 $36 b039: 15 .dd1 $15 b03a: 00 00 .dd2 0 b03c: 38 .dd1 $38 b03d: 32 .dd1 $32 b03e: b4 .dd1 180 b03f: 1e .dd1 30 b040: f7 .dd1 $f7 b041: f8 .dd1 $f8 b042: 01 .dd1 $01 b043: 02 .dd1 %00000010 b044: 00 50 00 1f+ .bulk $00,$50,$00,$1f,$ff,$ff ;vertices b04a: 50 0a 00 df+ .bulk $50,$0a,$00,$df,$ff,$ff b050: 00 50 00 5f+ .bulk $00,$50,$00,$5f,$ff,$ff b056: 46 28 00 5f+ .bulk $46,$28,$00,$5f,$ff,$ff b05c: 3c 32 00 1f+ .bulk $3c,$32,$00,$1f,$65,$dc b062: 32 00 3c 1f+ .bulk $32,$00,$3c,$1f,$ff,$ff b068: 28 00 46 9f+ .bulk $28,$00,$46,$9f,$10,$32 b06e: 00 1e 4b 3f+ .bulk $00,$1e,$4b,$3f,$ff,$ff b074: 00 32 3c 7f+ .bulk $00,$32,$3c,$7f,$98,$ba ; Viper. b07a: 00 hull_viper .dd1 $00 b07b: f9 15 .dd2 $15f9 b07d: 6e .dd1 $6e b07e: be .dd1 $be b07f: 51 .dd1 $51 b080: 00 .dd1 $00 b081: 2a .dd1 $2a b082: 5a .dd1 $5a b083: 14 .dd1 $14 b084: 00 00 .dd2 0 b086: 1c .dd1 $1c b087: 17 .dd1 $17 b088: 8c .dd1 140 b089: 20 .dd1 32 b08a: 00 .dd1 $00 b08b: 00 .dd1 $00 b08c: 01 .dd1 $01 b08d: 11 .dd1 %00010001 b08e: 00 00 48 1f+ .bulk $00,$00,$48,$1f,$21,$43 ;vertices b094: 00 10 18 1e+ .bulk $00,$10,$18,$1e,$10,$22 b09a: 00 10 18 5e+ .bulk $00,$10,$18,$5e,$43,$55 b0a0: 30 00 18 3f+ .bulk $30,$00,$18,$3f,$42,$66 b0a6: 30 00 18 bf+ LB0A6 .bulk $30,$00,$18,$bf,$31,$66 b0ac: 18 10 18 7e+ .bulk $18,$10,$18,$7e,$54,$66 b0b2: 18 10 18 fe+ .bulk $18,$10,$18,$fe,$35,$66 b0b8: 18 10 18 3f+ .bulk $18,$10,$18,$3f,$20,$66 b0be: 18 10 18 bf+ .bulk $18,$10,$18,$bf,$10,$66 b0c4: 20 00 18 b3+ .bulk $20,$00,$18,$b3,$66,$66 b0ca: 20 00 18 33+ .bulk $20,$00,$18,$33,$66,$66 b0d0: 08 08 18 33+ .bulk $08,$08,$18,$33,$66,$66 b0d6: 08 08 18 b3+ .bulk $08,$08,$18,$b3,$66,$66 b0dc: 08 08 18 f2+ .bulk $08,$08,$18,$f2,$66,$66 b0e2: 08 08 18 72+ .bulk $08,$08,$18,$72,$66,$66 b0e8: 1f 42 00 0c .bulk $1f,$42,$00,$0c ;edges b0ec: 1e 21 00 04 .bulk $1e,$21,$00,$04 b0f0: 1e 43 00 08 .bulk $1e,$43,$00,$08 b0f4: 1f 31 00 10 .bulk $1f,$31,$00,$10 b0f8: 1e 20 04 1c .bulk $1e,$20,$04,$1c b0fc: 1e 10 04 20 .bulk $1e,$10,$04,$20 b100: 1e 54 08 14 .bulk $1e,$54,$08,$14 b104: 1e 53 08 18 .bulk $1e,$53,$08,$18 b108: 1f 60 1c 20 .bulk $1f,$60,$1c,$20 b10c: 1e 65 14 18 .bulk $1e,$65,$14,$18 b110: 1f 61 10 20 .bulk $1f,$61,$10,$20 b114: 1e 63 10 18 .bulk $1e,$63,$10,$18 b118: 1f 62 0c 1c .bulk $1f,$62,$0c,$1c b11c: 1e 46 0c 14 .bulk $1e,$46,$0c,$14 b120: 13 66 24 30 .bulk $13,$66,$24,$30 b124: 12 66 24 34 .bulk $12,$66,$24,$34 b128: 13 66 28 2c .bulk $13,$66,$28,$2c b12c: 12 66 28 38 .bulk $12,$66,$28,$38 b130: 10 66 2c 38 .bulk $10,$66,$2c,$38 b134: 10 66 30 34 .bulk $10,$66,$30,$34 b138: 1f 00 20 00 .bulk $1f,$00,$20,$00 ;faces b13c: 9f 16 21 0b .bulk $9f,$16,$21,$0b b140: 1f 16 21 0b .bulk $1f,$16,$21,$0b b144: df 16 21 0b .bulk $df,$16,$21,$0b b148: 5f 16 21 0b .bulk $5f,$16,$21,$0b b14c: 5f 00 20 00 .bulk $5f,$00,$20,$00 b150: 3f 00 00 30 .bulk $3f,$00,$00,$30 ; Sidewinder. b154: 00 hull_sidewinder .dd1 $00 b155: 81 10 .dd2 $1081 b157: 50 .dd1 $50 b158: 8c .dd1 $8c b159: 41 .dd1 $41 b15a: 00 .dd1 $00 b15b: 1e .dd1 $1e b15c: 3c .dd1 $3c b15d: 0f .dd1 $0f b15e: 32 00 .dd2 50 ;bounty (50) b160: 1c .dd1 $1c b161: 14 .dd1 $14 b162: 46 .dd1 70 b163: 25 .dd1 37 b164: 00 .dd1 $00 b165: 00 .dd1 $00 b166: 02 .dd1 $02 b167: 10 .dd1 %00010000 b168: 20 00 24 9f+ .bulk $20,$00,$24,$9f,$10,$54 ;vertices b16e: 20 00 24 1f+ .bulk $20,$00,$24,$1f,$20,$65 b174: 40 00 1c 3f+ .bulk $40,$00,$1c,$3f,$32,$66 b17a: 40 00 1c bf+ .bulk $40,$00,$1c,$bf,$31,$44 b180: 00 10 1c 3f+ .bulk $00,$10,$1c,$3f,$10,$32 b186: 00 10 1c 7f+ .bulk $00,$10,$1c,$7f,$43,$65 b18c: 0c 06 1c af+ .bulk $0c,$06,$1c,$af,$33,$33 b192: 0c 06 1c 2f+ .bulk $0c,$06,$1c,$2f,$33,$33 b198: 0c 06 1c 6c+ .bulk $0c,$06,$1c,$6c,$33,$33 b19e: 0c 06 1c ec+ .bulk $0c,$06,$1c,$ec,$33,$33 b1a4: 1f 50 00 04 .bulk $1f,$50,$00,$04 ;edges b1a8: 1f 62 04 08 .bulk $1f,$62,$04,$08 b1ac: 1f 20 04 10 .bulk $1f,$20,$04,$10 b1b0: 1f 10 00 10 .bulk $1f,$10,$00,$10 b1b4: 1f 41 00 0c .bulk $1f,$41,$00,$0c b1b8: 1f 31 0c 10 .bulk $1f,$31,$0c,$10 b1bc: 1f 32 08 10 .bulk $1f,$32,$08,$10 b1c0: 1f 43 0c 14 .bulk $1f,$43,$0c,$14 b1c4: 1f 63 08 14 .bulk $1f,$63,$08,$14 b1c8: 1f 65 04 14 .bulk $1f,$65,$04,$14 b1cc: 1f 54 00 14 .bulk $1f,$54,$00,$14 b1d0: 0f 33 18 1c .bulk $0f,$33,$18,$1c b1d4: 0c 33 1c 20 .bulk $0c,$33,$1c,$20 b1d8: 0c 33 18 24 .bulk $0c,$33,$18,$24 b1dc: 0c 33 20 24 .bulk $0c,$33,$20,$24 b1e0: 1f 00 20 08 .bulk $1f,$00,$20,$08 ;faces b1e4: 9f 0c 2f 06 .bulk $9f,$0c,$2f,$06 b1e8: 1f 0c 2f 06 .bulk $1f,$0c,$2f,$06 b1ec: 3f 00 00 70 .bulk $3f,$00,$00,$70 b1f0: df 0c 2f 06 .bulk $df,$0c,$2f,$06 b1f4: 5f 00 20 08 .bulk $5f,$00,$20,$08 b1f8: 5f 0c 2f 06 .bulk $5f,$0c,$2f,$06 ; Mamba. b1fc: 01 hull_mamba .dd1 $01 b1fd: 24 13 .dd2 $1324 b1ff: aa .dd1 $aa b200: 1a .dd1 $1a b201: 61 .dd1 $61 b202: 00 .dd1 $00 b203: 22 .dd1 $22 b204: 96 .dd1 $96 b205: 1c .dd1 $1c b206: 96 00 .dd2 150 ;bounty (150) b208: 14 .dd1 $14 b209: 19 .dd1 $19 b20a: 5a .dd1 90 b20b: 1e .dd1 30 b20c: 00 .dd1 $00 b20d: 01 .dd1 $01 b20e: 02 .dd1 $02 b20f: 12 .dd1 %00010010 b210: 00 00 40 1f+ .bulk $00,$00,$40,$1f,$10,$32 ;vertices b216: 40 08 20 ff+ .bulk $40,$08,$20,$ff,$20,$44 b21c: 20 08 20 be+ .bulk $20,$08,$20,$be,$21,$44 b222: 20 08 20 3e+ .bulk $20,$08,$20,$3e,$31,$44 b228: 40 08 20 7f+ .bulk $40,$08,$20,$7f,$30,$44 b22e: 04 04 10 8e+ .bulk $04,$04,$10,$8e,$11,$11 b234: 04 04 10 0e+ .bulk $04,$04,$10,$0e,$11,$11 b23a: 08 03 1c 0d+ .bulk $08,$03,$1c,$0d,$11,$11 b240: 08 03 1c 8d+ .bulk $08,$03,$1c,$8d,$11,$11 b246: 14 04 10 d4+ .bulk $14,$04,$10,$d4,$00,$00 b24c: 14 04 10 54+ .bulk $14,$04,$10,$54,$00,$00 b252: 18 07 14 f4+ .bulk $18,$07,$14,$f4,$00,$00 b258: 10 07 14 f0+ .bulk $10,$07,$14,$f0,$00,$00 b25e: 10 07 14 70+ .bulk $10,$07,$14,$70,$00,$00 b264: 18 07 14 74+ .bulk $18,$07,$14,$74,$00,$00 b26a: 08 04 20 ad+ .bulk $08,$04,$20,$ad,$44,$44 b270: 08 04 20 2d+ .bulk $08,$04,$20,$2d,$44,$44 b276: 08 04 20 6e+ .bulk $08,$04,$20,$6e,$44,$44 b27c: 08 04 20 ee+ .bulk $08,$04,$20,$ee,$44,$44 b282: 20 04 20 a7+ .bulk $20,$04,$20,$a7,$44,$44 b288: 20 04 20 27+ .bulk $20,$04,$20,$27,$44,$44 b28e: 24 04 20 67+ .bulk $24,$04,$20,$67,$44,$44 b294: 24 04 20 e7+ .bulk $24,$04,$20,$e7,$44,$44 b29a: 26 00 20 a5+ .bulk $26,$00,$20,$a5,$44,$44 b2a0: 26 00 20 25+ .bulk $26,$00,$20,$25,$44,$44 b2a6: 1f 20 00 04 .bulk $1f,$20,$00,$04 ;edges b2aa: 1f 30 00 10 .bulk $1f,$30,$00,$10 b2ae: 1f 40 04 10 .bulk $1f,$40,$04,$10 b2b2: 1e 42 04 08 .bulk $1e,$42,$04,$08 b2b6: 1e 41 08 0c .bulk $1e,$41,$08,$0c b2ba: 1e 43 0c 10 .bulk $1e,$43,$0c,$10 b2be: 0e 11 14 18 .bulk $0e,$11,$14,$18 b2c2: 0c 11 18 1c .bulk $0c,$11,$18,$1c b2c6: 0d 11 1c 20 .bulk $0d,$11,$1c,$20 b2ca: 0c 11 14 20 .bulk $0c,$11,$14,$20 b2ce: 14 00 24 2c .bulk $14,$00,$24,$2c b2d2: 10 00 24 30 .bulk $10,$00,$24,$30 b2d6: 10 00 28 34 .bulk $10,$00,$28,$34 b2da: 14 00 28 38 .bulk $14,$00,$28,$38 b2de: 0e 00 34 38 .bulk $0e,$00,$34,$38 b2e2: 0e 00 2c 30 .bulk $0e,$00,$2c,$30 b2e6: 0d 44 3c 40 .bulk $0d,$44,$3c,$40 b2ea: 0e 44 44 48 .bulk $0e,$44,$44,$48 b2ee: 0c 44 3c 48 .bulk $0c,$44,$3c,$48 b2f2: 0c 44 40 44 .bulk $0c,$44,$40,$44 b2f6: 07 44 50 54 .bulk $07,$44,$50,$54 b2fa: 05 44 50 60 .bulk $05,$44,$50,$60 b2fe: 05 44 54 60 .bulk $05,$44,$54,$60 b302: 07 44 4c 58 .bulk $07,$44,$4c,$58 b306: 05 44 4c 5c .bulk $05,$44,$4c,$5c b30a: 05 44 58 5c .bulk $05,$44,$58,$5c b30e: 1e 21 00 08 .bulk $1e,$21,$00,$08 b312: 1e 31 00 0c .bulk $1e,$31,$00,$0c b316: 5e 00 18 02 .bulk $5e,$00,$18,$02 ;faces b31a: 1e 00 18 02 .bulk $1e,$00,$18,$02 b31e: 9e 20 40 10 .bulk $9e,$20,$40,$10 b322: 1e 20 40 10 .bulk $1e,$20,$40,$10 b326: 3e 00 00 7f .bulk $3e,$00,$00,$7f ; Krait. b32a: 01 hull_krait .dd1 $01 b32b: 10 0e .dd2 $0e10 b32d: 7a .dd1 $7a b32e: ce .dd1 $ce b32f: 59 .dd1 $59 b330: 00 .dd1 $00 b331: 12 .dd1 $12 b332: 66 .dd1 $66 b333: 15 .dd1 $15 b334: 64 00 .dd2 100 ;bounty (100) b336: 18 .dd1 $18 b337: 14 .dd1 $14 b338: 50 .dd1 80 b339: 1e .dd1 30 b33a: 00 .dd1 $00 b33b: 00 .dd1 $00 b33c: 01 .dd1 $01 b33d: 10 .dd1 %00010000 b33e: 00 00 60 1f+ .bulk $00,$00,$60,$1f,$01,$23 ;vertices b344: 00 12 30 3f+ .bulk $00,$12,$30,$3f,$03,$45 b34a: 00 12 30 7f+ .bulk $00,$12,$30,$7f,$12,$45 b350: 5a 00 03 3f+ .bulk $5a,$00,$03,$3f,$01,$44 b356: 5a 00 03 bf+ .bulk $5a,$00,$03,$bf,$23,$55 b35c: 5a 00 57 1e+ .bulk $5a,$00,$57,$1e,$01,$11 b362: 5a 00 57 9e+ .bulk $5a,$00,$57,$9e,$23,$33 b368: 00 05 35 09+ .bulk $00,$05,$35,$09,$00,$33 b36e: 00 07 26 06+ .bulk $00,$07,$26,$06,$00,$33 b374: 12 07 13 89+ .bulk $12,$07,$13,$89,$33,$33 b37a: 12 07 13 09+ .bulk $12,$07,$13,$09,$00,$00 b380: 12 0b 27 28+ .bulk $12,$0b,$27,$28,$44,$44 b386: 12 0b 27 68+ .bulk $12,$0b,$27,$68,$44,$44 b38c: 24 00 1e 28+ .bulk $24,$00,$1e,$28,$44,$44 b392: 12 0b 27 a8+ .bulk $12,$0b,$27,$a8,$55,$55 b398: 12 0b 27 e8+ .bulk $12,$0b,$27,$e8,$55,$55 b39e: 24 00 1e a8+ .bulk $24,$00,$1e,$a8,$55,$55 b3a4: 1f 03 00 04 .bulk $1f,$03,$00,$04 ;edges b3a8: 1f 12 00 08 .bulk $1f,$12,$00,$08 b3ac: 1f 01 00 0c .bulk $1f,$01,$00,$0c b3b0: 1f 23 00 10 .bulk $1f,$23,$00,$10 b3b4: 1f 35 04 10 .bulk $1f,$35,$04,$10 b3b8: 1f 25 10 08 .bulk $1f,$25,$10,$08 b3bc: 1f 14 08 0c .bulk $1f,$14,$08,$0c b3c0: 1f 04 0c 04 .bulk $1f,$04,$0c,$04 b3c4: 1e 01 0c 14 .bulk $1e,$01,$0c,$14 b3c8: 1e 23 10 18 .bulk $1e,$23,$10,$18 b3cc: 08 45 04 08 .bulk $08,$45,$04,$08 b3d0: 09 00 1c 28 .bulk $09,$00,$1c,$28 b3d4: 06 00 20 28 .bulk $06,$00,$20,$28 b3d8: 09 33 1c 24 .bulk $09,$33,$1c,$24 b3dc: 06 33 20 24 .bulk $06,$33,$20,$24 b3e0: 08 44 2c 34 .bulk $08,$44,$2c,$34 b3e4: 08 44 34 30 .bulk $08,$44,$34,$30 b3e8: 07 44 30 2c .bulk $07,$44,$30,$2c b3ec: 07 55 38 3c .bulk $07,$55,$38,$3c b3f0: 08 55 3c 40 .bulk $08,$55,$3c,$40 b3f4: 08 55 40 38 .bulk $08,$55,$40,$38 b3f8: 1f 03 18 03 .bulk $1f,$03,$18,$03 ;faces b3fc: 5f 03 18 03 .bulk $5f,$03,$18,$03 b400: df 03 18 03 .bulk $df,$03,$18,$03 b404: 9f 03 18 03 .bulk $9f,$03,$18,$03 b408: 3f 26 00 4d .bulk $3f,$26,$00,$4d b40c: bf 26 00 4d .bulk $bf,$26,$00,$4d ; Adder. b410: 00 hull_adder .dd1 $00 b411: c4 09 .dd2 $09c4 b413: 80 .dd1 $80 b414: f4 .dd1 $f4 b415: 65 .dd1 $65 b416: 00 .dd1 $00 b417: 16 .dd1 $16 b418: 6c .dd1 $6c b419: 1d .dd1 $1d b41a: 28 00 .dd2 40 ;bounty (40) b41c: 3c .dd1 $3c b41d: 14 .dd1 $14 b41e: 55 .dd1 85 b41f: 18 .dd1 24 b420: 00 .dd1 $00 b421: 00 .dd1 $00 b422: 02 .dd1 $02 b423: 10 .dd1 %00010000 b424: 12 00 28 9f+ .bulk $12,$00,$28,$9f,$01,$bc ;vertices b42a: 12 00 28 1f+ .bulk $12,$00,$28,$1f,$01,$23 b430: 1e 00 18 3f+ .bulk $1e,$00,$18,$3f,$23,$45 b436: 1e 00 28 3f+ .bulk $1e,$00,$28,$3f,$45,$66 b43c: 12 07 28 7f+ .bulk $12,$07,$28,$7f,$56,$7e b442: 12 07 28 ff+ .bulk $12,$07,$28,$ff,$78,$ae b448: 1e 00 28 bf+ .bulk $1e,$00,$28,$bf,$89,$aa b44e: 1e 00 18 bf+ .bulk $1e,$00,$18,$bf,$9a,$bc b454: 12 07 28 bf+ .bulk $12,$07,$28,$bf,$78,$9d b45a: 12 07 28 3f+ .bulk $12,$07,$28,$3f,$46,$7d b460: 12 07 0d 9f+ .bulk $12,$07,$0d,$9f,$09,$bd b466: 12 07 0d 1f+ .bulk $12,$07,$0d,$1f,$02,$4d b46c: 12 07 0d df+ .bulk $12,$07,$0d,$df,$1a,$ce b472: 12 07 0d 5f+ .bulk $12,$07,$0d,$5f,$13,$5e b478: 0b 03 1d 85+ .bulk $0b,$03,$1d,$85,$00,$00 b47e: 0b 03 1d 05+ .bulk $0b,$03,$1d,$05,$00,$00 b484: 0b 04 18 04+ .bulk $0b,$04,$18,$04,$00,$00 b48a: 0b 04 18 84+ .bulk $0b,$04,$18,$84,$00,$00 b490: 1f 01 00 04 .bulk $1f,$01,$00,$04 ;edges b494: 07 23 04 08 .bulk $07,$23,$04,$08 b498: 1f 45 08 0c .bulk $1f,$45,$08,$0c b49c: 1f 56 0c 10 .bulk $1f,$56,$0c,$10 b4a0: 1f 7e 10 14 .bulk $1f,$7e,$10,$14 b4a4: 1f 8a 14 18 .bulk $1f,$8a,$14,$18 b4a8: 1f 9a 18 1c .bulk $1f,$9a,$18,$1c b4ac: 07 bc 1c 00 .bulk $07,$bc,$1c,$00 b4b0: 1f 46 0c 24 .bulk $1f,$46,$0c,$24 b4b4: 1f 7d 24 20 .bulk $1f,$7d,$24,$20 b4b8: 1f 89 20 18 .bulk $1f,$89,$20,$18 b4bc: 1f 0b 00 28 .bulk $1f,$0b,$00,$28 b4c0: 1f 9b 1c 28 .bulk $1f,$9b,$1c,$28 b4c4: 1f 02 04 2c .bulk $1f,$02,$04,$2c b4c8: 1f 24 08 2c .bulk $1f,$24,$08,$2c b4cc: 1f 1c 00 30 .bulk $1f,$1c,$00,$30 b4d0: 1f ac 1c 30 .bulk $1f,$ac,$1c,$30 b4d4: 1f 13 04 34 .bulk $1f,$13,$04,$34 b4d8: 1f 35 08 34 .bulk $1f,$35,$08,$34 b4dc: 1f 0d 28 2c .bulk $1f,$0d,$28,$2c b4e0: 1f 1e 30 34 .bulk $1f,$1e,$30,$34 b4e4: 1f 9d 20 28 .bulk $1f,$9d,$20,$28 b4e8: 1f 4d 24 2c .bulk $1f,$4d,$24,$2c b4ec: 1f ae 14 30 .bulk $1f,$ae,$14,$30 b4f0: 1f 5e 10 34 .bulk $1f,$5e,$10,$34 b4f4: 05 00 38 3c .bulk $05,$00,$38,$3c b4f8: 03 00 3c 40 .bulk $03,$00,$3c,$40 b4fc: 04 00 40 44 .bulk $04,$00,$40,$44 b500: 03 00 44 38 .bulk $03,$00,$44,$38 b504: 1f 00 27 0a .bulk $1f,$00,$27,$0a ;faces b508: 5f 00 27 0a .bulk $5f,$00,$27,$0a b50c: 1f 45 32 0d .bulk $1f,$45,$32,$0d b510: 5f 45 32 0d .bulk $5f,$45,$32,$0d b514: 1f 1e 34 00 .bulk $1f,$1e,$34,$00 b518: 5f 1e 34 00 .bulk $5f,$1e,$34,$00 b51c: 3f 00 00 a0 .bulk $3f,$00,$00,$a0 b520: 3f 00 00 a0 .bulk $3f,$00,$00,$a0 b524: 3f 00 00 a0 .bulk $3f,$00,$00,$a0 b528: 9f 1e 34 00 .bulk $9f,$1e,$34,$00 b52c: df 1e 34 00 .bulk $df,$1e,$34,$00 b530: 9f 45 32 0d .bulk $9f,$45,$32,$0d b534: df 45 32 0d .bulk $df,$45,$32,$0d b538: 1f 00 1c 00 .bulk $1f,$00,$1c,$00 b53c: 5f 00 1c 00 .bulk $5f,$00,$1c,$00 ; Gecko. b540: 00 hull_gecko .dd1 $00 b541: 49 26 .dd2 $2649 b543: 5c .dd1 $5c b544: a0 .dd1 $a0 b545: 45 .dd1 $45 b546: 00 .dd1 $00 b547: 1a .dd1 $1a b548: 48 .dd1 $48 b549: 11 .dd1 $11 b54a: 37 00 .dd2 55 ;bounty (55) b54c: 24 .dd1 $24 b54d: 12 .dd1 $12 b54e: 46 .dd1 70 b54f: 1e .dd1 30 b550: 00 .dd1 $00 b551: 00 .dd1 $00 b552: 03 .dd1 $03 b553: 10 .dd1 %00010000 b554: 0a 04 2f df+ .bulk $0a,$04,$2f,$df,$03,$45 ;vertices b55a: 0a 04 2f 5f+ .bulk $0a,$04,$2f,$5f,$01,$23 b560: 10 08 17 bf+ .bulk $10,$08,$17,$bf,$05,$67 b566: 10 08 17 3f+ .bulk $10,$08,$17,$3f,$01,$78 b56c: 42 00 03 bf+ .bulk $42,$00,$03,$bf,$45,$66 b572: 42 00 03 3f+ .bulk $42,$00,$03,$3f,$12,$88 b578: 14 0e 17 ff+ .bulk $14,$0e,$17,$ff,$34,$67 b57e: 14 0e 17 7f+ .bulk $14,$0e,$17,$7f,$23,$78 b584: 08 06 21 d0+ .bulk $08,$06,$21,$d0,$33,$33 b58a: 08 06 21 51+ .bulk $08,$06,$21,$51,$33,$33 b590: 08 0d 10 f0+ .bulk $08,$0d,$10,$f0,$33,$33 b596: 08 0d 10 71+ .bulk $08,$0d,$10,$71,$33,$33 b59c: 1f 03 00 04 .bulk $1f,$03,$00,$04 ;edges b5a0: 1f 12 04 14 .bulk $1f,$12,$04,$14 b5a4: 1f 18 14 0c .bulk $1f,$18,$14,$0c b5a8: 1f 07 0c 08 .bulk $1f,$07,$0c,$08 b5ac: 1f 56 08 10 .bulk $1f,$56,$08,$10 b5b0: 1f 45 10 00 .bulk $1f,$45,$10,$00 b5b4: 1f 28 14 1c .bulk $1f,$28,$14,$1c b5b8: 1f 37 1c 18 .bulk $1f,$37,$1c,$18 b5bc: 1f 46 18 10 .bulk $1f,$46,$18,$10 b5c0: 1d 05 00 08 .bulk $1d,$05,$00,$08 b5c4: 1e 01 04 0c .bulk $1e,$01,$04,$0c b5c8: 1d 34 00 18 .bulk $1d,$34,$00,$18 b5cc: 1e 23 04 1c .bulk $1e,$23,$04,$1c b5d0: 14 67 08 18 .bulk $14,$67,$08,$18 b5d4: 14 78 0c 1c .bulk $14,$78,$0c,$1c b5d8: 10 33 20 28 .bulk $10,$33,$20,$28 b5dc: 11 33 24 2c .bulk $11,$33,$24,$2c b5e0: 1f 00 1f 05 .bulk $1f,$00,$1f,$05 ;faces b5e4: 1f 04 2d 08 .bulk $1f,$04,$2d,$08 b5e8: 5f 19 6c 13 .bulk $5f,$19,$6c,$13 b5ec: 5f 00 54 0c .bulk $5f,$00,$54,$0c b5f0: df 19 6c 13 .bulk $df,$19,$6c,$13 b5f4: 9f 04 2d 08 .bulk $9f,$04,$2d,$08 b5f8: bf 58 10 d6 .bulk $bf,$58,$10,$d6 b5fc: 3f 00 00 bb .bulk $3f,$00,$00,$bb b600: 3f 58 10 d6 .bulk $3f,$58,$10,$d6 ; Cobra MK-I. b604: 03 hull_cobra_mk1 .dd1 $03 b605: 49 26 .dd2 $2649 b607: 56 .dd1 $56 b608: 9e .dd1 $9e b609: 49 .dd1 $49 b60a: 28 .dd1 $28 b60b: 1a .dd1 $1a b60c: 42 .dd1 $42 b60d: 12 .dd1 $12 b60e: 4b 00 .dd2 75 ;bounty (75) b610: 28 .dd1 $28 b611: 13 .dd1 $13 b612: 5a .dd1 90 b613: 1a .dd1 26 b614: 00 .dd1 $00 b615: 00 .dd1 $00 b616: 02 .dd1 $02 b617: 12 .dd1 %00010010 b618: 12 01 32 df+ .bulk $12,$01,$32,$df,$01,$23 ;vertices b61e: 12 01 32 5f+ .bulk $12,$01,$32,$5f,$01,$45 b624: 42 00 07 9f+ .bulk $42,$00,$07,$9f,$23,$88 b62a: 42 00 07 1f+ .bulk $42,$00,$07,$1f,$45,$99 b630: 20 0c 26 bf+ .bulk $20,$0c,$26,$bf,$26,$78 b636: 20 0c 26 3f+ .bulk $20,$0c,$26,$3f,$46,$79 b63c: 36 0c 26 ff+ .bulk $36,$0c,$26,$ff,$13,$78 b642: 36 0c 26 7f+ .bulk $36,$0c,$26,$7f,$15,$79 b648: 00 0c 06 34+ .bulk $00,$0c,$06,$34,$02,$46 b64e: 00 01 32 42+ .bulk $00,$01,$32,$42,$01,$11 b654: 00 01 3c 5f+ .bulk $00,$01,$3c,$5f,$01,$11 b65a: 1f 01 04 00 .bulk $1f,$01,$04,$00 ;edges b65e: 1f 23 00 08 .bulk $1f,$23,$00,$08 b662: 1f 38 08 18 .bulk $1f,$38,$08,$18 b666: 1f 17 18 1c .bulk $1f,$17,$18,$1c b66a: 1f 59 1c 0c .bulk $1f,$59,$1c,$0c b66e: 1f 45 0c 04 .bulk $1f,$45,$0c,$04 b672: 1f 28 08 10 .bulk $1f,$28,$08,$10 b676: 1f 67 10 14 .bulk $1f,$67,$10,$14 b67a: 1f 49 14 0c .bulk $1f,$49,$14,$0c b67e: 14 02 00 20 .bulk $14,$02,$00,$20 b682: 14 04 20 04 .bulk $14,$04,$20,$04 b686: 10 26 10 20 .bulk $10,$26,$10,$20 b68a: 10 46 20 14 .bulk $10,$46,$20,$14 b68e: 1f 78 10 18 .bulk $1f,$78,$10,$18 b692: 1f 79 14 1c .bulk $1f,$79,$14,$1c b696: 14 13 00 18 .bulk $14,$13,$00,$18 b69a: 14 15 04 1c .bulk $14,$15,$04,$1c b69e: 02 01 28 24 .bulk $02,$01,$28,$24 b6a2: 1f 00 29 0a .bulk $1f,$00,$29,$0a ;faces b6a6: 5f 00 1b 03 .bulk $5f,$00,$1b,$03 b6aa: 9f 08 2e 08 .bulk $9f,$08,$2e,$08 b6ae: df 0c 39 0c .bulk $df,$0c,$39,$0c b6b2: 1f 08 2e 08 .bulk $1f,$08,$2e,$08 b6b6: 5f 0c 39 0c .bulk $5f,$0c,$39,$0c b6ba: 1f 00 31 00 .bulk $1f,$00,$31,$00 b6be: 3f 00 00 9a .bulk $3f,$00,$00,$9a b6c2: bf 79 6f 3e .bulk $bf,$79,$6f,$3e b6c6: 3f 79 6f 3e .bulk $3f,$79,$6f,$3e ; Worm. b6ca: 00 hull_worm .dd1 $00 b6cb: 49 26 .dd2 $2649 b6cd: 50 .dd1 $50 b6ce: 90 .dd1 $90 b6cf: 4d .dd1 $4d b6d0: 00 .dd1 $00 b6d1: 12 .dd1 $12 b6d2: 3c .dd1 $3c b6d3: 10 .dd1 $10 b6d4: 00 00 .dd2 0 b6d6: 20 .dd1 $20 b6d7: 13 .dd1 $13 b6d8: 1e .dd1 30 b6d9: 17 .dd1 23 b6da: 00 .dd1 $00 b6db: 00 .dd1 $00 b6dc: 03 .dd1 $03 b6dd: 08 .dd1 %00001000 b6de: 0a 0a 23 5f+ .bulk $0a,$0a,$23,$5f,$02,$77 ;vertices b6e4: 0a 0a 23 df+ .bulk $0a,$0a,$23,$df,$03,$77 b6ea: 05 06 0f 1f+ .bulk $05,$06,$0f,$1f,$01,$24 b6f0: 05 06 0f 9f+ .bulk $05,$06,$0f,$9f,$01,$35 b6f6: 0f 0a 19 5f+ .bulk $0f,$0a,$19,$5f,$24,$77 b6fc: 0f 0a 19 df+ .bulk $0f,$0a,$19,$df,$35,$77 b702: 1a 0a 19 7f+ .bulk $1a,$0a,$19,$7f,$46,$77 b708: 1a 0a 19 ff+ .bulk $1a,$0a,$19,$ff,$56,$77 b70e: 08 0e 19 3f+ .bulk $08,$0e,$19,$3f,$14,$66 b714: 08 0e 19 bf+ .bulk $08,$0e,$19,$bf,$15,$66 b71a: 1f 07 00 04 .bulk $1f,$07,$00,$04 ;edges b71e: 1f 37 04 14 .bulk $1f,$37,$04,$14 b722: 1f 57 14 1c .bulk $1f,$57,$14,$1c b726: 1f 67 1c 18 .bulk $1f,$67,$1c,$18 b72a: 1f 47 18 10 .bulk $1f,$47,$18,$10 b72e: 1f 27 10 00 .bulk $1f,$27,$10,$00 b732: 1f 02 00 08 .bulk $1f,$02,$00,$08 b736: 1f 03 04 0c .bulk $1f,$03,$04,$0c b73a: 1f 24 10 08 .bulk $1f,$24,$10,$08 b73e: 1f 35 14 0c .bulk $1f,$35,$14,$0c b742: 1f 14 08 20 .bulk $1f,$14,$08,$20 b746: 1f 46 20 18 .bulk $1f,$46,$20,$18 b74a: 1f 15 0c 24 .bulk $1f,$15,$0c,$24 b74e: 1f 56 24 1c .bulk $1f,$56,$24,$1c b752: 1f 01 08 0c .bulk $1f,$01,$08,$0c b756: 1f 16 20 24 .bulk $1f,$16,$20,$24 b75a: 1f 00 58 46 .bulk $1f,$00,$58,$46 ;faces b75e: 1f 00 45 0e .bulk $1f,$00,$45,$0e b762: 1f 46 42 23 .bulk $1f,$46,$42,$23 b766: 9f 46 42 23 .bulk $9f,$46,$42,$23 b76a: 1f 40 31 0e .bulk $1f,$40,$31,$0e b76e: 9f 40 31 0e .bulk $9f,$40,$31,$0e b772: 3f 00 00 c8 .bulk $3f,$00,$00,$c8 b776: 5f 00 50 00 .bulk $5f,$00,$50,$00 ; Cobra MK-III (pirate edition). Vertices are same as regular version. Has two ; missiles instead of 3. ; ; edges offset $f500 -> $ac7a -> hull_cobra_mk3 edges ; faces offset $f598 -> $ad12 -> hull_cobra_mk3 faces b77a: 01 hull_cobra3_pir .dd1 $01 b77b: 41 23 .dd2 $2341 b77d: 00 .dd1 $00 b77e: 98 .dd1 $98 b77f: 9d .dd1 $9d b780: 54 .dd1 $54 b781: 2a .dd1 $2a b782: a8 .dd1 $a8 b783: 26 .dd1 $26 b784: af 00 .dd2 175 ;bounty (175) b786: 34 .dd1 $34 b787: 32 .dd1 $32 b788: 96 .dd1 150 b789: 1c .dd1 28 b78a: f5 .dd1 $f5 b78b: f5 .dd1 $f5 b78c: 01 .dd1 $01 b78d: 12 .dd1 %00010010 b78e: 20 00 4c 1f+ .bulk $20,$00,$4c,$1f,$ff,$ff ;vertices b794: 20 00 4c 9f+ .bulk $20,$00,$4c,$9f,$ff,$ff b79a: 00 1a 18 1f+ .bulk $00,$1a,$18,$1f,$ff,$ff b7a0: 78 03 08 ff+ .bulk $78,$03,$08,$ff,$73,$aa b7a6: 78 03 08 7f+ .bulk $78,$03,$08,$7f,$84,$cc b7ac: 58 10 28 bf+ .bulk $58,$10,$28,$bf,$ff,$ff b7b2: 58 10 28 3f+ .bulk $58,$10,$28,$3f,$ff,$ff b7b8: 80 08 28 7f+ .bulk $80,$08,$28,$7f,$98,$cc b7be: 80 08 28 ff+ .bulk $80,$08,$28,$ff,$97,$aa b7c4: 00 1a 28 3f+ .bulk $00,$1a,$28,$3f,$65,$99 b7ca: 20 18 28 ff+ .bulk $20,$18,$28,$ff,$a9,$bb b7d0: 20 18 28 7f+ .bulk $20,$18,$28,$7f,$b9,$cc b7d6: 24 08 28 b4+ .bulk $24,$08,$28,$b4,$99,$99 b7dc: 08 0c 28 b4+ .bulk $08,$0c,$28,$b4,$99,$99 b7e2: 08 0c 28 34+ .bulk $08,$0c,$28,$34,$99,$99 b7e8: 24 08 28 34+ .bulk $24,$08,$28,$34,$99,$99 b7ee: 24 0c 28 74+ .bulk $24,$0c,$28,$74,$99,$99 b7f4: 08 10 28 74+ .bulk $08,$10,$28,$74,$99,$99 b7fa: 08 10 28 f4+ .bulk $08,$10,$28,$f4,$99,$99 b800: 24 0c 28 f4+ .bulk $24,$0c,$28,$f4,$99,$99 b806: 00 00 4c 06+ .bulk $00,$00,$4c,$06,$b0,$bb b80c: 00 00 5a 1f+ .bulk $00,$00,$5a,$1f,$b0,$bb b812: 50 06 28 e8+ .bulk $50,$06,$28,$e8,$99,$99 b818: 50 06 28 a8+ .bulk $50,$06,$28,$a8,$99,$99 b81e: 58 00 28 a6+ .bulk $58,$00,$28,$a6,$99,$99 b824: 50 06 28 28+ .bulk $50,$06,$28,$28,$99,$99 b82a: 58 00 28 26+ .bulk $58,$00,$28,$26,$99,$99 b830: 50 06 28 68+ .bulk $50,$06,$28,$68,$99,$99 ; Asp MK-II. b836: 00 hull_asp_mk2 .dd1 $00 b837: 10 0e .dd2 $0e10 b839: 86 .dd1 $86 b83a: f6 .dd1 $f6 b83b: 69 .dd1 $69 b83c: 20 .dd1 $20 b83d: 1a .dd1 $1a b83e: 72 .dd1 $72 b83f: 1c .dd1 $1c b840: c8 00 .dd2 200 ;bounty (200) b842: 30 .dd1 $30 b843: 28 .dd1 $28 b844: 96 .dd1 150 b845: 28 .dd1 40 b846: 00 .dd1 $00 b847: 00 .dd1 $00 b848: 01 .dd1 $01 b849: 29 .dd1 %00101001 b84a: 00 12 00 56+ .bulk $00,$12,$00,$56,$01,$22 ;vertices b850: 00 09 2d 7f+ .bulk $00,$09,$2d,$7f,$12,$bb b856: 2b 00 2d 3f+ .bulk $2b,$00,$2d,$3f,$16,$bb b85c: 45 03 00 5f+ .bulk $45,$03,$00,$5f,$16,$79 b862: 2b 0e 1c 5f+ .bulk $2b,$0e,$1c,$5f,$01,$77 b868: 2b 00 2d bf+ .bulk $2b,$00,$2d,$bf,$25,$bb b86e: 45 03 00 df+ .bulk $45,$03,$00,$df,$25,$8a b874: 2b 0e 1c df+ .bulk $2b,$0e,$1c,$df,$02,$88 b87a: 1a 07 49 5f+ .bulk $1a,$07,$49,$5f,$04,$79 b880: 1a 07 49 df+ .bulk $1a,$07,$49,$df,$04,$8a b886: 2b 0e 1c 1f+ .bulk $2b,$0e,$1c,$1f,$34,$69 b88c: 2b 0e 1c 9f+ .bulk $2b,$0e,$1c,$9f,$34,$5a b892: 00 09 2d 3f+ .bulk $00,$09,$2d,$3f,$35,$6b b898: 11 00 2d aa+ .bulk $11,$00,$2d,$aa,$bb,$bb b89e: 11 00 2d 29+ .bulk $11,$00,$2d,$29,$bb,$bb b8a4: 00 04 2d 6a+ .bulk $00,$04,$2d,$6a,$bb,$bb b8aa: 00 04 2d 28+ .bulk $00,$04,$2d,$28,$bb,$bb b8b0: 00 07 49 4a+ .bulk $00,$07,$49,$4a,$04,$04 b8b6: 00 07 53 4a+ .bulk $00,$07,$53,$4a,$04,$04 b8bc: 16 12 00 04 .bulk $16,$12,$00,$04 ;edges b8c0: 16 01 00 10 .bulk $16,$01,$00,$10 b8c4: 16 02 00 1c .bulk $16,$02,$00,$1c b8c8: 1f 1b 04 08 .bulk $1f,$1b,$04,$08 b8cc: 1f 16 08 0c .bulk $1f,$16,$08,$0c b8d0: 10 79 0c 20 .bulk $10,$79,$0c,$20 b8d4: 1f 04 20 24 .bulk $1f,$04,$20,$24 b8d8: 10 8a 18 24 .bulk $10,$8a,$18,$24 b8dc: 1f 25 14 18 .bulk $1f,$25,$14,$18 b8e0: 1f 2b 04 14 .bulk $1f,$2b,$04,$14 b8e4: 1f 17 0c 10 .bulk $1f,$17,$0c,$10 b8e8: 1f 07 10 20 .bulk $1f,$07,$10,$20 b8ec: 1f 28 18 1c .bulk $1f,$28,$18,$1c b8f0: 1f 08 1c 24 .bulk $1f,$08,$1c,$24 b8f4: 1f 6b 08 30 .bulk $1f,$6b,$08,$30 b8f8: 1f 5b 14 30 .bulk $1f,$5b,$14,$30 b8fc: 16 36 28 30 .bulk $16,$36,$28,$30 b900: 16 35 2c 30 .bulk $16,$35,$2c,$30 b904: 16 34 28 2c .bulk $16,$34,$28,$2c b908: 1f 5a 18 2c .bulk $1f,$5a,$18,$2c b90c: 1f 4a 24 2c .bulk $1f,$4a,$24,$2c b910: 1f 69 0c 28 .bulk $1f,$69,$0c,$28 b914: 1f 49 20 28 .bulk $1f,$49,$20,$28 b918: 0a bb 34 3c .bulk $0a,$bb,$34,$3c b91c: 09 bb 3c 38 .bulk $09,$bb,$3c,$38 b920: 08 bb 38 40 .bulk $08,$bb,$38,$40 b924: 08 bb 40 34 .bulk $08,$bb,$40,$34 b928: 0a 04 48 44 .bulk $0a,$04,$48,$44 b92c: 5f 00 23 05 .bulk $5f,$00,$23,$05 ;faces b930: 7f 08 26 07 .bulk $7f,$08,$26,$07 b934: ff 08 26 07 .bulk $ff,$08,$26,$07 b938: 36 00 18 01 .bulk $36,$00,$18,$01 b93c: 1f 00 2b 13 .bulk $1f,$00,$2b,$13 b940: bf 06 1c 02 .bulk $bf,$06,$1c,$02 b944: 3f 06 1c 02 .bulk $3f,$06,$1c,$02 b948: 5f 3b 40 1f .bulk $5f,$3b,$40,$1f b94c: df 3b 40 1f .bulk $df,$3b,$40,$1f b950: 1f 50 2e 32 .bulk $1f,$50,$2e,$32 b954: 9f 50 2e 32 .bulk $9f,$50,$2e,$32 b958: 3f 00 00 5a .bulk $3f,$00,$00,$5a b95c: e7 .dd1 $e7 ;? b95d: 33 .dd1 $33 b95e: 53 .dd1 $53 b95f: 08 .dd1 $08 ; Python (pirate edition). Vertices are same as regular version. ; ; edges offset $f43c -> $ad9c -> hull_python edges ; faces offset $f4a4 -> $ae04 -> hull_python faces b960: 02 hull_python_pir .dd1 $02 b961: 00 19 .dd2 $1900 b963: 3c .dd1 $3c b964: a4 .dd1 $a4 b965: 59 .dd1 $59 b966: 00 .dd1 $00 b967: 2a .dd1 $2a b968: 42 .dd1 $42 b969: 1a .dd1 $1a b96a: c8 00 .dd2 200 ;bounty (200) b96c: 34 .dd1 $34 b96d: 28 .dd1 $28 b96e: fa .dd1 250 b96f: 14 .dd1 20 b970: f4 .dd1 $f4 b971: f4 .dd1 $f4 b972: 00 .dd1 $00 b973: 1b .dd1 %00011011 b974: 00 00 e0 1f+ .bulk $00,$00,$e0,$1f,$10,$32 ;vertices b97a: 00 30 30 1f+ .bulk $00,$30,$30,$1f,$10,$54 b980: 60 00 10 3f+ .bulk $60,$00,$10,$3f,$ff,$ff b986: 60 00 10 bf+ .bulk $60,$00,$10,$bf,$ff,$ff b98c: 00 30 20 3f+ .bulk $00,$30,$20,$3f,$54,$98 b992: 00 18 70 3f+ .bulk $00,$18,$70,$3f,$89,$cc b998: 30 00 70 bf+ .bulk $30,$00,$70,$bf,$b8,$cc b99e: 30 00 70 3f+ .bulk $30,$00,$70,$3f,$a9,$cc b9a4: 00 30 30 5f+ .bulk $00,$30,$30,$5f,$32,$76 b9aa: 00 30 20 7f+ .bulk $00,$30,$20,$7f,$76,$ba b9b0: 00 18 70 7f+ .bulk $00,$18,$70,$7f,$ba,$cc ; Fer-de-lance. b9b6: 00 hull_ferdelance .dd1 $00 b9b7: 40 06 .dd2 $0640 b9b9: 86 .dd1 $86 b9ba: f2 .dd1 $f2 b9bb: 6d .dd1 $6d b9bc: 00 .dd1 $00 b9bd: 1a .dd1 $1a b9be: 72 .dd1 $72 b9bf: 1b .dd1 $1b b9c0: 00 00 .dd2 0 b9c2: 28 .dd1 $28 b9c3: 28 .dd1 $28 b9c4: a0 .dd1 160 b9c5: 1e .dd1 30 b9c6: 00 .dd1 $00 b9c7: 00 .dd1 $00 b9c8: 01 .dd1 $01 b9c9: 12 .dd1 %00010010 b9ca: 00 0e 6c 5f+ .bulk $00,$0e,$6c,$5f,$01,$59 ;vertices b9d0: 28 0e 04 ff+ .bulk $28,$0e,$04,$ff,$12,$99 b9d6: 0c 0e 34 ff+ .bulk $0c,$0e,$34,$ff,$23,$99 b9dc: 0c 0e 34 7f+ .bulk $0c,$0e,$34,$7f,$34,$99 b9e2: 28 0e 04 7f+ .bulk $28,$0e,$04,$7f,$45,$99 b9e8: 28 0e 04 bc+ .bulk $28,$0e,$04,$bc,$01,$26 b9ee: 0c 02 34 bc+ .bulk $0c,$02,$34,$bc,$23,$67 b9f4: 0c 02 34 3c+ .bulk $0c,$02,$34,$3c,$34,$78 b9fa: 28 0e 04 3c+ .bulk $28,$0e,$04,$3c,$04,$58 ba00: 00 12 14 2f+ .bulk $00,$12,$14,$2f,$06,$78 ba06: 03 0b 61 cb+ .bulk $03,$0b,$61,$cb,$00,$00 ba0c: 1a 08 12 89+ .bulk $1a,$08,$12,$89,$00,$00 ba12: 10 0e 04 ab+ .bulk $10,$0e,$04,$ab,$00,$00 ba18: 03 0b 61 4b+ .bulk $03,$0b,$61,$4b,$00,$00 ba1e: 1a 08 12 09+ .bulk $1a,$08,$12,$09,$00,$00 ba24: 10 0e 04 2b+ .bulk $10,$0e,$04,$2b,$00,$00 ba2a: 00 0e 14 6c+ .bulk $00,$0e,$14,$6c,$99,$99 ba30: 0e 0e 2c cc+ .bulk $0e,$0e,$2c,$cc,$99,$99 ba36: 0e 0e 2c 4c+ .bulk $0e,$0e,$2c,$4c,$99,$99 ba3c: 1f 19 00 04 .bulk $1f,$19,$00,$04 ;edges ba40: 1f 29 04 08 .bulk $1f,$29,$04,$08 ba44: 1f 39 08 0c .bulk $1f,$39,$08,$0c ba48: 1f 49 0c 10 .bulk $1f,$49,$0c,$10 ba4c: 1f 59 00 10 .bulk $1f,$59,$00,$10 ba50: 1c 01 00 14 .bulk $1c,$01,$00,$14 ba54: 1c 26 14 18 .bulk $1c,$26,$14,$18 ba58: 1c 37 18 1c .bulk $1c,$37,$18,$1c ba5c: 1c 48 1c 20 .bulk $1c,$48,$1c,$20 ba60: 1c 05 00 20 .bulk $1c,$05,$00,$20 ba64: 0f 06 14 24 .bulk $0f,$06,$14,$24 ba68: 0b 67 18 24 .bulk $0b,$67,$18,$24 ba6c: 0b 78 1c 24 .bulk $0b,$78,$1c,$24 ba70: 0f 08 20 24 .bulk $0f,$08,$20,$24 ba74: 0e 12 04 14 .bulk $0e,$12,$04,$14 ba78: 0e 23 08 18 .bulk $0e,$23,$08,$18 ba7c: 0e 34 0c 1c .bulk $0e,$34,$0c,$1c ba80: 0e 45 10 20 .bulk $0e,$45,$10,$20 ba84: 08 00 28 2c .bulk $08,$00,$28,$2c ba88: 09 00 2c 30 .bulk $09,$00,$2c,$30 ba8c: 0b 00 28 30 .bulk $0b,$00,$28,$30 ba90: 08 00 34 38 .bulk $08,$00,$34,$38 ba94: 09 00 38 3c .bulk $09,$00,$38,$3c ba98: 0b 00 34 3c .bulk $0b,$00,$34,$3c ba9c: 0c 99 40 44 .bulk $0c,$99,$40,$44 baa0: 0c 99 40 48 .bulk $0c,$99,$40,$48 baa4: 08 99 44 48 .bulk $08,$99,$44,$48 baa8: 1c 00 18 06 .bulk $1c,$00,$18,$06 ;faces baac: 9f 44 00 18 .bulk $9f,$44,$00,$18 bab0: bf 3f 00 25 .bulk $bf,$3f,$00,$25 bab4: 3f 00 00 68 .bulk $3f,$00,$00,$68 bab8: 3f 3f 00 25 .bulk $3f,$3f,$00,$25 babc: 1f 44 00 18 .bulk $1f,$44,$00,$18 bac0: bc 0c 2e 13 .bulk $bc,$0c,$2e,$13 bac4: 3c 00 2d 16 .bulk $3c,$00,$2d,$16 bac8: 3c 0c 2e 13 .bulk $3c,$0c,$2e,$13 bacc: 5f 00 1c 00 .bulk $5f,$00,$1c,$00 ; Moray. bad0: 01 hull_moray .dd1 $01 bad1: 84 03 .dd2 $0384 bad3: 68 .dd1 $68 bad4: b4 .dd1 $b4 bad5: 49 .dd1 $49 bad6: 00 .dd1 $00 bad7: 1a .dd1 $1a bad8: 54 .dd1 $54 bad9: 13 .dd1 $13 bada: 32 00 .dd2 50 ;bounty (50) badc: 24 .dd1 $24 badd: 28 .dd1 $28 bade: 64 .dd1 100 badf: 19 .dd1 25 bae0: 00 .dd1 $00 bae1: 00 .dd1 $00 bae2: 02 .dd1 $02 bae3: 10 .dd1 %00010000 bae4: 0f 00 41 1f+ .bulk $0f,$00,$41,$1f,$02,$78 ;vertices baea: 0f 00 41 9f+ .bulk $0f,$00,$41,$9f,$01,$67 baf0: 00 12 28 31+ .bulk $00,$12,$28,$31,$ff,$ff baf6: 3c 00 00 9f+ .bulk $3c,$00,$00,$9f,$13,$66 bafc: 3c 00 00 1f+ .bulk $3c,$00,$00,$1f,$25,$88 bb02: 1e 1b 0a 78+ .bulk $1e,$1b,$0a,$78,$45,$78 bb08: 1e 1b 0a f8+ .bulk $1e,$1b,$0a,$f8,$34,$67 bb0e: 09 04 19 e7+ .bulk $09,$04,$19,$e7,$44,$44 bb14: 09 04 19 67+ .bulk $09,$04,$19,$67,$44,$44 bb1a: 00 12 10 67+ .bulk $00,$12,$10,$67,$44,$44 bb20: 0d 03 31 05+ .bulk $0d,$03,$31,$05,$00,$00 bb26: 06 00 41 05+ .bulk $06,$00,$41,$05,$00,$00 bb2c: 0d 03 31 85+ .bulk $0d,$03,$31,$85,$00,$00 bb32: 06 00 41 85+ .bulk $06,$00,$41,$85,$00,$00 bb38: 1f 07 00 04 .bulk $1f,$07,$00,$04 ;edges bb3c: 1f 16 04 0c .bulk $1f,$16,$04,$0c bb40: 18 36 0c 18 .bulk $18,$36,$0c,$18 bb44: 18 47 14 18 .bulk $18,$47,$14,$18 bb48: 18 58 10 14 .bulk $18,$58,$10,$14 bb4c: 1f 28 00 10 .bulk $1f,$28,$00,$10 bb50: 0f 67 04 18 .bulk $0f,$67,$04,$18 bb54: 0f 78 00 14 .bulk $0f,$78,$00,$14 bb58: 0f 02 00 08 .bulk $0f,$02,$00,$08 bb5c: 0f 01 04 08 .bulk $0f,$01,$04,$08 bb60: 11 13 08 0c .bulk $11,$13,$08,$0c bb64: 11 25 08 10 .bulk $11,$25,$08,$10 bb68: 0d 45 08 14 .bulk $0d,$45,$08,$14 bb6c: 0d 34 08 18 .bulk $0d,$34,$08,$18 bb70: 05 44 1c 20 .bulk $05,$44,$1c,$20 bb74: 07 44 1c 24 .bulk $07,$44,$1c,$24 bb78: 07 44 20 24 .bulk $07,$44,$20,$24 bb7c: 05 00 28 2c .bulk $05,$00,$28,$2c bb80: 05 00 30 34 .bulk $05,$00,$30,$34 bb84: 1f 00 2b 07 .bulk $1f,$00,$2b,$07 ;faces bb88: 9f 0a 31 07 .bulk $9f,$0a,$31,$07 bb8c: 1f 0a 31 07 .bulk $1f,$0a,$31,$07 bb90: f8 3b 1c 65 .bulk $f8,$3b,$1c,$65 bb94: 78 00 34 4e .bulk $78,$00,$34,$4e bb98: 78 3b 1c 65 .bulk $78,$3b,$1c,$65 bb9c: df 48 63 32 .bulk $df,$48,$63,$32 bba0: 5f 00 53 1e .bulk $5f,$00,$53,$1e bba4: 5f 48 63 32 .bulk $5f,$48,$63,$32 ; Thargoid. bba8: 00 hull_thargoid .dd1 $00 bba9: 49 26 .dd2 $2649 bbab: 8c .dd1 $8c bbac: f4 .dd1 $f4 bbad: 69 .dd1 $69 bbae: 3c .dd1 $3c bbaf: 26 .dd1 $26 bbb0: 78 .dd1 $78 bbb1: 1a .dd1 $1a bbb2: f4 01 .dd2 500 ;bounty (500) bbb4: 28 .dd1 $28 bbb5: 37 .dd1 $37 bbb6: f0 .dd1 240 bbb7: 27 .dd1 39 bbb8: 00 .dd1 $00 bbb9: 00 .dd1 $00 bbba: 02 .dd1 $02 bbbb: 16 .dd1 %00010110 bbbc: 20 30 30 5f+ .bulk $20,$30,$30,$5f,$40,$88 ;vertices bbc2: 20 44 00 5f+ .bulk $20,$44,$00,$5f,$10,$44 bbc8: 20 30 30 7f+ .bulk $20,$30,$30,$7f,$21,$44 bbce: 20 00 44 3f+ .bulk $20,$00,$44,$3f,$32,$44 bbd4: 20 30 30 3f+ .bulk $20,$30,$30,$3f,$43,$55 bbda: 20 44 00 1f+ .bulk $20,$44,$00,$1f,$54,$66 bbe0: 20 30 30 1f+ .bulk $20,$30,$30,$1f,$64,$77 bbe6: 20 00 44 1f+ .bulk $20,$00,$44,$1f,$74,$88 bbec: 18 74 74 df+ .bulk $18,$74,$74,$df,$80,$99 bbf2: 18 a4 00 df+ .bulk $18,$a4,$00,$df,$10,$99 bbf8: 18 74 74 ff+ .bulk $18,$74,$74,$ff,$21,$99 bbfe: 18 00 a4 bf+ .bulk $18,$00,$a4,$bf,$32,$99 bc04: 18 74 74 bf+ .bulk $18,$74,$74,$bf,$53,$99 bc0a: 18 a4 00 9f+ .bulk $18,$a4,$00,$9f,$65,$99 bc10: 18 74 74 9f+ .bulk $18,$74,$74,$9f,$76,$99 bc16: 18 00 a4 9f+ .bulk $18,$00,$a4,$9f,$87,$99 bc1c: 18 40 50 9e+ .bulk $18,$40,$50,$9e,$99,$99 bc22: 18 40 50 be+ .bulk $18,$40,$50,$be,$99,$99 bc28: 18 40 50 fe+ .bulk $18,$40,$50,$fe,$99,$99 bc2e: 18 40 50 de+ .bulk $18,$40,$50,$de,$99,$99 bc34: 1f 84 00 1c .bulk $1f,$84,$00,$1c ;edges bc38: 1f 40 00 04 .bulk $1f,$40,$00,$04 bc3c: 1f 41 04 08 .bulk $1f,$41,$04,$08 bc40: 1f 42 08 0c .bulk $1f,$42,$08,$0c bc44: 1f 43 0c 10 .bulk $1f,$43,$0c,$10 bc48: 1f 54 10 14 .bulk $1f,$54,$10,$14 bc4c: 1f 64 14 18 .bulk $1f,$64,$14,$18 bc50: 1f 74 18 1c .bulk $1f,$74,$18,$1c bc54: 1f 80 00 20 .bulk $1f,$80,$00,$20 bc58: 1f 10 04 24 .bulk $1f,$10,$04,$24 bc5c: 1f 21 08 28 .bulk $1f,$21,$08,$28 bc60: 1f 32 0c 2c .bulk $1f,$32,$0c,$2c bc64: 1f 53 10 30