Commit Graph

22 Commits

Author SHA1 Message Date
Geralt
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
Rickey
35ecbf33ae Format and document utility files (#246)
Some checks failed
Deploy Nightly / Run Build ROM Workflow (push) Has been cancelled
Deploy Nightly / Deploy nightly (push) Has been cancelled
* Format and document utility files

* Add Doxyfile

* small updates for cleanup

* Final touches for util docs

* Replace `_` with `s_` for static functions

* update for clang-format changes

* Update include/audio_utils.h

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

* Apply suggestions from code review

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

* Update include/audio_utils.h

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

* Update include/graphic_utils.h

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

* Make clang-format happy :)

* Update gitignore for doxygen

* restor graphic_utils.c to main

* update graphics utils

* tmp

* tmp

* get it to compile

* fix some bad merge mistakes

* Fix clang format

* Apply suggestions from code review

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

* make clang-format happy

---------

Co-authored-by: MeirGavish <meir.gavish@gmail.com>
2025-12-07 12:56:39 -08:00
cellos51
d0d83eb236 Main menu uses HBLANK and the game uses standard affine background 2025-08-28 23:00:27 -04:00
cellos51
f4d8fc9097 Merge branch 'main' of https://github.com/cellos51/balatro-gba into hblank_affine_background_effects and changed parameters on affine source to be updated from experimental branch 2025-08-28 22:39:48 -04:00
cellos51
4f1f7cb347 Add splash screen functionality and update game state management
- Introduced GAME_SPLASH_SCREEN state in game.h
- Implemented splash_screen_init and splash_screen_update functions in splash_screen.c
- Updated game.c to initialize with GAME_SPLASH_SCREEN and handle splash screen updates
- Removed old splash screen code from main.c
2025-08-24 15:44:45 -04:00
MeirGavish
b043b82d3f Optimized affine background HBLANK effect - improved but still not good enough 2025-08-12 00:06:04 +03:00
cellos51
f2497a1284 fixed boss blind background being too dark 2025-08-10 16:34:47 -04:00
cellos51
7d2be834a3 Splash screen with disclaimer added 2025-08-10 13:00:38 -04:00
cellos51
c5ff984e84 Added copliot's changes 2025-08-10 12:09:59 -04:00
cellos51
164f58aa1e Main menu prototype 2025-08-09 21:49:37 -04:00
cellos51
af2358f487 Minor optimization 2025-08-09 17:08:18 -04:00
cellos51
0dde0cb6ef Took Copilot's advice and defined some magic numbers 2025-08-09 15:14:57 -04:00
cellos51
1ef0ce212b Different animation and fixed top 3 scanlines 2025-08-09 14:58:21 -04:00
cellos51
521b373bd2 Added new background visuals 2025-08-09 13:52:24 -04:00
cellos51
6363613f15 Added & back to the tile8_mem in affine_background_init() and changed memcpy16 to 32 2025-08-08 10:44:55 -04:00
cellos51
650c09af28 Converted void to u16 in functions 2025-08-08 09:54:24 -04:00
cellos51
12ca27e27b Removed default color for affine background and changed to load palette from image instead 2025-08-08 00:32:30 -04:00
cellos51
dbe8585c0a Refactor affine_background_set_color to simplify brightness adjustment logic 2025-08-08 00:08:28 -04:00
cellos51
bebe2237e4 Add memcpy16_tile8_with_palette_offset function and update affine_background_init to use it 2025-08-08 00:00:20 -04:00
cellos51
9be6a31dce Use tonc defines for getting colors 2025-08-07 23:31:23 -04:00
cellos51
d0ca4a483d Fix indentation in affine_background.c for consistency 2025-08-05 14:42:37 -04:00
cellos51
592d7ae8bc Add affine background color functionality and integrate into game loop 2025-08-05 14:35:52 -04:00