100 rem ********* where am i? ********* 110 rem ------------------------------- 120 rem this is the recommended method 130 rem how to detect a c64 emulator, 140 rem e.g. for disabling fast loaders 150 rem 160 rem - the byte at $dfff changes 170 rem between $55 and $aa 180 rem - the byte at $dffe contains 190 rem the manufacturer code letter: 200 rem a = c64alive 210 rem f = frodo 220 rem p = personal c64 230 rem s = c64 software emulator 240 rem v = vice 250 rem / = power64 260 rem - the word at $dffc contains 270 rem the emulator version number, 280 rem e.g. $0120 for version 1.2 290 rem - the bytes from $dfa0 contain 300 rem a copyright string with 310 rem emulator name and version, 320 rem $0d, copyright and $00. 330 rem ------------------------------- 340 : 500 print 510 x=57343: rem $dfff 520 if peek(x)<>85 then if peek(x)<>85 then 1000 530 if peek(x)<>170 then 1000 540 if peek(x)<>85 then 1000 550 if peek(x)<>170 then 1000 560 m$=chr$(peek(57342)): rem $dffe 570 print "manufacturer = '"; m$; "' "; 580 if m$="a" then print "(c64alive)"; 590 if m$="f" then print "(frodo)"; 600 if m$="p" then print "(pc64)"; 610 if m$="s" then print "(c64s)"; 620 if m$="v" then print "(vice)"; 630 if m$="/" then print "(power64)"; 640 print 650 : 700 v=peek(57341)*256 + peek(57340): rem $dffd/$dffc 710 h$="0123456789abcdef" 720 for i=0 to 3 730 v$=mid$(h$,1+(v and 15),1)+v$ 740 v=int(v/16) 750 next 760 print "version = $";v$ 770 print 780 : 800 i=57248: rem $dfa0 810 x=peek(i) 820 if x=0 then print: end 830 print chr$(x); 840 i=i+1 850 goto 810 860 : 900 rem ------------------------------- 910 rem these are manufacturer-specific 920 rem workarounds, which should be 930 rem replaced with the official 940 rem emulator detection method 950 : 1000 if peek(60682)<>0 then 1100: rem $ed0a 1010 print "c64 software emulator" 1020 print "(c)1991-94 miha peternel" 1030 end 1040 : 1100 if peek(60736)<>0 then 1200: rem $ed40 1110 print "x64 (version 0.2.0 or 0.3.0)" 1120 print "(c)1993-94 j.sonninen/t.rantanen/j.valta" 1130 end 1140 : 1200 x=57087: rem $deff 1210 if peek(x)+peek(x)+peek(x)<>0 then 2000 1220 print "c64alive" 1230 print "(c)1993-94 f.littmann developments" 1240 end 1250 : 2000 print "this is an original c64 or c128"