Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <z64ovl/oot/u10.h>
- typedef struct {
- z64_actor_t actor;
- } entity_t;
- typedef union {
- void* dp_void;
- u8* dp_u8;
- u16* dp_u16;
- u32* dp_u32;
- u64* dp_u64;
- s8* dp_s8;
- s16* dp_s16;
- s32* dp_s32;
- s64* dp_s64;
- u8 bytes[ 4 ];
- u32 word;
- } dp_types;
- typedef union {
- u8 bytes[ 11 ];
- struct {
- u8* ptr;
- u8 padding[ 7 ];
- } c00_data;
- struct {
- u8 number_of_bytes;
- u8 bytes[ 10 ];
- } c01_data;
- struct {
- u64 number_of_zeroes;
- u8 padding[ 3 ];
- } c02_data;
- struct {
- // ?????
- } c03_data;
- struct {
- void (*func_pointer)(void);
- u8 padding[ 7 ];
- } c04_data;
- } pad_data_t;
- // sizeof(pad_data_t) == 11
- static volatile dp_types data_pointer;
- static void step( entity_t* entity, z64_global_t* global ) {
- volatile pad_data_t temp;
- union {
- struct {
- u8 big_endian_padding;
- u8 ll_command;
- u8 byte2;
- u8 byte1;
- };
- u32 word;
- } leftover;
- #define padb( pad, byte ) ( ((u8*)&(global->common.input[ pad ].raw))[ byte ] )
- temp.bytes[ 0 ] = padb( 1, 0 );
- temp.bytes[ 1 ] = padb( 1, 2 );
- temp.bytes[ 2 ] = padb( 1, 3 );
- temp.bytes[ 3 ] = padb( 2, 0 );
- temp.bytes[ 4 ] = padb( 2, 2 );
- temp.bytes[ 5 ] = padb( 2, 3 );
- temp.bytes[ 6 ] = padb( 3, 0 );
- temp.bytes[ 7 ] = padb( 3, 2 );
- temp.bytes[ 8 ] = padb( 3, 3 );
- leftover.word = padb( 1, 1 ); leftover.word <<= 6;
- leftover.word |= padb( 2, 1 ); leftover.word <<= 6;
- leftover.word |= padb( 3, 1 );
- temp.bytes[ 9 ] = leftover.byte1;
- temp.bytes[ 10 ] = leftover.byte2;
- switch( leftover.ll_command ) {
- case 0: {
- } break;
- }
- }
- const z64_actor_init_t init_vars = {
- .number = 0xDEAD, .padding = 0xBEEF,
- .type = 0x06, // stage prop
- .room = 0x00,
- .flags = 0x00000030,
- .object = 1,
- .instance_size = sizeof(entity_t),
- .init = NULL,
- .dest = NULL,
- .main = step,
- .draw = NULL
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement