-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Live range display #8
Conversation
Wow, thanks so much for the prompt and detailed feedback. I completely agree with all the points you made and will adjust accordingly. The Z button behavior on the live screen was mostly an artifact left over from testing - I was running into reduced framerates when the history buffer was larger and wanted an option to reset it. It seems to be performing well enough now, so I'll change it so I can add a third screen to test the buttons. Do you have any thoughts on how to exit that menu? As you pointed out, keeping the behavior consistent with other screens means you can't test the functionality of the start button. Is the poll rate a function of the efficiency of the event loop, or can you manually increase it from the default? I'm sure there are ways to optimize the history loop, but my C is a tad rusty and I didn't want to get in too far over my head on the first pass. Would you prefer these three additions be submitted to separate feature branches so you can merge them selectively as they become ready? I kept everything together for now to avoid any merge conflicts in the main menu and help sections. Again, thanks for the thorough review. I should be able to make these revisions within 24 hours, but I'll let you know if I run into any issues. |
from reading libdragon's documentation and code, polling is performed internally by libdragon and seems to be happening on every vertical interrupt, controller_scan() merely synchronizes the cached state. to achieve what i'm thinking about, i think it's necessary to create a timer (running every n milliseconds) that calls async_joybus_read() and then puts the result in an array or so for later processing in the event loop. so e.g. for n = 1 and assuming full framerate, we should get about 17 polls assuming no errors. then we can just draw 17 points on the screen in one frame or plot 17 values etc. i think it's going to be a bit tricky to handle with all the edge cases and stuff so i'd probably want to implement it on my own, as i'm already decently familiar with the joybus protocol and been fighting C memory bugs recently anyway 🤣 the display mode idea sounds nice, probably could be a part of the live display screen since its very similar in concept. will have to use a different approach though (not clearing the image buffer instead of storing history) as my antialiased line drawing routine is not particularly optimized for speed 😅 for button test screen, i would say holding a specific button combination for long enough (e.g. a+b+start for 1 second) would suffice for now. though i think that screen is something i'd like to give more consideration in regards to design. want to have something that looks nice :o) if you still want to do it, i could probably design some mockup to use as a baseline, but yea i think that particular one would be good to be done on a separate branch |
btw 1 more thing i forgot about, when you start the oscilloscope screen you can sometimes get an unexpected first plotted value, on first rom boot on real console its pretty random but on next occurences it seems to be leftover from before exiting the screen, perhaps some memory not initialized correctly? also |
Cool, I'll leave the If the line display does work out, I think it would make sense as an option to cycle through (e.g. display of history as points, rays, or none). I'm also concerned about performance, though, and will likely not implement it if it's noticeably slower to render than the pixels we're drawing now. Do you think the native I think you're right about plotting the first value before initializing it. The current iteration of that screen doesn't actually show the most recent value since it renders the lines before updating |
that approach means that you essentially have "infinite" history though, which you may or may not like. i'm fine with it |
Interesting, sounds like a fun side quest. If it's ok with you, I may commit as is for now and reimplement in the coming weeks once I've studied the code some more. Not sure how I feel about "infinite" history - sounds nice in theory, but I'm not sure how we'd make use of it without a substantially more complicated UI. Was your aim to be able to zoom out and/or trace back beyond the current screen? |
my aim is to make it performant enough to be viable :o) since you can just draw 1 line instead of 1000 lines every frame. not considering zooming etc. atm |
… B; Update help text to display B usage and note L/R in addition to D-pad
* Center oscilloscope title text * Fix format of x/y coordinates on oscilloscope view * Space out oscilloscope elements more logically * Adjust zoom to 40% to further limit plot overlap * Display current values (history[0]) on plot
* Center title text on screen * Add label indicating current comparison * Implement bounds checking on range display
* Revert `graphics_draw_line` change, using `draw_aa_line` for bounds checking * Increment counter after render to avoid reading unitialized data
Ok, I've got nearly everything implemented with a few exceptions:
I'm open to your input on whether the live range display's title text should be centered, and if we should move the comparison text to a different place. It looks a bit odd being centered when the graph itself isn't, but it needs to be centered in order to fit on one line. One other behavior on which I'd appreciate your input: if you turn off display of tracking history, should it continue to be tracked? Currently it does not, and resumes tracking when the display is turned back on. The errant initial values on the oscilloscope display were due to incrementing the counter prior to the first plot render; it was displaying a value that had not yet been initialized. I believe this is fixed but have not yet thoroughly tested it. I tried using Individual fixes are outlined in the commit notes. Let me know if there's anything else you'd like to see changed or cleaned up. |
Forgot to add - the latest build is attached to the last release here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for the late response, was feeling a bit worn out yesterday. actually properly looking at code this time :o)
other suggestions:
- might be good to nudge the plots up by 10px to center them vertically on the screen
- if you still want to try centering the range, i commited adjusted versions of the functions to x-offset branch: b02675f
* Shorten label text * Call controller_scan() before get_keys_pressed() * Center elements horizontally * Whitespace cleanup
* Implement zoomout to 75% similar to range display page * Adjust controls for consistency: * A: toggle history display * Z: toggle zoom * Update help text
Ok, I think I've got these changes implemented. I also ported the range display page's zoom functionality to the live display since centering the graph introduced an overlap with the X/Y labels. Thanks for your patience; let me know if there's anything else that needs to be changed. Test build here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good! likewise, thank you for your patience and your work :o)
Adds two screens to the controller test ROM:
Let me know what needs to be changed or cleaned up. I've tested on Everdrive and emu (SimpleN64); testing releases for both screens are published on my fork.
Fixes #5 and, in at least some capacity, #4.