mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-22 19:06:15 +08:00
a8be1daca4
Each of the four byte-order helpers computed the swap into Rax and then returned via ctx.SetReturn(0). SetReturn writes its argument into Rax, so it immediately overwrote the converted value with 0 and the guest saw every sceNetHtonl / sceNetHtons / sceNetNtohl / sceNetNtohs call return 0. Leave the swapped value in Rax and return ORBIS_GEN2_OK as the dispatch status instead, matching how the value-returning exports in this file (e.g. sceNetPoolCreate) already work. Add a NetExports test suite covering the swaps, the 16-bit width masking, an htonl/ntohl round-trip, and a regression guard that a non-zero input never converts to 0.