MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / ShiftJIS_ConvertChar

Function ShiftJIS_ConvertChar

pcsx2/ShiftJisToUnicode.cpp:808–832  ·  view source on GitHub ↗

requires two bytes on input (second CAN be 0), returns unicode mapping, assigns used bytes (1/2) This function takes a u8 by design - we do NOT want sign extension of the characters!!

Source from the content-addressed store, hash-verified

806// requires two bytes on input (second CAN be 0), returns unicode mapping, assigns used bytes (1/2)
807// This function takes a u8 by design - we do NOT want sign extension of the characters!!
808wchar_t ShiftJIS_ConvertChar(const u8* input, int& used)
809{
810 const uint FirstByte = input[0];
811
812 if(NumBytes[FirstByte] == 1)
813 {
814 used = 1;
815 return OneByte[FirstByte];
816 }
817 else
818 {
819 //if( !pxAssert( NumBytes[FirstByte] != 0 ) )
820 if( NumBytes[FirstByte] == 0 )
821 {
822 // FIXME : Hackfixed a null pointer in FFX (during opening scenes). It tries to
823 // print an 0xfc/0x0a combo, followed by a NULL. Other IOP prints seem to have valid
824 // Shift-JIS encodings. not sure what's going on yet, so this needs reviewed sometime
825 // --air
826 used = 1; return (u16)FirstByte;
827 }
828
829 used = 2;
830 return TwoBytes[FirstByte][input[1]];
831 }
832}
833
834std::string ShiftJIS_ConvertString( const char* src )
835{

Callers 1

ShiftJIS_ConvertStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected