Add error handling to sceRtcGetDaysInMonth().

This commit is contained in:
Unknown W. Brackets 2012-11-22 19:19:37 -08:00
parent 21398bfcf8
commit 965eeaf9da
2 changed files with 6 additions and 1 deletions

View file

@ -23,6 +23,7 @@
enum
{
SCE_KERNEL_ERROR_OK = 0,
SCE_KERNEL_ERROR_INVALID_ARGUMENT = 0x800001ff,
SCE_KERNEL_ERROR_ERROR = 0x80020001,
SCE_KERNEL_ERROR_NOTIMP = 0x80020002,
SCE_KERNEL_ERROR_ILLEGAL_EXPCODE = 0x80020032,

View file

@ -24,6 +24,7 @@
#include "HLE.h"
#include "../MIPS/MIPS.h"
#include "sceKernel.h"
#include "sceRtc.h"
#include "../CoreTiming.h"
@ -87,9 +88,12 @@ u32 sceRtcGetDayOfWeek(u32 year, u32 month, u32 day)
u32 sceRtcGetDaysInMonth(u32 year, u32 month)
{
DEBUG_LOG(HLE,"sceRtcGetDaysInMonth()");
DEBUG_LOG(HLE,"sceRtcGetDaysInMonth(%d, %d)", year, month);
u32 numberOfDays;
if (year <= 0 || month <= 0 || month > 12)
return SCE_KERNEL_ERROR_INVALID_ARGUMENT;
switch (month)
{
case 4: