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

Game::setting does not work in debug mode #9

Open
fwsGonzo opened this issue May 19, 2024 · 0 comments
Open

Game::setting does not work in debug mode #9

fwsGonzo opened this issue May 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@fwsGonzo
Copy link
Collaborator

inline std::optional<intptr_t> Game::setting(std::string_view setting)
{
	register const char* name_ptr  asm("a0") = setting.begin();
	register unsigned    name_len  asm("a1") = setting.size();
	register long        sysno     asm("a7") = ECALL_GAME_SETTING;
	register bool        has_value asm("a0");
	register intptr_t    result    asm("a1");

	asm("ecall"
		: "=r"(has_value), "=r"(result)
		: "m"(*(const char(*)[name_len])name_ptr),
		  "r"(name_ptr), "r"(name_len), "r"(sysno));

	if (has_value) return int64_t(result);
	return std::nullopt;
}

Looking at this, I cannot see what's wrong. It just doesn't work. Can you see what's wrong?

@fwsGonzo fwsGonzo added the bug Something isn't working label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant