Skip to content

Diatom: the handheld's own sticks, and L3/R3 (R36S) - #465

Draft
tarikbc wants to merge 2 commits into
mainfrom
r36s-sticks
Draft

tarikbc wants to merge 2 commits into
mainfrom
r36s-sticks

Conversation

@tarikbc

@tarikbc tarikbc commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

The first R36S that ran ZyperOS (Sylver's, 2026-11-23) played Gran Turismo 2 with its sticks doing nothing. This PR stacks on #459, because the R36S's port is there.

#244 (the Smart Pro) has merged with the hook for a handheld's own sticks: diatom_port_input_axes, and env.c giving the cores those sticks. This PR now uses that hook and adds:

  • The port: port/pixel2.c (and so port/r36s.c) reads the joypad's ABS_X, ABS_Y, ABS_RX and ABS_RY from its own events, with the range and the flat from the kernel. A pad without those axes, like the Pixel 2's, reports no sticks, as before. This replaces the Pixel 2 port's "no sticks" stub.
  • The stick clicks: BTN_THUMBL and BTN_THUMBR become the new DIATOM_BTN_L3 and DIATOM_BTN_R3. They come after MENU, so every other button keeps its bit. They reach the core as the RetroPad's L3 and R3. The PlayStation's DualShock turns analog on L3+R3 (ZyperOS sets that combo), so on the R36S both sticks pressed together turn analog on.
  • The desktop port's input script knows l3 and r3.

Checks: make -C diatom all stub check passes. The device ports compile in plastron's build. Not yet tried on an R36S.

The first R36S that ran ZyperOS played Gran Turismo 2 with its sticks
doing nothing: Diatom gave every core centered sticks, as no handheld it
ran had any. Now a port says what its sticks read
(diatom_port_input_axes: left X and Y, right X and Y, in libretro's
range, the centre and the dead zone taken out), and the core's analog
device gets them: the left one whenever the d-pad is not pushing the
stick (stick=dpad), the right one always.

- port/pixel2.c (and so port/r36s.c): the joypad's ABS_X, ABS_Y, ABS_RX
  and ABS_RY, with their range and their flat from the kernel, read from
  its own events; a pad without them (the Pixel 2's) has no sticks, as
  before. BTN_THUMBL and BTN_THUMBR are L3 and R3.
- DIATOM_BTN_L3 and DIATOM_BTN_R3, after MENU so every other bit stays,
  the RetroPad's L3 and R3. The PlayStation's DualShock turns analog on
  L3+R3 (its analog_combo), so on the R36S both sticks pressed together
  turn it on, as the real pad's ANALOG button does.
- The Brick and the desktop port have no sticks of their own.

The same hook as the TrimUI Smart Pro's work (#244) adds, so either can
take the other's.
# Conflicts:
#	diatom/include/diatom_port.h
#	diatom/port/brick.c
#	diatom/port/desktop.c
#	diatom/src/env.c
Base automatically changed from r36s-profile to main November 24, 2026 00:58

This branch has not been deployed

No deployments
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.

1 participant