English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. Tutorials (http://eab.abime.net/forumdisplay.php?f=73)
-   -   68k & 060 friendly code... (http://eab.abime.net/showthread.php?t=57252)

korruptor 15 January 2011 20:02

68k & 060 friendly code...
 
Hiya,

I've just got an 060 into my 1200, so I've hit the point where my dodgy old 500 code doesn't display properly. I'm pretty sure this is because of my interrupt setup being wrong for the higher processor.

Am I right in thinking that I need to get the VBR if I'm on a higher processor?

If so, how do I detect the CPU in asm to make the decision?

I'd like to dev on the 1200 (so run it and test it) but actually target the A500 for the stuff I'm making.

Thanks!

pmc 15 January 2011 21:16

Hey korruptor :)

Yeah, you need to get the VBR.

This code will do it, just bsr to it in your startup before you need to set up your interrupt:

Code:

execbase        equ        $4
supervisor        equ        -30
attnflags        equ        296


.get_vbr:        move.l        execbase.w,a6
        btst        #0,attnflags+1(a6)
        bne.s        .need_vbr
        lea        sys_vbr_addr(pc),a0
        move.l        #0,(a0)
        rts

.need_vbr        lea        .get_vbr_code(pc),a5
        jsr        supervisor(a6)
        lea        sys_vbr_addr(pc),a0
        move.l        d0,(a0)
        rts

.get_vbr_code:        movec        vbr,d0
        rte

sys_vbr_addr:        dc.l        0

Don't thank me for the above, thank StingRay. :)

korruptor 15 January 2011 21:33

Oh, cracking, I'd just come back to post that I'd discovered the AttnFlags after much googling!

Thanks PMC (and Stingray!) :D

korruptor 04 February 2011 22:43

My next question; can anyone remember the key you hold down to turn the Blizzard expansion cards off during boot? :D

I know there's one for the 030 and I vaguely remember it being a function key but I can't make that trick work with the 060...

So far my code is spectacularly crashing, which is better than the grey screen I had before. :D

Edit: Fixed the crash. Yay!

adolescent 05 February 2011 01:58

Quote:

Originally Posted by korruptor (Post 734399)
My next question; can anyone remember the key you hold down to turn the Blizzard expansion cards off during boot? :D

Hold down the "2" button (not the one of the number pad) during boot.

korruptor 05 February 2011 15:46

Ah. Brilliant, thank you!


All times are GMT +2. The time now is 04:24.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.

Page generated in 0.05321 seconds with 11 queries