Skip to content

Commit

Permalink
atari:xbios: Call NOVA routines in supervisor mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pmandin committed Dec 3, 2017
1 parent 4bb80eb commit 4ddd306
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/video/xbios/SDL_xbios_nova.c
Expand Up @@ -257,10 +257,14 @@ static int setColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors)

static void NOVA_SetMode(_THIS, int num_mode)
{
void *oldstack;

if ((num_mode<0) || (num_mode>=NOVA_modecount)) {
return;
}

oldstack = (void *)Super(NULL);

__asm__ __volatile__ (
"moveql #0,d0\n\t"
"movel %0,a0\n\t"
Expand All @@ -272,10 +276,16 @@ static void NOVA_SetMode(_THIS, int num_mode)
: /* clobbered registers */
"d0", "d1", "d2", "a0", "a1", "cc", "memory"
);

SuperToUser(oldstack);
}

static void NOVA_SetScreen(_THIS, void *screen)
{
void *oldstack;

oldstack = (void *)Super(NULL);

__asm__ __volatile__ (
"movel %0,a0\n\t"
"movel %1,a1\n\t"
Expand All @@ -286,16 +296,21 @@ static void NOVA_SetScreen(_THIS, void *screen)
: /* clobbered registers */
"d0", "d1", "d2", "a0", "a1", "cc", "memory"
);

SuperToUser(oldstack);
}

static void NOVA_SetColor(_THIS, int index, int r, int g, int b)
{
Uint8 color[3];
void *oldstack;

color[0] = r;
color[1] = g;
color[2] = b;

oldstack = (void *)Super(NULL);

__asm__ __volatile__ (
"movel %0,d0\n\t"
"movel %1,a0\n\t"
Expand All @@ -307,6 +322,8 @@ static void NOVA_SetColor(_THIS, int index, int r, int g, int b)
: /* clobbered registers */
"d0", "d1", "d2", "a0", "a1", "cc", "memory"
);

SuperToUser(oldstack);
}

static nova_resolution_t *NOVA_LoadModes(int *num_modes)
Expand Down

0 comments on commit 4ddd306

Please sign in to comment.