Cave Story (nxengine) on the Raspberry Pi

UPDATE: New Raspbian Binaries Available

I got a request today to see if I could get Cave Story working on the Raspberry Pi.  It took me about 4 hours but I’ve gotten a decent version running.  This uses the NXengine open source cave story project, along with the english translation patch the freeware data files.

Cave Story Raspberry Pi

Steps to run:

  1. Download binaries
  2. Run unzip
  3. cd into nxengine
  4. run sudo chmod 777 /dev/fb0
  5. run sudo modprobe snd_bcm2835
  6. run ./nx
  7. Play Cave Story!

Let me know if you have any issues with the binaries or running the program.  I’ve only ever played about 5 minutes of Cave Story so I’m not sure how well it’s running, but it seemed to be fine to me.  Looking forward to the feedback.


Link to source code:

18 thoughts on “Cave Story (nxengine) on the Raspberry Pi

  1. Thank you so much! You are a hero to the RPi community. I’m off to bed but I will install it tomorrow. I hope you get a chance to play through the game, it may surprise you how deep it gets, both story and gameplay.

  2. could you have a look at minecraft?

    there is a thread as raspberry pi forums.

    I think whats needed is lwjgl compiled for arm and translated to opengl es instead of desktop opengl. then it should just work (since it’s java)

  3. I got a chance to try it. It worked my first time when I launched it in the GUI but it running a little slow and was in window mode. So I tried it from the main shell and it wouldn’t run saying I had an Audio error of some kind (through the shell or the GUI.) Any thoughts?

  4. Why I use ./nx it tells me

    pi@raspbmc:~/Game/nxengine$ ./nx
    -bash: ./nx: No such file or directory

    sudo ./nx
    sudo: unable to execute ./nx: No such file or directory

    I’m in the correct directory, any advice will appreciated.

    • BTW, nx has execute permissions:
      pi@raspbmc:~/Game/nxengine$ ls -lha
      total 4.2M
      drwxr-xr-x 8 pi pi 4.0K Jul 20 14:33 .
      drwxr-xr-x 7 pi pi 4.0K Jul 20 14:28 ..
      -rwxr-xr-x 1 pi pi 4.8K Jul 17 2012 AGTP Readme.txt
      -rwxr-xr-x 1 pi pi 148 Jul 17 2012 Config.dat
      drwxr-xr-x 4 pi pi 4.0K Jul 17 2012 data
      -rw-r–r– 1 pi pi 7.9K Jul 17 2012 debug.txt
      -rwxr-xr-x 1 pi pi 96K Jul 17 2012 DoConfig.exe
      -rwxr-xr-x 1 pi pi 1.5M Jul 17 2012 Doukutsu.exe
      -rw-r–r– 1 pi pi 79K Jul 17 2012 drum.pcm
      drwxr-xr-x 2 pi pi 4.0K Jul 17 2012 endpic
      -rw-r–r– 1 pi pi 297K Jul 17 2012 font.ttf
      drwxr-xr-x 2 pi pi 4.0K Jul 17 2012 Manual
      -rwxr-xr-x 1 pi pi 465 Jul 17 2012 Manual.html
      -rwxr-xr-x 1 pi pi 908K Jul 17 2012 nx
      -rw-r–r– 1 pi pi 470 Jul 17 2012 nx.png
      drwxr-xr-x 2 pi pi 4.0K Jul 17 2012 org
      drwxr-xr-x 2 pi pi 4.0K Jul 17 2012 pxt
      -rw-r–r– 1 pi pi 1.9K Jul 17 2012 README.txt
      drwxr-xr-x 2 pi pi 4.0K Jul 17 2012 replay
      -rw-r–r– 1 pi pi 166 Jul 17 2012 settings.dat
      -rw-r–r– 1 pi pi 8.4K Jul 17 2012 smalfont.bmp
      -rw-r–r– 1 pi pi 1.3M Jul 17 2012 sndcache.pcm
      -rw-r–r– 1 pi pi 55K Jul 17 2012 sprites.sif
      -rw-r–r– 1 pi pi 6.8K Jul 17 2012 stage.dat
      -rw-r–r– 1 pi pi 1.1K Jul 17 2012 tilekey.dat
      -rw-r–r– 1 pi pi 25K Jul 17 2012 wavetable.dat

  5. how do you go out of full screen to windowed mode, if you cant do that, then how do you up the size of the game on screen, because it works for me, but it is in a window that is really small

    • I worked out the answer to our question!!!!!!!!!!

      (Yours but I share the problem too)

      Open debug.txt

      Go down three lines,

      You should see Video mode is automatically scaled to a certain value.

      SDL_SetVideoMode: 320×240 @ 32bpp

      Look up the optimum size of your device – I use Raspberry Pi-top Ceed so I would put a 1366×768 resolution- and replace it with your screen resolution value.

      Easily just go to

      I hope it works and that I could help…

  6. When I try to run nx it says I am doing an “ILLEGAL INSTRUCTION”

    i@pi-top:~/Desktop/cavestory $ ./nx
    Illegal instruction

    When i add sudo it does nothing. No Game Loads For Me!!!!!

    pi@pi-top:~/Desktop/cavestory $ sudo ./nx
    pi@pi-top:~/Desktop/cavestory $

    Help PLease!!!

  7. Hello i know that this isnt the right fourmu for the cave story im using but… i couldnt install it here so i got it on retropie and i cant do ANYTHING but listen to the music No buttons on the controller work and no buttons on the keyboard work can someone help me???????

Leave a Reply

Your email address will not be published. Required fields are marked *