Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Implement proper %s handling for syscall 117 (0x75) #4123

Merged
merged 1 commit into from Jan 17, 2021

Conversation

F0bes
Copy link
Member

@F0bes F0bes commented Jan 9, 2021

This fixes #2865

This makes the syscall iterate through the format string which can be considered "slow" but this syscall is only going to be used for debugging purposes anyways :)

Works with my little crude example program
image

@F0bes F0bes force-pushed the syscall-117-string branch 2 times, most recently from 305ae7d to 885c7cf Compare January 10, 2021 01:13
@F0bes
Copy link
Member Author

F0bes commented Jan 10, 2021

For those curious or those who'd like to test, here is how you can use this syscall:

void syscallout(char* passedInA0, ...){
    asm __volatile__(
        "li $v1,0x75 \n"
        "syscall    \n" );
}

The syscall supports up to 7 arguments, the stack is not used

@F0bes
Copy link
Member Author

F0bes commented Jan 11, 2021

Verified working on Manjaro Linux x32 and x64 :)

@refractionpcsx2
Copy link
Member

What about japanese text? Pretty sure that's the reason it had the ShiftJIS in there

@F0bes
Copy link
Member Author

F0bes commented Jan 17, 2021

What about japanese text? Pretty sure that's the reason it had the ShiftJIS in there

Uh oh, I recall that having problems due to encoding. I'll look into it after work.

@F0bes
Copy link
Member Author

F0bes commented Jan 17, 2021

image
Seems to work properly without the ShiftJIS stuff.

@refractionpcsx2 refractionpcsx2 merged commit cebc531 into PCSX2:master Jan 17, 2021
@F0bes F0bes deleted the syscall-117-string branch January 13, 2023 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Syscall 0x75 (System Out logging) causes access violation with format specifier "%s"
2 participants