Skip to content

Commit

Permalink
Remove Gamecube cod (#335)
Browse files Browse the repository at this point in the history
* Remove gc stuff

* version bump
  • Loading branch information
ethteck authored Feb 3, 2024
1 parent abecea9 commit 6b46125
Show file tree
Hide file tree
Showing 26 changed files with 17 additions and 1,104 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# splat Release Notes

### 0.21.9

* Removed gc code in favor of decomp-toolkit, which is now linked-to from this project.

### 0.21.8

* `gfx` and `vtx` segments now support an optional `length` parameter, allowing splat to know their size
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

A binary splitting tool to assist with decompilation and modding projects

Currently, only N64, PSX, and PS2 binaries are supported.
Currently, only N64, PSX, and PS2 binaries are supported. More platforms may come in the future.

Please check out the [wiki](https://github.com/ethteck/splat/wiki) for more information including [examples](https://github.com/ethteck/splat/wiki/Examples) of projects that use splat.

Expand All @@ -21,10 +21,14 @@ The brackets corresponds to the optional dependencies to install while installin
If you use a `requirements.txt` file in your repository, then you can add this library with the following line:

```txt
splat64[mips]>=0.21.8,<1.0.0
splat64[mips]>=0.21.9,<1.0.0
```

### Optional dependencies

- `mips`: Required when using the N64, PSX or PS2 platforms.
- `dev`: Installs all the available dependencies groups and other packages for development.

### Gamecube / Wii

For Gamecube / Wii projects, see [decomp-toolkit](https://github.com/encounter/decomp-toolkit)!
8 changes: 0 additions & 8 deletions docs/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ The target platform for the binary. Options are:
- `n64` (Nintendo 64)
- `psx` (PlayStation 1)
- `ps2` (PlayStation 2)
- `gc` (GameCube)

#### Usage
```yaml
Expand Down Expand Up @@ -647,13 +646,6 @@ Use named libultra symbols by default. Those will need to be added to a linker s

Use named hardware register symbols by default. Those will need to be added to a linker script manually by the user


## Gamecube-specific options

### filesystem_path

Path where the iso's filesystem will be extracted to

## Compiler-specific options

### use_legacy_include_asm
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "splat64"
# Should be synced with src/splat/__init__.py
version = "0.21.8"
version = "0.21.9"
description = "A binary splitting tool to assist with decompilation and modding projects"
readme = "README.md"
license = {file = "LICENSE"}
Expand Down
2 changes: 1 addition & 1 deletion src/splat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
__package_name__ = __name__

# Should be synced with pyproject.toml
__version_info__: Tuple[int, int, int] = (0, 21, 8)
__version_info__: Tuple[int, int, int] = (0, 21, 9)
__version__ = ".".join(map(str, __version_info__))
__author__ = "ethteck"

Expand Down
1 change: 0 additions & 1 deletion src/splat/platforms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from . import gc as gc
from . import n64 as n64
from . import ps2 as ps2
from . import psx as psx
5 changes: 0 additions & 5 deletions src/splat/platforms/gc.py

This file was deleted.

69 changes: 2 additions & 67 deletions src/splat/scripts/create_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys
from pathlib import Path

from ..util.gc import gcinfo
from ..util.n64 import find_code_length, rominfo
from ..util.psx import psxexeinfo

Expand All @@ -22,11 +21,6 @@ def main(file_path: Path):

file_bytes = file_path.read_bytes()

# Check for GC disc image
if int.from_bytes(file_bytes[0x1C:0x20], byteorder="big") == 0xC2339F3D:
create_gc_config(file_path, file_bytes)
return

# Check for PSX executable
if file_bytes[0:8] == b"PS-X EXE":
create_psx_config(file_path, file_bytes)
Expand Down Expand Up @@ -155,63 +149,6 @@ def create_n64_config(rom_path: Path):
f.write(segments)


def create_gc_config(iso_path: Path, iso_bytes: bytes):
gc = gcinfo.get_info(iso_path, iso_bytes)
basename = gc.system_code + gc.game_code + gc.region_code + gc.publisher_code

header = f"""\
name: \"{gc.name.title()} ({gc.get_region_name()})\"
system_code: {gc.system_code}
game_code: {gc.game_code}
region_code: {gc.region_code}
publisher_code: {gc.publisher_code}
sha1: {gc.sha1}
options:
filesystem_path: filesystem
basename: {basename}
target_path: {iso_path.with_suffix(".iso")}
base_path: .
compiler: {gc.compiler}
platform: gc
# undefined_funcs_auto: True
# undefined_funcs_auto_path: undefined_funcs_auto.txt
# undefined_syms_auto: True
# undefined_syms_auto_path: undefined_syms_auto.txt
# symbol_addrs_path: symbol_addrs.txt
# asm_path: asm
# src_path: src
# build_path: build
# extensions_path: tools/splat_ext
# section_order: [".text", ".data", ".rodata", ".bss"]
# auto_all_sections: [".data", ".rodata", ".bss"]
"""

segments = f"""\
segments:
- name: filesystem
type: fst
path: filesystem/sys/fst.bin
- name: bootinfo
type: bootinfo
path: filesystem/sys/boot.bin
- name: bi2
type: bi2
path: filesystem/sys/bi2.bin
- name: apploader
type: apploader
path: filesystem/sys/apploader.img
- name: main
type: dol
path: filesystem/sys/main.dol
"""

out_file = f"{basename}.yaml"
with open(out_file, "w", newline="\n") as f:
print(f"Writing config to {out_file}")
f.write(header)
f.write(segments)


def create_psx_config(exe_path: Path, exe_bytes: bytes):
exe = psxexeinfo.PsxExe.get_info(exe_path, exe_bytes)
basename = exe_path.name.replace(" ", "").lower()
Expand Down Expand Up @@ -306,17 +243,15 @@ def create_psx_config(exe_path: Path, exe_bytes: bytes):
def add_arguments_to_parser(parser: argparse.ArgumentParser):
parser.add_argument(
"file",
help="Path to a .z64/.n64 ROM, PSX executable, or .iso/.gcm GameCube image",
help="Path to a .z64/.n64 ROM or PSX executable",
)


def process_arguments(args: argparse.Namespace):
main(Path(args.file))


script_description = (
"Create a splat config from an N64 ROM, PSX executable, or a GameCube disc image."
)
script_description = "Create a splat config from an N64 ROM or PSX executable."


def add_subparser(subparser: argparse._SubParsersAction):
Expand Down
4 changes: 2 additions & 2 deletions src/splat/scripts/split.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,8 +530,8 @@ def main(
# Split
do_split(all_segments, rom_bytes, stats, cache)

if (
options.opts.is_mode_active("ld") and options.opts.platform != "gc"
if options.opts.is_mode_active(
"ld"
): # TODO move this to platform initialization when it gets implemented
global linker_writer
linker_writer = write_linker_script(all_segments)
Expand Down
1 change: 0 additions & 1 deletion src/splat/segtypes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from . import segment as segment

from . import common as common
from . import gc as gc
from . import n64 as n64
from . import ps2 as ps2
from . import psx as psx
9 changes: 0 additions & 9 deletions src/splat/segtypes/gc/__init__.py

This file was deleted.

8 changes: 0 additions & 8 deletions src/splat/segtypes/gc/apploader.py

This file was deleted.

67 changes: 0 additions & 67 deletions src/splat/segtypes/gc/bi2.py

This file was deleted.

Loading

0 comments on commit 6b46125

Please sign in to comment.