Skip to content

Commit

Permalink
Document some CPU functions and add format workflow (#178)
Browse files Browse the repository at this point in the history
* port stuff from oot-vc

* build issues

* missed one wrong type

* review
  • Loading branch information
Yanis002 authored Sep 18, 2024
1 parent cd30a65 commit 8d833dc
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 32 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
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
Loading

0 comments on commit 8d833dc

Please sign in to comment.