English Amiga Board


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

 
 
Thread Tools
Old 22 September 2020, 09:49   #1
LeCaravage
Registered User
 
LeCaravage's Avatar
 
Join Date: May 2017
Location: AmigaLand
Posts: 459
IRQ ASM pb

Hi,
I must admit that irq programming is something I'm not sure to master, but to be honest I've never understand its mechanics.

I use P61 music routine in lvl6 IRQ. I also use another one, but at a lower priority : lvl3 for instance.
The lvl6 irq is never turned off during main loop, but the lvl3 one is turned on/off 2 times.
The lvl3 irq is somehow turned off after a while, even though it shouldn't. The result is my program freezes, because main program waits indefinitely for an unlock semaphor coming from lvl3 irq, which will be never set.
I suspect it's because I'm not using the irqs turn on and off right. I'm unsure because Seka doesn't give contain of $09A and $09c after a breakpoint.
I always use $dff09a AND dff09c to turn on and off irqs amongst other flows (I guess but unsure).

Finally, so my question is :

What advices could you give and what is the proper way to turn on and off irqs in a main programm ?
LeCaravage is offline  
Old 22 September 2020, 11:10   #2
buzzybee
Registered User
 
Join Date: Oct 2015
Location: Landsberg / Germany
Posts: 526
For Proxima 3 I use OS-controlled interrupts, since this feels more stable to me than having to care about interrupts all myself. Especially as I am using a rather interesting setup of copper interrupt to init software interrupt for timing reasons / avoid possible conflicts with vertical blank interrupt

Initcode looks something like this:

Code:
	lea	CopIntServer(pc),a1
	moveq  #4,d0
	CALLEXEC	AddIntServer         ;Add copper interrupt to system list
	lea	VBLIntServer(pc),a1
	moveq  #5,d0
	CALLEXEC	AddIntServer         ;Add vb interrupt to system list


CopIntServer
	dc.l  0,0                     ;ln_Succ,ln_Pred
	dc.b  0,9                     ;ln_Type,ln_Pri
	dc.l  CopIntName                 ;ln_Name
	dc.l  0,copperInt             ;is_Data,is_Code
VBLintServer
	dc.l  0,0
	dc.b  0,
	dc.l  VBLIntName
	dc.l  0,vertBlancInt
SoftIntServer	; no active server, init'ed by copper interrupt
	dc.l  0,0
	dc.b  0,9
	dc.l  softIntName
	dc.l  0,softInt

CopIntName	dc.b "RP3_CopServ",0  
VBLIntName	dc.b "RP3_VBLServ",0 
softIntName	dc.b "RP3_SoftServ",0
Interrupts themselves are basic subroutines, ending with rts

Code:
copperInt
	SAVEREGISTERS
....
	lea	SoftIntServer(pc),a1
	CALLEXEC Cause	; init software interrupt, delegate further 50 hz code handling without blocking vbi and coper interrupt chain
.skipIntCall
	RESTOREREGISTERS
	rts
And to remove servers from the list of active interrupts:

Code:
	lea	CopIntServer(pc),a1
	moveq  #4,d0
	CALLEXEC	RemIntServer         ; remove copper interrupt
	lea	VBLIntServer(pc),a1
	moveq  #5,d0
	CALLEXEC	RemIntServer         ; remove vertical blank interrupt
buzzybee is offline  
Old 22 September 2020, 11:22   #3
LeCaravage
Registered User
 
LeCaravage's Avatar
 
Join Date: May 2017
Location: AmigaLand
Posts: 459
I use a similar scheme but in main program for add/remove/processing objets (real or virtual bobs).

The pb is I turn off system, so knowing what contains 'addintserver' and remintserver' could be interesting.
Anyway thanks for your help.
LeCaravage is offline  
Old 23 September 2020, 15:59   #4
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by LeCaravage View Post
Seka doesn't give contain of $09A and $09c
Those registers cannot be read, in fact all of the custom chip registers are either read or write, not both. Could that be the source of your problems (reading the wrong registers) ?
hooverphonique is offline  
Old 23 September 2020, 18:03   #5
LeCaravage
Registered User
 
LeCaravage's Avatar
 
Join Date: May 2017
Location: AmigaLand
Posts: 459
Quote:
Originally Posted by hooverphonique View Post
Those registers cannot be read, in fact all of the custom chip registers are either read or write, not both. Could that be the source of your problems (reading the wrong registers) ?
Checked again but I don't get a read access to these registers. I didn't know there's no R/W custom registers on Amiga, I've probably mixed things with some C64 registers.

Could it be possible the P61 replay alters other irq bits in $dff09a other than lvl6 one ?
LeCaravage is offline  
Old 24 September 2020, 10:06   #6
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
Quote:
Originally Posted by LeCaravage View Post
Could it be possible the P61 replay alters other irq bits in $dff09a other than lvl6 one ?
I don't know, but potentially it could be altering INTEN (bit 14) master interrupt enable.
hooverphonique is offline  
Old 24 September 2020, 17:19   #7
LeCaravage
Registered User
 
LeCaravage's Avatar
 
Join Date: May 2017
Location: AmigaLand
Posts: 459
Quote:
Originally Posted by hooverphonique View Post
I don't know, but potentially it could be altering INTEN (bit 14) master interrupt enable.
What is the use of this specific bit ?

Is there some cases where a lower irq could interrupt an aldready running higher one ?

Last edited by LeCaravage; 24 September 2020 at 17:45.
LeCaravage is offline  
Old 25 September 2020, 18:21   #8
LeCaravage
Registered User
 
LeCaravage's Avatar
 
Join Date: May 2017
Location: AmigaLand
Posts: 459
Quote:
Originally Posted by hooverphonique View Post
I don't know, but potentially it could be altering INTEN (bit 14) master interrupt enable.
I tried to disable bit 14 but the sound is turned off.

I just discovered that $09A and $09C can be read via $01C and $01E.

I added backgound color changes into the main loop of P61 replay and I noticed that it seems to freezes always at the same raster line. Very strange.
LeCaravage is offline  
Old 26 September 2020, 13:32   #9
Tomislav
Registered User
 
Join Date: Aug 2014
Location: Zagreb / Croatia
Posts: 302
Here is information of Amiga hardware access:
http://amiga-dev.wikidot.com/information:hardware
Tomislav is offline  
Old 26 September 2020, 15:46   #10
LeCaravage
Registered User
 
LeCaravage's Avatar
 
Join Date: May 2017
Location: AmigaLand
Posts: 459
Quote:
Originally Posted by Tomislav View Post
Here is information of Amiga hardware access:
http://amiga-dev.wikidot.com/information:hardware
Thanks, indeed usefull site, I'm already using it.


Can someone confirm what I think I understand about $9A, $9C.
The first is a request, the second one is a sort of acknowledgment of the current finishing irq ? (just before the rte).
LeCaravage is offline  
Old 26 September 2020, 17:48   #11
Bartman
Registered User
 
Join Date: Feb 2019
Location: Munich, Germany
Posts: 63
It seems P61 also uses INTF_EXTER
Bartman is offline  
Old 26 September 2020, 18:29   #12
LeCaravage
Registered User
 
LeCaravage's Avatar
 
Join Date: May 2017
Location: AmigaLand
Posts: 459
Quote:
Originally Posted by Bartman View Post
It seems P61 also uses INTF_EXTER
You mean the bit #13 of intena ? Do you know the other one ?
LeCaravage 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
ASM: Asm-ONE or AsmPro - how to set a Hello amiga coders, I hope it is ok to hijack ? Fireball Coders. Asm / Hardware 2 24 April 2020 21:16
Cannot use AUDX-INT (Level 4 IRQ) to stop sample. Herpes Coders. Asm / Hardware 18 16 January 2020 22:37
Spurious PORTS irq ross Coders. Asm / Hardware 37 27 February 2019 20:20
Irq Blitter LeCaravage Coders. Asm / Hardware 9 16 June 2017 10:21
IRQ Virus redblade request.Apps 8 01 September 2012 08:22

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 01:08.

Top

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