English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 18 October 2017, 12:45   #1
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,146
Any way to free sprite 0 (mouse pointer)?

As the title suggests I'm looking for a way to completely free sprite 0 so it can be used for other stuff. Tried quite a few things so far and was satisfied with none. Is it even possible to claim sprite 0 when system is still intact?
And no, just changing the sprite to something invisible is not enough, I really need to have full control of sprite 0, i.e. it must not handle any mouse movements any longer.

Any hints welcome!
StingRay is offline  
Old 18 October 2017, 14:35   #2
ross
Omnia fert aetas

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 48
Posts: 1,256
Chain to VBL IRQ and tamper gfxBase->copper stuff?

Last edited by ross; 14 November 2017 at 23:38.
ross is offline  
Old 18 October 2017, 15:07   #3
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,146
Well, that still wouldn't fix the problem with the system still handling the mouse movements. And if possible I'm looking for a "clean" (i.e. less hacky) solution.
StingRay is offline  
Old 18 October 2017, 15:19   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,030
Add high priority input.device/IND_ADDHANDLER and swallow all events? (or all mouse events only).
Toni Wilen is offline  
Old 18 October 2017, 15:24   #5
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,146
That might indeed work. Will try it, thanks.
StingRay is offline  
Old 18 October 2017, 16:55   #6
ross
Omnia fert aetas

ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 48
Posts: 1,256
But this not solve the freeing of sprite..
(you got a stuck sprite0 on screen if you ignore each event)

Seems that a mix of the two techniques is required.

How about:
- intuition->LockIBase (a bit extreme..)
- high priority input.device/IND_ADDHANDLER (all events to NIL)
- chain to VBL IRQ and tamper gfxBase->copper->spritepointer
(maintaining wb/system copperlist, yes is hacky..)

Logically if don't need Intuition and don't need to inject mouse movement
What's your purpose?

Last edited by ross; 14 November 2017 at 23:38.
ross is offline  
Old 18 October 2017, 17:37   #7
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,962
How system-legal are you wanting to be? You could eat all mouse movement events and use SetPointer() to set the sprite 0 [i.e. mouse pointer] image which would apply while your window is active.

Or you could call SetPrefs() to set the system-wide mouse pointer image. But that will work on Kickstart 1.x only; on 2.x or later you could replace the pointer ILBM image in ENV: maybe.

Moving the sprite would require injecting fake mouse movement input events.
mark_k is online now  
Old 18 October 2017, 21:41   #8
Samurai_Crow
Total Chaos forever!

Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Ft. Collins, CO USA
Age: 44
Posts: 1,119
Send a message via Yahoo to Samurai_Crow
This could be handy for a more system friendly AmosPro runtime environment and others as well!

Sent from my Prism II using Tapatalk
Samurai_Crow is offline  
Old 18 October 2017, 22:30   #9
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 2,962
Digging into this subject some more...

A thread from comp.sys.amiga.programmer in 1993

From postings by Chris Green (Commodore graphics software engineer):
See the source code for AABoing on amiga.physik.unizh.ch. This
contains a fragment of how to use sprite 0 more-or-less safely.
I am using 64 bit wide sprites (os 3.0, AA chips), but the
same technique works under previous kickstarts.

The "trick" is to obtain another sprite, and set the spritenum
field in the SimpleSprite (or ExtSprite) structure to zero. Then when
this sprite is moved or changed, it will replace sprite 0. If intuition
moves the sprite (in response to a mouse click, for instance), it will
steal the sprite back temporarily, but this can be fixed by preventing
intuition from seeing mousemove events (via an input handler).


AABoing on Aminet
mark_k is online now  
Old 19 October 2017, 10:43   #10
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 45
Posts: 3,246
For using sprite 0 I would start by trying to overwrite its pointer ($dff120) with mine in a custom copper list. The OS would still maintain the old sprite with the mouse position but that data just wouldn't be displayed anymore. If you use an Intuition screen you can do that by using Screen.ViewPort.UCopIns.
meynaf 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
mouse pointer destroyed meynaf support.WinUAE 39 22 November 2015 21:52
Mouse Pointer Washac support.WinUAE 2 19 February 2012 21:57
Humongous mouse pointer Rixa support.Apps 9 21 September 2010 11:38
Mouse pointer Washac support.Other 4 12 February 2010 02:38
Documentation needed Graphics.libary (about AGA Sprite/pointer) CFOU! Coders. General 8 30 August 2006 20:08

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


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.07307 seconds with 14 queries