Commit Graph
33 Commits
Author SHA1 Message Date
GeraltandMathisMartin31 c706a387a9 Implement a global SpriteObject update loop (#553)
* Implement `sprite_object_update_all`

* clang format

* Change update order

* tmp

* make it crash

* Fix bad address crash

* Address @MeirGavish's comments

* Tweaked card draw position further

* Tweaked card draw position further, again

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-06-17 19:26:53 -07:00
GeraltandMathisMartin31 1df8402900 [Feature] Implement seeded runs by adding a Seed selection menu (#482)
* initial commit

* wip

* WIP

* WIP

* clang format

* Choose Seed navigation mostly done

* seed input navigation done

* seed input done

* cleanup and clang format

* Implement base 10 to 36 conversions

* Enable seeded runs

* clang format

* show default deck sprite, name and description

* Rename Deck enum to DeckType

* Implement arbitrary 9-patch expand system

* Make 9-patch example smaller in the docs

* Improve NinePatchRect docs

* fix Deck back side sprite palette

* clang format

* Add last deck description

* clang format

* Fix 'Z' in seed input keyboard

* Fix rebase issue

* fix deck sprite not updating

* Documents static funcs in run_setup.c

* more documentation

* clang format

* Move Play button to the left in its row

* Tests WIP

* removing tests for random.h

* use the new StateMachine struct

* First wave of fixes

* Fix the 9-patch again

* Changed the base 36 logic so it's in big endian

* properly set end of base 36 string to '\0'

* typos

* fix cursor position after rolling a seed + fix random seed generation

* Make keyboard more intuitive to use

* static const var

* Address more comment from @ricfehr3

* clang format

* clang format

* clang format

* clang format

* clang format

* clang format

* clang format

* fix deck palette

* create the `DEF_SEED_KEYBOARD_BUTTON_OBJECT` macro

* Replace `expand_3x3` by a call to `expand_9-patch`

* clang format

* clang format

* clang format

* fix rebase iussue in state_machine.h

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-06-02 00:06:37 -07:00
221b6d77c0 Add option to enable a more readable deck, suggestion by @Turro75 (#495) (#511)
* Options menu revamp

* Implement readable card sprites

* redraw characters to fix the original style

* clang format

* remove usage of UNDEFINED (-1) for unsigned values

* typo

* change save fix for something cleaner

* remove dependency to game_variables.h from card.c

* Make the palette look less silly ^^'

* Address @ricfehr3's comments

* clang format

* quick rename

* clang format

---------

Co-authored-by: Geralt <84459734+MathisMartin31@users.noreply.github.com>
Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
Co-authored-by: Turro75 <valerio.turrini@gmail.com>
2026-05-25 11:11:33 -07:00
Rickey cebdebbfd0 Revert "Add option to enable a more readable deck, suggestion by @Turro75 (#495)" (#510)
This reverts commit d3c0357856.
2026-05-25 11:01:13 -07:00
GeraltandMathisMartin31 d3c0357856 Add option to enable a more readable deck, suggestion by @Turro75 (#495)
* Options menu revamp

* Implement readable card sprites

* redraw characters to fix the original style

* clang format

* remove usage of UNDEFINED (-1) for unsigned values

* typo

* change save fix for something cleaner

* remove dependency to game_variables.h from card.c

* Make the palette look less silly ^^'

* Address @ricfehr3's comments

* clang format

* quick rename

* clang format

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-05-25 11:00:37 -07:00
GeraltandMathisMartin31 e7f550ce22 [Feature] Implement options menu and reading/writing values from/to the SRAM (#449)
* background

* Implement Options button

* Update main menu artwork

* add options menu tiles

* prepare options menu handling

* incorporate main menu refactor

* toto

* add all menu interactions

* do not reset selection_x in main_menu

* options struct

* fix rebase from ricfehr3's repo

* Implement high contrast cards

* Save/Load options values to SRAM

* load options on game_init and validate data within the load_options function

* Get changes from ricfehr3's PR

* recover fix for glitched ace

* clang format

* clang format

* clang format

* Save 500B of image data by using only minimal set of tiles instead of keeping final window in source file

* clang format

* clang format

* Implement Options button

* Update main menu artwork

* progress, leaving it alone for now until discussion

* make game_vars an extern

* Move options vars into their own struct

* rollback previous commit

* Implement save validation. Version check to come

* implement data validity + version check for game saves

* clang format

* Save position in rng sequence for consistent run after load

* fix rebase issues

* fix rebase issue

* remove unused/duplicate define

* Oops, made a mistake when testing PR #424

* encode high contrast palette into an image, and load it at game_start

* document save.c/h and correct typos

* correct alignment

* game speed and high contrast buttons working

* small cleanup

* sliders also work again now

* clang format

* Moved balatro_version extern declaration to version.h file

* removed unsused variable

* make showing ROM version a toggle

* move ante, round and money to the GameVariables struct

* Rename SaveCheckInfo struct to SaveHeader for clarity

* Add SaveHeader struct explanation

* clang format

* Revert unnecessary tileset optimization

* SFX now follows the sound volume slider

* clang format

* Music now follows volume slider

* Changed volume slider increment from 5 to 20 to avoid having the music sound too rough under 20% volume

* refactor main_menu.c to use SelectionGrid and Button structs

* clang format

* make a "new" save button so we don't save during the state transition

* clang format

* Reduced state transition flicker by only changing affine background to a different one

* Fix loading game too late in game init sequence

* First batch of suggestions from @MeirGavish

* Remove unnecessary intermediary buffers for high contrast palette swapping

* comment row warp hack for button input

* Add some of Copilot's suggestions

* rename balatro_version into gbalatro_version for rebranding reasons + version display erase screen fix

* remove unnecessary NULL check on `on_selection_changed` method

* implement small game speed arrow buttons animation

* factorize some code

* remove unnecessary data validation in load_game(), since we already checked the header

* Implement @MeirGavish 's suggestion regarding splitting the huge `on_update` function

* clang format

* implement @ricfehr3 's suggestion about keeping last selected button instead of using an obscure `on_boot` boolean

* Apply @ricfehr3's suggestions

* fix clang-format flags

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-05-02 14:28:52 -07:00
MeirGavish 9bffe5c9a9 Refactor - remove selected from SpriteObject (#305) 2025-12-12 18:44:26 -08:00
Rickey 184ee719b3 Clang format card.c/h (#256) 2025-11-26 00:52:04 +02:00
MeirGavish b472ce2bad Changed the order of suits to match the original Balatro (#189) 2025-10-30 11:18:36 +02:00
Rickey Fehr d499abe2c4 Cleanup for PR 2025-10-17 16:55:09 -07:00
Rickey Fehr 06cd13a17f Centralize location of memory pools
This commit centralizes the location of memory pools and adds an
associated script (scripts/get_memory_map.sh) to read the memory map.
2025-10-17 16:55:09 -07:00
MonteCrysto b7a94fa085 Fix some issues (I actually forgot to compile) 2025-09-30 23:34:11 +02:00
MeirGavish 2539954dea Fixed build error from previous merge and applied review comments 2025-08-17 11:10:00 +03:00
theturtlemafia 254efd7841 implement feedback 2025-08-09 19:23:47 -04:00
theturtlemafia a72458c2c3 adds jokers 6-16. Extract hand type detection logic from hand_get_type to be used by jokers as well 2025-07-28 18:27:48 -04:00
MeirGavish 95565862b0 Extracted JokerObject and CardObject common functionalities to SpriteObject, removing duplicate code and dangerous casts. 2025-07-27 01:13:57 +03:00
cellos51 6a1f3bcd7a I hope this works 2025-07-23 20:14:22 -04:00
MeirGavish c781807ed8 Revert "Sprite vram optimizations" 2025-07-24 02:14:04 +03:00
cellos51 011bc64bab huge memory save 2025-07-23 16:17:24 -04:00
cellos51 1b4267893d Added greedy joker and refactor joker system 2025-07-22 20:00:05 -04:00
cellos51 176910c483 Jokers appear in the shop but don't do anything yet 2025-07-18 19:29:17 -04:00
cellos51 4a5644eddb Defining a basic system for jokers 2025-07-17 21:47:50 -04:00
MeirGavish 8bbe707dab refactor - removed some magic numbers 2025-06-29 11:58:54 +03:00
cellos51 af43a91f19 moved all logic from card.c to game.c for future optimization 2025-06-26 00:20:46 -04:00
cellos51 126d5a5bab pushing changes before i do a major refactor 2025-06-25 00:07:00 -04:00
cellos51 c06aad7b26 Still some jank stuff right now but i think the whole sorta round functionality has been more or less finished 2025-06-23 18:57:51 -04:00
cellos51 5055c9abc7 functional basic gameplay 2025-06-12 01:44:54 -04:00
cellos51 85b25e575f Made the card animations for playing exactly in the same order and manor as Balatro (perfectionism moment) 2025-06-11 14:10:49 -04:00
cellos51 423c061b2f Cards can now be played but no score will be given 2025-06-10 19:22:45 -04:00
cellos51 2d21c83f89 Update card handling logic and improve background management; add hand types and refine game state transitions. 2025-05-19 11:24:13 -04:00
cellos51 7ce6082edd Refactor hand_discard function to return a boolean and update game logic for discarding cards; add background_play_gfx and improve text engine initialization. 2025-02-16 22:07:44 -05:00
cellos51 edfa358e35 Added the ability to discard cards in a hand and other various changes. 2025-02-08 22:27:05 -05:00
cellos51 cac321a325 first commit 2025-01-31 17:42:09 -05:00