Skip to content

Commit

Permalink
Implemented RISC OS and OS/2 desktop resolution code (thanks to Alan …
Browse files Browse the repository at this point in the history
…and Doodle)
  • Loading branch information
slouken committed Mar 18, 2006
1 parent a7f2e93 commit 15f8ee0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/video/os2fslib/SDL_os2fslib.c
Expand Up @@ -2725,8 +2725,8 @@ static int os2fslib_VideoInit(_THIS, SDL_PixelFormat *vformat)
}

/* Determine the current screen size */
_this->info.current_w = 0; // FIXME!
_this->info.current_h = 0; // FIXME!
_this->info.current_w = pDesktopMode->uiXResolution;
_this->info.current_h = pDesktopMode->uiYResolution;

/* Determine the screen depth */
vformat->BitsPerPixel = pDesktopMode->uiBPP;
Expand Down
17 changes: 11 additions & 6 deletions src/video/riscos/SDL_riscosvideo.c
Expand Up @@ -162,22 +162,27 @@ VideoBootStrap RISCOS_bootstrap = {
int RISCOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
{
_kernel_swi_regs regs;
int vars[4], vals[3];

if (RISCOS_InitTask() == 0)
{
SDL_SetError("Unable to start task");
return 0;
}

regs.r[0] = -1; /* Current mode */
regs.r[1] = 9; /* Log base 2 bpp */
vars[0] = 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);
vformat->BitsPerPixel = (1 << regs.r[2]);
_kernel_swi(OS_ReadVduVariables, &regs, &regs);
vformat->BitsPerPixel = (1 << vals[0]);

/* Determine the current screen size */
this->info.current_w = 0; /* FIXME! */
this->info.current_h = 0; /* FIXME! */
this->info.current_w = vals[1] + 1;
this->info.current_h = vals[2] + 1;

/* Minimum bpp for SDL is 8 */
if (vformat->BitsPerPixel < 8) vformat->BitsPerPixel = 8;
Expand Down

0 comments on commit 15f8ee0

Please sign in to comment.