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

Function write_HLE

pcsx2/IopBios.cpp:893–925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

891 }
892
893 int write_HLE()
894 {
895 s32 fd = a0;
896 u32 data = a1;
897 u32 count = a2;
898
899 if (fd == 1) // stdout
900 {
901 const std::string s = Ra1;
902 iopConLog(ShiftJIS_ConvertString(s.data(), a2));
903 pc = ra;
904 v0 = a2;
905 return 1;
906 }
907 else if (IOManFile* file = getfd<IOManFile>(fd))
908 {
909 auto buf = std::make_unique<char[]>(count);
910
911 [[unlikely]]
912 if (!iopMemSafeReadBytes(data, buf.get(), count))
913 {
914 for (u32 i = 0; i < count; i++)
915 buf[i] = iopMemRead8(data + i);
916 }
917
918 v0 = file->write(buf.get(), count);
919
920 pc = ra;
921 return 1;
922 }
923
924 return 0;
925 }
926 } // namespace ioman
927
928 namespace sysmem

Callers

nothing calls this directly

Calls 6

ShiftJIS_ConvertStringFunction · 0.85
iopMemSafeReadBytesFunction · 0.85
iopMemRead8Function · 0.85
dataMethod · 0.45
getMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected