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

Non-rpi Linux? #1

Open
davidde opened this issue May 14, 2018 · 4 comments
Open

Non-rpi Linux? #1

davidde opened this issue May 14, 2018 · 4 comments

Comments

@davidde
Copy link

davidde commented May 14, 2018

Does this also work on non-rpi Linux? I just tried it on Debian, and I got:

cargo run -- /dev/input/event0 
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target/debug/rustysnake /dev/input/event0`
Hello, world!
thread 'main' panicked at 'file not found: Error { repr: Os { code: 13, message: "Permission denied" } }', /checkout/src/libcore/result.rs:916:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

But maybe this has to do with the controller used? (I don't have a SNES one, so I tried a steam controller and keyboard ...)

@praetp
Copy link
Owner

praetp commented May 14, 2018

There is no hard dependency on Raspberry PI in the game logic but you must specify the device file of the input device as sole argument and it must support certain events.
If you are using a different kind of device with different kinds of events, you can send me a PR if you manage to get it working.

But here you are getting a permission denied, so I think there's still something else at play...

EDIT: Also, you will have to find an alternative for the display which is now hardcoded to be the unicorn hat hd.
We could make this configurable.

@davidde
Copy link
Author

davidde commented May 14, 2018

Ok, thanks. Will let you know if I happen to find something.

@davidde
Copy link
Author

davidde commented May 14, 2018

Yes, the display seems to be the problem now. UnicornHatHd::default() on line 67 of unicornhd.rs unwraps on an err value:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 2, message: "No such file or directory" } }

But I wouldn't know how to fix this ...

@praetp
Copy link
Owner

praetp commented May 14, 2018

The easy workaround is to uncomment the bottom lines in Cargo.toml. It will 'fake' the unicorn hat hd.
This is probably not something you want as the final display but it will allow you to run the game in your PC.
Not sure what you have in mind as a long term solution... Interested to hear..

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

No branches or pull requests

2 participants