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

GameShell support #643

Closed
ffreling opened this issue Jul 28, 2018 · 21 comments
Closed

GameShell support #643

ffreling opened this issue Jul 28, 2018 · 21 comments
Labels
enhancement Improvement of existing feature or adding something new

Comments

@ffreling
Copy link

Hi,

I would like to run TIC-80 on the GameShell (https://www.clockworkpi.com/)
It is powered by a Quad-core Cortex-A7 CPU,512 MB Memory, Mail GPU.

It looks like a great fit for the TIC-80, even with its limited inputs.

I tried compiling the linux target on it and it compiled fine but when I tried running the binary output I got the following error:

"./bin/tic80” terminated by signal SIGSEGV (Address boundary error)

I also tried to compile the chip-ltotarget (I figured out this platform was closer to the GameShell than regular linux) but it failed:

/usr/bin/ld: 3rd-party/pre-built/arm/liblua.a(lapi.o): relocation R_ARM_THM_MOVW_ABS_NC against `luaO_nilobject_' can not be used when making a shared object; recompile with -fPIC
3rd-party/pre-built/arm/liblua.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status

Any tips to run TIC-80 on this platform would be appreciated :)

@ffreling
Copy link
Author

My issue with the linux binary was that I was trying to run it via ssh. I can run it from the GameShell launcher without error.

But when I run it, I can only see what seems to be the top right part of the screen. My display is 320x240, does TIC-80 support this resolution? Or is every TIC-80 pixel drawn like a 2x2 pixel?

@ffreling
Copy link
Author

Defining STUDIO_UI_SCALE to 1 in src/system.c did the trick. Now I can see the full screen.

@nesbox
Copy link
Owner

nesbox commented Jul 29, 2018

@ffreling Great, how about performance? Does it work on 60 fps when playing games, Withem Up for example?
Thanks.

@ffreling
Copy link
Author

I can't use any input for now, I need to remap the GameShell buttons to x, z, etc.
Your documentation says I should do it through the pause menu, but I can't enter any options, only the "Esc" button works for now 😅

@ffreling
Copy link
Author

Since I can't input anything on the GameShell, I need to load a keymap.
On linux I see that it is located at ~/.local/share/com.nesbox.tic/TIC-80/.local/keymap.dat but its format is not really readable. Is the format documented? Or should I just modify it on my computer then copy it over the GameShell?

@nesbox
Copy link
Owner

nesbox commented Jul 31, 2018

keymap.dat just an array of keyboard scancodes

tic_key keycodes[KEYMAP_COUNT];

you can modify it yourself if you know the codes of the GameShell buttons

@ffreling
Copy link
Author

I made a custom keymap on my laptop, copied it on the console and now it seems to work fine :)
"Witchem Up" runs smoothly, the only drawback is that once I am in TIC-80, I cannot exit with only gamepad controls, I have to reboot to quit.

It would help to have a "Quit TIC-80" option in the pause menu. I can't edit anything when I run from the GameShell since I only have 4 buttons.

Anyway, it's quite fun, especially with the -surf :)

@nesbox
Copy link
Owner

nesbox commented Jul 31, 2018

added an issue #646

@ffreling
Copy link
Author

I plan to package it for the GameShell and I have a few questions:

  • Can I reuse your icon to associate it with the TIC-80 launcher?
  • Is it possible to define STUDIO_UI_SCALE on the command-line? I need to set it to 1 to fit the UI on the smaller screen (320x240).
  • Should I create a new build target named gameshell?
  • Would it be possible to host gameshell-compatible binaries? I am not sure you want to support many platforms but since not everyone want to build it from sources, it would be easier to provide binaries.

I hope we can create a simple wiki page on the GameShell repository to help people install TIC-80, like this page does for PICO-8: https://github.com/clockworkpi/GameShellDocs/wiki/Running-PICO-8-on-the-GameShell

@nesbox
Copy link
Owner

nesbox commented Jul 31, 2018

Great, so

  • feel free to reuse TIC icon.
  • UI scale definition can be added to the command line (pls create an issue or make PR).
  • yes, please create gameshell target if it is different from linux target
  • it will be possible to host gameshell-compatible binaries, I use Github Releases section for such things.
    Thanks

@soxfox42
Copy link
Contributor

I was just about to create the same issue with my version of this. By the way, I set up shift+menu (backspace) to quit on my build until we have a menu option.

@ffreling
Copy link
Author

@nesbox I think with a command line argument to set UI scale, it should be compatible with the linux target.

I will create an issue for this, I tried to patch it but I am not sure where to set this UI Scale property: console, studio, or system/platform.

@ffreling
Copy link
Author

I created the issue: #647

@nesbox
Copy link
Owner

nesbox commented Aug 1, 2018

added ui-scale parameter here 1504301

@ffreling
Copy link
Author

ffreling commented Aug 1, 2018

I will check if the compiled linux version on my computer can run smoothly on the GameShell (I am afraid of a few runtime dependencies). It worked fine when compiled on the GameShell, but it would be even simpler to have a single binary run everywhere :)

@cuu
Copy link
Contributor

cuu commented Aug 1, 2018

https://forum.clockworkpi.com/t/run-tic80-on-gs/1121

here is my test of tic80 on GameShell

:) tic80 is great

@nesbox
Copy link
Owner

nesbox commented Aug 1, 2018

@cuu great, thanks
btw, I think changing TIC80_WIDTH and TIC80_WIDTH values is not a good idea, you are breaking compatibility with a lot of games which use direct RAM access via peek/poke

@ffreling
Copy link
Author

ffreling commented Aug 1, 2018

@nesbox the new -uiscale option works fine 👍

I updated my instructions on the GameShell forum: https://forum.clockworkpi.com/t/tic-80-support-in-the-gameshell/979/4
With "Quit TIC-80" in the game menu, I believe that's all that's needed for the GameShell.

With regard to binary releases, I just built the linux target and it ran fine. I can provide binaries compiled on the GameShell as a convenience but if you have a Linux ARM 32-bit machine, I think it might work.

@nesbox
Copy link
Owner

nesbox commented Aug 2, 2018

added Quit TIC-80 here b14dd23

@ffreling
Copy link
Author

ffreling commented Aug 2, 2018

Thanks! I really appreciate how fast you fixed these issues.

@Anrock Anrock added the enhancement Improvement of existing feature or adding something new label Nov 6, 2019
@Anrock
Copy link
Collaborator

Anrock commented Nov 6, 2019

So, with TIC-80 working on GameShell is there anything else left to do or this issue could be closed?

@nesbox nesbox closed this as completed Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing feature or adding something new
Projects
None yet
Development

No branches or pull requests

5 participants