From 67cfaa568dfa1598c7985711e8f80824ce39f40c Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Sun, 30 Apr 2017 14:40:53 -0400 Subject: [PATCH] Add OSScreenPutPixelEx function OSScreenPutPixelEx will draw a pixel of a certain color to the specified coordinates. This just writes the input u32 to the target location in the framebuffer, nothing is done with the data already stored in the framebuffer. --- fs_functions.c | 2 +- fs_functions.h | 2 +- os_functions.c | 4 +++- os_functions.h | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fs_functions.c b/fs_functions.c index 232cd99..e7fcfa2 100644 --- a/fs_functions.c +++ b/fs_functions.c @@ -31,7 +31,7 @@ EXPORT_DECL(s32, FSDelClient, void *pClient); EXPORT_DECL(void, FSInitCmdBlock, void *pCmd); EXPORT_DECL(s32, FSGetMountSource, void *pClient, void *pCmd, s32 type, void *source, s32 errHandling); -EXPORT_DECL(s32, FSMount, void *pClient, void *pCmd, void *source, char *target, uint32_t bytes, s32 errHandling); +EXPORT_DECL(s32, FSMount, void *pClient, void *pCmd, void *source, char *target, u32 bytes, s32 errHandling); EXPORT_DECL(s32, FSUnmount, void *pClient, void *pCmd, const char *target, s32 errHandling); EXPORT_DECL(s32, FSGetStat, void *pClient, void *pCmd, const char *path, FSStat *stats, s32 errHandling); diff --git a/fs_functions.h b/fs_functions.h index 2b245df..9cd7824 100644 --- a/fs_functions.h +++ b/fs_functions.h @@ -40,7 +40,7 @@ extern s32 (* FSDelClient)(void *pClient); extern void (* FSInitCmdBlock)(void *pCmd); extern s32 (* FSGetMountSource)(void *pClient, void *pCmd, s32 type, void *source, s32 errHandling); -extern s32 (* FSMount)(void *pClient, void *pCmd, void *source, char *target, uint32_t bytes, s32 errHandling); +extern s32 (* FSMount)(void *pClient, void *pCmd, void *source, char *target, u32 bytes, s32 errHandling); extern s32 (* FSUnmount)(void *pClient, void *pCmd, const char *target, s32 errHandling); extern s32 (* FSRename)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error); extern s32 (* FSRenameAsync)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error, void *asyncParams); diff --git a/os_functions.c b/os_functions.c index b8efa78..6c2c9d9 100644 --- a/os_functions.c +++ b/os_functions.c @@ -83,6 +83,7 @@ EXPORT_DECL(s32, OSScreenClearBufferEx, u32 bufferNum, u32 temp); EXPORT_DECL(s32, OSScreenFlipBuffersEx, u32 bufferNum); EXPORT_DECL(s32, OSScreenPutFontEx, u32 bufferNum, u32 posX, u32 posY, const char * buffer); EXPORT_DECL(s32, OSScreenEnableEx, u32 bufferNum, s32 enable); +EXPORT_DECL(u32, OSScreenPutPixelEx, u32 bufferNum, u32 posX, u32 posY, u32 color); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! Memory functions @@ -127,7 +128,7 @@ EXPORT_DECL(void, addr_PrepareTitle_hook, void); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! Other function addresses //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -EXPORT_DECL(void, DCInvalidateRange, void *buffer, uint32_t length); +EXPORT_DECL(void, DCInvalidateRange, void *buffer, u32 length); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! Energy Saver functions @@ -226,6 +227,7 @@ void InitOSFunctionPointers(void) OS_FIND_EXPORT(coreinit_handle, OSScreenFlipBuffersEx); OS_FIND_EXPORT(coreinit_handle, OSScreenPutFontEx); OS_FIND_EXPORT(coreinit_handle, OSScreenEnableEx); + OS_FIND_EXPORT(coreinit_handle, OSScreenPutPixelEx); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! Thread functions //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/os_functions.h b/os_functions.h index 289d602..8e1d6c1 100644 --- a/os_functions.h +++ b/os_functions.h @@ -119,6 +119,7 @@ extern s32 (*OSScreenClearBufferEx)(u32 bufferNum, u32 temp); extern s32 (*OSScreenFlipBuffersEx)(u32 bufferNum); extern s32 (*OSScreenPutFontEx)(u32 bufferNum, u32 posX, u32 posY, const char * buffer); extern s32 (*OSScreenEnableEx)(u32 bufferNum, s32 enable); +extern u32 (*OSScreenPutPixelEx)(u32 bufferNum, u32 posX, u32 posY, u32 color); typedef unsigned char (*exception_callback)(void * interruptedContext); extern void (* OSSetExceptionCallback)(u8 exceptionType, exception_callback newCallback); @@ -166,7 +167,7 @@ extern void (* addr_PrepareTitle_hook)(void); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! Other function addresses //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -extern void (*DCInvalidateRange)(void *buffer, uint32_t length); +extern void (*DCInvalidateRange)(void *buffer, u32 length); //!---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- //! Energy Saver functions