libdragon
|
N64 System Interface. More...
Go to the source code of this file.
Macros | |
#define | RCP_FREQUENCY (__boot_consoletype ? 96000000 : 62500000) |
Frequency of the RCP. | |
#define | CPU_FREQUENCY (__boot_consoletype ? 144000000 : 93750000) |
Frequency of the MIPS R4300 CPU. | |
#define | KSEG0_START_ADDR ((void*)0x80000000) |
void pointer to cached and non-mapped memory start address | |
#define | UncachedAddr(_addr) ((void *)(((unsigned long)(_addr))|0x20000000)) |
Return the uncached memory address for a given address. | |
#define | UncachedShortAddr(_addr) ((short *)(((unsigned long)(_addr))|0x20000000)) |
Return the uncached memory address for a given address. | |
#define | UncachedUShortAddr(_addr) ((unsigned short *)(((unsigned long)(_addr))|0x20000000)) |
Return the uncached memory address for a given address. | |
#define | UncachedLongAddr(_addr) ((long *)(((unsigned long)(_addr))|0x20000000)) |
Return the uncached memory address for a given address. | |
#define | UncachedULongAddr(_addr) ((unsigned long *)(((unsigned long)(_addr))|0x20000000)) |
Return the uncached memory address for a given address. | |
#define | CachedAddr(_addr) ((void *)(((unsigned long)(_addr))&~0x20000000)) |
Return the cached memory address for a given address. | |
#define | PhysicalAddr(_addr) |
Return the physical memory address for a given address. | |
#define | HEAP_START_ADDR ((void*)__bss_end) |
Void pointer to the start of heap memory. | |
#define | MEMORY_BARRIER() asm volatile ("" : : : "memory") |
Memory barrier to ensure in-order execution. | |
#define | TICKS_READ() C0_COUNT() |
Returns the 32-bit hardware tick counter. | |
#define | TICKS_PER_SECOND (CPU_FREQUENCY/2) |
Number of updates to the count register per second. | |
#define | TICKS_DISTANCE(from, to) ((int32_t)((uint32_t)(to) - (uint32_t)(from))) |
Calculate the time passed between two ticks. | |
#define | TICKS_SINCE(t0) TICKS_DISTANCE(t0, TICKS_READ()) |
Return how much time has passed since the instant t0. | |
#define | TICKS_BEFORE(t1, t2) ({ TICKS_DISTANCE(t1, t2) > 0; }) |
Returns true if "t1" is before "t2". | |
#define | TICKS_FROM_MS(val) (((val) * (TICKS_PER_SECOND / 1000))) |
Returns equivalent count ticks for the given milliseconds. | |
#define | TICKS_FROM_US(val) (((val) * (8 * TICKS_PER_SECOND / 1000000) / 8)) |
Returns equivalent count ticks for the given microseconds. | |
#define | TICKS_TO_US(val) (((val) * 8 / (8 * TICKS_PER_SECOND / 1000000))) |
Returns equivalent count ticks for the given microseconds. | |
#define | TICKS_TO_MS(val) (((val) / (TICKS_PER_SECOND / 1000))) |
Returns equivalent count ticks for the given microseconds. | |
#define | data_cache_hit_invalidate(addr_, sz_) |
Force a data cache invalidate over a memory region. | |
Enumerations | |
enum | tv_type_t { TV_PAL = 0 , TV_NTSC = 1 , TV_MPAL = 2 } |
Type of TV video output. More... | |
enum | reset_type_t { RESET_COLD = 0 , RESET_WARM = 1 } |
Reset types. More... | |
Functions | |
bool | sys_bbplayer (void) |
Return true if we are running on a iQue player. | |
uint64_t | get_ticks (void) |
Read the number of ticks since system startup. | |
uint64_t | get_ticks_us (void) |
Read the number of microseconds since system startup. | |
uint64_t | get_ticks_ms (void) |
Read the number of millisecounds since system startup. | |
void | wait_ticks (unsigned long wait) |
Spin wait until the number of ticks have elapsed. | |
void | wait_ms (unsigned long wait_ms) |
Spin wait until the number of milliseconds have elapsed. | |
void | __data_cache_hit_invalidate (volatile void *addr, unsigned long length) |
Underlying implementation of data_cache_hit_invalidate. | |
void | data_cache_hit_writeback (volatile const void *, unsigned long) |
Force a data cache writeback over a memory region. | |
void | data_cache_hit_writeback_invalidate (volatile void *, unsigned long) |
Force a data cache writeback invalidate over a memory region. | |
void | data_cache_index_writeback_invalidate (volatile void *, unsigned long) |
Force a data cache index writeback invalidate over a memory region. | |
void | data_cache_writeback_invalidate_all (void) |
Force a data cache writeback invalidate over whole memory. | |
void | inst_cache_hit_writeback (volatile const void *, unsigned long) |
Force an instruction cache writeback over a memory region. | |
void | inst_cache_hit_invalidate (volatile void *, unsigned long) |
Force an instruction cache invalidate over a memory region. | |
void | inst_cache_index_invalidate (volatile void *, unsigned long) |
Force an instruction cache index invalidate over a memory region. | |
void | inst_cache_invalidate_all (void) |
Force an instruction cache invalidate over whole memory. | |
int | get_memory_size () |
Get amount of available memory. | |
bool | is_memory_expanded () |
Is expansion pak in use. | |
void * | malloc_uncached (size_t size) |
Allocate a buffer that will be accessed as uncached memory. | |
void * | malloc_uncached_aligned (int align, size_t size) |
Allocate a buffer that will be accessed as uncached memory, specifying alignment. | |
void | free_uncached (void *buf) |
Free an uncached memory buffer. | |
tv_type_t | get_tv_type () |
Is system NTSC/PAL/MPAL. | |
reset_type_t | sys_reset_type (void) |
Get reset type. | |
N64 System Interface.