Discover gbpak and rumble functions

This commit is contained in:
Ryan Dwyer
2021-09-23 18:36:28 +10:00
parent 6e216d3f09
commit d1a5f42edd
31 changed files with 581 additions and 574 deletions
+5 -5
View File
@@ -22,7 +22,7 @@
build/ROMID/lib/ultra/os/initialize.o (section); \
build/ROMID/lib/ultra/io/sptask.o (section); \
build/ROMID/lib/lib_06100.o (section); \
build/ROMID/lib/lib_06330.o (section); \
build/ROMID/lib/ultra/io/gbpakpower.o (section); \
build/ROMID/lib/ultra/io/conteeplongwrite.o (section); \
build/ROMID/lib/lib_06550.o (section); \
build/ROMID/lib/lib_070d0.o (section); \
@@ -203,10 +203,10 @@
build/ROMID/lib/ultra/io/pfsreadwritefile.o (section); \
build/ROMID/lib/ultra/io/pfsnumfiles.o (section); \
build/ROMID/lib/ultra/io/pfsfilestate.o (section); \
build/ROMID/lib/lib_50be0.o (section); \
build/ROMID/lib/lib_50d60.o (section); \
build/ROMID/lib/lib_50f20.o (section); \
build/ROMID/lib/lib_513b0.o (section); \
build/ROMID/lib/ultra/io/gbpakgetstatus.o (section); \
build/ROMID/lib/ultra/io/gbpakreadid.o (section); \
build/ROMID/lib/ultra/io/gbpakcheckconnector.o (section); \
build/ROMID/lib/ultra/io/gbpakreadwrite.o (section); \
build/ROMID/lib/ultra/os/setcompare.o (section); \
build/ROMID/lib/ultra/io/vimodepallan1.o (section); \
build/ROMID/lib/ultra/io/vimodempallan1.o (section); \
+5 -5
View File
@@ -21,7 +21,7 @@
build/ROMID/lib/ultra/os/initialize.o (section); \
build/ROMID/lib/ultra/io/sptask.o (section); \
build/ROMID/lib/lib_06100.o (section); \
build/ROMID/lib/lib_06330.o (section); \
build/ROMID/lib/ultra/io/gbpakpower.o (section); \
build/ROMID/lib/ultra/io/conteeplongwrite.o (section); \
build/ROMID/lib/lib_06550.o (section); \
build/ROMID/lib/lib_070d0.o (section); \
@@ -199,10 +199,10 @@
build/ROMID/lib/ultra/io/pfsreadwritefile.o (section); \
build/ROMID/lib/ultra/io/pfsnumfiles.o (section); \
build/ROMID/lib/ultra/io/pfsfilestate.o (section); \
build/ROMID/lib/lib_50be0.o (section); \
build/ROMID/lib/lib_50d60.o (section); \
build/ROMID/lib/lib_50f20.o (section); \
build/ROMID/lib/lib_513b0.o (section); \
build/ROMID/lib/ultra/io/gbpakgetstatus.o (section); \
build/ROMID/lib/ultra/io/gbpakreadid.o (section); \
build/ROMID/lib/ultra/io/gbpakcheckconnector.o (section); \
build/ROMID/lib/ultra/io/gbpakreadwrite.o (section); \
build/ROMID/lib/lib_51570.o (section); \
build/ROMID/lib/ultra/io/vimodepallan1.o (section); \
build/ROMID/lib/ultra/io/vimodempallan1.o (section); \
+5 -5
View File
@@ -21,7 +21,7 @@
build/ROMID/lib/ultra/os/initialize.o (section); \
build/ROMID/lib/ultra/io/sptask.o (section); \
build/ROMID/lib/lib_06100.o (section); \
build/ROMID/lib/lib_06330.o (section); \
build/ROMID/lib/ultra/io/gbpakpower.o (section); \
build/ROMID/lib/ultra/io/conteeplongwrite.o (section); \
build/ROMID/lib/lib_06550.o (section); \
build/ROMID/lib/lib_070d0.o (section); \
@@ -199,10 +199,10 @@
build/ROMID/lib/ultra/io/pfsreadwritefile.o (section); \
build/ROMID/lib/ultra/io/pfsnumfiles.o (section); \
build/ROMID/lib/ultra/io/pfsfilestate.o (section); \
build/ROMID/lib/lib_50be0.o (section); \
build/ROMID/lib/lib_50d60.o (section); \
build/ROMID/lib/lib_50f20.o (section); \
build/ROMID/lib/lib_513b0.o (section); \
build/ROMID/lib/ultra/io/gbpakgetstatus.o (section); \
build/ROMID/lib/ultra/io/gbpakreadid.o (section); \
build/ROMID/lib/ultra/io/gbpakcheckconnector.o (section); \
build/ROMID/lib/ultra/io/gbpakreadwrite.o (section); \
build/ROMID/lib/lib_51570.o (section); \
build/ROMID/lib/ultra/io/vimodepallan1.o (section); \
build/ROMID/lib/ultra/io/vimodempallan1.o (section); \
+22 -22
View File
@@ -126,7 +126,7 @@ u32 var80070118 = 0x78000000;
u32 var8007011c = 0x00000000;
#if VERSION >= VERSION_NTSC_1_0
void bgun0f097ba0(s32 handnum, s32 weaponnum)
void bgunRumble(s32 handnum, s32 weaponnum)
{
u32 stack;
s32 contpadtouse1;
@@ -134,24 +134,24 @@ void bgun0f097ba0(s32 handnum, s32 weaponnum)
bool singlewield = false;
s32 contpad1;
s32 contpad2;
s32 a;
s32 b;
s32 contpad1hasrumble;
s32 contpad2hasrumble;
joyGetContpadNumsForPlayer(g_Vars.currentplayernum, &contpad1, &contpad2);
if (optionsGetControlMode(g_Vars.currentplayerstats->mpindex) >= CONTROLMODE_21
&& contpad1 >= 0 && contpad2 >= 0) {
a = pak0f116914(contpad1) == 1;
b = pak0f116914(contpad2) == 1;
contpad1hasrumble = pakGetType(contpad1) == PAKTYPE_RUMBLE;
contpad2hasrumble = pakGetType(contpad2) == PAKTYPE_RUMBLE;
if (!weaponHasFlag(weaponnum, WEAPONFLAG_DUALWIELD)) {
singlewield = true;
}
if (a && b) {
if (contpad1hasrumble && contpad2hasrumble) {
if (singlewield) {
pak0f11dc04(contpad1, 0.2f, 2, 4);
pak0f11dc04(contpad2, 0.2f, 2, 4);
pakRumble(contpad1, 0.2f, 2, 4);
pakRumble(contpad2, 0.2f, 2, 4);
} else {
s32 contpadtouse1 = contpad1;
@@ -159,26 +159,26 @@ void bgun0f097ba0(s32 handnum, s32 weaponnum)
contpadtouse1 = contpad2;
}
pak0f11dc04(contpadtouse1, 0.2f, 2, 4);
pakRumble(contpadtouse1, 0.2f, 2, 4);
}
} else {
s32 contpadtouse2 = contpad1;
if (b) {
if (contpad2hasrumble) {
contpadtouse2 = contpad2;
}
pak0f11dc04(contpadtouse2, 0.2f, 2, 4);
pakRumble(contpadtouse2, 0.2f, 2, 4);
}
} else {
if (contpad1 >= 0) {
pak0f11dc04(contpad1, 0.2f, 2, 4);
pakRumble(contpad1, 0.2f, 2, 4);
}
}
}
#else
GLOBAL_ASM(
glabel bgun0f097ba0
glabel bgunRumble
/* f095b30: 27bdffd0 */ addiu $sp,$sp,-48
/* f095b34: 3c08800a */ lui $t0,0x800a
/* f095b38: 2508e6c0 */ addiu $t0,$t0,-6464
@@ -192,7 +192,7 @@ glabel bgun0f097ba0
/* f095b58: 28410004 */ slti $at,$v0,0x4
/* f095b5c: 1420007c */ bnez $at,.NB0f095d50
/* f095b60: 2508e6c0 */ addiu $t0,$t0,-6464
/* f095b64: 0fc44336 */ jal pak0f116914
/* f095b64: 0fc44336 */ jal pakGetType
/* f095b68: 8104028f */ lb $a0,0x28f($t0)
/* f095b6c: 3c08800a */ lui $t0,0x800a
/* f095b70: 2508e6c0 */ addiu $t0,$t0,-6464
@@ -233,7 +233,7 @@ glabel bgun0f097ba0
/* f095be8: 01f82021 */ addu $a0,$t7,$t8
/* f095bec: 0004ce00 */ sll $t9,$a0,0x18
/* f095bf0: 00192603 */ sra $a0,$t9,0x18
/* f095bf4: 0fc44336 */ jal pak0f116914
/* f095bf4: 0fc44336 */ jal pakGetType
/* f095bf8: afa6001c */ sw $a2,0x1c($sp)
/* f095bfc: 8fa6001c */ lw $a2,0x1c($sp)
/* f095c00: 3c08800a */ lui $t0,0x800a
@@ -282,7 +282,7 @@ glabel bgun0f097ba0
/* f095c98: 34a5cccd */ ori $a1,$a1,0xcccd
/* f095c9c: 03002025 */ or $a0,$t8,$zero
/* f095ca0: 24060002 */ addiu $a2,$zero,0x2
/* f095ca4: 0fc45e2f */ jal pak0f11dc04
/* f095ca4: 0fc45e2f */ jal pakRumble
/* f095ca8: 24070004 */ addiu $a3,$zero,0x4
/* f095cac: 1000002f */ beqz $zero,.NB0f095d6c
/* f095cb0: 8fbf0014 */ lw $ra,0x14($sp)
@@ -327,7 +327,7 @@ glabel bgun0f097ba0
/* f095d34: 34a5cccd */ ori $a1,$a1,0xcccd
/* f095d38: 01a02025 */ or $a0,$t5,$zero
/* f095d3c: 24060002 */ addiu $a2,$zero,0x2
/* f095d40: 0fc45e2f */ jal pak0f11dc04
/* f095d40: 0fc45e2f */ jal pakRumble
/* f095d44: 24070004 */ addiu $a3,$zero,0x4
/* f095d48: 10000008 */ beqz $zero,.NB0f095d6c
/* f095d4c: 8fbf0014 */ lw $ra,0x14($sp)
@@ -336,7 +336,7 @@ glabel bgun0f097ba0
/* f095d54: 34a5cccd */ ori $a1,$a1,0xcccd
/* f095d58: 8104028f */ lb $a0,0x28f($t0)
/* f095d5c: 24060002 */ addiu $a2,$zero,0x2
/* f095d60: 0fc45e2f */ jal pak0f11dc04
/* f095d60: 0fc45e2f */ jal pakRumble
/* f095d64: 24070004 */ addiu $a3,$zero,0x4
/* f095d68: 8fbf0014 */ lw $ra,0x14($sp)
.NB0f095d6c:
@@ -5903,7 +5903,7 @@ glabel var7f1ac320
/* f09a868: 8fad0058 */ lw $t5,0x58($sp)
/* f09a86c: 8fa4005c */ lw $a0,0x5c($sp)
/* f09a870: 8da50000 */ lw $a1,0x0($t5)
/* f09a874: 0fc25ee8 */ jal bgun0f097ba0
/* f09a874: 0fc25ee8 */ jal bgunRumble
/* f09a878: afa70064 */ sw $a3,0x64($sp)
/* f09a87c: 8fae0054 */ lw $t6,0x54($sp)
/* f09a880: 24060001 */ addiu $a2,$zero,0x1
@@ -6233,7 +6233,7 @@ glabel var7f1ac320
/* f09a868: 8fad0058 */ lw $t5,0x58($sp)
/* f09a86c: 8fa4005c */ lw $a0,0x5c($sp)
/* f09a870: 8da50000 */ lw $a1,0x0($t5)
/* f09a874: 0fc25ee8 */ jal bgun0f097ba0
/* f09a874: 0fc25ee8 */ jal bgunRumble
/* f09a878: afa70064 */ sw $a3,0x64($sp)
/* f09a87c: 8fae0054 */ lw $t6,0x54($sp)
/* f09a880: 24060001 */ addiu $a2,$zero,0x1
@@ -6563,7 +6563,7 @@ glabel var7f1ac320
/* f0988a4: 8fad0050 */ lw $t5,0x50($sp)
/* f0988a8: 8fa40054 */ lw $a0,0x54($sp)
/* f0988ac: 8da50000 */ lw $a1,0x0($t5)
/* f0988b0: 0fc256cc */ jal bgun0f097ba0
/* f0988b0: 0fc256cc */ jal bgunRumble
/* f0988b4: afa7005c */ sw $a3,0x5c($sp)
/* f0988b8: 8fae004c */ lw $t6,0x4c($sp)
/* f0988bc: 24060001 */ addiu $a2,$zero,0x1
@@ -6835,7 +6835,7 @@ const char var7f1ab898[] = "rofftime";
// hand->stateflags |= HANDSTATEFLAG_00000020;
// hand->stateflags |= HANDSTATEFLAG_00000010;
//
// bgun0f097ba0(handnum, info->weaponnum);
// bgunRumble(handnum, info->weaponnum);
//
// if (usesammo && func->ammoindex >= 0) {
// hand->loadedammo[func->ammoindex] -= hand->shotstotake;
+2 -2
View File
@@ -467,7 +467,7 @@ s32 cheatMenuHandleDialog(s32 operation, struct menudialog *dialog, union handle
if (operation == MENUOP_OPEN) {
func0f14a52c();
if (pak0f11e78c()) {
if (gbpakIsAnyPerfectDark()) {
gamefileSetFlag(GAMEFILEFLAG_USED_TRANSFERPAK);
}
@@ -497,7 +497,7 @@ s32 cheatMenuHandleDialog(s32 operation, struct menudialog *dialog, union handle
}
if (operation == MENUOP_CLOSE) {
if (pak0f11e78c()) {
if (gbpakIsAnyPerfectDark()) {
gamefileSetFlag(GAMEFILEFLAG_USED_TRANSFERPAK);
}
+4 -4
View File
@@ -4502,19 +4502,19 @@ void chrDamage(struct chrdata *chr, f32 damage, struct coord *vector, struct gse
joyGetContpadNumsForPlayer(g_Vars.currentplayernum, &contpad1, &contpad2);
if (contpad1 >= 0) {
pak0f11dc04(contpad1, 0.25f, -1, -1);
pakRumble(contpad1, 0.25f, -1, -1);
}
if (contpad2 >= 0) {
pak0f11dc04(contpad2, 0.25f, -1, -1);
pakRumble(contpad2, 0.25f, -1, -1);
}
#else
setCurrentPlayerNum(propGetPlayerNum(vprop));
pak0f11dc04((s8)g_Vars.currentplayernum, 0.25f, -1, -1);
pakRumble((s8)g_Vars.currentplayernum, 0.25f, -1, -1);
if (optionsGetControlMode(g_Vars.currentplayerstats->mpindex) >= CONTROLMODE_21) {
pak0f11dc04((s8)(PLAYERCOUNT() + g_Vars.currentplayernum), 0.25f, -1, -1);
pakRumble((s8)(PLAYERCOUNT() + g_Vars.currentplayernum), 0.25f, -1, -1);
}
#endif
+3 -3
View File
@@ -225,7 +225,7 @@ void filelistUpdate(struct filelist *list)
}
list->deviceguids[dis2dev[i]].fileid = 0;
list->deviceguids[dis2dev[i]].deviceserial = pakGetDeviceSerial(dis2dev[i]);
list->deviceguids[dis2dev[i]].deviceserial = pakGetSerial(dis2dev[i]);
} else {
// PFS error?
list->spacesfree[dis2dev[i]] = -1;
@@ -254,7 +254,7 @@ void filelistUpdate(struct filelist *list)
list->devicestartindexes[dev2dis[filedevices[i]]] = list->numfiles;
}
file->deviceserial = pakGetDeviceSerial(filedevices[i]);
file->deviceserial = pakGetSerial(filedevices[i]);
file->fileid = sp1288[i];
list->numfiles++;
@@ -267,7 +267,7 @@ void filelistUpdate(struct filelist *list)
if (list->deviceguids[filedevices[i]].fileid == 0) {
list->deviceguids[filedevices[i]].fileid = sp1288[i];
list->deviceguids[filedevices[i]].deviceserial = pakGetDeviceSerial(filedevices[i]);
list->deviceguids[filedevices[i]].deviceserial = pakGetSerial(filedevices[i]);
}
}
}
+1 -1
View File
@@ -2423,7 +2423,7 @@ char *pakMenuTextEditingPakName(struct menuitem *item)
s32 pakSelectionMenuHandler(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_CHECKDISABLED) {
if (!pakIsConnected((s8)item->param)) {
if (!pakIsMemoryPak((s8)item->param)) {
return true;
}
}
+4 -4
View File
@@ -559,7 +559,7 @@ glabel var7f1ad568
/* f0b7318: adc80004 */ sw $t0,0x4($t6)
/* f0b731c: adc10008 */ sw $at,0x8($t6)
/* f0b7320: 8e31d03c */ lw $s1,%lo(g_StageSetup+0xc)($s1)
/* f0b7324: 0fc47788 */ jal pak0f11de20
/* f0b7324: 0fc47788 */ jal pakEnableRumbleForPlayer
/* f0b7328: 8244028f */ lb $a0,0x28f($s2)
/* f0b732c: 8e490284 */ lw $t1,0x284($s2)
/* f0b7330: a12019b3 */ sb $zero,0x19b3($t1)
@@ -896,7 +896,7 @@ glabel var7f1ad568
// u32 stack[4];
// s32 aiStack188[34]; // 5c
//
// pak0f11de20(g_Vars.currentplayernum);
// pakEnableRumbleForPlayer(g_Vars.currentplayernum);
//
// g_Vars.currentplayer->dostartnewlife = false;
//
@@ -3473,7 +3473,7 @@ void func0f0ba010(void)
var8009de2c = -1;
g_InCutscene = 1;
pak0f11dcb0(1);
pakStopRumbleForAllPaks(true);
g_Vars.in_cutscene = g_Vars.tickmode == TICKMODE_CUTSCENE && g_CutsceneCurAnimFrame60 < animGetNumFrames(g_CutsceneAnimNum) - 1;
g_Vars.cutsceneskip60ths = 0;
}
@@ -14136,7 +14136,7 @@ Gfx *currentPlayerRenderHud(Gfx *gdl)
bool pass = false;
if (g_Vars.currentplayer->isdead == 1) {
pak0f11dd58(g_Vars.currentplayernum);
pakDisableRumbleForPlayer(g_Vars.currentplayernum);
g_Vars.currentplayer->isdead = 2;
pass = true;
}
+12 -12
View File
@@ -650,12 +650,12 @@ glabel var7f1b1f44nc
/* f1627d0: 3c018008 */ lui $at,0x8008
/* f1627d4: ac206874 */ sw $zero,0x6874($at)
/* f1627d8: 3c018008 */ lui $at,0x8008
/* f1627dc: 0c005812 */ jal joy000150c4
/* f1627dc: 0c005812 */ jal joyIsCyclicPollingEnabled
/* f1627e0: ac206870 */ sw $zero,0x6870($at)
/* f1627e4: 10400008 */ beqz $v0,.NB0f162808
/* f1627e8: 3c057f1b */ lui $a1,0x7f1b
/* f1627ec: 24a51e20 */ addiu $a1,$a1,0x1e20
/* f1627f0: 0c00581b */ jal joyGetLock
/* f1627f0: 0c00581b */ jal joyDisableCyclicPolling
/* f1627f4: 240402f8 */ addiu $a0,$zero,0x2f8
/* f1627f8: 3c11800a */ lui $s1,0x800a
/* f1627fc: 2631e6c0 */ addiu $s1,$s1,-6464
@@ -6948,7 +6948,7 @@ glabel var7f1b8ed0pf
/* f16c7a4: 10000003 */ b .PF0f16c7b4
/* f16c7a8: a28004d1 */ sb $zero,0x4d1($s4)
.PF0f16c7ac:
/* f16c7ac: 0fc47a8d */ jal pak0f11df38
/* f16c7ac: 0fc47a8d */ jal pakEnableRumbleForAllPlayers
/* f16c7b0: a29804d1 */ sb $t8,0x4d1($s4)
.PF0f16c7b4:
/* f16c7b4: 2415ffff */ li $s5,-1
@@ -8222,7 +8222,7 @@ void lvTick(void)
g_Vars.paksconnected2 = 0;
} else {
g_Vars.paksconnected2 = 31;
pak0f11df38();
pakEnableRumbleForAllPlayers();
}
g_Vars.joydisableframestogo = -1;
@@ -8566,12 +8566,12 @@ glabel lvTick
.NB0f166764:
/* f166764: 14400018 */ bnez $v0,.NB0f1667c8
/* f166768: 00000000 */ sll $zero,$zero,0x0
/* f16676c: 0c005812 */ jal joy000150c4
/* f16676c: 0c005812 */ jal joyIsCyclicPollingEnabled
/* f166770: 00000000 */ sll $zero,$zero,0x0
/* f166774: 14400004 */ bnez $v0,.NB0f166788
/* f166778: 24040cce */ addiu $a0,$zero,0xcce
/* f16677c: 3c057f1b */ lui $a1,0x7f1b
/* f166780: 0c005834 */ jal joyReleaseLock
/* f166780: 0c005834 */ jal joyEnableCyclicPolling
/* f166784: 24a51e98 */ addiu $a1,$a1,0x1e98
.NB0f166788:
/* f166788: 8e8204b4 */ lw $v0,0x4b4($s4)
@@ -8588,7 +8588,7 @@ glabel lvTick
/* f1667b0: 10000003 */ beqz $zero,.NB0f1667c0
/* f1667b4: a28004d1 */ sb $zero,0x4d1($s4)
.NB0f1667b8:
/* f1667b8: 0fc45ecc */ jal pak0f11df38
/* f1667b8: 0fc45ecc */ jal pakEnableRumbleForAllPlayers
/* f1667bc: a28f04d1 */ sb $t7,0x4d1($s4)
.NB0f1667c0:
/* f1667c0: 2415ffff */ addiu $s5,$zero,-1
@@ -9821,7 +9821,7 @@ void lvRecordDistanceMoved(void)
void lvReset(void)
{
pak0f11dcb0(1);
pakStopRumbleForAllPaks(true);
if (g_MiscAudioHandle && audioIsPlaying(g_MiscAudioHandle)) {
audioStop(g_MiscAudioHandle);
@@ -9872,9 +9872,9 @@ void lvCheckPauseStateChanged(void)
if (paused != var80084010) {
if (paused) {
pak0f11deb8();
pakDisableRumbleForAllPlayers();
} else {
pak0f11df38();
pakEnableRumbleForAllPlayers();
}
}
@@ -9884,11 +9884,11 @@ void lvCheckPauseStateChanged(void)
void lvSetPaused(bool paused)
{
if (paused) {
pak0f11deb8();
pakDisableRumbleForAllPlayers();
snd0000fe20();
} else {
snd0000fe50();
pak0f11df38();
pakEnableRumbleForAllPlayers();
}
var80084014 = paused;
+325 -320
View File
File diff suppressed because it is too large Load Diff
+28
View File
@@ -68,6 +68,23 @@ typedef struct {
char game_name[16];
} OSPfsState;
typedef struct {
u16 fixed1; /* Fixed data (0x00, 0xc3) */
u16 start_address; /* Program start address */
u8 nintendo_chr[0x30]; /* "Nintendo" character data */
u8 game_title[16]; /* Game title */
u16 company_code; /* Company code */
u8 body_code; /* Body code */
u8 cart_type; /* Game pak type */
u8 rom_size; /* ROM size */
u8 ram_size; /* RAM size */
u8 country_code; /* country code */
u8 fixed_data; /* fixed data(0x33) */
u8 version; /* Mask ROM version number */
u8 isum; /* Complement check */
u16 sum; /* Sum check */
} OSGbpakId;
/**************************************************************************
*
* Global definitions
@@ -87,11 +104,16 @@ typedef struct {
#define PFS_ERR_EXIST 9 /* file exists */
#define PFS_ERR_ID_FATAL 10 /* dead ram pack */
#define PFS_ERR_DEVICE 11 /* wrong device type */
#define PFS_ERR_NO_GBCART 12 /* no gb cartridge (64GB-PAK) */
#define PFS_ERR_NEW_GBCART 13 /* gb cartridge may be changed */
#define OS_PFS_VERSION 0x0200
#define OS_PFS_VERSION_HI (OS_PFS_VERSION >> 8)
#define OS_PFS_VERSION_LO (OS_PFS_VERSION & 255)
#define OS_GBPAK_POWER_OFF 0
#define OS_GBPAK_POWER_ON 1
#define PFS_FILE_NAME_LEN 16
#define PFS_FILE_EXT_LEN 4
#define BLOCKSIZE 32 /* bytes */
@@ -167,6 +189,12 @@ s32 osMotorAccess(OSPfs *pfs, u32 vibrate);
void osSetUpMempakWrite(s32 channel, OSPifRam* buf);
s32 osMotorProbe(OSMesgQueue *mq, OSPfs *pfs, s32 channel);
s32 osGbpakCheckConnector(OSPfs *pfs, u8 *status);
s32 osGbpakGetStatus(OSPfs *pfs, u8 *status);
s32 osGbpakPower(OSPfs *pfs, s32 flag);
s32 osGbpakReadId(OSPfs *pfs, OSGbpakId *id, u8 *status);
s32 osGbpakReadWrite(OSPfs *pfs, u16 flag, u16 address, u8 *buffer, u16 size);
#endif /* defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS) */
#ifdef _LANGUAGE_C_PLUS_PLUS
+17
View File
@@ -1000,6 +1000,9 @@
#define GAMEFILEFLAG_4D 0x4d
#define GAMEFILEFLAG_4E 0x4e
#define GBGAME_OTHER 0
#define GBGAME_PD 2
#define GOPOSFLAG_SPEED 0x03 // bits 0x01 and 0x02 combined
#define GOPOSFLAG_INIT 0x04
#define GOPOSFLAG_FORPATHSTART 0x08
@@ -3082,6 +3085,11 @@
#define PAKFILETYPE_GAME 0x080
#define PAKFILETYPE_100 0x100
#define PAKTYPE_NONE 0
#define PAKTYPE_RUMBLE 1
#define PAKTYPE_MEMORY 2
#define PAKTYPE_GAMEBOY 3
#define PATHFLAG_CIRCULAR 1
#define PATHFLAG_FLYING 2
#define PATHFLAG_INUSE 4
@@ -3230,6 +3238,15 @@
#define ROOMFLAG_PLAYAMBIENTTRACK 0x4000
#define ROOMFLAG_OUTDOORS 0x8000
#define RUMBLESTATE_1 1
#define RUMBLESTATE_ENABLED_STOPPED 2
#define RUMBLESTATE_ENABLED_STARTING 3
#define RUMBLESTATE_ENABLED_RUMBLING 4
#define RUMBLESTATE_ENABLED_STOPPING 5
#define RUMBLESTATE_DISABLED_STOPPING 6
#define RUMBLESTATE_DISABLED_STOPPED 7
#define RUMBLESTATE_ENABLING 8
#define SAVEDEVICE_CONTROLLERPAK1 0
#define SAVEDEVICE_CONTROLLERPAK2 1
#define SAVEDEVICE_CONTROLLERPAK3 2
+1 -1
View File
@@ -4,7 +4,7 @@
#include "data.h"
#include "types.h"
void bgun0f097ba0(s32 handnum, s32 weaponnum);
void bgunRumble(s32 handnum, s32 weaponnum);
s32 bgunGetUnequippedReloadIndex(s32 weaponnum);
void bgunTickUnequippedReload(void);
bool bgun0f097df0(struct inventory_typef *arg0, struct hand *hand);
+21 -21
View File
@@ -9,7 +9,7 @@ u32 pakAlign(s8 device, u32 size);
s32 pakGetAlignedFileLenByBodyLen(s8 device, s32 bodylen);
u32 pakGetBodyLenByFileLen(u32 filelen);
u32 pakGenerateSerial(s8 device);
bool pakIsConnected(s8 device);
bool pakIsMemoryPak(s8 device);
s32 pak0f1167b0(s8 device, u32 filetype, u32 *buffer1024);
s32 pak0f1167d8(s8 device);
s32 pak0f116800(s8 device, s32 fileid, u8 *body, s32 arg3);
@@ -17,20 +17,20 @@ s32 pak0f116828(s8 device, s32 fileid, s32 filetype, u8 *body, s32 *outfileid, s
bool pakDeleteFile(s8 device, s32 fileid);
s32 pakDeleteGameNote(s8 device, u16 company_code, u32 game_code, char *game_name, char *ext_name);
s32 pak0f1168c4(s8 device, struct pakdata **arg1);
u32 pak0f116914(s8 device);
s32 pakGetDeviceSerial(s8 device);
u32 pakGetType(s8 device);
s32 pakGetSerial(s8 device);
void pak0f11698c(s8 device);
void pak0f116994(void);
void pak0f1169c8(s8 device, s32 arg1);
bool pak0f116aec(s8 device);
bool pak0f116b5c(s8 device);
void pak0f116bdc(s8 device, u8 *arg1, u8 *arg2);
u16 pakGetSerial(s8 device);
u32 pakGetUnk000(s8 device);
u16 _pakGetSerial(s8 device);
u32 _pakGetType(s8 device);
void pakSetUnk010(s8 device, s32 value);
s32 pak0f116df0(s8 device, struct pakdata **arg1);
s32 pakDeleteGameNote2(s8 device, u16 company_code, u32 game_code, char *game_name, char *ext_name);
s32 pakDeleteFile2(s8 device, s32 fileid);
s32 _pakDeleteGameNote(s8 device, u16 company_code, u32 game_code, char *game_name, char *ext_name);
s32 _pakDeleteFile(s8 device, s32 fileid);
s32 pakGetUnk264(s8 device);
u32 pakGetMaxFileSize(s8 device);
s32 pakGetBodyLenByType(s8 device, u32 filetype);
@@ -105,9 +105,9 @@ void pak0f11c54c(void);
void pak0f11c6d0(void);
void pakExecuteDebugOperations(void);
void pak0f11ca30(void);
void pak0f11cb9c(u32 arg0);
s32 pak0f11cbd8(s8 device, s32 arg1, char *arg2, u16 arg3);
s32 pak0f11cc6c(s8 device, u16 arg1, char *buffer, u16 len);
void gbpakHandleError(u32 arg0);
bool gbpakRead(s8 device, s32 address, u8 *buffer, u16 size);
bool gbpakWrite(s8 device, u16 address, u8 *buffer, u16 size);
bool pak0f11cd00(s8 device, u16 arg1, char *arg2, s32 arg3, s32 arg4);
bool pak0f11ce00(s8 device, u16 arg1, char *arg2, s32 arg3, bool arg4);
u32 pak0f11d118(void);
@@ -123,16 +123,16 @@ u32 pak0f11d8b4(void);
u32 pak0f11d9c4(void);
#if VERSION >= VERSION_NTSC_1_0
void pak0f11dc04(s32 arg0, f32 arg1, s32 arg2, s32 arg3);
void pakRumble(s32 device, f32 numsecs, s32 onduration, s32 offduration);
#else
void pak0f11dc04(s8 arg0, f32 arg1, s32 arg2, s32 arg3);
void pakRumble(s8 device, f32 numsecs, s32 onduration, s32 offduration);
#endif
void pak0f11dcb0(s32 arg0);
void pak0f11dd58(s8 playernum);
void pak0f11de20(s8 playernum);
void pak0f11deb8(void);
void pak0f11df38(void);
void pakStopRumbleForAllPaks(bool disablepolling);
void pakDisableRumbleForPlayer(s8 playernum);
void pakEnableRumbleForPlayer(s8 playernum);
void pakDisableRumbleForAllPlayers(void);
void pakEnableRumbleForAllPlayers(void);
void pakDumpPak(void);
void pak0f11df94(s8 device);
void pak0f11e3bc(s8 device);
@@ -144,10 +144,10 @@ bool pakHasBitflag(u32 flagnum, u8 *stream);
void pakClearAllBitflags(u8 *flags);
void pakN64FontCodeToAscii(char *src, char *dst, s32 len);
s8 pakFindBySerial(s32 deviceserial);
s32 pak0f11e750(s8 arg0);
bool pak0f11e78c(void);
bool pak0f11e7f0(char *a, char *b);
s32 pak0f11e844(s8 device);
s32 pak0f11e750(s8 device);
bool gbpakIsAnyPerfectDark(void);
bool gbpakStrcmp(char *a, char *b);
s32 gbpakIdentifyGame(s8 device);
bool pak0f11ea34(s8 arg0);
extern const char var7f1b423c[];
+8 -8
View File
@@ -24,7 +24,7 @@ void joy00014238(void);
void joyDebugJoy(void);
s32 joyStartReadData(OSMesgQueue *mq);
void joyReadData(void);
void joyPoll(void);
void joysTick(void);
void joy00014810(bool value);
s32 joyGetNumSamples(void);
s32 joyGetStickXOnSample(s32 samplenum, s8 contpadnum);
@@ -37,21 +37,21 @@ s32 joyGetStickX(s8 contpadnum);
s32 joyGetStickY(s8 contpadnum);
u16 joyGetButtons(s8 contpadnum, u16 mask);
u16 joyGetButtonsPressedThisFrame(s8 contpadnum, u16 mask);
s32 joy000150c4(void);
bool joyIsCyclicPollingEnabled(void);
#if VERSION >= VERSION_NTSC_1_0
void joyGetLock(void);
void joyReleaseLock(void);
void joyDisableCyclicPolling(void);
void joyEnableCyclicPolling(void);
#else
void joyGetLock(s32 line, char *file);
void joyReleaseLock(s32 line, char *file);
void joyDisableCyclicPolling(s32 line, char *file);
void joyEnableCyclicPolling(s32 line, char *file);
#endif
void joyReset(void);
void joyGetContpadNumsForPlayer(s8 playernum, s32 *pad1, s32 *pad2);
void joy000153c4(s8 device, s32 arg1);
void joyStopRumble(s8 device, bool disablepolling);
s32 joy000155b4(s8 device);
s32 joy000155f4(s8 device);
void joy0001561c(void);
void joysTickRumble(void);
#endif
-9
View File
@@ -1,9 +0,0 @@
#ifndef _IN_LIB_LIB_06330_H
#define _IN_LIB_LIB_06330_H
#include <ultra64.h>
#include "data.h"
#include "types.h"
s32 func00006330(OSPfs *pfs, u32 arg1);
#endif
-9
View File
@@ -1,9 +0,0 @@
#ifndef _IN_LIB_LIB_50BE0_H
#define _IN_LIB_LIB_50BE0_H
#include <ultra64.h>
#include "data.h"
#include "types.h"
u32 func00050be0(void);
#endif
-9
View File
@@ -1,9 +0,0 @@
#ifndef _IN_LIB_LIB_50D60_H
#define _IN_LIB_LIB_50D60_H
#include <ultra64.h>
#include "data.h"
#include "types.h"
s32 func00050d60(OSPfs *pfs, char *arg1, u8 *arg2);
#endif
-9
View File
@@ -1,9 +0,0 @@
#ifndef _IN_LIB_LIB_50F20_H
#define _IN_LIB_LIB_50F20_H
#include <ultra64.h>
#include "data.h"
#include "types.h"
u32 func50f20(void);
#endif
-9
View File
@@ -1,9 +0,0 @@
#ifndef _IN_LIB_LIB_513B0_H
#define _IN_LIB_LIB_513B0_H
#include <ultra64.h>
#include "data.h"
#include "types.h"
s32 func000513b0(OSPfs *pfs, bool arg1, u16 arg2, char *arg3, u16 arg4);
#endif
+6 -6
View File
@@ -5031,8 +5031,8 @@ struct pakheadercache {
};
struct pak {
/*0x000*/ s32 unk000;
/*0x004*/ u32 unk004;
/*0x000*/ s32 type;
/*0x004*/ u32 rumblestate;
/*0x008*/ u32 unk008;
/*0x00c*/ u32 unk00c;
/*0x010*/ u32 unk010;
@@ -5048,9 +5048,9 @@ struct pak {
/*0x278*/ u32 unk278;
/*0x27c*/ u32 unk27c;
/*0x280*/ u32 unk280;
/*0x284*/ s32 unk284;
/*0x288*/ u32 unk288;
/*0x28c*/ u32 unk28c;
/*0x284*/ s32 rumblepulsestopat;
/*0x288*/ u32 rumblepulselen;
/*0x28c*/ u32 rumblepulsetimer; // counts up to pulselen then loops
/*0x290*/ u32 unk290;
/*0x294*/ u32 unk294;
/*0x298*/ u32 unk298;
@@ -5060,7 +5060,7 @@ struct pak {
/*0x2a8*/ u32 numpages;
/*0x2ac*/ u32 unk2ac;
/*0x2b0*/ u32 unk2b0;
/*0x2b4*/ f32 unk2b4;
/*0x2b4*/ f32 rumblettl;
/*0x2b8*/ u8 unk2b8_01 : 1;
/*0x2b8*/ u8 unk2b8_02 : 1;
/*0x2b8*/ u8 unk2b8_03 : 1;
+91 -79
View File
@@ -46,16 +46,16 @@ u32 var80099eb0;
u32 var80099eb4;
OSMesg var80099eb8;
u32 var80099ebc;
OSMesgQueue var80099ec0;
OSMesgQueue g_JoyStopCyclicPollingMesgQueue;
OSMesg var80099ed8;
u32 var80099edc;
OSMesgQueue var80099ee0;
OSMesgQueue g_JoyStopCyclicPollingDoneMesgQueue;
OSMesg var80099ef8;
u32 var80099efc;
OSMesgQueue var80099f00;
OSMesgQueue g_JoyStartCyclicPollingMesgQueue;
OSMesg var80099f18;
u32 var80099f1c;
OSMesgQueue var80099f20;
OSMesgQueue g_JoyStartCyclicPollingDoneMesgQueue;
OSContStatus var80099f38[4];
u8 g_JoyPfsStates[100];
u32 var80099fac;
@@ -79,7 +79,7 @@ u8 g_JoyConnectedControllers = 0;
bool g_JoyQueuesCreated = false;
bool g_JoyInitDone = false;
bool g_JoyNeedsInit = true;
u32 var8005eebc = 0;
u32 g_JoyCyclicPollDisableCount = 0;
u32 var8005eec0 = 1;
s32 (*var8005eec4)(struct contsample *samples, s32 samplenum) = NULL;
void (*var8005eec8)(struct contsample *samples, s32 samplenum, s32 samplenum2) = NULL;
@@ -98,7 +98,7 @@ u32 var8005eef0 = 1;
void joy00013900(void)
{
if (var8005eef0) {
joyGetLock();
joyDisableCyclicPolling();
var8005eef0 = false;
}
}
@@ -106,7 +106,7 @@ void joy00013900(void)
void joy00013938(void)
{
if (!var8005eef0) {
joyReleaseLock();
joyEnableCyclicPolling();
var8005eef0 = true;
}
}
@@ -213,7 +213,7 @@ void joyCheckPfs(s32 arg0)
u32 value;
if (var8005eedc
&& (arg0 == 2 || (var8005eee0 && (arg0 || ((var8005eebc == 0 || var8005eef0 == 0) && var8005eeec))))
&& (arg0 == 2 || (var8005eee0 && (arg0 || ((g_JoyCyclicPollDisableCount == 0 || var8005eef0 == 0) && var8005eeec))))
&& !doingit) {
doingit = true;
prevcount = thiscount;
@@ -235,13 +235,13 @@ void joyCheckPfs(s32 arg0)
var8005eee8++;
if (arg0) {
joyGetLock();
joyDisableCyclicPolling();
}
osPfsIsPlug(&var80099e78, &bitpattern);
if (arg0) {
joyReleaseLock();
joyEnableCyclicPolling();
}
bitpattern |= 0x10;
@@ -299,10 +299,10 @@ void joySystemInit(void)
s32 i;
s32 j;
osCreateMesgQueue(&var80099ec0, &var80099eb8, 1);
osCreateMesgQueue(&var80099ee0, &var80099ed8, 1);
osCreateMesgQueue(&var80099f00, &var80099ef8, 1);
osCreateMesgQueue(&var80099f20, &var80099f18, 1);
osCreateMesgQueue(&g_JoyStopCyclicPollingMesgQueue, &var80099eb8, 1);
osCreateMesgQueue(&g_JoyStopCyclicPollingDoneMesgQueue, &var80099ed8, 1);
osCreateMesgQueue(&g_JoyStartCyclicPollingMesgQueue, &var80099ef8, 1);
osCreateMesgQueue(&g_JoyStartCyclicPollingDoneMesgQueue, &var80099f18, 1);
osCreateMesgQueue(&var80099e78, &var80099e90, 10);
osSetEventMesg(OS_EVENT_SI, &var80099e78, NULL);
@@ -354,13 +354,13 @@ void joy00013dfc(void)
OSMesg msg;
if (g_JoyQueuesCreated) {
osSendMesg(&var80099ec0, &msg, OS_MESG_NOBLOCK);
osRecvMesg(&var80099ee0, &msg, OS_MESG_BLOCK);
osSendMesg(&g_JoyStopCyclicPollingMesgQueue, &msg, OS_MESG_NOBLOCK);
osRecvMesg(&g_JoyStopCyclicPollingDoneMesgQueue, &msg, OS_MESG_BLOCK);
joy00013e84();
osSendMesg(&var80099f00, &msg, OS_MESG_NOBLOCK);
osRecvMesg(&var80099f20, &msg, OS_MESG_BLOCK);
osSendMesg(&g_JoyStartCyclicPollingMesgQueue, &msg, OS_MESG_NOBLOCK);
osRecvMesg(&g_JoyStartCyclicPollingDoneMesgQueue, &msg, OS_MESG_BLOCK);
var8005eec0 = 1;
}
@@ -380,7 +380,7 @@ void joy00013e84(void)
g_JoyInitDone = true;
for (i = 0; i < 4; i++) {
joy000153c4(i, 0);
joyStopRumble(i, false);
}
} else {
u32 slots = 0xf;
@@ -560,7 +560,7 @@ void joy00014238(void)
}
if (var8005eec4 == NULL) {
joy0001561c();
joysTickRumble();
}
doingit = false;
@@ -594,22 +594,22 @@ void joyDebugJoy(void)
var8005eec8(g_JoyData[0].samples, g_JoyData[0].curstart, g_JoyData[0].curlast);
}
if (joy000150c4() && var8005eec0 && joyGetNumSamples() <= 0) {
if (joyIsCyclicPollingEnabled() && var8005eec0 && joyGetNumSamples() <= 0) {
#if VERSION >= VERSION_NTSC_FINAL
joyGetLock();
joyDisableCyclicPolling();
joy00014238();
joyReleaseLock();
joyEnableCyclicPolling();
joyConsumeSamples(&g_JoyData[0]);
#elif VERSION >= VERSION_NTSC_1_0
joyGetLock();
joyReleaseLock();
joyDisableCyclicPolling();
joyEnableCyclicPolling();
joyConsumeSamples(&g_JoyData[0]);
joy00014238();
#else
joyGetLock(500, "joy.c");
joyDisableCyclicPolling(500, "joy.c");
joy00014238();
func0001509cnb();
joyReleaseLock(507, "joy.c");
joyEnableCyclicPolling(507, "joy.c");
joyConsumeSamples(&g_JoyData[0]);
#endif
}
@@ -654,12 +654,12 @@ void joyReadData(void)
}
#if VERSION >= VERSION_NTSC_1_0
void joyPoll(void)
void joysTick(void)
{
OSMesg msg;
s8 i;
if (osRecvMesg(&var80099ec0, &msg, OS_MESG_NOBLOCK) == 0) {
if (osRecvMesg(&g_JoyStopCyclicPollingMesgQueue, &msg, OS_MESG_NOBLOCK) == 0) {
if (g_JoyBusy) {
osRecvMesg(&var80099e78, &msg, OS_MESG_BLOCK);
@@ -676,7 +676,7 @@ void joyPoll(void)
}
}
osSendMesg(&var80099ee0, &msg, OS_MESG_NOBLOCK);
osSendMesg(&g_JoyStopCyclicPollingDoneMesgQueue, &msg, OS_MESG_NOBLOCK);
var8005ee68++;
@@ -684,7 +684,7 @@ void joyPoll(void)
return;
}
if (osRecvMesg(&var80099f00, &msg, OS_MESG_NOBLOCK) == 0) {
if (osRecvMesg(&g_JoyStartCyclicPollingMesgQueue, &msg, OS_MESG_NOBLOCK) == 0) {
var8005ee68--;
if (var8005ee68 == 0) {
@@ -692,7 +692,7 @@ void joyPoll(void)
g_JoyBusy = true;
}
osSendMesg(&var80099f20, &msg, OS_MESG_NOBLOCK);
osSendMesg(&g_JoyStartCyclicPollingDoneMesgQueue, &msg, OS_MESG_NOBLOCK);
return;
}
@@ -744,7 +744,7 @@ void joyPoll(void)
}
#else
GLOBAL_ASM(
glabel joyPoll
glabel joysTick
/* 1536c: 3c028006 */ lui $v0,0x8006
/* 15370: 244212c0 */ addiu $v0,$v0,0x12c0
/* 15374: 8c4e0000 */ lw $t6,0x0($v0)
@@ -1233,12 +1233,19 @@ glabel func00015fa4nb
);
#endif
s32 joy000150c4(void)
bool joyIsCyclicPollingEnabled(void)
{
return var8005eebc ? false : true;
return g_JoyCyclicPollDisableCount ? false : true;
}
void joyGetLock(
/**
* If cyclic polling is enabled, send a message to the scheduler thread telling
* it to update the joy state (connected controllers, PFS etc). Then block while
* waiting for its done message to come back, and increment the disable count.
*
* If cyclic polling was already disabled, simply increase the disable count.
*/
void joyDisableCyclicPolling(
#if VERSION >= VERSION_NTSC_1_0
void
#else
@@ -1248,15 +1255,19 @@ void joyGetLock(
{
OSMesg msg;
if (var8005eebc == 0) {
osSendMesg(&var80099ec0, &msg, OS_MESG_NOBLOCK);
osRecvMesg(&var80099ee0, &msg, OS_MESG_BLOCK);
if (g_JoyCyclicPollDisableCount == 0) {
osSendMesg(&g_JoyStopCyclicPollingMesgQueue, &msg, OS_MESG_NOBLOCK);
osRecvMesg(&g_JoyStopCyclicPollingDoneMesgQueue, &msg, OS_MESG_BLOCK);
}
var8005eebc++;
g_JoyCyclicPollDisableCount++;
}
void joyReleaseLock(
/**
* Indicate that the caller is done with cyclic polling being disabled,
* and enable cyclic polling if there are no callers left who want it disabled.
*/
void joyEnableCyclicPolling(
#if VERSION >= VERSION_NTSC_1_0
void
#else
@@ -1266,11 +1277,11 @@ void joyReleaseLock(
{
OSMesg msg;
var8005eebc--;
g_JoyCyclicPollDisableCount--;
if (var8005eebc == 0) {
osSendMesg(&var80099f00, &msg, OS_MESG_NOBLOCK);
osRecvMesg(&var80099f20, &msg, OS_MESG_BLOCK);
if (g_JoyCyclicPollDisableCount == 0) {
osSendMesg(&g_JoyStartCyclicPollingMesgQueue, &msg, OS_MESG_NOBLOCK);
osRecvMesg(&g_JoyStartCyclicPollingDoneMesgQueue, &msg, OS_MESG_BLOCK);
}
}
@@ -1340,14 +1351,14 @@ void joyGetContpadNumsForPlayer(s8 playernum, s32 *pad1, s32 *pad2)
#endif
#if VERSION >= VERSION_NTSC_1_0
void joy000153c4(s8 device, s32 arg1)
void joyStopRumble(s8 device, bool disablepolling)
{
u32 stack;
if (device != SAVEDEVICE_GAMEPAK) {
if (g_Paks[device].unk000 != 2 && g_Paks[device].unk000 != 3) {
if (arg1) {
joyGetLock();
if (g_Paks[device].type != PAKTYPE_MEMORY && g_Paks[device].type != PAKTYPE_GAMEBOY) {
if (disablepolling) {
joyDisableCyclicPolling();
}
if (osMotorProbe(&var80099e78, PFS(device), device) == 0) {
@@ -1356,15 +1367,16 @@ void joy000153c4(s8 device, s32 arg1)
osMotorStop(PFS(device));
}
if (arg1) {
joyReleaseLock();
if (disablepolling) {
joyEnableCyclicPolling();
}
if (g_Paks[device].unk004 != 6 && g_Paks[device].unk004 != 7) {
g_Paks[device].unk004 = 5;
if (g_Paks[device].rumblestate != RUMBLESTATE_DISABLED_STOPPING
&& g_Paks[device].rumblestate != RUMBLESTATE_DISABLED_STOPPED) {
g_Paks[device].rumblestate = RUMBLESTATE_ENABLED_STOPPING;
}
g_Paks[device].unk2b4 = -1;
g_Paks[device].rumblettl = -1;
}
}
@@ -1374,7 +1386,7 @@ void joy000153c4(s8 device, s32 arg1)
}
#else
GLOBAL_ASM(
glabel joy000153c4
glabel joyStopRumble
/* 162b0: 27bdffd8 */ addiu $sp,$sp,-40
/* 162b4: 00047600 */ sll $t6,$a0,0x18
/* 162b8: 000e7e03 */ sra $t7,$t6,0x18
@@ -1407,7 +1419,7 @@ glabel joy000153c4
/* 16324: 2404041e */ addiu $a0,$zero,0x41e
/* 16328: 3c057005 */ lui $a1,0x7005
/* 1632c: 24a55958 */ addiu $a1,$a1,0x5958
/* 16330: 0c00581b */ jal joyGetLock
/* 16330: 0c00581b */ jal joyDisableCyclicPolling
/* 16334: afa60024 */ sw $a2,0x24($sp)
/* 16338: 8fa60024 */ lw $a2,0x24($sp)
.NB0001633c:
@@ -1493,7 +1505,7 @@ glabel joy000153c4
/* 16454: 3c057005 */ lui $a1,0x7005
/* 16458: 51000004 */ beqzl $t0,.NB0001646c
/* 1645c: 8fa3001c */ lw $v1,0x1c($sp)
/* 16460: 0c005834 */ jal joyReleaseLock
/* 16460: 0c005834 */ jal joyEnableCyclicPolling
/* 16464: 24a55960 */ addiu $a1,$a1,0x5960
/* 16468: 8fa3001c */ lw $v1,0x1c($sp)
.NB0001646c:
@@ -1528,49 +1540,49 @@ s32 joy000155f4(s8 device)
return joy000155b4(device);
}
void joy0001561c(void)
void joysTickRumble(void)
{
s32 i;
for (i = 0; i < 4; i++) {
if (g_Paks[i].unk010 == 11 && g_Paks[i].unk000 == 1) {
switch (g_Paks[i].unk004) {
case 3:
g_Paks[i].unk004 = 4;
if (g_Paks[i].unk010 == 11 && g_Paks[i].type == PAKTYPE_RUMBLE) {
switch (g_Paks[i].rumblestate) {
case RUMBLESTATE_ENABLED_STARTING:
g_Paks[i].rumblestate = RUMBLESTATE_ENABLED_RUMBLING;
osMotorStart(PFS(i));
break;
case 4:
if (g_Paks[i].unk284 != -1) {
if (g_Paks[i].unk28c == 0) {
case RUMBLESTATE_ENABLED_RUMBLING:
if (g_Paks[i].rumblepulsestopat != -1) {
if (g_Paks[i].rumblepulsetimer == 0) {
osMotorStart(PFS(i));
} else if (g_Paks[i].unk284 == g_Paks[i].unk28c) {
} else if (g_Paks[i].rumblepulsestopat == g_Paks[i].rumblepulsetimer) {
osMotorStop(PFS(i));
}
g_Paks[i].unk28c++;
g_Paks[i].rumblepulsetimer++;
if (g_Paks[i].unk288 == g_Paks[i].unk28c) {
g_Paks[i].unk28c = 0;
if (g_Paks[i].rumblepulselen == g_Paks[i].rumblepulsetimer) {
g_Paks[i].rumblepulsetimer = 0;
}
}
g_Paks[i].unk2b4--;
g_Paks[i].rumblettl--;
if (g_Paks[i].unk2b4 < 0) {
g_Paks[i].unk004 = 5;
if (g_Paks[i].rumblettl < 0) {
g_Paks[i].rumblestate = RUMBLESTATE_ENABLED_STOPPING;
}
break;
case 5:
g_Paks[i].unk004 = 2;
case RUMBLESTATE_ENABLED_STOPPING:
g_Paks[i].rumblestate = RUMBLESTATE_ENABLED_STOPPED;
osMotorStop(PFS(i));
break;
case 6:
case RUMBLESTATE_DISABLED_STOPPING:
osMotorStop(PFS(i));
g_Paks[i].unk004 = 7;
g_Paks[i].rumblestate = RUMBLESTATE_DISABLED_STOPPED;
break;
case 8:
g_Paks[i].unk004 = 2;
g_Paks[i].unk2b4 = -1;
case RUMBLESTATE_ENABLING:
g_Paks[i].rumblestate = RUMBLESTATE_ENABLED_STOPPED;
g_Paks[i].rumblettl = -1;
break;
}
}
-1
View File
@@ -4,7 +4,6 @@
#include "bss.h"
#include "lib/lib_4b170.h"
#include "lib/lib_4e090.h"
#include "lib/lib_513b0.h"
#include "lib/lib_52360.h"
#include "data.h"
#include "types.h"
+1 -1
View File
@@ -284,7 +284,7 @@ void func00002078(OSSched *sc)
func00009ed4();
}
joyPoll();
joysTick();
snd0000fe18();
func00001b98(sc->frameCount);
}
@@ -1,15 +1,13 @@
#include <ultra64.h>
#include "constants.h"
#include "bss.h"
#include "lib/lib_06330.h"
#include "lib/libc/ll.h"
#include "lib/lib_4e090.h"
#include "lib/lib_513b0.h"
#include "data.h"
#include "types.h"
GLOBAL_ASM(
glabel func50f20
glabel osGbpakCheckConnector
/* 50f20: 27bdfdf0 */ addiu $sp,$sp,-528
/* 50f24: afbf0044 */ sw $ra,0x44($sp)
/* 50f28: 240e0001 */ addiu $t6,$zero,0x1
@@ -26,13 +24,13 @@ glabel func50f20
/* 50f54: afa50214 */ sw $a1,0x214($sp)
/* 50f58: afae0208 */ sw $t6,0x208($sp)
/* 50f5c: afa00204 */ sw $zero,0x204($sp)
/* 50f60: 0c0142f8 */ jal func00050be0
/* 50f60: 0c0142f8 */ jal osGbpakGetStatus
/* 50f64: a7a00200 */ sh $zero,0x200($sp)
/* 50f68: 2401000d */ addiu $at,$zero,0xd
/* 50f6c: 14410005 */ bne $v0,$at,.L00050f84
/* 50f70: 00401825 */ or $v1,$v0,$zero
/* 50f74: 8fa40210 */ lw $a0,0x210($sp)
/* 50f78: 0c0142f8 */ jal func00050be0
/* 50f78: 0c0142f8 */ jal osGbpakGetStatus
/* 50f7c: 8fa50214 */ lw $a1,0x214($sp)
/* 50f80: 00401825 */ or $v1,$v0,$zero
.L00050f84:
@@ -49,7 +47,7 @@ glabel func50f20
/* 50fa8: 33190001 */ andi $t9,$t8,0x1
/* 50fac: 57200008 */ bnezl $t9,.L00050fd0
/* 50fb0: 27a40070 */ addiu $a0,$sp,0x70
/* 50fb4: 0c0018cc */ jal func00006330
/* 50fb4: 0c0018cc */ jal osGbpakPower
/* 50fb8: 24050001 */ addiu $a1,$zero,0x1
/* 50fbc: 50400004 */ beqzl $v0,.L00050fd0
/* 50fc0: 27a40070 */ addiu $a0,$sp,0x70
@@ -83,7 +81,7 @@ glabel func50f20
/* 51024: 02a03825 */ or $a3,$s5,$zero
/* 51028: 8fa40210 */ lw $a0,0x210($sp)
/* 5102c: 00002825 */ or $a1,$zero,$zero
/* 51030: 0c0144ec */ jal func000513b0
/* 51030: 0c0144ec */ jal osGbpakReadWrite
/* 51034: 0240a025 */ or $s4,$s2,$zero
/* 51038: 10400003 */ beqz $v0,.L00051048
/* 5103c: 8fae0208 */ lw $t6,0x208($sp)
@@ -113,7 +111,7 @@ glabel func50f20
/* 51098: 30d8ffff */ andi $t8,$a2,0xffff
/* 5109c: 03003025 */ or $a2,$t8,$zero
/* 510a0: 00002825 */ or $a1,$zero,$zero
/* 510a4: 0c0144ec */ jal func000513b0
/* 510a4: 0c0144ec */ jal osGbpakReadWrite
/* 510a8: 02503821 */ addu $a3,$s2,$s0
/* 510ac: 50400004 */ beqzl $v0,.L000510c0
/* 510b0: a2360000 */ sb $s6,0x0($s1)
@@ -160,7 +158,7 @@ glabel func50f20
/* 51140: 240f0020 */ addiu $t7,$zero,0x20
/* 51144: afaf0010 */ sw $t7,0x10($sp)
/* 51148: 03ce3821 */ addu $a3,$s8,$t6
/* 5114c: 0c0144ec */ jal func000513b0
/* 5114c: 0c0144ec */ jal osGbpakReadWrite
/* 51150: 01a03025 */ or $a2,$t5,$zero
/* 51154: 50400004 */ beqzl $v0,.L00051168
/* 51158: a2160000 */ sb $s6,0x0($s0)
@@ -179,7 +177,7 @@ glabel func50f20
/* 51188: 240a0020 */ addiu $t2,$zero,0x20
/* 5118c: afaa0010 */ sw $t2,0x10($sp)
/* 51190: 02093821 */ addu $a3,$s0,$t1
/* 51194: 0c0144ec */ jal func000513b0
/* 51194: 0c0144ec */ jal osGbpakReadWrite
/* 51198: 3246ffff */ andi $a2,$s2,0xffff
/* 5119c: 50400004 */ beqzl $v0,.L000511b0
/* 511a0: a2360000 */ sb $s6,0x0($s1)
@@ -258,7 +256,7 @@ glabel func50f20
/* 512a8: 02a03825 */ or $a3,$s5,$zero
/* 512ac: 8fa40210 */ lw $a0,0x210($sp)
/* 512b0: 00002825 */ or $a1,$zero,$zero
/* 512b4: 0c0144ec */ jal func000513b0
/* 512b4: 0c0144ec */ jal osGbpakReadWrite
/* 512b8: 0240a025 */ or $s4,$s2,$zero
/* 512bc: 10400003 */ beqz $v0,.L000512cc
/* 512c0: 8fa40210 */ lw $a0,0x210($sp)
@@ -276,7 +274,7 @@ glabel func50f20
/* 512ec: afaf0010 */ sw $t7,0x10($sp)
/* 512f0: 01603025 */ or $a2,$t3,$zero
/* 512f4: 02203825 */ or $a3,$s1,$zero
/* 512f8: 0c0144ec */ jal func000513b0
/* 512f8: 0c0144ec */ jal osGbpakReadWrite
/* 512fc: 00002825 */ or $a1,$zero,$zero
/* 51300: 10400003 */ beqz $v0,.L00051310
/* 51304: 02a02025 */ or $a0,$s5,$zero
@@ -305,7 +303,7 @@ glabel func50f20
/* 51354: 24020004 */ addiu $v0,$zero,0x4
/* 51358: 8fa40210 */ lw $a0,0x210($sp)
.L0005135c:
/* 5135c: 0c0142f8 */ jal func00050be0
/* 5135c: 0c0142f8 */ jal osGbpakGetStatus
/* 51360: 8fa50214 */ lw $a1,0x214($sp)
/* 51364: 2401000d */ addiu $at,$zero,0xd
/* 51368: 14410002 */ bne $v0,$at,.L00051374
@@ -3,15 +3,13 @@
#include "constants.h"
#include "bss.h"
#include "lib/lib_06100.h"
#include "lib/lib_06330.h"
#include "lib/lib_4b170.h"
#include "lib/lib_4e090.h"
#include "lib/lib_513b0.h"
#include "data.h"
#include "types.h"
GLOBAL_ASM(
glabel func00050be0
glabel osGbpakGetStatus
/* 50be0: 27bdffb0 */ addiu $sp,$sp,-80
/* 50be4: afbf001c */ sw $ra,0x1c($sp)
/* 50be8: afb10018 */ sw $s1,0x18($sp)
@@ -6,7 +6,7 @@
#include "types.h"
GLOBAL_ASM(
glabel func00006330
glabel osGbpakPower
/* 6330: 27bdffa0 */ addiu $sp,$sp,-96
/* 6334: afb10028 */ sw $s1,0x28($sp)
/* 6338: afb00024 */ sw $s0,0x24($sp)
@@ -3,10 +3,8 @@
#include "constants.h"
#include "bss.h"
#include "lib/lib_06100.h"
#include "lib/lib_06330.h"
#include "lib/lib_4b170.h"
#include "lib/lib_4e090.h"
#include "lib/lib_513b0.h"
#include "data.h"
#include "types.h"
@@ -30,19 +28,19 @@ u32 var8006122c = 0xffffff03;
u32 var80061230 = 0x03030303;
GLOBAL_ASM(
glabel func00050d60
glabel osGbpakReadId
/* 50d60: 27bdff70 */ addiu $sp,$sp,-144
/* 50d64: afbf001c */ sw $ra,0x1c($sp)
/* 50d68: afa50094 */ sw $a1,0x94($sp)
/* 50d6c: afa40090 */ sw $a0,0x90($sp)
/* 50d70: afa60098 */ sw $a2,0x98($sp)
/* 50d74: 0c0142f8 */ jal func00050be0
/* 50d74: 0c0142f8 */ jal osGbpakGetStatus
/* 50d78: 00c02825 */ or $a1,$a2,$zero
/* 50d7c: 2401000d */ addiu $at,$zero,0xd
/* 50d80: 14410005 */ bne $v0,$at,.L00050d98
/* 50d84: 00403825 */ or $a3,$v0,$zero
/* 50d88: 8fa40090 */ lw $a0,0x90($sp)
/* 50d8c: 0c0142f8 */ jal func00050be0
/* 50d8c: 0c0142f8 */ jal osGbpakGetStatus
/* 50d90: 8fa50098 */ lw $a1,0x98($sp)
/* 50d94: 00403825 */ or $a3,$v0,$zero
.L00050d98:
@@ -59,7 +57,7 @@ glabel func00050d60
/* 50dbc: 31f80001 */ andi $t8,$t7,0x1
/* 50dc0: 57000008 */ bnezl $t8,.L00050de4
/* 50dc4: 24190060 */ addiu $t9,$zero,0x60
/* 50dc8: 0c0018cc */ jal func00006330
/* 50dc8: 0c0018cc */ jal osGbpakPower
/* 50dcc: 24050001 */ addiu $a1,$zero,0x1
/* 50dd0: 50400004 */ beqzl $v0,.L00050de4
/* 50dd4: 24190060 */ addiu $t9,$zero,0x60
@@ -71,14 +69,14 @@ glabel func00050d60
/* 50de8: 8fa40090 */ lw $a0,0x90($sp)
/* 50dec: 00002825 */ or $a1,$zero,$zero
/* 50df0: 24060100 */ addiu $a2,$zero,0x100
/* 50df4: 0c0144ec */ jal func000513b0
/* 50df4: 0c0144ec */ jal osGbpakReadWrite
/* 50df8: 27a70024 */ addiu $a3,$sp,0x24
/* 50dfc: 10400003 */ beqz $v0,.L00050e0c
/* 50e00: 8fa40090 */ lw $a0,0x90($sp)
/* 50e04: 10000041 */ b .L00050f0c
/* 50e08: 8fbf001c */ lw $ra,0x1c($sp)
.L00050e0c:
/* 50e0c: 0c0142f8 */ jal func00050be0
/* 50e0c: 0c0142f8 */ jal osGbpakGetStatus
/* 50e10: 8fa50098 */ lw $a1,0x98($sp)
/* 50e14: 2401000d */ addiu $at,$zero,0xd
/* 50e18: 14410002 */ bne $v0,$at,.L00050e24
@@ -4,13 +4,12 @@
#include "bss.h"
#include "lib/lib_4b170.h"
#include "lib/lib_4e090.h"
#include "lib/lib_513b0.h"
#include "lib/lib_52360.h"
#include "data.h"
#include "types.h"
GLOBAL_ASM(
glabel func000513b0
glabel osGbpakReadWrite
/* 513b0: 27bdffc0 */ addiu $sp,$sp,-64
/* 513b4: afb10020 */ sw $s1,0x20($sp)
/* 513b8: afbf0034 */ sw $ra,0x34($sp)
-2
View File
@@ -3,10 +3,8 @@
#include "constants.h"
#include "bss.h"
#include "lib/lib_06100.h"
#include "lib/lib_06330.h"
#include "lib/lib_4b170.h"
#include "lib/lib_4e090.h"
#include "lib/lib_513b0.h"
#include "data.h"
#include "types.h"