mirror of
https://github.com/LNH-team/dspico-wrfuxxed.git
synced 2026-06-02 00:56:52 +02:00
Initial commit
This commit is contained in:
42
source/memNtrWram.h
Normal file
42
source/memNtrWram.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
|
||||
typedef enum
|
||||
{
|
||||
MEM_NTR_WRAM_ARM9 = 0,
|
||||
MEM_NTR_WRAM_ARM7 = 1
|
||||
} MemNtrWramMapping;
|
||||
|
||||
#define REG_WRAMCNT (*(vu8*)0x04000247)
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
static inline void mem_setNtrWram0Mapping(MemNtrWramMapping mapping)
|
||||
{
|
||||
REG_WRAMCNT = (REG_WRAMCNT & ~1) | mapping;
|
||||
}
|
||||
|
||||
static inline MemNtrWramMapping mem_getNtrWram0Mapping(void)
|
||||
{
|
||||
return REG_WRAMCNT & 1;
|
||||
}
|
||||
|
||||
static inline void mem_setNtrWram1Mapping(MemNtrWramMapping mapping)
|
||||
{
|
||||
REG_WRAMCNT = (REG_WRAMCNT & ~2) | (mapping << 1);
|
||||
}
|
||||
|
||||
static inline MemNtrWramMapping mem_getNtrWram1Mapping(void)
|
||||
{
|
||||
return (REG_WRAMCNT >> 1) & 1;
|
||||
}
|
||||
|
||||
static inline void mem_setNtrWramMapping(MemNtrWramMapping block0, MemNtrWramMapping block1)
|
||||
{
|
||||
REG_WRAMCNT = block0 | (block1 << 1);
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user