mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
setup moved from makefile to tp
This commit is contained in:
@@ -180,16 +180,6 @@ $(DOL_SHIFT): $(ELF_SHIFT) | tools
|
|||||||
$(ELF2DOL) $< $@ $(SDATA_PDHR) $(SBSS_PDHR) $(TARGET_COL)
|
$(ELF2DOL) $< $@ $(SDATA_PDHR) $(SBSS_PDHR) $(TARGET_COL)
|
||||||
@cp -v $(DOL_SHIFT) $(DOL)
|
@cp -v $(DOL_SHIFT) $(DOL)
|
||||||
|
|
||||||
setup:
|
|
||||||
@if [ ! -d tools/mwcc_compiler/ ]; then \
|
|
||||||
mkdir tools/mwcc_compiler/ ; \
|
|
||||||
wget https://cdn.discordapp.com/attachments/727918646525165659/917185027656286218/GC_WII_COMPILERS.zip -P tools/mwcc_compiler/ ; \
|
|
||||||
unzip tools/mwcc_compiler/GC_WII_COMPILERS.zip "GC/*" -d tools/mwcc_compiler/ ; \
|
|
||||||
mv tools/mwcc_compiler/GC/* tools/mwcc_compiler/ ; \
|
|
||||||
rm tools/mwcc_compiler/GC_WII_COMPILERS.zip ; \
|
|
||||||
rmdir tools/mwcc_compiler/GC ; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
shift: dirs $(DOL_SHIFT)
|
shift: dirs $(DOL_SHIFT)
|
||||||
|
|
||||||
game: shift
|
game: shift
|
||||||
|
|||||||
@@ -22,15 +22,9 @@ Project Setup
|
|||||||
git clone https://github.com/zeldaret/tp
|
git clone https://github.com/zeldaret/tp
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Setup the compiler
|
2. Place a copy of NTSC-U GCN Twilight Princess in the root directory and call it `gz2e01.iso` (find this on your own)
|
||||||
|
|
||||||
```bash
|
3. Then run the setup script
|
||||||
make setup
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Place a copy of NTSC-U GCN Twilight Princess in the root directory and call it `gz2e01.iso` (find this on your own)
|
|
||||||
|
|
||||||
4. Setup the project
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./tp setup
|
./tp setup
|
||||||
|
|||||||
+21
-8
@@ -28,6 +28,9 @@ try:
|
|||||||
import libarc
|
import libarc
|
||||||
import io
|
import io
|
||||||
import extract_game_assets
|
import extract_game_assets
|
||||||
|
import requests
|
||||||
|
import zipfile
|
||||||
|
import shutil
|
||||||
|
|
||||||
from rich.logging import RichHandler
|
from rich.logging import RichHandler
|
||||||
from rich.console import Console
|
from rich.console import Console
|
||||||
@@ -145,19 +148,29 @@ def setup(debug: bool, game_path: Path, tools_path: Path):
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
#
|
#
|
||||||
text = Text("--- Patching compiler")
|
text = Text("--- Fetching compiler")
|
||||||
text.stylize("bold magenta")
|
text.stylize("bold magenta")
|
||||||
CONSOLE.print(text)
|
CONSOLE.print(text)
|
||||||
|
|
||||||
compilers = tools_path.joinpath("mwcc_compiler")
|
compilers = tools_path.joinpath("mwcc_compiler")
|
||||||
if not compilers.exists() or not compilers.is_dir():
|
if not compilers.exists() or not compilers.is_dir():
|
||||||
LOG.error(
|
os.mkdir(compilers)
|
||||||
(
|
r = requests.get('https://cdn.discordapp.com/attachments/727918646525165659/917185027656286218/GC_WII_COMPILERS.zip')
|
||||||
f"Unable to find MWCC compilers: missing directory '{compilers}'\n"
|
z = zipfile.ZipFile(io.BytesIO(r.content))
|
||||||
f"Check the README for instructions on how to obtain the compilers"
|
z.extractall(compilers)
|
||||||
)
|
gc_path = compilers.joinpath("GC")
|
||||||
)
|
|
||||||
sys.exit(1)
|
allfiles = os.listdir(gc_path)
|
||||||
|
for f in allfiles:
|
||||||
|
src_path = os.path.join(gc_path, f)
|
||||||
|
dst_path = os.path.join(compilers, f)
|
||||||
|
shutil.move(src_path, dst_path)
|
||||||
|
os.rmdir(gc_path)
|
||||||
|
|
||||||
|
#
|
||||||
|
text = Text("--- Patching compiler")
|
||||||
|
text.stylize("bold magenta")
|
||||||
|
CONSOLE.print(text)
|
||||||
|
|
||||||
c27 = compilers.joinpath("2.7")
|
c27 = compilers.joinpath("2.7")
|
||||||
if not c27.exists() or not c27.is_dir():
|
if not c27.exists() or not c27.is_dir():
|
||||||
|
|||||||
Reference in New Issue
Block a user