rockbox/firmware/target/hosted
Adam N. Burke 383e227671 Sansa Clip Zip: Implement LCD flip (180 degree rotation)
Enable HAVE_LCD_FLIP for the Clip Zip and implement lcd_set_flip()
in the LCD driver, making the Display -> Flip Display setting work.
This lets the player be used upside down, e.g. clipped to clothing
with the control buttons pointing up and screen on the bottom.

Defining HAVE_LCD_FLIP also activates the existing button remap in
button_flip() (firmware/drivers/button.c) for this target: while the
display is flipped, LEFT/RIGHT, UP/DOWN and the volume keys are all
swapped to match the new orientation, so the whole device is usable
upside down, not just readable.

The flip is done in hardware by reversing the controller's GRAM write
direction and mirroring the write window in lcd_setup_rect, so partial
updates keep working and there is no per-frame cost. Both panel
variants are handled: the type 0 WiseChip/SEPS114A via MEMORY_WRITE/READ
(1Dh, 0x02), and the type 1 Visionox/LD7134 via the Graphic RAM Writing
Direction register (05h, 0x03). The direction register is written in
lcd_enable(), so it is set while the panel is powered and is re-applied
after display standby; lcd_set_flip() cycles the panel off and on so a
change to the setting takes effect immediately.

For the simulator, which has no real LCD controller, lcd_set_flip() is
implemented in the SDL LCD driver (lcd-bitmap.c) as a software mirror of
the framebuffer, so the flip is visible in theme previews; the generic
uisimulator stub is guarded out when HAVE_LCD_FLIP is defined.

Tested on real type 1 / LD7134 hardware in both orientations: display
content, button remapping and album art are all correct, and test_fps
shows partial updates run at full speed when flipped (1/4 frame 325 fps,
matching the non-flipped rate). The type 0 / SEPS114A path uses the same
approach; the 0x02 direction value was confirmed to flip a type 0 panel
by William Wilgus during review.

Change-Id: I99ef13949102b344826e72d1d90c71e2271448a6
2026-06-14 23:16:17 -04:00
..
agptek chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
aigo chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
anbernic chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
android chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
ctru chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
fiio chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
hiby chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
ibasso pcm: introduce pcm_sink 2026-03-02 10:09:11 +09:00
samsungypr chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
sdl Sansa Clip Zip: Implement LCD flip (180 degree rotation) 2026-06-14 23:16:17 -04:00
sonynwz chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
surfans chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
tinyalsa hosted: Pull tinyalsa out of ibasso tree so other targets can use it 2025-11-28 19:33:48 -05:00
xduoo chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
alsa-controls.c nwz/alsa: various improvements 2020-10-31 14:16:31 +00:00
alsa-controls.h erosqhosted: Support HW volume control on rev2+ hardware 2024-11-01 14:12:31 -04:00
backlight-target.h New port: FiiO M3K 2020-10-09 12:41:18 -04:00
backlight-unix.c hiby: backlight: use framebuffer blanking instead of PWM on hosted targets 2026-01-19 14:23:07 -05:00
backtrace-glibc.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
button-devinput.c hiby: ability to add/remove input device 2026-04-16 08:03:06 -04:00
button-devinput.h hiby: ability to add/remove input device 2026-04-16 08:03:06 -04:00
cpufreq-linux.c hosted: Use O_CLOEXEC for all open() and "e" for fopen() calls 2020-10-11 01:47:03 -04:00
cpufreq-linux.h CPUFreq scaling governor interface for Linux/Android hosted devices. 2015-01-30 20:15:58 +01:00
cpuinfo-linux.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
cpuinfo-linux.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
debug-hosted.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
filesystem-app.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
filesystem-app.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
filesystem-hosted.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
filesystem-unix.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
filesystem-unix.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
filesystem-win32.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
filesystem-win32.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
hibyos.make chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
kernel-unix.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
kernel-unix.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lc-unix.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
lcd-linuxfb.c debug: Report if double-buffered fb is enabled 2025-05-08 12:35:03 -04:00
pcm-alsa.c pcm: introduce pcm_sink 2026-03-02 10:09:11 +09:00
pcm-alsa.h pcm: improve 32-bit software volume scaling 2026-02-23 15:44:42 +00:00
power-linux.c Rockbox for the HiBy R3 Pro II/R1 2025-12-27 15:44:54 -05:00
rolo.c use path_append for setting directories is several settings 2024-04-01 07:35:53 -04:00
rtc.c chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
sysfs.c hosted: Use O_CLOEXEC for all open() and "e" for fopen() calls 2020-10-11 01:47:03 -04:00
sysfs.h xDuoo X3II and X20 port 2020-04-06 18:15:41 +02:00
system-hosted.c hiby: ability to add/remove input device 2026-04-16 08:03:06 -04:00
system-hosted.h chore: Get rid of *all* vestigal CVS '$Id:$' tags 2026-06-01 16:01:18 -04:00
usb-hiby.c add const to const * strings 2022-05-03 23:00:58 -04:00