From 3dceb6045351bc90024463cbef800c2b5b5bde9f Mon Sep 17 00:00:00 2001 From: GValiente Date: Mon, 2 Oct 2023 00:45:01 +0200 Subject: [PATCH] butano: subsystems rom usage reduced (thanks felixjones!) --- butano/hw/src/bn_hw_audio.cpp | 6 ++++-- butano/hw/src/bn_hw_link.cpp | 4 +++- butano/hw/src/bn_hw_memory.cpp | 2 +- butano/include/bn_documentation.h | 1 + butano/src/bn_audio_manager.cpp | 4 +++- butano/src/bn_bg_blocks_manager.cpp | 9 +++++---- butano/src/bn_bgs_manager.cpp | 7 ++++++- butano/src/bn_bgs_manager.h | 2 ++ butano/src/bn_cameras_manager.cpp | 6 ++++-- butano/src/bn_core.cpp | 21 +++++++++++++------- butano/src/bn_display_manager.cpp | 4 +++- butano/src/bn_gpio_manager.cpp | 1 + butano/src/bn_hblank_effects_manager.cpp | 4 +++- butano/src/bn_hdma_manager.cpp | 8 +++++++- butano/src/bn_hdma_manager.h | 2 ++ butano/src/bn_keypad_manager.cpp | 4 +++- butano/src/bn_memory_manager.cpp | 4 +++- butano/src/bn_palettes_manager.cpp | 7 ++++++- butano/src/bn_palettes_manager.h | 2 ++ butano/src/bn_sprite_affine_mats_manager.cpp | 4 +++- butano/src/bn_sprite_tiles_manager.cpp | 9 +++++---- butano/src/bn_sprites_manager.cpp | 4 +++- docs/changelog.html | 2 +- 23 files changed, 85 insertions(+), 32 deletions(-) diff --git a/butano/hw/src/bn_hw_audio.cpp b/butano/hw/src/bn_hw_audio.cpp index b2fbda79f..2a274ce8f 100644 --- a/butano/hw/src/bn_hw_audio.cpp +++ b/butano/hw/src/bn_hw_audio.cpp @@ -55,7 +55,7 @@ namespace bool dmg_sync = false; }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; constexpr int _mix_length() @@ -94,7 +94,7 @@ namespace constexpr int _max_channels = BN_CFG_AUDIO_MAX_MUSIC_CHANNELS + BN_CFG_AUDIO_MAX_SOUND_CHANNELS; - alignas(int) BN_DATA_EWRAM uint8_t maxmod_engine_buffer[ + alignas(int) BN_DATA_EWRAM_BSS uint8_t maxmod_engine_buffer[ _max_channels * (MM_SIZEOF_MODCH + MM_SIZEOF_ACTCH + MM_SIZEOF_MIXCH) + _mix_length()]; alignas(int) uint8_t maxmod_mixing_buffer[_mix_length()]; @@ -194,6 +194,8 @@ namespace void init() { + new(&data) static_data(); + irq::set_isr(irq::id::VBLANK, mmVBlank); irq::enable(irq::id::VBLANK); diff --git a/butano/hw/src/bn_hw_link.cpp b/butano/hw/src/bn_hw_link.cpp index 161f18d21..95e9c4948 100644 --- a/butano/hw/src/bn_hw_link.cpp +++ b/butano/hw/src/bn_hw_link.cpp @@ -27,7 +27,7 @@ namespace bool active = false; }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; void _check_active() { @@ -111,6 +111,8 @@ namespace void init() { + new(&data) static_data(); + data.connection.init(_sendDataCallback, _receiveResponseCallback, _resetStateCallback); irq::set_isr(irq::id::SERIAL, _serial_intr); irq::set_isr(irq::id::TIMER1, _timer_intr); diff --git a/butano/hw/src/bn_hw_memory.cpp b/butano/hw/src/bn_hw_memory.cpp index 019613f3e..e49cdbbb4 100644 --- a/butano/hw/src/bn_hw_memory.cpp +++ b/butano/hw/src/bn_hw_memory.cpp @@ -24,7 +24,7 @@ static_assert(BN_CFG_EWRAM_WAIT_STATE == BN_EWRAM_WAIT_STATE_2 || #if BN_CFG_EWRAM_WAIT_STATE == BN_EWRAM_WAIT_STATE_1 namespace { - BN_DATA_EWRAM unsigned ewram_data; + BN_DATA_EWRAM_BSS unsigned ewram_data; } #endif diff --git a/butano/include/bn_documentation.h b/butano/include/bn_documentation.h index b629cfad2..e3a9310ee 100644 --- a/butano/include/bn_documentation.h +++ b/butano/include/bn_documentation.h @@ -2161,6 +2161,7 @@ * * bn::assert::callback and bn::assert::set_callback added. * * `BN_DATA_EWRAM_BSS` added. * * bn::memory::used_static_ewram fixed. + * * Butano subsystems ROM usage reduced. * * Tonclib tiled surface functions added. * * Unused Tonclib functions and data removed. * diff --git a/butano/src/bn_audio_manager.cpp b/butano/src/bn_audio_manager.cpp index ab0b72372..eb12c6fd4 100644 --- a/butano/src/bn_audio_manager.cpp +++ b/butano/src/bn_audio_manager.cpp @@ -361,11 +361,13 @@ namespace bool dmg_sync_enabled = false; }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; } void init() { + new(&data) static_data(); + hw::audio::init(); } diff --git a/butano/src/bn_bg_blocks_manager.cpp b/butano/src/bn_bg_blocks_manager.cpp index 191364720..991f98ee4 100644 --- a/butano/src/bn_bg_blocks_manager.cpp +++ b/butano/src/bn_bg_blocks_manager.cpp @@ -323,7 +323,7 @@ namespace } }; - void init() + items_list() { for(int index = 0; index < max_items; ++index) { @@ -384,7 +384,7 @@ namespace private: item_type _items[max_list_items]; - alignas(int) int8_t _free_indices_array[max_items] = {}; + alignas(int) int8_t _free_indices_array[max_items]; int _free_indices_size = max_items; void _join(int index, int new_index) @@ -437,7 +437,7 @@ namespace bool delay_commit = false; }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; struct create_data @@ -1166,11 +1166,12 @@ namespace void init() { + new(&data) static_data(); + BN_BG_BLOCKS_LOG("bg_blocks_manager - INIT"); item_type new_item; new_item.blocks_count = hw::bg_tiles::blocks_count(); - data.items.init(); data.items.push_front(new_item); data.free_blocks_count = new_item.blocks_count; diff --git a/butano/src/bn_bgs_manager.cpp b/butano/src/bn_bgs_manager.cpp index 4d75c8d63..e6c07fbcb 100644 --- a/butano/src/bn_bgs_manager.cpp +++ b/butano/src/bn_bgs_manager.cpp @@ -362,7 +362,7 @@ namespace bool commit = false; }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; [[nodiscard]] bool _check_unique_regular_big_map(item_type& item) @@ -502,6 +502,11 @@ namespace } } +void init() +{ + new(&data) static_data(); +} + int used_count() { return data.items_vector.size(); diff --git a/butano/src/bn_bgs_manager.h b/butano/src/bn_bgs_manager.h index 82bd27d14..d77fb238e 100644 --- a/butano/src/bn_bgs_manager.h +++ b/butano/src/bn_bgs_manager.h @@ -30,6 +30,8 @@ namespace bgs_manager { using id_type = void*; + void init(); + [[nodiscard]] int used_count(); [[nodiscard]] int available_count(); diff --git a/butano/src/bn_cameras_manager.cpp b/butano/src/bn_cameras_manager.cpp index 9eba4e310..273b836e8 100644 --- a/butano/src/bn_cameras_manager.cpp +++ b/butano/src/bn_cameras_manager.cpp @@ -38,16 +38,18 @@ namespace public: item_type items[max_items]; - alignas(int) uint8_t free_item_indexes_array[max_items] = {}; + alignas(int) uint8_t free_item_indexes_array[max_items]; int free_item_indexes_size = max_items; bool update = false; }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; } void init() { + new(&data) static_data(); + for(int index = 0; index < max_items; ++index) { data.free_item_indexes_array[index] = uint8_t(index); diff --git a/butano/src/bn_core.cpp b/butano/src/bn_core.cpp index 6f082f9ce..c049ec82f 100644 --- a/butano/src/bn_core.cpp +++ b/butano/src/bn_core.cpp @@ -131,7 +131,7 @@ namespace volatile bool waiting_for_vblank = false; }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; void enable() { @@ -311,13 +311,24 @@ void init() void init(const string_view& keypad_commands) { + new(&data) static_data(); + // Initial wait: hw::core::init(); + // Init H-Blank effects system: + hblank_effects_manager::init(); + // Init irq system: hw::irq::init(); hw::irq::set_isr(hw::irq::id::HBLANK, hw::hblank_effects::_intr); + // Init hdma system: + hdma_manager::init(); + + // Init link system: + link_manager::init(); + // Init audio system: audio_manager::init(); @@ -330,18 +341,14 @@ void init(const string_view& keypad_commands) // Init display: display_manager::init(); - // Init H-Blank effects system: - hblank_effects_manager::init(); - - // Init link system: - link_manager::init(); - // Init high level systems: memory_manager::init(); cameras_manager::init(); + palettes_manager::init(); sprite_tiles_manager::init(); sprites_manager::init(); bg_blocks_manager::init(); + bgs_manager::init(); keypad_manager::init(keypad_commands); // First update: diff --git a/butano/src/bn_display_manager.cpp b/butano/src/bn_display_manager.cpp index 4ccaffce0..0e8d349ca 100644 --- a/butano/src/bn_display_manager.cpp +++ b/butano/src/bn_display_manager.cpp @@ -67,7 +67,7 @@ namespace bool commit_green_swap = false; }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; [[nodiscard]] pair _blending_hw_weights(fixed top_weight, fixed bottom_weight) { @@ -101,6 +101,8 @@ namespace void init() { + new(&data) static_data(); + unsigned initial_window_flags = unsigned(hw::display::window_flag::SPRITES) | unsigned(hw::display::window_flag::BLENDING); diff --git a/butano/src/bn_gpio_manager.cpp b/butano/src/bn_gpio_manager.cpp index 217f324a2..cb85a42c3 100644 --- a/butano/src/bn_gpio_manager.cpp +++ b/butano/src/bn_gpio_manager.cpp @@ -5,6 +5,7 @@ #include "bn_gpio_manager.h" +#include #include "../hw/include/bn_hw_gpio.h" #include "bn_rumble.cpp.h" diff --git a/butano/src/bn_hblank_effects_manager.cpp b/butano/src/bn_hblank_effects_manager.cpp index 0ff0db954..256f1fcf9 100644 --- a/butano/src/bn_hblank_effects_manager.cpp +++ b/butano/src/bn_hblank_effects_manager.cpp @@ -1043,7 +1043,7 @@ namespace hw_entries entries_b; }; - BN_DATA_EWRAM static_external_data external_data; + BN_DATA_EWRAM_BSS static_external_data external_data; static_internal_data internal_data; void _update_visible_item_index(int item_index) @@ -1144,6 +1144,8 @@ namespace void init() { + new(&external_data) static_external_data(); + hw::hblank_effects::commit_entries(internal_data.entries_b); for(int index = max_items - 1; index >= 0; --index) diff --git a/butano/src/bn_hdma_manager.cpp b/butano/src/bn_hdma_manager.cpp index 0df4644d1..0b6de2f04 100644 --- a/butano/src/bn_hdma_manager.cpp +++ b/butano/src/bn_hdma_manager.cpp @@ -5,6 +5,7 @@ #include "bn_hdma_manager.h" +#include #include "bn_display.h" #include "../hw/include/bn_hw_dma.h" #include "../hw/include/bn_hw_memory.h" @@ -149,7 +150,12 @@ namespace entry high_priority_entry = entry(hw::dma::high_priority_channel()); }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; +} + +void init() +{ + new(&data) static_data(); } void enable() diff --git a/butano/src/bn_hdma_manager.h b/butano/src/bn_hdma_manager.h index a430dd689..a8ec6f305 100644 --- a/butano/src/bn_hdma_manager.h +++ b/butano/src/bn_hdma_manager.h @@ -10,6 +10,8 @@ namespace bn::hdma_manager { + void init(); + void enable(); void disable(); diff --git a/butano/src/bn_keypad_manager.cpp b/butano/src/bn_keypad_manager.cpp index e1facb9de..185926625 100644 --- a/butano/src/bn_keypad_manager.cpp +++ b/butano/src/bn_keypad_manager.cpp @@ -69,11 +69,13 @@ namespace #endif }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; } void init(const string_view& commands) { + new(&data) static_data(); + BN_ASSERT(commands.size() % 2 == 0, "Invalid commands size: ", commands.size()); data.commands = commands; diff --git a/butano/src/bn_memory_manager.cpp b/butano/src/bn_memory_manager.cpp index f7fe7a65b..157cf91ff 100644 --- a/butano/src/bn_memory_manager.cpp +++ b/butano/src/bn_memory_manager.cpp @@ -24,11 +24,13 @@ namespace best_fit_allocator allocator; }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; } void init() { + new(&data) static_data(); + char* start = hw::memory::ewram_heap_start(); char* end = hw::memory::ewram_heap_end(); data.allocator.reset(static_cast(start), end - start); diff --git a/butano/src/bn_palettes_manager.cpp b/butano/src/bn_palettes_manager.cpp index 4fdba3abe..e38644e9d 100644 --- a/butano/src/bn_palettes_manager.cpp +++ b/butano/src/bn_palettes_manager.cpp @@ -26,7 +26,12 @@ namespace palettes_bank bg_palettes_bank; }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; +} + +void init() +{ + new(&data) static_data(); } palettes_bank& sprite_palettes_bank() diff --git a/butano/src/bn_palettes_manager.h b/butano/src/bn_palettes_manager.h index e5000d939..05674a52e 100644 --- a/butano/src/bn_palettes_manager.h +++ b/butano/src/bn_palettes_manager.h @@ -15,6 +15,8 @@ class palettes_bank; namespace palettes_manager { + void init(); + [[nodiscard]] palettes_bank& sprite_palettes_bank(); [[nodiscard]] palettes_bank& bg_palettes_bank(); diff --git a/butano/src/bn_sprite_affine_mats_manager.cpp b/butano/src/bn_sprite_affine_mats_manager.cpp index db3cd50cb..a55105954 100644 --- a/butano/src/bn_sprite_affine_mats_manager.cpp +++ b/butano/src/bn_sprite_affine_mats_manager.cpp @@ -86,7 +86,7 @@ namespace int last_index_to_remove_if_not_needed = 0; }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; void _update_flipped_identity(int index) @@ -201,6 +201,8 @@ namespace void init(void* handles) { + new(&data) static_data(); + data.handles_ptr = static_cast(handles); for(int index = max_items - 1; index >= 0; --index) diff --git a/butano/src/bn_sprite_tiles_manager.cpp b/butano/src/bn_sprite_tiles_manager.cpp index 2647e156f..19799a96e 100644 --- a/butano/src/bn_sprite_tiles_manager.cpp +++ b/butano/src/bn_sprite_tiles_manager.cpp @@ -162,7 +162,7 @@ namespace } }; - void init() + items_list() { for(int index = 0; index < max_items; ++index) { @@ -239,7 +239,7 @@ namespace private: item_type _items[max_list_items]; - alignas(int) int16_t _free_indices_array[max_items] = {}; + alignas(int) int16_t _free_indices_array[max_items]; int _free_indices_size = max_items; void _insert_node(int position_index, int new_index) @@ -282,7 +282,7 @@ namespace bool delay_commit = false; }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; #if BN_CFG_SPRITE_TILES_LOG_ENABLED @@ -680,11 +680,12 @@ namespace void init() { + new(&data) static_data(); + BN_SPRITE_TILES_LOG("sprite_tiles_manager - INIT"); item_type new_item; new_item.tiles_count = hw::sprite_tiles::tiles_count(); - data.items.init(); data.items.push_front(new_item); data.free_items.push_back(data.items.begin().id()); data.free_tiles_count = new_item.tiles_count; diff --git a/butano/src/bn_sprites_manager.cpp b/butano/src/bn_sprites_manager.cpp index 87f69e195..f654196e1 100644 --- a/butano/src/bn_sprites_manager.cpp +++ b/butano/src/bn_sprites_manager.cpp @@ -44,7 +44,7 @@ namespace bool reload_all_handles = false; }; - BN_DATA_EWRAM static_data data; + BN_DATA_EWRAM_BSS static_data data; void _always_update_indexes_to_commit(const item_type& item) { @@ -233,6 +233,8 @@ namespace void init() { + new(&data) static_data(); + for(hw::sprites::handle_type& handle : data.handles) { hw::sprites::hide_and_destroy(handle); diff --git a/docs/changelog.html b/docs/changelog.html index c4ad3a798..f14c2e535 100644 --- a/docs/changelog.html +++ b/docs/changelog.html @@ -182,7 +182,7 @@

Contents

  • 0.1.0
  • -

    15.5.0 (next release)

    15.4.1

    bn::core::reset race condition fixed.

    15.4.0

    15.3.2

    BG blocks commit fixed.

    15.3.1

    Slow game pak detection fixed (again).

    15.3.0

    15.2.0

    • bn::seed_random added.
    • Standard assert implemented.
    • Thread-safe initialization of local statics disabled.
    • Static destructors fixed.
    • Maps commit optimized by more than 35% in some cases.
    • Palette search optimized by more than 25% in some cases.
    • Big maps commit optimized.
    • Display setup commit optimized.
    • BG blocks and sprite tiles managers ROM usage reduced.
    • map_collision example added.

    15.1.0

    • memcmp optimized.
    • Link flags fixed.

    15.0.0

    14.1.0

    14.0.0

    13.18.0

    13.17.0

    13.16.1

    bn::ibitset AND operator fixed.

    13.16.0

    13.15.0

    • Brightness, contrast and intensity color effects optimized.
    • bn::random internal variables are protected to allow child classes to access them.
    • compile_commands.json generation support.

    13.14.0

    13.13.0

    13.12.1

    Tonclib linking error fixed.

    13.12.0

    13.11.0

    13.10.1

    -flto memset undefined references fixed.

    13.10.0

    • memset moved to IWRAM.
    • Backdrop fade blending fixed.

    13.9.0

    13.8.1

    bn::any management with types that can't be copied, moved or swapped fixed.

    13.8.0

    13.7.0

    13.6.0

    13.5.0

    13.4.0

    • BN_BASIC_ASSERT added.
    • Repeated color palettes reduction can be disabled when importing a regular background. See the Regular backgrounds import guide to learn how to disable it.
    • Unaligned byte memset fixed.
    • Asserts without diagnostic information ROM usage reduced.
    • Input tiles in dynamic_regular_bg and dynamic_affine_bg examples are imported without using a map.
    • Frequently asked questions (FAQ) page improved.

    13.3.1

    bn::erase and bn::erase_if fixed.

    13.3.0

    13.2.0

    13.1.1

    Recovery of deleted background maps fixed.

    13.1.0

    13.0.0

    12.5.0

    BN_CFG_ASSERT_SHOW_DIAGNOSTIC added.

    12.4.0

    • SRAM magic string fixed.
    • BN_CODE_IWRAM macro can be used for thumb code too.
    • Destructors of classes with _ptr suffix ROM usage reduced.
    • 4BPP regular backgrounds quantization improved.
    • Some error messages improved.
    • Import images guide explains why Usenti is recommended over other image editors.

    12.3.0

    • bn::sprite_text_generator variable width fonts rendering fixed and optimized.
    • Sprite shape and size update ROM usage reduced.
    • Some Cppcheck warnings removed.

    12.2.0

    • Automatic sprite double size detection fixed.
    • Sprite tiles management optimized (EWRAM and CPU usage reduced).
    • Background tiles and maps management optimized (EWRAM and CPU usage reduced).
    • Color palettes management CPU usage reduced.
    • Sprites and sprite affine mats management CPU usage reduced.
    • Backgrounds management CPU usage reduced.
    • Cameras management CPU usage reduced.

    12.1.0

    • Sprite tiles delayed commit fixed.
    • V-Blank interrupt management optimized (EWRAM and CPU usage reduced).
    • Missed link messages frequency reduced.
    • bn::timer::elapsed_ticks optimized.

    12.0.0

    • (Breaking change) bn::aligned fixed.
    • Color effects optimized.

    11.0.1

    bn::string::starts_with and bn::string_view::starts_with fixed.

    11.0.0

    Huffman images compression support (make sure to update devkitARM before using it).

    10.7.0

    10.6.1

    bn::bitset AND, OR and XOR operators fixed.

    10.6.0

    10.5.0

    10.4.0

    • Avoid data decompression in V-Blank if possible.
    • Audio updates can no longer be interrupted.

    10.3.0

    10.2.0

    10.1.0

    10.0.0

    • Custom linker flags can be specified in the project's Makefile.
    • Asserts ROM usage reduced.
    • Audio startup fixed when link-time optimization is enabled.
    • Audio stop fixed when link communication is active.
    • Parallel link-time optimization temporal files ignored and added to the list of files to clean.

    9.5.0

    9.4.1

    BMP files colors count calculation fixed (again).

    9.4.0

    9.3.0

    9.2.0

    9.1.1

    bn::calculate_sin_lut_value sine and cosine symmetry with 135 and 315 degrees fixed.

    9.1.0

    9.0.0

    8.10.0

    8.9.0

    • Hue shift palette effect added. See the palettes example to learn how to use it.
    • Brightness effect ROM usage reduced.
    • bn::sprite_item and bn::sprite_tiles_item size reduced.
    • Automatic sprite double size detection fixed.
    • bn::hbe_visible_toggle_action removed, since it was not possible to use it.
    • Clang build fixes.
    • Clang-Tidy warnings fixed.
    • New games made with Butano added to README.md.

    8.8.0

    • Modified assets detection optimized.
    • Audio and graphics tools unified in order to reduce build time.
    • bn::newton_raphson_sqrt removed, since it doesn't work for bn::fixed input values.

    8.7.0

    • An external bn::bg_palette_item can be specified when importing regular and affine backgrounds.
    • Colors count can be specified when importing sprite and background palettes.
    • Standard containers equality comparison optimized.
    • Asserts file name hack fixed.
    • Universal GBA Library LGPL license files removed.
    • Standard containers documentation improved.
    • Frequently asked questions (FAQ) page improved.

    8.6.0

    8.5.0

    8.4.0

    8.3.0

    • Maps commit optimized by more than 50% in some cases.
    • Integer alignment at minimum enforced in all containers.
    • BG blocks manager and sprite tiles manager commit fixed.

    8.2.0

    • (Security issue) Source code files full path is not stored in output ROMs anymore.
    • Some Clang-Tidy and Cppcheck warnings removed.

    8.1.0

    8.0.0

    7.8.0

    7.7.0

    7.6.0

    7.5.1

    Audio and HDMA issues when updating at less than 60FPS fixed.

    7.5.0

    7.4.0

    • Run-length is preferred to LZ77 when choosing best compression mode.
    • Sprites automatic double size mode and affine matrix management fixed.
    • Frequently asked questions (FAQ) page improved.

    7.3.0

    • bn::sprite_text_generator now can plot multiple 16x16 variable width characters in a single sprite.
    • bn::sprite_text_generator IWRAM usage reduced.
    • Third party libraries to link can be specified in the project's Makefile.
    • Project's Makefile allows to build source files generated with an external tool. See the external_tool example to learn how to do it.
    • butano-audio-tool.py generates a list of all available music and sound items with their name.
    • audio_player example added.
    • Varooom 3D improved (check its readme.txt file for details).

    7.2.0

    7.1.1

    bn::vector, bn::unordered_map and bn::unordered_set move constructors and assignment operators fixed.

    7.1.0

    7.0.1

    bn::format build fix.

    7.0.0

    • Varooom 3D source code and assets added.
    • Maximum number of active H-Blank effects reduced to 6.
    • Common files moved to common namespace.

    6.18.0

    • Generated items are now constexpr inline to avoid being copied to every translation unit.
    • Sprites EWRAM usage reduced.
    • Different type backgrounds sorting fixed.

    6.17.1

    • bn::sort with 128bit sort keys fixed.
    • IRQs setup during startup improved.

    6.17.0

    6.16.0

    6.15.0

    6.14.0

    6.13.1

    6.13.0

    6.12.0

    6.11.0

    • An external tool can be called from the project's Makefile. See the external_tool example to learn how to call it.
    • Affine background tiles offset optimized.
    • Big numbers to string conversion optimized.
    • 32bit integer division optimized.
    • 64bit integer division by 0 assert added.
    • Big maps maximum valid position fixed.
    • Compressed tiles warning fixed.
    • GCC11 warning fixed.
    • Some 8x8 sprite text characters fixed.
    • Qt Creator setup guide added.
    • More questions added to Frequently asked questions (FAQ) page.

    6.10.0

    • dynamic_bg example added.
    • Affine background tiles offset fixed.

    6.9.0

    • bn::sprite_font supports all sprite shapes and sizes.
    • Trivial type containers destruction optimized.
    • Container destructors are always noexcept.
    • Redundant container asserts removed.
    • GPIO direction register setup.

    6.8.0

    • Sprites optimized.
    • Blending optimized.
    • Mosaic optimized.
    • Internal memory transfers optimized.
    • texture_polygons example affine parameters fixed.
    • Clouds removed from world_map example.

    6.7.0

    • Automatic sprite double size detection improved.
    • Butano Fighter allows to disable rumble in the title menu.

    6.6.2

    Automatic sprite double size detection fixed.

    6.6.1

    BG blocks manager use after move fixed.

    6.6.0

    • SRAM memory usage reduced.
    • Sprite animate actions memory usage reduced.
    • Missing asserts added to some actions.
    • bn::random is now a trivial class.
    • BG blocks manager search fixed.
    • world_map example frame rate back to 60FPS.

    6.5.0

    6.4.0

    6.3.0

    6.2.0

    6.1.0

    • Sprite tiles generation outputs sprite shape and size.
    • BN_ASSERT and BN_ERROR can be modified or disabled for specific code sections.
    • Sprites IWRAM usage reduced.
    • Some internal asserts removed.
    • Profiler screen fixed.
    • Documentation explains how to place data in ROM.

    6.0.0

    5.3.1

    bn::atan2 and bn::degrees_atan2 fixed.

    5.3.0

    5.2.0

    5.1.0

    5.0.0

    4.4.0

    • bn::sprite_font allows to specify space between characters.
    • Background palettes bits per pixel mode can be specified by the user.
    • Palettes change optimized.
    • Unused palette colors are not imported anymore.
    • bn::sprite_ptr::set_tiles() validation fixed.

    4.3.0

    • H-Blank effects EWRAM usage reduced (more than 2KB by default).
    • Optimization level changed to -O2 to avoid another No$gba crash.
    • SRAM code moved back from ROM to EWRAM, since doing that doesn't make No$gba crash anymore.
    • Redundant reset code removed.

    4.2.0

    • Sprite and background palettes can be generated from images alone, without tiles nor maps.
    • <cstddef> is always included (bn_cstddef.h header file removed).
    • bn::unordered_map and bn::unordered_set assignment fixed.

    4.1.0

    • H-Blank effects optimized (it fixes world_map example flickering).
    • SRAM code moved from EWRAM to ROM to avoid a No$gba crash.

    4.0.0

    3.3.0

    • HDMA properly supported (now it works at less than 60fps). See bn::hdma and the hdma_polygons example for more.
    • gba-link-connection remote timeout detection fixed.

    3.2.1

    bn::optional build fix.

    3.2.0

    bn::optional is now constexpr.

    3.1.0

    3.0.0

    Thanks to the awesome gba-link-connection, multiplayer support has been implemented! See bn::link and the link example for more.

    2.0.0

    • By removing some method overloads, lots of runtime asserts when creating resources have been removed.
    • bn::palette_bpp_mode has been renamed to bn::bpp_mode and bpp_mode() methods have been renamed to bpp().
    • 8 bits per pixel background tiles allocation fixed.

    1.0.0

    0.4.0

    • btn renamed to bn. No more API breaks will be made between minor releases after 1.0.0, promise.
    • Background tiles manager status can be printed in the log with bn::bg_tiles::log_status(). This is done automatically when a non-optional background tiles allocation fails too.
    • Background regular maps manager status can be printed in the log with bn::bg_maps::log_status(). This is done automatically when a non-optional regular background map allocation fails too.
    • Sprite tiles manager status can be printed in the log with bn::sprite_tiles::log_status(). This is done automatically when a non-optional sprite tiles allocation fails too.
    • Color palettes managers status can be printed in the log with bn::bg_palettes::log_status() and bn::sprite_palettes::log_status(). This is done automatically when a non-optional color palette allocation fails too.
    • Sprites destruction optimized.
    • Setters with an optional parameter added to some classes.
    • Optional components documentation fixed.
    • Other documentation improvements.

    0.3.0

    • Sprites update performance improved up to 30% in Butano Fighter thanks to avoid rebuilding sprites list as much as possible.
    • Profiler can show the maximum measured ticks per entry.
    • Assets tools print output binaries size.

    0.2.0

    • Performance improved up to 12% in Butano Fighter without -flto thanks to using less build translation units.
    • Documentation improved.

    0.1.0

    First release.

    +

    15.5.0 (next release)

    15.4.1

    bn::core::reset race condition fixed.

    15.4.0

    15.3.2

    BG blocks commit fixed.

    15.3.1

    Slow game pak detection fixed (again).

    15.3.0

    15.2.0

    • bn::seed_random added.
    • Standard assert implemented.
    • Thread-safe initialization of local statics disabled.
    • Static destructors fixed.
    • Maps commit optimized by more than 35% in some cases.
    • Palette search optimized by more than 25% in some cases.
    • Big maps commit optimized.
    • Display setup commit optimized.
    • BG blocks and sprite tiles managers ROM usage reduced.
    • map_collision example added.

    15.1.0

    • memcmp optimized.
    • Link flags fixed.

    15.0.0

    14.1.0

    14.0.0

    13.18.0

    13.17.0

    13.16.1

    bn::ibitset AND operator fixed.

    13.16.0

    13.15.0

    • Brightness, contrast and intensity color effects optimized.
    • bn::random internal variables are protected to allow child classes to access them.
    • compile_commands.json generation support.

    13.14.0

    13.13.0

    13.12.1

    Tonclib linking error fixed.

    13.12.0

    13.11.0

    13.10.1

    -flto memset undefined references fixed.

    13.10.0

    • memset moved to IWRAM.
    • Backdrop fade blending fixed.

    13.9.0

    13.8.1

    bn::any management with types that can't be copied, moved or swapped fixed.

    13.8.0

    13.7.0

    13.6.0

    13.5.0

    13.4.0

    • BN_BASIC_ASSERT added.
    • Repeated color palettes reduction can be disabled when importing a regular background. See the Regular backgrounds import guide to learn how to disable it.
    • Unaligned byte memset fixed.
    • Asserts without diagnostic information ROM usage reduced.
    • Input tiles in dynamic_regular_bg and dynamic_affine_bg examples are imported without using a map.
    • Frequently asked questions (FAQ) page improved.

    13.3.1

    bn::erase and bn::erase_if fixed.

    13.3.0

    13.2.0

    13.1.1

    Recovery of deleted background maps fixed.

    13.1.0

    13.0.0

    12.5.0

    BN_CFG_ASSERT_SHOW_DIAGNOSTIC added.

    12.4.0

    • SRAM magic string fixed.
    • BN_CODE_IWRAM macro can be used for thumb code too.
    • Destructors of classes with _ptr suffix ROM usage reduced.
    • 4BPP regular backgrounds quantization improved.
    • Some error messages improved.
    • Import images guide explains why Usenti is recommended over other image editors.

    12.3.0

    • bn::sprite_text_generator variable width fonts rendering fixed and optimized.
    • Sprite shape and size update ROM usage reduced.
    • Some Cppcheck warnings removed.

    12.2.0

    • Automatic sprite double size detection fixed.
    • Sprite tiles management optimized (EWRAM and CPU usage reduced).
    • Background tiles and maps management optimized (EWRAM and CPU usage reduced).
    • Color palettes management CPU usage reduced.
    • Sprites and sprite affine mats management CPU usage reduced.
    • Backgrounds management CPU usage reduced.
    • Cameras management CPU usage reduced.

    12.1.0

    • Sprite tiles delayed commit fixed.
    • V-Blank interrupt management optimized (EWRAM and CPU usage reduced).
    • Missed link messages frequency reduced.
    • bn::timer::elapsed_ticks optimized.

    12.0.0

    • (Breaking change) bn::aligned fixed.
    • Color effects optimized.

    11.0.1

    bn::string::starts_with and bn::string_view::starts_with fixed.

    11.0.0

    Huffman images compression support (make sure to update devkitARM before using it).

    10.7.0

    10.6.1

    bn::bitset AND, OR and XOR operators fixed.

    10.6.0

    10.5.0

    10.4.0

    • Avoid data decompression in V-Blank if possible.
    • Audio updates can no longer be interrupted.

    10.3.0

    10.2.0

    10.1.0

    10.0.0

    • Custom linker flags can be specified in the project's Makefile.
    • Asserts ROM usage reduced.
    • Audio startup fixed when link-time optimization is enabled.
    • Audio stop fixed when link communication is active.
    • Parallel link-time optimization temporal files ignored and added to the list of files to clean.

    9.5.0

    9.4.1

    BMP files colors count calculation fixed (again).

    9.4.0

    9.3.0

    9.2.0

    9.1.1

    bn::calculate_sin_lut_value sine and cosine symmetry with 135 and 315 degrees fixed.

    9.1.0

    9.0.0

    8.10.0

    8.9.0

    • Hue shift palette effect added. See the palettes example to learn how to use it.
    • Brightness effect ROM usage reduced.
    • bn::sprite_item and bn::sprite_tiles_item size reduced.
    • Automatic sprite double size detection fixed.
    • bn::hbe_visible_toggle_action removed, since it was not possible to use it.
    • Clang build fixes.
    • Clang-Tidy warnings fixed.
    • New games made with Butano added to README.md.

    8.8.0

    • Modified assets detection optimized.
    • Audio and graphics tools unified in order to reduce build time.
    • bn::newton_raphson_sqrt removed, since it doesn't work for bn::fixed input values.

    8.7.0

    • An external bn::bg_palette_item can be specified when importing regular and affine backgrounds.
    • Colors count can be specified when importing sprite and background palettes.
    • Standard containers equality comparison optimized.
    • Asserts file name hack fixed.
    • Universal GBA Library LGPL license files removed.
    • Standard containers documentation improved.
    • Frequently asked questions (FAQ) page improved.

    8.6.0

    8.5.0

    8.4.0

    8.3.0

    • Maps commit optimized by more than 50% in some cases.
    • Integer alignment at minimum enforced in all containers.
    • BG blocks manager and sprite tiles manager commit fixed.

    8.2.0

    • (Security issue) Source code files full path is not stored in output ROMs anymore.
    • Some Clang-Tidy and Cppcheck warnings removed.

    8.1.0

    8.0.0

    7.8.0

    7.7.0

    7.6.0

    7.5.1

    Audio and HDMA issues when updating at less than 60FPS fixed.

    7.5.0

    7.4.0

    • Run-length is preferred to LZ77 when choosing best compression mode.
    • Sprites automatic double size mode and affine matrix management fixed.
    • Frequently asked questions (FAQ) page improved.

    7.3.0

    • bn::sprite_text_generator now can plot multiple 16x16 variable width characters in a single sprite.
    • bn::sprite_text_generator IWRAM usage reduced.
    • Third party libraries to link can be specified in the project's Makefile.
    • Project's Makefile allows to build source files generated with an external tool. See the external_tool example to learn how to do it.
    • butano-audio-tool.py generates a list of all available music and sound items with their name.
    • audio_player example added.
    • Varooom 3D improved (check its readme.txt file for details).

    7.2.0

    7.1.1

    bn::vector, bn::unordered_map and bn::unordered_set move constructors and assignment operators fixed.

    7.1.0

    7.0.1

    bn::format build fix.

    7.0.0

    • Varooom 3D source code and assets added.
    • Maximum number of active H-Blank effects reduced to 6.
    • Common files moved to common namespace.

    6.18.0

    • Generated items are now constexpr inline to avoid being copied to every translation unit.
    • Sprites EWRAM usage reduced.
    • Different type backgrounds sorting fixed.

    6.17.1

    • bn::sort with 128bit sort keys fixed.
    • IRQs setup during startup improved.

    6.17.0

    6.16.0

    6.15.0

    6.14.0

    6.13.1

    6.13.0

    6.12.0

    6.11.0

    • An external tool can be called from the project's Makefile. See the external_tool example to learn how to call it.
    • Affine background tiles offset optimized.
    • Big numbers to string conversion optimized.
    • 32bit integer division optimized.
    • 64bit integer division by 0 assert added.
    • Big maps maximum valid position fixed.
    • Compressed tiles warning fixed.
    • GCC11 warning fixed.
    • Some 8x8 sprite text characters fixed.
    • Qt Creator setup guide added.
    • More questions added to Frequently asked questions (FAQ) page.

    6.10.0

    • dynamic_bg example added.
    • Affine background tiles offset fixed.

    6.9.0

    • bn::sprite_font supports all sprite shapes and sizes.
    • Trivial type containers destruction optimized.
    • Container destructors are always noexcept.
    • Redundant container asserts removed.
    • GPIO direction register setup.

    6.8.0

    • Sprites optimized.
    • Blending optimized.
    • Mosaic optimized.
    • Internal memory transfers optimized.
    • texture_polygons example affine parameters fixed.
    • Clouds removed from world_map example.

    6.7.0

    • Automatic sprite double size detection improved.
    • Butano Fighter allows to disable rumble in the title menu.

    6.6.2

    Automatic sprite double size detection fixed.

    6.6.1

    BG blocks manager use after move fixed.

    6.6.0

    • SRAM memory usage reduced.
    • Sprite animate actions memory usage reduced.
    • Missing asserts added to some actions.
    • bn::random is now a trivial class.
    • BG blocks manager search fixed.
    • world_map example frame rate back to 60FPS.

    6.5.0

    6.4.0

    6.3.0

    6.2.0

    6.1.0

    • Sprite tiles generation outputs sprite shape and size.
    • BN_ASSERT and BN_ERROR can be modified or disabled for specific code sections.
    • Sprites IWRAM usage reduced.
    • Some internal asserts removed.
    • Profiler screen fixed.
    • Documentation explains how to place data in ROM.

    6.0.0

    5.3.1

    bn::atan2 and bn::degrees_atan2 fixed.

    5.3.0

    5.2.0

    5.1.0

    5.0.0

    4.4.0

    • bn::sprite_font allows to specify space between characters.
    • Background palettes bits per pixel mode can be specified by the user.
    • Palettes change optimized.
    • Unused palette colors are not imported anymore.
    • bn::sprite_ptr::set_tiles() validation fixed.

    4.3.0

    • H-Blank effects EWRAM usage reduced (more than 2KB by default).
    • Optimization level changed to -O2 to avoid another No$gba crash.
    • SRAM code moved back from ROM to EWRAM, since doing that doesn't make No$gba crash anymore.
    • Redundant reset code removed.

    4.2.0

    • Sprite and background palettes can be generated from images alone, without tiles nor maps.
    • <cstddef> is always included (bn_cstddef.h header file removed).
    • bn::unordered_map and bn::unordered_set assignment fixed.

    4.1.0

    • H-Blank effects optimized (it fixes world_map example flickering).
    • SRAM code moved from EWRAM to ROM to avoid a No$gba crash.

    4.0.0

    3.3.0

    • HDMA properly supported (now it works at less than 60fps). See bn::hdma and the hdma_polygons example for more.
    • gba-link-connection remote timeout detection fixed.

    3.2.1

    bn::optional build fix.

    3.2.0

    bn::optional is now constexpr.

    3.1.0

    3.0.0

    Thanks to the awesome gba-link-connection, multiplayer support has been implemented! See bn::link and the link example for more.

    2.0.0

    • By removing some method overloads, lots of runtime asserts when creating resources have been removed.
    • bn::palette_bpp_mode has been renamed to bn::bpp_mode and bpp_mode() methods have been renamed to bpp().
    • 8 bits per pixel background tiles allocation fixed.

    1.0.0

    0.4.0

    • btn renamed to bn. No more API breaks will be made between minor releases after 1.0.0, promise.
    • Background tiles manager status can be printed in the log with bn::bg_tiles::log_status(). This is done automatically when a non-optional background tiles allocation fails too.
    • Background regular maps manager status can be printed in the log with bn::bg_maps::log_status(). This is done automatically when a non-optional regular background map allocation fails too.
    • Sprite tiles manager status can be printed in the log with bn::sprite_tiles::log_status(). This is done automatically when a non-optional sprite tiles allocation fails too.
    • Color palettes managers status can be printed in the log with bn::bg_palettes::log_status() and bn::sprite_palettes::log_status(). This is done automatically when a non-optional color palette allocation fails too.
    • Sprites destruction optimized.
    • Setters with an optional parameter added to some classes.
    • Optional components documentation fixed.
    • Other documentation improvements.

    0.3.0

    • Sprites update performance improved up to 30% in Butano Fighter thanks to avoid rebuilding sprites list as much as possible.
    • Profiler can show the maximum measured ticks per entry.
    • Assets tools print output binaries size.

    0.2.0

    • Performance improved up to 12% in Butano Fighter without -flto thanks to using less build translation units.
    • Documentation improved.

    0.1.0

    First release.