Commit Graph

729 Commits

Author SHA1 Message Date
wuxu 7c62cfc950 Add a main-menu Joker gallery
Expose every registered Joker from a paged review screen entered with Start or Select. Reuse the gameplay card art and description renderers, support controller navigation, and clean up the preview object when returning to the menu.
2026-07-19 11:36:38 +08:00
wuxu c1632590c6 Localize Joker descriptions in Chinese
Translate every registered Joker description while preserving names and gameplay effects. Encode the text through the extended TTE font and center explicit UTF-8 lines without counting formatting tags.
2026-07-19 11:36:01 +08:00
wuxu c7ef3c0047 Add Chinese text rendering support
Extend the bitmap font pipeline with the Chinese Joker glyph subset and encode supported UTF-8 text for Tonc TTE. Move the affine map clear of the expanded font, add a compile-time VRAM overlap guard, and cover every custom glyph with host tests.
2026-07-19 11:35:14 +08:00
MeirGavish 7a5a4a1276 Updated all static variables to have the s_ prefix and constants to upper case (#591)
* Updated all static variables to have the s_ prefix and constants to upper case

* Renamed missed sneaky functions in round.c (+ clang-format...)

* Renamed a few more missed constants

* Updated rng_update() documentation

* Apply suggestions from Copilot's code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Added missed suggestion

* Updated rng_update() comment

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-16 20:21:18 +03:00
Geralt 6e7d8a8399 Document hand analysis functions in hand.h (#572)
* doxygen

* clang format

* Update round.cFix call to `find_straight_in_played_cards`

* Update straight/flush functions docs in hand.h

* typo

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-07-10 17:46:05 -07:00
MeirGavish d24b0b5619 Refactor shop code to use generic Item (#536)
* Turned SpriteObject into a member of JokerObject and CardObject and expiremented with casting

* Extracted shop code to use generic `SpriteObject`

* Extracted shop joker generation to a function

* Renamed object -> item

* Added setters and getters for `SpriteObject` members and updated all accesses to use them with casting (AI used for tedious work and reviewed - model Raptor mini)

* Added sprite_object_set_vx() because sprite_object_set_vy() exists and reordered the function order to have x,y parameters first, then targets

* Added Item object to act as a purchasable interface for the shop - AI used (model Raptor mini)

* Added -fms-extensions and switched to anonymous inheritance

* Fixed anonymous inheritance for joker and added direct access for that too

* fix build error from previous commit + clang-format

* Fixed build errors + clang-format for real this time (I hope...)

* clang-format one last time, I don't understand it anymore

* clang-format is annoying

* Added uses of CHECK_NULL_ARG macros

* Merged item_defs.h into item.h and fixed build error from previous commit

* clang-format...?

* Changed sprite_object_new() into sprite_object_init() and made it accept a parameter instead of returning one to make it less awkward

* Updated sprite_object_init() documentation

* Updated sprite_object_destroy documentation

* More clang-format

* Renamed add_to_inventory to acquire and updated documentation

* Added function documentations

* Update documentation + swap order of consumable and playing card types

* Added documentation for new files (+ small addition to button.h)

* clang-format

* Used typedef

* A bit more documentation

* Changed sho pcode to use generic Item instead of SpriteObject

* clang-format + fixed NULL-check error

* Revert weird clang-format...?

* clang-format for real

* Fixed errors from rebase on log_function_name

* Fixed build errors from rebase on main

* Added some more documentation about first member struct inheritance

* typo fix

* typo fix for real

* Removed SpriteObject field getters/setters (AI used - model Raptor mini)

* Renamed item_acquire -> item_on_acquired

* Added item_can_acquire()

* clang-format

* Fixed some sprite issues but not all...

* Fixed some more issues

* Cleanup JokerObject some more JokerObjects in the shop

* Added `item_destroy()`

* Added item_set_available_to_shop, CHECK_ITEM_TYPE macros + small documentation updates

* Another small JokerObject->Item replacement

* Removed item_set_available_to_shop and replaced with item_roll_new() and item_dispose(), also changed "available_to_shop" semantics to "rollable"

* Re-applied changes from game.c to round.c after rebase on main

* Added partial implementations of item functions for playing cards

* Line endings fix...

* Macro renames, function documentations

* Updated documentations

* Apply fixes from Copilot review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Fix card_object_get_buy_price type checking

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Avoid double pointer cast on dispose

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Apply suggestions from @ricfehr3's code review

Co-authored-by: Rickey <ric@rf3.xyz>

* Remove redundant comments

* Moved error checking before joker_get_random_rarity

Co-authored-by: Rickey <ric@rf3.xyz>

* Fixed build error from rebase

* clang-format

* Added doxygen documentation for Item explaining inheritance

* Removed unnecessary comment

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Rickey <ric@rf3.xyz>
2026-07-09 09:13:51 +03:00
Geralt 369c680cb7 [Enhancement] Game Over screen rework (#548)
* WIP

* getting somewhere

* clean up everything real good

* doc

* clang format

* Fix round.c after merge

* Remove extra deck_pop declaration

* Remove unnecessary comment

* address MeirGavish's review

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-07-08 03:48:31 +03:00
MeirGavish da16e6a486 [Refactor] Moved reset_top_left_panel_bottom_row() to common_ui.c/.h (#581) 2026-07-06 06:26:18 +03:00
MeirGavish 9a4aaca399 Fixed #575 incorrect joker sell value displayed after displaying description (#576) 2026-07-02 13:26:00 +03:00
MeirGavish 4d26f13c26 Add logging macros that include the function name (#557)
* Added function name logging to mgba_logger

* Addendum to no-op defines

* Fixed compile errors

* Added "()" to function name in log to make it clearer it's a function

* Corrected documentation

* clang-format...?

* Removed MGBA_LOG_LEVEL_MASK magic number

* Added CHECK_NULL_ARG macros

* clang-format...?

* clang-format for real

* Added documentation for CHECK_NULL_ARG_VOID and CHECK_NULL_ARG_RET

* Fixed typo

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Fixed macro safety by wrappinh with do-while

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Fixed format string cut risk in mgba_func_printf

* clang-format

* clang-format some more

* clang-format for real

* Fixed DEBUG -> INFO in comment

Co-authored-by: Rickey <ric@rf3.xyz>

* Moved NULL-check macros to util.h and renamed them

* Small additions - macro rename + clang-format

* Truncate the string instead of the function name

* Cleaned up code from previous commit

* clang-format

* Added mgba_logger_available check to mgba_func_printf

* Updated documentation for latest change

* Changed CHECK_NULL_ARG functions to generic RETURN_ON_ERROR_VAL functions.

* clang-format

* Changed back to specifically check NULL

* clang-format

* Changed "=" into "==" in the error message

* clang-format

* Fixed forgotten "=="

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Rickey <ric@rf3.xyz>
2026-06-28 06:54:47 +03:00
Geralt 45eac259a5 [Refactor] Separate Round logic into its own file (#570)
* Everything works, need to clean up

* cleanup

* fix rebase issue

* clang format

* docs

* clang format

* clang format

* address part of review

* Protect against edge case when discarding at end of hand

* Protect undiscard against popping a discarded card that doesn't exist

* Protect against out of bounds access to the `played` cards stack

* fix condition in `select_four_of_a_kind_cards_in_played_hand`

* change `get_played_top() + 1` to `get_played_size()`

* move `can_play/discard_hand` functions to round.c

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-06-27 16:57:37 -07:00
Geralt f722b9eef4 better flames (#571)
Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-06-22 16:11:38 +03:00
Wheeler 5b5facca8c Logo Tweak, Deck Color Fix and Joker Border Consistency (QOL) (#547)
* Touchups (QOL Changes)

- Tweaked Logo to look slightly different (moved the "G" and "!" closer to other letters and connected them like in the actual logo from the full game)
- Changed the face down decks to have their colors changed. The red used before was darker than the one on the shop and round screens. I color matched them from the full game.
- I changed the borders of some Jokers to be white, like how they are in the full game. (Minor tweaks were made to them)

*I tested them and it seems to not break anything sprite-wise*

* Undo Joker Art Changes + Fix Logo

- Added changes to Joker Borders
- (Blue Joker has gray border to match the others, the only Joker with a different border is Blackboard)
- Reverted "!" Point (It's two pixels closer to the other letters unlike the original)
2026-06-20 11:56:03 -07:00
Geralt 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
MeirGavish d2cdc7af1b Fixed argument on calls to obj_unhide (#562) 2026-06-16 18:23:00 -07:00
Geralt 751a547059 Implement new sprite_object_position function (#559)
Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-06-16 20:33:31 +03:00
Rickey bf08d4eb78 Refine controls section in README.md (#552)
* Refine controls section in README.md

Updated control descriptions for clarity and consistency.

* Update control instructions in README.md

* Update README.md

Co-authored-by: MeirGavish <meir.gavish@gmail.com>

---------

Co-authored-by: MeirGavish <meir.gavish@gmail.com>
2026-06-13 01:17:56 -07:00
Rickey 36b01e0c95 Remove automatic releases on tags (#554) 2026-06-12 21:38:43 -07:00
Geralt 6170efca99 Fix missing Deck size/max text after showing Joker description in the Shop
Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-06-12 20:05:57 -07:00
Rickey 8111b6e046 Cleanup sprite_position usage (#539)
* Cleanup sprite_position usage

* Add IWRAM_CODE attr for inline sprite function

* removed extra sprite_position call
2026-06-11 18:01:41 -07:00
Elliot Tester 35c7a29cc5 Scripts Take Rom as Arg (#512)
* initial

* suggestions for get_memory_map.sh

* CONTRIBUTING.md suggestions

* save_build.sh suggestions

* rerun

* env variable

* add to env

* print usage and remove redundant qoutes
2026-06-10 21:23:47 -07:00
Rickey 4cbdd6c004 Temporarily remove "new run" and "resume" buttons (#546)
* Temporarily remove "new run" and "resume" buttons

* clang format

* Add apology
2026-06-10 21:09:12 -07:00
MeirGavish 2ea3e7b19c Removed dubious sprite_object cast from long ago (#538) 2026-06-09 19:38:47 -07:00
Rickey Fehr 2665f5bff5 Revert "Temporarily remove "new run" and "resume" buttons"
This reverts commit 55073b5b1d.
2026-06-09 19:30:58 -07:00
Rickey Fehr 55073b5b1d Temporarily remove "new run" and "resume" buttons 2026-06-09 19:26:01 -07:00
Geralt 022535c1e7 swap bleuprint and brainstorm's descriptions (#545)
Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-06-09 19:08:11 -07:00
Geralt e26558e1a5 [Feature] Implement Joker descriptions in the Shop when holding B (#530)
* WIP

* WIP

* WIP

* WIP

* Tags are bugged but it's looking good

* Centering is bugged, almost there

* WIP

* Fixed centeriiiing, yaaaay

* good progress

* add proper '\n' support

* WIP descriptions

* All descriptions are there ^^

* missing 9-patch for pretty display

* WIP

* fix rebase issues

* Fix minor Run Setup screen issues

* Almost done, only one fix to go

* Aaaalmooost doooneeeee

* make desc frame size adaptative

* add rarity color and text

* final cleanup

* clang format

* clang format

* clang format

* clang format

* clang format

* Fix Joker update loop index

* Fix const and Bull description

* Fix unwanted button SFX

* fix tte colors

* Add misprint description

* Fix justified line length computation

* Add safeguards to tag parsing loop

* clang format

* Fix Ante bugged display at boss blind end

* Tweak suit colors

* Final fixes

* Simplified the way we print descriptions

* simplify further

* get rid of weird macro

* Fix Onwed joker price when holding A after showing its description

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-06-08 18:16:37 -07:00
Rickey 917354f057 Clarify Linux installation instructions (#531)
Added note about Ubuntu version requirements for installation.
2026-06-05 21:29:35 -07:00
MeirGavish 47e0e3ae0e Fixed issue #528 - incorrect joker sell value display (#529) 2026-06-02 18:34:32 -07:00
Geralt 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
MeirGavish 21d8d912ab Replaced lose sound effect with original ripped sound effects (#522)
* Replaced lose sound effect with original ripped sound effects

* Increased lose sfx sample rate to 44.1khz - quality is better and rom size seems unaffected

* Update source/game/game_over.c

Co-authored-by: Rickey <ric@rf3.xyz>

* Fixed game over sfx constants types


---------

Co-authored-by: Rickey <ric@rf3.xyz>
2026-06-01 00:16:45 +03:00
MeirGavish 8dc96b6bbb Refactor - Moved shop data structures to shop.c/.h (#521)
* Moved shop data structures to `shop.c/.h`

* Renamed static variables and reset function
2026-05-31 12:32:27 +03:00
Rickey 63b6584706 Feature/game over audio (#494)
* initial additions

* Move current_blind to game vars

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* Compile but is broken

* temp fix for token location

* tmp

* Working, lets clean up

* remove todo

* Remove odd reroll blind variable

* fix skipping blind screen

* fix reroll

* remove magic for blind token locations

* clang format

* Cleanup button highlight in blind menu

* some cleanup

* Add layout file for global UI rects

* remove dead code

* Clang format

* clang format it up

* Move reset top left funct to gfx utils

* make note of soon-to-be removed vars

* Cleanup gamevars declaration

* Cleanup layout file

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Add include for stdbool.h in common_ui.h

* Cleanup rect declaration

* Start moving state machine stuff to new file

* quick tmp

* oops, add new files

* working call list

* fixed pointer stuff

* working as per norm

* working replacement

* move defines to static const

* fix compile issue

* Add some missing "void"s

* Working new substates

* add statemachine to blind select

* Fix game restart statemachine leak

* clang-format

* Clang format

* Rework shop exit logic

* Use new state machine in shop

* Remove substates entirely

* Remove debug stuff

* Clang format

* document state machine better

* update list tests

* clang-format

* Update for PR

* Claaaaang format

* another clang-format

* Remove extra state in round_end

* cleanup docs for removals in lists

* clang-format... again

* update doxygen format

* Clang format

* tmp

* Update for Pr

* clang-format

* Cleanup for only supporting losing

* bug fix, thanks logs!

* Fix dangling pointer bug

The control of removing statemachines may call issues if starting the
function is done from another state machine call. To remedy this, add a
flag to determine if a state machine is registered and return early
instead of blindly removing it to re-add.

* Fix bug with audio iterations possibly going in reverse

* Remove extra includes

* Clang-format

* Add sound effects for game win/lose

* adjust audio steps

* tmp

* Nice sounding and cleaned up

* Fix and cleanup

* clang-format

* clang-format

* clang format again

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-27 21:57:30 -07:00
Geralt d2e453c256 Prevent bad colors in case affine_background_set_color is called twice by mistake (#505)
Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-05-25 21:55:53 -07:00
Rickey 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
Geralt 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
Rickey 92cb9f9883 Refactor/state machine (#470)
* initial additions

* Move current_blind to game vars

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* tmp

* Compile but is broken

* temp fix for token location

* tmp

* Working, lets clean up

* remove todo

* Remove odd reroll blind variable

* fix skipping blind screen

* fix reroll

* remove magic for blind token locations

* clang format

* Cleanup button highlight in blind menu

* some cleanup

* Add layout file for global UI rects

* remove dead code

* Clang format

* clang format it up

* Move reset top left funct to gfx utils

* make note of soon-to-be removed vars

* Cleanup gamevars declaration

* Cleanup layout file

* Apply suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Add include for stdbool.h in common_ui.h

* Cleanup rect declaration

* Start moving state machine stuff to new file

* quick tmp

* oops, add new files

* working call list

* fixed pointer stuff

* working as per norm

* working replacement

* move defines to static const

* fix compile issue

* Add some missing "void"s

* Working new substates

* add statemachine to blind select

* Fix game restart statemachine leak

* clang-format

* Clang format

* Rework shop exit logic

* Use new state machine in shop

* Remove substates entirely

* Remove debug stuff

* Clang format

* document state machine better

* update list tests

* clang-format

* Update for PR

* Claaaaang format

* another clang-format

* Remove extra state in round_end

* cleanup docs for removals in lists

* clang-format... again

* update doxygen format

* Clang format

* Update list docs

* Update lists tests

* Fix bad conflict resolution

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-22 18:06:13 -07:00
Geralt 2329c4c681 Refactor/hand (#490)
* move all hand funcs to their new file. now to clean up

* WIP

* Cleanup + doc hand.h

* clang format

* Refactor loose variables in hand.c into a proper Hand struct

* Fix some more issues

* Apply *some* suggestions from code review

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* remove outdated comment

* fix rebase issue

* fix rng_info missing from g_game_vars init

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-22 17:51:39 -07:00
Rickey d7414157a5 Add logging (#492)
* Add logger implementation for mgba debugging

* Add logging details to contributors guide

* Clang-format

* update docs real quick

* Cleanup for PR

* Update for PR

* Fix bad rebase

* Fix docs
2026-05-21 20:07:34 -07:00
Geralt c2844a5d32 Refactor/RNG system (#476)
* Extract rng manipulation to its own file

* clang format

* Get CPU cycles since game start to use for RNG

* change a few things

* clang format

* Implement suggestions from @ricfehr3

* clang format

* Fix rebase issue

* clang format

* Create RngInfo struct to hold seed and step

* clang format

* Make a note about rng_restore system not having been tested properly yet

* Apply suggestions from @ricfehr3

Co-authored-by: Rickey <ric@rf3.xyz>

* clang format

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
Co-authored-by: Rickey <ric@rf3.xyz>
2026-05-21 19:47:48 -07:00
Geralt e3f680d6d0 Fix applying boss blind color twice (#49
Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-05-20 18:59:17 -07:00
Geralt 69403f059f Allow to exit the options menu without saving changes made (#484)
* Allow exiting options menu without saving

* Change "Back" button text to "Cancel" to be more explicit

* clang format

* fix load_game

* use proper existing defines for options default values

* fix buttons' array sizes

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-05-19 18:10:49 -07:00
Rickey 9b85329669 Document deprecation warning for 'getdata' method (#489)
Added comments regarding the deprecation of 'getdata' in Pillow.

Comment in regards to: https://github.com/GBALATRO/balatro-gba/pull/486 . Good info for anyone seeing the warning.
2026-05-18 21:43:24 -07:00
Elliot Tester dae65d035f sprite optimizations + static array fix (#454)
* optimizations

* fix prototype

* clang-format

* changes

* fix bug

* fix bug that came back after rebase

* make is_sprite_object_static more readable

* make it not broken

* actually make it compile...

* clang-format

* remove first extra check

* remove second extra check

* remove third extra check

* helper function 1

* second helper function

* how did i do this that wrong

* seperate epsilon

* combine if statements

* clarify comment

* remove redundant checks

* Remove braces around return

Co-authored-by: Rickey <ric@rf3.xyz>

* Move comment to above

Co-authored-by: Rickey <ric@rf3.xyz>

* clang-format

* simplify using abs()

Co-authored-by: Rickey <ric@rf3.xyz>

* fix syntax error from suggestion

* drop second epsilon + use abs()

* update comment

* extract sprite_oject_needs_position_sync from is_sprite_object_static

* figured out the root cause :)

* make it compile

---------

Co-authored-by: Rickey <ric@rf3.xyz>
2026-05-16 21:08:47 -07:00
Geralt d5d5a6fd6b Refactor/shop (#475)
* initial commit, DOES NOT COMPILE

* Rename joker interactions file to `joker_row`

* IT'S WORKIIING (now to make it pretty lol)

* fixed rebase issues

* fix rebase + undo state machine changes

* Document shop state functions

* clang format

* fix reroll cost not appearing on shop init

* Move generic SpriteObject text/price printing functions to sprite.c + some minor fixes

* Resolve weird defines/include order issue

* clang format

* Implement suggestions from @ricfehr3

* clang format

* clang format

* fix rebase

* Implement sugegstions from @ricfehr3

* Refactored shop to use the Button struct

* missed some memsets

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-05-15 18:36:19 -07:00
Rickey b1c2b7f35e Refactor/round end (#479)
* Initial round_end extraction

* move hands to game vars

* Checkpoint

* Finish removing all variables for state fns

* Move over round_end substate functions

* Move over round_end with compile

* working in general

* Fix round start state issue

* clang-format

* Fix clang format issue

* PR fixes and standardize types in game vars struct

* Clang-format
2026-05-13 18:22:02 -07:00
HEMASHREE N 57ec84fcc7 docs: clarify clang-format version and usage (#474)
* docs: clarify clang-format version and usage

Added version, installation, and verification steps for clang-format to help contributors avoid CI issues.

* Enhance CONTRIBUTING.md with installation details

Updated installation instructions for clang-format on Ubuntu/Debian and Arch Linux. Added details for verifying installation and modified commands to include additional directories.

* Revise clang-format installation instructions

Updated installation instructions for clang-format and removed redundant verification section.

* Enhance clang-format usage instructions in CONTRIBUTING.md

Added recommendations for using clang-format before PR submission to ensure proper code formatting.

* Update CONTRIBUTING.md with clang18 PATH instructions

Add instructions to set PATH for clang18 on Arch Linux
2026-05-10 16:00:32 -07:00
Geralt a79c4c92e2 Updating the save mechanism by creating an intermediary SaveData struct (#472)
* Make save changes their own branch

* Make SaveData tags char[] instead of u32[]

* Make Game and Options data saving independent

* removed unused functions

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* mark save sections as valid only after they are actually written to SRAM

* fix comparison between different integer types

* Implement some suggestions from @ricfehr3

* Add extensive documentation on the structure of the savefile

* fix doxygen doc generation

* fix it again

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-10 12:39:54 -07:00
Geralt 6373fee144 Refactor/game over screen (#468)
* Move game over (win/lose) state functions to their own file

* remove unused enum

* clang format

* Implement suggestions from @ricfehr3

* Fixing lack of highlighted button after skipping  ablind

* factorize as much game over state code as possible

---------

Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
2026-05-07 21:36:12 -07:00