-
Notifications
You must be signed in to change notification settings - Fork 202
Add basic OSD support #188
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
base: dev
Are you sure you want to change the base?
Conversation
|
Can you add back Inside rg_display.c you can access display.screen.width directly, that's no problem and you can leave those changes if you want. Edit: I've also fixed the printf in snes on the dev branch, you can remove this unrelated change. |
|
Okay, On the other hand I'm wondering if it still a good Idea to add transparency? But I can't think of an other way to have my battery icon without a rectangle "behind" it. |
launcher/main/gui.c
Outdated
| .width = rg_display_get_width(), | ||
| .height = rg_display_get_height(), | ||
| .width = rg_display_get_info()->screen.width, | ||
| .height = rg_display_get_info()->screen.height, |
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.
Should be undone
| printf("Rom loaded: name: %s, id: %s, company: %s, size: %dKB\n", Memory.ROMName, Memory.ROMId, Memory.CompanyId, Memory.CalculatedSize / 1024); | ||
| Settings.ForceHeader = Settings.ForceHiROM = Settings.ForceLoROM = Settings.ForceInterleaved = Settings.ForceNoHeader = Settings.ForceNotInterleaved = Settings.ForceInterleaved2 = false; | ||
| Settings.ForceHeader = false; | ||
| Settings.ForceHiROM = false; | ||
| Settings.ForceLoROM = false; | ||
| Settings.ForceInterleaved = false; | ||
| Settings.ForceNoHeader = false; | ||
| Settings.ForceNotInterleaved = false; | ||
| Settings.ForceInterleaved2 = false; | ||
|
|
||
| printf("Rom loaded: name: %s, id: %s, company: %s, size: %dKB\n", | ||
| Memory.ROMName, Memory.ROMId, Memory.CompanyId, (int)(Memory.CalculatedSize / 1024)); |
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.
Should be undone.
| uint16_t *buffer = osd.surface->data; // Treat the buffer as 16-bit values | ||
| for (int i = 0; i < osd.surface->width * osd.surface->height; i++) | ||
| buffer[i] = C_TRANSPARENT; // Assign the C_TRANSPARENT color directly to the background |
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.
I have finally implemented rg_surface_fill, you should now be able to do rg_surface_fill(osd.surface, NULL, C_TRANSPARENT);
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.
Although I'm not able to test my own code right now so maybe best don't waste your time...
|
If we go ahead with transparency then I think we should reconsider how we handle things. Currently you rerender the background pixels which works fine but it bypasses the filtering system and it also makes the code more repetitive. Bypassing the filtering for a few pixels in the case of a battery icon doesn't really matter, the pixels will be close enough. But it might cause visible weirdness if the OSD is bigger with more transparent zones. One possibility I can think of is that in the The other option I can think of is to just ignore the filter problem. We keep your current code but I clean it up a bit to reuse more code and improve correctness.
If the goal is limited to drawing a battery icon then drawing the few rectangles of the icon directly to the screen with But if so, I suggest that we keep this current PR open for when one of us, or someone else, wants to finish the full-fledged OSD :) (or at least transfer your changes to a branch in my repo before you delete them on your side). |
c72c92e to
3dbe19b
Compare
|
Hi, sorry for the really late reply! I haven't worked on retro-go for a long time but I'm getting back to it. Anyway, about the OSD, first thanks for your review but I feel like it would be relatively hard for me to make good clean code for now, I'm relatively new to C programming and I don't want to waste your time so yes I think we should left this PR open for when the full implementation of the OSD will be necessary and someone will want to work on it. I will create a new PR soon with just the battery icon! |
35ca41d to
832b20d
Compare
|
I've been experimenting with on-screen indicators: https://github.com/ducalex/retro-go/commits/on-screen-indicators/ In With this current code the icon can only be drawn at the bottom (you can experiment, but you'll see there's too much flicker if moved elsewhere). To have it on top we possibly could call Of course the real way of putting it anywhere we want without flicker is compositing the part that intersects with the game screen. I've also experimented with that but the added complexity doesn't seen worth it. So let me know if you have thoughts about placement and style and blinking and all that! |
|
Hey, sorry for the late answer! First thanks for taking the time to do the implementation ;) I tested the battery icon and your implementation is great, I also noticed the blinking, but I feel like it's not an issue worth the effort for an icon that is only meant to let people know the device is going to die soon. I agree that the placement isn't the best since it doesn't correspond to the usual icon but it's a minor detail considering the added blinking when placed correctly. So I'm happy with the current code! Edit: if merged, maybe you should let the user choose wether they want this option or not in the settings (some might find it annoying) |
|
I've merged the battery icon on low power. Best way to test it is to disconnect the battery or in It was impossible to find colors that work well on all backgrounds, but making it flash seems to work around that by still drawing some attention. Let me know how you feel about the styling and behavior!
It only appears at 2% which is usually a few minutes left, so I think it's fair to say that the user would prefer to see it than lose state. But I agree giving control to the user is important and I intend to add a toggle! |
#188) As of now there is no way to disable it, but I will add a toggle later, likely in the LED menu (and rename the menu to Indicators or something)..
|
Yes, the blinking really helps it stand out from the game. Personally, I think the icon is great as it is! |
The PR aims to add support for simple OSDs on retro-go during game emulation