Skip to content

Commit ae136b1

Browse files
author
Sean Cross
committed
shim: Initial commit
0 parents  commit ae136b1

File tree

3 files changed

+464
-0
lines changed

3 files changed

+464
-0
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
all: bcm_host.c
2+
gcc -c bcm_host.c -o bcm_host.o -fPIC `sdl-config --cflags`
3+
gcc -fPIC -shared -lEGL -lGLESv1_CM -Wl,-soname,libbcm_host.so.1 bcm_host.o -o libbcm_host.so.1.0

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
Minecraft: Pi Edition wrapper
2+
=============================
3+
4+
This is a wrapper for Minecraft: Pi Edition's OpenGL ES drivers. It makes
5+
several assumptions about running on a Raspberry Pi, some of which are not
6+
valid on our system (Kosagi Novena). Namely, it suffers from the following:
7+
8+
* Requires libbcm, which does not exist outside Broadcom chips
9+
* Does not pass the window object to eglContextCreate()
10+
* Calls init()/destroy() multiple times, which crashes our vendor's GL drivers
11+
* Links against libGLESv2.so but uses GLES 1.0
12+
13+
This library and runtime environment aim to solve these problems.
14+
15+
Usage
16+
-----
17+
18+
To compile our libbcm replacement, simply run "make".
19+
20+
Then download Minecraft from http://pi.minecraft.net/ and extract it so
21+
that minecraft-pi is in the current directory.
22+
23+
Copy /usr/lib/libGLESv1_CM.so or /usr/lib/arm-linux-gnueabihf/libGLESv1_CM.so
24+
to this directory and rename it to libGLESv2.so
25+
26+
Finally, run minecraft-pi with the following invokation:
27+
28+
LD_PRELOAD=./libbcm_host.so LD_LIBRARY_PATH=$PWD ./minecraft-pi
29+
30+
Gotchas
31+
-------
32+
33+
Minecraft is run at full-screen for performance reasons. Unfortunately,
34+
the Minecraft program doesn't have an "Exit" function, so you'll have to
35+
come up with your own way of killing it.
36+
37+
Design
38+
------
39+
40+
There are counters that monitor how many times various functions are
41+
called. Minecraft seems to initialize EGL and then tear it down again
42+
right away, which causes our vendor's driver to crash. To get around
43+
this, we count how many times each driver is invoked, and only call
44+
the real egl functions after a certain number of invocations.

0 commit comments

Comments
 (0)