Menu

#266 Fix mouse range for non 80x25 text modes when autolock=false

Unstable_(example)
open
nobody
None
1
2016-02-16
2016-02-16
No

In 40x25 text mode, when autolock is false, only the left half of the screen is accessible. According to int 33h documentation, mouse pointer coordinates should be within 640x200 regardless of the current mode. Hence, Mouse_CursorMoved should not look at BIOSMEM_NB_COLS/ROWS like it does today, but instead simply multiply the supplied x/y values by 640 and 200 respectively. This is what this patch does.

Tested in 80x25 and 40x25.

1 Attachments

Discussion

  • ripsaw8080

    ripsaw8080 - 2016-02-16

    It was changed not long ago to use the BIOS dimensions to support 80x50, and your patch would regress to the pointer not being able to move into the lower half of the screen.

    I think line 258 in the current source is what needs to be balanced against, so perhaps "if (mouse.mode<2) mouse.x *= 2;" would take care of that.

    Do you have a game or app that uses the mouse cursor in 40x25?

     
    • Raphael Assenat

      Raphael Assenat - 2016-03-03

      You are right, it breaks modes with more than 25 rows. I did not know these modes extended the 640x200 text mode mouse pointer "virtual screen"...

      I'm adding mouse support to an old 40x25 game which could benefit from it, but I'm not ready to release it. So I made a simple test program, ttest.asm, which switches to a few different modes to test. (http://www.raphnet.net/programmation/mixed/mixed_en.php)

      Here is an updated and tested patch. 40x25, 80x25 and 80x50 are all working properly.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.