English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 18 October 2017, 11:45   #1
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
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, 13:35   #2
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
Chain to VBL IRQ and tamper gfxBase->copper stuff?

Last edited by ross; 14 November 2017 at 22:38.
ross is offline  
Old 18 October 2017, 14:07   #3
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
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, 14:19   #4
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,528
Add high priority input.device/IND_ADDHANDLER and swallow all events? (or all mouse events only).
Toni Wilen is online now  
Old 18 October 2017, 14:24   #5
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
That might indeed work. Will try it, thanks.
StingRay is offline  
Old 18 October 2017, 15:55   #6
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,476
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 22:38.
ross is offline  
Old 18 October 2017, 16:37   #7
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,343
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 offline  
Old 18 October 2017, 20:41   #8
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,187
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, 21:30   #9
mark_k
Registered User
 
Join Date: Aug 2004
Location:
Posts: 3,343
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 offline  
Old 19 October 2017, 09:43   #10
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,326
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
Humongous mouse pointer Rixa support.Apps 13 31 March 2022 13:23
mouse pointer destroyed meynaf support.WinUAE 39 22 November 2015 20:52
Mouse Pointer Washac support.WinUAE 2 19 February 2012 20:57
Mouse pointer Washac support.Other 4 12 February 2010 01:38
Documentation needed Graphics.libary (about AGA Sprite/pointer) CFou! Coders. General 8 30 August 2006 19: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 17:31.

Top

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