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

(3DS) Additional features [DO NOT MERGE] #13743

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MrHuu
Copy link
Contributor

@MrHuu MrHuu commented Mar 14, 2022

Disclaimer:

This is a work in progress branch, mainly existing for personal use.
This contain various additional experimental features for the 3DS platform.
This should go with a fair warning, most of the features are incomplete, non-functional, highly un-optimized or just plain wrong.
There is currently no intention the have this merged any time soon, if ever.

Why create this draft, you may ask.
This is mainly done for easier maintenance and keeping it up-to-date with upstream retroarch.
I will continue working on this, but without any estimate or obligations.

Description:

This branch adds various additional features to the 3DS platform, including:

  • Screen modes:

    • Top only
    • Bottom only
    • Mirror both screens
    • Dual screen
      • rotation is working
      • frame position offset only works on 0° and 270° for now
      • p.o.c. dual screen overlays
  • Bottom screen controls:

  • Control options (mainly used for lightgun support for now):

    • Head-tracking (New3DS only)
    • Gyroscope / Accelerometer
    • Touch-screen

While some of these features matured well enough for my personal usage, it's far from complete in general.
I can't stress this enough, but this is done as a fun side project for me to learn about code development with the benefit of having a few (to me) 'must have' games supported.

  • Known issues:
    • Overall code style, indentation, useless comments
    • Unused debug code, experimental code

Unless you're interested in helping improving or just for laughs and giggles, i do not recommend looking through this commit.
But, if you feel like improving, expanding or claiming it your own, feel more than free to do so.

If you're adventurous enough and really want to compile this branch, it builds without issues.
Required assets are included and can be found here:
https://github.com/MrHuu/RetroArch/tree/ctr_bottom_screen/ctr/ctr-bottom/_assets/ctr

@MrHuu MrHuu force-pushed the ctr_bottom_screen branch 2 times, most recently from 76e3120 to e583993 Compare August 22, 2022 15:56
@LibretroAdmin
Copy link
Contributor

Hi, what kind of roadblocks remain for this PR, and how should we orient further?

@MrHuu
Copy link
Contributor Author

MrHuu commented Aug 29, 2022

This branch contains a lot of experimental features currently not fit for the greater public.
I think the best approach to have at least some of the features merged would be to make separate PR's.
Ignoring input options, like qtm, accel/gyro, touch for now. They could always be added later.

Main issue would be adapting the current graphics driver.

Since the bottom screen handling is done entirely by the graphics driver, it makes it kind of difficult to make changes to either graphics driver or input handling.

To maintain functional(!) functionality, a first PR could contain:

  • Move bottom screen input handling from ctr_gfx.c to ctr_input.c and /ctr/ctr-bottom/ctr_bottom.c

From there, it's probably best to add some of the other options:

  • Dual screen rendering
  • Rendering menu / content on top, bottom or both screen(s)
  • Bottom screen input options like the keyboard or mouse

This requires some major changes in ctr_gfx.c and ctr_input.c, and most changes are dependent on each other.

One other issue to take in account is threading;

bool ctr_refresh_bottom(bool refresh)
{
bool oldval;
while (LightLock_TryLock(&lock) != 0)
{
oldval = ctr_bottom_state_gfx.refresh_bottom_menu;
ctr_bottom_state_gfx.refresh_bottom_menu = refresh;
LightLock_Unlock(&lock);
}
return oldval;
}

This function can be called from both the video and input driver.
I do not know how to handle the threaded video driver properly. While the current solution seems to work for me, i doubt it's done correctly from a developers point of view.

I'm not particularly proud at how the bottom screen input is handled in general in /ctr/ctr-bottom/ctr_bottom.c.
While it's functional, it's not optimal. But unfortunately i'm not sure on how to improve things.

I could create a PR based on this if desired, but it probably has to be reviewed thoroughly before merging.

@MrHuu MrHuu force-pushed the ctr_bottom_screen branch 2 times, most recently from f2155f5 to 027bdfa Compare September 17, 2022 17:50
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.

None yet

2 participants