Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 2.0.4 #12

Merged
merged 4 commits into from
Nov 18, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-20.04
timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Cache
id: cache-1
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: cache
key: ${{ runner.os }}-cache-33
Expand All @@ -33,7 +33,7 @@ jobs:

- name: Compile
run: |
PATH=$(pwd)/devkitpro/devkitPPC/bin:$PATH DEVKITPPC=$(pwd)/devkitpro/devkitPPC DEVKITPRO=$(pwd)/devkitpro
cp -r $(pwd)/devkitpro/devkitPPC devkitPPC/
cd src
python3 make.py

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ src/bin
files/UIPatches/*.szs
__pycache__/
*.zip
devkitPPC/
.vscode/
2 changes: 1 addition & 1 deletion build/ISO/Build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ echo.
SET /P FRAMERATE=Force 30 FPS? (Y/N):
IF /i %FRAMERATE%==Y (wit\wit.exe dolpatch mkw.d/sys/main.dol 8000400F=01 -q) ELSE (wit\wit.exe dolpatch mkw.d/sys/main.dol 8000400F=00 -q)

wit\wit.exe dolpatch mkw.d/sys/main.dol 8000629C=4BFFDF4C load=80004010,hns/Loader.bin -q
wit\wit.exe dolpatch mkw.d/sys/main.dol 8000629C=4BFFDF58 load=80004010,hns/Loader.bin -q

echo.
echo Format Selection:
Expand Down
2 changes: 1 addition & 1 deletion build/Riivo/riivolution/hns.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<folder disc="/Scene/UI" external="/hns/UI" create="true" />
<!--Load Code-->
<memory valuefile="/hns/Loader.bin" offset="0x80004010" />
<memory offset="0x8000629C" value="4BFFDF4C" />
<memory offset="0x8000629C" value="4BFFDF58" />
<folder external="/hns/hns" disc="/hns" create="true"/>
</patch>
<patch id="mythingsctgp">
Expand Down
Binary file modified files/UIPatches/Global/message/Manu.bmg
Binary file not shown.
Binary file modified files/UIPatches/Global/message/StaffRole.bmg
Binary file not shown.
5 changes: 5 additions & 0 deletions src/include/dwc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once
#include "common.h"

int DWC_CloseConnectionHard(u8 playerAid);
bool DWC_IsServerMyself();
4 changes: 2 additions & 2 deletions src/include/hidenseek.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once
#include <common.h>
#include "common.h"

typedef struct {
u8 isStopped, isSeeker, isRealSeeker, unused;
u8 isStopped, isSeeker, isRealSeeker, doneTrackCheck;
} HideNSeekPlayer;

typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion src/include/inputdata.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <common.h>
#include "common.h"

// Documentation by Seeky, SwareJonge and _tZ

Expand Down
2 changes: 1 addition & 1 deletion src/include/itemholder.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <common.h>
#include "common.h"

typedef struct {
u8 unk[0x8C];
Expand Down
4 changes: 2 additions & 2 deletions src/include/jgpt.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include <common.h>
#include <vec.h>
#include "common.h"
#include "vec.h"

typedef struct {
VEC3 pos, rot;
Expand Down
4 changes: 2 additions & 2 deletions src/include/killdata.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include <common.h>
#include <screentext.h>
#include "common.h"
#include "screentext.h"

extern void* GetBMGPlayer(u16 pid);
extern void ApplyKillData(screenText* textData);
Expand Down
4 changes: 2 additions & 2 deletions src/include/menudata.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include <common.h>
#include <inputdata.h>
#include "common.h"
#include "inputdata.h"

typedef struct {
u32 controllerInfo, unk, wantsController;
Expand Down
2 changes: 1 addition & 1 deletion src/include/musichandler.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <common.h>
#include "common.h"

typedef struct {
u8 unk[0x40];
Expand Down
7 changes: 7 additions & 0 deletions src/include/os.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#pragma once

#include "common.h"

bool OSDisableInterrupts();
bool OSRestoreInterrupts(bool);
void OSReport(const char *format, ...);
2 changes: 1 addition & 1 deletion src/include/player.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <common.h>
#include "common.h"

// Documentation by stebler, SwareJonge and 1superchip

Expand Down
2 changes: 1 addition & 1 deletion src/include/racedata.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <common.h>
#include "common.h"

// Documentation by Seeky, TheLordScruffy, WhatIsLoaf and riidefi

Expand Down
20 changes: 11 additions & 9 deletions src/include/raceinfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <common.h>
#include "common.h"

// Documentation by Seeky, _tZ, Kevin, Leseratte, stebler and Melg

Expand Down Expand Up @@ -60,14 +60,16 @@ typedef struct {
} RaceinfoPlayer; // Total size 0x54

typedef struct {
void* vtable;
void* random1;
void* random2;
RaceinfoPlayer **players;
void* gamemodeData;
TimerManager* timerManager;
u8 unk[0x10];
u32 raceState;
void* vtable;
void* random1;
void* random2;
RaceinfoPlayer **players;
void* gamemodeData;
TimerManager* timerManager;
u8 unk[8];
u32 timer;
u8 unk2[4];
u32 raceState;
} _Raceinfo;

extern _Raceinfo* Raceinfo;
33 changes: 33 additions & 0 deletions src/include/racemodeonline.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#pragma once
#include "common.h"
#include "raceinfo.h"

typedef struct {
u8 packedBits[15];
u8 _F;
u8 localPlayerId[2];
u8 _12;
u8 localPlayerCount;
u32 timeSinceLeaderFinish;
u32 minimumRaceFinishTime;
bool disconnecting;
u8 _1D;
u16 idleTimers[2];
u16 idleCountdowns[2];
u16 _26;
} RaceHeader2VS;

typedef struct {
void* vtable;
_Raceinfo *raceinfo;
} RaceMode;

typedef struct {
RaceMode inherit;
u8 unk[0xF0];
RaceHeader2VS outPacket;
u8 unk2[0x54];
} RaceModeOnlineVs; // Total size 0x174

RaceHeader2VS* GetRaceHeader2Buffer(u32 param_1, u32 playerId);
void clearSendRH2(u32 ptr_miscPacketHandler);
2 changes: 1 addition & 1 deletion src/include/racepacket.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <common.h>
#include "common.h"

typedef struct {
u32 checksum[2];
Expand Down
2 changes: 1 addition & 1 deletion src/include/rknetcontroller.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <common.h>
#include "common.h"

// Documentation by Seeky

Expand Down
2 changes: 1 addition & 1 deletion src/include/screentext.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <common.h>
#include "common.h"

// Documentation by Kevin

Expand Down
2 changes: 1 addition & 1 deletion src/include/selecthandler.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <common.h>
#include "common.h"

// Documentation by Seeky

Expand Down
6 changes: 3 additions & 3 deletions src/include/utils.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include <common.h>
#include <player.h>
#include <raceinfo.h>
#include "common.h"
#include "player.h"
#include "raceinfo.h"

int UtilRandint(int lo, int hi);
void UtilRandomSeed(int seed);
Expand Down
2 changes: 1 addition & 1 deletion src/include/vec.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once
#include <common.h>
#include "common.h"

typedef struct {
float x, y, z;
Expand Down
5 changes: 3 additions & 2 deletions src/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
from elftools.elf.elffile import ELFFile as elf

# Locate various things
gcc = 'powerpc-eabi-gcc'
objcopy = 'powerpc-eabi-objcopy'
gcc = os.path.join("..", "devkitPPC", "bin", "powerpc-eabi-gcc")
objcopy = os.path.join("..", "devkitPPC", "bin", "powerpc-eabi-objcopy")
destdir = 'bin'

# Initialize variables
Expand Down Expand Up @@ -73,6 +73,7 @@ def build(isBootStrap: bool):
print('Insert', hex(instruction), 'at', hex(startHook))

# Convert to binary
print(f'Converting {region} to binary...')
c = call([objcopy, '-O', 'binary', '-R', '.eh_frame', '-R', '.eh_frame_hdr', outputfile + 'o', outputfile + 'bin'])
if c != 0:
print('Build failed!')
Expand Down
7 changes: 5 additions & 2 deletions src/payload/main.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "common.h"

// Forward declarations
void CupScreenPatch();
void BattleCupScreenPatch();
Expand Down Expand Up @@ -143,7 +142,7 @@ void loadCodes() {
directWriteBranch(GuestSendHook, GuestSend, false);
directWriteBranch(HostCheckHook, HostCheck, false);
directWriteBranch(HostCheckHelperHook, HostCheckHelper, true);
directWrite8(Version, 7);
directWrite8(Version, 8);

// Improved Position Interpolation (by stebler)
directWrite32(NoInterpolation, 0x3F800000);
Expand Down Expand Up @@ -345,6 +344,10 @@ void loadCodes() {
directWriteBranch(TagDistanceHook2, TagDistanceFunc, true);
directWriteBranch(TagShowHook, HandleTags, true);

// Track Check (by CLF78 and Lami)
directWriteBranch(InsertTrackIdentHook, InsertTrackIdent, false);
directWriteBranch(CheckTrackIdentHook, CheckTrackIdent, false);

// Disable Track Music (by CosmoCourtney)
if (NoMusic == 1) {
directWrite32(NoMusicHook, 0x38600000);
Expand Down
12 changes: 6 additions & 6 deletions src/payload/main/battlefixes.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <common.h>
#include <hidenseek.h>
#include <jgpt.h>
#include <raceinfo.h>
#include <player.h>
#include <vec.h>
#include "common.h"
#include "hidenseek.h"
#include "jgpt.h"
#include "raceinfo.h"
#include "player.h"
#include "vec.h"

#define DELFINOPIERCRC 0x72836BEE

Expand Down
10 changes: 5 additions & 5 deletions src/payload/main/hnsdata.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <common.h>
#include <hidenseek.h>
#include <racedata.h>
#include <rknetcontroller.h>
#include <utils.h>
#include "common.h"
#include "hidenseek.h"
#include "racedata.h"
#include "rknetcontroller.h"
#include "utils.h"

int pidHelper(char currentpid, char prevaid1, char prevaid2, int index) {

Expand Down
8 changes: 4 additions & 4 deletions src/payload/main/hudedits.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <common.h>
#include <hidenseek.h>
#include <racedata.h>
#include <raceinfo.h>
#include "common.h"
#include "hidenseek.h"
#include "racedata.h"
#include "raceinfo.h"

int ScoreSound(int score) {

Expand Down
12 changes: 6 additions & 6 deletions src/payload/main/invisibility.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <common.h>
#include <hidenseek.h>
#include <racedata.h>
#include <racepacket.h>
#include <rknetcontroller.h>
#include <utils.h>
#include "common.h"
#include "hidenseek.h"
#include "racedata.h"
#include "racepacket.h"
#include "rknetcontroller.h"
#include "utils.h"

void InvisibilityFunc(RacePacket* packet, int length, int aid) {

Expand Down
18 changes: 9 additions & 9 deletions src/payload/main/itemhit.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include <common.h>
#include <hidenseek.h>
#include <killdata.h>
#include <musichandler.h>
#include <player.h>
#include <racedata.h>
#include <racepacket.h>
#include <rknetcontroller.h>
#include <utils.h>
#include "common.h"
#include "hidenseek.h"
#include "killdata.h"
#include "musichandler.h"
#include "player.h"
#include "racedata.h"
#include "racepacket.h"
#include "rknetcontroller.h"
#include "utils.h"

void PlayerKiller(char pid) {

Expand Down
6 changes: 3 additions & 3 deletions src/payload/main/killdata.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <common.h>
#include <killdata.h>
#include <screentext.h>
#include "common.h"
#include "killdata.h"
#include "screentext.h"

void AddNewKillData(u16 type, u16 int1, u16 int2) {

Expand Down
4 changes: 2 additions & 2 deletions src/payload/main/noclip.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <hidenseek.h>
#include <player.h>
#include "hidenseek.h"
#include "player.h"

bool NoClip(PlayerPointers** player1) {
register PlayerSub18* player2 asm("r30");
Expand Down
Loading