I'm trying to get a GUIRMouseCursor working, but it seems to cut off at weird places. For example, when the mouse is on the far right, underneath the [X] button, it switches back to the main cursor instead of the custom one I have set. This is a quick DCSB program that illustrates the problem:
Code:
:sum(9
:sum(7,1,"F8F8F8F8F8","Testing
:sum(7,24,12*256+9,100*256+100,"0707070707FFFFFF","F8F8F8F8F8000000
:sum(12,12,12,1
I wasn't sure if it was just that I had the bounds too big one side (100, 100), but when I tried with smaller ones that should have worked (about (y,x) = (62,92)). Here's a snippet of my ASM code regarding this section:

Code:

Init:
   xor d
   ret
   jr Start
   
   .dw Description         ;or .dw $0000 if you don't have a description
   .db $07,$00         ;always this string
   .dw Icon         ;or .dw $0000 if you don't have an icon
   .dw $0000         ;usually .dw $0000 if you don't have or know what an ALE is
Start:                             ;main routines
   OpenGUIStack()

   PushGUIStacks(GUIStart)

   GUIMouse(0)

GUIStart:
-:   
   .dw {+}-{-}
   .db GUIRLargeWin
   .db %1010000
   .db %1100000
   .db %1000000
   .db %1100000
   .db %1010000
   .db "Drag+Drop",0
+:
        ; Snip a lot of other GUI elements
GUIR_CustomMouse:   
-:
   .dw {+}-{-}
   .db GUIRMouseCursor
   .db 9, 12
   .db 100,100         ; TODO: Fix this.
   .db %00000111
   .db %00000111
   .db %00000111
   .db %00000111
   .db %00000111
   .db %11111111
   .db %11111111
   .db %11111111
GUIR_CustomMouse_SpriteData:
   .db $00,$00,$00,$00
   .db $00,$00,$00,$00
+:   
   .dw $FFFF
Be sure to take into account that your items in the window all have coordinates relative to the window. That is, (0,0) is the top-left corner of the drawable window area, not the LCD. If you want to get into the title bar or even above it, you need to specify negative y coordinates for the item(S).
No luck there. I changed it to fit the insides of the GUIRLargeWin (where (y,x) = (54,92)), but it still cuts off in that one spot.

Just to make sure I'm not messing something silly up, when the DCS Wiki says:
Code:
0: word-packed top-left y,x of affected area [2 bytes]
2: word-packed bottom-right y,x of affected area [2 bytes]
4: 8-byte cursor mask [8 bytes]
12: 8-byte cursor sprite [8 bytes]
That means that my data looks like:
Code:
.db Y1,X1
.db Y2,X2
.db mask_stuff
.db sprite_stuff


Edit: I'm thinking that's not it because that just causes the cutoff to be even closer to the left.

Edit 2: Also, the DCSB page says that GUIRMouseCursor is LCD-based, not drawspace-based, but resetting everything to those values still disagrees. Could it be the routine you're using to check if the mouse is between those coordinates doesn't like bigger numbers?

Edit 3: Is there a way to get the location of the mouse pointer in ASM? Otherwise, I could put a ton of hotspots, but that wouldn't be a great idea. I'd need about 83/5 * 62/5 = 205 hotspots...
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are GMT - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement