OpenClaw icon indicating copy to clipboard operation
OpenClaw copied to clipboard

Zoomed in on rg353p

Open 31337-4554551n opened this issue 2 years ago • 22 comments

When installing through portmaster and running on ambernic rg353p it's all zoomed into a corner and you can't really see anything. Unsure where to post the bug. Here, OS github, or portmaster github. Sorry, very new to all of this.

31337-4554551n avatar Jul 11 '22 07:07 31337-4554551n

Hi, it's my first time hearing about "portmaster" or "ambernic rg353p" :-)

Are you trying to run the native aplication ? Or Emscripten build in the browser ?

pjasicek avatar Jul 11 '22 07:07 pjasicek

I am using jelos, which is a port of emuelec/351 elec. It's a linux distro made to work on the ambernic consoles. https://github.com/christianhaitian/PortMaster/wiki#openClaw Portmaster is included in the operating system, which is a tool to install ports for it. Yours is one of them. I can give you any other information you'd like, and a big thank you

31337-4554551n avatar Jul 11 '22 07:07 31337-4554551n

Sorry, I can't really help you with this. Contact the PortMaster guys for help or support.

pjasicek avatar Jul 11 '22 08:07 pjasicek

They don't accept requests, only push requests :( Such a shame, I was so excited for this Maybe you could take a quick gander with me as proxy?

31337-4554551n avatar Jul 11 '22 08:07 31337-4554551n

image

31337-4554551n avatar Jul 11 '22 08:07 31337-4554551n

Though it works if you plug it into an external screen with hdmi. So it's something to do with the port not detecting the screen size I think :D

31337-4554551n avatar Jul 11 '22 08:07 31337-4554551n

Looking at the PortMaster stuff it looks like your "model" is not supported. Download this:

https://github.com/christianhaitian/PortMaster/blob/main/Openclaw.zip

and open OpenClaw.sh

you can then see this section of script:

if [ "$LOWRES" == "Y" ]; then
  sed -i '/width\=\"1920\"/s//width\=\"480\"/g' $GAMEDIR/config.xml
  sed -i '/width\=\"857\"/s//width\=\"480\"/g' $GAMEDIR/config.xml
  sed -i '/width\=\"640\"/s//width\=\"480\"/g' $GAMEDIR/config.xml
  sed -i '/height\=\"1080\"/s//height\=\"320\"/g' $GAMEDIR/config.xml
  sed -i '/height\=\"480\"/s//height\=\"320\"/g' $GAMEDIR/config.xml
  sed -i '/<Scale>3/s//<Scale>1/g' $GAMEDIR/config.xml
elif [[ "$(cat /sys/firmware/devicetree/base/model)" == "Anbernic RG552" ]] || [[ -e "/dev/input/by-path/platform-singleadc-joypad-event-joystick" ]]; then
  if [[ -e "/usr/share/plymouth/themes/text.plymouth" ]] || [[ "$(cat "/etc/os-release")" == *"RG503"* ]]; then
    sed -i '/width\=\"857\"/s//width\=\"960\"/g' $GAMEDIR/config.xml
    sed -i '/width\=\"640\"/s//width\=\"960\"/g' $GAMEDIR/config.xml
    sed -i '/width\=\"480\"/s//width\=\"960\"/g' $GAMEDIR/config.xml
    sed -i '/height\=\"480\"/s//height\=\"544\"/g' $GAMEDIR/config.xml
    sed -i '/height\=\"320\"/s//height\=\"544\"/g' $GAMEDIR/config.xml
    sed -i '/<Scale>3/s//<Scale>1/g' $GAMEDIR/config.xml
  else
    sed -i '/width\=\"857\"/s//width\=\"1920\"/g' $GAMEDIR/config.xml
    sed -i '/width\=\"640\"/s//width\=\"1920\"/g' $GAMEDIR/config.xml
    sed -i '/width\=\"480\"/s//width\=\"1920\"/g' $GAMEDIR/config.xml
    sed -i '/height\=\"480\"/s//height\=\"1080\"/g' $GAMEDIR/config.xml
    sed -i '/height\=\"320\"/s//height\=\"1080\"/g' $GAMEDIR/config.xml
    sed -i '/<Scale>1/s//<Scale>3/g' $GAMEDIR/config.xml
  fi
elif [[ -e "/dev/input/by-path/platform-odroidgo3-joypad-event-joystick" ]]; then
  sed -i '/width\=\"1920\"/s//width\=\"857\"/g' $GAMEDIR/config.xml
  sed -i '/width\=\"640\"/s//width\=\"857\"/g' $GAMEDIR/config.xml
  sed -i '/width\=\"480\"/s//width\=\"857\"/g' $GAMEDIR/config.xml
  sed -i '/height\=\"1080\"/s//height\=\"480\"/g' $GAMEDIR/config.xml
  sed -i '/height\=\"320\"/s//height\=\"480\"/g' $GAMEDIR/config.xml
  sed -i '/<Scale>3/s//<Scale>1/g' $GAMEDIR/config.xml
else
  sed -i '/width\=\"1920\"/s//width\=\"640\"/g' $GAMEDIR/config.xml
  sed -i '/width\=\"857\"/s//width\=\"640\"/g' $GAMEDIR/config.xml
  sed -i '/width\=\"480\"/s//width\=\"640\"/g' $GAMEDIR/config.xml
  sed -i '/height\=\"1080\"/s//height\=\"480\"/g' $GAMEDIR/config.xml
  sed -i '/height\=\"320\"/s//height\=\"480\"/g' $GAMEDIR/config.xml
  sed -i '/<Scale>3/s//<Scale>1/g' $GAMEDIR/config.xml
fi

Not sure how linux-savvy you are, but basically it checks for the HW model of your device trying various stuff, e.g.:

elif [[ "$(cat /sys/firmware/devicetree/base/model)" == "Anbernic RG552" ]] || [[ -e "/dev/input/by-path/platform-singleadc-joypad-event-joystick" ]]; then

Then is sets the "correct" resolution for the given model. My guess is you will need to do the same:

  1. find our what HW model you have - you need to come up with a way how to determine that
  2. add the section specific to your model to that script and set the correct resolution for you (width/height/scale)

pjasicek avatar Jul 11 '22 08:07 pjasicek

As it is now, it is using 640x480 resolution with scale 3, from what I can see:

/openclaw/config.xml

<Configuration>
  <Display>
    <Size width="640" height="480" />
    <Scale>3</Scale>
...

Or, you can try to edit this directly and see what fits your device. Though I don't know how the OpenClaw.zip from PortMaster works in any way (if you upload it to your device with some SW or anything like that ...)

pjasicek avatar Jul 11 '22 08:07 pjasicek

Alright, I'll try that now. Quick question also, how can I use your port to change controls scheme? Clicking on the controls in options gives confirmation sound but nothing opens

31337-4554551n avatar Jul 11 '22 08:07 31337-4554551n

That's not implemented, no easy way to do that other than modifying and recompiling the source code.

pjasicek avatar Jul 11 '22 08:07 pjasicek

Ah, dang. It's like south button jump, right shoot, north punch. Awkward. Is that being worked on? :P

So what I should be able to do is cheat a little, and use

else sed -i '/width="1920"/s//width="640"/g' $GAMEDIR/config.xml sed -i '/width="857"/s//width="640"/g' $GAMEDIR/config.xml sed -i '/width="480"/s//width="640"/g' $GAMEDIR/config.xml sed -i '/height="1080"/s//height="480"/g' $GAMEDIR/config.xml sed -i '/height="320"/s//height="480"/g' $GAMEDIR/config.xml sed -i '/<Scale>3/s//<Scale>1/g' $GAMEDIR/config.xml fi

For my own parameters? So my display is 640*480, so I need to remove scale? or maybe modify some of those settings

31337-4554551n avatar Jul 11 '22 08:07 31337-4554551n

This project is more or less in a state of maintenance, I am not actively working on it anymore (these past 2 days being an exception). If you will need something specific done for you platform / hardware, your best bet is to do it yourself and send me a merge request.

For the resolution values, you will need to tinker with it, I don't really know to be honest - try deleting the whole if/elif/else construct from the /OpenClaw.sh and directly edit /openclaw/config.xml and see which values fit you.

Once you find them, you can try to incorporate them imto OpenClaw.sh if you want and then send the maintainers a merge request with your hardware config. That's atleast how me personally would go about it.

pjasicek avatar Jul 11 '22 08:07 pjasicek

Definitely out of my skill set, but thank you so much for your time :)

31337-4554551n avatar Jul 11 '22 08:07 31337-4554551n

I'm trying to puzzle this out, but the screen is already 640*480, so that last else statement should work, right?

31337-4554551n avatar Jul 11 '22 09:07 31337-4554551n

For anyone that ever comes across this in the future. The fix is Modifying the openclaw.sh file like this

GAMEDIR="/$directory/ports/openclaw"
cd $GAMEDIR

#if [ "$LOWRES" == "Y" ]; then
#  sed -i '/width\=\"1920\"/s//width\=\"480\"/g' $GAMEDIR/config.xml
#  sed -i '/width\=\"857\"/s//width\=\"480\"/g' $GAMEDIR/config.xml
#  sed -i '/width\=\"640\"/s//width\=\"480\"/g' $GAMEDIR/config.xml
#  sed -i '/height\=\"1080\"/s//height\=\"320\"/g' $GAMEDIR/config.xml
#  sed -i '/height\=\"480\"/s//height\=\"320\"/g' $GAMEDIR/config.xml
#  sed -i '/<Scale>3/s//<Scale>1/g' $GAMEDIR/config.xml
if [[ -e "/dev/input/by-path/platform-odroidgo3-joypad-event-joystick" ]]; then
  sed -i '/width\=\"1920\"/s//width\=\"640\"/g' $GAMEDIR/config.xml
  sed -i '/width\=\"640\"/s//width\=\"1920\"/g' $GAMEDIR/config.xml
  sed -i '/width\=\"480\"/s//width\=\"857\"/g' $GAMEDIR/config.xml
  sed -i '/height\=\"1080\"/s//height\=\"480\"/g' $GAMEDIR/config.xml
  sed -i '/height\=\"480\"/s//height\=\"1080\"/g' $GAMEDIR/config.xml
  sed -i '/<Scale>1/s//<Scale>3/g' $GAMEDIR/config.xml
else
  sed -i '/width\=\"1920\"/s//width\=\"640\"/g' $GAMEDIR/config.xml
  sed -i '/width\=\"857\"/s//width\=\"640\"/g' $GAMEDIR/config.xml
  sed -i '/width\=\"480\"/s//width\=\"640\"/g' $GAMEDIR/config.xml
  sed -i '/height\=\"1080\"/s//height\=\"480\"/g' $GAMEDIR/config.xml
  sed -i '/height\=\"320\"/s//height\=\"480\"/g' $GAMEDIR/config.xml
  sed -i '/<Scale>3/s//<Scale>1/g' $GAMEDIR/config.xml
fi

And it works on the small screen. Hopefully someone kind drops by a way to fix controls and swap the north and west buttons

31337-4554551n avatar Jul 11 '22 09:07 31337-4554551n

What's wrong with the buttons ?

pjasicek avatar Jul 11 '22 09:07 pjasicek

There is some button mapping I see, check:

/openclaw/openclaw.gptk.1

pjasicek avatar Jul 11 '22 09:07 pjasicek

I love you! Everything works perfectly! I'm going to try to figure out how to submit that to their github for the rg353p. Only ever used git for issues requests. One last question, how do I disable the max bullets etc and play with the lives and supplies you're meant to have in the original, is there a config for that?

31337-4554551n avatar Jul 11 '22 10:07 31337-4554551n

In /openclaw/config.xml

change this:

...
<LoadAllLevelSaves>true</LoadAllLevelSaves>
...

to this:

...
<LoadAllLevelSaves>false</LoadAllLevelSaves>
...

This will basically give you a clean-slate of the game - just Level 1 with no checkpoints, 3 lives, 10 bullets, 5 magic claws, 3 dynamites.

Hopefully the game save mechanism works on the port ;-)

pjasicek avatar Jul 11 '22 10:07 pjasicek

Omg, you're amazing. Everything is perfect. The only thing left to do is detect that there's an HDMI cable and change resolution in that if statement. I've got it all worked out, except the OS I'm using doesn't have xrandr and doesn't set that $LOWRES variable the script mentions. But I've got it working on the small screen, with good controls, starting from scratch (just gotta test that saves work) and we're good! My current work around is to flip the resolution and the scale ever time. A bit annoying, but it lets me play on either haha. Now when you say hope the save mechanism works, if it does, great. But also, would it overwrite your special settings (like if later I want to go back to all unlocked, will your save still be there, or mine will overwrite it?) You've been amazing, thank you.

Are there any other changes in your port that differ from the oringinal experience I can tweak?

31337-4554551n avatar Jul 11 '22 11:07 31337-4554551n

But also, would it overwrite your special settings (like if later I want to go back to all unlocked, will your save still be there, or mine will overwrite it?

The option to show all available levels will always be there, just switch back from LoadAllLevelSaves=false to LoadAllLevelSaves=true

Are there any other changes in your port that differ from the oringinal experience I can tweak?

You can look in the config.xml, but I don't thing anything is worth modifying. If sound is weird, you can play with the sound options there, but other than that, I don't think so

pjasicek avatar Jul 11 '22 11:07 pjasicek

Awesome so all timings, powers etc are the same. Some really touchy settings there. Thanx man, this is so awesome. Nostalgia is hitting me like a tank, I'm probably gonna play this till the sun comes up and worry about work later lol

31337-4554551n avatar Jul 11 '22 11:07 31337-4554551n