// ============================================
// output - Disassembled Source
// ============================================
// KickAssembler syntax
// Generated by Restore 64 v0.2.1 alpha build 298, 2026-04-11 21:36:10
// https://restore64.dev by datucker / Rabenauge
//
// Load address: $0801  End: $ce2f  (50735 bytes)
// Crunched with Exomizer v2/v3 — depacked by emulation
// Packer entry: $080b (via BASIC SYS 2059)
// Entry point:  $cd00 (52480)
// IRQ handler:  $c950 (irq_c950)
//
// Code: 519 bytes, Data: 50216 bytes
// Labels: 61, Subroutines: 3
//
// Verification: 5 line(s) auto-corrected to .byte for exact byte matching
//
// Cross-references: all OK
// ============================================


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

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

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

// --- Region $c900-$c942 ---
.pc = $c900 "sub_c900"
// Referenced by: jsr from $cafa

sub_c900:
        sei
        lda #$7f
        sta $dc0d
        lda #$01
        sta $d01a
        lda #$1b
        sta $d011
        lda #$62
        sta $d012
        lda #$50
        sta $02
        lda #$cb
        sta $03
        lda #$07
        sta $04
        lda #$50
        sta $05
        lda #$cd
        sta $06
        lda #$50
        sta $0314
        lda #$c9
        sta $0315
        lda #$07
        sta $07
        lda #$04
        sta $02aa
        lda #$c1
        sta $0318
        cli
        rts

// --- Region $c950-$cb01 ---
.pc = $c950 "irq_c950"
irq_c950: {
        ldy #$08
        jsr sub_cad5
        lda $04
        sta $d016
        lda #$15
        sta $d018
        ldy #$00
        ldx #$01
        lda #$6a
loop1:
        cmp $d012
        bne loop1
        ldy #$08
        jsr sub_cad5
        nop
        lda txt_cb00
        sta $d021
        sta $d020
        ldy #$00
        ldx #$01
        nop
        nop
        nop
loop2:
        lda txt_cb00,x
        sta $d021
        sta $d020
        ldy $cb18,x
loop3:
        dey
        bne loop3
        inx
        cpx #$18
        bne loop2
        nop
        nop
        lda #$00
        sta $d020
        sta $d021
        lda #$07
        sta $d016
        dec $04
        lda $04
        cmp #$ff
        bne skip3
        lda #$07
        sta $04
        ldx #$00
loop4:
        lda $0541,x
        sta $0540,x
        inx
        cpx #$27
        bne loop4
        ldy #$00
        lda ($02),y
        beq skip2
        ora #$80
        sta $0567
        inc $02
        bne skip1
        inc $03
skip1:
        jmp $c9db
skip2:
        lda #$50
        sta $02
        lda #$cb
        sta $03
        jmp $c9be
skip3:
        ldx #$00
loop6:
        lda $cb30,x
        sta $cb08,x
        inx
        cpx #$08
        bne loop6
        lda #$a2
loop7:
        cmp $d012
        bne loop7
        lda $07
        sta $d016
        ldy #$00
        ldx #$01
        lda #$aa
loop8:
        cmp $d012
        bne loop8
        ldy #$08
        jsr sub_cad5
        nop
        lda txt_cb00
        sta $d021
        sta $d020
        ldy #$00
        ldx #$01
        nop
        nop
        nop
loop9:
        lda txt_cb00,x
        sta $d020
        sta $d021
        ldy $cb18,x
loop10:
        dey
        bne loop10
        inx
        cpx #$18
        bne loop9
        nop
        nop
        lda #$00
        sta $d020
        sta $d021
        lda #$07
        sta $d016
        dec $07
        dec $07
        lda $07
        cmp #$ff
        bne skip6
        lda #$07
        sta $07
        ldx #$00
loop11:
        lda $0681,x
        sta $0680,x
        inx
        cpx #$27
        bne loop11
        ldy #$00
        lda ($05),y
        beq skip5
        ora #$80
        sta $06a7
        inc $05
        bne skip4
        inc $06
skip4:
        jmp $ca72
skip5:
        lda #$50
        sta $05
        lda #$cd
        sta $06
        jmp $ca55
skip6:
        lda #$0f
        sta $d019
        lda #$1b
        sta $d011
        dec $02aa
        lda $02aa
        beq skip7
        nop
        nop
        nop
        jmp $ea31
skip7:
        jsr sub_ca95
        lda #$04
        sta $02aa
        jmp $ea31
}

// Referenced by: jsr from $ca8a
sub_ca95: {
        ldx #$00
        lda txt_cb00
        tay
loop1:
        lda $cb01,x
        sta txt_cb00,x
        inx
        cpx #$07
        bne loop1
        tya
        sta $cb07
        ldx #$06
        lda $cb17
        tay
loop2:
        lda $cb10,x
        sta $cb11,x
        dex
        cpx #$ff
        bne loop2
        tya
        sta $cb10
        ldx #$17
        lda $cb47
        tay
loop3:
        lda $cb30,x
        sta $cb31,x
        dex
        cpx #$ff
        bne loop3
        tya
        sta $cb30
        rts
}
// Referenced by: jsr from $c952, $c96c, $ca01; branch from $cad6

sub_cad5:
        dey
        bne sub_cad5
        rts

loc_cad9:
        lda #$00
        sta $d020
        sta $d021
        lda #$00
        sta $0286
        lda #$93
        jsr $ffd2
        lda #$a0
        ldx #$00

loc_caef:
        sta $0540,x
        sta $0680,x
        inx
        cpx #$28
        bne loc_caef
        jsr sub_c900
        jmp loc_ccb8

txt_cb00:
        .encoding "screencode_mixed"
        .text "kl"
        .encoding "petscii_upper"

// --- Region $ccb8-$ccc1 ---
.pc = $ccb8 "loc_ccb8"

loc_ccb8:
        jsr $ffe4
        cmp #$20
        bne loc_ccb8
        jmp $fce2

// --- Region $cd00-$cd07 ---
.pc = $cd00 "main_cd00"

main_cd00:
        lda #$36
        sta $01
        jmp loc_cad9

txt_cd07:
        .encoding "screencode_mixed"
        .text "r"
        .encoding "petscii_upper"

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

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

dat_0801:
        // === BASIC loader stub ===
        .byte $0b,$08                                                     // [corrected] was: .byte $0c,$08                               // next line pointer ($080c)
        .byte $d3,$07                                                     // [corrected] was: .byte $00,$00                               // line number 0
        .byte $9e                                   // SYS token
        .byte $32,$30,$35,$39,$00
        .byte $a0                                                         // [corrected] was: .byte $00                                   // end of line
        .byte $00,$78                                                     // [corrected] was: .byte $00,$00                               // end of BASIC program
        .byte $e6,$01,$ba,$bd,$47,$0b,$9d,$fc,$00,$ca,$d0,$f7,$4c,$fe,$0b,$80 // ....G.......L...
        .byte $00,$78,$23,$7f,$46,$0d,$dc,$c6,$01,$1a,$8d,$29,$d0,$62,$0d,$8d // .x#.F......).b..
        .byte $a6,$62,$70,$3f,$94,$1d,$dc,$05,$4e,$14,$0d,$c9,$89,$15,$1d,$bd // .bp?....N.......
        .byte $da,$d0,$7f,$78,$a9,$c1,$61,$03,$58,$60,$4f,$cf,$f4,$80,$66,$c2 // ...x..a.X`O...f.
        .byte $e3,$16,$30,$15,$8d,$3b,$18,$b5,$6a,$41,$6b,$80,$1b,$98,$0d,$50 // ..0..;..jAk....P
        .byte $04,$a5,$bb,$6e,$04,$0d,$f4,$41,$55,$8e,$e3,$60,$0e,$dc,$67,$05 // ...n...AU..`..g.
        .byte $3d,$4b,$62,$a4,$db,$ae,$d8,$ab,$c9,$85,$03,$4c,$be,$c9,$df,$3a // =Kb........L...:
        .byte $60,$25,$c6,$99,$38,$08,$bb,$67,$e3,$d4,$b0,$a5,$d4,$63,$36,$a9 // `%..8..g.....c6.
        .byte $aa,$cd,$12,$1e,$23,$fb,$d7,$08,$d5,$d5,$ca,$dd,$ec,$b0,$54,$22 // ....#.........T"
        .byte $84,$8c,$a2,$01,$f1,$98,$bd,$d0,$71,$a4,$bc,$15,$cb,$a7,$1c,$34 // ........q......4
        .byte $18,$ec,$ed,$6b,$1a,$34,$00,$8d,$16,$d8,$e8,$c6,$26,$a5,$59,$c9 // ...k.4......&.Y.
        .byte $a7,$30,$d9,$a9,$85,$07,$cb,$38,$bd,$81,$cd,$5e,$1e,$27,$14,$a0 // .0.....8...^.'..
        .byte $00,$b1,$ce,$f0,$0e,$3b,$09,$80,$8d,$a7,$f9,$b4,$d0,$02,$bb,$e6 // .....;..........
        .byte $d4,$72,$9a,$50,$93,$05,$aa,$cd,$85,$06,$4c,$55,$df,$bc,$0f,$91 // .r.P......LU....
        .byte $19,$b6,$1b,$d9,$8d,$11,$d0,$ce,$f4,$ad,$25,$32,$f0,$06,$60,$45 // ..........%2..`E
        .byte $02,$20,$95,$ca,$a9,$8f,$04,$8d,$aa,$02,$4c,$31,$ea,$ff,$96,$ad // . ........L1....
        .byte $56,$6a,$01,$3d,$00,$92,$3b,$30,$66,$90,$07,$f6,$06,$ad,$17,$4e // Vj.=..;0f......N
        .byte $d4,$6e,$ec,$11,$96,$a0,$10,$46,$a2,$17,$ad,$47,$fd,$a8,$bd,$6d // .n.....F...G...m
        .byte $9d,$31,$26,$ca,$e0,$3b,$ff,$b4,$98,$ce,$30,$cb,$88,$f5,$fd,$60 // .1&..;....0....`
        .byte $5b,$b2,$37,$28,$21,$d0,$6c,$6d,$8d,$86,$02,$dc,$93,$20,$d2,$ff // [.7(!.lm..... ..
        .byte $6f,$a9,$a0,$a2,$e7,$40,$95,$05,$9d,$80,$06,$e8,$e0,$28,$d0,$ff // o....@.......(..
        .byte $f5,$fc,$fc,$c9,$4c,$b8,$cc,$fa,$50,$11,$1f,$01,$79,$01,$e2,$09 // ....L...P...y...
        .byte $1b,$41,$14,$e2,$1b,$b8,$80,$26,$e4,$09,$ac,$37,$e8,$c1,$0e,$06 // .A.....&...7....
        .byte $9a,$c3,$29,$24,$0f,$0c,$0b,$eb,$0c,$a1,$1e,$0a,$08,$df,$42,$f8 // ..)$..........B.
        .byte $06,$0f,$ea,$28,$b9,$27,$2e,$1d,$2c,$21,$90,$0d,$a5,$1f,$03,$3f // ...(.'..,!.....?
        .byte $04,$96,$82,$5e,$03,$43,$04,$b3,$fb,$c1,$68,$10,$c9,$c3,$09,$f4 // ...^.C....h.....
        .byte $06,$6d,$a1,$9b
        .text "$H.D"
        .byte $01,$93,$66,$a5,$cd,$0f,$ce,$0d
        .byte $59,$02,$05,$c2,$32,$35,$9a,$06,$2a,$31,$39,$98,$38,$21,$b1,$33 // Y...25..*19.8!.3
        .byte $71,$a5,$09,$e9
        .byte $2e,$62,$0b
        .byte $52,$c7,$a0
        .text "W66>"
        .byte $17
        .byte $3d
        .byte $65,$ed,$d0,$19,$10,$f6,$d2,$31,$4a,$bd,$e0,$06,$bd,$49,$32,$22 // e......1J....I2"
        .byte $72,$18,$3f,$f1,$37,$c3,$28,$15,$12,$3b,$0e,$0b,$ea,$19,$7a,$88 // r.?.7.(..;....z.
        .byte $07,$55,$9a,$0b,$b0,$33,$2c,$6a,$71,$10,$e3,$43,$c1,$0f,$09,$17 // .U...3,jq..C....
        .byte $c9,$9d,$13,$1e,$8f,$18,$a6,$d1,$36,$a5,$07,$0c,$f3,$31,$2e,$eb // ........6....1..
        .byte $05,$81,$99,$07,$29,$e8,$c1,$a7,$7d,$e6,$9e,$06,$03,$0f,$43,$11 // ....)...}.....C.
        .byte $fd,$15,$e1,$14,$e5,$06,$02,$23,$ec,$85,$b7,$c2,$48,$7d,$19,$e6 // .......#....H}..
        .byte $6f,$37,$24,$0e,$05,$77,$9c,$81,$ae,$10,$39,$38,$e2,$15,$03,$06 // o7$..w....98....
        .byte $47,$32,$17,$09,$34,$3c,$44,$04,$2e,$dc,$2d,$18,$10,$eb,$02,$82 // G2..4<D...-.....
        .byte $00,$92,$ed,$e4,$ff,$c9,$20,$d0,$f9,$4c,$7f,$e2,$fc,$c2,$00,$00 // ...... ..L......
        .byte $a9,$36,$85,$0f,$4c,$fd,$d9,$ca,$cd,$10,$b9,$94,$19,$e6,$cb,$80 // .6..L...........
        .byte $79,$0d,$cd,$18,$2f,$13,$79,$17,$12,$21,$66,$0f,$00,$00,$17,$cf // y.../.y..!f.....
        .byte $07,$0d,$a8,$99,$ba,$23,$f6,$10,$5f,$b0,$08,$57,$4a,$65,$06,$58 // .....#.._..WJe.X
        .byte $fc,$c0,$f6,$32,$5f,$17,$a3,$96,$46,$4d,$7e,$0f,$12,$f6,$38,$0d // ...2_...FM~...8.
        .byte $4e,$32,$4c,$1c,$6e,$14,$11,$c3,$b5
        .byte $22,$9c
        .text "81-.4"
        .byte $35,$a6,$3d,$10,$1b,$12,$d5,$14,$05,$27,$bb,$36,$02,$01,$19,$28 // 5.=......'.6...(
        .byte $7e,$06,$09,$b5,$2e,$a5,$0e,$0a,$29,$e9,$4c,$8c,$34,$6a,$35,$2d // ~.......).L.4j5-
        .byte $ae
        .text "6Q9T82"
        .byte $12,$0b,$9d,$86,$13,$14,$0c
        .byte $3e,$87
        .byte $38,$32,$31,$07,$2d,$8a,$35,$33,$5a,$64,$12,$32,$0e,$09,$01,$e5 // 821.-.53Zd.2....
        .byte $04,$e5,$36,$2b,$39,$74,$2d,$38,$2d,$72,$32,$30,$31,$f2,$2a,$14 // ..6+9t-8-r201.*.
        .byte $08,$eb,$96,$da,$0e,$04,$0c,$eb,$13,$0b,$03,$01,$16,$37,$05,$3a // .............7.:
        .byte $cf
        .byte $35,$31,$6b,$6a
        .byte $34,$5d
        .text "-8670"
        .byte $7c
        .byte $20,$20,$00
        .byte $78,$91,$03,$4c,$d5,$91,$58,$18,$85,$80,$92,$dc,$c1,$8d,$45,$89 // x..L..X.......E.
        .byte $88,$08,$00,$00,$18,$59,$05,$01,$10,$00,$08,$30,$ce,$e8,$a9,$00 // .....Y.....0....
        .byte $85,$fc,$85,$fb,$e0,$01,$90,$21,$a5,$fd,$4a,$d0,$11,$ad,$1c,$01 // .......!..J.....
        .byte $d0,$03,$ce,$1d,$01,$ce,$1c,$01,$ad,$48,$0b,$90,$1b,$6a,$26,$fc // .........H...j&.
        .byte $26,$fb,$ca,$d0,$e5,$85,$fd,$a5,$fc,$60,$c6,$01,$58,$4c,$00,$cd // &........`..XL..
        .byte $ca,$c6,$ff,$c6,$af,$88,$b1,$ae,$91,$fe,$98,$d0,$f8,$8a,$d0,$f0 // ................
        .byte $20,$00,$01,$f0,$0a,$a5,$fe,$d0,$02,$c6,$ff,$c6,$fe,$90,$be,$c8 //  ...............
        .byte $20,$00,$01,$f0,$fa,$c0,$11,$b0,$d1,$be,$33,$03,$20,$01,$01,$79 //  .........3. ..y
        .byte $67,$03,$85,$a7,$a5,$fb,$79,$9b,$03,$48,$d0,$06,$a4,$a7,$c0,$04 // g.....y..H......
        .byte $90,$02,$a0,$03,$be,$ac,$01,$20,$01,$01,$79,$af,$01,$a8,$38,$a5 // ....... ..y...8.
        .byte $fe,$e5,$a7,$85,$fe,$b0,$02,$c6,$ff,$be,$34,$03,$20,$01,$01,$79 // ..........4. ..y
        .byte $68,$03,$90,$03,$e6,$fb,$18,$65,$fe,$85,$ae,$a5,$fb,$79,$9c,$03 // h......e.....y..
        .byte $65,$ff,$85,$af,$a4,$a7,$68,$aa,$90,$90,$02,$04,$04,$30,$20,$10 // e.....h......0 .
        .byte $e8,$98,$29,$0f,$f0,$13,$8a,$4a,$a6,$fc,$2a,$26,$fb,$ca,$10,$fa // ..)....J..*&....
        .byte $79,$67,$03,$aa,$a5,$fb,$79,$9b,$03,$99,$9c,$03,$8a,$99,$68,$03 // yg....y.......h.
        .byte $a2,$04,$20,$01,$01,$99,$34,$03,$c8,$c0,$34,$d0,$d3,$a0,$00,$4c // .. ...4...4....L
        .byte $43,$01                               // C.

// --- Region $c943-$c94f ---
.pc = $c943 "dat_c943"

dat_c943:
        .fill 13, $00

// --- Region $cb02-$ccb7 ---
.pc = $cb02 "Segment $cb02"
        .byte $0f,$01,$01,$0f,$0c,$0b,$00,$00,$00,$00,$00,$00,$00,$00,$0b,$0c // ................
        .byte $0f,$01,$01,$0f,$0c,$0b,$09,$09,$08,$08,$09,$09,$08,$08,$01,$09 // ................
        .byte $08,$09,$08,$08,$09,$09,$01,$08,$09,$09,$08,$08,$08,$09,$09,$06 // ................
        .byte $0e,$03,$01,$01,$03,$0e,$06,$0b,$0c,$0f,$01,$01,$0f,$0c,$0b,$09 // ................
        .byte $08,$0a,$01,$01,$0a,$08,$09,$00,$00,$00,$00,$00,$00,$00,$12,$0f // ................
        .byte $01,$04,$20,$12,$01,$09,$04,$05,$12,$2c,$20,$02,$19,$20,$0d,$09 // .. ......, .. ..
        .byte $0e,$04,$13,$03,$01,$10,$05,$20,$2d,$20,$03,$12,$01,$03,$0b,$05 // ....... - ......
        .byte $04,$20,$02,$19,$20,$0e,$0f,$20,$06,$12,$09,$0c,$0c,$13,$20,$09 // . .. .. ...... .
        .byte $0e,$14,$05,$12,$0e,$01,$14,$09,$0f,$0e,$01,$0c,$20,$0f,$0e,$20 // ............ .. 
        .byte $0e,$0f,$16,$05,$0d,$02,$05,$12,$20,$32,$35,$14,$08 // ........ 25..

txt_cb9f:
        .text ", 1988!  "

txt_cba8:
        .encoding "screencode_mixed"
        .text "when it asks for a password, type"
        .encoding "petscii_upper"

txt_cbc9:
        .text " "
        .byte $22                                   // double quote character
        .text "1"
        .byte $22                                   // double quote character
        .text " "

txt_cbce:
        .encoding "screencode_mixed"
        .text "and the return key to go to level"
        .encoding "petscii_upper"

txt_cbef:
        .text " 2, "
        .byte $22                                   // double quote character
        .text "2"
        .byte $22                                   // double quote character
        .text " "

txt_cbf7:
        .encoding "screencode_mixed"
        .text "and the return key to go to level"
        .encoding "petscii_upper"

txt_cc18:
        .text " 3, "

txt_cc1c:
        .encoding "screencode_mixed"
        .text "or press fire to start at level"
        .encoding "petscii_upper"

txt_cc3b:
        .text " 1     "

txt_cc42:
        .encoding "screencode_mixed"
        .text "greetings to: atc - conquest - fbr - inc - mayhem - nec - rampar - ucf - wise - xds - xpb"
        .encoding "petscii_upper"

txt_cc9b:
        .text "                            "
        .byte $00                                   // string terminator

// --- Region $ccc2-$ccc2 ---
.pc = $ccc2 "dat_ccc2"

dat_ccc2:
        // === Fill data (1 bytes, $ccc2-$ccc2) ===
        .byte $00                                   // .

// --- Region $cd08-$cd1c ---
.pc = $cd08 "Segment $cd08"
        .byte $09,$10,$20,$02,$19,$20,$03,$05,$0e,$14,$12,$01,$18,$2f,$13,$01 // .. .. ......./..
        .byte $0d,$01,$12,$21                       // ...!

dat_cd1c:
        // === Fill data (1 bytes, $cd1c-$cd1c) ===
        .byte $00                                   // .

// --- Region $cd50-$ce2e ---
.pc = $cd50 "txt_cd50"

txt_cd50:
        .text "     "

txt_cd55:
        .encoding "screencode_mixed"
        .text "great escapes(nfi hq"
        .encoding "petscii_upper"

txt_cd69:
        .text "): 516-968-0532 * "

txt_cd7b:
        .encoding "screencode_mixed"
        .text "wares for the masses(nfi tq"
        .encoding "petscii_upper"

txt_cd96:
        .text "): 609-845-6945 * "

txt_cda8:
        .encoding "screencode_mixed"
        .text "pirate's bay(nfi n.nj"
        .encoding "petscii_upper"

txt_cdbd:
        .text "): 201-495-9699 * "

txt_cdcf:
        .encoding "screencode_mixed"
        .text "the dark castle"
        .encoding "petscii_upper"

txt_cdde:
        .text ": 516-821-3353 * "
        .byte $14,$12,$09,$0e,$09,$04,$01,$04       // ........

txt_cdf7:
        .text ": 609-228-0201 * "

txt_ce08:
        .encoding "screencode_mixed"
        .text "the endless cave"
        .encoding "petscii_upper"

txt_ce18:
        .text ": 516-747-8670         "
