English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 09 March 2006, 01:53   #1
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,604
'Chaining' Vblank interrups under the system

Hm. I'm doing a bootblock where I

1. Start my own copper
2. Start a Vblank interrupt which fades a logo in, WHILE
3. I load sectors with Exec/DoIo()

Problem is, DoIo seems to need the system's Vblank int on to load, because if I just set my own int, the logo fades in nicely, but nothing is loaded.

If I don't set my fade int, tracks load nicely.


I tried putting a JMP at the end of my int that jumps to the old system interrupt address (JUST AS AN EXPERIMENT, OK? ), and then the tracks load nicely, but my fade interrupt routine is never heard from again. I guess the system sets the Vblank interrupt address back.

Anyway I have a big hunch that using jumps is hardly the correct way of "adding" a small routine to the system Vblank.

So my question is: how do I add my little fade routine to the system vblank interrupt structure? Just inserting a little JSR into the 'chain' (preferably last)would do.

Last edited by Photon; 09 March 2006 at 02:09.
Photon is offline  
Old 09 March 2006, 16:51   #2
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,604
DOH!

Problem solved, just a stupid bug. (So stupid I won't tell you what it was. Never code when you're tired )

Found the bug AFTER I managed to find out how to chain ints on my own, of course.

Anyway here's the code to add an extra subroutine on the system Vblank chain:

Code:
AddInt:	move.l 4.w,a6
	lea IntStruct(PC),a1
	moveq #5,d0		;Interrupt number 0-15. 5=INTB_VERTB
	jsr -$a8(a6)		;AddIntServer
;---------------------------------
IntStruct:
.Node:
.succ:	dc.l 0
.pred:	dc.l 0
.type:	dc.b 2		;node type. 2=NT_INTERRUPT
.pri:	dc.b -60	;priority, -60=Low
.name:	dc.l MyName
.Data:	dc.l 0		;int. data ptr
.Code:	dc.l MyInt	;int. routine address. set d0=0 and rts at end of it
MyName:	dc.b "PhotonsInt",0
EVEN
;---------------------------------
MyInt:
	movem.l d1-a6,-(SP)    ;a1 points to interrupt data 
	;-----int code------
	movem.l (SP)+,d1-a6
	moveq #0,d0
	RTS
Note that this is how you do it under the controlled circumstances of the bootblock on an A500. To use it for a system utility or something you would allocate memory for the interrupt routine and structure, and clean up after yourself when you're done, i.e. RemIntServer() and deallocate memory. Use includes instead of the typed constants here on anything above Kick 1.3.

Last edited by Photon; 09 March 2006 at 18:00.
Photon 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
System is not validated! FFS (and I dont mean fast file system!) Macca support.Hardware 11 11 June 2007 13:04
Linking PC, Amiga and Mac. HardStep support.Hardware 3 01 February 2006 21:03
Devpac Linking Problems Steve Coders. General 8 10 December 2002 11:37

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 23:16.

Top

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