Add vscode settings, update CONTRIBUTING.md

This commit is contained in:
Luke Street 2022-09-30 17:51:20 -04:00
parent 19b6768179
commit e6639bf20e
5 changed files with 58 additions and 4 deletions

3
.gitignore vendored
View File

@ -12,5 +12,4 @@ tools/mwcc_compiler/*
*.bat
include/lmgr326b.dll
.idea/
.vscode/
versions/
versions/

16
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/include",
"${workspaceFolder}/libc"
],
"cStandard": "c99",
"cppStandard": "c++98",
"intelliSenseMode": "linux-clang-x86",
"compilerPath": ""
}
],
"version": 4
}

6
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"recommendations": [
"ms-vscode.cpptools",
"xaver.clang-format"
]
}

17
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"[c]": {
"files.encoding": "shiftjis",
"editor.defaultFormatter": "xaver.clang-format"
},
"[cpp]": {
"files.encoding": "shiftjis",
"editor.defaultFormatter": "xaver.clang-format"
},
"editor.tabSize": 2,
"files.associations": {
"source_location": "cpp"
},
"files.autoSave": "onFocusChange",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
}

View File

@ -14,8 +14,23 @@ There are several useful resources you can use for this decomp:
Visual Studio Code is recommended.
[objdiff](https://github.com/encounter/objdiff) will be your primary diffing tool. // TODO more info
### Diffing
[objdiff](https://github.com/encounter/objdiff) will be your primary diffing tool. You can fetch a binary from the latest GitHub Actions build, or build from source with `cargo run --release`.
objdiff configuration:
- Project dir: `prime`
- Target build dir: `prime/build/mp1.0/asm`
- Base build dir: `prime/build/mp1.0/src`
- Obj: Whatever .o you're currently working on (can select from asm or src build dirs)
- [x] Build target
- [x] Reverse function order (deferred)
objdiff will automatically rebuild and reload the object on source changes, so you can quickly iterate on functions.
With CodeWarrior, the `-inline deferred` flag reverses the function order in a translation unit. You'll work bottom-up in most asm files. Dolphin SDK files do **not** use `-inline deferred`, so their function order is top-down.
### Sharing
When you have a function mismatch that you want help on, you can upload a scratch to [decomp.me](https://decomp.me):
- Use `tools/decompctx.py src/path/to/file.cpp` to generate `ctx.c` which you can put in the "Context" field.
- Set preset to `Metroid Prime (USA)`.
@ -33,6 +48,7 @@ Metaforce -> decomp
- Any other `zeus::` class has the prefixed removed, i.e. `zeus::CVector3f` -> `CVector3f`
- `std::vector` -> `rstl::vector`
- `std::optional` -> `rstl::optional_object`
- `std::pair` -> `rstl::pair`
- `std::unique_ptr` -> `rstl::single_ptr` or `rstl::auto_ptr` (`auto_ptr` has an adjacent boolean)
- `std::shared_ptr` -> `rstl::rc_ptr` or `rstl::ncrc_ptr`
- `std::array<T, N> var` -> `T var[N]`
@ -186,4 +202,4 @@ However, in retail, the standard is to use `GetX()` for const and `X()` for non-
```c++
CWorld* World() { return x850_world.get(); }
const CWorld* GetWorld() const { return x850_world.get(); }
```
```