Testovanie a identifikacia pocitaca

Zdrojový kód


4      5b00            *s
5      5b00             
6      5b00             
7      5b00            l      =    k-run               <- dlzka kodu
8      5b00             
9      5b00                   org  #81f0
10     81f0            sp                              Vysledky testu:
11     81f0            typ    ds   #01                 0=?, 1=48/Gama, 2=128/+2, 3=+2A/+3, 4=M
12     81f1            mem    ds   #01                 0=48k , FF=128k memory
13     81f2            ay     ds   #01                 0=no AY , FF=AY pripojeny
14     81f3             
15     81f3                   org  #8200
16     8200            p
17     8200 f3         run    di
18     8201 ed73c082          ld   (oldsp+1),sp
19     8205 31f081            ld   sp,sp
20     8208 210080            ld   hl,#8000            Test hodin
21     820b 110180            ld   de,#8001            [rutinka z dema OVERSCAN]
22     820e 011001            ld   bc,#0110            [akurat je doplnene eMko]
23     8211 3681              ld   (hl),#81
24     8213 edb0              ldir
25     8215 3ec3              ld   a,#c3
26     8217 328181            ld   (#8181),a
27     821a 213382            ld   hl,rut1
28     821d 11cc5b            ld   de,#5bcc
29     8220 0e07              ld   c,rut2-rut1
30     8222 ed538281          ld   (#8182),de
31     8226 edb0              ldir
32     8228 213a82            ld   hl,rut2
33     822b 3e80              ld   a,#80
34     822d ed47              ld   i,a
35     822f ed5e              im2
36     8231 fb                ei
37     8232 76                hlt
38     8233 228281     rut1   ld   (#8182),hl
39     8236 fb                ei                       bc=4016 (M!) ..... #04
40     8237 03                inc  bc                  bc=3616 (2A) ..... #03
41     8238 18fd              jr   -3                  bc=3185 (+2) ..... #02
42     823a ed56       rut2   im1                      bc=3123 (48) ..... #01
43     823c 31f081            ld   sp,sp               nekompatibilny ... #00
44     823f 112b0c            ld   de,3123-8
45     8242 cdc382            call comp                <- vyhodnotenie
46     8245 3840              jr   c,nekom
47     8247 2601              ld   h,#01
48     8249 113b0c            ld   de,3123+8
49     824c cdc382            call comp
50     824f 3838              jr   c,ano
51     8251 11690c            ld   de,3185-8
52     8254 cdc382            call comp
53     8257 382e              jr   c,nekom
54     8259 2602              ld   h,#02
55     825b 11790c            ld   de,3185+8
56     825e cdc382            call comp
57     8261 3826              jr   c,ano
58     8263 11180e            ld   de,3616-8
59     8266 cdc382            call comp
60     8269 381c              jr   c,nekom
61     826b 2603              ld   h,#03
62     826d 11280e            ld   de,3616+8
63     8270 cdc382            call comp
64     8273 3814              jr   c,ano
65     8275 11a80f            ld   de,4016-8
66     8278 cdc382            call comp
67     827b 380a              jr   c,nekom
68     827d 2604              ld   h,#04
69     827f 11b80f            ld   de,4016+8
70     8282 cdc382            call comp
71     8285 3802              jr   c,ano
72     8287 2600       nekom  ld   h,#00
73     8289 7c         ano    ld   a,h
74     828a 32f081            ld   (typ),a
75     828d             
76     828d 01fd7f            ld   bc,#7ffd            test prepinania ramiek
77     8290 21ffff            ld   hl,#ffff
78     8293 111011            ld   de,#1110
79     8296 ed59              out  (c),e
80     8298 7e                ld   a,(hl)
81     8299 75                ld   (hl),l
82     829a ed51              out  (c),d
83     829c 72                ld   (hl),d
84     829d ed59              out  (c),e
85     829f 34                inc  (hl)
86     82a0 77                ld   (hl),a
87     82a1 2801              jr   z,#01
88     82a3 24                inc  h
89     82a4 7c                ld   a,h
90     82a5 32f181            ld   (mem),a
91     82a8             
92     82a8 01fdff            ld   bc,#fffd            Test AY
93     82ab 3e01              ld   a,#01
94     82ad ed79              out  (c),a
95     82af 06bf              ld   b,#bf
96     82b1 ed49              out  (c),c
97     82b3 06ff              ld   b,#ff
98     82b5 ed78              in   a,(c)
99     82b7 ee0d              xor  #0d
100    82b9 fe01              cp   #01
101    82bb 9f                sbc  a,a
102    82bc 32f281            ld   (ay),a
103    82bf             
104    82bf 315555     oldsp  ld   sp,#5555
105    82c2 c9                ret
106    82c3             
107    82c3 78         comp   ld   a,b                 cp bc,de
108    82c4 ba                cp   d
109    82c5 c0                ret  nz
110    82c6 79                ld   a,c
111    82c7 bb                cp   e
112    82c8 c9                ret
113    82c9            k

 ano    8289  *  ay     81f2  *  comp   82c3  *  k      82c9  *
 l      00c9  *  mem    81f1  *  nekom  8287  *  oldsp  82bf  *
 p      8200  *  run    8200  *  rut1   8233  *  rut2   823a  *
 sp     81f0  *  typ    81f0  *                                

Bytes:201  labels:14  errors:0   


Popis
Tento program vam na zisti, na akom pocitaci pracuje, kolko pameti ma dany pocitac (48k alebo 128k) a ci je vybaveny zvukovym procesorom AY-3-891X. Vie rozoznat tieto pocitace:
1.Spektrum 48k alebo Didaktik GAMA
2.Spektrum 128k alebo +2
3.Spektrum +2A alebo +3
4.Didaktik M alebo Kompakt
Ak testovany pocitac nie je ani jeden z nich, vrati 0.

Poznámky
Vhodne pouzitie je do dema ktore si tym padom dokaze samo zistit ake casovanie ma dany pocitac a podla toho nastavit konstanty do multicoloru. Dalsie vhodne pouzitie je test presnosti casovania emulatorov.

Poslal
Busy