English Amiga Board


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

 
 
Thread Tools
Old 10 July 2013, 23:32   #1
bodhi
Registered User
 
bodhi's Avatar
 
Join Date: Nov 2012
Location: GB
Posts: 32
Adding a VB Interrupt to AOS server chain

Hi,

I don't know if anyone will be able to help from this post but here goes...

I'm simply trying to add my own vertical blank handler to AmigaOS server chain and I'm not having much success.

I'm sure there is a problem with the way I'm initializing my server, so I paste here just the stuff that I think might be wrong - hopefully it is enough information:


Code:
;####################################################
;# MAIN                                                                  
;####################################################
_main
	jsr		StartUp
	jsr		Rasterize
	jsr		Convert2Cop
	move.l          #CopList0,COP1LC+_custom ; load address of new copper into cop control reg
	jsr		StartInterrupt ; <--- here's where the problems start
.loop

.skip
	btst	#6,$bfe001 ; mouse press loop
	bne.s	.loop
	
	jsr		CloseDown
	rts
;####################################################
;# SUB ROUTINES                                                                              
;####################################################

StartInterrupt
	; initialize vertical blank Interrupt server structure
	move.l	#MyIS,a0
	move.b	#NT_INTERRUPT,LN_TYPE(a0)
	move.b	#100,LN_PRI(a0)
	move.l	#VBIntName,LN_NAME(a0)
	move.l	#counter,IS_DATA(a0)
	move.l	#VBCounter,IS_CODE(a0)
	
	move.l	4.w,a6
	move.b	#INTB_VERTB,d0 ; type is VERTB interrupt
	move.l	#MyIS,a1
	jsr             _LVOAddIntServer(a6)
	rts

VBCounter:

        ; ----> DO VB STUFF HERE <----

	move.l	#_custom,a0 ; 10+ priority vertb servers expect custom base address in a0 on exit
	move.l	#0,d0 ; set Z flag so that next VB server in chain is executed. Clear Z flag to terminate chain
	rts

;####################################################
;# DATA                                                                                      
;####################################################

MyIS ds.b IS_SIZE
	cnop 0,2
VBIntName	dc.b "My-VB-Interrupt",0
	cnop 0,2
If I comment out jsr _LVOAddIntServer(a6) I get no crash. If I leave it in, I get a fatal crash and reset.

Any hints?
bodhi is offline  
Old 11 July 2013, 02:04   #2
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Rem- and AddIntServer will interpret the whole longword of D0, so do a moveq #INTB_VERTB instead of move.b and it should work.
Leffmann is offline  
Old 11 July 2013, 02:54   #3
bodhi
Registered User
 
bodhi's Avatar
 
Join Date: Nov 2012
Location: GB
Posts: 32
That done the trick!

I'm so glad for this board and people like you. It would have taken me ages to figure that out!

but I should have seen it myself. The RKM function description is: void AddIntServer(ULONG, struct Interrupt *);

thank you
bodhi 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
New Competition: Chain Game Galahad/FLT EAB's competition 19 28 June 2013 20:13
AOS scratch register question. Thorham Coders. Asm / Hardware 7 19 December 2012 22:09
ExtractModule (AOS 3.9) NubeCheCorre request.Apps 2 05 May 2012 13:31
FS: PegasosII G4 1GHz + AOS 4.1 parski MarketPlace 1 22 June 2011 23:57
a problem on scsi-chain Bamiga2002 support.Hardware 15 28 October 2009 16:09

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

Top

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