English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 16 January 2012, 09:10   #1
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,344
Horizontal Blanking

Hi All

I would like to trigger an interrupt every time that the Horizontal Blanking occur,
How could I do that? It's a been long time since my last conding for Amiga, and I have to polish my skills a bit . I would like to do somenthing within the Horizontal Blankings' Time.

thanks a lot
sandruzzo is offline  
Old 16 January 2012, 09:17   #2
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Trigger the interrupt with a write to INTREQ in your Copper program.
Leffmann is offline  
Old 16 January 2012, 09:40   #3
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by sandruzzo View Post
Hi All

I would like to trigger an interrupt every time that the Horizontal Blanking occur,
I suppose you mean the vertical blanking interval here? If so, patch the level 3 interrupt vector ($6c.w, take care of the VBR on 680x0 CPU's) and enable the the level 3 interrupt in INTENA (bit 5, VERTB).
StingRay is offline  
Old 16 January 2012, 10:02   #4
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
Quote:
Originally Posted by StingRay View Post
I suppose you mean the vertical blanking interval here? If so, patch the level 3 interrupt vector ($6c.w, take care of the VBR on 680x0 CPU's) and enable the the level 3 interrupt in INTENA (bit 5, VERTB).
And if not, then make a copper list that waits for the end (or start) of each scan line and trigger a copper interrupt after that.
Thorham is offline  
Old 16 January 2012, 10:29   #5
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,344
Thanks for your helps. I meant Horizontal not Vertical Blanking. I would like to do some test
in order to take advantage of this Horizontal blanking, Like copy speed. So I have to write a copperlist that wait all the lines (200 or 256), and after each wait, I have to a move that trigger this Interrupt, doesn't ?

thanks
sandruzzo is offline  
Old 16 January 2012, 11:49   #6
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
You would have to wait for the first non visible horizontal wait pos on the right hand edge of each scanline and then trigger your interrupt by writing intreq.
pmc is offline  
Old 16 January 2012, 12:00   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,553
What kind of setup? Use of "hblank" interrupts on non-fast RAM/<68020 CPU setup is waste of CPU time. It takes over 50 CPU cycles to enter and exit an interrupt.
Toni Wilen is online now  
Old 16 January 2012, 13:59   #8
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by sandruzzo View Post
Thanks for your helps. I meant Horizontal not Vertical Blanking. I would like to do some test
in order to take advantage of this Horizontal blanking, Like copy speed.
I am still not sure that you mean horizontal blanking. (TC) C2P copyspeed routines (if that is what you're referring to with copyspeed) take advantage of the vertical blanking because chipmem access is faster then.
StingRay is offline  
Old 16 January 2012, 15:18   #9
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,344
StingRay,

Yes I meant horizontal blanking too. I would like to see what kind of outcome I'll see. Just to test...
sandruzzo is offline  
Old 16 January 2012, 15:20   #10
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Still don't get what you're trying to do personally - post your test code maybe?
pmc is offline  
Old 16 January 2012, 15:32   #11
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,344
Just to see how quick or how slow could be to works with chip-mem when bitplane DMA aren't using it. I still have to write my code..
sandruzzo is offline  
Old 16 January 2012, 17:03   #12
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by pmc View Post
Still don't get what you're trying to do personally
You're not the only one. For me it doesn't make sense. But I'll wait and see.
StingRay is offline  
Old 16 January 2012, 18:13   #13
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,344
hehe! Nothing fancy. Just to play with interrupts.
sandruzzo is offline  
Old 16 January 2012, 18:43   #14
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,831
sandruzzo just wants to know how much speed can be gained if you also use the horizontal blank and not just the vertical one.
Thorham is offline  
Old 16 January 2012, 18:46   #15
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
I understood that. It still doesn't make sense to me!

Last edited by StingRay; 16 January 2012 at 19:42. Reason: typo
StingRay is offline  
Old 16 January 2012, 20:51   #16
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,344
Thorham

I don't know how much speed can be gained. I want to see what would be difference about accessing during Hblank or during normal rasterline.
sandruzzo is offline  
Old 16 January 2012, 23:19   #17
Kalms
Registered User
 
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
You can do some estimations at least.

A line is approximately 228 buscycles. If you have a 320 pixels wide lores screen, then the bitplane DMA-on portion of that screen is 160 buscycles.

So you have 160 buscycles worth of DMA-on and 68 buscycles of DMA-off.

During the DMA-on portion, on a lores screen you will only see a performance degradation if you have more than 4 bitplanes active. On an A500, having 5 bitplanes active will steal 25% of the DMA slots. On an A1200, having 5/6/7/8 bitplanes active will steal 6.25%/12.5%/18.75%/25% of the DMA slots, respectively.

(If you are running in hires/shres then a lot more buscycles will be used up by bitplane DMA.)

Now the kicker is, how much time do you lose by triggering the interrupt? if you target another machine than standard a500, how do you adjust the amount of work being done during the interrupt to match the performance of the machine?

I never tried it myself because I assumed that the overhead of the hblank interrupt would outweigh the few buscycles saved. Also, I normally target faster machines and there it is difficult to make the code self-adjusting.
Kalms is offline  
Old 17 January 2012, 03:53   #18
mc6809e
Registered User
 
Join Date: Jan 2012
Location: USA
Posts: 372
Quote:
Originally Posted by sandruzzo View Post
Hi All

I would like to trigger an interrupt every time that the Horizontal Blanking occur,
How could I do that? It's a been long time since my last conding for Amiga, and I have to polish my skills a bit . I would like to do somenthing within the Horizontal Blankings' Time.

thanks a lot
Are you attempting to get the CPU to use available odd chipram cycles at the beginning of a scan line? Maybe you're hoping to get the CPU to run concurrently with the blitter when no other DMA is occurring.

My advice would be to experiment with a copper list that triggers interrupts at various places along each horizontal line to discover when you get the greatest level of concurrency. The proper place will most likely vary with the instruction sequence you wish to execute. It's possible the best place to trigger an interrupt is somewhere in the middle of a scan line.

Other programmers are forced to interrupt on hblank or vblack. You have an Amiga. You can trigger an interrupt whenever you damn well please.
mc6809e is offline  
Old 17 January 2012, 09:27   #19
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,344
Kalms , mc6809e

thanks for your reply. I just want to play a little bit with Amiga interrupt, like I neved did, and see if I can get a better blittler and cpu work when they have as much cycle as possible. but since you already did it...
sandruzzo 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
DPMS screen blanking mark_k support.WinUAE 2 28 February 2013 18:15
Multimonitor blanking Dr.Venom request.UAE Wishlist 3 08 July 2012 17:58
Wanted - Blanking plates for Elbox Power Tower fitzsteve MarketPlace 0 21 October 2010 11:49
Wanted: Amiga 2000HD floppy disc blanking plate davideo MarketPlace 1 28 March 2008 13:25
[Wanted] Amiga 4000 5.25" blanking plate jimbo100 MarketPlace 16 20 June 2007 17:27

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 21:22.

Top

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