From 2c2cb17f74a19ec2680a45e0dcee8d4231ba4389 Mon Sep 17 00:00:00 2001 From: Seafoamm Date: Sun, 21 Sep 2025 00:25:51 -0700 Subject: [PATCH 01/12] Add macOS setup instructions --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 542d27f..fcae51d 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,24 @@ Disregard Steps 3-4 and instead click the green code button on the main reposito 4.) Follow instructions from windows tutorial step 3 +## **-macOS-** +1.) Install devkitPro installer using: https://github.com/devkitPro/installer and following https://devkitpro.org/wiki/devkitPro_pacman#macOS. +> Note: You may have to install the installers directly from their url in a browser, as the installer script may not install correctly due to Cloudflare checks on their server. You can use one of the following urls: + +> Apple Silicon: https://pkg.devkitpro.org/packages/macos-installers/devkitpro-pacman-installer.arm64.pkg + +> Intel: https://pkg.devkitpro.org/packages/macos-installers/devkitpro-pacman-installer.x86_64.pkg + + +2.) Verify that devkitPro is installed in '/opt/devkitpro' + +3.) Add the following to your .bashrc or .zshrc (or export the variables in your shell session): +- export DEVKITPRO=/opt/devkitpro +- export DEVKITARM=$DEVKITPRO/devkitARM +- export PATH=$PATH:$DEVKITPRO/tools/bin:$DEVKITPRO/pacman/bin + +4.) Follow instructions from Windows tutorial step 4 + ## **Common Issues:** #### 1. **When I run `make` it errors out and won't compile!** From a9f44e74d4f7bbc8d54260bbf0e34d5e1a1cad23 Mon Sep 17 00:00:00 2001 From: Marcel Schnelle Date: Sun, 21 Sep 2025 17:50:51 +0900 Subject: [PATCH 02/12] Wrap around hand selection when going out of bounds horizontally --- source/game.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/source/game.c b/source/game.c index 625ecc6..49a6604 100644 --- a/source/game.c +++ b/source/game.c @@ -851,8 +851,21 @@ void card_draw() void hand_set_focus(int index) { - if (index < 0 || index > hand_top || hand_state != HAND_SELECT) return; - selection_x = index; + if (hand_state != HAND_SELECT) return; + + // Wrap around to the other side of the hand when going out of bounds on either side + if (index < 0) + { + selection_x = hand_top; + } + else if (index > hand_top) + { + selection_x = 0; + } + else + { + selection_x = index; + } play_sfx(SFX_CARD_FOCUS, MM_BASE_PITCH_RATE + rand() % 512); } From 591485a5ac80a059a491345557c227ecb78aefa3 Mon Sep 17 00:00:00 2001 From: noctowlhoot Date: Mon, 22 Sep 2025 20:49:35 +0930 Subject: [PATCH 03/12] Update joker_effects.c I was unsure of the significance of the number immediately after joker rarity in the joker registry, so I haven't put the joker effects in there. If anyone can tell me what the significance of that number is I can add them in :) --- source/joker_effects.c | 138 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/source/joker_effects.c b/source/joker_effects.c index 1382ea2..a78a137 100644 --- a/source/joker_effects.c +++ b/source/joker_effects.c @@ -464,6 +464,143 @@ static JokerEffect odd_todd_joker_effect(Joker *joker, Card *scored_card) { return effect; } + __attribute__((unused)) + static JokerEffect the_duo_joker_effect(Joker *joker, Card *scored_card) { + JokerEffect effect = {0}; + if (scored_card != NULL) + return effect; // if card != null, we are not at the end-phase of scoring yet + + // This is really inefficient but the only way at the moment to check for whole-hand conditions + u8 suits[NUM_SUITS]; + u8 ranks[NUM_RANKS]; + get_played_distribution(ranks, suits); + + if (hand_contains_n_of_a_kind(ranks) >= 2) + effect.xmult = 2; + return effect; + } + + +// graphics available from @MathisMartin31 + __attribute__((unused)) + static JokerEffect the_trio_joker_effect(Joker *joker, Card *scored_card) { + JokerEffect effect = {0}; + if (scored_card != NULL) + return effect; // if card != null, we are not at the end-phase of scoring yet + + // This is really inefficient but the only way at the moment to check for whole-hand conditions + u8 suits[NUM_SUITS]; + u8 ranks[NUM_RANKS]; + get_played_distribution(ranks, suits); + + if (hand_contains_n_of_a_kind(ranks) >= 3) + effect.xmult = 3; + return effect; + } + +// graphics available from @MathisMartin31 + __attribute__((unused)) + static JokerEffect the_family_joker_effect(Joker *joker, Card *scored_card) { + JokerEffect effect = {0}; + if (scored_card != NULL) + return effect; // if card != null, we are not at the end-phase of scoring yet + + // This is really inefficient but the only way at the moment to check for whole-hand conditions + u8 suits[NUM_SUITS]; + u8 ranks[NUM_RANKS]; + get_played_distribution(ranks, suits); + + if (hand_contains_n_of_a_kind(ranks) >= 4) + effect.xmult = 4; + return effect; + } + +// graphics available from @MathisMartin31 + __attribute__((unused)) + static JokerEffect the_order_joker_effect(Joker *joker, Card *scored_card) { + JokerEffect effect = {0}; + if (scored_card != NULL) + return effect; // if card != null, we are not at the end-phase of scoring yet + + u8 suits[NUM_SUITS]; + u8 ranks[NUM_RANKS]; + get_played_distribution(ranks, suits); + + if (hand_contains_straight(ranks)) + effect.xmult = 3; + return effect; +} + +// graphics available from @MathisMartin31 + __attribute__((unused)) + static JokerEffect the_tribe_joker_effect(Joker *joker, Card *scored_card) { + JokerEffect effect = {0}; + if (scored_card != NULL) + return effect; // if card != null, we are not at the end-phase of scoring yet + + u8 suits[NUM_SUITS]; + u8 ranks[NUM_RANKS]; + get_played_distribution(ranks, suits); + + if (hand_contains_flush(suits)) + effect.xmult = 2; + return effect; +} + + +// graphics available from @MathisMartin31 + __attribute__((unused)) +static JokerEffect joker_bootstraps_effect(Joker *joker, Card *scored_card) { + JokerEffect effect = {0}; + if (scored_card != NULL) + return effect; // if card != null, we are not at the end-phase of scoring yet + + effect.mult = (get_money() / 5) * 2; + + return effect; +} + +// no graphics available but ready to be used if wanted when graphics available +__attribute__((unused)) +static JokerEffect shoot_the_moon_joker_effect(Joker *joker, Card *scored_card) { + JokerEffect effect = {0}; + if (scored_card != NULL) + return effect; // if card != null, we are not at the end-phase of scoring yet + + CardObject** hand = get_hand_array(); + int hand_size = hand_get_size(); + for (int i = 0; i < hand_size; i++ ) + { + switch (hand[i]->card->rank) { + case QUEEN: + + effect.mult += 13; + default: + break; + } + } + + return effect; +} + +// no graphics available but ready to be used if wanted when graphics available +__attribute__((unused)) +static JokerEffect triboulet_joker_effect(Joker *joker, Card *scored_card) { + JokerEffect effect = {0}; + if (scored_card == NULL) + return effect; + + switch (scored_card->rank) { + case KING: case QUEEN: case JACK: + effect.xmult = 2; + default: + break; + } + + return effect; +} + + /* The index of a joker in the registry matches its ID. * The joker sprites are matched by ID so the position in the registry * determines the joker's sprite. @@ -508,6 +645,7 @@ const JokerInfo joker_registry[] = { // The following jokers don't have sprites yet, // uncomment them when their sprites are added. + #if 0 { COMMON_JOKER, 5, raised_fist_joker_effect }, { COMMON_JOKER, 6, reserved_parking_joker_effect }, From 26db4e1aa0211539b65afa7473674c5284814532 Mon Sep 17 00:00:00 2001 From: noctowlhoot Date: Mon, 22 Sep 2025 21:42:15 +0930 Subject: [PATCH 04/12] Update joker_effects.c fixed triboulet - was triggering for jacks also, rem --- source/joker_effects.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/joker_effects.c b/source/joker_effects.c index a78a137..403baa4 100644 --- a/source/joker_effects.c +++ b/source/joker_effects.c @@ -591,7 +591,7 @@ static JokerEffect triboulet_joker_effect(Joker *joker, Card *scored_card) { return effect; switch (scored_card->rank) { - case KING: case QUEEN: case JACK: + case KING: case QUEEN: effect.xmult = 2; default: break; From 8d278b0c194afdb9f42733c303e29147e51824c9 Mon Sep 17 00:00:00 2001 From: Wheeler <118409873+GreenNinja2525@users.noreply.github.com> Date: Mon, 22 Sep 2025 12:44:20 -0400 Subject: [PATCH 05/12] Fix Dynamic Badges (hopefully) I think I fixed the dynamic badges, it just needed a maxAge parameter to properly tell GitHub to recache the data. I can't really test this as it is set to refresh each badge every 2 hours. I also fixed some minor formatting in the build instructions. I also added a discussions badge so people can read through them before contributing. --- README.md | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 542d27f..30c652c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # Balatro-GBA -[![Build Status](https://img.shields.io/github/actions/workflow/status/cellos51/balatro-gba/build_ci_workflow.yml?style=flat&logo=github&branch=main&label=Builds&labelColor=gray&color=default&v=1)](https://github.com/cellos51/balatro-gba/actions) -[![Open Issues](https://custom-icon-badges.demolab.com/github/issues/cellos51/balatro-gba?logo=bug&style=flat&label=Issues&labelColor=gray&color=red&v=2)](https://github.com/cellos51/balatro-gba/issues) -[![Pull Requests](https://custom-icon-badges.demolab.com/github/issues-pr/cellos51/balatro-gba?logo=git-pull-request&style=flat&label=Pull%20Requests&labelColor=gray&color=indigo&v=3)](https://github.com/cellos51/balatro-gba/pulls) +[![Build Status](https://img.shields.io/github/actions/workflow/status/cellos51/balatro-gba/build_ci_workflow.yml?style=flat&logo=github&branch=main&label=Builds&labelColor=gray&color=default&maxAge=7200)](https://github.com/cellos51/balatro-gba/actions) +[![Open Issues](https://custom-icon-badges.demolab.com/github/issues/cellos51/balatro-gba?logo=issue-opened&style=flat&label=Issues&labelColor=gray&color=red&maxAge=7200)](https://github.com/cellos51/balatro-gba/issues) +[![Pull Requests](https://custom-icon-badges.demolab.com/github/issues-pr/cellos51/balatro-gba?logo=git-pull-request&style=flat&label=Pull%20Requests&labelColor=gray&color=indigo&maxAge=7200)](https://github.com/cellos51/balatro-gba/pulls) +[![GitHub Discussions](https://custom-icon-badges.demolab.com/github/discussions/cellos51/balatro-gba?logo=comment-discussion&label=Discussions&labelColor=gray&color=blue&style=flat&maxAge=7200)](https://github.com/cellos51/balatro-gba/discussions) This is an attempt to recreate the game **'Balatro'** as accurately as possible, including all of the visual effects that make Balatro feel satisfying to play. This **tech-demo/proof of concept** is strictly limited in content to a minimal version of Balatro and will **NOT** recreate the full game. **This version is intended for people who already own and know how the official full game works.** Please refer to the Balatro Wiki if you need help understanding certain mechanics or abilities. @@ -45,10 +46,10 @@ A docker compose file is provided to build this project. 1.) Install [docker desktop](https://docs.docker.com/compose/install/). 2.) Open a terminal to this projects directory: -- On **linux** run `UID=$(id -u) GID=$(id -g) docker compose up` -- On **windows** run `docker compose up` +- On **Linux** run `UID=$(id -u) GID=$(id -g) docker compose up` +- On **Windows** run `docker compose up` -Docker will build the project and the ROM will be in the same location as step 7 describes below. +Docker will build the project and the ROM will be in the same location as how Step 7 describes below. ## **-Windows-** Video Tutorial: https://youtu.be/72Zzo1VDYzQ?si=UDmEdbST1Cx1zZV2 @@ -71,13 +72,13 @@ Disregard Steps 3-4 and instead click the green code button on the main reposito ## **-Linux-** -1.) Add the devkitPro repo using these instructions https://devkitpro.org/wiki/devkitPro_pacman +1.) Add the devkitPro repository using these instructions https://devkitpro.org/wiki/devkitPro_pacman -2.) Install devkitPro by running `sudo pacman -S gba-dev` and accepting all packages +2.) Install devkitPro by running `sudo pacman -S gba-dev` and accepting all packages. -3.) Activate the devkitPro environment by running `source /etc/profile.d/devkit-env.sh` or opening a new shell +3.) Activate the devkitPro environment by running `source /etc/profile.d/devkit-env.sh` or opening a new shell. -4.) Follow instructions from windows tutorial step 3 +4.) Follow instructions from the Windows tutorial starting from Step 3 ## **Common Issues:** From 3888a198c8506b7cc6d0d88775f7314e785cc0df Mon Sep 17 00:00:00 2001 From: Wheeler <118409873+GreenNinja2525@users.noreply.github.com> Date: Mon, 22 Sep 2025 22:38:57 -0400 Subject: [PATCH 06/12] Change to Shields.io Badges Hopefully this allows them to update properly. Shields.io is way more reliable and updates on its own. Hopefully this works! --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 30c652c..3ec2518 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ # Balatro-GBA [![Build Status](https://img.shields.io/github/actions/workflow/status/cellos51/balatro-gba/build_ci_workflow.yml?style=flat&logo=github&branch=main&label=Builds&labelColor=gray&color=default&maxAge=7200)](https://github.com/cellos51/balatro-gba/actions) -[![Open Issues](https://custom-icon-badges.demolab.com/github/issues/cellos51/balatro-gba?logo=issue-opened&style=flat&label=Issues&labelColor=gray&color=red&maxAge=7200)](https://github.com/cellos51/balatro-gba/issues) -[![Pull Requests](https://custom-icon-badges.demolab.com/github/issues-pr/cellos51/balatro-gba?logo=git-pull-request&style=flat&label=Pull%20Requests&labelColor=gray&color=indigo&maxAge=7200)](https://github.com/cellos51/balatro-gba/pulls) -[![GitHub Discussions](https://custom-icon-badges.demolab.com/github/discussions/cellos51/balatro-gba?logo=comment-discussion&label=Discussions&labelColor=gray&color=blue&style=flat&maxAge=7200)](https://github.com/cellos51/balatro-gba/discussions) +[![Open Issues](https://img.shields.io/github/issues/cellos51/balatro-gba?style=flat&color=red&label=Issues&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ij48cGF0aCBmaWxsPSJ3aGl0ZSIgZD0iTTggOS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzWiI+PC9wYXRoPjxwYXRoIGZpbGw9IndoaXRlIiBkPSJNOCAwYTggOCAwIDEgMSAwIDE2QTggOCAwIDAgMSA4IDBaTTEuNSA4YTYuNSA2LjUgMCAxIDAgMTMgMCA2LjUgNi41IDAgMCAwLTEzIDBaIj48L3BhdGg+PC9zdmc+)](https://github.com/cellos51/balatro-gba/issues) +[![Pull Requests](https://img.shields.io/github/issues-pr/cellos51/balatro-gba?style=flat&color=indigo&label=Pull%20Requests&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ij48cGF0aCBmaWxsPSJ3aGl0ZSIgZD0iTTEuNSAzLjI1YTIuMjUgMi4yNSAwIDEgMSAzIDIuMTIydjUuMjU2YTIuMjUxIDIuMjUxIDAgMSAxLTEuNSAwVjUuMzcyQTIuMjUgMi4yNSAwIDAgMSAxLjUgMy4yNVptNS42NzctLjE3N0w5LjU3My42NzdBLjI1LjI1IDAgMCAxIDEwIC44NTRWMi41aDFBMi41IDIuNSAwIDAgMSAxMy41IDV2NS42MjhhMi4yNTEgMi4yNTEgMCAxIDEtMS41IDBWNWExIDEgMCAwIDAtMS0xaC0xdjEuNjQ2YS4yNS4yNSAwIDAgMS0uNDI3LjE3N0w3LjE3NyAzLjQyN2EuMjUuMjUgMCAwIDEgMC0uMzU0Wk0zLjc1IDIuNWEuNzUuNzUgMCAxIDAgMCAxLjUuNzUuNzUgMCAwIDAgMC0xLjVabTAgOS41YS43NS43NSAwIDEgMCAwIDEuNS43NS43NSAwIDAgMCAwLTEuNVptOC4yNS43NWEuNzUuNzUgMCAxIDAgMS41IDAgLjc1Ljc1IDAgMCAwLTEuNSAwWiI+PC9wYXRoPjwvc3ZnPg==)](https://github.com/cellos51/balatro-gba/pulls) +[![Discussions](https://img.shields.io/github/discussions/cellos51/balatro-gba?style=flat&color=blue&label=Discussions&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNiAxNiIgd2lkdGg9IjE2IiBoZWlnaHQ9IjE2Ij48cGF0aCBmaWxsPSJ3aGl0ZSIgZD0iTTEuNzUgMWg4LjVjLjk2NiAwIDEuNzUuNzg0IDEuNzUgMS43NXY1LjVBMS43NSAxLjc1IDAgMCAxIDEwLjI1IDEwSDcuMDYxbC0yLjU3NCAyLjU3M0ExLjQ1OCAxLjQ1OCAwIDAgMSAyIDExLjU0M1YxMGgtLjI1QTEuNzUgMS43NSAwIDAgMSAwIDguMjV2LTUuNUMwIDEuNzg0Ljc4NCAxIDEuNzUgMVpNMS41IDIuNzV2NS41YzAgLjEzOC4xMTIuMjUuMjUuMjVoMWEuNzUuNzUgMCAwIDEgLjc1Ljc1djIuMTlsMi43Mi0yLjcyYS43NDkuNzQ5IDAgMCAxIC41My0uMjJoMy41YS4yNS4yNSAwIDAgMCAuMjUtLjI1di01LjVhLjI1LjI1IDAgMCAwLS4yNS0uMjVoLTguNWEuMjUuMjUgMCAwIDAtLjI1LjI1Wm0xMyAyYS4yNS4yNSAwIDAgMC0uMjUtLjI1aC0uNWEuNzUuNzUgMCAwIDEgMC0xLjVoLjVjLjk2NiAwIDEuNzUuNzg0IDEuNzUgMS43NXY1LjVBMS43NSAxLjc1IDAgMCAxIDE0LjI1IDEySDE0djEuNTQzYTEuNDU4IDEuNDU4IDAgMCAxLTIuNDg3IDEuMDNMOS4yMiAxMi4yOGEuNzQ5Ljc0OSAwIDAgMSAuMzI2LTEuMjc1Ljc0OS43NDkgMCAwIDEgLjczNC4yMTVsMi4yMiAyLjIydi0yLjE5YS43NS43NSAwIDAgMSAuNzUtLjc1aDFhLjI1LjI1IDAgMCAwIC4yNS0uMjVaIj48L3BhdGg+PC9zdmc+)](https://github.com/cellos51/balatro-gba/discussions) This is an attempt to recreate the game **'Balatro'** as accurately as possible, including all of the visual effects that make Balatro feel satisfying to play. This **tech-demo/proof of concept** is strictly limited in content to a minimal version of Balatro and will **NOT** recreate the full game. **This version is intended for people who already own and know how the official full game works.** Please refer to the Balatro Wiki if you need help understanding certain mechanics or abilities. From ebe789aa52afa359894f0d11d2958b1439a3acca Mon Sep 17 00:00:00 2001 From: Rickey Fehr Date: Tue, 23 Sep 2025 16:15:50 -0700 Subject: [PATCH 07/12] Add git hash baked into ROM for bug reports --- Makefile | 6 ++++++ include/version.h | 7 +++++++ source/game.c | 1 + 3 files changed, 14 insertions(+) create mode 100644 include/version.h diff --git a/Makefile b/Makefile index 9bee64f..d76c021 100644 --- a/Makefile +++ b/Makefile @@ -38,11 +38,17 @@ GRAPHICS := graphics #--------------------------------------------------------------------------------- ARCH := -mthumb -mthumb-interwork +GIT_DIRTY := $(shell git diff-index --quiet HEAD -- || echo "-dirty") +GIT_HASH := $(shell git rev-parse --short HEAD) +GIT_C_FLAGS := -DGIT_HASH=\"$(GIT_HASH)\" -DGIT_DIRTY=\"$(GIT_DIRTY)\" + CFLAGS := -g -O3 -Wall -Werror\ -mcpu=arm7tdmi -mtune=arm7tdmi \ -ffast-math -fomit-frame-pointer -funroll-loops \ $(ARCH) +CFLAGS += $(GIT_C_FLAGS) + CFLAGS += $(INCLUDE) CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions diff --git a/include/version.h b/include/version.h new file mode 100644 index 0000000..8e1345b --- /dev/null +++ b/include/version.h @@ -0,0 +1,7 @@ +#ifndef VERSION_H +#define VERSION_H + +__attribute__((used)) +const char gba_version[] = "GBA_VERSION:" GIT_HASH GIT_DIRTY; + +#endif // VERSION_H diff --git a/source/game.c b/source/game.c index 625ecc6..018ebb6 100644 --- a/source/game.c +++ b/source/game.c @@ -28,6 +28,7 @@ #include "soundbank.h" #include "list.h" +#include "version.h" static uint rng_seed = 0; From 56bbc2ff9ae5b7aa5056d3f874e16da46ad0a249 Mon Sep 17 00:00:00 2001 From: Rickey Fehr Date: Tue, 23 Sep 2025 17:14:18 -0700 Subject: [PATCH 08/12] Add defaults for GIT_HASH and GIT_DIRTY --- Makefile | 2 +- include/version.h | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d76c021..5ac91f7 100644 --- a/Makefile +++ b/Makefile @@ -39,7 +39,7 @@ GRAPHICS := graphics ARCH := -mthumb -mthumb-interwork GIT_DIRTY := $(shell git diff-index --quiet HEAD -- || echo "-dirty") -GIT_HASH := $(shell git rev-parse --short HEAD) +GIT_HASH := $(shell git rev-parse --short HEAD || echo "undef") GIT_C_FLAGS := -DGIT_HASH=\"$(GIT_HASH)\" -DGIT_DIRTY=\"$(GIT_DIRTY)\" CFLAGS := -g -O3 -Wall -Werror\ diff --git a/include/version.h b/include/version.h index 8e1345b..85be8ff 100644 --- a/include/version.h +++ b/include/version.h @@ -1,7 +1,15 @@ #ifndef VERSION_H #define VERSION_H +#ifndef GIT_HASH +#define GIT_HASH "undef" +#endif + +#ifndef GIT_DIRTY +#define GIT_DIRTY "-dirty" +#endif + __attribute__((used)) -const char gba_version[] = "GBA_VERSION:" GIT_HASH GIT_DIRTY; +const char balatro_version[] = "GBALATRO_VERSION:" GIT_HASH GIT_DIRTY; #endif // VERSION_H From b8a441f971893b7c920de341ff6d2d786276b75a Mon Sep 17 00:00:00 2001 From: noctowlhoot Date: Wed, 24 Sep 2025 22:53:54 +0930 Subject: [PATCH 09/12] Update joker_effects.c updated jokers into joker registry --- source/joker_effects.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/source/joker_effects.c b/source/joker_effects.c index 403baa4..6c04579 100644 --- a/source/joker_effects.c +++ b/source/joker_effects.c @@ -550,7 +550,7 @@ static JokerEffect odd_todd_joker_effect(Joker *joker, Card *scored_card) { // graphics available from @MathisMartin31 __attribute__((unused)) -static JokerEffect joker_bootstraps_effect(Joker *joker, Card *scored_card) { +static JokerEffect bootstraps_joker_effect(Joker *joker, Card *scored_card) { JokerEffect effect = {0}; if (scored_card != NULL) return effect; // if card != null, we are not at the end-phase of scoring yet @@ -652,6 +652,13 @@ const JokerInfo joker_registry[] = { { COMMON_JOKER, 4, abstract_joker_effect }, { UNCOMMON_JOKER, 6, bull_joker_effect}, + { RARE_JOKER, 8, the_duo_joker_effect}, + { RARE_JOKER, 8, the_trio_joker_effect}, + { RARE_JOKER, 8, the_family_joker_effect}, + { RARE_JOKER, 8, the_order_joker_effect}, + { RARE_JOKER, 8, the_tribe_joker_effect}, + { UNCOMMON_JOKER, 7, bootstraps_joker_effect}, + { COMMON_JOKER, 5, shoot_the_moon_joker_effect}, #endif }; From 36bcf0fa3027282b3612181cc293898823da7602 Mon Sep 17 00:00:00 2001 From: Rickey Fehr Date: Wed, 24 Sep 2025 20:44:13 -0700 Subject: [PATCH 10/12] Move version into C file --- Makefile | 2 +- source/game.c | 1 - include/version.h => source/version.c | 7 +------ 3 files changed, 2 insertions(+), 8 deletions(-) rename include/version.h => source/version.c (68%) diff --git a/Makefile b/Makefile index 5ac91f7..d187d39 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ CFLAGS += $(INCLUDE) CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions ASFLAGS := -g $(ARCH) -LDFLAGS = -g $(ARCH) -Wl,-Map,$(notdir $*.map) +LDFLAGS = -g $(ARCH) -Wl,-Map,$(notdir $*.map),--undefined=balatro_version #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project diff --git a/source/game.c b/source/game.c index 018ebb6..625ecc6 100644 --- a/source/game.c +++ b/source/game.c @@ -28,7 +28,6 @@ #include "soundbank.h" #include "list.h" -#include "version.h" static uint rng_seed = 0; diff --git a/include/version.h b/source/version.c similarity index 68% rename from include/version.h rename to source/version.c index 85be8ff..9d850d8 100644 --- a/include/version.h +++ b/source/version.c @@ -1,6 +1,3 @@ -#ifndef VERSION_H -#define VERSION_H - #ifndef GIT_HASH #define GIT_HASH "undef" #endif @@ -9,7 +6,5 @@ #define GIT_DIRTY "-dirty" #endif -__attribute__((used)) +__attribute__((section(".version"), used)) const char balatro_version[] = "GBALATRO_VERSION:" GIT_HASH GIT_DIRTY; - -#endif // VERSION_H From 88726cbb39b39ef20f0fd048dc9240e2168e87f1 Mon Sep 17 00:00:00 2001 From: Rickey Fehr Date: Wed, 24 Sep 2025 20:49:01 -0700 Subject: [PATCH 11/12] Add script to get version --- scripts/build_bug_report.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scripts/build_bug_report.py diff --git a/scripts/build_bug_report.py b/scripts/build_bug_report.py new file mode 100644 index 0000000..017127a --- /dev/null +++ b/scripts/build_bug_report.py @@ -0,0 +1,27 @@ +#!/usr/bin/env python3 + +import sys +import re + +def grep_binary_offsets(path, pattern): + with open(path, "rb") as f: + data = f.read() + + results = [] + for match in re.finditer(rb"[ -~]{4,}", data): + s = match.group() + if re.search(pattern.encode(), s): + results.append((match.start(), s.decode("utf-8", errors="ignore"))) + return results + +if __name__ == "__main__": + if len(sys.argv) < 2: + print("Usage: python script.py ") + sys.exit(1) + + file_path = sys.argv[1] + pattern = "GBALATRO_VERSION" + + for offset, text in grep_binary_offsets(file_path, pattern): + version = text.split(":")[1] + print(f"git hash: {version}") From 0187b5f78e2b7d711fc37f12b8f52664f0c4214b Mon Sep 17 00:00:00 2001 From: noctowlhoot Date: Tue, 7 Oct 2025 20:24:00 +1030 Subject: [PATCH 12/12] Update source/joker_effects.c Co-authored-by: MeirGavish --- source/joker_effects.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/source/joker_effects.c b/source/joker_effects.c index 6c04579..fec1273 100644 --- a/source/joker_effects.c +++ b/source/joker_effects.c @@ -571,13 +571,10 @@ static JokerEffect shoot_the_moon_joker_effect(Joker *joker, Card *scored_card) int hand_size = hand_get_size(); for (int i = 0; i < hand_size; i++ ) { - switch (hand[i]->card->rank) { - case QUEEN: - - effect.mult += 13; - default: - break; - } + if (hand[i]->card->rank == QUEEN) + { + effect.mult += 13; + } } return effect;