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

Document CPU functions and add format workflow #178

Merged
merged 4 commits into from
Sep 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
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