Difference between revisions of "83Plus:BCALLs:4D65"
From WikiTI
(Create AppUpdateMouse) |
(→Example: linkage) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | [[Category:83Plus:BCALLs:By Name:Display|AppUpdateMouse]] [[Category:83Plus:BCALLs:By Name|AppUpdateMouse]] [[Category:83Plus:BCALLs:By Address|4D65 - AppUpdateMouse]] | ||
== Synopsis == | == Synopsis == | ||
'''Official Name:''' AppUpdateMouse | '''Official Name:''' AppUpdateMouse | ||
Line 21: | Line 22: | ||
== Example == | == Example == | ||
− | + | B_CALL [[83Plus:BCALLs:4D47|AppStartMouse]] | |
− | MouseLoop: | + | MouseLoop: |
− | + | cp 0Ch | |
− | + | jr z,MouseDone | |
− | + | B_CALL AppUpdateMouse | |
− | + | jr MouseLoop | |
+ | MouseDone: | ||
+ | B_CALL [[83Plus:BCALLs:4D53|AppEraseMouse]] | ||
+ | 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