English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. C/C++

 
 
Thread Tools
Old 26 July 2017, 14:06   #21
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by roondar View Post
You can indeed disable all interrupts and that does prevent the OS from doing anything at all. Do note however that WaitTOF(), WaitBlitter(), disk IO and pretty much all other Wait() or signal response type functions the OS provides only work when the correct interrupts are available and if used while interrupts are disabled they may either hang or re-enable interrupts, neither of which is what you want.

My personal view these days is that you either use the OS (to do timing, IO, input, etc) or you don't use the OS at all. Manually disabling interrupts can have detrimental effects on system stability, especially so the system has a 3rd party harddisk controller or any form of network card.

That said, it is possible to selectively switch the OS on and off. However, if you wish the OS to stay on... You can change the priority instead and only use OS supported functions to dabble with interrupts (meaning no Forbid()/Permit() and no manual interrupt vectors except through Exec)
Ok, thanks for the explanation, roondar, I appreciate it!

I'd like to be friends with the OS for as long as possible, so I'll just use the priority for now -- it seems to work, after all. Also, most users probably won't appreciate my demo leaving their system in an unstable state..
guy lateur is offline  
Old 26 July 2017, 14:11   #22
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Quote:
Originally Posted by hooverphonique View Post
A screen cannot capture input, but a window can, however. Otherwise, I think you can use input.device to capture input (mouse/keyboard) for yourself - I've never bothered with that in my demos/intros, though...
Thanks for the pointers, I may look into that sometime. It's a really minor annoyance, though, so I probably won't bother either. There's still a lot of way more fun stuff on my todo list..
guy lateur is offline  
Old 26 July 2017, 19:29   #23
guy lateur
Registered User
 
guy lateur's Avatar
 
Join Date: May 2017
Location: Belgium
Age: 50
Posts: 334
Update: the copper bar now spans the whole vertical range of the screen.

As mentioned earlier, I was annoyed that I had some hard coded numbers in my source regarding the first (0x2b, anyone?) and last visible/copper-renderable lines on the screen. I got rid of them using some values in the View/Port structure in GfxBase. These are the relevant properties:
Code:
DWidth = GfxBase->ActiView->ViewPort->DWidth;
DHeight = GfxBase->ActiView->ViewPort->DHeight;

DxOffsetV = GfxBase->ActiView->DxOffset;
DyOffsetV = GfxBase->ActiView->DyOffset;
I translate these into more user friendly values as follows:
Code:
lineTop = DyOffsetV + 1;			// use +1 for caution
lineBottom = DHeight + DyOffsetV - 1;	// use -1 for caution
nrLines = lineBottom - lineTop + 1;
I can understand that DyOffsetV contains the magical 0x2b line starting value (lineTop), but the calculation of lineBottom is a little weird. Apparently, what you lose at the top (DyOffsetV), you get back at the bottom (DHeight + DyOffsetV). Is this the correct way to calculate this? It seems to work, but it feels kind of strange, especially when you try to apply the same logic to the horizontal values -- but let's not get into that just yet..

As mentioned earlier, I'm testing this on an Amiga Forever emulated A1200, and also on a real A1200. Both have their screen modes set to high-res PAL, but I do get different numbers (*) from the View/Port structures. Like I said, it seems to work, but I can't say I really understand it. It would be nice if somebody could elaborate a bit more on these numbers. The docs (http://amigadev.elowar.com/read/ADCD...ED.html#line63) aren't very helpful, unfortunately.

(*)
AF emulation:
DWidth, DHeight: 640, 256
DxOffsetV, DyOffsetV: 129, 44
Real A1200:
DWidth, DHeight: 724, 282
DxOffsetV, DyOffsetV: 93, 30
Attached Files
File Type: zip sineCopper.zip (21.7 KB, 78 views)
guy lateur 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
Combining copper scrolling with copper background phx Coders. Asm / Hardware 16 13 February 2021 12:41
Best way to mix blitting with copper and copper effects roondar Coders. Asm / Hardware 3 12 September 2016 13:12
copper ? turrican3 Coders. Asm / Hardware 10 27 January 2016 09:10
Blitter using the copper... h0ffman Coders. Asm / Hardware 9 23 February 2012 08:25
Understanding the Copper BippyM Coders. Tutorials 38 04 September 2010 12:18

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

Top

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