Skip to content

Commit bf1051f

Browse files
committed
Remove limit in PS/2 since it seems to work worse in QEMU
1 parent 414f38c commit bf1051f

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

applications/libps2/src/ps2.cpp

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,8 @@ void ps2ReadMouseIrq()
8282
void ps2CheckForData()
8383
{
8484
uint8_t status;
85-
int limit = 100;
8685
while(((status = g_io_port_read_byte(G_PS2_STATUS_PORT)) & 0x01) != 0)
8786
{
88-
if(!--limit)
89-
break;
90-
9187
uint8_t value = g_io_port_read_byte(G_PS2_DATA_PORT);
9288

9389
if((status & 0x20) == 0)
@@ -224,19 +220,16 @@ void ps2HandlePacket()
224220
uint8_t valY = mousePacketBuffer[2];
225221
int8_t scroll = intelliMouseMode ? (int8_t) mousePacketBuffer[3] : 0;
226222

223+
int16_t offX = (valX | ((flags & 0x10) ? 0xFF00 : 0));
224+
int16_t offY = (valY | ((flags & 0x20) ? 0xFF00 : 0));
227225
if((flags & (1 << 6)) || (flags & (1 << 7)))
228226
{
229-
// ignore overflowing values
230-
klog("ignoring overflowing value");
227+
offX = 0;
228+
offY = 0;
231229
}
232-
else
233-
{
234-
int16_t offX = (valX | ((flags & 0x10) ? 0xFF00 : 0));
235-
int16_t offY = (valY | ((flags & 0x20) ? 0xFF00 : 0));
236230

237-
if(registeredMouseCallback)
238-
registeredMouseCallback(offX, -offY, flags, scroll);
239-
}
231+
if(registeredMouseCallback)
232+
registeredMouseCallback(offX, -offY, flags, scroll);
240233
}
241234

242235
void ps2WaitForBuffer(ps2_buffer_t buffer)

kernel/inc/build_config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
// version
4949
#define G_VERSION_MAJOR 0
5050
#define G_VERSION_MINOR 23
51-
#define G_VERSION_PATCH 1
51+
#define G_VERSION_PATCH 2
5252

5353
#define G_LOADER_VERSION_MAJOR 1
5454
#define G_LOADER_VERSION_MINOR 1

0 commit comments

Comments
 (0)