English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 22 November 2023, 10:22   #1
AmiNju
Registered User
 
Join Date: Mar 2020
Location: Duesseldorf / Germany
Posts: 32
Busy Pointer on screen

I write a little game on with Screens (without BlitzMode) - os friendly. Sometimes I need time to update the bitmap (draw things, etc.). In this time the user can't click on everything. How is it possible to change the mouse pointer to "busy" and after the action back to "normal"? NBusyPointer don't work.
AmiNju is offline  
Old 23 November 2023, 13:32   #2
Honitos
Registered User
 
Honitos's Avatar
 
Join Date: Nov 2019
Location: Celle / Germany
Posts: 145
Unfortunetely you cannot change the mousepointer of the screen, you only can change the pointer that is related to a window. Do you have a e.g. backdropped window?

BTW, BusyPointer requires Kickstart/Workbench 2.0+

Last edited by Honitos; 23 November 2023 at 15:49.
Honitos is offline  
Old 24 November 2023, 20:18   #3
AmiNju
Registered User
 
Join Date: Mar 2020
Location: Duesseldorf / Germany
Posts: 32
Hm...if I can't change the mousepointer for a screen, how can I change the mousepointer system wide (to Busy pointer)? Or is this not possible too?
AmiNju is offline  
Old 24 November 2023, 22:44   #4
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,001
Quote:
Originally Posted by AmiNju View Post
os friendly
OS-friendly means you have a window, otherwise you wouldn't be able to handle any input. Just use that window to set the busy pointer. If you don't have a window yet, just open one. A screen does not make sense without a window. In an OS-friendly environment.
thomas is online now  
Old 17 December 2023, 20:53   #5
AmiNju
Registered User
 
Join Date: Mar 2020
Location: Duesseldorf / Germany
Posts: 32
What's the command to change the pointer in a window? I found WPointer but for that I need an own shape. But I want to use the system busy pointer.
AmiNju is offline  
Old 18 December 2023, 17:29   #6
aNdy/AL/COS
Registered User
 
aNdy/AL/COS's Avatar
 
Join Date: Jan 2022
Location: Wales
Posts: 91
Create a shape, 'borrow' the system pointer image and just use the WPointer command?

I've always preferred the 'ZZ' pointer of 1.x to the 'stopwatch' of 2.x+ anyways...
aNdy/AL/COS is offline  
Old 19 December 2023, 22:53   #7
Honitos
Registered User
 
Honitos's Avatar
 
Join Date: Nov 2019
Location: Celle / Germany
Posts: 145
To set the busy pointer sprite, same as NBusyPointer does, you could use the Intuition function SetWindowPointerA_ ( http://amigadev.elowar.com/read/ADCD.../node03F7.html) that requires Kick 2.0.

The function requires a pointer to the current window that can be get via...

WinPointer.l = Peek.l(Addr Window(+window number+))

The taglist can be generated using the Tags()-function.


BTW, NBusypointer does not work as it requires a window opened with its own command NWindow.

Last edited by Honitos; 19 December 2023 at 23:07.
Honitos is offline  
Old 19 December 2023, 23:11   #8
No.3
Registered User
 
Join Date: Sep 2022
Location: Switzerland
Posts: 115
Quote:
Originally Posted by Honitos View Post
To set the busy pointer sprite, same as NBusyPointer does, you could use the Intuition function SetWindowPointerA_ ( http://amigadev.elowar.com/read/ADCD.../node03F7.html) that requires Kick 2.0.
"V39" is Kick 3.0
No.3 is offline  
Old 21 December 2023, 13:36   #9
AmiNju
Registered User
 
Join Date: Mar 2020
Location: Duesseldorf / Germany
Posts: 32
Quote:
Originally Posted by aNdy/AL/COS View Post
Create a shape, 'borrow' the system pointer image and just use the WPointer command?

I've always preferred the 'ZZ' pointer of 1.x to the 'stopwatch' of 2.x+ anyways...
Thanks for your replies! I will test this next year. I need compatibility to Kickstart 1.3 for those who won't install the game to their harddisk and prefer to play by floppy disk.
AmiNju is offline  
Old 04 January 2024, 16:58   #10
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,214
From the Amiga reference manual, there's a hint of how to do in for WB1.3:

Code:
/* data for a busy pointer.
** this data must be in chip memory!!!
*/
UWORD __chip waitPointer[] =
 {
 0x0000, 0x0000, /* reserved, must be NULL */
 0x0400, 0x07C0,
 0x0000, 0x07C0,
 0x0100, 0x0380,
 0x0000, 0x07E0,
 0x07C0, 0x1FF8,
 0x1FF0, 0x3FEC,
 0x3FF8, 0x7FDE,
 0x3FF8, 0x7FBE,
 0x7FFC, 0xFF7F,
 0x7EFC, 0xFFFF,
 0x7FFC, 0xFFFF,
 0x3FF8, 0x7FFE,
 0x3FF8, 0x7FFE,
 0x1FF0, 0x3FFC,
 0x07C0, 0x1FF8,
 0x0000, 0x07E0,
 0x0000, 0x0000, /* reserved, must be NULL */
 };
Code:
/*
** beginWait()
**
** Clear the requester with InitRequester. This makes a requester of
** width = 0, height = 0, left = 0, top = 0; in fact, everything is zero.
** This requester will simply block input to the window until
** EndRequest is called.
**
** The pointer is set to a reasonable 4-color busy pointer, with proper offsets.
*/
BOOL beginWait(struct Window *win, struct Requester *waitRequest)
{
extern UWORD __chip waitPointer[];
InitRequester(waitRequest);
if (Request(waitRequest, win))
 {
 SetPointer(win, waitPointer, 16, 16, -6, 0);
 SetWindowTitles(win,"Busy - Input Blocked",(UBYTE *)~0);
 return(TRUE);
 }
else
 return(FALSE);
}
/*
** endWait()
**
** Routine to reset the pointer to the system default, and remove the
** requester installed with beginWait().
*/
VOID endWait(struct Window *win, struct Requester *waitRequest)
{
ClearPointer(win);
EndRequest(waitRequest, win);
SetWindowTitles(win,"Not Busy",(UBYTE *)~0);
}
E-Penguin is offline  
Old 06 January 2024, 00:13   #11
E-Penguin
Banana
 
E-Penguin's Avatar
 
Join Date: Jul 2016
Location: Darmstadt
Posts: 1,214
OK, so this works in AB3, which has the "chip" keyword to force the section into chip ram. Tested on A1200, WB3.1, 8Mb Fast, and A500, 1.3, 500+500kb.

If just sets the pointer to the "wait" pointer image while that window is in focus. It could be cleared with
ClearPointer_ win
, or just clicking outside of the window.

One weirdness - in an A1200 configuration with Z3 RAM, it doesn't allocate the waitpointer image in chip ram after all, but somewhere up in Fast. So a more robust solution would be to dynamically allocate a bank in chip and copy the data in, but I leave this as an exercise to the reader. I guess something in AmiBlitz3 doesn't like the Z3 RAM.

Code:
WBStartup

NPrint "Hello World!"

FindScreen 0
Window 0,10,10,100,100,9,"SIZE ME!",1,2
*w.Window=Peek.l(Addr Window(0))
WindowOutput 0

win.l=Peek.l(Addr Window(0))
waitPtr.l = ?waitPointer

SetPointer_ win, waitPtr, 16, 16, -6, 0


Repeat
ev.l=WaitEvent
WLocate 0,0
NPrint *w\Width
NPrint *w\Height
NPrint waitPtr
Until ev=$200


End

Chip

Even
waitPointer:
Dc.w $0000
Dc.w $0000
Dc.w $0400
Dc.w $07C0
Dc.w $0000
Dc.w $07C0
Dc.w $0100
Dc.w $0380
Dc.w $0000
Dc.w $07E0
Dc.w $07C0
Dc.w $1FF8
Dc.w $1FF0
Dc.w $3FEC
Dc.w $3FF8
Dc.w $7FDE
Dc.w $3FF8
Dc.w $7FBE
Dc.w $7FFC
Dc.w $FF7F
Dc.w $7EFC
Dc.w $FFFF
Dc.w $7FFC
Dc.w $FFFF
Dc.w $3FF8
Dc.w $7FFE
Dc.w $3FF8
Dc.w $7FFE
Dc.w $1FF0
Dc.w $3FFC
Dc.w $07C0
Dc.w $1FF8
Dc.w $0000
Dc.w $07E0
Dc.w $0000
Dc.w $0000

Last edited by E-Penguin; 06 January 2024 at 16:46.
E-Penguin 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
Pointer (Prefs) opening in new screen levellord support.AmigaOS 4 03 November 2021 23:28
Busy wait for screen lines Quagliarulo Coders. Asm / Hardware 5 18 July 2020 12:17
Screen tear/glitch following mouse pointer. lordofchaos support.WinUAE 5 24 May 2019 20:03
Animated Busy Pointer Image Leandro Jardim request.Other 1 23 May 2012 02:41
Mouse pointer jumps to centre of screen ral-clan support.WinUAE 0 30 January 2011 02:41

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

Top

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