; 01-detect.s - unlock VIC-X and report what this machine has ; ; cl65 -t c64 -C c64-asm.cfg -u __EXEHDR__ --asm-include-dir ../include -o 01-detect.prg 01-detect.s .include "vicx.inc" STROUT = $AB1E ; BASIC ROM: print the text at A (low), Y (high) LINPRT = $BDCD ; BASIC ROM: print the number in X (low), A (high) .macro PRINT text lda #<(text) ldy #>(text) jsr STROUT .endmacro .macro NUMBER register ; print one register as a decimal number ldx register lda #0 jsr LINPRT .endmacro .code sei ; nothing may write $D000-$D3FF mid-unlock VICX_UNLOCK_SEQ cli lda VICX_ID0 ; "VX" only reads back on VIC-X cmp #$56 bne novicx lda VICX_ID1 cmp #$58 beq found novicx: PRINT t_none rts found: PRINT t_found NUMBER VICX_VERSION PRINT t_vram lda VICX_CAP_VRAM ; 8 KB units: multiply by 8 ldy #0 sty high asl rol high asl rol high asl rol high tax lda high jsr LINPRT PRINT t_xram NUMBER VICX_CAP_XRAM PRINT t_spr NUMBER VICX_CAP_SPR PRINT t_line NUMBER VICX_CAP_SPRLINE PRINT t_feat NUMBER VICX_CAP_FEAT PRINT t_blit NUMBER VICX_CAP_BLIT lda #13 jmp $FFD2 ; a final new line high: .byte 0 t_none: .byte "no vic-x here", 13, 0 t_found: .byte "vic-x found, spec version ", 0 t_vram: .byte 13, "vram: ", 0 t_xram: .byte " kb", 13, "xram: ", 0 t_spr: .byte " mb", 13, "sprites: ", 0 t_line: .byte " per line: ", 0 t_feat: .byte 13, "features: ", 0 t_blit: .byte " blitter: ", 0