{"schema":1,"platform":"c64","game":"gunship","part":"helpers","title":"Gunship","build":"original disk, Rapidlok V6, PAL, C64 Preservation Project gunship_s1/s2[microprose_1985](rl6)(pal)","symbols_sha256":"408cfcbd4e49a5f3bed0b3ed27d87af9c0cfd3bb17514924bd7d68a6a2806155","snapshot":{"file":"work/play-loading.vsf","sha256":"10b99ca38dd675ace96e8fd52a064a6d29c21a3c9b0f77b9248434dfb33220ee"},"index":[{"a":32768,"n":"cbm80_vectors","k":"table","len":4,"c":true},{"a":32772,"n":"cbm80_text","k":"table","len":5,"c":true},{"a":32777,"n":"rom_out","k":"routine","len":11,"c":true},{"a":32788,"n":"move_ram","k":"routine","len":9,"c":true},{"a":32797,"n":"fill_ram","k":"routine","len":6,"c":true},{"a":32803,"n":"rom_back","k":"routine","len":1,"c":true},{"a":32804,"n":"saved_port","k":"routine","len":5,"c":true},{"a":32809,"n":"fill","k":"routine","len":29,"c":true},{"a":32817,"n":"b_8031","k":"branch","len":1,"c":false},{"a":32827,"n":"b_803B","k":"branch","len":1,"c":false},{"a":32831,"n":"b_803F","k":"branch","len":1,"c":false},{"a":32837,"n":"r_8045","k":"branch","len":1,"c":false},{"a":32838,"n":"copy_up","k":"routine","len":33,"c":true},{"a":32844,"n":"b_804C","k":"branch","len":1,"c":false},{"a":32858,"n":"b_805A","k":"branch","len":1,"c":false},{"a":32862,"n":"b_805E","k":"branch","len":1,"c":false},{"a":32870,"n":"r_8066","k":"branch","len":1,"c":false},{"a":32871,"n":"copy_down","k":"routine","len":39,"c":true},{"a":32877,"n":"b_806D","k":"branch","len":1,"c":false},{"a":32887,"n":"b_8077","k":"branch","len":1,"c":false},{"a":32895,"n":"b_807F","k":"branch","len":1,"c":false},{"a":32900,"n":"b_8084","k":"branch","len":1,"c":false},{"a":32909,"n":"r_808D","k":"branch","len":1,"c":false},{"a":32910,"n":"call","k":"routine","len":11,"c":true},{"a":32921,"n":"window_colours","k":"routine","len":40,"c":true},{"a":32961,"n":"window_rows","k":"routine","len":26,"c":true},{"a":32963,"n":"b_80C3","k":"branch","len":1,"c":false},{"a":32965,"n":"b_80C5","k":"branch","len":1,"c":false},{"a":32982,"n":"b_80D6","k":"branch","len":1,"c":false},{"a":32987,"n":"reset_halt","k":"routine","len":8,"c":true}],"records":[{"a":0,"t":"gap","n":32768},{"a":32768,"l":"cbm80_vectors","c":"The cartridge signature the KERNAL looks for on a reset: two vectors and the letters CBM80. A reset (and an NMI that reaches the KERNAL's handler) jumps through $8000 or $8002, here both $80DB, which blanks the screen and stops.","t":"addr","b":[219,128],"oa":32987,"o":"reset_halt"},{"a":32770,"t":"addr","b":[219,128],"oa":32987,"o":"reset_halt"},{"a":32772,"l":"cbm80_text","c":"The letters CBM80 in PETSCII, with bit 7 set on the first three as the KERNAL's test expects.","t":"byte","b":[195,194,205,56,48]},{"a":32777,"l":"rom_out","c":"Switches the ROMs and I/O out for a copy through any of memory: interrupts off, the processor port's setting saved into the operand at $8024 for rom_back to restore, then $01 = $04, all RAM.","t":"code","b":[120],"m":"sei","x":[32788,32797]},{"a":32778,"t":"code","b":[165,1],"m":"lda","oa":1,"o":"$01"},{"a":32780,"t":"code","b":[141,36,128],"m":"sta","oa":32804,"o":"saved_port"},{"a":32783,"t":"code","b":[169,4],"m":"lda","o":"#$04"},{"a":32785,"t":"code","b":[133,1],"m":"sta","oa":1,"o":"$01"},{"a":32787,"t":"code","b":[96],"m":"rts"},{"a":32788,"l":"move_ram","c":"SYS M6 (32788): rom_out, copy_up, rom_back. The copy reaches the RAM under the ROMs and the I/O.","t":"code","b":[32,9,128],"m":"jsr","oa":32777,"o":"rom_out"},{"a":32791,"t":"code","b":[32,70,128],"m":"jsr","oa":32838,"o":"copy_up"},{"a":32794,"t":"code","b":[76,35,128],"m":"jmp","oa":32803,"o":"rom_back"},{"a":32797,"l":"fill_ram","c":"SYS S6 (32797): rom_out, fill, rom_back. The fill reaches the RAM under the ROMs and the I/O.","t":"code","b":[32,9,128],"m":"jsr","oa":32777,"o":"rom_out"},{"a":32800,"t":"code","b":[32,41,128],"m":"jsr","oa":32809,"o":"fill"},{"a":32803,"l":"rom_back","c":"Puts the processor port back as rom_out found it (its LDA operand is rewritten by rom_out) and turns interrupts on.","t":"code","b":[169,55],"m":"lda","o":"#$37","x":[32794]},{"a":32804,"t":"note","l":"saved_port","c":"The operand of rom_back's LDA #: rom_out writes the processor port's setting here, so rom_back puts back whatever was there before the copy.","note":"inside the item at $8023","x":[32780]},{"a":32805,"t":"code","b":[133,1],"m":"sta","oa":1,"o":"$01"},{"a":32807,"t":"code","b":[88],"m":"cli"},{"a":32808,"t":"code","b":[96],"m":"rts"},{"a":32809,"l":"fill","c":"SYS SB (32809): stores the byte in $A5 into $AA whole pages and then $A9 more bytes, from the address in $A7-$A8. The BASIC sets $A5-$AA by POKE A0..A5.","t":"code","b":[165,165],"m":"lda","oa":165,"o":"$A5","x":[32800]},{"a":32811,"t":"code","b":[160,0],"m":"ldy","o":"#$00"},{"a":32813,"t":"code","b":[166,170],"m":"ldx","oa":170,"o":"$AA"},{"a":32815,"t":"code","b":[240,10],"m":"beq","oa":32827,"o":"b_803B"},{"a":32817,"l":"b_8031","t":"code","b":[145,167],"m":"sta","oa":167,"o":"($A7),y","x":[32820,32825]},{"a":32819,"t":"code","b":[200],"m":"iny"},{"a":32820,"t":"code","b":[208,251],"m":"bne","oa":32817,"o":"b_8031"},{"a":32822,"t":"code","b":[230,168],"m":"inc","oa":168,"o":"$A8"},{"a":32824,"t":"code","b":[202],"m":"dex"},{"a":32825,"t":"code","b":[208,246],"m":"bne","oa":32817,"o":"b_8031"},{"a":32827,"l":"b_803B","t":"code","b":[166,169],"m":"ldx","oa":169,"o":"$A9","x":[32815]},{"a":32829,"t":"code","b":[240,6],"m":"beq","oa":32837,"o":"r_8045"},{"a":32831,"l":"b_803F","t":"code","b":[145,167],"m":"sta","oa":167,"o":"($A7),y","x":[32835]},{"a":32833,"t":"code","b":[200],"m":"iny"},{"a":32834,"t":"code","b":[202],"m":"dex"},{"a":32835,"t":"code","b":[208,250],"m":"bne","oa":32831,"o":"b_803F"},{"a":32837,"l":"r_8045","t":"code","b":[96],"m":"rts","x":[32829]},{"a":32838,"l":"copy_up","c":"SYS MV (32838): copies $AA pages and then $A9 bytes from the address in $A5-$A6 to the one in $A7-$A8, upwards.","t":"code","b":[160,0],"m":"ldy","o":"#$00","x":[32791]},{"a":32840,"t":"code","b":[166,170],"m":"ldx","oa":170,"o":"$AA"},{"a":32842,"t":"code","b":[240,14],"m":"beq","oa":32858,"o":"b_805A"},{"a":32844,"l":"b_804C","t":"code","b":[177,165],"m":"lda","oa":165,"o":"($A5),y","x":[32849,32856]},{"a":32846,"t":"code","b":[145,167],"m":"sta","oa":167,"o":"($A7),y"},{"a":32848,"t":"code","b":[200],"m":"iny"},{"a":32849,"t":"code","b":[208,249],"m":"bne","oa":32844,"o":"b_804C"},{"a":32851,"t":"code","b":[230,166],"m":"inc","oa":166,"o":"$A6"},{"a":32853,"t":"code","b":[230,168],"m":"inc","oa":168,"o":"$A8"},{"a":32855,"t":"code","b":[202],"m":"dex"},{"a":32856,"t":"code","b":[208,242],"m":"bne","oa":32844,"o":"b_804C"},{"a":32858,"l":"b_805A","t":"code","b":[166,169],"m":"ldx","oa":169,"o":"$A9","x":[32842]},{"a":32860,"t":"code","b":[240,8],"m":"beq","oa":32870,"o":"r_8066"},{"a":32862,"l":"b_805E","t":"code","b":[177,165],"m":"lda","oa":165,"o":"($A5),y","x":[32868]},{"a":32864,"t":"code","b":[145,167],"m":"sta","oa":167,"o":"($A7),y"},{"a":32866,"t":"code","b":[200],"m":"iny"},{"a":32867,"t":"code","b":[202],"m":"dex"},{"a":32868,"t":"code","b":[208,248],"m":"bne","oa":32862,"o":"b_805E"},{"a":32870,"l":"r_8066","t":"code","b":[96],"m":"rts","x":[32860]},{"a":32871,"l":"copy_down","c":"SYS BM (32871): the same copy run backwards, from the last byte down, for a block that moves up over itself. $A5-$A6 and $A7-$A8 hold the last addresses; $A9 counts the bytes of the first pass and $AA the pages after it.","t":"code","b":[160,0],"m":"ldy","o":"#$00"},{"a":32873,"t":"code","b":[166,169],"m":"ldx","oa":169,"o":"$A9"},{"a":32875,"t":"code","b":[240,23],"m":"beq","oa":32900,"o":"b_8084"},{"a":32877,"l":"b_806D","t":"code","b":[177,165],"m":"lda","oa":165,"o":"($A5),y","x":[32898,32906]},{"a":32879,"t":"code","b":[145,167],"m":"sta","oa":167,"o":"($A7),y"},{"a":32881,"t":"code","b":[165,165],"m":"lda","oa":165,"o":"$A5"},{"a":32883,"t":"code","b":[208,2],"m":"bne","oa":32887,"o":"b_8077"},{"a":32885,"t":"code","b":[198,166],"m":"dec","oa":166,"o":"$A6"},{"a":32887,"l":"b_8077","t":"code","b":[198,165],"m":"dec","oa":165,"o":"$A5","x":[32883]},{"a":32889,"t":"code","b":[165,167],"m":"lda","oa":167,"o":"$A7"},{"a":32891,"t":"code","b":[208,2],"m":"bne","oa":32895,"o":"b_807F"},{"a":32893,"t":"code","b":[198,168],"m":"dec","oa":168,"o":"$A8"},{"a":32895,"l":"b_807F","t":"code","b":[198,167],"m":"dec","oa":167,"o":"$A7","x":[32891]},{"a":32897,"t":"code","b":[202],"m":"dex"},{"a":32898,"t":"code","b":[208,233],"m":"bne","oa":32877,"o":"b_806D"},{"a":32900,"l":"b_8084","t":"code","b":[165,170],"m":"lda","oa":170,"o":"$AA","x":[32875]},{"a":32902,"t":"code","b":[240,5],"m":"beq","oa":32909,"o":"r_808D"},{"a":32904,"t":"code","b":[198,170],"m":"dec","oa":170,"o":"$AA"},{"a":32906,"t":"code","b":[76,109,128],"m":"jmp","oa":32877,"o":"b_806D"},{"a":32909,"l":"r_808D","t":"code","b":[96],"m":"rts","x":[32902]},{"a":32910,"l":"call","c":"SYS KE (32910): calls a machine-code routine with registers set from BASIC. A from $A5, X from $A6, Y from $A7, the carry from bit 0 of $A8, and the routine's address in $A9-$AA. The loaders use it for the KERNAL's SETLFS, SETNAM and LOAD.","t":"code","b":[165,165],"m":"lda","oa":165,"o":"$A5"},{"a":32912,"t":"code","b":[166,166],"m":"ldx","oa":166,"o":"$A6"},{"a":32914,"t":"code","b":[164,167],"m":"ldy","oa":167,"o":"$A7"},{"a":32916,"t":"code","b":[102,168],"m":"ror","oa":168,"o":"$A8"},{"a":32918,"t":"code","b":[108,169,0],"m":"jmp","oa":169,"o":"($00A9)"},{"a":32921,"l":"window_colours","c":"SYS 32921: colours the cockpit's window for the theatre, or for night. $A7 goes into five bytes ($3FC4, $420C-$420D, $422A-$422B), then $A5 fills 12 rows of 32 bytes from $402C and $A6 the same rows from $7C2C, 40 bytes to a row, the layout of a screen's colour cells. G2 calls it with four DATA values for each theatre.","t":"code","b":[165,167],"m":"lda","oa":167,"o":"$A7"},{"a":32923,"t":"code","b":[141,196,63],"m":"sta","oa":16324,"o":"$3FC4"},{"a":32926,"t":"code","b":[141,12,66],"m":"sta","oa":16908,"o":"$420C"},{"a":32929,"t":"code","b":[141,13,66],"m":"sta","oa":16909,"o":"$420D"},{"a":32932,"t":"code","b":[141,42,66],"m":"sta","oa":16938,"o":"$422A"},{"a":32935,"t":"code","b":[141,43,66],"m":"sta","oa":16939,"o":"$422B"},{"a":32938,"t":"code","b":[169,44],"m":"lda","o":"#$2C"},{"a":32940,"t":"code","b":[133,167],"m":"sta","oa":167,"o":"$A7"},{"a":32942,"t":"code","b":[169,64],"m":"lda","o":"#$40"},{"a":32944,"t":"code","b":[133,168],"m":"sta","oa":168,"o":"$A8"},{"a":32946,"t":"code","b":[165,165],"m":"lda","oa":165,"o":"$A5"},{"a":32948,"t":"code","b":[32,193,128],"m":"jsr","oa":32961,"o":"window_rows"},{"a":32951,"t":"code","b":[169,44],"m":"lda","o":"#$2C"},{"a":32953,"t":"code","b":[133,167],"m":"sta","oa":167,"o":"$A7"},{"a":32955,"t":"code","b":[169,124],"m":"lda","o":"#$7C"},{"a":32957,"t":"code","b":[133,168],"m":"sta","oa":168,"o":"$A8"},{"a":32959,"t":"code","b":[165,166],"m":"lda","oa":166,"o":"$A6"},{"a":32961,"l":"window_rows","c":"Fills 12 rows of 32 cells with A, from the address in $A7-$A8, stepping 40 bytes a row.","t":"code","b":[162,11],"m":"ldx","o":"#$0B","x":[32948]},{"a":32963,"l":"b_80C3","t":"code","b":[160,31],"m":"ldy","o":"#$1F","x":[32984]},{"a":32965,"l":"b_80C5","t":"code","b":[145,167],"m":"sta","oa":167,"o":"($A7),y","x":[32968]},{"a":32967,"t":"code","b":[136],"m":"dey"},{"a":32968,"t":"code","b":[16,251],"m":"bpl","oa":32965,"o":"b_80C5"},{"a":32970,"t":"code","b":[72],"m":"pha"},{"a":32971,"t":"code","b":[24],"m":"clc"},{"a":32972,"t":"code","b":[165,167],"m":"lda","oa":167,"o":"$A7"},{"a":32974,"t":"code","b":[105,40],"m":"adc","o":"#$28"},{"a":32976,"t":"code","b":[133,167],"m":"sta","oa":167,"o":"$A7"},{"a":32978,"t":"code","b":[144,2],"m":"bcc","oa":32982,"o":"b_80D6"},{"a":32980,"t":"code","b":[230,168],"m":"inc","oa":168,"o":"$A8"},{"a":32982,"l":"b_80D6","t":"code","b":[104],"m":"pla","x":[32978]},{"a":32983,"t":"code","b":[202],"m":"dex"},{"a":32984,"t":"code","b":[16,233],"m":"bpl","oa":32963,"o":"b_80C3"},{"a":32986,"t":"code","b":[96],"m":"rts"},{"a":32987,"l":"reset_halt","c":"Where a reset lands while the side two programs are in memory: the screen is blanked and the machine loops here for ever.","t":"code","b":[169,0],"m":"lda","o":"#$00","x":[32768,32770,32992]},{"a":32989,"t":"code","b":[141,17,208],"m":"sta","o":"vic_control1"},{"a":32992,"t":"code","b":[76,219,128],"m":"jmp","oa":32987,"o":"reset_halt"},{"a":32995,"t":"gap","n":32541}]}