SSBM Decomp
Loading...
Searching...
No Matches
ppc_mem.h
Go to the documentation of this file.
1
#ifndef _METROTRK_PPC_MEM_H
2
#define _METROTRK_PPC_MEM_H
3
4
#include <
platform.h
>
5
6
static
inline
u8
ppc_readbyte1
(
const
u8* ptr)
7
{
8
u32* alignedPtr = (u32*) ((u32) ptr & ~3);
9
return
(u8) (*alignedPtr >> ((3 - ((u32) ptr - (u32) alignedPtr)) << 3));
10
}
11
12
static
inline
void
ppc_writebyte1
(u8* ptr, u8 val)
13
{
14
u32* alignedPtr = (u32*) ((u32) ptr & ~3);
15
u32 v = *alignedPtr;
16
u32 uVar3 = 0xFF << ((3 - ((u32) ptr - (u32) alignedPtr)) << 3);
17
u32 iVar1 = (3 - ((u32) ptr - (u32) alignedPtr)) << 3;
18
*alignedPtr = (v & ~uVar3) | (uVar3 & (val << iVar1));
19
}
20
21
#endif
platform.h
ppc_writebyte1
static void ppc_writebyte1(u8 *ptr, u8 val)
Definition
ppc_mem.h:12
ppc_readbyte1
static u8 ppc_readbyte1(const u8 *ptr)
Definition
ppc_mem.h:6
src
MetroTRK
ppc_mem.h
Generated by
1.9.8