Merge branch 'main' into main

This commit is contained in:
Geralt
2025-10-08 23:25:24 +02:00
committed by GitHub
19 changed files with 106 additions and 30 deletions
+9 -1
View File
@@ -4,6 +4,8 @@ on:
push:
branches:
- main
tags:
- "v*"
pull_request:
branches:
- main
@@ -19,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Get docker image cache
uses: actions/cache@v4
@@ -53,3 +55,9 @@ jobs:
- name: Build the project
run: docker compose -f docker-compose.yml run --rm balatro sh -c "make -j$(nproc)"
- uses: softprops/action-gh-release@v2
if: ${{ startsWith(github.ref, 'refs/tags/') }}
with:
files: |
build/balatro-gba.gba
+25 -4
View File
@@ -41,15 +41,36 @@ This **tech-demo/proof of concept** is strictly limited in content to a minimal
# **Build Instructions:**
## **-Docker-**
A docker compose file is provided to build this project.
A docker compose file is provided to build this project. It provides a standard build environment for this projects CI/CD and can also be used to build the ROM locally.
1.) Install [docker desktop](https://docs.docker.com/compose/install/).
_Some users may find this option to be the easiest way to build locally._
- _This option **avoids** setting up the development environment as described below._
- _No additional software besides **docker desktop** is required._
2.) Open a terminal to this projects directory:
### Step-by-Step
1.) Install [docker desktop](https://docs.docker.com/desktop/) for your operating system.
2.) Open a terminal to this project's directory:
- 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 how Step 7 describes below.
<details>
<summary><i>How do I open a terminal in windows?</i></summary>
---
From the file explorer, you can open a folder in **powershell** (_a modern windows terminal_):
- **hold 'Shift'** and **Right Click** on the folder.
- Select **"Open PowerShell window here"** from the popup menu.
---
</details>
3.) Docker will build the project and the ROM will be in the same location as step 7 describes below.
## **-Windows-**
Video Tutorial: https://youtu.be/72Zzo1VDYzQ?si=UDmEdbST1Cx1zZV2
+2 -2
View File
@@ -1,8 +1,8 @@
services:
balatro:
image: devkitpro/devkitarm:latest
working_dir: /balatro
working_dir: /balatro-gba
volumes:
- ./:/balatro
- ./:/balatro-gba
user: "${UID-1000}:${GID-1000}"
command: ["sh", "-c", "make -j$(nproc)"]
+1
View File
@@ -0,0 +1 @@
-gB4 -Mw4 -Mh4 -m! -pn 16
Binary file not shown.

After

Width:  |  Height:  |  Size: 877 B

+1
View File
@@ -0,0 +1 @@
-gB4 -Mw4 -Mh4 -m! -pn 16
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

+1
View File
@@ -0,0 +1 @@
-gB4 -Mw4 -Mh4 -m! -pn 16
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+1
View File
@@ -0,0 +1 @@
-gB4 -Mw4 -Mh4 -m! -pn 16
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

+1
View File
@@ -0,0 +1 @@
-gB4 -Mw4 -Mh4 -m! -pn 16
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+1
View File
@@ -0,0 +1 @@
-gB4 -Mw4 -Mh4 -m! -pn 16
Binary file not shown.

After

Width:  |  Height:  |  Size: 955 B

+6
View File
@@ -13,3 +13,9 @@ DEF_JOKER_GFX(11)
DEF_JOKER_GFX(12)
DEF_JOKER_GFX(13)
DEF_JOKER_GFX(14)
DEF_JOKER_GFX(15)
DEF_JOKER_GFX(16)
DEF_JOKER_GFX(17)
DEF_JOKER_GFX(18)
DEF_JOKER_GFX(19)
DEF_JOKER_GFX(20)
+1 -1
View File
@@ -36,7 +36,7 @@
#define DEFAULT_JOKER_ID 0
#define GREEDY_JOKER_ID 1 // This is just an example to show the patern of making joker IDs
#define JOKER_STENCIL_ID 16
#define PAREIDOLIA_JOKER_ID 30
#define PAREIDOLIA_JOKER_ID 41
typedef struct
{
+6
View File
@@ -16,5 +16,11 @@
#include "joker_gfx12.h"
#include "joker_gfx13.h"
#include "joker_gfx14.h"
#include "joker_gfx15.h"
#include "joker_gfx16.h"
#include "joker_gfx17.h"
#include "joker_gfx18.h"
#include "joker_gfx19.h"
#include "joker_gfx20.h"
#endif
+51 -22
View File
@@ -304,9 +304,6 @@ static JokerEffect blue_joker_effect(Joker *joker, Card *scored_card) {
return effect;
}
// Using __attribute__((unused)) for jokers with no sprites yet to avoid warning
// Remove the attribute once they have sprites
__attribute__((unused))
static JokerEffect raised_fist_joker_effect(Joker *joker, Card *scored_card)
{
JokerEffect effect = {0};
@@ -331,7 +328,6 @@ static JokerEffect raised_fist_joker_effect(Joker *joker, Card *scored_card)
return effect;
}
__attribute__((unused))
static JokerEffect reserved_parking_joker_effect(Joker *joker, Card *scored_card) {
JokerEffect effect = {0};
if (scored_card != NULL)
@@ -386,7 +382,6 @@ static JokerEffect scary_face_joker_effect(Joker *joker, Card *scored_card) {
return effect;
}
__attribute__((unused))
static JokerEffect abstract_joker_effect(Joker *joker, Card *scored_card) {
JokerEffect effect = {0};
if (scored_card != NULL)
@@ -399,7 +394,6 @@ static JokerEffect abstract_joker_effect(Joker *joker, Card *scored_card) {
return effect;
}
__attribute__((unused))
static JokerEffect bull_joker_effect(Joker *joker, Card *scored_card) {
JokerEffect effect = {0};
if (scored_card != NULL)
@@ -480,7 +474,6 @@ static JokerEffect the_duo_joker_effect(Joker *joker, Card *scored_card) {
return effect;
}
// graphics available from @MathisMartin31
__attribute__((unused))
static JokerEffect the_trio_joker_effect(Joker *joker, Card *scored_card) {
@@ -547,7 +540,8 @@ static JokerEffect the_tribe_joker_effect(Joker *joker, Card *scored_card) {
return effect;
}
// Using __attribute__((unused)) for jokers with no sprites yet to avoid warning
// Remove the attribute once they have sprites
// graphics available from @MathisMartin31
__attribute__((unused))
static JokerEffect bootstraps_joker_effect(Joker *joker, Card *scored_card) {
@@ -597,6 +591,41 @@ static JokerEffect triboulet_joker_effect(Joker *joker, Card *scored_card) {
return effect;
}
static JokerEffect blueprint_joker_effect(Joker *joker, Card *scored_card) {
JokerEffect effect = {0};
List* jokers = get_jokers();
int list_size = list_get_size(jokers);
for (int i = 0; i < list_size - 1; i++ ) {
JokerObject* curr_joker_object = list_get(jokers, i);
if (curr_joker_object->joker == joker) {
JokerObject* next_joker_object = list_get(jokers, i + 1);
effect = joker_get_score_effect(next_joker_object->joker, scored_card);
break;
}
}
return effect;
}
static JokerEffect brainstorm_joker_effect(Joker *joker, Card *scored_card) {
JokerEffect effect = {0};
static bool in_brainstorm = false;
if (in_brainstorm)
return effect;
List* jokers = get_jokers();
JokerObject* first_joker = list_get(jokers, 0);
if (first_joker != NULL && first_joker->joker->id != JOKER_BRAINSTORM_ID) {
// Static var to avoid infinite blueprint + brainstorm loops
in_brainstorm = true;
effect = joker_get_score_effect(first_joker->joker, scored_card);
in_brainstorm = false;
}
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
@@ -639,24 +668,24 @@ const JokerInfo joker_registry[] = {
// Business card should be paired with Shortcut for palette optimization when it's added
{ COMMON_JOKER, 4, scary_face_joker_effect }, // 28
{ COMMON_JOKER, 4, smiley_face_joker_effect }, // 29
{ UNCOMMON_JOKER, 5, NULL /* Pareidolia */ }, // 30
{ COMMON_JOKER, 5, raised_fist_joker_effect }, // 30
{ COMMON_JOKER, 6, reserved_parking_joker_effect }, // 31
{ COMMON_JOKER, 4, abstract_joker_effect }, // 32
{ UNCOMMON_JOKER, 6, bull_joker_effect}, // 33
{ RARE_JOKER, 8, the_duo_joker_effect}, // 34
{ RARE_JOKER, 8, the_trio_joker_effect}, // 35
{ RARE_JOKER, 8, the_family_joker_effect}, // 36
{ RARE_JOKER, 8, the_order_joker_effect}, // 37
{ RARE_JOKER, 8, the_tribe_joker_effect}, // 38
{ RARE_JOKER, 10, blueprint_joker_effect }, // 39
{ RARE_JOKER, 10, brainstorm_joker_effect }, // 40
{ UNCOMMON_JOKER, 5, NULL /* Pareidolia */ }, // 41
// 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 },
{ COMMON_JOKER, 4, abstract_joker_effect },
{ UNCOMMON_JOKER, 6, bull_joker_effect},
{ UNCOMMON_JOKER, 6, acrobat_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},
{ UNCOMMON_JOKER, 7, bootstraps_joker_effect},
{ COMMON_JOKER, 5, shoot_the_moon_joker_effect},
#endif
};
@@ -672,4 +701,4 @@ const JokerInfo* get_joker_registry_entry(int joker_id) {
size_t get_joker_registry_size(void) {
return joker_registry_size;
}
}