SDL-1.2: atari:video:xbios: two small bugfixes

From 7123e53291e76cd953a9182a76ce79a4e992e485 Mon Sep 17 00:00:00 2001
From: Miro Kropacek <[EMAIL REDACTED]>
Date: Tue, 12 Dec 2023 23:18:53 +0100
Subject: [PATCH] atari:video:xbios: two small bugfixes

- allow device->UpdateRects to be replaced even in SDL_XBIOS_VideoInit_ST (not used atm)

- report correct amount of free video ram (in kbytes, not bytes) but its value is questionable as it is the *current* amount (after screen allocations), not *total*
---
 src/video/xbios/SDL_xbios.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/video/xbios/SDL_xbios.c b/src/video/xbios/SDL_xbios.c
index aa2c2a7f..ef91c963 100644
--- a/src/video/xbios/SDL_xbios.c
+++ b/src/video/xbios/SDL_xbios.c
@@ -204,12 +204,13 @@ static SDL_VideoDevice *XBIOS_CreateDevice(int devindex)
 
 	device->free = XBIOS_DeleteDevice;
 
+	device->hidden->updRects = XBIOS_UpdateRects;
+
 	/* Setup device specific functions, default to ST for everything */
 	if (Getcookie(C__VDO, &cookie_cvdo) != C_FOUND) {
 		cookie_cvdo = VDO_ST << 16;
 	}
 	SDL_XBIOS_VideoInit_ST(device, cookie_cvdo);
-	device->hidden->updRects = XBIOS_UpdateRects;
 
 	switch (cookie_cvdo>>16) {
 		case VDO_ST:
@@ -292,6 +293,7 @@ void SDL_XBIOS_AddMode(_THIS, int actually_add, const xbiosmode_t *modeinfo)
 	}
 }
 
+/* Called after XBIOS_CreateDevice, and SDL_XBIOS_VideoInit_ST (and its follow-ups) */
 static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
 {
 	int i;
@@ -368,7 +370,7 @@ static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
 
 	/* Update hardware info */
 	this->info.hw_available = 1;
-	this->info.video_mem = (Uint32) Atari_SysMalloc(-1L, MX_STRAM);
+	this->info.video_mem = (Uint32) Atari_SysMalloc(-1L, MX_STRAM) / 1024;
 
 	/* Init chunky to planar routine */
 	SDL_Atari_C2pConvert = SDL_Atari_C2pConvert8;