// ============================================
// output - Disassembled Source
// ============================================
// KickAssembler syntax
// Generated by Restore 64 v0.2.1 alpha build 298, 2026-04-11 21:36:42
// https://restore64.dev by datucker / Rabenauge
//
// Load address: $0801  End: $0ef6  (1782 bytes)
// Entry point:  $0ad0 (via BASIC SYS 2768)
// IRQ handler:  $0845 (irq_0845)
//
// Code: 650 bytes, Data: 1132 bytes
// Labels: 51, Subroutines: 10
//
// Cross-references: all OK
// ============================================


// --- Region $0827-$09f4 ---
.pc = $0827 "sub_0827"
// Referenced by: jsr from $0862

sub_0827:
        ldx #$28
        ldy #$00

loc_082b:
.label smc_082c = * + 1
        lda txt_0d00,y                              // !SMC: modified by $0841
        sta $cf70,y
        iny
        dex
        bne loc_082b
        inc smc_082c
        lda smc_082c
        cmp #$d7
        bne loc_0844
        lda #$00
        sta smc_082c                                // SMC: modifies $082c

loc_0844:
        rts

irq_0845:
        lda $d019
        sta $d019
        bmi loc_0866
        jsr sub_0857
        lda $dc0d
        cli
        jmp $febc
// Referenced by: jsr from $084d

sub_0857:
        lda $fe
        beq loc_085e
        dec $fe
        rts

loc_085e:
        lda #$07
        sta $fe
        jsr sub_0827
        rts

loc_0866:
        lda $d012
        cmp #$f0
        bcs loc_087a
        lda $fe
        sta $d016
        lda #$f0
        sta $d012
        jmp $febc

loc_087a:
        lda #$00
        sta $d016
        lda #$e0
        sta $d012
        jmp $febc
// Referenced by: jsr from $09a9

sub_0887:
        sei
        lda #$a0
        sta $d012
        lda $d011
        and #$7f
        sta $d011
        lda #$81
        sta $d01a
        lda #$45
        ldx #$08
        sta $0314
        stx $0315
        cli
        rts
// Referenced by: jsr from $09a3

sub_08a6:
        lda #$3f
        sta $dd02
        lda #$94
        sta $dd00
        lda #$38
        sta $d018
        lda #$cc
        sta $0288
        lda #$93
        jsr $ffd2
        lda #$05
        jsr $ffd2
        lda #$00
        sta $d020
        sta $d021
        rts

// Referenced by: jsr from $09a6
sub_08cd: {
        lda $01
        pha
        lda #$37
        sta $01
        lda #$00
        ldx #$0b
        sta $5f
        stx $60
        lda #$01
        ldx #$0d
        sta $5a
        stx $5b
        lda #$c1
        ldx #$ee
        sta $58
        stx $59
        jsr $a3bf
        pla
        sta $01
        lda #$1c
        ldx #$42
        ldy #$68
        sta $d000
        stx $d002
        sty $d004
        lda #$91
        ldx #$b7
        ldy #$ca
        sta $d006
        stx $d008
        sty $d00a
        lda #$f0
        ldx #$23
        sta $d00c
        stx $d00e
        lda #$80
        sta $d010
        lda #$ff
        sta $d01d
        sta $d015
        ldx #$b3
        stx $cff8
        inx
        stx $cff9
        inx
        stx $cffa
        inx
        stx $cffb
        inx
        stx $cffc
        inx
        stx $cffd
        inx
        stx $cffe
        inx
        stx $cfff
        lda #$4f
        sta $d001
        sta $d003
        sta $d005
        sta $d007
        sta $d009
        sta $d00b
        sta $d00d
        sta $d00f
        lda #$01
        ldy #$00
loop:
        sta $d027,y
        iny
        cpy #$08
        bne loop
        rts
}
// Referenced by: jsr from $09ac

sub_096f:
        ldx #$0a
        ldy #$08
        clc
        jsr $fff0
        ldx #$5b
        ldy #$00

loc_097b:
        lda $0e00,y
        jsr $ffd2
        lda #$12
        jsr $ffd2
        lda $0e00,y
        jsr $ffd2
        lda #$92
        jsr $ffd2
        iny
        dex
        bne loc_097b
        lda #$8e
        jsr $ffd2
        lda #$08
        jsr $ffd2
        rts

loc_09a0:
        jsr sub_0a00
        jsr sub_08a6
        jsr sub_08cd
        jsr sub_0887
        jsr sub_096f

loc_09af:
        lda $dc01
        cmp #$ef
        bne loc_09af
        ldx #$60
        ldy #$00

loc_09ba:
        lda dat_0a7f,y
        lda $033c,y
        iny
        dex
        bne loc_09ba
        sei
        jsr $ff81
        jsr $fd15
        lda #$04
        sta $0288
        jmp loc_09e0

loc_09d3:
        lda #$97
        jsr $ffd2
        lda #$93
        jsr $ffd2
        jmp loc_09a0

loc_09e0:
        lda $dd00
        and #$fd
        ora #$03
        sta $dd00
        lda #$00
        sta $d020
        sta $d021
        jmp loc_0aab

// --- Region $0a00-$0a7d ---
.pc = $0a00 "sub_0a00"

// Referenced by: jsr from $09a0
sub_0a00: {
        sei
        lda $01
        and #$fb
        sta $01
        lda #$00
        sta $4b
        sta $50
        sta $52
        lda #$d0
        sta $4c
        clc
        lda #$e0
        sta $51
        adc #$04
        sta $53
        ldx #$04
        ldy #$00
loop:
        lda ($4b),y
        jsr sub_0a51
        iny
        bne loop
        inc $4c
        inc $51
        inc $53
        dex
        bne loop
        lda #$ff
        sta $e668
        sta $e669
        sta $e268
        sta $e269
        sta $e670
        sta $e671
        sta $e270
        sta $e271
        lda #$37
        sta $01
        cli
        rts
}
// Referenced by: jsr from $0a22

sub_0a51:
        sta $56
        txa
        pha
        jsr sub_0a62
        sta ($50),y
        jsr sub_0a62
        sta ($52),y
        pla
        tax
        rts
// Referenced by: jsr from $0a55, $0a5a

sub_0a62:
        lda #$00
        sta $57
        ldx #$04

loc_0a68:
        asl $56
        bcc loc_0a74
        rol $57
        sec
        rol $57
        clc
        bcc loc_0a78

loc_0a74:
        asl $57
        asl $57

loc_0a78:
        dex
        bne loc_0a68
        lda $57
        rts

// --- Region $0aab-$0ad8 ---
.pc = $0aab "loc_0aab"

loc_0aab:
        lda #$37
        sta $01
        lda $dd00
        and #$fd
        ora #$03
        sta $dd00
        lda #$04
        sta $0288
        cli
        nop
        jmp loc_0e60

loc_0ac3:
        lda #$00
        jsr $ff90
        lda #$40
        sta $dc05
        jmp $a7ae

main_0ad0:
        lda #$30
        sta $dc05
        jmp loc_09d3

dat_0ad8:
        // === Fill data (1 bytes, $0ad8-$0ad8) ===
        .byte $aa                                   // .

// --- Region $0e60-$0e71 ---
.pc = $0e60 "loc_0e60"

loc_0e60:
        ldx #$00

loc_0e62:
        lda scr_0e71,x
        sta $0100,x
        inx
        bne loc_0e62
        ldx #$ff
        txs
        jmp $0100

scr_0e71:
        // === Screen RAM (1 bytes, $0e71-$0e71) ===
        .byte $78                                   // scrcode: .

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

// --- Region $0801-$0826 ---
.pc = $0801 "dat_0801"

dat_0801:
        // === BASIC loader stub ===
        .byte $25,$08                               // next line pointer ($0825)
        .byte $da,$07                               // line number 2010
        .byte $9e                                   // SYS token
        .text "27682010 SECTION 8 1985   "      // SYS 2768 → main_0ad0
        .byte $00                                   // end of line
        .byte $00,$00                               // end of BASIC program

// --- Region $09f5-$09ff ---
.pc = $09f5 "dat_09f5"

dat_09f5:
        .fill 11, $aa

// --- Region $0a7e-$0aaa ---
.pc = $0a7e "dat_0a7e"

dat_0a7e:
        .byte $aa                                   // .

dat_0a7f:
        // === Fill data (44 bytes, $0a7f-$0aaa) ===
        .fill 44, $ea

// --- Region $0ad9-$0e5f ---
.pc = $0ad9 "Program $0ad9"
        .fill 39, $aa
        .byte $00,$00,$00,$00,$00,$00,$0f,$ff,$e0,$1f,$ff,$f0,$1f,$ff,$f0,$1c // ................
        .byte $00,$70,$1c,$00,$20,$1e,$00,$00,$1f,$ff,$e0,$1f,$ff,$f0,$0f,$ff // .p.. ...........
        .byte $f0,$00,$00,$f0,$0f,$80,$70,$1f,$c0,$70,$1f,$c0,$70,$1f,$c0,$f0 // ......p..p..p...
        .byte $1f,$ff,$f0,$1f,$ff,$f0,$0f,$ff,$e0,$00,$00,$00,$00,$00,$00,$04 // ................
        .byte $00,$00,$00,$00,$00,$00,$0f,$ff,$e0,$1f,$ff,$f0,$1f,$ff,$f0,$1e // ................
        .byte $00,$f0,$1c,$00,$70,$1c,$00,$20,$1c,$00,$00,$1f,$fc,$00,$1f,$fe // ....p.. ........
        .byte $00,$1f,$fc,$00,$1f,$c0,$00,$1f,$c0,$20,$1f,$c0,$70,$1f,$e0,$f0 // ......... ..p...
        .byte $1f,$ff,$f0,$1f,$ff,$f0,$0f,$ff,$e0,$00,$00,$00,$00,$00,$00,$85 // ................
        .byte $00,$00,$00,$00,$00,$00,$0f,$ff,$e0,$1f,$ff,$f0,$1f,$ff,$f0,$1e // ................
        .byte $00,$f0,$1c,$00,$70,$1c,$00,$20,$1c,$00,$00,$1c,$00,$00,$1f,$00 // ....p.. ........
        .byte $00,$1f,$80,$00,$1f,$c0,$00,$1f,$c0,$20,$1f,$c0,$70,$1f,$e0,$f0 // ......... ..p...
        .byte $1f,$ff,$f0,$1f,$ff,$f0,$0f,$ff,$e0,$00,$00,$00,$00,$00,$00,$00 // ................
        .byte $00,$00,$00,$00,$00,$00,$3f,$ff,$e0,$7f,$ff,$f0,$3f,$ff,$e0,$00 // ......?.....?...
        .byte $70,$00,$00,$70,$00,$00,$70,$00,$00,$70,$00,$00,$70,$00,$00,$7c // p..p..p..p..p..|
        .byte $00,$00,$7e,$00,$00,$7f,$00,$00,$7f,$00,$00,$7f,$00,$00,$7f,$00 // ..~.............
        .byte $00,$7f,$00,$00,$7f,$00,$00,$3e,$00,$00,$00,$00,$00,$00,$00,$00 // .......>........

scr_0c00:
        // === Screen RAM (608 bytes, $0c00-$0e5f) ===
        .encoding "screencode_mixed"
        .text "@@@@@@h@@"
        .byte $1c                                   // scrcode: .
        .text "@@"
        .byte $1c                                   // scrcode: .
        .text "@@"
        .byte $1c                                   // scrcode: .
        .text "@@"
        .byte $1c                                   // scrcode: .
        .text "@@"
        .byte $1c                                   // scrcode: .
        .text "@@"
        .byte $1c                                   // scrcode: .
        .text "@@"
        .byte $1c                                   // scrcode: .
        .text "@@"
        .byte $1f                                   // scrcode: .
        .text "@@"
        .byte $1f,$80                               // scrcode: ..
        .text "@"
        .byte $1f,$c0                               // scrcode: ..
        .text "@"
        .byte $1f                                   // scrcode: .
        .byte $c0                                   // scrcode: .
        .text "@"
        .byte $1f,$c0                               // scrcode: ..
        .text "@"
        .byte $1f,$c0                               // scrcode: ..
        .text "@"
        .byte $1f,$c0                               // scrcode: ..
        .text "@"
        .byte $1f,$c0                               // scrcode: ..
        .text "@o"
        .byte $80                                   // scrcode: .
        .text "@@@@@@@e@@@@@@o"
        .byte $ff,$e0,$1f,$ff,$f0,$1f,$ff,$f0,$1e   // scrcode: .........
        .text "@"
        .byte $f0,$1c                               // scrcode: ..
        .text "@"
        .byte $70,$1c                               // scrcode: ..
        .text "@"
        .byte $70,$1c                               // scrcode: ..
        .text "@"
        .byte $70,$1c                               // scrcode: ..
        .text "@"
        .byte $70,$1f                               // scrcode: ..
        .text "@"
        .byte $70,$1f,$80,$70,$1f,$c0,$70,$1f,$c0,$70,$1f,$c0,$70,$1f,$c0,$f0 // scrcode: ................
        .byte $1f,$ff,$f0,$1f,$ff,$f0               // scrcode: ......
        .text "o"
        .byte $ff                                   // scrcode: .
        .byte $e0                                   // scrcode: .
        .text "@@@@@@@@@@@@@l@ "
        .byte $1e                                   // scrcode: .
        .text "@"
        .byte $70,$1f                               // scrcode: ..
        .text "@"
        .byte $70,$1f,$80,$70,$1f,$c0,$70,$1d,$e0,$70,$1c,$f0,$70,$1c,$78,$70 // scrcode: ................
        .byte $1f                                   // scrcode: .
        .text "<"
        .byte $70,$1f,$9e,$70,$1f,$cf,$70,$1f,$c7,$f0,$1f,$c3,$f0,$1f,$c1,$f0 // scrcode: ................
        .byte $1f,$c0,$f0,$1f,$c0,$70               // scrcode: ......
        .text "o"
        .byte $80                                   // scrcode: .
        .text " @@@@@@"
        .byte $44                                   // scrcode: .
        .text "@@@@@@o"
        .byte $ff                                   // scrcode: .
        .byte $e0,$1f,$ff,$f0,$1f,$ff,$f0,$1e       // scrcode: ........
        .text "@"
        .byte $f0,$1c                               // scrcode: ..
        .text "@"
        .byte $70,$1c                               // scrcode: ..
        .text "@"
        .byte $70,$1e                               // scrcode: ..
        .text "@"
        .byte $f0,$1f,$ff,$f0,$1f,$ff,$e0,$1f       // scrcode: ........
        .text "@"
        .byte $f0,$1f,$80,$70,$1f,$80,$70,$1f,$80,$70,$1f,$80,$f0 // scrcode: .............
        .byte $1f,$ff,$f0,$1f,$ff,$f0               // scrcode: ......
        .text "o"
        .byte $ff,$e0                               // scrcode: ..
        .text "@@@@@@@"
        .encoding "petscii_upper"

txt_0d00:
        .text "               M"
        .byte $cd                                   // 'M' | $80 (end-of-string marker)
        .encoding "screencode_mixed"
        .byte $4e,$ce                               // scrcode: ..
        .text "  s"
        .byte $93                                   // scrcode: .
        .text "e"
        .byte $85                                   // scrcode: .
        .text "c"
        .byte $83                                   // scrcode: .
        .text "t"
        .byte $94                                   // scrcode: .
        .text "i"
        .byte $89                                   // scrcode: .
        .text "o"
        .byte $8f                                   // scrcode: .
        .text "n"
        .byte $8e                                   // scrcode: .
        .encoding "petscii_upper"

txt_0d23:
        .text "  8"
        .byte $b8                                   // '8' | $80 (end-of-string marker)
        .encoding "screencode_mixed"
        .text "/"
        .byte $af                                   // scrcode: .
        .text "s"
        .byte $93                                   // scrcode: .
        .text "o"
        .byte $8f                                   // scrcode: .
        .text "f"
        .byte $86                                   // scrcode: .
        .text "t"
        .byte $94                                   // scrcode: .
        .text "b"
        .byte $82                                   // scrcode: .
        .text "u"
        .byte $95                                   // scrcode: .
        .text "s"
        .byte $93                                   // scrcode: .
        .text "t"
        .byte $94                                   // scrcode: .
        .text "e"
        .byte $85                                   // scrcode: .
        .text "r"
        .byte $92                                   // scrcode: .
        .text "s"
        .byte $93                                   // scrcode: .
        .text "s"
        .byte $93                                   // scrcode: .
        .text "y"
        .byte $99                                   // scrcode: .
        .text "s"
        .byte $93                                   // scrcode: .
        .text "t"
        .byte $94                                   // scrcode: .
        .text "e"
        .byte $85                                   // scrcode: .
        .text "m"
        .byte $8d                                   // scrcode: .
        .text "s"
        .byte $93                                   // scrcode: .
        .text "."
        .byte $ae                                   // scrcode: .
        .text "   g"
        .byte $87                                   // scrcode: .
        .text "r"
        .byte $92                                   // scrcode: .
        .text "e"
        .byte $85                                   // scrcode: .
        .text "e"
        .byte $85                                   // scrcode: .
        .text "t"
        .byte $94                                   // scrcode: .
        .text "i"
        .byte $89                                   // scrcode: .
        .text "n"
        .byte $8e                                   // scrcode: .
        .text "g"
        .byte $87                                   // scrcode: .
        .text "s"
        .byte $93                                   // scrcode: .
        .text "  t"
        .byte $94                                   // scrcode: .
        .text "o"
        .byte $8f                                   // scrcode: .
        .text "  b"
        .byte $82                                   // scrcode: .
        .text "c"
        .byte $83                                   // scrcode: .
        .text "s"
        .byte $93                                   // scrcode: .
        .text ","
        .byte $ac                                   // scrcode: .
        .text "i"
        .byte $89                                   // scrcode: .
        .text "n"
        .byte $8e                                   // scrcode: .
        .text "d"
        .byte $84                                   // scrcode: .
        .text "y"
        .byte $99                                   // scrcode: .
        .text ","
        .byte $ac                                   // scrcode: .
        .text "j"
        .byte $8a                                   // scrcode: .
        .text "e"
        .byte $85                                   // scrcode: .
        .text "d"
        .byte $84                                   // scrcode: .
        .text "i"
        .byte $89                                   // scrcode: .
        .text ","
        .byte $ac                                   // scrcode: .
        .text "c"
        .byte $83                                   // scrcode: .
        .text "b"
        .byte $82                                   // scrcode: .
        .text "g"
        .byte $87                                   // scrcode: .
        .text ","
        .byte $ac                                   // scrcode: .
        .text "a"
        .byte $81                                   // scrcode: .
        .text "b"
        .byte $82                                   // scrcode: .
        .text "c"
        .byte $83                                   // scrcode: .
        .text "  a"
        .byte $81                                   // scrcode: .
        .text "n"
        .byte $8e                                   // scrcode: .
        .text "d"
        .byte $84                                   // scrcode: .
        .text " "
        .text " t"
        .byte $94                                   // scrcode: .
        .text "b"
        .byte $82                                   // scrcode: .
        .text "c"
        .byte $83                                   // scrcode: .
        .text "."
        .byte $ae                                   // scrcode: .
        .encoding "petscii_upper"

dat_0da8:
        .text "                                                                                        "
        .byte $cd                                   // 'M' | $80 (end-of-string marker)
        .byte $ce                                   // scrcode: .

txt_0e02:
        .text " SECTION 8"
        .byte $0d                                   // string terminator

txt_0e0d:
        .text "      PRESENTS"
        .byte $0d                                   // string terminator
        .byte $96                                   // scrcode: .

txt_0e1d:
        .text "                   "
        .byte $0d                                   // string terminator

txt_0e31:
        .text "        QUARI     "
        .encoding "screencode_mixed"
        .text "e mm"
        .encoding "petscii_upper"

txt_0e47:
        .text " SOFTBUSTERSSYSTEMS"
        .byte $00                                   // string terminator
        .encoding "screencode_mixed"
        .text "@@@@@"
        .encoding "petscii_upper"

// --- Region $0e72-$0ef6 ---
.pc = $0e72 "Program $0e72"
        .encoding "screencode_mixed"
        .byte $a9                                   // scrcode: .
        .text "4"
        .byte $85                                   // scrcode: .
        .text "a"
        .byte $a0                                   // scrcode: .
        .text "@"
        .byte $a9,$e4,$85,$ae,$a9,$60,$85,$af,$a9   // scrcode: .........
        .text "@"
        .byte $85,$ac,$85,$ad,$a5,$ac,$d0           // scrcode: .......
        .text "b"
        .byte $c6,$ad,$c6,$ac,$a5,$ae,$d0           // scrcode: .......
        .text "b"
        .byte $c6,$af,$c6,$ae,$b1,$ae,$91,$ac       // scrcode: ........
        .byte $a5,$ae,$c9,$f7,$d0,$e6,$a5,$af,$c9   // scrcode: .........
        .text "n"
        .byte $d0,$e0,$a9                           // scrcode: ...
        .text "a"
        .byte $85,$ae,$a9                           // scrcode: ...
        .text "h"
        .byte $85,$af,$b1,$ac,$c9,$bf,$d0           // scrcode: .......
        .text "r "
        .byte $78                                   // scrcode: .
        .text "a"
        .byte $b1,$ac,$aa,$a9                       // scrcode: ....
        .text "@"
        .byte $91,$ae                               // scrcode: ..
        .text " "
        .byte $7f                                   // scrcode: .
        .text "a"
        .byte $ca                                   // scrcode: .
        .byte $d0,$f8,$f0                           // scrcode: ...
        .text "v"
        .byte $c9,$cf,$d0                           // scrcode: ...
        .text "m "
        .byte $78                                   // scrcode: .
        .text "a"
        .byte $b1,$ac,$aa                           // scrcode: ...
        .text " "
        .byte $78                                   // scrcode: .
        .text "a"
        .byte $b1,$ac,$d0,$e5,$91,$ae               // scrcode: ......
        .text " "
        .byte $7f                                   // scrcode: .
        .text "a "
        .byte $78                                   // scrcode: .
        .text "a"
        .byte $d0,$cd,$a9                           // scrcode: ...
        .text "7"
        .byte $85                                   // scrcode: .
        .text "a"
        .byte $58,$4c,$e2,$fc,$e6                   // scrcode: .....
        .byte $ac,$d0                               // scrcode: ..
        .text "b"
        .byte $e6,$ad,$60,$e6,$ae,$d0               // scrcode: ......
        .text "b"
        .byte $e6,$af,$60                           // scrcode: ...
        .encoding "petscii_upper"
