Get Amiga Config [680x0 ASM]
Posted: Fri Sep 15, 2006 12:23 am
I found some old stuff from our group for the 680x0 amiga... Dont know if following stuff will directly work with PB amiga... maybe you have to modify... otherwise the routine should work like a dream
Code: Select all
*******************************************
*** Get Amiga Config ***
*******************************************
; determines output in
; - ChipSet OCS/ECS/AGA d0
; - Kickstart version/VideoFreq d1
; - CPU version (z.b. "$68000") d2
; - FPU version (e.g. "$68882") d3
; - Free ram (Chip) d4
; - Free ram (Fast) d5
; - Max ram (Chip) d6
; - Max ram (Fast) d7
; kills: d0-d7/a6
GetConfig:
move.l a6,-(a7)
move.l $4.w,a6 ; get execbase
move.l #$20002,d1 ; largest Chip
jsr -216(a6) ; AvailMem()
lsr.l #8,d0 ; /1024
lsr.l #2,d0
move.l d0,d4
move.l #$20004,d1 ; largest Fast
jsr -216(a6) ; AvailMem()
lsr.l #8,d0 ; /1024
lsr.l #2,d0
move.l d0,d5
move.l 62(a6),d0 ; Max Chip
lsr.l #8,d0 ; / 1024
lsr.l #2,d0
move.l d0,d6
moveq #4,d1 ; Max Fast
bset #19,d1
jsr -216(a6) ; AvailMem()
lsr.l #8,d0 ; / 1024
lsr.l #2,d0
move.l d0,d7
bsr GetGFX
move.l $4.w,a6 ; get execbase
moveq #0,d1
move.w $14(a6),d1 ; KS version (1.3 = version 34)
swap d1
move.b 530(a6),d1 ; VBlank Frequency
move.l $4.w,a6 ; get execbase
moveq #0,d2
move.b $129(a6),d2
bsr GetFPU
bsr.b GetCPU
move.l (a7)+,a6
rts
GetCPU btst #7,d2
bne.b .68060
btst #3,d2
bne.s .68040
btst #2,d2
bne.s .68030
btst #1,d2
bne.s .68020
btst #0,d2
bne.s .68010
.68000 move.l #$68000,d2
rts
.68010 move.l #$68010,d2
rts
.68020 move.l #$68020,d2
rts
.68030 move.l #$68030,d2
rts
.68040 move.l #$68040,d2
rts
.68060 move.l #$68060,d2
rts
GetFPU moveq #0,d3
btst #7,d2
bne.b .68060i
btst #6,d2
bne.b .68040i
btst #5,d2
bne.b .68882
btst #4,d2
bne.b .68881
rts
.68881 move.l #$68881,d3
rts
.68882 move.l #$68882,d3
rts
.68040i move.l #$68040,d3
rts
.68060i move.l #$68060,d3
rts
GetGFX moveq #0,d1
move.b $dff07d,d1
cmp.b #$f8,d1
beq.b .AGA
cmp.b #$fc,d1
beq.b .ECS
moveq #0,d0
rts
.AGA moveq #2,d0
rts
.ECS moveq #1,d0
rts