// ============================================
// ctx-01 - Disassembled Source
// ============================================
// KickAssembler syntax
// Generated by Restore 64 vdisasm-one 1.0 build 1, 2026-03-29 17:54:11
// https://restore64.dev by datucker / Rabenauge
//
// Load address: $0801  End: $0c8f  (1167 bytes)
// Entry point:  $0812 (via BASIC SYS 2066)
// IRQ handler:  $091c (irq_091c)
// IRQ handler:  $ea31 (loc_ea31)
//
// Code: 592 bytes, Data: 575 bytes
// Labels: 54, Subroutines: 1
//
// Cross-references: all OK
// ============================================


// --- Region $0812-$09d5 ---
.pc = $0812 "main_0812"
main_0812: {
        ldx #$00
        lda #$20
loop1:
        sta $e000,x
        sta $e100,x
        sta $e200,x
        sta $e300,x
        inx
        bne loop1
        sei
        lda #$33
        sta $01
        lda #$d4
        sta $fc
        lda #$e8
        sta $fe
        ldy #$00
        sty $fb
        sty $fd
        ldx #$07
loop2:
        lda ($fb),y
        sta ($fd),y
        dey
        bne loop2
        inc $fe
        inc $fc
        dex
        bpl loop2
        lda #$34
        sta $01
        lsr $a8
        lda #$5c
        sta $02
        lda #$00
        sta $fb
        sta $fd
        lda #$e8
        sta $fc
        lda #$ea
        sta $fe
loop3:
        ldy #$07
        ldx #$0f
loop4:
        lda ($fb),y
        sta $02a8,x
        dex
        sta $02a8,x
        dex
        dey
        bpl loop4
        ldy #$07
loop5:
        lda $02a8,y
        sta ($fb),y
        lda $02b0,y
        sta ($fd),y
        dey
        bpl loop5
        lda $fb
        clc
        adc #$08
        sta $fb
        sta $fd
        bcc skip1
        inc $fc
        inc $fe
skip1:
        dec $02
        lda $02
        cmp #$1c
        bne loop3
        lda #$37
        sta $01
        ldx #$ff
        stx $e800
        inx
loop6:
        lda #$e9
        sta $e801,x
        inx
        cpx #$06
        bne loop6
        lda #$55
        sta $e807
        lda #$08
        sta $0286
        jsr $e544
        ldx #$00
        ldy #$00
loop7:
        lda $0ad5,x
        cmp #$ff
        beq skip3
        sta $fb
        lda #$08
        sta $fc
loop8:
        asl $fb
        bcc skip2
        lda #$00
        sta $dc0e
        sta $e168,y
        sta $d020
        lda #$0b
        sta $d022
        sta $d968,y
skip2:
        iny
        dec $fc
        bne loop8
        inx
        bne loop7
skip3:
        lda #$1c
        sta $0314                                   // set IRQ handler low byte
        lda #$09
        sta $0315                                   // set IRQ handler high byte
        cli
        ldx #$00
loop9:
        lda $0a17,x
        sta $04aa,x
        inx
        cpx #$14
        bne loop9
        ldx #$00
        txa
loop10:
        sta $d800,x
        sta $db00,x
        inx
        bne loop10
        inx
        stx $d01a                                   // all IRQs off
loop11:
        jsr $ffe4
        beq loop11
        cmp #$20
        bne loop11
        jmp loc_0a41
}

// ============================================
// IRQ handler
// ============================================
// Referenced by: branch from $0921

irq_091c:
        lda #$50
        cmp $d012
        bne irq_091c
        lda #$c7
        sta $dd00                                   // VIC bank 0 ($0000-$3fff)
        lda #$14
        sta $d018                                   // screen=$0400, charset=$1000
        ldx #$00

loc_092f:
        ldy $0a2b,x

loc_0932:
        dey
        bne loc_0932
        lda $0a37,x
        sta $d016
        sta $d016
        inx
        cpx #$0d
        bne loc_092f
        ldy #$30

loc_0945:
        dey
        bne loc_0945
        lda #$c8
        sta $dd00                                   // VIC bank 3 ($c000-$ffff)
        lda #$8a
        sta $d018                                   // screen=$2000, charset=$2800

loc_0952:
        lda #$78
        cmp $d012
        bne loc_0952
        nop
        ldy #$78
        ldx #$00

loc_095e:
        lda $09e4,x

loc_0961:
        cpy $d012
        bne loc_0961
        sta $d023
        iny
        inx
        cpx #$32
        bne loc_095e
        ldy $0a15
        ldx #$30

loc_0974:
        lda $09e4,x
        sta $09e5,x
        dex
        bne loc_0974
        sty $09e5
        lda #$34
        sta $01
        jsr sub_0a93
        lda #$37
        sta $01

loc_098b:
        lda #$e8
        cmp $d012
        bne loc_098b
        lda dat_0ad4
        sta $d016
        ldy #$e8
        ldx #$00

loc_099c:
        lda $09e4,x

loc_099f:
        cpy $d012
        bne loc_099f
        sta $d021
        iny
        inx
        cpx #$14
        bne loc_099c
        lda #$00
        sta $d021
        ldx $0a16
        cpx #$0d
        bne loc_09bb
        ldx #$ff

loc_09bb:
        inx
        stx $0a16
        lda txt_09d6,x
        sta $d8a1
        ldx #$28

loc_09c7:
        lda $d8a0,x
        sta $d8a1,x
        dex
        bne loc_09c7
        inc $d019                                   // acknowledge raster IRQ
        jmp $ea31

// --- Region $0a41-$0ad3 ---
.pc = $0a41 "loc_0a41"

loc_0a41:
        sei
        lda #$31
        ldy #$ea
        sta $0314                                   // set IRQ handler low byte
        sty $0315
        jsr $ff5b
        jsr $fda3
        lda #$c7
        sta $dd00                                   // VIC bank 0 ($0000-$3fff)
        lda #$14
        sta $d018                                   // screen=$0400, charset=$1000
        ldx #$00
        stx $d01a                                   // all IRQs off

loc_0a61:
        lda dat_0a70,x
        sta $03b7,x
        inx
        cpx #$28
        bne loc_0a61
        cli
        jmp $03b7

dat_0a70:
        .byte $78,$a9,$30,$85,$01,$a2,$00           // x.0....

loc_0a77:
        lda $0c90,x
        sta dat_0801,x
        inx
        bne loc_0a77
        inc $03c0
        inc $03c3
.label loc_0a87 = * + 1
        lda $03c0
        bne loc_0a77
        lda #$37
        sta $01
        cli
        jmp $fce2
// Referenced by: jsr from $0984

sub_0a93:
        lda dat_0ad4
        sbc #$02
        bcc loc_0a9e
        sta dat_0ad4
        rts

loc_0a9e:
        eor #$f8
        sta dat_0ad4
        ldy #$00

loc_0aa5:
        lda $e399,y
        sta $e398,y
        adc #$40
        sta $e3c0,y
        iny
        cpy #$28
        bne loc_0aa5
.label smc_0ab6 = * + 1
.label smc_0ab7 = * + 2
        lda txt_0af5                                // !SMC: modified by $0ac6, $0acb
        inc smc_0ab6
        bne loc_0ac0
        inc smc_0ab7

loc_0ac0:
        cmp #$ff
        bne loc_0ad0
        lda #$f5
        sta smc_0ab6                                // SMC: modifies $0ab6
        lda #$0a
        sta smc_0ab7                                // SMC: modifies $0ab7
        lda #$20

loc_0ad0:
        sta $e3bf
        rts

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

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

dat_0801:
        // === BASIC loader stub ===
        .byte $0f,$08                               // next line pointer ($080f)
        .byte $c5,$07                               // line number 1989
        .byte $9e                                   // SYS token
        .byte $32,$30,$36,$36,$20,$9a,$45,$58       // SYS 2066 → main_0812
        .byte $00                                   // end of line
        .byte $00,$00                               // end of BASIC program
        .byte $00                                   // .

// --- Region $09d6-$0a40 ---
.pc = $09d6 "txt_09d6"

txt_09d6:
        .encoding "screencode_mixed"
        .text "iikkhhllooggaa"
        .text "@"
        .text "i"
        .text "@"
        .text "ik"
        .text "@"
        .text "kh"
        .text "@"
        .text "hl"
        .text "@"
        .text "lo"
        .text "@"
        .text "og"
        .text "@"
        .text "ga"
        .text "@"
        .text "aa"
        .text "@"
        .text "ag"
        .text "@"
        .text "go"
        .text "@"
        .text "ol"
        .text "@"
        .text "lh"
        .text "@"
        .text "hk"
        .text "@"
        .text "ki"
        .text "@"
        .text "i"
        .text "@"
        .text "@"
        .text "@"
        .text "@"
        .text "@"
        .text "@"
        .text "@"
        .text "@"
        .text "the best you can getghhahhhhhhha"
        .text "@"
        .text "@"
        .text "gfedcba"
        .text "@"
        .encoding "petscii_upper"

// --- Region $0ad4-$0c8f ---
.pc = $0ad4 "dat_0ad4"

dat_0ad4:
        .byte $00,$0f,$39,$ef,$1e,$d8,$18,$6d,$b1,$b0,$d8,$18,$6d,$b1,$b6,$70 // ..9....m....m..p
        .byte $18,$6d,$b1,$b0,$d8,$1f,$7d,$b1,$be,$d8,$0f,$39,$b1,$9e,$d8,$ff // .m....}....9....
        .byte $00                                   // .

txt_0af5:
        .encoding "screencode_mixed"
        .text "remember the preview i released of this almost 1 year back? well this is the full release version of the same shit. cracked and trained by rockstar. it's still in that frozen form that it was on tape so it works"
        .encoding "petscii_upper"

txt_0bc8:
        .text " 100%.  "

txt_0bd0:
        .encoding "screencode_mixed"
        .text "contex salutes you"
        .encoding "petscii_upper"

txt_0be2:
        .text ": 711 - "

txt_0bea:
        .encoding "screencode_mixed"
        .text "action - cosmos - ligh"
        .encoding "petscii_upper"

scr_0c00:
        // === Screen RAM (144 bytes, $0c00-$0c8f) ===
        .encoding "screencode_mixed"
        .text "t - ils - crazy - talent - gp"
        .encoding "petscii_upper"

txt_0c1d:
        .text " -  "
        .encoding "screencode_mixed"
        .text "dcs - "
        .byte $1b                                   // scrcode: .
        .text "d"
        .byte $1d                                   // scrcode: .
        .text " - f4cg - dominators - x-ray - "
        .text "nato - oneway - zeb+wot - transcom - sph"
        .text "inx - red sector - rti"
        .encoding "petscii_upper"

txt_0c87:
        .text "...     "
        .byte $ff                                   // scrcode: .
