26 May 2009, 18:36 | #41 |
Used Register
Join Date: Nov 2008
Location: Headvillage / The Nethervoids
Age: 50
Posts: 103
|
Yeah, bit 9 is the master switch... "Main screen turn on"... "We get signal."
|
27 May 2009, 13:59 | #42 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
Watcha chaps.
After StingRay pointed out that my method of setting up a copper interrupt by banging the copper int vector directly fails on later Amiga models I've added a RetroLock(c) to my code. It's now guaranteed to safely not work on anything higher than a 68000. Or your money back. New routine with RetroLock(c) attached - once I understand properly what Sting's VBR stuff does, I'll replace the RetroLock(c) with a more friendly use of interrupt vectors. Last edited by pmc; 28 May 2009 at 11:39. |
27 May 2009, 14:57 | #43 |
Used Register
Join Date: Nov 2008
Location: Headvillage / The Nethervoids
Age: 50
Posts: 103
|
Here's my finding... I'm sure the experts will let us know when it's incorrect.. (which is great b.t.w., don't get me wrong!)
On 68000 machines the vectors to jump to exception routines always start at $0. On 68+ machines this doesn't have to be the case. Putting the address of your interrupt routine in $6c (level 3 interrupt vector) can give unwanted result on anything else but 68000 machines. Vectors might as well have been moved to say $10000. In that case, address of your interrupt routine should be put in $1006c instead of $6c. What Stingray's routine does is: .GetVBR move.l a5,-(a7) ; store a5 on stack moveq #0,d0 ; Put 0, which is the default offset for the vector jumps in d0 move.l $4.w,a6 ; something with exex.lib btst #0,296+1(a6) ; Is it 68010+ machine? beq.b .is68k ; nope, branch to end of this routine lea .getit(pc),a5 ; If it is 68+, load address of the -getit routine in a5 jsr -30(a6) ; And enter SuperVisor mode. This does some thingemabobs, including jumping to the .getit code. ; Once where back here, d0 contains offset for vectors. .is68k move.l (a7)+,a5 ; Restore a5 from stack rts .getit movec vbr,d0 ; Vector Base register to d0 rte ; back to user state code Back in the main code, after the .GetVBR call d0 contains the offset. it's moved to a0. then, using $6c(a0) the right address for level 3 interrupt vector is used. Or something like that... |
27 May 2009, 15:02 | #44 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
RetroLock sounds nice. The VBR stuff is actually not very complex, on 68000 the vectorbase always starts at $0 so the Lev3 vector would be $6c, Lev2 $68 etc. On CPU's > 68000 the vectorbase can be moved to fast ram so if you would change $6c.w to point to your VBI it would have no effect. Instead, you will have to read the address of the VBR (V.ector B.ase R.egister) and set your interrupts relative to this address, f.e. for a VBI it would be move.l VBRptr(pc),a0 move.l #MyVBI,$6c(a0). I'm doing this is my startup, just look for
Code:
move.l $6c(a0),.OldVBI-.VARS_HW(a5) lea .NewVBI(pc),a1 move.l a1,$6c(a0) Edit: posted at the same time as Vortex. |
27 May 2009, 15:14 | #45 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
As always, thanks chaps.
From the explanations, it looks like I understood the code at a fundamental level cos that's more or less what I'd understood from the routine but the movec vbr,d0 was confusing me slightly. Now I realise that movec is a new opcode not available on 68000 but is vbr a register on these higher processors - a bit like pc or sp for example? If so, does it therefore have to be moved with a movec? Sorry - suppose I'm drifting this off into a conversation more about the way the 68020 works... |
27 May 2009, 15:20 | #46 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
moveq #0,d0 movec d0,VBR Just make sure that you're in supervisor mode as movec is a privileged instruction. |
|
27 May 2009, 15:24 | #47 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
OK cool. Thanks for explaining. Time to implement.
Well, it looks like RetroLock(c) has become the world record holder for the software that was useful for the shortest amount of time ever. And before I'd even managed to license it and make my fortune. |
28 May 2009, 11:45 | #48 |
gone
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
|
I've finished my startup code now, including being friendly to systems with relocatable interrupt vectors.
Attached is a new startup version of my copperwave code which has been tested as working on A500, A500+ and A1200. Big big thanks StingRay for all your assistance and patience for helping me get together a nice startup routine that I can use with all my code now going forwards. You are the top man! Last edited by pmc; 26 February 2010 at 12:23. |
26 June 2009, 10:16 | #49 | |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Quote:
Also, for games/demos, SetPatch is normally used for compatibility, in which case you don't have to worry about the VBR. But if you want your code to work OS-friendly on 'any setup', it's nice to not make the user run SetPatch just to see your stuff... |
|
26 June 2009, 10:23 | #50 | |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
Quote:
This is not true. You always have to care about the VBR if you bang the hw directly, i.e. AddIntServer is not used to install an IRQ handler. Some demos require that Setpatch is started due the to way they check for AGA chipsets. |
|
26 June 2009, 17:50 | #51 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
|
Also see the last sentence, the one you didn't quote
SetPatch doesn't allow (or 'fix') that the (let's say) demo assumes VBR=0? To assemble the movec command in 68000-only assemblers, use dc.w $4e7b,$0801 for movec d0,VBR dc.w $4e7a,$0801 for movec VBR,d0. Last edited by Photon; 26 June 2009 at 18:11. |
26 June 2009, 23:23 | #52 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
No, Setpatch even relocates the VBR to fastmem. If you don't want to care about the VBR use system functions (AddIntServer f.e.) to install the IRQ, otherwise you'll need to take the VBR into account.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Remember Bars 'N' Pipes? | Mikey_C | Amiga scene | 19 | 04 January 2023 22:29 |
Combining copper scrolling with copper background | phx | Coders. Asm / Hardware | 16 | 13 February 2021 12:41 |
Bars & Pipes Professional | Ricebug | New to Emulation or Amiga scene | 0 | 08 February 2012 03:32 |
Dopus bars | frikilokooo | project.ClassicWB | 11 | 12 April 2008 17:10 |
Bars and Pipes | Frank | New to Emulation or Amiga scene | 2 | 01 March 2004 13:43 |
|
|