Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/revolution/SO/SOCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ typedef enum {

typedef enum {
SO_SO_REUSEADDR = 0x0004,
SO_SO_SNDBUF = 0x1002,
SO_SO_RCVBUF = 0x1003,
SO_SO_SNDBUF = 0x1001,
SO_SO_RCVBUF = 0x1002,
} SOSockOpt;

typedef enum { SO_SHUT_RD, SO_SHUT_WR, SO_SHUT_RDWR } SOShutdownType;
Expand Down
4 changes: 2 additions & 2 deletions lib/libkiwi/core/kiwiJSON.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void Reader::DecodeImpl() {
ParseEncoding(pos);
}

// TODO: Implement UTF-16 parsing
// TODO(kiwi) Implement UTF-16 parsing
K_ASSERT_EX(mEncoding == EEncoding_UTF8,
"UTF-16 encoding is not yet supported");

Expand Down Expand Up @@ -1231,7 +1231,7 @@ void PrintVisitor::Visit(const Element& rElement) {
it != rElement.Get<Object>().End(); ++it, i++) {
Print('\"' + (it->key + "\": "));

// TODO: Fix this somehow?
// TODO(kiwi) Fix this somehow?
Visit(it->value);

// Values are comma separated
Expand Down
2 changes: 1 addition & 1 deletion lib/libkiwi/core/kiwiJSON.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class Element {
K_ASSERT(mType == EType_Object);
const Element* pElement = Get<Object>().Find(rKey);

// TODO: Better way to return a dummy element?
// TODO(kiwi) Better way to return a dummy element?
if (pElement == nullptr) {
static const Element undefined;
return undefined;
Expand Down
2 changes: 1 addition & 1 deletion lib/libkiwi/core/kiwiJSONImpl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ template <> K_INLINE void Element::Set<Object>(const Object& rValue) {
/**@{*/
template <> K_INLINE Null_t& Element::Get<Null_t>() {
K_ASSERT(mType == EType_Null);
// TODO: Better way to solve this problem?
// TODO(kiwi) Better way to solve this problem?
return const_cast<Null_t&>(json::null);
}
template <> K_INLINE const Null_t& Element::Get<Null_t>() const {
Expand Down
2 changes: 1 addition & 1 deletion lib/libkiwi/core/kiwiMemoryMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class MemoryMgr : public StaticSingleton<MemoryMgr> {
EGG::Heap* GetHeap(EMemory memory) const;

private:
// TODO: How to get more MEM1 memory from WS2?
// TODO(kiwi) How to get more MEM1 memory from WS2?
#if defined(PACK_SPORTS) || defined(PACK_PLAY)
//! Initial size for each heap
static const u32 HEAP_SIZE = OS_MEM_KB_TO_B(1024);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <libkiwi/prim/kiwiBitCast.h>

#include <libkiwi.h>

namespace kiwi {
Expand All @@ -8,37 +6,38 @@ namespace detail {
/**
* @brief Constructor
*/
ThreadImpl::ThreadImpl() : mpOSThread(nullptr), mpThreadStack(nullptr) {
StdThreadImpl::StdThreadImpl() : mpOSThread(nullptr), mpThreadStack(nullptr) {
// Thread & stack aligned to 32
mpOSThread = new (32) OSThread();
K_ASSERT_PTR(mpOSThread);
mpThreadStack = new (32) u8[scStackSize];
K_ASSERT_PTR(mpThreadStack);

BOOL success =
OSCreateThread(mpOSThread, nullptr, nullptr,
mpThreadStack + scStackSize, scStackSize, scPriority, 0);
BOOL success = OSCreateThread(mpOSThread, nullptr, nullptr,
mpThreadStack + scStackSize, scStackSize,
OS_PRIORITY_MAX - 1, 0);

K_ASSERT(success);
}

/**
* @brief Destructor
*/
ThreadImpl::~ThreadImpl() {
StdThreadImpl::~StdThreadImpl() {
K_ASSERT_PTR(mpOSThread);
K_ASSERT_EX(*mpOSThread->stackEnd == OS_THREAD_STACK_MAGIC,
"Thread stack overflow!!!");

OSDetachThread(mpOSThread);

delete mpOSThread;
delete mpThreadStack;
delete[] mpThreadStack;
}

/**
* @brief Begins execution on this thread
*/
void ThreadImpl::Start() {
void StdThreadImpl::Start() {
K_ASSERT_PTR(mpOSThread);
K_ASSERT(mpOSThread->state == OS_THREAD_STATE_READY);
K_ASSERT_EX(mpOSThread->context.srr0 != 0, "No function to call");
Expand All @@ -51,7 +50,7 @@ void ThreadImpl::Start() {
/**
* @brief Waits for this thread to finish executing
*/
void ThreadImpl::Join() {
void StdThreadImpl::Join() {
K_ASSERT_PTR(mpOSThread);

BOOL success = OSJoinThread(mpOSThread, nullptr);
Expand All @@ -63,7 +62,7 @@ void ThreadImpl::Join() {
*
* @param addr Function address (new SRR0 value)
*/
void ThreadImpl::SetFunction(const void* addr) {
void StdThreadImpl::SetFunction(const void* addr) {
K_ASSERT_PTR(mpOSThread);
K_ASSERT(addr != 0);
mpOSThread->context.srr0 = BitCast<u32>(addr);
Expand All @@ -75,7 +74,7 @@ void ThreadImpl::SetFunction(const void* addr) {
* @param i GPR number
* @param value New value
*/
void ThreadImpl::SetGPR(u32 idx, u32 value) {
void StdThreadImpl::SetGPR(u32 idx, u32 value) {
K_ASSERT_PTR(mpOSThread);
K_ASSERT(idx >= 0 && idx < K_LENGTHOF(mpOSThread->context.gprs));
mpOSThread->context.gprs[idx] = value;
Expand Down
27 changes: 14 additions & 13 deletions lib/libkiwi/core/kiwiThread.h → lib/libkiwi/core/kiwiStdThread.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LIBKIWI_CORE_THREAD_H
#define LIBKIWI_CORE_THREAD_H
#ifndef LIBKIWI_CORE_STD_THREAD_H
#define LIBKIWI_CORE_STD_THREAD_H
#include <libkiwi/debug/kiwiAssert.h>
#include <libkiwi/k_types.h>

Expand All @@ -16,7 +16,7 @@ namespace detail {
/**
* @brief Common thread implementation
*/
class ThreadImpl {
class StdThreadImpl {
public:
/**
* @brief Waits for this thread to finish executing
Expand All @@ -27,11 +27,11 @@ class ThreadImpl {
/**
* @brief Constructor
*/
ThreadImpl();
StdThreadImpl();
/**
* @brief Destructor
*/
~ThreadImpl();
~StdThreadImpl();

/**
* @brief Begins execution on this thread
Expand Down Expand Up @@ -77,7 +77,7 @@ class ThreadImpl {
* @details Similar to std::thread.
* @note Only allows GPR arguments
*/
class Thread : public detail::ThreadImpl {
class StdThread : public detail::StdThreadImpl {
public:
// Thread function parameter
typedef void* Param;
Expand All @@ -92,14 +92,14 @@ class Thread : public detail::ThreadImpl {
*
* @param pFunc Static, no-parameter function
*/
template <typename TRet> Thread(TRet (*pFunc)());
template <typename TRet> StdThread(TRet (*pFunc)());
/**
* @brief Constructor
*
* @param pFunc Static, single-parameter function
* @param pArg Function argument
*/
template <typename TRet> Thread(TRet (*pFunc)(Param), Param pArg);
template <typename TRet> StdThread(TRet (*pFunc)(Param), Param pArg);
/**@}*/

/**
Expand All @@ -113,7 +113,7 @@ class Thread : public detail::ThreadImpl {
* @param rObj Class instance
*/
template <typename TRet, typename TClass>
Thread(TRet (TClass::*pFunc)(), TClass& rObj);
StdThread(TRet (TClass::*pFunc)(), TClass& rObj);
/**
* @brief Constructor
*
Expand All @@ -122,7 +122,7 @@ class Thread : public detail::ThreadImpl {
* @param pArg Function argument
*/
template <typename TRet, typename TClass>
Thread(TRet (TClass::*pFunc)(Param), TClass& rObj, Param pArg);
StdThread(TRet (TClass::*pFunc)(Param), TClass& rObj, Param pArg);
/**@}*/

/**
Expand All @@ -136,7 +136,7 @@ class Thread : public detail::ThreadImpl {
* @param rObj Class instance
*/
template <typename TRet, typename TClass>
Thread(TRet (TClass::*pFunc)() const, const TClass& rObj);
StdThread(TRet (TClass::*pFunc)() const, const TClass& rObj);
/**
* @brief Constructor
*
Expand All @@ -145,7 +145,8 @@ class Thread : public detail::ThreadImpl {
* @param pArg Function argument
*/
template <typename TRet, typename TClass>
Thread(TRet (TClass::*pFunc)(Param) const, const TClass& rObj, Param pArg);
StdThread(TRet (TClass::*pFunc)(Param) const, const TClass& rObj,
Param pArg);
/**@}*/
};

Expand All @@ -154,7 +155,7 @@ class Thread : public detail::ThreadImpl {

// Implementation header
#ifndef LIBKIWI_CORE_THREAD_IMPL_HPP
#include <libkiwi/core/kiwiThreadImpl.hpp>
#include <libkiwi/core/kiwiStdThreadImpl.hpp>
#endif

#endif
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// Implementation header
#ifndef LIBKIWI_CORE_THREAD_IMPL_HPP
#define LIBKIWI_CORE_THREAD_IMPL_HPP
#ifndef LIBKIWI_CORE_STD_THREAD_IMPL_HPP
#define LIBKIWI_CORE_STD_THREAD_IMPL_HPP

// Declaration header
#ifndef LIBKIWI_CORE_THREAD_H
#include <libkiwi/core/kiwiThread.h>
#ifndef LIBKIWI_CORE_STD_THREAD_H
#include <libkiwi/core/kiwiStdThread.h>
#endif

#include <libkiwi/prim/kiwiBitCast.h>
Expand All @@ -22,7 +22,7 @@ namespace kiwi {
*
* @param pFunc Static, no-parameter function
*/
template <typename TRet> Thread::Thread(TRet (*pFunc)()) {
template <typename TRet> StdThread::StdThread(TRet (*pFunc)()) {
K_ASSERT_PTR(pFunc);

SetFunction(pFunc);
Expand All @@ -36,7 +36,7 @@ template <typename TRet> Thread::Thread(TRet (*pFunc)()) {
* @param pArg Function argument
*/
template <typename TRet>
Thread::Thread(TRet (*pFunc)(Thread::Param), Thread::Param pArg) {
StdThread::StdThread(TRet (*pFunc)(StdThread::Param), StdThread::Param pArg) {
K_ASSERT_PTR(pFunc);

SetFunction(pFunc);
Expand All @@ -56,7 +56,7 @@ Thread::Thread(TRet (*pFunc)(Thread::Param), Thread::Param pArg) {
* @param rObj Class instance
*/
template <typename TRet, typename TClass>
Thread::Thread(TRet (TClass::*pFunc)(), TClass& rObj) {
StdThread::StdThread(TRet (TClass::*pFunc)(), TClass& rObj) {
K_ASSERT(pFunc);

SetMemberFunction(pFunc, rObj);
Expand All @@ -71,8 +71,8 @@ Thread::Thread(TRet (TClass::*pFunc)(), TClass& rObj) {
* @param pArg Function argument
*/
template <typename TRet, typename TClass>
Thread::Thread(TRet (TClass::*pFunc)(Thread::Param), TClass& rObj,
Thread::Param pArg) {
StdThread::StdThread(TRet (TClass::*pFunc)(StdThread::Param), TClass& rObj,
StdThread::Param pArg) {
K_ASSERT(pFunc);

SetMemberFunction(pFunc, rObj);
Expand All @@ -92,7 +92,7 @@ Thread::Thread(TRet (TClass::*pFunc)(Thread::Param), TClass& rObj,
* @param rObj Class instance
*/
template <typename TRet, typename TClass>
Thread::Thread(TRet (TClass::*pFunc)() const, const TClass& rObj) {
StdThread::StdThread(TRet (TClass::*pFunc)() const, const TClass& rObj) {
K_ASSERT(pFunc);

SetMemberFunction(pFunc, rObj);
Expand All @@ -107,8 +107,8 @@ Thread::Thread(TRet (TClass::*pFunc)() const, const TClass& rObj) {
* @param pArg Function argument
*/
template <typename TRet, typename TClass>
Thread::Thread(TRet (TClass::*pFunc)(Thread::Param) const, const TClass& rObj,
Thread::Param pArg) {
StdThread::StdThread(TRet (TClass::*pFunc)(StdThread::Param) const,
const TClass& rObj, StdThread::Param pArg) {
K_ASSERT(pFunc);

SetMemberFunction(pFunc, rObj);
Expand Down Expand Up @@ -139,8 +139,8 @@ struct MemberFunction {
* @param rObj Class instance
*/
template <typename TFunc, typename TClass>
K_DONT_INLINE void ThreadImpl::SetMemberFunction(TFunc pFunc,
const TClass& rObj) {
K_DONT_INLINE void StdThreadImpl::SetMemberFunction(TFunc pFunc,
const TClass& rObj) {

K_STATIC_ASSERT_EX(sizeof(TFunc) == sizeof(MemberFunction),
"Not a member function");
Expand Down
2 changes: 1 addition & 1 deletion lib/libkiwi/debug/kiwiNw4rDirectPrint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void Nw4rDirectPrint::SetupXfb() {
// Initialize direct print
SetColor(Color::WHITE);

// TODO: WS2 framebuffer is 608x456. Why?
// TODO(kiwi) WS2 framebuffer is 608x456. Why?
#if defined(PACK_SPORTS) || defined(PACK_PLAY)
// Try to repurpose current framebuffer
void* pXfb = VIGetCurrentFrameBuffer();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef LIBKIWI_NET_EMU_RICH_PRESENCE_CLIENT_H
#define LIBKIWI_NET_EMU_RICH_PRESENCE_CLIENT_H
#ifndef LIBKIWI_FUN_EMU_RICH_PRESENCE_CLIENT_H
#define LIBKIWI_FUN_EMU_RICH_PRESENCE_CLIENT_H
#include <libkiwi/fun/kiwiIRichPresenceClient.h>
#include <libkiwi/k_types.h>
#include <libkiwi/net/kiwiIRichPresenceClient.h>
#include <libkiwi/util/kiwiIosDevice.h>

namespace kiwi {
//! @addtogroup libkiwi_net
//! @addtogroup libkiwi_fun
//! @{

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#ifndef LIBKIWI_NET_I_RICH_PRESENCE_CLIENT_H
#define LIBKIWI_NET_I_RICH_PRESENCE_CLIENT_H
#ifndef LIBKIWI_FUN_I_RICH_PRESENCE_CLIENT_H
#define LIBKIWI_FUN_I_RICH_PRESENCE_CLIENT_H
#include <libkiwi/k_types.h>
#include <libkiwi/prim/kiwiString.h>

namespace kiwi {
//! @addtogroup libkiwi_net
//! @addtogroup libkiwi_fun
//! @{

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace kiwi {
RichPresenceMgr::RichPresenceMgr()
: ISceneHook(-1), mpClient(nullptr), mpProfile(nullptr) {

// TODO: Only Dolphin Emulator is supported for now
// TODO(kiwi) Only Dolphin Emulator is supported for now
mpClient = new EmuRichPresenceClient();
K_ASSERT_PTR(mpClient);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LIBKIWI_NET_RICH_PRESENCE_MGR_H
#define LIBKIWI_NET_RICH_PRESENCE_MGR_H
#ifndef LIBKIWI_FUN_RICH_PRESENCE_MGR_H
#define LIBKIWI_FUN_RICH_PRESENCE_MGR_H
#include <libkiwi/core/kiwiSceneHookMgr.h>
#include <libkiwi/k_types.h>
#include <libkiwi/prim/kiwiString.h>
Expand All @@ -8,6 +8,8 @@
#include <revolution/OS.h>

namespace kiwi {
//! @addtogroup libkiwi_fun
//! @{

// Forward declarations
class IRichPresenceClient;
Expand Down Expand Up @@ -105,6 +107,7 @@ class RichPresenceMgr : public StaticSingleton<RichPresenceMgr>,
OSAlarm mAlarm;
};

//! @}
} // namespace kiwi

#endif
Loading
Loading