Welcome, Guest. Please login or register.

Author Topic: How to detect CPU?  (Read 3305 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline x303

Re: How to detect CPU?
« Reply #14 from previous page: July 26, 2009, 03:06:53 AM »
Quote from: JosephC;516852
How does one detect if running on ECS or AGA?

    Taken from RandyAGA.doc:

          LEA     $DFF000,A5
           MOVE.W  $7C(A5),D0      ; DeniseID or LisaID in AGA
           MOVEQ   #30,D2          ; Check 30 times ( prevents old denise random)
           ANDI.W  #%000000011111111,d0    ; low byte only
DENLOOP:
           MOVE.W  $7C(A5),D1      ; Denise ID (LisaID on AGA)
           ANDI.W  #%000000011111111,d1    ; low byte only
           CMP.B   d0,d1           ; same value?
           BNE.S   NOTAGA          ; Not the same value, then OCS Denise!
           DBRA    D2,DENLOOP      ; (THANX TO DDT/HBT FOR MULTICHECK HINT)
           ORI.B   #%11110000,D0   ; MASK AGA REVISION (will work on new aga)
           CMPI.B  #%11111000,D0   ; BIT 3=AGA (this bit will be=0 in AAA!)
           BNE.S   NOTAGA          ; IS THE AGA CHIPSET PRESENT?
           ST.B    AGA             ; Set the AGA flag that will be tested later
NOTAGA:                         ; NOT AGA, BUT IS POSSIBLE AN AAA MACHINE!!

You can find it here: http://aminet.net/docs/misc/RandyAGA.lha

x303 :D :D :D
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: How to detect CPU?
« Reply #15 on: July 26, 2009, 11:16:13 AM »
Quote from: x303;516874
Taken from RandyAGA.doc:

          LEA     $DFF000,A5
           MOVE.W  $7C(A5),D0      ; DeniseID or LisaID in AGA
           MOVEQ   #30,D2          ; Check 30 times ( prevents old denise random)
           ANDI.W  #%000000011111111,d0    ; low byte only
DENLOOP:
           MOVE.W  $7C(A5),D1      ; Denise ID (LisaID on AGA)
           ANDI.W  #%000000011111111,d1    ; low byte only
           CMP.B   d0,d1           ; same value?
           BNE.S   NOTAGA          ; Not the same value, then OCS Denise!
           DBRA    D2,DENLOOP      ; (THANX TO DDT/HBT FOR MULTICHECK HINT)
           ORI.B   #%11110000,D0   ; MASK AGA REVISION (will work on new aga)
           CMPI.B  #%11111000,D0   ; BIT 3=AGA (this bit will be=0 in AAA!)
           BNE.S   NOTAGA          ; IS THE AGA CHIPSET PRESENT?
           ST.B    AGA             ; Set the AGA flag that will be tested later
NOTAGA:                         ; NOT AGA, BUT IS POSSIBLE AN AAA MACHINE!!

You can find it here: http://aminet.net/docs/misc/RandyAGA.lha


That's a bit unreliable, it's better to check Agnus/Alice version.

Code: [Select]

        move.w  $DFF004,d0
        and.w   #$6F00,d0
        cmp.w   #$2200,d0
        beq.b  .aga
        cmp.w   #$2300,d0
 .aga:  seq.b   ISAGA

        ...
        ...

ISAGA:  dc.b    0