// ============================================
// output - Part 1 of 2
// ============================================
// KickAssembler syntax
// Generated by Restore 64 v0.2.1 alpha build 298, 2026-04-11 21:36:18
// https://restore64.dev by datucker / Rabenauge
//
// Load address: $0800  End: $dbff  (54272 bytes)
// Crunched with Cruncher AB — depacked by emulation
// Packer entry: $080d (via BASIC SYS 2061)
// Entry point:  $09a1 (2465)
// IRQ handler:  $0b1f (irq_0b1f)
// IRQ handler:  $0a48 (nmi_0a48)
//
// Code: 488 bytes, Data: 53784 bytes
// Labels: 60, Subroutines: 8
//
// Cross-references: all OK
// ============================================


// --- Region $09a1-$0b7c ---
.pc = $09a1 "main_09a1"

main_09a1:
        sei
        lda #$77
        sta $01
        jsr $fda3
        jsr sub_0a92
        jsr sub_0ae7
        ldy #$00
        sty $d020
        sty $d021
        sty $dc0e
        iny
        sty $d01a
        sty $d019
        ldx #$2a
        ldy #$04
        lda #$09
        jsr sub_0a4c
        lda #$a6
        jsr sub_0d00
        lda #$1f
        ldx #$0b
        sta $0314
        stx $0315
        lda #$48
        ldx #$0a
        sta $0318
        stx $0319
        lda #$a4
        ldx #$0b
        sta $f6
        stx $f7
        ldx #$27

loc_09ed:
        lda #$07
        sta $da58,x
        lda #$20
        sta $0658,x
        dex
        bpl loc_09ed
        cli
        lda #$00
        sta $fb

loc_09ff:
        ldx $fb
        inx
        cpx #$0c
        bne loc_0a08
        ldx #$00

loc_0a08:
        stx $fb
        lda $0b98,x                                 // !SMC: modified by $0af2
        ldx #$01
        ldy #$04
        jsr sub_0a4c

loc_0a14:
        bit $d011
        bmi loc_0a14

loc_0a19:
        bit $d011
        bpl loc_0a19
        lda #$ef
        cmp $dc01
        bne loc_09ff
        jsr $ff5b
        lda #$08
        jsr $ffb1
        lda #$6f
        jsr $ff93
        lda #$49
        jsr $ffa8
        jsr $edfe
        ldx #$00

loc_0a3c:
        lda sub_0d00,x
        sta $02a7,x
        inx
        bne loc_0a3c
        jmp $fce2

nmi_0a48:
        lda $dc0d
        rti

// Referenced by: jsr from $09c7, $0a11
sub_0a4c: {
        sta $f8
        stx $fe
        sty $ff
        ldx #$00
        ldy #$09
        stx $fc
        sty $fd
        ldy #$00
loop:
        lda ($fc),y
        beq loc_0a88
        tax
        lsr
        lsr
        lsr
        lsr
        jsr sub_0a74
        txa
        jsr sub_0a74
        inc $fc
        bne skip
        inc $fd
skip:
        bne loop
}
// Referenced by: jsr from $0a65, $0a69

sub_0a74:
        and #$0f
        cmp #$03
        beq loc_0a82
        jsr sub_0a89
        lda $f8
        jsr sub_0a89

loc_0a82:
        inc $fe
        bne loc_0a88
        inc $ff

loc_0a88:
        rts
// Referenced by: jsr from $0a7a, $0a7f

sub_0a89:
        sta ($fe),y
        lda $ff
        eor #$dc
        sta $ff
        rts

// Referenced by: jsr from $09a9
sub_0a92: {
        lda #$06
        sta $fb
loop1:
        lda $d020
        jsr sub_0ae0
        sta $d020
        lda $d021
        jsr sub_0ae0
        sta $d021
        ldx #$00
loop2:
        lda $d800,x
        jsr sub_0ae0
        sta $d800,x
        lda $d900,x
        jsr sub_0ae0
        sta $d900,x
        lda $da00,x
        jsr sub_0ae0
        sta $da00,x
        lda $db00,x
        jsr sub_0ae0
        sta $db00,x
        dex
        bne loop2
loop3:
        bit $d011
        bpl loop3
loop4:
        bit $d011
        bmi loop4
        dec $fb
        bne loop1
        rts
}
// Referenced by: jsr from $0a99, $0aa2, $0aad, $0ab6, $0abf, $0ac8

sub_0ae0:
        and #$0f
        tay
        lda chr_0b7d,y
        rts
// Referenced by: jsr from $09ac

sub_0ae7:
        lda #$73
        sta $01
        ldx #$0a

loc_0aed:
        ldy #$00
        sty $fa
        lda txt_0b8d,x
        asl
        asl
        rol $fa
        asl
        rol $fa
        sta $f9
        lda $fa
        clc
        adc #$d0
        sta $fa
        ldy #$07

loc_0b06:
        lda ($f9),y
.label smc_0b09 = * + 1
        sta $0858,y                                 // !SMC: modified by $0b14
        dey
        bpl loc_0b06
        sec
        lda smc_0b09
        sbc #$08
        sta smc_0b09                                // SMC: modifies $0b09
        dex
        bpl loc_0aed
        lda #$77
        sta $01
        rts

irq_0b1f:
        lda #$01
        sta $d019
        lda #$16
        sta $d018
.label smc_0b2a = * + 1
        lda #$00                                    // !SMC: modified by $0b53
        ora #$c0
        sta $d016
        lda $d012
        clc
        adc #$0c

loc_0b36:
        cmp $d012
        bcs loc_0b36
        lda #$c8
        sta $d016
        lda #$12
        sta $d018
        jsr sub_0b4b
        jmp $ea7e
// Referenced by: jsr from $0b45

sub_0b4b:
        dec smc_0b2a
        bmi loc_0b51
        rts

loc_0b51:
        lda #$07
        sta smc_0b2a                                // SMC: modifies $0b2a
        ldy #$00

loc_0b58:
        lda $0659,y
        sta $0658,y
        iny
        cpy #$27
        bne loc_0b58
        ldy #$00

loc_0b65:
        lda ($f6),y
        bne loc_0b73
        lda #$a4
        ldx #$0b
        sta $f6
        stx $f7
        bne loc_0b65

loc_0b73:
        sta $067f
        inc $f6
        bne loc_0b7c

chr_0b7a:
        // === Charset data (2 bytes, $0b7a-$0b7b) ===
        .byte $e6,$f7                               // char 0 (partial)

loc_0b7c:
        rts

// --- Region $0d00-$0d08 ---
.pc = $0d00 "sub_0d00"
// Referenced by: jsr from $09cc

sub_0d00:
        sta $d012
        lda #$1b
        sta $d011
        rts

// --- Region $2c0a-$2c0a ---
.pc = $2c0a "Segment $2c0a"
        brk

// --- Region $589d-$589d ---
.pc = $589d "Segment $589d"
        brk

// --- Region $8cd0-$8cd0 ---
.pc = $8cd0 "Segment $8cd0"
        brk

// --- Region $a90a-$a90a ---
.pc = $a90a "Segment $a90a"
        brk

// --- Region $add0-$add0 ---
.pc = $add0 "Segment $add0"
        brk

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

// --- Region $0800-$0800 ---
.pc = $0800 "dat_0800"

dat_0800:
        // === Fill data (1 bytes, $0800-$0800) ===
        .byte $00                                   // .

// --- Region $0900-$09a0 ---
.pc = $0900 "dat_0900"

dat_0900:
        .byte $12,$31,$23,$14                       // char 32 (partial)

txt_0904:
        .byte $44,$21,$44,$44                       // char 32 (partial)
        .byte $21,$23,$33,$31,$23,$54,$44,$23       // char 33 '!'
        .byte $14,$44,$42,$33,$66,$36,$63,$61       // char 34 '"'
        .byte $42,$67,$48,$54,$96,$63,$33,$36       // char 35 '#'
        .byte $63,$65,$42,$63,$61,$44,$49,$33       // char 36 '$'
        .byte $66,$36,$63,$66,$36,$63,$36,$63       // char 37 '%'
        .byte $36,$63,$33,$36,$63,$66,$36,$63       // char 38 '&'
        .byte $66,$33,$33,$33,$6a,$4b,$72,$67       // char 39 '''
        .byte $26,$72,$36,$72,$36,$72,$33,$36       // char 40 '('
        .byte $72,$67,$26,$72,$6a,$42,$33,$33       // char 41 ')'
        .byte $63,$58,$36,$63,$66                   // char 42 (partial)

txt_0955:
        .byte $36,$36,$36                           // char 42 (partial)
        .byte $36,$36,$33,$36,$36,$63,$66,$36       // char 43 '+'
        .byte $63,$59,$33,$33,$63,$66,$36,$63       // char 44 ','
        .byte $79                                   // char 45 (partial)

txt_0969:
        .byte $36,$36,$36,$36,$37,$44,$26           // char 45 (partial)
        .byte $36,$63,$66,$36,$63,$74,$42,$33       // char 46 '.'
        .byte $63,$66,$36,$63                       // char 47 (partial)

txt_097c:
        .byte $33,$36,$36,$36                       // char 47 (partial)
        .byte $36,$33,$33,$66,$36,$63,$66,$36       // char 48 '0'
        .byte $63,$33,$36,$33,$74,$97,$49,$74       // char 49 '1'

txt_0990:
        .byte $44,$49,$37,$49,$37,$44,$44,$97       // char 50 '2'
        .byte $49,$74,$97,$49,$74,$44,$49,$33       // char 51 '3'
        .byte $00                                   // char 52 (partial)

// --- Region $0b7d-$0cff ---
.pc = $0b7d "chr_0b7d"

chr_0b7d:
        // === Charset data (387 bytes, $0b7d-$0cff) ===
        .byte $00,$0f,$09,$0e,$00,$00,$00,$0a       // char 0 @+0
        .byte $02,$00,$08,$00,$0b,$05,$06,$0c       // char 1 @+1

txt_0b8d:
        .byte $55,$49,$20,$40,$70,$5d,$4a,$6e       // char 2 @+2
        .byte $4b,$6d,$7d,$09,$02,$08,$0a,$07       // char 3 @+3
        .byte $01,$01,$01,$07,$0a,$08,$02           // char 4 (partial)

txt_0ba4:
        .byte $20                                   // char 4 (partial)
        .byte $46,$41,$43,$45,$20,$4f,$46,$46       // char 5 @+5
        .byte $20,$57,$41,$53,$20,$50,$41,$4c       // char 6 @+6
        .byte $2d,$46,$49,$58,$45,$44,$20,$42       // char 7 @+7
        .byte $59,$20,$43,$26,$43,$20,$4f,$46       // char 8 @+8
        .byte $20,$48,$4f,$54,$4c,$49,$4e,$45       // char 9 @+9
        .byte $2e,$20,$4f,$52,$49,$47,$49,$4e       // char 10 @+10
        .byte $41,$4c,$20,$43,$52,$41,$43,$4b       // char 11 @+11
        .byte $45,$44,$20,$42,$59,$20,$48,$4f       // char 12 @+12
        .byte $52,$49,$5a,$4f,$4e,$20,$4f,$46       // char 13 @+13
        .byte $20,$4e,$45,$43,$2f,$4e,$45,$49       // char 14 @+14
        .byte $2e,$20,$47,$52,$45,$45,$54,$53       // char 15 @+15
        .byte $20,$54,$4f,$20,$59,$4f,$55,$20       // char 16 @+16
        .byte $41,$4c,$4c,$21,$21,$20,$43,$4f       // char 17 @+17
        .byte $4e,$54,$41,$43,$54,$20,$48,$54       // char 18 @+18
        .byte $4c,$3a,$43,$41,$4c,$4c,$20,$52       // char 19 @+19
        .byte $4f,$42,$2c,$2b,$33,$31,$28,$30       // char 20 @+20
        .byte $29,$34,$33,$2d,$34,$37,$39,$32       // char 21 @+21
        .byte $34,$36,$20,$4f,$52,$20,$57,$52       // char 22 @+22
        .byte $49,$54,$45,$20,$54,$4f,$3a,$48       // char 23 @+23
        .byte $4f,$54,$4c,$49,$4e,$45,$20,$46       // char 24 @+24
        .byte $41,$4e,$43,$4c,$55,$42,$2c,$50       // char 25 @+25
        .byte $4f,$20,$42,$4f,$58,$20,$32,$31       // char 26 @+26
        .byte $32,$37,$20,$36,$32,$30,$31,$20       // char 27 @+27
        .byte $43,$41,$2c,$20,$4d,$41,$41,$53       // char 28 @+28
        .byte $54,$52,$49,$43,$48,$54,$20,$49       // char 29 @+29
        .byte $4e,$20,$48,$4f,$4c,$4c,$41,$4e       // char 30 @+30
        .byte $44,$21,$20,$20,$20,$20,$20,$20       // char 31 @+31
        .byte $20,$4d,$41,$59,$20,$59,$4f,$55       // char 32 ' '
        .byte $20,$4c,$49,$56,$45,$20,$54,$4f       // char 33 '!'
        .byte $20,$53,$45,$45,$20,$54,$48,$45       // char 34 '"'
        .byte $20,$44,$41,$57,$4e,$2e,$20,$20       // char 35 '#'
        .byte $20,$20,$20,$20,$20,$43,$55,$53       // char 36 '$'
        .byte $54,$41,$52,$44,$20,$49,$53,$20       // char 37 '%'
        .byte $47,$4f,$4e,$45,$2e                   // char 38 (partial)

dat_0cb2:
        // === Fill data (69 bytes, $0cb2-$0cf6) ===
        .fill 69, $20
        .byte $00,$00,$00,$00,$00,$00               // char 47 (partial)
        .byte $00,$00,$00                           // char 48 (partial)

// --- Region $0d09-$0d09 ---
.pc = $0d09 "dat_0d09"

dat_0d09:
        // === Fill data (1 bytes, $0d09-$0d09) ===
        .byte $00                                   // .

// --- Region $1800-$1800 ---
.pc = $1800 "chr_1800"

chr_1800:
        .byte $00                                   // .

// --- Region $1c00-$1c00 ---
.pc = $1c00 "scr_1c00"

scr_1c00:
        .byte $00                                   // .

// --- Region $2000-$2000 ---
.pc = $2000 "spr_2000"

spr_2000:
        .byte $00                                   // .

// --- Region $2c0b-$2c0b ---
.pc = $2c0b "dat_2c0b"

dat_2c0b:
        // === Fill data (1 bytes, $2c0b-$2c0b) ===
        .byte $00                                   // .

// --- Region $3000-$3000 ---
.pc = $3000 "scr_3000"

scr_3000:
        .byte $00                                   // .

// --- Region $589e-$589e ---
.pc = $589e "dat_589e"

dat_589e:
        // === Fill data (1 bytes, $589e-$589e) ===
        .byte $00                                   // .

// --- Region $8cd1-$8cd1 ---
.pc = $8cd1 "dat_8cd1"

dat_8cd1:
        // === Fill data (1 bytes, $8cd1-$8cd1) ===
        .byte $00                                   // .

// --- Region $a90b-$a90b ---
.pc = $a90b "dat_a90b"

dat_a90b:
        // === Fill data (1 bytes, $a90b-$a90b) ===
        .byte $00                                   // .

// --- Region $add1-$add1 ---
.pc = $add1 "dat_add1"

dat_add1:
        // === Fill data (1 bytes, $add1-$add1) ===
        .byte $00                                   // .
