Memory module

Memory management utilities.

Files

file bn_alignment.h
file bn_config_ewram.h
file bn_ewram_wait_state.h
file bn_memory.h
file bn_memory_alias.h
file bn_unique_ptr.h

Namespaces

namespace bn
Main Butano namespace.
namespace bn::memory
Memory related functions.

Classes

template<typename Type>
struct bn::default_delete
Default deleter.

Functions

template<int Bytes>
auto aligned(const void* pointer) -> bool
Indicates if the given void pointer is aligned to the given Bytes.
template<int Bytes, typename Type>
auto aligned(const Type* pointer) -> bool
Indicates if the given Type pointer is aligned to the given Bytes.

Defines

#define BN_CFG_EWRAM_WAIT_STATE
#define BN_EWRAM_WAIT_STATE_2
#define BN_EWRAM_WAIT_STATE_1

Function documentation

template<int Bytes>
bool aligned(const void* pointer)

Indicates if the given void pointer is aligned to the given Bytes.

template<int Bytes, typename Type>
bool aligned(const Type* pointer)

Indicates if the given Type pointer is aligned to the given Bytes.

Define documentation

#define BN_CFG_EWRAM_WAIT_STATE

Specifies EWRAM access time in clock cycles.

Values not specified in BN_EWRAM_WAIT_STATE_* macros are not allowed.

#define BN_EWRAM_WAIT_STATE_2

EWRAM access time is 2+1 clock cycles for sequential accesses.

#define BN_EWRAM_WAIT_STATE_1

EWRAM access time is 1+1 clock cycles for sequential accesses.

This wait states setting is not supported by the GBA Micro. Enabling it will not crash the GBA Micro though, it will just fall back to BN_EWRAM_WAIT_STATE_2.

Some GBA SPs will crash after a few frames with this setting.