Tic-80: GameShell support

Created on 28 Jul 2018  ยท  21Comments  ยท  Source: nesbox/TIC-80

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 :)

enhancement

Most helpful comment

added Quit TIC-80 here b14dd23

All 21 comments

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?

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

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

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 :sweat_smile:

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?

keymap.dat just an array of keyboard scancodes
https://github.com/nesbox/TIC-80/blob/03efd9051855ad61cc7fbd4eba09a3284f9dd6f5/src/studio.c#L110
you can modify it yourself if you know the codes of the GameShell buttons

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 :)

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

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

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.

@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.

added ui-scale parameter here 1504301

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 :)

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

here is my test of tic80 on GameShell

:) tic80 is great

@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

@nesbox the new -uiscale option works fine :+1:

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.

added Quit TIC-80 here b14dd23

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

codeartisticninja picture codeartisticninja  ยท  4Comments

BuoYancYdabl picture BuoYancYdabl  ยท  5Comments

fangzhangmnm picture fangzhangmnm  ยท  3Comments

novemberisms picture novemberisms  ยท  5Comments

BraininaBowl picture BraininaBowl  ยท  3Comments