Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show all replies
Re: How to detect CPU?
« on: July 24, 2009, 12:05:57 AM »
You can still use AttnFlags, but you might have to #define the value:

#ifndef AFB_68060
#define AFB_68060 7
#endif

#ifndef AFF_68060
#define AFF_68060 (1<#endif

I believe this only works if the 68060.library is installed. As for speed, timing a known-cycle (per CPU type) loop seems to be a way to do it, but you'll need to ensure the instruction cache (if present) is enabled.

Piru would be the man to ask as his WhichAmiga tool detects the entire gamut of m68k amiga configurations.
« Last Edit: July 24, 2009, 12:08:56 AM by Karlos »
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show all replies
Re: How to detect CPU?
« Reply #1 on: July 24, 2009, 08:22:26 PM »
Quote from: terminator4;516744
Lets not exaggerate, not entire gamut.  Works fine on my Amiga 4000 060 but not with A2000 060.   In that respect it was quite disappointing for me.


What I meant was it clearly has code that can differentiate 060 from every other m68k that has been used in an Amiga, which means that Piru obviously knows a suitable method.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16882
  • Country: gb
  • Thanked: 6 times
    • Show all replies
Re: How to detect CPU?
« Reply #2 on: July 24, 2009, 10:44:55 PM »
If you need to differentiate between EC and non-EC versions, AttnFlags is no longer sufficient.

Incidentally, AFB_68060/AFF_68060 didn't seem to be #defined in any of my NDK versions.
int p; // A