Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
Expand Down
Binary file modified files/UIPatches/Global/message/Lace.bmg
Binary file not shown.
Binary file modified files/UIPatches/Global/message/Manu.bmg
Binary file not shown.
1 change: 1 addition & 0 deletions src/include/dwc.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
#include "common.h"

int DWC_CloseConnectionHard(u8 playerAid);
u8 DWC_GetServerAid();
bool DWC_IsServerMyself();
14 changes: 14 additions & 0 deletions src/include/kartdynamics.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#pragma once
#include "common.h"

typedef struct {
u8 unk[0x171]; // Values we don't need to know
bool noGravity;
bool isHit;
bool force0xVelY;
bool inBullet;
// Incomplete (more values we don't need to know)
} KartDynamics;



58 changes: 15 additions & 43 deletions src/payload/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,19 @@ void loadCodes() {
// Exception Handler (by Star)
directWrite32(ShowExceptions, 0);

// Wiimmfi Code Patches (by Leseratte)
directWriteNop(WiimmfiPatch1);
directWrite32(WiimmfiPatch2, 0x3BC00000);
directWriteBranch(WiimmfiPatch3, WiimmfiASM1, false);
directWriteBranch(WiimmfiPatch4, WiimmfiASM2, false);

// Wiimmfi Domain Name Patches (by Seeky)
directWriteString(WiimmfiVersionString, "LE-CODE GCT v1 ");
directWriteString(WiimmfiURLs, "://ca.nas.wiimmfi.de/ca");
directWriteStringOffset(WiimmfiURLs, 0x28, "://naswii.wiimmfi.de/ac");
directWriteStringOffset(WiimmfiURLs, 0xA8, "://naswii.wiimmfi.de/pr");

#ifdef REGION_P
directWriteStringOffset(WiimmfiURLs, 0x50, "main.nas.wiimmfi.de/pp");
#elif REGION_E
directWriteStringOffset(WiimmfiURLs, 0x50, "main.nas.wiimmfi.de/pe");
#elif REGION_J
directWriteStringOffset(WiimmfiURLs, 0x50, "main.nas.wiimmfi.de/pj");
#elif REGION_K
directWriteStringOffset(WiimmfiURLs, 0x50, "main.nas.wiimmfi.de/pk");
#endif

directWriteStringOffset(WiimmfiURLs, 0x964, "wiimmfi.de"); // Available
directWriteStringOffset(WiimmfiURLs, 0x10D4, "wiimmfi.de"); // GPCM
directWriteStringOffset(WiimmfiURLs, 0x1AEC, "wiimmfi.de"); // GPSP
directWriteStringOffset(WiimmfiURLs, 0x2C8D, "wiimmfi.de"); // Master
directWriteStringOffset(WiimmfiURLs, 0x38A7, "wiimmfi.de"); // Natneg
directWriteStringOffset(WiimmfiURLs, 0x38C3, "wiimmfi.de");
directWriteStringOffset(WiimmfiURLs, 0x38DF, "wiimmfi.de");
directWriteStringOffset(WiimmfiURLs, 0x3A2F, "wiimmfi.de"); // MS
directWriteStringOffset(WiimmfiURLs, 0x3AB3, "wiimmfi.de"); // SAKE

// Wiimmfi Login Region Changer (by Atlas)
directWriteString(LoginRegion, "120053");

// VS Matchmaking Region Patch (by Leseratte)
tempVal32 = 0x38E04E55;
directWrite32(VSRegion, 0x38A04E55);
directWrite32(VSRegion2, tempVal32);
directWrite32Offset(VSRegion2, 0x518, tempVal32);
directWrite32(VSRegion3, 0x38800055);
// WiiLink Code Patches (by The WiiLink Team, ported by Palapeli and Ismy)
directWriteArray(WL_Code_Text_Hook, WL_Code_Text, 0x58);
directWriteArray(WL_Code_Data_Hook, WL_Code_Data, 0x4C);

// WiiLink Auth response
directWriteArray(WL_Auth_Response_Hook, WL_Auth_Response, 0x8);

// WiiLink String Patches
directWriteArray(WL_Domain_Hook, WL_Domain, 0x11);
directWriteArray(WL_URL_Hook, WL_URL, 0x18);

// WiiLink Skip DNS request caching
directWrite32(WL_Skip_DNS, 0x480001F4);

// Always Win Track Vote (by Star, modified by Seeky & CLF78)
directWriteBranch(AlwaysWinVoteHook, VotePatch, true);
Expand Down Expand Up @@ -142,7 +114,7 @@ void loadCodes() {
directWriteBranch(GuestSendHook, GuestSend, false);
directWriteBranch(HostCheckHook, HostCheck, false);
directWriteBranch(HostCheckHelperHook, HostCheckHelper, true);
directWrite8(Version, 8);
directWrite8(Version, 9);

// Improved Position Interpolation (by stebler)
directWrite32(NoInterpolation, 0x3F800000);
Expand All @@ -158,7 +130,7 @@ void loadCodes() {
directWriteBranch(NoStarInvincibilityHook2, NoStarInvincibility2, true); // enable damage from objects
directWriteBranch(NoStarInvincibilityHook3, NoStarInvincibility3, true); // enable damage from players

// Instant Respawn + Respawn Cooldown (by davidevgen, CLF78 and stebler)
// Instant Respawn + Respawn Cooldown (by davidevgen, CLF78, stebler and Lami)
directWrite8(InstantRespawn1, 0);
directWriteBranch(InstantRespawn2, RespawnCooldown, true);

Expand Down
4 changes: 3 additions & 1 deletion src/payload/main/itemhit.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ void PlayerDC() {
if (pid != -1) {

// Update KillData
AddNewKillData(2, (u16)pid, 0xFFFF);
// Check if the player got kicked for having the wrong track
u16 DCType = (HideNSeekData.players[pid].doneTrackCheck == 2) ? 4 : 2;
AddNewKillData(DCType, (u16)pid, 0xFFFF);

// If the player is a Seeker, just decrease totalSeekers
if (HideNSeekData.players[pid].isSeeker)
Expand Down
34 changes: 0 additions & 34 deletions src/payload/main/respawn.S

This file was deleted.

17 changes: 17 additions & 0 deletions src/payload/main/respawn.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include "common.h"
#include "hidenseek.h"
#include "kartdynamics.h"
#include "os.h"
#include "racedata.h"

extern u8 InstantRespawn3;
void RespawnCooldown(KartDynamics* kartDynamics){
if (Have30SecondsPassed && !HideNSeekData.players[Racedata->main.scenarios[0].settings.hudPlayerIds[0]].isSeeker){
kartDynamics->noGravity = 1;
InstantRespawn3 = 0x6E;
} else {
kartDynamics->noGravity = 0;
InstantRespawn3 = 0;
}
}

31 changes: 15 additions & 16 deletions src/payload/main/trackcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,25 @@ void InsertTrackIdent(RaceModeOnlineVs *RaceModeOnlineVs) {
}

void CheckTrackIdent() {
if(DWC_IsServerMyself()){
if (Raceinfo->timer != 240) {
return;
}
u8 playerId;
for (playerId = 0; playerId < Racedata->main.scenarios[0].playerCount; playerId++) {
if (HideNSeekData.players[RKNetController->aidsToPids[playerId]].doneTrackCheck) {
continue;
}
if (Racedata->main.scenarios->players[playerId].playerType == PLAYER_REAL_LOCAL) {
if (Raceinfo->timer == 240) {

u8 pid;
for (pid = 0; pid < Racedata->main.scenarios[0].playerCount; pid++) {
if (HideNSeekData.players[pid].doneTrackCheck || Racedata->main.scenarios->players[pid].playerType == PLAYER_REAL_LOCAL) {
continue;
}
RaceHeader2VS* RH2 = GetRaceHeader2Buffer(ptr_miscPacketHandler, playerId);
RaceHeader2VS* RH2 = GetRaceHeader2Buffer(ptr_miscPacketHandler, RKNetController->aidsToPids[pid]);

if (RH2->minimumRaceFinishTime != ENPTCRC) {
bool ret = OSDisableInterrupts();
DWC_CloseConnectionHard(RKNetController->aidsToPids[playerId]);
OSRestoreInterrupts(ret);
if (RH2->minimumRaceFinishTime != ENPTCRC && RKNetController->aidsToPids[pid] != DWC_GetServerAid()) {
HideNSeekData.players[pid].doneTrackCheck = 2; // We use this to show the right disconnection message later
if (DWC_IsServerMyself()) {
bool ret = OSDisableInterrupts();
DWC_CloseConnectionHard(RKNetController->aidsToPids[pid]);
OSRestoreInterrupts(ret);
}
continue;
}
HideNSeekData.players[RKNetController->aidsToPids[playerId]].doneTrackCheck = 1;
HideNSeekData.players[pid].doneTrackCheck = 1;
}

}
Expand Down
52 changes: 52 additions & 0 deletions src/payload/main/wiilink.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.include "asm_setup.S"

.global WL_Code_Text, WL_Code_Data, WL_Auth_Response, WL_Domain, WL_URL

# Code (text)
WL_Code_Text:
#ifdef REGION_P
.long 0x48000088, 0x3FE0800F, 0x3BFFDEAC, 0x8061000C, 0x38800F2A, 0x38A1001C, 0x48002D59, 0x3861001C, 0x389FFFDC, 0x4BF251E1, 0x2C030000, 0x4182000C, 0x3800AE5A, 0x48000A34, 0x8061000C, 0x38630002, 0x389F0000, 0x80AD973C, 0x38A559E0, 0x7C6903A6, 0x4E800421, 0x48000A68
#elif REGION_E
.long 0x48000088, 0x3FE0800F, 0x3BFFDE0C, 0x8061000C, 0x38800F2A, 0x38A1001C, 0x48002D59, 0x3861001C, 0x389FFFDC, 0x4BF24721, 0x2C030000, 0x4182000C, 0x3800AE5A, 0x48000A34, 0x8061000C, 0x38630002, 0x389F0000, 0x80AD973C, 0x38A559E0, 0x7C6903A6, 0x4E800421, 0x48000A68
#elif REGION_J
.long 0x48000088, 0x3FE0800F, 0x3BFFDDCC, 0x8061000C, 0x38800F2A, 0x38A1001C, 0x48002D59, 0x3861001C, 0x389FFFDC, 0x4BF251E5, 0x2C030000, 0x4182000C, 0x3800AE5A, 0x48000A34, 0x8061000C, 0x38630002, 0x389F0000, 0x80AD973C, 0x38A559E0, 0x7C6903A6, 0x4E800421, 0x48000A68
#elif REGION_K

.long 0x48000088, 0x3FE0800F, 0x3BFFDF24, 0x8061000C, 0x38800F2A, 0x38A1001C, 0x48002D59, 0x3861001C, 0x389FFFDC, 0x4BF251D1, 0x2C030000, 0x4182000C, 0x3800AE5A, 0x48000A34, 0x8061000C, 0x38630002, 0x389F0000, 0x80AD975C, 0x38A559E0, 0x7C6903A6, 0x4E800421, 0x48000A68
#endif

# Code (data)
WL_Code_Data:
#ifdef REGION_P
.long 0x4800007C, 0x30663939, 0x33383335, 0x31636633, 0x62346162, 0x34343864, 0x33383733, 0x62656430, 0x61633937, 0x00000000, 0x00000000, 0x801D8FF8, 0x801D925C, 0x801D92F8, 0x8028ADE4, 0x802F1CB8, 0x524D4350, 0x44303000, 0x00000000
#elif REGION_E
.long 0x4800007C, 0x30663939, 0x33383335, 0x31636633, 0x62346162, 0x34343864, 0x33383733, 0x62656430, 0x61633937, 0x00000000, 0x00000000, 0x801D8F58, 0x801D91BC, 0x801D9258, 0x80286AA4, 0x802ED938, 0x524D4345, 0x44303000, 0x00000000
#elif REGION_J
.long 0x4800007C, 0x30663939, 0x33383335, 0x31636633, 0x62346162, 0x34343864, 0x33383733, 0x62656430, 0x61633937, 0x00000000, 0x00000000, 0x801D8F18, 0x801D917C, 0x801D9218, 0x8028A784, 0x802F1638, 0x524D434A, 0x44303000, 0x00000000
#elif REGION_K
.long 0x4800007C, 0x30663939, 0x33383335, 0x31636633, 0x62346162, 0x34343864, 0x33383733, 0x62656430, 0x61633937, 0x00000000, 0x00000000, 0x801D9354, 0x801D95B8, 0x801D9654, 0x80278DD4, 0x802DFCB8, 0x524D434B, 0x44303000, 0x00000000
#endif

# Auth response
WL_Auth_Response:
.long 0x40810680, 0x4BFFFCF4

# # Skip DNS request caching
# WL_Skip_DNS:
# .long 0x480001F4

# Available Domain
WL_Domain:
.long 0x67732E77, 0x69696C69, 0x6E6B3234, 0x2E636F6D, 0x00000000

# NAS /ac URL
WL_URL:
.long 0x3A2F2F6E, 0x61732E77, 0x69696C69, 0x6E6B3234, 0x2E636F6D, 0x2F773000

# # Anti-Wiimmfi
# No_Wiimmfi_1:
# .long 0x2C030000
# No_Wiimmfi_2:
# .long 0x7C7E1B78
# No_Wiimmfi_3:
# .long 0x0000CAFE
111 changes: 0 additions & 111 deletions src/payload/main/wiimmfi.S

This file was deleted.

Loading