-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add support for slowing down emulation #3
Comments
Hi @jessemillar, this function Line 83 in db7d0eb
|
Sure! I added
This line ( |
Some stuttering especially on start maybe inevitable. The issue is that sim-arduboy uses simavr which is more of a simulator than an emulator. It tries to simulate interaction execution timing and pin state changes so they happen with the right timing with respect to the simulated clock but with no regards to wall clock (except for the function I mentioned in my first reply). What seems very strange is that I expected that function to be called a lot more often. Did you add your print statement above this line? Line 93 in db7d0eb
|
I did add it above that line. I was confused why it wasn't called more frequently too. This is what my copy of
|
Need to double check under which conditions avr_callback_sleep_sync() is called currently but I suspect for some reason the game is not letting the CPU idle often so the sleep function does not get called. |
I just realized that I'm calling |
@dxxb as I see sim-arduboy do not have any ADC related code. |
I believe libasimavr supports simulating the ADC. If so, it would be a matter of hooking sim-arduboy into it and feeding the ADC result with some random source. |
I added PR #12 with adc feeding. It pass my tests,but unfortunately delay on start in the Crates game is not related for initRandomSeed()... |
Running my
.hex
file in thesim_arduboy
binary results in a play experience roughly 3x faster than it is on the physical Arduboy. Is there a way to limit the draw rate or CPU clock speed in the emulator to more closely match the Arduboy hardware?The text was updated successfully, but these errors were encountered: