* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* Created sprite bank for all blinds
* progress city, it's a beatiful city that progress city!
* Sprite appears in blind selection screen
* Added all blind colors
* fix magic numbers + disable boss reroll
* Fix boss blind token not moving after a reroll
* fix always rolling the Needle due to choosing too early for the rng seed to be set
* No need for affine sprite for blind tokens, regular is enough
* address Copilot's review 1/2
* address Copilot's review 2/2
* correct Blind Tokens/Types
* Index palette colors into the files instead of code
* Fix blind sprites (flip bug not solved)
* Fix magic number, tile index and Mark colors
* load boss blind palette only when changing spritesheet
* Adressing clang format and ease of modification of the blinds' list
* Removed some magic numbers
---------
Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
* Convert static joker sprites indexes to maps for dynamic spritesheets size
* tmp commit
* reorder Joker spritesheets
* more reordering
* Joker maps, will test later
* More reorders and palette optimizations. Sprites now work
* Fix Joker gfx
* Format joker.c
* Fix rebase error
* Integrate Shoot the Moon art
* format
* format
* removing useless GBAL_UNUSED from photograph Joker effect func
* Tidy up joker.c variables formatting
* Fix magic number
* Add context for map in joker.c
Co-authored-by: Rickey <ric@rf3.xyz>
* Update source/joker.c
Co-authored-by: Rickey <ric@rf3.xyz>
* Apply suggestion from @ricfehr3
Co-authored-by: Rickey <ric@rf3.xyz>
* format
* reduce clutter in joker_effects.c file by defining a macro for forward static declarations of joker effect funcs
* refactored some maps in joker.c to make it more concise
* clang format
* adding back how to mark functions as unused when Jokers don't have a sprite yet
* format
* Remove comment about unused functions for Jokers without art
---------
Co-authored-by: MathisMartin31 <mathis.martin31@gmail.com>
Co-authored-by: Rickey <ric@rf3.xyz>
* Clang format joker files and def files
* Fix blind usage of GBLA_UNUSED macro
* Add final files for clang-format (main.c and selection_grid.h)
---------
Co-authored-by: MeirGavish <meir.gavish@gmail.com>
* Introduce indexed list implementation
* Fix CI tests for pool
* Take bitset out of pool
* Replace joker bitset interactions with wrappers
* Add bitset tests
* Add test to gitignore
---------
Co-authored-by: rfehr-idexx <ric-fehr@idexx.com>