Skip to content

Commit

Permalink
Switch to faster C implementation of lzss compression
Browse files Browse the repository at this point in the history
  • Loading branch information
mike8699 committed Sep 30, 2024
1 parent 65e0786 commit 74a7011
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ph_rando/patcher/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import struct

from ndspy import bmg, code, lz10, narc, rom
from pylz import lzs_encode
from vidua import bps
from zed.common import Game
from zed.zmb import ZMB
Expand Down Expand Up @@ -221,7 +222,7 @@ def open_zmb_files(
zmb_path = path[path.index('.bin/') + 5 :]
narc_file = narc.NARC(lz10.decompress(input_rom.getFileByName(narc_path)))
narc_file.setFileByName(zmb_path, zmb_file.save(game=Game.PhantomHourglass))
input_rom.setFileByName(narc_path, lz10.compress(narc_file.save()))
input_rom.setFileByName(narc_path, lzs_encode(narc_file.save()))


def _patch_zmb_map_objects(aux_data: list[Area], input_rom: rom.NintendoDSRom) -> None:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies = [
"ndspy@git+https://github.com/mike8699/ndspy.git@9d80480e8a3d65a389aac6f5d10978bd9113c977",
"ordered-set==4.1.0",
"pydantic==2.4.2",
"pylz@git+https://github.com/mike8699/pylz.git@f4b5dceea32d9bbd98a4baab94419e0483621307",
"pyparsing==3.1.1",
"vidua==0.4.5",
"zed@git+https://github.com/phst-randomizer/zed.git@e59a9653ea1344cbc147bab446821813200b9d19",
Expand Down

0 comments on commit 74a7011

Please sign in to comment.