Difference between revisions of "Disassembly:Democart 2"

From veswiki
Jump to: navigation, search
Line 1: Line 1:
{{Incomplete Disassembly}}
 
  
This is the complete disassembly of the [[Channel F]] [[Democart 2]] made with Peter Trauner's [[f8tool]]. Original code is copyright © 1977 Fairchild Semiconductor.
+
This is a disassembly of the [[Channel F]] [[Democart 2]]. Original code is copyright © 1977 Fairchild Semiconductor.
  
 
<pre>
 
<pre>
Reset: equ $0000
+
; -----------------------------------------------------------------------------
 +
; Annotated and formatted Democart 2 disassembly.
 +
; -----------------------------------------------------------------------------
  
org $0800
+
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
  
CartridgeStart: LR  $5,A                ; 0800 55
 
                NOP                      ; 0801 2b
 
CartridgeEntry: LISU 3                  ; 0802 63
 
                LISL 7                  ; 0803 6f
 
                LIS  $1                  ; 0804 71
 
                LR  (IS),A              ; 0805 5c
 
                PI  $0135              ; 0806 28 01 35
 
                DCI  A0bc6              ; 0809 2a 0b c6
 
                PI  A0ba3              ; 080c 28 0b a3
 
                LISU 3                  ; 080f 63
 
                LISL 7                  ; 0810 6f
 
                LIS  $3                  ; 0811 73
 
                LR  (IS),A              ; 0812 5c
 
                PI  $0135              ; 0813 28 01 35
 
                DCI  A0bcf              ; 0816 2a 0b cf
 
                PI  A0ba3              ; 0819 28 0b a3
 
                LIS  $6                  ; 081c 76
 
                LR  $3,A                ; 081d 53
 
                PI  A0fea              ; 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  A0b76              ; 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  A0b76              ; 0836 28 0b 76
 
                LI  $33                ; 0839 20 33
 
                LR  $1,A                ; 083b 51
 
                PI  A0b7d              ; 083c 28 0b 7d
 
                LI  $41                ; 083f 20 41
 
                LR  $1,A                ; 0841 51
 
                PI  A0b7d              ; 0842 28 0b 7d
 
                DCI  A0bd8              ; 0845 2a 0b d8
 
                PI  A0ba3              ; 0848 28 0b a3
 
                LIS  $0                  ; 084b 70
 
                LR  $3,A                ; 084c 53
 
                PI  A0fed              ; 084d 28 0f ed
 
                LI  $14                ; 0850 20 14
 
                LR  $1,A                ; 0852 51
 
                LIS  $6                  ; 0853 76
 
                LR  $2,A                ; 0854 52
 
                PI  $020e              ; 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  $020e              ; 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  $0679              ; 0868 28 06 79
 
                DCI  A0be6              ; 086b 2a 0b e6
 
                PI  A0ba3              ; 086e 28 0b a3
 
                LIS  $6                  ; 0871 76
 
                LR  $3,A                ; 0872 53
 
                PI  A0fea              ; 0873 28 0f ea
 
                LIS  $6                  ; 0876 76
 
                LR  $a,A                ; 0877 5a
 
                DCI  A0c98              ; 0878 2a 0c 98
 
                LI  $20                ; 087b 20 20
 
                LR  $1,A                ; 087d 51
 
                LR  $2,A                ; 087e 52
 
A087f:          LI  $80                ; 087f 20 80
 
                LR  $0,A                ; 0881 50
 
                PI  A0fcd              ; 0882 28 0f cd
 
                LIS  $2                  ; 0885 72
 
                AS  $1                  ; 0886 c1
 
                LR  $1,A                ; 0887 51
 
                DS  $a                  ; 0888 3a
 
                BF  $4,A087f            ; 0889 94 f5
 
                PI  A0b96              ; 088b 28 0b 96
 
                LIS  $6                  ; 088e 76
 
                LR  $3,A                ; 088f 53
 
                PI  A0fea              ; 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  A0cc8              ; 0899 2a 0c c8
 
                LI  $80                ; 089c 20 80
 
                LR  $0,A                ; 089e 50
 
                PI  A0fcd              ; 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  A0cc8              ; 08a8 2a 0c c8
 
                PI  A0fcd              ; 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  A0cc8              ; 08b7 2a 0c c8
 
                PI  A0fcd              ; 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  A0cc8              ; 08c3 2a 0c c8
 
                PI  A0fcd              ; 08c6 28 0f cd
 
                DCI  A0cd0              ; 08c9 2a 0c d0
 
                PI  A0ba3              ; 08cc 28 0b a3
 
                LIS  $6                  ; 08cf 76
 
                LR  $3,A                ; 08d0 53
 
                PI  A0fed              ; 08d1 28 0f ed
 
                LI  $13                ; 08d4 20 13
 
                LR  $1,A                ; 08d6 51
 
                LIS  $6                  ; 08d7 76
 
                LR  $2,A                ; 08d8 52
 
                PI  $020e              ; 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  $020e              ; 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  A0fc6              ; 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  A0fc6              ; 08f8 28 0f c6
 
                LIS  $9                  ; 08fb 79
 
                LR  $4,A                ; 08fc 54
 
                DCI  A0c00              ; 08fd 2a 0c 00
 
A0900:          LM                      ; 0900 16
 
                LR  $1,A                ; 0901 51
 
                LM                      ; 0902 16
 
                LR  $2,A                ; 0903 52
 
                LM                      ; 0904 16
 
                LR  $0,A                ; 0905 50
 
                XDC                      ; 0906 2c
 
                DCI  $0c1b              ; 0907 2a 0c 1b
 
                PI  $067c              ; 090a 28 06 7c
 
                XDC                      ; 090d 2c
 
                DS  $4                  ; 090e 34
 
                BF  $4,A0900            ; 090f 94 f0
 
                PI  A0fd6              ; 0911 28 0f d6
 
                DCI  A0bf9              ; 0914 2a 0b f9
 
                PI  A0ba3              ; 0917 28 0b a3
 
                LIS  $6                  ; 091a 76
 
                LR  $3,A                ; 091b 53
 
                PI  A0fea              ; 091c 28 0f ea
 
                LIS  $0                  ; 091f 70
 
                LR  $2,A                ; 0920 52
 
                LR  $0,A                ; 0921 50
 
                LIS  $d                  ; 0922 7d
 
                LR  $a,A                ; 0923 5a
 
A0924:          LI  $7e                ; 0924 20 7e
 
                LR  $1,A                ; 0926 51
 
                PI  $0679              ; 0927 28 06 79
 
                LR  A,$2                ; 092a 42
 
                INC                      ; 092b 1f
 
                LR  $2,A                ; 092c 52
 
                DS  $a                  ; 092d 3a
 
                BF  $4,A0924            ; 092e 94 f5
 
A0930:          LIS  $4                  ; 0930 74
 
                AS  $2                  ; 0931 c2
 
                LR  $2,A                ; 0932 52
 
                LIS  $3                  ; 0933 73
 
                LR  $1,A                ; 0934 51
 
A0935:          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  $067c              ; 093b 28 06 7c
+
; Auto labels for branch targets inside mixed code/data bytes.
                DS  $1                  ; 093e 31
+
L0B6E equ $0B6E
                LR  A,$1                ; 093f 41
+
L0B7B equ $0B7B
                CI  $77                ; 0940 25 77
+
L0B80 equ $0B80
                BT  2,A0935            ; 0942 82 f2
+
L0B85 equ $0B85
                LR  A,$2                ; 0944 42
+
L0B8B equ $0B8B
                CI  $28                ; 0945 25 28
+
L0BB1 equ $0BB1
                BT  2,A0930            ; 0947 82 e8
+
L0C1D equ $0C1D
                LIS  $3                  ; 0949 73
+
L0C1F equ $0C1F
                LR  $a,A                ; 094a 5a
+
L0C64 equ $0C64
                LI  $26                ; 094b 20 26
+
L0CD7 equ $0CD7
                LR  $2,A                ; 094d 52
+
L0D04 equ $0D04
A094e:          LIS  $8                  ; 094e 78
+
L0EE0 equ $0EE0
                LR  $1,A                ; 094f 51
+
L0EF5 equ $0EF5
                LIS  $0                  ; 0950 70
+
L0F58 equ $0F58
                LR  $0,A                ; 0951 50
+
L0F7A equ $0F7A
A0952:          PI  $0679              ; 0952 28 06 79
 
                LIS  $2                  ; 0955 72
 
                AS  $2                  ; 0956 c2
 
                LR  $2,A                ; 0957 52
 
                DS  $1                  ; 0958 31
 
                DS  $a                  ; 0959 3a
 
                BF  $4,A0952            ; 095a 94 f7
 
                PI  $0679              ; 095c 28 06 79
 
                LR  A,$2                ; 095f 42
 
                INC                      ; 0960 1f
 
                LR  $2,A                ; 0961 52
 
                DS  $1                  ; 0962 31
 
                PI  $0679              ; 0963 28 06 79
 
                LR  A,$2                ; 0966 42
 
                CI  $31                ; 0967 25 31
 
                BF  $2,A0973            ; 0969 92 09
 
                LI  $2b                ; 096b 20 2b
 
                LR  $2,A                ; 096d 52
 
                LIS  $3                  ; 096e 73
 
                LR  $a,A                ; 096f 5a
 
                JMP  A094e              ; 0970 29 09 4e
 
A0973:          NOP                      ; 0973 2b
 
                LIS  $0                  ; 0974 70
 
                LR  $0,A                ; 0975 50
 
                LI  $2d                ; 0976 20 2d
 
                LR  $2,A                ; 0978 52
 
A0979:          LI  $53                ; 0979 20 53
 
                LR  $1,A                ; 097b 51
 
                PI  $0679              ; 097c 28 06 79
 
                DS  $1                  ; 097f 31
 
                DS  $2                  ; 0980 32
 
                PI  $0679              ; 0981 28 06 79
 
                LIS  $3                  ; 0984 73
 
                LR  $a,A                ; 0985 5a
 
A0986:          DS  $2                  ; 0986 32
 
                DS  $2                  ; 0987 32
 
                DS  $1                  ; 0988 31
 
                PI  $0679              ; 0989 28 06 79
 
                DS  $a                  ; 098c 3a
 
                BF  $4,A0986            ; 098d 94 f8
 
                LR  A,$2                ; 098f 42
 
                CI  $27                ; 0990 25 27
 
                BF  $2,A099a            ; 0992 92 07
 
                LI  $30                ; 0994 20 30
 
                LR  $2,A                ; 0996 52
 
                JMP  A0979              ; 0997 29 09 79
 
A099a:          PI  A0fd6              ; 099a 28 0f d6
 
                DCI  A0c76              ; 099d 2a 0c 76
 
                LI  $69                ; 09a0 20 69
 
                LR  $a,A                ; 09a2 5a
 
                PI  A0ba3              ; 09a3 28 0b a3
 
                PI  A0ba3              ; 09a6 28 0b a3
 
                LIS  $0                  ; 09a9 70
 
                LR  $a,A                ; 09aa 5a
 
                PI  A0ba3              ; 09ab 28 0b a3
 
                LIS  $3                  ; 09ae 73
 
                LR  $3,A                ; 09af 53
 
                PI  A0fea              ; 09b0 28 0f ea
 
                DCI  A0c34              ; 09b3 2a 0c 34
 
                XDC                      ; 09b6 2c
 
                DCI  A0c67              ; 09b7 2a 0c 67
 
                LIS  $5                  ; 09ba 75
 
                LR  $a,A                ; 09bb 5a
 
A09bc:          LM                      ; 09bc 16
 
                LR  $1,A                ; 09bd 51
 
                LM                      ; 09be 16
 
                LR  $2,A                ; 09bf 52
 
                LM                      ; 09c0 16
 
                LR  $0,A                ; 09c1 50
 
                XDC                      ; 09c2 2c
 
                PI  A0fcd              ; 09c3 28 0f cd
 
                XDC                      ; 09c6 2c
 
                DS  $a                  ; 09c7 3a
 
                BF  $4,A09bc            ; 09c8 94 f3
 
                DCI  A0c5c              ; 09ca 2a 0c 5c
 
                PI  A0ba3              ; 09cd 28 0b a3
 
                LIS  $3                  ; 09d0 73
 
                LR  $3,A                ; 09d1 53
 
                PI  A0fed              ; 09d2 28 0f ed
 
                PI  A0fd6              ; 09d5 28 0f d6
 
                LIS  $9                  ; 09d8 79
 
                LR  $a,A                ; 09d9 5a
 
                DCI  A0cde              ; 09da 2a 0c de
 
A09dd:          LM                      ; 09dd 16
 
                LR  $1,A                ; 09de 51
 
                LM                      ; 09df 16
 
                LR  $2,A                ; 09e0 52
 
                LM                      ; 09e1 16
 
                LR  $0,A                ; 09e2 50
 
                XDC                      ; 09e3 2c
 
                DCI  $0cf9              ; 09e4 2a 0c f9
 
                PI  $067c              ; 09e7 28 06 7c
 
                XDC                      ; 09ea 2c
 
                DS  $a                  ; 09eb 3a
 
                BF  $4,A09dd            ; 09ec 94 f0
 
                DCI  $0d08              ; 09ee 2a 0d 08
 
                PI  A0ba3              ; 09f1 28 0b a3
 
                LIS  $3                  ; 09f4 73
 
                LR  $3,A                ; 09f5 53
 
                PI  A0fed              ; 09f6 28 0f ed
 
                PI  A0fd6              ; 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  A0b76              ; 0a05 28 0b 76
 
                LIS  $2                  ; 0a08 72
 
                LR  $a,A                ; 0a09 5a
 
A0a0a:          LIS  $f                  ; 0a0a 7f
 
                LR  $3,A                ; 0a0b 53
 
                LIS  $f                  ; 0a0c 7f
 
                AS  $1                  ; 0a0d c1
 
                LR  $1,A                ; 0a0e 51
 
                PI  A0b76              ; 0a0f 28 0b 76
 
                DS  $a                  ; 0a12 3a
 
                BF  $4,A0a0a            ; 0a13 94 f6
 
                LI  $69                ; 0a15 20 69
 
                LR  $a,A                ; 0a17 5a
 
                DCI  A0d14              ; 0a18 2a 0d 14
 
                PI  A0ba3              ; 0a1b 28 0b a3
 
                PI  A0ba3              ; 0a1e 28 0b a3
 
                PI  A0ba3              ; 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  A0b76              ; 0a2d 28 0b 76
 
                LIS  $6                  ; 0a30 76
 
                LR  $a,A                ; 0a31 5a
 
                DCI  A0d44              ; 0a32 2a 0d 44
 
A0a35:          LM                      ; 0a35 16
 
                LR  $1,A                ; 0a36 51
 
                LM                      ; 0a37 16
 
                LR  $2,A                ; 0a38 52
 
                LM                      ; 0a39 16
 
                LR  $0,A                ; 0a3a 50
 
                XDC                      ; 0a3b 2c
 
                PI  $0679              ; 0a3c 28 06 79
 
                XDC                      ; 0a3f 2c
 
                DS  $a                  ; 0a40 3a
 
                BF  $4,A0a35            ; 0a41 94 f3
 
                DCI  A0d56              ; 0a43 2a 0d 56
 
                LIS  $0                  ; 0a46 70
 
                LR  $a,A                ; 0a47 5a
 
                PI  A0ba3              ; 0a48 28 0b a3
 
                LIS  $6                  ; 0a4b 76
 
                LR  $3,A                ; 0a4c 53
 
                PI  A0fed              ; 0a4d 28 0f ed
 
                PI  A0fd6              ; 0a50 28 0f d6
 
                DCI  A0d61              ; 0a53 2a 0d 61
 
                LI  $69                ; 0a56 20 69
 
                LR  $a,A                ; 0a58 5a
 
                PI  A0ba3              ; 0a59 28 0b a3
 
                PI  A0ba3              ; 0a5c 28 0b a3
 
                PI  A0ba3              ; 0a5f 28 0b a3
 
                LIS  $0                  ; 0a62 70
 
                LR  $a,A                ; 0a63 5a
 
                PI  A0ba3              ; 0a64 28 0b a3
 
                LIS  $6                  ; 0a67 76
 
                LR  $3,A                ; 0a68 53
 
                PI  A0fed              ; 0a69 28 0f ed
 
                PI  A0fd6              ; 0a6c 28 0f d6
 
                DCI  A0d79              ; 0a6f 2a 0d 79
 
                LIS  $6                  ; 0a72 76
 
                LR  $a,A                ; 0a73 5a
 
A0a74:          LM                      ; 0a74 16
 
                LR  $1,A                ; 0a75 51
 
                LM                      ; 0a76 16
 
                LR  $2,A                ; 0a77 52
 
                LM                      ; 0a78 16
 
                LR  $0,A                ; 0a79 50
 
                XDC                      ; 0a7a 2c
 
                DCI  A0d8b              ; 0a7b 2a 0d 8b
 
                PI  A0fcd              ; 0a7e 28 0f cd
 
                XDC                      ; 0a81 2c
 
                DS  $a                  ; 0a82 3a
 
                BF  $4,A0a74            ; 0a83 94 f0
 
                DCI  $0d99              ; 0a85 2a 0d 99
 
                XDC                      ; 0a88 2c
 
                DCI  A0da8              ; 0a89 2a 0d a8
 
                LIS  $3                  ; 0a8c 73
 
                LR  $a,A                ; 0a8d 5a
 
A0a8e:          LM                      ; 0a8e 16
 
                LR  $1,A                ; 0a8f 51
 
                LM                      ; 0a90 16
 
                LR  $2,A                ; 0a91 52
 
                LM                      ; 0a92 16
 
                LR  $0,A                ; 0a93 50
 
                XDC                      ; 0a94 2c
 
                PI  $067c              ; 0a95 28 06 7c
 
                XDC                      ; 0a98 2c
 
                DS  $a                  ; 0a99 3a
 
                BF  $4,A0a8e            ; 0a9a 94 f3
 
                DCI  A0d93              ; 0a9c 2a 0d 93
 
                PI  A0ba3              ; 0a9f 28 0b a3
 
                LIS  $6                  ; 0aa2 76
 
                LR  $3,A                ; 0aa3 53
 
                PI  A0fea              ; 0aa4 28 0f ea
 
                DCI  A0db1              ; 0aa7 2a 0d b1
 
                LIS  $2                  ; 0aaa 72
 
                LR  $a,A                ; 0aab 5a
 
A0aac:          LM                      ; 0aac 16
 
                LR  $1,A                ; 0aad 51
 
                LM                      ; 0aae 16
 
                LR  $2,A                ; 0aaf 52
 
                LM                      ; 0ab0 16
 
                LR  $0,A                ; 0ab1 50
 
                XDC                      ; 0ab2 2c
 
                DCI  $0f58              ; 0ab3 2a 0f 58
 
                PI  $067c              ; 0ab6 28 06 7c
 
                XDC                      ; 0ab9 2c
 
                DS  $a                  ; 0aba 3a
 
                BF  $4,A0aac            ; 0abb 94 f0
 
                LIS  $4                  ; 0abd 74
 
                LR  $a,A                ; 0abe 5a
 
                LI  $10                ; 0abf 20 10
 
                LR  $2,A                ; 0ac1 52
 
A0ac2:          LI  $17                ; 0ac2 20 17
 
                LR  $1,A                ; 0ac4 51
 
                LI  $81                ; 0ac5 20 81
 
                LR  $0,A                ; 0ac7 50
 
                PI  $0679              ; 0ac8 28 06 79
 
                LIS  $5                  ; 0acb 75
 
                AS  $2                  ; 0acc c2
 
                LR  $2,A                ; 0acd 52
 
                CI  $27                ; 0ace 25 27
 
                BT  2,A0ac2            ; 0ad0 82 f1
 
                LI  $1a                ; 0ad2 20 1a
 
                LR  $1,A                ; 0ad4 51
 
                LI  $1a                ; 0ad5 20 1a
 
                LR  $2,A                ; 0ad7 52
 
                DCI  A0dc3              ; 0ad8 2a 0d c3
 
                LIS  $6                  ; 0adb 76
 
                LR  $a,A                ; 0adc 5a
 
A0add:          LM                      ; 0add 16
 
                LR  $0,A                ; 0ade 50
 
                XDC                      ; 0adf 2c
 
                DCI  A0dc9              ; 0ae0 2a 0d c9
 
                PI  $067c              ; 0ae3 28 06 7c
 
                DS  $1                  ; 0ae6 31
 
                DS  $1                  ; 0ae7 31
 
                XDC                      ; 0ae8 2c
 
                DS  $a                  ; 0ae9 3a
 
                BF  $4,A0add            ; 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  A0dce              ; 0af5 2a 0d ce
 
                PI  A0fcd              ; 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  A0dce              ; 0b01 2a 0d ce
 
                PI  A0fcd              ; 0b04 28 0f cd
 
                PI  A0fd6              ; 0b07 28 0f d6
 
                DCI  A0db7              ; 0b0a 2a 0d b7
 
                PI  A0ba3              ; 0b0d 28 0b a3
 
                LIS  $6                  ; 0b10 76
 
                LR  $3,A                ; 0b11 53
 
                PI  A0fea              ; 0b12 28 0f ea
 
                DCI  A0dd6              ; 0b15 2a 0d d6
 
                LIS  $8                  ; 0b18 78
 
                LR  $2,A                ; 0b19 52
 
A0b1a:          LIS  $f                  ; 0b1a 7f
 
A0b1b:          LR  $1,A                ; 0b1b 51
 
                LI  $c0                ; 0b1c 20 c0
 
                LR  $0,A                ; 0b1e 50
 
                LM                      ; 0b1f 16
 
                XDC                      ; 0b20 2c
 
                LR  $a,A                ; 0b21 5a
 
                SR  4                  ; 0b22 14
 
                SL  4                  ; 0b23 15
 
                SR  1                  ; 0b24 12
 
                LR  $b,A                ; 0b25 5b
 
                LR  A,$a                ; 0b26 4a
 
                SL  4                  ; 0b27 15
 
                SR  1                  ; 0b28 12
 
                LR  $a,A                ; 0b29 5a
 
                DCI  A0e26              ; 0b2a 2a 0e 26
 
                LR  A,$b                ; 0b2d 4b
 
                ADC                      ; 0b2e 8e
 
                PI  A0fcd              ; 0b2f 28 0f cd
 
                DS  $1                  ; 0b32 31
 
                DCI  A0e26              ; 0b33 2a 0e 26
 
                LR  A,$a                ; 0b36 4a
 
                ADC                      ; 0b37 8e
 
                LI  $c0                ; 0b38 20 c0
 
                LR  $0,A                ; 0b3a 50
 
                PI  A0fcd              ; 0b3b 28 0f cd
 
                XDC                      ; 0b3e 2c
 
                DS  $1                  ; 0b3f 31
 
                LR  A,$1                ; 0b40 41
 
                CI  $5a                ; 0b41 25 5a
 
                BT  2,A0b1b            ; 0b43 82 d7
 
                LIS  $4                  ; 0b45 74
 
                AS  $2                  ; 0b46 c2
 
                LR  $2,A                ; 0b47 52
 
                CI  $2f                ; 0b48 25 2f
 
                BT  2,A0b1a            ; 0b4a 82 cf
 
                DCI  A0e96              ; 0b4c 2a 0e 96
 
                PI  A0ba3              ; 0b4f 28 0b a3
 
                LIS  $6                  ; 0b52 76
 
                LR  $3,A                ; 0b53 53
 
                PI  A0fea              ; 0b54 28 0f ea
 
A0b57:          DCI  A0e9d              ; 0b57 2a 0e 9d
 
                LIS  $c                  ; 0b5a 7c
 
A0b5b:          LR  $a,A                ; 0b5b 5a
 
A0b5c:          LM                      ; 0b5c 16
 
                LR  $1,A                ; 0b5d 51
 
                LM                      ; 0b5e 16
 
                LR  $2,A                ; 0b5f 52
 
                LM                      ; 0b60 16
 
                LR  $0,A                ; 0b61 50
 
                XDC                      ; 0b62 2c
 
                DCI  A0ec1              ; 0b63 2a 0e c1
 
                PI  $067c              ; 0b66 28 06 7c
 
                XDC                      ; 0b69 2c
 
                DS  $a                  ; 0b6a 3a
 
                BF  $4,A0b5c            ; 0b6b 94 f0
 
                DCI  A0ee4              ; 0b6d 2a 0e e4
 
                PI  A0ba3              ; 0b70 28 0b a3
 
                JMP  Reset              ; 0b73 29 00 00
 
A0b76:          LR  K,P                ; 0b76 08
 
                PI  pushk              ; 0b77 28 01 07 - bios pushk
 
                JMP  $0215              ; 0b7a 29 02 15 - bios, calls draw char
 
A0b7d:          LR  K,P                ; 0b7d 08
 
                PI  pushk              ; 0b7e 28 01 07 - bios pushk
 
                LIS  $a                  ; 0b81 7a
 
                LR  $2,A                ; 0b82 52
 
                PI  $01f6              ; 0b83 28 01 f6
 
                LI  $17                ; 0b86 20 17
 
                LR  $2,A                ; 0b88 52
 
                PI  $01f6              ; 0b89 28 01 f6
 
                LI  $24                ; 0b8c 20 24
 
                LR  $2,A                ; 0b8e 52
 
                PI  $01f6              ; 0b8f 28 01 f6
 
                PI  $011e              ; 0b92 28 01 1e
 
                PK                      ; 0b95 0c
 
A0b96:          LR  K,P                ; 0b96 08
 
                LIS  $3                  ; 0b97 73
 
                LR  $0,A                ; 0b98 50
 
                LIS  $f                  ; 0b99 7f
 
                LR  $5,A                ; 0b9a 55
 
A0b9b:          PI  $008f              ; 0b9b 28 00 8f
 
                DS  $0                  ; 0b9e 30
 
                BF  $4,A0b9b            ; 0b9f 94 fb
 
                LR  P,K                ; 0ba1 09
 
                POP                      ; 0ba2 1c
 
A0ba3:          LR  K,P                ; 0ba3 08
 
                PI  pushk              ; 0ba4 28 01 07 - bios pushk
 
                LM                      ; 0ba7 16
 
                LR  $3,A                ; 0ba8 53
 
                LM                      ; 0ba9 16
 
                LR  $2,A                ; 0baa 52
 
                LM                      ; 0bab 16
 
                LR  $1,A                ; 0bac 51
 
A0bad:          LM                      ; 0bad 16
 
                LR  $0,A                ; 0bae 50
 
                XDC                      ; 0baf 2c
 
                DCI  A0eef              ; 0bb0 2a 0e ef
 
A0bb3:          PI  $067c              ; 0bb3 28 06 7c
 
                XDC                      ; 0bb6 2c
 
                DS  $3                  ; 0bb7 33
 
                BF  $4,A0bad            ; 0bb8 94 f4
 
                LR  A,$a                ; 0bba 4a
 
                CI  $69                ; 0bbb 25 69
 
                BT  4,A0bc2            ; 0bbd 84 04
 
                PI  A0b96              ; 0bbf 28 0b 96
 
A0bc2:          PI  $011e              ; 0bc2 28 01 1e
 
                PK                      ; 0bc5 0c
 
A0bc6:          LR  QU,A                ; 0bc6 06
 
                SL  1                  ; 0bc7 13
 
                OUT  $91                ; 0bc8 27 91
 
                BF  $9,A0b57            ; 0bca 99 8c
 
                BF  $4,A0b5b            ; 0bcc 94 8e
 
                db  $a3               
 
A0bcf:          LR  QU,A                ; 0bcf 06
 
                OI  $26                ; 0bd0 22 26
 
                LR  (IS)-,A            ; 0bd2 5e
 
                LR  A,(IS)-            ; 0bd3 4e
 
                LR  $8,A                ; 0bd4 58
 
                LR  $8,A                ; 0bd5 58
 
                LR  $2,A                ; 0bd6 52
 
                LR  (IS)+,A            ; 0bd7 5d
 
A0bd8:          LR  IS,A                ; 0bd8 0b
 
                DS  $1                  ; 0bd9 31
 
                DI                      ; 0bda 1a
 
                BF  $e,-110            ; 0bdb 9e 92
 
                XM                      ; 0bdd 8c
 
                LR  A,KU                ; 0bde 00
 
                LR  (IS)-,A            ; 0bdf 5e
 
                LR  A,$a                ; 0be0 4a
 
                LR  A,(IS)              ; 0be1 4c
 
                LR  A,KU                ; 0be2 00
 
                ASD  (IS)-              ; 0be3 de
 
                ASD  $9                  ; 0be4 d9
 
                AS  (IS)-              ; 0be5 ce
 
A0be6:          LR  DC,H                ; 0be6 10
 
                LI  $0a                ; 0be7 20 0a
 
                BF  $d,-111            ; 0be9 9d 91
 
                BF  $9,-103            ; 0beb 99 99
 
                BF  $e,-110            ; 0bed 9e 92
 
                BF  $8,-112            ; 0bef 98 90
 
                LR  A,KU                ; 0bf1 00
 
                BF  $0,A0b7d            ; 0bf2 90 8a
 
A0bf4:          BF  $6,-106            ; 0bf4 96 96
 
A0bf6:          ADC                      ; 0bf6 8e
 
                BF  $c,A0b9b            ; 0bf7 9c a3
 
A0bf9:          LR  KU,A                ; 0bf9 04
 
A0bfa:          NOP                      ; 0bfa 2b
 
                db  $2d               
 
                LR  (IS)-,A            ; 0bfc 5e
 
                LR  A,$a                ; 0bfd 4a
 
                LR  $8,A                ; 0bfe 58
 
                LR  $4,A                ; 0bff 54
 
A0c00:          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,82                ; 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
 
A0c1c:          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,A0c76            ; 0c25 80 50
 
                DS  $8                  ; 0c27 38
 
                LIS  $0                  ; 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,-128              ; 0c30 80 80
 
                BT  0,A0bb3            ; 0c32 80 80
 
A0c34:          LR  Q,DC                ; 0c34 0e
 
                db  $ff               
 
                db  $ff               
 
                db  $3f               
 
                DCI  $2e2a              ; 0c38 2a 2e 2a
 
                db  $2e               
 
                LIS  $0                  ; 0c3c 70
 
                db  $ff               
 
                db  $ff               
 
                NS  (IS)                ; 0c3f fc
 
                LR  $4,A                ; 0c40 54
 
                LIS  $4                  ; 0c41 74
 
                LR  $4,A                ; 0c42 54
 
                LIS  $4                  ; 0c43 74
 
                LR  (IS)+,A            ; 0c44 5d
 
                LR  $5,A                ; 0c45 55
 
                LR  (IS)+,A            ; 0c46 5d
 
                LR  $5,A                ; 0c47 55
 
                LR  (IS)+,A            ; 0c48 5d
 
                LR  $5,A                ; 0c49 55
 
                LR  (IS)+,A            ; 0c4a 5d
 
                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  (IS)-              ; 0c58 fe
 
                OUTS 14                  ; 0c59 be
 
                LR  A,KU                ; 0c5a 00
 
                LR  A,KU                ; 0c5b 00
 
A0c5c:          LR  K,P                ; 0c5c 08
 
                SL  1                  ; 0c5d 13
 
                INC                      ; 0c5e 1f
 
                BF  $d,A0bfa            ; 0c5f 9d 9a
 
                BF  $2,A0c00            ; 0c61 92 9e
 
                BR7  A0bf6              ; 0c63 8f 92
 
A0c65:          BF  $c,A0bf4            ; 0c65 9c 8e
 
A0c67:          DS  $0                  ; 0c67 30
 
                db  $2e               
 
                AS  $0                  ; 0c69 c0
 
                DS  $3                  ; 0c6a 33
 
                db  $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,A0ccf            ; 0c72 80 5c
 
                DS  $2                  ; 0c74 32
 
                LR  A,$0                ; 0c75 40
 
A0c76:          PK                      ; 0c76 0c
 
                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
 
                db  $2e               
 
                LR  A,$b                ; 0c88 4b
 
                LR  A,(IS)-            ; 0c89 4e
 
                LR  (IS)-,A            ; 0c8a 5e
 
                LISU 6                  ; 0c8b 66
 
                LR  P,K                ; 0c8c 09
 
                POP                      ; 0c8d 1c
 
                LI  $4b                ; 0c8e 20 4b
 
                LR  $6,A                ; 0c90 56
 
                LR  A,$a                ; 0c91 4a
 
                LR  A,(IS)              ; 0c92 4c
 
                LR  $4,A                ; 0c93 54
 
                LR  $3,A                ; 0c94 53
 
                LR  A,$a                ; 0c95 4a
 
                LR  A,(IS)              ; 0c96 4c
 
                LR  $4,A                ; 0c97 54
 
A0c98:          NS  $8                  ; 0c98 f8
 
                BT  4,A0c1c            ; 0c99 84 82
 
                BT  1,-127              ; 0c9b 81 81
 
                BT  1,-127              ; 0c9d 81 81
 
                db  $ff               
 
                LR  A,KU                ; 0ca0 00
 
                LR  A,KU                ; 0ca1 00
 
                LR  A,KU                ; 0ca2 00
 
                POP                      ; 0ca3 1c
 
                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  (IS)                ; 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
 
                db  $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
 
A0cc8:          db  $ff               
 
                AS  $3                  ; 0cc9 c3
 
                INS  5                  ; 0cca a5
 
                BF  $9,A0c65            ; 0ccb 99 99
 
                INS  5                  ; 0ccd a5
 
                AS  $3                  ; 0cce c3
 
A0ccf:          db  $ff               
 
A0cd0:          LR  IS,A                ; 0cd0 0b
 
                DS  $0                  ; 0cd1 30
 
                LNK                      ; 0cd2 19
 
                NM                      ; 0cd3 8a
 
                db  $df               
 
                LR  (IS)-,A            ; 0cd5 5e
 
                BF  $9,0                ; 0cd6 99 00
 
                LR  A,(IS)+            ; 0cd8 4d
 
                LR  $9,A                ; 0cd9 59
 
                ASD  $9                  ; 0cda d9
 
                AS  (IS)+              ; 0cdb cd
 
                LR  $6,A                ; 0cdc 56
 
                ADC                      ; 0cdd 8e
 
A0cde:          EI                      ; 0cde 1b
 
                LR  DC,H                ; 0cdf 10
 
                BT  2,A0d31            ; 0ce0 82 50
 
                OUT  $82                ; 0ce2 27 82
 
                CI  $0d                ; 0ce4 25 0d
 
                AS  $1                  ; 0ce6 c1
 
                DS  (IS)+              ; 0ce7 3d
 
                LR  DC,H                ; 0ce8 10
 
                AS  $1                  ; 0ce9 c1
 
                DS  $6                  ; 0cea 36
 
                EI                      ; 0ceb 1b
 
                AS  $1                  ; 0cec c1
 
A0ced:          db  $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
 
                LIS  $0                  ; 0cfc 70
 
A0cfd:          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
 
                LIS  $0                  ; 0d06 70
 
                LI  $09                ; 0d07 20 09
 
                LM                      ; 0d09 16
 
                LR  W,J                ; 0d0a 1d
 
                LR  (IS)+,A            ; 0d0b 5d
 
                LR  $a,A                ; 0d0c 5a
 
                LR  A,$a                ; 0d0d 4a
 
                LR  A,(IS)              ; 0d0e 4c
 
                LR  A,(IS)-            ; 0d0f 4e
 
                LR  A,KU                ; 0d10 00
 
                LISU 1                  ; 0d11 61
 
                LR  A,$a                ; 0d12 4a
 
                LR  (IS),A              ; 0d13 5c
 
A0d14:          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
 
                SL  1                  ; 0d26 13
 
                XS  $9                  ; 0d27 e9
 
                LR  A,$4                ; 0d28 44
 
A0d29:          LR  A,$2                ; 0d29 42
 
                LR  A,KU                ; 0d2a 00
 
                LR  A,KU                ; 0d2b 00
 
                XS  $a                  ; 0d2c ea
 
                LR  A,$1                ; 0d2d 41
 
                LR  A,$3                ; 0d2e 43
 
                LR  A,KU                ; 0d2f 00
 
                LR  A,KU                ; 0d30 00
 
A0d31:          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,$9                ; 0d3e 49
 
                LR  A,KU                ; 0d3f 00
 
                LR  A,KU                ; 0d40 00
 
                LR  A,KU                ; 0d41 00
 
                LR  A,$3                ; 0d42 43
 
                LR  A,$9                ; 0d43 49
 
A0d44:          db  $2e               
 
                NOP                      ; 0d45 2b
 
                BT  1,A0d6f            ; 0d46 81 28
 
                XDC                      ; 0d48 2c
 
                LR  A,$3                ; 0d49 43
 
                DS  $5                  ; 0d4a 35
 
                XDC                      ; 0d4b 2c
 
                LR  A,$6                ; 0d4c 46
 
                DS  $b                  ; 0d4d 3b
 
                XDC                      ; 0d4e 2c
 
                LR  A,$9                ; 0d4f 49
 
                DS  $5                  ; 0d50 35
 
                AI  $42                ; 0d51 24 42
 
                DS  $b                  ; 0d53 3b
 
                AI  $43                ; 0d54 24 43
 
A0d56:          LR  K,P                ; 0d56 08
 
                LR  P,K                ; 0d57 09
 
                LI  $97                ; 0d58 20 97
 
                NM                      ; 0d5a 8a
 
                BF  $e,A0ced            ; 0d5b 9e 91
 
                BF  $b,A0cfd            ; 0d5d 9b 9f
 
                BF  $2,-92              ; 0d5f 92 a4
 
A0d61:          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
 
                db  $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
 
A0d6f:          LR  A,$0                ; 0d6f 40
 
                LR  QU,A                ; 0d70 06
 
A0d71:          LR  H,DC                ; 0d71 11
 
                OUT  $cb                ; 0d72 27 cb
 
                AS  $a                  ; 0d74 ca
 
                ASD  $0                  ; 0d75 d0
 
                AS  (IS)-              ; 0d76 ce
 
                ASD  $6                  ; 0d77 d6
 
                ASD  (IS)+              ; 0d78 dd
 
A0d79:          SR  4                  ; 0d79 14
 
                LNK                      ; 0d7a 19
 
                BT  0,A0d96            ; 0d7b 80 1a
 
                LNK                      ; 0d7d 19
 
                BT  0,A0daf            ; 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,(IS)+            ; 0d85 4d
 
                LNK                      ; 0d86 19
 
                LR  A,$0                ; 0d87 40
 
                LR  $3,A                ; 0d88 53
 
                LNK                      ; 0d89 19
 
                LR  A,$0                ; 0d8a 40
 
A0d8b:          NS  (IS)-              ; 0d8b fe
 
                NS  (IS)-              ; 0d8c fe
 
                NS  (IS)-              ; 0d8d fe
 
                NS  (IS)-              ; 0d8e fe
 
                NS  (IS)-              ; 0d8f fe
 
                NS  (IS)-              ; 0d90 fe
 
                NS  (IS)-              ; 0d91 fe
 
                LR  A,KU                ; 0d92 00
 
A0d93:          LR  A,QL                ; 0d93 03
 
                LR  H,DC                ; 0d94 11
 
                db  $2e               
 
A0d96:          BF  $8,A0d29            ; 0d96 98 92
 
                BF  $7,A0d71            ; 0d98 97 d8
 
                ASD  $8                  ; 0d9a d8
 
                ASD  $8                  ; 0d9b d8
 
                ASD  $8                  ; 0d9c d8
 
                ASD  $8                  ; 0d9d d8
 
                LR  A,KU                ; 0d9e 00
 
                LIS  $0                  ; 0d9f 70
 
                LR  A,KU                ; 0da0 00
 
                LIS  $0                  ; 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
 
A0da8:          COM                      ; 0da8 18
 
                DI                      ; 0da9 1a
 
                BT  0,A0ddf            ; 0daa 80 34
 
                DI                      ; 0dac 1a
 
                LR  A,$0                ; 0dad 40
 
                LR  $1,A                ; 0dae 51
 
A0daf:          DI                      ; 0daf 1a
 
                LR  A,$0                ; 0db0 40
 
A0db1:          LR  DC,H                ; 0db1 10
 
                LR  DC,H                ; 0db2 10
 
                BT  0,A0dc4            ; 0db3 80 10
 
                XI  $40                ; 0db5 23 40
 
A0db7:          LR  P,K                ; 0db7 09
 
                LR  K,P                ; 0db8 08
 
                ST                      ; 0db9 17
 
                AS  (IS)+              ; 0dba cd
 
                ASD  (IS)                ; 0dbb dc
 
                AS  $a                  ; 0dbc ca
 
                ASD  $0                  ; 0dbd d0
 
                LR  A,KU                ; 0dbe 00
 
                ASD  (IS)                ; 0dbf dc
 
                AS  $a                  ; 0dc0 ca
 
                AS  (IS)                ; 0dc1 cc
 
                AS  (IS)-              ; 0dc2 ce
 
A0dc3:          AS  $0                  ; 0dc3 c0
 
A0dc4:          BT  0,A0e05            ; 0dc4 80 40
 
                AS  $0                  ; 0dc6 c0
 
                BT  0,A0e08            ; 0dc7 80 40
 
A0dc9:          NS  $0                  ; 0dc9 f0
 
                NS  $0                  ; 0dca f0
 
                NS  $0                  ; 0dcb f0
 
                NS  $0                  ; 0dcc f0
 
                LR  A,KU                ; 0dcd 00
 
A0dce:          db  $ff               
 
                db  $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
 
A0dd6:          LR  A,$5                ; 0dd6 45
 
                LR  A,$5                ; 0dd7 45
 
                LR  A,$5                ; 0dd8 45
 
                LR  A,$9                ; 0dd9 49
 
                AS  $5                  ; 0dda c5
 
                LR  A,(IS)              ; 0ddb 4c
 
                LR  $4,A                ; 0ddc 54
 
                AS  $5                  ; 0ddd c5
 
                AS  $7                  ; 0dde c7
 
A0ddf:          LISU 3                  ; 0ddf 63
 
                ASD  (IS)+              ; 0de0 dd
 
                ASD  $7                  ; 0de1 d7
 
                LR  (IS)+,A            ; 0de2 5d
 
                ASD  $1                  ; 0de3 d1
 
                ASD  (IS)+              ; 0de4 dd
 
                LR  A,$6                ; 0de5 46
 
                ASD  $4                  ; 0de6 d4
 
                LISU 4                  ; 0de7 64
 
                LISU 7                  ; 0de8 67
 
                LISU 1                  ; 0de9 61
 
                ASD  (IS)+              ; 0dea dd
 
                ASD  (IS)+              ; 0deb dd
 
                ASD  (IS)+              ; 0dec dd
 
                ASD  $1                  ; 0ded d1
 
                BT  7,A0e46            ; 0dee 87 57
 
                AS  (IS)                ; 0df0 cc
 
                LR  (IS)+,A            ; 0df1 5d
 
                ASD  $7                  ; 0df2 d7
 
                LISL 5                  ; 0df3 6d
 
                BT  6,A0e6b            ; 0df4 86 76
 
                ASD  $4                  ; 0df6 d4
 
                LISL 4                  ; 0df7 6c
 
                AS  (IS)                ; 0df8 cc
 
                LISU 7                  ; 0df9 67
 
                LISU 1                  ; 0dfa 61
 
                LR  A,$b                ; 0dfb 4b
 
                LISU 4                  ; 0dfc 64
 
                BF  $2,A0e74            ; 0dfd 92 76
 
                PK                      ; 0dff 0c
 
                AS  $5                  ; 0e00 c5
 
                SR  4                  ; 0e01 14
 
                AS  $b                  ; 0e02 cb
 
                LISU 0                  ; 0e03 60
 
                AS  $6                  ; 0e04 c6
 
A0e05:          LIS  $5                  ; 0e05 75
 
                LR  KL,A                ; 0e06 05
 
                LR  A,(IS)              ; 0e07 4c
 
A0e08:          AS  $b                  ; 0e08 cb
 
                LISL 5                  ; 0e09 6d
 
                LR  A,$2                ; 0e0a 42
 
                LR  $4,A                ; 0e0b 54
 
                LR  $4,A                ; 0e0c 54
 
                LR  (IS)+,A            ; 0e0d 5d
 
                LR  A,$6                ; 0e0e 46
 
                LIS  $5                  ; 0e0f 75
 
                LR  A,(IS)              ; 0e10 4c
 
                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  (IS)                ; 0e22 cc
 
                OUTS 6                  ; 0e23 b6
 
                LIS  $6                  ; 0e24 76
 
                LIS  $6                  ; 0e25 76
 
A0e26:          NS  (IS)-              ; 0e26 fe
 
                NS  (IS)-              ; 0e27 fe
 
                AS  $0                  ; 0e28 c0
 
                AS  $0                  ; 0e29 c0
 
                NS  (IS)-              ; 0e2a fe
 
                NS  (IS)-              ; 0e2b fe
 
                LR  A,KU                ; 0e2c 00
 
                LR  A,KU                ; 0e2d 00
 
                NS  (IS)-              ; 0e2e fe
 
                NS  (IS)-              ; 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  (IS)-              ; 0e36 fe
 
                NS  (IS)-              ; 0e37 fe
 
                LR  QU,A                ; 0e38 06
 
                LR  QU,A                ; 0e39 06
 
                NS  (IS)-              ; 0e3a fe
 
                NS  (IS)-              ; 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  (IS)-              ; 0e42 fe
 
                NS  (IS)-              ; 0e43 fe
 
                LR  A,KU                ; 0e44 00
 
                LR  A,KU                ; 0e45 00
 
A0e46:          NS  (IS)-              ; 0e46 fe
 
                NS  (IS)-              ; 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  (IS)-              ; 0e4e fe
 
                NS  (IS)-              ; 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
 
A0e56:          AS  $6                  ; 0e56 c6
 
                AS  $6                  ; 0e57 c6
 
A0e58:          LR  QU,A                ; 0e58 06
 
                LR  QU,A                ; 0e59 06
 
                NS  (IS)-              ; 0e5a fe
 
                NS  (IS)-              ; 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  (IS)-              ; 0e62 fe
 
                NS  (IS)-              ; 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
 
A0e6b:          AS  $6                  ; 0e6b c6
 
                LR  A,KU                ; 0e6c 00
 
                LR  A,KU                ; 0e6d 00
 
                NS  (IS)-              ; 0e6e fe
 
                NS  (IS)-              ; 0e6f fe
 
                LR  A,KU                ; 0e70 00
 
                LR  A,KU                ; 0e71 00
 
                AS  $6                  ; 0e72 c6
 
                AS  $6                  ; 0e73 c6
 
A0e74:          LR  A,KU                ; 0e74 00
 
                LR  A,KU                ; 0e75 00
 
                AS  $6                  ; 0e76 c6
 
                AS  $6                  ; 0e77 c6
 
A0e78:          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  (IS)-              ; 0e82 fe
 
                NS  (IS)-              ; 0e83 fe
 
A0e84:          LR  A,KU                ; 0e84 00
 
                LR  A,KU                ; 0e85 00
 
                NS  (IS)-              ; 0e86 fe
 
                NS  (IS)-              ; 0e87 fe
 
                LR  A,KU                ; 0e88 00
 
                LR  A,KU                ; 0e89 00
 
                NS  (IS)-              ; 0e8a fe
 
                NS  (IS)-              ; 0e8b fe
 
                LR  A,KU                ; 0e8c 00
 
                LR  A,KU                ; 0e8d 00
 
A0e8e:          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
 
A0e96:          LR  KU,A                ; 0e96 04
 
                DS  $3                  ; 0e97 33
 
                NOP                      ; 0e98 2b
 
                LR  $7,A                ; 0e99 57
 
                LR  A,$a                ; 0e9a 4a
 
                LISU 4                  ; 0e9b 64
 
                LR  A,(IS)-            ; 0e9c 4e
 
A0e9d:          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
 
A0ead:          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
 
A0eba:          BT  4,A0ef1            ; 0eba 84 36
 
                DS  $0                  ; 0ebc 30
 
                LR  A,$5                ; 0ebd 45
 
A0ebe:          db  $2f               
 
                DS  $0                  ; 0ebf 30
 
                AS  $6                  ; 0ec0 c6
 
A0ec1:          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
 
                LIS  $0                  ; 0ecd 70
 
                LR  $0,A                ; 0ece 50
 
                LR  $0,A                ; 0ecf 50
 
                LI  $70                ; 0ed0 20 70
 
                LIS  $0                  ; 0ed2 70
 
                ASD  $8                  ; 0ed3 d8
 
                LR  A,KU                ; 0ed4 00
 
                BT  0,A0e56            ; 0ed5 80 80
 
                BT  0,A0e58            ; 0ed7 80 80
 
A0ed9:          BT  0,A0eba            ; 0ed9 80 e0
 
                XS  $0                  ; 0edb e0
 
                LR  A,KU                ; 0edc 00
 
                LR  A,KU                ; 0edd 00
 
A0ede:          LR  A,KU                ; 0ede 00
 
                LI  $78                ; 0edf 20 78
 
                LIS  $0                  ; 0ee1 70
 
                LR  $0,A                ; 0ee2 50
 
                LR  $0,A                ; 0ee3 50
 
A0ee4:          LR  K,P                ; 0ee4 08
 
                CI  $20                ; 0ee5 25 20
 
                OM                      ; 0ee7 8b
 
                NM                      ; 0ee8 8a
 
                BF  $d,A0e78            ; 0ee9 9d 8e
 
                OM                      ; 0eeb 8b
 
                NM                      ; 0eec 8a
 
                BF  $6,A0e84            ; 0eed 96 96
 
A0eef:          NS  $8                  ; 0eef f8
 
                AM                      ; 0ef0 88
 
A0ef1:          AM                      ; 0ef1 88
 
                AM                      ; 0ef2 88
 
A0ef3:          NS  $8                  ; 0ef3 f8
 
A0ef4:          LI  $60                ; 0ef4 20 60
 
                LI  $20                ; 0ef6 20 20
 
                LIS  $0                  ; 0ef8 70
 
                NS  $8                  ; 0ef9 f8
 
                LR  K,P                ; 0efa 08
 
                NS  $8                  ; 0efb f8
 
                BT  0,-8                ; 0efc 80 f8
 
                NS  $8                  ; 0efe f8
 
                LR  K,P                ; 0eff 08
 
                DS  $8                  ; 0f00 38
 
                LR  K,P                ; 0f01 08
 
A0f02:          NS  $8                  ; 0f02 f8
 
                AM                      ; 0f03 88
 
                AM                      ; 0f04 88
 
                NS  $8                  ; 0f05 f8
 
                LR  K,P                ; 0f06 08
 
A0f07:          LR  K,P                ; 0f07 08
 
                NS  $8                  ; 0f08 f8
 
                BT  0,A0f02            ; 0f09 80 f8
 
                LR  K,P                ; 0f0b 08
 
                NS  $8                  ; 0f0c f8
 
                BT  0,A0e8e            ; 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
 
A0f17:          NS  $8                  ; 0f17 f8
 
                AM                      ; 0f18 88
 
                NS  $8                  ; 0f19 f8
 
                AM                      ; 0f1a 88
 
                NS  $8                  ; 0f1b f8
 
A0f1c:          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
 
A0f27:          LR  A,$8                ; 0f27 48
 
                LIS  $8                  ; 0f28 78
 
                LR  A,$8                ; 0f29 48
 
                NS  $8                  ; 0f2a f8
 
                NS  $8                  ; 0f2b f8
 
                BT  0,A0ead            ; 0f2c 80 80
 
                BT  0,A0f27            ; 0f2e 80 f8
 
                NS  $8                  ; 0f30 f8
 
A0f31:          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,A0f17            ; 0f36 80 e0
 
                BT  0,A0f31            ; 0f38 80 f8
 
                NS  $8                  ; 0f3a f8
 
                BT  0,A0f1c            ; 0f3b 80 e0
 
                BT  0,A0ebe            ; 0f3d 80 80
 
                NS  $8                  ; 0f3f f8
 
                BT  0,A0ed9            ; 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,A0ef4            ; 0f53 90 a0
 
                AS  $0                  ; 0f55 c0
 
                INS  0                  ; 0f56 a0
 
                BF  $0,0                ; 0f57 90 00
 
                AS  $8                  ; 0f59 c8
 
                db  $ff               
 
                AS  $8                  ; 0f5b c8
 
                LR  A,KU                ; 0f5c 00
 
                BT  0,A0ede            ; 0f5d 80 80
 
                BT  0,-128              ; 0f5f 80 80
 
                NS  $8                  ; 0f61 f8
 
A0f62:          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,A0ef3            ; 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,-128              ; 0f74 80 80
 
                NS  $8                  ; 0f76 f8
 
                AM                      ; 0f77 88
 
                AM                      ; 0f78 88
 
                BF  $0,A0f62            ; 0f79 90 e8
 
                NS  $8                  ; 0f7b f8
 
                AM                      ; 0f7c 88
 
                NS  $8                  ; 0f7d f8
 
                BF  $0,A0f07            ; 0f7e 90 88
 
                NS  $8                  ; 0f80 f8
 
                BT  0,-8                ; 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
 
A0fc6:          LR  K,P                ; 0fc6 08
 
                PI  pushk              ; 0fc7 28 01 07 - bios pushk
 
                JMP  $01fc              ; 0fca 29 01 fc
 
A0fcd:          LR  K,P                ; 0fcd 08
 
                PI  pushk              ; 0fce 28 01 07 - bios pushk
 
                LIS  $8                  ; 0fd1 78
 
                LR  $4,A                ; 0fd2 54
 
                JMP  $068a              ; 0fd3 29 06 8a
 
A0fd6:          LR  K,P                ; 0fd6 08
 
                PI  pushk              ; 0fd7 28 01 07 - bios pushk
 
                LISU 2                  ; 0fda 62
 
                LISL 6                  ; 0fdb 6e
 
                LI  $99                ; 0fdc 20 99
 
                LR  (IS)+,A            ; 0fde 5d
 
                LR  (IS),A              ; 0fdf 5c
 
                PI  $02ac              ; 0fe0 28 02 ac
 
                PI  $02b5              ; 0fe3 28 02 b5
 
                PI  $011e              ; 0fe6 28 01 1e
 
                PK                      ; 0fe9 0c
 
A0fea:          LIS  $0                  ; 0fea 70
 
                BF  $0,A0fee            ; 0feb 90 02
 
A0fed:          LIS  $1                  ; 0fed 71
 
A0fee:          LISU 3                  ; 0fee 63
 
                LISL 7                  ; 0fef 6f
 
                LR  (IS),A              ; 0ff0 5c
 
                LR  K,P                ; 0ff1 08
 
                PI  pushk              ; 0ff2 28 01 07 - bios pushk
 
                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  $011e              ; 0ffc 28 01 1e
 
                PK                      ; 0fff 0c
 
  
 +
 +
 +
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
  
  
 
</pre>
 
</pre>

Revision as of 22:27, 4 August 2026

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