diff options
| author | Anghelo Carvajal <angheloalf95@gmail.com> | 2021-11-06 00:29:56 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-06 00:29:56 -0300 |
| commit | 278ff4a4b372c7ef6e2ba8b7d114d76adcfbcecc (patch) | |
| tree | cacd28facfbc84eb8c7b28dfd8a02ec50ef2f17c /src | |
| parent | e70a8fbb992eb05d606406ae70974e56bcf912dc (diff) | |
`motor.c` OK (#397)
* use motor in the spec
* import bss
* Delete viextendvstart.c
* rename functions
* move stuff and format
* remove globals.h and ultra64.h
* Update src/libultra/io/motor.c
Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>
* add motor.h to padmgr
* fix
Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/boot_O1/viextendvstart.c | 5 | ||||
| -rw-r--r-- | src/code/padmgr.c | 1 | ||||
| -rw-r--r-- | src/libultra/io/motor.c | 21 | ||||
| -rw-r--r-- | src/libultra/io/rumblepak.c | 7 |
4 files changed, 14 insertions, 20 deletions
diff --git a/src/boot_O1/viextendvstart.c b/src/boot_O1/viextendvstart.c deleted file mode 100644 index ce9f718d0..000000000 --- a/src/boot_O1/viextendvstart.c +++ /dev/null @@ -1,5 +0,0 @@ -#include "global.h" - -void osViExtendVStart(u32 a0) { - __additional_scanline = a0; -} diff --git a/src/code/padmgr.c b/src/code/padmgr.c index a8ef1db15..0d539126a 100644 --- a/src/code/padmgr.c +++ b/src/code/padmgr.c @@ -1,4 +1,5 @@ #include "global.h" +#include "ultra64/motor.h" #pragma GLOBAL_ASM("asm/non_matchings/code/padmgr/Padmgr_GetControllerBitmask.s") diff --git a/src/libultra/io/motor.c b/src/libultra/io/motor.c index 25254c61b..4c0bfb67a 100644 --- a/src/libultra/io/motor.c +++ b/src/libultra/io/motor.c @@ -1,12 +1,16 @@ -#include "ultra64.h" -#include "global.h" +#include "ultra64/motor.h" + +#include "io/controller.h" +#include "functions.h" #define BANK_ADDR 0x400 #define MOTOR_ID 0x80 +OSPifRam osPifBuffers[MAXCONTROLLERS]; + s32 __osPfsSelectBank(OSPfs* pfs, u8 bank); -s32 osSetRumble(OSPfs* pfs, u32 vibrate) { +s32 __osMotorAccess(OSPfs* pfs, u32 vibrate) { s32 i; s32 ret; u8* buf = (u8*)&osPifBuffers[pfs->channel]; @@ -45,10 +49,11 @@ s32 osSetRumble(OSPfs* pfs, u32 vibrate) { return ret; } -void osSetUpMempakWrite(u32 channel, OSPifRam* buf) { + +void _MakeMotorData(s32 channel, OSPifRam* buf) { u8* bufptr = (u8*)buf; __OSContRamReadFormat mempakwr; - u32 i; + s32 i; mempakwr.dummy = 0xFF; mempakwr.txsize = 0x23; @@ -68,7 +73,7 @@ void osSetUpMempakWrite(u32 channel, OSPifRam* buf) { *bufptr = 0xFE; } -s32 osProbeRumblePak(OSMesgQueue* ctrlrqueue, OSPfs* pfs, u32 channel) { +s32 osMotorInit(OSMesgQueue* ctrlrqueue, OSPfs* pfs, s32 channel) { s32 ret; u8 sp24[BLOCKSIZE]; @@ -111,8 +116,8 @@ s32 osProbeRumblePak(OSMesgQueue* ctrlrqueue, OSPfs* pfs, u32 channel) { if (sp24[BLOCKSIZE - 1] != MOTOR_ID) { return 0xB; } - if ((pfs->status & PFS_MOTOR_INITIALIZED) == 0) { - osSetUpMempakWrite(channel, &osPifBuffers[channel]); + if (!(pfs->status & PFS_MOTOR_INITIALIZED)) { + _MakeMotorData(channel, &osPifBuffers[channel]); } pfs->status = PFS_MOTOR_INITIALIZED; diff --git a/src/libultra/io/rumblepak.c b/src/libultra/io/rumblepak.c deleted file mode 100644 index 3353059da..000000000 --- a/src/libultra/io/rumblepak.c +++ /dev/null @@ -1,7 +0,0 @@ -#include "global.h" - -#pragma GLOBAL_ASM("asm/non_matchings/boot/rumblepak/osSetRumble.s") - -#pragma GLOBAL_ASM("asm/non_matchings/boot/rumblepak/osSetUpMempakWrite.s") - -#pragma GLOBAL_ASM("asm/non_matchings/boot/rumblepak/osProbeRumblePak.s") |
