Disassembly of Commodore LCD kernal

Note: main 'documentation' and description (including I/O memory layout, additional information, details, etc) page can be found here.

Click here to review the added comments.




; da65 V2.13.3 - (C) Copyright 2000-2009,  Ullrich von Bassewitz
; Created:    2014-01-21 00:08:01
; Input file: kizapr-u102.bin
; Page:       1


        .setcpu "65C02"

; ----------------------------------------------------------------------------
L004E           := $004E
L0081           := $0081
VidMemHi        := $00A0
CursorX         := $00A1
CursorY         := $00A2
CurMaxX_        := $00A4
CurMaxY_        := $00A6
StopKeyFlag     := $00AD
FNptr_lo        := $00AE
FNptr_hi        := $00AF
ST              := $00BA
VidPtrLo        := $00C1
VidPtrHi        := $00C2
LFS2ndAddr      := $00C4
LFSDevNum       := $00C5
LFSLogNum       := $00C6
stack           := $0100
L0300           := $0300
RAMVEC_IRQ      := $0314
RAMVEC_BRK      := $0316
RAMVEC_NMI      := $0318
RAMVEC_OPEN     := $031A
RAMVEC_CLOSE    := $031C
RAMVEC_CHKIN    := $031E
RAMVEC_CHKOUT   := $0320
RAMVEC_CLRCHN   := $0322
RAMVEC_CHRIN    := $0324
RAMVEC_CHROUT   := $0326
RAMVEC_STOP     := $0328
RAMVEC_GETIN    := $032A
RAMVEC_CLALL    := $032C
RAMVEC_WTF      := $032E
RAMVEC_LOAD     := $0330
RAMVEC_SAVE     := $0332
L0334           := $0334
L0336           := $0336
FROM_C669       := $0338
FROM_C672       := $0341
FROM_C67B       := $034A
L034D           := $034D
FROM_C684       := $0353
FROM_C68D       := $035C
L035F           := $035F
CurMaxY         := $037E
L0380           := $0380
CurMaxX         := $0381
KernMsg         := $0383
L0386           := $0386
FNlength        := $0387
TOD_60HZ        := $038F
TOD_SECS        := $0390
TOD_MINS        := $0391
TOD_HOURS       := $0392
MemBotLoByte    := $0398
MemBotHiByte    := $0399
MemTopLoByte    := $039A
MemTopHiByte    := $039B
L03AB           := $03AB
L03B7           := $03B7
L03C0           := $03C0
L0470           := $0470
L066A           := $066A
L0810           := $0810
L0A00           := $0A00
L11A0           := $11A0
L1F0C           := $1F0C
L2020           := $2020
L2E6A           := $2E6A
L42D0           := $42D0
L42E4           := $42E4
L4307           := $4307
L4825           := $4825
L4AF3           := $4AF3
L4D37           := $4D37
L4D39           := $4D39
L4DCA           := $4DCA
L4F4C           := $4F4C
L4F7F           := $4F7F
L5044           := $5044
L5061           := $5061
L509D           := $509D
L51D3           := $51D3
L51F0           := $51F0
L51F5           := $51F5
L53DE           := $53DE
L5595           := $5595
L5609           := $5609
L5653           := $5653
L5A79           := $5A79
L5A93           := $5A93
L5A9E           := $5A9E
L673E           := $673E
L6E6E           := $6E6E
L77CB           := $77CB
L77DD           := $77DD
L78C5           := $78C5
L792A           := $792A
L7944           := $7944
L7947           := $7947
L794A           := $794A
L794C           := $794C
L795A           := $795A
L7A73           := $7A73
L7D16           := $7D16
L7E6A           := $7E6A
; ----------------------------------------------------------------------------
; At offset 4: this bytes tells the number of Kbytes to be checked by the ROM
; checksum routine. I don't know the purpose of the other bytes though.
        .byte   $00,$00,$FF,$FF,$10,$DD,$DD,$DD ; 8000 00 00 FF FF 10 DD DD DD  ........
; ----------------------------------------------------------------------------
Commodore_LCD:
; Every ROM images begins with this "identification" string. This one is also
; used to compare with the searched ones by the ROM scanning routine.
        .byte   "Commodore LCD"                 ; 8008 43 6F 6D 6D 6F 64 6F 72  Commodor
                                                ; 8010 65 20 4C 43 44           e LCD
; ----------------------------------------------------------------------------
; Every ROMs contain a "directory" with the "applications" can be found (I
; guess). Besides the names, I know only maybe three bytes of the six
; (prefixed every name): the size of that entry, zero for no more entries.
; Two other bytes (last two bytes - a word - before the name itself) may
; encode the entry point of the given software. I don't know the purpose of
; other bytes.
        .byte   $11,$10,$20,$00,$38,$80,$4D,$4F ; 8015 11 10 20 00 38 80 4D 4F  .. .8.MO
        .byte   $4E,$49,$54,$4F,$52,$2E,$4D,$4F ; 801D 4E 49 54 4F 52 2E 4D 4F  NITOR.MO
        .byte   $4E,$11,$01,$20,$00,$4C,$80,$43 ; 8025 4E 11 01 20 00 4C 80 43  N.. .L.C
        .byte   $4F,$4D,$4D,$41,$4E,$44,$2E,$43 ; 802D 4F 4D 4D 41 4E 44 2E 43  OMMAND.C
        .byte   $4D,$44,$00                     ; 8035 4D 44 00                 MD.
; ----------------------------------------------------------------------------
; It seems to be the entry point of "MONITOR.MON".
        cpx     #$0E                            ; 8038 E0 0E                    ..
        bne     L8040                           ; 803A D0 04                    ..
        clc                                     ; 803C 18                       .
        jmp     L84FA                           ; 803D 4C FA 84                 L..
; ----------------------------------------------------------------------------
L8040:  cpx     #$06                            ; 8040 E0 06                    ..
        beq     L8049                           ; 8042 F0 05                    ..
        cpx     #$04                            ; 8044 E0 04                    ..
        beq     L8049                           ; 8046 F0 01                    ..
        rts                                     ; 8048 60                       `
; ----------------------------------------------------------------------------
L8049:  jmp     LC6DF                           ; 8049 4C DF C6                 L..
; ----------------------------------------------------------------------------
; It seems to be the entry point of "COMMAND.CMD".
        cpx     #$08                            ; 804C E0 08                    ..
        bne     L8066                           ; 804E D0 16                    ..
        lda     #$7E                            ; 8050 A9 7E                    .~
L8052:  ldx     #$01                            ; 8052 A2 01                    ..
        ldy     #$0E                            ; 8054 A0 0E                    ..
        jsr     SetLFS                          ; 8056 20 CF FC                  ..
        lda     $0423                           ; 8059 AD 23 04                 .#.
        ldx     #$24                            ; 805C A2 24                    .$
        ldy     #$04                            ; 805E A0 04                    ..
        jsr     SetNam                          ; 8060 20 D6 FC                  ..
        jsr     Open_                           ; 8063 20 DE FC                  ..
L8066:  rts                                     ; 8066 60                       `
; ----------------------------------------------------------------------------
L8067:  txa                                     ; 8067 8A                       .
        tay                                     ; 8068 A8                       .
        lda     #$FF                            ; 8069 A9 FF                    ..
L806B:  phy                                     ; 806B 5A                       Z
        ldx     #$00                            ; 806C A2 00                    ..
        phx                                     ; 806E DA                       .
        pha                                     ; 806F 48                       H
        phy                                     ; 8070 5A                       Z
        cld                                     ; 8071 D8                       .
        ldx     #$08                            ; 8072 A2 08                    ..
L8074:  stx     L03C0                           ; 8074 8E C0 03                 ...
L8077:  dec     L03C0                           ; 8077 CE C0 03                 ...
        ldx     L03C0                           ; 807A AE C0 03                 ...
        bpl     L8082                           ; 807D 10 03                    ..
        sec                                     ; 807F 38                       8
        bra     L80BB                           ; 8080 80 39                    .9
L8082:  lda     $0204                           ; 8082 AD 04 02                 ...
        and     PowersOfTwo,x                   ; 8085 3D 41 B0                 =A.
        beq     L8077                           ; 8088 F0 ED                    ..
        lda     ROM_MMU_values,x                ; 808A BD CB 82                 ...
        sta     MMU_KERN_WINDOW                 ; 808D 8D 00 FF                 ...
        lda     #$40                            ; 8090 A9 40                    .@
        sta     $DC                             ; 8092 85 DC                    ..
        stz     $DB                             ; 8094 64 DB                    d.
        lda     #$15                            ; 8096 A9 15                    ..
        .byte   $2C                             ; 8098 2C                       ,
L8099:  lda     ($DB)                           ; 8099 B2 DB                    ..
        clc                                     ; 809B 18                       .
        adc     $DB                             ; 809C 65 DB                    e.
        sta     $DB                             ; 809E 85 DB                    ..
        bcc     L80A4                           ; 80A0 90 02                    ..
        inc     $DC                             ; 80A2 E6 DC                    ..
L80A4:  lda     ($DB)                           ; 80A4 B2 DB                    ..
        beq     L8077                           ; 80A6 F0 CF                    ..
        tsx                                     ; 80A8 BA                       .
L80A9:  inc     stack+3,x                       ; 80A9 FE 03 01                 ...
        ldy     #$01                            ; 80AC A0 01                    ..
        lda     ($DB),y                         ; 80AE B1 DB                    ..
        and     stack+2,x                       ; 80B0 3D 02 01                 =..
        beq     L8099                           ; 80B3 F0 E4                    ..
        dec     stack+1,x                       ; 80B5 DE 01 01                 ...
        bne     L8099                           ; 80B8 D0 DF                    ..
        clc                                     ; 80BA 18                       .
L80BB:  ply                                     ; 80BB 7A                       z
        ply                                     ; 80BC 7A                       z
        plx                                     ; 80BD FA                       .
        ply                                     ; 80BE 7A                       z
        bcc     L80C3                           ; 80BF 90 02                    ..
        ldx     #$00                            ; 80C1 A2 00                    ..
L80C3:  cpx     #$00                            ; 80C3 E0 00                    ..
        rts                                     ; 80C5 60                       `
; ----------------------------------------------------------------------------
L80C6:  pha                                     ; 80C6 48                       H
        ldy     #$01                            ; 80C7 A0 01                    ..
        phy                                     ; 80C9 5A                       Z
L80CA:  ply                                     ; 80CA 7A                       z
        lda     #$07                            ; 80CB A9 07                    ..
        jsr     L806B                           ; 80CD 20 6B 80                  k.
        beq     L80DC                           ; 80D0 F0 0A                    ..
        pla                                     ; 80D2 68                       h
        pha                                     ; 80D3 48                       H
        phy                                     ; 80D4 5A                       Z
        ldy     #$03                            ; 80D5 A0 03                    ..
        eor     ($DB),y                         ; 80D7 51 DB                    Q.
        bne     L80CA                           ; 80D9 D0 EF                    ..
        ply                                     ; 80DB 7A                       z
L80DC:  ply                                     ; 80DC 7A                       z
        cpx     #$00                            ; 80DD E0 00                    ..
        rts                                     ; 80DF 60                       `
; ----------------------------------------------------------------------------
L80E0:  and     #$3F                            ; 80E0 29 3F                    )?
        sta     $03BC                           ; 80E2 8D BC 03                 ...
        ldx     #$04                            ; 80E5 A2 04                    ..
        jsr     LD230                           ; 80E7 20 30 D2                  0.
        stz     $03BD                           ; 80EA 9C BD 03                 ...
        lda     $03BC                           ; 80ED AD BC 03                 ...
        ldy     #$01                            ; 80F0 A0 01                    ..
        jsr     L806B                           ; 80F2 20 6B 80                  k.
        beq     L8148                           ; 80F5 F0 51                    .Q
        lda     #$05                            ; 80F7 A9 05                    ..
        sta     $03BF                           ; 80F9 8D BF 03                 ...
        ldx     #$07                            ; 80FC A2 07                    ..
        lda     $03BC                           ; 80FE AD BC 03                 ...
L8101:  cmp     PowersOfTwo,x                   ; 8101 DD 41 B0                 .A.
        beq     L810B                           ; 8104 F0 05                    ..
        dex                                     ; 8106 CA                       .
        bpl     L8101                           ; 8107 10 F8                    ..
        bra     L8115                           ; 8109 80 0A                    ..
L810B:  ldy     #$08                            ; 810B A0 08                    ..
        jsr     L806B                           ; 810D 20 6B 80                  k.
        bne     L8115                           ; 8110 D0 03                    ..
        inc     $03BF                           ; 8112 EE BF 03                 ...
L8115:  jsr     L815E                           ; 8115 20 5E 81                  ^.
L8118:  jsr     LB6DF                           ; 8118 20 DF B6                  ..
        ldx     #$09                            ; 811B A2 09                    ..
L811D:  cmp     L8154,x                         ; 811D DD 54 81                 .T.
        beq     L8127                           ; 8120 F0 05                    ..
        dex                                     ; 8122 CA                       .
        bpl     L811D                           ; 8123 10 F8                    ..
        bra     L8118                           ; 8125 80 F1                    ..
L8127:  txa                                     ; 8127 8A                       .
        cmp     #$07                            ; 8128 C9 07                    ..
        bcs     L8148                           ; 812A B0 1C                    ..
        cmp     #$06                            ; 812C C9 06                    ..
        bne     L813A                           ; 812E D0 0A                    ..
        cmp     $03BF                           ; 8130 CD BF 03                 ...
        beq     L813A                           ; 8133 F0 05                    ..
        jsr     L815E                           ; 8135 20 5E 81                  ^.
        bra     L8118                           ; 8138 80 DE                    ..
L813A:  clc                                     ; 813A 18                       .
        adc     $03BE                           ; 813B 6D BE 03                 m..
        tay                                     ; 813E A8                       .
        lda     $03BD                           ; 813F AD BD 03                 ...
        jsr     L806B                           ; 8142 20 6B 80                  k.
        beq     L8118                           ; 8145 F0 D1                    ..
        .byte   $2C                             ; 8147 2C                       ,
L8148:  ldx     #$00                            ; 8148 A2 00                    ..
        phx                                     ; 814A DA                       .
        pha                                     ; 814B 48                       H
        ldx     #$06                            ; 814C A2 06                    ..
        jsr     LD230                           ; 814E 20 30 D2                  0.
        pla                                     ; 8151 68                       h
        plx                                     ; 8152 FA                       .
        rts                                     ; 8153 60                       `
; ----------------------------------------------------------------------------
L8154:  .byte   $85,$89,$86,$8A,$87,$8B,$88,$8C ; 8154 85 89 86 8A 87 8B 88 8C  ........
        .byte   $0D,$8D                         ; 815C 0D 8D                    ..
; ----------------------------------------------------------------------------
L815E:  sec                                     ; 815E 38                       8
        cld                                     ; 815F D8                       .
        lda     $03BF                           ; 8160 AD BF 03                 ...
        adc     $03BE                           ; 8163 6D BE 03                 m..
        sta     $03BE                           ; 8166 8D BE 03                 ...
L8169:  ldy     $03BE                           ; 8169 AC BE 03                 ...
        lda     $03BD                           ; 816C AD BD 03                 ...
        jsr     L806B                           ; 816F 20 6B 80                  k.
        bne     L818A                           ; 8172 D0 16                    ..
        ldy     #$01                            ; 8174 A0 01                    ..
        sty     $03BE                           ; 8176 8C BE 03                 ...
L8179:  lda     $03BD                           ; 8179 AD BD 03                 ...
        asl     a                               ; 817C 0A                       .
        bne     L8180                           ; 817D D0 01                    ..
        inc     a                               ; 817F 1A                       .
L8180:  sta     $03BD                           ; 8180 8D BD 03                 ...
        bit     $03BC                           ; 8183 2C BC 03                 ,..
        beq     L8179                           ; 8186 F0 F1                    ..
        bra     L8169                           ; 8188 80 DF                    ..
L818A:  ldx     #$00                            ; 818A A2 00                    ..
L818C:  phx                                     ; 818C DA                       .
        phy                                     ; 818D 5A                       Z
        jsr     L81E0                           ; 818E 20 E0 81                  ..
        lda     #$D4                            ; 8191 A9 D4                    ..
        sta     $DB                             ; 8193 85 DB                    ..
        lda     #$81                            ; 8195 A9 81                    ..
        sta     $DC                             ; 8197 85 DC                    ..
        tsx                                     ; 8199 BA                       .
        lda     stack+2,x                       ; 819A BD 02 01                 ...
        ldy     #$07                            ; 819D A0 07                    ..
        cmp     #$07                            ; 819F C9 07                    ..
        beq     L81B8                           ; 81A1 F0 15                    ..
        ldy     #$00                            ; 81A3 A0 00                    ..
        dec     a                               ; 81A5 3A                       :
        cmp     $03BF                           ; 81A6 CD BF 03                 ...
        beq     L81B8                           ; 81A9 F0 0D                    ..
        ldy     stack+1,x                       ; 81AB BC 01 01                 ...
        lda     $03BD                           ; 81AE AD BD 03                 ...
        jsr     L806B                           ; 81B1 20 6B 80                  k.
        beq     L81C5                           ; 81B4 F0 0F                    ..
        ldy     #$06                            ; 81B6 A0 06                    ..
L81B8:  lda     ($DB),y                         ; 81B8 B1 DB                    ..
        cmp     #$2E                            ; 81BA C9 2E                    ..
        beq     L81C5                           ; 81BC F0 07                    ..
        clc                                     ; 81BE 18                       .
        jsr     LB6F9                           ; 81BF 20 F9 B6                  ..
        iny                                     ; 81C2 C8                       .
        bra     L81B8                           ; 81C3 80 F3                    ..
L81C5:  lda     #$0D                            ; 81C5 A9 0D                    ..
        clc                                     ; 81C7 18                       .
        jsr     LB6F9                           ; 81C8 20 F9 B6                  ..
        ply                                     ; 81CB 7A                       z
        plx                                     ; 81CC FA                       .
        iny                                     ; 81CD C8                       .
        inx                                     ; 81CE E8                       .
        cpx     #$08                            ; 81CF E0 08                    ..
        bne     L818C                           ; 81D1 D0 B9                    ..
        rts                                     ; 81D3 60                       `
; ----------------------------------------------------------------------------
        .byte   "<MORE>.EXIT."                  ; 81D4 3C 4D 4F 52 45 3E 2E 45  <MORE>.E
                                                ; 81DC 58 49 54 2E              XIT.
; ----------------------------------------------------------------------------
L81E0:  ldy     L81F3,x                         ; 81E0 BC F3 81                 ...
        ldx     $039C                           ; 81E3 AE 9C 03                 ...
        lda     #$89                            ; 81E6 A9 89                    ..
        sec                                     ; 81E8 38                       8
        jsr     LB6F9                           ; 81E9 20 F9 B6                  ..
        lda     #$67                            ; 81EC A9 67                    .g
        ldy     #$09                            ; 81EE A0 09                    ..
        sta     ($BD),y                         ; 81F0 91 BD                    ..
        rts                                     ; 81F2 60                       `
; ----------------------------------------------------------------------------
L81F3:  .byte   $00,$0A,$14,$1E                 ; 81F3 00 0A 14 1E              ....
L81F7:  .byte   $28,$32,$3C,$46                 ; 81F7 28 32 3C 46              (2<F
; ----------------------------------------------------------------------------
L81FB:  stz     $0450                           ; 81FB 9C 50 04                 .P.
        jsr     L806B                           ; 81FE 20 6B 80                  k.
        beq     L821C                           ; 8201 F0 19                    ..
        phx                                     ; 8203 DA                       .
        pha                                     ; 8204 48                       H
        phy                                     ; 8205 5A                       Z
        ldx     #$00                            ; 8206 A2 00                    ..
        ldy     #$06                            ; 8208 A0 06                    ..
L820A:  lda     ($DB),y                         ; 820A B1 DB                    ..
        sta     $0450,x                         ; 820C 9D 50 04                 .P.
        inx                                     ; 820F E8                       .
        iny                                     ; 8210 C8                       .
        tya                                     ; 8211 98                       .
        cmp     ($DB)                           ; 8212 D2 DB                    ..
        bne     L820A                           ; 8214 D0 F4                    ..
        stz     $0450,x                         ; 8216 9E 50 04                 .P.
        ply                                     ; 8219 7A                       z
        pla                                     ; 821A 68                       h
        plx                                     ; 821B FA                       .
L821C:  rts                                     ; 821C 60                       `
; ----------------------------------------------------------------------------
L821D:  lda     #$AE                            ; 821D A9 AE                    ..
        sta     $034E                           ; 821F 8D 4E 03                 .N.
        ldx     FNlength                        ; 8222 AE 87 03                 ...
        beq     L826E                           ; 8225 F0 47                    .G
        ldy     #$01                            ; 8227 A0 01                    ..
L8229:  lda     #$7F                            ; 8229 A9 7F                    ..
        jsr     L806B                           ; 822B 20 6B 80                  k.
        beq     L826E                           ; 822E F0 3E                    .>
        pha                                     ; 8230 48                       H
        phx                                     ; 8231 DA                       .
        phy                                     ; 8232 5A                       Z
        ldx     FNlength                        ; 8233 AE 87 03                 ...
        beq     L826E                           ; 8236 F0 36                    .6
        lda     ($DB)                           ; 8238 B2 DB                    ..
        tay                                     ; 823A A8                       .
L823B:  dey                                     ; 823B 88                       .
        dex                                     ; 823C CA                       .
        bmi     L824D                           ; 823D 30 0E                    0.
        jsr     L826F                           ; 823F 20 6F 82                  o.
        cmp     ($DB),y                         ; 8242 D1 DB                    ..
        bne     L824D                           ; 8244 D0 07                    ..
        cmp     #$2E                            ; 8246 C9 2E                    ..
        bne     L823B                           ; 8248 D0 F1                    ..
        clc                                     ; 824A 18                       .
        bra     L826B                           ; 824B 80 1E                    ..
L824D:  ldy     #$06                            ; 824D A0 06                    ..
        ldx     #$00                            ; 824F A2 00                    ..
L8251:  jsr     L826F                           ; 8251 20 6F 82                  o.
        cmp     ($DB),y                         ; 8254 D1 DB                    ..
        bne     L8265                           ; 8256 D0 0D                    ..
        inx                                     ; 8258 E8                       .
        iny                                     ; 8259 C8                       .
        cpx     FNlength                        ; 825A EC 87 03                 ...
        bne     L8251                           ; 825D D0 F2                    ..
        lda     ($DB),y                         ; 825F B1 DB                    ..
        cmp     #$2E                            ; 8261 C9 2E                    ..
        beq     L826B                           ; 8263 F0 06                    ..
L8265:  ply                                     ; 8265 7A                       z
        plx                                     ; 8266 FA                       .
        pla                                     ; 8267 68                       h
        iny                                     ; 8268 C8                       .
        bra     L8229                           ; 8269 80 BE                    ..
L826B:  ply                                     ; 826B 7A                       z
        plx                                     ; 826C FA                       .
        pla                                     ; 826D 68                       h
L826E:  rts                                     ; 826E 60                       `
; ----------------------------------------------------------------------------
L826F:  phy                                     ; 826F 5A                       Z
        txa                                     ; 8270 8A                       .
        tay                                     ; 8271 A8                       .
        jsr     FROM_C67B                       ; 8272 20 4A 03                  J.
        ply                                     ; 8275 7A                       z
        rts                                     ; 8276 60                       `
; ----------------------------------------------------------------------------
; Interesting, though I don't know the purpose of the given ZP locations. It
; seems, $FD00, $FD80, $FE00, $FE80 are used some kind of MMU purpose, based
; on value CMP'd with constants which suggests memory is devided into parts
; (high byte only): $00-$3F, $40-$7F, $80-$BF, $C0-$F7, $F8-$FF.
L8277:  sei                                     ; 8277 78                       x
        phx                                     ; 8278 DA                       .
        ldx     L03C0                           ; 8279 AE C0 03                 ...
        lda     ROM_MMU_values,x                ; 827C BD CB 82                 ...
        clc                                     ; 827F 18                       .
        adc     #$10                            ; 8280 69 10                    i.
        ldy     #$02                            ; 8282 A0 02                    ..
        sec                                     ; 8284 38                       8
        sbc     ($DB),y                         ; 8285 F1 DB                    ..
        tax                                     ; 8287 AA                       .
        ldy     #$05                            ; 8288 A0 05                    ..
        lda     ($DB),y                         ; 828A B1 DB                    ..
        cmp     #$F8                            ; 828C C9 F8                    ..
        bcs     L82B1                           ; 828E B0 21                    .!
        stz     MMU_APPL_WINDOW1                ; 8290 9C 00 FD                 ...
        stz     MMU_APPL_WINDOW2                ; 8293 9C 80 FD                 ...
        stz     MMU_APPL_WINDOW3                ; 8296 9C 00 FE                 ...
        cmp     #$C0                            ; 8299 C9 C0                    ..
        bcs     L82AE                           ; 829B B0 11                    ..
        cmp     #$80                            ; 829D C9 80                    ..
        bcs     L82AB                           ; 829F B0 0A                    ..
        cmp     #$40                            ; 82A1 C9 40                    .@
        bcs     L82A8                           ; 82A3 B0 03                    ..
        stx     MMU_APPL_WINDOW1                ; 82A5 8E 00 FD                 ...
L82A8:  stx     MMU_APPL_WINDOW2                ; 82A8 8E 80 FD                 ...
L82AB:  stx     MMU_APPL_WINDOW3                ; 82AB 8E 00 FE                 ...
L82AE:  stx     MMU_APPL_WINDOW4                ; 82AE 8E 80 FE                 ...
L82B1:  pha                                     ; 82B1 48                       H
        dey                                     ; 82B2 88                       .
        lda     ($DB),y                         ; 82B3 B1 DB                    ..
        ply                                     ; 82B5 7A                       z
        cmp     #$00                            ; 82B6 C9 00                    ..
        bne     L82BB                           ; 82B8 D0 01                    ..
        dey                                     ; 82BA 88                       .
L82BB:  dec     a                               ; 82BB 3A                       :
        plx                                     ; 82BC FA                       .
        rts                                     ; 82BD 60                       `
; ----------------------------------------------------------------------------
L82BE:  jsr     ScanROMs                        ; 82BE 20 D3 82                  ..
        sta     $0204                           ; 82C1 8D 04 02                 ...
        stx     $0205                           ; 82C4 8E 05 02                 ...
        sty     $0206                           ; 82C7 8C 06 02                 ...
        rts                                     ; 82CA 60                       `
; ----------------------------------------------------------------------------
ROM_MMU_values:
; The 'ScanROMs' routine uses this table to write values to $FF00 to check
; for ROMs.
        .byte   $70,$80,$90,$A0,$B0,$C0,$D0,$E0 ; 82CB 70 80 90 A0 B0 C0 D0 E0  p.......
; ----------------------------------------------------------------------------
ScanROMs:
; This routine seems to scan ROMs, searching for the "Commodore LCD" string.
; This is done by using register at $FF00 which seems to tell the memory
; mapping at CPU address $4000. So I think $FF00 tells what is mapped to
; $4000.
        lda     #$00                            ; 82D3 A9 00                    ..
        pha                                     ; 82D5 48                       H
        pha                                     ; 82D6 48                       H
        pha                                     ; 82D7 48                       H
        ldy     #$07                            ; 82D8 A0 07                    ..
L82DA:  lda     ROM_MMU_values,y                ; 82DA B9 CB 82                 ...
        sta     MMU_KERN_WINDOW                 ; 82DD 8D 00 FF                 ...
        phy                                     ; 82E0 5A                       Z
        ldx     #$0C                            ; 82E1 A2 0C                    ..
L82E3:  lda     $4008,x                         ; 82E3 BD 08 40                 ..@
        cmp     Commodore_LCD,x                 ; 82E6 DD 08 80                 ...
        bne     L8315                           ; 82E9 D0 2A                    .*
        dex                                     ; 82EB CA                       .
        bpl     L82E3                           ; 82EC 10 F5                    ..
        ply                                     ; 82EE 7A                       z
        phy                                     ; 82EF 5A                       Z
        lda     ROM_MMU_values,y                ; 82F0 B9 CB 82                 ...
; $4004 is the paged-in ROM, where the id string would be ($FF00 controls
; what can you see from $4000), it's compared with the kernal's image's id
; string ("Commodore LCD").
        ldx     $4004                           ; 82F3 AE 04 40                 ..@
        pha                                     ; 82F6 48                       H
        jsr     RomCheckSum                     ; 82F7 20 67 83                  g.
        ply                                     ; 82FA 7A                       z
        sty     MMU_KERN_WINDOW                 ; 82FB 8C 00 FF                 ...
L82FE:  phx                                     ; 82FE DA                       .
        tsx                                     ; 82FF BA                       .
        clc                                     ; 8300 18                       .
        adc     stack+4,x                       ; 8301 7D 04 01                 }..
        sta     stack+4,x                       ; 8304 9D 04 01                 ...
; Hmm, it seems to be a bug for me, it should be 'pla', otherwise X is messed
; up to be used to address byte on the stack.
        plx                                     ; 8307 FA                       .
        adc     stack+5,x                       ; 8308 7D 05 01                 }..
        sta     stack+5,x                       ; 830B 9D 05 01                 ...
        ply                                     ; 830E 7A                       z
        phy                                     ; 830F 5A                       Z
        jsr     PrintRomSumChkByPassed          ; 8310 20 2F 83                  /.
        sec                                     ; 8313 38                       8
        .byte   $24                             ; 8314 24                       $
L8315:  clc                                     ; 8315 18                       .
        ply                                     ; 8316 7A                       z
        tsx                                     ; 8317 BA                       .
        rol     stack+1,x                       ; 8318 3E 01 01                 >..
        dey                                     ; 831B 88                       .
        bpl     L82DA                           ; 831C 10 BC                    ..
        pla                                     ; 831E 68                       h
        ply                                     ; 831F 7A                       z
        plx                                     ; 8320 FA                       .
        cmp     $0204                           ; 8321 CD 04 02                 ...
        bne     L832E                           ; 8324 D0 08                    ..
        cpx     $0205                           ; 8326 EC 05 02                 ...
        bne     L832E                           ; 8329 D0 03                    ..
        cpy     $0206                           ; 832B CC 06 02                 ...
L832E:  rts                                     ; 832E 60                       `
; ----------------------------------------------------------------------------
PrintRomSumChkByPassed:
; Push Y onto the stack. Write "ROMSUM ...." text, then take the value from
; the stack, "covert" into an ASCII number (ORA), and print it, followed by
; the " INSTALLED" text.
        phy                                     ; 832F 5A                       Z
        jsr     ShowInLineText                  ; 8330 20 5B FB                  [.
        .byte   "ROMSUM CHECK BYPASSED, ROM #"  ; 8333 52 4F 4D 53 55 4D 20 43  ROMSUM C
                                                ; 833B 48 45 43 4B 20 42 59 50  HECK BYP
                                                ; 8343 41 53 53 45 44 2C 20 52  ASSED, R
                                                ; 834B 4F 4D 20 23              OM #
        .byte   $00                             ; 834F 00                       .
; ----------------------------------------------------------------------------
        pla                                     ; 8350 68                       h
        ora     #$30                            ; 8351 09 30                    .0
        jsr     ShowChar_                       ; 8353 20 B3 AB                  ..
        jsr     ShowInLineText                  ; 8356 20 5B FB                  [.
        .byte   "  INSTALLED"                   ; 8359 20 20 49 4E 53 54 41 4C    INSTAL
                                                ; 8361 4C 45 44                 LED
        .byte   $0D,$00                         ; 8364 0D 00                    ..
; ----------------------------------------------------------------------------
        rts                                     ; 8366 60                       `
; ----------------------------------------------------------------------------
RomCheckSum:
; Creates checksum on ROMs.
; Input: 
;        A = value of $FF00 reg to start at
;        X = number of Kbytes to check
; Output:
;        X/A = 16 bit checksum (simple addition, X is the high byte)
        sta     $03C2                           ; 8367 8D C2 03                 ...
        stx     $03C1                           ; 836A 8E C1 03                 ...
        lda     #$00                            ; 836D A9 00                    ..
        tax                                     ; 836F AA                       .
        cld                                     ; 8370 D8                       .
L8371:  ldy     $03C2                           ; 8371 AC C2 03                 ...
        sty     MMU_KERN_WINDOW                 ; 8374 8C 00 FF                 ...
        ldy     #$00                            ; 8377 A0 00                    ..
        clc                                     ; 8379 18                       .
L837A:  adc     $4000,y                         ; 837A 79 00 40                 y.@
        bcc     L8381                           ; 837D 90 02                    ..
        clc                                     ; 837F 18                       .
        inx                                     ; 8380 E8                       .
L8381:  adc     $4100,y                         ; 8381 79 00 41                 y.A
        bcc     L8388                           ; 8384 90 02                    ..
        clc                                     ; 8386 18                       .
        inx                                     ; 8387 E8                       .
L8388:  adc     $4200,y                         ; 8388 79 00 42                 y.B
        bcc     L838F                           ; 838B 90 02                    ..
        clc                                     ; 838D 18                       .
        inx                                     ; 838E E8                       .
L838F:  adc     $4300,y                         ; 838F 79 00 43                 y.C
        bcc     L8396                           ; 8392 90 02                    ..
        clc                                     ; 8394 18                       .
        inx                                     ; 8395 E8                       .
L8396:  iny                                     ; 8396 C8                       .
        bne     L837A                           ; 8397 D0 E1                    ..
        inc     $03C2                           ; 8399 EE C2 03                 ...
        dec     $03C1                           ; 839C CE C1 03                 ...
        bne     L8371                           ; 839F D0 D0                    ..
        rts                                     ; 83A1 60                       `
; ----------------------------------------------------------------------------
L83A2:  lda     $DD                             ; 83A2 A5 DD                    ..
        ldx     $DE                             ; 83A4 A6 DE                    ..
        ldy     $DF                             ; 83A6 A4 DF                    ..
        pha                                     ; 83A8 48                       H
        phx                                     ; 83A9 DA                       .
        phy                                     ; 83AA 5A                       Z
        lda     #$0F                            ; 83AB A9 0F                    ..
        sta     $DE                             ; 83AD 85 DE                    ..
        lda     #$00                            ; 83AF A9 00                    ..
        sta     $DD                             ; 83B1 85 DD                    ..
        sta     $DF                             ; 83B3 85 DF                    ..
        pha                                     ; 83B5 48                       H
        pha                                     ; 83B6 48                       H
        tay                                     ; 83B7 A8                       .
        tsx                                     ; 83B8 BA                       .
        cld                                     ; 83B9 D8                       .
L83BA:  clc                                     ; 83BA 18                       .
        adc     ($DD),y                         ; 83BB 71 DD                    q.
        bcc     L83C7                           ; 83BD 90 08                    ..
        inc     stack+1,x                       ; 83BF FE 01 01                 ...
        bne     L83C7                           ; 83C2 D0 03                    ..
        inc     stack+2,x                       ; 83C4 FE 02 01                 ...
L83C7:  iny                                     ; 83C7 C8                       .
        bne     L83BA                           ; 83C8 D0 F0                    ..
        dec     $DE                             ; 83CA C6 DE                    ..
        dec     $DE                             ; 83CC C6 DE                    ..
        beq     L83BA                           ; 83CE F0 EA                    ..
        inc     $DE                             ; 83D0 E6 DE                    ..
        bpl     L83BA                           ; 83D2 10 E6                    ..
        plx                                     ; 83D4 FA                       .
        ply                                     ; 83D5 7A                       z
        sta     $DD                             ; 83D6 85 DD                    ..
        stx     $DE                             ; 83D8 86 DE                    ..
        sty     $DF                             ; 83DA 84 DF                    ..
        ply                                     ; 83DC 7A                       z
        plx                                     ; 83DD FA                       .
        pla                                     ; 83DE 68                       h
        cmp     $DD                             ; 83DF C5 DD                    ..
        bne     L83EB                           ; 83E1 D0 08                    ..
        cpx     $DE                             ; 83E3 E4 DE                    ..
        bne     L83EB                           ; 83E5 D0 04                    ..
        cpy     $DF                             ; 83E7 C4 DF                    ..
        beq     L83EC                           ; 83E9 F0 01                    ..
L83EB:  clc                                     ; 83EB 18                       .
L83EC:  rts                                     ; 83EC 60                       `
; ----------------------------------------------------------------------------
L83ED:  lda     #$02                            ; 83ED A9 02                    ..
        .byte   $2C                             ; 83EF 2C                       ,
L83F0:  lda     #$00                            ; 83F0 A9 00                    ..
        bit     $10A9                           ; 83F2 2C A9 10                 ,..
        ldx     #$01                            ; 83F5 A2 01                    ..
L83F7:  phx                                     ; 83F7 DA                       .
        pha                                     ; 83F8 48                       H
        jsr     L840F                           ; 83F9 20 0F 84                  ..
        bcs     L8407                           ; 83FC B0 09                    ..
        jsr     KL_RESTOR                       ; 83FE 20 96 C6                  ..
        plx                                     ; 8401 FA                       .
        phx                                     ; 8402 DA                       .
        jsr     L8420                           ; 8403 20 20 84                   .
        clc                                     ; 8406 18                       .
L8407:  pla                                     ; 8407 68                       h
        plx                                     ; 8408 FA                       .
        inx                                     ; 8409 E8                       .
        bcc     L83F7                           ; 840A 90 EB                    ..
        jmp     KL_RESTOR                       ; 840C 4C 96 C6                 L..
; ----------------------------------------------------------------------------
L840F:  jsr     L8067                           ; 840F 20 67 80                  g.
        beq     L841C                           ; 8412 F0 08                    ..
        bit     #$C0                            ; 8414 89 C0                    ..
        bne     L841C                           ; 8416 D0 04                    ..
        ldy     #$01                            ; 8418 A0 01                    ..
        clc                                     ; 841A 18                       .
        rts                                     ; 841B 60                       `
; ----------------------------------------------------------------------------
L841C:  sec                                     ; 841C 38                       8
        bit     #$00                            ; 841D 89 00                    ..
        rts                                     ; 841F 60                       `
; ----------------------------------------------------------------------------
L8420:  jsr     L8277                           ; 8420 20 77 82                  w.
        jmp     LFA67                           ; 8423 4C 67 FA                 Lg.
; ----------------------------------------------------------------------------
L8426:  stz     $0202                           ; 8426 9C 02 02                 ...
        ldx     $0203                           ; 8429 AE 03 02                 ...
        stx     $0200                           ; 842C 8E 00 02                 ...
        stz     $0203                           ; 842F 9C 03 02                 ...
L8433           := * + 1
        jsr     L840F                           ; 8432 20 0F 84                  ..
        bcc     L843A                           ; 8435 90 03                    ..
        jmp     L843F                           ; 8437 4C 3F 84                 L?.
; ----------------------------------------------------------------------------
L843A:  ldx     #$0A                            ; 843A A2 0A                    ..
        jsr     L8420                           ; 843C 20 20 84                   .
L843F:  jsr     L8685                           ; 843F 20 85 86                  ..
        lda     #$20                            ; 8442 A9 20                    . 
        ldy     #$01                            ; 8444 A0 01                    ..
        jsr     L806B                           ; 8446 20 6B 80                  k.
        clc                                     ; 8449 18                       .
        jsr     L8459                           ; 844A 20 59 84                  Y.
        ldy     #$01                            ; 844D A0 01                    ..
        lda     #$10                            ; 844F A9 10                    ..
        jsr     L806B                           ; 8451 20 6B 80                  k.
        clc                                     ; 8454 18                       .
        jsr     L8459                           ; 8455 20 59 84                  Y.
        brk                                     ; 8458 00                       .
L8459:  ldy     $0202                           ; 8459 AC 02 02                 ...
        bne     L843F                           ; 845C D0 E1                    ..
        bcc     L8472                           ; 845E 90 12                    ..
        jsr     L840F                           ; 8460 20 0F 84                  ..
        beq     L84C3                           ; 8463 F0 5E                    .^
        bit     #$12                            ; 8465 89 12                    ..
        beq     L84C3                           ; 8467 F0 5A                    .Z
        ldy     $0200                           ; 8469 AC 00 02                 ...
        sty     $0203                           ; 846C 8C 03 02                 ...
        stz     $0200                           ; 846F 9C 00 02                 ...
L8472:  jsr     L840F                           ; 8472 20 0F 84                  ..
        beq     L84C3                           ; 8475 F0 4C                    .L
        bit     #$01                            ; 8477 89 01                    ..
        bne     L849B                           ; 8479 D0 20                    . 
        bit     #$12                            ; 847B 89 12                    ..
        bne     L8482                           ; 847D D0 03                    ..
        stz     $0203                           ; 847F 9C 03 02                 ...
L8482:  sta     $0201                           ; 8482 8D 01 02                 ...
        stx     $0200                           ; 8485 8E 00 02                 ...
        sei                                     ; 8488 78                       x
        jsr     KL_RESTOR                       ; 8489 20 96 C6                  ..
        ldx     #$04                            ; 848C A2 04                    ..
        lda     $0203                           ; 848E AD 03 02                 ...
        beq     L8495                           ; 8491 F0 02                    ..
        ldx     #$06                            ; 8493 A2 06                    ..
L8495:  jsr     L8420                           ; 8495 20 20 84                   .
        jmp     L8426                           ; 8498 4C 26 84                 L&.
; ----------------------------------------------------------------------------
L849B:  stx     $0202                           ; 849B 8E 02 02                 ...
        php                                     ; 849E 08                       .
        sei                                     ; 849F 78                       x
        jsr     LC6CB                           ; 84A0 20 CB C6                  ..
        jsr     KL_RESTOR                       ; 84A3 20 96 C6                  ..
        ldx     #$08                            ; 84A6 A2 08                    ..
        jsr     L8420                           ; 84A8 20 20 84                   .
        sei                                     ; 84AB 78                       x
        jsr     LC6CB                           ; 84AC 20 CB C6                  ..
        .byte   $9C                             ; 84AF 9C                       .
L84B0:  .byte   $02                             ; 84B0 02                       .
        .byte   $02                             ; 84B1 02                       .
        ldx     $0200                           ; 84B2 AE 00 02                 ...
        jsr     L840F                           ; 84B5 20 0F 84                  ..
        beq     L84C0                           ; 84B8 F0 06                    ..
        jsr     L8277                           ; 84BA 20 77 82                  w.
        plp                                     ; 84BD 28                       (
        sec                                     ; 84BE 38                       8
        rts                                     ; 84BF 60                       `
; ----------------------------------------------------------------------------
L84C0:  jmp     L8426                           ; 84C0 4C 26 84                 L&.
; ----------------------------------------------------------------------------
L84C3:  clc                                     ; 84C3 18                       .
        rts                                     ; 84C4 60                       `
; ----------------------------------------------------------------------------
L84C5:  php                                     ; 84C5 08                       .
        sei                                     ; 84C6 78                       x
        ldx     $0202                           ; 84C7 AE 02 02                 ...
        beq     L84DA                           ; 84CA F0 0E                    ..
        jsr     LC6CB                           ; 84CC 20 CB C6                  ..
        .byte   $20                             ; 84CF 20                        
L84D0:  sbc     $2084                           ; 84D0 ED 84 20                 .. 
        .byte   $CB                             ; 84D3 CB                       .
        dec     FNptr_lo                        ; 84D4 C6 AE                    ..
        .byte   $02                             ; 84D6 02                       .
        .byte   $02                             ; 84D7 02                       .
        bra     L84E0                           ; 84D8 80 06                    ..
L84DA:  jsr     L84ED                           ; 84DA 20 ED 84                  ..
        ldx     $0200                           ; 84DD AE 00 02                 ...
L84E0:  jsr     L840F                           ; 84E0 20 0F 84                  ..
        beq     L84EA                           ; 84E3 F0 05                    ..
        jsr     L8277                           ; 84E5 20 77 82                  w.
        plp                                     ; 84E8 28                       (
        rts                                     ; 84E9 60                       `
; ----------------------------------------------------------------------------
L84EA:  jmp     L843F                           ; 84EA 4C 3F 84                 L?.
; ----------------------------------------------------------------------------
L84ED:  ldx     $0200                           ; 84ED AE 00 02                 ...
        jsr     L840F                           ; 84F0 20 0F 84                  ..
        beq     L84FA                           ; 84F3 F0 05                    ..
        ldx     #$0E                            ; 84F5 A2 0E                    ..
        jmp     L8420                           ; 84F7 4C 20 84                 L .
; ----------------------------------------------------------------------------
; This seems to be the "shutdown" function or part of it: "state" should be
; saved (which is checked on next reset to see it was a clean shutdown) and
; then it used /POWEROFF line to actually switch the power off (the RAM is
; still powered at least on CLCD!)
L84FA:  sec                                     ; 84FA 38                       8
L84FB:  php                                     ; 84FB 08                       .
        sei                                     ; 84FC 78                       x
        php                                     ; 84FD 08                       .
        ldx     #$00                            ; 84FE A2 00                    ..
L8500:  phx                                     ; 8500 DA                       .
        jsr     LFCF1                           ; 8501 20 F1 FC                  ..
        plx                                     ; 8504 FA                       .
        dex                                     ; 8505 CA                       .
        bpl     L8500                           ; 8506 10 F8                    ..
        plp                                     ; 8508 28                       (
        bcs     L8510                           ; 8509 B0 05                    ..
        tsx                                     ; 850B BA                       .
        cpx     #$20                            ; 850C E0 20                    . 
        bcs     L8516                           ; 850E B0 06                    ..
L8510:  ldx     #$FF                            ; 8510 A2 FF                    ..
        tsx                                     ; 8512 BA                       .
        jsr     L8685                           ; 8513 20 85 86                  ..
L8516:  jsr     L889A                           ; 8516 20 9A 88                  ..
        jsr     L83ED                           ; 8519 20 ED 83                  ..
        jsr     L8644                           ; 851C 20 44 86                  D.
        jsr     L86E9                           ; 851F 20 E9 86                  ..
        sei                                     ; 8522 78                       x
        tsx                                     ; 8523 BA                       .
        stx     $0207                           ; 8524 8E 07 02                 ...
        jsr     L83A2                           ; 8527 20 A2 83                  ..
; Release /POWERON signal, machine will switch off. Run the endless BRA if it
; needs some cycle to happen or some kind of odd problem makes it impossible
; to power off actually.
        lda     #$04                            ; 852A A9 04                    ..
        tsb     VIA1_PORTB                      ; 852C 0C 00 F8                 ...
        trb     VIA1_DDRB                       ; 852F 1C 02 F8                 ...
L8532:  bra     L8532                           ; 8532 80 FE                    ..
KL_RESET:
; *************************************
; Start of the real RESET routine after
; MMU set up.
; *************************************
        sei                                     ; 8534 78                       x
; As soon as possible set /POWERON signal to low (low-active signal)
; configure DDR bit as well.
        lda     #$04                            ; 8535 A9 04                    ..
        tsb     VIA1_DDRB                       ; 8537 0C 02 F8                 ...
        trb     VIA1_PORTB                      ; 853A 1C 00 F8                 ...
        ldx     $0207                           ; 853D AE 07 02                 ...
        txs                                     ; 8540 9A                       .
        cpx     #$20                            ; 8541 E0 20                    . 
        bcc     L8582                           ; 8543 90 3D                    .=
        jsr     L83A2                           ; 8545 20 A2 83                  ..
        bne     L8582                           ; 8548 D0 38                    .8
        sec                                     ; 854A 38                       8
        jsr     LCDsetupGetOrSet                ; 854B 20 28 B2                  (.
        jsr     L870F                           ; 854E 20 0F 87                  ..
        bcs     L8582                           ; 8551 B0 2F                    ./
        jsr     ScanROMs                        ; 8553 20 D3 82                  ..
        bne     L8582                           ; 8556 D0 2A                    .*
        ldx     $0200                           ; 8558 AE 00 02                 ...
        jsr     L840F                           ; 855B 20 0F 84                  ..
        beq     L8582                           ; 855E F0 22                    ."
        jsr     InitIOhw                        ; 8560 20 63 87                  c.
        jsr     KBD_READ_VIA_SR                 ; 8563 20 E4 B5                  ..
        jsr     LB5FD                           ; 8566 20 FD B5                  ..
        lsr     a                               ; 8569 4A                       J
        bcs     L8582                           ; 856A B0 16                    ..
        jsr     L83F0                           ; 856C 20 F0 83                  ..
        jsr     L8644                           ; 856F 20 44 86                  D.
        jsr     L887F                           ; 8572 20 7F 88                  ..
        ldx     $0200                           ; 8575 AE 00 02                 ...
        jsr     L840F                           ; 8578 20 0F 84                  ..
        beq     L8582                           ; 857B F0 05                    ..
        jsr     L8277                           ; 857D 20 77 82                  w.
        plp                                     ; 8580 28                       (
        rts                                     ; 8581 60                       `
; ----------------------------------------------------------------------------
L8582:  ldx     #$FF                            ; 8582 A2 FF                    ..
        txs                                     ; 8584 9A                       .
        jsr     L8685                           ; 8585 20 85 86                  ..
        cli                                     ; 8588 58                       X
        jsr     ShowInLineText                  ; 8589 20 5B FB                  [.
        .byte   " COULD NOT RESTORE PREVIOUS STA"; 858C 20 43 4F 55 4C 44 20 4E  COULD N
                                                ; 8594 4F 54 20 52 45 53 54 4F  OT RESTO
                                                ; 859C 52 45 20 50 52 45 56 49  RE PREVI
                                                ; 85A4 4F 55 53 20 53 54 41     OUS STA
        .byte   "TE"                            ; 85AB 54 45                    TE
        .byte   $0D,$07,$00                     ; 85AD 0D 07 00                 ...
; ----------------------------------------------------------------------------
        ldx     #$02                            ; 85B0 A2 02                    ..
        jsr     WaitXticks_                     ; 85B2 20 E4 BF                  ..
        lda     StopKeyFlag                     ; 85B5 A5 AD                    ..
        and     #$1F                            ; 85B7 29 1F                    ).
        eor     #$15                            ; 85B9 49 15                    I.
        bne     L85C0                           ; 85BB D0 03                    ..
        jmp     L87C5                           ; 85BD 4C C5 87                 L..
; ----------------------------------------------------------------------------
L85C0:  jsr     L870F                           ; 85C0 20 0F 87                  ..
        bcc     L85E2                           ; 85C3 90 1D                    ..
        jsr     ShowInLineText                  ; 85C5 20 5B FB                  [.
        .byte   "YOUR DISK IS NOT INTACT"       ; 85C8 59 4F 55 52 20 44 49 53  YOUR DIS
                                                ; 85D0 4B 20 49 53 20 4E 4F 54  K IS NOT
                                                ; 85D8 20 49 4E 54 41 43 54      INTACT
        .byte   $0D,$07,$00                     ; 85DF 0D 07 00                 ...
; ----------------------------------------------------------------------------
L85E2:  jsr     L82BE                           ; 85E2 20 BE 82                  ..
        beq     L8607                           ; 85E5 F0 20                    . 
        jsr     ShowInLineText                  ; 85E7 20 5B FB                  [.
        .byte   "ROM ENVIROMENT HAS CHANGED"    ; 85EA 52 4F 4D 20 45 4E 56 49  ROM ENVI
                                                ; 85F2 52 4F 4D 45 4E 54 20 48  ROMENT H
                                                ; 85FA 41 53 20 43 48 41 4E 47  AS CHANG
                                                ; 8602 45 44                    ED
        .byte   $0D,$07,$00                     ; 8604 0D 07 00                 ...
; ----------------------------------------------------------------------------
L8607:  jsr     L889A                           ; 8607 20 9A 88                  ..
        jsr     L83F0                           ; 860A 20 F0 83                  ..
        jsr     L8644                           ; 860D 20 44 86                  D.
        stz     $0384                           ; 8610 9C 84 03                 ...
        lda     #$0E                            ; 8613 A9 0E                    ..
        sta     CursorY                         ; 8615 85 A2                    ..
        jsr     ShowInLineText                  ; 8617 20 5B FB                  [.
        .byte   "P"                             ; 861A 50                       P
L861B:  .byte   "RESS ANY KEY TO CONTINUE"      ; 861B 52 45 53 53 20 41 4E 59  RESS ANY
                                                ; 8623 20 4B 45 59 20 54 4F 20   KEY TO 
                                                ; 862B 43 4F 4E 54 49 4E 55 45  CONTINUE
        .byte   $00                             ; 8633 00                       .
; ----------------------------------------------------------------------------
        cli                                     ; 8634 58                       X
        jsr     LB2D6                           ; 8635 20 D6 B2                  ..
        jsr     LB6DF                           ; 8638 20 DF B6                  ..
        jsr     LB2E4                           ; 863B 20 E4 B2                  ..
        jsr     PrintNewLine                    ; 863E 20 D3 CA                  ..
        jmp     L843F                           ; 8641 4C 3F 84                 L?.
; ----------------------------------------------------------------------------
L8644:  cli                                     ; 8644 58                       X
L8645:  ldy     #$00                            ; 8645 A0 00                    ..
L8647:  ldx     #$02                            ; 8647 A2 02                    ..
        jsr     WaitXticks_                     ; 8649 20 E4 BF                  ..
        lda     StopKeyFlag                     ; 864C A5 AD                    ..
        bit     #$20                            ; 864E 89 20                    . 
        bne     L8653                           ; 8650 D0 01                    ..
        rts                                     ; 8652 60                       `
; ----------------------------------------------------------------------------
; Funny :)
L8653:  iny                                     ; 8653 C8                       .
        bne     L8647                           ; 8654 D0 F1                    ..
        jsr     ShowInLineText80                ; 8656 20 56 FB                  V.
        .byte   "HEY, LEAVE OFF THE BUTTON, WILL"; 8659 48 45 59 2C 20 4C 45 41 HEY, LEA
                                                ; 8661 56 45 20 4F 46 46 20 54  VE OFF T
                                                ; 8669 48 45 20 42 55 54 54 4F  HE BUTTO
                                                ; 8671 4E 2C 20 57 49 4C 4C     N, WILL
        .byte   " YA ??"                        ; 8678 20 59 41 20 3F 3F         YA ??
        .byte   $0D,$00                         ; 867E 0D 00                    ..
; ----------------------------------------------------------------------------
        jsr     LC65C                           ; 8680 20 5C C6                  \.
        bra     L8644                           ; 8683 80 BF                    ..
L8685:  stz     $0200                           ; 8685 9C 00 02                 ...
        stz     $0203                           ; 8688 9C 03 02                 ...
L868C           := * + 1
        stz     $0202                           ; 868B 9C 02 02                 ...
        jsr     KL_IOINIT                       ; 868E 20 47 87                  G.
        jsr     L87BA                           ; 8691 20 BA 87                  ..
        jsr     KL_RESTOR                       ; 8694 20 96 C6                  ..
        jsr     LFDDF                           ; 8697 20 DF FD                  ..
        jsr     L8C6F                           ; 869A 20 6F 8C                  o.
        stz     $0384                           ; 869D 9C 84 03                 ...
; Set MEMBOT vector to $0FFF
        ldy     #$0F                            ; 86A0 A0 0F                    ..
        ldx     #$FF                            ; 86A2 A2 FF                    ..
        clc                                     ; 86A4 18                       .
        jmp     MEMBOT__                        ; 86A5 4C AD D3                 L..
; ----------------------------------------------------------------------------
KL_RAMTAS:
        php                                     ; 86A8 08                       .
; D9/DA shows here the tested amount of RAM to be found OK, starts from zero
        sei                                     ; 86A9 78                       x
        stz     $D9                             ; 86AA 64 D9                    d.
        stz     $DA                             ; 86AC 64 DA                    d.
; This seems to test the zero page memory.
        ldx     #$00                            ; 86AE A2 00                    ..
L86B0:  lda     $00,x                           ; 86B0 B5 00                    ..
        ldy     #$01                            ; 86B2 A0 01                    ..
L86B4:  eor     $FF                             ; 86B4 45 FF                    E.
        sta     $00,x                           ; 86B6 95 00                    ..
        cmp     $00,x                           ; 86B8 D5 00                    ..
        bne     L86E3                           ; 86BA D0 27                    .'
        dey                                     ; 86BC 88                       .
        bpl     L86B4                           ; 86BD 10 F5                    ..
        dex                                     ; 86BF CA                       .
        bne     L86B0                           ; 86C0 D0 EE                    ..
; Test rest of the RAM, using the kernal window to page in the testable area.
L86C2:  lda     $D9                             ; 86C2 A5 D9                    ..
        ldx     $DA                             ; 86C4 A6 DA                    ..
        inc     a                               ; 86C6 1A                       .
        bne     L86CA                           ; 86C7 D0 01                    ..
        inx                                     ; 86C9 E8                       .
L86CA:  jsr     L8A87                           ; 86CA 20 87 8A                  ..
        ldy     #$00                            ; 86CD A0 00                    ..
L86CF:  lda     ($E4),y                         ; 86CF B1 E4                    ..
        ldx     #$01                            ; 86D1 A2 01                    ..
L86D3:  eor     #$FF                            ; 86D3 49 FF                    I.
        sta     ($E4),y                         ; 86D5 91 E4                    ..
        cmp     ($E4),y                         ; 86D7 D1 E4                    ..
        bne     L86E3                           ; 86D9 D0 08                    ..
        dex                                     ; 86DB CA                       .
        bpl     L86D3                           ; 86DC 10 F5                    ..
        iny                                     ; 86DE C8                       .
L86DF:  bne     L86CF                           ; 86DF D0 EE                    ..
        bra     L86C2                           ; 86E1 80 DF                    ..
L86E3:  lda     $D9                             ; 86E3 A5 D9                    ..
        ldx     $DA                             ; 86E5 A6 DA                    ..
        plp                                     ; 86E7 28                       (
        rts                                     ; 86E8 60                       `
; ----------------------------------------------------------------------------
L86E9:  jsr     L8C6F                           ; 86E9 20 6F 8C                  o.
        jsr     L86F6                           ; 86EC 20 F6 86                  ..
        sta     $02D9                           ; 86EF 8D D9 02                 ...
        sty     $02DA                           ; 86F2 8C DA 02                 ...
        rts                                     ; 86F5 60                       `
; ----------------------------------------------------------------------------
L86F6:  cld                                     ; 86F6 D8                       .
        lda     #$00                            ; 86F7 A9 00                    ..
        tay                                     ; 86F9 A8                       .
        ldx     #$D1                            ; 86FA A2 D1                    ..
L86FC:  clc                                     ; 86FC 18                       .
        adc     $0208,x                         ; 86FD 7D 08 02                 }..
        bcc     L8703                           ; 8700 90 01                    ..
        iny                                     ; 8702 C8                       .
L8703:  dex                                     ; 8703 CA                       .
        bpl     L86FC                           ; 8704 10 F6                    ..
        cmp     $02D9                           ; 8706 CD D9 02                 ...
        bne     L870E                           ; 8709 D0 03                    ..
        cpy     $02DA                           ; 870B CC DA 02                 ...
L870E:  rts                                     ; 870E 60                       `
; ----------------------------------------------------------------------------
L870F:  jsr     L8E46                           ; 870F 20 46 8E                  F.
        bcc     L8745                           ; 8712 90 31                    .1
        lda     $020A                           ; 8714 AD 0A 02                 ...
        ldx     $020B                           ; 8717 AE 0B 02                 ...
        bne     L8720                           ; 871A D0 04                    ..
        cmp     #$10                            ; 871C C9 10                    ..
        bcc     L8745                           ; 871E 90 25                    .%
L8720:  jsr     KL_RAMTAS                       ; 8720 20 A8 86                  ..
        cmp     $0208                           ; 8723 CD 08 02                 ...
        bne     L8745                           ; 8726 D0 1D                    ..
        cpx     $0209                           ; 8728 EC 09 02                 ...
        bne     L8745                           ; 872B D0 18                    ..
        cpx     $020B                           ; 872D EC 0B 02                 ...
        bcc     L8745                           ; 8730 90 13                    ..
        bne     L8739                           ; 8732 D0 05                    ..
        cmp     $020A                           ; 8734 CD 0A 02                 ...
        bcc     L8745                           ; 8737 90 0C                    ..
L8739:  cpx     #$02                            ; 8739 E0 02                    ..
        bcc     L8743                           ; 873B 90 06                    ..
        bne     L8745                           ; 873D D0 06                    ..
        cmp     #$00                            ; 873F C9 00                    ..
        bne     L8745                           ; 8741 D0 02                    ..
L8743:  clc                                     ; 8743 18                       .
        rts                                     ; 8744 60                       `
; ----------------------------------------------------------------------------
L8745:  sec                                     ; 8745 38                       8
        rts                                     ; 8746 60                       `
; ----------------------------------------------------------------------------
KL_IOINIT:
        jsr     InitIOhw                        ; 8747 20 63 87                  c.
        jsr     LB4DA                           ; 874A 20 DA B4                  ..
        ldx     #$02                            ; 874D A2 02                    ..
L874F:  stz     $0393,x                         ; 874F 9E 93 03                 ...
        dex                                     ; 8752 CA                       .
        bpl     L874F                           ; 8753 10 FA                    ..
        stz     $0385                           ; 8755 9C 85 03                 ...
        lda     #$03                            ; 8758 A9 03                    ..
        sta     L0386                           ; 875A 8D 86 03                 ...
        lda     #$FF                            ; 875D A9 FF                    ..
        sta     KernMsg                         ; 875F 8D 83 03                 ...
        rts                                     ; 8762 60                       `
; ----------------------------------------------------------------------------
InitIOhw:
; Inits VIAs, ACIA and possible other stuffs with JSRing routines.
        php                                     ; 8763 08                       .
        sei                                     ; 8764 78                       x
        lda     #$FF                            ; 8765 A9 FF                    ..
        sta     VIA1_DDRA                       ; 8767 8D 03 F8                 ...
        lda     #$3F                            ; 876A A9 3F                    .?
        sta     VIA1_DDRB                       ; 876C 8D 02 F8                 ...
        lda     #$00                            ; 876F A9 00                    ..
        sta     VIA1_PORTB                      ; 8771 8D 00 F8                 ...
        lda     #$48                            ; 8774 A9 48                    .H
L8777           := * + 1
        sta     VIA1_ACR                        ; 8776 8D 0B F8                 ...
        lda     #$A0                            ; 8779 A9 A0                    ..
L877D           := * + 2
        sta     VIA1_PCR                        ; 877B 8D 0C F8                 ...
        lda     #$1A                            ; 877E A9 1A                    ..
L8781           := * + 1
        sta     VIA1_T1LL                       ; 8780 8D 06 F8                 ...
        lda     #$41                            ; 8783 A9 41                    .A
        sta     VIA1_T1CH                       ; 8785 8D 05 F8                 ...
        lda     #$C0                            ; 8788 A9 C0                    ..
        sta     VIA1_IER                        ; 878A 8D 0E F8                 ...
        stz     VIA2_PORTA                      ; 878D 9C 81 F8                 ...
        lda     #$FF                            ; 8790 A9 FF                    ..
        sta     VIA2_DDRA                       ; 8792 8D 83 F8                 ...
        lda     #$AF                            ; 8795 A9 AF                    ..
        sta     VIA2_DDRB                       ; 8797 8D 82 F8                 ...
        lda     #$82                            ; 879A A9 82                    ..
        sta     VIA2_PORTB                      ; 879C 8D 80 F8                 ...
        lda     #$00                            ; 879F A9 00                    ..
        sta     VIA2_ACR                        ; 87A1 8D 8B F8                 ...
        lda     #$0C                            ; 87A4 A9 0C                    ..
        sta     VIA2_PCR                        ; 87A6 8D 8C F8                 ...
        lda     #$80                            ; 87A9 A9 80                    ..
        sta     VIA2_IFR                        ; 87AB 8D 8D F8                 ...
        stz     ACIA_ST                         ; 87AE 9C 81 F9                 ...
        jsr     LBFBE                           ; 87B1 20 BE BF                  ..
        sec                                     ; 87B4 38                       8
        jsr     LCDsetupGetOrSet                ; 87B5 20 28 B2                  (.
        plp                                     ; 87B8 28                       (
        rts                                     ; 87B9 60                       `
; ----------------------------------------------------------------------------
L87BA:  jsr     LB4DA                           ; 87BA 20 DA B4                  ..
        ldx     #$00                            ; 87BD A2 00                    ..
        jsr     LD230                           ; 87BF 20 30 D2                  0.
        jmp     LB1DA                           ; 87C2 4C DA B1                 L..
; ----------------------------------------------------------------------------
L87C5:  sei                                     ; 87C5 78                       x
        ldx     #$FF                            ; 87C6 A2 FF                    ..
        txs                                     ; 87C8 9A                       .
        inx                                     ; 87C9 E8                       .
L87CA:  stz     $00,x                           ; 87CA 74 00                    t.
        stz     stack,x                         ; 87CC 9E 00 01                 ...
        stz     $0200,x                         ; 87CF 9E 00 02                 ...
        stz     L0300,x                         ; 87D2 9E 00 03                 ...
        stz     $0400,x                         ; 87D5 9E 00 04                 ...
        inx                                     ; 87D8 E8                       .
        bne     L87CA                           ; 87D9 D0 EF                    ..
        jsr     L8685                           ; 87DB 20 85 86                  ..
        cli                                     ; 87DE 58                       X
        jsr     ShowInLineText                  ; 87DF 20 5B FB                  [.
        .byte   "ESTABLISHING S"                ; 87E2 45 53 54 41 42 4C 49 53  ESTABLIS
                                                ; 87EA 48 49 4E 47 20 53        HING S
L87F0:  .byte   "YST"                           ; 87F0 59 53 54                 YST
L87F3:  .byte   "EM PARAMETERS "                ; 87F3 45 4D 20 50 41 52 41 4D  EM PARAM
                                                ; 87FB 45 54 45 52 53 20        ETERS 
        .byte   $07,$0D,$00                     ; 8801 07 0D 00                 ...
; ----------------------------------------------------------------------------
L8805           := * + 1
        jsr     L82BE                           ; 8804 20 BE 82                  ..
        lda     #$0F                            ; 8807 A9 0F                    ..
L880B           := * + 2
        sta     $020C                           ; 8809 8D 0C 02                 ...
L880E           := * + 2
        jsr     KL_RAMTAS                       ; 880C 20 A8 86                  ..
L8811           := * + 2
        sta     $0208                           ; 880F 8D 08 02                 ...
        stx     $0209                           ; 8812 8E 09 02                 ...
        sta     $020A                           ; 8815 8D 0A 02                 ...
        stx     $020B                           ; 8818 8E 0B 02                 ...
        stx     $00                             ; 881B 86 00                    ..
        lsr     $00                             ; 881D 46 00                    F.
        ror     a                               ; 881F 6A                       j
        lsr     $00                             ; 8820 46 00                    F.
        ror     a                               ; 8822 6A                       j
        jsr     L8850                           ; 8823 20 50 88                  P.
        jsr     L8E5C                           ; 8826 20 5C 8E                  \.
        .byte   $20                             ; 8829 20                        
L882A:  .byte   $5B                             ; 882A 5B                       [
        .byte   $FB                             ; 882B FB                       .
        .byte   " "                             ; 882C 20                        
L882D:  .byte   "KBYTE SYSTEM ESTABLI"          ; 882D 4B 42 59 54 45 20 53 59  KBYTE SY
                                                ; 8835 53 54 45 4D 20 45 53 54  STEM EST
                                                ; 883D 41 42 4C 49              ABLI
L8841:  .byte   "SHE"                           ; 8841 53 48 45                 SHE
L8844:  .byte   "D"                             ; 8844 44                       D
        .byte   $0D,$00                         ; 8845 0D 00                    ..
; ----------------------------------------------------------------------------
        jsr     LD411                           ; 8847 20 11 D4                  ..
        jsr     L8644                           ; 884A 20 44 86                  D.
        jmp     L843F                           ; 884D 4C 3F 84                 L?.
; ----------------------------------------------------------------------------
L8850:  jsr     L886A                           ; 8850 20 6A 88                  j.
        pha                                     ; 8853 48                       H
        phx                                     ; 8854 DA                       .
        tya                                     ; 8855 98                       .
        bne     L885D                           ; 8856 D0 05                    ..
        pla                                     ; 8858 68                       h
        bne     L8861                           ; 8859 D0 06                    ..
        beq     L8864                           ; 885B F0 07                    ..
L885D:  jsr     L8865                           ; 885D 20 65 88                  e.
        pla                                     ; 8860 68                       h
L8861:  jsr     L8865                           ; 8861 20 65 88                  e.
L8864:  pla                                     ; 8864 68                       h
L8865:  ora     #$30                            ; 8865 09 30                    .0
        jmp     ShowChar_                       ; 8867 4C B3 AB                 L..
; ----------------------------------------------------------------------------
L886A:  ldy     #$FF                            ; 886A A0 FF                    ..
        cld                                     ; 886C D8                       .
        sec                                     ; 886D 38                       8
L886E:  iny                                     ; 886E C8                       .
        sbc     #$64                            ; 886F E9 64                    .d
        bcs     L886E                           ; 8871 B0 FB                    ..
        adc     #$64                            ; 8873 69 64                    id
        ldx     #$FF                            ; 8875 A2 FF                    ..
L8877:  inx                                     ; 8877 E8                       .
        sbc     #$0A                            ; 8878 E9 0A                    ..
        bcs     L8877                           ; 887A B0 FB                    ..
        adc     #$0A                            ; 887C 69 0A                    i.
        rts                                     ; 887E 60                       `
; ----------------------------------------------------------------------------
L887F:  clc                                     ; 887F 18                       .
        jsr     L88C2                           ; 8880 20 C2 88                  ..
        bit     $0384                           ; 8883 2C 84 03                 ,..
        bvc     L8896                           ; 8886 50 0E                    P.
        ldy     #$02                            ; 8888 A0 02                    ..
L888A:  lda     ($E4),y                         ; 888A B1 E4                    ..
        sta     $037A,y                         ; 888C 99 7A 03                 .z.
        dey                                     ; 888F 88                       .
        bpl     L888A                           ; 8890 10 F8                    ..
        sec                                     ; 8892 38                       8
        jsr     LCDsetupGetOrSet                ; 8893 20 28 B2                  (.
L8896:  stz     $0384                           ; 8896 9C 84 03                 ...
        rts                                     ; 8899 60                       `
; ----------------------------------------------------------------------------
L889A:  jsr     LBE69                           ; 889A 20 69 BE                  i.
        sec                                     ; 889D 38                       8
        jsr     L88C2                           ; 889E 20 C2 88                  ..
        bit     $0384                           ; 88A1 2C 84 03                 ,..
        bvc     L88BF                           ; 88A4 50 19                    P.
        lda     #$93                            ; 88A6 A9 93                    ..
        jsr     ShowChar_                       ; 88A8 20 B3 AB                  ..
        ldy     #$02                            ; 88AB A0 02                    ..
L88AD:  lda     $037A,y                         ; 88AD B9 7A 03                 .z.
        sta     ($E4),y                         ; 88B0 91 E4                    ..
        dey                                     ; 88B2 88                       .
        bpl     L88AD                           ; 88B3 10 F8                    ..
        and     #$01                            ; 88B5 29 01                    ).
        ldy     VidMemHi                        ; 88B7 A4 A0                    ..
        ldx     #$00                            ; 88B9 A2 00                    ..
        clc                                     ; 88BB 18                       .
        jsr     LCDsetupGetOrSet                ; 88BC 20 28 B2                  (.
L88BF:  jmp     KL_RESTOR                       ; 88BF 4C 96 C6                 L..
; ----------------------------------------------------------------------------
L88C2:  ldx     #$C0                            ; 88C2 A2 C0                    ..
        ldy     #$04                            ; 88C4 A0 04                    ..
        jsr     KL_VECTOR                       ; 88C6 20 9B C6                  ..
        lda     $020C                           ; 88C9 AD 0C 02                 ...
        ldx     $020D                           ; 88CC AE 0D 02                 ...
        inc     a                               ; 88CF 1A                       .
        bne     L88D3                           ; 88D0 D0 01                    ..
        inx                                     ; 88D2 E8                       .
L88D3:  cpx     $020B                           ; 88D3 EC 0B 02                 ...
        bcc     L88E5                           ; 88D6 90 0D                    ..
        bne     L88DF                           ; 88D8 D0 05                    ..
        cmp     $020A                           ; 88DA CD 0A 02                 ...
        bcc     L88E5                           ; 88DD 90 06                    ..
L88DF:  lda     #$80                            ; 88DF A9 80                    ..
        sta     $0384                           ; 88E1 8D 84 03                 ...
        rts                                     ; 88E4 60                       `
; ----------------------------------------------------------------------------
L88E5:  jsr     L8A87                           ; 88E5 20 87 8A                  ..
        lda     #$FF                            ; 88E8 A9 FF                    ..
        sta     $0384                           ; 88EA 8D 84 03                 ...
        lda     #$05                            ; 88ED A9 05                    ..
        sta     $03E7                           ; 88EF 8D E7 03                 ...
        ldy     #$FF                            ; 88F2 A0 FF                    ..
L88F4:  phy                                     ; 88F4 5A                       Z
        clc                                     ; 88F5 18                       .
        cld                                     ; 88F6 D8                       .
        lda     $03E7                           ; 88F7 AD E7 03                 ...
        adc     #$04                            ; 88FA 69 04                    i.
        tax                                     ; 88FC AA                       .
        ldy     #$13                            ; 88FD A0 13                    ..
        sec                                     ; 88FF 38                       8
        jsr     LB6F9                           ; 8900 20 F9 B6                  ..
        ply                                     ; 8903 7A                       z
        ldx     #$29                            ; 8904 A2 29                    .)
L8906:  phy                                     ; 8906 5A                       Z
        lda     ($E4),y                         ; 8907 B1 E4                    ..
        pha                                     ; 8909 48                       H
        phy                                     ; 890A 5A                       Z
        txa                                     ; 890B 8A                       .
        tay                                     ; 890C A8                       .
        lda     ($BD),y                         ; 890D B1 BD                    ..
        ply                                     ; 890F 7A                       z
        sta     ($E4),y                         ; 8910 91 E4                    ..
        txa                                     ; 8912 8A                       .
        tay                                     ; 8913 A8                       .
        pla                                     ; 8914 68                       h
        sta     ($BD),y                         ; 8915 91 BD                    ..
        ply                                     ; 8917 7A                       z
        dey                                     ; 8918 88                       .
        dex                                     ; 8919 CA                       .
        bpl     L8906                           ; 891A 10 EA                    ..
        dec     $03E7                           ; 891C CE E7 03                 ...
        bpl     L88F4                           ; 891F 10 D3                    ..
        rts                                     ; 8921 60                       `
; ----------------------------------------------------------------------------
L8922:  lda     #$05                            ; 8922 A9 05                    ..
        sta     $03E7                           ; 8924 8D E7 03                 ...
        ldx     #$A4                            ; 8927 A2 A4                    ..
L8929:  jsr     L893C                           ; 8929 20 3C 89                  <.
        ldx     #$0D                            ; 892C A2 0D                    ..
        dec     $03E7                           ; 892E CE E7 03                 ...
        bne     L8929                           ; 8931 D0 F6                    ..
        ldx     #$A3                            ; 8933 A2 A3                    ..
        jsr     L893C                           ; 8935 20 3C 89                  <.
        lda     #$0D                            ; 8938 A9 0D                    ..
        bra     L8948                           ; 893A 80 0C                    ..
L893C:  phx                                     ; 893C DA                       .
        jsr     L8964                           ; 893D 20 64 89                  d.
        plx                                     ; 8940 FA                       .
L8941:  txa                                     ; 8941 8A                       .
        jsr     L897C                           ; 8942 20 7C 89                  |.
        bcc     L8941                           ; 8945 90 FA                    ..
        rts                                     ; 8947 60                       `
; ----------------------------------------------------------------------------
L8948:  cmp     #$07                            ; 8948 C9 07                    ..
        bne     L894F                           ; 894A D0 03                    ..
        jmp     LC65C                           ; 894C 4C 5C C6                 L\.
; ----------------------------------------------------------------------------
L894F:  cmp     #$93                            ; 894F C9 93                    ..
        beq     L8922                           ; 8951 F0 CF                    ..
        cmp     #$0D                            ; 8953 C9 0D                    ..
        bne     L897C                           ; 8955 D0 25                    .%
        .byte   $20                             ; 8957 20                        
        .byte   $7C                             ; 8958 7C                       |
L8959:  bit     #$AD                            ; 8959 89 AD                    ..
        smb6    $03                             ; 895B E7 03                    ..
        cmp     #$04                            ; 895D C9 04                    ..
        bcs     L8980                           ; 895F B0 1F                    ..
        inc     $03E7                           ; 8961 EE E7 03                 ...
L8964:  clc                                     ; 8964 18                       .
        cld                                     ; 8965 D8                       .
        lda     $03E7                           ; 8966 AD E7 03                 ...
        adc     #$04                            ; 8969 69 04                    i.
        tax                                     ; 896B AA                       .
        ldy     #$13                            ; 896C A0 13                    ..
        lda     #$29                            ; 896E A9 29                    .)
        pha                                     ; 8970 48                       H
        sec                                     ; 8971 38                       8
        jsr     LB6F9                           ; 8972 20 F9 B6                  ..
        lda     #$65                            ; 8975 A9 65                    .e
        ply                                     ; 8977 7A                       z
        sta     ($BD),y                         ; 8978 91 BD                    ..
        lda     #$A7                            ; 897A A9 A7                    ..
L897C:  clc                                     ; 897C 18                       .
        jmp     LB6F9                           ; 897D 4C F9 B6                 L..
; ----------------------------------------------------------------------------
L8980:  stz     $03E7                           ; 8980 9C E7 03                 ...
L8983:  inc     $03E7                           ; 8983 EE E7 03                 ...
        jsr     L8964                           ; 8986 20 64 89                  d.
        lda     $03E7                           ; 8989 AD E7 03                 ...
        cmp     #$04                            ; 898C C9 04                    ..
        beq     L89A1                           ; 898E F0 11                    ..
        ldy     #$AA                            ; 8990 A0 AA                    ..
L8992:  lda     ($BD),y                         ; 8992 B1 BD                    ..
        jsr     L89A8                           ; 8994 20 A8 89                  ..
        sta     ($BD),y                         ; 8997 91 BD                    ..
        jsr     L89A8                           ; 8999 20 A8 89                  ..
        dey                                     ; 899C 88                       .
        bmi     L8992                           ; 899D 30 F3                    0.
        bra     L8983                           ; 899F 80 E2                    ..
L89A1:  lda     #$0D                            ; 89A1 A9 0D                    ..
        jsr     L897C                           ; 89A3 20 7C 89                  |.
        bra     L8964                           ; 89A6 80 BC                    ..
L89A8:  tax                                     ; 89A8 AA                       .
        tya                                     ; 89A9 98                       .
        eor     #$80                            ; 89AA 49 80                    I.
        tay                                     ; 89AC A8                       .
        txa                                     ; 89AD 8A                       .
        rts                                     ; 89AE 60                       `
; ----------------------------------------------------------------------------
L89AF:  jsr     L8A39                           ; 89AF 20 39 8A                  9.
        bcs     L89B5                           ; 89B2 B0 01                    ..
        rts                                     ; 89B4 60                       `
; ----------------------------------------------------------------------------
L89B5:  lda     $020A                           ; 89B5 AD 0A 02                 ...
L89B8:  bne     L89BD                           ; 89B8 D0 03                    ..
        dec     $020B                           ; 89BA CE 0B 02                 ...
L89BD:  dec     $020A                           ; 89BD CE 0A 02                 ...
        jsr     LD3F6                           ; 89C0 20 F6 D3                  ..
        jmp     L8A81                           ; 89C3 4C 81 8A                 L..
; ----------------------------------------------------------------------------
L89C6:  jsr     L89AF                           ; 89C6 20 AF 89                  ..
        bcc     L89E1                           ; 89C9 90 16                    ..
        lda     $E8                             ; 89CB A5 E8                    ..
        sta     $020E                           ; 89CD 8D 0E 02                 ...
        sta     ($E4)                           ; 89D0 92 E4                    ..
        lda     $E9                             ; 89D2 A5 E9                    ..
        sta     $020F                           ; 89D4 8D 0F 02                 ...
        ldy     #$01                            ; 89D7 A0 01                    ..
        sta     ($E4),y                         ; 89D9 91 E4                    ..
        iny                                     ; 89DB C8                       .
        lda     #$02                            ; 89DC A9 02                    ..
        sta     ($E4),y                         ; 89DE 91 E4                    ..
        sec                                     ; 89E0 38                       8
L89E1:  rts                                     ; 89E1 60                       `
; ----------------------------------------------------------------------------
L89E2:  jsr     L8A81                           ; 89E2 20 81 8A                  ..
L89E5:  lda     $020E                           ; 89E5 AD 0E 02                 ...
        cmp     $0219                           ; 89E8 CD 19 02                 ...
        bne     L89F2                           ; 89EB D0 05                    ..
        jsr     L89FF                           ; 89ED 20 FF 89                  ..
        bra     L89E2                           ; 89F0 80 F0                    ..
L89F2:  jsr     L8A61                           ; 89F2 20 61 8A                  a.
        bcs     L89E5                           ; 89F5 B0 EE                    ..
        sec                                     ; 89F7 38                       8
        rts                                     ; 89F8 60                       `
; ----------------------------------------------------------------------------
L89F9:  jsr     L8AD5                           ; 89F9 20 D5 8A                  ..
        bcs     L89FF                           ; 89FC B0 01                    ..
        rts                                     ; 89FE 60                       `
; ----------------------------------------------------------------------------
L89FF:  lda     $0216                           ; 89FF AD 16 02                 ...
        pha                                     ; 8A02 48                       H
        lda     $E5                             ; 8A03 A5 E5                    ..
        pha                                     ; 8A05 48                       H
        jsr     L8A81                           ; 8A06 20 81 8A                  ..
        stz     $D9                             ; 8A09 64 D9                    d.
        pla                                     ; 8A0B 68                       h
        sta     $DA                             ; 8A0C 85 DA                    ..
        ldy     #$00                            ; 8A0E A0 00                    ..
L8A10:  lda     ($E4),y                         ; 8A10 B1 E4                    ..
        tax                                     ; 8A12 AA                       .
        pla                                     ; 8A13 68                       h
L8A14:  pha                                     ; 8A14 48                       H
        sta     MMU_KERN_WINDOW                 ; 8A15 8D 00 FF                 ...
        lda     ($D9),y                         ; 8A18 B1 D9                    ..
L8A1A:  pha                                     ; 8A1A 48                       H
        txa                                     ; 8A1B 8A                       .
        sta     ($D9),y                         ; 8A1C 91 D9                    ..
        .byte   $AD                             ; 8A1E AD                       .
        .byte   $16                             ; 8A1F 16                       .
L8A20:  .byte   $02                             ; 8A20 02                       .
        .byte   $8D                             ; 8A21 8D                       .
        brk                                     ; 8A22 00                       .
L8A23:  bbs7    $68,$68                         ; 8A23 FF 68 91                 .h.
        cpx     $C8                             ; 8A26 E4 C8                    ..
        bne     L8A10                           ; 8A28 D0 E6                    ..
        pla                                     ; 8A2A 68                       h
        inc     $020A                           ; 8A2B EE 0A 02                 ...
        bne     L8A33                           ; 8A2E D0 03                    ..
        inc     $020B                           ; 8A30 EE 0B 02                 ...
L8A33:  jsr     LD3F6                           ; 8A33 20 F6 D3                  ..
        jmp     L8A81                           ; 8A36 4C 81 8A                 L..
; ----------------------------------------------------------------------------
L8A39:  ldx     $020B                           ; 8A39 AE 0B 02                 ...
        lda     $020A                           ; 8A3C AD 0A 02                 ...
        bne     L8A42                           ; 8A3F D0 01                    ..
        dex                                     ; 8A41 CA                       .
L8A42:  dec     a                               ; 8A42 3A                       :
        cpx     $020D                           ; 8A43 EC 0D 02                 ...
        bne     L8A4E                           ; 8A46 D0 06                    ..
        cmp     $020C                           ; 8A48 CD 0C 02                 ...
        bne     L8A4E                           ; 8A4B D0 01                    ..
        clc                                     ; 8A4D 18                       .
L8A4E:  lda     #$19                            ; 8A4E A9 19                    ..
        rts                                     ; 8A50 60                       `
; ----------------------------------------------------------------------------
        cld                                     ; 8A51 D8                       .
        sec                                     ; 8A52 38                       8
        lda     $0208                           ; 8A53 AD 08 02                 ...
        sbc     $020A                           ; 8A56 ED 0A 02                 ...
        tax                                     ; 8A59 AA                       .
        lda     $0209                           ; 8A5A AD 09 02                 ...
        sbc     $020B                           ; 8A5D ED 0B 02                 ...
        rts                                     ; 8A60 60                       `
; ----------------------------------------------------------------------------
L8A61:  ldx     $DA                             ; 8A61 A6 DA                    ..
        lda     $D9                             ; 8A63 A5 D9                    ..
        inc     a                               ; 8A65 1A                       .
        bne     L8A69                           ; 8A66 D0 01                    ..
        inx                                     ; 8A68 E8                       .
L8A69:  cpx     $0209                           ; 8A69 EC 09 02                 ...
        bcc     L8A77                           ; 8A6C 90 09                    ..
        bne     L8A75                           ; 8A6E D0 05                    ..
        cmp     $0208                           ; 8A70 CD 08 02                 ...
        bcc     L8A77                           ; 8A73 90 02                    ..
L8A75:  clc                                     ; 8A75 18                       .
        rts                                     ; 8A76 60                       `
; ----------------------------------------------------------------------------
L8A77:  stx     $DA                             ; 8A77 86 DA                    ..
        sta     $D9                             ; 8A79 85 D9                    ..
        inc     $E5                             ; 8A7B E6 E5                    ..
        bmi     L8A87                           ; 8A7D 30 08                    0.
        bra     L8AA9                           ; 8A7F 80 28                    .(
L8A81:  ldx     $020B                           ; 8A81 AE 0B 02                 ...
L8A84:  lda     $020A                           ; 8A84 AD 0A 02                 ...
L8A87:  sta     $D9                             ; 8A87 85 D9                    ..
        stx     $DA                             ; 8A89 86 DA                    ..
        sec                                     ; 8A8B 38                       8
        cld                                     ; 8A8C D8                       .
        sbc     #$40                            ; 8A8D E9 40                    .@
        bcs     L8A92                           ; 8A8F B0 01                    ..
        dex                                     ; 8A91 CA                       .
L8A92:  sta     $E5                             ; 8A92 85 E5                    ..
        txa                                     ; 8A94 8A                       .
        asl     $E5                             ; 8A95 06 E5                    ..
        rol     a                               ; 8A97 2A                       *
        asl     $E5                             ; 8A98 06 E5                    ..
        rol     a                               ; 8A9A 2A                       *
        asl     a                               ; 8A9B 0A                       .
        asl     a                               ; 8A9C 0A                       .
        asl     a                               ; 8A9D 0A                       .
        asl     a                               ; 8A9E 0A                       .
        sta     $0216                           ; 8A9F 8D 16 02                 ...
        sec                                     ; 8AA2 38                       8
        ror     $E5                             ; 8AA3 66 E5                    f.
        lsr     $E5                             ; 8AA5 46 E5                    F.
        stz     $E4                             ; 8AA7 64 E4                    d.
L8AA9:  lda     $0216                           ; 8AA9 AD 16 02                 ...
        sta     MMU_KERN_WINDOW                 ; 8AAC 8D 00 FF                 ...
L8AAF:  ldy     #$01                            ; 8AAF A0 01                    ..
        lda     ($E4)                           ; 8AB1 B2 E4                    ..
        tax                                     ; 8AB3 AA                       .
        sta     $020E                           ; 8AB4 8D 0E 02                 ...
        lda     ($E4),y                         ; 8AB7 B1 E4                    ..
        tay                                     ; 8AB9 A8                       .
        lda     $020A                           ; 8ABA AD 0A 02                 ...
        eor     $0208                           ; 8ABD 4D 08 02                 M..
        bne     L8ACD                           ; 8AC0 D0 0B                    ..
        lda     $020B                           ; 8AC2 AD 0B 02                 ...
        eor     $0209                           ; 8AC5 4D 09 02                 M..
        bne     L8ACD                           ; 8AC8 D0 03                    ..
        ldy     #$FF                            ; 8ACA A0 FF                    ..
        tax                                     ; 8ACC AA                       .
L8ACD:  stx     $020E                           ; 8ACD 8E 0E 02                 ...
        sty     $020F                           ; 8AD0 8C 0F 02                 ...
        sec                                     ; 8AD3 38                       8
        rts                                     ; 8AD4 60                       `
; ----------------------------------------------------------------------------
L8AD5:  jsr     L8AA9                           ; 8AD5 20 A9 8A                  ..
        jsr     L8AEE                           ; 8AD8 20 EE 8A                  ..
        beq     L8AFA                           ; 8ADB F0 1D                    ..
        jsr     L8A81                           ; 8ADD 20 81 8A                  ..
L8AE0:  jsr     L8AEE                           ; 8AE0 20 EE 8A                  ..
        beq     L8AFA                           ; 8AE3 F0 15                    ..
        jsr     L8A61                           ; 8AE5 20 61 8A                  a.
        bcs     L8AE0                           ; 8AE8 B0 F6                    ..
        clc                                     ; 8AEA 18                       .
        lda     #$14                            ; 8AEB A9 14                    ..
        rts                                     ; 8AED 60                       `
; ----------------------------------------------------------------------------
L8AEE:  lda     $E8                             ; 8AEE A5 E8                    ..
        cmp     $020E                           ; 8AF0 CD 0E 02                 ...
        bne     L8AFA                           ; 8AF3 D0 05                    ..
        lda     $E9                             ; 8AF5 A5 E9                    ..
        cmp     $020F                           ; 8AF7 CD 0F 02                 ...
L8AFA:  rts                                     ; 8AFA 60                       `
; ----------------------------------------------------------------------------
        cpx     $DA                             ; 8AFB E4 DA                    ..
        bne     L8B08                           ; 8AFD D0 09                    ..
        cmp     $D9                             ; 8AFF C5 D9                    ..
        bne     L8B08                           ; 8B01 D0 05                    ..
        jsr     L8AA9                           ; 8B03 20 A9 8A                  ..
        bra     L8B0B                           ; 8B06 80 03                    ..
L8B08:  jsr     L8A87                           ; 8B08 20 87 8A                  ..
L8B0B:  stz     $020E                           ; 8B0B 9C 0E 02                 ...
        stz     $020F                           ; 8B0E 9C 0F 02                 ...
        sec                                     ; 8B11 38                       8
        rts                                     ; 8B12 60                       `
; ----------------------------------------------------------------------------
L8B13:  lda     $0207                           ; 8B13 AD 07 02                 ...
        bne     L8B1D                           ; 8B16 D0 05                    ..
        inc     $0207                           ; 8B18 EE 07 02                 ...
        bra     L8B13                           ; 8B1B 80 F6                    ..
L8B1D:  pha                                     ; 8B1D 48                       H
        jsr     L8DBE                           ; 8B1E 20 BE 8D                  ..
        pla                                     ; 8B21 68                       h
        bcs     L8B27                           ; 8B22 B0 03                    ..
        sec                                     ; 8B24 38                       8
        bra     L8B31                           ; 8B25 80 0A                    ..
L8B27:  inc     a                               ; 8B27 1A                       .
        bne     L8B2B                           ; 8B28 D0 01                    ..
        inc     a                               ; 8B2A 1A                       .
L8B2B:  cmp     $0207                           ; 8B2B CD 07 02                 ...
        bne     L8B1D                           ; 8B2E D0 ED                    ..
        clc                                     ; 8B30 18                       .
L8B31:  sta     $0207                           ; 8B31 8D 07 02                 ...
        sta     $0219                           ; 8B34 8D 19 02                 ...
        lda     #$48                            ; 8B37 A9 48                    .H
        rts                                     ; 8B39 60                       `
; ----------------------------------------------------------------------------
L8B3A:  .byte   $20                             ; 8B3A 20                        
        rti                                     ; 8B3B 40                       @
; ----------------------------------------------------------------------------
L8B3C:  .byte   $8B                             ; 8B3C 8B                       .
        .byte   $4C                             ; 8B3D 4C                       L
        .byte   $3F                             ; 8B3E 3F                       ?
L8B3F:  .byte   $99                             ; 8B3F 99                       .
L8B40:  jsr     L8C36                           ; 8B40 20 36 8C                  6.
        bcs     L8B46                           ; 8B43 B0 01                    ..
        rts                                     ; 8B45 60                       `
; ----------------------------------------------------------------------------
L8B46:  lda     $E7                             ; 8B46 A5 E7                    ..
        bit     #$10                            ; 8B48 89 10                    ..
        bne     L8B50                           ; 8B4A D0 04                    ..
        lda     #$3D                            ; 8B4C A9 3D                    .=
        clc                                     ; 8B4E 18                       .
        rts                                     ; 8B4F 60                       `
; ----------------------------------------------------------------------------
L8B50:  lda     $E6                             ; 8B50 A5 E6                    ..
        cmp     #$0F                            ; 8B52 C9 0F                    ..
        bne     L8B59                           ; 8B54 D0 03                    ..
        jmp     L9AA5                           ; 8B56 4C A5 9A                 L..
; ----------------------------------------------------------------------------
L8B59:  lda     $E7                             ; 8B59 A5 E7                    ..
        bit     #$80                            ; 8B5B 89 80                    ..
        bne     L8BA0                           ; 8B5D D0 41                    .A
        lda     $E8                             ; 8B5F A5 E8                    ..
        bne     L8B66                           ; 8B61 D0 03                    ..
        jmp     L939A                           ; 8B63 4C 9A 93                 L..
; ----------------------------------------------------------------------------
L8B66:  stz     $039D                           ; 8B66 9C 9D 03                 ...
        lda     $EA                             ; 8B69 A5 EA                    ..
        bne     L8B7F                           ; 8B6B D0 12                    ..
        jsr     L8AD5                           ; 8B6D 20 D5 8A                  ..
        bcs     L8B7B                           ; 8B70 B0 09                    ..
        dec     $039D                           ; 8B72 CE 9D 03                 ...
        lda     #$0D                            ; 8B75 A9 0D                    ..
        sec                                     ; 8B77 38                       8
        rts                                     ; 8B78 60                       `
; ----------------------------------------------------------------------------
L8B79:  inc     $E9                             ; 8B79 E6 E9                    ..
L8B7B:  lda     #$02                            ; 8B7B A9 02                    ..
        sta     $EA                             ; 8B7D 85 EA                    ..
L8B7F:  jsr     L8AD5                           ; 8B7F 20 D5 8A                  ..
        bcc     L8B9F                           ; 8B82 90 1B                    ..
        ldy     #$02                            ; 8B84 A0 02                    ..
        lda     ($E4),y                         ; 8B86 B1 E4                    ..
        beq     L8B8E                           ; 8B88 F0 04                    ..
        cmp     $EA                             ; 8B8A C5 EA                    ..
        beq     L8B92                           ; 8B8C F0 04                    ..
L8B8E:  inc     $EA                             ; 8B8E E6 EA                    ..
        beq     L8B79                           ; 8B90 F0 E7                    ..
L8B92:  lda     $EA                             ; 8B92 A5 EA                    ..
        cmp     ($E4),y                         ; 8B94 D1 E4                    ..
        bne     L8B9B                           ; 8B96 D0 03                    ..
        ror     $039D                           ; 8B98 6E 9D 03                 n..
L8B9B:  tay                                     ; 8B9B A8                       .
        lda     ($E4),y                         ; 8B9C B1 E4                    ..
        sec                                     ; 8B9E 38                       8
L8B9F:  rts                                     ; 8B9F 60                       `
; ----------------------------------------------------------------------------
L8BA0:  lda     #$0D                            ; 8BA0 A9 0D                    ..
        stz     $039D                           ; 8BA2 9C 9D 03                 ...
        dec     $039D                           ; 8BA5 CE 9D 03                 ...
        sec                                     ; 8BA8 38                       8
        rts                                     ; 8BA9 60                       `
; ----------------------------------------------------------------------------
L8BAA:  jsr     L8BB0                           ; 8BAA 20 B0 8B                  ..
        jmp     L993F                           ; 8BAD 4C 3F 99                 L?.
; ----------------------------------------------------------------------------
L8BB0:  sta     $039E                           ; 8BB0 8D 9E 03                 ...
        jsr     L8C36                           ; 8BB3 20 36 8C                  6.
        bcs     L8BB9                           ; 8BB6 B0 01                    ..
        rts                                     ; 8BB8 60                       `
; ----------------------------------------------------------------------------
L8BB9:  lda     $E7                             ; 8BB9 A5 E7                    ..
        bit     #$20                            ; 8BBB 89 20                    . 
        bne     L8BC3                           ; 8BBD D0 04                    ..
        lda     #$3D                            ; 8BBF A9 3D                    .=
L8BC1:  clc                                     ; 8BC1 18                       .
        rts                                     ; 8BC2 60                       `
; ----------------------------------------------------------------------------
L8BC3:  bit     #$80                            ; 8BC3 89 80                    ..
        beq     L8BCB                           ; 8BC5 F0 04                    ..
L8BC7:  lda     #$49                            ; 8BC7 A9 49                    .I
        bra     L8BC1                           ; 8BC9 80 F6                    ..
L8BCB:  lda     $E6                             ; 8BCB A5 E6                    ..
        cmp     #$0F                            ; 8BCD C9 0F                    ..
        bne     L8BD7                           ; 8BCF D0 06                    ..
        jmp     L975D                           ; 8BD1 4C 5D 97                 L].
; ----------------------------------------------------------------------------
L8BD4:  sta     $039E                           ; 8BD4 8D 9E 03                 ...
L8BD7:  lda     $EA                             ; 8BD7 A5 EA                    ..
        bne     L8BE1                           ; 8BD9 D0 06                    ..
        jsr     L8A39                           ; 8BDB 20 39 8A                  9.
        bcs     L8BF7                           ; 8BDE B0 17                    ..
        rts                                     ; 8BE0 60                       `
; ----------------------------------------------------------------------------
L8BE1:  inc     $EA                             ; 8BE1 E6 EA                    ..
        bne     L8BFE                           ; 8BE3 D0 19                    ..
        jsr     L8A39                           ; 8BE5 20 39 8A                  9.
        bcc     L8C0E                           ; 8BE8 90 24                    .$
        jsr     L8AD5                           ; 8BEA 20 D5 8A                  ..
        bcc     L8C0E                           ; 8BED 90 1F                    ..
        ldy     #$02                            ; 8BEF A0 02                    ..
        lda     #$00                            ; 8BF1 A9 00                    ..
L8BF3:  sta     ($E4),y                         ; 8BF3 91 E4                    ..
        inc     $E9                             ; 8BF5 E6 E9                    ..
L8BF7:  ldy     #$03                            ; 8BF7 A0 03                    ..
        sty     $EA                             ; 8BF9 84 EA                    ..
        jsr     L89C6                           ; 8BFB 20 C6 89                  ..
L8BFE:  jsr     L8AD5                           ; 8BFE 20 D5 8A                  ..
        ldy     #$02                            ; 8C01 A0 02                    ..
        lda     $EA                             ; 8C03 A5 EA                    ..
        sta     ($E4),y                         ; 8C05 91 E4                    ..
        tay                                     ; 8C07 A8                       .
        lda     $039E                           ; 8C08 AD 9E 03                 ...
        sta     ($E4),y                         ; 8C0B 91 E4                    ..
        sec                                     ; 8C0D 38                       8
L8C0E:  rts                                     ; 8C0E 60                       `
; ----------------------------------------------------------------------------
L8C0F:  pha                                     ; 8C0F 48                       H
        lda     $EA                             ; 8C10 A5 EA                    ..
L8C12:  inc     a                               ; 8C12 1A                       .
        bne     L8C17                           ; 8C13 D0 02                    ..
        inc     $E9                             ; 8C15 E6 E9                    ..
L8C17:  cmp     #$03                            ; 8C17 C9 03                    ..
        bcc     L8C12                           ; 8C19 90 F7                    ..
L8C1B:  sta     $EA                             ; 8C1B 85 EA                    ..
        jsr     L8AD5                           ; 8C1D 20 D5 8A                  ..
        pla                                     ; 8C20 68                       h
        bcc     L8C27                           ; 8C21 90 04                    ..
        ldy     $EA                             ; 8C23 A4 EA                    ..
        sta     ($E4),y                         ; 8C25 91 E4                    ..
L8C27:  lda     #$47                            ; 8C27 A9 47                    .G
        rts                                     ; 8C29 60                       `
; ----------------------------------------------------------------------------
L8C2A:  .byte   $20                             ; 8C2A 20                        
L8C2B:  .byte   $3B                             ; 8C2B 3B                       ;
        sty     $894C                           ; 8C2C 8C 4C 89                 .L.
        .byte   $8C                             ; 8C2F 8C                       .
L8C30:  jsr     L8C3E                           ; 8C30 20 3E 8C                  >.
        jmp     L8C89                           ; 8C33 4C 89 8C                 L..
; ----------------------------------------------------------------------------
L8C36:  lda     LFS2ndAddr                      ; 8C36 A5 C4                    ..
        and     #$0F                            ; 8C38 29 0F                    ).
L8C3A:  .byte   $2C                             ; 8C3A 2C                       ,
L8C3B:  lda     #$11                            ; 8C3B A9 11                    ..
        .byte   $2C                             ; 8C3D 2C                       ,
L8C3E:  lda     #$10                            ; 8C3E A9 10                    ..
L8C40:  cmp     $E6                             ; 8C40 C5 E6                    ..
        beq     L8C66                           ; 8C42 F0 22                    ."
        pha                                     ; 8C44 48                       H
        lda     $E6                             ; 8C45 A5 E6                    ..
        jsr     L8C4D                           ; 8C47 20 4D 8C                  M.
L8C4A:  pla                                     ; 8C4A 68                       h
        sta     $E6                             ; 8C4B 85 E6                    ..
L8C4D:  inc     a                               ; 8C4D 1A                       .
        asl     a                               ; 8C4E 0A                       .
        asl     a                               ; 8C4F 0A                       .
        dec     a                               ; 8C50 3A                       :
        tax                                     ; 8C51 AA                       .
        ldy     #$03                            ; 8C52 A0 03                    ..
L8C54:  lda     $E7,y                           ; 8C54 B9 E7 00                 ...
        pha                                     ; 8C57 48                       H
        lda     $024D,x                         ; 8C58 BD 4D 02                 .M.
        sta     $E7,y                           ; 8C5B 99 E7 00                 ...
        pla                                     ; 8C5E 68                       h
        sta     $024D,x                         ; 8C5F 9D 4D 02                 .M.
        dex                                     ; 8C62 CA                       .
        dey                                     ; 8C63 88                       .
        bpl     L8C54                           ; 8C64 10 EE                    ..
L8C66:  lda     #$46                            ; 8C66 A9 46                    .F
L8C68:  clc                                     ; 8C68 18                       .
        ldx     $E7                             ; 8C69 A6 E7                    ..
        beq     L8C6E                           ; 8C6B F0 01                    ..
        sec                                     ; 8C6D 38                       8
L8C6E:  rts                                     ; 8C6E 60                       `
; ----------------------------------------------------------------------------
L8C6F:  lda     #$0E                            ; 8C6F A9 0E                    ..
        jsr     L8C40                           ; 8C71 20 40 8C                  @.
        ldx     #$47                            ; 8C74 A2 47                    .G
L8C76:  .byte   $9E                             ; 8C76 9E                       .
L8C77:  eor     $CA02                           ; 8C77 4D 02 CA                 M..
L8C7A:  bpl     L8C76                           ; 8C7A 10 FA                    ..
        stz     $02D5                           ; 8C7C 9C D5 02                 ...
        inx                                     ; 8C7F E8                       .
        txa                                     ; 8C80 8A                       .
        tay                                     ; 8C81 A8                       .
        sec                                     ; 8C82 38                       8
        jmp     L9964                           ; 8C83 4C 64 99                 Ld.
; ----------------------------------------------------------------------------
L8C86:  jsr     L8C36                           ; 8C86 20 36 8C                  6.
L8C89:  ldx     #$03                            ; 8C89 A2 03                    ..
L8C8B:  stz     $E7,x                           ; 8C8B 74 E7                    t.
        dex                                     ; 8C8D CA                       .
        bpl     L8C8B                           ; 8C8E 10 FB                    ..
        sec                                     ; 8C90 38                       8
        rts                                     ; 8C91 60                       `
; ----------------------------------------------------------------------------
L8C92:  lda     #$00                            ; 8C92 A9 00                    ..
        jsr     L8C9F                           ; 8C94 20 9F 8C                  ..
        bcc     L8C9E                           ; 8C97 90 05                    ..
        jsr     L8C89                           ; 8C99 20 89 8C                  ..
        bra     L8C92                           ; 8C9C 80 F4                    ..
L8C9E:  rts                                     ; 8C9E 60                       `
; ----------------------------------------------------------------------------
L8C9F:  tay                                     ; 8C9F A8                       .
        ldx     #$0F                            ; 8CA0 A2 0F                    ..
L8CA2:  phy                                     ; 8CA2 5A                       Z
        phx                                     ; 8CA3 DA                       .
        txa                                     ; 8CA4 8A                       .
        jsr     L8C40                           ; 8CA5 20 40 8C                  @.
        plx                                     ; 8CA8 FA                       .
        ply                                     ; 8CA9 7A                       z
        lda     $E7                             ; 8CAA A5 E7                    ..
        beq     L8CB6                           ; 8CAC F0 08                    ..
        bit     #$80                            ; 8CAE 89 80                    ..
        bne     L8CB6                           ; 8CB0 D0 04                    ..
        cpy     $E8                             ; 8CB2 C4 E8                    ..
        beq     L8CBA                           ; 8CB4 F0 04                    ..
L8CB6:  dex                                     ; 8CB6 CA                       .
        bpl     L8CA2                           ; 8CB7 10 E9                    ..
        clc                                     ; 8CB9 18                       .
L8CBA:  rts                                     ; 8CBA 60                       `
; ----------------------------------------------------------------------------
L8CBB:  stz     $E9                             ; 8CBB 64 E9                    d.
        stz     $EA                             ; 8CBD 64 EA                    d.
        stz     $E8                             ; 8CBF 64 E8                    d.
        bra     L8CCE                           ; 8CC1 80 0B                    ..
L8CC3:  jsr     L8CE6                           ; 8CC3 20 E6 8C                  ..
        bcc     L8CD1                           ; 8CC6 90 09                    ..
        clc                                     ; 8CC8 18                       .
        bit     $039D                           ; 8CC9 2C 9D 03                 ,..
        bmi     L8CD1                           ; 8CCC 30 03                    0.
L8CCE:  jsr     L8CE6                           ; 8CCE 20 E6 8C                  ..
L8CD1:  ldx     $EA                             ; 8CD1 A6 EA                    ..
        ldy     $03A7                           ; 8CD3 AC A7 03                 ...
        stx     $03A7                           ; 8CD6 8E A7 03                 ...
        sty     $EA                             ; 8CD9 84 EA                    ..
        ldx     $E9                             ; 8CDB A6 E9                    ..
        ldy     $03A6                           ; 8CDD AC A6 03                 ...
        stx     $03A6                           ; 8CE0 8E A6 03                 ...
        sty     $E9                             ; 8CE3 84 E9                    ..
        rts                                     ; 8CE5 60                       `
; ----------------------------------------------------------------------------
L8CE6:  ldx     $EA                             ; 8CE6 A6 EA                    ..
        ldy     $E9                             ; 8CE8 A4 E9                    ..
        stx     $03A7                           ; 8CEA 8E A7 03                 ...
        .byte   $8C                             ; 8CED 8C                       .
L8CEE:  ldx     $03                             ; 8CEE A6 03                    ..
        stz     $02D8                           ; 8CF0 9C D8 02                 ...
        ldx     #$FF                            ; 8CF3 A2 FF                    ..
L8CF5:  inx                                     ; 8CF5 E8                       .
        cpx     #$19                            ; 8CF6 E0 19                    ..
        beq     L8D13                           ; 8CF8 F0 19                    ..
        phx                                     ; 8CFA DA                       .
        jsr     L8B66                           ; 8CFB 20 66 8B                  f.
        plx                                     ; 8CFE FA                       .
        bcc     L8D15                           ; 8CFF 90 14                    ..
        sta     $0218,x                         ; 8D01 9D 18 02                 ...
        cpx     #$05                            ; 8D04 E0 05                    ..
        bit     $039D                           ; 8D06 2C 9D 03                 ,..
        bmi     L8D12                           ; 8D09 30 07                    0.
        bcc     L8CF5                           ; 8D0B 90 E8                    ..
        cmp     #$00                            ; 8D0D C9 00                    ..
        bne     L8CF5                           ; 8D0F D0 E4                    ..
        sec                                     ; 8D11 38                       8
L8D12:  rts                                     ; 8D12 60                       `
; ----------------------------------------------------------------------------
L8D13:  lda     #$43                            ; 8D13 A9 43                    .C
L8D15:  clc                                     ; 8D15 18                       .
        rts                                     ; 8D16 60                       `
; ----------------------------------------------------------------------------
L8D17:  jsr     L8C92                           ; 8D17 20 92 8C                  ..
        jsr     L8C3E                           ; 8D1A 20 3E 8C                  >.
        jsr     L8CE6                           ; 8D1D 20 E6 8C                  ..
        bcc     L8D3C                           ; 8D20 90 1A                    ..
L8D22:  bit     $039D                           ; 8D22 2C 9D 03                 ,..
        bmi     L8D3C                           ; 8D25 30 15                    0.
L8D27:  jsr     L8B66                           ; 8D27 20 66 8B                  f.
        bcc     L8D5A                           ; 8D2A 90 2E                    ..
        jsr     L8CD1                           ; 8D2C 20 D1 8C                  ..
        jsr     L8C0F                           ; 8D2F 20 0F 8C                  ..
        bcc     L8D5A                           ; 8D32 90 26                    .&
        jsr     L8CD1                           ; 8D34 20 D1 8C                  ..
        bit     $039D                           ; 8D37 2C 9D 03                 ,..
        bpl     L8D27                           ; 8D3A 10 EB                    ..
L8D3C:  jsr     L8CD1                           ; 8D3C 20 D1 8C                  ..
        jsr     L8AD5                           ; 8D3F 20 D5 8A                  ..
        lda     #$47                            ; 8D42 A9 47                    .G
        bcc     L8D5A                           ; 8D44 90 14                    ..
        lda     $EA                             ; 8D46 A5 EA                    ..
        beq     L8D50                           ; 8D48 F0 06                    ..
        ldy     #$02                            ; 8D4A A0 02                    ..
        sta     ($E4),y                         ; 8D4C 91 E4                    ..
        inc     $E9                             ; 8D4E E6 E9                    ..
L8D50:  jsr     L89F9                           ; 8D50 20 F9 89                  ..
        jsr     L8C30                           ; 8D53 20 30 8C                  0.
        jsr     L8E39                           ; 8D56 20 39 8E                  9.
        sec                                     ; 8D59 38                       8
L8D5A:  rts                                     ; 8D5A 60                       `
; ----------------------------------------------------------------------------
L8D5B:  jsr     L8E10                           ; 8D5B 20 10 8E                  ..
        lda     #$30                            ; 8D5E A9 30                    .0
        trb     $0218                           ; 8D60 1C 18 02                 ...
L8D63:  jsr     L8E91                           ; 8D63 20 91 8E                  ..
        bcc     L8D9E                           ; 8D66 90 36                    .6
        jsr     L8C92                           ; 8D68 20 92 8C                  ..
        jsr     L8C30                           ; 8D6B 20 30 8C                  0.
        lda     #$10                            ; 8D6E A9 10                    ..
        sta     $E7                             ; 8D70 85 E7                    ..
L8D72:  jsr     L8B66                           ; 8D72 20 66 8B                  f.
        bcs     L8D7A                           ; 8D75 B0 03                    ..
        lda     #$47                            ; 8D77 A9 47                    .G
        rts                                     ; 8D79 60                       `
; ----------------------------------------------------------------------------
L8D7A:  lda     $039D                           ; 8D7A AD 9D 03                 ...
        bpl     L8D72                           ; 8D7D 10 F3                    ..
        lda     #$20                            ; 8D7F A9 20                    . 
        tsb     $E7                             ; 8D81 04 E7                    ..
        ldx     #$FF                            ; 8D83 A2 FF                    ..
L8D85:  inx                                     ; 8D85 E8                       .
        phx                                     ; 8D86 DA                       .
        lda     $0218,x                         ; 8D87 BD 18 02                 ...
        jsr     L8BD4                           ; 8D8A 20 D4 8B                  ..
        plx                                     ; 8D8D FA                       .
        cpx     #$05                            ; 8D8E E0 05                    ..
        bcc     L8D85                           ; 8D90 90 F3                    ..
        lda     $0218,x                         ; 8D92 BD 18 02                 ...
        bne     L8D85                           ; 8D95 D0 EE                    ..
        jsr     L8C30                           ; 8D97 20 30 8C                  0.
        jsr     L8E39                           ; 8D9A 20 39 8E                  9.
        sec                                     ; 8D9D 38                       8
L8D9E:  rts                                     ; 8D9E 60                       `
; ----------------------------------------------------------------------------
L8D9F:  jsr     L8C30                           ; 8D9F 20 30 8C                  0.
        jsr     L8CBB                           ; 8DA2 20 BB 8C                  ..
        bra     L8DAA                           ; 8DA5 80 03                    ..
L8DA7:  jsr     L8CC3                           ; 8DA7 20 C3 8C                  ..
L8DAA:  bcc     L8DBA                           ; 8DAA 90 0E                    ..
        jsr     L8FC3                           ; 8DAC 20 C3 8F                  ..
        bcc     L8DB5                           ; 8DAF 90 04                    ..
        lda     $0218                           ; 8DB1 AD 18 02                 ...
        rts                                     ; 8DB4 60                       `
; ----------------------------------------------------------------------------
L8DB5:  bit     $039D                           ; 8DB5 2C 9D 03                 ,..
        bpl     L8DA7                           ; 8DB8 10 ED                    ..
L8DBA:  clc                                     ; 8DBA 18                       .
        lda     #$3E                            ; 8DBB A9 3E                    .>
        rts                                     ; 8DBD 60                       `
; ----------------------------------------------------------------------------
L8DBE:  pha                                     ; 8DBE 48                       H
        jsr     L8C30                           ; 8DBF 20 30 8C                  0.
        jsr     L8CBB                           ; 8DC2 20 BB 8C                  ..
        bra     L8DCA                           ; 8DC5 80 03                    ..
L8DC7:  jsr     L8CC3                           ; 8DC7 20 C3 8C                  ..
L8DCA:  bcc     L8DDC                           ; 8DCA 90 10                    ..
        lda     $0218                           ; 8DCC AD 18 02                 ...
        bit     #$80                            ; 8DCF 89 80                    ..
        bne     L8DC7                           ; 8DD1 D0 F4                    ..
        tsx                                     ; 8DD3 BA                       .
        lda     $0219                           ; 8DD4 AD 19 02                 ...
        cmp     stack+1,x                       ; 8DD7 DD 01 01                 ...
        bne     L8DC7                           ; 8DDA D0 EB                    ..
L8DDC:  pla                                     ; 8DDC 68                       h
        lda     #$3E                            ; 8DDD A9 3E                    .>
        rts                                     ; 8DDF 60                       `
; ----------------------------------------------------------------------------
L8DE0:  lda     $0219                           ; 8DE0 AD 19 02                 ...
        .byte   $2C                             ; 8DE3 2C                       ,
L8DE4:  lda     #$00                            ; 8DE4 A9 00                    ..
        ldx     #$00                            ; 8DE6 A2 00                    ..
        phx                                     ; 8DE8 DA                       .
        phx                                     ; 8DE9 DA                       .
        pha                                     ; 8DEA 48                       H
        jsr     L8A81                           ; 8DEB 20 81 8A                  ..
        beq     L8E0A                           ; 8DEE F0 1A                    ..
L8DF0:  tsx                                     ; 8DF0 BA                       .
        lda     $020E                           ; 8DF1 AD 0E 02                 ...
        cmp     stack+1,x                       ; 8DF4 DD 01 01                 ...
        bne     L8E05                           ; 8DF7 D0 0C                    ..
        inc     stack+2,x                       ; 8DF9 FE 02 01                 ...
        ldy     #$02                            ; 8DFC A0 02                    ..
        lda     ($E4),y                         ; 8DFE B1 E4                    ..
        beq     L8E05                           ; 8E00 F0 03                    ..
        sta     stack+3,x                       ; 8E02 9D 03 01                 ...
L8E05:  jsr     L8A61                           ; 8E05 20 61 8A                  a.
        bcs     L8DF0                           ; 8E08 B0 E6                    ..
L8E0A:  pla                                     ; 8E0A 68                       h
        pla                                     ; 8E0B 68                       h
        ply                                     ; 8E0C 7A                       z
        cmp     #$00                            ; 8E0D C9 00                    ..
        rts                                     ; 8E0F 60                       `
; ----------------------------------------------------------------------------
L8E10:  lda     $0219                           ; 8E10 AD 19 02                 ...
        jsr     L8E5E                           ; 8E13 20 5E 8E                  ^.
        sta     $021A                           ; 8E16 8D 1A 02                 ...
        stx     $021B                           ; 8E19 8E 1B 02                 ...
        sty     $021C                           ; 8E1C 8C 1C 02                 ...
        rts                                     ; 8E1F 60                       `
; ----------------------------------------------------------------------------
L8E20:  lda     $0219                           ; 8E20 AD 19 02                 ...
        .byte   $20                             ; 8E23 20                        
        .byte   $5E                             ; 8E24 5E                       ^
L8E25:  stx     $1ACD                           ; 8E25 8E CD 1A                 ...
        .byte   $02                             ; 8E28 02                       .
        bne     L8E35                           ; 8E29 D0 0A                    ..
        cpx     $021B                           ; 8E2B EC 1B 02                 ...
        bne     L8E35                           ; 8E2E D0 05                    ..
        cpy     $021C                           ; 8E30 CC 1C 02                 ...
        beq     L8E36                           ; 8E33 F0 01                    ..
L8E35:  clc                                     ; 8E35 18                       .
L8E36:  lda     #$1B                            ; 8E36 A9 1B                    ..
        rts                                     ; 8E38 60                       `
; ----------------------------------------------------------------------------
L8E39:  jsr     L8E5C                           ; 8E39 20 5C 8E                  \.
        sta     $0213                           ; 8E3C 8D 13 02                 ...
        stx     $0214                           ; 8E3F 8E 14 02                 ...
        sty     $0215                           ; 8E42 8C 15 02                 ...
        rts                                     ; 8E45 60                       `
; ----------------------------------------------------------------------------
L8E46:  jsr     L8E5C                           ; 8E46 20 5C 8E                  \.
        cmp     $0213                           ; 8E49 CD 13 02                 ...
        bne     L8E58                           ; 8E4C D0 0A                    ..
        cpx     $0214                           ; 8E4E EC 14 02                 ...
        bne     L8E58                           ; 8E51 D0 05                    ..
        cpy     $0215                           ; 8E53 CC 15 02                 ...
        beq     L8E59                           ; 8E56 F0 01                    ..
L8E58:  clc                                     ; 8E58 18                       .
L8E59:  lda     #$1B                            ; 8E59 A9 1B                    ..
        rts                                     ; 8E5B 60                       `
; ----------------------------------------------------------------------------
L8E5C:  lda     #$00                            ; 8E5C A9 00                    ..
L8E5E:  ldx     #$00                            ; 8E5E A2 00                    ..
        phx                                     ; 8E60 DA                       .
        phx                                     ; 8E61 DA                       .
        pha                                     ; 8E62 48                       H
        jsr     L8A81                           ; 8E63 20 81 8A                  ..
        beq     L8E8D                           ; 8E66 F0 25                    .%
        lda     #$00                            ; 8E68 A9 00                    ..
L8E6A:  tsx                                     ; 8E6A BA                       .
        ldy     stack+1,x                       ; 8E6B BC 01 01                 ...
        cpy     $020E                           ; 8E6E CC 0E 02                 ...
        bne     L8E86                           ; 8E71 D0 13                    ..
        ldy     #$00                            ; 8E73 A0 00                    ..
        clc                                     ; 8E75 18                       .
L8E76:  adc     ($E4),y                         ; 8E76 71 E4                    q.
        bcc     L8E83                           ; 8E78 90 09                    ..
        clc                                     ; 8E7A 18                       .
        inc     stack+2,x                       ; 8E7B FE 02 01                 ...
        bne     L8E83                           ; 8E7E D0 03                    ..
        inc     stack+3,x                       ; 8E80 FE 03 01                 ...
L8E83:  iny                                     ; 8E83 C8                       .
        bne     L8E76                           ; 8E84 D0 F0                    ..
L8E86:  pha                                     ; 8E86 48                       H
        jsr     L8A61                           ; 8E87 20 61 8A                  a.
        pla                                     ; 8E8A 68                       h
        bcs     L8E6A                           ; 8E8B B0 DD                    ..
L8E8D:  plx                                     ; 8E8D FA                       .
        plx                                     ; 8E8E FA                       .
        ply                                     ; 8E8F 7A                       z
        rts                                     ; 8E90 60                       `
; ----------------------------------------------------------------------------
L8E91:  jsr     L8DE4                           ; 8E91 20 E4 8D                  ..
        beq     L8EA7                           ; 8E94 F0 11                    ..
        tya                                     ; 8E96 98                       .
        ldx     #$FF                            ; 8E97 A2 FF                    ..
L8E99:  inc     a                               ; 8E99 1A                       .
        beq     L8EA7                           ; 8E9A F0 0B                    ..
        inx                                     ; 8E9C E8                       .
        cpx     #$05                            ; 8E9D E0 05                    ..
        bcc     L8E99                           ; 8E9F 90 F8                    ..
        lda     $021D,x                         ; 8EA1 BD 1D 02                 ...
        bne     L8E99                           ; 8EA4 D0 F3                    ..
        rts                                     ; 8EA6 60                       `
; ----------------------------------------------------------------------------
L8EA7:  jsr     L8A39                           ; 8EA7 20 39 8A                  9.
        bcc     L8EAE                           ; 8EAA 90 02                    ..
        lda     #$01                            ; 8EAC A9 01                    ..
L8EAE:  rts                                     ; 8EAE 60                       `
; ----------------------------------------------------------------------------
L8EAF:  lda     FNptr_lo                        ; 8EAF A5 AE                    ..
        ldx     FNptr_hi                        ; 8EB1 A6 AF                    ..
        ldy     FNlength                        ; 8EB3 AC 87 03                 ...
        sta     $E2                             ; 8EB6 85 E2                    ..
        stx     $E3                             ; 8EB8 86 E3                    ..
        sty     $039F                           ; 8EBA 8C 9F 03                 ...
L8EBD:  stz     $03A5                           ; 8EBD 9C A5 03                 ...
        stz     $03A3                           ; 8EC0 9C A3 03                 ...
        stz     $03A4                           ; 8EC3 9C A4 03                 ...
        stz     $03A0                           ; 8EC6 9C A0 03                 ...
        lda     #$E2                            ; 8EC9 A9 E2                    ..
        sta     $034E                           ; 8ECB 8D 4E 03                 .N.
        lda     $039F                           ; 8ECE AD 9F 03                 ...
        bne     L8ED7                           ; 8ED1 D0 04                    ..
L8ED3:  lda     #$21                            ; 8ED3 A9 21                    .!
        clc                                     ; 8ED5 18                       .
        rts                                     ; 8ED6 60                       `
; ----------------------------------------------------------------------------
L8ED7:  ldy     #$00                            ; 8ED7 A0 00                    ..
        jsr     L8FAD                           ; 8ED9 20 AD 8F                  ..
        dey                                     ; 8EDC 88                       .
        bcc     L8ED3                           ; 8EDD 90 F4                    ..
        cmp     #$24                            ; 8EDF C9 24                    .$
        beq     L8EE7                           ; 8EE1 F0 04                    ..
        cmp     #$40                            ; 8EE3 C9 40                    .@
        bne     L8EEB                           ; 8EE5 D0 04                    ..
L8EE7:  iny                                     ; 8EE7 C8                       .
        sta     $03A0                           ; 8EE8 8D A0 03                 ...
L8EEB:  sty     $03A1                           ; 8EEB 8C A1 03                 ...
L8EEE:  sty     $03A2                           ; 8EEE 8C A2 03                 ...
        cpy     $039F                           ; 8EF1 CC 9F 03                 ...
        bne     L8EF9                           ; 8EF4 D0 03                    ..
        jmp     L8F86                           ; 8EF6 4C 86 8F                 L..
; ----------------------------------------------------------------------------
L8EF9:  jsr     L8FAD                           ; 8EF9 20 AD 8F                  ..
        bcc     L8ED3                           ; 8EFC 90 D5                    ..
        tax                                     ; 8EFE AA                       .
        cpx     #$20                            ; 8EFF E0 20                    . 
        beq     L8EEE                           ; 8F01 F0 EB                    ..
        cpx     #$30                            ; 8F03 E0 30                    .0
        beq     L8EEE                           ; 8F05 F0 E7                    ..
        cpx     #$3A                            ; 8F07 E0 3A                    .:
        bne     L8F14                           ; 8F09 D0 09                    ..
        lda     #$03                            ; 8F0B A9 03                    ..
        tsb     $03A5                           ; 8F0D 0C A5 03                 ...
        bne     L8ED3                           ; 8F10 D0 C1                    ..
        bra     L8EEB                           ; 8F12 80 D7                    ..
L8F14:  lda     #$02                            ; 8F14 A9 02                    ..
        tsb     $03A5                           ; 8F16 0C A5 03                 ...
        cpx     #$3D                            ; 8F19 E0 3D                    .=
        beq     L8F81                           ; 8F1B F0 64                    .d
        cpx     #$3F                            ; 8F1D E0 3F                    .?
        beq     L8F25                           ; 8F1F F0 04                    ..
        cpx     #$2A                            ; 8F21 E0 2A                    .*
        bne     L8F2A                           ; 8F23 D0 05                    ..
L8F25:  lda     #$40                            ; 8F25 A9 40                    .@
        tsb     $03A5                           ; 8F27 0C A5 03                 ...
L8F2A:  cpx     #$2C                            ; 8F2A E0 2C                    .,
        bne     L8EEE                           ; 8F2C D0 C0                    ..
        dey                                     ; 8F2E 88                       .
L8F2F:  cpy     $039F                           ; 8F2F CC 9F 03                 ...
        beq     L8F86                           ; 8F32 F0 52                    .R
        jsr     L8FAD                           ; 8F34 20 AD 8F                  ..
        bcc     L8F5F                           ; 8F37 90 26                    .&
        cmp     #$3D                            ; 8F39 C9 3D                    .=
        beq     L8F81                           ; 8F3B F0 44                    .D
        cmp     #$20                            ; 8F3D C9 20                    . 
        beq     L8F2F                           ; 8F3F F0 EE                    ..
        cmp     #$2C                            ; 8F41 C9 2C                    .,
        bne     L8F5F                           ; 8F43 D0 1A                    ..
L8F45:  cpy     $039F                           ; 8F45 CC 9F 03                 ...
        bcs     L8F5F                           ; 8F48 B0 15                    ..
        jsr     L8FAD                           ; 8F4A 20 AD 8F                  ..
        bcc     L8F5F                           ; 8F4D 90 10                    ..
        cmp     #$20                            ; 8F4F C9 20                    . 
        beq     L8F45                           ; 8F51 F0 F2                    ..
        and     #$DF                            ; 8F53 29 DF                    ).
        ldx     #$05                            ; 8F55 A2 05                    ..
L8F57:  cmp     L8F7B,x                         ; 8F57 DD 7B 8F                 .{.
        beq     L8F63                           ; 8F5A F0 07                    ..
        dex                                     ; 8F5C CA                       .
        bpl     L8F57                           ; 8F5D 10 F8                    ..
L8F5F:  lda     #$21                            ; 8F5F A9 21                    .!
        clc                                     ; 8F61 18                       .
        rts                                     ; 8F62 60                       `
; ----------------------------------------------------------------------------
L8F63:  cpx     #$02                            ; 8F63 E0 02                    ..
        bcs     L8F71                           ; 8F65 B0 0A                    ..
        ldx     $03A4                           ; 8F67 AE A4 03                 ...
        bne     L8F5F                           ; 8F6A D0 F3                    ..
        sta     $03A4                           ; 8F6C 8D A4 03                 ...
        bra     L8F2F                           ; 8F6F 80 BE                    ..
L8F71:  ldx     $03A3                           ; 8F71 AE A3 03                 ...
        bne     L8F5F                           ; 8F74 D0 E9                    ..
        sta     $03A3                           ; 8F76 8D A3 03                 ...
        bra     L8F2F                           ; 8F79 80 B4                    ..
L8F7B:  .byte   $53                             ; 8F7B 53                       S
        bvc     L8FD0                           ; 8F7C 50 52                    PR
        rmb5    $41                             ; 8F7E 57 41                    WA
        .byte   $4D                             ; 8F80 4D                       M
L8F81:  lda     #$20                            ; 8F81 A9 20                    . 
        tsb     $03A5                           ; 8F83 0C A5 03                 ...
L8F86:  lda     $03A1                           ; 8F86 AD A1 03                 ...
        cmp     $03A2                           ; 8F89 CD A2 03                 ...
        bcc     L8F96                           ; 8F8C 90 08                    ..
        stz     $03A2                           ; 8F8E 9C A2 03                 ...
        stz     $03A1                           ; 8F91 9C A1 03                 ...
        bcs     L8F9B                           ; 8F94 B0 05                    ..
L8F96:  lda     #$80                            ; 8F96 A9 80                    ..
        tsb     $03A5                           ; 8F98 0C A5 03                 ...
L8F9B:  cld                                     ; 8F9B D8                       .
        clc                                     ; 8F9C 18                       .
        lda     #$10                            ; 8F9D A9 10                    ..
        adc     $03A1                           ; 8F9F 6D A1 03                 m..
        cmp     $03A2                           ; 8FA2 CD A2 03                 ...
        lda     #$21                            ; 8FA5 A9 21                    .!
        bcc     L8FAC                           ; 8FA7 90 03                    ..
        .byte   $AD                             ; 8FA9 AD                       .
L8FAA:  lda     $03                             ; 8FAA A5 03                    ..
L8FAC:  rts                                     ; 8FAC 60                       `
; ----------------------------------------------------------------------------
L8FAD:  jsr     FROM_C67B                       ; 8FAD 20 4A 03                  J.
        iny                                     ; 8FB0 C8                       .
L8FB1:  ldx     #$03                            ; 8FB1 A2 03                    ..
L8FB3:  .byte   $DD                             ; 8FB3 DD                       .
L8FB4:  bbs3    $8F,$8F                         ; 8FB4 BF 8F D0                 ...
        .byte   $02                             ; 8FB7 02                       .
        clc                                     ; 8FB8 18                       .
        rts                                     ; 8FB9 60                       `
; ----------------------------------------------------------------------------
L8FBA:  dex                                     ; 8FBA CA                       .
        bpl     L8FB3                           ; 8FBB 10 F6                    ..
        sec                                     ; 8FBD 38                       8
        rts                                     ; 8FBE 60                       `
; ----------------------------------------------------------------------------
L8FBF:  brk                                     ; 8FBF 00                       .
        ora     L8D22                           ; 8FC0 0D 22 8D                 .".
L8FC3:  ldx     #$00                            ; 8FC3 A2 00                    ..
        ldy     $03A1                           ; 8FC5 AC A1 03                 ...
        lda     #$E2                            ; 8FC8 A9 E2                    ..
        sta     $034E                           ; 8FCA 8D 4E 03                 .N.
L8FCD:  jsr     FROM_C67B                       ; 8FCD 20 4A 03                  J.
L8FD0:  cmp     #$2A                            ; 8FD0 C9 2A                    .*
        beq     L8FE9                           ; 8FD2 F0 15                    ..
        cmp     #$3F                            ; 8FD4 C9 3F                    .?
        beq     L8FDD                           ; 8FD6 F0 05                    ..
        cmp     $021D,x                         ; 8FD8 DD 1D 02                 ...
        bne     L8FF1                           ; 8FDB D0 14                    ..
L8FDD:  iny                                     ; 8FDD C8                       .
        cpy     $03A2                           ; 8FDE CC A2 03                 ...
        bne     L8FEB                           ; 8FE1 D0 08                    ..
        inx                                     ; 8FE3 E8                       .
        lda     $021D,x                         ; 8FE4 BD 1D 02                 ...
        bne     L8FF1                           ; 8FE7 D0 08                    ..
L8FE9:  sec                                     ; 8FE9 38                       8
        rts                                     ; 8FEA 60                       `
; ----------------------------------------------------------------------------
L8FEB:  inx                                     ; 8FEB E8                       .
        .byte   $BD                             ; 8FEC BD                       .
L8FED:  ora     $D002,x                         ; 8FED 1D 02 D0                 ...
        .byte   $DC                             ; 8FF0 DC                       .
L8FF1:  clc                                     ; 8FF1 18                       .
        rts                                     ; 8FF2 60                       `
; ----------------------------------------------------------------------------
L8FF3:  stz     $02D8                           ; 8FF3 9C D8 02                 ...
        lda     #$E2                            ; 8FF6 A9 E2                    ..
        sta     $034E                           ; 8FF8 8D 4E 03                 .N.
        ldx     #$00                            ; 8FFB A2 00                    ..
        ldy     $03A1                           ; 8FFD AC A1 03                 ...
L9000:  jsr     FROM_C67B                       ; 9000 20 4A 03                  J.
        sta     $021D,x                         ; 9003 9D 1D 02                 ...
        inx                                     ; 9006 E8                       .
        iny                                     ; 9007 C8                       .
        cpy     $03A2                           ; 9008 CC A2 03                 ...
        bne     L9000                           ; 900B D0 F3                    ..
        stz     $021D,x                         ; 900D 9E 1D 02                 ...
        rts                                     ; 9010 60                       `
; ----------------------------------------------------------------------------
L9011:  ldx     #$53                            ; 9011 A2 53                    .S
        lda     $0218                           ; 9013 AD 18 02                 ...
        bit     #$40                            ; 9016 89 40                    .@
        beq     L901C                           ; 9018 F0 02                    ..
        ldx     #$50                            ; 901A A2 50                    .P
L901C:  lda     #$40                            ; 901C A9 40                    .@
        cpx     $03A4                           ; 901E EC A4 03                 ...
        beq     L9029                           ; 9021 F0 06                    ..
        ldy     $03A4                           ; 9023 AC A4 03                 ...
L9026:  beq     L9029                           ; 9026 F0 01                    ..
        clc                                     ; 9028 18                       .
L9029:  stx     $03A4                           ; 9029 8E A4 03                 ...
        rts                                     ; 902C 60                       `
; ----------------------------------------------------------------------------
L902D:  ldx     #$04                            ; 902D A2 04                    ..
        lda     $0218                           ; 902F AD 18 02                 ...
        bit     #$80                            ; 9032 89 80                    ..
        bne     L9038                           ; 9034 D0 02                    ..
        ldx     #$01                            ; 9036 A2 01                    ..
L9038:  lda     $0218,x                         ; 9038 BD 18 02                 ...
        sta     $E7,x                           ; 903B 95 E7                    ..
        dex                                     ; 903D CA                       .
        bpl     L9038                           ; 903E 10 F8                    ..
        rts                                     ; 9040 60                       `
; ----------------------------------------------------------------------------
L9041:  jsr     L8C92                           ; 9041 20 92 8C                  ..
        stz     $02D6                           ; 9044 9C D6 02                 ...
        lda     #$2A                            ; 9047 A9 2A                    .*
        sta     $0238                           ; 9049 8D 38 02                 .8.
        stz     $0239                           ; 904C 9C 39 02                 .9.
        stz     $024C                           ; 904F 9C 4C 02                 .L.
        lda     $03A5                           ; 9052 AD A5 03                 ...
        bit     #$80                            ; 9055 89 80                    ..
        beq     L907D                           ; 9057 F0 24                    .$
        ldx     #$00                            ; 9059 A2 00                    ..
        ldy     $03A1                           ; 905B AC A1 03                 ...
L905E:  lda     #$E2                            ; 905E A9 E2                    ..
        sta     $034E                           ; 9060 8D 4E 03                 .N.
        jsr     FROM_C67B                       ; 9063 20 4A 03                  J.
        sta     $0238,x                         ; 9066 9D 38 02                 .8.
        iny                                     ; 9069 C8                       .
        inx                                     ; 906A E8                       .
        cpy     $03A2                           ; 906B CC A2 03                 ...
        bne     L905E                           ; 906E D0 EE                    ..
        cpx     #$14                            ; 9070 E0 14                    ..
        bcs     L9077                           ; 9072 B0 03                    ..
        stz     $0238,x                         ; 9074 9E 38 02                 .8.
L9077:  .byte   $AD                             ; 9077 AD                       .
        .byte   $A4                             ; 9078 A4                       .
L9079:  .byte   $03                             ; 9079 03                       .
        sta     $024C                           ; 907A 8D 4C 02                 .L.
L907D:  sec                                     ; 907D 38                       8
        rts                                     ; 907E 60                       `
; ----------------------------------------------------------------------------
        ldx     $B2                             ; 907F A6 B2                    ..
        ldy     $B3                             ; 9081 A4 B3                    ..
        sec                                     ; 9083 38                       8
        rts                                     ; 9084 60                       `
; ----------------------------------------------------------------------------
L9085:  jsr     L908B                           ; 9085 20 8B 90                  ..
        jmp     L993F                           ; 9088 4C 3F 99                 L?.
; ----------------------------------------------------------------------------
L908B:  ldx     $B7                             ; 908B A6 B7                    ..
        lda     $B6                             ; 908D A5 B6                    ..
        sta     $B8                             ; 908F 85 B8                    ..
        stx     $B9                             ; 9091 86 B9                    ..
        cpx     #$08                            ; 9093 E0 08                    ..
        bcc     L90DD                           ; 9095 90 46                    .F
        cpx     #$F8                            ; 9097 E0 F8                    ..
        bcs     L90DD                           ; 9099 B0 42                    .B
        lda     $B3                             ; 909B A5 B3                    ..
        cmp     #$F8                            ; 909D C9 F8                    ..
        bcc     L90A7                           ; 909F 90 06                    ..
        bne     L90DD                           ; 90A1 D0 3A                    .:
        lda     $B2                             ; 90A3 A5 B2                    ..
        bne     L90DD                           ; 90A5 D0 36                    .6
L90A7:  jsr     L8EAF                           ; 90A7 20 AF 8E                  ..
        bcc     L90DA                           ; 90AA 90 2E                    ..
        bit     #$80                            ; 90AC 89 80                    ..
        beq     L90DA                           ; 90AE F0 2A                    .*
        bit     #$60                            ; 90B0 89 60                    .`
        bne     L90DA                           ; 90B2 D0 26                    .&
        lda     $03A3                           ; 90B4 AD A3 03                 ...
        bne     L90DA                           ; 90B7 D0 21                    .!
        lda     $03A0                           ; 90B9 AD A0 03                 ...
        beq     L90C2                           ; 90BC F0 04                    ..
        cmp     #$40                            ; 90BE C9 40                    .@
        bne     L90DA                           ; 90C0 D0 18                    ..
L90C2:  .byte   $20                             ; 90C2 20                        
L90C3:  bbs1    $8D,$8D                         ; 90C3 9F 8D 90                 ...
        and     StopKeyFlag                     ; 90C6 25 AD                    %.
        ldy     #$03                            ; 90C8 A0 03                    ..
        .byte   $D0                             ; 90CA D0                       .
L90CB:  tsb     $A9                             ; 90CB 04 A9                    ..
        bbr3    $80,L90DF                       ; 90CD 3F 80 0F                 ?..
L90D0:  .byte   $AD                             ; 90D0 AD                       .
        clc                                     ; 90D1 18                       .
L90D2:  .byte   $02                             ; 90D2 02                       .
        and     #$80                            ; 90D3 29 80                    ).
        beq     L90E1                           ; 90D5 F0 0A                    ..
        lda     #$1A                            ; 90D7 A9 1A                    ..
        .byte   $2C                             ; 90D9 2C                       ,
L90DA:  lda     #$21                            ; 90DA A9 21                    .!
        .byte   $2C                             ; 90DC 2C                       ,
L90DD:  lda     #$19                            ; 90DD A9 19                    ..
L90DF:  clc                                     ; 90DF 18                       .
        rts                                     ; 90E0 60                       `
; ----------------------------------------------------------------------------
L90E1:  jsr     L9011                           ; 90E1 20 11 90                  ..
        bcc     L90DF                           ; 90E4 90 F9                    ..
        jsr     L8DE0                           ; 90E6 20 E0 8D                  ..
        inc     a                               ; 90E9 1A                       .
        bra     L910D                           ; 90EA 80 21                    .!
L90EC:  stz     $03A0                           ; 90EC 9C A0 03                 ...
        jsr     L8B13                           ; 90EF 20 13 8B                  ..
L90F2:  bcc     L90DF                           ; 90F2 90 EB                    ..
        jsr     L8FF3                           ; 90F4 20 F3 8F                  ..
        stz     $0218                           ; 90F7 9C 18 02                 ...
        lda     $03A4                           ; 90FA AD A4 03                 ...
        cmp     #$53                            ; 90FD C9 53                    .S
        beq     L9106                           ; 90FF F0 05                    ..
        lda     #$40                            ; 9101 A9 40                    .@
        sta     $0218                           ; 9103 8D 18 02                 ...
L9106:  .byte   $20                             ; 9106 20                        
        .byte   $91                             ; 9107 91                       .
L9108:  stx     $D490                           ; 9108 8E 90 D4                 ...
        eor     #$01                            ; 910B 49 01                    I.
L910D:  pha                                     ; 910D 48                       H
        .byte   $20                             ; 910E 20                        
        .byte   $A4                             ; 910F A4                       .
L9110:  sta     ($8C),y                         ; 9110 91 8C                    ..
        inc     a                               ; 9112 1A                       .
        .byte   $02                             ; 9113 02                       .
        pla                                     ; 9114 68                       h
        clc                                     ; 9115 18                       .
        adc     $020A                           ; 9116 6D 0A 02                 m..
        ldx     $020B                           ; 9119 AE 0B 02                 ...
        bcc     L911F                           ; 911C 90 01                    ..
        inx                                     ; 911E E8                       .
L911F:  clc                                     ; 911F 18                       .
        sbc     $021A                           ; 9120 ED 1A 02                 ...
        bcs     L9126                           ; 9123 B0 01                    ..
        dex                                     ; 9125 CA                       .
L9126:  tay                                     ; 9126 A8                       .
        bne     L912A                           ; 9127 D0 01                    ..
        dex                                     ; 9129 CA                       .
L912A:  dec     a                               ; 912A 3A                       :
        cpx     $020D                           ; 912B EC 0D 02                 ...
        bcc     L9137                           ; 912E 90 07                    ..
        bne     L913A                           ; 9130 D0 08                    ..
        cmp     $020C                           ; 9132 CD 0C 02                 ...
        bcs     L913A                           ; 9135 B0 03                    ..
L9137:  jmp     L90DD                           ; 9137 4C DD 90                 L..
; ----------------------------------------------------------------------------
L913A:  cpx     #$00                            ; 913A E0 00                    ..
        bne     L9145                           ; 913C D0 07                    ..
        cmp     $B7                             ; 913E C5 B7                    ..
        bcs     L9145                           ; 9140 B0 03                    ..
        jsr     L91D5                           ; 9142 20 D5 91                  ..
L9145:  lda     $03A0                           ; 9145 AD A0 03                 ...
        beq     L9150                           ; 9148 F0 06                    ..
        jsr     L89E2                           ; 914A 20 E2 89                  ..
        jsr     L8D17                           ; 914D 20 17 8D                  ..
L9150:  jsr     L91A4                           ; 9150 20 A4 91                  ..
        cpy     #$00                            ; 9153 C0 00                    ..
        beq     L91A1                           ; 9155 F0 4A                    .J
        dey                                     ; 9157 88                       .
        .byte   $8C                             ; 9158 8C                       .
        inc     a                               ; 9159 1A                       .
L915A:  .byte   $02                             ; 915A 02                       .
        sta     $021B                           ; 915B 8D 1B 02                 ...
        lda     #$E0                            ; 915E A9 E0                    ..
        sta     $034E                           ; 9160 8D 4E 03                 .N.
L9163:  jsr     L89AF                           ; 9163 20 AF 89                  ..
        ldy     #$FF                            ; 9166 A0 FF                    ..
L9168:  jsr     FROM_C67B                       ; 9168 20 4A 03                  J.
        sta     ($E4),y                         ; 916B 91 E4                    ..
        dey                                     ; 916D 88                       .
        bne     L9168                           ; 916E D0 F8                    ..
        ldy     #$02                            ; 9170 A0 02                    ..
L9172:  lda     $0219,y                         ; 9172 B9 19 02                 ...
        sta     ($E4),y                         ; 9175 91 E4                    ..
        dey                                     ; 9177 88                       .
        bpl     L9172                           ; 9178 10 F8                    ..
        sec                                     ; 917A 38                       8
        lda     $E0                             ; 917B A5 E0                    ..
        sbc     #$FD                            ; 917D E9 FD                    ..
        bcs     L9183                           ; 917F B0 02                    ..
        dec     $E1                             ; 9181 C6 E1                    ..
L9183:  sta     $E0                             ; 9183 85 E0                    ..
        stz     $021B                           ; 9185 9C 1B 02                 ...
        ldy     $021A                           ; 9188 AC 1A 02                 ...
        dec     $021A                           ; 918B CE 1A 02                 ...
        tya                                     ; 918E 98                       .
        bne     L9163                           ; 918F D0 D2                    ..
        bit     $0218                           ; 9191 2C 18 02                 ,..
        bvc     L91A1                           ; 9194 50 0B                    P.
        ldy     #$04                            ; 9196 A0 04                    ..
        lda     $B9                             ; 9198 A5 B9                    ..
        sta     ($E4),y                         ; 919A 91 E4                    ..
        dey                                     ; 919C 88                       .
        lda     $B8                             ; 919D A5 B8                    ..
        sta     ($E4),y                         ; 919F 91 E4                    ..
L91A1:  jmp     L8D5B                           ; 91A1 4C 5B 8D                 L[.
; ----------------------------------------------------------------------------
L91A4:  ldx     $B7                             ; 91A4 A6 B7                    ..
        lda     $B6                             ; 91A6 A5 B6                    ..
        bit     $0218                           ; 91A8 2C 18 02                 ,..
        bvc     L91B3                           ; 91AB 50 06                    P.
        sec                                     ; 91AD 38                       8
        sbc     #$02                            ; 91AE E9 02                    ..
        bcs     L91B3                           ; 91B0 B0 01                    ..
        dex                                     ; 91B2 CA                       .
L91B3:  ldy     #$00                            ; 91B3 A0 00                    ..
L91B5:  cpx     $B3                             ; 91B5 E4 B3                    ..
        bcc     L91BD                           ; 91B7 90 04                    ..
        cmp     $B2                             ; 91B9 C5 B2                    ..
        bcs     L91C9                           ; 91BB B0 0C                    ..
L91BD:  adc     #$FD                            ; 91BD 69 FD                    i.
        bcc     L91C2                           ; 91BF 90 01                    ..
        inx                                     ; 91C1 E8                       .
L91C2:  iny                                     ; 91C2 C8                       .
        bne     L91B5                           ; 91C3 D0 F0                    ..
        lda     #$34                            ; 91C5 A9 34                    .4
        clc                                     ; 91C7 18                       .
        rts                                     ; 91C8 60                       `
; ----------------------------------------------------------------------------
L91C9:  dex                                     ; 91C9 CA                       .
        sta     $E0                             ; 91CA 85 E0                    ..
L91CC:  stx     $E1                             ; 91CC 86 E1                    ..
        clc                                     ; 91CE 18                       .
        lda     $B2                             ; 91CF A5 B2                    ..
        sbc     $E0                             ; 91D1 E5 E0                    ..
        sec                                     ; 91D3 38                       8
        rts                                     ; 91D4 60                       `
; ----------------------------------------------------------------------------
L91D5:  pha                                     ; 91D5 48                       H
        sta     $E1                             ; 91D6 85 E1                    ..
        stz     $E0                             ; 91D8 64 E0                    d.
        lda     #$B7                            ; 91DA A9 B7                    ..
        sta     $034E                           ; 91DC 8D 4E 03                 .N.
        lda     #$E0                            ; 91DF A9 E0                    ..
        sta     $0360                           ; 91E1 8D 60 03                 .`.
L91E4:  lda     $B7                             ; 91E4 A5 B7                    ..
        cmp     $B3                             ; 91E6 C5 B3                    ..
        bne     L91F0                           ; 91E8 D0 06                    ..
        lda     $B6                             ; 91EA A5 B6                    ..
        cmp     $B2                             ; 91EC C5 B2                    ..
        beq     L9206                           ; 91EE F0 16                    ..
L91F0:  ldy     #$00                            ; 91F0 A0 00                    ..
        jsr     FROM_C67B                       ; 91F2 20 4A 03                  J.
        jsr     FROM_C68D                       ; 91F5 20 5C 03                  \.
        inc     $E0                             ; 91F8 E6 E0                    ..
        bne     L91FE                           ; 91FA D0 02                    ..
        inc     $E1                             ; 91FC E6 E1                    ..
L91FE:  inc     $B6                             ; 91FE E6 B6                    ..
        bne     L9204                           ; 9200 D0 02                    ..
        inc     $B7                             ; 9202 E6 B7                    ..
L9204:  bra     L91E4                           ; 9204 80 DE                    ..
L9206:  lda     $E0                             ; 9206 A5 E0                    ..
        sta     $B2                             ; 9208 85 B2                    ..
        lda     $E1                             ; 920A A5 E1                    ..
        sta     $B3                             ; 920C 85 B3                    ..
        pla                                     ; 920E 68                       h
        sta     $B7                             ; 920F 85 B7                    ..
        stz     $B6                             ; 9211 64 B6                    d.
        rts                                     ; 9213 60                       `
; ----------------------------------------------------------------------------
L9214:  jsr     L921A                           ; 9214 20 1A 92                  ..
        jmp     L993F                           ; 9217 4C 3F 99                 L?.
; ----------------------------------------------------------------------------
L921A:  jsr     L8C36                           ; 921A 20 36 8C                  6.
        bcs     L9221                           ; 921D B0 02                    ..
        sec                                     ; 921F 38                       8
        rts                                     ; 9220 60                       `
; ----------------------------------------------------------------------------
L9221:  lda     $E6                             ; 9221 A5 E6                    ..
        cmp     #$0F                            ; 9223 C9 0F                    ..
        beq     L9240                           ; 9225 F0 19                    ..
        lda     $E7                             ; 9227 A5 E7                    ..
        bit     #$20                            ; 9229 89 20                    . 
        beq     L9240                           ; 922B F0 13                    ..
        bit     #$80                            ; 922D 89 80                    ..
        bne     L9240                           ; 922F D0 0F                    ..
        lda     $E8                             ; 9231 A5 E8                    ..
        beq     L9240                           ; 9233 F0 0B                    ..
        .byte   $20                             ; 9235 20                        
L9236:  ldx     $908D,y                         ; 9236 BE 8D 90                 ...
        asl     $20                             ; 9239 06 20                    . 
        rmb1    $8D                             ; 923B 17 8D                    ..
        jsr     L8D5B                           ; 923D 20 5B 8D                  [.
L9240:  jmp     L8C86                           ; 9240 4C 86 8C                 L..
; ----------------------------------------------------------------------------
L9243:  .byte   $20                             ; 9243 20                        
L9244:  eor     #$92                            ; 9244 49 92                    I.
        jmp     L993F                           ; 9246 4C 3F 99                 L?.
; ----------------------------------------------------------------------------
L9249:  .byte   $20                             ; 9249 20                        
L924A:  rol     $8C,x                           ; 924A 36 8C                    6.
        lda     $E6                             ; 924C A5 E6                    ..
        cmp     #$0F                            ; 924E C9 0F                    ..
L9250:  bne     L9255                           ; 9250 D0 03                    ..
        jmp     L9737                           ; 9252 4C 37 97                 L7.
; ----------------------------------------------------------------------------
L9255:  .byte   $20                             ; 9255 20                        
L9256:  bit     #$8C                            ; 9256 89 8C                    ..
        jsr     L8EAF                           ; 9258 20 AF 8E                  ..
        .byte   $90                             ; 925B 90                       .
L925C:  rol     a                               ; 925C 2A                       *
        bit     #$20                            ; 925D 89 20                    . 
        bne     L9282                           ; 925F D0 21                    .!
        .byte   $AE                             ; 9261 AE                       .
L9262:  ldy     #$03                            ; 9262 A0 03                    ..
        beq     L928C                           ; 9264 F0 26                    .&
        cpx     #$24                            ; 9266 E0 24                    .$
L9268:  bne     L927B                           ; 9268 D0 11                    ..
        ldx     $03A3                           ; 926A AE A3 03                 ...
        .byte   $D0                             ; 926D D0                       .
L926E:  clc                                     ; 926E 18                       .
        jsr     L8C36                           ; 926F 20 36 8C                  6.
        .byte   $20                             ; 9272 20                        
        .byte   $41                             ; 9273 41                       A
L9274:  bcc     $921F                           ; 9274 90 A9                    ..
        bvc     $91FD                           ; 9276 50 85                    P.
        smb6    $38                             ; 9278 E7 38                    .8
L927A:  rts                                     ; 927A 60                       `
; ----------------------------------------------------------------------------
L927B:  ldy     $03A3                           ; 927B AC A3 03                 ...
L927E:  cpy     #$57                            ; 927E C0 57                    .W
        beq     L9289                           ; 9280 F0 07                    ..
L9282:  lda     #$21                            ; 9282 A9 21                    .!
        .byte   $2C                             ; 9284 2C                       ,
L9285:  .byte   $A9                             ; 9285 A9                       .
L9286:  .byte   $21                             ; 9286 21                       !
L9287:  clc                                     ; 9287 18                       .
        rts                                     ; 9288 60                       `
; ----------------------------------------------------------------------------
L9289:  stx     $03A3                           ; 9289 8E A3 03                 ...
L928C:  bit     #$80                            ; 928C 89 80                    ..
        beq     L9282                           ; 928E F0 F2                    ..
        ldy     #$52                            ; 9290 A0 52                    .R
        ldx     $03A3                           ; 9292 AE A3 03                 ...
        bne     L929A                           ; 9295 D0 03                    ..
        sty     $03A3                           ; 9297 8C A3 03                 ...
L929A:  bit     #$40                            ; 929A 89 40                    .@
        beq     L92A3                           ; 929C F0 05                    ..
        cpx     $03A3                           ; 929E EC A3 03                 ...
        bne     L9285                           ; 92A1 D0 E2                    ..
L92A3:  jsr     L8D9F                           ; 92A3 20 9F 8D                  ..
        bcc     L9317                           ; 92A6 90 6F                    .o
        jsr     L9011                           ; 92A8 20 11 90                  ..
        bcc     L92C7                           ; 92AB 90 1A                    ..
        ldy     $03A3                           ; 92AD AC A3 03                 ...
        lda     #$3F                            ; 92B0 A9 3F                    .?
        cpy     #$57                            ; 92B2 C0 57                    .W
        beq     L92C7                           ; 92B4 F0 11                    ..
        lda     $0218                           ; 92B6 AD 18 02                 ...
        bit     #$80                            ; 92B9 89 80                    ..
        beq     L92C9                           ; 92BB F0 0C                    ..
        lda     #$1A                            ; 92BD A9 1A                    ..
        cpy     #$40                            ; 92BF C0 40                    .@
        beq     L92C7                           ; 92C1 F0 04                    ..
        cpy     #$41                            ; 92C3 C0 41                    .A
        bne     L9315                           ; 92C5 D0 4E                    .N
L92C7:  clc                                     ; 92C7 18                       .
        rts                                     ; 92C8 60                       `
; ----------------------------------------------------------------------------
L92C9:  lda     $0219                           ; 92C9 AD 19 02                 ...
        jsr     L8C9F                           ; 92CC 20 9F 8C                  ..
        bcc     L92E6                           ; 92CF 90 15                    ..
        lda     $E7                             ; 92D1 A5 E7                    ..
        and     #$20                            ; 92D3 29 20                    ) 
        beq     L92DB                           ; 92D5 F0 04                    ..
        lda     #$3C                            ; 92D7 A9 3C                    .<
        bra     L92C7                           ; 92D9 80 EC                    ..
L92DB:  .byte   $AC                             ; 92DB AC                       .
        .byte   $A3                             ; 92DC A3                       .
L92DD:  .byte   $03                             ; 92DD 03                       .
        cpy     #$52                            ; 92DE C0 52                    .R
        beq     L92F8                           ; 92E0 F0 16                    ..
L92E2:  lda     #$3C                            ; 92E2 A9 3C                    .<
        bra     L92C7                           ; 92E4 80 E1                    ..
L92E6:  lda     $0218                           ; 92E6 AD 18 02                 ...
        bit     #$20                            ; 92E9 89 20                    . 
        beq     L92F8                           ; 92EB F0 0B                    ..
        ldy     $03A3                           ; 92ED AC A3 03                 ...
        cpy     #$4D                            ; 92F0 C0 4D                    .M
        beq     L92F8                           ; 92F2 F0 04                    ..
        cpy     #$40                            ; 92F4 C0 40                    .@
        bne     L92E2                           ; 92F6 D0 EA                    ..
L92F8:  ldy     $03A3                           ; 92F8 AC A3 03                 ...
        cpy     #$40                            ; 92FB C0 40                    .@
        bne     L930C                           ; 92FD D0 0D                    ..
        jsr     L8D17                           ; 92FF 20 17 8D                  ..
        jsr     L89E2                           ; 9302 20 E2 89                  ..
        lda     #$57                            ; 9305 A9 57                    .W
        sta     $03A3                           ; 9307 8D A3 03                 ...
        bra     L9317                           ; 930A 80 0B                    ..
L930C:  cpy     #$4D                            ; 930C C0 4D                    .M
        beq     L9315                           ; 930E F0 05                    ..
        jsr     L8E20                           ; 9310 20 20 8E                   .
        bcc     L92C7                           ; 9313 90 B2                    ..
L9315:  bra     L9335                           ; 9315 80 1E                    ..
L9317:  ldy     $03A3                           ; 9317 AC A3 03                 ...
        cpy     #$52                            ; 931A C0 52                    .R
        beq     L9322                           ; 931C F0 04                    ..
        cpy     #$4D                            ; 931E C0 4D                    .M
        bne     L9326                           ; 9320 D0 04                    ..
L9322:  lda     #$3E                            ; 9322 A9 3E                    .>
        clc                                     ; 9324 18                       .
        rts                                     ; 9325 60                       `
; ----------------------------------------------------------------------------
L9326:  lda     #$57                            ; 9326 A9 57                    .W
        sta     $03A3                           ; 9328 8D A3 03                 ...
        lda     $03A4                           ; 932B AD A4 03                 ...
        bne     L9335                           ; 932E D0 05                    ..
        lda     #$53                            ; 9330 A9 53                    .S
        sta     $03A4                           ; 9332 8D A4 03                 ...
L9335:  ldy     $03A3                           ; 9335 AC A3 03                 ...
        cpy     #$57                            ; 9338 C0 57                    .W
        bne     L935A                           ; 933A D0 1E                    ..
        jsr     L8B13                           ; 933C 20 13 8B                  ..
        bcc     L9358                           ; 933F 90 17                    ..
        jsr     L8FF3                           ; 9341 20 F3 8F                  ..
        stz     $0218                           ; 9344 9C 18 02                 ...
        lda     $03A4                           ; 9347 AD A4 03                 ...
        cmp     #$50                            ; 934A C9 50                    .P
        bne     L9353                           ; 934C D0 05                    ..
        lda     #$40                            ; 934E A9 40                    .@
        sta     $0218                           ; 9350 8D 18 02                 ...
L9353:  jsr     L8E91                           ; 9353 20 91 8E                  ..
        bcs     L935A                           ; 9356 B0 02                    ..
L9358:  clc                                     ; 9358 18                       .
        rts                                     ; 9359 60                       `
; ----------------------------------------------------------------------------
L935A:  jsr     L8C36                           ; 935A 20 36 8C                  6.
        jsr     L902D                           ; 935D 20 2D 90                  -.
        .byte   $A9                             ; 9360 A9                       .
L9361:  bpl     $9367                           ; 9361 10 04                    ..
        smb6    $AC                             ; 9363 E7 AC                    ..
        .byte   $A3                             ; 9365 A3                       .
        .byte   $03                             ; 9366 03                       .
        cpy     #$4D                            ; 9367 C0 4D                    .M
        beq     L9378                           ; 9369 F0 0D                    ..
        cpy     #$52                            ; 936B C0 52                    .R
        bne     L937A                           ; 936D D0 0B                    ..
        lda     $E6                             ; 936F A5 E6                    ..
        cmp     #$0E                            ; 9371 C9 0E                    ..
        bne     L9378                           ; 9373 D0 03                    ..
        dec     $0405                           ; 9375 CE 05 04                 ...
L9378:  sec                                     ; 9378 38                       8
        rts                                     ; 9379 60                       `
; ----------------------------------------------------------------------------
L937A:  cpy     #$41                            ; 937A C0 41                    .A
        bne     L938D                           ; 937C D0 0F                    ..
        jsr     L8D17                           ; 937E 20 17 8D                  ..
L9381:  jsr     L8B40                           ; 9381 20 40 8B                  @.
        lda     #$47                            ; 9384 A9 47                    .G
        bcc     L9358                           ; 9386 90 D0                    ..
        bit     $039D                           ; 9388 2C 9D 03                 ,..
        bpl     L9381                           ; 938B 10 F4                    ..
L938D:  jsr     L8C36                           ; 938D 20 36 8C                  6.
        lda     #$20                            ; 9390 A9 20                    . 
        tsb     $E7                             ; 9392 04 E7                    ..
        tsb     $0218                           ; 9394 0C 18 02                 ...
        jmp     L8D63                           ; 9397 4C 63 8D                 Lc.
; ----------------------------------------------------------------------------
L939A:  lda     $02D6                           ; 939A AD D6 02                 ...
L939D:  bne     L93A2                           ; 939D D0 03                    ..
        sta     $02D7                           ; 939F 8D D7 02                 ...
L93A2:  ldx     $02D7                           ; 93A2 AE D7 02                 ...
        beq     L93C0                           ; 93A5 F0 19                    ..
        lda     $02D8                           ; 93A7 AD D8 02                 ...
        beq     L941F                           ; 93AA F0 73                    .s
        lda     $0217,x                         ; 93AC BD 17 02                 ...
        inx                                     ; 93AF E8                       .
        tay                                     ; 93B0 A8                       .
        bne     L93B8                           ; 93B1 D0 05                    ..
        cpx     #$0A                            ; 93B3 E0 0A                    ..
        bcc     L93B8                           ; 93B5 90 01                    ..
        tax                                     ; 93B7 AA                       .
L93B8:  stx     $02D7                           ; 93B8 8E D7 02                 ...
        stz     $039D                           ; 93BB 9C 9D 03                 ...
        sec                                     ; 93BE 38                       8
        rts                                     ; 93BF 60                       `
; ----------------------------------------------------------------------------
L93C0:  ldx     $02D6                           ; 93C0 AE D6 02                 ...
        jmp     (L93C6,x)                       ; 93C3 7C C6 93                 |..
L93C6:  trb     $94                             ; 93C6 14 94                    ..
        cpx     $93                             ; 93C8 E4 93                    ..
        sbc     #$93                            ; 93CA E9 93                    ..
        bne     L9361                           ; 93CC D0 93                    ..
        dec     $93,x                           ; 93CE D6 93                    ..
        ldx     #$08                            ; 93D0 A2 08                    ..
        lda     #$00                            ; 93D2 A9 00                    ..
        bra     L93DA                           ; 93D4 80 04                    ..
        ldx     #$00                            ; 93D6 A2 00                    ..
        lda     #$FF                            ; 93D8 A9 FF                    ..
L93DA:  stx     $02D6                           ; 93DA 8E D6 02                 ...
        sta     $039D                           ; 93DD 8D 9D 03                 ...
        lda     #$00                            ; 93E0 A9 00                    ..
        sec                                     ; 93E2 38                       8
        rts                                     ; 93E3 60                       `
; ----------------------------------------------------------------------------
        jsr     L8CBB                           ; 93E4 20 BB 8C                  ..
        bra     L93EC                           ; 93E7 80 03                    ..
L93E9:  jsr     L8CC3                           ; 93E9 20 C3 8C                  ..
L93EC:  ldx     #$04                            ; 93EC A2 04                    ..
        stx     $02D6                           ; 93EE 8E D6 02                 ...
        bcc     L9414                           ; 93F1 90 21                    .!
        lda     #$38                            ; 93F3 A9 38                    .8
        sta     $E2                             ; 93F5 85 E2                    ..
        lda     #$02                            ; 93F7 A9 02                    ..
        stz     $03A1                           ; 93F9 9C A1 03                 ...
L93FC:  sta     $E3                             ; 93FC 85 E3                    ..
        ldx     #$00                            ; 93FE A2 00                    ..
L9400:  lda     $0238,x                         ; 9400 BD 38 02                 .8.
L9403:  beq     L940A                           ; 9403 F0 05                    ..
        inx                                     ; 9405 E8                       .
        cpx     #$14                            ; 9406 E0 14                    ..
        bne     L9400                           ; 9408 D0 F6                    ..
L940A:  stx     $03A2                           ; 940A 8E A2 03                 ...
        jsr     L8FC3                           ; 940D 20 C3 8F                  ..
        bcc     L93E9                           ; 9410 90 D7                    ..
        bra     L941A                           ; 9412 80 06                    ..
L9414:  inc     $02D6                           ; 9414 EE D6 02                 ...
        inc     $02D6                           ; 9417 EE D6 02                 ...
L941A:  lda     #$01                            ; 941A A9 01                    ..
        sta     $02D7                           ; 941C 8D D7 02                 ...
L941F:  jsr     L8CCE                           ; 941F 20 CE 8C                  ..
        jsr     L942B                           ; 9422 20 2B 94                  +.
        dec     $02D8                           ; 9425 CE D8 02                 ...
        jmp     L939A                           ; 9428 4C 9A 93                 L..
; ----------------------------------------------------------------------------
; Jumps (by a jump table) to the right routine to dump the "virtual 1541"
; directory listing tail/head or the content itself, IMHO.
L942B:  ldx     $02D6                           ; 942B AE D6 02                 ...
L942F           := * + 1
        jmp     (L942F,x)                       ; 942E 7C 2F 94                 |/.
        .addr   L9457                           ; 9431 57 94                    W.
        .addr   L94A8                           ; 9433 A8 94                    ..
        .addr   L9488                           ; 9435 88 94                    ..
; ----------------------------------------------------------------------------
; This (and other part later) fragment seems to be the usual directory
; listing produced by an 1541 and compatible drives. The text says "virtual
; 1541" thus it seems CLCD handles something (possible programs in ROM and/or
; RAM disk) as it would be a "real" 1541 drive for the user.
L9437:  .byte   $01,$10,$01,$10,$00,$00,$12,$22 ; 9437 01 10 01 10 00 00 12 22  ......."
        .byte   "VIRTUAL 1541 "                 ; 943F 56 49 52 54 55 41 4C 20  VIRTUAL 
                                                ; 9447 31 35 34 31 20           1541 
L944C:  .byte   "   "                           ; 944C 20 20 20                    
        .byte   $22                             ; 944F 22                       "
        .byte   " ID 00"                        ; 9450 20 49 44 20 30 30         ID 00
        .byte   $00                             ; 9456 00                       .
; ----------------------------------------------------------------------------
; This dumps the directory listing head, with the "virtual 1541" text.
L9457:  ldx     #$1F                            ; 9457 A2 1F                    ..
L9459:  lda     L9437,x                         ; 9459 BD 37 94                 .7.
        sta     $0218,x                         ; 945C 9D 18 02                 ...
        dex                                     ; 945F CA                       .
        bpl     L9459                           ; 9460 10 F7                    ..
        jsr     L8DE4                           ; 9462 20 E4 8D                  ..
        sta     $021C                           ; 9465 8D 1C 02                 ...
        rts                                     ; 9468 60                       `
; ----------------------------------------------------------------------------
L9469:  .byte   $01,$10,$00,$00                 ; 9469 01 10 00 00              ....
        .byte   "BLOCKS USED.            "      ; 946D 42 4C 4F 43 4B 53 20 55  BLOCKS U
                                                ; 9475 53 45 44 2E 20 20 20 20  SED.    
                                                ; 947D 20 20 20 20 20 20 20 20          
        .byte   $00,$00,$00                     ; 9485 00 00 00                 ...
; ----------------------------------------------------------------------------
; This dumps the directory listing tail, with the "block used" text.
L9488:  ldx     #$1E                            ; 9488 A2 1E                    ..
L948A:  lda     L9469,x                         ; 948A BD 69 94                 .i.
        sta     $0218,x                         ; 948D 9D 18 02                 ...
        dex                                     ; 9490 CA                       .
        bpl     L948A                           ; 9491 10 F7                    ..
        cld                                     ; 9493 D8                       .
        sec                                     ; 9494 38                       8
        lda     $0208                           ; 9495 AD 08 02                 ...
        sbc     $020A                           ; 9498 ED 0A 02                 ...
        sta     $021A                           ; 949B 8D 1A 02                 ...
        lda     $0209                           ; 949E AD 09 02                 ...
        sbc     $020B                           ; 94A1 ED 0B 02                 ...
L94A6           := * + 2
        sta     $021B                           ; 94A4 8D 1B 02                 ...
        rts                                     ; 94A7 60                       `
; ----------------------------------------------------------------------------
; Afaik this dumps a row of the directory listing, about a file, you can even
; see the "PRG", "SEQ" stuffs appended.
L94A8:  ldx     #$04                            ; 94A8 A2 04                    ..
L94AA:  inx                                     ; 94AA E8                       .
        lda     $0218,x                         ; 94AB BD 18 02                 ...
        beq     L94B4                           ; 94AE F0 04                    ..
        cpx     #$15                            ; 94B0 E0 15                    ..
        bne     L94AA                           ; 94B2 D0 F6                    ..
L94B4:  lda     #$22                            ; 94B4 A9 22                    ."
L94B6:  sta     $0218,x                         ; 94B6 9D 18 02                 ...
        lda     #$20                            ; 94B9 A9 20                    . 
        inx                                     ; 94BB E8                       .
        cpx     #$20                            ; 94BC E0 20                    . 
        bne     L94B6                           ; 94BE D0 F6                    ..
        lda     $0218                           ; 94C0 AD 18 02                 ...
        bit     #$30                            ; 94C3 89 30                    .0
        beq     L94CC                           ; 94C5 F0 05                    ..
        ldx     #$2A                            ; 94C7 A2 2A                    .*
        stx     $022E                           ; 94C9 8E 2E 02                 ...
L94CC:  bit     #$80                            ; 94CC 89 80                    ..
        bne     L94D5                           ; 94CE D0 05                    ..
        jsr     L8DE0                           ; 94D0 20 E0 8D                  ..
        bra     L94D8                           ; 94D3 80 03                    ..
L94D5:  lda     $021B                           ; 94D5 AD 1B 02                 ...
L94D8:  sta     $021A                           ; 94D8 8D 1A 02                 ...
        lda     $0218                           ; 94DB AD 18 02                 ...
        and     #$40                            ; 94DE 29 40                    )@
        beq     L94EA                           ; 94E0 F0 08                    ..
        lda     #$50                            ; 94E2 A9 50                    .P
        ldx     #$52                            ; 94E4 A2 52                    .R
        ldy     #$47                            ; 94E6 A0 47                    .G
        bra     L94F0                           ; 94E8 80 06                    ..
L94EA:  lda     #$53                            ; 94EA A9 53                    .S
        ldx     #$45                            ; 94EC A2 45                    .E
        ldy     #$51                            ; 94EE A0 51                    .Q
L94F0:  sta     $022F                           ; 94F0 8D 2F 02                 ./.
        stx     $0230                           ; 94F3 8E 30 02                 .0.
        sty     $0231                           ; 94F6 8C 31 02                 .1.
        lda     #$01                            ; 94F9 A9 01                    ..
        sta     $0218                           ; 94FB 8D 18 02                 ...
        lda     #$10                            ; 94FE A9 10                    ..
        sta     $0219                           ; 9500 8D 19 02                 ...
        stz     $021B                           ; 9503 9C 1B 02                 ...
        lda     #$22                            ; 9506 A9 22                    ."
        sta     $021C                           ; 9508 8D 1C 02                 ...
        lda     $021A                           ; 950B AD 1A 02                 ...
        cmp     #$64                            ; 950E C9 64                    .d
        bcs     L9515                           ; 9510 B0 03                    ..
        jsr     L9522                           ; 9512 20 22 95                  ".
L9515:  lda     $021A                           ; 9515 AD 1A 02                 ...
        cmp     #$0A                            ; 9518 C9 0A                    ..
        bcc     L951F                           ; 951A 90 03                    ..
        jsr     L9522                           ; 951C 20 22 95                  ".
L951F:  jsr     L9522                           ; 951F 20 22 95                  ".
L9522:  lda     #$20                            ; 9522 A9 20                    . 
        ldx     #$04                            ; 9524 A2 04                    ..
L9526:  ldy     $0218,x                         ; 9526 BC 18 02                 ...
        sta     $0218,x                         ; 9529 9D 18 02                 ...
        tya                                     ; 952C 98                       .
        inx                                     ; 952D E8                       .
        cpx     #$1F                            ; 952E E0 1F                    ..
        bne     L9526                           ; 9530 D0 F4                    ..
        lda     #$00                            ; 9532 A9 00                    ..
        sta     $0237                           ; 9534 8D 37 02                 .7.
        rts                                     ; 9537 60                       `
; ----------------------------------------------------------------------------
LOAD__: sta     $0406                           ; 9538 8D 06 04                 ...
        stz     ST                              ; 953B 64 BA                    d.
        lda     LFSDevNum                       ; 953D A5 C5                    ..
        bne     L9544                           ; 953F D0 03                    ..
L9541:  jmp     LBC68                           ; 9541 4C 68 BC                 Lh.
; ----------------------------------------------------------------------------
L9544:  cmp     #$01                            ; 9544 C9 01                    ..
        beq     L9550                           ; 9546 F0 08                    ..
        cmp     #$04                            ; 9548 C9 04                    ..
        bcc     L9541                           ; 954A 90 F5                    ..
        cmp     #$1E                            ; 954C C9 1E                    ..
        bcs     L9541                           ; 954E B0 F1                    ..
L9550:  ldy     FNlength                        ; 9550 AC 87 03                 ...
        bne     L9558                           ; 9553 D0 03                    ..
        jmp     LBC65                           ; 9555 4C 65 BC                 Le.
; ----------------------------------------------------------------------------
L9558:  jsr     LBB8D                           ; 9558 20 8D BB                  ..
        ldx     LFS2ndAddr                      ; 955B A6 C4                    ..
        stx     $0407                           ; 955D 8E 07 04                 ...
        stz     LFS2ndAddr                      ; 9560 64 C4                    d.
        lda     LFSDevNum                       ; 9562 A5 C5                    ..
        dec     a                               ; 9564 3A                       :
        beq     L957A                           ; 9565 F0 13                    ..
        lda     #$60                            ; 9567 A9 60                    .`
        sta     LFS2ndAddr                      ; 9569 85 C4                    ..
        jsr     LBB40                           ; 956B 20 40 BB                  @.
        lda     LFSDevNum                       ; 956E A5 C5                    ..
        jsr     SendTalk                        ; 9570 20 91 BC                  ..
        lda     LFS2ndAddr                      ; 9573 A5 C4                    ..
        jsr     TALKSA__                        ; 9575 20 55 BD                  U.
        bra     L9592                           ; 9578 80 18                    ..
L957A:  phx                                     ; 957A DA                       .
        jsr     L966B                           ; 957B 20 6B 96                  k.
        plx                                     ; 957E FA                       .
        lda     ST                              ; 957F A5 BA                    ..
        bit     #$0C                            ; 9581 89 0C                    ..
        beq     L9592                           ; 9583 F0 0D                    ..
L9585:  jmp     LBC59                           ; 9585 4C 59 BC                 LY.
; ----------------------------------------------------------------------------
L9588:  lda     LFS2ndAddr                      ; 9588 A5 C4                    ..
        beq     L958F                           ; 958A F0 03                    ..
        jsr     LBC36                           ; 958C 20 36 BC                  6.
L958F:  jmp     LBC6B                           ; 958F 4C 6B BC                 Lk.
; ----------------------------------------------------------------------------
L9592:  jsr     L9661                           ; 9592 20 61 96                  a.
        sta     $B2                             ; 9595 85 B2                    ..
        lda     #$02                            ; 9597 A9 02                    ..
        bit     ST                              ; 9599 24 BA                    $.
        bne     L9585                           ; 959B D0 E8                    ..
        jsr     L9661                           ; 959D 20 61 96                  a.
        sta     $B3                             ; 95A0 85 B3                    ..
        lda     $0407                           ; 95A2 AD 07 04                 ...
        bne     L95AF                           ; 95A5 D0 08                    ..
        lda     $B4                             ; 95A7 A5 B4                    ..
        sta     $B2                             ; 95A9 85 B2                    ..
        lda     $B5                             ; 95AB A5 B5                    ..
        sta     $B3                             ; 95AD 85 B3                    ..
L95AF:  lda     $0406                           ; 95AF AD 06 04                 ...
        bne     L95E4                           ; 95B2 D0 30                    .0
        jsr     ShowInLineText80                ; 95B4 20 56 FB                  V.
        .byte   "LOADING"                       ; 95B7 4C 4F 41 44 49 4E 47     LOADING
        .byte   $0D,$00                         ; 95BE 0D 00                    ..
; ----------------------------------------------------------------------------
        lda     $B3                             ; 95C0 A5 B3                    ..
        cmp     #$05                            ; 95C2 C9 05                    ..
        bcc     L9588                           ; 95C4 90 C2                    ..
        cmp     #$F8                            ; 95C6 C9 F8                    ..
        bcs     L9588                           ; 95C8 B0 BE                    ..
        cmp     $020A                           ; 95CA CD 0A 02                 ...
        bcc     L95D4                           ; 95CD 90 05                    ..
        lda     $020B                           ; 95CF AD 0B 02                 ...
        beq     L9588                           ; 95D2 F0 B4                    ..
L95D4:  lda     LFS2ndAddr                      ; 95D4 A5 C4                    ..
        bne     L95F0                           ; 95D6 D0 18                    ..
        .byte   $AD                             ; 95D8 AD                       .
        .byte   $A0                             ; 95D9 A0                       .
L95DA:  .byte   $03                             ; 95DA 03                       .
        cmp     #$40                            ; 95DB C9 40                    .@
        bne     L95F0                           ; 95DD D0 11                    ..
        jsr     L96D6                           ; 95DF 20 D6 96                  ..
        bra     L9651                           ; 95E2 80 6D                    .m
L95E4:  jsr     ShowInLineText80                ; 95E4 20 56 FB                  V.
        .byte   $0D                             ; 95E7 0D                       .
        .byte   "VERIF"                         ; 95E8 56 45 52 49 46           VERIF
L95ED:  .byte   "Y "                            ; 95ED 59 20                    Y 
        .byte   $00                             ; 95EF 00                       .
; ----------------------------------------------------------------------------
L95F0:  lda     #$02                            ; 95F0 A9 02                    ..
        trb     ST                              ; 95F2 14 BA                    ..
        jsr     LFDB9                           ; 95F4 20 B9 FD                  ..
        beq     L9657                           ; 95F7 F0 5E                    .^
L95F9:  jsr     L9661                           ; 95F9 20 61 96                  a.
        tax                                     ; 95FC AA                       .
        lda     ST                              ; 95FD A5 BA                    ..
        lsr     a                               ; 95FF 4A                       J
        lsr     a                               ; 9600 4A                       J
        bcs     L95F9                           ; 9601 B0 F6                    ..
        txa                                     ; 9603 8A                       .
        ldy     $0406                           ; 9604 AC 06 04                 ...
        beq     L9622                           ; 9607 F0 19                    ..
        ldy     #$00                            ; 9609 A0 00                    ..
        sta     $0407                           ; 960B 8D 07 04                 ...
        lda     #$B2                            ; 960E A9 B2                    ..
        sta     $034E                           ; 9610 8D 4E 03                 .N.
        jsr     FROM_C67B                       ; 9613 20 4A 03                  J.
        cmp     $0407                           ; 9616 CD 07 04                 ...
        beq     L963D                           ; 9619 F0 22                    ."
        lda     #$10                            ; 961B A9 10                    ..
        jsr     SetST                           ; 961D 20 CA FC                  ..
        bra     L963D                           ; 9620 80 1B                    ..
L9622:  ldx     #$B2                            ; 9622 A2 B2                    ..
        stx     $0360                           ; 9624 8E 60 03                 .`.
        ldx     $B3                             ; 9627 A6 B3                    ..
        cpx     #$F8                            ; 9629 E0 F8                    ..
        bcs     L9637                           ; 962B B0 0A                    ..
        cpx     $020A                           ; 962D EC 0A 02                 ...
        bcc     L963A                           ; 9630 90 08                    ..
        ldx     $020B                           ; 9632 AE 0B 02                 ...
        bne     L963A                           ; 9635 D0 03                    ..
L9637:  jmp     L9588                           ; 9637 4C 88 95                 L..
; ----------------------------------------------------------------------------
L963A:  jsr     FROM_C68D                       ; 963A 20 5C 03                  \.
L963D:  inc     $B2                             ; 963D E6 B2                    ..
        bne     L9643                           ; 963F D0 02                    ..
        inc     $B3                             ; 9641 E6 B3                    ..
L9643:  bit     ST                              ; 9643 24 BA                    $.
        bvc     L95F9                           ; 9645 50 B2                    P.
        lda     LFS2ndAddr                      ; 9647 A5 C4                    ..
        beq     L9651                           ; 9649 F0 06                    ..
        jsr     UNTALK__                        ; 964B 20 81 BD                  ..
        jsr     LBC36                           ; 964E 20 36 BC                  6.
L9651:  ldx     $B2                             ; 9651 A6 B2                    ..
        ldy     $B3                             ; 9653 A4 B3                    ..
        clc                                     ; 9655 18                       .
        rts                                     ; 9656 60                       `
; ----------------------------------------------------------------------------
L9657:  lda     LFS2ndAddr                      ; 9657 A5 C4                    ..
        bne     L965E                           ; 9659 D0 03                    ..
        jsr     LBC36                           ; 965B 20 36 BC                  6.
L965E:  jmp     LBC4D                           ; 965E 4C 4D BC                 LM.
; ----------------------------------------------------------------------------
L9661:  lda     LFS2ndAddr                      ; 9661 A5 C4                    ..
        beq     L9668                           ; 9663 F0 03                    ..
        jmp     IECIN__                         ; 9665 4C A5 BD                 L..
; ----------------------------------------------------------------------------
L9668:  jmp     L971F                           ; 9668 4C 1F 97                 L..
; ----------------------------------------------------------------------------
L966B:  jsr     L9671                           ; 966B 20 71 96                  q.
        jmp     L993F                           ; 966E 4C 3F 99                 L?.
; ----------------------------------------------------------------------------
L9671:  jsr     L8EAF                           ; 9671 20 AF 8E                  ..
        .byte   $90                             ; 9674 90                       .
L9675:  bit     $89                             ; 9675 24 89                    $.
        jsr     $20D0                           ; 9677 20 D0 20                  . 
        ldx     $03A0                           ; 967A AE A0 03                 ...
        cpx     #$24                            ; 967D E0 24                    .$
        bne     L969C                           ; 967F D0 1B                    ..
        ldx     $03A3                           ; 9681 AE A3 03                 ...
        bne     L9698                           ; 9684 D0 12                    ..
        jsr     L9041                           ; 9686 20 41 90                  A.
        jsr     L8C2A                           ; 9689 20 2A 8C                  *.
        lda     #$40                            ; 968C A9 40                    .@
        tsb     $E7                             ; 968E 04 E7                    ..
        bra     L96C0                           ; 9690 80 2E                    ..
L9692:  lda     #$40                            ; 9692 A9 40                    .@
        .byte   $2C                             ; 9694 2C                       ,
L9695:  lda     #$3C                            ; 9695 A9 3C                    .<
        .byte   $2C                             ; 9697 2C                       ,
L9698:  lda     #$22                            ; 9698 A9 22                    ."
L969A:  clc                                     ; 969A 18                       .
        rts                                     ; 969B 60                       `
; ----------------------------------------------------------------------------
L969C:  jsr     L8D9F                           ; 969C 20 9F 8D                  ..
        bcc     L969A                           ; 969F 90 F9                    ..
        lda     $0218                           ; 96A1 AD 18 02                 ...
        .byte   $89                             ; 96A4 89                       .
L96A5:  jsr     $EDD0                           ; 96A5 20 D0 ED                  ..
        bit     #$80                            ; 96A8 89 80                    ..
        bne     L96B1                           ; 96AA D0 05                    ..
        jsr     L8E20                           ; 96AC 20 20 8E                   .
        bcc     L969A                           ; 96AF 90 E9                    ..
L96B1:  jsr     L9011                           ; 96B1 20 11 90                  ..
        bcc     L969A                           ; 96B4 90 E4                    ..
        cpx     #$53                            ; 96B6 E0 53                    .S
        beq     L9692                           ; 96B8 F0 D8                    ..
        jsr     L8C2A                           ; 96BA 20 2A 8C                  *.
        jsr     L902D                           ; 96BD 20 2D 90                  -.
L96C0:  lda     #$10                            ; 96C0 A9 10                    ..
        tsb     $E7                             ; 96C2 04 E7                    ..
        lda     $03A0                           ; 96C4 AD A0 03                 ...
        cmp     #$40                            ; 96C7 C9 40                    .@
        bne     L96D1                           ; 96C9 D0 06                    ..
        lda     $E7                             ; 96CB A5 E7                    ..
        and     #$80                            ; 96CD 29 80                    ).
        beq     L96D4                           ; 96CF F0 03                    ..
L96D1:  stz     $03A0                           ; 96D1 9C A0 03                 ...
L96D4:  sec                                     ; 96D4 38                       8
        rts                                     ; 96D5 60                       `
; ----------------------------------------------------------------------------
L96D6:  stz     $E9                             ; 96D6 64 E9                    d.
        dec     $E9                             ; 96D8 C6 E9                    ..
L96DA:  inc     $E9                             ; 96DA E6 E9                    ..
        jsr     L89F9                           ; 96DC 20 F9 89                  ..
        bcc     L9719                           ; 96DF 90 38                    .8
L96E1:  ldx     $020B                           ; 96E1 AE 0B 02                 ...
        lda     $020A                           ; 96E4 AD 0A 02                 ...
        bne     L96EA                           ; 96E7 D0 01                    ..
        dex                                     ; 96E9 CA                       .
L96EA:  dec     a                               ; 96EA 3A                       :
        jsr     L8A87                           ; 96EB 20 87 8A                  ..
        ldy     #$02                            ; 96EE A0 02                    ..
        lda     ($E4),y                         ; 96F0 B1 E4                    ..
        bne     L96F5                           ; 96F2 D0 01                    ..
        dec     a                               ; 96F4 3A                       :
L96F5:  sta     $E0                             ; 96F5 85 E0                    ..
        lda     $E9                             ; 96F7 A5 E9                    ..
        bne     L9703                           ; 96F9 D0 08                    ..
L96FB:  lda     $E7                             ; 96FB A5 E7                    ..
        and     #$40                            ; 96FD 29 40                    )@
        beq     L9703                           ; 96FF F0 02                    ..
        iny                                     ; 9701 C8                       .
        iny                                     ; 9702 C8                       .
L9703:  iny                                     ; 9703 C8                       .
        lda     ($E4),y                         ; 9704 B1 E4                    ..
        phy                                     ; 9706 5A                       Z
        ldy     #$00                            ; 9707 A0 00                    ..
        jsr     FROM_C68D                       ; 9709 20 5C 03                  \.
        inc     $B2                             ; 970C E6 B2                    ..
        bne     L9712                           ; 970E D0 02                    ..
        inc     $B3                             ; 9710 E6 B3                    ..
L9712:  ply                                     ; 9712 7A                       z
        cpy     $E0                             ; 9713 C4 E0                    ..
        bne     L9703                           ; 9715 D0 EC                    ..
        .byte   $80                             ; 9717 80                       .
L9718:  .byte   $C1                             ; 9718 C1                       .
L9719:  .byte   $20                             ; 9719 20                        
L971A:  .byte   $E2                             ; 971A E2                       .
        bit     #$4C                            ; 971B 89 4C                    .L
        rmb1    $8D                             ; 971D 17 8D                    ..
L971F:  jsr     L9725                           ; 971F 20 25 97                  %.
        .byte   $4C                             ; 9722 4C                       L
        .byte   $3F                             ; 9723 3F                       ?
L9724:  .byte   $99                             ; 9724 99                       .
L9725:  jsr     L8C3B                           ; 9725 20 3B 8C                  ;.
        bcc     L972D                           ; 9728 90 03                    ..
        jsr     L8B46                           ; 972A 20 46 8B                  F.
L972D:  rts                                     ; 972D 60                       `
; ----------------------------------------------------------------------------
L972E:  lda     #$20                            ; 972E A9 20                    . 
L9730:  cpy     #$3C                            ; 9730 C0 3C                    .<
L9732:  rol     a                               ; 9732 2A                       *
        eor     #$01                            ; 9733 49 01                    I.
        ror     a                               ; 9735 6A                       j
        rts                                     ; 9736 60                       `
; ----------------------------------------------------------------------------
L9737:  jsr     L8C36                           ; 9737 20 36 8C                  6.
        lda     #$10                            ; 973A A9 10                    ..
        tsb     $E7                             ; 973C 04 E7                    ..
        ldy     FNlength                        ; 973E AC 87 03                 ...
        sty     $02D5                           ; 9741 8C D5 02                 ...
        jsr     L972E                           ; 9744 20 2E 97                  ..
        bcs     L974A                           ; 9747 B0 01                    ..
L9749:  rts                                     ; 9749 60                       `
; ----------------------------------------------------------------------------
L974A:  lda     #$AE                            ; 974A A9 AE                    ..
        sta     $034E                           ; 974C 8D 4E 03                 .N.
        dey                                     ; 974F 88                       .
        bmi     L9749                           ; 9750 30 F7                    0.
L9752:  jsr     FROM_C67B                       ; 9752 20 4A 03                  J.
        sta     $0295,y                         ; 9755 99 95 02                 ...
        dey                                     ; 9758 88                       .
        bpl     L9752                           ; 9759 10 F7                    ..
        bra     L9772                           ; 975B 80 15                    ..
L975D:  ldy     $02D5                           ; 975D AC D5 02                 ...
        jsr     L972E                           ; 9760 20 2E 97                  ..
        bcs     L9766                           ; 9763 B0 01                    ..
        rts                                     ; 9765 60                       `
; ----------------------------------------------------------------------------
L9766:  .byte   $99                             ; 9766 99                       .
L9767:  sta     $02,x                           ; 9767 95 02                    ..
        inc     $02D5                           ; 9769 EE D5 02                 ...
        cmp     #$0D                            ; 976C C9 0D                    ..
        beq     L9772                           ; 976E F0 02                    ..
        sec                                     ; 9770 38                       8
        rts                                     ; 9771 60                       `
; ----------------------------------------------------------------------------
L9772:  lda     $0295                           ; 9772 AD 95 02                 ...
L9775:  ldx     #$07                            ; 9775 A2 07                    ..
L9777:  cmp     L978E,x                         ; 9777 DD 8E 97                 ...
        beq     L9783                           ; 977A F0 07                    ..
        dex                                     ; 977C CA                       .
        .byte   $10                             ; 977D 10                       .
L977E:  sed                                     ; 977E F8                       .
        lda     #$1F                            ; 977F A9 1F                    ..
        clc                                     ; 9781 18                       .
        rts                                     ; 9782 60                       `
; ----------------------------------------------------------------------------
L9783:  txa                                     ; 9783 8A                       .
        and     #$FE                            ; 9784 29 FE                    ).
        pha                                     ; 9786 48                       H
        jsr     L979E                           ; 9787 20 9E 97                  ..
        plx                                     ; 978A FA                       .
        jmp     (L9796,x)                       ; 978B 7C 96 97                 |..
L978E:  eor     #$69                            ; 978E 49 69                    Ii
        eor     ($72)                           ; 9790 52 72                    Rr
L9792:  .byte   $53                             ; 9792 53                       S
        .byte   $73                             ; 9793 73                       s
        lsr     $76,x                           ; 9794 56 76                    Vv
L9796:  bbr6    $8C,L97A7                       ; 9796 6F 8C 0E                 o..
        tya                                     ; 9799 98                       .
        dec     $97,x                           ; 979A D6 97                    ..
        .byte   $42                             ; 979C 42                       B
        tya                                     ; 979D 98                       .
L979E:  ldy     $02D5                           ; 979E AC D5 02                 ...
        dey                                     ; 97A1 88                       .
        lda     #$96                            ; 97A2 A9 96                    ..
        ldx     #$02                            ; 97A4 A2 02                    ..
        .byte   $4C                             ; 97A6 4C                       L
L97A7:  ldx     $8E,y                           ; 97A7 B6 8E                    ..
L97A9:  jsr     L979E                           ; 97A9 20 9E 97                  ..
L97AC:  lda     ($E2)                           ; 97AC B2 E2                    ..
        inc     $E2                             ; 97AE E6 E2                    ..
        bne     L97B4                           ; 97B0 D0 02                    ..
        inc     $E3                             ; 97B2 E6 E3                    ..
L97B4:  dec     $039F                           ; 97B4 CE 9F 03                 ...
        beq     L97D2                           ; 97B7 F0 19                    ..
        cmp     #$3D                            ; 97B9 C9 3D                    .=
        bne     L97AC                           ; 97BB D0 EF                    ..
        jsr     L8EBD                           ; 97BD 20 BD 8E                  ..
        bcc     L97D4                           ; 97C0 90 12                    ..
        and     #$40                            ; 97C2 29 40                    )@
        ora     $03A4                           ; 97C4 0D A4 03                 ...
        ora     $03A3                           ; 97C7 0D A3 03                 ...
        ora     $03A0                           ; 97CA 0D A0 03                 ...
        bne     L97D2                           ; 97CD D0 03                    ..
        jmp     L8D9F                           ; 97CF 4C 9F 8D                 L..
; ----------------------------------------------------------------------------
L97D2:  lda     #$21                            ; 97D2 A9 21                    .!
L97D4:  clc                                     ; 97D4 18                       .
        rts                                     ; 97D5 60                       `
; ----------------------------------------------------------------------------
        bcs     L97DC                           ; 97D6 B0 04                    ..
L97D8:  lda     #$22                            ; 97D8 A9 22                    ."
        clc                                     ; 97DA 18                       .
        rts                                     ; 97DB 60                       `
; ----------------------------------------------------------------------------
L97DC:  bit     #$80                            ; 97DC 89 80                    ..
        beq     L97D8                           ; 97DE F0 F8                    ..
        and     #$20                            ; 97E0 29 20                    ) 
        ora     $03A4                           ; 97E2 0D A4 03                 ...
        ora     $03A3                           ; 97E5 0D A3 03                 ...
        bne     L97D8                           ; 97E8 D0 EE                    ..
        lda     #$00                            ; 97EA A9 00                    ..
        pha                                     ; 97EC 48                       H
L97ED:
L97EE           := * + 1
        jsr     L8D9F                           ; 97ED 20 9F 8D                  ..
        bcc     L9805                           ; 97F0 90 13                    ..
L97F2:  tsx                                     ; 97F2 BA                       .
L97F5           := * + 2
        inc     stack+1,x                       ; 97F3 FE 01 01                 ...
        jsr     L8D17                           ; 97F6 20 17 8D                  ..
        lda     $0218                           ; 97F9 AD 18 02                 ...
        and     #$80                            ; 97FC 29 80                    ).
        bne     L97ED                           ; 97FE D0 ED                    ..
        jsr     L89E2                           ; 9800 20 E2 89                  ..
        bra     L97ED                           ; 9803 80 E8                    ..
L9805:  pla                                     ; 9805 68                       h
        ldx     #$01                            ; 9806 A2 01                    ..
        ldy     #$00                            ; 9808 A0 00                    ..
        sec                                     ; 980A 38                       8
        jmp     L9964                           ; 980B 4C 64 99                 Ld.
; ----------------------------------------------------------------------------
        .byte   $90                             ; 980E 90                       .
L980F:  bmi     $979A                           ; 980F 30 89                    0.
        bra     $9803                           ; 9811 80 F0                    ..
        rol     a                               ; 9813 2A                       *
        and     #$40                            ; 9814 29 40                    )@
        ora     $03A0                           ; 9816 0D A0 03                 ...
        ora     $03A3                           ; 9819 0D A3 03                 ...
        .byte   $0D                             ; 981C 0D                       .
L981D:  ldy     $03                             ; 981D A4 03                    ..
        bne     L983E                           ; 981F D0 1D                    ..
        jsr     L8D9F                           ; 9821 20 9F 8D                  ..
        lda     #$3F                            ; 9824 A9 3F                    .?
        bcs     L9840                           ; 9826 B0 18                    ..
        jsr     L97A9                           ; 9828 20 A9 97                  ..
        bcc     L9840                           ; 982B 90 13                    ..
        jsr     L979E                           ; 982D 20 9E 97                  ..
        jsr     L8FF3                           ; 9830 20 F3 8F                  ..
L9833:  jsr     L8D5B                           ; 9833 20 5B 8D                  [.
        bcc     L9840                           ; 9836 90 08                    ..
        jsr     L97A9                           ; 9838 20 A9 97                  ..
        jmp     L8D17                           ; 983B 4C 17 8D                 L..
; ----------------------------------------------------------------------------
L983E:  lda     #$21                            ; 983E A9 21                    .!
L9840:  clc                                     ; 9840 18                       .
        rts                                     ; 9841 60                       `
; ----------------------------------------------------------------------------
        jsr     L8C6F                           ; 9842 20 6F 8C                  o.
        jsr     KL_RAMTAS                       ; 9845 20 A8 86                  ..
        cpx     $0209                           ; 9848 EC 09 02                 ...
        beq     L985B                           ; 984B F0 0E                    ..
L984D:  stx     $0209                           ; 984D 8E 09 02                 ...
        sta     $0208                           ; 9850 8D 08 02                 ...
        stx     $020B                           ; 9853 8E 0B 02                 ...
        sta     $020A                           ; 9856 8D 0A 02                 ...
        sec                                     ; 9859 38                       8
        rts                                     ; 985A 60                       `
; ----------------------------------------------------------------------------
L985B:  cmp     $0208                           ; 985B CD 08 02                 ...
        bne     L984D                           ; 985E D0 ED                    ..
        cpx     $020A                           ; 9860 EC 0A 02                 ...
        bcc     L984D                           ; 9863 90 E8                    ..
        bne     L986C                           ; 9865 D0 05                    ..
        cmp     $020A                           ; 9867 CD 0A 02                 ...
        bcc     L984D                           ; 986A 90 E1                    ..
L986C:  jsr     L8CBB                           ; 986C 20 BB 8C                  ..
        bne     L9890                           ; 986F D0 1F                    ..
L9871:  jsr     L8CC3                           ; 9871 20 C3 8C                  ..
        bcc     L988B                           ; 9874 90 15                    ..
        jsr     L8CD1                           ; 9876 20 D1 8C                  ..
        jsr     L8AD5                           ; 9879 20 D5 8A                  ..
        ldy     #$02                            ; 987C A0 02                    ..
        lda     $EA                             ; 987E A5 EA                    ..
        sta     ($E4),y                         ; 9880 91 E4                    ..
L9882:  inc     $E9                             ; 9882 E6 E9                    ..
        beq     L9890                           ; 9884 F0 0A                    ..
        jsr     L89F9                           ; 9886 20 F9 89                  ..
        bra     L9882                           ; 9889 80 F7                    ..
L988B:  bit     $039D                           ; 988B 2C 9D 03                 ,..
        bpl     L9871                           ; 988E 10 E1                    ..
L9890:  jsr     L8CBB                           ; 9890 20 BB 8C                  ..
        .byte   $90                             ; 9893 90                       .
L9894:  .byte   $3B                             ; 9894 3B                       ;
        bra     L98AB                           ; 9895 80 14                    ..
L9897:  jsr     L8CC3                           ; 9897 20 C3 8C                  ..
        .byte   $90                             ; 989A 90                       .
L989B:  bit     $20,x                           ; 989B 34 20                    4 
        rol     a                               ; 989D 2A                       *
L989E:  sty     $18AD                           ; 989E 8C AD 18                 ...
        .byte   $02                             ; 98A1 02                       .
        bit     #$80                            ; 98A2 89 80                    ..
        bne     L98B4                           ; 98A4 D0 0E                    ..
        lda     $0219                           ; 98A6 AD 19 02                 ...
        sta     $E8                             ; 98A9 85 E8                    ..
L98AB:  jsr     L8AD5                           ; 98AB 20 D5 8A                  ..
        bcs     L98B9                           ; 98AE B0 09                    ..
        lda     $E9                             ; 98B0 A5 E9                    ..
        beq     L9897                           ; 98B2 F0 E3                    ..
L98B4:  jsr     L8D17                           ; 98B4 20 17 8D                  ..
        bra     L9890                           ; 98B7 80 D7                    ..
L98B9:  inc     $E9                             ; 98B9 E6 E9                    ..
        ldy     #$02                            ; 98BB A0 02                    ..
        lda     ($E4),y                         ; 98BD B1 E4                    ..
        beq     L98AB                           ; 98BF F0 EA                    ..
        lda     $E9                             ; 98C1 A5 E9                    ..
        pha                                     ; 98C3 48                       H
        jsr     L8DE0                           ; 98C4 20 E0 8D                  ..
        sta     $E9                             ; 98C7 85 E9                    ..
        pla                                     ; 98C9 68                       h
        cmp     $E9                             ; 98CA C5 E9                    ..
        .byte   $D0                             ; 98CC D0                       .
L98CD:  inc     $80                             ; 98CD E6 80                    ..
        .byte   $C7                             ; 98CF C7                       .
L98D0:  ldx     #$3F                            ; 98D0 A2 3F                    .?
L98D2:  stz     $0295,x                         ; 98D2 9E 95 02                 ...
        dex                                     ; 98D5 CA                       .
        bpl     L98D2                           ; 98D6 10 FA                    ..
        inc     $0295                           ; 98D8 EE 95 02                 ...
        jsr     L8CBB                           ; 98DB 20 BB 8C                  ..
L98DE:  bcc     L9917                           ; 98DE 90 37                    .7
        bra     L98E5                           ; 98E0 80 03                    ..
L98E2:  jsr     L8D17                           ; 98E2 20 17 8D                  ..
L98E5:  jsr     L8CBB                           ; 98E5 20 BB 8C                  ..
L98E8:  bra     L98ED                           ; 98E8 80 03                    ..
L98EA:  jsr     L8CC3                           ; 98EA 20 C3 8C                  ..
L98ED:  bcc     L9917                           ; 98ED 90 28                    .(
        jsr     L9932                           ; 98EF 20 32 99                  2.
        and     $0295,y                         ; 98F2 39 95 02                 9..
        bne     L98E2                           ; 98F5 D0 EB                    ..
        lda     PowersOfTwo,x                   ; 98F7 BD 41 B0                 .A.
        ora     $0295,y                         ; 98FA 19 95 02                 ...
        sta     $0295,y                         ; 98FD 99 95 02                 ...
        lda     #$30                            ; 9900 A9 30                    .0
        trb     $0218                           ; 9902 1C 18 02                 ...
        bne     L990F                           ; 9905 D0 08                    ..
        lda     $0219                           ; 9907 AD 19 02                 ...
        jsr     L8E20                           ; 990A 20 20 8E                   .
        bcs     L98EA                           ; 990D B0 DB                    ..
L990F:  jsr     L8D17                           ; 990F 20 17 8D                  ..
        jsr     L8D5B                           ; 9912 20 5B 8D                  [.
        bra     L98D0                           ; 9915 80 B9                    ..
L9917:  jsr     L8A81                           ; 9917 20 81 8A                  ..
L991A:  beq     L9930                           ; 991A F0 14                    ..
L991C:  lda     ($E4)                           ; 991C B2 E4                    ..
        jsr     L9932                           ; 991E 20 32 99                  2.
        and     $0295,y                         ; 9921 39 95 02                 9..
        bne     L992B                           ; 9924 D0 05                    ..
        jsr     L89FF                           ; 9926 20 FF 89                  ..
        bra     L9917                           ; 9929 80 EC                    ..
L992B:  jsr     L8A61                           ; 992B 20 61 8A                  a.
        bcs     L991C                           ; 992E B0 EC                    ..
L9930:  sec                                     ; 9930 38                       8
        rts                                     ; 9931 60                       `
; ----------------------------------------------------------------------------
L9932:  pha                                     ; 9932 48                       H
        lsr     a                               ; 9933 4A                       J
        lsr     a                               ; 9934 4A                       J
        lsr     a                               ; 9935 4A                       J
        tay                                     ; 9936 A8                       .
        pla                                     ; 9937 68                       h
        and     #$07                            ; 9938 29 07                    ).
        tax                                     ; 993A AA                       .
        lda     PowersOfTwo,x                   ; 993B BD 41 B0                 .A.
L993E:  rts                                     ; 993E 60                       `
; ----------------------------------------------------------------------------
L993F:  tax                                     ; 993F AA                       .
        lda     #$00                            ; 9940 A9 00                    ..
        bcs     L9955                           ; 9942 B0 11                    ..
        lda     $E8                             ; 9944 A5 E8                    ..
        ldy     $E9                             ; 9946 A4 E9                    ..
        jsr     L9964                           ; 9948 20 64 99                  d.
        lda     #$04                            ; 994B A9 04                    ..
        cpx     #$19                            ; 994D E0 19                    ..
        bne     L9953                           ; 994F D0 02                    ..
        ora     #$08                            ; 9951 09 08                    ..
L9953:  ldx     #$0D                            ; 9953 A2 0D                    ..
L9955:  bit     $039D                           ; 9955 2C 9D 03                 ,..
        bpl     L995C                           ; 9958 10 02                    ..
        ora     #$40                            ; 995A 09 40                    .@
L995C:  sta     ST                              ; 995C 85 BA                    ..
        stz     $039D                           ; 995E 9C 9D 03                 ...
        txa                                     ; 9961 8A                       .
L9962:  clc                                     ; 9962 18                       .
        rts                                     ; 9963 60                       `
; ----------------------------------------------------------------------------
L9964:  stx     $0210                           ; 9964 8E 10 02                 ...
        sta     $0211                           ; 9967 8D 11 02                 ...
        sty     $0212                           ; 996A 8C 12 02                 ...
        .byte   $9C                             ; 996D 9C                       .
        .byte   $17                             ; 996E 17                       .
L996F:  .byte   $02                             ; 996F 02                       .
        rts                                     ; 9970 60                       `
; ----------------------------------------------------------------------------
L9971:  .byte   "CHANNEL"                       ; 9971 43 48 41 4E 4E 45 4C     CHANNEL
        .byte   $00                             ; 9978 00                       .
        .byte   "COMMAND"                       ; 9979 43 4F 4D 4D 41 4E 44     COMMAND
        .byte   $00                             ; 9980 00                       .
        .byte   "DIRECTORY"                     ; 9981 44 49 52 45 43 54 4F 52  DIRECTOR
                                                ; 9989 59                       Y
        .byte   $00                             ; 998A 00                       .
        .byte   "DISK"                          ; 998B 44 49 53 4B              DISK
        .byte   $00                             ; 998F 00                       .
        .byte   "DOS"                           ; 9990 44 4F 53                 DOS
        .byte   $00                             ; 9993 00                       .
        .byte   "ERROR"                         ; 9994 45 52 52 4F 52           ERROR
        .byte   $00                             ; 9999 00                       .
L999A:  .byte   "EXISTS"                        ; 999A 45 58 49 53 54 53        EXISTS
        .byte   $00                             ; 99A0 00                       .
        .byte   "F"                             ; 99A1 46                       F
L99A2:  .byte   "ILE"                           ; 99A2 49 4C 45                 ILE
        .byte   $00                             ; 99A5 00                       .
L99A6:  .byte   "FILES"                         ; 99A6 46 49 4C 45 53           FILES
        .byte   $00                             ; 99AB 00                       .
        .byte   "FOUND"                         ; 99AC 46 4F 55 4E 44           FOUND
        .byte   $00                             ; 99B1 00                       .
        .byte   "FULL"                          ; 99B2 46 55 4C 4C              FULL
        .byte   $00                             ; 99B6 00                       .
        .byte   "ILLEGAL"                       ; 99B7 49 4C 4C 45 47 41 4C     ILLEGAL
        .byte   $00                             ; 99BE 00                       .
        .byte   "INVALID"                       ; 99BF 49 4E 56 41 4C 49 44     INVALID
        .byte   $00                             ; 99C6 00                       .
        .byte   "LARGE"                         ; 99C7 4C 41 52 47 45           LARGE
        .byte   $00                             ; 99CC 00                       .
        .byte   "LINE"                          ; 99CD 4C 49 4E 45              LINE
        .byte   $00                             ; 99D1 00                       .
        .byte   "LONG"                          ; 99D2 4C 4F 4E 47              LONG
        .byte   $00                             ; 99D6 00                       .
        .byte   "MISMATCH"                      ; 99D7 4D 49 53 4D 41 54 43 48  MISMATCH
        .byte   $00                             ; 99DF 00                       .
        .byte   "NO"                            ; 99E0 4E 4F                    NO
        .byte   $00                             ; 99E2 00                       .
        .byte   "NOT"                           ; 99E3 4E 4F 54                 NOT
        .byte   $00                             ; 99E6 00                       .
        .byte   "OK"                            ; 99E7 4F 4B                    OK
        .byte   $00                             ; 99E9 00                       .
        .byte   "OPEN"                          ; 99EA 4F 50 45 4E              OPEN
        .byte   $00                             ; 99EE 00                       .
        .byte   "PROTECT"                       ; 99EF 50 52 4F 54 45 43 54     PROTECT
        .byte   $00                             ; 99F6 00                       .
        .byte   "READ"                          ; 99F7 52 45 41 44              READ
        .byte   $00                             ; 99FB 00                       .
        .byte   "SCRATCHED"                     ; 99FC 53 43 52 41 54 43 48 45  SCRATCHE
                                                ; 9A04 44                       D
        .byte   $00                             ; 9A05 00                       .
        .byte   "SYNTAX"                        ; 9A06 53 59 4E 54 41 58        SYNTAX
        .byte   $00                             ; 9A0C 00                       .
        .byte   "SYSTEM"                        ; 9A0D 53 59 53 54 45 4D        SYSTEM
        .byte   $00                             ; 9A13 00                       .
        .byte   "T&S"                           ; 9A14 54 26 53                 T&S
        .byte   $00                             ; 9A17 00                       .
        .byte   "TOO"                           ; 9A18 54 4F 4F                 TOO
        .byte   $00                             ; 9A1B 00                       .
        .byte   "TYPE"                          ; 9A1C 54 59 50 45              TYPE
        .byte   $00                             ; 9A20 00                       .
        .byte   "VERIFY"                        ; 9A21 56 45 52 49 46 59        VERIFY
        .byte   $00                             ; 9A27 00                       .
        .byte   "WR"                            ; 9A28 57 52                    WR
L9A2A:  .byte   "I"                             ; 9A2A 49                       I
L9A2B:  .byte   "TE"                            ; 9A2B 54 45                    TE
        .byte   $00,$00                         ; 9A2D 00 00                    ..
; ----------------------------------------------------------------------------
        .byte   $77,$00,$00,$01,$36,$8C,$00,$14 ; 9A2F 77 00 00 01 36 8C 00 14  w...6...
        .byte   $47,$A4,$00,$19,$B8,$B1,$24,$1A ; 9A37 47 A4 00 19 B8 B1 24 1A  G.....$.
        .byte   $B8,$7F,$24,$1B,$87,$24,$00,$1F ; 9A3F B8 7F 24 1B 87 24 00 1F  ..$..$..
        .byte   $4F,$09,$00,$20,$62,$5D,$00,$21 ; 9A47 4F 09 00 20 62 5D 00 21  O.. b].!
        .byte   $96,$24,$00,$21,$96,$24,$00,$22 ; 9A4F 96 24 00 21 96 24 00 22  .$.!.$."
        .byte   $96,$24,$00,$27,$96,$24,$00,$34 ; 9A57 96 24 00 27 96 24 00 34  .$.'.$.4
        .byte   $31,$A8,$57,$3C,$B8,$31,$7A,$3D ; 9A5F 31 A8 57 3C B8 31 7A 3D  1.W<.1z=
        .byte   $31,$73,$7A                     ; 9A67 31 73 7A                 1sz
L9A6A:  .byte   $3E,$31,$73,$3C,$3F,$31,$2A,$00 ; 9A6A 3E 31 73 3C 3F 31 2A 00  >1s<?1*.
        .byte   $40,$31,$AC,$67,$43,$47,$9D,$A4 ; 9A72 40 31 AC 67 43 47 9D A4  @1.gCG..
        .byte   $46,$70,$01,$00,$47,$11,$24,$00 ; 9A7A 46 70 01 00 47 11 24 00  Fp..G.$.
        .byte   $47,$11,$24,$00,$48             ; 9A82 47 11 24 00 48           G.$.H
L9A87:  .byte   $1B,$42,$00,$49,$20,$67,$24     ; 9A87 1B 42 00 49 20 67 24     .B.I g$
L9A8E:  .byte   $00,$01,$02,$80,$81,$82,$83,$84 ; 9A8E 00 01 02 80 81 82 83 84  ........
        .byte   $85,$86,$87,$88                 ; 9A96 85 86 87 88              ....
L9A9A:  .byte   $41,$81,$10,$22,$42,$82,$10,$23 ; 9A9A 41 81 10 22 42 82 10 23  A.."B..#
        .byte   $43,$83,$00                     ; 9AA2 43 83 00                 C..
; ----------------------------------------------------------------------------
L9AA5:  lda     $0217                           ; 9AA5 AD 17 02                 ...
        inc     $0217                           ; 9AA8 EE 17 02                 ...
        ldy     #$0B                            ; 9AAB A0 0B                    ..
L9AAD:  cmp     L9A8E,y                         ; 9AAD D9 8E 9A                 ...
        beq     L9AB8                           ; 9AB0 F0 06                    ..
        dey                                     ; 9AB2 88                       .
        bpl     L9AAD                           ; 9AB3 10 F8                    ..
        jmp     L9AE8                           ; 9AB5 4C E8 9A                 L..
; ----------------------------------------------------------------------------
L9AB8:  lda     L9A9A,y                         ; 9AB8 B9 9A 9A                 ...
        bne     L9ACD                           ; 9ABB D0 10                    ..
        tax                                     ; 9ABD AA                       .
        tay                                     ; 9ABE A8                       .
        .byte   $20                             ; 9ABF 20                        
        .byte   $64                             ; 9AC0 64                       d
L9AC1:  sta     $6E38,y                         ; 9AC1 99 38 6E                 .8n
        sta     $A903,x                         ; 9AC4 9D 03 A9                 ...
        .byte   $0D                             ; 9AC7 0D                       .
        .byte   $2C                             ; 9AC8 2C                       ,
L9AC9:  lda     #$2C                            ; 9AC9 A9 2C                    .,
        sec                                     ; 9ACB 38                       8
        rts                                     ; 9ACC 60                       `
; ----------------------------------------------------------------------------
L9ACD:  bit     #$10                            ; 9ACD 89 10                    ..
        bne     L9AC9                           ; 9ACF D0 F8                    ..
        sta     $E0                             ; 9AD1 85 E0                    ..
        and     #$03                            ; 9AD3 29 03                    ).
L9AD5:  tax                                     ; 9AD5 AA                       .
        lda     $020F,x                         ; 9AD6 BD 0F 02                 ...
        jsr     L886A                           ; 9AD9 20 6A 88                  j.
        bit     $E0                             ; 9ADC 24 E0                    $.
        bmi     L9AE4                           ; 9ADE 30 04                    0.
        txa                                     ; 9AE0 8A                       .
        bvs     L9AE4                           ; 9AE1 70 01                    p.
        tya                                     ; 9AE3 98                       .
L9AE4:  .byte   $09                             ; 9AE4 09                       .
L9AE5:  bmi     L9B1F                           ; 9AE5 30 38                    08
        rts                                     ; 9AE7 60                       `
; ----------------------------------------------------------------------------
L9AE8:  dec     a                               ; 9AE8 3A                       :
        sta     $E0                             ; 9AE9 85 E0                    ..
        ldx     #$00                            ; 9AEB A2 00                    ..
        lda     $0210                           ; 9AED AD 10 02                 ...
L9AF0:  inx                                     ; 9AF0 E8                       .
        inx                                     ; 9AF1 E8                       .
        inx                                     ; 9AF2 E8                       .
        inx                                     ; 9AF3 E8                       .
        beq     L9B12                           ; 9AF4 F0 1C                    ..
        cmp     L9A2A,x                         ; 9AF6 DD 2A 9A                 .*.
        bne     L9AF0                           ; 9AF9 D0 F5                    ..
L9AFB:  lda     #$20                            ; 9AFB A9 20                    . 
        ldy     L9A2B,x                         ; 9AFD BC 2B 9A                 .+.
        .byte   $F0                             ; 9B00 F0                       .
L9B01:  .byte   $10                             ; 9B01 10                       .
L9B02:  dec     $E0                             ; 9B02 C6 E0                    ..
        beq     L9B19                           ; 9B04 F0 13                    ..
        iny                                     ; 9B06 C8                       .
        lda     L996F,y                         ; 9B07 B9 6F 99                 .o.
        bne     L9B02                           ; 9B0A D0 F6                    ..
        inx                                     ; 9B0C E8                       .
        txa                                     ; 9B0D 8A                       .
        and     #$03                            ; 9B0E 29 03                    ).
        bne     L9AFB                           ; 9B10 D0 E9                    ..
L9B12:  lda     #$80                            ; 9B12 A9 80                    ..
        sta     $0217                           ; 9B14 8D 17 02                 ...
        lda     #$2C                            ; 9B17 A9 2C                    .,
L9B19:  sec                                     ; 9B19 38                       8
        rts                                     ; 9B1A 60                       `
; ----------------------------------------------------------------------------
L9B1B:  jmp     (L9B1E,x)                       ; 9B1B 7C 1E 9B                 |..
L9B1E:  .byte   $F6                             ; 9B1E F6                       .
L9B1F:  .byte   $9B                             ; 9B1F 9B                       .
        phx                                     ; 9B20 DA                       .
        .byte   $9B                             ; 9B21 9B                       .
        .byte   $73                             ; 9B22 73                       s
L9B23:  ldy     $6B                             ; 9B23 A4 6B                    .k
        stz     L9BE0                           ; 9B25 9C E0 9B                 ...
        cmp     (CursorY),y                     ; 9B28 D1 A2                    ..
        ldy     $9C                             ; 9B2A A4 9C                    ..
        smb2    $9C                             ; 9B2C A7 9C                    ..
        .byte   $BB                             ; 9B2E BB                       .
        .byte   $9C                             ; 9B2F 9C                       .
        .byte   $BE                             ; 9B30 BE                       .
L9B31:  stz     L9F60                           ; 9B31 9C 60 9F                 .`.
        .byte   $63                             ; 9B34 63                       c
        bbs1    $F6,$F6                         ; 9B35 9F F6 A0                 ...
        sbc     LF0A0,y                         ; 9B38 F9 A0 F0                 ...
        stz     LA369,x                         ; 9B3B 9E 69 A3                 .i.
        adc     (CurMaxY_,x)                    ; 9B3E 61 A6                    a.
        smb2    CurMaxY_                        ; 9B40 A7 A6                    ..
        phy                                     ; 9B42 5A                       Z
        ldx     $6B                             ; 9B43 A6 6B                    .k
        ldx     $2B                             ; 9B45 A6 2B                    .+
        smb2    $48                             ; 9B47 A7 48                    .H
        tay                                     ; 9B49 A8                       .
        bbr4    $A8,L9AE5                       ; 9B4A 4F A8 98                 O..
        tay                                     ; 9B4D A8                       .
        and     L8AA9                           ; 9B4E 2D A9 8A                 -..
        ldx     #$D9                            ; 9B51 A2 D9                    ..
        ldx     #$9A                            ; 9B53 A2 9A                    ..
        ldx     #$DC                            ; 9B55 A2 DC                    ..
        ldx     #$DB                            ; 9B57 A2 DB                    ..
        smb2    $2B                             ; 9B59 A7 2B                    .+
        ldy     #$F1                            ; 9B5B A0 F1                    ..
        bbs1    $DB,L9B01                       ; 9B5D 9F DB A1                 ...
        cmp     $1AA1,x                         ; 9B60 DD A1 1A                 ...
        ldx     #$6B                            ; 9B63 A2 6B                    .k
        ldx     #$7B                            ; 9B65 A2 7B                    .{
        ldx     #$AB                            ; 9B67 A2 AB                    ..
        ldx     #$CD                            ; 9B69 A2 CD                    ..
        ldx     #$D5                            ; 9B6B A2 D5                    ..
        ldx     #$38                            ; 9B6D A2 38                    .8
        .byte   $A3                             ; 9B6F A3                       .
        and     (CurMaxX_,x)                    ; 9B70 21 A4                    !.
        stx     $A3,y                           ; 9B72 96 A3                    ..
        rol     CursorY                         ; 9B74 26 A2                    &.
        adc     CurMaxX_,x                      ; 9B76 75 A4                    u.
        tay                                     ; 9B78 A8                       .
        ldx     #$D8                            ; 9B79 A2 D8                    ..
        smb2    L004E                           ; 9B7B A7 4E                    .N
        bbs1    $42,L9B1F                       ; 9B7D 9F 42 9F                 .B.
        .byte   $33                             ; 9B80 33                       3
        bbs1    $5A,L9B23                       ; 9B81 9F 5A 9F                 .Z.
        bbr5    CurMaxY_,L9BF4                  ; 9B84 5F A6 6D                 _.m
        ldy     #$B7                            ; 9B87 A0 B7                    ..
        lda     ($CE,x)                         ; 9B89 A1 CE                    ..
        .byte   $9B                             ; 9B8B 9B                       .
        bbs1    $9B,L9B31                       ; 9B8C 9F 9B A2                 ...
        .byte   $9B                             ; 9B8F 9B                       .
        tya                                     ; 9B90 98                       .
        .byte   $9B                             ; 9B91 9B                       .
        .byte   $9B                             ; 9B92 9B                       .
        .byte   $9B                             ; 9B93 9B                       .
        dec     $A9                             ; 9B94 C6 A9                    ..
        cmp     #$A9                            ; 9B96 C9 A9                    ..
        jsr     LA02B                           ; 9B98 20 2B A0                  +.
        ldy     #$FF                            ; 9B9B A0 FF                    ..
        bra     L9BA4                           ; 9B9D 80 05                    ..
        jsr     LA02B                           ; 9B9F 20 2B A0                  +.
        ldy     #$00                            ; 9BA2 A0 00                    ..
L9BA4:  sty     $49                             ; 9BA4 84 49                    .I
        jsr     L9BF6                           ; 9BA6 20 F6 9B                  ..
        lda     $2B                             ; 9BA9 A5 2B                    .+
        eor     $49                             ; 9BAB 45 49                    EI
        sta     $00                             ; 9BAD 85 00                    ..
        lda     $2C                             ; 9BAF A5 2C                    .,
        eor     $49                             ; 9BB1 45 49                    EI
        sta     $01                             ; 9BB3 85 01                    ..
        jsr     LA26B                           ; 9BB5 20 6B A2                  k.
        jsr     L9BF6                           ; 9BB8 20 F6 9B                  ..
        lda     $2C                             ; 9BBB A5 2C                    .,
        eor     $49                             ; 9BBD 45 49                    EI
        and     $01                             ; 9BBF 25 01                    %.
        eor     $49                             ; 9BC1 45 49                    EI
        tay                                     ; 9BC3 A8                       .
        lda     $2B                             ; 9BC4 A5 2B                    .+
        eor     $49                             ; 9BC6 45 49                    EI
        and     $00                             ; 9BC8 25 00                    %.
        eor     $49                             ; 9BCA 45 49                    EI
        bra     L9BDA                           ; 9BCC 80 0C                    ..
        jsr     L9BF6                           ; 9BCE 20 F6 9B                  ..
        lda     $2C                             ; 9BD1 A5 2C                    .,
        eor     #$FF                            ; 9BD3 49 FF                    I.
        tay                                     ; 9BD5 A8                       .
        lda     $2B                             ; 9BD6 A5 2B                    .+
        eor     #$FF                            ; 9BD8 49 FF                    I.
L9BDA:  jsr     L9C60                           ; 9BDA 20 60 9C                  `.
L9BDD:  jmp     LA2B3                           ; 9BDD 4C B3 A2                 L..
; ----------------------------------------------------------------------------
L9BE0:  lda     $2D                             ; 9BE0 A5 2D                    .-
        bmi     L9C05                           ; 9BE2 30 21                    0!
        lda     $25                             ; 9BE4 A5 25                    .%
        cmp     #$91                            ; 9BE6 C9 91                    ..
        bcs     L9C05                           ; 9BE8 B0 1B                    ..
        jsr     LA338                           ; 9BEA 20 38 A3                  8.
        .byte   $A5                             ; 9BED A5                       .
L9BEE:  .byte   $2B                             ; 9BEE 2B                       +
        ldy     $2C                             ; 9BEF A4 2C                    .,
        sty     $06                             ; 9BF1 84 06                    ..
        .byte   $85                             ; 9BF3 85                       .
L9BF4:  rmb0    $60                             ; 9BF4 07 60                    .`
L9BF6:  lda     $25                             ; 9BF6 A5 25                    .%
        cmp     #$90                            ; 9BF8 C9 90                    ..
        bcc     L9C0A                           ; 9BFA 90 0E                    ..
        lda     #$58                            ; 9BFC A9 58                    .X
        ldy     #$9C                            ; 9BFE A0 9C                    ..
        jsr     LA2DC                           ; 9C00 20 DC A2                  ..
        beq     L9C0A                           ; 9C03 F0 05                    ..
L9C05:  ldx     #$0E                            ; 9C05 A2 0E                    ..
        jmp     LFB4B                           ; 9C07 4C 4B FB                 LK.
; ----------------------------------------------------------------------------
L9C0A:  .byte   $4C                             ; 9C0A 4C                       L
        sec                                     ; 9C0B 38                       8
L9C0C:  .byte   $A3                             ; 9C0C A3                       .
L9C0D:  inc     $3F                             ; 9C0D E6 3F                    .?
        bne     L9C13                           ; 9C0F D0 02                    ..
        inc     $40                             ; 9C11 E6 40                    .@
L9C13:  sei                                     ; 9C13 78                       x
        ldy     #$00                            ; 9C14 A0 00                    ..
        lda     #$3F                            ; 9C16 A9 3F                    .?
        sta     $034E                           ; 9C18 8D 4E 03                 .N.
        jsr     FROM_C67B                       ; 9C1B 20 4A 03                  J.
        cli                                     ; 9C1E 58                       X
        cmp     #$3A                            ; 9C1F C9 3A                    .:
        bcs     L9C2D                           ; 9C21 B0 0A                    ..
        cmp     #$20                            ; 9C23 C9 20                    . 
        beq     L9C0D                           ; 9C25 F0 E6                    ..
        sec                                     ; 9C27 38                       8
        sbc     #$30                            ; 9C28 E9 30                    .0
        sec                                     ; 9C2A 38                       8
        sbc     #$D0                            ; 9C2B E9 D0                    ..
L9C2D:  rts                                     ; 9C2D 60                       `
; ----------------------------------------------------------------------------
L9C2E:  lda     #$3F                            ; 9C2E A9 3F                    .?
        sta     $034E                           ; 9C30 8D 4E 03                 .N.
        jmp     FROM_C67B                       ; 9C33 4C 4A 03                 LJ.
; ----------------------------------------------------------------------------
L9C36:  lda     #$08                            ; 9C36 A9 08                    ..
        sta     $034E                           ; 9C38 8D 4E 03                 .N.
        .byte   $4C                             ; 9C3B 4C                       L
L9C3C:  lsr     a                               ; 9C3C 4A                       J
        .byte   $03                             ; 9C3D 03                       .
L9C3E:  lda     #$08                            ; 9C3E A9 08                    ..
        sta     $0357                           ; 9C40 8D 57 03                 .W.
        jmp     FROM_C684                       ; 9C43 4C 53 03                 LS.
; ----------------------------------------------------------------------------
L9C46:  lda     #$0A                            ; 9C46 A9 0A                    ..
        sta     $034E                           ; 9C48 8D 4E 03                 .N.
        jmp     FROM_C67B                       ; 9C4B 4C 4A 03                 LJ.
; ----------------------------------------------------------------------------
L9C4E:  pha                                     ; 9C4E 48                       H
        lda     #$0A                            ; 9C4F A9 0A                    ..
        sta     $0360                           ; 9C51 8D 60 03                 .`.
        pla                                     ; 9C54 68                       h
        jmp     FROM_C68D                       ; 9C55 4C 5C 03                 L\.
; ----------------------------------------------------------------------------
        bcc     L9BDA                           ; 9C58 90 80                    ..
        brk                                     ; 9C5A 00                       .
        brk                                     ; 9C5B 00                       .
        brk                                     ; 9C5C 00                       .
        brk                                     ; 9C5D 00                       .
        brk                                     ; 9C5E 00                       .
        brk                                     ; 9C5F 00                       .
L9C60:  ldx     #$00                            ; 9C60 A2 00                    ..
        .byte   $86                             ; 9C62 86                       .
L9C63:  .byte   $02                             ; 9C63 02                       .
        sta     $26                             ; 9C64 85 26                    .&
        sty     $27                             ; 9C66 84 27                    .'
        ldx     #$90                            ; 9C68 A2 90                    ..
        rts                                     ; 9C6A 60                       `
; ----------------------------------------------------------------------------
        ldx     $3F                             ; 9C6B A6 3F                    .?
        ldy     $40                             ; 9C6D A4 40                    .@
        stx     $3B                             ; 9C6F 86 3B                    .;
        sty     $3C                             ; 9C71 84 3C                    .<
        ldx     $08                             ; 9C73 A6 08                    ..
        stx     $3F                             ; 9C75 86 3F                    .?
        clc                                     ; 9C77 18                       .
        adc     $08                             ; 9C78 65 08                    e.
        sta     $0A                             ; 9C7A 85 0A                    ..
        ldx     $09                             ; 9C7C A6 09                    ..
        stx     $40                             ; 9C7E 86 40                    .@
        bcc     L9C83                           ; 9C80 90 01                    ..
        inx                                     ; 9C82 E8                       .
L9C83:  stx     $0B                             ; 9C83 86 0B                    ..
        ldy     #$00                            ; 9C85 A0 00                    ..
        jsr     L9C46                           ; 9C87 20 46 9C                  F.
        pha                                     ; 9C8A 48                       H
        tya                                     ; 9C8B 98                       .
        jsr     L9C4E                           ; 9C8C 20 4E 9C                  N.
        jsr     L9C13                           ; 9C8F 20 13 9C                  ..
        jsr     LA396                           ; 9C92 20 96 A3                  ..
        pla                                     ; 9C95 68                       h
        ldy     #$00                            ; 9C96 A0 00                    ..
        jsr     L9C4E                           ; 9C98 20 4E 9C                  N.
        ldx     $3B                             ; 9C9B A6 3B                    .;
        ldy     $3C                             ; 9C9D A4 3C                    .<
        stx     $3F                             ; 9C9F 86 3F                    .?
        sty     $40                             ; 9CA1 84 40                    .@
L9CA3:  rts                                     ; 9CA3 60                       `
; ----------------------------------------------------------------------------
        jsr     LA02B                           ; 9CA4 20 2B A0                  +.
L9CA7:  lda     $2D                             ; 9CA7 A5 2D                    .-
        eor     #$FF                            ; 9CA9 49 FF                    I.
        sta     $2D                             ; 9CAB 85 2D                    .-
        eor     $38                             ; 9CAD 45 38                    E8
        sta     $39                             ; 9CAF 85 39                    .9
        lda     $25                             ; 9CB1 A5 25                    .%
        jmp     L9CBE                           ; 9CB3 4C BE 9C                 L..
; ----------------------------------------------------------------------------
L9CB6:  jsr     L9E56                           ; 9CB6 20 56 9E                  V.
        bcc     L9CF7                           ; 9CB9 90 3C                    .<
        .byte   $20                             ; 9CBB 20                        
        .byte   $2B                             ; 9CBC 2B                       +
L9CBD:  .byte   $A0                             ; 9CBD A0                       .
L9CBE:  bne     L9CC3                           ; 9CBE D0 03                    ..
        jmp     LA26B                           ; 9CC0 4C 6B A2                 Lk.
; ----------------------------------------------------------------------------
L9CC3:  ldx     $3A                             ; 9CC3 A6 3A                    .:
        stx     $14                             ; 9CC5 86 14                    ..
        ldx     #$30                            ; 9CC7 A2 30                    .0
        lda     $30                             ; 9CC9 A5 30                    .0
L9CCB:  tay                                     ; 9CCB A8                       .
        beq     L9CA3                           ; 9CCC F0 D5                    ..
        sec                                     ; 9CCE 38                       8
        sbc     $25                             ; 9CCF E5 25                    .%
        beq     L9CF7                           ; 9CD1 F0 24                    .$
        bcc     L9CE7                           ; 9CD3 90 12                    ..
        .byte   $84                             ; 9CD5 84                       .
L9CD6:  and     CurMaxX_                        ; 9CD6 25 A4                    %.
        sec                                     ; 9CD8 38                       8
        sty     $2D                             ; 9CD9 84 2D                    .-
L9CDB:  eor     #$FF                            ; 9CDB 49 FF                    I.
        adc     #$00                            ; 9CDD 69 00                    i.
        ldy     #$00                            ; 9CDF A0 00                    ..
        sty     $14                             ; 9CE1 84 14                    ..
        ldx     #$25                            ; 9CE3 A2 25                    .%
        bne     L9CEB                           ; 9CE5 D0 04                    ..
L9CE7:  ldy     #$00                            ; 9CE7 A0 00                    ..
        sty     $3A                             ; 9CE9 84 3A                    .:
L9CEB:  cmp     #$F9                            ; 9CEB C9 F9                    ..
        bmi     L9CB6                           ; 9CED 30 C7                    0.
        tay                                     ; 9CEF A8                       .
        lda     $3A                             ; 9CF0 A5 3A                    .:
        lsr     $01,x                           ; 9CF2 56 01                    V.
        jsr     L9E6D                           ; 9CF4 20 6D 9E                  m.
L9CF7:  bit     $39                             ; 9CF7 24 39                    $9
        bpl     L9D73                           ; 9CF9 10 78                    .x
        ldy     #$25                            ; 9CFB A0 25                    .%
        cpx     #$30                            ; 9CFD E0 30                    .0
        beq     L9D03                           ; 9CFF F0 02                    ..
        ldy     #$30                            ; 9D01 A0 30                    .0
L9D03:  sec                                     ; 9D03 38                       8
        eor     #$FF                            ; 9D04 49 FF                    I.
        adc     $14                             ; 9D06 65 14                    e.
        sta     $3A                             ; 9D08 85 3A                    .:
        lda     $07,y                           ; 9D0A B9 07 00                 ...
        sbc     $07,x                           ; 9D0D F5 07                    ..
L9D0F:  sta     $2C                             ; 9D0F 85 2C                    .,
        lda     $06,y                           ; 9D11 B9 06 00                 ...
        sbc     $06,x                           ; 9D14 F5 06                    ..
        .byte   $85                             ; 9D16 85                       .
L9D17:  .byte   $2B                             ; 9D17 2B                       +
        lda     $05,y                           ; 9D18 B9 05 00                 ...
        sbc     $05,x                           ; 9D1B F5 05                    ..
        sta     $2A                             ; 9D1D 85 2A                    .*
        lda     $04,y                           ; 9D1F B9 04 00                 ...
        sbc     $04,x                           ; 9D22 F5 04                    ..
        sta     $29                             ; 9D24 85 29                    .)
L9D26:  lda     $03,y                           ; 9D26 B9 03 00                 ...
        sbc     $03,x                           ; 9D29 F5 03                    ..
        sta     $28                             ; 9D2B 85 28                    .(
        lda     $02,y                           ; 9D2D B9 02 00                 ...
        sbc     $02,x                           ; 9D30 F5 02                    ..
        sta     $27                             ; 9D32 85 27                    .'
        lda     $01,y                           ; 9D34 B9 01 00                 ...
        sbc     $01,x                           ; 9D37 F5 01                    ..
        sta     $26                             ; 9D39 85 26                    .&
L9D3B:  bcs     L9D40                           ; 9D3B B0 03                    ..
L9D3D:  jsr     L9DDA                           ; 9D3D 20 DA 9D                  ..
L9D40:  ldy     #$00                            ; 9D40 A0 00                    ..
        tya                                     ; 9D42 98                       .
        clc                                     ; 9D43 18                       .
L9D44:  ldx     $26                             ; 9D44 A6 26                    .&
        bne     L9DB6                           ; 9D46 D0 6E                    .n
        ldx     $27                             ; 9D48 A6 27                    .'
        stx     $26                             ; 9D4A 86 26                    .&
        .byte   $A6                             ; 9D4C A6                       .
L9D4D:  plp                                     ; 9D4D 28                       (
        stx     $27                             ; 9D4E 86 27                    .'
        ldx     $29                             ; 9D50 A6 29                    .)
        stx     $28                             ; 9D52 86 28                    .(
        ldx     $2A                             ; 9D54 A6 2A                    .*
        stx     $29                             ; 9D56 86 29                    .)
        ldx     $2B                             ; 9D58 A6 2B                    .+
        stx     $2A                             ; 9D5A 86 2A                    .*
        ldx     $2C                             ; 9D5C A6 2C                    .,
L9D5E:  stx     $2B                             ; 9D5E 86 2B                    .+
L9D60:  ldx     $3A                             ; 9D60 A6 3A                    .:
        stx     $2C                             ; 9D62 86 2C                    .,
        sty     $3A                             ; 9D64 84 3A                    .:
        adc     #$08                            ; 9D66 69 08                    i.
        cmp     #$38                            ; 9D68 C9 38                    .8
        bne     L9D44                           ; 9D6A D0 D8                    ..
L9D6C:  lda     #$00                            ; 9D6C A9 00                    ..
L9D6E:  .byte   $85                             ; 9D6E 85                       .
L9D6F:  .byte   $25                             ; 9D6F 25                       %
L9D70:  sta     $2D                             ; 9D70 85 2D                    .-
        rts                                     ; 9D72 60                       `
; ----------------------------------------------------------------------------
L9D73:  adc     $14                             ; 9D73 65 14                    e.
        sta     $3A                             ; 9D75 85 3A                    .:
        lda     $2C                             ; 9D77 A5 2C                    .,
        adc     $37                             ; 9D79 65 37                    e7
        sta     $2C                             ; 9D7B 85 2C                    .,
        lda     $2B                             ; 9D7D A5 2B                    .+
        adc     $36                             ; 9D7F 65 36                    e6
        .byte   $85                             ; 9D81 85                       .
L9D82:  .byte   $2B                             ; 9D82 2B                       +
        lda     $2A                             ; 9D83 A5 2A                    .*
        adc     $35                             ; 9D85 65 35                    e5
        sta     $2A                             ; 9D87 85 2A                    .*
        lda     $29                             ; 9D89 A5 29                    .)
        .byte   $65                             ; 9D8B 65                       e
L9D8C:  bit     $85,x                           ; 9D8C 34 85                    4.
        .byte   $29                             ; 9D8E 29                       )
L9D8F:  lda     $28                             ; 9D8F A5 28                    .(
L9D91:  adc     $33                             ; 9D91 65 33                    e3
        sta     $28                             ; 9D93 85 28                    .(
        lda     $27                             ; 9D95 A5 27                    .'
        adc     $32                             ; 9D97 65 32                    e2
        sta     $27                             ; 9D99 85 27                    .'
        lda     $26                             ; 9D9B A5 26                    .&
        adc     $31                             ; 9D9D 65 31                    e1
        sta     $26                             ; 9D9F 85 26                    .&
L9DA1:  jmp     L9DC3                           ; 9DA1 4C C3 9D                 L..
; ----------------------------------------------------------------------------
L9DA4:  adc     #$01                            ; 9DA4 69 01                    i.
        asl     $3A                             ; 9DA6 06 3A                    .:
        rol     $2C                             ; 9DA8 26 2C                    &,
        rol     $2B                             ; 9DAA 26 2B                    &+
        rol     $2A                             ; 9DAC 26 2A                    &*
        rol     $29                             ; 9DAE 26 29                    &)
        rol     $28                             ; 9DB0 26 28                    &(
        rol     $27                             ; 9DB2 26 27                    &'
        rol     $26                             ; 9DB4 26 26                    &&
L9DB6:  bpl     L9DA4                           ; 9DB6 10 EC                    ..
        sec                                     ; 9DB8 38                       8
        sbc     $25                             ; 9DB9 E5 25                    .%
        bcs     L9D6C                           ; 9DBB B0 AF                    ..
        eor     #$FF                            ; 9DBD 49 FF                    I.
        adc     #$01                            ; 9DBF 69 01                    i.
        sta     $25                             ; 9DC1 85 25                    .%
L9DC3:  bcc     L9DD9                           ; 9DC3 90 14                    ..
L9DC5:  inc     $25                             ; 9DC5 E6 25                    .%
        beq     L9E2F                           ; 9DC7 F0 66                    .f
        ror     $26                             ; 9DC9 66 26                    f&
        ror     $27                             ; 9DCB 66 27                    f'
        ror     $28                             ; 9DCD 66 28                    f(
        ror     $29                             ; 9DCF 66 29                    f)
        ror     $2A                             ; 9DD1 66 2A                    f*
        ror     $2B                             ; 9DD3 66 2B                    f+
        ror     $2C                             ; 9DD5 66 2C                    f,
        ror     $3A                             ; 9DD7 66 3A                    f:
L9DD9:  rts                                     ; 9DD9 60                       `
; ----------------------------------------------------------------------------
L9DDA:  lda     $2D                             ; 9DDA A5 2D                    .-
        eor     #$FF                            ; 9DDC 49 FF                    I.
        sta     $2D                             ; 9DDE 85 2D                    .-
L9DE0:  lda     $26                             ; 9DE0 A5 26                    .&
        eor     #$FF                            ; 9DE2 49 FF                    I.
        sta     $26                             ; 9DE4 85 26                    .&
        lda     $27                             ; 9DE6 A5 27                    .'
        eor     #$FF                            ; 9DE8 49 FF                    I.
        sta     $27                             ; 9DEA 85 27                    .'
L9DEC:  lda     $28                             ; 9DEC A5 28                    .(
        eor     #$FF                            ; 9DEE 49 FF                    I.
        sta     $28                             ; 9DF0 85 28                    .(
        lda     $29                             ; 9DF2 A5 29                    .)
        eor     #$FF                            ; 9DF4 49 FF                    I.
        sta     $29                             ; 9DF6 85 29                    .)
        lda     $2A                             ; 9DF8 A5 2A                    .*
        eor     #$FF                            ; 9DFA 49 FF                    I.
        sta     $2A                             ; 9DFC 85 2A                    .*
        lda     $2B                             ; 9DFE A5 2B                    .+
        eor     #$FF                            ; 9E00 49 FF                    I.
        sta     $2B                             ; 9E02 85 2B                    .+
        lda     $2C                             ; 9E04 A5 2C                    .,
        eor     #$FF                            ; 9E06 49 FF                    I.
        sta     $2C                             ; 9E08 85 2C                    .,
        lda     $3A                             ; 9E0A A5 3A                    .:
        eor     #$FF                            ; 9E0C 49 FF                    I.
        sta     $3A                             ; 9E0E 85 3A                    .:
        .byte   $E6                             ; 9E10 E6                       .
L9E11:  dec     a                               ; 9E11 3A                       :
        bne     L9E2E                           ; 9E12 D0 1A                    ..
L9E14:  inc     $2C                             ; 9E14 E6 2C                    .,
        bne     L9E2E                           ; 9E16 D0 16                    ..
        inc     $2B                             ; 9E18 E6 2B                    .+
        bne     L9E2E                           ; 9E1A D0 12                    ..
        inc     $2A                             ; 9E1C E6 2A                    .*
        bne     L9E2E                           ; 9E1E D0 0E                    ..
        inc     $29                             ; 9E20 E6 29                    .)
        bne     L9E2E                           ; 9E22 D0 0A                    ..
        inc     $28                             ; 9E24 E6 28                    .(
        bne     L9E2E                           ; 9E26 D0 06                    ..
        inc     $27                             ; 9E28 E6 27                    .'
        bne     L9E2E                           ; 9E2A D0 02                    ..
        inc     $26                             ; 9E2C E6 26                    .&
L9E2E:  rts                                     ; 9E2E 60                       `
; ----------------------------------------------------------------------------
L9E2F:  ldx     #$0F                            ; 9E2F A2 0F                    ..
        jmp     LFB4B                           ; 9E31 4C 4B FB                 LK.
; ----------------------------------------------------------------------------
L9E34:  ldx     #$0B                            ; 9E34 A2 0B                    ..
L9E36:  ldy     $07,x                           ; 9E36 B4 07                    ..
        sty     $3A                             ; 9E38 84 3A                    .:
        ldy     $06,x                           ; 9E3A B4 06                    ..
        sty     $07,x                           ; 9E3C 94 07                    ..
        ldy     $05,x                           ; 9E3E B4 05                    ..
        .byte   $94                             ; 9E40 94                       .
L9E41:  asl     $B4                             ; 9E41 06 B4                    ..
        tsb     $94                             ; 9E43 04 94                    ..
        ora     $B4                             ; 9E45 05 B4                    ..
        .byte   $03                             ; 9E47 03                       .
        sty     $04,x                           ; 9E48 94 04                    ..
        .byte   $B4                             ; 9E4A B4                       .
L9E4B:  .byte   $02                             ; 9E4B 02                       .
        sty     $03,x                           ; 9E4C 94 03                    ..
        ldy     $01,x                           ; 9E4E B4 01                    ..
        sty     $02,x                           ; 9E50 94 02                    ..
        ldy     $2F                             ; 9E52 A4 2F                    ./
        sty     $01,x                           ; 9E54 94 01                    ..
L9E56:  adc     #$08                            ; 9E56 69 08                    i.
        bmi     L9E36                           ; 9E58 30 DC                    0.
        beq     L9E36                           ; 9E5A F0 DA                    ..
        sbc     #$08                            ; 9E5C E9 08                    ..
        tay                                     ; 9E5E A8                       .
        lda     $3A                             ; 9E5F A5 3A                    .:
        .byte   $B0                             ; 9E61 B0                       .
L9E62:  inc     a                               ; 9E62 1A                       .
L9E63:  asl     $01,x                           ; 9E63 16 01                    ..
        bcc     L9E69                           ; 9E65 90 02                    ..
        inc     $01,x                           ; 9E67 F6 01                    ..
L9E69:  ror     $01,x                           ; 9E69 76 01                    v.
        ror     $01,x                           ; 9E6B 76 01                    v.
L9E6D:  ror     $02,x                           ; 9E6D 76 02                    v.
        ror     $03,x                           ; 9E6F 76 03                    v.
        ror     $04,x                           ; 9E71 76 04                    v.
        ror     $05,x                           ; 9E73 76 05                    v.
        ror     $06,x                           ; 9E75 76 06                    v.
        ror     $07,x                           ; 9E77 76 07                    v.
        ror     a                               ; 9E79 6A                       j
        iny                                     ; 9E7A C8                       .
        bne     L9E63                           ; 9E7B D0 E6                    ..
L9E7D:  clc                                     ; 9E7D 18                       .
        rts                                     ; 9E7E 60                       `
; ----------------------------------------------------------------------------
        sta     ($00,x)                         ; 9E7F 81 00                    ..
        brk                                     ; 9E81 00                       .
        brk                                     ; 9E82 00                       .
        brk                                     ; 9E83 00                       .
        brk                                     ; 9E84 00                       .
        brk                                     ; 9E85 00                       .
        brk                                     ; 9E86 00                       .
        php                                     ; 9E87 08                       .
        ror     LCD2D,x                         ; 9E88 7E 2D CD                 ~-.
        stz     $DB                             ; 9E8B 64 DB                    d.
        lda     ($F8,x)                         ; 9E8D A1 F8                    ..
        pla                                     ; 9E8F 68                       h
        ror     LF944,x                         ; 9E90 7E 44 F9                 ~D.
        cld                                     ; 9E93 D8                       .
        ldy     CurMaxY_,x                      ; 9E94 B4 A6                    ..
        bbr7    $F4,L9F17                       ; 9E96 7F F4 7E                 ..~
        .byte   $63                             ; 9E99 63                       c
        rmb4    $AB                             ; 9E9A 47 AB                    G.
        lsr     $98                             ; 9E9C 46 98                    F.
        .byte   $BB                             ; 9E9E BB                       .
        tsb     $7F                             ; 9E9F 04 7F                    ..
L9EA1:  asl     $4D                             ; 9EA1 06 4D                    .M
        .byte   $42                             ; 9EA3 42                       B
        jmp     L11A0                           ; 9EA4 4C A0 11                 L..
; ----------------------------------------------------------------------------
        ror     $7F                             ; 9EA7 66 7F                    f.
        bit     $25                             ; 9EA9 24 25                    $%
        bit     #$EB                            ; 9EAB 89 EB                    ..
        cpx     #$15                            ; 9EAD E0 15                    ..
        lsr     $7F                             ; 9EAF 46 7F                    F.
        .byte   $53                             ; 9EB1 53                       S
        .byte   $0B                             ; 9EB2 0B                       .
        lda     ($53),y                         ; 9EB3 B1 53                    .S
        dec     $F6,x                           ; 9EB5 D6 F6                    ..
        cpy     $1380                           ; 9EB7 CC 80 13                 ...
        .byte   $BB                             ; 9EBA BB                       .
        .byte   $62                             ; 9EBB 62                       b
        smb0    $7C                             ; 9EBC 87 7C                    .|
        bbs5    $EE,L9E41                       ; 9EBE DF EE 80                 ...
        ror     $38,x                           ; 9EC1 76 38                    v8
        lsr     LD0E1                           ; 9EC3 4E E1 D0                 N..
        bbr1    $E8,L9E4B                       ; 9EC6 1F E8 82                 ...
        sec                                     ; 9EC9 38                       8
        tax                                     ; 9ECA AA                       .
        .byte   $3B                             ; 9ECB 3B                       ;
        and     #$5C                            ; 9ECC 29 5C                    )\
        rmb1    $EE                             ; 9ECE 17 EE                    ..
        bra     L9F07                           ; 9ED0 80 35                    .5
        tsb     $F3                             ; 9ED2 04 F3                    ..
        .byte   $33                             ; 9ED4 33                       3
        sbc     $68DE,y                         ; 9ED5 F9 DE 68                 ..h
        sta     ($35,x)                         ; 9ED8 81 35                    .5
        tsb     $F3                             ; 9EDA 04 F3                    ..
        .byte   $33                             ; 9EDC 33                       3
        sbc     $68DE,y                         ; 9EDD F9 DE 68                 ..h
        bra     L9E62                           ; 9EE0 80 80                    ..
        brk                                     ; 9EE2 00                       .
        brk                                     ; 9EE3 00                       .
        brk                                     ; 9EE4 00                       .
        brk                                     ; 9EE5 00                       .
        brk                                     ; 9EE6 00                       .
        brk                                     ; 9EE7 00                       .
        bra     L9F1B                           ; 9EE8 80 31                    .1
        adc     ($17)                           ; 9EEA 72 17                    r.
        smb7    $D1                             ; 9EEC F7 D1                    ..
        .byte   $CF                             ; 9EEE CF                       .
        .byte   $7C                             ; 9EEF 7C                       |
L9EF0:  jsr     LA29A                           ; 9EF0 20 9A A2                  ..
        beq     $9EF7                           ; 9EF3 F0 02                    ..
        bpl     L9EFA                           ; 9EF5 10 03                    ..
        jmp     L9C05                           ; 9EF7 4C 05 9C                 L..
; ----------------------------------------------------------------------------
L9EFA:  .byte   $A5                             ; 9EFA A5                       .
L9EFB:  and     $E9                             ; 9EFB 25 E9                    %.
        bbr7    $48,$48                         ; 9EFD 7F 48 A9                 .H.
        bra     $9E87                           ; 9F00 80 85                    ..
        and     $A9                             ; 9F02 25 A9                    %.
        bne     $9EA6                           ; 9F04 D0 A0                    ..
        .byte   $9E                             ; 9F06 9E                       .
L9F07:  jsr     L9F3C                           ; 9F07 20 3C 9F                  <.
        lda     #$D8                            ; 9F0A A9 D8                    ..
        ldy     #$9E                            ; 9F0C A0 9E                    ..
        jsr     L9F54                           ; 9F0E 20 54 9F                  T.
L9F11:  lda     #$7F                            ; 9F11 A9 7F                    ..
        ldy     #$9E                            ; 9F13 A0 9E                    ..
        .byte   $20                             ; 9F15 20                        
        pha                                     ; 9F16 48                       H
L9F17:  .byte   $9F                             ; 9F17 9F                       .
L9F18:  lda     #$87                            ; 9F18 A9 87                    ..
        .byte   $A0                             ; 9F1A A0                       .
L9F1B:  .byte   $9E                             ; 9F1B 9E                       .
L9F1C:  .byte   $20                             ; 9F1C 20                        
L9F1D:  ror     $A9A7,x                         ; 9F1D 7E A7 A9                 ~..
        cpx     #$A0                            ; 9F20 E0 A0                    ..
        stz     $3C20,x                         ; 9F22 9E 20 3C                 . <
        bbs1    $68,L9F48                       ; 9F25 9F 68 20                 .h 
        and     (CurMaxX_,x)                    ; 9F28 21 A4                    !.
        lda     #$E8                            ; 9F2A A9 E8                    ..
        ldy     #$9E                            ; 9F2C A0 9E                    ..
L9F2E:  .byte   $20                             ; 9F2E 20                        
        .byte   $F1                             ; 9F2F F1                       .
L9F30:  .byte   $9F                             ; 9F30 9F                       .
L9F31:  bra     L9F63                           ; 9F31 80 30                    .0
        jsr     LA06D                           ; 9F33 20 6D A0                  m.
        bra     L9F63                           ; 9F36 80 2B                    .+
L9F38:  lda     #$BF                            ; 9F38 A9 BF                    ..
        ldy     #$A5                            ; 9F3A A0 A5                    ..
L9F3C:  jsr     L9FF1                           ; 9F3C 20 F1 9F                  ..
        jmp     L9CBE                           ; 9F3F 4C BE 9C                 L..
; ----------------------------------------------------------------------------
        jsr     LA06D                           ; 9F42 20 6D A0                  m.
        jmp     L9CBE                           ; 9F45 4C BE 9C                 L..
; ----------------------------------------------------------------------------
L9F48:  jsr     L9FF1                           ; 9F48 20 F1 9F                  ..
        jmp     L9CA7                           ; 9F4B 4C A7 9C                 L..
; ----------------------------------------------------------------------------
        jsr     LA06D                           ; 9F4E 20 6D A0                  m.
        jmp     L9CA7                           ; 9F51 4C A7 9C                 L..
; ----------------------------------------------------------------------------
L9F54:  jsr     L9FF1                           ; 9F54 20 F1 9F                  ..
        jmp     LA0F9                           ; 9F57 4C F9 A0                 L..
; ----------------------------------------------------------------------------
        jsr     LA06D                           ; 9F5A 20 6D A0                  m.
        jmp     LA0F9                           ; 9F5D 4C F9 A0                 L..
; ----------------------------------------------------------------------------
L9F60:  jsr     LA02B                           ; 9F60 20 2B A0                  +.
L9F63:  bne     L9F68                           ; 9F63 D0 03                    ..
        jmp     L9FF0                           ; 9F65 4C F0 9F                 L..
; ----------------------------------------------------------------------------
L9F68:  jsr     LA096                           ; 9F68 20 96 A0                  ..
        lda     #$00                            ; 9F6B A9 00                    ..
        sta     $0C                             ; 9F6D 85 0C                    ..
        sta     $0D                             ; 9F6F 85 0D                    ..
        sta     $0E                             ; 9F71 85 0E                    ..
        sta     $0F                             ; 9F73 85 0F                    ..
        sta     $10                             ; 9F75 85 10                    ..
        sta     $11                             ; 9F77 85 11                    ..
        sta     $12                             ; 9F79 85 12                    ..
        lda     $3A                             ; 9F7B A5 3A                    .:
        jsr     L9FA6                           ; 9F7D 20 A6 9F                  ..
        lda     $2C                             ; 9F80 A5 2C                    .,
        jsr     L9FA6                           ; 9F82 20 A6 9F                  ..
L9F85:  lda     $2B                             ; 9F85 A5 2B                    .+
        jsr     L9FA6                           ; 9F87 20 A6 9F                  ..
        lda     $2A                             ; 9F8A A5 2A                    .*
        jsr     L9FA6                           ; 9F8C 20 A6 9F                  ..
        lda     $29                             ; 9F8F A5 29                    .)
        jsr     L9FA6                           ; 9F91 20 A6 9F                  ..
        lda     $28                             ; 9F94 A5 28                    .(
        jsr     L9FA6                           ; 9F96 20 A6 9F                  ..
        lda     $27                             ; 9F99 A5 27                    .'
        jsr     L9FA6                           ; 9F9B 20 A6 9F                  ..
        lda     $26                             ; 9F9E A5 26                    .&
        jsr     L9FAB                           ; 9FA0 20 AB 9F                  ..
        jmp     LA198                           ; 9FA3 4C 98 A1                 L..
; ----------------------------------------------------------------------------
L9FA6:  bne     L9FAB                           ; 9FA6 D0 03                    ..
        jmp     L9E34                           ; 9FA8 4C 34 9E                 L4.
; ----------------------------------------------------------------------------
L9FAB:  lsr     a                               ; 9FAB 4A                       J
        ora     #$80                            ; 9FAC 09 80                    ..
L9FAE:  tay                                     ; 9FAE A8                       .
        bcc     L9FDC                           ; 9FAF 90 2B                    .+
        clc                                     ; 9FB1 18                       .
        lda     $12                             ; 9FB2 A5 12                    ..
        adc     $37                             ; 9FB4 65 37                    e7
        sta     $12                             ; 9FB6 85 12                    ..
        lda     $11                             ; 9FB8 A5 11                    ..
L9FBA:  adc     $36                             ; 9FBA 65 36                    e6
        sta     $11                             ; 9FBC 85 11                    ..
        lda     $10                             ; 9FBE A5 10                    ..
        adc     $35                             ; 9FC0 65 35                    e5
        sta     $10                             ; 9FC2 85 10                    ..
        lda     $0F                             ; 9FC4 A5 0F                    ..
        adc     $34                             ; 9FC6 65 34                    e4
        sta     $0F                             ; 9FC8 85 0F                    ..
        lda     $0E                             ; 9FCA A5 0E                    ..
        adc     $33                             ; 9FCC 65 33                    e3
        sta     $0E                             ; 9FCE 85 0E                    ..
        lda     $0D                             ; 9FD0 A5 0D                    ..
        adc     $32                             ; 9FD2 65 32                    e2
        sta     $0D                             ; 9FD4 85 0D                    ..
        lda     $0C                             ; 9FD6 A5 0C                    ..
        adc     $31                             ; 9FD8 65 31                    e1
        sta     $0C                             ; 9FDA 85 0C                    ..
L9FDC:  ror     $0C                             ; 9FDC 66 0C                    f.
        ror     $0D                             ; 9FDE 66 0D                    f.
        ror     $0E                             ; 9FE0 66 0E                    f.
        ror     $0F                             ; 9FE2 66 0F                    f.
        ror     $10                             ; 9FE4 66 10                    f.
        ror     $11                             ; 9FE6 66 11                    f.
        ror     $12                             ; 9FE8 66 12                    f.
        ror     $3A                             ; 9FEA 66 3A                    f:
        tya                                     ; 9FEC 98                       .
        lsr     a                               ; 9FED 4A                       J
        bne     L9FAE                           ; 9FEE D0 BE                    ..
L9FF0:  rts                                     ; 9FF0 60                       `
; ----------------------------------------------------------------------------
L9FF1:  sta     $08                             ; 9FF1 85 08                    ..
        sty     $09                             ; 9FF3 84 09                    ..
        ldy     #$07                            ; 9FF5 A0 07                    ..
        lda     ($08),y                         ; 9FF7 B1 08                    ..
        sta     $37                             ; 9FF9 85 37                    .7
        dey                                     ; 9FFB 88                       .
        lda     ($08),y                         ; 9FFC B1 08                    ..
        sta     $36                             ; 9FFE 85 36                    .6
        dey                                     ; A000 88                       .
        lda     ($08),y                         ; A001 B1 08                    ..
        sta     $35                             ; A003 85 35                    .5
        dey                                     ; A005 88                       .
        lda     ($08),y                         ; A006 B1 08                    ..
        sta     $34                             ; A008 85 34                    .4
        dey                                     ; A00A 88                       .
        lda     ($08),y                         ; A00B B1 08                    ..
        sta     $33                             ; A00D 85 33                    .3
        dey                                     ; A00F 88                       .
        lda     ($08),y                         ; A010 B1 08                    ..
        sta     $32                             ; A012 85 32                    .2
        dey                                     ; A014 88                       .
        lda     ($08),y                         ; A015 B1 08                    ..
        sta     $38                             ; A017 85 38                    .8
        eor     $2D                             ; A019 45 2D                    E-
        sta     $39                             ; A01B 85 39                    .9
        lda     $38                             ; A01D A5 38                    .8
        ora     #$80                            ; A01F 09 80                    ..
        sta     $31                             ; A021 85 31                    .1
        dey                                     ; A023 88                       .
        lda     ($08),y                         ; A024 B1 08                    ..
        sta     $30                             ; A026 85 30                    .0
        lda     $25                             ; A028 A5 25                    .%
        rts                                     ; A02A 60                       `
; ----------------------------------------------------------------------------
LA02B:  sta     $08                             ; A02B 85 08                    ..
        sty     $09                             ; A02D 84 09                    ..
        ldy     #$07                            ; A02F A0 07                    ..
        jsr     L9C36                           ; A031 20 36 9C                  6.
        sta     $37                             ; A034 85 37                    .7
        dey                                     ; A036 88                       .
        jsr     L9C36                           ; A037 20 36 9C                  6.
        sta     $36                             ; A03A 85 36                    .6
        dey                                     ; A03C 88                       .
        jsr     L9C36                           ; A03D 20 36 9C                  6.
        sta     $35                             ; A040 85 35                    .5
        dey                                     ; A042 88                       .
        jsr     L9C36                           ; A043 20 36 9C                  6.
        sta     $34                             ; A046 85 34                    .4
        dey                                     ; A048 88                       .
        jsr     L9C36                           ; A049 20 36 9C                  6.
        sta     $33                             ; A04C 85 33                    .3
        dey                                     ; A04E 88                       .
        jsr     L9C36                           ; A04F 20 36 9C                  6.
        sta     $32                             ; A052 85 32                    .2
        dey                                     ; A054 88                       .
LA055:  jsr     L9C36                           ; A055 20 36 9C                  6.
        sta     $38                             ; A058 85 38                    .8
        eor     $2D                             ; A05A 45 2D                    E-
        sta     $39                             ; A05C 85 39                    .9
        lda     $38                             ; A05E A5 38                    .8
        ora     #$80                            ; A060 09 80                    ..
        sta     $31                             ; A062 85 31                    .1
        dey                                     ; A064 88                       .
        .byte   $20                             ; A065 20                        
        .byte   $36                             ; A066 36                       6
LA067:  .byte   $9C                             ; A067 9C                       .
LA068:  sta     $30                             ; A068 85 30                    .0
        lda     $25                             ; A06A A5 25                    .%
        rts                                     ; A06C 60                       `
; ----------------------------------------------------------------------------
LA06D:  sta     $08                             ; A06D 85 08                    ..
        sty     $09                             ; A06F 84 09                    ..
        .byte   $A0                             ; A071 A0                       .
LA072:  .byte   $07                             ; A072 07                       .
LA073:  jsr     L9C3E                           ; A073 20 3E 9C                  >.
        sta     $30,y                           ; A076 99 30 00                 .0.
        dey                                     ; A079 88                       .
        cpy     #$02                            ; A07A C0 02                    ..
        bcs     LA073                           ; A07C B0 F5                    ..
        jsr     L9C3E                           ; A07E 20 3E 9C                  >.
        sta     $38                             ; A081 85 38                    .8
        eor     $2D                             ; A083 45 2D                    E-
        sta     $39                             ; A085 85 39                    .9
        lda     $38                             ; A087 A5 38                    .8
        ora     #$80                            ; A089 09 80                    ..
        sta     $31                             ; A08B 85 31                    .1
        dey                                     ; A08D 88                       .
        jsr     L9C3E                           ; A08E 20 3E 9C                  >.
        sta     $30                             ; A091 85 30                    .0
        lda     $25                             ; A093 A5 25                    .%
        rts                                     ; A095 60                       `
; ----------------------------------------------------------------------------
LA096:  lda     $30                             ; A096 A5 30                    .0
LA098:  beq     LA0B9                           ; A098 F0 1F                    ..
        clc                                     ; A09A 18                       .
        adc     $25                             ; A09B 65 25                    e%
        bcc     LA0A3                           ; A09D 90 04                    ..
        bmi     LA0BE                           ; A09F 30 1D                    0.
        clc                                     ; A0A1 18                       .
        .byte   $2C                             ; A0A2 2C                       ,
LA0A3:  bpl     LA0B9                           ; A0A3 10 14                    ..
        adc     #$80                            ; A0A5 69 80                    i.
        sta     $25                             ; A0A7 85 25                    .%
        bne     LA0AE                           ; A0A9 D0 03                    ..
        jmp     L9D70                           ; A0AB 4C 70 9D                 Lp.
; ----------------------------------------------------------------------------
LA0AE:  lda     $39                             ; A0AE A5 39                    .9
        sta     $2D                             ; A0B0 85 2D                    .-
        rts                                     ; A0B2 60                       `
; ----------------------------------------------------------------------------
LA0B3:  lda     $2D                             ; A0B3 A5 2D                    .-
        eor     #$FF                            ; A0B5 49 FF                    I.
        bmi     LA0BE                           ; A0B7 30 05                    0.
LA0B9:  pla                                     ; A0B9 68                       h
        pla                                     ; A0BA 68                       h
        jmp     L9D6C                           ; A0BB 4C 6C 9D                 Ll.
; ----------------------------------------------------------------------------
LA0BE:  jmp     L9E2F                           ; A0BE 4C 2F 9E                 L/.
; ----------------------------------------------------------------------------
LA0C1:  jsr     LA27B                           ; A0C1 20 7B A2                  {.
        tax                                     ; A0C4 AA                       .
        beq     LA0D7                           ; A0C5 F0 10                    ..
        clc                                     ; A0C7 18                       .
        adc     #$02                            ; A0C8 69 02                    i.
        bcs     LA0BE                           ; A0CA B0 F2                    ..
        ldx     #$00                            ; A0CC A2 00                    ..
        stx     $39                             ; A0CE 86 39                    .9
        jsr     L9CCB                           ; A0D0 20 CB 9C                  ..
        inc     $25                             ; A0D3 E6 25                    .%
        beq     LA0BE                           ; A0D5 F0 E7                    ..
LA0D7:  rts                                     ; A0D7 60                       `
; ----------------------------------------------------------------------------
        sty     $20                             ; A0D8 84 20                    . 
        brk                                     ; A0DA 00                       .
        brk                                     ; A0DB 00                       .
        brk                                     ; A0DC 00                       .
        brk                                     ; A0DD 00                       .
        brk                                     ; A0DE 00                       .
        brk                                     ; A0DF 00                       .
LA0E0:  ldx     #$14                            ; A0E0 A2 14                    ..
        jmp     LFB4B                           ; A0E2 4C 4B FB                 LK.
; ----------------------------------------------------------------------------
LA0E5:  .byte   $20                             ; A0E5 20                        
LA0E6:  .byte   $7B                             ; A0E6 7B                       {
        ldx     #$A9                            ; A0E7 A2 A9                    ..
        cld                                     ; A0E9 D8                       .
        ldy     #$A0                            ; A0EA A0 A0                    ..
        ldx     #$00                            ; A0EC A2 00                    ..
LA0EE:  stx     $39                             ; A0EE 86 39                    .9
        jsr     LA1DD                           ; A0F0 20 DD A1                  ..
        jmp     LA0F9                           ; A0F3 4C F9 A0                 L..
; ----------------------------------------------------------------------------
LA0F6:  jsr     LA02B                           ; A0F6 20 2B A0                  +.
LA0F9:  beq     LA0E0                           ; A0F9 F0 E5                    ..
        jsr     LA28A                           ; A0FB 20 8A A2                  ..
        lda     #$00                            ; A0FE A9 00                    ..
        sec                                     ; A100 38                       8
        sbc     $25                             ; A101 E5 25                    .%
        sta     $25                             ; A103 85 25                    .%
        .byte   $20                             ; A105 20                        
        .byte   $96                             ; A106 96                       .
LA107:  ldy     #$E6                            ; A107 A0 E6                    ..
        and     $F0                             ; A109 25 F0                    %.
        lda     (CursorY)                       ; A10B B2 A2                    ..
        sbc     stack+169,y                     ; A10D F9 A9 01                 ...
LA110:  ldy     $31                             ; A110 A4 31                    .1
        cpy     $26                             ; A112 C4 26                    .&
        bne     LA138                           ; A114 D0 22                    ."
        ldy     $32                             ; A116 A4 32                    .2
        cpy     $27                             ; A118 C4 27                    .'
        bne     LA138                           ; A11A D0 1C                    ..
        ldy     $33                             ; A11C A4 33                    .3
        cpy     $28                             ; A11E C4 28                    .(
        bne     LA138                           ; A120 D0 16                    ..
        ldy     $34                             ; A122 A4 34                    .4
        cpy     $29                             ; A124 C4 29                    .)
        bne     LA138                           ; A126 D0 10                    ..
        ldy     $35                             ; A128 A4 35                    .5
        cpy     $2A                             ; A12A C4 2A                    .*
        bne     LA138                           ; A12C D0 0A                    ..
        ldy     $36                             ; A12E A4 36                    .6
        cpy     $2B                             ; A130 C4 2B                    .+
        bne     LA138                           ; A132 D0 04                    ..
        ldy     $37                             ; A134 A4 37                    .7
        cpy     $2C                             ; A136 C4 2C                    .,
LA138:  php                                     ; A138 08                       .
        rol     a                               ; A139 2A                       *
        bcc     LA145                           ; A13A 90 09                    ..
        inx                                     ; A13C E8                       .
        sta     $12,x                           ; A13D 95 12                    ..
        beq     LA18B                           ; A13F F0 4A                    .J
        bpl     LA18F                           ; A141 10 4C                    .L
        lda     #$01                            ; A143 A9 01                    ..
LA145:  plp                                     ; A145 28                       (
        bcs     LA15C                           ; A146 B0 14                    ..
LA148:  asl     $37                             ; A148 06 37                    .7
LA14A:  rol     $36                             ; A14A 26 36                    &6
        rol     $35                             ; A14C 26 35                    &5
        rol     $34                             ; A14E 26 34                    &4
        rol     $33                             ; A150 26 33                    &3
        rol     $32                             ; A152 26 32                    &2
        rol     $31                             ; A154 26 31                    &1
        bcs     LA138                           ; A156 B0 E0                    ..
        bmi     LA110                           ; A158 30 B6                    0.
        bpl     LA138                           ; A15A 10 DC                    ..
LA15C:  tay                                     ; A15C A8                       .
        lda     $37                             ; A15D A5 37                    .7
        sbc     $2C                             ; A15F E5 2C                    .,
        sta     $37                             ; A161 85 37                    .7
        lda     $36                             ; A163 A5 36                    .6
        sbc     $2B                             ; A165 E5 2B                    .+
        sta     $36                             ; A167 85 36                    .6
        lda     $35                             ; A169 A5 35                    .5
        sbc     $2A                             ; A16B E5 2A                    .*
        sta     $35                             ; A16D 85 35                    .5
        lda     $34                             ; A16F A5 34                    .4
        sbc     $29                             ; A171 E5 29                    .)
        sta     $34                             ; A173 85 34                    .4
        .byte   $A5                             ; A175 A5                       .
LA176:  .byte   $33                             ; A176 33                       3
        sbc     $28                             ; A177 E5 28                    .(
        sta     $33                             ; A179 85 33                    .3
        lda     $32                             ; A17B A5 32                    .2
        sbc     $27                             ; A17D E5 27                    .'
        sta     $32                             ; A17F 85 32                    .2
        lda     $31                             ; A181 A5 31                    .1
        sbc     $26                             ; A183 E5 26                    .&
        sta     $31                             ; A185 85 31                    .1
        tya                                     ; A187 98                       .
        jmp     LA148                           ; A188 4C 48 A1                 LH.
; ----------------------------------------------------------------------------
LA18B:  lda     #$40                            ; A18B A9 40                    .@
        bne     LA145                           ; A18D D0 B6                    ..
LA18F:  asl     a                               ; A18F 0A                       .
        asl     a                               ; A190 0A                       .
        asl     a                               ; A191 0A                       .
        asl     a                               ; A192 0A                       .
        asl     a                               ; A193 0A                       .
        asl     a                               ; A194 0A                       .
        sta     $3A                             ; A195 85 3A                    .:
        plp                                     ; A197 28                       (
LA198:  lda     $0C                             ; A198 A5 0C                    ..
        sta     $26                             ; A19A 85 26                    .&
        lda     $0D                             ; A19C A5 0D                    ..
        sta     $27                             ; A19E 85 27                    .'
        lda     $0E                             ; A1A0 A5 0E                    ..
        sta     $28                             ; A1A2 85 28                    .(
        lda     $0F                             ; A1A4 A5 0F                    ..
        sta     $29                             ; A1A6 85 29                    .)
        lda     $10                             ; A1A8 A5 10                    ..
        sta     $2A                             ; A1AA 85 2A                    .*
        lda     $11                             ; A1AC A5 11                    ..
        sta     $2B                             ; A1AE 85 2B                    .+
        lda     $12                             ; A1B0 A5 12                    ..
        sta     $2C                             ; A1B2 85 2C                    .,
        jmp     L9D40                           ; A1B4 4C 40 9D                 L@.
; ----------------------------------------------------------------------------
        sec                                     ; A1B7 38                       8
        sta     $08                             ; A1B8 85 08                    ..
        sty     $09                             ; A1BA 84 09                    ..
        ldy     #$07                            ; A1BC A0 07                    ..
LA1BE:  jsr     L9C3E                           ; A1BE 20 3E 9C                  >.
        sta     $25,y                           ; A1C1 99 25 00                 .%.
        dey                                     ; A1C4 88                       .
        cpy     #$02                            ; A1C5 C0 02                    ..
        bcs     LA1BE                           ; A1C7 B0 F5                    ..
        jsr     L9C3E                           ; A1C9 20 3E 9C                  >.
        sta     $2D                             ; A1CC 85 2D                    .-
        ora     #$80                            ; A1CE 09 80                    ..
        sta     $26                             ; A1D0 85 26                    .&
        dey                                     ; A1D2 88                       .
        jsr     L9C3E                           ; A1D3 20 3E 9C                  >.
        sta     $25                             ; A1D6 85 25                    .%
        sty     $3A                             ; A1D8 84 3A                    .:
        rts                                     ; A1DA 60                       `
; ----------------------------------------------------------------------------
        clc                                     ; A1DB 18                       .
        .byte   $24                             ; A1DC 24                       $
LA1DD:  sec                                     ; A1DD 38                       8
        sta     $08                             ; A1DE 85 08                    ..
        sty     $09                             ; A1E0 84 09                    ..
        ldy     #$07                            ; A1E2 A0 07                    ..
        jsr     LA331                           ; A1E4 20 31 A3                  1.
        sta     $2C                             ; A1E7 85 2C                    .,
        dey                                     ; A1E9 88                       .
        jsr     LA331                           ; A1EA 20 31 A3                  1.
        sta     $2B                             ; A1ED 85 2B                    .+
        dey                                     ; A1EF 88                       .
        jsr     LA331                           ; A1F0 20 31 A3                  1.
        sta     $2A                             ; A1F3 85 2A                    .*
        dey                                     ; A1F5 88                       .
        jsr     LA331                           ; A1F6 20 31 A3                  1.
        sta     $29                             ; A1F9 85 29                    .)
        dey                                     ; A1FB 88                       .
        jsr     LA331                           ; A1FC 20 31 A3                  1.
        sta     $28                             ; A1FF 85 28                    .(
        dey                                     ; A201 88                       .
        jsr     LA331                           ; A202 20 31 A3                  1.
        sta     $27                             ; A205 85 27                    .'
        dey                                     ; A207 88                       .
        jsr     LA331                           ; A208 20 31 A3                  1.
        sta     $2D                             ; A20B 85 2D                    .-
        ora     #$80                            ; A20D 09 80                    ..
        sta     $26                             ; A20F 85 26                    .&
        dey                                     ; A211 88                       .
        jsr     LA331                           ; A212 20 31 A3                  1.
        sta     $25                             ; A215 85 25                    .%
        sty     $3A                             ; A217 84 3A                    .:
        rts                                     ; A219 60                       `
; ----------------------------------------------------------------------------
        tax                                     ; A21A AA                       .
        bra     LA227                           ; A21B 80 0A                    ..
LA21D:  ldx     #$1D                            ; A21D A2 1D                    ..
        .byte   $2C                             ; A21F 2C                       ,
LA220:  ldx     #$15                            ; A220 A2 15                    ..
        .byte   $A0                             ; A222 A0                       .
LA223:  brk                                     ; A223 00                       .
        beq     LA227                           ; A224 F0 01                    ..
        tax                                     ; A226 AA                       .
LA227:  jsr     LA28A                           ; A227 20 8A A2                  ..
        stx     $08                             ; A22A 86 08                    ..
        sty     $09                             ; A22C 84 09                    ..
        ldy     #$07                            ; A22E A0 07                    ..
        lda     #$08                            ; A230 A9 08                    ..
        sta     $0360                           ; A232 8D 60 03                 .`.
        lda     $2C                             ; A235 A5 2C                    .,
        jsr     FROM_C68D                       ; A237 20 5C 03                  \.
        dey                                     ; A23A 88                       .
        lda     $2B                             ; A23B A5 2B                    .+
        jsr     FROM_C68D                       ; A23D 20 5C 03                  \.
        dey                                     ; A240 88                       .
        lda     $2A                             ; A241 A5 2A                    .*
        jsr     FROM_C68D                       ; A243 20 5C 03                  \.
        dey                                     ; A246 88                       .
        lda     $29                             ; A247 A5 29                    .)
        jsr     FROM_C68D                       ; A249 20 5C 03                  \.
        dey                                     ; A24C 88                       .
        lda     $28                             ; A24D A5 28                    .(
        jsr     FROM_C68D                       ; A24F 20 5C 03                  \.
        dey                                     ; A252 88                       .
        lda     $27                             ; A253 A5 27                    .'
        jsr     FROM_C68D                       ; A255 20 5C 03                  \.
        dey                                     ; A258 88                       .
        lda     $2D                             ; A259 A5 2D                    .-
        ora     #$7F                            ; A25B 09 7F                    ..
        and     $26                             ; A25D 25 26                    %&
        jsr     FROM_C68D                       ; A25F 20 5C 03                  \.
        dey                                     ; A262 88                       .
        lda     $25                             ; A263 A5 25                    .%
        jsr     FROM_C68D                       ; A265 20 5C 03                  \.
        sty     $3A                             ; A268 84 3A                    .:
        rts                                     ; A26A 60                       `
; ----------------------------------------------------------------------------
LA26B:  lda     $38                             ; A26B A5 38                    .8
LA26D:  sta     $2D                             ; A26D 85 2D                    .-
        ldx     #$08                            ; A26F A2 08                    ..
LA271:  lda     $2F,x                           ; A271 B5 2F                    ./
        sta     $24,x                           ; A273 95 24                    .$
        dex                                     ; A275 CA                       .
        bne     LA271                           ; A276 D0 F9                    ..
        stx     $3A                             ; A278 86 3A                    .:
        rts                                     ; A27A 60                       `
; ----------------------------------------------------------------------------
LA27B:  jsr     LA28A                           ; A27B 20 8A A2                  ..
LA27E:  ldx     #$09                            ; A27E A2 09                    ..
LA280:  lda     $24,x                           ; A280 B5 24                    .$
        sta     $2F,x                           ; A282 95 2F                    ./
        dex                                     ; A284 CA                       .
        bne     LA280                           ; A285 D0 F9                    ..
        stx     $3A                             ; A287 86 3A                    .:
LA289:  rts                                     ; A289 60                       `
; ----------------------------------------------------------------------------
LA28A:  lda     $25                             ; A28A A5 25                    .%
        beq     LA289                           ; A28C F0 FB                    ..
        asl     $3A                             ; A28E 06 3A                    .:
        bcc     LA289                           ; A290 90 F7                    ..
LA292:  jsr     L9E14                           ; A292 20 14 9E                  ..
        bne     LA289                           ; A295 D0 F2                    ..
        jmp     L9DC5                           ; A297 4C C5 9D                 L..
; ----------------------------------------------------------------------------
LA29A:  lda     $25                             ; A29A A5 25                    .%
        beq     LA2A7                           ; A29C F0 09                    ..
LA29E:  lda     $2D                             ; A29E A5 2D                    .-
LA2A0:  rol     a                               ; A2A0 2A                       *
        lda     #$FF                            ; A2A1 A9 FF                    ..
        bcs     LA2A7                           ; A2A3 B0 02                    ..
        lda     #$01                            ; A2A5 A9 01                    ..
LA2A7:  rts                                     ; A2A7 60                       `
; ----------------------------------------------------------------------------
        jsr     LA29A                           ; A2A8 20 9A A2                  ..
LA2AB:  sta     $26                             ; A2AB 85 26                    .&
        lda     #$00                            ; A2AD A9 00                    ..
        sta     $27                             ; A2AF 85 27                    .'
        ldx     #$88                            ; A2B1 A2 88                    ..
LA2B3:  lda     $26                             ; A2B3 A5 26                    .&
        eor     #$FF                            ; A2B5 49 FF                    I.
        rol     a                               ; A2B7 2A                       *
LA2B8:  lda     #$00                            ; A2B8 A9 00                    ..
        sta     $2C                             ; A2BA 85 2C                    .,
        sta     $2B                             ; A2BC 85 2B                    .+
        sta     $2A                             ; A2BE 85 2A                    .*
        sta     $29                             ; A2C0 85 29                    .)
        sta     $28                             ; A2C2 85 28                    .(
LA2C4:  stx     $25                             ; A2C4 86 25                    .%
        sta     $3A                             ; A2C6 85 3A                    .:
        sta     $2D                             ; A2C8 85 2D                    .-
        .byte   $4C                             ; A2CA 4C                       L
LA2CB:  .byte   $3B                             ; A2CB 3B                       ;
        sta     $FA5A,x                         ; A2CC 9D 5A FA                 .Z.
        bra     LA2C4                           ; A2CF 80 F3                    ..
        phy                                     ; A2D1 5A                       Z
        plx                                     ; A2D2 FA                       .
        bra     LA2B8                           ; A2D3 80 E3                    ..
        phy                                     ; A2D5 5A                       Z
        plx                                     ; A2D6 FA                       .
        bra     LA2B3                           ; A2D7 80 DA                    ..
        lsr     $2D                             ; A2D9 46 2D                    F-
        rts                                     ; A2DB 60                       `
; ----------------------------------------------------------------------------
LA2DC:  sta     $0A                             ; A2DC 85 0A                    ..
        sty     $0B                             ; A2DE 84 0B                    ..
        ldy     #$00                            ; A2E0 A0 00                    ..
        lda     ($0A),y                         ; A2E2 B1 0A                    ..
        iny                                     ; A2E4 C8                       .
        tax                                     ; A2E5 AA                       .
        beq     LA29A                           ; A2E6 F0 B2                    ..
        lda     ($0A),y                         ; A2E8 B1 0A                    ..
        eor     $2D                             ; A2EA 45 2D                    E-
        bmi     LA29E                           ; A2EC 30 B0                    0.
        cpx     $25                             ; A2EE E4 25                    .%
        bne     LA328                           ; A2F0 D0 36                    .6
        lda     ($0A),y                         ; A2F2 B1 0A                    ..
        ora     #$80                            ; A2F4 09 80                    ..
        cmp     $26                             ; A2F6 C5 26                    .&
        bne     LA328                           ; A2F8 D0 2E                    ..
        iny                                     ; A2FA C8                       .
        lda     ($0A),y                         ; A2FB B1 0A                    ..
        cmp     $27                             ; A2FD C5 27                    .'
        bne     LA328                           ; A2FF D0 27                    .'
        iny                                     ; A301 C8                       .
        lda     ($0A),y                         ; A302 B1 0A                    ..
        cmp     $28                             ; A304 C5 28                    .(
        bne     LA328                           ; A306 D0 20                    . 
        iny                                     ; A308 C8                       .
        lda     ($0A),y                         ; A309 B1 0A                    ..
        cmp     $29                             ; A30B C5 29                    .)
        bne     LA328                           ; A30D D0 19                    ..
        iny                                     ; A30F C8                       .
        lda     ($0A),y                         ; A310 B1 0A                    ..
        cmp     $2A                             ; A312 C5 2A                    .*
        bne     LA328                           ; A314 D0 12                    ..
        iny                                     ; A316 C8                       .
        lda     ($0A),y                         ; A317 B1 0A                    ..
        cmp     $2B                             ; A319 C5 2B                    .+
        bne     LA328                           ; A31B D0 0B                    ..
        iny                                     ; A31D C8                       .
        lda     #$7F                            ; A31E A9 7F                    ..
        cmp     $3A                             ; A320 C5 3A                    .:
        lda     ($0A),y                         ; A322 B1 0A                    ..
        sbc     $2C                             ; A324 E5 2C                    .,
        beq     LA357                           ; A326 F0 2F                    ./
LA328:  lda     $2D                             ; A328 A5 2D                    .-
        bcc     LA32E                           ; A32A 90 02                    ..
        eor     #$FF                            ; A32C 49 FF                    I.
LA32E:  jmp     LA2A0                           ; A32E 4C A0 A2                 L..
; ----------------------------------------------------------------------------
LA331:  lda     ($08),y                         ; A331 B1 08                    ..
        bcs     LA357                           ; A333 B0 22                    ."
        jmp     L9C36                           ; A335 4C 36 9C                 L6.
; ----------------------------------------------------------------------------
LA338:  lda     $25                             ; A338 A5 25                    .%
        beq     LA386                           ; A33A F0 4A                    .J
        sec                                     ; A33C 38                       8
        sbc     #$B8                            ; A33D E9 B8                    ..
        bit     $2D                             ; A33F 24 2D                    $-
        bpl     LA34C                           ; A341 10 09                    ..
        tax                                     ; A343 AA                       .
        lda     #$FF                            ; A344 A9 FF                    ..
        sta     $2F                             ; A346 85 2F                    ./
        jsr     L9DE0                           ; A348 20 E0 9D                  ..
        txa                                     ; A34B 8A                       .
LA34C:  ldx     #$25                            ; A34C A2 25                    .%
        cmp     #$F9                            ; A34E C9 F9                    ..
        bpl     LA358                           ; A350 10 06                    ..
        jsr     L9E56                           ; A352 20 56 9E                  V.
        sty     $2F                             ; A355 84 2F                    ./
LA357:  rts                                     ; A357 60                       `
; ----------------------------------------------------------------------------
LA358:  tay                                     ; A358 A8                       .
        lda     $2D                             ; A359 A5 2D                    .-
        and     #$80                            ; A35B 29 80                    ).
        lsr     $26                             ; A35D 46 26                    F&
        ora     $26                             ; A35F 05 26                    .&
        sta     $26                             ; A361 85 26                    .&
        jsr     L9E6D                           ; A363 20 6D 9E                  m.
        sty     $2F                             ; A366 84 2F                    ./
        rts                                     ; A368 60                       `
; ----------------------------------------------------------------------------
LA369:  lda     $25                             ; A369 A5 25                    .%
        cmp     #$B8                            ; A36B C9 B8                    ..
        bcs     LA395                           ; A36D B0 26                    .&
        jsr     LA338                           ; A36F 20 38 A3                  8.
        .byte   $84                             ; A372 84                       .
LA373:  dec     a                               ; A373 3A                       :
        lda     $2D                             ; A374 A5 2D                    .-
        sty     $2D                             ; A376 84 2D                    .-
        eor     #$80                            ; A378 49 80                    I.
        rol     a                               ; A37A 2A                       *
        lda     #$B8                            ; A37B A9 B8                    ..
        sta     $25                             ; A37D 85 25                    .%
        lda     $2C                             ; A37F A5 2C                    .,
        sta     $00                             ; A381 85 00                    ..
        jmp     L9D3B                           ; A383 4C 3B 9D                 L;.
; ----------------------------------------------------------------------------
LA386:  sta     $26                             ; A386 85 26                    .&
        sta     $27                             ; A388 85 27                    .'
        sta     $28                             ; A38A 85 28                    .(
        sta     $29                             ; A38C 85 29                    .)
        .byte   $85                             ; A38E 85                       .
LA38F:  rol     a                               ; A38F 2A                       *
        sta     $2B                             ; A390 85 2B                    .+
        sta     $2C                             ; A392 85 2C                    .,
        tay                                     ; A394 A8                       .
LA395:  rts                                     ; A395 60                       `
; ----------------------------------------------------------------------------
LA396:  ldy     #$00                            ; A396 A0 00                    ..
LA398:  ldx     #$0D                            ; A398 A2 0D                    ..
LA39A:  sty     $21,x                           ; A39A 94 21                    .!
        dex                                     ; A39C CA                       .
        bpl     LA39A                           ; A39D 10 FB                    ..
        bcc     LA3B0                           ; A39F 90 0F                    ..
        cmp     #$2D                            ; A3A1 C9 2D                    .-
        bne     LA3A9                           ; A3A3 D0 04                    ..
        stx     $2E                             ; A3A5 86 2E                    ..
        beq     LA3AD                           ; A3A7 F0 04                    ..
LA3A9:  cmp     #$2B                            ; A3A9 C9 2B                    .+
        bne     LA3B2                           ; A3AB D0 05                    ..
LA3AD:  jsr     L9C0D                           ; A3AD 20 0D 9C                  ..
LA3B0:  bcc     LA40D                           ; A3B0 90 5B                    .[
LA3B2:  cmp     #$2E                            ; A3B2 C9 2E                    ..
        beq     LA3E4                           ; A3B4 F0 2E                    ..
        cmp     #$45                            ; A3B6 C9 45                    .E
        bne     LA3EA                           ; A3B8 D0 30                    .0
        jsr     L9C0D                           ; A3BA 20 0D 9C                  ..
        bcc     LA3D6                           ; A3BD 90 17                    ..
        cmp     #$AB                            ; A3BF C9 AB                    ..
LA3C1:  beq     LA3D1                           ; A3C1 F0 0E                    ..
        cmp     #$2D                            ; A3C3 C9 2D                    .-
        beq     LA3D1                           ; A3C5 F0 0A                    ..
        cmp     #$AA                            ; A3C7 C9 AA                    ..
        beq     LA3D3                           ; A3C9 F0 08                    ..
        cmp     #$2B                            ; A3CB C9 2B                    .+
        beq     LA3D3                           ; A3CD F0 04                    ..
LA3CF:  bne     LA3D8                           ; A3CF D0 07                    ..
LA3D1:  ror     $24                             ; A3D1 66 24                    f$
LA3D3:  jsr     L9C0D                           ; A3D3 20 0D 9C                  ..
LA3D6:  bcc     LA434                           ; A3D6 90 5C                    .\
LA3D8:  bit     $24                             ; A3D8 24 24                    $$
        bpl     LA3EA                           ; A3DA 10 0E                    ..
        lda     #$00                            ; A3DC A9 00                    ..
        sec                                     ; A3DE 38                       8
        sbc     $22                             ; A3DF E5 22                    ."
        jmp     LA3EC                           ; A3E1 4C EC A3                 L..
; ----------------------------------------------------------------------------
LA3E4:  ror     $23                             ; A3E4 66 23                    f#
        bit     $23                             ; A3E6 24 23                    $#
        bvc     LA3AD                           ; A3E8 50 C3                    P.
LA3EA:  lda     $22                             ; A3EA A5 22                    ."
LA3EC:  sec                                     ; A3EC 38                       8
        sbc     $21                             ; A3ED E5 21                    .!
        sta     $22                             ; A3EF 85 22                    ."
        beq     LA405                           ; A3F1 F0 12                    ..
        bpl     LA3FE                           ; A3F3 10 09                    ..
LA3F5:  jsr     LA0E5                           ; A3F5 20 E5 A0                  ..
        inc     $22                             ; A3F8 E6 22                    ."
        bne     LA3F5                           ; A3FA D0 F9                    ..
        beq     LA405                           ; A3FC F0 07                    ..
LA3FE:  jsr     LA0C1                           ; A3FE 20 C1 A0                  ..
        dec     $22                             ; A401 C6 22                    ."
        bne     LA3FE                           ; A403 D0 F9                    ..
LA405:  lda     $2E                             ; A405 A5 2E                    ..
        bmi     LA40A                           ; A407 30 01                    0.
        rts                                     ; A409 60                       `
; ----------------------------------------------------------------------------
LA40A:  jmp     LA6A7                           ; A40A 4C A7 A6                 L..
; ----------------------------------------------------------------------------
LA40D:  pha                                     ; A40D 48                       H
LA40E:  bit     $23                             ; A40E 24 23                    $#
        bpl     LA414                           ; A410 10 02                    ..
        inc     $21                             ; A412 E6 21                    .!
LA414:  jsr     LA0C1                           ; A414 20 C1 A0                  ..
        pla                                     ; A417 68                       h
        sec                                     ; A418 38                       8
        sbc     #$30                            ; A419 E9 30                    .0
        jsr     LA421                           ; A41B 20 21 A4                  !.
        jmp     LA3AD                           ; A41E 4C AD A3                 L..
; ----------------------------------------------------------------------------
LA421:  pha                                     ; A421 48                       H
        jsr     LA27B                           ; A422 20 7B A2                  {.
        pla                                     ; A425 68                       h
        jsr     LA2AB                           ; A426 20 AB A2                  ..
        lda     $38                             ; A429 A5 38                    .8
        eor     $2D                             ; A42B 45 2D                    E-
        sta     $39                             ; A42D 85 39                    .9
        ldx     $25                             ; A42F A6 25                    .%
        jmp     L9CBE                           ; A431 4C BE 9C                 L..
; ----------------------------------------------------------------------------
LA434:  lda     $22                             ; A434 A5 22                    ."
        cmp     #$0A                            ; A436 C9 0A                    ..
        bcc     LA443                           ; A438 90 09                    ..
        lda     #$64                            ; A43A A9 64                    .d
        bit     $24                             ; A43C 24 24                    $$
        bmi     LA456                           ; A43E 30 16                    0.
        jmp     L9E2F                           ; A440 4C 2F 9E                 L/.
; ----------------------------------------------------------------------------
LA443:  asl     a                               ; A443 0A                       .
        asl     a                               ; A444 0A                       .
        clc                                     ; A445 18                       .
        adc     $22                             ; A446 65 22                    e"
        asl     a                               ; A448 0A                       .
        clc                                     ; A449 18                       .
        ldy     #$00                            ; A44A A0 00                    ..
        sta     $22                             ; A44C 85 22                    ."
        jsr     L9C2E                           ; A44E 20 2E 9C                  ..
        .byte   $65                             ; A451 65                       e
LA452:  .byte   $22                             ; A452 22                       "
        sec                                     ; A453 38                       8
        sbc     #$30                            ; A454 E9 30                    .0
LA456:  sta     $22                             ; A456 85 22                    ."
        jmp     LA3D3                           ; A458 4C D3 A3                 L..
; ----------------------------------------------------------------------------
        .byte   $AF,$35,$E6,$20,$F4,$7F,$FF,$CC ; A45B AF 35 E6 20 F4 7F FF CC  .5. ....
        .byte   $B2,$63,$5F,$A9,$31,$9F,$FF,$E8 ; A463 B2 63 5F A9 31 9F FF E8  .c_.1...
        .byte   $B2,$63,$5F,$A9,$31,$9F,$FF,$FC ; A46B B2 63 5F A9 31 9F FF FC  .c_.1...
        .byte   $A0,$01,$A9,$20,$24,$2D,$10,$02 ; A473 A0 01 A9 20 24 2D 10 02  ... $-..
        .byte   $A9,$2D,$99,$FF,$00,$85,$2D,$84 ; A47B A9 2D 99 FF 00 85 2D 84  .-....-.
        .byte   $3B,$C8,$A9,$30,$A6,$25,$D0,$03 ; A483 3B C8 A9 30 A6 25 D0 03  ;..0.%..
; ----------------------------------------------------------------------------
LA48B:  jmp     LA5B2                           ; A48B 4C B2 A5                 L..
; ----------------------------------------------------------------------------
        lda     #$00                            ; A48E A9 00                    ..
        cpx     #$80                            ; A490 E0 80                    ..
        beq     LA496                           ; A492 F0 02                    ..
        bcs     LA49F                           ; A494 B0 09                    ..
LA496:  lda     #$6B                            ; A496 A9 6B                    .k
        ldy     #$A4                            ; A498 A0 A4                    ..
        jsr     L9F2E                           ; A49A 20 2E 9F                  ..
        lda     #$F1                            ; A49D A9 F1                    ..
LA49F:  sta     $21                             ; A49F 85 21                    .!
LA4A1:  lda     #$63                            ; A4A1 A9 63                    .c
        ldy     #$A4                            ; A4A3 A0 A4                    ..
        jsr     LA2DC                           ; A4A5 20 DC A2                  ..
        beq     LA4C8                           ; A4A8 F0 1E                    ..
        bpl     LA4BE                           ; A4AA 10 12                    ..
LA4AC:  lda     #$5B                            ; A4AC A9 5B                    .[
        ldy     #$A4                            ; A4AE A0 A4                    ..
        jsr     LA2DC                           ; A4B0 20 DC A2                  ..
LA4B3:  beq     LA4B7                           ; A4B3 F0 02                    ..
        bpl     LA4C5                           ; A4B5 10 0E                    ..
LA4B7:  jsr     LA0C1                           ; A4B7 20 C1 A0                  ..
        dec     $21                             ; A4BA C6 21                    .!
        bne     LA4AC                           ; A4BC D0 EE                    ..
LA4BE:  jsr     LA0E5                           ; A4BE 20 E5 A0                  ..
        inc     $21                             ; A4C1 E6 21                    .!
        bne     LA4A1                           ; A4C3 D0 DC                    ..
LA4C5:  jsr     L9F38                           ; A4C5 20 38 9F                  8.
LA4C8:  jsr     LA338                           ; A4C8 20 38 A3                  8.
        ldx     #$01                            ; A4CB A2 01                    ..
        .byte   $A5                             ; A4CD A5                       .
LA4CE:  and     ($18,x)                         ; A4CE 21 18                    !.
        adc     #$10                            ; A4D0 69 10                    i.
LA4D2:  bmi     LA4DD                           ; A4D2 30 09                    0.
        cmp     #$11                            ; A4D4 C9 11                    ..
        bcs     LA4DE                           ; A4D6 B0 06                    ..
        adc     #$FF                            ; A4D8 69 FF                    i.
        tax                                     ; A4DA AA                       .
        lda     #$02                            ; A4DB A9 02                    ..
LA4DD:  sec                                     ; A4DD 38                       8
LA4DE:  sbc     #$02                            ; A4DE E9 02                    ..
        sta     $22                             ; A4E0 85 22                    ."
        stx     $21                             ; A4E2 86 21                    .!
        txa                                     ; A4E4 8A                       .
        beq     LA4E9                           ; A4E5 F0 02                    ..
        bpl     LA4FC                           ; A4E7 10 13                    ..
LA4E9:  ldy     $3B                             ; A4E9 A4 3B                    .;
        lda     #$2E                            ; A4EB A9 2E                    ..
        iny                                     ; A4ED C8                       .
        sta     $FF,y                           ; A4EE 99 FF 00                 ...
        txa                                     ; A4F1 8A                       .
        beq     LA4FA                           ; A4F2 F0 06                    ..
        lda     #$30                            ; A4F4 A9 30                    .0
        iny                                     ; A4F6 C8                       .
        sta     $FF,y                           ; A4F7 99 FF 00                 ...
LA4FA:  sty     $3B                             ; A4FA 84 3B                    .;
LA4FC:  ldy     #$00                            ; A4FC A0 00                    ..
        ldx     #$80                            ; A4FE A2 80                    ..
LA500:  lda     $2C                             ; A500 A5 2C                    .,
        clc                                     ; A502 18                       .
        adc     LA5CD,y                         ; A503 79 CD A5                 y..
        sta     $2C                             ; A506 85 2C                    .,
        lda     $2B                             ; A508 A5 2B                    .+
        adc     LA5CC,y                         ; A50A 79 CC A5                 y..
        sta     $2B                             ; A50D 85 2B                    .+
        lda     $2A                             ; A50F A5 2A                    .*
        adc     LA5CB,y                         ; A511 79 CB A5                 y..
        sta     $2A                             ; A514 85 2A                    .*
        lda     $29                             ; A516 A5 29                    .)
        adc     LA5CA,y                         ; A518 79 CA A5                 y..
        sta     $29                             ; A51B 85 29                    .)
        lda     $28                             ; A51D A5 28                    .(
        adc     LA5C9,y                         ; A51F 79 C9 A5                 y..
        sta     $28                             ; A522 85 28                    .(
        lda     $27                             ; A524 A5 27                    .'
        adc     LA5C8,y                         ; A526 79 C8 A5                 y..
        sta     $27                             ; A529 85 27                    .'
        lda     $26                             ; A52B A5 26                    .&
        adc     LA5C7,y                         ; A52D 79 C7 A5                 y..
        sta     $26                             ; A530 85 26                    .&
        inx                                     ; A532 E8                       .
        bcs     LA539                           ; A533 B0 04                    ..
        bpl     LA500                           ; A535 10 C9                    ..
        bmi     LA53B                           ; A537 30 02                    0.
LA539:  bmi     LA500                           ; A539 30 C5                    0.
LA53B:  txa                                     ; A53B 8A                       .
        bcc     LA542                           ; A53C 90 04                    ..
        .byte   $49                             ; A53E 49                       I
LA53F:  bbs7    $69,$69                         ; A53F FF 69 0A                 .i.
LA542:  adc     #$2F                            ; A542 69 2F                    i/
        iny                                     ; A544 C8                       .
        iny                                     ; A545 C8                       .
        iny                                     ; A546 C8                       .
        iny                                     ; A547 C8                       .
        iny                                     ; A548 C8                       .
        iny                                     ; A549 C8                       .
        iny                                     ; A54A C8                       .
        sty     $3D                             ; A54B 84 3D                    .=
        ldy     $3B                             ; A54D A4 3B                    .;
        iny                                     ; A54F C8                       .
        tax                                     ; A550 AA                       .
        and     #$7F                            ; A551 29 7F                    ).
        sta     $FF,y                           ; A553 99 FF 00                 ...
        dec     $21                             ; A556 C6 21                    .!
        .byte   $D0                             ; A558 D0                       .
LA559:  asl     $A9                             ; A559 06 A9                    ..
        rol     $99C8                           ; A55B 2E C8 99                 ...
        .byte   $FF                             ; A55E FF                       .
        brk                                     ; A55F 00                       .
LA560:  sty     $3B                             ; A560 84 3B                    .;
        ldy     $3D                             ; A562 A4 3D                    .=
LA564:  txa                                     ; A564 8A                       .
        eor     #$FF                            ; A565 49 FF                    I.
        and     #$80                            ; A567 29 80                    ).
        tax                                     ; A569 AA                       .
        cpy     #$69                            ; A56A C0 69                    .i
        beq     LA572                           ; A56C F0 04                    ..
        cpy     #$93                            ; A56E C0 93                    ..
        bne     LA500                           ; A570 D0 8E                    ..
LA572:  ldy     $3B                             ; A572 A4 3B                    .;
LA574:  .byte   $B9                             ; A574 B9                       .
LA575:  bbs7    $00,LA500                       ; A575 FF 00 88                 ...
        cmp     #$30                            ; A578 C9 30                    .0
        beq     LA574                           ; A57A F0 F8                    ..
        cmp     #$2E                            ; A57C C9 2E                    ..
        beq     LA581                           ; A57E F0 01                    ..
        iny                                     ; A580 C8                       .
LA581:  lda     #$2B                            ; A581 A9 2B                    .+
        ldx     $22                             ; A583 A6 22                    ."
        beq     LA5B5                           ; A585 F0 2E                    ..
        bpl     LA591                           ; A587 10 08                    ..
        lda     #$00                            ; A589 A9 00                    ..
        sec                                     ; A58B 38                       8
        sbc     $22                             ; A58C E5 22                    ."
        tax                                     ; A58E AA                       .
        .byte   $A9                             ; A58F A9                       .
LA590:  .byte   $2D                             ; A590 2D                       -
LA591:  sta     stack+1,y                       ; A591 99 01 01                 ...
        lda     #$45                            ; A594 A9 45                    .E
        sta     stack,y                         ; A596 99 00 01                 ...
        txa                                     ; A599 8A                       .
        ldx     #$2F                            ; A59A A2 2F                    ./
        sec                                     ; A59C 38                       8
LA59D:  inx                                     ; A59D E8                       .
        sbc     #$0A                            ; A59E E9 0A                    ..
        bcs     LA59D                           ; A5A0 B0 FB                    ..
        adc     #$3A                            ; A5A2 69 3A                    i:
        sta     stack+3,y                       ; A5A4 99 03 01                 ...
        txa                                     ; A5A7 8A                       .
        sta     stack+2,y                       ; A5A8 99 02 01                 ...
        lda     #$00                            ; A5AB A9 00                    ..
        sta     stack+4,y                       ; A5AD 99 04 01                 ...
        beq     LA5BA                           ; A5B0 F0 08                    ..
LA5B2:  sta     $FF,y                           ; A5B2 99 FF 00                 ...
LA5B5:  lda     #$00                            ; A5B5 A9 00                    ..
        sta     stack,y                         ; A5B7 99 00 01                 ...
LA5BA:  lda     #$00                            ; A5BA A9 00                    ..
        ldy     #$01                            ; A5BC A0 01                    ..
        rts                                     ; A5BE 60                       `
; ----------------------------------------------------------------------------
        bra     LA5C1                           ; A5BF 80 00                    ..
LA5C1:  brk                                     ; A5C1 00                       .
LA5C2:  brk                                     ; A5C2 00                       .
        brk                                     ; A5C3 00                       .
        brk                                     ; A5C4 00                       .
        brk                                     ; A5C5 00                       .
        brk                                     ; A5C6 00                       .
LA5C7:  .byte   $FF                             ; A5C7 FF                       .
LA5C8:  .byte   $A5                             ; A5C8 A5                       .
LA5C9:  .byte   $0C                             ; A5C9 0C                       .
LA5CA:  .byte   $EF                             ; A5CA EF                       .
LA5CB:  .byte   $85                             ; A5CB 85                       .
LA5CC:  .byte   $C0                             ; A5CC C0                       .
LA5CD:  brk                                     ; A5CD 00                       .
        brk                                     ; A5CE 00                       .
        ora     #$18                            ; A5CF 09 18                    ..
        lsr     LA072                           ; A5D1 4E 72 A0                 Nr.
        brk                                     ; A5D4 00                       .
        bbs7    $FF,LA5EF                       ; A5D5 FF FF 17                 ...
        .byte   $2B                             ; A5D8 2B                       +
        phy                                     ; A5D9 5A                       Z
LA5DA:  beq     LA5DC                           ; A5DA F0 00                    ..
LA5DC:  brk                                     ; A5DC 00                       .
        brk                                     ; A5DD 00                       .
        rmb1    $48                             ; A5DE 17 48                    .H
        ror     $E8,x                           ; A5E0 76 E8                    v.
        brk                                     ; A5E2 00                       .
LA5E3:  bbs7    $FF,LA5E3                       ; A5E3 FF FF FD                 ...
        .byte   $AB                             ; A5E6 AB                       .
        .byte   $F4                             ; A5E7 F4                       .
        trb     a:$00                           ; A5E8 1C 00 00                 ...
        brk                                     ; A5EB 00                       .
        brk                                     ; A5EC 00                       .
        .byte   $3B                             ; A5ED 3B                       ;
        txs                                     ; A5EE 9A                       .
LA5EF:  dex                                     ; A5EF CA                       .
        brk                                     ; A5F0 00                       .
        .byte   $FF                             ; A5F1 FF                       .
LA5F2:  .byte   $FF                             ; A5F2 FF                       .
LA5F3:  bbs7    $FA,$FA                         ; A5F3 FF FA 0A                 ...
        .byte   $1F                             ; A5F6 1F                       .
LA5F7:  brk                                     ; A5F7 00                       .
        brk                                     ; A5F8 00                       .
LA5F9:  brk                                     ; A5F9 00                       .
        brk                                     ; A5FA 00                       .
LA5FB:  brk                                     ; A5FB 00                       .
LA5FC:  tya                                     ; A5FC 98                       .
        stx     $80,y                           ; A5FD 96 80                    ..
        .byte   $FF                             ; A5FF FF                       .
        .byte   $FF                             ; A600 FF                       .
LA601:  bbs7    $FF,$FF                         ; A601 FF FF F0                 ...
LA604:  lda     a:$C0,x                         ; A604 BD C0 00                 ...
        brk                                     ; A607 00                       .
        brk                                     ; A608 00                       .
        brk                                     ; A609 00                       .
        ora     ($86,x)                         ; A60A 01 86                    ..
        ldy     #$FF                            ; A60C A0 FF                    ..
        .byte   $FF                             ; A60E FF                       .
        .byte   $FF                             ; A60F FF                       .
LA610:  bbs7    $FF,$FF                         ; A610 FF FF D8                 ...
        .byte   $F0                             ; A613 F0                       .
LA614:  brk                                     ; A614 00                       .
        brk                                     ; A615 00                       .
        brk                                     ; A616 00                       .
        brk                                     ; A617 00                       .
        brk                                     ; A618 00                       .
        .byte   $03                             ; A619 03                       .
        inx                                     ; A61A E8                       .
        .byte   $FF                             ; A61B FF                       .
        .byte   $FF                             ; A61C FF                       .
LA61D:  bbs7    $FF,$FF                         ; A61D FF FF FF                 ...
LA620:  bbs7    $9C,$9C                         ; A620 FF 9C 00                 ...
        brk                                     ; A623 00                       .
        brk                                     ; A624 00                       .
        brk                                     ; A625 00                       .
        brk                                     ; A626 00                       .
        brk                                     ; A627 00                       .
        asl     a                               ; A628 0A                       .
        .byte   $FF                             ; A629 FF                       .
        .byte   $FF                             ; A62A FF                       .
LA62B:  bbs7    $FF,$FF                         ; A62B FF FF FF                 ...
LA62E:  bbs7    $FF,$FF                         ; A62E FF FF FF                 ...
LA631:  bbs7    $FF,$FF                         ; A631 FF FF FF                 ...
        bbs5    $0A,$0A                         ; A634 DF 0A 80                 ...
        brk                                     ; A637 00                       .
LA638:  brk                                     ; A638 00                       .
        brk                                     ; A639 00                       .
        brk                                     ; A63A 00                       .
        .byte   $03                             ; A63B 03                       .
LA63C:  .byte   $4B                             ; A63C 4B                       K
        cpy     #$FF                            ; A63D C0 FF                    ..
        .byte   $FF                             ; A63F FF                       .
        .byte   $FF                             ; A640 FF                       .
LA641:  bbs7    $FF,$FF                         ; A641 FF FF 73                 ..s
        rts                                     ; A644 60                       `
; ----------------------------------------------------------------------------
        brk                                     ; A645 00                       .
LA646:  brk                                     ; A646 00                       .
        brk                                     ; A647 00                       .
        brk                                     ; A648 00                       .
        brk                                     ; A649 00                       .
        asl     LFF10                           ; A64A 0E 10 FF                 ...
        .byte   $FF                             ; A64D FF                       .
        .byte   $FF                             ; A64E FF                       .
LA64F:  bbs7    $FF,LA64F                       ; A64F FF FF FD                 ...
        tay                                     ; A652 A8                       .
        brk                                     ; A653 00                       .
        brk                                     ; A654 00                       .
        brk                                     ; A655 00                       .
        brk                                     ; A656 00                       .
        brk                                     ; A657 00                       .
        brk                                     ; A658 00                       .
        bit     LDB20,x                         ; A659 3C 20 DB                 < .
        lda     ($80,x)                         ; A65C A1 80                    ..
        tsb     $0A80                           ; A65E 0C 80 0A                 ...
        jsr     LA27B                           ; A661 20 7B A2                  {.
        lda     #$BF                            ; A664 A9 BF                    ..
        ldy     #$A5                            ; A666 A0 A5                    ..
        jsr     LA1DD                           ; A668 20 DD A1                  ..
        bne     LA670                           ; A66B D0 03                    ..
        jmp     LA72B                           ; A66D 4C 2B A7                 L+.
; ----------------------------------------------------------------------------
LA670:  lda     $30                             ; A670 A5 30                    .0
        bne     LA677                           ; A672 D0 03                    ..
        jmp     L9D6E                           ; A674 4C 6E 9D                 Ln.
; ----------------------------------------------------------------------------
LA677:  ldx     #$41                            ; A677 A2 41                    .A
        ldy     #$00                            ; A679 A0 00                    ..
        jsr     LA227                           ; A67B 20 27 A2                  '.
        lda     $38                             ; A67E A5 38                    .8
        bpl     LA691                           ; A680 10 0F                    ..
        jsr     LA369                           ; A682 20 69 A3                  i.
        lda     #$41                            ; A685 A9 41                    .A
        ldy     #$00                            ; A687 A0 00                    ..
        jsr     LA2DC                           ; A689 20 DC A2                  ..
        bne     LA691                           ; A68C D0 03                    ..
        tya                                     ; A68E 98                       .
        ldy     $00                             ; A68F A4 00                    ..
LA691:  jsr     LA26D                           ; A691 20 6D A2                  m.
        tya                                     ; A694 98                       .
        pha                                     ; A695 48                       H
        jsr     L9EF0                           ; A696 20 F0 9E                  ..
        lda     #$41                            ; A699 A9 41                    .A
        ldy     #$00                            ; A69B A0 00                    ..
        jsr     L9F60                           ; A69D 20 60 9F                  `.
        jsr     LA72B                           ; A6A0 20 2B A7                  +.
        pla                                     ; A6A3 68                       h
        lsr     a                               ; A6A4 4A                       J
LA6A5:  bcc     LA6B1                           ; A6A5 90 0A                    ..
LA6A7:  lda     $25                             ; A6A7 A5 25                    .%
        beq     LA6B1                           ; A6A9 F0 06                    ..
        lda     $2D                             ; A6AB A5 2D                    .-
        eor     #$FF                            ; A6AD 49 FF                    I.
        sta     $2D                             ; A6AF 85 2D                    .-
LA6B1:  rts                                     ; A6B1 60                       `
; ----------------------------------------------------------------------------
        sta     ($38,x)                         ; A6B2 81 38                    .8
        tax                                     ; A6B4 AA                       .
        .byte   $3B                             ; A6B5 3B                       ;
        and     #$5C                            ; A6B6 29 5C                    )\
        rmb1    $EE                             ; A6B8 17 EE                    ..
        ora     $4A59                           ; A6BA 0D 59 4A                 .YJ
        brk                                     ; A6BD 00                       .
        brk                                     ; A6BE 00                       .
        brk                                     ; A6BF 00                       .
        brk                                     ; A6C0 00                       .
        brk                                     ; A6C1 00                       .
        brk                                     ; A6C2 00                       .
        eor     LDE61,x                         ; A6C3 5D 61 DE                 ]a.
        lda     ($87)                           ; A6C6 B2 87                    ..
        sbc     ($4C,x)                         ; A6C8 E1 4C                    .L
        trb     $7461                           ; A6CA 1C 61 74                 .at
        adc     $63                             ; A6CD 65 63                    ec
        txs                                     ; A6CF 9A                       .
        sta     $14D9                           ; A6D0 8D D9 14                 ...
        adc     $72                             ; A6D3 65 72                    er
        rmb6    $A8                             ; A6D5 67 A8                    g.
        ldy     $765C                           ; A6D7 AC 5C 76                 .\v
        .byte   $44                             ; A6DA 44                       D
        adc     #$5A                            ; A6DB 69 5A                    iZ
        sta     ($9E)                           ; A6DD 92 9E                    ..
        stz     $3EAF                           ; A6DF 9C AF 3E                 ..>
        tsb     $316D                           ; A6E2 0C 6D 31                 .m1
        rts                                     ; A6E5 60                       `
; ----------------------------------------------------------------------------
        ora     ($1D),y                         ; A6E6 11 1D                    ..
        rol     $0E41                           ; A6E8 2E 41 0E                 .A.
        bvs     LA76C                           ; A6EB 70 7F                    p.
        sbc     $FE                             ; A6ED E5 FE                    ..
        bit     L8645                           ; A6EF 2C 45 86                 ,E.
        bit     $74                             ; A6F2 24 74                    $t
LA6F4:  and     ($84,x)                         ; A6F4 21 84                    !.
        bit     #$7C                            ; A6F6 89 7C                    .|
        rol     $3C,x                           ; A6F8 36 3C                    6<
        bmi     LA773                           ; A6FA 30 77                    0w
        rol     LFFC3                           ; A6FC 2E C3 FF                 ...
        bit     $3953,x                         ; A6FF 3C 53 39                 <S9
        .byte   $82                             ; A702 82                       .
        ply                                     ; A703 7A                       z
        ora     $5B95,x                         ; A704 1D 95 5B                 ..[
        adc     $73D2,x                         ; A707 7D D2 73                 }.s
        sty     $7C                             ; A70A 84 7C                    .|
        .byte   $63                             ; A70C 63                       c
        cli                                     ; A70D 58                       X
        lsr     $B8                             ; A70E 46 B8                    F.
        and     $05                             ; A710 25 05                    %.
        sed                                     ; A712 F8                       .
        ror     LFD75,x                         ; A713 7E 75 FD                 ~u.
        bbs6    $FC,LA72F                       ; A716 EF FC 16                 ...
        bit     L8074                           ; A719 2C 74 80                 ,t.
        and     ($72),y                         ; A71C 31 72                    1r
LA71E:  rmb1    $F7                             ; A71E 17 F7                    ..
        cmp     ($CF),y                         ; A720 D1 CF                    ..
        jmp     (L0081,x)                       ; A722 7C 81 00                 |..
LA725:  brk                                     ; A725 00                       .
        brk                                     ; A726 00                       .
        brk                                     ; A727 00                       .
        brk                                     ; A728 00                       .
        brk                                     ; A729 00                       .
        brk                                     ; A72A 00                       .
LA72B:  lda     #$B2                            ; A72B A9 B2                    ..
        ldy     #$A6                            ; A72D A0 A6                    ..
LA72F:  .byte   $20                             ; A72F 20                        
LA730:  rol     $A59F                           ; A730 2E 9F A5                 ...
        dec     a                               ; A733 3A                       :
        .byte   $69                             ; A734 69                       i
LA735:  bvc     $A6C7                           ; A735 50 90                    P.
        .byte   $03                             ; A737 03                       .
        jsr     LA292                           ; A738 20 92 A2                  ..
LA73B:  sta     $14                             ; A73B 85 14                    ..
        jsr     LA27E                           ; A73D 20 7E A2                  ~.
        lda     $25                             ; A740 A5 25                    .%
        cmp     #$88                            ; A742 C9 88                    ..
LA744:  bcc     LA749                           ; A744 90 03                    ..
LA746:  jsr     LA0B3                           ; A746 20 B3 A0                  ..
LA749:  jsr     LA369                           ; A749 20 69 A3                  i.
        .byte   $A5                             ; A74C A5                       .
LA74D:  brk                                     ; A74D 00                       .
        clc                                     ; A74E 18                       .
        adc     #$81                            ; A74F 69 81                    i.
        beq     LA746                           ; A751 F0 F3                    ..
        sec                                     ; A753 38                       8
        sbc     #$01                            ; A754 E9 01                    ..
        pha                                     ; A756 48                       H
        ldx     #$08                            ; A757 A2 08                    ..
LA759:  lda     $30,x                           ; A759 B5 30                    .0
        ldy     $25,x                           ; A75B B4 25                    .%
        sta     $25,x                           ; A75D 95 25                    .%
        sty     $30,x                           ; A75F 94 30                    .0
        dex                                     ; A761 CA                       .
        bpl     LA759                           ; A762 10 F5                    ..
        lda     $14                             ; A764 A5 14                    ..
        sta     $3A                             ; A766 85 3A                    .:
        jsr     L9CA7                           ; A768 20 A7 9C                  ..
        .byte   $20                             ; A76B 20                        
LA76C:  smb2    CurMaxY_                        ; A76C A7 A6                    ..
        lda     #$BA                            ; A76E A9 BA                    ..
        ldy     #$A6                            ; A770 A0 A6                    ..
        .byte   $20                             ; A772 20                        
LA773:  sty     $A7,x                           ; A773 94 A7                    ..
        lda     #$00                            ; A775 A9 00                    ..
        sta     $39                             ; A777 85 39                    .9
        pla                                     ; A779 68                       h
        jsr     LA098                           ; A77A 20 98 A0                  ..
        rts                                     ; A77D 60                       `
; ----------------------------------------------------------------------------
LA77E:  sta     $3B                             ; A77E 85 3B                    .;
        sty     $3C                             ; A780 84 3C                    .<
        jsr     LA220                           ; A782 20 20 A2                   .
        lda     #$15                            ; A785 A9 15                    ..
        jsr     L9F60                           ; A787 20 60 9F                  `.
        jsr     LA798                           ; A78A 20 98 A7                  ..
        lda     #$15                            ; A78D A9 15                    ..
        ldy     #$00                            ; A78F A0 00                    ..
        jmp     L9F60                           ; A791 4C 60 9F                 L`.
; ----------------------------------------------------------------------------
        sta     $3B                             ; A794 85 3B                    .;
        sty     $3C                             ; A796 84 3C                    .<
LA798:  jsr     LA21D                           ; A798 20 1D A2                  ..
        lda     ($3B),y                         ; A79B B1 3B                    .;
LA79D:  sta     $2E                             ; A79D 85 2E                    ..
        ldy     $3B                             ; A79F A4 3B                    .;
        iny                                     ; A7A1 C8                       .
        tya                                     ; A7A2 98                       .
        bne     LA7A7                           ; A7A3 D0 02                    ..
        inc     $3C                             ; A7A5 E6 3C                    .<
LA7A7:  sta     $3B                             ; A7A7 85 3B                    .;
        ldy     $3C                             ; A7A9 A4 3C                    .<
LA7AB:  jsr     L9F2E                           ; A7AB 20 2E 9F                  ..
        lda     $3B                             ; A7AE A5 3B                    .;
        ldy     $3C                             ; A7B0 A4 3C                    .<
        clc                                     ; A7B2 18                       .
        adc     #$08                            ; A7B3 69 08                    i.
        .byte   $90                             ; A7B5 90                       .
LA7B6:  ora     ($C8,x)                         ; A7B6 01 C8                    ..
LA7B8:  sta     $3B                             ; A7B8 85 3B                    .;
        sty     $3C                             ; A7BA 84 3C                    .<
        jsr     L9F3C                           ; A7BC 20 3C 9F                  <.
        lda     #$1D                            ; A7BF A9 1D                    ..
        ldy     #$00                            ; A7C1 A0 00                    ..
        dec     $2E                             ; A7C3 C6 2E                    ..
        bne     LA7AB                           ; A7C5 D0 E4                    ..
        rts                                     ; A7C7 60                       `
; ----------------------------------------------------------------------------
        tya                                     ; A7C8 98                       .
        and     $44,x                           ; A7C9 35 44                    5D
        ply                                     ; A7CB 7A                       z
        brk                                     ; A7CC 00                       .
        brk                                     ; A7CD 00                       .
        brk                                     ; A7CE 00                       .
        brk                                     ; A7CF 00                       .
        pla                                     ; A7D0 68                       h
        plp                                     ; A7D1 28                       (
        lda     ($46),y                         ; A7D2 B1 46                    .F
        brk                                     ; A7D4 00                       .
        brk                                     ; A7D5 00                       .
        brk                                     ; A7D6 00                       .
        brk                                     ; A7D7 00                       .
        jsr     LA29A                           ; A7D8 20 9A A2                  ..
        bmi     LA81A                           ; A7DB 30 3D                    0=
        bne     LA805                           ; A7DD D0 26                    .&
        lda     VIA1_T1CL                       ; A7DF AD 04 F8                 ...
LA7E2:  sta     $26                             ; A7E2 85 26                    .&
        lda     VIA1_T1CH                       ; A7E4 AD 05 F8                 ...
        sta     $2B                             ; A7E7 85 2B                    .+
        lda     VIA1_T2CL                       ; A7E9 AD 08 F8                 ...
        sta     $2A                             ; A7EC 85 2A                    .*
        lda     VIA2_T2CL                       ; A7EE AD 88 F8                 ...
        sta     $29                             ; A7F1 85 29                    .)
        lda     VIA2_T1CL                       ; A7F3 AD 84 F8                 ...
        sta     $28                             ; A7F6 85 28                    .(
        lda     VIA1_T2CL                       ; A7F8 AD 08 F8                 ...
        sta     $27                             ; A7FB 85 27                    .'
        lda     VIA1_T2CH                       ; A7FD AD 09 F8                 ...
        sta     $2C                             ; A800 85 2C                    .,
        jmp     LA832                           ; A802 4C 32 A8                 L2.
; ----------------------------------------------------------------------------
LA805:  lda     #$AC                            ; A805 A9 AC                    ..
        ldy     #$03                            ; A807 A0 03                    ..
        jsr     LA1DD                           ; A809 20 DD A1                  ..
        lda     #$C8                            ; A80C A9 C8                    ..
        ldy     #$A7                            ; A80E A0 A7                    ..
        jsr     L9F2E                           ; A810 20 2E 9F                  ..
        lda     #$D0                            ; A813 A9 D0                    ..
        ldy     #$A7                            ; A815 A0 A7                    ..
        jsr     L9F3C                           ; A817 20 3C 9F                  <.
LA81A:  ldx     $2C                             ; A81A A6 2C                    .,
        lda     $26                             ; A81C A5 26                    .&
        sta     $2C                             ; A81E 85 2C                    .,
        stx     $26                             ; A820 86 26                    .&
        ldx     $2A                             ; A822 A6 2A                    .*
        lda     $29                             ; A824 A5 29                    .)
        sta     $2A                             ; A826 85 2A                    .*
        stx     $29                             ; A828 86 29                    .)
        ldx     $27                             ; A82A A6 27                    .'
        lda     $2B                             ; A82C A5 2B                    .+
        sta     $27                             ; A82E 85 27                    .'
        stx     $2B                             ; A830 86 2B                    .+
LA832:  lda     #$00                            ; A832 A9 00                    ..
        sta     $2D                             ; A834 85 2D                    .-
        lda     $25                             ; A836 A5 25                    .%
        sta     $3A                             ; A838 85 3A                    .:
        lda     #$80                            ; A83A A9 80                    ..
        sta     $25                             ; A83C 85 25                    .%
        jsr     L9D40                           ; A83E 20 40 9D                  @.
        ldx     #$AC                            ; A841 A2 AC                    ..
        ldy     #$03                            ; A843 A0 03                    ..
LA845:  jmp     LA227                           ; A845 4C 27 A2                 L'.
; ----------------------------------------------------------------------------
        lda     #$C4                            ; A848 A9 C4                    ..
        ldy     #$A8                            ; A84A A0 A8                    ..
        jsr     L9F3C                           ; A84C 20 3C 9F                  <.
LA84F:  jsr     LA27B                           ; A84F 20 7B A2                  {.
        lda     #$CC                            ; A852 A9 CC                    ..
        ldy     #$A8                            ; A854 A0 A8                    ..
        ldx     $38                             ; A856 A6 38                    .8
        jsr     LA0EE                           ; A858 20 EE A0                  ..
        jsr     LA27B                           ; A85B 20 7B A2                  {.
        jsr     LA369                           ; A85E 20 69 A3                  i.
        lda     #$00                            ; A861 A9 00                    ..
        sta     $39                             ; A863 85 39                    .9
        jsr     L9CA7                           ; A865 20 A7 9C                  ..
        lda     #$D4                            ; A868 A9 D4                    ..
        .byte   $A0                             ; A86A A0                       .
LA86B:  tay                                     ; A86B A8                       .
        jsr     L9F48                           ; A86C 20 48 9F                  H.
        lda     $2D                             ; A86F A5 2D                    .-
        pha                                     ; A871 48                       H
        bpl     LA881                           ; A872 10 0D                    ..
        jsr     L9F38                           ; A874 20 38 9F                  8.
        lda     $2D                             ; A877 A5 2D                    .-
        bmi     LA884                           ; A879 30 09                    0.
        lda     $04                             ; A87B A5 04                    ..
        eor     #$FF                            ; A87D 49 FF                    I.
        sta     $04                             ; A87F 85 04                    ..
LA881:  jsr     LA6A7                           ; A881 20 A7 A6                  ..
LA884:  lda     #$D4                            ; A884 A9 D4                    ..
        ldy     #$A8                            ; A886 A0 A8                    ..
        jsr     L9F3C                           ; A888 20 3C 9F                  <.
        pla                                     ; A88B 68                       h
        bpl     LA891                           ; A88C 10 03                    ..
        jsr     LA6A7                           ; A88E 20 A7 A6                  ..
LA891:  lda     #$DC                            ; A891 A9 DC                    ..
        ldy     #$A8                            ; A893 A0 A8                    ..
        jmp     LA77E                           ; A895 4C 7E A7                 L~.
; ----------------------------------------------------------------------------
        jsr     LA220                           ; A898 20 20 A2                   .
        lda     #$00                            ; A89B A9 00                    ..
        sta     $04                             ; A89D 85 04                    ..
        jsr     LA84F                           ; A89F 20 4F A8                  O.
        ldx     #$41                            ; A8A2 A2 41                    .A
        ldy     #$00                            ; A8A4 A0 00                    ..
        jsr     LA845                           ; A8A6 20 45 A8                  E.
        lda     #$15                            ; A8A9 A9 15                    ..
        ldy     #$00                            ; A8AB A0 00                    ..
        jsr     LA1DD                           ; A8AD 20 DD A1                  ..
        lda     #$00                            ; A8B0 A9 00                    ..
        sta     $2D                             ; A8B2 85 2D                    .-
        lda     $04                             ; A8B4 A5 04                    ..
        jsr     LA8C0                           ; A8B6 20 C0 A8                  ..
        lda     #$41                            ; A8B9 A9 41                    .A
        ldy     #$00                            ; A8BB A0 00                    ..
        jmp     LA0F6                           ; A8BD 4C F6 A0                 L..
; ----------------------------------------------------------------------------
LA8C0:  pha                                     ; A8C0 48                       H
        jmp     LA881                           ; A8C1 4C 81 A8                 L..
; ----------------------------------------------------------------------------
        sta     ($49,x)                         ; A8C4 81 49                    .I
        bbr0    $DA,LA86B                       ; A8C6 0F DA A2                 ...
        and     ($68,x)                         ; A8C9 21 68                    !h
        iny                                     ; A8CB C8                       .
        .byte   $83                             ; A8CC 83                       .
        eor     #$0F                            ; A8CD 49 0F                    I.
        phx                                     ; A8CF DA                       .
        ldx     #$21                            ; A8D0 A2 21                    .!
        pla                                     ; A8D2 68                       h
        iny                                     ; A8D3 C8                       .
        bbr7    $00,LA8D7                       ; A8D4 7F 00 00                 ...
LA8D7:  brk                                     ; A8D7 00                       .
        brk                                     ; A8D8 00                       .
        brk                                     ; A8D9 00                       .
        brk                                     ; A8DA 00                       .
        brk                                     ; A8DB 00                       .
        ora     #$7A                            ; A8DC 09 7A                    .z
        cmp     $20                             ; A8DE C5 20                    . 
        and     ($08,x)                         ; A8E0 21 08                    !.
        .byte   $FC                             ; A8E2 FC                       .
        tax                                     ; A8E3 AA                       .
        trb     $7D                             ; A8E4 14 7D                    .}
        eor     $76,x                           ; A8E6 55 76                    Uv
        ora     LC957,y                         ; A8E8 19 57 C9                 .W.
        txs                                     ; A8EB 9A                       .
        ldy     LB780                           ; A8EC AC 80 B7                 ...
        dec     $DC,x                           ; A8EF D6 DC                    ..
        sed                                     ; A8F1 F8                       .
        tax                                     ; A8F2 AA                       .
        lda     L82FE,y                         ; A8F3 B9 FE 82                 ...
        stz     $7A,x                           ; A8F6 74 7A                    tz
        inc     a                               ; A8F8 1A                       .
        pla                                     ; A8F9 68                       h
        .byte   $0C                             ; A8FA 0C                       .
LA8FB:  ror     a                               ; A8FB 6A                       j
        .byte   $F4                             ; A8FC F4                       .
        sty     $F1                             ; A8FD 84 F1                    ..
        .byte   $83                             ; A8FF 83                       .
        smb2    $EF                             ; A900 A7 EF                    ..
        .byte   $44                             ; A902 44                       D
        sec                                     ; A903 38                       8
        .byte   $DC                             ; A904 DC                       .
        stx     $28                             ; A905 86 28                    .(
        bit     $431A,x                         ; A907 3C 1A 43                 <.C
        smb7    $3B                             ; A90A F7 3B                    .;
        sed                                     ; A90C F8                       .
        smb0    $99                             ; A90D 87 99                    ..
        adc     #$66                            ; A90F 69 66                    if
        .byte   $73                             ; A911 73                       s
        ora     $EC,x                           ; A912 15 EC                    ..
        .byte   $23                             ; A914 23                       #
        smb0    $23                             ; A915 87 23                    .#
        and     $E3,x                           ; A917 35 E3                    5.
        .byte   $3B                             ; A919 3B                       ;
        lda     a:$57                           ; A91A AD 57 00                 .W.
        stx     $A5                             ; A91D 86 A5                    ..
        eor     $31E7,x                         ; A91F 5D E7 31                 ].1
        and     L90F2                           ; A922 2D F2 90                 -..
        .byte   $83                             ; A925 83                       .
        eor     #$0F                            ; A926 49 0F                    I.
        phx                                     ; A928 DA                       .
        ldx     #$21                            ; A929 A2 21                    .!
        pla                                     ; A92B 68                       h
        iny                                     ; A92C C8                       .
        lda     $2D                             ; A92D A5 2D                    .-
        pha                                     ; A92F 48                       H
        bpl     LA935                           ; A930 10 03                    ..
        jsr     LA6A7                           ; A932 20 A7 A6                  ..
LA935:  lda     $25                             ; A935 A5 25                    .%
        pha                                     ; A937 48                       H
        cmp     #$81                            ; A938 C9 81                    ..
        bcc     LA943                           ; A93A 90 07                    ..
        lda     #$7F                            ; A93C A9 7F                    ..
        ldy     #$9E                            ; A93E A0 9E                    ..
        jsr     L9F54                           ; A940 20 54 9F                  T.
LA943:  lda     #$5D                            ; A943 A9 5D                    .]
        ldy     #$A9                            ; A945 A0 A9                    ..
        jsr     LA77E                           ; A947 20 7E A7                  ~.
        pla                                     ; A94A 68                       h
        cmp     #$81                            ; A94B C9 81                    ..
        bcc     LA956                           ; A94D 90 07                    ..
        lda     #$C4                            ; A94F A9 C4                    ..
        ldy     #$A8                            ; A951 A0 A8                    ..
        jsr     L9F48                           ; A953 20 48 9F                  H.
LA956:  pla                                     ; A956 68                       h
        bpl     LA95C                           ; A957 10 03                    ..
        jmp     LA6A7                           ; A959 4C A7 A6                 L..
; ----------------------------------------------------------------------------
LA95C:  rts                                     ; A95C 60                       `
; ----------------------------------------------------------------------------
        tsb     $6275                           ; A95D 0C 75 62                 .ub
        inc     $07BA,x                         ; A960 FE BA 07                 ...
        trb     $3A                             ; A963 14 3A                    .:
        tay                                     ; A965 A8                       .
        sei                                     ; A966 78                       x
        dec     $D8,x                           ; A967 D6 D8                    ..
        dec     $5116                           ; A969 CE 16 51                 ..Q
        eor     $7A14                           ; A96C 4D 14 7A                 M.z
        rol     $7DD1,x                         ; A96F 3E D1 7D                 >.}
        .byte   $BD                             ; A972 BD                       .
        .byte   $4C                             ; A973 4C                       L
LA974:  rol     $88,x                           ; A974 36 88                    6.
        .byte   $7B                             ; A976 7B                       {
        .byte   $D7                             ; A977 D7                       .
LA978:  cpy     $23                             ; A978 C4 23                    .#
        .byte   $CB                             ; A97A CB                       .
        ora     ($6B,x)                         ; A97B 01 6B                    .k
        .byte   $9C                             ; A97D 9C                       .
LA97E:  jmp     ($1734,x)                       ; A97E 7C 34 17                 |4.
        asl     a                               ; A981 0A                       .
        dec     a                               ; A982 3A                       :
        .byte   $DC                             ; A983 DC                       .
        eor     ($78,x)                         ; A984 41 78                    Ax
        jmp     (L81F7,x)                       ; A986 7C F7 81                 |..
        .byte   $A3                             ; A989 A3                       .
        cmp     ($36,x)                         ; A98A C1 36                    .6
        rmb2    $00                             ; A98C 27 00                    '.
        adc     LAE19,x                         ; A98E 7D 19 AE                 }..
        adc     ($16,x)                         ; A991 61 16                    a.
        nop                                     ; A993 EA                       .
        tsx                                     ; A994 BA                       .
        eor     LB97D                           ; A995 4D 7D B9                 M}.
        rts                                     ; A998 60                       `
; ----------------------------------------------------------------------------
        bbs0    $78,LA9F9                       ; A999 8F 78 5D                 .x]
        .byte   $0B                             ; A99C 0B                       .
        tsx                                     ; A99D BA                       .
        adc     $7263,x                         ; A99E 7D 63 72                 }cr
        ora     ($44)                           ; A9A1 12 44                    .D
        .byte   $A1                             ; A9A3 A1                       .
LA9A4:  sta     $B4                             ; A9A4 85 B4                    ..
        ror     $4792,x                         ; A9A6 7E 92 47                 ~.G
        .byte   $FB                             ; A9A9 FB                       .
        .byte   $62                             ; A9AA 62                       b
        asl     $0D,x                           ; A9AB 16 0D                    ..
        .byte   $43                             ; A9AD 43                       C
        ror     LCC4C,x                         ; A9AE 7E 4C CC                 ~L.
        bbs3    $F0,LA974                       ; A9B1 BF F0 C0                 ...
        ply                                     ; A9B4 7A                       z
        stz     $7F                             ; A9B5 64 7F                    d.
        tax                                     ; A9B7 AA                       .
        tax                                     ; A9B8 AA                       .
        tax                                     ; A9B9 AA                       .
LA9BA:  stx     LB07D                           ; A9BA 8E 7D B0                 .}.
        cpy     #$80                            ; A9BD C0 80                    ..
        .byte   $7F                             ; A9BF 7F                       .
        .byte   $FF                             ; A9C0 FF                       .
LA9C1:  bbs7    $FF,$FF                         ; A9C1 FF FF F5                 ...
        lda     $202C,y                         ; A9C4 B9 2C 20                 ., 
        .byte   $2B                             ; A9C7 2B                       +
        ldy     #$20                            ; A9C8 A0 20                    . 
        inc     $9B,x                           ; A9CA F6 9B                    ..
        lda     $2C                             ; A9CC A5 2C                    .,
        sta     $00                             ; A9CE 85 00                    ..
        lda     $2B                             ; A9D0 A5 2B                    .+
        sta     $01                             ; A9D2 85 01                    ..
        jsr     LA26B                           ; A9D4 20 6B A2                  k.
        jsr     L9BF6                           ; A9D7 20 F6 9B                  ..
        lda     $2C                             ; A9DA A5 2C                    .,
        eor     $00                             ; A9DC 45 00                    E.
        tay                                     ; A9DE A8                       .
        lda     $2B                             ; A9DF A5 2B                    .+
LA9E1:  eor     $01                             ; A9E1 45 01                    E.
        jmp     L9BDA                           ; A9E3 4C DA 9B                 L..
; ----------------------------------------------------------------------------
LA9E6:  php                                     ; A9E6 08                       .
        sty     $03A0                           ; A9E7 8C A0 03                 ...
        cpx     #$50                            ; A9EA E0 50                    .P
        bcs     LAA17                           ; A9EC B0 29                    .)
        stx     $039F                           ; A9EE 8E 9F 03                 ...
LA9F1:  tax                                     ; A9F1 AA                       .
        and     #$0F                            ; A9F2 29 0F                    ).
        sta     $039D                           ; A9F4 8D 9D 03                 ...
        txa                                     ; A9F7 8A                       .
        lsr     a                               ; A9F8 4A                       J
LA9F9:  lsr     a                               ; A9F9 4A                       J
        lsr     a                               ; A9FA 4A                       J
        lsr     a                               ; A9FB 4A                       J
        inc     a                               ; A9FC 1A                       .
        sta     $039E                           ; A9FD 8D 9E 03                 ...
        cld                                     ; AA00 D8                       .
        lda     #$FF                            ; AA01 A9 FF                    ..
        sta     $ED                             ; AA03 85 ED                    ..
        lda     VidMemHi                        ; AA05 A5 A0                    ..
        clc                                     ; AA07 18                       .
        adc     #$07                            ; AA08 69 07                    i.
        sta     $EE                             ; AA0A 85 EE                    ..
LAA0C:  lda     $039D                           ; AA0C AD 9D 03                 ...
        inc     $039D                           ; AA0F EE 9D 03                 ...
        cmp     $039E                           ; AA12 CD 9E 03                 ...
        bcc     LAA19                           ; AA15 90 02                    ..
LAA17:  plp                                     ; AA17 28                       (
        rts                                     ; AA18 60                       `
; ----------------------------------------------------------------------------
LAA19:  stz     $EB                             ; AA19 64 EB                    d.
        lsr     a                               ; AA1B 4A                       J
        ror     $EB                             ; AA1C 66 EB                    f.
        adc     VidMemHi                        ; AA1E 65 A0                    e.
        sta     $EC                             ; AA20 85 EC                    ..
        ldy     $039F                           ; AA22 AC 9F 03                 ...
LAA25:  plp                                     ; AA25 28                       (
        php                                     ; AA26 08                       .
        lda     ($ED)                           ; AA27 B2 ED                    ..
        bcs     LAA31                           ; AA29 B0 06                    ..
        lda     ($EB),y                         ; AA2B B1 EB                    ..
        sta     ($ED)                           ; AA2D 92 ED                    ..
        lda     #$20                            ; AA2F A9 20                    . 
LAA31:  sta     ($EB),y                         ; AA31 91 EB                    ..
        lda     $ED                             ; AA33 A5 ED                    ..
        asl     a                               ; AA35 0A                       .
        eor     #$A2                            ; AA36 49 A2                    I.
        bne     LAA47                           ; AA38 D0 0D                    ..
        ror     a                               ; AA3A 6A                       j
        sta     $ED                             ; AA3B 85 ED                    ..
        bmi     LAA47                           ; AA3D 30 08                    0.
        dec     $EE                             ; AA3F C6 EE                    ..
        lda     $EE                             ; AA41 A5 EE                    ..
        cmp     VidMemHi                        ; AA43 C5 A0                    ..
        bcc     LAA17                           ; AA45 90 D0                    ..
LAA47:  dec     $ED                             ; AA47 C6 ED                    ..
        dey                                     ; AA49 88                       .
        bmi     LAA0C                           ; AA4A 30 C0                    0.
        cpy     $03A0                           ; AA4C CC A0 03                 ...
        bcs     LAA25                           ; AA4F B0 D4                    ..
        bra     LAA0C                           ; AA51 80 B9                    ..
LAA53:  stx     $03A3                           ; AA53 8E A3 03                 ...
        sty     $03A7                           ; AA56 8C A7 03                 ...
        sty     $0357                           ; AA59 8C 57 03                 .W.
        pha                                     ; AA5C 48                       H
        and     #$07                            ; AA5D 29 07                    ).
        sta     $03A2                           ; AA5F 8D A2 03                 ...
        pla                                     ; AA62 68                       h
        eor     #$F8                            ; AA63 49 F8                    I.
        bit     #$F8                            ; AA65 89 F8                    ..
        beq     LAA7F                           ; AA67 F0 16                    ..
        .byte   $09                             ; AA69 09                       .
LAA6A:  rmb0    $8D                             ; AA6A 07 8D                    ..
        lda     ($03,x)                         ; AA6C A1 03                    ..
        ldy     #$00                            ; AA6E A0 00                    ..
        ldx     #$00                            ; AA70 A2 00                    ..
LAA72:  jsr     FROM_C684                       ; AA72 20 53 03                  S.
        beq     LAA81                           ; AA75 F0 0A                    ..
        cmp     #$0D                            ; AA77 C9 0D                    ..
        bne     LAA7C                           ; AA79 D0 01                    ..
        inx                                     ; AA7B E8                       .
LAA7C:  iny                                     ; AA7C C8                       .
        bne     LAA72                           ; AA7D D0 F3                    ..
LAA7F:  sec                                     ; AA7F 38                       8
        rts                                     ; AA80 60                       `
; ----------------------------------------------------------------------------
LAA81:  cpx     #$0F                            ; AA81 E0 0F                    ..
        bcs     LAA7F                           ; AA83 B0 FA                    ..
        stx     $03A4                           ; AA85 8E A4 03                 ...
        clc                                     ; AA88 18                       .
        jsr     LAB90                           ; AA89 20 90 AB                  ..
LAA8C:  ldx     $03A4                           ; AA8C AE A4 03                 ...
        lda     $03A3                           ; AA8F AD A3 03                 ...
        bmi     LAA9C                           ; AA92 30 08                    0.
        cpx     $03A3                           ; AA94 EC A3 03                 ...
        bcs     LAA9D                           ; AA97 B0 04                    ..
        lda     #$00                            ; AA99 A9 00                    ..
        .byte   $24                             ; AA9B 24                       $
LAA9C:  txa                                     ; AA9C 8A                       .
LAA9D:  sta     $03A3                           ; AA9D 8D A3 03                 ...
        jsr     LAAF7                           ; AAA0 20 F7 AA                  ..
        jsr     LB6DF                           ; AAA3 20 DF B6                  ..
        cmp     #$91                            ; AAA6 C9 91                    ..
        bne     LAAAD                           ; AAA8 D0 03                    ..
        inc     $03A3                           ; AAAA EE A3 03                 ...
LAAAD:  cmp     #$11                            ; AAAD C9 11                    ..
        bne     LAAB4                           ; AAAF D0 03                    ..
        dec     $03A3                           ; AAB1 CE A3 03                 ...
LAAB4:  tax                                     ; AAB4 AA                       .
        lda     #$80                            ; AAB5 A9 80                    ..
        cpx     #$9D                            ; AAB7 E0 9D                    ..
        beq     LAAD9                           ; AAB9 F0 1E                    ..
        lsr     a                               ; AABB 4A                       J
        cpx     #$1D                            ; AABC E0 1D                    ..
        beq     LAAD9                           ; AABE F0 19                    ..
        lsr     a                               ; AAC0 4A                       J
        cpx     #$0D                            ; AAC1 E0 0D                    ..
        beq     LAAD9                           ; AAC3 F0 14                    ..
        cpx     #$85                            ; AAC5 E0 85                    ..
        bcc     LAA8C                           ; AAC7 90 C3                    ..
        cpx     #$8D                            ; AAC9 E0 8D                    ..
        bcs     LAA8C                           ; AACB B0 BF                    ..
        lda     LAA6A,x                         ; AACD BD 6A AA                 .j.
        cmp     $03A2                           ; AAD0 CD A2 03                 ...
        beq     LAAD7                           ; AAD3 F0 02                    ..
        ora     #$18                            ; AAD5 09 18                    ..
LAAD7:  eor     #$08                            ; AAD7 49 08                    I.
LAAD9:  and     $03A1                           ; AAD9 2D A1 03                 -..
        bit     #$F8                            ; AADC 89 F8                    ..
        beq     LAA8C                           ; AADE F0 AC                    ..
        sta     $03A1                           ; AAE0 8D A1 03                 ...
        sec                                     ; AAE3 38                       8
        jsr     LAB90                           ; AAE4 20 90 AB                  ..
        lda     $03A1                           ; AAE7 AD A1 03                 ...
        ldx     $03A3                           ; AAEA AE A3 03                 ...
        clc                                     ; AAED 18                       .
        rts                                     ; AAEE 60                       `
; ----------------------------------------------------------------------------
        brk                                     ; AAEF 00                       .
        .byte   $02                             ; AAF0 02                       .
        tsb     $06                             ; AAF1 04 06                    ..
        ora     ($03,x)                         ; AAF3 01 03                    ..
        ora     $07                             ; AAF5 05 07                    ..
LAAF7:  stz     $03A5                           ; AAF7 9C A5 03                 ...
        lda     #$FF                            ; AAFA A9 FF                    ..
        sta     $03A6                           ; AAFC 8D A6 03                 ...
        ldy     $03A7                           ; AAFF AC A7 03                 ...
        sty     $0357                           ; AB02 8C 57 03                 .W.
LAB05:  jsr     LAB57                           ; AB05 20 57 AB                  W.
        lda     #$A5                            ; AB08 A9 A5                    ..
        jsr     LAB50                           ; AB0A 20 50 AB                  P.
        bne     LAB11                           ; AB0D D0 02                    ..
        lda     #$20                            ; AB0F A9 20                    . 
LAB11:  clc                                     ; AB11 18                       .
        jsr     LB6F9                           ; AB12 20 F9 B6                  ..
        inc     $03A6                           ; AB15 EE A6 03                 ...
        ldy     $03A6                           ; AB18 AC A6 03                 ...
        jsr     FROM_C684                       ; AB1B 20 53 03                  S.
        beq     LAB24                           ; AB1E F0 04                    ..
        cmp     #$0D                            ; AB20 C9 0D                    ..
        bne     LAB11                           ; AB22 D0 ED                    ..
LAB24:  lda     #$0D                            ; AB24 A9 0D                    ..
        clc                                     ; AB26 18                       .
        jsr     LB6F9                           ; AB27 20 F9 B6                  ..
        lda     #$67                            ; AB2A A9 67                    .g
        jsr     LAB50                           ; AB2C 20 50 AB                  P.
        bne     LAB33                           ; AB2F D0 02                    ..
        lda     #$A0                            ; AB31 A9 A0                    ..
LAB33:  sta     ($BD)                           ; AB33 92 BD                    ..
        lda     $03A5                           ; AB35 AD A5 03                 ...
        inc     $03A5                           ; AB38 EE A5 03                 ...
        cmp     $03A4                           ; AB3B CD A4 03                 ...
        bcc     LAB05                           ; AB3E 90 C5                    ..
        cmp     #$0E                            ; AB40 C9 0E                    ..
        bcs     LAB50                           ; AB42 B0 0C                    ..
        jsr     LAB57                           ; AB44 20 57 AB                  W.
        ldy     #$08                            ; AB47 A0 08                    ..
        lda     #$64                            ; AB49 A9 64                    .d
LAB4B:  sta     ($BD),y                         ; AB4B 91 BD                    ..
        dey                                     ; AB4D 88                       .
        bpl     LAB4B                           ; AB4E 10 FB                    ..
LAB50:  ldx     $03A5                           ; AB50 AE A5 03                 ...
        cpx     $03A3                           ; AB53 EC A3 03                 ...
        rts                                     ; AB56 60                       `
; ----------------------------------------------------------------------------
LAB57:  ldx     $03A2                           ; AB57 AE A2 03                 ...
        ldy     LAB80,x                         ; AB5A BC 80 AB                 ...
        lda     #$08                            ; AB5D A9 08                    ..
        jsr     LAB50                           ; AB5F 20 50 AB                  P.
        bne     LAB66                           ; AB62 D0 02                    ..
        eor     #$80                            ; AB64 49 80                    I.
LAB66:  pha                                     ; AB66 48                       H
        lda     LAB70,x                         ; AB67 BD 70 AB                 .p.
        tax                                     ; AB6A AA                       .
        pla                                     ; AB6B 68                       h
        sec                                     ; AB6C 38                       8
        jmp     LB6F9                           ; AB6D 4C F9 B6                 L..
; ----------------------------------------------------------------------------
LAB70:  .byte   $0E                             ; AB70 0E                       .
LAB71:  .byte   $0D,$0C,$0B,$0A,$09,$08,$07,$06 ; AB71 0D 0C 0B 0A 09 08 07 06  ........
        .byte   $05,$04,$03,$02,$01,$00,$00     ; AB79 05 04 03 02 01 00 00     .......
LAB80:  .byte   $00,$0A,$14,$1E,$28,$32,$3C,$46 ; AB80 00 0A 14 1E 28 32 3C 46  ....(2<F
LAB88:  .byte   $09,$13,$1D,$27,$31,$3B,$45,$4F ; AB88 09 13 1D 27 31 3B 45 4F  ...'1;EO
; ----------------------------------------------------------------------------
LAB90:  php                                     ; AB90 08                       .
        ldx     #$04                            ; AB91 A2 04                    ..
        bcc     LAB97                           ; AB93 90 02                    ..
        ldx     #$06                            ; AB95 A2 06                    ..
LAB97:  clc                                     ; AB97 18                       .
        jsr     LD230                           ; AB98 20 30 D2                  0.
        ldx     $03A4                           ; AB9B AE A4 03                 ...
        lda     LAB71,x                         ; AB9E BD 71 AB                 .q.
        eor     #$E0                            ; ABA1 49 E0                    I.
        pha                                     ; ABA3 48                       H
        ldx     $03A2                           ; ABA4 AE A2 03                 ...
        ldy     LAB80,x                         ; ABA7 BC 80 AB                 ...
        lda     LAB88,x                         ; ABAA BD 88 AB                 ...
        tax                                     ; ABAD AA                       .
        pla                                     ; ABAE 68                       h
        plp                                     ; ABAF 28                       (
        jmp     LA9E6                           ; ABB0 4C E6 A9                 L..
; ----------------------------------------------------------------------------
ShowChar_:
        phx                                     ; ABB3 DA                       .
        phy                                     ; ABB4 5A                       Z
        bit     $0384                           ; ABB5 2C 84 03                 ,..
        bpl     LABC1                           ; ABB8 10 07                    ..
        bvc     LABC4                           ; ABBA 50 08                    P.
        jsr     L8948                           ; ABBC 20 48 89                  H.
        bra     LABC4                           ; ABBF 80 03                    ..
LABC1:  jsr     LABC8                           ; ABC1 20 C8 AB                  ..
LABC4:  ply                                     ; ABC4 7A                       z
        plx                                     ; ABC5 FA                       .
        clc                                     ; ABC6 18                       .
        rts                                     ; ABC7 60                       `
; ----------------------------------------------------------------------------
LABC8:  bit     $0382                           ; ABC8 2C 82 03                 ,..
        bpl     LABD6                           ; ABCB 10 09                    ..
        stz     $0382                           ; ABCD 9C 82 03                 ...
        jsr     LB220                           ; ABD0 20 20 B2                   .
        jsr     LAEA6                           ; ABD3 20 A6 AE                  ..
LABD6:  pha                                     ; ABD6 48                       H
LABD7:  php                                     ; ABD7 08                       .
        pla                                     ; ABD8 68                       h
        bit     #$04                            ; ABD9 89 04                    ..
        bne     LABED                           ; ABDB D0 10                    ..
        lda     $AA                             ; ABDD A5 AA                    ..
        and     $036D                           ; ABDF 2D 6D 03                 -m.
        and     #$02                            ; ABE2 29 02                    ).
        beq     LABED                           ; ABE4 F0 07                    ..
        ldx     #$02                            ; ABE6 A2 02                    ..
        jsr     WaitXticks_                     ; ABE8 20 E4 BF                  ..
        bra     LABD7                           ; ABEB 80 EA                    ..
LABED:  pla                                     ; ABED 68                       h
        ldx     $036E                           ; ABEE AE 6E 03                 .n.
        sta     $036E                           ; ABF1 8D 6E 03                 .n.
        cmp     #$0D                            ; ABF4 C9 0D                    ..
        beq     LAC2F                           ; ABF6 F0 37                    .7
        cmp     #$8D                            ; ABF8 C9 8D                    ..
        beq     LAC2F                           ; ABFA F0 33                    .3
        cpx     #$1B                            ; ABFC E0 1B                    ..
        bne     LAC03                           ; ABFE D0 03                    ..
        jmp     LB10E                           ; AC00 4C 0E B1                 L..
; ----------------------------------------------------------------------------
LAC03:  cmp     #$1B                            ; AC03 C9 1B                    ..
        bne     LAC08                           ; AC05 D0 01                    ..
        rts                                     ; AC07 60                       `
; ----------------------------------------------------------------------------
LAC08:  bit     $AA                             ; AC08 24 AA                    $.
        bpl     LAC24                           ; AC0A 10 18                    ..
        ldy     $A8                             ; AC0C A4 A8                    ..
        beq     LAC19                           ; AC0E F0 09                    ..
        cmp     #$94                            ; AC10 C9 94                    ..
        beq     LAC2F                           ; AC12 F0 1B                    ..
        dec     $A8                             ; AC14 C6 A8                    ..
        jmp     LAC3A                           ; AC16 4C 3A AC                 L:.
; ----------------------------------------------------------------------------
LAC19:  jsr     LB08E                           ; AC19 20 8E B0                  ..
        ldy     $A7                             ; AC1C A4 A7                    ..
        beq     LAC24                           ; AC1E F0 04                    ..
        cmp     #$14                            ; AC20 C9 14                    ..
        bne     LAC3A                           ; AC22 D0 16                    ..
LAC24:  cmp     #$13                            ; AC24 C9 13                    ..
        bne     LAC2F                           ; AC26 D0 07                    ..
        cpx     #$13                            ; AC28 E0 13                    ..
        bne     LAC2F                           ; AC2A D0 03                    ..
        jmp     LAE5B                           ; AC2C 4C 5B AE                 L[.
; ----------------------------------------------------------------------------
LAC2F:  bit     #$20                            ; AC2F 89 20                    . 
        bne     LAC3A                           ; AC31 D0 07                    ..
        bit     #$40                            ; AC33 89 40                    .@
        bne     LAC3A                           ; AC35 D0 03                    ..
        jmp     LACD2                           ; AC37 4C D2 AC                 L..
; ----------------------------------------------------------------------------
LAC3A:  jsr     LB09B                           ; AC3A 20 9B B0                  ..
        ldx     $036C                           ; AC3D AE 6C 03                 .l.
        beq     LAC44                           ; AC40 F0 02                    ..
        ora     #$80                            ; AC42 09 80                    ..
LAC44:  ldx     $A9                             ; AC44 A6 A9                    ..
        beq     LAC4D                           ; AC46 F0 05                    ..
        pha                                     ; AC48 48                       H
        jsr     LAEC9                           ; AC49 20 C9 AE                  ..
        pla                                     ; AC4C 68                       h
LAC4D:  jsr     LAF1C                           ; AC4D 20 1C AF                  ..
LAC50:  ldx     CursorX                         ; AC50 A6 A1                    ..
        cpx     CurMaxX_                        ; AC52 E4 A4                    ..
        beq     LAC59                           ; AC54 F0 03                    ..
        inc     CursorX                         ; AC56 E6 A1                    ..
LAC58:  rts                                     ; AC58 60                       `
; ----------------------------------------------------------------------------
LAC59:  lda     $AA                             ; AC59 A5 AA                    ..
        bit     #$04                            ; AC5B 89 04                    ..
        beq     LAC93                           ; AC5D F0 34                    .4
        bit     #$20                            ; AC5F 89 20                    . 
        beq     LAC58                           ; AC61 F0 F5                    ..
        ldy     CursorY                         ; AC63 A4 A2                    ..
        jsr     LB059                           ; AC65 20 59 B0                  Y.
        bcs     LAC93                           ; AC68 B0 29                    .)
        ldx     $A3                             ; AC6A A6 A3                    ..
        stx     CursorX                         ; AC6C 86 A1                    ..
        ldy     CursorY                         ; AC6E A4 A2                    ..
        sec                                     ; AC70 38                       8
        jsr     LB06F                           ; AC71 20 6F B0                  o.
        ldy     CursorY                         ; AC74 A4 A2                    ..
        cpy     CurMaxY_                        ; AC76 C4 A6                    ..
        bne     LAC8E                           ; AC78 D0 14                    ..
        ldy     $03E9                           ; AC7A AC E9 03                 ...
        bmi     LAC88                           ; AC7D 30 09                    0.
        cpy     $A5                             ; AC7F C4 A5                    ..
        beq     LAC88                           ; AC81 F0 05                    ..
        dec     $03E9                           ; AC83 CE E9 03                 ...
        bra     LAC8B                           ; AC86 80 03                    ..
LAC88:  jsr     LB393                           ; AC88 20 93 B3                  ..
LAC8B:  jmp     LAF4B                           ; AC8B 4C 4B AF                 LK.
; ----------------------------------------------------------------------------
LAC8E:  inc     CursorY                         ; AC8E E6 A2                    ..
        jmp     LAF89                           ; AC90 4C 89 AF                 L..
; ----------------------------------------------------------------------------
LAC93:  jmp     LADD1                           ; AC93 4C D1 AD                 L..
; ----------------------------------------------------------------------------
LAC96:  .byte   $07                             ; AC96 07                       .
; ----------------------------------------------------------------------------
LAC97:  .addr   LC65C                           ; AC97 5C C6                    \.
; ----------------------------------------------------------------------------
        .byte   $09                             ; AC99 09                       .
; ----------------------------------------------------------------------------
        .addr   LAD0E                           ; AC9A 0E AD                    ..
; ----------------------------------------------------------------------------
        .byte   $0A                             ; AC9C 0A                       .
; ----------------------------------------------------------------------------
        .addr   LADA5                           ; AC9D A5 AD                    ..
; ----------------------------------------------------------------------------
        .byte   $0D                             ; AC9F 0D                       .
; ----------------------------------------------------------------------------
        .addr   LAD4F                           ; ACA0 4F AD                    O.
; ----------------------------------------------------------------------------
        .byte   $0E                             ; ACA2 0E                       .
; ----------------------------------------------------------------------------
        .addr   LACFA                           ; ACA3 FA AC                    ..
; ----------------------------------------------------------------------------
        .byte   $11                             ; ACA5 11                       .
; ----------------------------------------------------------------------------
        .addr   LADA5                           ; ACA6 A5 AD                    ..
; ----------------------------------------------------------------------------
        .byte   $12                             ; ACA8 12                       .
; ----------------------------------------------------------------------------
        .addr   LAD72                           ; ACA9 72 AD                    r.
; ----------------------------------------------------------------------------
        .byte   $13                             ; ACAB 13                       .
; ----------------------------------------------------------------------------
        .addr   LAE6F                           ; ACAC 6F AE                    o.
; ----------------------------------------------------------------------------
        .byte   $14                             ; ACAE 14                       .
; ----------------------------------------------------------------------------
        .addr   LAE7B                           ; ACAF 7B AE                    {.
; ----------------------------------------------------------------------------
        .byte   $18                             ; ACB1 18                       .
; ----------------------------------------------------------------------------
        .addr   LAD37                           ; ACB2 37 AD                    7.
; ----------------------------------------------------------------------------
        .byte   $19                             ; ACB4 19                       .
; ----------------------------------------------------------------------------
        .addr   LACE2                           ; ACB5 E2 AC                    ..
; ----------------------------------------------------------------------------
        .byte   $1A                             ; ACB7 1A                       .
; ----------------------------------------------------------------------------
        .addr   LACE8                           ; ACB8 E8 AC                    ..
; ----------------------------------------------------------------------------
        .byte   $1D                             ; ACBA 1D                       .
; ----------------------------------------------------------------------------
        .addr   LADD1                           ; ACBB D1 AD                    ..
; ----------------------------------------------------------------------------
        .byte   $8D                             ; ACBD 8D                       .
; ----------------------------------------------------------------------------
        .addr   LAD4F                           ; ACBE 4F AD                    O.
; ----------------------------------------------------------------------------
        .byte   $8E                             ; ACC0 8E                       .
; ----------------------------------------------------------------------------
        .addr   LAD02                           ; ACC1 02 AD                    ..
; ----------------------------------------------------------------------------
        .byte   $91                             ; ACC3 91                       .
; ----------------------------------------------------------------------------
        .addr   LAD78                           ; ACC4 78 AD                    x.
; ----------------------------------------------------------------------------
        .byte   $92                             ; ACC6 92                       .
; ----------------------------------------------------------------------------
        .addr   LB224                           ; ACC7 24 B2                    $.
; ----------------------------------------------------------------------------
        .byte   $93                             ; ACC9 93                       .
; ----------------------------------------------------------------------------
        .addr   LAE47                           ; ACCA 47 AE                    G.
; ----------------------------------------------------------------------------
        .byte   $94                             ; ACCC 94                       .
; ----------------------------------------------------------------------------
        .addr   LAEC9                           ; ACCD C9 AE                    ..
; ----------------------------------------------------------------------------
        .byte   $9D                             ; ACCF 9D                       .
; ----------------------------------------------------------------------------
        .addr   LAE09                           ; ACD0 09 AE                    ..
; ----------------------------------------------------------------------------
LACD2:  ldx     #$39                            ; ACD2 A2 39                    .9
LACD4:  cmp     LAC96,x                         ; ACD4 DD 96 AC                 ...
        beq     LACDF                           ; ACD7 F0 06                    ..
        dex                                     ; ACD9 CA                       .
        dex                                     ; ACDA CA                       .
        dex                                     ; ACDB CA                       .
        bpl     LACD4                           ; ACDC 10 F6                    ..
        rts                                     ; ACDE 60                       `
; ----------------------------------------------------------------------------
LACDF:  jmp     (LAC97,x)                       ; ACDF 7C 97 AC                 |..
LACE2:  lda     #$40                            ; ACE2 A9 40                    .@
        tsb     $036D                           ; ACE4 0C 6D 03                 .m.
        rts                                     ; ACE7 60                       `
; ----------------------------------------------------------------------------
LACE8:  lda     #$40                            ; ACE8 A9 40                    .@
        trb     $036D                           ; ACEA 1C 6D 03                 .m.
        rts                                     ; ACED 60                       `
; ----------------------------------------------------------------------------
LACEE:  bit     $036D                           ; ACEE 2C 6D 03                 ,m.
        bvs     LACE2                           ; ACF1 70 EF                    p.
        lda     #$01                            ; ACF3 A9 01                    ..
        tsb     $037A                           ; ACF5 0C 7A 03                 .z.
        beq     LAD0A                           ; ACF8 F0 10                    ..
LACFA:  lda     #$01                            ; ACFA A9 01                    ..
        trb     $037A                           ; ACFC 1C 7A 03                 .z.
        bne     LAD0A                           ; ACFF D0 09                    ..
        rts                                     ; AD01 60                       `
; ----------------------------------------------------------------------------
LAD02:  lda     #$01                            ; AD02 A9 01                    ..
        tsb     $037A                           ; AD04 0C 7A 03                 .z.
        beq     LAD0A                           ; AD07 F0 01                    ..
        rts                                     ; AD09 60                       `
; ----------------------------------------------------------------------------
LAD0A:  sec                                     ; AD0A 38                       8
        jmp     LCDsetupGetOrSet                ; AD0B 4C 28 B2                 L(.
; ----------------------------------------------------------------------------
LAD0E:  ldx     CursorX                         ; AD0E A6 A1                    ..
        cpx     CurMaxX_                        ; AD10 E4 A4                    ..
        beq     LAD27                           ; AD12 F0 13                    ..
        lda     #$1D                            ; AD14 A9 1D                    ..
        ldx     $A9                             ; AD16 A6 A9                    ..
        beq     LAD1C                           ; AD18 F0 02                    ..
        lda     #$20                            ; AD1A A9 20                    . 
LAD1C:  jsr     LABD6                           ; AD1C 20 D6 AB                  ..
        jsr     LAD28                           ; AD1F 20 28 AD                  (.
        and     $0370,y                         ; AD22 39 70 03                 9p.
        beq     LAD0E                           ; AD25 F0 E7                    ..
LAD27:  rts                                     ; AD27 60                       `
; ----------------------------------------------------------------------------
LAD28:  lda     CursorX                         ; AD28 A5 A1                    ..
        lsr     a                               ; AD2A 4A                       J
        lsr     a                               ; AD2B 4A                       J
        lsr     a                               ; AD2C 4A                       J
        tay                                     ; AD2D A8                       .
        lda     CursorX                         ; AD2E A5 A1                    ..
        and     #$07                            ; AD30 29 07                    ).
        tax                                     ; AD32 AA                       .
        lda     PowersOfTwo,x                   ; AD33 BD 41 B0                 .A.
        rts                                     ; AD36 60                       `
; ----------------------------------------------------------------------------
LAD37:  jsr     LAD28                           ; AD37 20 28 AD                  (.
        eor     $0370,y                         ; AD3A 59 70 03                 Yp.
        sta     $0370,y                         ; AD3D 99 70 03                 .p.
        rts                                     ; AD40 60                       `
; ----------------------------------------------------------------------------
LAD41:  lda     #$80                            ; AD41 A9 80                    ..
        .byte   $2C                             ; AD43 2C                       ,
LAD44:  lda     #$00                            ; AD44 A9 00                    ..
        ldx     #$09                            ; AD46 A2 09                    ..
LAD48:  sta     $0370,x                         ; AD48 9D 70 03                 .p.
        dex                                     ; AD4B CA                       .
        bpl     LAD48                           ; AD4C 10 FA                    ..
        rts                                     ; AD4E 60                       `
; ----------------------------------------------------------------------------
LAD4F:  lda     $AA                             ; AD4F A5 AA                    ..
        lsr     a                               ; AD51 4A                       J
        bcc     LAD65                           ; AD52 90 11                    ..
        lda     #$08                            ; AD54 A9 08                    ..
        bit     StopKeyFlag                     ; AD56 24 AD                    $.
        beq     LAD65                           ; AD58 F0 0B                    ..
        php                                     ; AD5A 08                       .
        pla                                     ; AD5B 68                       h
        bit     #$04                            ; AD5C 89 04                    ..
        bne     LAD65                           ; AD5E D0 05                    ..
        ldx     #$2D                            ; AD60 A2 2D                    .-
        jsr     WaitXticks_                     ; AD62 20 E4 BF                  ..
LAD65:  jsr     LB15A                           ; AD65 20 5A B1                  Z.
        ldx     $A3                             ; AD68 A6 A3                    ..
        stx     CursorX                         ; AD6A 86 A1                    ..
        jsr     LADA5                           ; AD6C 20 A5 AD                  ..
        jmp     LB220                           ; AD6F 4C 20 B2                 L .
; ----------------------------------------------------------------------------
LAD72:  lda     #$80                            ; AD72 A9 80                    ..
        sta     $036C                           ; AD74 8D 6C 03                 .l.
        rts                                     ; AD77 60                       `
; ----------------------------------------------------------------------------
LAD78:  ldy     CursorY                         ; AD78 A4 A2                    ..
        cpy     $A5                             ; AD7A C4 A5                    ..
        beq     LAD8A                           ; AD7C F0 0C                    ..
        dec     CursorY                         ; AD7E C6 A2                    ..
        dey                                     ; AD80 88                       .
        jsr     LB059                           ; AD81 20 59 B0                  Y.
        bcs     LAD89                           ; AD84 B0 03                    ..
        jsr     LB393                           ; AD86 20 93 B3                  ..
LAD89:  rts                                     ; AD89 60                       `
; ----------------------------------------------------------------------------
LAD8A:  lda     #$10                            ; AD8A A9 10                    ..
        bit     $AA                             ; AD8C 24 AA                    $.
        bne     LAD91                           ; AD8E D0 01                    ..
        rts                                     ; AD90 60                       `
; ----------------------------------------------------------------------------
LAD91:  jsr     LB393                           ; AD91 20 93 B3                  ..
        bit     $AA                             ; AD94 24 AA                    $.
        bvc     LADA0                           ; AD96 50 08                    P.
        jsr     LAF89                           ; AD98 20 89 AF                  ..
        ldy     $A5                             ; AD9B A4 A5                    ..
        sty     CursorY                         ; AD9D 84 A2                    ..
        rts                                     ; AD9F 60                       `
; ----------------------------------------------------------------------------
LADA0:  ldy     CurMaxY_                        ; ADA0 A4 A6                    ..
        sty     CursorY                         ; ADA2 84 A2                    ..
        rts                                     ; ADA4 60                       `
; ----------------------------------------------------------------------------
LADA5:  ldy     CursorY                         ; ADA5 A4 A2                    ..
        cpy     CurMaxY_                        ; ADA7 C4 A6                    ..
        beq     LADB6                           ; ADA9 F0 0B                    ..
        jsr     LB059                           ; ADAB 20 59 B0                  Y.
        bcs     LADB3                           ; ADAE B0 03                    ..
        jsr     LB393                           ; ADB0 20 93 B3                  ..
LADB3:  inc     CursorY                         ; ADB3 E6 A2                    ..
        rts                                     ; ADB5 60                       `
; ----------------------------------------------------------------------------
LADB6:  lda     #$08                            ; ADB6 A9 08                    ..
        bit     $AA                             ; ADB8 24 AA                    $.
        bne     LADBD                           ; ADBA D0 01                    ..
        rts                                     ; ADBC 60                       `
; ----------------------------------------------------------------------------
LADBD:  jsr     LB393                           ; ADBD 20 93 B3                  ..
        bit     $AA                             ; ADC0 24 AA                    $.
        bvc     LADCC                           ; ADC2 50 08                    P.
        jsr     LAF4B                           ; ADC4 20 4B AF                  K.
        ldy     CurMaxY_                        ; ADC7 A4 A6                    ..
        sty     CursorY                         ; ADC9 84 A2                    ..
        rts                                     ; ADCB 60                       `
; ----------------------------------------------------------------------------
LADCC:  ldy     $A5                             ; ADCC A4 A5                    ..
        sty     CursorY                         ; ADCE 84 A2                    ..
        rts                                     ; ADD0 60                       `
; ----------------------------------------------------------------------------
LADD1:  ldx     CurMaxX_                        ; ADD1 A6 A4                    ..
        cpx     CursorX                         ; ADD3 E4 A1                    ..
        beq     LADDA                           ; ADD5 F0 03                    ..
        inc     CursorX                         ; ADD7 E6 A1                    ..
        rts                                     ; ADD9 60                       `
; ----------------------------------------------------------------------------
LADDA:  ldy     CursorY                         ; ADDA A4 A2                    ..
        cpy     CurMaxY_                        ; ADDC C4 A6                    ..
        beq     LADEF                           ; ADDE F0 0F                    ..
        jsr     LB059                           ; ADE0 20 59 B0                  Y.
        bcs     LADE8                           ; ADE3 B0 03                    ..
        jsr     LB393                           ; ADE5 20 93 B3                  ..
LADE8:  inc     CursorY                         ; ADE8 E6 A2                    ..
        ldx     $A3                             ; ADEA A6 A3                    ..
        stx     CursorX                         ; ADEC 86 A1                    ..
        rts                                     ; ADEE 60                       `
; ----------------------------------------------------------------------------
LADEF:  lda     $AA                             ; ADEF A5 AA                    ..
        bit     #$08                            ; ADF1 89 08                    ..
        bne     LADF6                           ; ADF3 D0 01                    ..
        rts                                     ; ADF5 60                       `
; ----------------------------------------------------------------------------
LADF6:  ldx     $A3                             ; ADF6 A6 A3                    ..
        stx     CursorX                         ; ADF8 86 A1                    ..
        jsr     LB393                           ; ADFA 20 93 B3                  ..
        bit     #$40                            ; ADFD 89 40                    .@
        bne     LAE04                           ; ADFF D0 03                    ..
        jmp     LAE6F                           ; AE01 4C 6F AE                 Lo.
; ----------------------------------------------------------------------------
LAE04:  ldy     CursorY                         ; AE04 A4 A2                    ..
        jmp     LAF4B                           ; AE06 4C 4B AF                 LK.
; ----------------------------------------------------------------------------
LAE09:  ldx     CursorX                         ; AE09 A6 A1                    ..
        cpx     $A3                             ; AE0B E4 A3                    ..
        beq     LAE12                           ; AE0D F0 03                    ..
        dec     CursorX                         ; AE0F C6 A1                    ..
        rts                                     ; AE11 60                       `
; ----------------------------------------------------------------------------
LAE12:  ldy     CursorY                         ; AE12 A4 A2                    ..
        cpy     $A5                             ; AE14 C4 A5                    ..
        beq     LAE28                           ; AE16 F0 10                    ..
        .byte   $C6                             ; AE18 C6                       .
LAE19:  ldx     #$A6                            ; AE19 A2 A6                    ..
        ldy     $86                             ; AE1B A4 86                    ..
        lda     ($88,x)                         ; AE1D A1 88                    ..
        jsr     LB059                           ; AE1F 20 59 B0                  Y.
        bcs     LAE27                           ; AE22 B0 03                    ..
        jsr     LB393                           ; AE24 20 93 B3                  ..
LAE27:  rts                                     ; AE27 60                       `
; ----------------------------------------------------------------------------
LAE28:  lda     $AA                             ; AE28 A5 AA                    ..
        bit     #$10                            ; AE2A 89 10                    ..
        bne     LAE2F                           ; AE2C D0 01                    ..
        rts                                     ; AE2E 60                       `
; ----------------------------------------------------------------------------
LAE2F:  jsr     LB393                           ; AE2F 20 93 B3                  ..
        ldx     CurMaxX_                        ; AE32 A6 A4                    ..
        stx     CursorX                         ; AE34 86 A1                    ..
        bit     $AA                             ; AE36 24 AA                    $.
        bvc     LAE42                           ; AE38 50 08                    P.
        jsr     LAF89                           ; AE3A 20 89 AF                  ..
        ldy     $A5                             ; AE3D A4 A5                    ..
        sty     CursorY                         ; AE3F 84 A2                    ..
        rts                                     ; AE41 60                       `
; ----------------------------------------------------------------------------
LAE42:  ldy     CurMaxY_                        ; AE42 A4 A6                    ..
        sty     CursorY                         ; AE44 84 A2                    ..
        rts                                     ; AE46 60                       `
; ----------------------------------------------------------------------------
LAE47:  jsr     LAE6F                           ; AE47 20 6F AE                  o.
        ldy     CurMaxY_                        ; AE4A A4 A6                    ..
LAE4C:  sty     CursorY                         ; AE4C 84 A2                    ..
        jsr     LAFC0                           ; AE4E 20 C0 AF                  ..
        ldy     CursorY                         ; AE51 A4 A2                    ..
        dey                                     ; AE53 88                       .
        cpy     $A5                             ; AE54 C4 A5                    ..
        bpl     LAE4C                           ; AE56 10 F4                    ..
        jmp     LB087                           ; AE58 4C 87 B0                 L..
; ----------------------------------------------------------------------------
LAE5B:  ldx     L0380                           ; AE5B AE 80 03                 ...
        stx     $A3                             ; AE5E 86 A3                    ..
        ldx     CurMaxX                         ; AE60 AE 81 03                 ...
        stx     CurMaxX_                        ; AE63 86 A4                    ..
        ldy     $037F                           ; AE65 AC 7F 03                 ...
LAE68:  sty     $A5                             ; AE68 84 A5                    ..
        ldy     CurMaxY                         ; AE6A AC 7E 03                 .~.
        sty     CurMaxY_                        ; AE6D 84 A6                    ..
LAE6F:  jsr     LB393                           ; AE6F 20 93 B3                  ..
        ldx     $A3                             ; AE72 A6 A3                    ..
        stx     CursorX                         ; AE74 86 A1                    ..
        ldy     $A5                             ; AE76 A4 A5                    ..
        sty     CursorY                         ; AE78 84 A2                    ..
        rts                                     ; AE7A 60                       `
; ----------------------------------------------------------------------------
LAE7B:  jsr     LAE09                           ; AE7B 20 09 AE                  ..
        jsr     LAEB1                           ; AE7E 20 B1 AE                  ..
LAE81:  ldx     CursorX                         ; AE81 A6 A1                    ..
        cpx     CurMaxX_                        ; AE83 E4 A4                    ..
        bne     LAE8E                           ; AE85 D0 07                    ..
        ldy     CursorY                         ; AE87 A4 A2                    ..
        jsr     LB059                           ; AE89 20 59 B0                  Y.
        bcc     LAEA1                           ; AE8C 90 13                    ..
LAE8E:  jsr     LADD1                           ; AE8E 20 D1 AD                  ..
        jsr     LAF41                           ; AE91 20 41 AF                  A.
        pha                                     ; AE94 48                       H
        jsr     LAE09                           ; AE95 20 09 AE                  ..
        pla                                     ; AE98 68                       h
        jsr     LAF1C                           ; AE99 20 1C AF                  ..
        jsr     LADD1                           ; AE9C 20 D1 AD                  ..
        bra     LAE81                           ; AE9F 80 E0                    ..
LAEA1:  lda     #$20                            ; AEA1 A9 20                    . 
        jsr     LAF1C                           ; AEA3 20 1C AF                  ..
LAEA6:  ldx     $03EA                           ; AEA6 AE EA 03                 ...
        ldy     $03EB                           ; AEA9 AC EB 03                 ...
        stx     CursorX                         ; AEAC 86 A1                    ..
        sty     CursorY                         ; AEAE 84 A2                    ..
        rts                                     ; AEB0 60                       `
; ----------------------------------------------------------------------------
LAEB1:  ldx     CursorX                         ; AEB1 A6 A1                    ..
        ldy     CursorY                         ; AEB3 A4 A2                    ..
        .byte   $8E                             ; AEB5 8E                       .
LAEB6:  nop                                     ; AEB6 EA                       .
        .byte   $03                             ; AEB7 03                       .
        sty     $03EB                           ; AEB8 8C EB 03                 ...
        rts                                     ; AEBB 60                       `
; ----------------------------------------------------------------------------
LAEBC:  ldx     CursorX                         ; AEBC A6 A1                    ..
        ldy     CursorY                         ; AEBE A4 A2                    ..
        cpy     $03EB                           ; AEC0 CC EB 03                 ...
        bne     LAEC8                           ; AEC3 D0 03                    ..
        cpx     $03EA                           ; AEC5 EC EA 03                 ...
LAEC8:  rts                                     ; AEC8 60                       `
; ----------------------------------------------------------------------------
LAEC9:  inc     $A8                             ; AEC9 E6 A8                    ..
        bne     LAECF                           ; AECB D0 02                    ..
        dec     $A8                             ; AECD C6 A8                    ..
LAECF:  ldx     $A9                             ; AECF A6 A9                    ..
        beq     LAED5                           ; AED1 F0 02                    ..
        stz     $A8                             ; AED3 64 A8                    d.
LAED5:  lda     #$20                            ; AED5 A9 20                    . 
        pha                                     ; AED7 48                       H
        jsr     LAEB1                           ; AED8 20 B1 AE                  ..
        dec     CursorX                         ; AEDB C6 A1                    ..
LAEDD:  jsr     LAC50                           ; AEDD 20 50 AC                  P.
        jsr     LAF41                           ; AEE0 20 41 AF                  A.
        tax                                     ; AEE3 AA                       .
        pla                                     ; AEE4 68                       h
        sta     (VidPtrLo)                      ; AEE5 92 C1                    ..
        phx                                     ; AEE7 DA                       .
        lda     CursorX                         ; AEE8 A5 A1                    ..
        cmp     CurMaxX_                        ; AEEA C5 A4                    ..
        bne     LAEDD                           ; AEEC D0 EF                    ..
        lda     $AA                             ; AEEE A5 AA                    ..
        bit     #$20                            ; AEF0 89 20                    . 
        beq     LAF16                           ; AEF2 F0 22                    ."
        bit     #$04                            ; AEF4 89 04                    ..
        beq     LAF16                           ; AEF6 F0 1E                    ..
        cpx     #$20                            ; AEF8 E0 20                    . 
        beq     LAF0F                           ; AEFA F0 13                    ..
        ldy     CursorY                         ; AEFC A4 A2                    ..
        cpy     CurMaxY_                        ; AEFE C4 A6                    ..
        bne     LAEDD                           ; AF00 D0 DB                    ..
        ldy     $03EB                           ; AF02 AC EB 03                 ...
        dey                                     ; AF05 88                       .
        cpy     $A5                             ; AF06 C4 A5                    ..
        bmi     LAEDD                           ; AF08 30 D3                    0.
        sty     $03EB                           ; AF0A 8C EB 03                 ...
        bra     LAEDD                           ; AF0D 80 CE                    ..
LAF0F:  ldy     CursorY                         ; AF0F A4 A2                    ..
        jsr     LB059                           ; AF11 20 59 B0                  Y.
        bcs     LAEDD                           ; AF14 B0 C7                    ..
LAF16:  pla                                     ; AF16 68                       h
        jmp     LAEA6                           ; AF17 4C A6 AE                 L..
; ----------------------------------------------------------------------------
LAF1A:  lda     #$20                            ; AF1A A9 20                    . 
LAF1C:  ldx     CursorX                         ; AF1C A6 A1                    ..
        ldy     CursorY                         ; AF1E A4 A2                    ..
        pha                                     ; AF20 48                       H
        jsr     LAF2C                           ; AF21 20 2C AF                  ,.
        pla                                     ; AF24 68                       h
; This op puts the chr into the video RAM.
        sta     (VidPtrLo)                      ; AF25 92 C1                    ..
        rts                                     ; AF27 60                       `
; ----------------------------------------------------------------------------
LAF28:  ldy     CursorY                         ; AF28 A4 A2                    ..
        ldx     CursorX                         ; AF2A A6 A1                    ..
LAF2C:  cld                                     ; AF2C D8                       .
        txa                                     ; AF2D 8A                       .
        asl     a                               ; AF2E 0A                       .
        sta     VidPtrLo                        ; AF2F 85 C1                    ..
        tya                                     ; AF31 98                       .
        lsr     a                               ; AF32 4A                       J
        ror     VidPtrLo                        ; AF33 66 C1                    f.
        adc     VidMemHi                        ; AF35 65 A0                    e.
        sta     VidPtrHi                        ; AF37 85 C2                    ..
        rts                                     ; AF39 60                       `
; ----------------------------------------------------------------------------
LAF3A:  cld                                     ; AF3A D8                       .
        sec                                     ; AF3B 38                       8
        lda     CurMaxX_                        ; AF3C A5 A4                    ..
        sbc     $A3                             ; AF3E E5 A3                    ..
        rts                                     ; AF40 60                       `
; ----------------------------------------------------------------------------
LAF41:  ldx     CursorX                         ; AF41 A6 A1                    ..
        ldy     CursorY                         ; AF43 A4 A2                    ..
        jsr     LAF2C                           ; AF45 20 2C AF                  ,.
        lda     (VidPtrLo)                      ; AF48 B2 C1                    ..
        rts                                     ; AF4A 60                       `
; ----------------------------------------------------------------------------
LAF4B:  ldy     $A5                             ; AF4B A4 A5                    ..
        cpy     CursorY                         ; AF4D C4 A2                    ..
        beq     LAF7C                           ; AF4F F0 2B                    .+
        ldx     $A3                             ; AF51 A6 A3                    ..
        jsr     LAF2C                           ; AF53 20 2C AF                  ,.
        jsr     LAF3A                           ; AF56 20 3A AF                  :.
        sta     $F3                             ; AF59 85 F3                    ..
        ldx     $A5                             ; AF5B A6 A5                    ..
LAF5D:  lda     VidPtrLo                        ; AF5D A5 C1                    ..
        ldy     VidPtrHi                        ; AF5F A4 C2                    ..
        sta     $F1                             ; AF61 85 F1                    ..
        sty     $F2                             ; AF63 84 F2                    ..
        eor     #$80                            ; AF65 49 80                    I.
        sta     VidPtrLo                        ; AF67 85 C1                    ..
        bmi     LAF6E                           ; AF69 30 03                    0.
        iny                                     ; AF6B C8                       .
        sty     VidPtrHi                        ; AF6C 84 C2                    ..
LAF6E:  ldy     $F3                             ; AF6E A4 F3                    ..
LAF70:  lda     (VidPtrLo),y                    ; AF70 B1 C1                    ..
        sta     ($F1),y                         ; AF72 91 F1                    ..
        dey                                     ; AF74 88                       .
        bpl     LAF70                           ; AF75 10 F9                    ..
        inx                                     ; AF77 E8                       .
        cpx     CursorY                         ; AF78 E4 A2                    ..
        bne     LAF5D                           ; AF7A D0 E1                    ..
LAF7C:  jsr     LAFD3                           ; AF7C 20 D3 AF                  ..
        lda     #$C0                            ; AF7F A9 C0                    ..
        tsb     $037D                           ; AF81 0C 7D 03                 .}.
        ldy     CursorY                         ; AF84 A4 A2                    ..
        jmp     LAFC0                           ; AF86 4C C0 AF                 L..
; ----------------------------------------------------------------------------
LAF89:  ldy     CursorY                         ; AF89 A4 A2                    ..
        cpy     CurMaxY_                        ; AF8B C4 A6                    ..
        beq     LAFC0                           ; AF8D F0 31                    .1
        jsr     LAF3A                           ; AF8F 20 3A AF                  :.
        sta     $F3                             ; AF92 85 F3                    ..
        ldy     CurMaxY_                        ; AF94 A4 A6                    ..
LAF96:  phy                                     ; AF96 5A                       Z
        ldx     $A3                             ; AF97 A6 A3                    ..
        jsr     LAF2C                           ; AF99 20 2C AF                  ,.
        lda     VidPtrLo                        ; AF9C A5 C1                    ..
        ldy     VidPtrHi                        ; AF9E A4 C2                    ..
        eor     #$80                            ; AFA0 49 80                    I.
        bpl     LAFA5                           ; AFA2 10 01                    ..
        dey                                     ; AFA4 88                       .
LAFA5:  sta     $F1                             ; AFA5 85 F1                    ..
        sty     $F2                             ; AFA7 84 F2                    ..
        ldy     $F3                             ; AFA9 A4 F3                    ..
LAFAB:  lda     ($F1),y                         ; AFAB B1 F1                    ..
        sta     (VidPtrLo),y                    ; AFAD 91 C1                    ..
        dey                                     ; AFAF 88                       .
        bpl     LAFAB                           ; AFB0 10 F9                    ..
        ply                                     ; AFB2 7A                       z
        dey                                     ; AFB3 88                       .
        cpy     CursorY                         ; AFB4 C4 A2                    ..
        bne     LAF96                           ; AFB6 D0 DE                    ..
        jsr     LAFF3                           ; AFB8 20 F3 AF                  ..
        lda     #$80                            ; AFBB A9 80                    ..
        tsb     $037D                           ; AFBD 0C 7D 03                 .}.
LAFC0:  ldy     CursorY                         ; AFC0 A4 A2                    ..
        ldx     $A3                             ; AFC2 A6 A3                    ..
        jsr     LAF2C                           ; AFC4 20 2C AF                  ,.
        jsr     LAF3A                           ; AFC7 20 3A AF                  :.
        tay                                     ; AFCA A8                       .
; This fragments prints spaces (ie; clear) on screen.
        lda     #$20                            ; AFCB A9 20                    . 
LAFCD:  sta     (VidPtrLo),y                    ; AFCD 91 C1                    ..
        dey                                     ; AFCF 88                       .
        bpl     LAFCD                           ; AFD0 10 FB                    ..
        rts                                     ; AFD2 60                       `
; ----------------------------------------------------------------------------
LAFD3:  jsr     LB020                           ; AFD3 20 20 B0                   .
        eor     $F1                             ; AFD6 45 F1                    E.
        and     $036A,x                         ; AFD8 3D 6A 03                 =j.
        sta     $F1                             ; AFDB 85 F1                    ..
        lda     $036A,x                         ; AFDD BD 6A 03                 .j.
        and     $F2                             ; AFE0 25 F2                    %.
        lsr     a                               ; AFE2 4A                       J
        ora     $F1                             ; AFE3 05 F1                    ..
        sta     $036A,x                         ; AFE5 9D 6A 03                 .j.
        rol     $036A,x                         ; AFE8 3E 6A 03                 >j.
LAFEB:  ror     $036A,x                         ; AFEB 7E 6A 03                 ~j.
        dex                                     ; AFEE CA                       .
        bpl     LAFEB                           ; AFEF 10 FA                    ..
        bra     LB013                           ; AFF1 80 20                    . 
LAFF3:  jsr     LB020                           ; AFF3 20 20 B0                   .
        eor     $F2                             ; AFF6 45 F2                    E.
        and     $036A,x                         ; AFF8 3D 6A 03                 =j.
        sta     $F2                             ; AFFB 85 F2                    ..
        lda     $036A,x                         ; AFFD BD 6A 03                 .j.
        and     $F1                             ; B000 25 F1                    %.
        asl     a                               ; B002 0A                       .
        ora     $F2                             ; B003 05 F2                    ..
        sta     $036A,x                         ; B005 9D 6A 03                 .j.
        .byte   $7E                             ; B008 7E                       ~
LB009:  ror     a                               ; B009 6A                       j
        .byte   $03                             ; B00A 03                       .
LB00B:  rol     $036A,x                         ; B00B 3E 6A 03                 >j.
        inx                                     ; B00E E8                       .
        cpx     #$02                            ; B00F E0 02                    ..
        bne     LB00B                           ; B011 D0 F8                    ..
LB013:  ldy     $A5                             ; B013 A4 A5                    ..
        beq     LB01B                           ; B015 F0 04                    ..
        dey                                     ; B017 88                       .
        jsr     LB07B                           ; B018 20 7B B0                  {.
LB01B:  ldy     CurMaxY_                        ; B01B A4 A6                    ..
        jmp     LB07B                           ; B01D 4C 7B B0                 L{.
; ----------------------------------------------------------------------------
LB020:  .byte   $A4                             ; B020 A4                       .
LB021:  ldx     #$98                            ; B021 A2 98                    ..
        and     #$07                            ; B023 29 07                    ).
        tax                                     ; B025 AA                       .
        lda     LB049,x                         ; B026 BD 49 B0                 .I.
        sta     $F2                             ; B029 85 F2                    ..
        lda     LB051,x                         ; B02B BD 51 B0                 .Q.
        sta     $F1                             ; B02E 85 F1                    ..
LB030:  tya                                     ; B030 98                       .
        and     #$07                            ; B031 29 07                    ).
        tax                                     ; B033 AA                       .
        lda     PowersOfTwo,x                   ; B034 BD 41 B0                 .A.
        pha                                     ; B037 48                       H
        tya                                     ; B038 98                       .
        lsr     a                               ; B039 4A                       J
        lsr     a                               ; B03A 4A                       J
        lsr     a                               ; B03B 4A                       J
        and     #$01                            ; B03C 29 01                    ).
        tax                                     ; B03E AA                       .
        pla                                     ; B03F 68                       h
        rts                                     ; B040 60                       `
; ----------------------------------------------------------------------------
PowersOfTwo:
        .byte   $01,$02,$04,$08,$10,$20,$40,$80 ; B041 01 02 04 08 10 20 40 80  ..... @.
LB049:  .byte   $01,$03,$07,$0F,$1F,$3F,$7F,$FF ; B049 01 03 07 0F 1F 3F 7F FF  .....?..
LB051:  .byte   $FF,$FE,$FC,$F8,$F0,$E0,$C0,$80 ; B051 FF FE FC F8 F0 E0 C0 80  ........
; ----------------------------------------------------------------------------
LB059:  lda     #$04                            ; B059 A9 04                    ..
        and     $AA                             ; B05B 25 AA                    %.
        beq     LB06D                           ; B05D F0 0E                    ..
        cpy     #$10                            ; B05F C0 10                    ..
        bcs     LB06D                           ; B061 B0 0A                    ..
        jsr     LB030                           ; B063 20 30 B0                  0.
        and     $036A,x                         ; B066 3D 6A 03                 =j.
        beq     LB06D                           ; B069 F0 02                    ..
        sec                                     ; B06B 38                       8
        rts                                     ; B06C 60                       `
; ----------------------------------------------------------------------------
LB06D:  clc                                     ; B06D 18                       .
        rts                                     ; B06E 60                       `
; ----------------------------------------------------------------------------
LB06F:  bcc     LB07B                           ; B06F 90 0A                    ..
        jsr     LB030                           ; B071 20 30 B0                  0.
        ora     $036A,x                         ; B074 1D 6A 03                 .j.
        sta     $036A,x                         ; B077 9D 6A 03                 .j.
        rts                                     ; B07A 60                       `
; ----------------------------------------------------------------------------
LB07B:  .byte   $20                             ; B07B 20                        
        .byte   $30                             ; B07C 30                       0
LB07D:  bcs     LB0C8                           ; B07D B0 49                    .I
        bbs7    $3D,LB0EB+1                     ; B07F FF 3D 6A                 .=j
        .byte   $03                             ; B082 03                       .
        sta     $036A,x                         ; B083 9D 6A 03                 .j.
        rts                                     ; B086 60                       `
; ----------------------------------------------------------------------------
LB087:  stz     $036A                           ; B087 9C 6A 03                 .j.
        .byte   $9C                             ; B08A 9C                       .
LB08B:  .byte   $6B                             ; B08B 6B                       k
        .byte   $03                             ; B08C 03                       .
        rts                                     ; B08D 60                       `
; ----------------------------------------------------------------------------
LB08E:  cmp     #$22                            ; B08E C9 22                    ."
        bne     LB09A                           ; B090 D0 08                    ..
        bit     $A7                             ; B092 24 A7                    $.
        stz     $A7                             ; B094 64 A7                    d.
        bvs     LB09A                           ; B096 70 02                    p.
        dec     $A7                             ; B098 C6 A7                    ..
LB09A:  rts                                     ; B09A 60                       `
; ----------------------------------------------------------------------------
LB09B:  cmp     #$FF                            ; B09B C9 FF                    ..
        bne     LB0A2                           ; B09D D0 03                    ..
        lda     #$5E                            ; B09F A9 5E                    .^
        rts                                     ; B0A1 60                       `
; ----------------------------------------------------------------------------
LB0A2:  phx                                     ; B0A2 DA                       .
        pha                                     ; B0A3 48                       H
        lsr     a                               ; B0A4 4A                       J
        lsr     a                               ; B0A5 4A                       J
        lsr     a                               ; B0A6 4A                       J
        lsr     a                               ; B0A7 4A                       J
        lsr     a                               ; B0A8 4A                       J
        tax                                     ; B0A9 AA                       .
        pla                                     ; B0AA 68                       h
        eor     LB0B0,x                         ; B0AB 5D B0 B0                 ]..
        plx                                     ; B0AE FA                       .
        rts                                     ; B0AF 60                       `
; ----------------------------------------------------------------------------
LB0B0:  .byte   $80,$00                         ; B0B0 80 00                    ..
LB0B2:  .byte   $40,$20,$40,$C0,$80,$80         ; B0B2 40 20 40 C0 80 80        @ @...
; ----------------------------------------------------------------------------
LB0B8:  sta     $F1                             ; B0B8 85 F1                    ..
        and     #$3F                            ; B0BA 29 3F                    )?
LB0BC:  asl     $F1                             ; B0BC 06 F1                    ..
        bit     $F1                             ; B0BE 24 F1                    $.
        bpl     LB0C4                           ; B0C0 10 02                    ..
        ora     #$80                            ; B0C2 09 80                    ..
LB0C4:  bcc     LB0CA                           ; B0C4 90 04                    ..
        ldx     $A7                             ; B0C6 A6 A7                    ..
LB0C8:  bne     LB0CE                           ; B0C8 D0 04                    ..
LB0CA:  bvs     LB0CE                           ; B0CA 70 02                    p.
        ora     #$40                            ; B0CC 09 40                    .@
LB0CE:  cmp     #$DE                            ; B0CE C9 DE                    ..
        bne     LB0D4                           ; B0D0 D0 02                    ..
        lda     #$FF                            ; B0D2 A9 FF                    ..
LB0D4:  rts                                     ; B0D4 60                       `
; ----------------------------------------------------------------------------
; Just guessing: this table is a byte then a jump address. Maybe it's some
; kind of terminal escape sequence table or such, at least pointed routines
; are often touch cursor position zp locs, etc.
LB0D5:  .byte   $41                             ; B0D5 41                       A
; ----------------------------------------------------------------------------
LB0D6:  .addr   LB12A                           ; B0D6 2A B1                    *.
; ----------------------------------------------------------------------------
        .byte   $42                             ; B0D8 42                       B
; ----------------------------------------------------------------------------
        .addr   LB12F                           ; B0D9 2F B1                    /.
; ----------------------------------------------------------------------------
        .byte   $43                             ; B0DB 43                       C
; ----------------------------------------------------------------------------
        .addr   LB13A                           ; B0DC 3A B1                    :.
; ----------------------------------------------------------------------------
        .byte   $44                             ; B0DE 44                       D
; ----------------------------------------------------------------------------
        .addr   LAFC0                           ; B0DF C0 AF                    ..
; ----------------------------------------------------------------------------
        .byte   $45                             ; B0E1 45                       E
; ----------------------------------------------------------------------------
        .addr   LB2CA                           ; B0E2 CA B2                    ..
; ----------------------------------------------------------------------------
        .byte   $46                             ; B0E4 46                       F
; ----------------------------------------------------------------------------
LB0E5:  .addr   LB2D0                           ; B0E5 D0 B2                    ..
; ----------------------------------------------------------------------------
        .byte   $49                             ; B0E7 49                       I
; ----------------------------------------------------------------------------
        .addr   LB13D                           ; B0E8 3D B1                    =.
; ----------------------------------------------------------------------------
        .byte   $4A                             ; B0EA 4A                       J
; ----------------------------------------------------------------------------
LB0EB:  .addr   LB14A                           ; B0EB 4A B1                    J.
; ----------------------------------------------------------------------------
        .byte   $4B                             ; B0ED 4B                       K
; ----------------------------------------------------------------------------
        .addr   LB15A                           ; B0EE 5A B1                    Z.
; ----------------------------------------------------------------------------
        .byte   $4C                             ; B0F0 4C                       L
; ----------------------------------------------------------------------------
        .addr   LB180                           ; B0F1 80 B1                    ..
; ----------------------------------------------------------------------------
        .byte   $4D                             ; B0F3 4D                       M
; ----------------------------------------------------------------------------
        .addr   LB185                           ; B0F4 85 B1                    ..
; ----------------------------------------------------------------------------
        .byte   $4F                             ; B0F6 4F                       O
; ----------------------------------------------------------------------------
        .addr   LB220                           ; B0F7 20 B2                     .
; ----------------------------------------------------------------------------
        .byte   $50                             ; B0F9 50                       P
; ----------------------------------------------------------------------------
        .addr   LB198                           ; B0FA 98 B1                    ..
; ----------------------------------------------------------------------------
LB0FC:  .byte   $51                             ; B0FC 51                       Q
; ----------------------------------------------------------------------------
LB0FD:  .addr   LB18A                           ; B0FD 8A B1                    ..
; ----------------------------------------------------------------------------
        .byte   $54                             ; B0FF 54                       T
; ----------------------------------------------------------------------------
        .addr   LB1B3                           ; B100 B3 B1                    ..
; ----------------------------------------------------------------------------
        .byte   $56                             ; B102 56                       V
; ----------------------------------------------------------------------------
        .addr   LB1BE                           ; B103 BE B1                    ..
; ----------------------------------------------------------------------------
        .byte   $57                             ; B105 57                       W
; ----------------------------------------------------------------------------
        .addr   LB1CA                           ; B106 CA B1                    ..
; ----------------------------------------------------------------------------
        .byte   $59                             ; B108 59                       Y
; ----------------------------------------------------------------------------
        .addr   LAD41                           ; B109 41 AD                    A.
; ----------------------------------------------------------------------------
        .byte   $5A                             ; B10B 5A                       Z
; ----------------------------------------------------------------------------
        .addr   LAD44                           ; B10C 44 AD                    D.
; ----------------------------------------------------------------------------
LB10E:  bit     $036E                           ; B10E 2C 6E 03                 ,n.
        bmi     LB126                           ; B111 30 13                    0.
        bvc     LB126                           ; B113 50 11                    P.
        lda     $036E                           ; B115 AD 6E 03                 .n.
        and     #$DF                            ; B118 29 DF                    ).
LB11A:  ldx     #$36                            ; B11A A2 36                    .6
LB11C:  cmp     LB0D5,x                         ; B11C DD D5 B0                 ...
        beq     LB127                           ; B11F F0 06                    ..
        dex                                     ; B121 CA                       .
        dex                                     ; B122 CA                       .
        dex                                     ; B123 CA                       .
        bpl     LB11C                           ; B124 10 F6                    ..
LB126:  rts                                     ; B126 60                       `
; ----------------------------------------------------------------------------
LB127:  jmp     (LB0D6,x)                       ; B127 7C D6 B0                 |..
LB12A:  sta     $A9                             ; B12A 85 A9                    ..
        stz     $A8                             ; B12C 64 A8                    d.
        rts                                     ; B12E 60                       `
; ----------------------------------------------------------------------------
LB12F:  ldx     CursorX                         ; B12F A6 A1                    ..
        stx     CurMaxX_                        ; B131 86 A4                    ..
        ldy     CursorY                         ; B133 A4 A2                    ..
        sty     CurMaxY_                        ; B135 84 A6                    ..
        jmp     LB087                           ; B137 4C 87 B0                 L..
; ----------------------------------------------------------------------------
LB13A:  stz     $A9                             ; B13A 64 A9                    d.
        rts                                     ; B13C 60                       `
; ----------------------------------------------------------------------------
LB13D:  jsr     LAF89                           ; B13D 20 89 AF                  ..
        ldy     CursorY                         ; B140 A4 A2                    ..
        dey                                     ; B142 88                       .
        jsr     LB059                           ; B143 20 59 B0                  Y.
        iny                                     ; B146 C8                       .
        jmp     LB06F                           ; B147 4C 6F B0                 Lo.
; ----------------------------------------------------------------------------
LB14A:  ldx     $A3                             ; B14A A6 A3                    ..
        stx     CursorX                         ; B14C 86 A1                    ..
        ldy     CursorY                         ; B14E A4 A2                    ..
LB150:  dey                                     ; B150 88                       .
        jsr     LB059                           ; B151 20 59 B0                  Y.
        bcs     LB150                           ; B154 B0 FA                    ..
        iny                                     ; B156 C8                       .
        sty     CursorY                         ; B157 84 A2                    ..
        rts                                     ; B159 60                       `
; ----------------------------------------------------------------------------
LB15A:  dec     CursorY                         ; B15A C6 A2                    ..
LB15C:  inc     CursorY                         ; B15C E6 A2                    ..
        ldy     CursorY                         ; B15E A4 A2                    ..
        jsr     LB059                           ; B160 20 59 B0                  Y.
        bcs     LB15C                           ; B163 B0 F7                    ..
        ldx     CurMaxX_                        ; B165 A6 A4                    ..
        stx     CursorX                         ; B167 86 A1                    ..
        bra     LB16E                           ; B169 80 03                    ..
LB16B:  jsr     LAE09                           ; B16B 20 09 AE                  ..
LB16E:  jsr     LAF41                           ; B16E 20 41 AF                  A.
        cmp     #$20                            ; B171 C9 20                    . 
        bne     LB17F                           ; B173 D0 0A                    ..
        cpx     $A3                             ; B175 E4 A3                    ..
        bne     LB16B                           ; B177 D0 F2                    ..
        dey                                     ; B179 88                       .
        jsr     LB059                           ; B17A 20 59 B0                  Y.
        bcs     LB16B                           ; B17D B0 EC                    ..
LB17F:  rts                                     ; B17F 60                       `
; ----------------------------------------------------------------------------
LB180:  lda     #$40                            ; B180 A9 40                    .@
        tsb     $AA                             ; B182 04 AA                    ..
        rts                                     ; B184 60                       `
; ----------------------------------------------------------------------------
LB185:  lda     #$40                            ; B185 A9 40                    .@
        trb     $AA                             ; B187 14 AA                    ..
        rts                                     ; B189 60                       `
; ----------------------------------------------------------------------------
LB18A:  jsr     LAEB1                           ; B18A 20 B1 AE                  ..
        jsr     LB15A                           ; B18D 20 5A B1                  Z.
        jsr     LAEBC                           ; B190 20 BC AE                  ..
        bcs     LB19E                           ; B193 B0 09                    ..
        jmp     LAEA6                           ; B195 4C A6 AE                 L..
; ----------------------------------------------------------------------------
LB198:  jsr     LAEB1                           ; B198 20 B1 AE                  ..
        jsr     LB14A                           ; B19B 20 4A B1                  J.
LB19E:  jsr     LAF1A                           ; B19E 20 1A AF                  ..
        jsr     LAEBC                           ; B1A1 20 BC AE                  ..
        bne     LB1A7                           ; B1A4 D0 01                    ..
        rts                                     ; B1A6 60                       `
; ----------------------------------------------------------------------------
LB1A7:  bpl     LB1AE                           ; B1A7 10 05                    ..
        jsr     LADD1                           ; B1A9 20 D1 AD                  ..
        bra     LB19E                           ; B1AC 80 F0                    ..
LB1AE:  jsr     LAE09                           ; B1AE 20 09 AE                  ..
        bra     LB19E                           ; B1B1 80 EB                    ..
LB1B3:  ldx     CursorX                         ; B1B3 A6 A1                    ..
        ldy     CursorY                         ; B1B5 A4 A2                    ..
        stx     $A3                             ; B1B7 86 A3                    ..
        sty     $A5                             ; B1B9 84 A5                    ..
        jmp     LB087                           ; B1BB 4C 87 B0                 L..
; ----------------------------------------------------------------------------
LB1BE:  jsr     LAEB1                           ; B1BE 20 B1 AE                  ..
        ldy     CurMaxY_                        ; B1C1 A4 A6                    ..
        sty     CursorY                         ; B1C3 84 A2                    ..
        jsr     LAF4B                           ; B1C5 20 4B AF                  K.
        bra     LB1D4                           ; B1C8 80 0A                    ..
LB1CA:  jsr     LAEB1                           ; B1CA 20 B1 AE                  ..
        ldy     $A5                             ; B1CD A4 A5                    ..
        sty     CursorY                         ; B1CF 84 A2                    ..
        jsr     LAF89                           ; B1D1 20 89 AF                  ..
LB1D4:  jsr     LB393                           ; B1D4 20 93 B3                  ..
        jmp     LAEA6                           ; B1D7 4C A6 AE                 L..
; ----------------------------------------------------------------------------
LB1DA:  jsr     LB2E4                           ; B1DA 20 E4 B2                  ..
        lda     #$08                            ; B1DD A9 08                    ..
        sta     VidMemHi                        ; B1DF 85 A0                    ..
        ldx     #$28                            ; B1E1 A2 28                    .(
        stx     $0368                           ; B1E3 8E 68 03                 .h.
        ldy     #$10                            ; B1E6 A0 10                    ..
LB1E8:  sty     $0369                           ; B1E8 8C 69 03                 .i.
        lda     #$0F                            ; B1EB A9 0F                    ..
        sta     CurMaxY                         ; B1ED 8D 7E 03                 .~.
        lda     #$4F                            ; B1F0 A9 4F                    .O
        sta     CurMaxX                         ; B1F2 8D 81 03                 ...
        stz     $037F                           ; B1F5 9C 7F 03                 ...
        stz     L0380                           ; B1F8 9C 80 03                 ...
        jsr     LAE5B                           ; B1FB 20 5B AE                  [.
        lda     #$00                            ; B1FE A9 00                    ..
        tax                                     ; B200 AA                       .
        ldy     VidMemHi                        ; B201 A4 A0                    ..
        clc                                     ; B203 18                       .
        jsr     LCDsetupGetOrSet                ; B204 20 28 B2                  (.
        jsr     LAE47                           ; B207 20 47 AE                  G.
        stz     $A7                             ; B20A 64 A7                    d.
        stz     $0382                           ; B20C 9C 82 03                 ...
        stz     $A9                             ; B20F 64 A9                    d.
        stz     $036E                           ; B211 9C 6E 03                 .n.
        stz     $A9                             ; B214 64 A9                    d.
        lda     #$ED                            ; B216 A9 ED                    ..
        sta     $AA                             ; B218 85 AA                    ..
        stz     $036F                           ; B21A 9C 6F 03                 .o.
        jsr     LAD41                           ; B21D 20 41 AD                  A.
LB220:  stz     $A7                             ; B220 64 A7                    d.
        stz     $A8                             ; B222 64 A8                    d.
LB224:  stz     $036C                           ; B224 9C 6C 03                 .l.
        rts                                     ; B227 60                       `
; ----------------------------------------------------------------------------
LCDsetupGetOrSet:
; This routine is called by RESET routine, with carry set.
; It seems it's the only part where locations $FF80 - $FF83 are written.
; $FF80-$FF83 is the write-only registers of the LCD controller.
; It's called first with carry set from $87B5,
; then called second with carry clear from $B204
        php                                     ; B228 08                       .
        sei                                     ; B229 78                       x
        bcc     LCDsetupSet                     ; B22A 90 09                    ..
        lda     $037A                           ; B22C AD 7A 03                 .z.
        ldx     $037B                           ; B22F AE 7B 03                 .{.
        ldy     $037C                           ; B232 AC 7C 03                 .|.
LCDsetupSet:
        and     #$03                            ; B235 29 03                    ).
        sta     $037A                           ; B237 8D 7A 03                 .z.
        stx     $037B                           ; B23A 8E 7B 03                 .{.
        sty     $037C                           ; B23D 8C 7C 03                 .|.
        ora     #$08                            ; B240 09 08                    ..
        sta     LFF82                           ; B242 8D 82 FF                 ...
        sta     LFF83                           ; B245 8D 83 FF                 ...
        stx     LFF80                           ; B248 8E 80 FF                 ...
        tya                                     ; B24B 98                       .
        asl     a                               ; B24C 0A                       .
        sta     KJ_SCINIT                       ; B24D 8D 81 FF                 ...
        lda     $037A                           ; B250 AD 7A 03                 .z.
        plp                                     ; B253 28                       (
        rts                                     ; B254 60                       `
; ----------------------------------------------------------------------------
LB255:  .word   $00A1,$00A2,$00A3,$00A4         ; B255 A1 00 A2 00 A3 00 A4 00  ........
        .word   $00A6,$00A5,$00A7,$037D         ; B25D A6 00 A5 00 A7 00 7D 03  ......}.
        .word   $00A8,$00A9,$00AA,$036F         ; B265 A8 00 A9 00 AA 00 6F 03  ......o.
        .word   $036C,$036D,$036A,$036B         ; B26D 6C 03 6D 03 6A 03 6B 03  l.m.j.k.
        .word   $036E,$0370,$0371,$0372         ; B275 6E 03 70 03 71 03 72 03  n.p.q.r.
        .word   $0373,$0374,$0375,$0376         ; B27D 73 03 74 03 75 03 76 03  s.t.u.v.
        .word   $0377,$0378,$0379,$00A0         ; B285 77 03 78 03 79 03 A0 00  w.x.y...
        .word   $037A,$037B,$037C               ; B28D 7A 03 7B 03 7C 03        z.{.|.
; ----------------------------------------------------------------------------
LB293:  stx     $F1                             ; B293 86 F1                    ..
        sty     $F2                             ; B295 84 F2                    ..
        jsr     LB2E4                           ; B297 20 E4 B2                  ..
        stz     $0382                           ; B29A 9C 82 03                 ...
        lda     #$F1                            ; B29D A9 F1                    ..
        sta     $034E                           ; B29F 8D 4E 03                 .N.
        sta     $0360                           ; B2A2 8D 60 03                 .`.
        ldy     #$00                            ; B2A5 A0 00                    ..
        ldx     #$00                            ; B2A7 A2 00                    ..
LB2A9:  lda     LB255,x                         ; B2A9 BD 55 B2                 .U.
        sta     VidPtrLo                        ; B2AC 85 C1                    ..
        lda     LB255+1,x                       ; B2AE BD 56 B2                 .V.
        sta     VidPtrHi                        ; B2B1 85 C2                    ..
        lda     (VidPtrLo)                      ; B2B3 B2 C1                    ..
        pha                                     ; B2B5 48                       H
        jsr     FROM_C67B                       ; B2B6 20 4A 03                  J.
        sta     (VidPtrLo)                      ; B2B9 92 C1                    ..
        pla                                     ; B2BB 68                       h
        jsr     FROM_C68D                       ; B2BC 20 5C 03                  \.
        iny                                     ; B2BF C8                       .
        inx                                     ; B2C0 E8                       .
        inx                                     ; B2C1 E8                       .
        cpx     #$3E                            ; B2C2 E0 3E                    .>
        bne     LB2A9                           ; B2C4 D0 E3                    ..
LB2C6:  sec                                     ; B2C6 38                       8
        jmp     LCDsetupGetOrSet                ; B2C7 4C 28 B2                 L(.
; ----------------------------------------------------------------------------
LB2CA:  lda     #$80                            ; B2CA A9 80                    ..
        tsb     $036F                           ; B2CC 0C 6F 03                 .o.
        rts                                     ; B2CF 60                       `
; ----------------------------------------------------------------------------
LB2D0:  lda     #$80                            ; B2D0 A9 80                    ..
        trb     $036F                           ; B2D2 1C 6F 03                 .o.
        rts                                     ; B2D5 60                       `
; ----------------------------------------------------------------------------
LB2D6:  jsr     LB2E4                           ; B2D6 20 E4 B2                  ..
        jsr     LAF28                           ; B2D9 20 28 AF                  (.
        lda     (VidPtrLo)                      ; B2DC B2 C1                    ..
        sta     $F0                             ; B2DE 85 F0                    ..
        sec                                     ; B2E0 38                       8
        ror     $EF                             ; B2E1 66 EF                    f.
        rts                                     ; B2E3 60                       `
; ----------------------------------------------------------------------------
LB2E4:  lda     #$FF                            ; B2E4 A9 FF                    ..
        trb     $EF                             ; B2E6 14 EF                    ..
        beq     LB2EE                           ; B2E8 F0 04                    ..
        lda     $F0                             ; B2EA A5 F0                    ..
        sta     (VidPtrLo)                      ; B2EC 92 C1                    ..
LB2EE:  rts                                     ; B2EE 60                       `
; ----------------------------------------------------------------------------
LB2EF:  lda     $0384                           ; B2EF AD 84 03                 ...
        bne     LB318                           ; B2F2 D0 24                    .$
        bit     $EF                             ; B2F4 24 EF                    $.
        bpl     LB318                           ; B2F6 10 20                    . 
        dec     $EF                             ; B2F8 C6 EF                    ..
        bmi     LB318                           ; B2FA 30 1C                    0.
        bit     $036F                           ; B2FC 2C 6F 03                 ,o.
        bmi     LB305                           ; B2FF 30 04                    0.
        lda     #$A0                            ; B301 A9 A0                    ..
        sta     $EF                             ; B303 85 EF                    ..
LB305:  lda     $F0                             ; B305 A5 F0                    ..
        cmp     (VidPtrLo)                      ; B307 D2 C1                    ..
        bne     LB316                           ; B309 D0 0B                    ..
        bit     $03FC                           ; B30B 2C FC 03                 ,..
        bpl     LB314                           ; B30E 10 04                    ..
        and     #$80                            ; B310 29 80                    ).
        ora     #$1E                            ; B312 09 1E                    ..
LB314:  eor     #$80                            ; B314 49 80                    I.
LB316:  sta     (VidPtrLo)                      ; B316 92 C1                    ..
LB318:  rts                                     ; B318 60                       `
; ----------------------------------------------------------------------------
LB319:  lda     $80                             ; B319 A5 80                    ..
        tsb     $0382                           ; B31B 0C 82 03                 ...
        bne     LB362                           ; B31E D0 42                    .B
        jsr     LB393                           ; B320 20 93 B3                  ..
        bra     LB349                           ; B323 80 24                    .$
LB325:  lda     #$80                            ; B325 A9 80                    ..
        tsb     $0382                           ; B327 0C 82 03                 ...
        bne     LB362                           ; B32A D0 36                    .6
        jsr     LAEB1                           ; B32C 20 B1 AE                  ..
        stx     $03E8                           ; B32F 8E E8 03                 ...
        sty     $03E9                           ; B332 8C E9 03                 ...
        bra     LB33A                           ; B335 80 03                    ..
LB337:  jsr     LABD6                           ; B337 20 D6 AB                  ..
LB33A:  jsr     LB2D6                           ; B33A 20 D6 B2                  ..
        jsr     LB6DF                           ; B33D 20 DF B6                  ..
        pha                                     ; B340 48                       H
        jsr     LB2E4                           ; B341 20 E4 B2                  ..
        pla                                     ; B344 68                       h
        cmp     #$0D                            ; B345 C9 0D                    ..
        bne     LB337                           ; B347 D0 EE                    ..
LB349:  stz     $A7                             ; B349 64 A7                    d.
        jsr     LB15A                           ; B34B 20 5A B1                  Z.
        jsr     LAEB1                           ; B34E 20 B1 AE                  ..
        ldy     $03E9                           ; B351 AC E9 03                 ...
        bmi     LB35F                           ; B354 30 09                    0.
        sty     CursorY                         ; B356 84 A2                    ..
        ldx     $03E8                           ; B358 AE E8 03                 ...
        stx     CursorX                         ; B35B 86 A1                    ..
        bra     LB362                           ; B35D 80 03                    ..
LB35F:  jsr     LB14A                           ; B35F 20 4A B1                  J.
LB362:  jsr     LAEBC                           ; B362 20 BC AE                  ..
        bcc     LB36E                           ; B365 90 07                    ..
        lda     #$40                            ; B367 A9 40                    .@
        tsb     $0382                           ; B369 0C 82 03                 ...
        bne     LB387                           ; B36C D0 19                    ..
LB36E:  jsr     LAF41                           ; B36E 20 41 AF                  A.
        jsr     LB0B8                           ; B371 20 B8 B0                  ..
        jsr     LB08E                           ; B374 20 8E B0                  ..
        bit     $0382                           ; B377 2C 82 03                 ,..
        bvs     LB383                           ; B37A 70 07                    p.
        pha                                     ; B37C 48                       H
        jsr     LADD1                           ; B37D 20 D1 AD                  ..
        pla                                     ; B380 68                       h
LB381:  clc                                     ; B381 18                       .
        rts                                     ; B382 60                       `
; ----------------------------------------------------------------------------
LB383:  cmp     #$20                            ; B383 C9 20                    . 
        bne     LB381                           ; B385 D0 FA                    ..
LB387:  jsr     LB15A                           ; B387 20 5A B1                  Z.
        stz     $A7                             ; B38A 64 A7                    d.
        stz     $0382                           ; B38C 9C 82 03                 ...
        lda     #$0D                            ; B38F A9 0D                    ..
        clc                                     ; B391 18                       .
        rts                                     ; B392 60                       `
; ----------------------------------------------------------------------------
LB393:  stz     $03E9                           ; B393 9C E9 03                 ...
        dec     $03E9                           ; B396 CE E9 03                 ...
        rts                                     ; B399 60                       `
; ----------------------------------------------------------------------------
; My guess: these tables help to decode the keyboard matrix read into actual
; characters. More tables, because of shifted, etc state.
KbdMat1:.byte   $40,$87,$86,$85,$88,$09,$0D,$14 ; B39A 40 87 86 85 88 09 0D 14  @.......
        .byte   $8A,$45,$53,$5A,$34,$41,$57,$33 ; B3A2 8A 45 53 5A 34 41 57 33  .ESZ4AW3
        .byte   $58,$54,$46,$43,$36,$44,$52,$35 ; B3AA 58 54 46 43 36 44 52 35  XTFC6DR5
        .byte   $56,$55,$48,$42,$38,$47,$59,$37 ; B3B2 56 55 48 42 38 47 59 37  VUHB8GY7
        .byte   $4E,$4F,$4B,$4D,$30,$4A,$49,$39 ; B3BA 4E 4F 4B 4D 30 4A 49 39  NOKM0JI9
        .byte   $2C,$2D,$3A,$2E,$91,$4C,$50,$11 ; B3C2 2C 2D 3A 2E 91 4C 50 11  ,-:..LP.
        .byte   $2F,$2B,$3D,$1B,$1D,$3B,$2A,$9D ; B3CA 2F 2B 3D 1B 1D 3B 2A 9D  /+=..;*.
        .byte   $8B,$51,$8C,$20,$32,$89,$13,$31 ; B3D2 8B 51 8C 20 32 89 13 31  .Q. 2..1
KbdMat2:.byte   $BA,$87,$86,$85,$88,$09,$8D,$94 ; B3DA BA 87 86 85 88 09 8D 94  ........
        .byte   $8A,$65,$73,$7A,$24,$61,$77,$23 ; B3E2 8A 65 73 7A 24 61 77 23  .esz$aw#
        .byte   $78,$74,$66,$63,$26,$64,$72,$25 ; B3EA 78 74 66 63 26 64 72 25  xtfc&dr%
        .byte   $76,$75,$68,$62,$28,$67,$79,$27 ; B3F2 76 75 68 62 28 67 79 27  vuhb(gy'
        .byte   $6E,$6F,$6B,$6D,$5E,$6A,$69,$29 ; B3FA 6E 6F 6B 6D 5E 6A 69 29  nokm^ji)
        .byte   $3C,$60,$5B,$3E,$91,$6C,$70,$11 ; B402 3C 60 5B 3E 91 6C 70 11  <`[>.lp.
        .byte   $3F,$7B,$7D,$1B,$1D,$5D,$A9,$9D ; B40A 3F 7B 7D 1B 1D 5D A9 9D  ?{}..]..
        .byte   $8B,$71,$8C,$A0,$22,$89,$93,$21 ; B412 8B 71 8C A0 22 89 93 21  .q.."..!
KbdMat3:.byte   $40,$87,$86,$85,$88,$09,$0D,$14 ; B41A 40 87 86 85 88 09 0D 14  @.......
        .byte   $8A,$65,$73,$7A,$34,$61,$77,$33 ; B422 8A 65 73 7A 34 61 77 33  .esz4aw3
        .byte   $78,$74,$66,$63,$36,$64,$72,$35 ; B42A 78 74 66 63 36 64 72 35  xtfc6dr5
        .byte   $76,$75,$68,$62,$38,$67,$79,$37 ; B432 76 75 68 62 38 67 79 37  vuhb8gy7
        .byte   $6E,$6F,$6B,$6D,$30,$6A,$69,$39 ; B43A 6E 6F 6B 6D 30 6A 69 39  nokm0ji9
        .byte   $2C,$2D,$3A,$2E,$91,$6C,$70,$11 ; B442 2C 2D 3A 2E 91 6C 70 11  ,-:..lp.
        .byte   $2F,$2B,$3D,$1B,$1D,$3B,$2A,$9D ; B44A 2F 2B 3D 1B 1D 3B 2A 9D  /+=..;*.
        .byte   $8B,$71,$8C,$20,$32,$89,$13,$31 ; B452 8B 71 8C 20 32 89 13 31  .q. 2..1
KbdMat4:.byte   $BA,$87,$86,$85,$88,$09,$8D,$94 ; B45A BA 87 86 85 88 09 8D 94  ........
        .byte   $8A,$B1,$AE,$AD,$24,$B0,$B3,$23 ; B462 8A B1 AE AD 24 B0 B3 23  ....$..#
        .byte   $BD,$A3,$BB,$BC,$26,$AC,$B2,$25 ; B46A BD A3 BB BC 26 AC B2 25  ....&..%
        .byte   $BE,$B8,$B4,$BF,$28,$A5,$B7,$27 ; B472 BE B8 B4 BF 28 A5 B7 27  ....(..'
        .byte   $AA,$B9,$A1,$A7,$5F,$B5,$A2,$29 ; B47A AA B9 A1 A7 5F B5 A2 29  ...._..)
        .byte   $2C,$5C,$A6,$2E,$91,$B6,$AF,$11 ; B482 2C 5C A6 2E 91 B6 AF 11  ,\......
        .byte   $A4,$7C,$FF,$1B,$1D,$A8,$7F,$9D ; B48A A4 7C FF 1B 1D A8 7F 9D  .|......
        .byte   $8B,$AB,$8A,$A0                 ; B492 8B AB 8A A0              ....
LB496:  .byte   $32,$89,$93,$31                 ; B496 32 89 93 31              2..1
KbdMat5:.byte   $80,$87,$86,$85,$88,$09,$0D,$14 ; B49A 80 87 86 85 88 09 0D 14  ........
        .byte   $8A,$05,$13,$1A,$34,$01,$17,$33 ; B4A2 8A 05 13 1A 34 01 17 33  ....4..3
        .byte   $18,$14,$06,$03,$36,$04,$12,$35 ; B4AA 18 14 06 03 36 04 12 35  ....6..5
        .byte   $16,$15,$08,$02,$38,$07,$19,$37 ; B4B2 16 15 08 02 38 07 19 37  ....8..7
        .byte   $0E,$0F,$0B,$0D,$1E,$0A,$09,$39 ; B4BA 0E 0F 0B 0D 1E 0A 09 39  .......9
        .byte   $12,$1C,$1B,$92,$91,$0C,$10,$11 ; B4C2 12 1C 1B 92 91 0C 10 11  ........
        .byte   $1F,$2B,$3D,$1B,$1D,$1D,$2A,$9D ; B4CA 1F 2B 3D 1B 1D 1D 2A 9D  .+=...*.
        .byte   $8B,$11,$8C,$20,$32,$89,$13,$31 ; B4D2 8B 11 8C 20 32 89 13 31  ... 2..1
; ----------------------------------------------------------------------------
LB4DA:  lda     #$09                            ; B4DA A9 09                    ..
        sta     $03F6                           ; B4DC 8D F6 03                 ...
        lda     #$1E                            ; B4DF A9 1E                    ..
        sta     $0367                           ; B4E1 8D 67 03                 .g.
        lda     #$01                            ; B4E4 A9 01                    ..
        sta     $0366                           ; B4E6 8D 66 03                 .f.
        sta     $0365                           ; B4E9 8D 65 03                 .e.
        lda     #$FF                            ; B4EC A9 FF                    ..
        sta     $038E                           ; B4EE 8D 8E 03                 ...
        lda     #$87                            ; B4F1 A9 87                    ..
        sta     L0336                           ; B4F3 8D 36 03                 .6.
        lda     #$FA                            ; B4F6 A9 FA                    ..
        sta     $0337                           ; B4F8 8D 37 03                 .7.
LB4FB:  php                                     ; B4FB 08                       .
        sei                                     ; B4FC 78                       x
        stz     $03F7                           ; B4FD 9C F7 03                 ...
        stz     $03F8                           ; B500 9C F8 03                 ...
        stz     $03F9                           ; B503 9C F9 03                 ...
        plp                                     ; B506 28                       (
        rts                                     ; B507 60                       `
; ----------------------------------------------------------------------------
KL_SCNKEY:
        lda     $F4                             ; B508 A5 F4                    ..
        beq     LB54C                           ; B50A F0 40                    .@
        dec     $F4                             ; B50C C6 F4                    ..
        lda     $AB                             ; B50E A5 AB                    ..
        and     #$07                            ; B510 29 07                    ).
        tax                                     ; B512 AA                       .
        lda     PowersOfTwo,x                   ; B513 BD 41 B0                 .A.
        eor     #$FF                            ; B516 49 FF                    I.
        sta     VIA1_PORTA                      ; B518 8D 01 F8                 ...
        lda     $AB                             ; B51B A5 AB                    ..
        lsr     a                               ; B51D 4A                       J
        lsr     a                               ; B51E 4A                       J
        lsr     a                               ; B51F 4A                       J
        tay                                     ; B520 A8                       .
        jsr     KBD_READ_VIA_SR                 ; B521 20 E4 B5                  ..
        and     PowersOfTwo,y                   ; B524 39 41 B0                 9A.
        beq     LB52E                           ; B527 F0 05                    ..
        lda     $0365                           ; B529 AD 65 03                 .e.
        sta     $F4                             ; B52C 85 F4                    ..
LB52E:  lda     $AB                             ; B52E A5 AB                    ..
        eor     #$07                            ; B530 49 07                    I.
        tax                                     ; B532 AA                       .
        lda     KbdMat1,x                       ; B533 BD 9A B3                 ...
        cmp     #$85                            ; B536 C9 85                    ..
        bcc     LB53E                           ; B538 90 04                    ..
        cmp     #$8D                            ; B53A C9 8D                    ..
        bcc     LB549                           ; B53C 90 0B                    ..
LB53E:  dec     $F5                             ; B53E C6 F5                    ..
        bpl     LB549                           ; B540 10 07                    ..
        lda     $0366                           ; B542 AD 66 03                 .f.
        sta     $F5                             ; B545 85 F5                    ..
        bne     LB585                           ; B547 D0 3C                    .<
LB549:  jmp     LB5FD                           ; B549 4C FD B5                 L..
; ----------------------------------------------------------------------------
LB54C:  lda     #$00                            ; B54C A9 00                    ..
        sta     VIA1_PORTA                      ; B54E 8D 01 F8                 ...
        jsr     KBD_READ_VIA_SR                 ; B551 20 E4 B5                  ..
        beq     LB549                           ; B554 F0 F3                    ..
        ldx     #$07                            ; B556 A2 07                    ..
LB558:  lda     PowersOfTwo,x                   ; B558 BD 41 B0                 .A.
        eor     #$FF                            ; B55B 49 FF                    I.
        sta     VIA1_PORTA                      ; B55D 8D 01 F8                 ...
        jsr     KBD_READ_VIA_SR                 ; B560 20 E4 B5                  ..
        bne     LB56A                           ; B563 D0 05                    ..
        dex                                     ; B565 CA                       .
        bpl     LB558                           ; B566 10 F0                    ..
        bra     LB549                           ; B568 80 DF                    ..
LB56A:  ldy     #$FF                            ; B56A A0 FF                    ..
LB56C:  iny                                     ; B56C C8                       .
        lsr     a                               ; B56D 4A                       J
        bcc     LB56C                           ; B56E 90 FC                    ..
        tya                                     ; B570 98                       .
        asl     a                               ; B571 0A                       .
        asl     a                               ; B572 0A                       .
        asl     a                               ; B573 0A                       .
        dec     a                               ; B574 3A                       :
LB575:  inc     a                               ; B575 1A                       .
        dex                                     ; B576 CA                       .
        bpl     LB575                           ; B577 10 FC                    ..
        sta     $AB                             ; B579 85 AB                    ..
LB57C           := * + 1
        lda     $0365                           ; B57B AD 65 03                 .e.
LB57F           := * + 1
        sta     $F4                             ; B57E 85 F4                    ..
        lda     $0367                           ; B580 AD 67 03                 .g.
        sta     $F5                             ; B583 85 F5                    ..
LB585:  lda     $AB                             ; B585 A5 AB                    ..
        eor     #$07                            ; B587 49 07                    I.
        tax                                     ; B589 AA                       .
LB58B           := * + 1
        jsr     LB5FD                           ; B58A 20 FD B5                  ..
        and     #$08                            ; B58D 29 08                    ).
        beq     LB5AC                           ; B58F F0 1B                    ..
        lda     #$02                            ; B591 A9 02                    ..
        and     $AA                             ; B593 25 AA                    %.
        beq     LB5AC                           ; B595 F0 15                    ..
        ldy     KbdMat1,x                       ; B597 BC 9A B3                 ...
        cpy     #$51                            ; B59A C0 51                    .Q
        bne     LB5A3                           ; B59C D0 05                    ..
        trb     $036D                           ; B59E 1C 6D 03                 .m.
        bra     LB5E1                           ; B5A1 80 3E                    .>
LB5A3:  cpy     #$53                            ; B5A3 C0 53                    .S
        bne     LB5AC                           ; B5A5 D0 05                    ..
        tsb     $036D                           ; B5A7 0C 6D 03                 .m.
        bra     LB5E1                           ; B5AA 80 35                    .5
LB5AC:  lda     StopKeyFlag                     ; B5AC A5 AD                    ..
        and     $038E                           ; B5AE 2D 8E 03                 -..
        ldy     KbdMat5,x                       ; B5B1 BC 9A B4                 ...
        bit     #$08                            ; B5B4 89 08                    ..
        bne     LB5D0                           ; B5B6 D0 18                    ..
        ldy     KbdMat4,x                       ; B5B8 BC 5A B4                 .Z.
        bit     #$10                            ; B5BB 89 10                    ..
        bne     LB5D0                           ; B5BD D0 11                    ..
        ldy     KbdMat2,x                       ; B5BF BC DA B3                 ...
        bit     #$04                            ; B5C2 89 04                    ..
        bne     LB5D0                           ; B5C4 D0 0A                    ..
        ldy     KbdMat3,x                       ; B5C6 BC 1A B4                 ...
        bit     #$02                            ; B5C9 89 02                    ..
        bne     LB5D0                           ; B5CB D0 03                    ..
        ldy     KbdMat1,x                       ; B5CD BC 9A B3                 ...
LB5D0:  tya                                     ; B5D0 98                       .
        ldy     $03FA                           ; B5D1 AC FA 03                 ...
LB5D4:  bne     LB5E1                           ; B5D4 D0 0B                    ..
        ldy     KbdMat1,x                       ; B5D6 BC 9A B3                 ...
        jsr     LFA84                           ; B5D9 20 84 FA                  ..
LB5DC:  sta     $AC                             ; B5DC 85 AC                    ..
        jsr     LB640                           ; B5DE 20 40 B6                  @.
LB5E1:  jmp     LBFBE                           ; B5E1 4C BE BF                 L..
; ----------------------------------------------------------------------------
KBD_READ_VIA_SR:
; It seems, CLCD's kbd is read through VIA's SR ... Interesting.
; AFAIK, port B of VIA is mainly used by IEC bus, but bit 0 for example seems
; to trigger (0->1) the keyboard "controller" to provide bits through serial
; transfer in SR-in.
        lda     VIA1_PORTB                      ; B5E4 AD 00 F8                 ...
        and     #$FE                            ; B5E7 29 FE                    ).
        sta     VIA1_PORTB                      ; B5E9 8D 00 F8                 ...
        inc     VIA1_PORTB                      ; B5EC EE 00 F8                 ...
        lda     VIA1_SR                         ; B5EF AD 0A F8                 ...
LB5F2:  lda     #$04                            ; B5F2 A9 04                    ..
LB5F4:  bit     VIA1_IFR                        ; B5F4 2C 0D F8                 ,..
        beq     LB5F4                           ; B5F7 F0 FB                    ..
        lda     VIA1_SR                         ; B5F9 AD 0A F8                 ...
        rts                                     ; B5FC 60                       `
; ----------------------------------------------------------------------------
LB5FD:  jsr     LB5F2                           ; B5FD 20 F2 B5                  ..
        sta     StopKeyFlag                     ; B600 85 AD                    ..
LB602:  and     #$14                            ; B602 29 14                    ).
        eor     #$14                            ; B604 49 14                    I.
        ora     $03FB                           ; B606 0D FB 03                 ...
        bne     LB613                           ; B609 D0 08                    ..
        jsr     LACEE                           ; B60B 20 EE AC                  ..
        lda     #$3C                            ; B60E A9 3C                    .<
        sta     $03FB                           ; B610 8D FB 03                 ...
LB613:  dec     $03FB                           ; B613 CE FB 03                 ...
        bpl     LB61B                           ; B616 10 03                    ..
        stz     $03FB                           ; B618 9C FB 03                 ...
LB61B:  lda     #$02                            ; B61B A9 02                    ..
        trb     StopKeyFlag                     ; B61D 14 AD                    ..
        beq     LB62F                           ; B61F F0 0E                    ..
        lda     $03FC                           ; B621 AD FC 03                 ...
        bit     #$40                            ; B624 89 40                    .@
        bne     LB634                           ; B626 D0 0C                    ..
        eor     #$C0                            ; B628 49 C0                    I.
        sta     $03FC                           ; B62A 8D FC 03                 ...
        bra     LB634                           ; B62D 80 05                    ..
LB62F:  lda     #$40                            ; B62F A9 40                    .@
        trb     $03FC                           ; B631 1C FC 03                 ...
LB634:  bit     $03FC                           ; B634 2C FC 03                 ,..
        bpl     LB63D                           ; B637 10 04                    ..
        lda     #$02                            ; B639 A9 02                    ..
        tsb     StopKeyFlag                     ; B63B 04 AD                    ..
LB63D:  lda     StopKeyFlag                     ; B63D A5 AD                    ..
        rts                                     ; B63F 60                       `
; ----------------------------------------------------------------------------
LB640:  php                                     ; B640 08                       .
        sei                                     ; B641 78                       x
        phx                                     ; B642 DA                       .
        ldx     $03F7                           ; B643 AE F7 03                 ...
        dex                                     ; B646 CA                       .
        bpl     LB64C                           ; B647 10 03                    ..
        ldx     $03F6                           ; B649 AE F6 03                 ...
LB64C:
LB64D           := * + 1
        cpx     $03F8                           ; B64C EC F8 03                 ...
        bne     LB655                           ; B64F D0 04                    ..
        plx                                     ; B651 FA                       .
        plp                                     ; B652 28                       (
        sec                                     ; B653 38                       8
        rts                                     ; B654 60                       `
; ----------------------------------------------------------------------------
LB655:  and     #$FF                            ; B655 29 FF                    ).
        beq     LB668                           ; B657 F0 0F                    ..
LB659:  ldx     $03F7                           ; B659 AE F7 03                 ...
        sta     $03EC,x                         ; B65C 9D EC 03                 ...
        dex                                     ; B65F CA                       .
        bpl     LB665                           ; B660 10 03                    ..
        ldx     $03F6                           ; B662 AE F6 03                 ...
LB665:  stx     $03F7                           ; B665 8E F7 03                 ...
LB668:  plx                                     ; B668 FA                       .
        plp                                     ; B669 28                       (
        clc                                     ; B66A 18                       .
        rts                                     ; B66B 60                       `
; ----------------------------------------------------------------------------
LB66C:  ldx     $03F8                           ; B66C AE F8 03                 ...
        lda     #$00                            ; B66F A9 00                    ..
        cpx     $03F7                           ; B671 EC F7 03                 ...
        beq     LB683                           ; B674 F0 0D                    ..
        lda     $03EC,x                         ; B676 BD EC 03                 ...
        dex                                     ; B679 CA                       .
        bpl     LB67F                           ; B67A 10 03                    ..
        ldx     $03F6                           ; B67C AE F6 03                 ...
LB67F:  stx     $03F8                           ; B67F 8E F8 03                 ...
        clc                                     ; B682 18                       .
LB683:  rts                                     ; B683 60                       `
; ----------------------------------------------------------------------------
LB684:  sta     $03F9                           ; B684 8D F9 03                 ...
        rts                                     ; B687 60                       `
; ----------------------------------------------------------------------------
LB688:  phx                                     ; B688 DA                       .
        phy                                     ; B689 5A                       Z
        lda     $03F9                           ; B68A AD F9 03                 ...
        stz     $03F9                           ; B68D 9C F9 03                 ...
        bne     LB6D1                           ; B690 D0 3F                    .?
        ldx     #$0C                            ; B692 A2 0C                    ..
        jsr     LD230                           ; B694 20 30 D2                  0.
        tax                                     ; B697 AA                       .
        bne     LB6D1                           ; B698 D0 37                    .7
        jsr     LB66C                           ; B69A 20 6C B6                  l.
        bcc     LB6C7                           ; B69D 90 28                    .(
        lda     #$0E                            ; B69F A9 0E                    ..
LB6A1:  jsr     L8C40                           ; B6A1 20 40 8C                  @.
        bcc     LB6C0                           ; B6A4 90 1A                    ..
        rol     $03FA                           ; B6A6 2E FA 03                 ...
        lda     StopKeyFlag                     ; B6A9 A5 AD                    ..
        lsr     a                               ; B6AB 4A                       J
        bcs     LB6BD                           ; B6AC B0 0F                    ..
        jsr     L8B46                           ; B6AE 20 46 8B                  F.
        bcc     LB6BD                           ; B6B1 90 0A                    ..
        bit     $039D                           ; B6B3 2C 9D 03                 ,..
        bpl     LB6BB                           ; B6B6 10 03                    ..
        jsr     L8C89                           ; B6B8 20 89 8C                  ..
LB6BB:  bra     LB6C7                           ; B6BB 80 0A                    ..
LB6BD:  jsr     L8C89                           ; B6BD 20 89 8C                  ..
LB6C0:  stz     $03FA                           ; B6C0 9C FA 03                 ...
LB6C3:  lda     #$00                            ; B6C3 A9 00                    ..
        bra     LB6D9                           ; B6C5 80 12                    ..
LB6C7:  ldx     #$0A                            ; B6C7 A2 0A                    ..
        jsr     LD230                           ; B6C9 20 30 D2                  0.
        ldx     #$0C                            ; B6CC A2 0C                    ..
        jsr     LD230                           ; B6CE 20 30 D2                  0.
LB6D1:  tax                                     ; B6D1 AA                       .
        beq     LB6D9                           ; B6D2 F0 05                    ..
        pha                                     ; B6D4 48                       H
        jsr     LBFBE                           ; B6D5 20 BE BF                  ..
        pla                                     ; B6D8 68                       h
LB6D9:  ply                                     ; B6D9 7A                       z
        plx                                     ; B6DA FA                       .
        cmp     #$00                            ; B6DB C9 00                    ..
        clc                                     ; B6DD 18                       .
        rts                                     ; B6DE 60                       `
; ----------------------------------------------------------------------------
LB6DF:  jsr     LBFF2                           ; B6DF 20 F2 BF                  ..
        jsr     LB688                           ; B6E2 20 88 B6                  ..
        beq     LB6DF                           ; B6E5 F0 F8                    ..
        rts                                     ; B6E7 60                       `
; ----------------------------------------------------------------------------
LB6E8:  lda     StopKeyFlag                     ; B6E8 A5 AD                    ..
        eor     #$01                            ; B6EA 49 01                    I.
        and     #$01                            ; B6EC 29 01                    ).
        bne     LB6F8                           ; B6EE D0 08                    ..
        php                                     ; B6F0 08                       .
        jsr     LFD2A                           ; B6F1 20 2A FD                  *.
        jsr     LB4FB                           ; B6F4 20 FB B4                  ..
        plp                                     ; B6F7 28                       (
LB6F8:  rts                                     ; B6F8 60                       `
; ----------------------------------------------------------------------------
LB6F9:  bcc     LB710                           ; B6F9 90 15                    ..
        sta     $03FD                           ; B6FB 8D FD 03                 ...
        txa                                     ; B6FE 8A                       .
        lsr     a                               ; B6FF 4A                       J
        clc                                     ; B700 18                       .
        cld                                     ; B701 D8                       .
        adc     VidMemHi                        ; B702 65 A0                    e.
        sta     $BE                             ; B704 85 BE                    ..
        txa                                     ; B706 8A                       .
LB707:  lsr     a                               ; B707 4A                       J
        tya                                     ; B708 98                       .
        bcc     LB70D                           ; B709 90 02                    ..
        ora     #$80                            ; B70B 09 80                    ..
LB70D:  sta     $BD                             ; B70D 85 BD                    ..
        rts                                     ; B70F 60                       `
; ----------------------------------------------------------------------------
LB710:  phx                                     ; B710 DA                       .
        phy                                     ; B711 5A                       Z
        .byte   $AE                             ; B712 AE                       .
        .byte   $FD                             ; B713 FD                       .
LB714:  .byte   $03                             ; B714 03                       .
        beq     LB754                           ; B715 F0 3D                    .=
        cpx     #$80                            ; B717 E0 80                    ..
        .byte   $F0                             ; B719 F0                       .
LB71A:  and     $0DC9,y                         ; B71A 39 C9 0D                 9..
        bne     LB729                           ; B71D D0 0A                    ..
LB71F:  lda     #$20                            ; B71F A9 20                    . 
LB721:  clc                                     ; B721 18                       .
        jsr     LB6F9                           ; B722 20 F9 B6                  ..
        bcc     LB71F                           ; B725 90 F8                    ..
        bra     LB754                           ; B727 80 2B                    .+
LB729:  cmp     #$12                            ; B729 C9 12                    ..
        bne     LB734                           ; B72B D0 07                    ..
        lda     #$80                            ; B72D A9 80                    ..
        tsb     $03FD                           ; B72F 0C FD 03                 ...
        bra     LB750                           ; B732 80 1C                    ..
LB734:  cmp     #$92                            ; B734 C9 92                    ..
        bne     LB73F                           ; B736 D0 07                    ..
        lda     #$80                            ; B738 A9 80                    ..
        trb     $03FD                           ; B73A 1C FD 03                 ...
        bra     LB750                           ; B73D 80 11                    ..
LB73F:  dec     $03FD                           ; B73F CE FD 03                 ...
        jsr     LB09B                           ; B742 20 9B B0                  ..
        bit     $03FD                           ; B745 2C FD 03                 ,..
        bpl     LB74C                           ; B748 10 02                    ..
        eor     #$80                            ; B74A 49 80                    I.
LB74C:  sta     ($BD)                           ; B74C 92 BD                    ..
        inc     $BD                             ; B74E E6 BD                    ..
LB750:  clc                                     ; B750 18                       .
        ply                                     ; B751 7A                       z
        plx                                     ; B752 FA                       .
        rts                                     ; B753 60                       `
; ----------------------------------------------------------------------------
LB754:  sec                                     ; B754 38                       8
        ply                                     ; B755 7A                       z
        plx                                     ; B756 FA                       .
        rts                                     ; B757 60                       `
; ----------------------------------------------------------------------------
LB758:  cpx     #$00                            ; B758 E0 00                    ..
        beq     LB760                           ; B75A F0 04                    ..
        sta     $B0                             ; B75C 85 B0                    ..
        stx     $B1                             ; B75E 86 B1                    ..
LB760:  .byte   $A0                             ; B760 A0                       .
LB761:  brk                                     ; B761 00                       .
        lda     ($B0),y                         ; B762 B1 B0                    ..
        tax                                     ; B764 AA                       .
        iny                                     ; B765 C8                       .
        lda     ($B0),y                         ; B766 B1 B0                    ..
        asl     a                               ; B768 0A                       .
        sta     $F6                             ; B769 85 F6                    ..
        txa                                     ; B76B 8A                       .
        lsr     a                               ; B76C 4A                       J
        tax                                     ; B76D AA                       .
        ror     $F6                             ; B76E 66 F6                    f.
        adc     VidMemHi                        ; B770 65 A0                    e.
        sta     $F7                             ; B772 85 F7                    ..
        iny                                     ; B774 C8                       .
        lda     ($B0),y                         ; B775 B1 B0                    ..
        sta     $03FE                           ; B777 8D FE 03                 ...
        iny                                     ; B77A C8                       .
        lda     ($B0),y                         ; B77B B1 B0                    ..
        sta     $03FF                           ; B77D 8D FF 03                 ...
LB780:  iny                                     ; B780 C8                       .
        lda     ($B0),y                         ; B781 B1 B0                    ..
        sta     $0400                           ; B783 8D 00 04                 ...
        ldx     #$00                            ; B786 A2 00                    ..
LB788:  lda     L0470,x                         ; B788 BD 70 04                 .p.
        beq     LB799                           ; B78B F0 0C                    ..
        cpx     $03FE                           ; B78D EC FE 03                 ...
        beq     LB795                           ; B790 F0 03                    ..
        inx                                     ; B792 E8                       .
        bne     LB788                           ; B793 D0 F3                    ..
LB795:  sec                                     ; B795 38                       8
        lda     #$00                            ; B796 A9 00                    ..
        rts                                     ; B798 60                       `
; ----------------------------------------------------------------------------
LB799:  stx     $0403                           ; B799 8E 03 04                 ...
        stx     $0402                           ; B79C 8E 02 04                 ...
        jsr     LB8B3                           ; B79F 20 B3 B8                  ..
        lda     $0400                           ; B7A2 AD 00 04                 ...
LB7A5:  and     #$02                            ; B7A5 29 02                    ).
LB7A7:  beq     LB7AB                           ; B7A7 F0 02                    ..
        clc                                     ; B7A9 18                       .
        rts                                     ; B7AA 60                       `
; ----------------------------------------------------------------------------
LB7AB:  jsr     LB903                           ; B7AB 20 03 B9                  ..
LB7AE:  jsr     LBFF2                           ; B7AE 20 F2 BF                  ..
        jsr     LB688                           ; B7B1 20 88 B6                  ..
        bne     LB7BE                           ; B7B4 D0 08                    ..
        lda     StopKeyFlag                     ; B7B6 A5 AD                    ..
        and     #$01                            ; B7B8 29 01                    ).
        beq     LB7AE                           ; B7BA F0 F2                    ..
        lda     #$03                            ; B7BC A9 03                    ..
LB7BE:  sta     $0401                           ; B7BE 8D 01 04                 ...
        ldy     #$05                            ; B7C1 A0 05                    ..
LB7C3:  lda     ($B0),y                         ; B7C3 B1 B0                    ..
        beq     LB7DE                           ; B7C5 F0 17                    ..
        cmp     $0401                           ; B7C7 CD 01 04                 ...
        beq     LB7CF                           ; B7CA F0 03                    ..
        iny                                     ; B7CC C8                       .
        .byte   $D0                             ; B7CD D0                       .
LB7CE:  .byte   $F4                             ; B7CE F4                       .
LB7CF:  pha                                     ; B7CF 48                       H
        jsr     LB8B3                           ; B7D0 20 B3 B8                  ..
        ldx     $0402                           ; B7D3 AE 02 04                 ...
        lda     #$00                            ; B7D6 A9 00                    ..
        sta     L0470,x                         ; B7D8 9D 70 04                 .p.
        pla                                     ; B7DB 68                       h
        clc                                     ; B7DC 18                       .
        rts                                     ; B7DD 60                       `
; ----------------------------------------------------------------------------
LB7DE:  tax                                     ; B7DE AA                       .
        lda     $0401                           ; B7DF AD 01 04                 ...
LB7E2:  cmp     LB7F4,x                         ; B7E2 DD F4 B7                 ...
        beq     LB7EE                           ; B7E5 F0 07                    ..
        inx                                     ; B7E7 E8                       .
        cpx     #$06                            ; B7E8 E0 06                    ..
        bne     LB7E2                           ; B7EA D0 F6                    ..
        beq     LB80C                           ; B7EC F0 1E                    ..
LB7EE:  jsr     LB806                           ; B7EE 20 06 B8                  ..
        jmp     LB7AB                           ; B7F1 4C AB B7                 L..
; ----------------------------------------------------------------------------
LB7F4:  sty     $14,x                           ; B7F4 94 14                    ..
        ora     L939D,x                         ; B7F6 1D 9D 93                 ...
        .byte   $8D                             ; B7F9 8D                       .
LB7FA:  eor     $B8                             ; B7FA 45 B8                    E.
        jmp     (L89B8)                         ; B7FC 6C B8 89                 l..
; ----------------------------------------------------------------------------
        clv                                     ; B7FF B8                       .
        smb1    $B8                             ; B800 97 B8                    ..
        ldx     #$B8                            ; B802 A2 B8                    ..
        .byte   $AD                             ; B804 AD                       .
        clv                                     ; B805 B8                       .
LB806:  txa                                     ; B806 8A                       .
        asl     a                               ; B807 0A                       .
        tax                                     ; B808 AA                       .
        jmp     (LB7FA,x)                       ; B809 7C FA B7                 |..
LB80C:  tax                                     ; B80C AA                       .
        and     #$7F                            ; B80D 29 7F                    ).
        cmp     #$20                            ; B80F C9 20                    . 
        bcc     LB7AE                           ; B811 90 9B                    ..
        txa                                     ; B813 8A                       .
        ldx     $0403                           ; B814 AE 03 04                 ...
        sta     L0470,x                         ; B817 9D 70 04                 .p.
        cpx     $0402                           ; B81A EC 02 04                 ...
        bne     LB82A                           ; B81D D0 0B                    ..
        ldx     $0402                           ; B81F AE 02 04                 ...
        cpx     $03FE                           ; B822 EC FE 03                 ...
        beq     LB82E                           ; B825 F0 07                    ..
        inc     $0402                           ; B827 EE 02 04                 ...
LB82A:  inx                                     ; B82A E8                       .
        stx     $0403                           ; B82B 8E 03 04                 ...
LB82E:  lda     $0400                           ; B82E AD 00 04                 ...
        and     #$01                            ; B831 29 01                    ).
        beq     LB83F                           ; B833 F0 0A                    ..
        cpx     $03FE                           ; B835 EC FE 03                 ...
        bne     LB83F                           ; B838 D0 05                    ..
        lda     #$00                            ; B83A A9 00                    ..
        jmp     LB7CF                           ; B83C 4C CF B7                 L..
; ----------------------------------------------------------------------------
LB83F:  jsr     LB8B3                           ; B83F 20 B3 B8                  ..
        jmp     LB7AB                           ; B842 4C AB B7                 L..
; ----------------------------------------------------------------------------
LB845:  ldx     $0402                           ; B845 AE 02 04                 ...
        cpx     $03FE                           ; B848 EC FE 03                 ...
        beq     LB869                           ; B84B F0 1C                    ..
        cpx     $0403                           ; B84D EC 03 04                 ...
        beq     LB869                           ; B850 F0 17                    ..
LB852:  lda     L0470,x                         ; B852 BD 70 04                 .p.
        sta     $0471,x                         ; B855 9D 71 04                 .q.
        cpx     $0403                           ; B858 EC 03 04                 ...
        beq     LB861                           ; B85B F0 04                    ..
        dex                                     ; B85D CA                       .
        jmp     LB852                           ; B85E 4C 52 B8                 LR.
; ----------------------------------------------------------------------------
LB861:  lda     #$20                            ; B861 A9 20                    . 
        sta     L0470,x                         ; B863 9D 70 04                 .p.
        inc     $0402                           ; B866 EE 02 04                 ...
LB869:  jmp     LB8B3                           ; B869 4C B3 B8                 L..
; ----------------------------------------------------------------------------
        ldx     $0403                           ; B86C AE 03 04                 ...
        beq     LB886                           ; B86F F0 15                    ..
        dec     $0403                           ; B871 CE 03 04                 ...
        dex                                     ; B874 CA                       .
LB875:  lda     $0471,x                         ; B875 BD 71 04                 .q.
        sta     L0470,x                         ; B878 9D 70 04                 .p.
        cpx     $0402                           ; B87B EC 02 04                 ...
        beq     LB883                           ; B87E F0 03                    ..
        inx                                     ; B880 E8                       .
        bne     LB875                           ; B881 D0 F2                    ..
LB883:  dec     $0402                           ; B883 CE 02 04                 ...
LB886:  jmp     LB8B3                           ; B886 4C B3 B8                 L..
; ----------------------------------------------------------------------------
        lda     $0403                           ; B889 AD 03 04                 ...
        cmp     $0402                           ; B88C CD 02 04                 ...
        beq     LB894                           ; B88F F0 03                    ..
        .byte   $EE                             ; B891 EE                       .
LB892:  .byte   $03                             ; B892 03                       .
        .byte   $04                             ; B893 04                       .
LB894:  jmp     LB8B3                           ; B894 4C B3 B8                 L..
; ----------------------------------------------------------------------------
        lda     $0403                           ; B897 AD 03 04                 ...
        beq     LB89F                           ; B89A F0 03                    ..
        dec     $0403                           ; B89C CE 03 04                 ...
LB89F:  jmp     LB8B3                           ; B89F 4C B3 B8                 L..
; ----------------------------------------------------------------------------
        lda     #$00                            ; B8A2 A9 00                    ..
LB8A4:  .byte   $8D                             ; B8A4 8D                       .
LB8A5:  .byte   $02                             ; B8A5 02                       .
        tsb     $8D                             ; B8A6 04 8D                    ..
LB8A8:  .byte   $03                             ; B8A8 03                       .
        tsb     $4C                             ; B8A9 04 4C                    .L
        .byte   $B3                             ; B8AB B3                       .
        clv                                     ; B8AC B8                       .
LB8AD:  lda     $0403                           ; B8AD AD 03 04                 ...
        jmp     LB8A4                           ; B8B0 4C A4 B8                 L..
; ----------------------------------------------------------------------------
LB8B3:  .byte   $20                             ; B8B3 20                        
LB8B4:  cpx     $B2                             ; B8B4 E4 B2                    ..
        ldy     #$00                            ; B8B6 A0 00                    ..
        ldx     #$00                            ; B8B8 A2 00                    ..
        lda     $0403                           ; B8BA AD 03 04                 ...
        sec                                     ; B8BD 38                       8
        sbc     $03FF                           ; B8BE ED FF 03                 ...
        .byte   $90                             ; B8C1 90                       .
LB8C2:  php                                     ; B8C2 08                       .
        tax                                     ; B8C3 AA                       .
        lda     $03FF                           ; B8C4 AD FF 03                 ...
        sbc     #$01                            ; B8C7 E9 01                    ..
        bne     LB8CE                           ; B8C9 D0 03                    ..
LB8CB:  lda     $0403                           ; B8CB AD 03 04                 ...
LB8CE:  sta     $0404                           ; B8CE 8D 04 04                 ...
LB8D1:  .byte   $EC                             ; B8D1 EC                       .
LB8D2:  .byte   $02                             ; B8D2 02                       .
        tsb     $F0                             ; B8D3 04 F0                    ..
        ora     $70BD,x                         ; B8D5 1D BD 70                 ..p
        tsb     $DA                             ; B8D8 04 DA                    ..
        jsr     LB09B                           ; B8DA 20 9B B0                  ..
        plx                                     ; B8DD FA                       .
        sta     $0401                           ; B8DE 8D 01 04                 ...
        lda     $0400                           ; B8E1 AD 00 04                 ...
        and     #$80                            ; B8E4 29 80                    ).
        ora     $0401                           ; B8E6 0D 01 04                 ...
LB8E9:  sta     ($F6),y                         ; B8E9 91 F6                    ..
        inx                                     ; B8EB E8                       .
        iny                                     ; B8EC C8                       .
        cpy     $03FF                           ; B8ED CC FF 03                 ...
        bne     LB8D1                           ; B8F0 D0 DF                    ..
        rts                                     ; B8F2 60                       `
; ----------------------------------------------------------------------------
LB8F3:  lda     $0400                           ; B8F3 AD 00 04                 ...
        and     #$80                            ; B8F6 29 80                    ).
        ora     #$20                            ; B8F8 09 20                    . 
LB8FA:  sta     ($F6),y                         ; B8FA 91 F6                    ..
        iny                                     ; B8FC C8                       .
        cpy     $03FF                           ; B8FD CC FF 03                 ...
        .byte   $D0                             ; B900 D0                       .
LB901:  sed                                     ; B901 F8                       .
        rts                                     ; B902 60                       `
; ----------------------------------------------------------------------------
LB903:  ldy     #$00                            ; B903 A0 00                    ..
        lda     ($B0),y                         ; B905 B1 B0                    ..
        tax                                     ; B907 AA                       .
        iny                                     ; B908 C8                       .
        lda     ($B0),y                         ; B909 B1 B0                    ..
        clc                                     ; B90B 18                       .
        .byte   $6D                             ; B90C 6D                       m
        .byte   $04                             ; B90D 04                       .
LB90E:  tsb     $A8                             ; B90E 04 A8                    ..
        clc                                     ; B910 18                       .
        jsr     PLOT_                           ; B911 20 01 FE                  ..
        jsr     LB2D6                           ; B914 20 D6 B2                  ..
        rts                                     ; B917 60                       `
; ----------------------------------------------------------------------------
LB918:  lda     $0385                           ; B918 AD 85 03                 ...
        and     #$1F                            ; B91B 29 1F                    ).
        bne     CHRIN__                         ; B91D D0 06                    ..
        .byte   $4C                             ; B91F 4C                       L
LB920:  dey                                     ; B920 88                       .
        .byte   $B6                             ; B921 B6                       .
LB922:  ply                                     ; B922 7A                       z
        plx                                     ; B923 FA                       .
LB924:  rts                                     ; B924 60                       `
; ----------------------------------------------------------------------------
CHRIN__:phx                                     ; B925 DA                       .
        phy                                     ; B926 5A                       Z
        lda     #$B9                            ; B927 A9 B9                    ..
        pha                                     ; B929 48                       H
        lda     #$21                            ; B92A A9 21                    .!
        pha                                     ; B92C 48                       H
        lda     $0385                           ; B92D AD 85 03                 ...
        and     #$1F                            ; B930 29 1F                    ).
        bne     LB937                           ; B932 D0 03                    ..
        jmp     LB325                           ; B934 4C 25 B3                 L%.
; ----------------------------------------------------------------------------
LB937:  cmp     #$02                            ; B937 C9 02                    ..
        bne     LB948                           ; B939 D0 0D                    ..
        .byte   $20                             ; B93B 20                        
LB93C:  asl     $48BF,x                         ; B93C 1E BF 48                 ..H
        lda     LFS2ndAddr                      ; B93F A5 C4                    ..
        and     #$0F                            ; B941 29 0F                    ).
        tax                                     ; B943 AA                       .
        pla                                     ; B944 68                       h
        jmp     LC3CB                           ; B945 4C CB C3                 L..
; ----------------------------------------------------------------------------
LB948:  bcs     LB94D                           ; B948 B0 03                    ..
        jmp     L8B3A                           ; B94A 4C 3A 8B                 L:.
; ----------------------------------------------------------------------------
LB94D:  cmp     #$03                            ; B94D C9 03                    ..
        .byte   $D0                             ; B94F D0                       .
LB950:  .byte   $03                             ; B950 03                       .
        .byte   $4C                             ; B951 4C                       L
LB952:  .byte   $19                             ; B952 19                       .
        .byte   $B3                             ; B953 B3                       .
LB954:  cmp     #$1E                            ; B954 C9 1E                    ..
        bne     LB95B                           ; B956 D0 03                    ..
        jmp     LBC5F                           ; B958 4C 5F BC                 L_.
; ----------------------------------------------------------------------------
LB95B:  bcc     LB960                           ; B95B 90 03                    ..
        jmp     LC2AD                           ; B95D 4C AD C2                 L..
; ----------------------------------------------------------------------------
LB960:  lda     ST                              ; B960 A5 BA                    ..
        bne     LB968                           ; B962 D0 04                    ..
        sec                                     ; B964 38                       8
        jmp     IECIN__                         ; B965 4C A5 BD                 L..
; ----------------------------------------------------------------------------
LB968:  lda     #$0D                            ; B968 A9 0D                    ..
        clc                                     ; B96A 18                       .
        rts                                     ; B96B 60                       `
; ----------------------------------------------------------------------------
CHROUT__:
        phx                                     ; B96C DA                       .
        phy                                     ; B96D 5A                       Z
        ldx     #$B9                            ; B96E A2 B9                    ..
        phx                                     ; B970 DA                       .
        ldx     #$21                            ; B971 A2 21                    .!
        phx                                     ; B973 DA                       .
LB974:  pha                                     ; B974 48                       H
        lda     L0386                           ; B975 AD 86 03                 ...
        and     #$1F                            ; B978 29 1F                    ).
        tax                                     ; B97A AA                       .
        pla                                     ; B97B 68                       h
LB97D           := * + 1
        cpx     #$01                            ; B97C E0 01                    ..
        bne     LB983                           ; B97E D0 03                    ..
        jmp     L8BAA                           ; B980 4C AA 8B                 L..
; ----------------------------------------------------------------------------
LB983:  bcs     LB988                           ; B983 B0 03                    ..
LB985:  jmp     ShowChar_                       ; B985 4C B3 AB                 L..
; ----------------------------------------------------------------------------
LB988:  cpx     #$03                            ; B988 E0 03                    ..
        beq     LB985                           ; B98A F0 F9                    ..
        bcs     LB994                           ; B98C B0 06                    ..
        jsr     LB9B0                           ; B98E 20 B0 B9                  ..
        jmp     LBF0C                           ; B991 4C 0C BF                 L..
; ----------------------------------------------------------------------------
LB994:  cpx     #$1E                            ; B994 E0 1E                    ..
        bne     LB9A7                           ; B996 D0 0F                    ..
        ldx     LFS2ndAddr                      ; B998 A6 C4                    ..
        pha                                     ; B99A 48                       H
        lda     LFS2ndAddr                      ; B99B A5 C4                    ..
        and     #$0F                            ; B99D 29 0F                    ).
        tax                                     ; B99F AA                       .
        pla                                     ; B9A0 68                       h
        jsr     LB9B0                           ; B9A1 20 B0 B9                  ..
        jmp     LC38C                           ; B9A4 4C 8C C3                 L..
; ----------------------------------------------------------------------------
LB9A7:  bcc     LB9AC                           ; B9A7 90 03                    ..
        jmp     LC271                           ; B9A9 4C 71 C2                 Lq.
; ----------------------------------------------------------------------------
LB9AC:  sec                                     ; B9AC 38                       8
        jmp     IECOUT__                        ; B9AD 4C 6C BD                 Ll.
; ----------------------------------------------------------------------------
LB9B0:  pha                                     ; B9B0 48                       H
LB9B1:  lda     LFS2ndAddr                      ; B9B1 A5 C4                    ..
        and     #$0F                            ; B9B3 29 0F                    ).
        tax                                     ; B9B5 AA                       .
        pla                                     ; B9B6 68                       h
        jmp     LC3D1                           ; B9B7 4C D1 C3                 L..
; ----------------------------------------------------------------------------
CHKIN__:jsr     LBAB5                           ; B9BA 20 B5 BA                  ..
        beq     LB9C2                           ; B9BD F0 03                    ..
        jmp     LBC56                           ; B9BF 4C 56 BC                 LV.
; ----------------------------------------------------------------------------
LB9C2:  jsr     LBAC4                           ; B9C2 20 C4 BA                  ..
        beq     LB9DC                           ; B9C5 F0 15                    ..
        cmp     #$1E                            ; B9C7 C9 1E                    ..
        bcs     LB9DC                           ; B9C9 B0 11                    ..
        cmp     #$01                            ; B9CB C9 01                    ..
        beq     LB9FE                           ; B9CD F0 2F                    ./
        cmp     #$03                            ; B9CF C9 03                    ..
        beq     LB9DC                           ; B9D1 F0 09                    ..
        bcs     LB9E1                           ; B9D3 B0 0C                    ..
        jsr     LBF4D                           ; B9D5 20 4D BF                  M.
        bcs     LB9E0                           ; B9D8 B0 06                    ..
        lda     LFSDevNum                       ; B9DA A5 C5                    ..
LB9DC:  sta     $0385                           ; B9DC 8D 85 03                 ...
        clc                                     ; B9DF 18                       .
LB9E0:  rts                                     ; B9E0 60                       `
; ----------------------------------------------------------------------------
LB9E1:  tax                                     ; B9E1 AA                       .
        jsr     SendTalk                        ; B9E2 20 91 BC                  ..
        bit     ST                              ; B9E5 24 BA                    $.
        bmi     LB9FB                           ; B9E7 30 12                    0.
        lda     LFS2ndAddr                      ; B9E9 A5 C4                    ..
        bpl     LB9F3                           ; B9EB 10 06                    ..
        jsr     LBD5B                           ; B9ED 20 5B BD                  [.
        jmp     LB9F6                           ; B9F0 4C F6 B9                 L..
; ----------------------------------------------------------------------------
LB9F3:  jsr     TALKSA__                        ; B9F3 20 55 BD                  U.
LB9F6:  txa                                     ; B9F6 8A                       .
        bit     ST                              ; B9F7 24 BA                    $.
        bpl     LB9DC                           ; B9F9 10 E1                    ..
LB9FB:  jmp     LBC5C                           ; B9FB 4C 5C BC                 L\.
; ----------------------------------------------------------------------------
LB9FE:  jsr     L9962                           ; B9FE 20 62 99                  b.
        bcc     LB9DC                           ; BA01 90 D9                    ..
        bra     LB9FB                           ; BA03 80 F6                    ..
CHKOUT__:
        jsr     LBAB5                           ; BA05 20 B5 BA                  ..
        beq     LBA0D                           ; BA08 F0 03                    ..
        jmp     LBC56                           ; BA0A 4C 56 BC                 LV.
; ----------------------------------------------------------------------------
LBA0D:  jsr     LBAC4                           ; BA0D 20 C4 BA                  ..
        bne     LBA15                           ; BA10 D0 03                    ..
        jmp     LBC62                           ; BA12 4C 62 BC                 Lb.
; ----------------------------------------------------------------------------
LBA15:  cmp     #$1E                            ; BA15 C9 1E                    ..
        bcs     LBA32                           ; BA17 B0 19                    ..
        cmp     #$02                            ; BA19 C9 02                    ..
        beq     LBA2B                           ; BA1B F0 0E                    ..
        bcs     LBA25                           ; BA1D B0 06                    ..
        jsr     L9962                           ; BA1F 20 62 99                  b.
        bcc     LBA32                           ; BA22 90 0E                    ..
        rts                                     ; BA24 60                       `
; ----------------------------------------------------------------------------
LBA25:  cmp     #$03                            ; BA25 C9 03                    ..
        beq     LBA32                           ; BA27 F0 09                    ..
        bne     LBA37                           ; BA29 D0 0C                    ..
LBA2B:  jsr     LBF4D                           ; BA2B 20 4D BF                  M.
        bcs     LBA36                           ; BA2E B0 06                    ..
        lda     LFSDevNum                       ; BA30 A5 C5                    ..
LBA32:  sta     L0386                           ; BA32 8D 86 03                 ...
        clc                                     ; BA35 18                       .
LBA36:  rts                                     ; BA36 60                       `
; ----------------------------------------------------------------------------
LBA37:  tax                                     ; BA37 AA                       .
        jsr     LISTEN__                        ; BA38 20 94 BC                  ..
        bit     ST                              ; BA3B 24 BA                    $.
        bmi     LBA50                           ; BA3D 30 11                    0.
        lda     LFS2ndAddr                      ; BA3F A5 C4                    ..
        bpl     LBA48                           ; BA41 10 05                    ..
        jsr     PORT1B_RESET_BIT3               ; BA43 20 4C BD                  L.
        bne     LBA4B                           ; BA46 D0 03                    ..
LBA48:  jsr     LSTNSA__                        ; BA48 20 46 BD                  F.
LBA4B:  txa                                     ; BA4B 8A                       .
        bit     ST                              ; BA4C 24 BA                    $.
        bpl     LBA32                           ; BA4E 10 E2                    ..
LBA50:  jmp     LBC5C                           ; BA50 4C 5C BC                 L\.
; ----------------------------------------------------------------------------
CLOSE__:ror     $0407                           ; BA53 6E 07 04                 n..
        jsr     LBAB8                           ; BA56 20 B8 BA                  ..
        beq     LBA5D                           ; BA59 F0 02                    ..
        clc                                     ; BA5B 18                       .
        rts                                     ; BA5C 60                       `
; ----------------------------------------------------------------------------
LBA5D:  jsr     LBAC4                           ; BA5D 20 C4 BA                  ..
        txa                                     ; BA60 8A                       .
        pha                                     ; BA61 48                       H
        lda     LFSDevNum                       ; BA62 A5 C5                    ..
        beq     LBA94                           ; BA64 F0 2E                    ..
        cmp     #$1E                            ; BA66 C9 1E                    ..
        bcs     LBA94                           ; BA68 B0 2A                    .*
        cmp     #$03                            ; BA6A C9 03                    ..
        beq     LBA94                           ; BA6C F0 26                    .&
        bcs     LBA7E                           ; BA6E B0 0E                    ..
        cmp     #$02                            ; BA70 C9 02                    ..
        bne     LBA79                           ; BA72 D0 05                    ..
        jsr     LC0E8                           ; BA74 20 E8 C0                  ..
        bra     LBA94                           ; BA77 80 1B                    ..
LBA79:  jsr     L9214                           ; BA79 20 14 92                  ..
        bra     LBA94                           ; BA7C 80 16                    ..
LBA7E:  bit     $0407                           ; BA7E 2C 07 04                 ,..
        bpl     LBA91                           ; BA81 10 0E                    ..
        lda     LFSDevNum                       ; BA83 A5 C5                    ..
        cmp     #$08                            ; BA85 C9 08                    ..
        bcc     LBA91                           ; BA87 90 08                    ..
        lda     LFS2ndAddr                      ; BA89 A5 C4                    ..
        and     #$0F                            ; BA8B 29 0F                    ).
        cmp     #$0F                            ; BA8D C9 0F                    ..
        beq     LBA94                           ; BA8F F0 03                    ..
LBA91:  jsr     LBC36                           ; BA91 20 36 BC                  6.
LBA94:  pla                                     ; BA94 68                       h
        tax                                     ; BA95 AA                       .
        dec     $0405                           ; BA96 CE 05 04                 ...
        cpx     $0405                           ; BA99 EC 05 04                 ...
        beq     LBAB3                           ; BA9C F0 15                    ..
        ldy     $0405                           ; BA9E AC 05 04                 ...
        lda     $02DB,y                         ; BAA1 B9 DB 02                 ...
        sta     $02DB,x                         ; BAA4 9D DB 02                 ...
        lda     $02E7,y                         ; BAA7 B9 E7 02                 ...
        sta     $02E7,x                         ; BAAA 9D E7 02                 ...
        lda     $02F3,y                         ; BAAD B9 F3 02                 ...
        sta     $02F3,x                         ; BAB0 9D F3 02                 ...
LBAB3:  clc                                     ; BAB3 18                       .
        rts                                     ; BAB4 60                       `
; ----------------------------------------------------------------------------
LBAB5:  stz     ST                              ; BAB5 64 BA                    d.
        txa                                     ; BAB7 8A                       .
LBAB8:  ldx     $0405                           ; BAB8 AE 05 04                 ...
LBABB:  dex                                     ; BABB CA                       .
        bmi     LBAD3                           ; BABC 30 15                    0.
        cmp     $02DB,x                         ; BABE DD DB 02                 ...
        bne     LBABB                           ; BAC1 D0 F8                    ..
        rts                                     ; BAC3 60                       `
; ----------------------------------------------------------------------------
LBAC4:  lda     $02DB,x                         ; BAC4 BD DB 02                 ...
        sta     LFSLogNum                       ; BAC7 85 C6                    ..
        lda     $02F3,x                         ; BAC9 BD F3 02                 ...
        sta     LFS2ndAddr                      ; BACC 85 C4                    ..
        lda     $02E7,x                         ; BACE BD E7 02                 ...
        sta     LFSDevNum                       ; BAD1 85 C5                    ..
LBAD3:  rts                                     ; BAD3 60                       `
; ----------------------------------------------------------------------------
LBAD4:  stz     $0405                           ; BAD4 9C 05 04                 ...
CLRCHN__:
        ldx     #$03                            ; BAD7 A2 03                    ..
        cpx     L0386                           ; BAD9 EC 86 03                 ...
        bcs     LBAE1                           ; BADC B0 03                    ..
        jsr     UNLSTN__                        ; BADE 20 90 BD                  ..
LBAE1:  cpx     $0385                           ; BAE1 EC 85 03                 ...
        bcs     LBAE9                           ; BAE4 B0 03                    ..
        jsr     UNTALK__                        ; BAE6 20 81 BD                  ..
LBAE9:  stx     L0386                           ; BAE9 8E 86 03                 ...
        stz     $0385                           ; BAEC 9C 85 03                 ...
        rts                                     ; BAEF 60                       `
; ----------------------------------------------------------------------------
Open__: ldx     LFSLogNum                       ; BAF0 A6 C6                    ..
        jsr     LBAB5                           ; BAF2 20 B5 BA                  ..
        bne     LBAFA                           ; BAF5 D0 03                    ..
        jmp     LBC53                           ; BAF7 4C 53 BC                 LS.
; ----------------------------------------------------------------------------
LBAFA:  ldx     $0405                           ; BAFA AE 05 04                 ...
        cpx     #$0C                            ; BAFD E0 0C                    ..
        bcc     LBB04                           ; BAFF 90 03                    ..
        jmp     LBC50                           ; BB01 4C 50 BC                 LP.
; ----------------------------------------------------------------------------
LBB04:  inc     $0405                           ; BB04 EE 05 04                 ...
        lda     LFSLogNum                       ; BB07 A5 C6                    ..
        sta     $02DB,x                         ; BB09 9D DB 02                 ...
        lda     LFS2ndAddr                      ; BB0C A5 C4                    ..
        ora     #$60                            ; BB0E 09 60                    .`
        sta     LFS2ndAddr                      ; BB10 85 C4                    ..
        sta     $02F3,x                         ; BB12 9D F3 02                 ...
        lda     LFSDevNum                       ; BB15 A5 C5                    ..
        sta     $02E7,x                         ; BB17 9D E7 02                 ...
        beq     LBB2F                           ; BB1A F0 13                    ..
        cmp     #$1E                            ; BB1C C9 1E                    ..
        beq     LBB2F                           ; BB1E F0 0F                    ..
        bcc     LBB25                           ; BB20 90 03                    ..
        jmp     LC219                           ; BB22 4C 19 C2                 L..
; ----------------------------------------------------------------------------
LBB25:  cmp     #$03                            ; BB25 C9 03                    ..
        beq     LBB2F                           ; BB27 F0 06                    ..
        bcc     LBB31                           ; BB29 90 06                    ..
        sec                                     ; BB2B 38                       8
        jsr     LBB40                           ; BB2C 20 40 BB                  @.
LBB2F:  clc                                     ; BB2F 18                       .
        rts                                     ; BB30 60                       `
; ----------------------------------------------------------------------------
LBB31:  cmp     #$02                            ; BB31 C9 02                    ..
        bne     LBB3B                           ; BB33 D0 06                    ..
        jsr     LBE52                           ; BB35 20 52 BE                  R.
        jmp     LC082                           ; BB38 4C 82 C0                 L..
; ----------------------------------------------------------------------------
LBB3B:  jmp     L9243                           ; BB3B 4C 43 92                 LC.
; ----------------------------------------------------------------------------
LBB3E:  clc                                     ; BB3E 18                       .
        rts                                     ; BB3F 60                       `
; ----------------------------------------------------------------------------
LBB40:  lda     LFS2ndAddr                      ; BB40 A5 C4                    ..
        bmi     LBB3E                           ; BB42 30 FA                    0.
        ldy     FNlength                        ; BB44 AC 87 03                 ...
        beq     LBB3E                           ; BB47 F0 F5                    ..
        stz     ST                              ; BB49 64 BA                    d.
        lda     LFSDevNum                       ; BB4B A5 C5                    ..
        jsr     LISTEN__                        ; BB4D 20 94 BC                  ..
        bit     ST                              ; BB50 24 BA                    $.
        bmi     LBB5F                           ; BB52 30 0B                    0.
        lda     LFS2ndAddr                      ; BB54 A5 C4                    ..
        ora     #$F0                            ; BB56 09 F0                    ..
        jsr     LSTNSA__                        ; BB58 20 46 BD                  F.
        lda     ST                              ; BB5B A5 BA                    ..
        bpl     LBB64                           ; BB5D 10 05                    ..
LBB5F:  pla                                     ; BB5F 68                       h
        pla                                     ; BB60 68                       h
        jmp     LBC5C                           ; BB61 4C 5C BC                 L\.
; ----------------------------------------------------------------------------
LBB64:  lda     FNlength                        ; BB64 AD 87 03                 ...
        beq     LBB7C                           ; BB67 F0 13                    ..
        ldy     #$00                            ; BB69 A0 00                    ..
LBB6B:  lda     #$AE                            ; BB6B A9 AE                    ..
        sta     $034E                           ; BB6D 8D 4E 03                 .N.
        jsr     FROM_C67B                       ; BB70 20 4A 03                  J.
        jsr     IECOUT__                        ; BB73 20 6C BD                  l.
        iny                                     ; BB76 C8                       .
        cpy     FNlength                        ; BB77 CC 87 03                 ...
        bne     LBB6B                           ; BB7A D0 EF                    ..
LBB7C:  jmp     LBC48                           ; BB7C 4C 48 BC                 LH.
; ----------------------------------------------------------------------------
; Maybe typo? :) Or it's only my English ... "SAVEING" ...
LBB7F:  jsr     ShowInLineText80                ; BB7F 20 56 FB                  V.
        .byte   "SAVEING "                      ; BB82 53 41 56 45 49 4E 47 20  SAVEING 
        .byte   $00                             ; BB8A 00                       .
; ----------------------------------------------------------------------------
        bra     LBB9F                           ; BB8B 80 12                    ..
LBB8D:  jsr     ShowInLineText80                ; BB8D 20 56 FB                  V.
        .byte   "SEARCHING FOR "                ; BB90 53 45 41 52 43 48 49 4E  SEARCHIN
                                                ; BB98 47 20 46 4F 52 20        G FOR 
        .byte   $00                             ; BB9E 00                       .
; ----------------------------------------------------------------------------
LBB9F:  bit     KernMsg                         ; BB9F 2C 83 03                 ,..
        bpl     LBBBF                           ; BBA2 10 1B                    ..
        ldy     FNlength                        ; BBA4 AC 87 03                 ...
        beq     LBBBC                           ; BBA7 F0 13                    ..
        ldy     #$00                            ; BBA9 A0 00                    ..
LBBAB:  lda     #$AE                            ; BBAB A9 AE                    ..
        sta     $034E                           ; BBAD 8D 4E 03                 .N.
        jsr     FROM_C67B                       ; BBB0 20 4A 03                  J.
        jsr     ShowChar_                       ; BBB3 20 B3 AB                  ..
        iny                                     ; BBB6 C8                       .
        cpy     FNlength                        ; BBB7 CC 87 03                 ...
        bne     LBBAB                           ; BBBA D0 EF                    ..
LBBBC:  jmp     PrintNewLine                    ; BBBC 4C D3 CA                 L..
; ----------------------------------------------------------------------------
LBBBF:  rts                                     ; BBBF 60                       `
; ----------------------------------------------------------------------------
LBBC0:  lda     LFSDevNum                       ; BBC0 A5 C5                    ..
        bne     LBBC7                           ; BBC2 D0 03                    ..
LBBC4:  jmp     LBC68                           ; BBC4 4C 68 BC                 Lh.
; ----------------------------------------------------------------------------
LBBC7:  cmp     #$03                            ; BBC7 C9 03                    ..
        beq     LBBC4                           ; BBC9 F0 F9                    ..
        cmp     #$02                            ; BBCB C9 02                    ..
        beq     LBBC4                           ; BBCD F0 F5                    ..
        ldy     FNlength                        ; BBCF AC 87 03                 ...
        bne     LBBD7                           ; BBD2 D0 03                    ..
        jmp     LBC65                           ; BBD4 4C 65 BC                 Le.
; ----------------------------------------------------------------------------
LBBD7:  cmp     #$01                            ; BBD7 C9 01                    ..
        bne     LBBE1                           ; BBD9 D0 06                    ..
        jsr     LBB7F                           ; BBDB 20 7F BB                  ..
        jmp     L9085                           ; BBDE 4C 85 90                 L..
; ----------------------------------------------------------------------------
LBBE1:  lda     #$61                            ; BBE1 A9 61                    .a
        sta     LFS2ndAddr                      ; BBE3 85 C4                    ..
        jsr     LBB40                           ; BBE5 20 40 BB                  @.
        jsr     LBB7F                           ; BBE8 20 7F BB                  ..
        lda     LFSDevNum                       ; BBEB A5 C5                    ..
        jsr     LISTEN__                        ; BBED 20 94 BC                  ..
        lda     LFS2ndAddr                      ; BBF0 A5 C4                    ..
        jsr     LSTNSA__                        ; BBF2 20 46 BD                  F.
        ldy     #$00                            ; BBF5 A0 00                    ..
        lda     $B7                             ; BBF7 A5 B7                    ..
        sta     $B9                             ; BBF9 85 B9                    ..
        lda     $B6                             ; BBFB A5 B6                    ..
        sta     $B8                             ; BBFD 85 B8                    ..
        lda     $B8                             ; BBFF A5 B8                    ..
        jsr     IECOUT__                        ; BC01 20 6C BD                  l.
        lda     $B9                             ; BC04 A5 B9                    ..
        jsr     IECOUT__                        ; BC06 20 6C BD                  l.
LBC09:  sec                                     ; BC09 38                       8
        lda     $B8                             ; BC0A A5 B8                    ..
        sbc     $B2                             ; BC0C E5 B2                    ..
        lda     $B9                             ; BC0E A5 B9                    ..
        sbc     $B3                             ; BC10 E5 B3                    ..
        bcs     LBC33                           ; BC12 B0 1F                    ..
        lda     #$B8                            ; BC14 A9 B8                    ..
        sta     $034E                           ; BC16 8D 4E 03                 .N.
        jsr     FROM_C67B                       ; BC19 20 4A 03                  J.
        jsr     IECOUT__                        ; BC1C 20 6C BD                  l.
        jsr     LFDB9                           ; BC1F 20 B9 FD                  ..
        bne     LBC2B                           ; BC22 D0 07                    ..
        jsr     LBC36                           ; BC24 20 36 BC                  6.
        lda     #$00                            ; BC27 A9 00                    ..
        sec                                     ; BC29 38                       8
        rts                                     ; BC2A 60                       `
; ----------------------------------------------------------------------------
LBC2B:  inc     $B8                             ; BC2B E6 B8                    ..
        bne     LBC09                           ; BC2D D0 DA                    ..
        inc     $B9                             ; BC2F E6 B9                    ..
        bne     LBC09                           ; BC31 D0 D6                    ..
LBC33:  jsr     UNLSTN__                        ; BC33 20 90 BD                  ..
LBC36:  bit     LFS2ndAddr                      ; BC36 24 C4                    $.
        bmi     LBC4B                           ; BC38 30 11                    0.
        lda     LFSDevNum                       ; BC3A A5 C5                    ..
        jsr     LISTEN__                        ; BC3C 20 94 BC                  ..
        lda     LFS2ndAddr                      ; BC3F A5 C4                    ..
        and     #$EF                            ; BC41 29 EF                    ).
        ora     #$E0                            ; BC43 09 E0                    ..
        jsr     LSTNSA__                        ; BC45 20 46 BD                  F.
LBC48:  jsr     UNLSTN__                        ; BC48 20 90 BD                  ..
LBC4B:  clc                                     ; BC4B 18                       .
        rts                                     ; BC4C 60                       `
; ----------------------------------------------------------------------------
LBC4D:  lda     #$00                            ; BC4D A9 00                    ..
        .byte   $2C                             ; BC4F 2C                       ,
LBC50:  lda     #$01                            ; BC50 A9 01                    ..
        .byte   $2C                             ; BC52 2C                       ,
LBC53:  lda     #$02                            ; BC53 A9 02                    ..
        .byte   $2C                             ; BC55 2C                       ,
LBC56:  lda     #$03                            ; BC56 A9 03                    ..
        .byte   $2C                             ; BC58 2C                       ,
LBC59:  lda     #$04                            ; BC59 A9 04                    ..
        .byte   $2C                             ; BC5B 2C                       ,
LBC5C:  lda     #$05                            ; BC5C A9 05                    ..
        .byte   $2C                             ; BC5E 2C                       ,
LBC5F:  lda     #$06                            ; BC5F A9 06                    ..
        .byte   $2C                             ; BC61 2C                       ,
LBC62:  lda     #$07                            ; BC62 A9 07                    ..
        .byte   $2C                             ; BC64 2C                       ,
LBC65:  lda     #$08                            ; BC65 A9 08                    ..
        .byte   $2C                             ; BC67 2C                       ,
LBC68:  lda     #$09                            ; BC68 A9 09                    ..
        .byte   $2C                             ; BC6A 2C                       ,
LBC6B:  lda     #$0A                            ; BC6B A9 0A                    ..
        pha                                     ; BC6D 48                       H
        jsr     LFD2A                           ; BC6E 20 2A FD                  *.
        bit     KernMsg                         ; BC71 2C 83 03                 ,..
        bvc     LBC8E                           ; BC74 50 18                    P.
        jsr     ShowInLineText                  ; BC76 20 5B FB                  [.
        .byte   $0D                             ; BC79 0D                       .
        .byte   "I/O ERROR #"                   ; BC7A 49 2F 4F 20 45 52 52 4F  I/O ERRO
                                                ; BC82 52 20 23                 R #
        .byte   $00                             ; BC85 00                       .
; ----------------------------------------------------------------------------
        pla                                     ; BC86 68                       h
        pha                                     ; BC87 48                       H
        jsr     L8850                           ; BC88 20 50 88                  P.
        jsr     PrintNewLine                    ; BC8B 20 D3 CA                  ..
LBC8E:  pla                                     ; BC8E 68                       h
        sec                                     ; BC8F 38                       8
        rts                                     ; BC90 60                       `
; ----------------------------------------------------------------------------
SendTalk:
        ora     #$40                            ; BC91 09 40                    .@
        .byte   $2C                             ; BC93 2C                       ,
LISTEN__:
        ora     #$20                            ; BC94 09 20                    . 
; This routine seems to be used to send out a byte on the IEC bus.
LBC96:  pha                                     ; BC96 48                       H
        bit     $040B                           ; BC97 2C 0B 04                 ,..
        bpl     LBCA9                           ; BC9A 10 0D                    ..
        sec                                     ; BC9C 38                       8
        ror     $040A                           ; BC9D 6E 0A 04                 n..
        jsr     LBCCA                           ; BCA0 20 CA BC                  ..
        lsr     $040B                           ; BCA3 4E 0B 04                 N..
        lsr     $040A                           ; BCA6 4E 0A 04                 N..
LBCA9:  pla                                     ; BCA9 68                       h
        sta     $0408                           ; BCAA 8D 08 04                 ...
        sei                                     ; BCAD 78                       x
        jsr     PORT1B_RESET_BIT5               ; BCAE 20 2C BE                  ,.
        cmp     #$3F                            ; BCB1 C9 3F                    .?
        bne     LBCB8                           ; BCB3 D0 03                    ..
        jsr     PORT1B_RESET_BIT4               ; BCB5 20 1A BE                  ..
LBCB8:  lda     VIA1_PORTB                      ; BCB8 AD 00 F8                 ...
        ora     #$08                            ; BCBB 09 08                    ..
        sta     VIA1_PORTB                      ; BCBD 8D 00 F8                 ...
LBCC0:  sei                                     ; BCC0 78                       x
        jsr     PORT1B_SET_BIT4                 ; BCC1 20 23 BE                  #.
        jsr     PORT1B_RESET_BIT5               ; BCC4 20 2C BE                  ,.
        jsr     LBE4A                           ; BCC7 20 4A BE                  J.
LBCCA:  sei                                     ; BCCA 78                       x
        jsr     PORT1B_RESET_BIT5               ; BCCB 20 2C BE                  ,.
        jsr     PORT1B_WAIT_CHANGE              ; BCCE 20 3E BE                  >.
        bcs     LBD3A                           ; BCD1 B0 67                    .g
        jsr     PORT1B_RESET_BIT4               ; BCD3 20 1A BE                  ..
        bit     VIA1_PORTB                      ; BCD6 2C 00 F8                 ,..
        bvs     LBD3A                           ; BCD9 70 5F                    p_
        bit     $040A                           ; BCDB 2C 0A 04                 ,..
        bpl     LBCEA                           ; BCDE 10 0A                    ..
LBCE0:  jsr     PORT1B_WAIT_CHANGE              ; BCE0 20 3E BE                  >.
        bcc     LBCE0                           ; BCE3 90 FB                    ..
LBCE5:  jsr     PORT1B_WAIT_CHANGE              ; BCE5 20 3E BE                  >.
        bcs     LBCE5                           ; BCE8 B0 FB                    ..
LBCEA:  jsr     PORT1B_WAIT_CHANGE              ; BCEA 20 3E BE                  >.
        bcc     LBCEA                           ; BCED 90 FB                    ..
        jsr     PORT1B_SET_BIT4                 ; BCEF 20 23 BE                  #.
        lda     #$08                            ; BCF2 A9 08                    ..
        sta     $040C                           ; BCF4 8D 0C 04                 ...
LBCF7:  lda     VIA1_PORTB                      ; BCF7 AD 00 F8                 ...
        cmp     VIA1_PORTB                      ; BCFA CD 00 F8                 ...
        bne     LBCF7                           ; BCFD D0 F8                    ..
        eor     #$C0                            ; BCFF 49 C0                    I.
        asl     a                               ; BD01 0A                       .
        bcc     LBD3D                           ; BD02 90 39                    .9
        ror     $0408                           ; BD04 6E 08 04                 n..
        bcs     LBD0E                           ; BD07 B0 05                    ..
        jsr     PORT1B_SET_BIT5                 ; BD09 20 35 BE                  5.
        bne     LBD11                           ; BD0C D0 03                    ..
LBD0E:  jsr     PORT1B_RESET_BIT5               ; BD0E 20 2C BE                  ,.
LBD11:  jsr     PORT1B_RESET_BIT4               ; BD11 20 1A BE                  ..
        nop                                     ; BD14 EA                       .
        nop                                     ; BD15 EA                       .
        nop                                     ; BD16 EA                       .
        nop                                     ; BD17 EA                       .
        lda     VIA1_PORTB                      ; BD18 AD 00 F8                 ...
        and     #$DF                            ; BD1B 29 DF                    ).
        ora     #$10                            ; BD1D 09 10                    ..
        sta     VIA1_PORTB                      ; BD1F 8D 00 F8                 ...
        dec     $040C                           ; BD22 CE 0C 04                 ...
        bne     LBCF7                           ; BD25 D0 D0                    ..
        lda     #$04                            ; BD27 A9 04                    ..
        sta     VIA1_T2CH                       ; BD29 8D 09 F8                 ...
LBD2C:  lda     VIA1_IFR                        ; BD2C AD 0D F8                 ...
        and     #$20                            ; BD2F 29 20                    ) 
        bne     LBD3D                           ; BD31 D0 0A                    ..
        jsr     PORT1B_WAIT_CHANGE              ; BD33 20 3E BE                  >.
        bcs     LBD2C                           ; BD36 B0 F4                    ..
        cli                                     ; BD38 58                       X
        rts                                     ; BD39 60                       `
; ----------------------------------------------------------------------------
LBD3A:  lda     #$80                            ; BD3A A9 80                    ..
        .byte   $2C                             ; BD3C 2C                       ,
LBD3D:  lda     #$03                            ; BD3D A9 03                    ..
LBD3F:  jsr     SetST                           ; BD3F 20 CA FC                  ..
        cli                                     ; BD42 58                       X
        clc                                     ; BD43 18                       .
        bcc     LBD95                           ; BD44 90 4F                    .O
LSTNSA__:
        sta     $0408                           ; BD46 8D 08 04                 ...
        jsr     LBCC0                           ; BD49 20 C0 BC                  ..
PORT1B_RESET_BIT3:
        lda     VIA1_PORTB                      ; BD4C AD 00 F8                 ...
        and     #$F7                            ; BD4F 29 F7                    ).
        sta     VIA1_PORTB                      ; BD51 8D 00 F8                 ...
        rts                                     ; BD54 60                       `
; ----------------------------------------------------------------------------
TALKSA__:
        sta     $0408                           ; BD55 8D 08 04                 ...
        jsr     LBCC0                           ; BD58 20 C0 BC                  ..
LBD5B:  sei                                     ; BD5B 78                       x
        jsr     PORT1B_SET_BIT5                 ; BD5C 20 35 BE                  5.
        jsr     PORT1B_RESET_BIT3               ; BD5F 20 4C BD                  L.
        jsr     PORT1B_RESET_BIT4               ; BD62 20 1A BE                  ..
LBD65:  jsr     PORT1B_WAIT_CHANGE              ; BD65 20 3E BE                  >.
        bmi     LBD65                           ; BD68 30 FB                    0.
        cli                                     ; BD6A 58                       X
        rts                                     ; BD6B 60                       `
; ----------------------------------------------------------------------------
IECOUT__:
        bit     $040B                           ; BD6C 2C 0B 04                 ,..
        bmi     LBD77                           ; BD6F 30 06                    0.
        sec                                     ; BD71 38                       8
        ror     $040B                           ; BD72 6E 0B 04                 n..
        bne     LBD7C                           ; BD75 D0 05                    ..
LBD77:  pha                                     ; BD77 48                       H
        jsr     LBCCA                           ; BD78 20 CA BC                  ..
        pla                                     ; BD7B 68                       h
LBD7C:  sta     $0408                           ; BD7C 8D 08 04                 ...
        clc                                     ; BD7F 18                       .
        rts                                     ; BD80 60                       `
; ----------------------------------------------------------------------------
UNTALK__:
        sei                                     ; BD81 78                       x
        jsr     PORT1B_SET_BIT4                 ; BD82 20 23 BE                  #.
        lda     VIA1_PORTB                      ; BD85 AD 00 F8                 ...
        ora     #$08                            ; BD88 09 08                    ..
        sta     VIA1_PORTB                      ; BD8A 8D 00 F8                 ...
        lda     #$5F                            ; BD8D A9 5F                    ._
        .byte   $2C                             ; BD8F 2C                       ,
UNLSTN__:
        lda     #$3F                            ; BD90 A9 3F                    .?
        jsr     LBC96                           ; BD92 20 96 BC                  ..
LBD95:  jsr     PORT1B_RESET_BIT3               ; BD95 20 4C BD                  L.
LBD98:  txa                                     ; BD98 8A                       .
        ldx     #$0A                            ; BD99 A2 0A                    ..
LBD9B:  dex                                     ; BD9B CA                       .
        bne     LBD9B                           ; BD9C D0 FD                    ..
        tax                                     ; BD9E AA                       .
        jsr     PORT1B_RESET_BIT4               ; BD9F 20 1A BE                  ..
        jmp     PORT1B_RESET_BIT5               ; BDA2 4C 2C BE                 L,.
; ----------------------------------------------------------------------------
IECIN__:sei                                     ; BDA5 78                       x
        lda     #$00                            ; BDA6 A9 00                    ..
        sta     $040C                           ; BDA8 8D 0C 04                 ...
        jsr     PORT1B_RESET_BIT4               ; BDAB 20 1A BE                  ..
LBDAE:  jsr     PORT1B_WAIT_CHANGE              ; BDAE 20 3E BE                  >.
        bpl     LBDAE                           ; BDB1 10 FB                    ..
LBDB3:  lda     #$01                            ; BDB3 A9 01                    ..
        sta     VIA1_T2CH                       ; BDB5 8D 09 F8                 ...
        jsr     PORT1B_RESET_BIT5               ; BDB8 20 2C BE                  ,.
LBDBB:  lda     VIA1_IFR                        ; BDBB AD 0D F8                 ...
        and     #$20                            ; BDBE 29 20                    ) 
        bne     LBDC9                           ; BDC0 D0 07                    ..
        jsr     PORT1B_WAIT_CHANGE              ; BDC2 20 3E BE                  >.
        bmi     LBDBB                           ; BDC5 30 F4                    0.
        bpl     LBDE3                           ; BDC7 10 1A                    ..
LBDC9:  lda     $040C                           ; BDC9 AD 0C 04                 ...
        beq     LBDD3                           ; BDCC F0 05                    ..
        lda     #$02                            ; BDCE A9 02                    ..
        jmp     LBD3F                           ; BDD0 4C 3F BD                 L?.
; ----------------------------------------------------------------------------
LBDD3:  jsr     PORT1B_SET_BIT5                 ; BDD3 20 35 BE                  5.
        jsr     PORT1B_RESET_BIT4               ; BDD6 20 1A BE                  ..
        lda     #$40                            ; BDD9 A9 40                    .@
        jsr     SetST                           ; BDDB 20 CA FC                  ..
        inc     $040C                           ; BDDE EE 0C 04                 ...
        bne     LBDB3                           ; BDE1 D0 D0                    ..
LBDE3:  lda     #$08                            ; BDE3 A9 08                    ..
        sta     $040C                           ; BDE5 8D 0C 04                 ...
LBDE8:  lda     VIA1_PORTB                      ; BDE8 AD 00 F8                 ...
        cmp     VIA1_PORTB                      ; BDEB CD 00 F8                 ...
        bne     LBDE8                           ; BDEE D0 F8                    ..
        eor     #$C0                            ; BDF0 49 C0                    I.
        asl     a                               ; BDF2 0A                       .
        bpl     LBDE8                           ; BDF3 10 F3                    ..
        ror     $0409                           ; BDF5 6E 09 04                 n..
LBDF8:  lda     VIA1_PORTB                      ; BDF8 AD 00 F8                 ...
        cmp     VIA1_PORTB                      ; BDFB CD 00 F8                 ...
        bne     LBDF8                           ; BDFE D0 F8                    ..
        eor     #$C0                            ; BE00 49 C0                    I.
        asl     a                               ; BE02 0A                       .
        bmi     LBDF8                           ; BE03 30 F3                    0.
        dec     $040C                           ; BE05 CE 0C 04                 ...
        bne     LBDE8                           ; BE08 D0 DE                    ..
        jsr     PORT1B_SET_BIT5                 ; BE0A 20 35 BE                  5.
        bit     ST                              ; BE0D 24 BA                    $.
        bvc     LBE14                           ; BE0F 50 03                    P.
        jsr     LBD98                           ; BE11 20 98 BD                  ..
LBE14:  lda     $0409                           ; BE14 AD 09 04                 ...
        cli                                     ; BE17 58                       X
        clc                                     ; BE18 18                       .
        rts                                     ; BE19 60                       `
; ----------------------------------------------------------------------------
PORT1B_RESET_BIT4:
; Reset VIA1 port-B bit#4.
        lda     VIA1_PORTB                      ; BE1A AD 00 F8                 ...
        and     #$EF                            ; BE1D 29 EF                    ).
        sta     VIA1_PORTB                      ; BE1F 8D 00 F8                 ...
        rts                                     ; BE22 60                       `
; ----------------------------------------------------------------------------
PORT1B_SET_BIT4:
; Set VIA1 port-B bit#4.
        lda     VIA1_PORTB                      ; BE23 AD 00 F8                 ...
        ora     #$10                            ; BE26 09 10                    ..
        sta     VIA1_PORTB                      ; BE28 8D 00 F8                 ...
        rts                                     ; BE2B 60                       `
; ----------------------------------------------------------------------------
PORT1B_RESET_BIT5:
; Reset VIA1 port-B bit#5.
        lda     VIA1_PORTB                      ; BE2C AD 00 F8                 ...
        and     #$DF                            ; BE2F 29 DF                    ).
        sta     VIA1_PORTB                      ; BE31 8D 00 F8                 ...
        rts                                     ; BE34 60                       `
; ----------------------------------------------------------------------------
PORT1B_SET_BIT5:
; Set VIA1 port-B bit#5.
        lda     VIA1_PORTB                      ; BE35 AD 00 F8                 ...
        ora     #$20                            ; BE38 09 20                    . 
        sta     VIA1_PORTB                      ; BE3A 8D 00 F8                 ...
        rts                                     ; BE3D 60                       `
; ----------------------------------------------------------------------------
PORT1B_WAIT_CHANGE:
; Waiting for change on port B of VIA1. The high two bits are inverted, and
; bit 7 moved to carry.
; Maybe used for CLK/DAT sense on IEC bus?
        lda     VIA1_PORTB                      ; BE3E AD 00 F8                 ...
        cmp     VIA1_PORTB                      ; BE41 CD 00 F8                 ...
        bne     PORT1B_WAIT_CHANGE              ; BE44 D0 F8                    ..
        eor     #$C0                            ; BE46 49 C0                    I.
        asl     a                               ; BE48 0A                       .
        rts                                     ; BE49 60                       `
; ----------------------------------------------------------------------------
LBE4A:  txa                                     ; BE4A 8A                       .
        ldx     #$B8                            ; BE4B A2 B8                    ..
LBE4D:  dex                                     ; BE4D CA                       .
        bne     LBE4D                           ; BE4E D0 FD                    ..
        tax                                     ; BE50 AA                       .
        rts                                     ; BE51 60                       `
; ----------------------------------------------------------------------------
LBE52:  stz     $0389                           ; BE52 9C 89 03                 ...
        stz     $0388                           ; BE55 9C 88 03                 ...
        lda     #$40                            ; BE58 A9 40                    .@
        sta     $038A                           ; BE5A 8D 8A 03                 ...
        lda     #$30                            ; BE5D A9 30                    .0
        sta     $038B                           ; BE5F 8D 8B 03                 ...
        lda     #$10                            ; BE62 A9 10                    ..
        sta     $038C                           ; BE64 8D 8C 03                 ...
        bra     LBE6C                           ; BE67 80 03                    ..
LBE69:  stz     ACIA_ST                         ; BE69 9C 81 F9                 ...
LBE6C:  php                                     ; BE6C 08                       .
        sei                                     ; BE6D 78                       x
        stz     $040F                           ; BE6E 9C 0F 04                 ...
        stz     $0410                           ; BE71 9C 10 04                 ...
        stz     $C3                             ; BE74 64 C3                    d.
        stz     $038D                           ; BE76 9C 8D 03                 ...
        plp                                     ; BE79 28                       (
        rts                                     ; BE7A 60                       `
; ----------------------------------------------------------------------------
LBE7B:  lda     ACIA_ST                         ; BE7B AD 81 F9                 ...
        bit     #$10                            ; BE7E 89 10                    ..
        beq     LBEB5                           ; BE80 F0 33                    .3
        ldx     $040E                           ; BE82 AE 0E 04                 ...
        lda     #$40                            ; BE85 A9 40                    .@
        bit     $C3                             ; BE87 24 C3                    $.
        bne     LBE9A                           ; BE89 D0 0F                    ..
        lda     #$20                            ; BE8B A9 20                    . 
        bit     $C3                             ; BE8D 24 C3                    $.
        bne     LBEB5                           ; BE8F D0 24                    .$
        ldx     $040D                           ; BE91 AE 0D 04                 ...
        lda     #$80                            ; BE94 A9 80                    ..
        bit     $C3                             ; BE96 24 C3                    $.
        beq     LBEB5                           ; BE98 F0 1B                    ..
LBE9A:  stx     ACIA_DATA                       ; BE9A 8E 80 F9                 ...
        trb     $C3                             ; BE9D 14 C3                    ..
        cpx     #$00                            ; BE9F E0 00                    ..
        beq     LBEB5                           ; BEA1 F0 12                    ..
        lda     #$10                            ; BEA3 A9 10                    ..
        cpx     $0388                           ; BEA5 EC 88 03                 ...
        bne     LBEAE                           ; BEA8 D0 04                    ..
        tsb     $C3                             ; BEAA 04 C3                    ..
        bra     LBEB5                           ; BEAC 80 07                    ..
LBEAE:  cpx     $0389                           ; BEAE EC 89 03                 ...
        bne     LBEB5                           ; BEB1 D0 02                    ..
        trb     $C3                             ; BEB3 14 C3                    ..
LBEB5:  lda     ACIA_ST                         ; BEB5 AD 81 F9                 ...
        bit     #$08                            ; BEB8 89 08                    ..
        beq     LBF0B                           ; BEBA F0 4F                    .O
        ldx     ACIA_DATA                       ; BEBC AE 80 F9                 ...
        and     #$07                            ; BEBF 29 07                    ).
        bne     LBECE                           ; BEC1 D0 0B                    ..
        cpx     #$00                            ; BEC3 E0 00                    ..
        beq     LBED9                           ; BEC5 F0 12                    ..
        lda     #$20                            ; BEC7 A9 20                    . 
        cpx     $0388                           ; BEC9 EC 88 03                 ...
        bne     LBED1                           ; BECC D0 03                    ..
LBECE:  tsb     $C3                             ; BECE 04 C3                    ..
        rts                                     ; BED0 60                       `
; ----------------------------------------------------------------------------
LBED1:  cpx     $0389                           ; BED1 EC 89 03                 ...
        bne     LBED9                           ; BED4 D0 03                    ..
        trb     $C3                             ; BED6 14 C3                    ..
        rts                                     ; BED8 60                       `
; ----------------------------------------------------------------------------
LBED9:  ldy     $038D                           ; BED9 AC 8D 03                 ...
        cpy     $038A                           ; BEDC CC 8A 03                 ...
        bcs     LBF0B                           ; BEDF B0 2A                    .*
        inc     $038D                           ; BEE1 EE 8D 03                 ...
        cpy     $038B                           ; BEE4 CC 8B 03                 ...
        bcc     LBEFB                           ; BEE7 90 12                    ..
        ldy     $0388                           ; BEE9 AC 88 03                 ...
        beq     LBEFB                           ; BEEC F0 0D                    ..
        lda     #$10                            ; BEEE A9 10                    ..
        bit     $C3                             ; BEF0 24 C3                    $.
        bne     LBEFB                           ; BEF2 D0 07                    ..
        sty     $040E                           ; BEF4 8C 0E 04                 ...
        lda     #$40                            ; BEF7 A9 40                    .@
        tsb     $C3                             ; BEF9 04 C3                    ..
LBEFB:  txa                                     ; BEFB 8A                       .
        ldx     $040F                           ; BEFC AE 0F 04                 ...
        bne     LBF04                           ; BEFF D0 03                    ..
        ldx     $038A                           ; BF01 AE 8A 03                 ...
LBF04:  dex                                     ; BF04 CA                       .
        sta     $04C0,x                         ; BF05 9D C0 04                 ...
        stx     $040F                           ; BF08 8E 0F 04                 ...
LBF0B:  rts                                     ; BF0B 60                       `
; ----------------------------------------------------------------------------
LBF0C:  tax                                     ; BF0C AA                       .
LBF0D:  lda     StopKeyFlag                     ; BF0D A5 AD                    ..
        lsr     a                               ; BF0F 4A                       J
        bit     $C3                             ; BF10 24 C3                    $.
        bpl     LBF16                           ; BF12 10 02                    ..
        bcc     LBF0D                           ; BF14 90 F7                    ..
LBF16:  stx     $040D                           ; BF16 8E 0D 04                 ...
        lda     #$80                            ; BF19 A9 80                    ..
        tsb     $C3                             ; BF1B 04 C3                    ..
        rts                                     ; BF1D 60                       `
; ----------------------------------------------------------------------------
LBF1E:  ldy     $038D                           ; BF1E AC 8D 03                 ...
        tya                                     ; BF21 98                       .
        beq     LBF4D                           ; BF22 F0 29                    .)
        dec     $038D                           ; BF24 CE 8D 03                 ...
        ldx     $0389                           ; BF27 AE 89 03                 ...
        beq     LBF3E                           ; BF2A F0 12                    ..
        cpy     $038C                           ; BF2C CC 8C 03                 ...
        bcs     LBF3E                           ; BF2F B0 0D                    ..
        lda     #$10                            ; BF31 A9 10                    ..
        bit     $C3                             ; BF33 24 C3                    $.
        beq     LBF3E                           ; BF35 F0 07                    ..
        stx     $040E                           ; BF37 8E 0E 04                 ...
        lda     #$40                            ; BF3A A9 40                    .@
        tsb     $C3                             ; BF3C 04 C3                    ..
LBF3E:  ldx     $0410                           ; BF3E AE 10 04                 ...
        bne     LBF46                           ; BF41 D0 03                    ..
        ldx     $038A                           ; BF43 AE 8A 03                 ...
LBF46:  dex                                     ; BF46 CA                       .
        lda     $04C0,x                         ; BF47 BD C0 04                 ...
        stx     $0410                           ; BF4A 8E 10 04                 ...
LBF4D:  clc                                     ; BF4D 18                       .
        rts                                     ; BF4E 60                       `
; ----------------------------------------------------------------------------
; Updates time-of-day (TOD) clock. Should be called at 60Hz frequency.
UDTIM__:dec     TOD_60HZ                        ; BF4F CE 8F 03                 ...
        bpl     LBFBD                           ; BF52 10 69                    .i
        lda     #$3B                            ; BF54 A9 3B                    .;
        sta     TOD_60HZ                        ; BF56 8D 8F 03                 ...
        lda     #$3B                            ; BF59 A9 3B                    .;
        inc     TOD_SECS                        ; BF5B EE 90 03                 ...
        cmp     TOD_SECS                        ; BF5E CD 90 03                 ...
        bcs     LBF7E                           ; BF61 B0 1B                    ..
        stz     TOD_SECS                        ; BF63 9C 90 03                 ...
        inc     TOD_MINS                        ; BF66 EE 91 03                 ...
        cmp     TOD_MINS                        ; BF69 CD 91 03                 ...
        bcs     LBF7E                           ; BF6C B0 10                    ..
        stz     TOD_MINS                        ; BF6E 9C 91 03                 ...
        inc     TOD_HOURS                       ; BF71 EE 92 03                 ...
        lda     #$17                            ; BF74 A9 17                    ..
        cmp     TOD_HOURS                       ; BF76 CD 92 03                 ...
        bcs     LBF7E                           ; BF79 B0 03                    ..
        stz     TOD_HOURS                       ; BF7B 9C 92 03                 ...
; this TOD stuff was easy, but I have no idea what the rest is ...
LBF7E:  lda     $0396                           ; BF7E AD 96 03                 ...
        ora     $0397                           ; BF81 0D 97 03                 ...
        beq     LBF93                           ; BF84 F0 0D                    ..
        dec     $0396                           ; BF86 CE 96 03                 ...
        bpl     LBF93                           ; BF89 10 08                    ..
        ldx     #$3B                            ; BF8B A2 3B                    .;
        stx     $0396                           ; BF8D 8E 96 03                 ...
        dec     $0397                           ; BF90 CE 97 03                 ...
LBF93:  lda     $0393                           ; BF93 AD 93 03                 ...
        and     #$FC                            ; BF96 29 FC                    ).
        ora     $0394                           ; BF98 0D 94 03                 ...
        ora     $0395                           ; BF9B 0D 95 03                 ...
        bne     LBFA8                           ; BF9E D0 08                    ..
        lda     $0393                           ; BFA0 AD 93 03                 ...
        beq     LBFBD                           ; BFA3 F0 18                    ..
        jsr     LC65C                           ; BFA5 20 5C C6                  \.
LBFA8:  dec     $0393                           ; BFA8 CE 93 03                 ...
        bpl     LBFBD                           ; BFAB 10 10                    ..
        lda     #$3B                            ; BFAD A9 3B                    .;
        sta     $0393                           ; BFAF 8D 93 03                 ...
        dec     $0394                           ; BFB2 CE 94 03                 ...
        bpl     LBFBD                           ; BFB5 10 06                    ..
        sta     $0394                           ; BFB7 8D 94 03                 ...
        dec     $0395                           ; BFBA CE 95 03                 ...
LBFBD:  rts                                     ; BFBD 60                       `
; ----------------------------------------------------------------------------
LBFBE:  php                                     ; BFBE 08                       .
        sei                                     ; BFBF 78                       x
        stz     $0396                           ; BFC0 9C 96 03                 ...
        lda     $0780                           ; BFC3 AD 80 07                 ...
        bne     LBFC9                           ; BFC6 D0 01                    ..
        dec     a                               ; BFC8 3A                       :
LBFC9:  sta     $0397                           ; BFC9 8D 97 03                 ...
        plp                                     ; BFCC 28                       (
        rts                                     ; BFCD 60                       `
; ----------------------------------------------------------------------------
LBFCE:  sei                                     ; BFCE 78                       x
        lda     TOD_HOURS                       ; BFCF AD 92 03                 ...
        ldx     TOD_MINS                        ; BFD2 AE 91 03                 ...
        ldy     TOD_SECS                        ; BFD5 AC 90 03                 ...
LBFD8:  sei                                     ; BFD8 78                       x
        sta     TOD_HOURS                       ; BFD9 8D 92 03                 ...
        stx     TOD_MINS                        ; BFDC 8E 91 03                 ...
        sty     TOD_SECS                        ; BFDF 8C 90 03                 ...
        cli                                     ; BFE2 58                       X
        rts                                     ; BFE3 60                       `
; ----------------------------------------------------------------------------
WaitXticks_:
; Waits for multiple of 1/60 seconds. Interrupt must be enabled, since it
; used TOD's 1/60 val.
; Input: X = number of 1/60 seconds.
        pha                                     ; BFE4 48                       H
LBFE5:  lda     TOD_60HZ                        ; BFE5 AD 8F 03                 ...
LBFE8:  cmp     TOD_60HZ                        ; BFE8 CD 8F 03                 ...
        beq     LBFE8                           ; BFEB F0 FB                    ..
        dex                                     ; BFED CA                       .
        bpl     LBFE5                           ; BFEE 10 F5                    ..
        pla                                     ; BFF0 68                       h
        rts                                     ; BFF1 60                       `
; ----------------------------------------------------------------------------
LBFF2:  pha                                     ; BFF2 48                       H
        phx                                     ; BFF3 DA                       .
        phy                                     ; BFF4 5A                       Z
        jsr     LC009                           ; BFF5 20 09 C0                  ..
        bcc     LBFFD                           ; BFF8 90 03                    ..
        jsr     L84C5                           ; BFFA 20 C5 84                  ..
LBFFD:  lda     $0335                           ; BFFD AD 35 03                 .5.
        beq     LC005                           ; C000 F0 03                    ..
        jsr     LFA78                           ; C002 20 78 FA                  x.
LC005:  ply                                     ; C005 7A                       z
        plx                                     ; C006 FA                       .
        pla                                     ; C007 68                       h
        rts                                     ; C008 60                       `
; ----------------------------------------------------------------------------
LC009:  lda     StopKeyFlag                     ; C009 A5 AD                    ..
        and     #$A0                            ; C00B 29 A0                    ).
        tax                                     ; C00D AA                       .
        php                                     ; C00E 08                       .
        sei                                     ; C00F 78                       x
        lda     $0396                           ; C010 AD 96 03                 ...
        ora     $0397                           ; C013 0D 97 03                 ...
        bne     LC019                           ; C016 D0 01                    ..
        inx                                     ; C018 E8                       .
LC019:  plp                                     ; C019 28                       (
        txa                                     ; C01A 8A                       .
        cmp     #$01                            ; C01B C9 01                    ..
        rts                                     ; C01D 60                       `
; ----------------------------------------------------------------------------
LC01E:  .byte   $01,$00,$01,$02,$00,$01,$02,$00 ; C01E 01 00 01 02 00 01 02 00  ........
        .byte   $01,$02,$00,$02                 ; C026 01 02 00 02              ....
LC02A:  .byte   $9D,$76,$51                     ; C02A 9D 76 51                 .vQ
LC02D:  .byte   $03,$00,$00,$00,$01,$01         ; C02D 03 00 00 00 01 01        ......
LC033:  .byte   $01,$02,$02,$02,$03,$03         ; C033 01 02 02 02 03 03        ......
LC039:  .byte   $8B,$9A,$AA,$BC                 ; C039 8B 9A AA BC              ....
LC03D:  .byte   $8C,$7E,$72,$67                 ; C03D 8C 7E 72 67              .~rg
LC041:  .byte   $A2,$09,$20,$E4,$BF,$08,$78,$C9 ; C041 A2 09 20 E4 BF 08 78 C9  .. ...x.
        .byte   $23,$D0,$02                     ; C049 23 D0 02                 #..
LC04C:  .byte   $A9,$0B,$29,$0F                 ; C04C A9 0B 29 0F              ..).
; ----------------------------------------------------------------------------
        tax                                     ; C050 AA                       .
        lda     #$C0                            ; C051 A9 C0                    ..
        tsb     VIA2_ACR                        ; C053 0C 8B F8                 ...
        ldy     LC01E,x                         ; C056 BC 1E C0                 ...
        lda     LC02A,y                         ; C059 B9 2A C0                 .*.
        sta     VIA2_T1CL                       ; C05C 8D 84 F8                 ...
        lda     #$01                            ; C05F A9 01                    ..
        sta     VIA2_T1CH                       ; C061 8D 85 F8                 ...
        ldy     LC02D,x                         ; C064 BC 2D C0                 .-.
        ldx     LC039,y                         ; C067 BE 39 C0                 .9.
LC06A:  lda     VIA2_PORTB                      ; C06A AD 80 F8                 ...
        eor     #$01                            ; C06D 49 01                    I.
        sta     VIA2_PORTB                      ; C06F 8D 80 F8                 ...
        lda     LC03D,y                         ; C072 B9 3D C0                 .=.
LC075:  dec     a                               ; C075 3A                       :
        bne     LC075                           ; C076 D0 FD                    ..
        dex                                     ; C078 CA                       .
        bne     LC06A                           ; C079 D0 EF                    ..
        lda     #$C0                            ; C07B A9 C0                    ..
        trb     VIA2_ACR                        ; C07D 1C 8B F8                 ...
        plp                                     ; C080 28                       (
        rts                                     ; C081 60                       `
; ----------------------------------------------------------------------------
LC082:  lda     #$AE                            ; C082 A9 AE                    ..
        sta     $034E                           ; C084 8D 4E 03                 .N.
        ldx     FNlength                        ; C087 AE 87 03                 ...
        beq     LC0A6                           ; C08A F0 1A                    ..
        stz     ACIA_ST                         ; C08C 9C 81 F9                 ...
        ldy     #$00                            ; C08F A0 00                    ..
        jsr     FROM_C67B                       ; C091 20 4A 03                  J.
        sta     ACIA_CTRL                       ; C094 8D 83 F9                 ...
        cpx     #$01                            ; C097 E0 01                    ..
        beq     LC0A6                           ; C099 F0 0B                    ..
        iny                                     ; C09B C8                       .
        jsr     FROM_C67B                       ; C09C 20 4A 03                  J.
        cpx     #$02                            ; C09F E0 02                    ..
        bne     LC0A8                           ; C0A1 D0 05                    ..
        sta     ACIA_CMD                        ; C0A3 8D 82 F9                 ...
LC0A6:  clc                                     ; C0A6 18                       .
        rts                                     ; C0A7 60                       `
; ----------------------------------------------------------------------------
LC0A8:  and     #$E0                            ; C0A8 29 E0                    ).
        sta     ACIA_CMD                        ; C0AA 8D 82 F9                 ...
        jsr     LC193                           ; C0AD 20 93 C1                  ..
        jsr     LC1A1                           ; C0B0 20 A1 C1                  ..
        jsr     LC1AD                           ; C0B3 20 AD C1                  ..
        ldy     #$02                            ; C0B6 A0 02                    ..
        jsr     FROM_C67B                       ; C0B8 20 4A 03                  J.
        cmp     #$41                            ; C0BB C9 41                    .A
        beq     LC0C3                           ; C0BD F0 04                    ..
        cmp     #$41                            ; C0BF C9 41                    .A
        bne     LC0CE                           ; C0C1 D0 0B                    ..
LC0C3:  jsr     LC1DF                           ; C0C3 20 DF C1                  ..
        bcs     LC0E3                           ; C0C6 B0 1B                    ..
        jsr     LC1BB                           ; C0C8 20 BB C1                  ..
        jmp     LC1B4                           ; C0CB 4C B4 C1                 L..
; ----------------------------------------------------------------------------
LC0CE:  jsr     LC1BB                           ; C0CE 20 BB C1                  ..
        jsr     LC189                           ; C0D1 20 89 C1                  ..
        lda     #$02                            ; C0D4 A9 02                    ..
        jsr     LC0F1                           ; C0D6 20 F1 C0                  ..
        bcs     LC0E3                           ; C0D9 B0 08                    ..
        jsr     LC1CD                           ; C0DB 20 CD C1                  ..
        bcs     LC0E3                           ; C0DE B0 03                    ..
        jmp     LC1B4                           ; C0E0 4C B4 C1                 L..
; ----------------------------------------------------------------------------
LC0E3:  lda     LFSLogNum                       ; C0E3 A5 C6                    ..
        jmp     LFCF1                           ; C0E5 4C F1 FC                 L..
; ----------------------------------------------------------------------------
LC0E8:  php                                     ; C0E8 08                       .
        sei                                     ; C0E9 78                       x
        jsr     LBE52                           ; C0EA 20 52 BE                  R.
        plp                                     ; C0ED 28                       (
        jmp     LC200                           ; C0EE 4C 00 C2                 L..
; ----------------------------------------------------------------------------
LC0F1:  pha                                     ; C0F1 48                       H
        and     #$7F                            ; C0F2 29 7F                    ).
        cmp     FNlength                        ; C0F4 CD 87 03                 ...
        bcc     LC0FC                           ; C0F7 90 03                    ..
        pla                                     ; C0F9 68                       h
        clc                                     ; C0FA 18                       .
        rts                                     ; C0FB 60                       `
; ----------------------------------------------------------------------------
LC0FC:  tay                                     ; C0FC A8                       .
        jsr     FROM_C67B                       ; C0FD 20 4A 03                  J.
        jsr     LC110                           ; C100 20 10 C1                  ..
        jsr     LC1F0                           ; C103 20 F0 C1                  ..
        pla                                     ; C106 68                       h
        inc     a                               ; C107 1A                       .
        bcs     LC10F                           ; C108 B0 05                    ..
        lda     StopKeyFlag                     ; C10A A5 AD                    ..
        lsr     a                               ; C10C 4A                       J
        bcc     LC0F1                           ; C10D 90 E2                    ..
LC10F:  rts                                     ; C10F 60                       `
; ----------------------------------------------------------------------------
LC110:  bit     #$40                            ; C110 89 40                    .@
        beq     LC116                           ; C112 F0 02                    ..
        and     #$DF                            ; C114 29 DF                    ).
LC116:  ldy     #$0F                            ; C116 A0 0F                    ..
LC118:  cmp     LC128,y                         ; C118 D9 28 C1                 .(.
        bne     LC123                           ; C11B D0 06                    ..
        ldx     LC138,y                         ; C11D BE 38 C1                 .8.
        jmp     (LC148,x)                       ; C120 7C 48 C1                 |H.
LC123:  dey                                     ; C123 88                       .
        bpl     LC118                           ; C124 10 F2                    ..
        clc                                     ; C126 18                       .
        rts                                     ; C127 60                       `
; ----------------------------------------------------------------------------
LC128:  .byte   $30,$31,$32,$33,$34,$35,$36,$37 ; C128 30 31 32 33 34 35 36 37  01234567
        .byte   $38,$39,$23,$2A,$52,$54,$57,$2C ; C130 38 39 23 2A 52 54 57 2C  89#*RTW,
LC138:  .byte   $00,$00,$00,$00,$00,$00,$00,$00 ; C138 00 00 00 00 00 00 00 00  ........
        .byte   $00,$00,$00,$00,$02,$04,$06,$08 ; C140 00 00 00 00 02 04 06 08  ........
; ----------------------------------------------------------------------------
LC148:  .addr   LC165                           ; C148 65 C1                    e.
        .addr   LC15A                           ; C14A 5A C1                    Z.
        .addr   LC152                           ; C14C 52 C1                    R.
        .addr   LC1CD                           ; C14E CD C1                    ..
        .addr   LC18C                           ; C150 8C C1                    ..
; ----------------------------------------------------------------------------
LC152:  tsx                                     ; C152 BA                       .
        lda     stack+3,x                       ; C153 BD 03 01                 ...
        ora     #$80                            ; C156 09 80                    ..
        bra     LC160                           ; C158 80 06                    ..
LC15A:  tsx                                     ; C15A BA                       .
        lda     stack+3,x                       ; C15B BD 03 01                 ...
        and     #$7F                            ; C15E 29 7F                    ).
LC160:  sta     stack+3,x                       ; C160 9D 03 01                 ...
        clc                                     ; C163 18                       .
        rts                                     ; C164 60                       `
; ----------------------------------------------------------------------------
LC165:  tsx                                     ; C165 BA                       .
        ldy     stack+3,x                       ; C166 BC 03 01                 ...
        bpl     LC170                           ; C169 10 05                    ..
        jsr     LC041                           ; C16B 20 41 C0                  A.
        clc                                     ; C16E 18                       .
        rts                                     ; C16F 60                       `
; ----------------------------------------------------------------------------
LC170:  cmp     #$30                            ; C170 C9 30                    .0
        bcc     LC188                           ; C172 90 14                    ..
        and     #$0F                            ; C174 29 0F                    ).
        bne     LC17A                           ; C176 D0 02                    ..
        lda     #$0A                            ; C178 A9 0A                    ..
LC17A:  pha                                     ; C17A 48                       H
        jsr     LC1C4                           ; C17B 20 C4 C1                  ..
        jsr     LC1BB                           ; C17E 20 BB C1                  ..
        pla                                     ; C181 68                       h
        dec     a                               ; C182 3A                       :
        bne     LC17A                           ; C183 D0 F5                    ..
        jsr     LC18C                           ; C185 20 8C C1                  ..
LC188:  rts                                     ; C188 60                       `
; ----------------------------------------------------------------------------
LC189:  jsr     LC18C                           ; C189 20 8C C1                  ..
LC18C:  ldx     #$3B                            ; C18C A2 3B                    .;
LC18E:  jsr     WaitXticks_                     ; C18E 20 E4 BF                  ..
        clc                                     ; C191 18                       .
        rts                                     ; C192 60                       `
; ----------------------------------------------------------------------------
LC193:  lda     #$02                            ; C193 A9 02                    ..
        trb     VIA2_PORTB                      ; C195 1C 80 F8                 ...
        bra     LC18C                           ; C198 80 F2                    ..
LC19A:  lda     #$02                            ; C19A A9 02                    ..
        tsb     VIA2_PORTB                      ; C19C 0C 80 F8                 ...
        clc                                     ; C19F 18                       .
        rts                                     ; C1A0 60                       `
; ----------------------------------------------------------------------------
LC1A1:  lda     #$01                            ; C1A1 A9 01                    ..
        tsb     ACIA_CMD                        ; C1A3 0C 82 F9                 ...
        rts                                     ; C1A6 60                       `
; ----------------------------------------------------------------------------
LC1A7:  lda     #$01                            ; C1A7 A9 01                    ..
        trb     ACIA_CMD                        ; C1A9 1C 82 F9                 ...
        rts                                     ; C1AC 60                       `
; ----------------------------------------------------------------------------
LC1AD:  lda     #$08                            ; C1AD A9 08                    ..
        tsb     VIA2_PORTB                      ; C1AF 0C 80 F8                 ...
        clc                                     ; C1B2 18                       .
        rts                                     ; C1B3 60                       `
; ----------------------------------------------------------------------------
LC1B4:  lda     #$08                            ; C1B4 A9 08                    ..
        trb     VIA2_PORTB                      ; C1B6 1C 80 F8                 ...
        clc                                     ; C1B9 18                       .
        rts                                     ; C1BA 60                       `
; ----------------------------------------------------------------------------
LC1BB:  lda     #$04                            ; C1BB A9 04                    ..
        tsb     ACIA_CMD                        ; C1BD 0C 82 F9                 ...
        ldx     #$02                            ; C1C0 A2 02                    ..
        bra     LC18E                           ; C1C2 80 CA                    ..
LC1C4:  lda     #$04                            ; C1C4 A9 04                    ..
        trb     ACIA_CMD                        ; C1C6 1C 82 F9                 ...
        ldx     #$04                            ; C1C9 A2 04                    ..
        bra     LC18E                           ; C1CB 80 C1                    ..
LC1CD:  lda     ACIA_ST                         ; C1CD AD 81 F9                 ...
        bit     #$20                            ; C1D0 89 20                    . 
        beq     LC18C                           ; C1D2 F0 B8                    ..
        bit     #$40                            ; C1D4 89 40                    .@
        bne     LC1DD                           ; C1D6 D0 05                    ..
        lda     StopKeyFlag                     ; C1D8 A5 AD                    ..
        lsr     a                               ; C1DA 4A                       J
        bcc     LC1CD                           ; C1DB 90 F0                    ..
LC1DD:  sec                                     ; C1DD 38                       8
        rts                                     ; C1DE 60                       `
; ----------------------------------------------------------------------------
LC1DF:  ldy     #$78                            ; C1DF A0 78                    .x
LC1E1:  ldx     #$01                            ; C1E1 A2 01                    ..
        jsr     WaitXticks_                     ; C1E3 20 E4 BF                  ..
        jsr     LC1CD                           ; C1E6 20 CD C1                  ..
        bcc     LC1EF                           ; C1E9 90 04                    ..
        dey                                     ; C1EB 88                       .
        bne     LC1E1                           ; C1EC D0 F3                    ..
        sec                                     ; C1EE 38                       8
LC1EF:  rts                                     ; C1EF 60                       `
; ----------------------------------------------------------------------------
LC1F0:  lda     #$04                            ; C1F0 A9 04                    ..
        trb     ACIA_CMD                        ; C1F2 1C 82 F9                 ...
        lda     #$C8                            ; C1F5 A9 C8                    ..
LC1F7:  dec     a                               ; C1F7 3A                       :
        bne     LC1F7                           ; C1F8 D0 FD                    ..
        lda     #$04                            ; C1FA A9 04                    ..
        tsb     ACIA_CMD                        ; C1FC 0C 82 F9                 ...
        rts                                     ; C1FF 60                       `
; ----------------------------------------------------------------------------
LC200:  jsr     LC1B4                           ; C200 20 B4 C1                  ..
        jsr     LC1C4                           ; C203 20 C4 C1                  ..
        jsr     LC1A7                           ; C206 20 A7 C1                  ..
        jsr     LC19A                           ; C209 20 9A C1                  ..
        lda     #$80                            ; C20C A9 80                    ..
        jmp     SetST                           ; C20E 4C CA FC                 L..
; ----------------------------------------------------------------------------
LC211:  .byte   $04,$02,$00,$04,$06,$07,$09,$0B ; C211 04 02 00 04 06 07 09 0B  ........
; ----------------------------------------------------------------------------
LC219:  stz     $0411                           ; C219 9C 11 04                 ...
        lda     FNlength                        ; C21C AD 87 03                 ...
        beq     LC22A                           ; C21F F0 09                    ..
        cmp     #$08                            ; C221 C9 08                    ..
        beq     LC22C                           ; C223 F0 07                    ..
        lda     #$01                            ; C225 A9 01                    ..
        jsr     SetST                           ; C227 20 CA FC                  ..
LC22A:  clc                                     ; C22A 18                       .
        rts                                     ; C22B 60                       `
; ----------------------------------------------------------------------------
LC22C:  lda     #$AE                            ; C22C A9 AE                    ..
        sta     $034E                           ; C22E 8D 4E 03                 .N.
        ldy     #$07                            ; C231 A0 07                    ..
LC233:  jsr     FROM_C67B                       ; C233 20 4A 03                  J.
        sta     $0412,y                         ; C236 99 12 04                 ...
        dey                                     ; C239 88                       .
        bpl     LC233                           ; C23A 10 F7                    ..
        lda     $0415                           ; C23C AD 15 04                 ...
        ror     a                               ; C23F 6A                       j
        ror     a                               ; C240 6A                       j
        ror     a                               ; C241 6A                       j
        and     #$C0                            ; C242 29 C0                    ).
        ora     $0412                           ; C244 0D 12 04                 ...
        sta     $0415                           ; C247 8D 15 04                 ...
        jsr     RTC_ACCESS_ON                   ; C24A 20 66 C3                  f.
        lda     #$80                            ; C24D A9 80                    ..
        tsb     VIA2_PORTA                      ; C24F 0C 81 F8                 ...
        php                                     ; C252 08                       .
        sei                                     ; C253 78                       x
        ldy     #$0E                            ; C254 A0 0E                    ..
        lda     #$40                            ; C256 A9 40                    .@
        jsr     LC340                           ; C258 20 40 C3                  @.
        ldx     #$01                            ; C25B A2 01                    ..
LC25D:  lda     $0412,x                         ; C25D BD 12 04                 ...
        jsr     LC325                           ; C260 20 25 C3                  %.
        inx                                     ; C263 E8                       .
        cpx     #$08                            ; C264 E0 08                    ..
        bne     LC25D                           ; C266 D0 F5                    ..
        jsr     RTC_ACCESS_OFF                  ; C268 20 6F C3                  o.
        plp                                     ; C26B 28                       (
        stz     $0411                           ; C26C 9C 11 04                 ...
        clc                                     ; C26F 18                       .
        rts                                     ; C270 60                       `
; ----------------------------------------------------------------------------
LC271:  jsr     LC2CE                           ; C271 20 CE C2                  ..
        php                                     ; C274 08                       .
        sei                                     ; C275 78                       x
        sed                                     ; C276 F8                       .
        lda     $0412                           ; C277 AD 12 04                 ...
        ldx     $0415                           ; C27A AE 15 04                 ...
        bne     LC287                           ; C27D D0 08                    ..
        cmp     #$12                            ; C27F C9 12                    ..
        bne     LC290                           ; C281 D0 0D                    ..
        lda     #$00                            ; C283 A9 00                    ..
        bra     LC290                           ; C285 80 09                    ..
LC287:  dex                                     ; C287 CA                       .
        bne     LC290                           ; C288 D0 06                    ..
        cmp     #$12                            ; C28A C9 12                    ..
        beq     LC290                           ; C28C F0 02                    ..
        adc     #$12                            ; C28E 69 12                    i.
LC290:  jsr     LC375                           ; C290 20 75 C3                  u.
        sta     TOD_HOURS                       ; C293 8D 92 03                 ...
        lda     $0413                           ; C296 AD 13 04                 ...
        jsr     LC375                           ; C299 20 75 C3                  u.
        sta     TOD_MINS                        ; C29C 8D 91 03                 ...
        lda     $0414                           ; C29F AD 14 04                 ...
        jsr     LC375                           ; C2A2 20 75 C3                  u.
        sta     TOD_SECS                        ; C2A5 8D 90 03                 ...
        stz     $0411                           ; C2A8 9C 11 04                 ...
        plp                                     ; C2AB 28                       (
        rts                                     ; C2AC 60                       `
; ----------------------------------------------------------------------------
LC2AD:  ldx     $0411                           ; C2AD AE 11 04                 ...
        beq     LC2BD                           ; C2B0 F0 0B                    ..
        cpx     #$08                            ; C2B2 E0 08                    ..
        bcc     LC2C3                           ; C2B4 90 0D                    ..
        lda     #$0D                            ; C2B6 A9 0D                    ..
        stz     $0411                           ; C2B8 9C 11 04                 ...
        clc                                     ; C2BB 18                       .
        rts                                     ; C2BC 60                       `
; ----------------------------------------------------------------------------
LC2BD:  jsr     LC2CE                           ; C2BD 20 CE C2                  ..
        stz     $0411                           ; C2C0 9C 11 04                 ...
LC2C3:  ldx     $0411                           ; C2C3 AE 11 04                 ...
        lda     $0412,x                         ; C2C6 BD 12 04                 ...
        inc     $0411                           ; C2C9 EE 11 04                 ...
        clc                                     ; C2CC 18                       .
        rts                                     ; C2CD 60                       `
; ----------------------------------------------------------------------------
LC2CE:  jsr     RTC_ACCESS_ON                   ; C2CE 20 66 C3                  f.
        ldx     #$07                            ; C2D1 A2 07                    ..
LC2D3:  jsr     LC30E                           ; C2D3 20 0E C3                  ..
        sta     $0412,x                         ; C2D6 9D 12 04                 ...
        dex                                     ; C2D9 CA                       .
        bpl     LC2D3                           ; C2DA 10 F7                    ..
        jsr     RTC_ACCESS_OFF                  ; C2DC 20 6F C3                  o.
        jsr     RTC_ACCESS_ON                   ; C2DF 20 66 C3                  f.
        ldx     #$07                            ; C2E2 A2 07                    ..
LC2E4:  jsr     LC30E                           ; C2E4 20 0E C3                  ..
        cmp     $0412,x                         ; C2E7 DD 12 04                 ...
        bne     LC2CE                           ; C2EA D0 E2                    ..
        dex                                     ; C2EC CA                       .
        bne     LC2E4                           ; C2ED D0 F5                    ..
        jsr     RTC_ACCESS_OFF                  ; C2EF 20 6F C3                  o.
        lda     $0412                           ; C2F2 AD 12 04                 ...
        and     #$3F                            ; C2F5 29 3F                    )?
        sta     $0412                           ; C2F7 8D 12 04                 ...
        lda     $0416                           ; C2FA AD 16 04                 ...
        and     #$0F                            ; C2FD 29 0F                    ).
        sta     $0416                           ; C2FF 8D 16 04                 ...
        lda     $0415                           ; C302 AD 15 04                 ...
        rol     a                               ; C305 2A                       *
        rol     a                               ; C306 2A                       *
        rol     a                               ; C307 2A                       *
        and     #$03                            ; C308 29 03                    ).
        sta     $0415                           ; C30A 8D 15 04                 ...
        rts                                     ; C30D 60                       `
; ----------------------------------------------------------------------------
LC30E:  ldy     LC211,x                         ; C30E BC 11 C2                 ...
        phy                                     ; C311 5A                       Z
        jsr     LC352                           ; C312 20 52 C3                  R.
        sta     $0411                           ; C315 8D 11 04                 ...
        ply                                     ; C318 7A                       z
        iny                                     ; C319 C8                       .
        jsr     LC352                           ; C31A 20 52 C3                  R.
        asl     a                               ; C31D 0A                       .
        asl     a                               ; C31E 0A                       .
        asl     a                               ; C31F 0A                       .
        asl     a                               ; C320 0A                       .
        ora     $0411                           ; C321 0D 11 04                 ...
        rts                                     ; C324 60                       `
; ----------------------------------------------------------------------------
LC325:  pha                                     ; C325 48                       H
        and     #$0F                            ; C326 29 0F                    ).
        ldy     LC211,x                         ; C328 BC 11 C2                 ...
        jsr     LC337                           ; C32B 20 37 C3                  7.
        pla                                     ; C32E 68                       h
        lsr     a                               ; C32F 4A                       J
        lsr     a                               ; C330 4A                       J
        lsr     a                               ; C331 4A                       J
        lsr     a                               ; C332 4A                       J
        ldy     LC211,x                         ; C333 BC 11 C2                 ...
        iny                                     ; C336 C8                       .
LC337:  pha                                     ; C337 48                       H
        lda     #$40                            ; C338 A9 40                    .@
        jsr     LC340                           ; C33A 20 40 C3                  @.
        ply                                     ; C33D 7A                       z
        lda     #$20                            ; C33E A9 20                    . 
LC340:  pha                                     ; C340 48                       H
        lda     #$7F                            ; C341 A9 7F                    ..
        trb     VIA2_PORTA                      ; C343 1C 81 F8                 ...
        tya                                     ; C346 98                       .
        tsb     VIA2_PORTA                      ; C347 0C 81 F8                 ...
        pla                                     ; C34A 68                       h
        tsb     VIA2_PORTA                      ; C34B 0C 81 F8                 ...
        trb     VIA2_PORTA                      ; C34E 1C 81 F8                 ...
        rts                                     ; C351 60                       `
; ----------------------------------------------------------------------------
; This quite odd routine reads (4 bit) data from the RTC chip. Odd, because
; port A of VIA#2 is configured as _output_ otherwise ... $40 is for AW
; (address write) signal for the RTC.
; Input: Y = RTC register number
; Output: A = read value
LC352:  lda     #$40                            ; C352 A9 40                    .@
        jsr     LC340                           ; C354 20 40 C3                  @.
        lda     #$1F                            ; C357 A9 1F                    ..
        tsb     VIA2_PORTA                      ; C359 0C 81 F8                 ...
        ldy     VIA2_PORTA                      ; C35C AC 81 F8                 ...
        trb     VIA2_PORTA                      ; C35F 1C 81 F8                 ...
        tya                                     ; C362 98                       .
        and     #$0F                            ; C363 29 0F                    ).
        rts                                     ; C365 60                       `
; ----------------------------------------------------------------------------
RTC_ACCESS_ON:
        stz     VIA2_PORTA                      ; C366 9C 81 F8                 ...
        lda     #$02                            ; C369 A9 02                    ..
        tsb     VIA1_PORTB                      ; C36B 0C 00 F8                 ...
        rts                                     ; C36E 60                       `
; ----------------------------------------------------------------------------
RTC_ACCESS_OFF:
        lda     #$02                            ; C36F A9 02                    ..
        trb     VIA1_PORTB                      ; C371 1C 00 F8                 ...
        rts                                     ; C374 60                       `
; ----------------------------------------------------------------------------
LC375:  pha                                     ; C375 48                       H
        lsr     a                               ; C376 4A                       J
        lsr     a                               ; C377 4A                       J
        lsr     a                               ; C378 4A                       J
        lsr     a                               ; C379 4A                       J
        tay                                     ; C37A A8                       .
        pla                                     ; C37B 68                       h
        cld                                     ; C37C D8                       .
        sec                                     ; C37D 38                       8
        sbc     LC382,y                         ; C37E F9 82 C3                 ...
        rts                                     ; C381 60                       `
; ----------------------------------------------------------------------------
LC382:  .byte   $00,$06,$0C,$12,$18,$1E,$24,$2A ; C382 00 06 0C 12 18 1E 24 2A  ......$*
        .byte   $30,$36                         ; C38A 30 36                    06
; ----------------------------------------------------------------------------
LC38C:  ldx     ST                              ; C38C A6 BA                    ..
        bne     LC3AC                           ; C38E D0 1C                    ..
        pha                                     ; C390 48                       H
        ldy     #$F0                            ; C391 A0 F0                    ..
LC393:  lda     VIA2_PORTB                      ; C393 AD 80 F8                 ...
        and     #$40                            ; C396 29 40                    )@
        bne     LC3B0                           ; C398 D0 16                    ..
        lda     StopKeyFlag                     ; C39A A5 AD                    ..
        lsr     a                               ; C39C 4A                       J
        lda     #$00                            ; C39D A9 00                    ..
        bcs     LC3AB                           ; C39F B0 0A                    ..
        ldx     #$01                            ; C3A1 A2 01                    ..
        jsr     WaitXticks_                     ; C3A3 20 E4 BF                  ..
        dey                                     ; C3A6 88                       .
        bne     LC393                           ; C3A7 D0 EA                    ..
        lda     #$01                            ; C3A9 A9 01                    ..
LC3AB:  plx                                     ; C3AB FA                       .
LC3AC:  sec                                     ; C3AC 38                       8
        jmp     SetST                           ; C3AD 4C CA FC                 L..
; ----------------------------------------------------------------------------
LC3B0:  ldx     #$03                            ; C3B0 A2 03                    ..
LC3B2:  dex                                     ; C3B2 CA                       .
        bpl     LC3B2                           ; C3B3 10 FD                    ..
        pla                                     ; C3B5 68                       h
        sta     VIA2_PORTA                      ; C3B6 8D 81 F8                 ...
        lda     #$20                            ; C3B9 A9 20                    . 
        trb     VIA2_PORTB                      ; C3BB 1C 80 F8                 ...
        tsb     VIA2_PORTB                      ; C3BE 0C 80 F8                 ...
        lda     #$02                            ; C3C1 A9 02                    ..
        tsb     VIA2_PCR                        ; C3C3 0C 8C F8                 ...
        trb     VIA2_PCR                        ; C3C6 1C 8C F8                 ...
        clc                                     ; C3C9 18                       .
        rts                                     ; C3CA 60                       `
; ----------------------------------------------------------------------------
LC3CB:  pha                                     ; C3CB 48                       H
        lda     LC44A,x                         ; C3CC BD 4A C4                 .J.
        bra     LC3D5                           ; C3CF 80 04                    ..
LC3D1:  pha                                     ; C3D1 48                       H
        lda     LC444,x                         ; C3D2 BD 44 C4                 .D.
LC3D5:  cpx     #$00                            ; C3D5 E0 00                    ..
        bne     LC3DC                           ; C3D7 D0 03                    ..
        clc                                     ; C3D9 18                       .
LC3DA:  pla                                     ; C3DA 68                       h
        rts                                     ; C3DB 60                       `
; ----------------------------------------------------------------------------
LC3DC:  cpx     #$07                            ; C3DC E0 07                    ..
        bcs     LC3DA                           ; C3DE B0 FA                    ..
        plx                                     ; C3E0 FA                       .
        phy                                     ; C3E1 5A                       Z
        tay                                     ; C3E2 A8                       .
        txa                                     ; C3E3 8A                       .
LC3E4:  phy                                     ; C3E4 5A                       Z
        ldx     LC416,y                         ; C3E5 BE 16 C4                 ...
        jsr     LC3F1                           ; C3E8 20 F1 C3                  ..
        ply                                     ; C3EB 7A                       z
        iny                                     ; C3EC C8                       .
        bcs     LC3E4                           ; C3ED B0 F5                    ..
        ply                                     ; C3EF 7A                       z
        rts                                     ; C3F0 60                       `
; ----------------------------------------------------------------------------
LC3F1:  jmp     (LC3F4,x)                       ; C3F1 7C F4 C3                 |..
LC3F4:  .addr   LC486                           ; C3F4 86 C4                    ..
        .addr   LC4C5                           ; C3F6 C5 C4                    ..
        .addr   LC488                           ; C3F8 88 C4                    ..
        .addr   LC496                           ; C3FA 96 C4                    ..
        .addr   LC5BC                           ; C3FC BC C5                    ..
        .addr   LC5AE                           ; C3FE AE C5                    ..
        .addr   LC5E3                           ; C400 E3 C5                    ..
        .addr   LC5F7                           ; C402 F7 C5                    ..
        .addr   LC553                           ; C404 53 C5                    S.
        .addr   LC55D                           ; C406 5D C5                    ].
        .addr   LC4A4                           ; C408 A4 C4                    ..
        .addr   LC58A                           ; C40A 8A C5                    ..
        .addr   LC567                           ; C40C 67 C5                    g.
        .addr   LC4D3                           ; C40E D3 C4                    ..
        .addr   LC513                           ; C410 13 C5                    ..
        .addr   LC59B                           ; C412 9B C5                    ..
        .addr   LC451                           ; C414 51 C4                    Q.
; ----------------------------------------------------------------------------
LC416:  .byte   $02,$04,$06,$08,$0A,$0C,$00,$02 ; C416 02 04 06 08 0A 0C 00 02  ........
        .byte   $06,$08,$0A,$0C,$00,$02,$18,$06 ; C41E 06 08 0A 0C 00 02 18 06  ........
        .byte   $1E,$0A,$1C,$10,$00,$02,$16,$0E ; C426 1E 0A 1C 10 00 02 16 0E  ........
        .byte   $00,$02,$1A,$1C,$10,$00,$04,$06 ; C42E 00 02 1A 1C 10 00 04 06  ........
        .byte   $14,$00,$04,$12,$00,$04,$20,$00 ; C436 14 00 04 12 00 04 20 00  ...... .
        .byte   $06,$14,$00,$12,$00,$20         ; C43E 06 14 00 12 00 20        ..... 
LC444:  .byte   $00,$00,$07,$0D,$15,$15         ; C444 00 00 07 0D 15 15        ......
LC44A:  .byte   $19,$1E,$22,$25,$28,$2B,$2D     ; C44A 19 1E 22 25 28 2B 2D     .."%(+-
; ----------------------------------------------------------------------------
LC451:  cmp     #$5E                            ; C451 C9 5E                    .^
        bcc     LC462                           ; C453 90 0D                    ..
        cmp     #$80                            ; C455 C9 80                    ..
        bcs     LC462                           ; C457 B0 09                    ..
        sec                                     ; C459 38                       8
        sbc     #$5E                            ; C45A E9 5E                    .^
        tay                                     ; C45C A8                       .
        lda     LC464,y                         ; C45D B9 64 C4                 .d.
        clc                                     ; C460 18                       .
        rts                                     ; C461 60                       `
; ----------------------------------------------------------------------------
LC462:  sec                                     ; C462 38                       8
        rts                                     ; C463 60                       `
; ----------------------------------------------------------------------------
LC464:  .byte   $71,$7F,$62,$60,$7B,$AE,$BD,$AD ; C464 71 7F 62 60 7B AE BD AD  q.b`{...
        .byte   $B0,$B1,$3E,$7F,$7A,$56,$AC,$BB ; C46C B0 B1 3E 7F 7A 56 AC BB  ..>.zV..
        .byte   $BE,$BC,$B8,$68,$A9,$B2,$B3,$B1 ; C474 BE BC B8 68 A9 B2 B3 B1  ...h....
        .byte   $AB,$76,$6E,$6D,$B7,$AF,$67,$68 ; C47C AB 76 6E 6D B7 AF 67 68  .vnm..gh
        .byte   $78,$7E                         ; C484 78 7E                    x~
; ----------------------------------------------------------------------------
LC486:  clc                                     ; C486 18                       .
        rts                                     ; C487 60                       `
; ----------------------------------------------------------------------------
LC488:  cmp     #$41                            ; C488 C9 41                    .A
        bcc     LC494                           ; C48A 90 08                    ..
        cmp     #$5B                            ; C48C C9 5B                    .[
        bcs     LC494                           ; C48E B0 04                    ..
        eor     #$20                            ; C490 49 20                    I 
        clc                                     ; C492 18                       .
        rts                                     ; C493 60                       `
; ----------------------------------------------------------------------------
LC494:  sec                                     ; C494 38                       8
        rts                                     ; C495 60                       `
; ----------------------------------------------------------------------------
LC496:  cmp     #$61                            ; C496 C9 61                    .a
        bcc     LC4A2                           ; C498 90 08                    ..
        cmp     #$7B                            ; C49A C9 7B                    .{
        bcs     LC4A2                           ; C49C B0 04                    ..
        eor     #$20                            ; C49E 49 20                    I 
        clc                                     ; C4A0 18                       .
        rts                                     ; C4A1 60                       `
; ----------------------------------------------------------------------------
LC4A2:  sec                                     ; C4A2 38                       8
        rts                                     ; C4A3 60                       `
; ----------------------------------------------------------------------------
LC4A4:  ldx     #$04                            ; C4A4 A2 04                    ..
LC4A6:  cmp     LC4B5,x                         ; C4A6 DD B5 C4                 ...
        beq     LC4B0                           ; C4A9 F0 05                    ..
        dex                                     ; C4AB CA                       .
        bpl     LC4A6                           ; C4AC 10 F8                    ..
        sec                                     ; C4AE 38                       8
        rts                                     ; C4AF 60                       `
; ----------------------------------------------------------------------------
LC4B0:  lda     LC4BD,x                         ; C4B0 BD BD C4                 ...
        clc                                     ; C4B3 18                       .
        rts                                     ; C4B4 60                       `
; ----------------------------------------------------------------------------
LC4B5:  .byte   $7B,$7D,$7E,$60,$5F,$7B,$7D,$60 ; C4B5 7B 7D 7E 60 5F 7B 7D 60  {}~`_{}`
LC4BD:  .byte   $A6,$A8,$5F,$BA,$A4,$E6,$E8,$FA ; C4BD A6 A8 5F BA A4 E6 E8 FA  .._.....
; ----------------------------------------------------------------------------
LC4C5:  cmp     #$80                            ; C4C5 C9 80                    ..
        bcc     LC4D1                           ; C4C7 90 08                    ..
        cmp     #$A0                            ; C4C9 C9 A0                    ..
        bcs     LC4D1                           ; C4CB B0 04                    ..
        and     #$7F                            ; C4CD 29 7F                    ).
        clc                                     ; C4CF 18                       .
        rts                                     ; C4D0 60                       `
; ----------------------------------------------------------------------------
LC4D1:  sec                                     ; C4D1 38                       8
        rts                                     ; C4D2 60                       `
; ----------------------------------------------------------------------------
LC4D3:  cmp     #$60                            ; C4D3 C9 60                    .`
        bcc     LC4E4                           ; C4D5 90 0D                    ..
        cmp     #$80                            ; C4D7 C9 80                    ..
        bcs     LC4E4                           ; C4D9 B0 09                    ..
        sec                                     ; C4DB 38                       8
        sbc     #$60                            ; C4DC E9 60                    .`
LC4DE:  tay                                     ; C4DE A8                       .
        lda     LC4F3,y                         ; C4DF B9 F3 C4                 ...
        clc                                     ; C4E2 18                       .
        rts                                     ; C4E3 60                       `
; ----------------------------------------------------------------------------
LC4E4:  cmp     #$C0                            ; C4E4 C9 C0                    ..
        bcc     LC4F1                           ; C4E6 90 09                    ..
        cmp     #$E0                            ; C4E8 C9 E0                    ..
        bcs     LC4F1                           ; C4EA B0 05                    ..
        sec                                     ; C4EC 38                       8
        sbc     #$C0                            ; C4ED E9 C0                    ..
        bra     LC4DE                           ; C4EF 80 ED                    ..
LC4F1:  sec                                     ; C4F1 38                       8
        rts                                     ; C4F2 60                       `
; ----------------------------------------------------------------------------
LC4F3:  .byte   $61,$73,$60,$61,$7A,$7A,$7B,$7C ; C4F3 61 73 60 61 7A 7A 7B 7C  as`azz{|
        .byte   $7D,$63,$65,$64,$4C,$79,$78,$66 ; C4FB 7D 63 65 64 4C 79 78 66  }cedLyxf
        .byte   $63,$5E,$7B,$6B,$7C,$66,$77,$4F ; C503 63 5E 7B 6B 7C 66 77 4F  c^{k|fwO
        .byte   $7E,$7D,$6A,$62,$60,$60,$7F,$5F ; C50B 7E 7D 6A 62 60 60 7F 5F  ~}jb``._
; ----------------------------------------------------------------------------
LC513:  cmp     #$A0                            ; C513 C9 A0                    ..
        bcc     LC524                           ; C515 90 0D                    ..
        cmp     #$C0                            ; C517 C9 C0                    ..
        bcs     LC524                           ; C519 B0 09                    ..
        sec                                     ; C51B 38                       8
        sbc     #$A0                            ; C51C E9 A0                    ..
LC51E:  tay                                     ; C51E A8                       .
        lda     LC533,y                         ; C51F B9 33 C5                 .3.
        clc                                     ; C522 18                       .
        rts                                     ; C523 60                       `
; ----------------------------------------------------------------------------
LC524:  cmp     #$E0                            ; C524 C9 E0                    ..
        bcc     LC531                           ; C526 90 09                    ..
        cmp     #$FF                            ; C528 C9 FF                    ..
        bcs     LC531                           ; C52A B0 05                    ..
        sec                                     ; C52C 38                       8
        sbc     #$E0                            ; C52D E9 E0                    ..
        bra     LC51E                           ; C52F 80 ED                    ..
LC531:  sec                                     ; C531 38                       8
        rts                                     ; C532 60                       `
; ----------------------------------------------------------------------------
LC533:  .byte   $20,$7C,$7B,$7A,$7B,$7C,$74,$7D ; C533 20 7C 7B 7A 7B 7C 74 7D   |{z{|t}
        .byte   $76,$72,$7D,$76,$6C,$65,$63,$7B ; C53B 76 72 7D 76 6C 65 63 7B  vr}vlec{
        .byte   $66,$75,$73,$74,$7C,$7C,$7D,$7A ; C543 66 75 73 74 7C 7C 7D 7A  fust||}z
        .byte   $7A,$7B,$64,$6D,$6F,$64,$6E,$25 ; C54B 7A 7B 64 6D 6F 64 6E 25  z{dmodn%
; ----------------------------------------------------------------------------
LC553:  cmp     #$FF                            ; C553 C9 FF                    ..
        bne     LC55B                           ; C555 D0 04                    ..
        lda     #$7F                            ; C557 A9 7F                    ..
        clc                                     ; C559 18                       .
        rts                                     ; C55A 60                       `
; ----------------------------------------------------------------------------
LC55B:  sec                                     ; C55B 38                       8
        rts                                     ; C55C 60                       `
; ----------------------------------------------------------------------------
LC55D:  cmp     #$5F                            ; C55D C9 5F                    ._
        bne     LC565                           ; C55F D0 04                    ..
        lda     #$A4                            ; C561 A9 A4                    ..
        clc                                     ; C563 18                       .
        rts                                     ; C564 60                       `
; ----------------------------------------------------------------------------
LC565:  sec                                     ; C565 38                       8
        rts                                     ; C566 60                       `
; ----------------------------------------------------------------------------
LC567:  ldx     #$08                            ; C567 A2 08                    ..
LC569:  cmp     LC581,x                         ; C569 DD 81 C5                 ...
        beq     LC573                           ; C56C F0 05                    ..
        dex                                     ; C56E CA                       .
        bpl     LC569                           ; C56F 10 F8                    ..
        sec                                     ; C571 38                       8
        rts                                     ; C572 60                       `
; ----------------------------------------------------------------------------
LC573:  lda     LC578,x                         ; C573 BD 78 C5                 .x.
        clc                                     ; C576 18                       .
        rts                                     ; C577 60                       `
; ----------------------------------------------------------------------------
LC578:  .byte   $5B,$5C,$5D,$2D,$27,$5F,$5B,$5D ; C578 5B 5C 5D 2D 27 5F 5B 5D  [\]-'_[]
        .byte   $27                             ; C580 27                       '
LC581:  .byte   $A6,$7C,$A8,$5F,$BA,$A4,$E6,$E8 ; C581 A6 7C A8 5F BA A4 E6 E8  .|._....
        .byte   $FA                             ; C589 FA                       .
; ----------------------------------------------------------------------------
LC58A:  ldx     #$07                            ; C58A A2 07                    ..
LC58C:  cmp     LC4BD,x                         ; C58C DD BD C4                 ...
        beq     LC596                           ; C58F F0 05                    ..
        dex                                     ; C591 CA                       .
        bpl     LC58C                           ; C592 10 F8                    ..
        sec                                     ; C594 38                       8
        rts                                     ; C595 60                       `
; ----------------------------------------------------------------------------
LC596:  lda     LC4B5,x                         ; C596 BD B5 C4                 ...
        clc                                     ; C599 18                       .
        rts                                     ; C59A 60                       `
; ----------------------------------------------------------------------------
LC59B:  cmp     #$7B                            ; C59B C9 7B                    .{
        bcc     LC5AC                           ; C59D 90 0D                    ..
        cmp     #$80                            ; C59F C9 80                    ..
        bcs     LC5AC                           ; C5A1 B0 09                    ..
        sec                                     ; C5A3 38                       8
        sbc     #$60                            ; C5A4 E9 60                    .`
        tay                                     ; C5A6 A8                       .
        lda     LC4F3,y                         ; C5A7 B9 F3 C4                 ...
        clc                                     ; C5AA 18                       .
        rts                                     ; C5AB 60                       `
; ----------------------------------------------------------------------------
LC5AC:  sec                                     ; C5AC 38                       8
        rts                                     ; C5AD 60                       `
; ----------------------------------------------------------------------------
LC5AE:  cmp     #$C1                            ; C5AE C9 C1                    ..
        bcc     LC5BA                           ; C5B0 90 08                    ..
        cmp     #$DB                            ; C5B2 C9 DB                    ..
        bcs     LC5BA                           ; C5B4 B0 04                    ..
        eor     #$80                            ; C5B6 49 80                    I.
        clc                                     ; C5B8 18                       .
        rts                                     ; C5B9 60                       `
; ----------------------------------------------------------------------------
LC5BA:  sec                                     ; C5BA 38                       8
        rts                                     ; C5BB 60                       `
; ----------------------------------------------------------------------------
LC5BC:  ldx     #$0A                            ; C5BC A2 0A                    ..
LC5BE:  cmp     LC5CD,x                         ; C5BE DD CD C5                 ...
        beq     LC5C8                           ; C5C1 F0 05                    ..
        dex                                     ; C5C3 CA                       .
        bpl     LC5BE                           ; C5C4 10 F8                    ..
        sec                                     ; C5C6 38                       8
        rts                                     ; C5C7 60                       `
; ----------------------------------------------------------------------------
LC5C8:  lda     LC5D8,x                         ; C5C8 BD D8 C5                 ...
        clc                                     ; C5CB 18                       .
        rts                                     ; C5CC 60                       `
; ----------------------------------------------------------------------------
LC5CD:  .byte   $A6,$A8,$BA,$5F,$A4,$E6,$E8,$FA ; C5CD A6 A8 BA 5F A4 E6 E8 FA  ..._....
        .byte   $7B,$7E,$7F                     ; C5D5 7B 7E 7F                 {~.
LC5D8:  .byte   $7B,$7D,$60,$7E,$5F,$7B,$7D,$60 ; C5D8 7B 7D 60 7E 5F 7B 7D 60  {}`~_{}`
        .byte   $20,$20,$20                     ; C5E0 20 20 20                    
; ----------------------------------------------------------------------------
LC5E3:  cmp     #$A0                            ; C5E3 C9 A0                    ..
        bcc     LC5ED                           ; C5E5 90 06                    ..
        cmp     #$C0                            ; C5E7 C9 C0                    ..
        bcs     LC5ED                           ; C5E9 B0 02                    ..
        bra     LC5F1                           ; C5EB 80 04                    ..
LC5ED:  cmp     #$E0                            ; C5ED C9 E0                    ..
        bcc     LC5F5                           ; C5EF 90 04                    ..
LC5F1:  lda     #$20                            ; C5F1 A9 20                    . 
        clc                                     ; C5F3 18                       .
        rts                                     ; C5F4 60                       `
; ----------------------------------------------------------------------------
LC5F5:  sec                                     ; C5F5 38                       8
        rts                                     ; C5F6 60                       `
; ----------------------------------------------------------------------------
LC5F7:  cmp     #$60                            ; C5F7 C9 60                    .`
        bcc     LC601                           ; C5F9 90 06                    ..
        cmp     #$80                            ; C5FB C9 80                    ..
        bcs     LC601                           ; C5FD B0 02                    ..
        bra     LC605                           ; C5FF 80 04                    ..
LC601:  cmp     #$A0                            ; C601 C9 A0                    ..
        bcc     LC609                           ; C603 90 04                    ..
LC605:  lda     #$20                            ; C605 A9 20                    . 
        clc                                     ; C607 18                       .
        rts                                     ; C608 60                       `
; ----------------------------------------------------------------------------
LC609:  sec                                     ; C609 38                       8
        rts                                     ; C60A 60                       `
; ----------------------------------------------------------------------------
LC60B:  jmp     (LC60E,x)                       ; C60B 7C 0E C6                 |..
LC60E:  .addr   LC618                           ; C60E 18 C6                    ..
        .addr   LC61E                           ; C610 1E C6                    ..
        .addr   LC626                           ; C612 26 C6                    &.
        .addr   LC63F                           ; C614 3F C6                    ?.
        .addr   LC65C                           ; C616 5C C6                    \.
; ----------------------------------------------------------------------------
LC618:  jsr     LC63F                           ; C618 20 3F C6                  ?.
        bcs     LC634                           ; C61B B0 17                    ..
        rts                                     ; C61D 60                       `
; ----------------------------------------------------------------------------
LC61E:  sta     VIA2_T2CL                       ; C61E 8D 88 F8                 ...
        sty     VIA2_T2CH                       ; C621 8C 89 F8                 ...
        bra     LC63F                           ; C624 80 19                    ..
LC626:  php                                     ; C626 08                       .
        sei                                     ; C627 78                       x
        eor     #$FF                            ; C628 49 FF                    I.
        sta     $041A                           ; C62A 8D 1A 04                 ...
        tya                                     ; C62D 98                       .
        eor     #$FF                            ; C62E 49 FF                    I.
        sta     $041B                           ; C630 8D 1B 04                 ...
        .byte   $2C                             ; C633 2C                       ,
LC634:  php                                     ; C634 08                       .
        sei                                     ; C635 78                       x
        inc     $041A                           ; C636 EE 1A 04                 ...
        bne     LC63E                           ; C639 D0 03                    ..
        inc     $041B                           ; C63B EE 1B 04                 ...
LC63E:  .byte   $2C                             ; C63E 2C                       ,
LC63F:  php                                     ; C63F 08                       .
        sei                                     ; C640 78                       x
        lda     $041A                           ; C641 AD 1A 04                 ...
        ora     $041B                           ; C644 0D 1B 04                 ...
        beq     LC654                           ; C647 F0 0B                    ..
        lda     #$10                            ; C649 A9 10                    ..
        tsb     VIA2_ACR                        ; C64B 0C 8B F8                 ...
        sta     VIA2_SR                         ; C64E 8D 8A F8                 ...
        plp                                     ; C651 28                       (
        sec                                     ; C652 38                       8
        rts                                     ; C653 60                       `
; ----------------------------------------------------------------------------
LC654:  lda     #$10                            ; C654 A9 10                    ..
        trb     VIA2_ACR                        ; C656 1C 8B F8                 ...
        plp                                     ; C659 28                       (
        clc                                     ; C65A 18                       .
        rts                                     ; C65B 60                       `
; ----------------------------------------------------------------------------
LC65C:  lda     #$A0                            ; C65C A9 A0                    ..
        tay                                     ; C65E A8                       .
        jsr     LC61E                           ; C65F 20 1E C6                  ..
        lda     #$06                            ; C662 A9 06                    ..
        ldy     #$00                            ; C664 A0 00                    ..
        jmp     LC626                           ; C666 4C 26 C6                 L&.
; ----------------------------------------------------------------------------
; It seems the following routines will be copied from $0338 to the RAM and
; used from there. Guessed purpose: the ROM itself is not always paged in, so
; we need them to be in RAM. Note about the "dummy writes", those (maybe ...)
; used to set/reset flip-flops to switch on/off mapping of various parts of
; the memories, but dunno what exactly :(
; ----------------------------------------------------
; My best guess so far: dummy writes to ...
; * $FA00: enables lower parts of KERNAL to be "seen"
; * $FA80: disables the above but enable ROM mapped from $4000 to be seen
; * $FB00: disables all mapped, but the "high area"
; "High area" is the end of the KERNAL & some I/O registers from
; at $FA00 (or probably from $F800?) and needs to be always (?)
; seen.
; ----------------------------------------------------
; This will be $0338 in RAM. It's even used by BASIC for example, the guessed
; purpose: allow to use RAM for BASIC even at an area where there is BASIC
; ROM paged in (from $4000) during its execution. $033C will be the RAM zp
; loc of LDA (zp),Y op.
LC669:  sta     MMU_MODE_RAM                    ; C669 8D 00 FB                 ...
        lda     ($00),y                         ; C66C B1 00                    ..
        sta     MMU_MODE_APPL                   ; C66E 8D 80 FA                 ...
        rts                                     ; C671 60                       `
; ----------------------------------------------------------------------------
; This will be $0341 in RAM. 
; $0345 will be the RAM zp loc of STA (zp),Y op.
; This routine is also used by BASIC.
; It seems ZP loc of STA is modified in RAM.
        sta     MMU_MODE_RAM                    ; C672 8D 00 FB                 ...
        sta     ($00),y                         ; C675 91 00                    ..
        sta     MMU_MODE_APPL                   ; C677 8D 80 FA                 ...
        rts                                     ; C67A 60                       `
; ----------------------------------------------------------------------------
; This will be $034A in RAM.
; $034E will be the RAM zp loc of LDA (zp),Y op.
        sta     MMU_MODE_RAM                    ; C67B 8D 00 FB                 ...
        lda     ($00),y                         ; C67E B1 00                    ..
        sta     MMU_MODE_KERN                   ; C680 8D 00 FA                 ...
        rts                                     ; C683 60                       `
; ----------------------------------------------------------------------------
; This will be $0353 in RAM.
; $0357 will be the RAM zp loc of LDA (zp),Y op.
        sta     MMU_MODE_APPL                   ; C684 8D 80 FA                 ...
        lda     ($00),y                         ; C687 B1 00                    ..
        sta     MMU_MODE_KERN                   ; C689 8D 00 FA                 ...
        rts                                     ; C68C 60                       `
; ----------------------------------------------------------------------------
; This will be $035C in RAM.
; $0360 will be the RAM zp loc of STA (zp),Y op.
        sta     MMU_MODE_RAM                    ; C68D 8D 00 FB                 ...
        sta     ($00),y                         ; C690 91 00                    ..
        sta     MMU_MODE_KERN                   ; C692 8D 00 FA                 ...
        rts                                     ; C695 60                       `
; ----------------------------------------------------------------------------
KL_RESTOR:
        ldx     #$90                            ; C696 A2 90                    ..
        ldy     #$FA                            ; C698 A0 FA                    ..
        clc                                     ; C69A 18                       .
KL_VECTOR:
        php                                     ; C69B 08                       .
        sei                                     ; C69C 78                       x
        stx     FNptr_lo                        ; C69D 86 AE                    ..
        sty     FNptr_hi                        ; C69F 84 AF                    ..
; This copies the routines from $C669 into the RAM from $338.
        ldx     #$2C                            ; C6A1 A2 2C                    .,
LC6A3:  lda     LC669,x                         ; C6A3 BD 69 C6                 .i.
        sta     FROM_C669,x                     ; C6A6 9D 38 03                 .8.
        dex                                     ; C6A9 CA                       .
        bpl     LC6A3                           ; C6AA 10 F7                    ..
        ldy     #$AE                            ; C6AC A0 AE                    ..
        sty     $034E                           ; C6AE 8C 4E 03                 .N.
        sty     $0360                           ; C6B1 8C 60 03                 .`.
        ldy     #$23                            ; C6B4 A0 23                    .#
LC6B6:  lda     RAMVEC_IRQ,y                    ; C6B6 B9 14 03                 ...
        bcs     LC6BE                           ; C6B9 B0 03                    ..
        jsr     FROM_C67B                       ; C6BB 20 4A 03                  J.
LC6BE:  sta     RAMVEC_IRQ,y                    ; C6BE 99 14 03                 ...
        bcc     LC6C6                           ; C6C1 90 03                    ..
        jsr     FROM_C68D                       ; C6C3 20 5C 03                  \.
LC6C6:  dey                                     ; C6C6 88                       .
        bpl     LC6B6                           ; C6C7 10 ED                    ..
        plp                                     ; C6C9 28                       (
        rts                                     ; C6CA 60                       `
; ----------------------------------------------------------------------------
LC6CB:  sei                                     ; C6CB 78                       x
        ldx     #$23                            ; C6CC A2 23                    .#
LC6CE:  ldy     RAMVEC_IRQ,x                    ; C6CE BC 14 03                 ...
        lda     $03C3,x                         ; C6D1 BD C3 03                 ...
        sta     RAMVEC_IRQ,x                    ; C6D4 9D 14 03                 ...
        tya                                     ; C6D7 98                       .
        sta     $03C3,x                         ; C6D8 9D C3 03                 ...
        dex                                     ; C6DB CA                       .
        bpl     LC6CE                           ; C6DC 10 F0                    ..
        rts                                     ; C6DE 60                       `
; ----------------------------------------------------------------------------
LC6DF:  stz     L03B7                           ; C6DF 9C B7 03                 ...
        stz     $03A1                           ; C6E2 9C A1 03                 ...
        ldx     #$FF                            ; C6E5 A2 FF                    ..
        stx     $03BB                           ; C6E7 8E BB 03                 ...
        txs                                     ; C6EA 9A                       .
        ldx     #$00                            ; C6EB A2 00                    ..
        jsr     LD230                           ; C6ED 20 30 D2                  0.
        jsr     ShowInLineText                  ; C6F0 20 5B FB                  [.
        .byte   $0D                             ; C6F3 0D                       .
        .byte   "COMMODORE LCD MONITOR"         ; C6F4 43 4F 4D 4D 4F 44 4F 52  COMMODOR
                                                ; C6FC 45 20 4C 43 44 20 4D 4F  E LCD MO
                                                ; C704 4E 49 54 4F 52           NITOR
        .byte   $00                             ; C709 00                       .
; ----------------------------------------------------------------------------
        bra     LC748                           ; C70A 80 3C                    .<
LC70C:  cld                                     ; C70C D8                       .
        ldx     #$05                            ; C70D A2 05                    ..
LC70F:  pla                                     ; C70F 68                       h
        sta     $03B5,x                         ; C710 9D B5 03                 ...
        dex                                     ; C713 CA                       .
        bpl     LC70F                           ; C714 10 F9                    ..
        jsr     LB2E4                           ; C716 20 E4 B2                  ..
        jsr     KL_RESTOR                       ; C719 20 96 C6                  ..
        jsr     LFD2A                           ; C71C 20 2A FD                  *.
        tsx                                     ; C71F BA                       .
        stx     $03BB                           ; C720 8E BB 03                 ...
        cpx     #$0A                            ; C723 E0 0A                    ..
        bcs     LC72A                           ; C725 B0 03                    ..
        ldx     #$FF                            ; C727 A2 FF                    ..
        txs                                     ; C729 9A                       .
LC72A:  php                                     ; C72A 08                       .
        jsr     ShowInLineText                  ; C72B 20 5B FB                  [.
        .byte   $0D                             ; C72E 0D                       .
        .byte   "BREAK"                         ; C72F 42 52 45 41 4B           BREAK
        .byte   $00                             ; C734 00                       .
; ----------------------------------------------------------------------------
        plp                                     ; C735 28                       (
        bcs     LC748                           ; C736 B0 10                    ..
        jsr     ShowInLineText                  ; C738 20 5B FB                  [.
        .byte   " STACK RESET"                  ; C73B 20 53 54 41 43 4B 20 52   STACK R
                                                ; C743 45 53 45 54              ESET
        .byte   $00                             ; C747 00                       .
; ----------------------------------------------------------------------------
LC748:  lda     #$C0                            ; C748 A9 C0                    ..
        sta     KernMsg                         ; C74A 8D 83 03                 ...
        lda     #$00                            ; C74D A9 00                    ..
        sta     $CB                             ; C74F 85 CB                    ..
        sta     $CC                             ; C751 85 CC                    ..
        cli                                     ; C753 58                       X
LC754:  jsr     LCC13                           ; C754 20 13 CC                  ..
        bra     LC767                           ; C757 80 0E                    ..
LC759:  jsr     KL_RESTOR                       ; C759 20 96 C6                  ..
        jsr     LFD2A                           ; C75C 20 2A FD                  *.
        jsr     ShowInLineText                  ; C75F 20 5B FB                  [.
        .byte   $1D,$1D                         ; C762 1D 1D                    ..
        .byte   ":?"                            ; C764 3A 3F                    :?
        .byte   $00                             ; C766 00                       .
; ----------------------------------------------------------------------------
LC767:  jsr     PrintNewLine                    ; C767 20 D3 CA                  ..
        stz     $CD                             ; C76A 64 CD                    d.
        ldx     #$00                            ; C76C A2 00                    ..
LC76E:  jsr     LFD3D                           ; C76E 20 3D FD                  =.
        sta     L0470,x                         ; C771 9D 70 04                 .p.
        stx     $CE                             ; C774 86 CE                    ..
        inx                                     ; C776 E8                       .
        cpx     #$50                            ; C777 E0 50                    .P
        beq     LC77F                           ; C779 F0 0