English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 24 January 2014, 14:15   #1
Steve
I Identify as an Ewok
 
Steve's Avatar
 
Join Date: Jul 2001
Location: North Lincolnshire
Age: 45
Posts: 2,356
Best way of detecting the AGA chipset?

Hi. I am wondering what is the best way to detect the AGA chipset? In the howtocode page it gives this listing to detect the AGA chipset. Are there other (better) ways?

Code:
GFXB_AA_ALICE   equ 2
gb_ChipRevBits0 equ $ec

; Call with a6 containing GfxBase from opened graphics.library

   btst  #GFXB_AA_ALICE,gb_ChipRevBits0(a6)
   bne.s is_aa
Steve is offline  
Old 24 January 2014, 14:28   #2
Steve
I Identify as an Ewok
 
Steve's Avatar
 
Join Date: Jul 2001
Location: North Lincolnshire
Age: 45
Posts: 2,356
Found some more code.

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

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

...
...

ISAGA: dc.b 0

Last edited by Steve; 24 January 2014 at 16:09.
Steve is offline  
Old 24 January 2014, 14:41   #3
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
Theres generally a combination of tests people do, because sometimes one check in itself won't be enough.

1). Check for 2meg of chip ram, basic configuration for AGA, but obviously doesn't stop others having it.
2). Check Kickstart version
3). Check Graphics library version
4). Check processor type

Thats what I did back in the day, but obviously, later on, people started using a lot of this stuff on other Amigas, and that buggered that all up.
Galahad/FLT is offline  
Old 24 January 2014, 15:01   #4
hitchhikr
Registered User
 
Join Date: Jun 2008
Location: somewhere else
Posts: 511
Code:
isAGA:
                 move.w $dff07c,d0
	         moveq #31-1,d2
	         and.w #$ff,d0
check_loop:      move.w $dff07C,d1
                 and.w #$ff,d1
	         cmp.b d0,d1
            	 bne.b not_AGA
            	 dbf d2,check_loop
            	 or.b #$f0,d0
            	 cmp.b #$f8,d0
            	 bne.b not_AGA
                 moveq #1,d0
                 rts
not_AGA:         moveq #0,d0
                 rts
hitchhikr is offline  
Old 24 January 2014, 15:11   #5
Steve
I Identify as an Ewok
 
Steve's Avatar
 
Join Date: Jul 2001
Location: North Lincolnshire
Age: 45
Posts: 2,356
I think this is the code I used when I first started playing with assembler a few years ago. Its taken from the HowToCode2 guide on back2roots ftp. I remember it worked fine when I tested it on my A1200 so what is the difference between this one and the one just posted by hitchhikr? Some comments would have been nice as I'm just learning asm again from where I left off years ago.

Code:
This code will check for AGA

        move.w	$dff07c,d0
	cmp.b	#$f8,d0
	bne.s	.notaga

	; Do your funky AGA Stuff in here!

.notaga
I understand that the above code is checking for the Amiga 1200/4000 Lisa chipset by comparing the returned value. If the returned value is $FC (11111100) then the chipset is ECS otherwise if it returns $F8 (11111000) then the chipset is AGA. Is this is the best way of detecting AGA? I don't understand why hitchhkrs code is so complicated. Is it just being more thorough?
Attached Thumbnails
Click image for larger version

Name:	LisaID.PNG
Views:	348
Size:	36.3 KB
ID:	38734  

Last edited by Steve; 24 January 2014 at 15:41.
Steve is offline  
Old 24 January 2014, 15:38   #6
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
VPOSR (DFF004) AGA check is easiest and 100% reliable test. No extra tests needed like DENISEID/LISAID requires (because it does not exist in OCS Denise).

btw, upper byte of LISAID can be used to detect between A1200 and A4000, it is zero on A1200, non-zero on A4000. (But first check AGA using VPOSR)
Toni Wilen is offline  
Old 24 January 2014, 16:58   #7
hitchhikr
Registered User
 
Join Date: Jun 2008
Location: somewhere else
Posts: 511
$dff07c doesn't exist on preAGA architectures so it's supposed to return "bus noise", the routine checks it several times to be sure that it's really an AGA machine ($f8) and not just a random value.
hitchhikr is offline  
Old 24 January 2014, 20:18   #8
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
$7c (DENISEID/LISAID) was introduced with ECS Denise. But VPOSR is still the best choice, no need for multiple tests
Toni Wilen is offline  
Old 24 January 2014, 20:55   #9
pandy71
Registered User
 
Join Date: Jun 2010
Location: PL?
Posts: 2,747
Quote:
Originally Posted by Toni Wilen View Post
$7c (DENISEID/LISAID) was introduced with ECS Denise. But VPOSR is still the best choice, no need for multiple tests
But seem to be inconclusive...

http://amiga-dev.wikidot.com/hardware:vposr
  • 8372 (Fat-hr) (agnushr),rev 5 = 22 PAL
  • 8374 (Alice) thru rev 2 = 22 PAL
pandy71 is offline  
Old 24 January 2014, 21:06   #10
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
Quote:
Originally Posted by pandy71 View Post
But seem to be inconclusive...

http://amiga-dev.wikidot.com/hardware:vposr
  • 8372 (Fat-hr) (agnushr),rev 5 = 22 PAL
  • 8374 (Alice) thru rev 2 = 22 PAL
I am quite sure it is documentation bug and it should say 21 Pal. (22 does not match NTSC model which is 31)

AmigaOS detects AGA by checking if bit 9 of VPOSR is set.
Toni Wilen is offline  
Old 25 January 2014, 20:42   #11
Steve
I Identify as an Ewok
 
Steve's Avatar
 
Join Date: Jul 2001
Location: North Lincolnshire
Age: 45
Posts: 2,356
Quote:
Originally Posted by Steve View Post
Found some more code.

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

Code:
beq.b .aga
.aga: seq.b ISAGA

ISAGA: dc.b 0
Thanks for all the input. I will have a play with the VPOSR test. I am curious about this bit of code though. I have looked through the 68k instruction set but can't find a seq.b instruction anywhere. Is this a typo?
Steve is offline  
Old 25 January 2014, 20:43   #12
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
Just checked by R-Type 2 AGA fix from back in the day, and I used the same method as Hitchhiker back then.... i'd forgotten!
Galahad/FLT is offline  
Old 25 January 2014, 20:50   #13
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,506
Quote:
Originally Posted by Steve View Post
Thanks for all the input. I will have a play with the VPOSR test. I am curious about this bit of code though. I have looked through the 68k instruction set but can't find a seq.b instruction anywhere. Is this a typo?
It is most likely called Scc in documentation. cc = any condition code.
Toni Wilen is offline  
Old 25 January 2014, 22:08   #14
Steve
I Identify as an Ewok
 
Steve's Avatar
 
Join Date: Jul 2001
Location: North Lincolnshire
Age: 45
Posts: 2,356
Quote:
Originally Posted by Toni Wilen View Post
It is most likely called Scc in documentation. cc = any condition code.
Yes you are right. Thanks again.
Steve is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Detecting ACA6x0 at startup jimbob support.Hardware 18 08 January 2013 22:25
Help on detecting Amiga model from within a script gulliver support.Other 5 11 October 2011 18:56
EHB sprites with AGA chipset ? FrenchShark Coders. General 4 17 September 2009 06:37
GameBase not detecting WinUAE (or any emulators at all) yoshimitsuhiro project.MAGE 1 15 March 2009 21:38
Does "Cycle-exact" do nothing with the AGA chipset? fmcpma support.WinUAE 10 26 October 2006 13:11

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 09:35.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08509 seconds with 16 queries