English Amiga Board


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

 
 
Thread Tools
Old 11 December 2012, 01:06   #1
neoman
titan sucks!
 
Join Date: Dec 2012
Location: munich/germany
Posts: 54
Force AmigaOS *not* to update COPxLCH

From the AHRM:

Code:
COP1LC  is written at the end of  vertical blanking .
------------------------------------------------------
The  COP1LC  register is written at the end of the  vertical blanking 
period by a graphics interrupt handler which is in the vertical blank
interrupt server chain.  As long as this server is intact,  COP1LC 
will be correctly strobed at the end of each vertical blank.
Is there any way to avoid this behaviour - I need their interrupt servers because I need timer.device and the timer interrupts but I don't need the copper list refresh. I just want force AmigaOS *not* to update these pointers. Since my VBI needs a variable time (due to music playback) I cannot just set COPxLC to my own pointers because they get overwritten on occasion.

Thanks for some help,
neoman/titan
neoman is offline  
Old 11 December 2012, 08:20   #2
neoman
titan sucks!
 
Join Date: Dec 2012
Location: munich/germany
Posts: 54
I think I found a way around it. But if someone knows it though, it would be pretty nice to know.

Thanks!
neoman is offline  
Old 11 December 2012, 08:36   #3
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,518
I don't remember AmigaOS ever writing to COP1LC, many semi-system friendly games (and very old demos) writes to COP1LC taking over the display without disabling interrupts.

But usual LoadView(NULL) should do it.
Toni Wilen is online now  
Old 11 December 2012, 10:46   #4
neoman
titan sucks!
 
Join Date: Dec 2012
Location: munich/germany
Posts: 54
Thanks so far, I will give it a try.

I add the interrupt using AddIntServer and AmigaOS's VBI also seems to be in that queue because it resets COP2LC after my interrupt has been done (I return from my interrupt with Z condition with intent of course!). It seems to restore them from LOFList/SHFList. But I just cannot set LOFList/SHFList to my COP2LC because I built a copper matrix which edits COP2LC all the time.
neoman is offline  
Old 11 December 2012, 10:50   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,518
Yeah, COP2LC is updated if system screen mode is interlaced.
LoadView(0); takes care of that too.
Toni Wilen is online now  
Old 11 December 2012, 11:58   #6
neoman
titan sucks!
 
Join Date: Dec 2012
Location: munich/germany
Posts: 54
Code:
_InstallScreen
	movem.l	d0-a6,-(sp)

	*** remove and store OS-view

	move.l	_GfxBase,a6
	move.l	gb_ActiView(a6),_OSView
	sub.l	a1,a1
	jsr	_LVOLoadView(a6)
	jsr	_LVOWaitTOF(a6)
	jsr	_LVOWaitTOF(a6)
That's strange, I already do this...
neoman is offline  
Old 12 June 2017, 16:53   #7
JackAsser
Registered User
 
Join Date: Jul 2006
Location: Lund / Sweden
Age: 45
Posts: 171
Reviving necro thread. Any solutions to this?
JackAsser is offline  
Old 13 June 2017, 14:45   #8
JackAsser
Registered User
 
Join Date: Jul 2006
Location: Lund / Sweden
Age: 45
Posts: 171
Quote:
Originally Posted by JackAsser View Post
Reviving necro thread. Any solutions to this?
This is the solution:

After chatting with StingRay the solution is simple. Simply also tell graphics.library (offset $32 or gb_LOFlist) to use the COP2LC pointer:

move.l gfxbase,a0
move.l my_copper,gb_LOFlist(a0)
move.l my_copper,$dff084

So while COP2LC _will_ be overwritten in the OS VBlank routine, it will at least be overwritten with _YOUR_ value.
JackAsser is offline  
Old 13 June 2017, 19:05   #9
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
You are talking about hitting the hardware while the OS is still alive? This is evil and disgusting!

Take over the system completely and do your stuff - no problems!

Otherwise the solution would be to avoid the execution of the OS VERTB interrupt handler. Insert a handler with AddIntServer(), as neoman mentioned, many years ago, and return with Z-flag set. So lower priority handlers do not execute. Make sure your handler has the highest priority, of course. The GfxBase->vbsrv has priority 10.

When that doesn't work (like neoman indicated - I didn't test it), you could also use SetIntVector() to replace the OS VERTB interrupt server routine with yours.

(BTW, this thread never had anything to do with C/C++ ...)
phx is offline  
Old 13 June 2017, 19:33   #10
JackAsser
Registered User
 
Join Date: Jul 2006
Location: Lund / Sweden
Age: 45
Posts: 171
Quote:
Originally Posted by phx View Post
You are talking about hitting the hardware while the OS is still alive? This is evil and disgusting!

Take over the system completely and do your stuff - no problems!

Otherwise the solution would be to avoid the execution of the OS VERTB interrupt handler. Insert a handler with AddIntServer(), as neoman mentioned, many years ago, and return with Z-flag set. So lower priority handlers do not execute. Make sure your handler has the highest priority, of course. The GfxBase->vbsrv has priority 10.

When that doesn't work (like neoman indicated - I didn't test it), you could also use SetIntVector() to replace the OS VERTB interrupt server routine with yours.

(BTW, this thread never had anything to do with C/C++ ...)
Tried all of the above w/o succes
JackAsser 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
Amikit AmigaOS ROM Update Amigan Amiga scene 10 21 April 2008 22:30
AmigaOS 4.0 July 2007 Update Available P-J News 0 19 July 2007 16:35
AmigaOS 4.0 The Final Update available P-J News 43 22 January 2007 09:40
Poseidon V3.4 for AmigaOS UPDATE!!! keropi News 5 03 November 2006 09:56
Unofficial AmigaOS homepage update DJBase News 3 04 January 2006 14:55

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 20:56.

Top

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