From ecf49328acfa5a4013babae1bda1587574e72606 Mon Sep 17 00:00:00 2001 From: maron2000 <68574602+maron2000@users.noreply.github.com> Date: Tue, 25 Jul 2023 22:23:04 +0900 Subject: [PATCH 1/3] Fix mouse column limit on text mode (issue #4353) --- src/ints/mouse.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ints/mouse.cpp b/src/ints/mouse.cpp index b4d2dfe055c..8494831c947 100644 --- a/src/ints/mouse.cpp +++ b/src/ints/mouse.cpp @@ -1288,6 +1288,8 @@ void Mouse_AfterNewVideoMode(bool setmode) { Bitu rows = IS_EGAVGA_ARCH?real_readb(BIOSMEM_SEG,BIOSMEM_NB_ROWS):24; if ((rows == 0) || (rows > 250)) rows = 25 - 1; mouse.max_y = 8*(rows+1) - 1; + uint16_t cols = real_readb(BIOSMEM_SEG, BIOSMEM_NB_COLS); + mouse.max_x = cols * 8 - 1; } break; } From d0397f83f5ca4bee87fdc65e9e5a9af53c9acefe Mon Sep 17 00:00:00 2001 From: maron2000 <68574602+maron2000@users.noreply.github.com> Date: Wed, 26 Jul 2023 22:23:30 +0900 Subject: [PATCH 2/3] Add limit check (mouse.cpp) --- src/ints/mouse.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ints/mouse.cpp b/src/ints/mouse.cpp index 8494831c947..7d77228acb3 100644 --- a/src/ints/mouse.cpp +++ b/src/ints/mouse.cpp @@ -1289,6 +1289,7 @@ void Mouse_AfterNewVideoMode(bool setmode) { if ((rows == 0) || (rows > 250)) rows = 25 - 1; mouse.max_y = 8*(rows+1) - 1; uint16_t cols = real_readb(BIOSMEM_SEG, BIOSMEM_NB_COLS); + if((cols == 0) || (cols > 250)) cols = 80; mouse.max_x = cols * 8 - 1; } break; From b7026908c9a9ce426fc6db9d2d8603ae8567422e Mon Sep 17 00:00:00 2001 From: maron2000 <68574602+maron2000@users.noreply.github.com> Date: Wed, 26 Jul 2023 22:27:23 +0900 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index 92fab76b367..bec64f8c1ee 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -53,6 +53,7 @@ Next - Fix disassembly for far jmp/call decoding (cimarronm) - Fix memory limits on expand-down segment descriptors (cimarronm) - Bump tinyfiledialog to ver 3.13.3 (maron2000) + - Fix mouse column limit on text mode (issue #4353) (maron2000) 2023.05.01 - IMGMAKE will choose LBA partition types for 2GB or larger disk images, but the user can also use -chs and -lba options to override