MEGA65 / mega65-rom-public

MEGA65 ROM public issue reporting
4 stars 0 forks source link

High resolution sprite support in the MOUSE driver #126

Open dansanderson opened 4 months ago

dansanderson commented 4 months ago

Add support for the BASIC MOUSE system to use the full visible coordinate plane when sprenv400 and/or sprh640 are set.

Change https://github.com/MEGA65/mega65-rom/commit/69f2bda300f62dcff6a41d8b440ca94930968572 introduces support for hires sprite coordinates in the hires sprite modes (sprenv400 for hires Y per sprite, sprh640 for hires X system-wide). With a bit of refactoring (or duplication), the revised get_sprpos and set_sprpos routines in b65.src can be used as a basis for a similar feature in MOUSE handling in system.src. I believe it is mostly the bounds checking that needs to change. Additional logic may be needed if the sprite modes change while MOUSE is active.

The plan is to add a "set sprite resolution to match screen resolution" mode for the sprite subsystem, controllable by a BASIC command. It is also intended that these features support manually adjusting sprenv400 and sprh640 directly via register POKEs, i.e. anything that depends on this state will read it directly from the registers. Separately, the new sprite resolution mode will adjust these registers when the screen resolution changes. This feature requests that the MOUSE driver read sprenv400 and sprh640 and support border-to-border mouse pointer travel accordingly.