Log In  


I'm no expert in any of this frankly but I wanted to document how I got Picotron working using Portmaster on my ARM based retro handheld, the Anbernic RG353P. Since the ARM release this was the first thing I wanted to do, even though my device has a 4:3 3.5 inch screen (which is not ideal).

I have only tested it on Ark OS but in theory as long as your OS supports SDL 2 it should be the same process. Don't shoot me if I'm wrong.

  1. Create a picotron folder within your ports folder (for me this sits within roms/roms2 - make sure you pick roms2 if you have a second SD card)
  2. Download and extract the ARM version of Picotron to your new picotron folder
  3. Create a picotron.sh file with the following content and save it to the ports folder (not the picotron folder - the parent folder)
#!/bin/bash
# PORTMASTER: picotron.zip, Picotron.sh

XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}

if [ -d "/opt/system/Tools/PortMaster/" ]; then
  controlfolder="/opt/system/Tools/PortMaster"
elif [ -d "/opt/tools/PortMaster/" ]; then
  controlfolder="/opt/tools/PortMaster"
elif [ -d "$XDG_DATA_HOME/PortMaster/" ]; then
  controlfolder="$XDG_DATA_HOME/PortMaster"
else
  controlfolder="/roms/ports/PortMaster"
fi

source $controlfolder/control.txt
source $controlfolder/device_info.txt

get_controls

GAMEDIR=/$directory/ports/picotron

> "$GAMEDIR/log.txt" && exec > >(tee "$GAMEDIR/log.txt") 2>&1

cd $GAMEDIR

$ESUDO rm -rf ~/.picotron
ln -sfv $GAMEDIR/conf/.picotron ~/

$ESUDO chmod 666 /dev/tty1
$ESUDO chmod 666 /dev/uinput
$GPTOKEYB "picotron" -c "$GAMEDIR/picotron.gptk.1" &
LD_LIBRARY_PATH="$GAMEDIR/libs" SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" ./picotron 2>&1 | tee $GAMEDIR/log.txt
$ESUDO kill -9 $(pidof gptokeyb)
$ESUDO systemctl restart oga_events &
printf "\033c" >> /dev/tty1
  1. Create a picotron.gptk.1 file with the following content and save it to the picotron folder
back = \"
start = \"
a = \"
b = \"
x = \"
y = \"
l1 = \"
l2 = mouse_right
l3 = \"
r1 = \"
r2 = mouse_left
r3 = esc
up = up
down = down
left = left
right = right
left_analog_up = \"
left_analog_down = \"
left_analog_left = \"
left_analog_right = \"
right_analog_up = mouse_movement_up
right_analog_down = mouse_movement_down
right_analog_left = mouse_movement_left
right_analog_right = mouse_movement_right
deadzone_triggers = 3000
mouse_scale = 8192
mouse_delay = 16

So for me, right analog stick controls the mouse, R2 is left click, L2 is right click and R3 (right thumbstick in) is escape key. Mouse speed is a little slow but it's only just sensitive enough to navigate the OS.

3


I wish portmaster worked on retropie. I'm having to do a lot of manual stuff in there and many things don't work.


1

This is my Anbernic RG 353VS running ROCKNIX.

After installing PortMaster, you need 2 things:

  1. a folder with the Picotron aarch64 release inside of it. roms/ports/picotron/
  2. a script to launch it ^

In my case I wanted to use the left analog stick as a mouse pointer. When pressed (L3) to be right click. The right analog stick, when pressed (R3) is a regular click. For this configuration a *.gptk file is created (see below) inside the picotron folder.

I also figured out that button mapping was wrong in my case. When I say 'wrong' I mean that bbs://featured/0/gamepad_sp-0.p64 was showing different layout compared to my actual handheld. Seems like it was using XBOX layout, but my device was using Nintendo layout. The easiest way to map this properly, would be to modify the /storage/.config/PortMaster/mapper.txt and put xbox instead of nintendo, but that change would probably become obsolete (overwritten) then next time you upgrade PortMaster. Hence, I am modifying on the fly the configuration thanks to the variable sdl_controllerconfig. You might ask, why I didn't use the gptk configuration for this... a fair question... I did, but didn't work out. What was happening is that it was assigning both Nintendo layout, plus my gptk config (both configs, instead of using one or the other). Last but not least, pay attention that he systemd service for ROCKNIX is 'essway.service' ;)

So... let's go:

Create the script $HOME/roms/ports/Picotron.sh

#!/bin/bash
# PORTMASTER: picotron.zip, Picotron.sh

### 1) pick your controlfolder (as the docs show)
XDG_DATA_HOME=${XDG_DATA_HOME:-$HOME/.local/share}
if   [ -d "/opt/system/Tools/PortMaster/" ]; then controlfolder="/opt/system/Tools/PortMaster"
elif [ -d "/opt/tools/PortMaster/"       ]; then controlfolder="/opt/tools/PortMaster"
elif [ -d "$XDG_DATA_HOME/PortMaster/"   ]; then controlfolder="$XDG_DATA_HOME/PortMaster"
else                                               controlfolder="/roms/ports/PortMaster"
fi

### 2) pull in the core
source "$controlfolder/control.txt"
source "$controlfolder/device_info.txt"

### 3) CFW tweaks
[ -f "$controlfolder/mod_${CFW_NAME}.txt" ] && source "$controlfolder/mod_${CFW_NAME}.txt"

### 4) SDL gamecontroller mapping
get_controls

# We swap A<->B and X<->Y here at runtime so we don't have to patch
# the file mapper.txt (which may be overwritten by updates).
# This keeps our Xbox layout tweak local to this port script.
sdl_controllerconfig=$(printf '%s' "$sdl_controllerconfig" | sed -E '
  # Swap A<->B
  s/,a:b([0-9]+),b:b([0-9]+),/,a:b\2,b:b\1,/;
  # Swap X<->Y
  s/,x:b([0-9]+),y:b([0-9]+),/,x:b\2,y:b\1,/
')

### 5) cd into your port
GAMEDIR="/$directory/ports/picotron"
CONFDIR="$GAMEDIR/conf"
mkdir -p "$CONFDIR"
export XDG_DATA_HOME="$CONFDIR"
cd "$GAMEDIR" || exit 1

### 6) logging
: > log.txt
exec > >(tee log.txt) 2>&1

### 7) build your GPTOKEYB command
GPTK_CFG="picotron.gptk"
$ESUDO chmod 666 /dev/tty1
$ESUDO chmod 666 /dev/uinput

### 8) Run the game with mouse simulation
$GPTOKEYB "picotron" -c "$GAMEDIR/$GPTK_CFG" &
LD_LIBRARY_PATH="$GAMEDIR/libs" SDL_GAMECONTROLLERCONFIG="$sdl_controllerconfig" ./picotron 2>&1 | tee $GAMEDIR/log.txt

### 9) Shutdown, if Start+Select buttons pressed
$ESUDO kill -9 $(pidof gptokeyb)
$ESUDO systemctl restart essway.service &
printf "\033c" >> /dev/tty1

Create the gptk file for simulating the mouse pointer: $HOME/roms/ports/picotron/picotron.gptk

back = \"
start = \"
guide = enter
a = \"
b = \"
x = \"
y = \"
l1 = \"
l2 = \"
l3 = mouse_right
r1 = \"
r2 = \"
r3 = mouse_left
up = \"
down = \"
left = \"
right = \"
left_analog_up = mouse_movement_up
left_analog_down = mouse_movement_down
left_analog_left = mouse_movement_left
left_analog_right= mouse_movement_right
right_analog_up = \"
right_analog_down = \"
right_analog_left = \"
right_analog_right = \"
deadzone_mode = scaled_radial
deadzone = 2000
deadzone_scale = 4
deadzone_delay = 16

You can also create $HOME/roms/ports/picotron/port.json:

{
  "id": "picotron",
  "name": "Picotron",
  "url": "https://www.lexaloffle.com/picotron.php",
  "version": "0.2.0h3",
  "description": "Fantasy workstation by Lexaloffle",
  "developer": "Lexaloffle",
  "category": "Applications",
  "launcher": "Picotron.sh"
}

and that's it. You can exit by pressing Start+Select together.


I tried these on a batocera/portmaster setup on my pi4, and while it works, the gamepad setting make the mouse reset to the top left of the screen every time I try to move it. But the SH file is on point, at least the program boots!



[Please log in to post a comment]