hacktools 0.38.3__tar.gz → 0.38.5__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.
Files changed (33) hide show
  1. {hacktools-0.38.3 → hacktools-0.38.5}/LICENSE +1 -1
  2. {hacktools-0.38.3/hacktools.egg-info → hacktools-0.38.5}/PKG-INFO +1 -1
  3. hacktools-0.38.5/hacktools/__init__.py +1 -0
  4. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/common.py +5 -1
  5. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/nitro.py +8 -2
  6. {hacktools-0.38.3 → hacktools-0.38.5/hacktools.egg-info}/PKG-INFO +1 -1
  7. hacktools-0.38.3/hacktools/__init__.py +0 -1
  8. {hacktools-0.38.3 → hacktools-0.38.5}/MANIFEST.in +0 -0
  9. {hacktools-0.38.3 → hacktools-0.38.5}/README.md +0 -0
  10. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/arch.py +0 -0
  11. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/assets/icon.png +0 -0
  12. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/c_ext/cmp_cri.c +0 -0
  13. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/c_ext/cmp_lzss.c +0 -0
  14. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/c_ext/cmp_misc.c +0 -0
  15. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/c_ext/cmp_racjin.c +0 -0
  16. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/c_ext/inc.h +0 -0
  17. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/compression.py +0 -0
  18. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/cpk.py +0 -0
  19. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/gb.py +0 -0
  20. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/gui.py +0 -0
  21. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/nasm.py +0 -0
  22. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/nds.py +0 -0
  23. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/psp.py +0 -0
  24. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/psx.py +0 -0
  25. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/wii.py +0 -0
  26. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools/ws.py +0 -0
  27. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools.egg-info/SOURCES.txt +0 -0
  28. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools.egg-info/dependency_links.txt +0 -0
  29. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools.egg-info/requires.txt +0 -0
  30. {hacktools-0.38.3 → hacktools-0.38.5}/hacktools.egg-info/top_level.txt +0 -0
  31. {hacktools-0.38.3 → hacktools-0.38.5}/setup.cfg +0 -0
  32. {hacktools-0.38.3 → hacktools-0.38.5}/setup.py +0 -0
  33. {hacktools-0.38.3 → hacktools-0.38.5}/tests/test_cmp.py +0 -0
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2020-2024 Illidan
3
+ Copyright (c) 2020-2025 Illidan
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: hacktools
3
- Version: 0.38.3
3
+ Version: 0.38.5
4
4
  Summary: A set of utilities and tools for rom hacking and translations.
5
5
  Home-page: https://github.com/Illidanz/hacktools
6
6
  Author: Illidan
@@ -0,0 +1 @@
1
+ __version__ = "0.38.5"
@@ -504,7 +504,7 @@ def logDebug(*messages):
504
504
 
505
505
  def logWarning(*messages):
506
506
  message = " ".join(str(x) for x in messages)
507
- logging.debug("[WARNING]" + message)
507
+ logging.debug("[WARNING] " + message)
508
508
 
509
509
 
510
510
  def logError(*messages):
@@ -1001,6 +1001,10 @@ def writeEncodedString(f, s, maxlen=0, encoding="shift_jis", zerobytes=1):
1001
1001
  i += 2
1002
1002
  x += 1
1003
1003
  if zerobytes > 0:
1004
+ if zerobytes > 1:
1005
+ if maxlen > 0 and i+1 > maxlen:
1006
+ return -1
1007
+ i += zerobytes - 1
1004
1008
  f.writeZero(zerobytes)
1005
1009
  return i
1006
1010
 
@@ -1007,7 +1007,7 @@ def writeNCGR(file, ncgr, infile, palettes, width=-1, height=-1):
1007
1007
  writeNCGRTile(f, pixels, width, ncgr, i, j, palettes[0])
1008
1008
 
1009
1009
 
1010
- def writeNSCR(file, ncgr, nscr, infile, palettes, width=-1, height=-1):
1010
+ def writeNSCR(file, ncgr, nscr, infile, palettes, width=-1, height=-1, skipfirst=False):
1011
1011
  try:
1012
1012
  from PIL import Image
1013
1013
  except ImportError:
@@ -1029,10 +1029,16 @@ def writeNSCR(file, ncgr, nscr, infile, palettes, width=-1, height=-1):
1029
1029
  if map.xflip or map.yflip:
1030
1030
  x += 1
1031
1031
  continue
1032
+ if skipfirst and x == 0:
1033
+ x += 1
1034
+ continue
1032
1035
  # Write the tile if it's a new one
1033
1036
  if map.tile not in donetiles:
1034
1037
  donetiles.append(map.tile)
1035
- f.seek(ncgr.tileoffset + map.tile * (8 * ncgr.bpp))
1038
+ tilenum = map.tile
1039
+ if skipfirst:
1040
+ tilenum -= 1
1041
+ f.seek(ncgr.tileoffset + tilenum * (8 * ncgr.bpp))
1036
1042
  writeNCGRTile(f, pixels, width, ncgr, i, j, palettes[map.pal])
1037
1043
  x += 1
1038
1044
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: hacktools
3
- Version: 0.38.3
3
+ Version: 0.38.5
4
4
  Summary: A set of utilities and tools for rom hacking and translations.
5
5
  Home-page: https://github.com/Illidanz/hacktools
6
6
  Author: Illidan
@@ -1 +0,0 @@
1
- __version__ = "0.38.3"
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