SDL: riscos: Ensure that last_mouse_buttons is initialised correctly

From 347659e8cf23648d0103a6e08343c12a41b46831 Mon Sep 17 00:00:00 2001
From: Cameron Cawley <[EMAIL REDACTED]>
Date: Wed, 25 May 2022 22:07:12 +0100
Subject: [PATCH] riscos: Ensure that last_mouse_buttons is initialised
 correctly

---
 src/video/riscos/SDL_riscosevents.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/video/riscos/SDL_riscosevents.c b/src/video/riscos/SDL_riscosevents.c
index b0a0d750915..56fe39882eb 100644
--- a/src/video/riscos/SDL_riscosevents.c
+++ b/src/video/riscos/SDL_riscosevents.c
@@ -143,6 +143,7 @@ int
 RISCOS_InitEvents(_THIS)
 {
     SDL_VideoData *driverdata = (SDL_VideoData *) _this->driverdata;
+    _kernel_swi_regs regs;
     int i, status;
 
     for (i = 0; i < RISCOS_MAX_KEYS_PRESSED; i++)
@@ -153,6 +154,9 @@ RISCOS_InitEvents(_THIS)
     SDL_ToggleModState(KMOD_CAPS,   (status & (1 << 4)) == 0);
     SDL_ToggleModState(KMOD_SCROLL, (status & (1 << 1)) != 0);
 
+    _kernel_swi(OS_Mouse, &regs, &regs);
+    driverdata->last_mouse_buttons = regs.r[2];
+
     /* Disable escape. */
     _kernel_osbyte(229, 1, 0);