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

1.1.0 #86

Merged
merged 55 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
bbb1c0d
memfile fix attempt
Pheenoh Jul 30, 2024
5b98d44
memfile fix
Pheenoh Jul 31, 2024
f999f2e
update pr branch
Pheenoh Jul 31, 2024
4e956e2
readd crash address for pr tests
Pheenoh Jul 31, 2024
3f7b705
fix other refs
Pheenoh Jul 31, 2024
95a6833
copy pasta
Pheenoh Jul 31, 2024
5d66e56
more granular actor pos/angle control
Pheenoh Aug 1, 2024
81237dd
simplify menu closing logic, add proc id to actor list
Pheenoh Aug 1, 2024
83fc7a4
migrate checkers to their own menu
Pheenoh Aug 1, 2024
2c856b9
Merge branch 'main' into memfile
Pheenoh Aug 1, 2024
69fc032
minor cleanup
Pheenoh Aug 1, 2024
1cb858b
Merge branch 'memfile' of github.com:zsrtp/tpgz into memfile
Pheenoh Aug 1, 2024
2d3d8d1
more actor view optimizations
Pheenoh Aug 1, 2024
25cdf89
skip startup logos
Pheenoh Aug 2, 2024
d2c2eba
rm extra mappings in tools menu
Pheenoh Aug 2, 2024
4da6740
lfc checker wip
Pheenoh Aug 3, 2024
456a30b
use new docker image(s)
Pheenoh Aug 5, 2024
74582e4
tell dme about the env it's running in
Pheenoh Aug 6, 2024
a8d6d08
crash test
Pheenoh Aug 6, 2024
40a3754
fix: Crash test at the end of main
kipcode66 Aug 6, 2024
974280f
removed redundant declaration
kipcode66 Aug 6, 2024
bef2ce7
rm crash test
Pheenoh Aug 6, 2024
9403d82
actor view address, update button combo checks for pause/delete
Pheenoh Aug 6, 2024
5577ee9
skip wii intros
Pheenoh Aug 7, 2024
254a534
rm extra testing
Pheenoh Aug 7, 2024
b6f966c
remove counters from save manager
Pheenoh Aug 7, 2024
18e14f5
use fpcEx_Search
Pheenoh Aug 12, 2024
2b02f55
very basic sound test menu
TakaRikka Aug 13, 2024
29a2153
add set scent option in pause menu
Pheenoh Aug 20, 2024
7aa025b
rm debug logging
Pheenoh Aug 20, 2024
ef55343
ee checker
Pheenoh Aug 27, 2024
a772b1a
golden bugs menu
Pheenoh Sep 1, 2024
6dc16ef
allow setting of charlo donation
Pheenoh Sep 2, 2024
b788995
add leever range viewer
TakaRikka Sep 2, 2024
084b1a9
add funraising flags, sort rupee flags into their own menu
Pheenoh Sep 2, 2024
49ea336
sort pause menu into sub menus
Pheenoh Sep 2, 2024
7c93c7b
sort tools menu into sub menus
Pheenoh Sep 3, 2024
82c82fb
intro cs flag WIP
Pheenoh Sep 4, 2024
f7d3969
fix actor spawner
TakaRikka Sep 16, 2024
971b08b
add coro/rusl td
Pheenoh Sep 17, 2024
196d876
Merge branch '1.1.0-dev' of github.com:zsrtp/tpgz into 1.1.0-dev
Pheenoh Sep 17, 2024
77e7146
update hundo saves, add stage info display
TakaRikka Sep 19, 2024
a98ece4
updating (simplifying) docker config
kipcode66 Sep 26, 2024
bc58c71
added wii BiTE saves
kipcode66 Sep 26, 2024
d671721
Update README.md
kipcode66 Sep 26, 2024
1597cb5
account for dScnLogo_c size difference on PAL
Pheenoh Sep 27, 2024
9e94c0d
rm wii fade on warning menu
Pheenoh Sep 27, 2024
5eeb8fb
use same class name for dScnLogo_c
Pheenoh Sep 27, 2024
a4a24f1
add missing enum
Pheenoh Sep 27, 2024
0c2aebd
keep fade function
Pheenoh Sep 27, 2024
04c40a2
rm intro cs flag feature for now
Pheenoh Sep 27, 2024
4b82ebc
fix bombs
kipcode66 Sep 27, 2024
f8363cd
update release automation
Pheenoh Sep 27, 2024
0760e64
Merge branch '1.1.0-dev' of github.com:zsrtp/tpgz into 1.1.0-dev
Pheenoh Sep 27, 2024
c303ca4
fixed wii nand writing
kipcode66 Sep 27, 2024
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
23 changes: 3 additions & 20 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,22 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/ubuntu/.devcontainer/base.Dockerfile

# [Choice] Ubuntu version (use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon): ubuntu-22.04, ubuntu-20.04, ubuntu-18.04
ARG VARIANT="jammy"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}
USER vscode
FROM devkitpro/devkitppc

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

RUN sudo dpkg --add-architecture i386
#RUN sudo dpkg --add-architecture i386
RUN sudo apt-get update && sudo apt-get install -y build-essential
RUN sudo apt-get install -y python3-pip
RUN sudo apt-get install -y libarchive-tools
RUN sudo apt-get install -y clang-format-10
RUN sudo apt-get install -y libarchive-tools
RUN sudo apt-get install -y cmake
# RUN sudo apt-get install -y wine64
# RUN sudo apt-get install -y wine
RUN sudo apt-get install -y ninja-build
RUN sudo apt-get upgrade -y
RUN sudo apt-get install -y libtinfo5

RUN python3 -m pip install Pillow

# Install DevkitPPC
RUN sudo ln -sf /proc/self/mounts /etc/mtab
WORKDIR /tmp
COPY install-devkitpro-pacman install-devkitpro-pacman
RUN sudo chmod +x ./install-devkitpro-pacman
RUN sudo ./install-devkitpro-pacman
RUN sudo dkp-pacman -Syu --noconfirm
WORKDIR /etc
RUN sudo ln -sf /proc/self/mounts mtab
RUN sudo dkp-pacman -S --noconfirm gamecube-dev wii-dev

# # Install the patchers
# WORKDIR /workspaces/romhack/wii
# RUN curl -L https://github.com/zsrtp/romhack-compiler/releases/download/v0.1.1-r2/romhack-v0.1.1-r2-linux-x64-musl.zip | bsdtar -xvf -
Expand Down
45 changes: 28 additions & 17 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,43 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.241.1/containers/ubuntu
{
"name": "Ubuntu",
"name": "TGPZ",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
"args": { "VARIANT": "ubuntu-20.04" }
"dockerfile": "Dockerfile"
},
"extensions": [
"ms-vscode.cpptools-extension-pack",
"ms-vscode.makefile-tools",
"ms-python.python",
"ms-vscode.hexeditor",
"twxs.cmake",
"Gruntfuggly.todo-tree",
"bungcip.better-toml",
"mhutchie.git-graph"
],
"features": {
"ghcr.io/devcontainers/features/python:1": {
"version": "3.12.5"
}
},

"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools-extension-pack",
"ms-vscode.makefile-tools",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.vscode-pylance",
"ms-vscode.hexeditor",
"twxs.cmake",
"Gruntfuggly.todo-tree",
"bungcip.better-toml",
"mhutchie.git-graph"
]
}
},

"onCreateCommand": "python3 -m pip install Pillow pycryptodome",

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"runArgs": [
"--network=host"
],
]

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
//"remoteUser": "vscode"
}
6 changes: 3 additions & 3 deletions .github/workflows/multi-region-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Multi-Region Tests

on:
pull_request:
branches: [ master ]
branches: [ main ]

jobs:
build:
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
dolphin_memory: "0x8044A6C0"
iso_name: tpgz.iso
container:
image: ghcr.io/pheenoh/zsrtp-tpgz:${{ matrix.container }}
image: ghcr.io/zsrtp/zsrtp-tpgz:${{ matrix.container }}
options: --shm-size=128m --ulimit core=-1 --privileged=true
name: ${{ matrix.platform }}-${{ matrix.region }} Test
steps:
Expand All @@ -70,4 +70,4 @@ jobs:
run: |
dolphin-emu-nogui --platform=headless --video_backend=Null -e build/${{ matrix.iso_name }} &
sleep 15
/dme -c ${{ matrix.dolphin_memory }}
dme -d dolphin-emu-nog -a ${{ matrix.dolphin_memory }} -q 0 --platform offscreen
7 changes: 7 additions & 0 deletions .github/workflows/tpgz-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ jobs:
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Download existing meta.json
run: aws s3 cp s3://${{ secrets.AWS_S3_BUCKET }}/patches/meta.json meta.json
- name: Update meta.json
run: |
python3 external/misc/meta.py
- name: Upload updated meta.json to S3
run: aws s3 cp meta.json s3://${{ secrets.AWS_S3_BUCKET }}/patches/meta.json --acl public-read
- name: Sync directory to S3
run: |
aws s3 sync patches/ s3://${{ secrets.AWS_S3_BUCKET }}/patches/ --acl public-read
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ include(cmake/relmapper.cmake)
include(cmake/fonts.cmake)

project(TPGZ
VERSION 1.0.0
VERSION 1.1.0
DESCRIPTION "Twilight Princess speedrunning practice and testing tool"
HOMEPAGE_URL "tpgz.io"
LANGUAGES C CXX ASM)
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ A *Twilight Princess* ROM hack for speedrun practice and research.

## Download
### Web
Patch your TP (GameCube) rom on the web using our website [tpgz.io](https://tpgz.io).
- This uses a lot of memory, so it requires a decent computer.
- The Wii version is currently not supported for web patching. Please follow the offline patching guide.
Patch your TP (GameCube/Wii) rom on the web using our website [tpgz.io](https://tpgz.io).

### Offline
To patch your rom offline, please follow our [guide](./docs/CreatingAnIso.md).
Expand Down
4 changes: 2 additions & 2 deletions RomHack.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ iso = "@TPGZ_CFG_BLD_ISO@"
"tpgz/save_files/any" = "../@TPGZ_CFG_SAVE_ANY_PATH@/any"

# any% bite saves
"tpgz/save_files/any_bite.bin" = "../res/save_files/any_bite.bin"
"tpgz/save_files/any_bite" = "../res/save_files/any_bite"
"tpgz/save_files/any_bite.bin" = "../@TPGZ_CFG_SAVE_ANY_PATH@/any_bite.bin"
"tpgz/save_files/any_bite" = "../@TPGZ_CFG_SAVE_ANY_PATH@/any_bite"

# 100% saves
"tpgz/save_files/hundo.bin" = "../res/save_files/hundo.bin"
Expand Down
4 changes: 4 additions & 0 deletions external/gcn_c/include/nand.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
#define NAND_OPEN_WRITE 0x02
#define NAND_OPEN_RW (NAND_OPEN_READ | NAND_OPEN_WRITE)

#define NAND_SEEK_BEG 0
#define NAND_SEEK_CUR 1
#define NAND_SEEK_END 2

typedef struct NANDInfo {
uint8_t unk[0x90];
} NANDInfo;
Expand Down
48 changes: 34 additions & 14 deletions external/gcn_c/include/storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,19 @@
#define OPEN_MODE_READ
#define OPEN_MODE_WRITE
#define OPEN_MODE_RW
#define STORAGE_SEEK_BEG 0
#define STORAGE_SEEK_CUR 1
#define STORAGE_SEEK_END 2
#else // WII_PLATFORM
#include "nand.h"
#define STORAGE_FILENAME_MAX NAND_FILENAME_MAX
#define FileInfo NANDInfo
#define OPEN_MODE_READ NAND_OPEN_READ
#define OPEN_MODE_WRITE NAND_OPEN_WRITE
#define OPEN_MODE_RW NAND_OPEN_RW
#define STORAGE_SEEK_BEG NAND_SEEK_BEG
#define STORAGE_SEEK_CUR NAND_SEEK_CUR
#define STORAGE_SEEK_END NAND_SEEK_END
#endif // WII_PLATFORM

enum StorageError {
Expand Down Expand Up @@ -45,17 +51,34 @@ typedef struct Storage {
int32_t result;
char file_name_buffer[STORAGE_FILENAME_MAX * 2];
uint32_t result_size;
uint32_t position;
} Storage;

#ifndef WII_PLATFORM
#define StorageCreate(ch, fileName, size, fileBuffer) CARDCreate(ch, fileName, size, fileBuffer)
#define StorageDelete(ch, fileName) CARDDelete(ch, fileName)
#define StorageOpen(ch, fileName, fileInfo, mode) CARDOpen(ch, fileName, fileInfo)
#define StorageClose(fileInfo) CARDClose(fileInfo)
#define StorageRead(storage, data, length, offset) \
({ (storage).result = CARDRead(&(storage).info, data, length, offset); })
#define StorageWrite(storage, data, length, offset) \
({ (storage).result = CARDWrite(&(storage).info, data, length, offset); })
#define StorageRead(storage, data, length) \
({ (storage).result = CARDRead(&(storage).info, data, length, (storage).position); (storage).position += length; (storage).result; })
#define StorageWrite(storage, data, length) \
({ (storage).result = CARDWrite(&(storage).info, data, length, (storage).position); (storage).position += length; (storage).result; })
inline int32_t StorageSeek(Storage* storage, int32_t offset, int32_t whence) {
switch (whence) {
case STORAGE_SEEK_BEG:
storage->position = (uint32_t)offset;
break;
case STORAGE_SEEK_CUR:
storage->position += offset;
break;
case STORAGE_SEEK_END:
storage->position = storage->info.length + offset;
break;
default:
return IoError;
}
return storage->position;
}
#else // WII_PLATFORM
#define StorageCreate(ch, fileName, size, fileBuffer) \
({ \
Expand All @@ -66,20 +89,17 @@ typedef struct Storage {
#define StorageDelete(ch, fileName) NANDDelete(fileName)
#define StorageOpen(ch, fileName, fileInfo, mode) NANDOpen(fileName, fileInfo, mode)
#define StorageClose(fileInfo) NANDClose(fileInfo)
#define StorageRead(storage, data, length, offset) \
#define StorageRead(storage, data, length) \
({ \
(storage).result = NANDSeek(&(storage).info, offset, 0); \
if ((storage).result == Ready) { \
(storage).result_size = NANDRead(&(storage).info, data, length); \
} \
(storage).result_size = NANDRead(&(storage).info, data, length); \
(storage).result = Ready; \
})
#define StorageWrite(storage, data, length, offset) \
#define StorageWrite(storage, data, length) \
({ \
(storage).result = NANDSeek(&(storage).info, offset, 0); \
if ((storage).result == Ready) { \
(storage).result_size = NANDWrite(&(storage).info, data, length); \
} \
(storage).result_size = NANDWrite(&(storage).info, data, length); \
(storage).result = Ready; \
})
#define StorageSeek(storage, offset, whence) NANDSeek(&(*(storage)).info, offset, whence)
#endif // WII_PLATFORM

#endif // __STORAGE_H__
27 changes: 23 additions & 4 deletions external/libtp_c/include/JSystem/JAudio2/JAISound.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,31 @@

class JAISoundID {
public:
operator u32() const { return this->mId; }
JAISoundID(u32 pId) { mId = pId; };
operator u32() const { return this->mId.mFullId; }

JAISoundID(u32 pId) { mId.mFullId = pId; };

JAISoundID(JAISoundID const& other) { mId = other.mId; };

JAISoundID() {}

private:
u32 mId;
bool isAnonymous() { return mId.mFullId == 0xffffffff; }
void setAnonymous() { mId.mFullId = -1; }

union {
u32 mFullId;
struct {
u8 b0;
u8 b1;
u8 b2;
u8 b3;
} mBytes;
struct {
u16 mSoundType;
u16 mShortId;
} mAdvancedId; // Debug doesn't have an inline for referencing the short ID so I assume
// it's similar to this
} mId;
};

struct JASTrack {};
Expand Down
22 changes: 22 additions & 0 deletions external/libtp_c/include/SSystem/SComponent/c_phase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef C_PHASE_H
#define C_PHASE_H

#include "../../dolphin/types.h"

typedef int (*cPhs__Handler)(void*);

enum cPhs__Step {
/* 0x0 */ cPhs_INIT_e,
/* 0x1 */ cPhs_LOADING_e,
/* 0x2 */ cPhs_NEXT_e,
/* 0x3 */ cPhs_UNK3_e, // appears to be an alternate error code, unsure how it differs
/* 0x4 */ cPhs_COMPLEATE_e,
/* 0x5 */ cPhs_ERROR_e,
};

typedef struct request_of_phase_process_class {
cPhs__Handler* mpHandlerTable;
int id;
} request_of_phase_process_class;

#endif
23 changes: 20 additions & 3 deletions external/libtp_c/include/Z2AudioLib/Z2AudioMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "Z2SoundStarter.h"
#include "Z2SpeechMgr2.h"
#include "Z2StatusMgr.h"
#include "../defines.h"

#ifdef GCN_PLATFORM
class Z2AudioMgr {
Expand Down Expand Up @@ -62,8 +63,24 @@ class Z2AudioMgr {
};
#endif

/* inline Z2AudioMgr* Z2GetAudioMgr() {
return Z2AudioMgr::getInterface();
} */
#ifdef WII_PLATFORM
#define mAudioMgrPtr Z2SeMgr__mAudioMgrPtr
#else
#define mAudioMgrPtr mAudioMgrPtr__10Z2AudioMgr
#endif

extern "C" Z2AudioMgr* mAudioMgrPtr;

inline Z2AudioMgr* Z2GetAudioMgr() {
return mAudioMgrPtr;
}

LIBTP_DEFINE_FUNC(seStart__7Z2SeMgrF10JAISoundIDPC3VecUlScffffUc,
Z2SeMgr__seStart_JAISoundID__Vec_const____unsigned_long__signed_char__float__float__float__float__unsigned_char_,
bool, Z2SeMgr__seStart, (Z2SeMgr*, JAISoundID, Vec const*, u32, s8, f32, f32, f32, f32, u8))

LIBTP_DEFINE_FUNC(seStop__7Z2SeMgrF10JAISoundIDUl,
Z2SeMgr__seStop_JAISoundID__unsigned_long_,
bool, Z2SeMgr__seStop, (Z2SeMgr*, JAISoundID, u32))

#endif /* Z2AUDIOMGR_H */
Loading