feat: Symmetric Multiprocessing, text editor improvements, merge doom libc, implement math functions

This commit is contained in:
2026-03-23 20:09:11 +01:00
parent a805b06406
commit 63d9270613
46 changed files with 3004 additions and 2404 deletions
+13
View File
@@ -197,6 +197,19 @@ namespace Drivers::PS2::Mouse {
g_MaxY = maxY;
}
void FlushState() {
g_PacketIndex = 0;
// Drain any stale bytes from the PS/2 controller data port
constexpr uint16_t StatusPort = 0x64;
constexpr uint16_t DataPort_ = 0x60;
for (int i = 0; i < 32; i++) {
uint8_t status = Io::In8(StatusPort);
if (!(status & 0x01)) break; // output buffer empty
Io::In8(DataPort_); // discard byte
}
}
void InjectMouseReport(uint8_t buttons, int8_t deltaX, int8_t deltaY, int8_t scroll) {
g_StateLock.Acquire();
+5
View File
@@ -34,6 +34,11 @@ namespace Drivers::PS2::Mouse {
void SetBounds(int32_t maxX, int32_t maxY);
// Reset packet assembly state and drain pending PS/2 data.
// Call after boot to ensure clean mouse state regardless of
// any bytes lost during interrupt-heavy boot sequence.
void FlushState();
// Inject a mouse report from an external source (e.g., USB HID mouse)
void InjectMouseReport(uint8_t buttons, int8_t deltaX, int8_t deltaY, int8_t scroll);