// ============================================
// output - Disassembled Source
// ============================================
// KickAssembler syntax
// Generated by Restore 64 v0.2.1 alpha build 298, 2026-04-01 10:59:24
// https://restore64.dev by datucker / Rabenauge
//
// Load address: $0800  End: $2cc2  (9411 bytes)
// Crunched with Cruncher AB — depacked by emulation
// Packer entry: $080d (via BASIC SYS 2061)
// Entry point:  $2cbc (11452)
// IRQ handler:  $2293 (irq_2293)
// IRQ handler:  $21ec (nmi_21ec)
// IRQ handler:  $ea31 (loc_ea31)
//
// Code: 2849 bytes, Data: 6562 bytes
// Labels: 235, Subroutines: 22
//
// Verification: 5 line(s) auto-corrected to .byte for exact byte matching
//
// Cross-references: all OK
// ============================================


// --- Region $0ab0-$0ab7 ---
.pc = $0ab0 "Program $0ab0"
        .byte $ff,$ff,$2f                           // isc $2fff,x // ILLEGAL
        .byte $af,$ff,$6f                           // lax $6fff // ILLEGAL

dat_0ab6:
        .byte $af,$ff                               // ..

// --- Region $1000-$1006 ---
.pc = $1000 "sub_1000"
// Referenced by: jsr from $2305

sub_1000:
        jmp loc_10d8
// Referenced by: jsr from $23df

sub_1003:
        jmp loc_10e6

dat_1006:
        .byte $01                                   // .

// --- Region $10d8-$1723 ---
.pc = $10d8 "loc_10d8"

loc_10d8:
        lda dat_1006
        cmp #$01
        beq loc_1153
        cmp #$02
        bne loc_111f
        jmp loc_1148

loc_10e6:
        tax
        lda $199a,x
        sta $1046
        txa
        sta $107c
        ldx #$00
        asl
        asl
        clc
        adc $107c
        adc $107c
        tay

loc_10fd:
        lda $1855,y
        sta $184f,x
        iny
        inx
        cpx #$06
        bne loc_10fd
        ldy #$00
        lda $107c
        asl
        adc $107c
        tax

loc_1113:
        lda $1007,y
        sta $1007,y
        inx
        iny
        cpy #$03
        bne loc_1113

loc_111f:
        ldx #$02
        lda #$00

loc_1123:
        sta $1030,x
        sta $102a,x
        sta $1027,x
        sta $101e,x
        sta $1080,x
        sta $1021,x
        sta $1083,x
        sta $1024,x
        dex
        bpl loc_1123
        lda #$1f
        sta $1154
        lda #$01
        sta dat_1006

loc_1148:
        ldx #$18
        lda #$00

loc_114c:
        sta $d400,x
        dex
        bpl loc_114c
        rts

loc_1153:
        lda #$1f
        sta $d418
        ldx #$02
        stx $100c
        dec $1042
        bpl loc_1168
        lda $1046
        sta $1042

loc_1168:
        lda $101a,x
        sta $101d
        lda $1042
        cmp $1046
        bne loc_1195
        txa
        asl
        tay
        lda $184f,y
        sta $14
        lda $1850,y
        sta $15
        dec $1024,x
        bpl loc_118b
        jmp loc_154f

loc_118b:
        lda $1064,x
        beq loc_1195
        lda #$fe
        sta $1033,x

loc_1195:
        lda $1030,x
        asl
        asl
        asl
        tay
        sty $1049
        lda $18b3,y
        and #$f0
        sta $103b
        lda $18b6,y
        and #$0f
        sta $1057
        cmp #$04
        bcs loc_11b8
        lda $18b4,y
        bne loc_11bb

loc_11b8:
        jmp loc_1249

loc_11bb:
        lda $1064,x
        cmp #$02
        bcs loc_11de
        ldy $1049
        lda $18b4,y
        pha
        and #$0f
        sta $1014,x
        pla
        and #$f0
        sta $1011,x
        lda $18b2,y
        lsr
        lsr
        lsr
        lsr
        sta $1017,x

loc_11de:
        lda $1017,x
        cmp #$ff
        beq loc_1203
        dec $1017,x
        lda $1017,x
        cmp #$ff
        bne loc_1249
        lda $1014,x
        and #$fe
        sta $1014,x
        lda $1014,x
        and #$7f
        lsr
        sta $100e,x
        jmp loc_1249

loc_1203:
        lda $100e,x
        bpl loc_122a
        clc
        lda tbl_hi_107d,x
        adc $1011,x
        sta tbl_hi_107d,x
        lda $103f,x
        adc #$00
        sta $103f,x
        dec $100e,x
        bmi loc_1249
        lda $1014,x
        and #$7f
        sta $100e,x
        jmp loc_1249

loc_122a:
        sec
        lda tbl_hi_107d,x
        sbc $1011,x
        sta tbl_hi_107d,x
        lda $103f,x
        sbc #$00
        sta $103f,x
        dec $100e,x
        bpl loc_1249
        lda $1014,x
        ora #$80
        sta $100e,x

loc_1249:
        lda $103b
        beq loc_12a3
        ldy $1049
        lda $18b2,y
        and #$0f
        sta $1271
        lda $1054,x
        bne loc_127b
        lda $105b,x
        clc
        adc $103b
        sta $105b,x
        lda $105e,x
        adc #$00
        sta $105e,x
        cmp #$0f
        bne loc_1294
        lda #$01
        sta $1054,x
        bne loc_1294

loc_127b:
        lda $105b,x
        sec
        sbc $103b
        sta $105b,x
        lda $105e,x
        sbc #$00
        sta $105e,x
        bne loc_1294
        lda #$00
        sta $1054,x

loc_1294:
        ldy $101d
        lda $105e,x
        sta $d403,y
        lda $105b,x
        sta $d402,y

loc_12a3:
        lda $1083,x
        beq loc_130c
        lda tbl_lo_1078,x
        beq loc_12e7
        clc
        lda tbl_hi_107d,x
        adc $1077
        sta tbl_hi_107d,x
        lda $103f,x
        adc #$00
        sta $103f,x
        cmp $1073,x
        beq loc_12c8
        bcs loc_12d4
        bcc loc_130c

loc_12c8:
        lda tbl_hi_107d,x
        cmp $1070,x
        beq loc_12d4
        bcs loc_12d4
        bcc loc_130c

loc_12d4:
        lda $1070,x
        sta tbl_hi_107d,x
        lda $1073,x
        sta $103f,x
        lda #$00
        sta $1083,x
        beq loc_130c

loc_12e7:
        sec
        lda tbl_hi_107d,x
        sbc $1077
        sta tbl_hi_107d,x
        lda $103f,x
        sbc #$00
        sta $103f,x
        cmp $1073,x
        beq loc_1302
        bcc loc_12d4
        bcs loc_130c

loc_1302:
        lda tbl_hi_107d,x
        cmp $1070,x
        beq loc_12d4
        bcc loc_12d4

loc_130c:
        ldy $1049
        lda $1064,x
        cmp #$02
        bcc loc_1324
        lda $18af,y
        pha

loc_131a:
        lda $103f,x
        pha
        lda tbl_hi_107d,x
        jmp loc_1336

loc_1324:
        lda $18b6,y
        and #$f0
        clc
        adc #$01
        pha
        cmp #$81
        bne loc_131a
        lda #$c0
        pha
        lda #$00

loc_1336:
        sta $104e,x
        pla
        sta $104b,x
        pla
        sta $102a,x
        lda $1057
        cmp #$0f
        bne loc_1387
        lda $1051,x
        sec
        sbc $1024,x
        cmp #$01
        bcc loc_136a
        lda $18b4,y
        cmp #$80
        bcs loc_136d
        sta $1076
        lda $103f,x
        clc
        adc $1076
        sta $104b,x
        sta $103f,x

loc_136a:
        jmp loc_14a6

loc_136d:
        sec
        sbc #$80
        sta $1076
        lda $103f,x
        sec
        sbc $1076
        cmp #$0a
        bcc loc_136a
        sta $104b,x
        sta $103f,x
        jmp loc_14a6

loc_1387:
        lda $1057
        and #$02
        beq loc_13f4
        lda $1064,x
        cmp #$02
        bcs loc_13b6
        ldy $1049
        lda $10d3
        sta $100b
        lda $18b5,y
        pha
        and #$0f
        sta $10d2
        sta $100a
        pla
        and #$f0
        clc
        adc #$0f
        sta $10d4
        sta $100d

loc_13b6:
        lda $10d5,x
        sta $d417
        lda $100a
        bne loc_13c9
        lda $100b
        bne loc_13db
        jmp loc_13fe

loc_13c9:
        dec $100a
        lda $100d
        clc
        adc #$08
        sta $100d
        sta $d416
        jmp loc_13fe

loc_13db:
        dec $100b
        lda #$00
        cmp $100d
        bcs loc_13fe
        lda $100d
        sec
        sbc #$08
        sta $100d
        sta $d416
        jmp loc_13fe

loc_13f4:
        dec $100c
        bpl loc_13fe
        lda #$f0
        sta $d417

loc_13fe:
        lda $1057
        and #$04
        beq loc_145e
        lda $18b4,y
        cmp #$20
        bcs loc_1416
        lda #$00
        sta $144d
        sta $1455
        beq loc_142a

loc_1416:
        lda $102d,x
        asl
        tay
        lda $170b,y
        sta $1455
        lda $170c,y
        sta $144d
        ldy $1049

loc_142a:
        lda $18b4,y
        asl
        asl
        asl
        sta $1086
        tya
        pha
        lda $1064,x
        cmp #$09
        bcs loc_1459
        clc
        adc $1086
        tay
        dey
        lda $10af,y
        sta $102a,x
        lda $108f,y
        clc
        adc #$00
        sta $104b,x
        lda #$00
        clc
        adc #$00
        sta $104e,x

loc_1459:
        pla
        tay
        jmp loc_14a6

loc_145e:
        lda $1057
        and #$08
        beq loc_14a6
        lda $18b4,y
        beq loc_147b
        pha
        lsr
        lsr
        lsr
        lsr
        sta $106e
        pla
        and #$0f
        sta $106f
        jmp loc_1484

loc_147b:
        lda #$0c
        sta $106e
        asl
        sta $106f

loc_1484:
        dec $1067
        bpl loc_148e
        lda #$02
        sta $1067

loc_148e:
        ldy $1067
        lda $102d,x
        clc
        adc $106d,y
        asl
        tay
        lda $170b,y
        sta $104e,x
        lda $170c,y
        sta $104b,x

loc_14a6:
        ldy $101d
        lda $104b,x
        sta $d401,y
        lda $104e,x
        sta $d400,y
        lda $102a,x
        and $1033,x
        sta $d404,y
        inc $1064,x
        dex
        bmi loc_1505
        jmp loc_1168
// Referenced by: jsr from $16a2

sub_14c7:
        lda $18b0,x
        and #$10
        bne loc_1518
        lda $18b0,x
        and #$0f
        asl
        asl
        asl
        asl
        sta $14f1
        txa
        tay
        ldx $1038
        lda $108c,x
        beq loc_1506
        cmp #$01
        beq loc_14f8
        lda $1089,x
        cmp #$10
        bcc loc_1505
        sec
        sbc #$10
        sta $1089,x
        jmp loc_1502

loc_14f8:
        lda $1089,x
        sec
        sbc $18b5,y
        sta $1089,x

loc_1502:
        inc $108c,x

loc_1505:
        rts

loc_1506:
        lda $18b1,y
        sta $1089,x
        jmp loc_1502
// Referenced by: jsr from $1580, $158c, $1598, $15a5

sub_150f:
        inc $101e,x
// Referenced by: jsr from $154f, $1569

sub_1512:
        ldy $101e,x
        lda ($14),y
        rts

loc_1518:
        lda $18b0,x
        and #$0f
        asl
        asl
        asl
        asl
        sta $153b
        txa
        tay
        ldx $1038
        lda $108c,x
        beq loc_1506
        cmp #$01
        beq loc_1542
        lda $1089,x
        cmp #$fe
        bcs loc_1505
        clc
        adc #$10
        sta $1089,x
        jmp loc_1502

loc_1542:
        lda $1089,x
        clc
        adc $18b5,y
        sta $1089,x
        jmp loc_1502

loc_154f:
        jsr sub_1512
        cmp #$ff
        bne loc_156c
        lda #$00
        sta $1024,x
        sta $1021,x
        sta $101e,x
        sta $1027,x
        lda #$1f
        sta $1154
        jsr sub_1512

loc_156c:
        cmp #$fe
        bne loc_1576
        lda #$02
        sta dat_1006
        rts

loc_1576:
        cmp #$74
        bcc loc_1583
        sec
        sbc #$80
        sta $10cf,x
        jsr sub_150f

loc_1583:
        cmp #$60
        bcc loc_158f
        and #$0f
        sta $1080,x
        jsr sub_150f

loc_158f:
        cmp #$50
        bcc loc_159b
        and #$0f
        sta $1027,x
        jsr sub_150f

loc_159b:
        cmp #$40
        bcc loc_15a8
        sec
        sbc #$30
        sta $1154
        jsr sub_150f

loc_15a8:
        tay
        lda $1007,x
        beq loc_15b6
        lda #$ff
        sta $1024,x
        jmp loc_14a6

loc_15b6:
        tya
        asl
        tay
        lda $17cf,y
        sta $f8
        lda $17d0,y
        sta $f9
        lda #$00
        sta $1064,x
        sta $1083,x
        lda #$ff
        sta $1033,x
        ldy $1021,x
        lda ($f8),y
        cmp #$ff
        bne loc_15e4
        lda #$00
        sta $1021,x
        inc $101e,x
        jmp loc_14a6

loc_15e4:
        cmp #$e0
        bcc loc_1632
        and #$0f
        asl
        asl
        asl
        asl
        sta $1077
        lda #$01
        sta $1083,x
        lda $102d,x
        sta $1609
        jsr sub_164a
        lda ($f8),y
        clc
        adc $10cf,x
        sta $103a
        cmp #$05
        bcc loc_1613
        lda #$01
        sta tbl_lo_1078,x
        bne loc_1618

loc_1613:
        lda #$00
        sta tbl_lo_1078,x

loc_1618:
        lda $1051,x
        sta $1024,x
        lda $103a
        asl
        tay
        lda $170b,y
        sta $1070,x
        lda $170c,y
        sta $1073,x
        jmp loc_16dc

loc_1632:
        jsr sub_1638
        jmp loc_165e
// Referenced by: jsr from $1632

sub_1638:
        cmp #$c0
        bcc loc_1650
        and #$1f
        clc
        adc $1080,x
        sta $1030,x
        lda #$00
        sta $108c,x
// Referenced by: jsr from $15fc

sub_164a:
        inc $1021,x
        iny
        lda ($f8),y

loc_1650:
        cmp #$80
        bcc loc_165d
        and #$3f
        sta $1051,x
        inc $1021,x
        iny

loc_165d:
        rts

loc_165e:
        lda ($f8),y
        and #$7f
        clc
        adc $10cf,x
        sta $102d,x
        asl
        tay
        lda $170b,y
        sta tbl_hi_107d,x
        lda $170c,y
        sta $103f,x
        lda $1051,x
        sta $1024,x
        txa
        sta $1038
        tay
        lda $1030,x
        asl
        asl
        asl
        tax
        lda $18af,x
        sta $1039
        ldy $101d
        lda $18b3,x
        and #$0f
        sta $d403,y
        pha
        lda $18b6,x
        and #$01
        beq loc_16b5
        jsr sub_14c7
        ldy $101d
        lda $1089,x
        sta $d406,y
        lda #$00
        sta $d405,y
        beq loc_16c4

loc_16b5:
        lda $18b1,x
        sta $d406,y
        lda $18b0,x
        sta $d405,y
        ldx $1038

loc_16c4:
        lda #$00
        sta $d402,y
        sta $105b,x
        sta $1054,x
        sta $103c,x
        pla
        sta $105e,x
        lda $1039
        sta $102a,x

loc_16dc:
        inc $1021,x
        ldy $1021,x
        lda ($f8),y
        cmp #$ff
        bne loc_1700

loc_16e8:
        lda #$00
        sta $1021,x
        sta $1080,x
        lda $1027,x
        beq loc_16fa
        dec $1027,x
        bne loc_16fd

loc_16fa:
        inc $101e,x

loc_16fd:
        jmp loc_14a6

loc_1700:
        cmp #$fe
        bne loc_16fd
        lda #$01
        sta $1007,x
        bne loc_16e8
        asl $01,x
        .byte $27,$01                               // rla $01 // ILLEGAL
        and $4b01,y
        ora ($5f,x)
        ora ($74,x)
        ora ($8a,x)
        ora ($a1,x)
        ora ($ba,x)
        ora ($d4,x)
        ora ($f0,x)
        ora ($0e,x)
        .byte $02                                   // jam // ILLEGAL

dat_1723:
        .byte $2d                                   // -

// --- Region $17d6-$181c ---
.pc = $17d6 "loc_17d6"

loc_17d6:
        ora $1962,y
        sei
        lda #$f0
        sta $d01a
        lda #$ea
        sta $0315
        lda #$31
        sta $0314
        jsr $fda3
        cli
        jsr $ff5b
        lda #$00
        sta $d020
        sta $d021
        tax

loc_17f9:
        sta $d400,x
        inx
        cpx #$19
        bne loc_17f9
        tax
        lda #$1d
        sta $af
        sta $2e
        lda #$d3
        sta $2d
        sta $ae

loc_180e:
        lda dat_181c,x
        sta $033c,x
        inx
        cpx #$33
        bne loc_180e
        jmp $033c

dat_181c:
        .byte $78                                   // x

// --- Region $21c3-$21f9 ---
.pc = $21c3 "loc_21c3"

loc_21c3:
        sei
        lda #$01
        sta $d01a
        lda #$7f
        sta $dc0d
        lda #$1b
        sta $d011
        lda #$93
        sta $0314
        lda #$22
        sta $0315
        lda #$00
        sta $c1
        cli

loc_21e2:
        lda $dc00
        and $dc01
        and #$10
        bne loc_21e2

nmi_21ec:
        sei
        lda #$37
        sta $01
        jsr $fda3
        jsr $ff5b
        jmp $fce2

// --- Region $2293-$22ba ---
.pc = $2293 "irq_2293"

irq_2293:
        lda $d019
        sta $d019
        ldx $c1
        inx
        cpx #$09
        bne loc_22a2
        ldx #$00

loc_22a2:
        stx $c1
        txa
        clc
        asl
        tax
        lda dat_22ba,x
        sta $20
        lda $22bb,x
        sta $21
        ldy #$05

loc_22b4:
        dey
        bne loc_22b4
        jmp ($0020)

dat_22ba:
        .byte $cc                                   // .

// --- Region $22cc-$2551 ---
.pc = $22cc "loc_22cc"

loc_22cc:
        lda #$31
        sta $d012
        lda #$00
        sta $d020
        sta $d021
        jsr sub_2590
        jsr sub_263c
        jmp $ea31

loc_22e2:
        lda #$70
        sta $d012
        lda #$00
        sta $d020
        lda #$da
        sta $d016
        lda #$06
        sta $d021
        lda #$0e
        sta $d022
        lda #$01
        sta $d023
        lda #$12
        sta $d018
        jsr sub_1000
        jmp $ea81

loc_230b:
        lda #$90
        sta $d012
        lda #$00
        sta $d020
        lda #$d8
        sta $d016
        lda #$06
        sta $d021
        lda #$0e
        sta $d022
        lda #$03
        sta $d023
        jmp $ea81

loc_232c:
        lda #$a0
        sta $d012
        lda #$00
        sta $d020
        lda #$09
        sta $d021
        lda #$0c
        sta $d022
        lda #$07
        sta $d023
        jmp $ea81

loc_2348:
        lda #$b1
        sta $d012
        lda #$00
        sta $d020
        lda #$0b
        sta $d021
        lda #$0c
        sta $d022
        lda #$0f
        sta $d023
        jmp $ea81

loc_2364:
        lda #$c1
        sta $d012
        lda #$00
        sta $d020
        lda #$02
        sta $d021
        lda #$0a
        sta $d022
        lda #$07
        sta $d023
        lda #$01
        ora #$10
        sta $d016
        jmp $ea81

loc_2387:
        lda #$ce
        sta $d012
        lda #$00
        sta $d020
        lda #$03
        ora #$10
        sta $d016
        jmp $ea81

loc_239b:
        lda #$de
        sta $d012
        lda #$00
        sta $d020
        lda #$09
        sta $d021
        lda #$05
        sta $d022
        lda #$07
        sta $d023
        jmp $ea81

loc_23b7:
        lda #$f0
        sta $d012
        lda #$00
        sta $d020
        lda #$d8
        sta $d016
        lda #$09
        sta $d021
        lda #$0c
        sta $d022
        lda #$07
        sta $d023
        jsr sub_2716
        jmp $ea81

// Referenced by: jsr from $2cbd
sub_23db: {
        lda #$00
        tax
        tay
        jsr sub_1003
        lda #$ec
        sta $0318
        lda #$21
        sta $0319
        lda #$00
        sta $d011
        lda #$08
        jsr $ffd2
        lda #$08
        sta $0286
        jsr $e544
        ldx #$00
loop1:
        lda #$ff
        sta $0800,x
        inx
        cpx #$08
        bne loop1
        ldx #$00
loop2:
        lda #$00
        sta $0400,x
        sta $0500,x
        sta $0600,x
        sta $0700,x
        inx
        bne loop2
        ldx #$00
loop3:
        lda $0f00,x
        sta $0403,x
        lda $0f20,x
        sta $042b,x
        lda $0f40,x
        sta $0453,x
        lda $0f60,x
        sta $047b,x
        lda $0f80,x
        sta $04a3,x
        lda $0fa0,x
        sta $04cb,x
        lda $0fc0,x
        sta $04f3,x
        lda $0fe0,x
        sta $051b,x
        inx
        cpx #$20
        bne loop3
        ldx #$00
loop4:
        lda $26ee,x
        sta $0798,x
        inx
        cpx #$28
        bne loop4
        lda #$0f
        sta $d015
        lda #$06
        sta $d017
        lda #$08
        sta $d01d
        lda #$01
        sta $d01c
        lda #$10
        sta $d002
        sta $d004
        lda #$32
        sta $d003
        lda #$48
        sta $d005
        lda #$07
        sta $d027
        lda #$09
        sta $d025
        lda #$0c
        sta $d026
        lda #$00
        sta $d000
        sta $d001
        lda #$00
        sta $d028
        sta $d029
        lda #$0c
        sta $d02a
        lda #$81
        sta $07f8
        lda #$80
        sta $07f9
        sta $07fa
        lda #$86
        sta $07fb
        lda #$e3
        sta $d007
        lda $02a6
        bne skip
        lda #$64
        sta $d006
        jmp $24d4
skip:
        lda #$ce
        sta $d006
done:
        jsr sub_24de
        jsr sub_261f
        jsr sub_26d1
        rts
}

// Referenced by: jsr from $24d4
sub_24de: {
        lda #$53
        sta $ae
        lda #$25
        sta $af
        lda #$90
        sta $b0
        lda #$05
        sta $b1
        lda #$14
        sta $2552
loop:
        ldy #$00
        lda ($ae),y
        and #$3f
        sta dat_2551
        jsr sub_254c
        ldy #$00
        sta ($b0),y
        jsr sub_2543
        ldy #$01
        sta ($b0),y
        jsr sub_2543
        ldy #$28
        sta ($b0),y
        jsr sub_2543
        ldy #$29
        sta ($b0),y
        lda $b0
        clc
        adc #$02
        sta $b0
        lda $b1
        adc #$00
        sta $b1
        dec $2552
        bne skip
        lda $b0
        clc
        adc #$28
        sta $b0
        lda #$14
        sta $2552
skip:
        inc $ae
        bne done
        inc $af
done:
        ldy #$00
        lda ($ae),y
        bne loop
        rts
}
// Referenced by: jsr from $2503, $250a, $2511

sub_2543:
        lda dat_2551
        clc
        adc #$40
        sta dat_2551
// Referenced by: jsr from $24fc

sub_254c:
        tay
        lda dat_1f00,y
        rts

dat_2551:
        .byte $f9                                   // .

// --- Region $2590-$26e7 ---
.pc = $2590 "sub_2590"

// Referenced by: jsr from $22d9
sub_2590: {
        lda $263b
        beq done
        dec $263b
        rts
done:
        jsr sub_25a0
        jsr sub_25a0
        rts
}

// Referenced by: jsr from $2599, $259c
sub_25a0: {
        ldx $237e
        dex
        cpx #$00
        bne done
        jsr sub_25b1
        ldx #$08
done:
        stx $237e
        rts
}
// Referenced by: jsr from $25a8

sub_25b1:
        ldx #$00

loc_25b3:
        lda $06a9,x
        sta $06a8,x
        inx
        cpx #$28
        bne loc_25b3
        ldx dat_2635
        lda $2637,x
        sta $06cf
        inx
        lda $2637,x
        inx
        cpx #$04
        beq loc_25d4
        stx dat_2635
        rts

loc_25d4:
        ldx #$00
        stx dat_2635
        ldy #$00
        lda ($2d),y
        and #$3f
        cmp #$00
        beq sub_261f
        cmp #$1f
        beq loc_262a
        sta $2636
        tax
        lda dat_1f00,x
        sta $2637
        lda $2636
        clc
        adc #$40
        tax
        lda dat_1f00,x
        sta $2639
        lda $2636
        clc
        adc #$80
        tax
        lda dat_1f00,x
        sta $2638
        lda $2636
        clc
        adc #$c0
        tax
        lda dat_1f00,x
        sta $263a
// Referenced by: jsr from $262f

sub_2618:
        inc $2d
        bne loc_261e
        inc $2e

loc_261e:
        rts
// Referenced by: jsr from $24d7; branch from $25e1

sub_261f:
        lda #$85
        sta $2d
        lda #$27
        sta $2e
        jmp loc_25d4

loc_262a:
        lda #$50
        sta $263b
        jsr sub_2618
        jmp loc_25d4

dat_2635:
        .byte $00,$20,$01,$01,$01,$01,$00           // . .....

// Referenced by: jsr from $22dc
sub_263c: {
        lda $26ed
        beq skip
        dec $26ed
        rts
skip:
        jsr sub_2652
        jsr sub_2652
        jsr sub_2652
        jsr sub_2652
        rts
}

// Referenced by: jsr from $2645, $2648, $264b, $264e
sub_2652: {
        ldx $2392
        dex
        cpx #$00
        bne done
        jsr sub_2663
        ldx #$08
done:
        stx $2392
        rts
}
// Referenced by: jsr from $265a

sub_2663:
        ldx #$00

loc_2665:
        lda $0721,x
        sta $0720,x
        inx
        cpx #$28
        bne loc_2665
        ldx dat_26e7
        lda $26e9,x
        sta $0747
        inx
        lda $26e9,x
        inx
        cpx #$04
        beq loc_2686
        stx dat_26e7
        rts

loc_2686:
        ldx #$00
        stx dat_26e7
        ldy #$00
        lda ($3d),y
        and #$3f
        cmp #$00
        beq sub_26d1
        cmp #$1f
        beq loc_26dc
        sta $26e8
        tax
        lda dat_1f00,x
        sta $26e9
        lda $26e8
        clc
        adc #$40
        tax
        lda dat_1f00,x
        sta $26eb
        lda $26e8
        clc
        adc #$80
        tax
        lda dat_1f00,x
        sta $26ea
        lda $26e8
        clc
        adc #$c0
        tax
        lda dat_1f00,x
        sta $26ec
// Referenced by: jsr from $26e1

sub_26ca:
        inc $3d
        bne loc_26d0
        inc $3e

loc_26d0:
        rts
// Referenced by: jsr from $24da; branch from $2693

sub_26d1:
        lda #$3f
        sta $3d
        lda #$2a
        sta $3e
        jmp loc_2686

loc_26dc:
        lda #$50
        sta $26ed
        jsr sub_26ca
        jmp loc_2686

dat_26e7:
        .byte $02                                   // .

// --- Region $2716-$275f ---
.pc = $2716 "sub_2716"
// Referenced by: jsr from $23d5

sub_2716:
        inc dat_2760
        lda dat_2760
        cmp #$04
        beq loc_2721
        rts

loc_2721:
        lda #$00
        sta dat_2760
        inc $2761

loc_2729:
        ldx $2761
        lda $2763,x
        cmp #$ff
        bne loc_275c
        ldx #$00
        stx $2761
        inc $2762

loc_273b:
        ldx $2762
        lda $276c,x
        cmp #$ff
        bne loc_274d
        ldx #$00
        stx $2762
        jmp loc_273b

loc_274d:
        sta $d000
        ldx $2762
        lda $2779,x
        sta $d001
        jmp loc_2729

loc_275c:
        sta $07f8
        rts

// --- Region $2cbc-$2cc2 ---
.pc = $2cbc "main_2cbc"

main_2cbc:
        sei
        jsr sub_23db
        jmp loc_21c3

// ============================================
// Data blocks
// ============================================

// --- Region $0801-$0aaf ---
.pc = $0801 "dat_0801"

dat_0801:
        // === BASIC loader stub ===
        .byte $0b,$08                                                     // [corrected] was: .byte $0c,$08                               // next line pointer ($080c)
        .byte $14,$00                                                     // [corrected] was: .byte $00,$00                               // line number 0
        .byte $9e                                   // SYS token
        .byte $80,$00,$ff,$ff,$ff
        .byte $ff                                                         // [corrected] was: .byte $00                                   // end of line
        .byte $ff,$ff                                                     // [corrected] was: .byte $00,$00                               // end of BASIC program
        .byte $ff,$ff,$00,$55,$af,$a4,$91,$4f,$1f,$0f,$00,$55,$af,$a4,$91,$4f // ...U...O...U...O
        .byte $15,$00,$00,$55,$af,$af,$9f,$4f,$15,$00,$00,$55,$eb,$e7,$d3,$c7 // ...U...O...U....
        .byte $15,$00,$00,$55,$af,$ac,$9d,$4f,$15,$00,$0f,$5f,$af,$a4,$91,$4f // ...U...O..._...O
        .byte $1f,$0f,$00,$55,$f9,$f4,$f1,$f6,$15,$00,$00,$41,$ff,$ff,$ff,$af // ...U.......A....
        .byte $91,$c6,$0f,$5f,$ad,$a4,$91,$46,$1f,$0f,$0f,$5f,$af,$af,$9f,$4f // ..._...F..._...O
        .byte $15,$00,$3f,$5f,$ab,$a4,$91,$4e,$1f,$0f,$00,$55,$af,$a4,$91,$46 // ..?_...N...U...F
        .byte $1d,$0f,$00,$55,$af,$a4,$91,$ff,$15,$00,$00,$55,$f9,$f4,$f1,$f6 // ...U.......U....
        .byte $f5,$f0,$0f,$5f,$af,$af,$93,$c6,$f5,$fc,$0f,$5f,$ad,$a4,$91,$47 // ..._......._...G
        .byte $1f,$3f,$0f,$57,$e9,$f4,$f1,$c6,$17,$0f,$0f,$57,$e9,$f4,$f1,$f6 // .?.W.......W....
        .byte $f5,$f0,$00,$55,$fd,$f4,$d1,$46,$15,$00,$f0,$f5,$f9,$f4,$f1,$ff // ...U...F........
        .byte $f5,$f0,$c3,$e7,$ef,$ff,$ff,$ff,$ff,$ff,$c3,$d7,$90,$91,$db,$aa // ................
        .byte $22,$d3,$f0,$f6,$ff,$fc,$f5,$c0,$cb,$ff,$fc,$fd,$fc,$fe,$ff,$ff // "...............
        .byte $ff,$ff,$f0,$c6,$63,$0f,$1f,$67,$c2,$f0,$fc,$fc,$ff,$ff,$ff,$ff // ....c..g........
        .byte $fd,$fc,$ff,$f0,$f4,$41,$44,$f2,$f0,$ff,$ff,$ff,$ff,$ff,$ff,$f0 // .....AD.........
        .byte $f6,$fb,$ff,$ff,$ff,$e4,$d1,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$f0 // ................
        .byte $f6,$ff,$ff,$ff,$ff,$fc,$f5,$c0,$cb,$ff,$00,$55,$af,$ac,$91,$47 // ...........U...G
        .byte $15,$00,$f0,$d5,$e9,$f4,$f1,$f6,$d5,$c0,$00,$55,$ff,$a4,$91,$4f // ...........U...O
        .byte $15,$00,$00,$55,$ff,$f4,$f1,$ff,$55,$00,$0c,$5d,$ad,$a4,$91,$fe // ...U....U..]....
        .byte $fd,$fc,$00,$55,$ff,$ff,$ff,$ff,$ff,$ff,$00,$55,$af,$a4,$91,$ff // ...U.......U....
        .byte $ff,$ff,$ff,$f0,$f4,$ff,$ff,$f0,$f4,$ff,$ff,$f0,$f4,$ff,$ff,$f0 // ................
        .byte $f4,$f3,$fc,$f4,$d3                   // .....

txt_0953:
        .text "O/G"
        .byte $d0                                   // 'P' | $80 (end-of-string marker)
        .byte $fc,$ff,$ff,$f5,$f4,$ff,$f4,$f1,$ff,$fc,$fd,$ff,$ff,$ff,$ff,$fd // ................
        .byte $fc,$00,$55,$af,$f4,$f1,$ff,$f5,$f0,$03,$47,$db,$6b,$ab,$eb,$d7 // ..U.......G.k...
        .byte $c3,$03,$47,$db,$6f,$af,$eb,$57,$03,$03,$47,$db,$ff,$ff,$eb,$57 // ..G.o..W..G....W
        .byte $03,$03,$47,$db,$eb,$eb,$eb,$57,$03,$03,$47,$ff,$7f,$bf,$ff,$57 // ..G....W..G....W
        .byte $03,$03,$47,$ff,$7f,$bf,$ff,$ff,$ff,$03,$47,$ff,$6b,$ab,$eb,$57 // ..G.......G.k..W
        .byte $03,$c3,$c7,$db,$6b,$ab,$eb,$d7,$c3,$03,$47,$3f,$7f,$bf,$bf,$57 // ....k.....G?...W
        .byte $03,$03,$53,$c7,$db,$eb,$eb,$a7,$9f,$c3,$47,$1f,$7f,$bf,$af,$57 // ..S.......G....W
        .byte $c3,$ff,$ff,$ff,$ff,$ff,$ff,$57,$03,$f3,$c7,$1b,$6b,$ab,$eb,$d7 // .......W....k...
        .byte $c3,$c3,$c7,$db,$eb,$ab,$ab,$57,$c3,$03,$47,$db,$6b,$ab,$ff,$ff // .......W..G.k...
        .byte $ff,$03,$47,$db,$eb,$ab,$ab,$55,$00,$03,$47,$db,$6b,$ab,$bf,$5f // ..G....U..G.k.._
        .byte $03,$03,$47,$3f,$7f,$bf,$bf,$7f,$3f,$c3,$c7,$db,$eb,$eb,$eb,$57 // ..G?....?......W
        .byte $03,$c3,$c7,$db,$eb,$ab,$af,$7f,$ff,$c3,$c7,$db,$6b,$ab,$ab,$d7 // ............k...
        .byte $f3,$c3,$47,$1f,$7f,$bf,$bf,$7f,$3f,$03,$47,$1b,$6f,$bf,$ff,$57 // ..G.....?.G.o..W
        .byte $03,$3f,$7f,$3f,$7f,$bf,$ff,$7f,$3f,$0f,$9f,$bf,$ff,$ff,$ff,$ff // .?.?....?.......
        .byte $ff,$0f,$5f,$43,$4b,$6f,$a3,$83,$4f,$f0,$d4,$53,$af,$bf,$d3,$e3 // .._CKo..O..S....
        .byte $ff                                   // .

txt_0a48:
        .text "??"
        .byte $bf                                   // '?' | $80 (end-of-string marker)
        .byte $ff,$ff,$ff,$ff,$ff,$3f,$3f,$ff,$ff,$ff,$ff,$bf,$3f,$0f,$63,$c6 // .....??.....?.c.
        .byte $f0,$f8,$e6,$43,$0f,$ff,$ff,$ff,$2f,$af,$ff,$ff,$ff,$ff,$ff,$ff // ...C..../.......
        .byte $6f,$af,$ff,$ff,$ff,$f0,$d4,$53,$af,$bf,$ff,$ff,$ff,$03,$47,$1b // o......S......G.
        .byte $6b,$eb,$eb,$57,$03,$3f,$7f,$3f,$7f,$bf,$bf,$5f,$0f,$03,$47,$db // k..W.?.?..._..G.
        .byte $6b,$ab,$ff,$57,$03,$03,$47,$db,$6b,$ab,$eb,$57,$03,$3f,$7f,$3f // k..W..G.k..W.?.?
        .byte $6b,$ab,$bf,$7f,$3f,$03,$47,$db,$eb,$eb,$eb,$d7,$c3,$3f,$bf,$ff // k...?.G......?..
        .byte $ff,$ff,$ff,$bf,$3f                   // ....?

// --- Region $0ab8-$0fff ---
.pc = $0ab8 "txt_0ab8"

txt_0ab8:
        .text "?/"
        .byte $cb                                   // 'K' | $80 (end-of-string marker)
        .byte $f2,$f4,$e2,$0b,$3f,$03,$47,$db,$6b,$ab,$ff,$7f,$3f,$ff,$ff,$ff // ....?.G.k...?...
        .byte $ff,$ff,$ff,$ff,$fc,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$3f,$ff,$ff,$ff // ............?...
        .byte $ff,$f0,$c5,$1a,$19,$ff,$ff,$f0,$05,$5a,$a9,$95,$50,$ff,$0f,$53 // .........Z..P..S
        .byte $53,$93,$53,$03,$33,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$f0,$f1,$c6,$c6 // S.S.3...........
        .byte $19,$19,$19,$19,$15,$4f,$93,$53,$4c,$0c,$0c,$3c,$3c,$15,$15,$c5 // .....O.SL..<<...
        .byte $f1,$f1,$f1,$f1,$f1,$43,$53,$93,$93,$93,$93,$93,$93,$f3,$f3,$f3 // .....CS.........
        .byte $f3,$f3,$f3,$f3,$f3,$ff,$ff,$ff,$fc,$fc,$fc,$fc,$fc,$c5,$1a,$19 // ................
        .byte $69,$64,$64,$64
        .text "T?OO"
        .byte $03
        .byte $33,$f3,$f3,$f3,$c4,$c0,$f3
        .byte $fc,$ff,$ff,$ff,$f0,$33,$f3,$cf,$3f,$ff,$f0,$05,$55,$ff,$ff,$ff // .....3..?...U...
        .byte $ff,$ff,$ff,$3f,$3f,$f1,$f1,$f1,$f1,$f1,$f1,$f1,$f1,$93,$93,$93 // ...??...........
        .byte $93,$93,$93,$93,$93,$ff,$ff,$ff,$ff,$ff,$f0,$c5,$c6,$ff,$ff,$ff // ................
        .byte $ff,$ff,$00,$55,$aa,$ff,$ff,$ff,$ff,$ff,$0f,$53,$93,$ff,$ff,$ff // ...U.......S....
        .byte $ff,$ff,$f0,$05,$5a,$ff,$ff,$ff,$ff,$ff,$0f,$50,$a5,$ff,$ff,$ff // ....Z......P....
        .byte $ff,$ff,$fc,$c1,$15,$ff,$ff,$ff,$ff,$ff,$3f,$4f,$4c,$ff,$ff,$ff // ..........?OL...
        .byte $ff,$ff,$c0,$15,$6a,$ff,$ff,$ff,$ff,$ff,$3f,$4f,$43,$00,$03,$cf // ....j.....?OC...
        .byte $f0,$ff,$ff,$fc,$c1,$cf,$cf,$3f,$ff,$ff,$c3,$14,$54,$ff,$fc,$f1 // .......?....T...
        .byte $f1,$f1,$f0,$ff,$ff,$05,$5a,$a9,$95,$54,$55,$19,$19,$a9,$95,$50 // ......Z..TU....P
        .byte $03                                   // .

txt_0bcc:
        .text "????????????"
        .byte $f3,$f3,$f3,$f3,$f3,$f3,$f0,$f0,$f2,$f1,$c6,$c9,$19,$25,$65,$94 // .............%e.
        .byte $55,$94,$50,$43,$4f,$0f,$3f,$3f,$55,$00,$ff,$fc,$fc,$f3,$f3,$cf // U.PCO.??U.......
        .byte $43,$0f,$3f,$ff,$ff,$ff,$ff,$ff,$fc,$f1,$f1,$f1,$f1,$f1,$fc,$ff // C.?.............
        .byte $69,$a4,$90,$93,$93,$53,$03,$00,$55,$00,$f0,$f3,$cf,$cf,$cf,$3f // i....S..U......?
        .byte $55,$00,$0c,$f0,$f1,$fc,$fc,$fc,$5a,$05,$00,$53,$90,$94,$64,$64 // U.......Z..S..dd
        .byte $4f,$03,$33,$f3,$fc,$fc,$fc,$fc,$ff,$ff,$fc,$fc,$fc,$fc,$ff,$ff // O.3.............
        .byte $c1,$16,$6a,$65,$54,$05,$c6,$c6,$6a,$a5,$54,$40,$0f,$4f,$4f,$4f // ..jeT...j.T@.OOO
        .byte $41,$01,$02,$c2,$c1,$f0,$fc,$fc,$a5,$94,$50,$43,$4f,$0f,$3f,$ff // A.........PCO.?.
        .byte $43,$03,$fc,$fc,$fc,$fc,$fc,$fc,$fc,$f1,$c6,$c6,$c5,$c1,$fc,$fc // C...............
        .byte $16,$6a,$a5,$54,$40,$54,$64,$64,$a4,$50,$40,$0c,$fc,$fc,$fc,$fc // .j.T@Tdd.P@.....
        .fill 8, $19
        .byte $f1,$f2,$f2,$f1,$f0,$fc,$f0,$f0,$94,$50,$53,$43,$0f,$03,$50,$94 // .........PSC..P.
        .byte $ff,$ff,$ff,$fc,$fc,$ff,$ff,$ff,$cf,$3f,$3f,$ff,$ff // .........??..

txt_0c9d:
        .text "??"
        .byte $cf                                   // 'O' | $80 (end-of-string marker)
        .byte $ff,$ff,$ff,$fc,$f1,$c6,$1a,$19,$ff,$ff,$c0,$15,$6a,$a5,$54,$40 // ............j.T@
        .byte $ff,$00,$55,$aa,$95,$50,$00,$c3,$fc,$0c,$50,$a4,$45,$01,$0c,$f3 // ..U..P....P.E...
        .byte $64,$64,$64,$64,$94,$50,$03,$03,$fc,$fc,$fc,$fc,$fc,$fc,$fc,$fc // dddd.P..........
        .fill 8, $c6

txt_0cd8:
        .text "OOOOOOOO"
        .byte $f3,$f3,$cf,$cf,$cf,$cf,$cf,$cf       // ........

txt_0ce8:
        .text "??"
        .byte $cf                                   // 'O' | $80 (end-of-string marker)
        .byte $f0,$ff,$ff,$ff,$ff,$f3,$f3,$cf,$3f,$ff,$ff,$ff,$ff,$64,$64,$64 // ........?....ddd
        .byte $64,$64,$64,$64,$64,$f0,$f0,$f3,$f3,$f3,$f3,$f3,$f3,$94,$65,$25 // ddddd.........e%
        .byte $19,$c9,$c6,$f2,$f1
        .byte $3f,$3f,$0f
        .text "OCSP"
        .byte $94,$cf,$f3,$f3
        .byte $fc,$fc,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff // ..........

txt_0d25:
        .text "??"
        .byte $cf                                   // 'O' | $80 (end-of-string marker)
        .byte $fc,$fc,$fc,$fc,$f1,$f1,$f1,$f1,$69,$65,$64,$a4,$94,$90,$93,$93 // ........ied.....
        .byte $0f,$3c,$3c,$f3,$f3,$f3,$f3,$f3,$3f,$ff,$ff,$ff,$ff,$ff,$ff,$ff // .<<.....?.......
        .byte $10,$54,$64,$64,$64,$64,$64,$64,$cf,$cf,$cf,$cf,$cf,$cf,$cf,$cf // .Tdddddd........
        .byte $ff,$ff,$ff,$ff,$ff,$ff,$fc,$fc,$19,$19,$19,$19,$19,$19,$69,$65 // ..............ie

txt_0d68:
        .text "???????<??????"
        .byte $0f,$0f,$f1,$f1,$f1,$f1,$f1,$f1,$c6,$c6,$93,$93,$93,$93,$93,$93 // ................
        .byte $93,$53,$f3,$f3,$f3,$f3,$f3,$f3,$fc,$fc,$fc,$fc,$ff,$ff,$ff,$ff // .S..............
        .byte $ff,$ff,$cf,$f3,$f3,$fc,$fc,$ff,$fc,$fc,$ff,$ff,$ff,$ff,$ff,$3f // ...............?
        .byte $3f,$4f,$f1,$f1,$f1,$f1,$f1,$f1,$fc,$fc,$93,$93,$93,$93,$90,$94 // ?O..............
        .byte $64,$64,$f3,$f3,$f3,$f3,$fc,$fc,$fc,$3f,$ff,$ff,$ff,$ff,$ff,$ff // dd.......?......
        .byte $ff,$0f,$fc,$fc,$fc,$fc,$fc,$fc,$f1,$c1,$64,$64,$64,$64,$64,$64 // ..........dddddd
        .byte $a4,$94,$fc,$fc,$fc,$fc,$fc,$fc,$f0,$f1,$c6,$c6,$c6,$c6,$c6,$c6 // ................
        .byte $1a,$19,$cf,$cf,$cf,$cf,$cf,$cf,$03,$13,$fc,$fc,$fc,$fc,$fc,$fc // ................
        .byte $f1,$f1,$c1,$1a,$29,$25,$14,$c0,$ff,$ff,$a4,$94,$50,$03,$3f,$00 // ....)%......P.?.
        .byte $ff,$ff,$3c,$3c,$fc,$ff,$ff,$00,$ff,$ff,$50,$69,$16,$01,$f0,$00 // ..<<......Pi....
        .byte $ff,$ff,$fc
        .text "1221"
        .byte $fc,$ff,$ff,$1a,$a9,$95
        .byte $50,$43,$00
        .byte $ff,$ff,$4f,$4f,$0f,$3f,$ff,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$00 // ..OO.?..........
        .byte $ff,$ff,$0f,$f3,$f3,$f3,$f3,$0f,$ff,$ff,$c6,$1a,$19,$19,$15,$c0 // ................
        .byte $ff,$ff,$94,$50,$43,$0f,$3f,$00,$ff,$ff,$fc,$fc,$ff,$ff,$ff,$00 // ...PC.?.........
        .byte $ff,$ff
        .byte $50,$29,$16,$01,$f0,$00,$ff,$ff,$fc
        .text "<???"
        .byte $ff
        .byte $ff,$ff,$65,$69,$19,$15,$c0,$fc,$ff,$ff,$3f,$0f,$43,$0f,$3f,$00 // ..ei......?.C.?.
        .byte $ff,$ff,$00,$15,$1a,$15,$00,$00,$ff,$ff,$16,$6a,$a5,$54,$00,$0f // ...........j.T..
        .byte $ff,$ff,$90,$53,$00,$0f,$cf,$f0,$ff,$ff,$f1,$f1,$f0,$fc,$ff,$00 // ...S............
        .byte $ff,$ff,$43,$a4,$58,$04,$c0,$03,$ff,$ff,$f0,$c6,$ca,$c9,$c5,$f0 // ..C.X...........
        .byte $ff,$ff,$69,$a5,$54,$40,$0f,$00,$ff,$ff,$0f,$3f,$3f,$ff,$ff,$00 // ..i.T@.....??...
        .byte $ff,$ff,$14,$1a,$05,$c0,$fc,$00,$ff,$ff,$3f,$4f,$8f,$4f,$0f,$3f // ..........?O.O.?
        .byte $ff,$ff,$ff,$fc,$fc,$fc,$fc,$ff,$ff,$ff,$06,$6a,$a5,$94,$50,$00 // ...........j..P.
        .byte $ff,$ff,$90,$53,$43,$0f,$ff,$00,$ff,$ff,$f1,$f1,$fc,$fc,$ff,$00 // ...SC...........
        .byte $ff,$ff,$00,$00,$00,$00,$00,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff // ................
        .fill 10, $ff
        .byte $01,$01,$59,$5a,$01,$01,$5b,$5c,$5d,$01,$01,$01,$01,$01,$01,$01 // ..YZ..[\].......
        .fill 13, $01
        .byte $5e,$01,$01,$01,$01,$5f,$60,$01,$01,$61,$62,$63,$01,$01,$01,$01 // ^...._`..abc....
        .fill 15, $01
        .byte $64,$65,$66,$01,$01,$01,$67,$68,$69,$01,$6a,$6b,$63,$6c,$6d,$6d // def...ghi.jkclmm
        .byte $6e,$01,$01,$59,$6f,$6d,$6d,$70,$5a,$01,$01,$59,$71,$72,$73,$74 // n..YommpZ..Yqrst
        .byte $01,$75,$76,$01,$01,$77,$78,$79,$7a,$01,$6a,$6b,$7b,$7c,$7d,$7e // .uv..wxyz.jk{|}~
        .byte $7f,$01,$01,$80,$81,$82,$83,$84,$85,$01,$86,$87,$88,$89,$8a,$8b // ................
        .byte $8c,$8d,$8e,$01,$01,$01,$8f,$7a,$7a,$01,$6a,$6b,$90,$91,$92,$93 // .......zz.jk....
        .byte $01,$01,$01,$94,$95,$96,$97,$98,$99,$01,$01,$9a,$9b,$9c,$9d,$9e // ................
        .byte $99,$9f,$99,$01,$01,$01,$8f,$7a,$7a,$01,$6a,$6b,$a0,$a1,$a2,$a3 // .......zz.jk....
        .byte $a4,$01,$a5,$a6,$a7,$a8,$99,$a9,$99,$01,$01,$9a,$9b,$aa,$01,$01 // ................
        .byte $99,$9f,$99,$01,$01,$ab,$ac,$ad,$ae,$01,$af,$b0,$b1,$b2,$a1,$a2 // ................
        .byte $b3,$b4,$b5,$b6,$b7,$b8,$b9,$ba,$bb,$69,$01,$bc,$9b,$bd,$01,$01 // .........i......
        .byte $be,$ba,$be,$69,$01,$bf,$c0,$c1,$c2,$c3,$c4,$c5,$c6,$c7,$c8,$c9 // ...i............
        .byte $ca,$cb,$cc,$cd,$ce,$cf,$d0,$d1,$d2,$d3,$d4,$d5,$d6,$d7,$d8,$d9 // ................
        .byte $da,$db,$dc,$d3                       // ....

// --- Region $1007-$10d7 ---
.pc = $1007 "Segment $1007"
        .byte $00,$00,$00,$02,$0f,$00,$1f,$ff,$00,$84,$00,$c0,$20,$00,$02,$06 // ............ ...
        .byte $00,$08,$ff,$00,$07,$0e,$00,$02,$02,$03,$12,$25,$00,$02,$00,$14 // ...........%....
        .byte $07,$03,$00,$41,$81,$00,$22,$00,$00,$01,$03,$00,$fe,$fe,$fe,$00 // ...A..".........
        .byte $00,$00,$41,$a4,$60,$00,$00,$00,$07,$01,$01,$01,$00,$00,$00,$02 // ..A.`...........
        .byte $00,$02,$08,$00,$07,$24,$01,$c1,$00,$16,$03,$01,$1f,$00,$00,$00 // .....$..........
        .byte $02,$00,$00,$00,$80,$00,$00,$09,$09,$00,$00,$00,$00,$05,$05,$23 // ...............#
        .byte $01,$00,$00,$00,$00,$00,$00,$03,$07,$00,$14,$b4,$00,$1a,$08,$10 // ................
        .byte $d0                                   // .

tbl_lo_1078:
        .byte $00,$01,$01,$00,$00                   // address table low bytes

tbl_hi_107d:
        .byte $c1,$16,$16,$00,$00                   // address table high bytes
        .byte $00,$00,$00,$00,$08,$00,$00,$f8,$a7,$f5,$00,$02,$00,$30,$0a,$08 // .............0..
        .byte $06,$04,$03,$02,$03,$30,$0e,$0c,$24,$24,$0e,$0c,$10,$30,$0e,$0c // .....0..$$...0..
        .byte $3c,$0e,$48,$0c,$3c,$30,$0e           // <.H.<0.

txt_10a9:
        .text "H$$HH$"
        .byte $81                                   // .

txt_10b0:
        .text "AAAAAAA"
        .byte $81,$41,$41,$81,$81,$41,$41,$81,$81,$41,$41,$81,$11,$81,$11,$81 // .AA..AA..AA.....
        .byte $81,$41,$15,$81,$81,$81,$15,$81,$00,$00,$00,$06,$0f,$ff,$f1,$f2 // .A..............
        .byte $f4                                   // .

// --- Region $1724-$17d5 ---
.pc = $1724 "Segment $1724"
        .byte $02,$4e,$02,$71,$02,$96,$02,$be,$02,$e7,$02,$14,$03,$42,$03,$74 // .N.q.........B.t
        .byte $03,$a9,$03,$e0,$03,$1b,$04,$5a,$04,$9c,$04,$e2,$04,$2d,$05,$7b // .......Z.....-.{
        .byte $05,$cf,$05,$27,$06,$85,$06,$e8,$06,$51,$07,$c1,$07,$37,$08,$b4 // ...'.....Q...7..
        .byte $08,$38,$09,$c4,$09,$59,$0a,$f7,$0a,$9e,$0b,$4e,$0c,$0a,$0d,$d0 // .8...Y.....N....
        .byte $0d,$a2,$0e,$81,$0f,$6d,$10,$67,$11,$70,$12,$89,$13,$b2,$14,$ed // .....m.g.p......
        .byte $15,$3b,$17,$9d,$18,$14,$1a,$a0,$1b,$45,$1d,$03,$1f,$db,$20,$cf // .;.......E.... .
        .byte $22,$e1,$24,$12,$27,$65,$29,$db,$2b,$76 // ".$.'e).+v

txt_178e:
        .text ".:1'4A7"
        .byte $8a,$3a,$05,$3e,$b5,$41,$9d,$45,$c1   // .:.>.A.E.

txt_179e:
        .text "I$N"
        .byte $c9                                   // 'I' | $80 (end-of-string marker)
        .byte $52,$b6,$57,$ed,$5c,$73,$62,$4e,$68,$82,$6e,$14,$75,$0a,$7c,$6a // R.W.\sbNh.n.u.|j
        .byte $83,$3b,$8b,$82,$93,$48,$9c,$93,$a5,$6b,$af,$da,$b9,$e7,$c3,$9c // .;...H...k......
        .byte $d0,$04,$dd,$28,$ea,$14,$f8,$00,$00,$00,$00,$00,$00,$13,$19,$17 // ...(............
        .byte $19,$31,$19,$4f                       // .1.O

// --- Region $181d-$19f7 ---
.pc = $181d "Segment $181d"
        .byte $a9,$34,$85,$01,$a2,$00,$bd,$00,$29,$9d,$01,$08,$e8,$d0,$f7,$ee // .4......).......
        .byte $48,$03,$ee,$45,$03,$d0,$ef,$a9,$37,$85,$01,$a9,$00,$8d,$00,$08 // H..E....7.......

txt_183d:
        .text "X Y"
        .byte $a6                                   // '&' | $80 (end-of-string marker)
        .byte $4c,$ae,$a7,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$f7,$18 // L...............
        .byte $ff,$18,$07,$19,$f7,$18,$ff           // .......

txt_1858:
        .encoding "screencode_mixed"
        .text "xgy music by marcus schnider / ripped by excell of ikari!  you can't hurt us lamers"
        .encoding "petscii_upper"

txt_18ab:
        .text "!!  "
        .byte $00                                   // string terminator
        .byte $00,$00,$00,$00,$00,$00,$00,$41,$00,$fe,$0f,$68,$00,$f6,$82,$01 // .......A...h....
        .byte $01,$f8,$0f,$48,$00,$51,$05,$01,$01,$f8,$0f,$48,$01,$51,$05,$17 // ...H.Q.....H.Q..
        .byte $00,$f5,$0f,$f8,$90,$00,$8f,$41,$00,$f7,$0f,$f8,$00,$00,$80,$41 // .......A.......A
        .byte $00,$f9,$0f,$a8,$37,$00,$88,$41,$00,$f9,$0f,$a8,$38,$00,$88,$41 // ....7..A....8..A
        .byte $00,$f9,$0f,$a8,$58,$00,$88,$80,$58,$01,$54,$00,$52,$01,$ff,$80 // ....X...X.T.R...
        .byte $54,$04,$56,$04,$54,$03,$ff,$80,$54,$00,$54,$03,$54,$02,$54,$00 // T.V.T...T.T.T.T.
        .byte $02,$02,$ff,$c0,$9f,$00,$ff,$c1,$85,$18,$83,$24,$22,$81,$18,$83 // ...........$"...
        .byte $24,$18,$22,$1f,$85,$1b,$83,$27,$22,$81,$24,$83,$1d,$22,$23,$24 // $."....'".$.."#$
        .byte $ff,$c6,$81,$3c,$83,$3c,$3c,$3c,$81,$3c,$83 // ...<.<<<.<.

txt_193b:
        .text "<<<<"
        .byte $c7                                   // 'G' | $80 (end-of-string marker)
        .byte $81
        .byte $3c,$83
        .byte $3c,$3c,$3c,$81
        .byte $3c,$c8,$83
        .text "<<<<"
        .byte $ff,$c5
        .byte $81                                   // .

txt_1951:
        .text "023<<:07500305:<"
        .byte $ff,$c2,$81,$00,$c2,$00,$c4           // .......

txt_1968:
        .text "HH"
        .byte $c3                                   // 'C' | $80 (end-of-string marker)
        .byte $00,$00,$c4                           // ...

txt_196e:
        .text "HH"
        .byte $c2                                   // 'B' | $80 (end-of-string marker)
        .byte $00,$00,$c4,$48,$c2,$00,$c3,$00,$00,$00,$00,$c2,$81,$00,$c2,$00 // ...H............
        .byte $c4                                   // .

txt_1982:
        .text "HH"
        .byte $c3                                   // 'C' | $80 (end-of-string marker)
        .byte $00,$00,$c4                           // ...

txt_1988:
        .text "HH"
        .byte $c2                                   // 'B' | $80 (end-of-string marker)
        .byte $00,$c3,$00,$c4,$48,$c2,$00,$c3,$00,$00,$c3,$00,$c3,$00,$ff,$02 // ....H...........
        .byte $00,$00,$c4                           // ...

txt_199e:
        .text "H<"
        .byte $c3                                   // 'C' | $80 (end-of-string marker)
        .byte $00,$c4,$48,$c3,$00,$c3,$00,$ff,$c5,$83,$3c,$81,$3c,$85 // ..H.......<.<.

txt_19af:
        .text "<<"
        .byte $ca                                   // 'J' | $80 (end-of-string marker)
        .byte $89,$3c,$c5,$83,$3c,$c6,$83,$3a,$81,$3a,$85 // .<..<..:.:.

txt_19bd:
        .text "::"
        .byte $ca                                   // 'J' | $80 (end-of-string marker)
        .byte $8d,$3c,$c9,$83,$3c,$81,$3c,$85       // .<..<.<.

txt_19c8:
        .text "<<"
        .byte $ca                                   // 'J' | $80 (end-of-string marker)
        .byte $89,$3c,$83,$3c,$c7,$83,$3c,$81,$3c,$85,$3c,$3c,$83,$3c,$c8,$83 // .<.<..<.<.<<.<..
        .byte $1f,$81,$1d,$18,$18,$ff,$cb,$87,$3c,$83,$43,$87 // ........<.C.

txt_19e7:
        .text "A?"
        .byte $a3                                   // '#' | $80 (end-of-string marker)
        .byte $41,$87,$3a,$83,$41,$87,$3f,$3e,$93,$3f,$8f,$41,$ff // A.:.A.?>.?.A.

dat_19f7:
        // === Fill data (1 bytes, $19f7-$19f7) ===
        .byte $00                                   // .

// --- Region $1f00-$2040 ---
.pc = $1f00 "dat_1f00"

dat_1f00:
        .byte $01,$02,$03,$04,$05,$03,$02,$06,$07,$08,$09,$0a,$0b,$0c,$0c,$04 // ................
        .byte $02,$04,$0d,$0e,$0f,$0b,$10,$11,$12,$13,$14,$01,$01,$01,$01,$01 // ................
        .byte $01,$15,$16,$17,$01,$18,$01,$19,$1a,$1b,$01,$1c,$1d,$1e,$1f // ...............

txt_1f2f:
        .text " !"
        .byte $22                                   // double quote character
        .text "#$%"
        .byte $0e,$03,$26,$03                       // ..&.

txt_1f39:
        .text "'()*+,-"
        .byte $01                                   // .

txt_1f41:
        .text "./0123456789:;1<=>4?"
        .byte $40                                   // @ character
        .text "AB8CD"
        .byte $01,$01,$01,$01,$01,$01,$45,$46,$47,$01,$48,$01,$49,$4a,$4b,$01 // ......EFG.H.IJK.
        .byte $4c,$01,$4d,$01                       // L.M.

txt_1f6f:
        .text "NOPQRS44TR."
        .byte $01,$01
        .text "UVWX"

dat_1f80:
        // === Fill data (128 bytes, $1f80-$1fff) ===
        .fill 128, $01

spr_2000:
        // === Sprite data (64 bytes, $2000-$203f) ===
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff,$ff,$ff                           // ########################
        .byte $ff                                   // sprite 0 padding

spr_2040:
        // === Sprite data (1 bytes, $2040-$2040) ===
        .byte $00

// --- Region $2059-$2066 ---
.pc = $2059 "dat_2059"

dat_2059:
        .byte $10,$00
        .byte $00,$30,$00                           // ..........##............
        .byte $00,$64,$00                           // .........##..#..........
        .byte $00,$30,$00                           // ..........##............
        .byte $00,$10

dat_2066:
        // === Fill data (1 bytes, $2066-$2066) ===
        .byte $00                                   // .

// --- Region $2096-$20a9 ---
.pc = $2096 "dat_2096"

dat_2096:
        .byte $10,$00,$00,$30,$00,$00,$20,$00,$07,$ab,$40,$00,$20,$00,$00,$30 // ...0.. ...@. ..0
        .byte $00,$00,$10                           // ...

dat_20a9:
        // === Fill data (1 bytes, $20a9-$20a9) ===
        .byte $00                                   // .

// --- Region $20ca-$21c2 ---
.pc = $20ca "dat_20ca"

dat_20ca:
        .byte $10,$00,$00,$10,$00,$00,$30,$00,$00,$30,$00,$01,$21,$00,$00,$20 // ......0..0..!.. 
        .byte $00,$00,$20,$00,$1e,$aa,$d0,$00,$20,$00,$00,$20,$00,$01,$21,$00 // .. ..... .. ..!.
        .byte $00,$30,$00,$00,$30,$00,$00,$10,$00,$00,$10,$00,$00,$00,$00,$00 // .0..0...........
        .fill 13, $00
        .byte $10,$00,$00,$30,$00,$00,$30,$00,$00,$20,$00,$04,$20,$40,$03,$67 // ...0..0.. .. @.g
        .byte $00,$01,$ed,$00,$03,$ab,$00,$3a,$aa,$b0,$03,$ab,$00,$01,$ed,$00 // .......:........
        .byte $03,$67,$00,$04,$20,$40,$00,$20,$00,$00,$30,$00,$00,$30,$00,$00 // .g.. @. ..0..0..
        .byte $10,$00,$00,$00,$00,$00,$00,$00,$00,$00,$10,$00,$00,$30,$00,$00 // .............0..
        .byte $20,$00,$00,$20,$00,$00,$20,$00,$10,$20,$10,$0c,$20,$c0,$02,$66 //  .. .. .. .. ..f
        .byte $00,$01,$ed,$00,$07,$ab,$40,$ea,$aa,$ac,$07,$ab,$40,$01,$ed,$00 // ......@.....@...
        .byte $02,$66,$00,$0c,$20,$c0,$10,$20,$10,$00,$20,$00,$00,$20,$00,$00 // .f.. .. .. .. ..
        .byte $20,$00,$00,$30,$00,$00,$10,$00,$00   //  ..0.....

spr_2180:
        // === Sprite data (64 bytes, $2180-$21bf) ===
        .byte $f0,$00,$0f                           // ####................####
        .byte $78,$00,$1e                           // .####..............####.
        .byte $3c,$00,$3c                           // ..####............####..
        .byte $1e,$00,$78                           // ...####..........####...
        .byte $0f,$00,$f0                           // ....####........####....
        .byte $07,$81,$e0                           // .....####......####.....
        .byte $03,$c3,$c0                           // ......####....####......
        .byte $01,$e7,$80                           // .......####..####.......
        .byte $00,$ff,$00                           // ........########........
        .byte $00,$7e,$00                           // .........######.........
        .byte $00,$3c,$00                           // ..........####..........
        .byte $00,$7e,$00                           // .........######.........
        .byte $00,$ff,$00                           // ........########........
        .byte $01,$e7,$80                           // .......####..####.......
        .byte $03,$c3,$c0                           // ......####....####......
        .byte $07,$81,$e0                           // .....####......####.....
        .byte $0f,$00,$f0                           // ....####........####....
        .byte $1e,$00,$78                           // ...####..........####...
        .byte $3c,$00,$3c                           // ..####............####..
        .byte $78,$00,$1e                           // .####..............####.
        .byte $f0,$00,$0f                           // ####................####
        .byte $20                                   // sprite 0 padding
        .byte $20,$db,$23                           //  .#

// --- Region $21fa-$21fa ---
.pc = $21fa "dat_21fa"

dat_21fa:
        // === Fill data (1 bytes, $21fa-$21fa) ===
        .byte $00                                   // .

// --- Region $22bb-$22cb ---
.pc = $22bb "Segment $22bb"
        .byte $22,$e2
        .byte $22,$0b
        .text "#,#H#"
        .byte $64
        .byte $23,$87
        .byte $23,$9b
        .byte $23,$b7
        .byte $23                                   // #

// --- Region $2552-$258f ---
.pc = $2552 "Segment $2552"
        .byte $14                                   // .

txt_2553:
        .text "  PROUDLY PRESENTS     "
        .byte $13,$08,$01,$04,$0f,$17,$20,$06,$0f,$12,$03,$05 // ...... .....

txt_2576:
        .text "++   "
        .byte $12,$05,$0c,$05,$01,$13,$05,$04,$20,$0f,$0e // ........ ..

txt_2586:
        .text " 17/05/89"
        .byte $00                                   // string terminator

// --- Region $26e8-$2715 ---
.pc = $26e8 "Segment $26e8"
        .byte $0b,$0a,$01,$38,$01,$00,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01 // ...8............
        .byte $02,$3c,$02,$2e,$0b,$39,$01,$01,$01,$01,$01,$01,$0c,$3b,$0f,$3f // .<...9.......;.?
        .byte $0e,$34,$04,$30,$01,$01,$01,$01,$01,$01,$01,$01,$01,$01 // .4.0..........

// --- Region $2760-$2cbb ---
.pc = $2760 "dat_2760"

dat_2760:
        .byte $02,$06,$0a,$81,$82,$83,$84,$85,$84,$83,$82,$ff,$be,$fe,$d2,$8f // ................
        .byte $aa,$82,$5b,$fc,$86,$e3,$48,$85,$ff,$5f,$3c,$5f,$3e,$5f,$4a,$30 // ..[...H.._<_>_J0
        .byte $60,$5f                               // `_

txt_2782:
        .text "KA=       "

txt_278c:
        .encoding "screencode_mixed"
        .text "welcome to another release by the non-stop ruling ikari"
        .encoding "petscii_upper"

txt_27c3:
        .text "... "

txt_27c7:
        .encoding "screencode_mixed"
        .text "this time we bring you "
        .byte $22                                   // double quote
        .text "shadow force"
        .encoding "petscii_upper"

txt_27eb:
        .byte $22                                   // double quote character
        .text " ++ "

txt_27f0:
        .encoding "screencode_mixed"
        .text "trained by excell"
        .encoding "petscii_upper"

txt_2801:
        .text "... "

txt_2805:
        .encoding "screencode_mixed"
        .text "this could have been a better game if the shoots would follow the space-craft, futhermore it's logic that this game never would be sold, course the whole thing is a rip-off from games like "
        .byte $22                                   // double quote
        .text "hawk-eye"
        .byte $22                                   // double quote
        .text " "
        .byte $22                                   // double quote
        .text "shadow skimmer"
        .byte $22                                   // double quote
        .text " "
        .byte $22                                   // double quote
        .text "cybernoid"
        .byte $22                                   // double quote
        .text " "
        .byte $22                                   // double quote
        .text "crazy comets ii"
        .encoding "petscii_upper"

txt_28fa:
        .byte $22                                   // double quote character
        .text " + "

txt_28fe:
        .encoding "screencode_mixed"
        .text "lot's of other cool games, so with grafix from these games, well it can't be all that bad, ey"
        .encoding "petscii_upper"

txt_295b:
        .text "!?    "

txt_2961:
        .encoding "screencode_mixed"
        .text "ok, this is just another of those endless ikari releases, and you should look out for games like "
        .byte $22                                   // double quote
        .text "circus attraction"
        .encoding "petscii_upper"

txt_29d4:
        .byte $22                                   // double quote character
        .text " + "
        .byte $22                                   // double quote character
        .byte $17,$01,$0e,$04,$05,$12,$05,$12,$20,$33,$04 // ........ 3.

txt_29e4:
        .byte $22                                   // double quote character
        .text "... "

txt_29e9:
        .encoding "screencode_mixed"
        .text "ok, enjoy yourself"
        .encoding "petscii_upper"

txt_29fb:
        .text ".... "

txt_2a00:
        .encoding "screencode_mixed"
        .text "wrap time is here (c) excell of ikari"
        .encoding "petscii_upper"

txt_2a25:
        .text " 1989                    "
        .byte $00                                   // string terminator

dat_2a3f:
        .text "                                           "

txt_2a6a:
        .encoding "screencode_mixed"
        .text "ok, before the greetings, just a quick reminder that channel"
        .encoding "petscii_upper"

txt_2aa6:
        .text " 42 "

txt_2aaa:
        .encoding "screencode_mixed"
        .text "is now all members of ikari, so make sure you call the addiction on this number"
        .encoding "petscii_upper"

txt_2af9:
        .text "  503-654-5943 ("

txt_2b09:
        .encoding "screencode_mixed"
        .text "in the states ofcoz"
        .encoding "petscii_upper"

txt_2b1c:
        .text "')    "

txt_2b22:
        .encoding "screencode_mixed"
        .text "ok greet time boys and girls"
        .encoding "petscii_upper"

txt_2b3e:
        .text "..... 711 - "
        .byte $01,$02,$0e,$0f,$12,$0d,$01,$0c,$20,$2d,$20,$01,$07,$09,$0c,$05 // ........ - .....
        .byte $20,$2d,$20,$81,$18,$05,$0e,$0f,$0e,$20,$2d,$20,$82,$05,$01,$13 //  - ...... - ....
        .byte $14,$09,$05,$20,$82,$0f,$19,$13,$20,$2d,$20,$82,$12,$0f,$13,$20 // ... .... - .... 
        .byte $2d,$20,$83                           // - .

txt_2b7d:
        .encoding "screencode_mixed"
        .text "osmos - crazy - dominators - drive - elite - fire eagle - frantic - "
        .encoding "petscii_upper"
        .byte $86,$15,$14,$15,$12,$05,$20,$2d,$20,$88 // ...... - .

txt_2bcb:
        .encoding "screencode_mixed"
        .text "otline - lazer - light - oneway - "
        .encoding "petscii_upper"
        .byte $8f,$0e,$0c,$09,$0e,$05,$20,$2d,$20,$93,$03,$09,$05,$0e,$03,$05 // ...... - .......

txt_2bfd:
        .text " 451 - "

txt_2c04:
        .encoding "screencode_mixed"
        .text "shadows - sharks - starion - tecnique - tristar - xakk - x-ray and ofcoz zargon, well if you are not in there, better shape up"
        .encoding "petscii_upper"

txt_2c82:
        .text ".... "

txt_2c87:
        .encoding "screencode_mixed"
        .text "or maybe it's on purpose"
        .encoding "petscii_upper"

txt_2c9f:
        .text "!!!                         "
        .byte $00                                   // string terminator
