Disassembly:Democart 2
From veswiki
This is a disassembly of the Channel F Democart 2. Original code is copyright © 1977 Fairchild Semiconductor.
; ----------------------------------------------------------------------------- ; Annotated and formatted Democart 2 disassembly. ; ----------------------------------------------------------------------------- reset equ $0000 ; BIOS reset vector delay equ $008F ; BIOS delay routine clearscrn equ $00D0 ; BIOS clear screen routine pushk equ $0107 ; BIOS K-stack push popk equ $011E ; BIOS K-stack pop drawchar equ $0679 ; BIOS draw character entry drawchar_entry equ $067C ; BIOS draw character internal entry ; Auto labels for branch targets inside mixed code/data bytes. L0B6E equ $0B6E L0B7B equ $0B7B L0B80 equ $0B80 L0B85 equ $0B85 L0B8B equ $0B8B L0BB1 equ $0BB1 L0C1D equ $0C1D L0C1F equ $0C1F L0C64 equ $0C64 L0CD7 equ $0CD7 L0D04 equ $0D04 L0EE0 equ $0EE0 L0EF5 equ $0EF5 L0F58 equ $0F58 L0F7A equ $0F7A processor f8 org $0800 ; ----------------------------------------------------------------------------- ; Cartridge signature/start vector. First byte is $55 for a valid Channel F ; cartridge. ; ----------------------------------------------------------------------------- cartridge_start: lr 5,A ; 0800 55 nop ; 0801 2b ; ----------------------------------------------------------------------------- ; cartridge_entry ; Main Democart 2 script. Shows multiple demo screens, uses BIOS text and ; graphics routines, then returns to BIOS reset. ; ----------------------------------------------------------------------------- cartridge_entry: lisu 3 ; 0802 63 lisl 7 ; 0803 6f lis 1 ; 0804 71 lr S,A ; 0805 5c - store A in selected scratchpad register pi $0135 ; 0806 28 01 35 dci L0BC6 ; 0809 2a 0b c6 - load DC with data/code pointer pi draw_compressed_text ; 080c 28 0b a3 lisu 3 ; 080f 63 lisl 7 ; 0810 6f lis 3 ; 0811 73 lr S,A ; 0812 5c - store A in selected scratchpad register pi $0135 ; 0813 28 01 35 dci L0BCF ; 0816 2a 0b cf - load DC with data/code pointer pi draw_compressed_text ; 0819 28 0b a3 lis 6 ; 081c 76 lr 3,A ; 081d 53 pi clear_screen_o37_0 ; 081e 28 0f ea li $26 ; 0821 20 26 lr 1,A ; 0823 51 li $14 ; 0824 20 14 lr 2,A ; 0826 52 li $28 ; 0827 20 28 lr 3,A ; 0829 53 pi bios_drawchar_0215_wrapper ; 082a 28 0b 76 li $26 ; 082d 20 26 lr 1,A ; 082f 51 li $21 ; 0830 20 21 lr 2,A ; 0832 52 li $28 ; 0833 20 28 lr 3,A ; 0835 53 pi bios_drawchar_0215_wrapper ; 0836 28 0b 76 li $33 ; 0839 20 33 lr 1,A ; 083b 51 pi draw_three_prompt_markers ; 083c 28 0b 7d li $41 ; 083f 20 41 lr 1,A ; 0841 51 pi draw_three_prompt_markers ; 0842 28 0b 7d dci L0BD8 ; 0845 2a 0b d8 - load DC with data/code pointer pi draw_compressed_text ; 0848 28 0b a3 clr ; 084b 70 lr 3,A ; 084c 53 pi clear_screen_o37_1 ; 084d 28 0f ed li $14 ; 0850 20 14 lr 1,A ; 0852 51 lis 6 ; 0853 76 lr 2,A ; 0854 52 pi bios_player_draw ; 0855 28 02 0e li $14 ; 0858 20 14 lr 1,A ; 085a 51 li $2E ; 085b 20 2e lr 2,A ; 085d 52 pi bios_player_draw ; 085e 28 02 0e li $12 ; 0861 20 12 lr 1,A ; 0863 51 lr 2,A ; 0864 52 li $58 ; 0865 20 58 lr 0,A ; 0867 50 pi drawchar ; 0868 28 06 79 - BIOS draw character routine dci L0BE6 ; 086b 2a 0b e6 - load DC with data/code pointer pi draw_compressed_text ; 086e 28 0b a3 lis 6 ; 0871 76 lr 3,A ; 0872 53 pi clear_screen_o37_0 ; 0873 28 0f ea lis 6 ; 0876 76 lr HU,A ; 0877 5a dci L0C98 ; 0878 2a 0c 98 - load DC with data/code pointer li $20 ; 087b 20 20 lr 1,A ; 087d 51 lr 2,A ; 087e 52 L087F: li $80 ; 087f 20 80 lr 0,A ; 0881 50 pi bios_drawchar_bitmap_wrapper ; 0882 28 0f cd lis 2 ; 0885 72 as 1 ; 0886 c1 lr 1,A ; 0887 51 ds HU ; 0888 3a bf 4,L087F ; 0889 94 f5 pi short_delay ; 088b 28 0b 96 lis 6 ; 088e 76 lr 3,A ; 088f 53 pi clear_screen_o37_0 ; 0890 28 0f ea li $18 ; 0893 20 18 lr 2,A ; 0895 52 li $30 ; 0896 20 30 lr 1,A ; 0898 51 dci L0CC8 ; 0899 2a 0c c8 - load DC with data/code pointer li $80 ; 089c 20 80 lr 0,A ; 089e 50 pi bios_drawchar_bitmap_wrapper ; 089f 28 0f cd lis 2 ; 08a2 72 as 1 ; 08a3 c1 lr 1,A ; 08a4 51 li $80 ; 08a5 20 80 lr 0,A ; 08a7 50 dci L0CC8 ; 08a8 2a 0c c8 - load DC with data/code pointer pi bios_drawchar_bitmap_wrapper ; 08ab 28 0f cd li $30 ; 08ae 20 30 lr 1,A ; 08b0 51 li $20 ; 08b1 20 20 lr 2,A ; 08b3 52 li $80 ; 08b4 20 80 lr 0,A ; 08b6 50 dci L0CC8 ; 08b7 2a 0c c8 - load DC with data/code pointer pi bios_drawchar_bitmap_wrapper ; 08ba 28 0f cd lis 2 ; 08bd 72 as 1 ; 08be c1 lr 1,A ; 08bf 51 li $80 ; 08c0 20 80 lr 0,A ; 08c2 50 dci L0CC8 ; 08c3 2a 0c c8 - load DC with data/code pointer pi bios_drawchar_bitmap_wrapper ; 08c6 28 0f cd dci L0CD0 ; 08c9 2a 0c d0 - load DC with data/code pointer pi draw_compressed_text ; 08cc 28 0b a3 lis 6 ; 08cf 76 lr 3,A ; 08d0 53 pi clear_screen_o37_1 ; 08d1 28 0f ed li $13 ; 08d4 20 13 lr 1,A ; 08d6 51 lis 6 ; 08d7 76 lr 2,A ; 08d8 52 pi bios_player_draw ; 08d9 28 02 0e li $13 ; 08dc 20 13 lr 1,A ; 08de 51 li $2F ; 08df 20 2f lr 2,A ; 08e1 52 pi bios_player_draw ; 08e2 28 02 0e li $11 ; 08e5 20 11 lr 1,A ; 08e7 51 lis 9 ; 08e8 79 lr 2,A ; 08e9 52 li $24 ; 08ea 20 24 lr 3,A ; 08ec 53 pi bios_draw_a01fc_wrapper ; 08ed 28 0f c6 li $5A ; 08f0 20 5a lr 1,A ; 08f2 51 lis 9 ; 08f3 79 lr 2,A ; 08f4 52 li $24 ; 08f5 20 24 lr 3,A ; 08f7 53 pi bios_draw_a01fc_wrapper ; 08f8 28 0f c6 lis 9 ; 08fb 79 lr 4,A ; 08fc 54 dci L0C00 ; 08fd 2a 0c 00 - load DC with data/code pointer L0900: lm ; 0900 16 - load byte from DC and increment DC lr 1,A ; 0901 51 lm ; 0902 16 - load byte from DC and increment DC lr 2,A ; 0903 52 lm ; 0904 16 - load byte from DC and increment DC lr 0,A ; 0905 50 xdc ; 0906 2c - exchange DC and H pointers dci $0C1B ; 0907 2a 0c 1b pi drawchar_entry ; 090a 28 06 7c xdc ; 090d 2c - exchange DC and H pointers ds 4 ; 090e 34 bf 4,L0900 ; 090f 94 f0 pi bios_score_prompt_wrapper ; 0911 28 0f d6 dci L0BF9 ; 0914 2a 0b f9 - load DC with data/code pointer pi draw_compressed_text ; 0917 28 0b a3 lis 6 ; 091a 76 lr 3,A ; 091b 53 pi clear_screen_o37_0 ; 091c 28 0f ea clr ; 091f 70 lr 2,A ; 0920 52 lr 0,A ; 0921 50 lis $D ; 0922 7d lr HU,A ; 0923 5a L0924: li $7E ; 0924 20 7e lr 1,A ; 0926 51 pi drawchar ; 0927 28 06 79 - BIOS draw character routine lr A,2 ; 092a 42 inc ; 092b 1f lr 2,A ; 092c 52 ds HU ; 092d 3a bf 4,L0924 ; 092e 94 f5 L0930: lis 4 ; 0930 74 as 2 ; 0931 c2 lr 2,A ; 0932 52 lis 3 ; 0933 73 lr 1,A ; 0934 51 L0935: li $C0 ; 0935 20 c0 lr 0,A ; 0937 50 dci $4000 ; 0938 2a 40 00 ; Points data counter to unused area. ; Pullups on data bus holds D7-D3 high in the real cartridge ; and turns "Black Jack" table green. ; Replace with $0d8b if it's going to work 100% on Multi-Cart and emulation. pi drawchar_entry ; 093b 28 06 7c ds 1 ; 093e 31 lr A,1 ; 093f 41 ci $77 ; 0940 25 77 bt 2,L0935 ; 0942 82 f2 lr A,2 ; 0944 42 ci $28 ; 0945 25 28 bt 2,L0930 ; 0947 82 e8 lis 3 ; 0949 73 lr HU,A ; 094a 5a li $26 ; 094b 20 26 lr 2,A ; 094d 52 L094E: lis 8 ; 094e 78 lr 1,A ; 094f 51 clr ; 0950 70 lr 0,A ; 0951 50 L0952: pi drawchar ; 0952 28 06 79 - BIOS draw character routine lis 2 ; 0955 72 as 2 ; 0956 c2 lr 2,A ; 0957 52 ds 1 ; 0958 31 ds HU ; 0959 3a bf 4,L0952 ; 095a 94 f7 pi drawchar ; 095c 28 06 79 - BIOS draw character routine lr A,2 ; 095f 42 inc ; 0960 1f lr 2,A ; 0961 52 ds 1 ; 0962 31 pi drawchar ; 0963 28 06 79 - BIOS draw character routine lr A,2 ; 0966 42 ci $31 ; 0967 25 31 bf 2,L0973 ; 0969 92 09 li $2B ; 096b 20 2b lr 2,A ; 096d 52 lis 3 ; 096e 73 lr HU,A ; 096f 5a jmp L094E ; 0970 29 09 4e - unconditional jump L0973: nop ; 0973 2b clr ; 0974 70 lr 0,A ; 0975 50 li $2D ; 0976 20 2d lr 2,A ; 0978 52 L0979: li $53 ; 0979 20 53 lr 1,A ; 097b 51 pi drawchar ; 097c 28 06 79 - BIOS draw character routine ds 1 ; 097f 31 ds 2 ; 0980 32 pi drawchar ; 0981 28 06 79 - BIOS draw character routine lis 3 ; 0984 73 lr HU,A ; 0985 5a L0986: ds 2 ; 0986 32 ds 2 ; 0987 32 ds 1 ; 0988 31 pi drawchar ; 0989 28 06 79 - BIOS draw character routine ds HU ; 098c 3a bf 4,L0986 ; 098d 94 f8 lr A,2 ; 098f 42 ci $27 ; 0990 25 27 bf 2,L099A ; 0992 92 07 li $30 ; 0994 20 30 lr 2,A ; 0996 52 jmp L0979 ; 0997 29 09 79 - unconditional jump L099A: pi bios_score_prompt_wrapper ; 099a 28 0f d6 dci L0C76 ; 099d 2a 0c 76 - load DC with data/code pointer li $69 ; 09a0 20 69 lr HU,A ; 09a2 5a pi draw_compressed_text ; 09a3 28 0b a3 pi draw_compressed_text ; 09a6 28 0b a3 clr ; 09a9 70 lr HU,A ; 09aa 5a pi draw_compressed_text ; 09ab 28 0b a3 lis 3 ; 09ae 73 lr 3,A ; 09af 53 pi clear_screen_o37_0 ; 09b0 28 0f ea dci L0C34 ; 09b3 2a 0c 34 - load DC with data/code pointer xdc ; 09b6 2c - exchange DC and H pointers dci L0C67 ; 09b7 2a 0c 67 - load DC with data/code pointer lis 5 ; 09ba 75 lr HU,A ; 09bb 5a L09BC: lm ; 09bc 16 - load byte from DC and increment DC lr 1,A ; 09bd 51 lm ; 09be 16 - load byte from DC and increment DC lr 2,A ; 09bf 52 lm ; 09c0 16 - load byte from DC and increment DC lr 0,A ; 09c1 50 xdc ; 09c2 2c - exchange DC and H pointers pi bios_drawchar_bitmap_wrapper ; 09c3 28 0f cd xdc ; 09c6 2c - exchange DC and H pointers ds HU ; 09c7 3a bf 4,L09BC ; 09c8 94 f3 dci L0C5C ; 09ca 2a 0c 5c - load DC with data/code pointer pi draw_compressed_text ; 09cd 28 0b a3 lis 3 ; 09d0 73 lr 3,A ; 09d1 53 pi clear_screen_o37_1 ; 09d2 28 0f ed pi bios_score_prompt_wrapper ; 09d5 28 0f d6 lis 9 ; 09d8 79 lr HU,A ; 09d9 5a dci L0CDE ; 09da 2a 0c de - load DC with data/code pointer L09DD: lm ; 09dd 16 - load byte from DC and increment DC lr 1,A ; 09de 51 lm ; 09df 16 - load byte from DC and increment DC lr 2,A ; 09e0 52 lm ; 09e1 16 - load byte from DC and increment DC lr 0,A ; 09e2 50 xdc ; 09e3 2c - exchange DC and H pointers dci $0CF9 ; 09e4 2a 0c f9 pi drawchar_entry ; 09e7 28 06 7c xdc ; 09ea 2c - exchange DC and H pointers ds HU ; 09eb 3a bf 4,L09DD ; 09ec 94 f0 dci $0D08 ; 09ee 2a 0d 08 pi draw_compressed_text ; 09f1 28 0b a3 lis 3 ; 09f4 73 lr 3,A ; 09f5 53 pi clear_screen_o37_1 ; 09f6 28 0f ed pi bios_score_prompt_wrapper ; 09f9 28 0f d6 li $10 ; 09fc 20 10 lr 1,A ; 09fe 51 li $1A ; 09ff 20 1a lr 2,A ; 0a01 52 li $10 ; 0a02 20 10 lr 3,A ; 0a04 53 pi bios_drawchar_0215_wrapper ; 0a05 28 0b 76 lis 2 ; 0a08 72 lr HU,A ; 0a09 5a L0A0A: lis $F ; 0a0a 7f lr 3,A ; 0a0b 53 lis $F ; 0a0c 7f as 1 ; 0a0d c1 lr 1,A ; 0a0e 51 pi bios_drawchar_0215_wrapper ; 0a0f 28 0b 76 ds HU ; 0a12 3a bf 4,L0A0A ; 0a13 94 f6 li $69 ; 0a15 20 69 lr HU,A ; 0a17 5a dci L0D14 ; 0a18 2a 0d 14 - load DC with data/code pointer pi draw_compressed_text ; 0a1b 28 0b a3 pi draw_compressed_text ; 0a1e 28 0b a3 pi draw_compressed_text ; 0a21 28 0b a3 li $30 ; 0a24 20 30 lr 1,A ; 0a26 51 li $28 ; 0a27 20 28 lr 2,A ; 0a29 52 li $10 ; 0a2a 20 10 lr 3,A ; 0a2c 53 pi bios_drawchar_0215_wrapper ; 0a2d 28 0b 76 lis 6 ; 0a30 76 lr HU,A ; 0a31 5a dci L0D44 ; 0a32 2a 0d 44 - load DC with data/code pointer L0A35: lm ; 0a35 16 - load byte from DC and increment DC lr 1,A ; 0a36 51 lm ; 0a37 16 - load byte from DC and increment DC lr 2,A ; 0a38 52 lm ; 0a39 16 - load byte from DC and increment DC lr 0,A ; 0a3a 50 xdc ; 0a3b 2c - exchange DC and H pointers pi drawchar ; 0a3c 28 06 79 - BIOS draw character routine xdc ; 0a3f 2c - exchange DC and H pointers ds HU ; 0a40 3a bf 4,L0A35 ; 0a41 94 f3 dci L0D56 ; 0a43 2a 0d 56 - load DC with data/code pointer clr ; 0a46 70 lr HU,A ; 0a47 5a pi draw_compressed_text ; 0a48 28 0b a3 lis 6 ; 0a4b 76 lr 3,A ; 0a4c 53 pi clear_screen_o37_1 ; 0a4d 28 0f ed pi bios_score_prompt_wrapper ; 0a50 28 0f d6 dci L0D61 ; 0a53 2a 0d 61 - load DC with data/code pointer li $69 ; 0a56 20 69 lr HU,A ; 0a58 5a pi draw_compressed_text ; 0a59 28 0b a3 pi draw_compressed_text ; 0a5c 28 0b a3 pi draw_compressed_text ; 0a5f 28 0b a3 clr ; 0a62 70 lr HU,A ; 0a63 5a pi draw_compressed_text ; 0a64 28 0b a3 lis 6 ; 0a67 76 lr 3,A ; 0a68 53 pi clear_screen_o37_1 ; 0a69 28 0f ed pi bios_score_prompt_wrapper ; 0a6c 28 0f d6 dci L0D79 ; 0a6f 2a 0d 79 - load DC with data/code pointer lis 6 ; 0a72 76 lr HU,A ; 0a73 5a L0A74: lm ; 0a74 16 - load byte from DC and increment DC lr 1,A ; 0a75 51 lm ; 0a76 16 - load byte from DC and increment DC lr 2,A ; 0a77 52 lm ; 0a78 16 - load byte from DC and increment DC lr 0,A ; 0a79 50 xdc ; 0a7a 2c - exchange DC and H pointers dci L0D8B ; 0a7b 2a 0d 8b - load DC with data/code pointer pi bios_drawchar_bitmap_wrapper ; 0a7e 28 0f cd xdc ; 0a81 2c - exchange DC and H pointers ds HU ; 0a82 3a bf 4,L0A74 ; 0a83 94 f0 dci $0D99 ; 0a85 2a 0d 99 xdc ; 0a88 2c - exchange DC and H pointers dci L0DA8 ; 0a89 2a 0d a8 - load DC with data/code pointer lis 3 ; 0a8c 73 lr HU,A ; 0a8d 5a L0A8E: lm ; 0a8e 16 - load byte from DC and increment DC lr 1,A ; 0a8f 51 lm ; 0a90 16 - load byte from DC and increment DC lr 2,A ; 0a91 52 lm ; 0a92 16 - load byte from DC and increment DC lr 0,A ; 0a93 50 xdc ; 0a94 2c - exchange DC and H pointers pi drawchar_entry ; 0a95 28 06 7c xdc ; 0a98 2c - exchange DC and H pointers ds HU ; 0a99 3a bf 4,L0A8E ; 0a9a 94 f3 dci L0D93 ; 0a9c 2a 0d 93 - load DC with data/code pointer pi draw_compressed_text ; 0a9f 28 0b a3 lis 6 ; 0aa2 76 lr 3,A ; 0aa3 53 pi clear_screen_o37_0 ; 0aa4 28 0f ea dci L0DB1 ; 0aa7 2a 0d b1 - load DC with data/code pointer lis 2 ; 0aaa 72 lr HU,A ; 0aab 5a L0AAC: lm ; 0aac 16 - load byte from DC and increment DC lr 1,A ; 0aad 51 lm ; 0aae 16 - load byte from DC and increment DC lr 2,A ; 0aaf 52 lm ; 0ab0 16 - load byte from DC and increment DC lr 0,A ; 0ab1 50 xdc ; 0ab2 2c - exchange DC and H pointers dci $0F58 ; 0ab3 2a 0f 58 pi drawchar_entry ; 0ab6 28 06 7c xdc ; 0ab9 2c - exchange DC and H pointers ds HU ; 0aba 3a bf 4,L0AAC ; 0abb 94 f0 lis 4 ; 0abd 74 lr HU,A ; 0abe 5a li $10 ; 0abf 20 10 lr 2,A ; 0ac1 52 L0AC2: li $17 ; 0ac2 20 17 lr 1,A ; 0ac4 51 li $81 ; 0ac5 20 81 lr 0,A ; 0ac7 50 pi drawchar ; 0ac8 28 06 79 - BIOS draw character routine lis 5 ; 0acb 75 as 2 ; 0acc c2 lr 2,A ; 0acd 52 ci $27 ; 0ace 25 27 bt 2,L0AC2 ; 0ad0 82 f1 li $1A ; 0ad2 20 1a lr 1,A ; 0ad4 51 li $1A ; 0ad5 20 1a lr 2,A ; 0ad7 52 dci L0DC3 ; 0ad8 2a 0d c3 - load DC with data/code pointer lis 6 ; 0adb 76 lr HU,A ; 0adc 5a L0ADD: lm ; 0add 16 - load byte from DC and increment DC lr 0,A ; 0ade 50 xdc ; 0adf 2c - exchange DC and H pointers dci L0DC9 ; 0ae0 2a 0d c9 - load DC with data/code pointer pi drawchar_entry ; 0ae3 28 06 7c ds 1 ; 0ae6 31 ds 1 ; 0ae7 31 xdc ; 0ae8 2c - exchange DC and H pointers ds HU ; 0ae9 3a bf 4,L0ADD ; 0aea 94 f2 li $2C ; 0aec 20 2c lr 2,A ; 0aee 52 li $12 ; 0aef 20 12 lr 1,A ; 0af1 51 li $80 ; 0af2 20 80 lr 0,A ; 0af4 50 dci L0DCE ; 0af5 2a 0d ce - load DC with data/code pointer pi bios_drawchar_bitmap_wrapper ; 0af8 28 0f cd li $43 ; 0afb 20 43 lr 1,A ; 0afd 51 li $40 ; 0afe 20 40 lr 0,A ; 0b00 50 dci L0DCE ; 0b01 2a 0d ce - load DC with data/code pointer pi bios_drawchar_bitmap_wrapper ; 0b04 28 0f cd pi bios_score_prompt_wrapper ; 0b07 28 0f d6 dci L0DB7 ; 0b0a 2a 0d b7 - load DC with data/code pointer pi draw_compressed_text ; 0b0d 28 0b a3 lis 6 ; 0b10 76 lr 3,A ; 0b11 53 pi clear_screen_o37_0 ; 0b12 28 0f ea dci L0DD6 ; 0b15 2a 0d d6 - load DC with data/code pointer lis 8 ; 0b18 78 lr 2,A ; 0b19 52 L0B1A: lis $F ; 0b1a 7f L0B1B: lr 1,A ; 0b1b 51 li $C0 ; 0b1c 20 c0 lr 0,A ; 0b1e 50 lm ; 0b1f 16 - load byte from DC and increment DC xdc ; 0b20 2c - exchange DC and H pointers lr HU,A ; 0b21 5a sr 4 ; 0b22 14 sl 4 ; 0b23 15 sr 1 ; 0b24 12 lr HL,A ; 0b25 5b lr A,HU ; 0b26 4a sl 4 ; 0b27 15 sr 1 ; 0b28 12 lr HU,A ; 0b29 5a dci L0E26 ; 0b2a 2a 0e 26 - load DC with data/code pointer lr A,HL ; 0b2d 4b adc ; 0b2e 8e pi bios_drawchar_bitmap_wrapper ; 0b2f 28 0f cd ds 1 ; 0b32 31 dci L0E26 ; 0b33 2a 0e 26 - load DC with data/code pointer lr A,HU ; 0b36 4a adc ; 0b37 8e li $C0 ; 0b38 20 c0 lr 0,A ; 0b3a 50 pi bios_drawchar_bitmap_wrapper ; 0b3b 28 0f cd xdc ; 0b3e 2c - exchange DC and H pointers ds 1 ; 0b3f 31 lr A,1 ; 0b40 41 ci $5A ; 0b41 25 5a bt 2,L0B1B ; 0b43 82 d7 lis 4 ; 0b45 74 as 2 ; 0b46 c2 lr 2,A ; 0b47 52 ci $2F ; 0b48 25 2f bt 2,L0B1A ; 0b4a 82 cf dci L0E96 ; 0b4c 2a 0e 96 - load DC with data/code pointer pi draw_compressed_text ; 0b4f 28 0b a3 lis 6 ; 0b52 76 lr 3,A ; 0b53 53 pi clear_screen_o37_0 ; 0b54 28 0f ea L0B57: dci L0E9D ; 0b57 2a 0e 9d - load DC with data/code pointer lis $C ; 0b5a 7c L0B5B: lr HU,A ; 0b5b 5a L0B5C: lm ; 0b5c 16 - load byte from DC and increment DC lr 1,A ; 0b5d 51 lm ; 0b5e 16 - load byte from DC and increment DC lr 2,A ; 0b5f 52 lm ; 0b60 16 - load byte from DC and increment DC lr 0,A ; 0b61 50 xdc ; 0b62 2c - exchange DC and H pointers dci L0EC1 ; 0b63 2a 0e c1 - load DC with data/code pointer pi drawchar_entry ; 0b66 28 06 7c xdc ; 0b69 2c - exchange DC and H pointers ds HU ; 0b6a 3a bf 4,L0B5C ; 0b6b 94 f0 dci L0EE4 ; 0b6d 2a 0e e4 - load DC with data/code pointer pi draw_compressed_text ; 0b70 28 0b a3 jmp reset ; 0b73 29 00 00 - unconditional jump ; ----------------------------------------------------------------------------- ; bios_drawchar_0215_wrapper ; Wrapper around BIOS draw routine at $0215. Saves K, then tail-jumps into BIOS ; code. ; ----------------------------------------------------------------------------- bios_drawchar_0215_wrapper: lr K,P ; 0b76 08 pi pushk ; 0b77 28 01 07 - bios pushk - save return address on BIOS K-stack jmp bios_draw_entity ; 0b7a 29 02 15 - bios, calls draw char - unconditional jump ; ----------------------------------------------------------------------------- ; draw_three_prompt_markers ; Draws three repeated BIOS objects at fixed Y positions $0A, $17 and $24 using ; BIOS routine $01F6. ; ----------------------------------------------------------------------------- draw_three_prompt_markers: lr K,P ; 0b7d 08 pi pushk ; 0b7e 28 01 07 - bios pushk - save return address on BIOS K-stack lis $A ; 0b81 7a lr 2,A ; 0b82 52 pi bios_draw_lives ; 0b83 28 01 f6 li $17 ; 0b86 20 17 lr 2,A ; 0b88 52 pi bios_draw_lives ; 0b89 28 01 f6 li $24 ; 0b8c 20 24 lr 2,A ; 0b8e 52 pi bios_draw_lives ; 0b8f 28 01 f6 pi popk ; 0b92 28 01 1e - restore return address from BIOS K-stack pk ; 0b95 0c - return via K/P after BIOS K-stack restore ; ----------------------------------------------------------------------------- ; short_delay ; Short delay helper. Uses r0 as outer counter and r5 as BIOS delay parameter. ; ----------------------------------------------------------------------------- short_delay: lr K,P ; 0b96 08 lis 3 ; 0b97 73 lr 0,A ; 0b98 50 lis $F ; 0b99 7f lr 5,A ; 0b9a 55 short_delay_loop: pi delay ; 0b9b 28 00 8f ds 0 ; 0b9e 30 bf 4,short_delay_loop ; 0b9f 94 fb lr P,K ; 0ba1 09 pop ; 0ba2 1c - return from subroutine ; ----------------------------------------------------------------------------- ; draw_compressed_text ; Draws a compressed or data-driven text/object stream. DC points at stream ; header: count, Y, X, then character/object bytes. ; ----------------------------------------------------------------------------- draw_compressed_text: lr K,P ; 0ba3 08 pi pushk ; 0ba4 28 01 07 - bios pushk - save return address on BIOS K-stack lm ; 0ba7 16 - load byte from DC and increment DC lr 3,A ; 0ba8 53 lm ; 0ba9 16 - load byte from DC and increment DC lr 2,A ; 0baa 52 lm ; 0bab 16 - load byte from DC and increment DC lr 1,A ; 0bac 51 ; ----------------------------------------------------------------------------- ; draw_compressed_text_next_char ; Inner stream loop. Loads one stream item from DC and draws through BIOS ; drawchar entry with alternate glyph/data pointer. ; ----------------------------------------------------------------------------- draw_compressed_text_next_char: lm ; 0bad 16 - load byte from DC and increment DC lr 0,A ; 0bae 50 xdc ; 0baf 2c - exchange DC and H pointers dci L0EEF ; 0bb0 2a 0e ef - load DC with data/code pointer ; ----------------------------------------------------------------------------- ; draw_compressed_text_write_char ; Calls BIOS drawchar entry for one stream item, advances, and repeats until ; count expires. ; ----------------------------------------------------------------------------- draw_compressed_text_write_char: pi drawchar_entry ; 0bb3 28 06 7c xdc ; 0bb6 2c - exchange DC and H pointers ds 3 ; 0bb7 33 bf 4,draw_compressed_text_next_char ; 0bb8 94 f4 lr A,HU ; 0bba 4a ci $69 ; 0bbb 25 69 bt 4,draw_compressed_text_done ; 0bbd 84 04 pi short_delay ; 0bbf 28 0b 96 ; ----------------------------------------------------------------------------- ; draw_compressed_text_done ; Restores return address from BIOS K-stack and returns from stream drawing ; routine. ; ----------------------------------------------------------------------------- draw_compressed_text_done: pi popk ; 0bc2 28 01 1e - restore return address from BIOS K-stack pk ; 0bc5 0c - return via K/P after BIOS K-stack restore L0BC6: lr QU,A ; 0bc6 06 sl 1 ; 0bc7 13 out $91 ; 0bc8 27 91 bf 9,L0B57 ; 0bca 99 8c bf 4,L0B5B ; 0bcc 94 8e .byte $A3 L0BCF: lr QU,A ; 0bcf 06 oi $26 ; 0bd0 22 26 lr D,A ; 0bd2 5e - store A and decrement ISAR lr A,D ; 0bd3 4e - read selected scratchpad register and decrement ISAR lr 8,A ; 0bd4 58 lr 8,A ; 0bd5 58 lr 2,A ; 0bd6 52 lr I,A ; 0bd7 5d - store A and increment ISAR L0BD8: lr IS,A ; 0bd8 0b ds 1 ; 0bd9 31 di ; 0bda 1a bf $E,L0B6E ; 0bdb 9e 92 xm ; 0bdd 8c lr A,KU ; 0bde 00 lr D,A ; 0bdf 5e - store A and decrement ISAR lr A,HU ; 0be0 4a lr A,S ; 0be1 4c - read selected scratchpad register lr A,KU ; 0be2 00 asd D ; 0be3 de asd J ; 0be4 d9 as D ; 0be5 ce L0BE6: lr DC,H ; 0be6 10 li $0A ; 0be7 20 0a bf $D,L0B7B ; 0be9 9d 91 bf 9,L0B85 ; 0beb 99 99 bf $E,L0B80 ; 0bed 9e 92 bf 8,L0B80 ; 0bef 98 90 lr A,KU ; 0bf1 00 bf 0,draw_three_prompt_markers ; 0bf2 90 8a L0BF4: bf 6,L0B8B ; 0bf4 96 96 L0BF6: adc ; 0bf6 8e bf $C,short_delay_loop ; 0bf7 9c a3 L0BF9: lr KU,A ; 0bf9 04 L0BFA: nop ; 0bfa 2b .byte $2D lr D,A ; 0bfc 5e - store A and decrement ISAR lr A,HU ; 0bfd 4a lr 8,A ; 0bfe 58 lr 4,A ; 0bff 54 L0C00: dci $10C0 ; 0c00 2a 10 c0 lr A,2 ; 0c03 42 lr DC,H ; 0c04 10 as 0 ; 0c05 c0 ds 6 ; 0c06 36 ei ; 0c07 1b as 0 ; 0c08 c0 dci $25C0 ; 0c09 2a 25 c0 lr A,2 ; 0c0c 42 ci $C0 ; 0c0d 25 c0 lnk ; 0c0f 19 lr P0,Q ; 0c10 0d bt 3,L0C64 ; 0c11 83 52 pi $8417 ; 0c13 28 84 17 lr IS,A ; 0c16 0b as 1 ; 0c17 c1 lr 4,A ; 0c18 54 dci $4200 ; 0c19 2a 42 00 L0C1C: li $70 ; 0c1c 20 70 li $00 ; 0c1e 20 00 li $70 ; 0c20 20 70 xs 0 ; 0c22 e0 lr 0,A ; 0c23 50 lr K,P ; 0c24 08 bt 0,L0C76 ; 0c25 80 50 ds 8 ; 0c27 38 clr ; 0c28 70 li $08 ; 0c29 20 08 lr K,P ; 0c2b 08 lr K,P ; 0c2c 08 lr K,P ; 0c2d 08 ns 8 ; 0c2e f8 ns 8 ; 0c2f f8 bt 0,L0BB1 ; 0c30 80 80 bt 0,draw_compressed_text_write_char ; 0c32 80 80 L0C34: lr Q,DC ; 0c34 0e .byte $FF .byte $FF .byte $3F dci $2E2A ; 0c38 2a 2e 2a .byte $2E clr ; 0c3c 70 .byte $FF .byte $FF ns S ; 0c3f fc lr 4,A ; 0c40 54 lis 4 ; 0c41 74 lr 4,A ; 0c42 54 lis 4 ; 0c43 74 lr I,A ; 0c44 5d - store A and increment ISAR lr 5,A ; 0c45 55 lr I,A ; 0c46 5d - store A and increment ISAR lr 5,A ; 0c47 55 lr I,A ; 0c48 5d - store A and increment ISAR lr 5,A ; 0c49 55 lr I,A ; 0c4a 5d - store A and increment ISAR lr 5,A ; 0c4b 55 lr A,KU ; 0c4c 00 lr A,0 ; 0c4d 40 lisu 0 ; 0c4e 60 lis $D ; 0c4f 7d lis $F ; 0c50 7f lis $D ; 0c51 7d lr A,KU ; 0c52 00 lr A,KU ; 0c53 00 lr A,KU ; 0c54 00 lr A,QU ; 0c55 02 lr QU,A ; 0c56 06 outs 14 ; 0c57 be ns D ; 0c58 fe outs 14 ; 0c59 be lr A,KU ; 0c5a 00 lr A,KU ; 0c5b 00 L0C5C: lr K,P ; 0c5c 08 sl 1 ; 0c5d 13 inc ; 0c5e 1f bf $D,L0BFA ; 0c5f 9d 9a bf 2,L0C00 ; 0c61 92 9e br7 L0BF6 ; 0c63 8f 92 L0C65: bf $C,L0BF4 ; 0c65 9c 8e L0C67: ds 0 ; 0c67 30 .byte $2E as 0 ; 0c69 c0 ds 3 ; 0c6a 33 .byte $2E as 0 ; 0c6c c0 ds 1 ; 0c6d 31 ds 3 ; 0c6e 33 as 0 ; 0c6f c0 lr IS,A ; 0c70 0b ds 2 ; 0c71 32 bt 0,L0CCF ; 0c72 80 5c ds 2 ; 0c74 32 lr A,0 ; 0c75 40 L0C76: pk ; 0c76 0c - return via K/P after BIOS K-stack restore lr IS,A ; 0c77 0b st ; 0c78 17 lr A,0 ; 0c79 40 lr A,5 ; 0c7a 45 lr A,0 ; 0c7b 40 lr A,0 ; 0c7c 40 lr A,KU ; 0c7d 00 lr A,KU ; 0c7e 00 lr A,KU ; 0c7f 00 lr A,KU ; 0c80 00 lr A,0 ; 0c81 40 lr A,5 ; 0c82 45 lr A,0 ; 0c83 40 lr A,0 ; 0c84 40 lr KU,A ; 0c85 04 ds 3 ; 0c86 33 .byte $2E lr A,HL ; 0c88 4b lr A,D ; 0c89 4e - read selected scratchpad register and decrement ISAR lr D,A ; 0c8a 5e - store A and decrement ISAR lisu 6 ; 0c8b 66 lr P,K ; 0c8c 09 pop ; 0c8d 1c - return from subroutine li $4B ; 0c8e 20 4b lr 6,A ; 0c90 56 lr A,HU ; 0c91 4a lr A,S ; 0c92 4c - read selected scratchpad register lr 4,A ; 0c93 54 lr 3,A ; 0c94 53 lr A,HU ; 0c95 4a lr A,S ; 0c96 4c - read selected scratchpad register lr 4,A ; 0c97 54 L0C98: ns 8 ; 0c98 f8 bt 4,L0C1C ; 0c99 84 82 bt 1,L0C1D ; 0c9b 81 81 bt 1,L0C1F ; 0c9d 81 81 .byte $FF lr A,KU ; 0ca0 00 lr A,KU ; 0ca1 00 lr A,KU ; 0ca2 00 pop ; 0ca3 1c - return from subroutine xi $22 ; 0ca4 23 22 oi $DC ; 0ca6 22 dc lr A,KU ; 0ca8 00 lr A,KU ; 0ca9 00 lr A,KU ; 0caa 00 lis 8 ; 0cab 78 as 7 ; 0cac c7 lr A,4 ; 0cad 44 lr A,4 ; 0cae 44 ds 8 ; 0caf 38 lr KU,A ; 0cb0 04 lr KU,A ; 0cb1 04 lr KU,A ; 0cb2 04 lr KU,A ; 0cb3 04 ns S ; 0cb4 fc lr A,4 ; 0cb5 44 lr A,4 ; 0cb6 44 lis $F ; 0cb7 7f lr DC,H ; 0cb8 10 pi $2828 ; 0cb9 28 28 28 pi $2810 ; 0cbc 28 28 10 .byte $EF lr A,KU ; 0cc0 00 lr A,KU ; 0cc1 00 lr A,KU ; 0cc2 00 lr K,P ; 0cc3 08 sr 4 ; 0cc4 14 sr 4 ; 0cc5 14 lr K,P ; 0cc6 08 ns 6 ; 0cc7 f6 L0CC8: .byte $FF as 3 ; 0cc9 c3 ins 5 ; 0cca a5 bf 9,L0C65 ; 0ccb 99 99 ins 5 ; 0ccd a5 as 3 ; 0cce c3 L0CCF: .byte $FF L0CD0: lr IS,A ; 0cd0 0b ds 0 ; 0cd1 30 lnk ; 0cd2 19 nm ; 0cd3 8a .byte $DF lr D,A ; 0cd5 5e - store A and decrement ISAR bf 9,L0CD7 ; 0cd6 99 00 lr A,I ; 0cd8 4d - read selected scratchpad register and increment ISAR lr J,A ; 0cd9 59 asd J ; 0cda d9 as I ; 0cdb cd lr 6,A ; 0cdc 56 adc ; 0cdd 8e L0CDE: ei ; 0cde 1b lr DC,H ; 0cdf 10 bt 2,L0D31 ; 0ce0 82 50 out $82 ; 0ce2 27 82 ci $0D ; 0ce4 25 0d as 1 ; 0ce6 c1 ds I ; 0ce7 3d lr DC,H ; 0ce8 10 as 1 ; 0ce9 c1 ds 6 ; 0cea 36 ei ; 0ceb 1b as 1 ; 0cec c1 L0CED: .byte $2F ci $C1 ; 0cee 25 c1 lr A,7 ; 0cf0 47 pi $C117 ; 0cf1 28 c1 17 lr IS,A ; 0cf4 0b as 0 ; 0cf5 c0 lr 4,A ; 0cf6 54 dci $4000 ; 0cf7 2a 40 00 li $F8 ; 0cfa 20 f8 clr ; 0cfc 70 L0CFD: lr A,KU ; 0cfd 00 lr A,KU ; 0cfe 00 lr 0,A ; 0cff 50 li $50 ; 0d00 20 50 lr A,KU ; 0d02 00 li $70 ; 0d03 20 70 asd 8 ; 0d05 d8 clr ; 0d06 70 li $09 ; 0d07 20 09 lm ; 0d09 16 - load byte from DC and increment DC lr W,J ; 0d0a 1d lr I,A ; 0d0b 5d - store A and increment ISAR lr HU,A ; 0d0c 5a lr A,HU ; 0d0d 4a lr A,S ; 0d0e 4c - read selected scratchpad register lr A,D ; 0d0f 4e - read selected scratchpad register and decrement ISAR lr A,KU ; 0d10 00 lisu 1 ; 0d11 61 lr A,HU ; 0d12 4a lr S,A ; 0d13 5c - store A in selected scratchpad register L0D14: lr P0,Q ; 0d14 0d lr DC,H ; 0d15 10 sl 1 ; 0d16 13 lr A,KU ; 0d17 00 lr A,2 ; 0d18 42 lr A,3 ; 0d19 43 lr A,KU ; 0d1a 00 lr A,KU ; 0d1b 00 lr A,KU ; 0d1c 00 lr A,7 ; 0d1d 47 lr A,2 ; 0d1e 42 lr A,KU ; 0d1f 00 lr A,KU ; 0d20 00 lr A,KU ; 0d21 00 lr A,1 ; 0d22 41 lr A,3 ; 0d23 43 lr P0,Q ; 0d24 0d lm ; 0d25 16 - load byte from DC and increment DC sl 1 ; 0d26 13 xs J ; 0d27 e9 lr A,4 ; 0d28 44 L0D29: lr A,2 ; 0d29 42 lr A,KU ; 0d2a 00 lr A,KU ; 0d2b 00 xs HU ; 0d2c ea lr A,1 ; 0d2d 41 lr A,3 ; 0d2e 43 lr A,KU ; 0d2f 00 lr A,KU ; 0d30 00 L0D31: xs 2 ; 0d31 e2 lr A,KU ; 0d32 00 lr A,3 ; 0d33 43 lr P0,Q ; 0d34 0d lr J,W ; 0d35 1e sl 1 ; 0d36 13 lr A,KU ; 0d37 00 lr A,6 ; 0d38 46 lr A,5 ; 0d39 45 lr A,KU ; 0d3a 00 lr A,KU ; 0d3b 00 lr A,KU ; 0d3c 00 lr A,5 ; 0d3d 45 lr A,J ; 0d3e 49 lr A,KU ; 0d3f 00 lr A,KU ; 0d40 00 lr A,KU ; 0d41 00 lr A,3 ; 0d42 43 lr A,J ; 0d43 49 L0D44: .byte $2E nop ; 0d45 2b bt 1,L0D6F ; 0d46 81 28 xdc ; 0d48 2c - exchange DC and H pointers lr A,3 ; 0d49 43 ds 5 ; 0d4a 35 xdc ; 0d4b 2c - exchange DC and H pointers lr A,6 ; 0d4c 46 ds HL ; 0d4d 3b xdc ; 0d4e 2c - exchange DC and H pointers lr A,J ; 0d4f 49 ds 5 ; 0d50 35 ai $42 ; 0d51 24 42 ds HL ; 0d53 3b ai $43 ; 0d54 24 43 L0D56: lr K,P ; 0d56 08 lr P,K ; 0d57 09 li $97 ; 0d58 20 97 nm ; 0d5a 8a bf $E,L0CED ; 0d5b 9e 91 bf $B,L0CFD ; 0d5d 9b 9f bf 2,L0D04 ; 0d5f 92 a4 L0D61: lr A,QL ; 0d61 03 out $14 ; 0d62 27 14 lr A,0 ; 0d64 40 lr A,0 ; 0d65 40 lr A,0 ; 0d66 40 lr A,KL ; 0d67 01 .byte $2D sr 4 ; 0d69 14 lisl 2 ; 0d6a 6a lr A,QU ; 0d6b 02 ds 3 ; 0d6c 33 ds 3 ; 0d6d 33 lr A,2 ; 0d6e 42 L0D6F: lr A,0 ; 0d6f 40 lr QU,A ; 0d70 06 L0D71: lr H,DC ; 0d71 11 out $CB ; 0d72 27 cb as HU ; 0d74 ca asd 0 ; 0d75 d0 as D ; 0d76 ce asd 6 ; 0d77 d6 asd I ; 0d78 dd L0D79: sr 4 ; 0d79 14 lnk ; 0d7a 19 bt 0,L0D96 ; 0d7b 80 1a lnk ; 0d7d 19 bt 0,L0DAF ; 0d7e 80 30 lnk ; 0d80 19 lr A,0 ; 0d81 40 ds 6 ; 0d82 36 lnk ; 0d83 19 lr A,0 ; 0d84 40 lr A,I ; 0d85 4d - read selected scratchpad register and increment ISAR lnk ; 0d86 19 lr A,0 ; 0d87 40 lr 3,A ; 0d88 53 lnk ; 0d89 19 lr A,0 ; 0d8a 40 L0D8B: ns D ; 0d8b fe ns D ; 0d8c fe ns D ; 0d8d fe ns D ; 0d8e fe ns D ; 0d8f fe ns D ; 0d90 fe ns D ; 0d91 fe lr A,KU ; 0d92 00 L0D93: lr A,QL ; 0d93 03 lr H,DC ; 0d94 11 .byte $2E L0D96: bf 8,L0D29 ; 0d96 98 92 bf 7,L0D71 ; 0d98 97 d8 asd 8 ; 0d9a d8 asd 8 ; 0d9b d8 asd 8 ; 0d9c d8 asd 8 ; 0d9d d8 lr A,KU ; 0d9e 00 clr ; 0d9f 70 lr A,KU ; 0da0 00 clr ; 0da1 70 lr A,KU ; 0da2 00 lr A,KU ; 0da3 00 ns 0 ; 0da4 f0 lr A,KU ; 0da5 00 lis $F ; 0da6 7f lr A,KU ; 0da7 00 L0DA8: com ; 0da8 18 di ; 0da9 1a bt 0,L0DDF ; 0daa 80 34 di ; 0dac 1a lr A,0 ; 0dad 40 lr 1,A ; 0dae 51 L0DAF: di ; 0daf 1a lr A,0 ; 0db0 40 L0DB1: lr DC,H ; 0db1 10 lr DC,H ; 0db2 10 bt 0,L0DC4 ; 0db3 80 10 xi $40 ; 0db5 23 40 L0DB7: lr P,K ; 0db7 09 lr K,P ; 0db8 08 st ; 0db9 17 as I ; 0dba cd asd S ; 0dbb dc as HU ; 0dbc ca asd 0 ; 0dbd d0 lr A,KU ; 0dbe 00 asd S ; 0dbf dc as HU ; 0dc0 ca as S ; 0dc1 cc as D ; 0dc2 ce L0DC3: as 0 ; 0dc3 c0 L0DC4: bt 0,L0E05 ; 0dc4 80 40 as 0 ; 0dc6 c0 bt 0,L0E08 ; 0dc7 80 40 L0DC9: ns 0 ; 0dc9 f0 ns 0 ; 0dca f0 ns 0 ; 0dcb f0 ns 0 ; 0dcc f0 lr A,KU ; 0dcd 00 L0DCE: .byte $FF .byte $FF lr A,KU ; 0dd0 00 lr A,KU ; 0dd1 00 lr A,KU ; 0dd2 00 lr A,KU ; 0dd3 00 lr A,KU ; 0dd4 00 lr A,KU ; 0dd5 00 L0DD6: lr A,5 ; 0dd6 45 lr A,5 ; 0dd7 45 lr A,5 ; 0dd8 45 lr A,J ; 0dd9 49 as 5 ; 0dda c5 lr A,S ; 0ddb 4c - read selected scratchpad register lr 4,A ; 0ddc 54 as 5 ; 0ddd c5 as 7 ; 0dde c7 L0DDF: lisu 3 ; 0ddf 63 asd I ; 0de0 dd asd 7 ; 0de1 d7 lr I,A ; 0de2 5d - store A and increment ISAR asd 1 ; 0de3 d1 asd I ; 0de4 dd lr A,6 ; 0de5 46 asd 4 ; 0de6 d4 lisu 4 ; 0de7 64 lisu 7 ; 0de8 67 lisu 1 ; 0de9 61 asd I ; 0dea dd asd I ; 0deb dd asd I ; 0dec dd asd 1 ; 0ded d1 bt 7,L0E46 ; 0dee 87 57 as S ; 0df0 cc lr I,A ; 0df1 5d - store A and increment ISAR asd 7 ; 0df2 d7 lisl 5 ; 0df3 6d bt 6,L0E6B ; 0df4 86 76 asd 4 ; 0df6 d4 lisl 4 ; 0df7 6c as S ; 0df8 cc lisu 7 ; 0df9 67 lisu 1 ; 0dfa 61 lr A,HL ; 0dfb 4b lisu 4 ; 0dfc 64 bf 2,L0E74 ; 0dfd 92 76 pk ; 0dff 0c - return via K/P after BIOS K-stack restore as 5 ; 0e00 c5 sr 4 ; 0e01 14 as HL ; 0e02 cb lisu 0 ; 0e03 60 as 6 ; 0e04 c6 L0E05: lis 5 ; 0e05 75 lr KL,A ; 0e06 05 lr A,S ; 0e07 4c - read selected scratchpad register L0E08: as HL ; 0e08 cb lisl 5 ; 0e09 6d lr A,2 ; 0e0a 42 lr 4,A ; 0e0b 54 lr 4,A ; 0e0c 54 lr I,A ; 0e0d 5d - store A and increment ISAR lr A,6 ; 0e0e 46 lis 5 ; 0e0f 75 lr A,S ; 0e10 4c - read selected scratchpad register as 6 ; 0e11 c6 asd 4 ; 0e12 d4 lis 6 ; 0e13 76 lis 6 ; 0e14 76 lis $B ; 0e15 7b xm ; 0e16 8c as 6 ; 0e17 c6 ins 4 ; 0e18 a4 lr 4,A ; 0e19 54 lisu 7 ; 0e1a 67 lr 4,A ; 0e1b 54 lr 4,A ; 0e1c 54 lr 1,A ; 0e1d 51 lis $C ; 0e1e 7c as 2 ; 0e1f c2 lis 6 ; 0e20 76 lis $B ; 0e21 7b as S ; 0e22 cc outs 6 ; 0e23 b6 lis 6 ; 0e24 76 lis 6 ; 0e25 76 L0E26: ns D ; 0e26 fe ns D ; 0e27 fe as 0 ; 0e28 c0 as 0 ; 0e29 c0 ns D ; 0e2a fe ns D ; 0e2b fe lr A,KU ; 0e2c 00 lr A,KU ; 0e2d 00 ns D ; 0e2e fe ns D ; 0e2f fe as 6 ; 0e30 c6 as 6 ; 0e31 c6 as 6 ; 0e32 c6 as 6 ; 0e33 c6 lr A,KU ; 0e34 00 lr A,KU ; 0e35 00 ns D ; 0e36 fe ns D ; 0e37 fe lr QU,A ; 0e38 06 lr QU,A ; 0e39 06 ns D ; 0e3a fe ns D ; 0e3b fe lr A,KU ; 0e3c 00 lr A,KU ; 0e3d 00 as 6 ; 0e3e c6 as 6 ; 0e3f c6 as 6 ; 0e40 c6 as 6 ; 0e41 c6 ns D ; 0e42 fe ns D ; 0e43 fe lr A,KU ; 0e44 00 lr A,KU ; 0e45 00 L0E46: ns D ; 0e46 fe ns D ; 0e47 fe as 0 ; 0e48 c0 as 0 ; 0e49 c0 as 6 ; 0e4a c6 as 6 ; 0e4b c6 lr A,KU ; 0e4c 00 lr A,KU ; 0e4d 00 ns D ; 0e4e fe ns D ; 0e4f fe lr QU,A ; 0e50 06 lr QU,A ; 0e51 06 as 6 ; 0e52 c6 as 6 ; 0e53 c6 lr A,KU ; 0e54 00 lr A,KU ; 0e55 00 L0E56: as 6 ; 0e56 c6 as 6 ; 0e57 c6 L0E58: lr QU,A ; 0e58 06 lr QU,A ; 0e59 06 ns D ; 0e5a fe ns D ; 0e5b fe lr A,KU ; 0e5c 00 lr A,KU ; 0e5d 00 as 6 ; 0e5e c6 as 6 ; 0e5f c6 as 0 ; 0e60 c0 as 0 ; 0e61 c0 ns D ; 0e62 fe ns D ; 0e63 fe lr A,KU ; 0e64 00 lr A,KU ; 0e65 00 as 6 ; 0e66 c6 as 6 ; 0e67 c6 as 0 ; 0e68 c0 as 0 ; 0e69 c0 as 6 ; 0e6a c6 L0E6B: as 6 ; 0e6b c6 lr A,KU ; 0e6c 00 lr A,KU ; 0e6d 00 ns D ; 0e6e fe ns D ; 0e6f fe lr A,KU ; 0e70 00 lr A,KU ; 0e71 00 as 6 ; 0e72 c6 as 6 ; 0e73 c6 L0E74: lr A,KU ; 0e74 00 lr A,KU ; 0e75 00 as 6 ; 0e76 c6 as 6 ; 0e77 c6 L0E78: lr QU,A ; 0e78 06 lr QU,A ; 0e79 06 as 6 ; 0e7a c6 as 6 ; 0e7b c6 lr A,KU ; 0e7c 00 lr A,KU ; 0e7d 00 as 6 ; 0e7e c6 as 6 ; 0e7f c6 lr A,KU ; 0e80 00 lr A,KU ; 0e81 00 ns D ; 0e82 fe ns D ; 0e83 fe L0E84: lr A,KU ; 0e84 00 lr A,KU ; 0e85 00 ns D ; 0e86 fe ns D ; 0e87 fe lr A,KU ; 0e88 00 lr A,KU ; 0e89 00 ns D ; 0e8a fe ns D ; 0e8b fe lr A,KU ; 0e8c 00 lr A,KU ; 0e8d 00 L0E8E: as 6 ; 0e8e c6 as 6 ; 0e8f c6 as 6 ; 0e90 c6 as 6 ; 0e91 c6 as 6 ; 0e92 c6 as 6 ; 0e93 c6 lr A,KU ; 0e94 00 lr A,KU ; 0e95 00 L0E96: lr KU,A ; 0e96 04 ds 3 ; 0e97 33 nop ; 0e98 2b lr 7,A ; 0e99 57 lr A,HU ; 0e9a 4a lisu 4 ; 0e9b 64 lr A,D ; 0e9c 4e - read selected scratchpad register and decrement ISAR L0E9D: sl 4 ; 0e9d 15 di ; 0e9e 1a lr A,0 ; 0e9f 40 com ; 0ea0 18 lr P0,Q ; 0ea1 0d lr A,0 ; 0ea2 40 ds 5 ; 0ea3 35 lr A,IS ; 0ea4 0a lr A,0 ; 0ea5 40 lr 0,A ; 0ea6 50 lr P0,Q ; 0ea7 0d lr A,0 ; 0ea8 40 sr 1 ; 0ea9 12 oi $41 ; 0eaa 22 41 ds 7 ; 0eac 37 L0EAD: sr 4 ; 0ead 14 lr A,1 ; 0eae 41 lr 8,A ; 0eaf 58 oi $41 ; 0eb0 22 41 ds 7 ; 0eb2 37 lr W,J ; 0eb3 1d lr A,2 ; 0eb4 42 ds 5 ; 0eb5 35 ds 6 ; 0eb6 36 lr A,3 ; 0eb7 43 ds 4 ; 0eb8 34 ds 1 ; 0eb9 31 L0EBA: bt 4,L0EF1 ; 0eba 84 36 ds 0 ; 0ebc 30 lr A,5 ; 0ebd 45 L0EBE: .byte $2F ds 0 ; 0ebf 30 as 6 ; 0ec0 c6 L0EC1: lr DC,H ; 0ec1 10 ds 8 ; 0ec2 38 ds 8 ; 0ec3 38 pi $2810 ; 0ec4 28 28 10 ds 8 ; 0ec7 38 ds 8 ; 0ec8 38 pi $E8A0 ; 0ec9 28 e8 a0 ns 0 ; 0ecc f0 clr ; 0ecd 70 lr 0,A ; 0ece 50 lr 0,A ; 0ecf 50 li $70 ; 0ed0 20 70 clr ; 0ed2 70 asd 8 ; 0ed3 d8 lr A,KU ; 0ed4 00 bt 0,L0E56 ; 0ed5 80 80 bt 0,L0E58 ; 0ed7 80 80 L0ED9: bt 0,L0EBA ; 0ed9 80 e0 xs 0 ; 0edb e0 lr A,KU ; 0edc 00 lr A,KU ; 0edd 00 L0EDE: lr A,KU ; 0ede 00 li $78 ; 0edf 20 78 clr ; 0ee1 70 lr 0,A ; 0ee2 50 lr 0,A ; 0ee3 50 L0EE4: lr K,P ; 0ee4 08 ci $20 ; 0ee5 25 20 om ; 0ee7 8b nm ; 0ee8 8a bf $D,L0E78 ; 0ee9 9d 8e om ; 0eeb 8b nm ; 0eec 8a bf 6,L0E84 ; 0eed 96 96 L0EEF: ns 8 ; 0eef f8 am ; 0ef0 88 L0EF1: am ; 0ef1 88 am ; 0ef2 88 L0EF3: ns 8 ; 0ef3 f8 L0EF4: li $60 ; 0ef4 20 60 li $20 ; 0ef6 20 20 clr ; 0ef8 70 ns 8 ; 0ef9 f8 lr K,P ; 0efa 08 ns 8 ; 0efb f8 bt 0,L0EF5 ; 0efc 80 f8 ns 8 ; 0efe f8 lr K,P ; 0eff 08 ds 8 ; 0f00 38 lr K,P ; 0f01 08 L0F02: ns 8 ; 0f02 f8 am ; 0f03 88 am ; 0f04 88 ns 8 ; 0f05 f8 lr K,P ; 0f06 08 L0F07: lr K,P ; 0f07 08 ns 8 ; 0f08 f8 bt 0,L0F02 ; 0f09 80 f8 lr K,P ; 0f0b 08 ns 8 ; 0f0c f8 bt 0,L0E8E ; 0f0d 80 80 ns 8 ; 0f0f f8 am ; 0f10 88 ns 8 ; 0f11 f8 ns 8 ; 0f12 f8 lr K,P ; 0f13 08 lr DC,H ; 0f14 10 lr DC,H ; 0f15 10 lr DC,H ; 0f16 10 L0F17: ns 8 ; 0f17 f8 am ; 0f18 88 ns 8 ; 0f19 f8 am ; 0f1a 88 ns 8 ; 0f1b f8 L0F1C: ns 8 ; 0f1c f8 am ; 0f1d 88 ns 8 ; 0f1e f8 lr K,P ; 0f1f 08 lr K,P ; 0f20 08 ns 8 ; 0f21 f8 am ; 0f22 88 ns 8 ; 0f23 f8 am ; 0f24 88 am ; 0f25 88 ns 8 ; 0f26 f8 L0F27: lr A,8 ; 0f27 48 lis 8 ; 0f28 78 lr A,8 ; 0f29 48 ns 8 ; 0f2a f8 ns 8 ; 0f2b f8 bt 0,L0EAD ; 0f2c 80 80 bt 0,L0F27 ; 0f2e 80 f8 ns 8 ; 0f30 f8 L0F31: lr A,8 ; 0f31 48 lr A,8 ; 0f32 48 lr A,8 ; 0f33 48 ns 8 ; 0f34 f8 ns 8 ; 0f35 f8 bt 0,L0F17 ; 0f36 80 e0 bt 0,L0F31 ; 0f38 80 f8 ns 8 ; 0f3a f8 bt 0,L0F1C ; 0f3b 80 e0 bt 0,L0EBE ; 0f3d 80 80 ns 8 ; 0f3f f8 bt 0,L0ED9 ; 0f40 80 98 am ; 0f42 88 ns 8 ; 0f43 f8 am ; 0f44 88 am ; 0f45 88 ns 8 ; 0f46 f8 am ; 0f47 88 am ; 0f48 88 ns 8 ; 0f49 f8 li $20 ; 0f4a 20 20 li $F8 ; 0f4c 20 f8 ns 8 ; 0f4e f8 li $20 ; 0f4f 20 20 ins 0 ; 0f51 a0 xs 0 ; 0f52 e0 bf 0,L0EF4 ; 0f53 90 a0 as 0 ; 0f55 c0 ins 0 ; 0f56 a0 bf 0,L0F58 ; 0f57 90 00 as 8 ; 0f59 c8 .byte $FF as 8 ; 0f5b c8 lr A,KU ; 0f5c 00 bt 0,L0EDE ; 0f5d 80 80 bt 0,L0EE0 ; 0f5f 80 80 ns 8 ; 0f61 f8 L0F62: am ; 0f62 88 asd 8 ; 0f63 d8 ins 8 ; 0f64 a8 am ; 0f65 88 am ; 0f66 88 am ; 0f67 88 as 8 ; 0f68 c8 ins 8 ; 0f69 a8 bf 8,L0EF3 ; 0f6a 98 88 ns 8 ; 0f6c f8 am ; 0f6d 88 am ; 0f6e 88 am ; 0f6f 88 ns 8 ; 0f70 f8 ns 8 ; 0f71 f8 am ; 0f72 88 ns 8 ; 0f73 f8 bt 0,L0EF5 ; 0f74 80 80 ns 8 ; 0f76 f8 am ; 0f77 88 am ; 0f78 88 bf 0,L0F62 ; 0f79 90 e8 ns 8 ; 0f7b f8 am ; 0f7c 88 ns 8 ; 0f7d f8 bf 0,L0F07 ; 0f7e 90 88 ns 8 ; 0f80 f8 bt 0,L0F7A ; 0f81 80 f8 lr K,P ; 0f83 08 ns 8 ; 0f84 f8 ns 8 ; 0f85 f8 li $20 ; 0f86 20 20 li $20 ; 0f88 20 20 am ; 0f8a 88 am ; 0f8b 88 am ; 0f8c 88 am ; 0f8d 88 ns 8 ; 0f8e f8 am ; 0f8f 88 am ; 0f90 88 am ; 0f91 88 lr 0,A ; 0f92 50 li $88 ; 0f93 20 88 am ; 0f95 88 ins 8 ; 0f96 a8 asd 8 ; 0f97 d8 am ; 0f98 88 am ; 0f99 88 lr 0,A ; 0f9a 50 li $50 ; 0f9b 20 50 am ; 0f9d 88 am ; 0f9e 88 am ; 0f9f 88 ns 8 ; 0fa0 f8 li $20 ; 0fa1 20 20 ns 8 ; 0fa3 f8 lr DC,H ; 0fa4 10 li $40 ; 0fa5 20 40 ns 8 ; 0fa7 f8 lr A,KU ; 0fa8 00 lr A,KU ; 0fa9 00 lr A,KU ; 0faa 00 lr A,KU ; 0fab 00 lr A,KU ; 0fac 00 ns 8 ; 0fad f8 lr K,P ; 0fae 08 ds 8 ; 0faf 38 lr A,KU ; 0fb0 00 li $00 ; 0fb1 20 00 lr A,KU ; 0fb3 00 lr A,KU ; 0fb4 00 lr A,KU ; 0fb5 00 lr A,0 ; 0fb6 40 li $20 ; 0fb7 20 20 li $00 ; 0fb9 20 00 li $20 ; 0fbb 20 20 li $F8 ; 0fbd 20 f8 li $20 ; 0fbf 20 20 lr A,KU ; 0fc1 00 lr A,KU ; 0fc2 00 ns 8 ; 0fc3 f8 lr A,KU ; 0fc4 00 lr A,KU ; 0fc5 00 ; ----------------------------------------------------------------------------- ; bios_draw_a01fc_wrapper ; Wrapper for BIOS routine $01FC. Used for a repeated object/sprite style draw. ; ----------------------------------------------------------------------------- bios_draw_a01fc_wrapper: lr K,P ; 0fc6 08 pi pushk ; 0fc7 28 01 07 - bios pushk - save return address on BIOS K-stack jmp $01FC ; 0fca 29 01 fc - unconditional jump ; ----------------------------------------------------------------------------- ; bios_drawchar_bitmap_wrapper ; Wrapper for BIOS drawchar bitmap entry. Sets r4=8 before tail-jumping into ; BIOS drawchar internals. ; ----------------------------------------------------------------------------- bios_drawchar_bitmap_wrapper: lr K,P ; 0fcd 08 pi pushk ; 0fce 28 01 07 - bios pushk - save return address on BIOS K-stack lis 8 ; 0fd1 78 lr 4,A ; 0fd2 54 jmp bios_drawchar_bitmap_entry ; 0fd3 29 06 8a - unconditional jump ; ----------------------------------------------------------------------------- ; bios_score_prompt_wrapper ; Wrapper around BIOS score/prompt rendering helper. Initializes object bytes ; at O26/O27 before BIOS calls. ; ----------------------------------------------------------------------------- bios_score_prompt_wrapper: lr K,P ; 0fd6 08 pi pushk ; 0fd7 28 01 07 - bios pushk - save return address on BIOS K-stack lisu 2 ; 0fda 62 lisl 6 ; 0fdb 6e li $99 ; 0fdc 20 99 lr I,A ; 0fde 5d - store A and increment ISAR lr S,A ; 0fdf 5c - store A in selected scratchpad register pi bios_score_left ; 0fe0 28 02 ac pi bios_score_right ; 0fe3 28 02 b5 pi popk ; 0fe6 28 01 1e - restore return address from BIOS K-stack pk ; 0fe9 0c - return via K/P after BIOS K-stack restore ; ----------------------------------------------------------------------------- ; clear_screen_o37_0 ; Clear-screen wrapper variant. Stores 0 in O37 before calling BIOS clearscrn. ; ----------------------------------------------------------------------------- clear_screen_o37_0: clr ; 0fea 70 bf 0,clear_screen_common ; 0feb 90 02 ; ----------------------------------------------------------------------------- ; clear_screen_o37_1 ; Clear-screen wrapper variant. Stores 1 in O37 before calling BIOS clearscrn. ; ----------------------------------------------------------------------------- clear_screen_o37_1: lis 1 ; 0fed 71 ; ----------------------------------------------------------------------------- ; clear_screen_common ; Common clear-screen helper. Stores O37, builds r3=$D0+r3, then calls BIOS ; clearscrn. ; ----------------------------------------------------------------------------- clear_screen_common: lisu 3 ; 0fee 63 lisl 7 ; 0fef 6f lr S,A ; 0ff0 5c - store A in selected scratchpad register lr K,P ; 0ff1 08 pi pushk ; 0ff2 28 01 07 - bios pushk - save return address on BIOS K-stack li $D0 ; 0ff5 20 d0 as 3 ; 0ff7 c3 lr 3,A ; 0ff8 53 pi clearscrn ; 0ff9 28 00 d0 - bios clear screen routine pi popk ; 0ffc 28 01 1e - restore return address from BIOS K-stack pk ; 0fff 0c - return via K/P after BIOS K-stack restore