match and link pad.c

This commit is contained in:
Prakxo
2023-05-04 10:00:22 +00:00
parent f09c06cbfe
commit 879041ed4b
4 changed files with 32 additions and 1 deletions
+2
View File
@@ -38,6 +38,8 @@ libu64/gfxprint.c:
.sbss: [0x80218630, 0x80218638]
libu64/gfxprint_data.c:
.data: [0x800dc810, 0x800dd090]
libu64/pad.c:
.text: [0x8005b9a8, 0x8005ba2c]
libc64/aprintf.c:
.text: [0x8005cbdc, 0x8005cc14]
#libc64/math64.c: //not match
+6
View File
@@ -16,6 +16,12 @@ typedef struct {
/* 0x12 */ OSContPad off;
} pad_t;
int pad_physical_stick_x(pad_t*);
int pad_physical_stick_y(pad_t*);
void pad_set_logical_stick(pad_t*, int, int);
void pad_correct_stick(pad_t*);
#ifdef __cplusplus
}
#endif
+23
View File
@@ -0,0 +1,23 @@
#include "libu64/pad.h"
int pad_physical_stick_x(pad_t* pad){
return pad->now.stick_x;
}
int pad_physical_stick_y(pad_t* pad){
return pad->now.stick_y;
}
void pad_set_logical_stick(pad_t* pad, int x, int y){
pad->off.stick_x = x;
pad->off.stick_y = y;
}
void pad_correct_stick(pad_t* pad){
int x = pad_physical_stick_x(pad);
int y = pad_physical_stick_y(pad);
pad_set_logical_stick(pad,((x * 60) / 72), ((y * 60) / 72));
}