namespace
coreCore related functions.
Typedefs
- using update_callback_type = void(*)()
- Core update callback type alias.
Functions
- void init()
- This function must be called before using Butano, and it must be called only once.
- void init(const optional<color>& transparent_color)
- This function must be called before using Butano, and it must be called only once.
-
void init(const string_
view& keypad_commands) - This function must be called before using Butano, and it must be called only once.
-
void init(const optional<color>& transparent_color,
const string_
view& keypad_commands) - This function must be called before using Butano, and it must be called only once.
- auto skip_frames() -> int
- Returns the number of frames to skip.
- void set_skip_frames(int skip_frames)
- Sets the number of frames to skip.
- void update()
- Updates the screen and all Butano subsystems.
-
void sleep(keypad::
key_type wake_up_key) - Sleeps the GBA until the given keypad key is pressed.
-
void sleep(const span<const keypad::
key_type>& wake_up_keys) - Sleeps the GBA until the given keypad keys are pressed.
- void reset()
- Resets the GBA, going back to the start of main().
- void hard_reset()
- Resets the GBA, going back to the start of main() after showing the BIOS intro.
- auto current_cpu_usage() -> fixed
- Returns the CPU usage of the current frame.
- auto current_cpu_ticks() -> int
- Returns the CPU timer ticks of the current frame.
- auto last_cpu_usage() -> fixed
- Returns the CPU usage of the last elapsed frame.
- auto last_cpu_ticks() -> int
- Returns the CPU timer ticks of the last elapsed frame.
- auto last_vblank_usage() -> fixed
- Returns the maximum V-Blank usage of the last elapsed frame.
- auto last_vblank_ticks() -> int
- Returns the maximum V-Blank timer ticks of the last elapsed frame.
- auto last_missed_frames() -> int
- Returns the number of screen refreshes that were missed in the last core::
update call. -
auto update_callback() -> update_
callback_ type - Returns the user function called in core::
update. -
void set_update_callback(update_
callback_ type update_callback) - Sets the user function called in core::
update. -
auto vblank_callback() -> vblank_
callback_ type - Returns the user function called in V-Blank.
-
void set_vblank_callback(vblank_
callback_ type vblank_callback) - Sets the user function called in V-Blank.
- auto slow_game_pak() -> bool
- Indicates if a slow game pak like the SuperCard SD has been detected or not.
-
auto system_font() -> const system_
font& - Returns the font used to show assert and profiling messages.
-
void set_system_font(const bn::
system_font& font) - Sets the font used to show assert and profiling messages.
-
auto assert_tag() -> const string_
view& - Returns the tag displayed in assert messages.
-
void set_assert_tag(const string_
view& assert_tag) - Sets the tag displayed in assert messages.
- void log_stacktrace()
- Logs the current stack trace.
Typedef documentation
using bn:: core:: update_callback_type = void(*)()
#include <bn_core_update_callback_type.h>
Core update callback type alias.
Function documentation
void bn:: core:: init()
#include <bn_core.h>
This function must be called before using Butano, and it must be called only once.
void bn:: core:: init(const optional<color>& transparent_color)
#include <bn_core.h>
This function must be called before using Butano, and it must be called only once.
Parameters | |
---|---|
transparent_color | Initial transparent color of the backgrounds. |
void bn:: core:: init(const string_ view& keypad_commands)
#include <bn_core.h>
This function must be called before using Butano, and it must be called only once.
Parameters | |
---|---|
keypad_commands | Keypad commands recorded with the keypad logger. |
Instead of reading the keypad of the GBA, these keypad commands are replayed.
void bn:: core:: init(const optional<color>& transparent_color,
const string_ view& keypad_commands)
#include <bn_core.h>
This function must be called before using Butano, and it must be called only once.
Parameters | |
---|---|
transparent_color | Initial transparent color of the backgrounds. |
keypad_commands | Keypad commands recorded with the keypad logger. |
Instead of reading the keypad of the GBA, these keypad commands are replayed.
int bn:: core:: skip_frames()
#include <bn_core.h>
Returns the number of frames to skip.
0 skip frames means ~60 frames per second, 1 skip frame means ~30 frames per second, and so on.
void bn:: core:: set_skip_frames(int skip_frames)
#include <bn_core.h>
Sets the number of frames to skip.
0 skip frames means ~60 frames per second, 1 skip frame means ~30 frames per second, and so on.
void bn:: core:: update()
#include <bn_core.h>
Updates the screen and all Butano subsystems.
void bn:: core:: sleep(keypad:: key_type wake_up_key)
#include <bn_core.h>
Sleeps the GBA until the given keypad key is pressed.
void bn:: core:: sleep(const span<const keypad:: key_type>& wake_up_keys)
#include <bn_core.h>
Sleeps the GBA until the given keypad keys are pressed.
void bn:: core:: reset()
#include <bn_core.h>
Resets the GBA, going back to the start of main().
Keep in mind that it doesn't rewind the stack, so alive objects are not destroyed.
void bn:: core:: hard_reset()
#include <bn_core.h>
Resets the GBA, going back to the start of main() after showing the BIOS intro.
Keep in mind that it doesn't rewind the stack, so alive objects are not destroyed.
fixed bn:: core:: current_cpu_usage()
#include <bn_core.h>
Returns the CPU usage of the current frame.
A CPU usage greater than 1 means that at least one screen refresh should have been missed.
int bn:: core:: current_cpu_ticks()
#include <bn_core.h>
Returns the CPU timer ticks of the current frame.
A CPU tick count greater than timers::
fixed bn:: core:: last_cpu_usage()
#include <bn_core.h>
Returns the CPU usage of the last elapsed frame.
A CPU usage greater than 1 means that at least one screen refresh should have been missed.
If you only want to retrieve the number of missed screen refreshes, core::
int bn:: core:: last_cpu_ticks()
#include <bn_core.h>
Returns the CPU timer ticks of the last elapsed frame.
A CPU tick count greater than timers::
If you only want to retrieve the number of missed screen refreshes, core::
fixed bn:: core:: last_vblank_usage()
#include <bn_core.h>
Returns the maximum V-Blank usage of the last elapsed frame.
A V-Blank usage greater than 1 means that the screen is being redrawn before all of GBA display components are updated.
int bn:: core:: last_vblank_ticks()
#include <bn_core.h>
Returns the maximum V-Blank timer ticks of the last elapsed frame.
A V-Blank tick count greater than timers::
int bn:: core:: last_missed_frames()
#include <bn_core.h>
Returns the number of screen refreshes that were missed in the last core::
update_ callback_ type bn:: core:: update_callback()
#include <bn_core.h>
Returns the user function called in core::
void bn:: core:: set_update_callback(update_ callback_ type update_callback)
#include <bn_core.h>
Sets the user function called in core::
vblank_ callback_ type bn:: core:: vblank_callback()
#include <bn_core.h>
Returns the user function called in V-Blank.
void bn:: core:: set_vblank_callback(vblank_ callback_ type vblank_callback)
#include <bn_core.h>
Sets the user function called in V-Blank.
bool bn:: core:: slow_game_pak()
#include <bn_core.h>
Indicates if a slow game pak like the SuperCard SD has been detected or not.
const system_ font& bn:: core:: system_font()
#include <bn_core.h>
Returns the font used to show assert and profiling messages.
void bn:: core:: set_system_font(const bn:: system_font& font)
#include <bn_core.h>
Sets the font used to show assert and profiling messages.
const string_ view& bn:: core:: assert_tag()
#include <bn_core.h>
Returns the tag displayed in assert messages.
void bn:: core:: set_assert_tag(const string_ view& assert_tag)
#include <bn_core.h>
Sets the tag displayed in assert messages.
void bn:: core:: log_stacktrace()
#include <bn_core.h>
Logs the current stack trace.
The stack trace is mangled, you can demangle it with demangler.com for example.