Imejp: cellImeJpEnterChar (#2600)

This commit is contained in:
ikki84 2017-04-07 09:30:07 -03:00 committed by Ivan
parent 74e806810d
commit 27ea4285ef
4 changed files with 75 additions and 30 deletions

View file

@ -1,5 +1,6 @@
#include "stdafx.h" #include "stdafx.h"
#include "Emu/Cell/PPUModule.h" #include "Emu/Cell/PPUModule.h"
#include "cellImeJp.h"
logs::channel cellImeJp("cellImeJp", logs::level::notice); logs::channel cellImeJp("cellImeJp", logs::level::notice);
@ -15,21 +16,26 @@ enum
CELL_IMEJP_ERROR_OTHER = 0x8002bfff, CELL_IMEJP_ERROR_OTHER = 0x8002bfff,
}; };
static uint16_t s_ime_string[256];
s32 cellImeJpOpen() s32 cellImeJpOpen()
{ {
UNIMPLEMENTED_FUNC(cellImeJp); std::memset(s_ime_string, 0, sizeof(s_ime_string));
cellImeJp.error("cellImeJpOpen()");
return CELL_OK; return CELL_OK;
} }
s32 cellImeJpOpen2() s32 cellImeJpOpen2()
{ {
UNIMPLEMENTED_FUNC(cellImeJp); std::memset(s_ime_string, 0, sizeof(s_ime_string));
cellImeJp.error("cellImeJpOpen2()");
return CELL_OK; return CELL_OK;
} }
s32 cellImeJpOpen3() s32 cellImeJpOpen3()
{ {
UNIMPLEMENTED_FUNC(cellImeJp); std::memset(s_ime_string, 0, sizeof(s_ime_string));
cellImeJp.error("cellImeJpOpen3()");
return CELL_OK; return CELL_OK;
} }
@ -69,34 +75,37 @@ s32 cellImeJpReset()
return CELL_OK; return CELL_OK;
} }
s32 cellImeJpGetStatus() s32 cellImeJpGetStatus(CellImeJpHandle hImeJpHandle, vm::ptr<u16> pInputStatus)
{ {
UNIMPLEMENTED_FUNC(cellImeJp); cellImeJp.error("cellImeJpGetStatus()");
*pInputStatus = CELL_IMEJP_CANDIDATE_EMPTY;
return CELL_OK; return CELL_OK;
} }
s32 cellImeJpEnterChar() s32 cellImeJpEnterChar(CellImeJpHandle hImeJpHandle, u16 inputChar, vm::ptr<u16> pOutputStatus)
{ {
UNIMPLEMENTED_FUNC(cellImeJp); LOG_TODO(HLE, "cellImeJpEnterChar hImeJpHandle / inputChar / pOutputStatus (%d / 0x%x / %d)" HERE, hImeJpHandle, inputChar, pOutputStatus);
*s_ime_string = inputChar;
*pOutputStatus = CELL_IMEJP_RET_CONFIRMED;
return CELL_OK; return CELL_OK;
} }
s32 cellImeJpEnterCharExt() s32 cellImeJpEnterCharExt(CellImeJpHandle hImeJpHandle, u16 inputChar, vm::ptr<u16> pOutputStatus)
{ {
UNIMPLEMENTED_FUNC(cellImeJp); cellImeJp.todo("cellImeJpEnterCharExt()");
return CELL_OK; return cellImeJpEnterChar(hImeJpHandle, inputChar, pOutputStatus);
} }
s32 cellImeJpEnterString() s32 cellImeJpEnterString(CellImeJpHandle hImeJpHandle, u16 inputChar, vm::ptr<u16> pOutputStatus)
{ {
UNIMPLEMENTED_FUNC(cellImeJp); cellImeJp.todo("cellImeJpEnterString()");
return CELL_OK; return cellImeJpEnterChar(hImeJpHandle, inputChar, pOutputStatus);
} }
s32 cellImeJpEnterStringExt() s32 cellImeJpEnterStringExt(CellImeJpHandle hImeJpHandle, u16 inputChar, vm::ptr<u16> pOutputStatus)
{ {
UNIMPLEMENTED_FUNC(cellImeJp); cellImeJp.todo("cellImeJpEnterStringExt()");
return CELL_OK; return cellImeJpEnterChar(hImeJpHandle, inputChar, pOutputStatus);
} }
s32 cellImeJpModeCaretRight() s32 cellImeJpModeCaretRight()
@ -201,33 +210,38 @@ s32 cellImeJpGetFocusTop()
return CELL_OK; return CELL_OK;
} }
s32 cellImeJpGetFocusLength() s32 cellImeJpGetFocusLength(CellImeJpHandle hImeJpHandle, vm::ptr<u16> pFocusLength)
{ {
UNIMPLEMENTED_FUNC(cellImeJp); cellImeJp.error("cellImeJpGetFocusLength()");
*pFocusLength = 1;
return CELL_OK; return CELL_OK;
} }
s32 cellImeJpGetConfirmYomiString() s32 cellImeJpGetConfirmYomiString(CellImeJpHandle hImeJpHandle, vm::ptr<u16> pYomiString)
{ {
UNIMPLEMENTED_FUNC(cellImeJp); cellImeJp.error("cellImeJpGetConfirmYomiString()");
*pYomiString = *s_ime_string;
return CELL_OK; return CELL_OK;
} }
s32 cellImeJpGetConfirmString() s32 cellImeJpGetConfirmString(CellImeJpHandle hImeJpHandle, vm::ptr<u16> pConfirmString)
{ {
UNIMPLEMENTED_FUNC(cellImeJp); cellImeJp.error("cellImeJpGetConfirmString()");
*pConfirmString = *s_ime_string;
return CELL_OK; return CELL_OK;
} }
s32 cellImeJpGetConvertYomiString() s32 cellImeJpGetConvertYomiString(CellImeJpHandle hImeJpHandle, vm::ptr<u16> pYomiString)
{ {
UNIMPLEMENTED_FUNC(cellImeJp); cellImeJp.error("cellImeJpGetConvertYomiString()");
*pYomiString = *s_ime_string;
return CELL_OK; return CELL_OK;
} }
s32 cellImeJpGetConvertString() s32 cellImeJpGetConvertString(CellImeJpHandle hImeJpHandle, vm::ptr<u16> pConvertString)
{ {
UNIMPLEMENTED_FUNC(cellImeJp); cellImeJp.error("cellImeJpGetConvertString()");
*pConvertString = *s_ime_string;
return CELL_OK; return CELL_OK;
} }

View file

@ -0,0 +1,27 @@
#pragma once
namespace vm { using namespace ps3; }
typedef vm::ptr<void> CellImeJpHandle;
//Input state of the ImeJp
enum {
CELL_IMEJP_BEFORE_INPUT = 0,
CELL_IMEJP_BEFORE_CONVERT = 1,
CELL_IMEJP_CONVERTING = 2,
CELL_IMEJP_CANDIDATE_EMPTY = 3,
CELL_IMEJP_POSTCONVERT_KANA = 4,
CELL_IMEJP_POSTCONVERT_HALF = 5,
CELL_IMEJP_POSTCONVERT_RAW = 6,
CELL_IMEJP_CANDIDATES = 7,
CELL_IMEJP_MOVE_CLAUSE_GAP = 8,
};
//cellImeJpEnterChar, returning values pointed in pOutputStatus.
enum {
CELL_IMEJP_RET_NONE = 0,
CELL_IMEJP_RET_THROUGH = 1,
CELL_IMEJP_RET_CONFIRMED = 2,
};

View file

@ -164,7 +164,7 @@
<ClCompile Include="Emu\Cell\Modules\cellGifDec.cpp" /> <ClCompile Include="Emu\Cell\Modules\cellGifDec.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellHttp.cpp" /> <ClCompile Include="Emu\Cell\Modules\cellHttp.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellHttpUtil.cpp" /> <ClCompile Include="Emu\Cell\Modules\cellHttpUtil.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellImejp.cpp" /> <ClCompile Include="Emu\Cell\Modules\cellImeJp.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellJpgDec.cpp" /> <ClCompile Include="Emu\Cell\Modules\cellJpgDec.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellJpgEnc.cpp" /> <ClCompile Include="Emu\Cell\Modules\cellJpgEnc.cpp" />
<ClCompile Include="Emu\Cell\Modules\cellKb.cpp" /> <ClCompile Include="Emu\Cell\Modules\cellKb.cpp" />
@ -557,6 +557,7 @@
<ClInclude Include="Emu\Cell\Modules\cellGcmSys.h" /> <ClInclude Include="Emu\Cell\Modules\cellGcmSys.h" />
<ClInclude Include="Emu\Cell\Modules\cellGem.h" /> <ClInclude Include="Emu\Cell\Modules\cellGem.h" />
<ClInclude Include="Emu\Cell\Modules\cellGifDec.h" /> <ClInclude Include="Emu\Cell\Modules\cellGifDec.h" />
<ClInclude Include="Emu\Cell\Modules\cellImeJp.h" />
<ClInclude Include="Emu\Cell\Modules\cellJpgDec.h" /> <ClInclude Include="Emu\Cell\Modules\cellJpgDec.h" />
<ClInclude Include="Emu\Cell\Modules\cellKb.h" /> <ClInclude Include="Emu\Cell\Modules\cellKb.h" />
<ClInclude Include="Emu\Cell\Modules\cellL10n.h" /> <ClInclude Include="Emu\Cell\Modules\cellL10n.h" />
@ -705,4 +706,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

View file

@ -371,7 +371,7 @@
<ClCompile Include="Emu\Cell\Modules\cellHttpUtil.cpp"> <ClCompile Include="Emu\Cell\Modules\cellHttpUtil.cpp">
<Filter>Emu\Cell\Modules</Filter> <Filter>Emu\Cell\Modules</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Emu\Cell\Modules\cellImejp.cpp"> <ClCompile Include="Emu\Cell\Modules\cellImeJp.cpp">
<Filter>Emu\Cell\Modules</Filter> <Filter>Emu\Cell\Modules</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Emu\Cell\Modules\cellJpgDec.cpp"> <ClCompile Include="Emu\Cell\Modules\cellJpgDec.cpp">
@ -1282,6 +1282,9 @@
<ClInclude Include="Emu\Cell\Modules\cellGifDec.h"> <ClInclude Include="Emu\Cell\Modules\cellGifDec.h">
<Filter>Emu\Cell\Modules</Filter> <Filter>Emu\Cell\Modules</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="Emu\Cell\Modules\cellImeJp.h">
<Filter>Emu\Cell\Modules</Filter>
</ClInclude>
<ClInclude Include="Emu\Cell\Modules\cellJpgDec.h"> <ClInclude Include="Emu\Cell\Modules\cellJpgDec.h">
<Filter>Emu\Cell\Modules</Filter> <Filter>Emu\Cell\Modules</Filter>
</ClInclude> </ClInclude>
@ -1751,4 +1754,4 @@
<Filter>Utilities</Filter> <Filter>Utilities</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>