Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into no-asm-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
cadmic committed Sep 20, 2024
2 parents 4c7e98a + 944ed73 commit 849746e
Show file tree
Hide file tree
Showing 13 changed files with 2,521 additions and 639 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Check Format

on:
push:
pull_request:

jobs:
format:
runs-on: ubuntu-24.04
defaults:
run:
shell: bash

steps:
# Checkout the repository (shallow clone)
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive

# Set Git config
- name: Git config
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

# Run formatter
- name: Run clang-format
run: ./format

# Cancel if there's a diff
- name: Check status
run: git diff --name-only --exit-code
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
# oot-gc
oot-gc
[![Build Status]][actions] ![mq-j] ![mq-u] ![mq-e] ![ce-j] ![ce-u] ![ce-e] [![Discord Badge]][discord]
=============

[Build Status]: https://github.com/zeldaret/oot-gc/actions/workflows/build.yml/badge.svg
[actions]: https://github.com/zeldaret/oot-gc/actions/workflows/build.yml

[mq-j]: https://img.shields.io/endpoint?label=mq-j&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Foot-gc%2Fmq-j%2Fdol%2F%3Fmode%3Dshield%26measure%3Dcode

[mq-u]: https://img.shields.io/endpoint?label=mq-u&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Foot-gc%2Fmq-j%2Fdol%2F%3Fmode%3Dshield%26measure%3Dcode

[mq-e]: https://img.shields.io/endpoint?label=mq-e&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Foot-gc%2Fmq-j%2Fdol%2F%3Fmode%3Dshield%26measure%3Dcode

[ce-j]: https://img.shields.io/endpoint?label=ce-j&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Foot-gc%2Fce-j%2Fdol%2F%3Fmode%3Dshield%26measure%3Dcode

[ce-u]: https://img.shields.io/endpoint?label=ce-u&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Foot-gc%2Fce-u%2Fdol%2F%3Fmode%3Dshield%26measure%3Dcode

[ce-e]: https://img.shields.io/endpoint?label=ce-e&url=https%3A%2F%2Fprogress.decomp.club%2Fdata%2Foot-gc%2Fce-e%2Fdol%2F%3Fmode%3Dshield%26measure%3Dcode

[Discord Badge]: https://img.shields.io/discord/688807550715560050?color=%237289DA&logo=discord&logoColor=%23FFFFFF
[discord]: https://discord.zelda.deco.mp/

A work-in-progress decompilation of the N64 emulator used in the GameCube releases of The Legend of Zelda: Ocarina of Time.

Expand Down
378 changes: 189 additions & 189 deletions configure.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions include/emulator/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ typedef struct CpuOptimize {
} CpuOptimize; // size = 0x28

typedef struct Cpu Cpu;
typedef bool (*CpuExecuteFunc)(Cpu* pCPU, s32 nCount, s32 nAddressN64, s32 nAddressGCN);
typedef s32 (*CpuExecuteFunc)(Cpu* pCPU, s32 nCount, s32 nAddressN64, s32 nAddressGCN);

// _CPU
struct Cpu {
Expand Down Expand Up @@ -350,7 +350,7 @@ struct Cpu {
bool cpuFreeCachedAddress(Cpu* pCPU, s32 nAddress0, s32 nAddress1);
bool cpuTestInterrupt(Cpu* pCPU, s32 nMaskIP);
bool cpuException(Cpu* pCPU, CpuExceptionCode eCode, s32 nMaskIP);
bool cpuExecute(Cpu* pCPU, u64 nAddressBreak);
bool cpuExecute(Cpu* pCPU, s32 nCount, u64 nAddressBreak);
bool cpuSetRegisterCP0(Cpu* pCPU, s32 iRegister, s64 nData);
bool cpuGetRegisterCP0(Cpu* pCPU, s32 iRegister, s64* pnData);
bool __cpuERET(Cpu* pCPU);
Expand Down
37 changes: 17 additions & 20 deletions include/emulator/mcardGCN.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "dolphin.h"

// __anon_0x1BD8E
typedef enum MemCardCommand {
MC_C_NONE = 0,
MC_C_CONTINUE = 1,
Expand All @@ -14,7 +13,6 @@ typedef enum MemCardCommand {
MC_C_FORMAT_CARD = 6,
} MemCardCommand;

// __anon_0x1B0CB
typedef enum MemCardError {
MC_E_NONE = 0,
MC_E_BUSY = 1,
Expand Down Expand Up @@ -97,61 +95,60 @@ typedef enum MemCardMessage {
MC_M_GF06 = 49,
} MemCardMessage;

// __anon_0x1AC1A
typedef struct __anon_0x1AC1A {
typedef struct MemCardGameInfo {
/* 0x00 */ s32 configuration;
/* 0x04 */ s32 size;
/* 0x08 */ s32 offset;
/* 0x0C */ char* buffer;
/* 0x10 */ s32* writtenBlocks;
/* 0x14 */ s32 writtenConfig;
} __anon_0x1AC1A; // size = 0x18
/* 0x10 */ bool* writtenBlocks;
/* 0x14 */ bool writtenConfig;
} MemCardGameInfo; // size = 0x18

typedef struct __anon_0x1AEB5 {
typedef struct MemCardFileInfo {
/* 0x000 */ s32 currentGame;
/* 0x004 */ s32 fileSize;
/* 0x008 */ char name[33];
/* 0x02C */ s32 numberOfGames;
/* 0x030 */ __anon_0x1AC1A game;
/* 0x048 */ s32 changedDate;
/* 0x04C */ s32 changedChecksum;
/* 0x030 */ MemCardGameInfo game;
/* 0x048 */ bool changedDate;
/* 0x04C */ bool changedChecksum;
/* 0x050 */ s32 gameSize[16];
/* 0x090 */ s32 gameOffset[16];
/* 0x0D0 */ s32 gameConfigIndex[16];
/* 0x110 */ char gameName[16][33];
/* 0x320 */ OSCalendarTime time;
/* 0x348 */ CARDFileInfo fileInfo;
} __anon_0x1AEB5; // size = 0x35C
} MemCardFileInfo; // size = 0x35C

// __anon_0x1B36F
typedef struct _MCARD {
/* 0x000 */ __anon_0x1AEB5 file;
/* 0x000 */ MemCardFileInfo file;
/* 0x35C */ MemCardError error;
/* 0x360 */ s32 slot;
/* 0x364 */ bool (*pPollFunction)(void);
/* 0x368 */ s32 pollPrevBytes;
/* 0x36C */ s32 pollSize;
/* 0x370 */ char pollMessage[256];
/* 0x470 */ s32 saveToggle;
/* 0x470 */ bool saveToggle;
/* 0x474 */ char* writeBuffer;
/* 0x478 */ char* readBuffer;
/* 0x47C */ s32 writeToggle;
/* 0x480 */ s32 soundToggle;
/* 0x47C */ bool writeToggle;
/* 0x480 */ bool soundToggle;
/* 0x484 */ s32 writeStatus;
/* 0x488 */ s32 writeIndex;
/* 0x48C */ s32 accessType;
/* 0x490 */ s32 gameIsLoaded;
/* 0x490 */ bool gameIsLoaded;
/* 0x494 */ char saveFileName[256];
/* 0x594 */ char saveComment[256];
/* 0x694 */ char* saveIcon;
/* 0x698 */ char* saveBanner;
/* 0x69C */ char saveGameName[256];
/* 0x79C */ s32 saveFileSize;
/* 0x7A0 */ s32 saveGameSize;
/* 0x7A4 */ s32 bufferCreated;
/* 0x7A4 */ bool bufferCreated;
/* 0x7A8 */ s32 cardSize;
/* 0x7AC */ s32 wait;
/* 0x7B0 */ s32 isBroken;
/* 0x7AC */ bool wait;
/* 0x7B0 */ bool isBroken;
/* 0x7B4 */ s32 saveConfiguration;
} MemCard; // size = 0x7B8

Expand Down
2 changes: 2 additions & 0 deletions include/emulator/simGCN.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ typedef enum SimulatorArgumentType {

extern bool gDVDResetToggle;
extern bool gbDisplayedError;
extern bool gButtonDownToggle;

extern void* gpFrame;
extern void* gpSound;
Expand Down Expand Up @@ -164,6 +165,7 @@ bool simulatorDetectController(s32 channel);
bool simulatorReadPak(s32 channel, u16 address, u8* data);
bool simulatorWritePak(s32 channel, u16 address, u8* data);
bool simulatorSetControllerMap(u32* mapData, s32 channel);
void simulatorReset(bool IPL, bool forceMenu);
void simulatorResetAndPlayMovie(void);
bool simulatorDrawErrorMessage(SimulatorMessage simulatorErrorMessage, bool drawBar, s32 percent);
bool simulatorDVDShowError(s32 nStatus, void*, s32, u32);
Expand Down
Loading

0 comments on commit 849746e

Please sign in to comment.