Commit 04df7fef authored by Sam Lantinga's avatar Sam Lantinga

Implemented RISC OS and OS/2 desktop resolution code (thanks to Alan and Doodle)

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401553
parent d6d98ddc
...@@ -2725,8 +2725,8 @@ static int os2fslib_VideoInit(_THIS, SDL_PixelFormat *vformat) ...@@ -2725,8 +2725,8 @@ static int os2fslib_VideoInit(_THIS, SDL_PixelFormat *vformat)
} }
/* Determine the current screen size */ /* Determine the current screen size */
_this->info.current_w = 0; // FIXME! _this->info.current_w = pDesktopMode->uiXResolution;
_this->info.current_h = 0; // FIXME! _this->info.current_h = pDesktopMode->uiYResolution;
/* Determine the screen depth */ /* Determine the screen depth */
vformat->BitsPerPixel = pDesktopMode->uiBPP; vformat->BitsPerPixel = pDesktopMode->uiBPP;
......
...@@ -162,6 +162,7 @@ VideoBootStrap RISCOS_bootstrap = { ...@@ -162,6 +162,7 @@ VideoBootStrap RISCOS_bootstrap = {
int RISCOS_VideoInit(_THIS, SDL_PixelFormat *vformat) int RISCOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
{ {
_kernel_swi_regs regs; _kernel_swi_regs regs;
int vars[4], vals[3];
if (RISCOS_InitTask() == 0) if (RISCOS_InitTask() == 0)
{ {
...@@ -169,15 +170,19 @@ int RISCOS_VideoInit(_THIS, SDL_PixelFormat *vformat) ...@@ -169,15 +170,19 @@ int RISCOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
return 0; return 0;
} }
regs.r[0] = -1; /* Current mode */ vars[0] = 9; /* Log base 2 bpp */
regs.r[1] = 9; /* Log base 2 bpp */ vars[1] = 11; /* XWndLimit - num x pixels -1 */
vars[2] = 12; /* YWndLimit - num y pixels -1 */
vars[3] = -1; /* Terminate list */
regs.r[0] = (int)vars;
regs.r[1] = (int)vals;
_kernel_swi(OS_ReadModeVariable, &regs, &regs); _kernel_swi(OS_ReadVduVariables, &regs, &regs);
vformat->BitsPerPixel = (1 << regs.r[2]); vformat->BitsPerPixel = (1 << vals[0]);
/* Determine the current screen size */ /* Determine the current screen size */
this->info.current_w = 0; /* FIXME! */ this->info.current_w = vals[1] + 1;
this->info.current_h = 0; /* FIXME! */ this->info.current_h = vals[2] + 1;
/* Minimum bpp for SDL is 8 */ /* Minimum bpp for SDL is 8 */
if (vformat->BitsPerPixel < 8) vformat->BitsPerPixel = 8; if (vformat->BitsPerPixel < 8) vformat->BitsPerPixel = 8;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment