home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Go64!
/
Go64_2000-10_2000_CSW_Side_B.d64
/
emu-checker.src
< prev
next >
Wrap
Text File
|
2023-02-26
|
8KB
|
328 lines
include standard.c64
debuglines = 4
debugpos = $0400+(25-debuglines)*40
statusline = 25-debuglines-2
choice set $31
org $0801
flag = $fb
zp_tmp = $fc
adr $080b, 64
byt $9e,"2061",0,0,0
jmp_in:
lda #9
sta $d020
sta $d021
lda #$1c
sta $0288
jsr $e544
ldx #statusline+2
ldy #0
clc
jsr $fff0
lda #lo(scrn1c_txt)
ldy #hi(scrn1c_txt)
jsr print
lda #4
sta $0288
lda #lo(screen)
ldy #hi(screen)
jsr print
getkey:
ldx #debuglines*40
cl_dbpos:
lda #$20
sta debugpos-1,x
lda #$0f
sta debugpos&$3ff+$d800-1,x
dex
bne cl_dbpos
ldx #statusline
jsr $e9ff
gk_l1:
jsr $ffe4
beq gk_l1
cmp #choice
choice set choice+1
bne no_d800
d800_check:
ldy #0
ldx #0
d800_l1:
lda $d800
sta debugpos,x
eor $d800
beq d800_l2
iny
d800_l2:
inx
cpx #debuglines*40
bne d800_l1
sty flag
lda #lo(d800_c64)
ldy #hi(d800_c64)
ldx flag
bne d800_l3
lda #lo(d800_emu)
ldy #hi(d800_emu)
d800_l3:
jsr write_stat
jsr $ffe4
cmp #' '
bne d800_check
jmp getkey
no_d800:
cmp #choice
choice set choice+1
bne no_sid
check_sid:
lda #$ff
sta flag
sta $d400
lda $d400
sta zp_tmp
sid_l5:
lda $d012
bpl *-3
ldx #0
ldy #0
sid_l1:
lda $d400
sta debugpos,x
cmp zp_tmp
beq sid_l2
ldy #1
sid_l2:
lda $d012
cmp $d012
beq *-3
inx
cpx #debuglines*40
bne sid_l1
cpy #1
beq sid_l3
dec flag
bne sid_l5
lda #lo(sid_emu)
ldy #hi(sid_emu)
bne sid_l4
sid_l3:
lda #lo(sid_c64)
ldy #hi(sid_c64)
sid_l4:
jsr write_stat
sid_l6
jsr $ffe4
cmp #' '
bne sid_l6
jmp getkey
no_sid:
cmp #choice
choice set choice+1
bne no_mkeys
ldx #statusline+2
ldy #0
clc
jsr $fff0
lda #lo(keys_start)
ldy #hi(keys_start)
jsr print
sei
mkeys_check:
ldx #0
ldy #$7f
lda #$10
jsr mkey_sub
cpx #1
bne mkey_l2
cli
jmp getkey
mkey_l2:
ldy #$f7
lda #$04
jsr mkey_sub
ldy #$ef
lda #$40
jsr mkey_sub
ldy #$fb
lda #$08
jsr mkey_sub
ldy #$fd
lda #$08
jsr mkey_sub
cpx #4
bne mkeys_check
lda #lo(keys_c64)
ldy #hi(keys_c64)
jsr write_stat
jmp mkeys_check
mkey_sub:
sty $dc00
and $dc01
bne mkey_l1
inx
mkey_l1:
rts
no_mkeys:
cmp #choice
choice set choice+1
bne no_scrn1c
lda #lo(scrn1c_int)
ldy #hi(scrn1c_int)
jsr write_stat
sei
scrn1c_l2:
lda #$fb-debuglines*8-1
cmp $d012
bne *-3
lda #$76
sta $d018
lda $d012
bne *-3
lda #$16
sta $d018
ldx #$ff
ldy #$7f
lda #$10
jsr mkey_sub
bne scrn1c_l2
cli
jmp getkey
no_scrn1c:
cmp #choice
choice set choice+1
bne no_emuchk
ldx #$55
cpx $dfff
beq emu_l1
cpx $dfff
bne emu_l2
emu_l1:
ldy #$aa
cpy $dfff
bne emu_l2
cpx $dfff
bne emu_l2
cpy $dfff
bne emu_l2
lda $dffe
ora #$20
sta emu_type
lda #lo(emu_fnd)
ldy #hi(emu_fnd)
jsr write_stat
lda $dffd
ldx #0
jsr hexout
lda $dffc
ldx #3
jsr hexout
lda #15
sta $0286
lda #$a0
ldy #$df
jsr print
emu_l3:
jsr $ffe4
cmp #' '
bne emu_l3
no_quit:
jmp getkey
emu_l2:
lda #lo(emu_nfnd)
ldy #hi(emu_nfnd)
jsr write_stat
jmp emu_l3
no_emuchk:
cmp #'q'
bne no_quit
lda #lo(end_str)
ldy #hi(end_str)
jmp print
write_stat:
sta ws_mod+1
sty ws_mod+2
clc
ldx #statusline
ldy #0
jsr $fff0
lda #7
sta $0286
bne ws_mod
print:
sta ws_mod+1
sty ws_mod+2
ldy #0
ws_mod: lda screen,y
beq ws_l1
jsr $ffd2
iny
bne ws_mod
inc ws_mod+2
bne ws_mod
ws_l1:
rts
hexout:
pha
lsr
lsr
lsr
lsr
jsr hexout2
pla
and #$0f
hexout2:
clc
adc #$30
cmp #$3a
bcc hexout_l1
sbc #$39
hexout_l1:
sta debugpos-80+emu_vers-emu_fnd,x
inx
rts
screen:
byt $0e
binclude "help\emucheck.scr",2
cascii
d800_c64: byt "$d800 changes. it's c64 alike.",0
d800_emu: byt "$d800 is constant. it's an emulator.",0
sid_c64: byt "$d400 changes. it's c64 alike.",0
sid_emu: byt "$d400 is constant. it's an emulator.",0
keys_start: byt $9b,"please press the keys "
byt "'",$05,"g",$9b,"'+"
byt "'",$05,"o",$9b,"'+"
byt "'",$05,"6",$9b,"'+"
byt "'",$05,"4",$9b,"'",$0d
byt "simultaneously. a message will appear",$0d
byt "if succeeded.",0
keys_c64: byt "keys pressed. it's c64 alike.",0
scrn1c_int: byt "normally, you should see junk below.",0
scrn1c_txt: byt "but if you can read this, then it's",$0d
byt "an emulator (with a nasty bug).",0
emu_fnd: byt "emulator found: type '"
emu_type byt " ', version "
emu_vers byt "00.00",$0d,$0d,0
emu_nfnd: byt "recognition unsuccessful!",0
end_str: byt $9e,$93,$8e,0
end $0801