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

Make rust emitted code compatible with Rev A Playdate hardware #61

Merged
merged 1 commit into from
Aug 10, 2024

Conversation

jder
Copy link
Contributor

@jder jder commented Jun 12, 2024

Hi there! I've been working on a Playdate game in rust for the last 9 months using crankstart. Thanks for all the work on this project which has made that possible! I have a bunch of changes to both crankstart and crank, some of which are probably useful to others, so I'm planning to start sending some back upstream. Here's the first! Changelog below:

--

The FPU settings for C code are -mfpu=fpv5-sp-d16, the -sp- part means that double precision floating point is unsupported. The rust docs show that getting this same effect from rustc-emitted code requires this additional target feature. Note that at the moment this produces a warning that this target flag is unstable.

Without this, I was getting "undefined instruction" errors for f64 instructions on the original Playdate hardware, with this change it seems to be resolved.

The FPU settings above are `-mfpu=fpv5-sp-d16`, the `-sp-` part means that double precision floating point is unsupported. The [rust docs](https://doc.rust-lang.org/nightly/rustc/platform-support/thumbv7em-none-eabi.html#table-of-supported-cpus-for-thumbv7em-none-eabihf) show that getting this same effect from rustc-emitted code requires this additional target feature.

Without this, I was getting "undefined instruction" errors for f64 instructions on the original Playdate hardware, with this change it seems to be resolved.
@jder
Copy link
Contributor Author

jder commented Aug 10, 2024

Hey @boozook are you interested in getting something like this merged?

@boozook
Copy link
Member

boozook commented Aug 10, 2024

Wow, I've just added same as note in the wiki today. I'll fix it in the cargo-playdate soon, but if you want do it yourself, it could be great.

@jder
Copy link
Contributor Author

jder commented Aug 10, 2024

Sorry, I'm not sure what you're saying. You don't want to make this change to this repo, you want me to do it in here instead? Is crankstart/crank deprecated/unmaintained now?

@boozook
Copy link
Member

boozook commented Aug 10, 2024

I apologize for my crooked lang. I passively support and review pull-requests this repository. I also plan to make a similar fix in my main project in the near future. But if you want to do PR there, that would be great.

@boozook boozook merged commit f877535 into pd-rs:main Aug 10, 2024
@jder
Copy link
Contributor Author

jder commented Aug 10, 2024

Got it, thanks for merging! I can make a PR there.

@boozook
Copy link
Member

boozook commented Aug 10, 2024

Thank you so much!

@jder jder deleted the patch-1 branch August 10, 2024 19:31
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.

2 participants