View Issue Details

IDProjectCategoryView StatusLast Update
0036708FPCRTLpublic2020-02-18 16:03
ReporterRafael Ángel Campos Vargas Assigned ToMarco van de Voort  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version3.0.2 
Summary0036708: Function result of GetMouseState on unit msmouse.pas with strange bits
DescriptionIf I assign in Go32v2 (FreeDOS-VirtualBox)
  GetMouseState(x,y,buttons);
  SomeWord := buttons;
// Runtime error because out of range buttons is $00A0000 (It is a Longint not a Word).

unit msmouse.pas;

Procedure GetMouseState(var x, y, buttons : LongInt);
begin
    if (not MouseFound) then Exit;
   asm
       ...
       ...
       movw %bx, (%eax)
end;
end;

Simple solution...
 Procedure GetMouseState(var x, y, buttons : LongInt);
begin
    if (not MouseFound) then Exit;
   asm
       ...
       ...
      movl $0, (%eax)
       movw %bx, (%eax)
end;
end;

Additional InformationNOTE: Actually I am using a modified version of msmouse.pas with a modified Initialization
I artificially increments MaxXValue to 1600 and MaxYValue to 1200 to obtain a
finner mouse pointer on graph unit of Go32v2.
In theory, I think I must to decrement cell size, or report change to graph mode...
TagsNo tags attached.
Fixed in Revision44210
FPCOldBugId
FPCTarget-
Attached Files

Activities

Marco van de Voort

2020-02-18 16:03

manager   ~0121160

I chose to fix it with an andl $65535,%ebx and a 32-bit mov, since that is also done for x and y.

Thanks for the report

Issue History

Date Modified Username Field Change
2020-02-18 02:35 Rafael Ángel Campos Vargas New Issue
2020-02-18 16:03 Marco van de Voort Assigned To => Marco van de Voort
2020-02-18 16:03 Marco van de Voort Status new => resolved
2020-02-18 16:03 Marco van de Voort Resolution open => fixed
2020-02-18 16:03 Marco van de Voort Fixed in Revision => 44210
2020-02-18 16:03 Marco van de Voort FPCTarget => -
2020-02-18 16:03 Marco van de Voort Note Added: 0121160