From e42bb51b42456f1f80bd58fe46a774086f8fcd08 Mon Sep 17 00:00:00 2001 From: Rinnegatamante Date: Thu, 5 Oct 2017 19:20:28 +0200 Subject: Named anonymous enums in psp2kern Named anonymous enums in psp2kern --- include/kernel/display.h | 48 +++++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'include/kernel/display.h') diff --git a/include/kernel/display.h b/include/kernel/display.h index c1236a6..abf0d2b 100644 --- a/include/kernel/display.h +++ b/include/kernel/display.h @@ -7,43 +7,45 @@ extern "C" { #endif -enum { - SCE_DISPLAY_ERROR_OK = 0, - SCE_DISPLAY_ERROR_INVALID_HEAD = 0x80290000, - SCE_DISPLAY_ERROR_INVALID_VALUE = 0x80290001, - SCE_DISPLAY_ERROR_INVALID_ADDR = 0x80290002, - SCE_DISPLAY_ERROR_INVALID_PIXELFORMAT = 0x80290003, - SCE_DISPLAY_ERROR_INVALID_PITCH = 0x80290004, - SCE_DISPLAY_ERROR_INVALID_RESOLUTION = 0x80290005, - SCE_DISPLAY_ERROR_INVALID_UPDATETIMING = 0x80290006, - SCE_DISPLAY_ERROR_NO_FRAME_BUFFER = 0x80290007, - SCE_DISPLAY_ERROR_NO_PIXEL_DATA = 0x80290008 -}; +typedef enum SceDisplayErrorCode { + SCE_DISPLAY_ERROR_OK = 0, + SCE_DISPLAY_ERROR_INVALID_HEAD = 0x80290000, + SCE_DISPLAY_ERROR_INVALID_VALUE = 0x80290001, + SCE_DISPLAY_ERROR_INVALID_ADDR = 0x80290002, + SCE_DISPLAY_ERROR_INVALID_PIXELFORMAT = 0x80290003, + SCE_DISPLAY_ERROR_INVALID_PITCH = 0x80290004, + SCE_DISPLAY_ERROR_INVALID_RESOLUTION = 0x80290005, + SCE_DISPLAY_ERROR_INVALID_UPDATETIMING = 0x80290006, + SCE_DISPLAY_ERROR_NO_FRAME_BUFFER = 0x80290007, + SCE_DISPLAY_ERROR_NO_PIXEL_DATA = 0x80290008 +} SceDisplayErrorCode; -#define SCE_DISPLAY_PIXELFORMAT_A8B8G8R8 0x00000000U +typedef enum SceDisplayPixelFormat { + SCE_DISPLAY_PIXELFORMAT_A8B8G8R8 = 0x00000000U +} SceDisplayPixelFormat; -enum { +typedef enum SceDisplaySetBufSync { /** Buffer change effective immediately */ SCE_DISPLAY_SETBUF_IMMEDIATE = 0, /** Buffer change effective next frame */ SCE_DISPLAY_SETBUF_NEXTFRAME = 1 -}; +} SceDisplaySetBufSync; /** - * Structure used with sceDisplaySetFrameBuf to set/update framebuffer. + * Structure used with ::sceDisplaySetFrameBuf to set/update framebuffer. * Original screen resolution is 960x544, but the following resolutions * can also be supplied as width and height : * 480x272, 640x368, 720x408 * - * @note - This structure is returned by sceDisplayGetFrameBuf + * @note - This structure is returned by ::sceDisplayGetFrameBuf */ typedef struct SceDisplayFrameBuf { - SceSize size; //!< sizeof(SceDisplayFrameBuf) - void *base; //!< Pointer to framebuffer - unsigned int pitch; //!< pitch pixels - unsigned int pixelformat; //!< use SCE_DISPLAY_PIXELFORMAT_A8B8G8R8 - unsigned int width; //!< framebuffer width - unsigned int height; //!< framebuffer height + SceSize size; //!< sizeof(SceDisplayFrameBuf) + void *base; //!< Pointer to framebuffer + unsigned int pitch; //!< pitch pixels + unsigned int pixelformat; //!< pixel format (one of ::SceDisplayPixelFormat) + unsigned int width; //!< framebuffer width + unsigned int height; //!< framebuffer height } SceDisplayFrameBuf; /** -- cgit v1.2.3