Difference between revisions of "83Plus:BCALLs:4D65"

From WikiTI
Jump to: navigation, search
m
(Example: linkage)
 
Line 22: Line 22:
  
 
== Example ==
 
== Example ==
<nowiki> B_CALL AppStartMouse
+
  B_CALL [[83Plus:BCALLs:4D47|AppStartMouse]]
MouseLoop:
+
MouseLoop:
cp 0Ch
+
  cp 0Ch
jr z,MouseDone
+
  jr z,MouseDone
B_CALL AppUpdateMouse
+
  B_CALL AppUpdateMouse
jr MouseLoop
+
  jr MouseLoop
MouseDone:
+
MouseDone:
B_CALL AppEraseMouse
+
  B_CALL [[83Plus:BCALLs:4D53|AppEraseMouse]]
ret</nowiki>
+
  ret

Latest revision as of 07:14, 11 April 2005

Synopsis

Official Name: AppUpdateMouse

BCALL Address: 4D65

Update the mouse cursor on the screen based on previous key press, and wait for another key press.

Inputs

  • Memory as set up by AppStartMouse

Outputs

  • A: 0Ah if arrow key pressed, 0Ch if enter key pressed
  • 986D: Current mouse cursor coordinates
  • Mouse cursor updated on screen based on keypress during previous AppUpdateMouse or AppStartMouse

Destroys

  • BC, DE, HL

Comments

You must call AppStartMouse to initialize memory before calling AppUpdateMouse. AppUpdateMouse will wait for a keypress, but will only return when an arrow key, or the enter key, is pressed. If an arrow key is pressed, the mouse cursor coordinates will be automatically updated. The below example allows a user to move the mouse cursor around the screen, and returns once the enter key is pressed.

Example

 B_CALL AppStartMouse
MouseLoop:
 cp 0Ch
 jr z,MouseDone
 B_CALL AppUpdateMouse
 jr MouseLoop
MouseDone:
 B_CALL AppEraseMouse
 ret