riscos: Use a macro to represent sprite modes SDL-1.2
authorCameron Cawley <ccawley2011@gmail.com>
Tue, 18 Jun 2019 23:31:40 +0100
branchSDL-1.2
changeset 1291487d60cae0273
parent 12913 d07b4feae69c
riscos: Use a macro to represent sprite modes
src/video/riscos/SDL_riscosvideo.c
     1.1 --- a/src/video/riscos/SDL_riscosvideo.c	Tue Jun 18 23:55:01 2019 +0100
     1.2 +++ b/src/video/riscos/SDL_riscosvideo.c	Tue Jun 18 23:31:40 2019 +0100
     1.3 @@ -60,22 +60,27 @@
     1.4  static void RISCOS_UnlockHWSurface(_THIS, SDL_Surface *surface);
     1.5  static void RISCOS_FreeHWSurface(_THIS, SDL_Surface *surface);
     1.6  
     1.7 +#define MODE_350(type, xdpi, ydpi) \
     1.8 +	(1 | (xdpi << 1) | (ydpi << 13) | (type << 27))
     1.9 +#define MODE_521(type, xeig, yeig, flags) \
    1.10 +	(0x78000001 | (xeig << 4) | (yeig << 6) | (flags & 0xFF00) | (type << 20))
    1.11 +
    1.12  /* Table of known pixel formats */
    1.13  const RISCOS_SDL_PixelFormat *RISCOS_SDL_PixelFormats = (const RISCOS_SDL_PixelFormat[]) {
    1.14  /* 8bpp palettized */
    1.15 -{ { 255,   0x0080, 3,         28 }, 8, 0, 0, 0 },
    1.16 +{ { 255,   0x0080, 3,                      28 }, 8, 0, 0, 0 },
    1.17  /* 12bpp true colour */
    1.18 -{ { 4095,  0x0000, 4, 0x79004051 }, 12, 0x0f,     0x0f<<4, 0x0f<<8  },
    1.19 -{ { 4095,  0x4000, 4, 0x79004051 }, 12, 0x0f<<8,  0x0f<<4, 0x0f     },
    1.20 +{ { 4095,  0x0000, 4, MODE_521(16,1,1,0)      }, 12, 0x0f,     0x0f<<4, 0x0f<<8  },
    1.21 +{ { 4095,  0x4000, 4, MODE_521(16,1,1,0x4000) }, 12, 0x0f<<8,  0x0f<<4, 0x0f     },
    1.22  /* 15bpp true colour */
    1.23 -{ { 65535, 0x0000, 4, 0x28168003 }, 15, 0x1f,     0x1f<<5, 0x1f<<10 },
    1.24 -{ { 65535, 0x4000, 4, 0x78504051 }, 15, 0x1f<<10, 0x1f<<5, 0x1f     },
    1.25 +{ { 65535, 0x0000, 4, MODE_350(5,90,90)       }, 15, 0x1f,     0x1f<<5, 0x1f<<10 },
    1.26 +{ { 65535, 0x4000, 4, MODE_521(5,1,1,0x4000)  }, 15, 0x1f<<10, 0x1f<<5, 0x1f     },
    1.27  /* 16bpp true colour */
    1.28 -{ { 65535, 0x0080, 4, 0x50168003 }, 16, 0x1f,     0x3f<<5, 0x1f<<11 },
    1.29 -{ { 65535, 0x4080, 4, 0x78A04051 }, 16, 0x1f<<11, 0x3f<<5, 0x1f     },
    1.30 +{ { 65535, 0x0080, 4, MODE_350(10,90,90)      }, 16, 0x1f,     0x3f<<5, 0x1f<<11 },
    1.31 +{ { 65535, 0x4080, 4, MODE_521(10,1,1,0x4000) }, 16, 0x1f<<11, 0x3f<<5, 0x1f     },
    1.32  /* 32bpp true colour */
    1.33 -{ { -1,    0x0000, 5, 0x30168003 }, 32, 0xff,     0xff<<8, 0xff<<16 },
    1.34 -{ { -1,    0x4000, 5, 0x78604051 }, 32, 0xff<<16, 0xff<<8, 0xff     },
    1.35 +{ { -1,    0x0000, 5, MODE_350(6,90,90)       }, 32, 0xff,     0xff<<8, 0xff<<16 },
    1.36 +{ { -1,    0x4000, 5, MODE_521(6,1,1,0x4000)  }, 32, 0xff<<16, 0xff<<8, 0xff     },
    1.37  /* Terminator */
    1.38  { },
    1.39  };