{"schema":1,"platform":"c64","game":"north-and-south","part":"resident","title":"North & South","build":"PAL cassette, four sides, Cyberload fast loader; the original release as the Ultimate Tape Archive V4.0 has it (entry 7562)","symbols_sha256":"268f0b716882a63c3f72383406324fab83dd28cf002cedf4e01061356bb40b9b","snapshot":{"file":"work/entry.vsf","sha256":"ad56eab9c6101c594fbae21a71c4b4189f19c91b455f7974ad03bae71a3a3a56"},"index":[{"a":679,"n":"boot_stage1","k":"table","len":149,"c":true},{"a":828,"n":"boot_header","k":"table","len":66,"c":true},{"a":894,"n":"year_kept","k":"variable","len":1,"c":true},{"a":895,"n":"menu_seen","k":"variable","len":1,"c":true},{"a":896,"n":"level","k":"variable","len":2,"c":true},{"a":898,"n":"cpu_union","k":"variable","len":1,"c":true},{"a":899,"n":"cpu_confed","k":"variable","len":1,"c":true},{"a":900,"n":"opt_indians","k":"variable","len":1,"c":true},{"a":901,"n":"opt_storm","k":"variable","len":1,"c":true},{"a":902,"n":"opt_reinforcements","k":"variable","len":1,"c":true},{"a":903,"n":"opt_arcade","k":"variable","len":1,"c":true},{"a":904,"n":"opt_keyboard","k":"variable","len":1,"c":true},{"a":905,"n":"start_year","k":"variable","len":1,"c":true},{"a":906,"n":"units_inf","k":"variable","len":2,"c":true},{"a":908,"n":"units_cav","k":"variable","len":2,"c":true},{"a":910,"n":"units_cannon","k":"variable","len":2,"c":true},{"a":912,"n":"retreat_to","k":"variable","len":2,"c":true},{"a":914,"n":"fell_back","k":"variable","len":2,"c":true},{"a":916,"n":"side_out","k":"variable","len":2,"c":true},{"a":918,"n":"attacker","k":"variable","len":1,"c":true},{"a":919,"n":"arcade_result","k":"variable","len":1,"c":true},{"a":920,"n":"winner","k":"variable","len":1,"c":true},{"a":921,"n":"months_tens","k":"variable","len":1,"c":true},{"a":922,"n":"months_units","k":"variable","len":1,"c":true},{"a":923,"n":"no_ending","k":"variable","len":1,"c":true},{"a":924,"n":"boot_header_end","k":"table","len":96,"c":true},{"a":1020,"n":"boot_after","k":"variable","len":2,"c":true},{"a":2048,"n":"boot_entry","k":"routine","len":3,"c":true},{"a":2051,"n":"load_file","k":"routine","len":3,"c":true},{"a":2054,"n":"script","k":"routine","len":84,"c":true},{"a":2067,"n":"j_0813","k":"branch","len":1,"c":false},{"a":2138,"n":"b_085A","k":"routine","len":11,"c":true},{"a":2149,"n":"load_by_number","k":"routine","len":51,"c":true},{"a":2152,"n":"j_0868","k":"branch","len":1,"c":false},{"a":2167,"n":"b_0877","k":"branch","len":1,"c":false},{"a":2194,"n":"b_0892","k":"branch","len":1,"c":false},{"a":2200,"n":"quiet_machine","k":"routine","len":51,"c":true},{"a":2251,"n":"file_asked","k":"variable","len":1,"c":true},{"a":2252,"n":"file_names","k":"variable","len":1,"c":true},{"a":2253,"n":"f_08CD","k":"table","len":27,"c":true},{"a":2280,"n":"file_side","k":"table","len":14,"c":true},{"a":2294,"n":"file_tape","k":"table","len":14,"c":true},{"a":2308,"n":"file_starts_side","k":"table","len":14,"c":true},{"a":2322,"n":"file_name_text","k":"table","len":28,"c":true},{"a":2350,"n":"rewind_prompt","k":"routine","len":62,"c":true},{"a":2380,"n":"b_094C","k":"branch","len":1,"c":false},{"a":2412,"n":"wait_fire","k":"routine","len":21,"c":true},{"a":2422,"n":"b_0976","k":"branch","len":1,"c":false},{"a":2433,"n":"rewind_text","k":"table","len":12,"c":true},{"a":2445,"n":"a_098D","k":"table","len":7,"c":true},{"a":2452,"n":"a_0994","k":"table","len":21,"c":true},{"a":2473,"n":"clear_screen","k":"routine","len":33,"c":true},{"a":2475,"n":"b_09AB","k":"branch","len":1,"c":false},{"a":2506,"n":"text_mode","k":"routine","len":34,"c":true},{"a":2540,"n":"year_text","k":"routine","len":43,"c":true},{"a":2542,"n":"b_09EE","k":"branch","len":1,"c":false},{"a":2659,"n":"fast_load","k":"routine","len":93,"c":true},{"a":2724,"n":"b_0AA4","k":"branch","len":1,"c":false},{"a":2751,"n":"r_0ABF","k":"branch","len":1,"c":false},{"a":2752,"n":"b_0AC0","k":"routine","len":8,"c":true},{"a":2760,"n":"loader_irq_vec","k":"variable","len":1,"c":true},{"a":2761,"n":"a_0AC9","k":"variable","len":1,"c":true},{"a":2762,"n":"a_0ACA","k":"variable","len":1,"c":true},{"a":2763,"n":"loader_irq","k":"routine","len":33,"c":true},{"a":2790,"n":"b_0AE6","k":"branch","len":1,"c":false},{"a":2796,"n":"a_0AEC","k":"routine","len":46,"c":true},{"a":2819,"n":"b_0B03","k":"branch","len":1,"c":false},{"a":2842,"n":"a_0B1A","k":"routine","len":116,"c":true},{"a":2847,"n":"b_0B1F","k":"branch","len":1,"c":false},{"a":2856,"n":"b_0B28","k":"branch","len":1,"c":false},{"a":2861,"n":"b_0B2D","k":"branch","len":1,"c":false},{"a":2870,"n":"b_0B36","k":"branch","len":1,"c":false},{"a":2905,"n":"b_0B59","k":"branch","len":1,"c":false},{"a":2916,"n":"b_0B64","k":"branch","len":1,"c":false},{"a":2921,"n":"b_0B69","k":"branch","len":1,"c":false},{"a":2958,"n":"a_0B8E","k":"routine","len":2,"c":true},{"a":2960,"n":"a_0B90","k":"routine","len":39,"c":true},{"a":2965,"n":"b_0B95","k":"branch","len":1,"c":false},{"a":2978,"n":"b_0BA2","k":"branch","len":1,"c":false},{"a":2980,"n":"j_0BA4","k":"branch","len":1,"c":false},{"a":2996,"n":"b_0BB4","k":"branch","len":1,"c":false},{"a":2999,"n":"j_0BB7","k":"routine","len":42,"c":true},{"a":3013,"n":"b_0BC5","k":"branch","len":1,"c":false},{"a":3021,"n":"b_0BCD","k":"branch","len":1,"c":false},{"a":3033,"n":"b_0BD9","k":"branch","len":1,"c":false},{"a":3041,"n":"j_0BE1","k":"routine","len":31,"c":true},{"a":3045,"n":"b_0BE5","k":"branch","len":1,"c":false},{"a":3047,"n":"b_0BE7","k":"branch","len":1,"c":false},{"a":3057,"n":"b_0BF1","k":"branch","len":1,"c":false}],"records":[{"a":0,"t":"gap","n":679},{"a":0,"t":"note","l":"cpu_port_ddr","note":"outside the tracked image"},{"a":679,"l":"boot_stage1","c":"what is left of the tape's first file ($029F-$033A, as its header at $033C says), the boot the KERNAL loads: from $02AC it draws the loading banner, \"CYBERLOAD NOW LOADING NORTH & SOUTH\" (35 screen codes at $02EE) between stripes of colour, decodes the code in the tape header after it by an XOR chain ($02DC), and runs it. It lies over the KERNAL's vectors at $0300-$0333. Nothing runs it again once the game has started.","t":"byte","b":[76,120,32,68,229,162,34,169]},{"a":687,"t":"byte","b":[1,157,67,217,157,227,217,169]},{"a":695,"t":"byte","b":[7,157,107,217,157,147,217,157]},{"a":703,"t":"byte","b":[187,217,169,160,157,67,5,157]},{"a":711,"t":"byte","b":[227,5,169,82,157,107,5,169]},{"a":719,"t":"byte","b":[119,157,187,5,189,238,2,157]},{"a":727,"t":"byte","b":[147,5,202,16,210,160,171,89]},{"a":735,"t":"byte","b":[80,3,153,80,3,136,208,247]},{"a":743,"t":"byte","b":[73,175,141,13,220,208,99,3]},{"a":751,"t":"byte","b":[25,2,5,18,12,15,1,4]},{"a":759,"t":"byte","b":[32,14,15,23,32,12,15,1]},{"a":767,"t":"byte","b":[4,9,14,7,32,14,15,18]},{"a":775,"t":"byte","b":[20,8,32,38,32,19,15,21]},{"a":783,"t":"byte","b":[20,8,52,53,54,166,2,107]},{"a":791,"t":"byte","b":[142,193,254,188,141,139,73,127]},{"a":799,"t":"byte","b":[141,96,209,141,225,211,122,200]},{"a":807,"t":"byte","b":[220,234,246,238,76,222,202,224]},{"a":815,"t":"byte","b":[144,208,243,140,140,140,204,140]},{"a":823,"t":"byte","b":[140,240,23,178,0]},{"a":828,"l":"boot_header","c":"the KERNAL's cassette buffer as the boot left it: the boot file's header (type 3, start $029F, end $033B, the name \"NORTH & SOUTH\" at $0341) and from $0351 the decoded code that reads the fast loader from tape with CIA 1's timer ($0357); the game's settings at $037E-$039B are written over the rest of it.","t":"byte","b":[3,159,2,59,3,8,78,79]},{"a":836,"t":"byte","b":[82,84,72,32,38,32,83,79]},{"a":844,"t":"byte","b":[85,84,72,32,32,208,196,73]},{"a":852,"t":"byte","b":[22,149,113,160,254,140,4,220]},{"a":860,"t":"byte","b":[160,1,140,5,220,142,13,220]},{"a":868,"t":"byte","b":[72,32,191,3,104,42,201,15]},{"a":876,"t":"byte","b":[208,246,32,174,3,201,15,240]},{"a":884,"t":"byte","b":[249,201,240,208,235,32,174,3]},{"a":892,"t":"byte","b":[24,109]},{"a":894,"l":"year_kept","c":"the start year the menu chose, kept for redrawing the menu's calendar ($11BB) when the game comes back to the menu.","t":"byte","b":[147]},{"a":895,"l":"menu_seen","c":"0 until the menu has run once: then it sets the defaults and makes it 1 ($1878), so later visits keep the settings.","t":"byte","b":[3],"x":[2064]},{"a":896,"l":"level","c":"each side's level, 0 to 2, set on the menu: corporal, sergeant, captain, the rank the ending's messages give; the computer's chances in the battle ($9D14 there) and the fort's and train's lengths and guards follow it.","t":"byte","b":[141]},{"a":897,"c":"level, continued: the Confederacy's.","t":"byte","b":[147]},{"a":898,"l":"cpu_union","c":"1 when the computer plays the Union.","t":"byte","b":[3]},{"a":899,"l":"cpu_confed","c":"1 when the computer plays the Confederacy.","t":"byte","b":[144]},{"a":900,"l":"opt_indians","c":"1 with the Indians and the Mexican on.","t":"byte","b":[3]},{"a":901,"l":"opt_storm","c":"1 with the storm on.","t":"byte","b":[238]},{"a":902,"l":"opt_reinforcements","c":"1 with the European reinforcements on.","t":"byte","b":[148]},{"a":903,"l":"opt_arcade","c":"1 for the arcade sequences (battle, fort, train), 0 for the strategic game, which decides them at random.","t":"byte","b":[3]},{"a":904,"l":"opt_keyboard","c":"1 for the keys instead of the joystick, when one person plays.","t":"byte","b":[32]},{"a":905,"l":"start_year","c":"the start year, 0 to 3 for 1861 to 1864; the map moves it on each December.","t":"byte","b":[174],"x":[2086]},{"a":906,"l":"units_inf","c":"the infantry of each side in the battle: the Union's here, the Confederacy's at $038B; the map fills these and reads back what is left.","t":"byte","b":[3]},{"a":907,"c":"units_inf, continued: the Confederacy's.","t":"byte","b":[72]},{"a":908,"l":"units_cav","c":"each side's cavalry in the battle.","t":"byte","b":[32]},{"a":909,"c":"units_cav, continued: the Confederacy's.","t":"byte","b":[191]},{"a":910,"l":"units_cannon","c":"each side's cannons in the battle.","t":"byte","b":[3]},{"a":911,"c":"units_cannon, continued: the Confederacy's.","t":"byte","b":[144]},{"a":912,"l":"retreat_to","c":"each side's territory to fall back to from the battle, $FF for none.","t":"byte","b":[14]},{"a":913,"c":"retreat_to, continued: the Confederacy's.","t":"byte","b":[104]},{"a":914,"l":"fell_back","c":"set for a side that fell back in the battle.","t":"byte","b":[141]},{"a":915,"c":"fell_back, continued: the Confederacy's.","t":"byte","b":[167]},{"a":916,"l":"side_out","c":"$FF for a side that is out of the battle, beaten or gone.","t":"byte","b":[3]},{"a":917,"c":"side_out, continued: the Confederacy's.","t":"byte","b":[238]},{"a":918,"l":"attacker","c":"the side that attacks in the fort or the train (0 the Union, 1 the Confederacy).","t":"byte","b":[147]},{"a":919,"l":"arcade_result","c":"the fort's or the train's result: 1 the attacker won, 0 it lost.","t":"byte","b":[3]},{"a":920,"l":"winner","c":"the side that won the war, which the ending reads: 0 the Union, 1 the Confederacy.","t":"byte","b":[208]},{"a":921,"l":"months_tens","c":"the months the war has lasted, tens digit, 0 shown as a space by the ending.","t":"byte","b":[3]},{"a":922,"l":"months_units","c":"its units digit, counted on each month by the map ($0C7F).","t":"byte","b":[238]},{"a":923,"l":"no_ending","c":"1 so that the script loads no ending: the map sets it ($1173) when the Commodore key stops a game the computer plays on both sides, and clears it when the war is won ($0CE0).","t":"byte","b":[148],"x":[2122]},{"a":924,"l":"boot_header_end","c":"the rest of the boot's code in the cassette buffer, after the game's settings, with its subroutines at $03AE (a byte) and $03BF (a bit, timed by CIA 1's timer A).","t":"byte","b":[3,176,233,32,191,3,176,213]},{"a":932,"t":"byte","b":[76,174,3,197,241,240,85,76]},{"a":940,"t":"byte","b":[226,252,169,1,72,32,191,3]},{"a":948,"t":"byte","b":[104,42,144,248,72,101,241,133]},{"a":956,"t":"byte","b":[241,104,96,169,16,44,13,220]},{"a":964,"t":"byte","b":[240,251,173,4,220,205,4,220]},{"a":972,"t":"byte","b":[240,1,24,169,25,141,14,220]},{"a":980,"t":"byte","b":[8,198,240,16,31,169,32,133]},{"a":988,"t":"byte","b":[240,164,254,169,160,153,67,5]},{"a":996,"t":"byte","b":[153,227,5,200,192,35,144,2]},{"a":1004,"t":"byte","b":[160,0,169,32,153,67,5,153]},{"a":1012,"t":"byte","b":[227,5,132,254,40,96,166,2]},{"a":1020,"l":"boot_after","c":"two bytes after the cassette buffer, 0, that nothing reads.","t":"byte","b":[0,0]},{"a":1022,"t":"gap","n":1026,"x":[2757]},{"a":2048,"l":"boot_entry","c":"the game's own start, reached once by the Cyberload boot: jumps over the next vector to the script at $0806.","t":"code","b":[76,6,8],"m":"jmp","oa":2054,"o":"script"},{"a":2051,"l":"load_file","c":"the one way any part loads a file: A is the file's number (0 to 13, the table at $0912); jumps to $0865, which shows the tape prompt first when the file starts a side and retries the load until it succeeds.","t":"code","b":[76,101,8],"m":"jmp","oa":2149,"x":[2056,2072,2077,2092,2097,2102,2107,2129],"o":"load_by_number"},{"a":2054,"l":"script","c":"the game's top level. Loads file 7 (TP, the title) and calls it at $8000; then for ever: files 0 and 1 (OC and OM, the menu) and the menu at $1000; the start year's file, 9 + the year chosen ($0389, 0 to 3, so T1 to T4); the map's files 3, 2 and 4 (M2, M1, M3); the year's text ($09EC) and the strategic game at $0C00; then, unless $039B is set, file 13 (CS, the ending) at $8000; and last the prompt for tape 1 side 1 before the menu loads again. The screen is cleared ($09A9) between the steps.","t":"code","b":[169,7],"m":"lda","x":[2048],"o":"#$07"},{"a":2056,"t":"code","b":[32,3,8],"m":"jsr","oa":2051,"o":"load_file"},{"a":2059,"t":"code","b":[32,0,128],"m":"jsr","oa":32768,"o":"$8000"},{"a":2062,"c":"the menu loop's start: clears $037F, then resets the stack to $FF on every pass, so nothing a part left on it survives.","t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":2064,"t":"code","b":[141,127,3],"m":"sta","oa":895,"o":"menu_seen"},{"a":2067,"l":"j_0813","t":"code","b":[162,255],"m":"ldx","x":[2146],"o":"#$FF"},{"a":2069,"t":"code","b":[154],"m":"txs"},{"a":2070,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":2072,"t":"code","b":[32,3,8],"m":"jsr","oa":2051,"o":"load_file"},{"a":2075,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":2077,"t":"code","b":[32,3,8],"m":"jsr","oa":2051,"o":"load_file"},{"a":2080,"t":"code","b":[32,0,16],"m":"jsr","oa":4096,"o":"$1000"},{"a":2083,"t":"code","b":[32,169,9],"m":"jsr","oa":2473,"o":"clear_screen"},{"a":2086,"t":"code","b":[173,137,3],"m":"lda","oa":905,"o":"start_year"},{"a":2089,"t":"code","b":[24],"m":"clc"},{"a":2090,"t":"code","b":[105,9],"m":"adc","o":"#$09"},{"a":2092,"t":"code","b":[32,3,8],"m":"jsr","oa":2051,"o":"load_file"},{"a":2095,"t":"code","b":[169,3],"m":"lda","o":"#$03"},{"a":2097,"t":"code","b":[32,3,8],"m":"jsr","oa":2051,"o":"load_file"},{"a":2100,"t":"code","b":[169,2],"m":"lda","o":"#$02"},{"a":2102,"t":"code","b":[32,3,8],"m":"jsr","oa":2051,"o":"load_file"},{"a":2105,"t":"code","b":[169,4],"m":"lda","o":"#$04"},{"a":2107,"t":"code","b":[32,3,8],"m":"jsr","oa":2051,"o":"load_file"},{"a":2110,"t":"code","b":[32,236,9],"m":"jsr","oa":2540,"o":"year_text"},{"a":2113,"t":"code","b":[32,169,9],"m":"jsr","oa":2473,"o":"clear_screen"},{"a":2116,"t":"code","b":[32,0,12],"m":"jsr","oa":3072,"o":"$0C00"},{"a":2119,"t":"code","b":[32,169,9],"m":"jsr","oa":2473,"o":"clear_screen"},{"a":2122,"c":"after the strategic game returns: a $039B of 0 loads the ending, any other value goes straight to the prompt for side 1.","t":"code","b":[173,155,3],"m":"lda","oa":923,"o":"no_ending"},{"a":2125,"t":"code","b":[208,11],"m":"bne","oa":2138,"o":"b_085A"},{"a":2127,"t":"code","b":[169,13],"m":"lda","o":"#$0D"},{"a":2129,"t":"code","b":[32,3,8],"m":"jsr","oa":2051,"o":"load_file"},{"a":2132,"t":"code","b":[32,0,128],"m":"jsr","oa":32768,"o":"$8000"},{"a":2135,"t":"code","b":[32,169,9],"m":"jsr","oa":2473,"o":"clear_screen"},{"a":2138,"l":"b_085A","c":"the end of a game: asks for tape 1 side 1 ($08CB = 0, the prompt at $092E) and loads the menu again.","t":"code","b":[169,0],"m":"lda","x":[2125],"o":"#$00"},{"a":2140,"t":"code","b":[141,203,8],"m":"sta","oa":2251,"o":"file_asked"},{"a":2143,"t":"code","b":[32,46,9],"m":"jsr","oa":2350,"o":"rewind_prompt"},{"a":2146,"t":"code","b":[76,19,8],"m":"jmp","oa":2067,"o":"j_0813"},{"a":2149,"l":"load_by_number","c":"stores the file's number in $08CB, quietens the machine ($0898), shows the rewind prompt ($092E) when $0904 marks the file as the first of its side, points $BB/$BC at its two-letter name ($08CC) with the name's length 2 in $B7, and calls the fast loader with mode $41 (load where the file's header says, border flashing). The loader returns carry set on a bad load; the prompt is then shown again and the load retried, for ever.","t":"code","b":[141,203,8],"m":"sta","oa":2251,"x":[2051],"o":"file_asked"},{"a":2152,"l":"j_0868","t":"code","b":[32,152,8],"m":"jsr","oa":2200,"x":[2197],"o":"quiet_machine"},{"a":2155,"t":"code","b":[173,203,8],"m":"lda","oa":2251,"o":"file_asked"},{"a":2158,"t":"code","b":[168],"m":"tay"},{"a":2159,"t":"code","b":[185,4,9],"m":"lda","oa":2308,"o":"file_starts_side,y"},{"a":2162,"t":"code","b":[240,3],"m":"beq","oa":2167,"o":"b_0877"},{"a":2164,"t":"code","b":[32,46,9],"m":"jsr","oa":2350,"o":"rewind_prompt"},{"a":2167,"l":"b_0877","t":"code","b":[173,203,8],"m":"lda","oa":2251,"x":[2162],"o":"file_asked"},{"a":2170,"t":"code","b":[10],"m":"asl","o":"a"},{"a":2171,"t":"code","b":[170],"m":"tax"},{"a":2172,"t":"code","b":[189,204,8],"m":"lda","oa":2252,"o":"file_names,x"},{"a":2175,"t":"code","b":[133,187],"m":"sta","oa":187,"o":"zpa_BB"},{"a":2177,"t":"code","b":[189,205,8],"m":"lda","oa":2253,"o":"f_08CD,x"},{"a":2180,"t":"code","b":[133,188],"m":"sta","oa":188,"o":"zpa_BC"},{"a":2182,"t":"code","b":[169,2],"m":"lda","o":"#$02"},{"a":2184,"t":"code","b":[133,183],"m":"sta","oa":183,"o":"zpa_B7"},{"a":2186,"t":"code","b":[169,65],"m":"lda","o":"#$41"},{"a":2188,"t":"code","b":[32,99,10],"m":"jsr","oa":2659,"o":"fast_load"},{"a":2191,"t":"code","b":[176,1],"m":"bcs","oa":2194,"o":"b_0892"},{"a":2193,"t":"code","b":[96],"m":"rts"},{"a":2194,"l":"b_0892","t":"code","b":[32,46,9],"m":"jsr","oa":2350,"x":[2191],"o":"rewind_prompt"},{"a":2197,"t":"code","b":[76,104,8],"m":"jmp","oa":2152,"o":"j_0868"},{"a":2200,"l":"quiet_machine","c":"before a load or a prompt: interrupts off, the KERNAL and BASIC in ($01 = $37), both CIAs' interrupts and timers stopped and acknowledged, border and background black, sprites off, the raster interrupt off and acknowledged, interrupts on again (the KERNAL's).","t":"code","b":[120],"m":"sei","x":[2152,2350]},{"a":2201,"t":"code","b":[169,55],"m":"lda","o":"#$37"},{"a":2203,"t":"code","b":[133,1],"m":"sta","oa":1,"o":"zpa_01"},{"a":2205,"t":"code","b":[169,127],"m":"lda","o":"#$7F"},{"a":2207,"t":"code","b":[141,13,220],"m":"sta","o":"cia1_interrupt"},{"a":2210,"t":"code","b":[141,13,221],"m":"sta","o":"cia2_interrupt"},{"a":2213,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":2215,"t":"code","b":[141,14,220],"m":"sta","o":"cia1_control_a"},{"a":2218,"t":"code","b":[141,14,221],"m":"sta","o":"cia2_control_a"},{"a":2221,"t":"code","b":[44,13,221],"m":"bit","o":"cia2_interrupt"},{"a":2224,"t":"code","b":[44,13,220],"m":"bit","o":"cia1_interrupt"},{"a":2227,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":2229,"t":"code","b":[141,32,208],"m":"sta","o":"vic_border"},{"a":2232,"t":"code","b":[141,33,208],"m":"sta","o":"vic_background0"},{"a":2235,"t":"code","b":[141,21,208],"m":"sta","o":"vic_sprite_enable"},{"a":2238,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":2240,"t":"code","b":[141,26,208],"m":"sta","o":"vic_irq_enable"},{"a":2243,"t":"code","b":[173,25,208],"m":"lda","o":"vic_irq_status"},{"a":2246,"t":"code","b":[141,25,208],"m":"sta","o":"vic_irq_status"},{"a":2249,"t":"code","b":[88],"m":"cli"},{"a":2250,"t":"code","b":[96],"m":"rts"},{"a":2251,"l":"file_asked","c":"the number of the file being loaded, written by $0865 (and $085C); read by the loader's caller and the prompt.","t":"byte","b":[7],"x":[2140,2149,2155,2167,2356]},{"a":2252,"l":"file_names","c":"fourteen pointers, low byte first, to each file's two-letter name in $0912 (file 0 at $0912, file 1 at $0914 and so on).","t":"byte","b":[18],"x":[2172]},{"a":2253,"l":"f_08CD","c":"file_names, continued: the pointers to files 0 to 13's names, $0912 to $092C, two bytes apart.","t":"byte","b":[9,20,9,22,9,24,9,26],"x":[2177]},{"a":2261,"t":"byte","b":[9,28,9,30,9,32,9,34]},{"a":2269,"t":"byte","b":[9,36,9,38,9,40,9,42]},{"a":2277,"t":"byte","b":[9,44,9]},{"a":2280,"l":"file_side","c":"the side of the cassette each file is on, 1 or 2, by file number; the prompt shows it.","t":"byte","b":[1,1,2,2,2,2,2,1],"x":[2359]},{"a":2288,"t":"byte","b":[1,1,1,1,1,2]},{"a":2294,"l":"file_tape","c":"which of the two cassettes each file is on, 1 or 2, by file number; the prompt shows it.","t":"byte","b":[1,1,1,1,1,2,2,1],"x":[2369]},{"a":2302,"t":"byte","b":[2,1,1,1,1,1]},{"a":2308,"l":"file_starts_side","c":"1 for a file the loader can only find after the tape is rewound (the first of a side the game asks for: M2, S1, S2, BS), 0 for one that follows on the tape from the file before; a 1 shows the rewind prompt first.","t":"byte","b":[0,0,0,1,0,1,1,0],"x":[2159]},{"a":2316,"t":"byte","b":[1,0,0,0,0,0]},{"a":2322,"l":"file_name_text","c":"the fourteen two-letter file names in ASCII, as the files' headers carry them: OC OM M1 M2 M3 S1 S2 TP BS T1 T2 T3 T4 CS.","t":"byte","b":[79,67,79,77,77,49,77,50]},{"a":2330,"t":"byte","b":[77,51,83,49,83,50,84,80]},{"a":2338,"t":"byte","b":[66,83,84,49,84,50,84,51]},{"a":2346,"t":"byte","b":[84,52,67,83]},{"a":2350,"l":"rewind_prompt","c":"the prompt \"REWIND TAPE t SIDE s, HIT FIRE THEN PLAY\" on the bottom row: quietens the machine ($0898), shows the ROM's upper-case set on a cleared screen ($09CA), writes the tape and side digits from $08F6 and $08E8 into the text ($098D, $0994), copies the 40 characters to $07C0 in white, starts the cassette motor (bit 5 of $01 cleared), waits for fire ($096C) and blanks the screen for the load.","t":"code","b":[32,152,8],"m":"jsr","oa":2200,"x":[2143,2164,2194],"o":"quiet_machine"},{"a":2353,"t":"code","b":[32,202,9],"m":"jsr","oa":2506,"o":"text_mode"},{"a":2356,"t":"code","b":[174,203,8],"m":"ldx","oa":2251,"o":"file_asked"},{"a":2359,"t":"code","b":[189,232,8],"m":"lda","oa":2280,"o":"file_side,x"},{"a":2362,"t":"code","b":[168],"m":"tay"},{"a":2363,"t":"code","b":[24],"m":"clc"},{"a":2364,"t":"code","b":[105,48],"m":"adc","o":"#$30"},{"a":2366,"t":"code","b":[141,148,9],"m":"sta","oa":2452,"o":"a_0994"},{"a":2369,"t":"code","b":[189,246,8],"m":"lda","oa":2294,"o":"file_tape,x"},{"a":2372,"t":"code","b":[24],"m":"clc"},{"a":2373,"t":"code","b":[105,48],"m":"adc","o":"#$30"},{"a":2375,"t":"code","b":[141,141,9],"m":"sta","oa":2445,"o":"a_098D"},{"a":2378,"t":"code","b":[162,39],"m":"ldx","o":"#$27"},{"a":2380,"l":"b_094C","t":"code","b":[189,129,9],"m":"lda","oa":2433,"x":[2392],"o":"rewind_text,x"},{"a":2383,"t":"code","b":[157,192,7],"m":"sta","oa":1984,"o":"f_07C0,x"},{"a":2386,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":2388,"t":"code","b":[157,192,219],"m":"sta","o":"$DBC0,x"},{"a":2391,"t":"code","b":[202],"m":"dex"},{"a":2392,"t":"code","b":[16,242],"m":"bpl","oa":2380,"o":"b_094C"},{"a":2394,"t":"code","b":[165,1],"m":"lda","oa":1,"o":"zpa_01"},{"a":2396,"t":"code","b":[41,223],"m":"and","o":"#$DF"},{"a":2398,"t":"code","b":[133,1],"m":"sta","oa":1,"o":"zpa_01"},{"a":2400,"t":"code","b":[32,108,9],"m":"jsr","oa":2412,"o":"wait_fire"},{"a":2403,"t":"code","b":[173,17,208],"m":"lda","o":"vic_control1"},{"a":2406,"t":"code","b":[41,239],"m":"and","o":"#$EF"},{"a":2408,"t":"code","b":[141,17,208],"m":"sta","o":"vic_control1"},{"a":2411,"t":"code","b":[96],"m":"rts"},{"a":2412,"l":"wait_fire","c":"waits until bit 4 of either CIA 1 port reads low, with port A made an output: fire on joystick 2 ($DC00), or on joystick 1, the space bar or another key that pulls the same line ($DC01).","t":"code","b":[169,0],"m":"lda","x":[2400,2579],"o":"#$00"},{"a":2414,"t":"code","b":[141,3,220],"m":"sta","o":"cia1_ddr_b"},{"a":2417,"t":"code","b":[169,255],"m":"lda","o":"#$FF"},{"a":2419,"t":"code","b":[141,2,220],"m":"sta","o":"cia1_ddr_a"},{"a":2422,"l":"b_0976","t":"code","b":[173,0,220],"m":"lda","x":[2430],"o":"cia1_port_a"},{"a":2425,"t":"code","b":[45,1,220],"m":"and","o":"cia1_port_b"},{"a":2428,"t":"code","b":[41,16],"m":"and","o":"#$10"},{"a":2430,"t":"code","b":[208,246],"m":"bne","oa":2422,"o":"b_0976"},{"a":2432,"t":"code","b":[96],"m":"rts"},{"a":2433,"l":"rewind_text","c":"the prompt's 40 screen codes, \"REWIND TAPE 1 SIDE 1, HIT FIRE THEN PLAY\"; the prompt rewrites the tape digit at $098D and the side digit at $0994.","t":"byte","b":[18,5,23,9,14,4,32,20],"x":[2380]},{"a":2441,"t":"byte","b":[1,16,5,32]},{"a":2445,"l":"a_098D","c":"the prompt text's tape digit, rewritten from $08F6 by $0947.","t":"byte","b":[49,32,19,9,4,5,32],"x":[2375]},{"a":2452,"l":"a_0994","c":"the prompt text's side digit, rewritten from $08E8 by $093E.","t":"byte","b":[49,44,32,8,9,20,32,6],"x":[2366]},{"a":2460,"t":"byte","b":[9,18,5,32,20,8,5,14]},{"a":2468,"t":"byte","b":[32,16,12,1,25]},{"a":2473,"l":"clear_screen","c":"fills the screen at $0400 with spaces and colour RAM with black, then falls into $09CA.","t":"code","b":[162,0],"m":"ldx","x":[2083,2113,2119,2135],"o":"#$00"},{"a":2475,"l":"b_09AB","t":"code","b":[169,0],"m":"lda","x":[2504],"o":"#$00"},{"a":2477,"t":"code","b":[157,0,216],"m":"sta","o":"colour_ram,x"},{"a":2480,"t":"code","b":[157,0,217],"m":"sta","o":"$D900,x"},{"a":2483,"t":"code","b":[157,0,218],"m":"sta","o":"$DA00,x"},{"a":2486,"t":"code","b":[157,0,219],"m":"sta","o":"$DB00,x"},{"a":2489,"t":"code","b":[169,32],"m":"lda","o":"#$20"},{"a":2491,"t":"code","b":[157,0,4],"m":"sta","oa":1024,"o":"f_0400,x"},{"a":2494,"t":"code","b":[157,0,5],"m":"sta","oa":1280,"o":"f_0500,x"},{"a":2497,"t":"code","b":[157,0,6],"m":"sta","oa":1536,"o":"f_0600,x"},{"a":2500,"t":"code","b":[157,0,7],"m":"sta","oa":1792,"o":"f_0700,x"},{"a":2503,"t":"code","b":[202],"m":"dex"},{"a":2504,"t":"code","b":[208,225],"m":"bne","oa":2475,"o":"b_09AB"},{"a":2506,"l":"text_mode","c":"the video chip on bank 0 with the screen at $0400 and the ROM's upper-case characters ($D018 = $14), screen on, 25 rows, no scroll ($D011 = $98), 40 columns ($D016 = $08).","t":"code","b":[173,2,221],"m":"lda","x":[2353],"o":"cia2_ddr_a"},{"a":2509,"t":"code","b":[9,3],"m":"ora","o":"#$03"},{"a":2511,"t":"code","b":[141,2,221],"m":"sta","o":"cia2_ddr_a"},{"a":2514,"t":"code","b":[173,0,221],"m":"lda","o":"cia2_port_a"},{"a":2517,"t":"code","b":[41,252],"m":"and","o":"#$FC"},{"a":2519,"t":"code","b":[9,3],"m":"ora","o":"#$03"},{"a":2521,"t":"code","b":[141,0,221],"m":"sta","o":"cia2_port_a"},{"a":2524,"t":"code","b":[169,20],"m":"lda","o":"#$14"},{"a":2526,"t":"code","b":[141,24,208],"m":"sta","o":"vic_memory"},{"a":2529,"t":"code","b":[169,152],"m":"lda","o":"#$98"},{"a":2531,"t":"code","b":[141,17,208],"m":"sta","o":"vic_control1"},{"a":2534,"t":"code","b":[169,8],"m":"lda","o":"#$08"},{"a":2536,"t":"code","b":[141,22,208],"m":"sta","o":"vic_control2"},{"a":2539,"t":"code","b":[96],"m":"rts"},{"a":2540,"l":"year_text","c":"the start year's text before the map: colour RAM red for the first three quarters and black for the last page, border and background black, screen on, the ROM's lower- and upper-case characters ($D018 = $16), so the text the year's file left at $0400 shows in mixed case; then waits for fire ($096C).","t":"code","b":[162,0],"m":"ldx","x":[2110],"o":"#$00"},{"a":2542,"l":"b_09EE","t":"code","b":[169,2],"m":"lda","x":[2559],"o":"#$02"},{"a":2544,"t":"code","b":[157,0,216],"m":"sta","o":"colour_ram,x"},{"a":2547,"t":"code","b":[157,0,217],"m":"sta","o":"$D900,x"},{"a":2550,"t":"code","b":[157,0,218],"m":"sta","o":"$DA00,x"},{"a":2553,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":2555,"t":"code","b":[157,0,219],"m":"sta","o":"$DB00,x"},{"a":2558,"t":"code","b":[202],"m":"dex"},{"a":2559,"t":"code","b":[208,237],"m":"bne","oa":2542,"o":"b_09EE"},{"a":2561,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":2563,"t":"code","b":[141,32,208],"m":"sta","o":"vic_border"},{"a":2566,"t":"code","b":[141,33,208],"m":"sta","o":"vic_background0"},{"a":2569,"t":"code","b":[169,152],"m":"lda","o":"#$98"},{"a":2571,"t":"code","b":[141,17,208],"m":"sta","o":"vic_control1"},{"a":2574,"t":"code","b":[169,22],"m":"lda","o":"#$16"},{"a":2576,"t":"code","b":[141,24,208],"m":"sta","o":"vic_memory"},{"a":2579,"t":"code","b":[32,108,9],"m":"jsr","oa":2412,"o":"wait_fire"},{"a":2582,"t":"code","b":[96],"m":"rts"},{"a":2583,"c":"73 bytes of $BD between the last routine and the loader, then a jmp $0AAA at $0A60 that no instruction reaches: filler.","t":"byte","b":[189,189,189,189,189,189,189,189]},{"a":2591,"t":"byte","b":[189,189,189,189,189,189,189,189]},{"a":2599,"t":"byte","b":[189,189,189,189,189,189,189,189]},{"a":2607,"t":"byte","b":[189,189,189,189,189,189,189,189]},{"a":2615,"t":"byte","b":[189,189,189,189,189,189,189,189]},{"a":2623,"t":"byte","b":[189,189,189,189,189,189,189,189]},{"a":2631,"t":"byte","b":[189,189,189,189,189,189,189,189]},{"a":2639,"t":"byte","b":[189,189,189,189,189,189,189,189]},{"a":2647,"t":"byte","b":[189,189,189,189,189,189,189,189]},{"a":2655,"t":"byte","b":[189,76,170,10]},{"a":2659,"l":"fast_load","c":"the Cyberload loader's entry. A is the mode ($93): bit 0 set loads where the file's header says, clear loads at X/Y (stored into $0B8E/$0B90); bit 1 set returns at once and lets the interrupt finish the load; bit 6 flashes the border; bit 7 compares instead of storing. It switches the ROMs out, points $FFFE at its interrupt ($0ACB) and runs CIA 1's timer A, then waits for the interrupt to set $90 to $FD (done) or $FF (failed) and returns carry set on a failure, with X/Y the end address ($AC/$AD).","t":"code","b":[120],"m":"sei","x":[2188]},{"a":2660,"t":"code","b":[133,147],"m":"sta","oa":147,"o":"zpa_93"},{"a":2662,"t":"code","b":[142,142,11],"m":"stx","oa":2958,"o":"a_0B8E"},{"a":2665,"t":"code","b":[140,144,11],"m":"sty","oa":2960,"o":"a_0B90"},{"a":2668,"t":"code","b":[165,1],"m":"lda","oa":1,"o":"zpa_01"},{"a":2670,"t":"code","b":[41,220],"m":"and","o":"#$DC"},{"a":2672,"t":"code","b":[9,1],"m":"ora","o":"#$01"},{"a":2674,"t":"code","b":[133,1],"m":"sta","oa":1,"o":"zpa_01"},{"a":2676,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":2678,"t":"code","b":[141,236,10],"m":"sta","oa":2796,"o":"a_0AEC"},{"a":2681,"t":"code","b":[169,127],"m":"lda","o":"#$7F"},{"a":2683,"t":"code","b":[141,13,220],"m":"sta","o":"cia1_interrupt"},{"a":2686,"t":"code","b":[169,144],"m":"lda","o":"#$90"},{"a":2688,"t":"code","b":[141,13,220],"m":"sta","o":"cia1_interrupt"},{"a":2691,"t":"code","b":[173,201,10],"m":"lda","oa":2761,"o":"a_0AC9"},{"a":2694,"t":"code","b":[141,254,255],"m":"sta","oa":65534,"o":"$FFFE"},{"a":2697,"t":"code","b":[173,202,10],"m":"lda","oa":2762,"o":"a_0ACA"},{"a":2700,"t":"code","b":[141,255,255],"m":"sta","oa":65535,"o":"$FFFF"},{"a":2703,"t":"code","b":[169,254],"m":"lda","o":"#$FE"},{"a":2705,"t":"code","b":[141,4,220],"m":"sta","o":"cia1_timer_a_lo"},{"a":2708,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":2710,"t":"code","b":[141,5,220],"m":"sta","o":"cia1_timer_a_hi"},{"a":2713,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":2715,"t":"code","b":[133,144],"m":"sta","oa":144,"o":"zpa_90"},{"a":2717,"t":"code","b":[88],"m":"cli"},{"a":2718,"t":"code","b":[165,147],"m":"lda","oa":147,"o":"zpa_93"},{"a":2720,"t":"code","b":[41,2],"m":"and","o":"#$02"},{"a":2722,"t":"code","b":[208,27],"m":"bne","oa":2751,"o":"r_0ABF"},{"a":2724,"l":"b_0AA4","t":"code","b":[165,144],"m":"lda","oa":144,"x":[2728],"o":"zpa_90"},{"a":2726,"t":"code","b":[201,253],"m":"cmp","o":"#$FD"},{"a":2728,"t":"code","b":[144,250],"m":"bcc","oa":2724,"o":"b_0AA4"},{"a":2730,"t":"code","b":[169,127],"m":"lda","o":"#$7F"},{"a":2732,"t":"code","b":[141,13,220],"m":"sta","o":"cia1_interrupt"},{"a":2735,"t":"code","b":[165,1],"m":"lda","oa":1,"o":"zpa_01"},{"a":2737,"t":"code","b":[9,32],"m":"ora","o":"#$20"},{"a":2739,"t":"code","b":[133,192],"m":"sta","oa":192,"o":"zpa_C0"},{"a":2741,"t":"code","b":[133,1],"m":"sta","oa":1,"o":"zpa_01"},{"a":2743,"t":"code","b":[165,144],"m":"lda","oa":144,"o":"zpa_90"},{"a":2745,"t":"code","b":[201,254],"m":"cmp","o":"#$FE"},{"a":2747,"t":"code","b":[166,172],"m":"ldx","oa":172,"o":"zpa_AC"},{"a":2749,"t":"code","b":[164,173],"m":"ldy","oa":173,"o":"zpa_AD"},{"a":2751,"l":"r_0ABF","t":"code","b":[96],"m":"rts","x":[2722]},{"a":2752,"l":"b_0AC0","c":"the loader's pass-through of a raster interrupt: acknowledges it, interrupts on, and jumps through the vector at $03FE.","t":"code","b":[141,25,208],"m":"sta","x":[2767],"o":"vic_irq_status"},{"a":2755,"t":"code","b":[88],"m":"cli"},{"a":2756,"t":"code","b":[104],"m":"pla"},{"a":2757,"t":"code","b":[108,254,3],"m":"jmp","oa":1022,"o":"(p_03FE)"},{"a":2760,"l":"loader_irq_vec","c":"a jmp $0ACB that nothing runs: the loader reads its operand as the address of its interrupt ($0A83, $0A89) and puts it in $FFFE/$FFFF.","t":"byte","b":[76]},{"a":2761,"l":"a_0AC9","c":"loader_irq_vec, continued: the interrupt's address, low byte.","t":"byte","b":[203],"x":[2691]},{"a":2762,"l":"a_0ACA","c":"loader_irq_vec, continued: its high byte.","t":"byte","b":[10],"x":[2697]},{"a":2763,"l":"loader_irq","c":"the loader's interrupt, one for each pulse on the tape: a raster interrupt goes on to $0AC0; otherwise it reads CIA 1 (the pulse's length against timer A), restarts the timer, flashes the border when mode bit 6 is set, and shifts the bit into $95, branching through the offset at $0AEC, which each state of the loader rewrites.","t":"code","b":[72],"m":"pha"},{"a":2764,"t":"code","b":[173,25,208],"m":"lda","o":"vic_irq_status"},{"a":2767,"t":"code","b":[48,239],"m":"bmi","oa":2752,"o":"b_0AC0"},{"a":2769,"t":"code","b":[173,13,220],"m":"lda","o":"cia1_interrupt"},{"a":2772,"t":"code","b":[74],"m":"lsr","o":"a"},{"a":2773,"t":"code","b":[169,17],"m":"lda","o":"#$11"},{"a":2775,"t":"code","b":[141,14,220],"m":"sta","o":"cia1_control_a"},{"a":2778,"t":"code","b":[36,147],"m":"bit","oa":147,"o":"zpa_93"},{"a":2780,"t":"code","b":[80,8],"m":"bvc","oa":2790,"o":"b_0AE6"},{"a":2782,"t":"code","b":[173,32,208],"m":"lda","o":"vic_border"},{"a":2785,"t":"code","b":[73,5],"m":"eor","o":"#$05"},{"a":2787,"t":"code","b":[141,32,208],"m":"sta","o":"vic_border"},{"a":2790,"l":"b_0AE6","t":"code","b":[173,13,220],"m":"lda","x":[2780],"o":"cia1_interrupt"},{"a":2793,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":2795,"t":"code","b":[240,22],"m":"beq","oa":2819,"o":"b_0B03"},{"a":2796,"t":"note","l":"a_0AEC","c":"the offset of the beq at $0AEB, which is always taken (A is 0): 0 sends each bit to $0AED, which hunts for the sync byte $0F; $18 ($0AF7, once it has come) sends each bit to the byte stage at $0B05; $16 ($0BEB, once the load is over) to $0B03, which ignores the pulses.","note":"inside the item at $0AEB","x":[2678,2807,2849,3051]},{"a":2797,"t":"code","b":[38,149],"m":"rol","oa":149,"o":"zpa_95"},{"a":2799,"t":"code","b":[165,149],"m":"lda","oa":149,"o":"zpa_95"},{"a":2801,"t":"code","b":[201,15],"m":"cmp","o":"#$0F"},{"a":2803,"t":"code","b":[208,14],"m":"bne","oa":2819,"o":"b_0B03"},{"a":2805,"t":"code","b":[169,24],"m":"lda","o":"#$18"},{"a":2807,"t":"code","b":[141,236,10],"m":"sta","oa":2796,"o":"a_0AEC"},{"a":2810,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":2812,"t":"code","b":[141,26,11],"m":"sta","oa":2842,"o":"a_0B1A"},{"a":2815,"t":"code","b":[169,1],"m":"lda","o":"#$01"},{"a":2817,"t":"code","b":[133,149],"m":"sta","oa":149,"o":"zpa_95"},{"a":2819,"l":"b_0B03","t":"code","b":[104],"m":"pla","x":[2795,2803,2823]},{"a":2820,"t":"code","b":[64],"m":"rti"},{"a":2821,"c":"the loader's byte stage: a byte complete in $95 is added to the checksum $9B and handed to the state the branch at $0B19 names; $0B1A, its offset, is rewritten by every state ($0B28, $0B41, $0B80, $0BA6, $0BD1).","t":"code","b":[38,149],"m":"rol","oa":149,"o":"zpa_95"},{"a":2823,"t":"code","b":[144,250],"m":"bcc","oa":2819,"o":"b_0B03"},{"a":2825,"t":"code","b":[165,149],"m":"lda","oa":149,"o":"zpa_95"},{"a":2827,"t":"code","b":[69,155],"m":"eor","oa":155,"o":"zpa_9B"},{"a":2829,"t":"code","b":[133,155],"m":"sta","oa":155,"o":"zpa_9B"},{"a":2831,"t":"code","b":[138],"m":"txa"},{"a":2832,"t":"code","b":[72],"m":"pha"},{"a":2833,"t":"code","b":[152],"m":"tya"},{"a":2834,"t":"code","b":[72],"m":"pha"},{"a":2835,"t":"code","b":[165,149],"m":"lda","oa":149,"o":"zpa_95"},{"a":2837,"t":"code","b":[162,1],"m":"ldx","o":"#$01"},{"a":2839,"t":"code","b":[134,149],"m":"stx","oa":149,"o":"zpa_95"},{"a":2841,"t":"code","b":[176,27],"m":"bcs","oa":2870,"o":"b_0B36"},{"a":2842,"t":"note","l":"a_0B1A","c":"the offset of the bcs at $0B19, the loader's state, stored by each state for the byte that comes next: 0 (the code from here, waiting for the sync byte $0F), $1E ($0B39, the sync), $34 ($0B4F, the header), $6D ($0B88, the start of a block), $18 ($0B33, to $0BB7: the data) and $1B ($0B36, to $0BE1: the checksum).","note":"inside the item at $0B19","x":[2812,2858,2883,2946,2984,3027]},{"a":2843,"t":"code","b":[201,15],"m":"cmp","o":"#$0F"},{"a":2845,"t":"code","b":[240,9],"m":"beq","oa":2856,"o":"b_0B28"},{"a":2847,"l":"b_0B1F","t":"code","b":[169,0],"m":"lda","x":[2879,2903],"o":"#$00"},{"a":2849,"t":"code","b":[141,236,10],"m":"sta","oa":2796,"o":"a_0AEC"},{"a":2852,"t":"code","b":[169,255],"m":"lda","o":"#$FF"},{"a":2854,"t":"code","b":[133,149],"m":"sta","oa":149,"o":"zpa_95"},{"a":2856,"l":"b_0B28","t":"code","b":[169,30],"m":"lda","x":[2845],"o":"#$1E"},{"a":2858,"t":"code","b":[141,26,11],"m":"sta","oa":2842,"o":"a_0B1A"},{"a":2861,"l":"b_0B2D","t":"code","b":[104],"m":"pla","x":[2875,2892,2919,2949,2996,3030,3054]},{"a":2862,"t":"code","b":[168],"m":"tay"},{"a":2863,"t":"code","b":[104],"m":"pla"},{"a":2864,"t":"code","b":[170],"m":"tax"},{"a":2865,"t":"code","b":[104],"m":"pla"},{"a":2866,"t":"code","b":[64],"m":"rti"},{"a":2867,"t":"code","b":[76,183,11],"m":"jmp","oa":2999,"o":"j_0BB7"},{"a":2870,"l":"b_0B36","t":"code","b":[76,225,11],"m":"jmp","oa":3041,"x":[2841],"o":"j_0BE1"},{"a":2873,"c":"sync: waits for $0F, then $AA, then clears the byte count $9C and checksum $9B.","t":"code","b":[201,15],"m":"cmp","o":"#$0F"},{"a":2875,"t":"code","b":[240,240],"m":"beq","oa":2861,"o":"b_0B2D"},{"a":2877,"t":"code","b":[201,170],"m":"cmp","o":"#$AA"},{"a":2879,"t":"code","b":[208,222],"m":"bne","oa":2847,"o":"b_0B1F"},{"a":2881,"t":"code","b":[169,52],"m":"lda","o":"#$34"},{"a":2883,"t":"code","b":[141,26,11],"m":"sta","oa":2842,"o":"a_0B1A"},{"a":2886,"t":"code","b":[169,0],"m":"lda","o":"#$00"},{"a":2888,"t":"code","b":[133,156],"m":"sta","oa":156,"o":"zpa_9C"},{"a":2890,"t":"code","b":[133,155],"m":"sta","oa":155,"o":"zpa_9B"},{"a":2892,"t":"code","b":[76,45,11],"m":"jmp","oa":2861,"o":"b_0B2D"},{"a":2895,"c":"the header: its first bytes must match the name asked for ($BB), else the file is skipped and the loader looks for the next; bytes 16 to 21 go to $AC-$B1 (where to load, the length, the pulse timing).","t":"code","b":[164,156],"m":"ldy","oa":156,"o":"zpa_9C"},{"a":2897,"t":"code","b":[196,183],"m":"cpy","oa":183,"o":"zpa_B7"},{"a":2899,"t":"code","b":[176,4],"m":"bcs","oa":2905,"o":"b_0B59"},{"a":2901,"t":"code","b":[209,187],"m":"cmp","oa":187,"o":"(zpa_BB),y"},{"a":2903,"t":"code","b":[208,198],"m":"bne","oa":2847,"o":"b_0B1F"},{"a":2905,"l":"b_0B59","t":"code","b":[192,22],"m":"cpy","x":[2899],"o":"#$16"},{"a":2907,"t":"code","b":[176,12],"m":"bcs","oa":2921,"o":"b_0B69"},{"a":2909,"t":"code","b":[192,16],"m":"cpy","o":"#$10"},{"a":2911,"t":"code","b":[144,3],"m":"bcc","oa":2916,"o":"b_0B64"},{"a":2913,"t":"code","b":[153,156,0],"m":"sta","oa":156,"o":"zpa_9C,y"},{"a":2916,"l":"b_0B64","t":"code","b":[200],"m":"iny","x":[2911]},{"a":2917,"t":"code","b":[132,156],"m":"sty","oa":156,"o":"zpa_9C"},{"a":2919,"t":"code","b":[208,196],"m":"bne","oa":2861,"o":"b_0B2D"},{"a":2921,"l":"b_0B69","t":"code","b":[165,155],"m":"lda","oa":155,"x":[2907],"o":"zpa_9B"},{"a":2923,"t":"code","b":[208,120],"m":"bne","oa":3045,"o":"b_0BE5"},{"a":2925,"c":"sets CIA 1's timer A from the header's timing ($B0/$B1 times one and a half), the threshold between a short and a long pulse.","t":"code","b":[165,177],"m":"lda","oa":177,"o":"zpa_B1"},{"a":2927,"t":"code","b":[74],"m":"lsr","o":"a"},{"a":2928,"t":"code","b":[72],"m":"pha"},{"a":2929,"t":"code","b":[165,176],"m":"lda","oa":176,"o":"zpa_B0"},{"a":2931,"t":"code","b":[106],"m":"ror","o":"a"},{"a":2932,"t":"code","b":[24],"m":"clc"},{"a":2933,"t":"code","b":[101,176],"m":"adc","oa":176,"o":"zpa_B0"},{"a":2935,"t":"code","b":[141,4,220],"m":"sta","o":"cia1_timer_a_lo"},{"a":2938,"t":"code","b":[104],"m":"pla"},{"a":2939,"t":"code","b":[101,177],"m":"adc","oa":177,"o":"zpa_B1"},{"a":2941,"t":"code","b":[141,5,220],"m":"sta","o":"cia1_timer_a_hi"},{"a":2944,"t":"code","b":[169,109],"m":"lda","o":"#$6D"},{"a":2946,"t":"code","b":[141,26,11],"m":"sta","oa":2842,"o":"a_0B1A"},{"a":2949,"t":"code","b":[76,45,11],"m":"jmp","oa":2861,"o":"b_0B2D"},{"a":2952,"c":"the start of a block: unless mode bit 0 is set, loads at X/Y instead of the header's address; takes the next block's length, up to 256 bytes, from $AE/$AF.","t":"code","b":[165,147],"m":"lda","oa":147,"o":"zpa_93"},{"a":2954,"t":"code","b":[74],"m":"lsr","o":"a"},{"a":2955,"t":"code","b":[176,8],"m":"bcs","oa":2965,"o":"b_0B95"},{"a":2957,"t":"code","b":[162,14],"m":"ldx","o":"#$0E"},{"a":2958,"t":"note","l":"a_0B8E","c":"the low byte of the address to load at when the mode's bit 0 is clear, the operand of the ldx # at $0B8D, stored from X by $0A66.","note":"inside the item at $0B8D","x":[2662]},{"a":2959,"t":"code","b":[160,7],"m":"ldy","o":"#$07"},{"a":2960,"t":"note","l":"a_0B90","c":"the high byte of that address, the operand of the ldy # at $0B8F, stored from Y by $0A69; the code from here takes the block's length and starts it.","note":"inside the item at $0B8F","x":[2665]},{"a":2961,"t":"code","b":[134,172],"m":"stx","oa":172,"o":"zpa_AC"},{"a":2963,"t":"code","b":[132,173],"m":"sty","oa":173,"o":"zpa_AD"},{"a":2965,"l":"b_0B95","t":"code","b":[160,0],"m":"ldy","x":[2955,3061],"o":"#$00"},{"a":2967,"t":"code","b":[165,175],"m":"lda","oa":175,"o":"zpa_AF"},{"a":2969,"t":"code","b":[208,7],"m":"bne","oa":2978,"o":"b_0BA2"},{"a":2971,"t":"code","b":[164,174],"m":"ldy","oa":174,"o":"zpa_AE"},{"a":2973,"t":"code","b":[133,174],"m":"sta","oa":174,"o":"zpa_AE"},{"a":2975,"t":"code","b":[76,164,11],"m":"jmp","oa":2980,"o":"j_0BA4"},{"a":2978,"l":"b_0BA2","t":"code","b":[198,175],"m":"dec","oa":175,"x":[2969],"o":"zpa_AF"},{"a":2980,"l":"j_0BA4","t":"code","b":[132,156],"m":"sty","oa":156,"x":[2975],"o":"zpa_9C"},{"a":2982,"t":"code","b":[169,24],"m":"lda","o":"#$18"},{"a":2984,"t":"code","b":[141,26,11],"m":"sta","oa":2842,"o":"a_0B1A"},{"a":2987,"t":"code","b":[230,144],"m":"inc","oa":144,"o":"zpa_90"},{"a":2989,"t":"code","b":[36,147],"m":"bit","oa":147,"o":"zpa_93"},{"a":2991,"t":"code","b":[80,3],"m":"bvc","oa":2996,"o":"b_0BB4"},{"a":2993,"t":"code","b":[238,32,208],"m":"inc","o":"vic_border"},{"a":2996,"l":"b_0BB4","t":"code","b":[76,45,11],"m":"jmp","oa":2861,"x":[2991,3023],"o":"b_0B2D"},{"a":2999,"l":"j_0BB7","c":"stores a byte with all RAM visible ($01 = $04), or compares it when mode bit 7 is set, and steps $AC/$AD; at the block's end goes back for the checksum.","t":"code","b":[166,1],"m":"ldx","oa":1,"x":[2867],"o":"zpa_01"},{"a":3001,"t":"code","b":[160,4],"m":"ldy","o":"#$04"},{"a":3003,"t":"code","b":[132,1],"m":"sty","oa":1,"o":"zpa_01"},{"a":3005,"t":"code","b":[160,0],"m":"ldy","o":"#$00"},{"a":3007,"t":"code","b":[36,147],"m":"bit","oa":147,"o":"zpa_93"},{"a":3009,"t":"code","b":[48,22],"m":"bmi","oa":3033,"o":"b_0BD9"},{"a":3011,"t":"code","b":[145,172],"m":"sta","oa":172,"o":"(zpa_AC),y"},{"a":3013,"l":"b_0BC5","t":"code","b":[134,1],"m":"stx","oa":1,"x":[3035],"o":"zpa_01"},{"a":3015,"t":"code","b":[230,172],"m":"inc","oa":172,"o":"zpa_AC"},{"a":3017,"t":"code","b":[208,2],"m":"bne","oa":3021,"o":"b_0BCD"},{"a":3019,"t":"code","b":[230,173],"m":"inc","oa":173,"o":"zpa_AD"},{"a":3021,"l":"b_0BCD","t":"code","b":[198,156],"m":"dec","oa":156,"x":[3017],"o":"zpa_9C"},{"a":3023,"t":"code","b":[208,227],"m":"bne","oa":2996,"o":"b_0BB4"},{"a":3025,"t":"code","b":[169,27],"m":"lda","o":"#$1B"},{"a":3027,"t":"code","b":[141,26,11],"m":"sta","oa":2842,"o":"a_0B1A"},{"a":3030,"t":"code","b":[76,45,11],"m":"jmp","oa":2861,"o":"b_0B2D"},{"a":3033,"l":"b_0BD9","t":"code","b":[209,172],"m":"cmp","oa":172,"x":[3009],"o":"(zpa_AC),y"},{"a":3035,"t":"code","b":[240,232],"m":"beq","oa":3013,"o":"b_0BC5"},{"a":3037,"t":"code","b":[134,1],"m":"stx","oa":1,"o":"zpa_01"},{"a":3039,"t":"code","b":[208,4],"m":"bne","oa":3045,"o":"b_0BE5"},{"a":3041,"l":"j_0BE1","c":"the block's checksum: a wrong one ends the load with $90 = $FF; when the length $AE/$AF is used up the load ends with $90 = $FD.","t":"code","b":[165,155],"m":"lda","oa":155,"x":[2870],"o":"zpa_9B"},{"a":3043,"t":"code","b":[240,12],"m":"beq","oa":3057,"o":"b_0BF1"},{"a":3045,"l":"b_0BE5","t":"code","b":[169,255],"m":"lda","x":[2923,3039],"o":"#$FF"},{"a":3047,"l":"b_0BE7","t":"code","b":[133,144],"m":"sta","oa":144,"x":[3065],"o":"zpa_90"},{"a":3049,"t":"code","b":[169,22],"m":"lda","o":"#$16"},{"a":3051,"t":"code","b":[141,236,10],"m":"sta","oa":2796,"o":"a_0AEC"},{"a":3054,"t":"code","b":[76,45,11],"m":"jmp","oa":2861,"o":"b_0B2D"},{"a":3057,"l":"b_0BF1","t":"code","b":[165,174],"m":"lda","oa":174,"x":[3043],"o":"zpa_AE"},{"a":3059,"t":"code","b":[5,175],"m":"ora","oa":175,"o":"zpa_AF"},{"a":3061,"t":"code","b":[208,158],"m":"bne","oa":2965,"o":"b_0B95"},{"a":3063,"t":"code","b":[169,253],"m":"lda","o":"#$FD"},{"a":3065,"t":"code","b":[208,236],"m":"bne","oa":3047,"o":"b_0BE7"},{"a":3067,"t":"byte","b":[255],"note":"not a legal opcode"},{"a":3068,"t":"byte","b":[255],"note":"not a legal opcode"},{"a":3069,"t":"byte","b":[255],"note":"not a legal opcode"},{"a":3070,"t":"code","b":[0],"m":"brk"},{"a":3071,"t":"code","b":[0],"m":"brk"},{"a":3072,"t":"gap","n":62464,"x":[2116]}]}