ReverseBox 0.26.7__tar.gz → 0.26.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {reversebox-0.26.7 → reversebox-0.26.8}/PKG-INFO +1 -1
- {reversebox-0.26.7 → reversebox-0.26.8}/ReverseBox.egg-info/PKG-INFO +1 -1
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/swizzle_psvita_dreamcast.py +18 -18
- {reversebox-0.26.7 → reversebox-0.26.8}/setup.py +1 -1
- {reversebox-0.26.7 → reversebox-0.26.8}/LICENSE +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/README.md +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/ReverseBox.egg-info/SOURCES.txt +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/ReverseBox.egg-info/dependency_links.txt +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/ReverseBox.egg-info/requires.txt +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/ReverseBox.egg-info/top_level.txt +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/checksum/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/checksum/checksum_adler32.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/checksum/checksum_cocos2d_pvr.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/checksum/checksum_fletcher16.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/checksum/checksum_fletcher32.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/checksum/checksum_internet_ipv4_header.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/checksum/checksum_sum8.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/checksum/checksum_sum8_2s_complement.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/checksum/checksum_unix_sum_bsd16.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/checksum/checksum_unix_sum_sysv.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/checksum/checksum_xor8.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/common/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/common/common.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/common/logger.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/common/numpy_helper_functions.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/compression/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/compression/compression_jcalg1.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/compression/compression_lzo.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/compression/compression_mio0.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/compression/compression_refpack.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/compression/compression_zlib.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/crc16_arc.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/crc16_ccitt.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/crc16_dnp.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/crc16_ea_crcf.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/crc16_kermit.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/crc16_modbus.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/crc16_sick.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/crc32_asobo.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/crc32_iso_hdlc.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/crc64_asobo.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/crc64_go_iso.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/crc8.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/crc/crc_unix_cksum.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/encryption/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/encryption/encryption_hatch_engine.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/encryption/encryption_rot13.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/encryption/encryption_xor_basic.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/encryption/encryption_xor_basic_key_guesser.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/encryption/encryption_xor_gianas_return_zda.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/encryption/encryption_xor_retro64_eco.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/hash/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/hash/hash_additive.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/hash/hash_ap.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/hash/hash_djb2.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/hash/hash_fnv.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/hash/hash_jenkins_one_at_a_time.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/hash/hash_md2.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/hash/hash_md5.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/hash/hash_murmur3.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/hash/hash_pivotal_games_dat.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/hash/hash_sdbm.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/hash/hash_sha1.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/hash/hash_sha2.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/common.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/compression/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/compression/compression_gst.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/compression/compression_lzw.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/compression/compression_packbits.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/compression/compression_rle_executioners.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/compression/compression_rle_tga.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/compression/compression_zlib.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/decoders/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/decoders/bumpmap_decoder.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/decoders/compressed_decoder.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/decoders/gst_decoder.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/decoders/n64_decoder.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/decoders/yuv_decoder.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/encoders/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/encoders/gst_encoder.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/file_formats/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/file_formats/image_dds.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/image_decoder.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/image_encoder.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/image_formats.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/palettes/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/palettes/palette_random.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/palettes/palette_vga.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/pillow_wrapper.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/swizzle_3ds.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/swizzle_bc.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/swizzle_cmpr.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/swizzle_gamecube.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/swizzle_gst.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/swizzle_morton.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/swizzle_morton_ps4.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/swizzle_ps2.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/swizzle_psp.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/swizzle_switch.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/swizzle_x360.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/io_files/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/io_files/bytes_handler.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/io_files/bytes_helper_functions.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/io_files/check_file.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/io_files/file_handler.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/io_files/mod_handler.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/io_files/translation_text_handler.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/libs/DirectXTex.dll +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/libs/__init__.py +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/libs/ea_swizzle.dll +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/reversebox/libs/refpack.dll +0 -0
- {reversebox-0.26.7 → reversebox-0.26.8}/setup.cfg +0 -0
{reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/swizzling/swizzle_psvita_dreamcast.py
RENAMED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"""
|
|
2
|
-
Copyright © 2024 Bartłomiej Duda
|
|
2
|
+
Copyright © 2024-2025 Bartłomiej Duda
|
|
3
3
|
License: GPL-3.0 License
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
+
import numpy as np
|
|
7
|
+
|
|
6
8
|
# fmt: off
|
|
7
9
|
|
|
8
|
-
#
|
|
10
|
+
# Dreamcast and PS Vita Texture Swizzling
|
|
11
|
+
# Morton Order (+ rotate by 90 degrees)
|
|
9
12
|
# https://en.wikipedia.org/wiki/Z-order_curve
|
|
10
13
|
# https://dreamcast.wiki/Twiddling
|
|
11
14
|
|
|
@@ -17,16 +20,14 @@ License: GPL-3.0 License
|
|
|
17
20
|
# - Senran Kagura: Shinovi Versus (PS Vita) (*.GXT)
|
|
18
21
|
|
|
19
22
|
|
|
20
|
-
def bsr(
|
|
23
|
+
def bsr(value: int) -> int:
|
|
21
24
|
"""bit scan reverse"""
|
|
22
|
-
if
|
|
23
|
-
raise ValueError("bsr is undefined for 0")
|
|
24
|
-
return x.bit_length() - 1
|
|
25
|
+
return int(np.floor(np.log2(value))) if value > 0 else 0
|
|
25
26
|
|
|
26
27
|
|
|
27
28
|
def enclosing_power_of_2(x: int) -> int:
|
|
28
|
-
"""find power of 2 equal or bigger than x"""
|
|
29
|
-
return 1 <<
|
|
29
|
+
"""find the smallest power of 2 equal or bigger than x"""
|
|
30
|
+
return 1 << int(np.ceil(np.log2(x)))
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
def align(value: int, alignment: int) -> int:
|
|
@@ -35,20 +36,20 @@ def align(value: int, alignment: int) -> int:
|
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
def get_morton_index_psvita_dreamcast(x: int, y: int, width: int, height: int) -> int:
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
d = min(
|
|
41
|
-
|
|
39
|
+
log_w = bsr(width)
|
|
40
|
+
log_h = bsr(height)
|
|
41
|
+
d = min(log_w, log_h)
|
|
42
|
+
m = 0
|
|
42
43
|
|
|
43
44
|
for i in range(d):
|
|
44
|
-
|
|
45
|
+
m |= ((x & (1 << i)) << (i + 1)) | ((y & (1 << i)) << i)
|
|
45
46
|
|
|
46
47
|
if width < height:
|
|
47
|
-
|
|
48
|
+
m |= ((y & ~(width - 1)) << d)
|
|
48
49
|
else:
|
|
49
|
-
|
|
50
|
+
m |= ((x & ~(height - 1)) << d)
|
|
50
51
|
|
|
51
|
-
return
|
|
52
|
+
return m
|
|
52
53
|
|
|
53
54
|
|
|
54
55
|
def _convert_psvita_dreamcast_4bpp(pixel_data: bytes, img_width: int, img_height: int, swizzle_flag: bool) -> bytes:
|
|
@@ -95,16 +96,15 @@ def _convert_psvita_dreamcast(pixel_data: bytes, img_width: int, img_height: int
|
|
|
95
96
|
pixel_size = bpp // 8
|
|
96
97
|
|
|
97
98
|
oy = 0
|
|
98
|
-
dest_offset = 0
|
|
99
99
|
for y in range(img_height):
|
|
100
100
|
ox = 0
|
|
101
101
|
for x in range(img_width):
|
|
102
102
|
src_offset = (ox + oy) * pixel_size
|
|
103
|
+
dest_offset = (y * img_width + x) * pixel_size
|
|
103
104
|
if not swizzle_flag:
|
|
104
105
|
converted_data[dest_offset:dest_offset + pixel_size] = pixel_data[src_offset:src_offset + pixel_size]
|
|
105
106
|
else:
|
|
106
107
|
converted_data[src_offset:src_offset + pixel_size] = pixel_data[dest_offset:dest_offset + pixel_size]
|
|
107
|
-
dest_offset += pixel_size
|
|
108
108
|
|
|
109
109
|
ox = (ox - mx) & mx
|
|
110
110
|
oy = (oy - my) & my
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{reversebox-0.26.7 → reversebox-0.26.8}/reversebox/checksum/checksum_internet_ipv4_header.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{reversebox-0.26.7 → reversebox-0.26.8}/reversebox/encryption/encryption_xor_basic_key_guesser.py
RENAMED
|
File without changes
|
{reversebox-0.26.7 → reversebox-0.26.8}/reversebox/encryption/encryption_xor_gianas_return_zda.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/compression/compression_packbits.py
RENAMED
|
File without changes
|
{reversebox-0.26.7 → reversebox-0.26.8}/reversebox/image/compression/compression_rle_executioners.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|