msokalski / ascii-patrol

Ascii Patrol is an ASCII game project. It was mainly inspired by "Moon Patrol", my favourite arcade game at the times I was a child.
GNU General Public License v3.0
220 stars 20 forks source link

Can't press any key to continue (aarch64) #18

Closed clort81 closed 4 years ago

clort81 commented 4 years ago

I'll poke around but i can't get keyboard input (?) on my jetson nano build.

Looks nice with my glsl shader though! :)

commenting out the prompt() i get segfault

[Thread 0x7fb7465130 (LWP 8349) exited]                                                                                                  
Thread 1 "asciipat" received signal SIGSEGV, Segmentation fault.                                                                         
SPRITE::Paint (this=0x5555612910 <intro_modal+2200>, scr=0x5555612030 <global_screen>, dx=68, dy=42, sx=0, sy=0, sw=0, sh=0,             
    bgkey=0 '\000', blend=true) at game.cpp:1445                                                                                         
1445            const char* img = data->mono[frame];                                                                                     
(gdb) bt                                                                                                                                 
#0  SPRITE::Paint (this=0x5555612910 <intro_modal+2200>, scr=0x5555612030 <global_screen>, dx=68, dy=42, sx=0, sy=0, sw=0, sh=0,         
    bgkey=0 '\000', blend=true) at game.cpp:1445                                                                                         
#1  0x000000555558e218 in INTRO_MODAL::Run (this=0x5555612078 <intro_modal>) at temp.cpp:1496                                            
#2  0x000000555559f230 in terminal_loop () at spec_nix.cpp:1082                                                                          
#3  0x000000555558b5d8 in main (argc=1, argv=0x7fffffeb08) at temp.cpp:2187  
(gdb) p frame                                                                                   
$1 = 0 
$ setfont asciipat.psf
Couldn't get a file descriptor referring to the console
$ echo $TERM
xterm
$ echo $LANG
en_US.UTF-8

hmm...?

msokalski commented 4 years ago
  1. Yep, xterm is known here to fool me on grabbing keyboard from focused window. One thing worth trying is another terminal, on default nano distro there's gnome-terminal I believe.
  2. Looks like for some reason data pointer is null or frame is invalid, maybe assets.cpp is not compiled / linked into executable?
msokalski commented 4 years ago

No respond, closing.

clort81 commented 4 years ago

Hello, i missed your response. Sorry! during make i get

...
g++ -c -Wno-multichar -O3 -D NIX -o assets.o assets.cpp
...
g++ -o asciipat -pthread manual.o mo3.o unmo3.o stb_vorbis.o conf.o gameover.o inter.o twister.o game.o temp.o menu.o assets.o spec_dos.o spec_win.o spec_nix.o spec_web.o -L/usr/X11/lib -lX11 -lXi -lpulse

709608 Feb 27 13:30 asciipat

rxvt-unicode (urxvt) v9.22 Works

🕇 /pr/ascii/ascii-patrol$ echo $TERM rxvt-unicode-256color 🕇 /pr/ascii/ascii-patrol$ echo $LANG en_DK.UTF-8 🕇 /pr/ascii/ascii-patrol$ ./asciipat Pulse: Context connecting... Pulse: Connection failed. W=89, H=35 Falling back to X11 input

xfce4-terminal 0.8.8 (Xfce 4.14) Works

[1]+ Done sleep 0.1s && transset-df -p -t 0.94 🕇 /pr/ascii/ascii-patrol$ echo $TERM xterm-256color 🕇 /pr/ascii/ascii-patrol$ setfont asciipat.psf Couldn't get a file descriptor referring to the console 🕇 /pr/ascii/ascii-patrol$ ./asciipat Pulse: Context connecting... Pulse: Connection failed. W=116, H=40 Falling back to X11 input

Works fine too! So yeah, just xterm -class UXTerm having problems here.

Thanks for the awesome game. Best ascii game! Cheers!

msokalski commented 4 years ago

Thanks for feedback! even if a bit late :)