2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
5 Desc: Graphics function SetChipRev()
8 #include <aros/debug.h>
9 #include <graphics/gfxbase.h>
10 #include <hardware/custom.h>
12 #include <proto/graphics.h>
14 /* See rom/graphics/setchiprev.c for documentation */
16 AROS_LH1(ULONG
, SetChipRev
,
17 AROS_LHA(ULONG
, ChipRev
, D0
),
18 struct GfxBase
*, GfxBase
, 148, Graphics
)
22 volatile struct Custom
*custom
= (struct Custom
*)0xdff000;
23 UWORD vposr
, deniseid1
, deniseid2
, deniseid3
;
26 vposr
= custom
->vposr
& 0x7f00;
28 chipflags
|= GFXF_HR_AGNUS
;
29 if (vposr
>= 0x2200) {
30 chipflags
|= GFXF_AA_ALICE
| GFXF_AA_LISA
| GFXF_HR_DENISE
;
33 deniseid1
= custom
->deniseid
& 0x00ff;
34 custom
->deniseid
= custom
->dmaconr
;
35 deniseid2
= custom
->deniseid
& 0x00ff;
36 custom
->deniseid
= custom
->dmaconr
^ 0x8000;
37 deniseid3
= custom
->deniseid
& 0x00ff;
39 if (deniseid1
== deniseid2
&& deniseid2
== deniseid3
&& deniseid1
== 0xfc)
40 chipflags
|= GFXF_HR_DENISE
;
43 if (ChipRev
!= SETCHIPREV_BEST
) {
44 if (ChipRev
== SETCHIPREV_A
&& chipflags
>= SETCHIPREV_A
)
45 chipflags
= SETCHIPREV_A
;
46 else if (ChipRev
== SETCHIPREV_ECS
&& chipflags
>= SETCHIPREV_ECS
)
47 chipflags
= SETCHIPREV_ECS
;
48 else if (ChipRev
== SETCHIPREV_AA
&& chipflags
>= SETCHIPREV_AA
)
49 chipflags
= SETCHIPREV_AA
;
51 GfxBase
->ChipRevBits0
= chipflags
;
53 return GfxBase
->ChipRevBits0
;