Thread with 2 posts
jump to expanded postthe emotional rollercoaster of
๐จ oh god how the hell do you implement va_list
๐ ah itโs just a void * pointing to the stack
๐ฑ but the first few args can be passed in registers
๐ฎ oh, the callee can just push them to the stack
๐คฏ โฆand the arguments end up in the right order if you do!
I think the implementation of va_list in touchHLE is quite elegant, if I do say so myself: https://github.com/hikari-no-yume/touchHLE/blob/cf6b650ebb227ac588d2eb107a8cea90a5fbe97a/src/abi.rs#L349-L360