Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "z3d.h"
- #include "advance.h"
- vec3 pos;
- uint16_t angle;
- advance_ctx_t advance_ctx = {};
- advance_input_t inputs = {};
- uint8_t advance_init;
- void scan_inputs() {
- inputs.cur.val = real_hid.pad.pads[real_hid.pad.index].curr.val;
- inputs.pressed.val = (inputs.cur.val) & (~inputs.old.val);
- inputs.up.val = (~inputs.cur.val) & (inputs.old.val);
- inputs.old.val = inputs.cur.val;
- }
- void advance_main() {
- scan_inputs();
- if(inputs.pressed.d_left){
- pos = link.pos_1;
- //angle = ANGLE //todo
- }
- scan_inputs();
- if(inputs.pressed.d_right){
- link.pos_1 = pos;
- link.pos_2 = pos;
- //ANGLE = angle //todo
- }
- }
- ------------------------------------------------------------------------
- #ifndef Z3D_H
- #define Z3D_H
- #include "hid.h"
- typedef void* (*memcpy_proc) (void* dst, void* src, uint32_t size);
- #if Z3D == MM3D
- #define real_hid_addr 0x10002000
- #define hid_ctx_addr 0x007b2d30
- #define z3d_rupee_addr 0x00775318
- #define memcpy_addr 0x001f28e8
- #elif Z3D == OOT3D
- #define real_hid_addr 0x10002000
- #define hid_ctx_addr 0x005AEC58
- #define z3d_rupee_addr 0x005879A0
- #define memcpy_addr 0x00371738
- #endif
- #define real_hid (*(hid_mem_t *) real_hid_addr)
- #define hid_ctx (*(hid_ctx_t *) hid_ctx_addr)
- #define memcpy ((memcpy_proc) memcpy_addr)
- #define z3d_rupee (*(uint16_t *)z3d_rupee_addr)
- typedef struct
- {
- uint16_t magic;
- uint16_t free;
- uint32_t size;
- struct heap_node_t* next;
- struct heap_node_t* prev;
- } heap_node_t;
- typedef struct
- {
- float x;
- float y;
- float z;
- } vec3;
- typedef struct
- {
- uint32_t ukn1; //0x0
- uint32_t ukn2; //0x4
- vec3 pos_1; //0x8, 0xc, 0x10
- uint32_t ukn3; //0x14
- uint32_t ukn4; //0x18
- uint32_t ukn5; //0x1c
- uint32_t ukn6; //0x20
- uint32_t ukn7; //0x24
- vec3 pos_2; //0x28, 0x2c, 0x30
- } actor_t;
- #define actor_heap_begin_addr_maybe 0x005a2E3C
- //#define link_addr ((*((void**)actor_heap_begin_addr_maybe)) + sizeof(heap_node_t)) //should always be 0x908f5010 but that is more slightly more proper
- #define link_addr 0x098f5010
- #define link (*((actor_t *)link_addr))
- #endif //Z3D_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement