mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
SDに出力するResult用マクロの整理 git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@3 385bec56-5757-e545-9c3a-d8741f4650f1
81 lines
2.5 KiB
C++
81 lines
2.5 KiB
C++
/*---------------------------------------------------------------------------*
|
|
Project: Horizon
|
|
File: CommonLogger.h
|
|
|
|
Copyright 2009 Nintendo. All rights reserved.
|
|
|
|
These coded instructions, statements, and computer programs contain
|
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
|
Company Ltd., and are protected by Federal copyright law. They may
|
|
not be disclosed to third parties or copied or duplicated in any form,
|
|
in whole or in part, without the prior written consent of Nintendo.
|
|
|
|
$Rev$
|
|
*---------------------------------------------------------------------------*/
|
|
|
|
#ifndef COMMONLOGGER_H_
|
|
#define COMMONLOGGER_H_
|
|
|
|
#include <nn.h>
|
|
#include "demo.h"
|
|
|
|
#include "SdLogger.h"
|
|
#include "LogConsole.h"
|
|
|
|
#define COMMON_LOGGER( ... ) (void)common::Logger::GetLoggerInstance()->Print(__VA_ARGS__)
|
|
#define COMMON_LOGGER_RESULT(result) \
|
|
(void)nn::dbg::PrintResult(result); \
|
|
(void)common::Logger::GetLoggerInstance()->PrintResult("Result = %X\n", result.GetPrintableBits()); \
|
|
|
|
#define COMMON_LOGGER_RESULT_WITH_LINE(result, line) \
|
|
(void)nn::dbg::PrintResult(result); \
|
|
(void)common::Logger::GetLoggerInstance()->PrintResult("line = %d\n", line); \
|
|
(void)common::Logger::GetLoggerInstance()->PrintResult("Result = %X\n", result.GetPrintableBits()); \
|
|
|
|
#define COMMON_LOGGER_RESULT_IF_FAILED(result) \
|
|
if(result.IsFailure()) \
|
|
{ \
|
|
COMMON_LOGGER_RESULT(result); \
|
|
} \
|
|
|
|
#define COMMON_LOGGER_RESULT_IF_FAILED_WITH_LINE(result) \
|
|
if(result.IsFailure()) \
|
|
{ \
|
|
COMMON_LOGGER_RESULT_WITH_LINE(result, __LINE__); \
|
|
} \
|
|
|
|
namespace common
|
|
{
|
|
|
|
namespace Logger
|
|
{
|
|
|
|
class CommonLogger
|
|
{
|
|
public:
|
|
CommonLogger();
|
|
~CommonLogger();
|
|
|
|
void Initialize(u32 width, u32 height, u32 maxLine, demo::RenderSystemDrawing* renderSystem);
|
|
void Finalize();
|
|
|
|
void Print(const char* fmt, ...);
|
|
void PrintResult(const char* fmt, ...);
|
|
void PrintResultIfFailed(nn::Result result, u32 line = 0);
|
|
void ScrollUp();
|
|
void ScrollDown();
|
|
void ScrollToBegin();
|
|
void ScrollToEnd();
|
|
void DrawConsole();
|
|
private:
|
|
nn::os::CriticalSection m_CriticalSection;
|
|
};
|
|
|
|
CommonLogger* GetLoggerInstance();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif /* COMMONLOGGER_H_ */
|