Merge pull request #56 from CreeperMario/unrelated-fixes

Various small fixes
This commit is contained in:
James 2017-08-06 17:52:14 +01:00 committed by GitHub
commit dd73b95579
6 changed files with 44 additions and 4 deletions

View File

@ -11,4 +11,6 @@ target_link_libraries(triangle
defaultheap
gx2
gfd
proc_ui)
nsysnet
proc_ui
sysapp)

View File

@ -113,7 +113,7 @@ exit:
WHBLogPrintf("Exiting...");
GX2RDestroyBufferEx(&positionBuffer, 0);
GX2RDestroyBufferEx(&colourBuffer, 0);
//WHBUnmountSdCard(); !! freezes on unmount for unkown reason !!
WHBUnmountSdCard();
WHBGfxShutdown();
WHBProcShutdown();
return result;

View File

@ -70,7 +70,7 @@ static int __libwut_lock_close(int *lock)
static int __libwut_lock_acquire(int *lock)
{
OSMutex *mutex = (OSMutex *)lock;
OSMutex *mutex = (OSMutex *)*lock;
if (!lock || *lock == 0) {
return -1;
}
@ -81,7 +81,7 @@ static int __libwut_lock_acquire(int *lock)
static int __libwut_lock_release(int *lock)
{
OSMutex *mutex = (OSMutex *)lock;
OSMutex *mutex = (OSMutex *)*lock;
if (!lock || *lock == 0) {
return -1;
}

View File

@ -0,0 +1,21 @@
#pragma once
#include <wut.h>
/**
* \defgroup whb_log_cafe Cafe OS System Log Output
* \ingroup whb
* @{
*/
#ifdef __cplusplus
extern "C" {
#endif
BOOL
WHBLogCafeInit();
#ifdef __cplusplus
}
#endif
/** @} */

15
src/libwhb/src/log_cafe.c Normal file
View File

@ -0,0 +1,15 @@
#include <coreinit/debug.h>
#include <whb/log.h>
static void
cafeLogHandler(const char * msg)
{
OSReport("%s\n", msg);
}
BOOL
WHBLogCafeInit()
{
WHBAddLogHandler(cafeLogHandler);
return TRUE;
}

View File

@ -67,6 +67,8 @@ WHBUnmountSdCard()
return TRUE;
}
FSInitCmdBlock(&cmd);
result = FSUnmount(&sClient, &cmd, sMountPath, -1);
if (result < 0) {
WHBLogPrintf("%s: FSUnmount error %d", __FUNCTION__, result);