Il thread
Modifica C64 e una vecchia discussione
Versione Commodore 64, metodo per verificarla mi hanno invogliato a cercare maggiori info per fare un programma/funzione per determinare quale modello, revisione e modifica del Kernal abbiamo montato. Stavo facendo gia' il programmino quando semplicemente googlando per cercare Kernal ROMs che gia' non avessi, mi sono imbattuto in un
codice in ungherese, che ho adattato alle mie esigenze, ampliando il numero di ROMs identificate; Gia' che c'ero ne ho fatto anche una versione in CRT per poter provare anche se funzionava il detect del C64GS, che accetta appunto solo cartucce. Il tutto e' stato testato solo in CCS e VICE, ma mi aspetto che funzioni regolarmente anche sui C64 veri.
;---------------------------------------
;C=64 KERNAL ROM Detector
;---------------------------------------
;based on http://c64.rulez.org/hardware/
; hardwaredetection/romdetect/kernal/
; kernaldetect.txt
;---------------------------------------
;enhanced by iAN CooG/HF
;---------------------------------------
Vunknown = 0
Vc4064ty = 1
Vr1 = 2
Vr2eng = 3
Vr2sve = 4
Vr3eng = 5
Vr3sve = 6
Vsx64eng = 7
Vsx64sve = 8
Vgs = 9
Vc65_90 = 10
Vc65_91 = 11
Vcock = 12
Vprolog = 13
Vttran = 14
Vtproc = 15
Vtdrive = 16
Vddos = 17
Vdmag = 18
Vjiffy = 19
Vexos = 20
Vbeast = 21
Vde64erv = 22
Vsdos = 23
Vsdos40t = 24
Vmicro = 25
Vhbasic = 26;add:iAN
Vdigi = 27;add:iAN
Vdelta = 28;add:iAN
Varmag = 29;add:iAN, cockroach mod
Vsdosp = 30;add:iAN, speeddos plus
Vpiffy = 31;add:iAN, jiffydos mod
Vtaxs = 32;add:iAN
;---------------------------------------
* = $0801
word eop
word 7102
byte $9e,"2061",0
eop word 0
;---------------------------------------
jsr identify
;return:
;X=0 unknown,
;X>0 ROM type
lda strtablelow,x
ldy strtable_hi,x
jmp $ab1e
;---------------------------------------
identify
ldx #Vunknown
lda $ff80
;cmp #$00
beq r2typ
t1 cmp #$03
beq r3typ
t2 cmp #$04
bne t3
jmp c65typ
t3 cmp #$43
bne t4
jmp sx64r
t4 cmp #$53
bne t5c
jmp sdostyp
t5c cmp #$c3
beq cockarmag
cmp #$64
bne t6
ldx #Vc4064ty
t6 cmp #$aa
bne t744
ldx #Vr1
t744 cmp #$44
bne t7
ldx #Vdigi
t7 rts
;---------------------------------------
cockarmag
lda $f20d
cmp #$3a
bne cr1
ldx #Vcock
cr1 cmp #$e7
bne cr2
ldx #Varmag
cr2 rts
;---------------------------------------
r2typ
lda $fa26
cmp #$65
beq r2
cmp #$18
bne t8
ldx #Vprolog
t8 cmp #$97
bne t9
ldx #Vttran
t9 cmp #$fa
bne t10tx
ldx #Vtproc
t10tx cmp #$8d
bne t10
ldx #Vtaxs
t10 cmp #$c4
bne t11
ldx #Vhbasic
t11 rts
;---------------------------------------
r2 lda $ebf0
cmp #$ba
bne t12
ldx #Vr2eng
t12 cmp #$dd
bne t13
ldx #Vr2sve
t13 rts
;---------------------------------------
r3typ lda $fc00
cmp #$01
beq r3
t14 cmp #$20
beq exbea
cmp #$a3
beq jifpif
t15 cmp #$43
bne t16
ldx #Vgs
t16 cmp #$91
bne t17
ldx #Vtdrive
t17 cmp #$a2
bne t19
ldx #Vddos
t19 cmp #$dd
bne t20d
ldx #Vdmag
t20d cmp #$f8
bne t20
ldx #Vdelta
t20 rts
;---------------------------------------
jifpif
lda $e4ee
cmp #$44
bne j2
ldx #Vjiffy
j2 cmp #$52
bne j3
ldx #Vpiffy
j3 rts
;---------------------------------------
r3 lda $ebf0
cmp #$ba
bne t21
ldx #Vr3eng
t21 cmp #$dd
bne t22
ldx #Vr3sve
t22 rts
;---------------------------------------
exbea lda $e000
cmp #$85
bne t23
ldx #Vexos
t23 cmp #$2c
bne t24
ldx #Vbeast
t24 rts
;---------------------------------------
c65typ lda $f888
cmp #$30
bne t25
ldx #Vc65_90
t25 cmp #$31
bne t26
ldx #Vc65_91
t26 rts
;---------------------------------------
sx64r lda $fa26
cmp #$65
beq sx64typ
t27 cmp #$a0
bne t28
ldx #Vde64erv
t28 rts
;---------------------------------------
sx64typ lda $ebf0
cmp #$ba
bne t29
ldx #Vsx64eng
t29 cmp #$dd
bne t30
ldx #Vsx64sve
t30 rts
;---------------------------------------
sdostyp lda $e479
cmp #$20
bne t31p
ldx #Vsdos
t31p cmp #$2a
bne t31
ldx #Vsdosp
t31 cmp #$43
bne t32
ldx #Vsdos40t
t32 cmp #$4b
bne t33
ldx #Vmicro
t33 rts
;---------------------------------------
_unknown text "unknown" ,0
_c4064ty text "4064/educator" ,0
_r1 text "c64 rev1" ,0
_r2eng text "c64 rev2" ,0
_r2sve text "c64 rev2 sweden" ,0
_r3eng text "c64 rev3" ,0
_r3sve text "c64 rev3 sweden" ,0
_sx64eng text "sx64" ,0
_sx64sve text "sx64 sweden" ,0
_gs text "c64 games system" ,0
_c65_90 text "c65 1990" ,0
_c65_91 text "c65 1991" ,0
_cock text "cockroach" ,0
_prolog text "prologic dos" ,0
_ttran text "turbo trans" ,0
_tproc text "turbo process" ,0
_taxs text "turbo access" ,0
_tdrive text "turbo drive" ,0
_ddos text "dolphindos 2" ,0
_dmag text "dolphinmager" ,0
_jiffy text "jiffydos 6.01" ,0
_piffy text "piffydos" ,0
_exos text "exos v3" ,0
_beast text "beast system" ,0
_de64erv text "64'er v3" ,0
_sdos text "speeddos" ,0
_sdosp text "speeddos plus" ,0
_sdos40t text "speeddos 40tracks" ,0
_micro text "microtronic prof.dos",0
_hbasic text "dos-hypra-cent" ,0
_digi text "digidos" ,0
_delta text "delta electronics" ,0
_armag text "armageddon" ,0
;---------------------------------------
strtablelow
byte <_unknown
byte <_c4064ty
byte <_r1
byte <_r2eng
byte <_r2sve
byte <_r3eng
byte <_r3sve
byte <_sx64eng
byte <_sx64sve
byte <_gs
byte <_c65_90
byte <_c65_91
byte <_cock
byte <_prolog
byte <_ttran
byte <_tproc
byte <_tdrive
byte <_ddos
byte <_dmag
byte <_jiffy
byte <_exos
byte <_beast
byte <_de64erv
byte <_sdos
byte <_sdos40t
byte <_micro
byte <_hbasic
byte <_digi
byte <_delta
byte <_armag
byte <_sdosp
byte <_piffy
byte <_taxs
strtable_hi
byte >_unknown
byte >_c4064ty
byte >_r1
byte >_r2eng
byte >_r2sve
byte >_r3eng
byte >_r3sve
byte >_sx64eng
byte >_sx64sve
byte >_gs
byte >_c65_90
byte >_c65_91
byte >_cock
byte >_prolog
byte >_ttran
byte >_tproc
byte >_tdrive
byte >_ddos
byte >_dmag
byte >_jiffy
byte >_exos
byte >_beast
byte >_de64erv
byte >_sdos
byte >_sdos40t
byte >_micro
byte >_hbasic
byte >_digi
byte >_delta
byte >_armag
byte >_sdosp
byte >_piffy
byte >_taxs
;---------------------------------------
;eof
Sorgenti, prg e crt li hosto sul mio sito
http://iancoog.altervista.org/hid/kernaldetect.rar