Skip to content

Commit

Permalink
Update dtk stuff
Browse files Browse the repository at this point in the history
Updated to this commit: encounter/dtk-template@14c60bb
  • Loading branch information
CelestialAmber committed Nov 3, 2024
1 parent b6c39cd commit df2bcdd
Show file tree
Hide file tree
Showing 8 changed files with 474 additions and 146 deletions.
38 changes: 30 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
# IDE folders
.idea/
.vs/

# Caches
__pycache__
.idea
.vscode
.ninja_*
.mypy_cache
*.exe
build
build.ninja
objdiff.json
.cache/

# Original files
orig/*/*
!orig/*/.gitkeep
*.dol
*.rel
*.elf
*.o
*.map
*.MAP

# Build files
build/
.ninja_*
build.ninja

# decompctx output
ctx.*
*.ctx

# Generated configs
objdiff.json
compile_commands.json

# Miscellaneous
/*.txt
ctx.c
*.exe
.DS_Store
16 changes: 11 additions & 5 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
{
"recommendations": [
"ms-vscode.cpptools",
"ms-vscode.makefile-tools"
]
}
"recommendations": [
"llvm-vs-code-extensions.vscode-clangd",
"ms-python.black-formatter",
"ms-python.flake8",
],
"unwantedRecommendations": [
"ms-vscode.cmake-tools",
"ms-vscode.cpptools-extension-pack",
"ms-vscode.cpptools",
]
}
55 changes: 21 additions & 34 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,23 @@
{
"[c]": {
"files.encoding": "utf8"
},
"[cpp]": {
"files.encoding": "utf8"
},
"editor.tabSize": 4,
"files.exclude": {
"**/CVS": false,
"**/*.ctx": true
},
"files.insertFinalNewline": true,
"files.associations": {
"*.cp": "cpp",
"algorithm": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstring": "cpp",
"cwchar": "cpp",
"exception": "cpp",
"iterator": "cpp",
"new": "cpp",
"typeinfo": "cpp"
},
"search.useIgnoreFiles": false,
"search.exclude": {
"build/*/config.json": true,
"build/**/*.MAP": true,
"build.ninja": true,
".ninja_*": true,
"objdiff.json": true
}
"[c]": {
"files.encoding": "utf8",
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
},
"[cpp]": {
"files.encoding": "utf8",
"editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
},
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
// "editor.tabSize": 2,
"files.autoSave": "onFocusChange",
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.associations": {
"*.inc": "c",
".clangd": "yaml"
},
// Disable C/C++ IntelliSense, use clangd instead
"C_Cpp.intelliSenseEngine": "disabled",
}
6 changes: 3 additions & 3 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@
# Tool versions
config.binutils_tag = "2.42-1"
config.compilers_tag = "20240706"
config.dtk_tag = "v1.1.0"
config.objdiff_tag = "v2.2.1"
config.sjiswrap_tag = "v1.1.1"
config.dtk_tag = "v1.1.4"
config.objdiff_tag = "v2.3.3"
config.sjiswrap_tag = "v1.2.0"
config.wibo_tag = "0.6.11"

# Project
Expand Down
2 changes: 1 addition & 1 deletion tools/decompctx.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
os.path.join(root_dir, "libs/RVL_SDK/src/revolution/hbm/include"),
]

include_pattern = re.compile(r'^#\s*include\s*[<"](.+?)[>"]$')
include_pattern = re.compile(r'^#\s*include\s*[<"](.+?)[>"]')
guard_pattern = re.compile(r"^#\s*ifndef\s+(.*)$")
pragmaonce_pattern = re.compile(r'^#pragma once.*$')

Expand Down
1 change: 1 addition & 0 deletions tools/download_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def dtk_url(tag: str) -> str:
repo = "https://github.com/encounter/decomp-toolkit"
return f"{repo}/releases/download/{tag}/dtk-{system}-{arch}{suffix}"


def objdiff_cli_url(tag: str) -> str:
uname = platform.uname()
suffix = ""
Expand Down
23 changes: 9 additions & 14 deletions tools/ninja_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,10 @@
import os
from io import StringIO
from pathlib import Path
from typing import Dict, List, Match, Optional, Tuple, Union
from typing import Dict, Iterable, List, Match, Optional, Tuple, Union

NinjaPath = Union[str, Path]
NinjaPaths = Union[
List[str],
List[Path],
List[NinjaPath],
List[Optional[str]],
List[Optional[Path]],
List[Optional[NinjaPath]],
]
NinjaPaths = Iterable[Optional[NinjaPath]]
NinjaPathOrPaths = Union[NinjaPath, NinjaPaths]


Expand Down Expand Up @@ -118,8 +111,8 @@ def build(
pool: Optional[str] = None,
dyndep: Optional[NinjaPath] = None,
) -> List[str]:
outputs = serialize_paths(outputs)
out_outputs = [escape_path(x) for x in outputs]
str_outputs = serialize_paths(outputs)
out_outputs = [escape_path(x) for x in str_outputs]
all_inputs = [escape_path(x) for x in serialize_paths(inputs)]

if implicit:
Expand Down Expand Up @@ -154,7 +147,7 @@ def build(
for key, val in iterator:
self.variable(key, val, indent=1)

return outputs
return str_outputs

def include(self, path: str) -> None:
self._line("include %s" % path)
Expand Down Expand Up @@ -225,9 +218,11 @@ def serialize_path(input: Optional[NinjaPath]) -> str:


def serialize_paths(input: Optional[NinjaPathOrPaths]) -> List[str]:
if isinstance(input, list):
if isinstance(input, str) or isinstance(input, Path):
return [serialize_path(input)] if input else []
elif input is not None:
return [serialize_path(path) for path in input if path]
return [serialize_path(input)] if input else []
return []


def escape(string: str) -> str:
Expand Down
Loading

0 comments on commit df2bcdd

Please sign in to comment.