English Amiga Board


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

 
 
Thread Tools
Old 18 July 2022, 11:49   #1
LeCaravage
Registered User
 
LeCaravage's Avatar
 
Join Date: May 2017
Location: AmigaLand
Posts: 459
Turn on/off blitter priority during blit

Hi folks,

I wonder as I meet the case, but is it safe to turn on or off the blitter priority over cpu while the blitter is running ?

As it seems to work on unexpanded Amiga 500, what happens with A1200/A3000/A4000 etc... ?
LeCaravage is offline  
Old 18 July 2022, 11:52   #2
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,216
Generally not advisable. The problem is that the CPU then gets no slot whatsoever, in particular neither for processing interrupts, which may - depending on the nature of the interrupt - cause quite some disturbance in the system.
Thomas Richter is offline  
Old 18 July 2022, 12:13   #3
chb
Registered User
 
Join Date: Dec 2014
Location: germany
Posts: 439
Quote:
Originally Posted by Thomas Richter View Post
The problem is that the CPU then gets no slot whatsoever, in particular neither for processing interrupts, which may - depending on the nature of the interrupt - cause quite some disturbance in the system.
OT: That's only true for blits without idle cycles. A simple D clear blit e.g. will leave free cycles for the CPU even with blit priority on.
chb is offline  
Old 18 July 2022, 12:42   #4
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Thomas and chb are right.

It is safe to change Blitter priority while the Blitter is running, but when the Blitter leaves no free cycles you have to know what you're doing.

For example in my games setting the Blitter priority is part of the WAITBLIT macro, because the CPU definitely has nothing else to do when it reaches WAITBLIT. I have only VERTB and CIAB-timer interrupts enabled. The VERTB is no problem, because my game engine runs within the interrupt. The timer interrupt is for the music, and it usually doesn't matter when it is delayed until a blit finishes.

It's a design decision you have to make.
phx is offline  
Old 18 July 2022, 12:45   #5
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,039
Depends on context...
OS-killer? Do whatever you want.
OS friendly with multitasking disabled? Do whatever you want.
OS friendly with multitasking enabled? Sure, if you know what you are doing. But as Thomas hinted, there might be unwated side effects, some of them are depending on hardware config (eg. yes/no fast ram?).
a/b is offline  
Old 18 July 2022, 15:51   #6
LeCaravage
Registered User
 
LeCaravage's Avatar
 
Join Date: May 2017
Location: AmigaLand
Posts: 459
Sorry I forgot to give context.

Amiga 500 KS1.3 (512/512).
I tun off system and restablish it at exit.

I use the blitter priority over cpu with only one Destination and zero source.

As I can understand by reading your answers, it's safe to use it in this context, but is it the same with faster Amigas ? A1200,A4000... ?
LeCaravage is offline  
Old 18 July 2022, 16:25   #7
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,410
Quote:
Originally Posted by LeCaravage View Post
Sorry I forgot to give context.

Amiga 500 KS1.3 (512/512).
I tun off system and restablish it at exit.

I use the blitter priority over cpu with only one Destination and zero source.

As I can understand by reading your answers, it's safe to use it in this context, but is it the same with faster Amigas ? A1200,A4000... ?
It shouldn't function any differently on A1200/A4000.

The only thing to keep in mind is that you should always include a Blitter wait routine/macro even if you run with the Blitter set to have priority, as faster systems might still have the CPU running (either from the cache or from Fast Memory) even if the Blitter is set up this way and this can potentially end up setting up Blitter registers for new blits while the old one is still running.
roondar is offline  
Old 18 July 2022, 20:22   #8
LeCaravage
Registered User
 
LeCaravage's Avatar
 
Join Date: May 2017
Location: AmigaLand
Posts: 459
Quote:
Originally Posted by roondar View Post
It shouldn't function any differently on A1200/A4000.

The only thing to keep in mind is that you should always include a Blitter wait routine/macro even if you run with the Blitter set to have priority, as faster systems might still have the CPU running (either from the cache or from Fast Memory) even if the Blitter is set up this way and this can potentially end up setting up Blitter registers for new blits while the old one is still running.
It is hard to resist temptation of removing waitblit() ^^
LeCaravage is offline  
Old 18 July 2022, 20:48   #9
paraj
Registered User
 
paraj's Avatar
 
Join Date: Feb 2017
Location: Denmark
Posts: 1,099
Quote:
Originally Posted by LeCaravage View Post
It is hard to resist temptation of removing waitblit() ^^
Resist this temptation. If you're making some record breaking demo for A500 I'll give a pass, otherwise it's just not worth it. You will regret it.

Instead as mentioned upthread doing D=0 only uses half of blitter cycles, better to use them with the CPU
paraj is offline  
Old 19 July 2022, 22:51   #10
LeCaravage
Registered User
 
LeCaravage's Avatar
 
Join Date: May 2017
Location: AmigaLand
Posts: 459
Quote:
Originally Posted by phx View Post
Thomas and chb are right.

It is safe to change Blitter priority while the Blitter is running, but when the Blitter leaves no free cycles you have to know what you're doing.

For example in my games setting the Blitter priority is part of the WAITBLIT macro, because the CPU definitely has nothing else to do when it reaches WAITBLIT. I have only VERTB and CIAB-timer interrupts enabled. The VERTB is no problem, because my game engine runs within the interrupt. The timer interrupt is for the music, and it usually doesn't matter when it is delayed until a blit finishes.

It's a design decision you have to make.
It's the first time I hear a engine like yours. You mean the blit operatios are within the IRQ ? What happens if the frame drops ?
LeCaravage is offline  
Old 20 July 2022, 01:00   #11
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
It's not so uncommon.

Quote:
Originally Posted by LeCaravage View Post
You mean the blit operatios are within the IRQ ?
Yes. Everything.

Quote:
What happens if the frame drops ?
Shouldn't happen. These games are designed to run at 50 fps on all Amigas.

Advantage of this approach (for me) is that the main program can still do some low priority tasks in parallel, like loading and decoding data from disk, while the rendering is done at high priority during the interrupt.
phx 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
Immediate Blitter & Wait for Blitter... volvo_0ne support.WinUAE 32 18 September 2022 09:52
Blitter flip with interleaved bitplanes (single blit) alpine9000 Coders. Asm / Hardware 4 15 December 2018 04:49
Blitter Priority - Blthog Asman Coders. Asm / Hardware 3 12 December 2016 21:26
Blitter busy flag with blitter DMA off? NorthWay Coders. Asm / Hardware 9 23 February 2014 21:05
One "hole" in each scan line to turn off blitter nasty? mc6809e Coders. Asm / Hardware 1 03 July 2012 12:12

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

Top

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