Problems with 8 bpp

I’ve got a problem that I’ve been poking at for some time now with no
joy. I’m trying to draw a filled circle, which works fine at all bit
depths except 8.

The method I use is:
create a surface like so:
the_circle = SDL_CreateRGBSurface( SDL_HWSURFACE | SDL_SRCCOLORKEY,
circle_radius * 2 + 1,
circle_radius * 2 + 1,
screen->format->BitsPerPixel,
screen->format->Rmask,
screen->format->Gmask,
screen->format->Bmask,
screen->format->Amask );

I get the colours to plot with:
bg = SDL_MapRGB(the_circle->format, 0x00, 0xFF, 0xFF);
add = SDL_MapRGB(the_circle->format, 0xFF, 0xFF, 0x00);

I lock the surface (if required) and plot the circle.
The code I use to plot points in 8 bpp is:
((Uint8 *)the_circle->pixels) + y * screen->pitch + x * bpp =
(Uint8)colour;

where x and y are the points to plot, bpp == 8, and colour is either
"bg" or “add” (this is from one of the video examples in the sdl docs
btw).

I unlock the the surface if it was locked.

I set the colorkey with:
SDL_SetColorKey( the_circle, SDL_SRCCOLORKEY, bg );

and blit the mongrel, but I get nothing (and not black, just nothing).

I tried using SDL_HWPALETTE in SDL_SetVideoMode().
I’ve tried setting up the colour palette with SDL_SetColors().
I’ve tried playing with different flags in both SDL_SetVideoMode() and
SDL_CreateRGBSurface().

All to no joy.

16, and 32 bit modes both work fine however.
(the flags I’m currently using with SDL_SetVideoMode() are
SDL_HWSURFACE | SDL_ANYFORMAT).

So does anyone have any bright ideas?

Thanks,
Julian.