Native C and OpenGL ES 2.0, the rules of Balatro, your own copy of the game
Overview | Balatro.love | Install | Build | Decisions | Roadmap
Note
Version 1.0 is out. It plays full runs with all 150 jokers, all decks and stakes, the 20 challenges, Endless Mode, and the sounds and the music of Balatro. The rules and the text of each card agree with the code of Balatro 1.0.1o. CHANGELOG.md lists the changes of each release. docs/decisions.md holds each decision and its reason.
Important
This is a fan project. It is not from LocalThunk or Playstack. The repository and the .deb hold no file of Balatro. You need your own copy.
A round |
A hand scores |
The shop |
The blind select |
An Arcana Pack |
A new run |
Balatro4S plays Balatro on an iPhone 4S with iOS 6.1.3. Balatro itself does not run on iOS 6. Balatro4S is a new engine in C, with the rules of Balatro 1.0.1o.
The app reads the art, the font, the text, the shaders, and the sounds from
the Balatro.love file of your own copy. It holds no file of Balatro.
The rules agree with the Lua code of Balatro itself. A test harness runs the real code of Balatro on the Mac with the LuaJIT of the game, and compares it with the C code over thousands of random seeds: the score of each hand, each joker, each blind, each tag, pack, and voucher, the start of each deck, stake, and challenge, and the money of each round. The same seed gives the same run as in Balatro.
The game runs at 60 frames each second on the A5. The editions and the background use the shaders of Balatro. After the first start, the app starts in about 1 second.
- All 150 jokers, 22 Tarot cards, 12 Planet cards, 18 Spectral cards, 32 vouchers, 24 tags, and all booster packs
- The 28 boss blinds and the 5 final boss blinds
- The 15 decks and the 8 stakes, with the Eternal, Perishable, and Rental stickers
- The 20 challenges, and Endless Mode after ante 8
- The seeds of Balatro
- The Foil, Holographic, Polychrome, and Negative editions and the moving background, with the shaders of Balatro
- The cards move, lean, and shake with the springs of Balatro
- The sounds and the five music tracks of Balatro, decoded on the phone
- The run saves itself and comes back after a restart
- A profile with the stats, the high scores, the wins of each deck, the unlocks, and the discoveries, as in Balatro
- The collection, the statistics, and the settings: game speed, screen shake, volume, music, and sounds
Version 1.0.0 was checked on an iPhone 4S with iOS 6.1.3.
The art, the sounds, the font, and the text of Balatro belong to their
owners. Balatro4S reads them from Balatro.love.
- Buy Balatro, for example on Steam.
- Find
Balatro.love. On a Mac, it is inBalatro.app/Contents/Game/Balatro.app/Contents/Resources/. On Windows,Balatro.exeis a zip archive that holds the same files. - Copy it to
/var/mobile/Media/Balatro4S/Balatro.loveon the phone, with an AFC tool or withscp.
On its first start, the app decodes the textures and keeps them in
/var/mobile/Media/Balatro4S/cache/, about 31 MB. The run, the profile,
and the settings are in the same directory.
You need an iPhone, iPod touch, or iPad with iOS 6 and a jailbreak.
- Download the
.debfile from the latest release. - Copy it to the phone, for example with
scpto/tmp/. - On the phone, as root:
dpkg -i /tmp/io.github.stivengjekaj.balatro4s_*.deb.
The Balatro4S icon comes on the home screen. To remove the app:
dpkg -r io.github.stivengjekaj.balatro4s.
On iOS 7 or later, or with an APT that has TLS 1.2, you can also add the
Cydia source https://stiven-gjekaj.github.io/cydia/. Cydia then shows the
updates. Cydia on iOS 6 cannot read it, because its APT stops at TLS 1.0
and GitHub accepts only TLS 1.2. See
the repository.
You need a Mac with Xcode and the iOS 9.3 SDK of Theos.
- Download
iPhoneOS9.3.sdk.tar.xzfrom the releases of theos/sdks and unpack it intosdks/. The result issdks/iPhoneOS9.3.sdk. Git does not tracksdks/. - Run
./fix-sdk.shone time. It changes the SDK stubs for the new Apple linker and for iOS 6. - Build:
| Command | Result |
|---|---|
scripts/app.sh |
build/Balatro4S.app |
scripts/deb.sh |
The Cydia package in build/ |
scripts/test.sh |
The tests, on the Mac |
scripts/test.sh --phone |
The tests, on the phone |
scripts/install.sh |
Builds the app, copies it to the phone, and opens it |
scripts/install.sh --debug |
The same, with the debug commands of src/game/bo_debug.c |
scripts/tap.sh |
Sends debug commands, as "tap X Y", to a debug build |
scripts/shot.sh |
Saves a screenshot of the phone |
scripts/icons.sh |
The icons of the app |
scripts/release.sh |
Tests, packs, tags, and publishes a release |
The phone scripts use ssh iphone4s. Set up that host in ~/.ssh/config,
for example with a USB tunnel of iproxy on port 2222.
build.sh builds one armv7 binary. It compiles with ARC and links without
ARC, and all code is in ARM mode (-marm). The new Apple linker makes Thumb
code that crashes on iOS 6 before main starts.
The tools in tools/ compare the C code with Balatro. They need Balatro in
/Applications on the Mac, or its path in BALATRO_APP:
| Command | Result |
|---|---|
tools/oracle.sh score FILE |
Runs a scenario with the code of Balatro |
tools/fuzz.py |
Compares random scenarios of the C code and of Balatro |
tools/oracle.sh gen src/core |
Makes the card data in src/core/bo_data.c |
tools/oracle.sh genchallenges src/core |
Makes the challenge data |
If you find Balatro4S useful, you can support its development here.
The code is under the MIT licence. See LICENSE. Balatro4S uses stb_vorbis by Sean Barrett under the MIT licence or the public domain, as src/third_party/README.md tells. Balatro and its art, sounds, font, and text belong to LocalThunk and Playstack.





