Skip to content

Commit

Permalink
v0.19.7
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomiejduda committed Jun 7, 2024
1 parent 43dc579 commit 665e4e8
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 6 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ More info about EA Image file format can be found on [Xentax Wiki](https://web.a
| <center>13 / 0x0D</center> | <center>✔️</center> | <center>❌</center> | Cricket 2005 (PS2) <br> Cricket 2007 (PS2) |
| <center>14 / 0x0E</center> | <center>✔️</center> | <center>❌</center> | Cricket 2005 (PS2) <br>Cricket 2007 (PS2) <br>FIFA Street (PS2) <br>Fight Night Round 3 (PS2) <br>MVP 07 NCAA Baseball (PS2) <br>MVP Baseball 2005 (PS2) |
| <center>15 / 0x0F</center> | <center>✔️</center> | <center>❌</center> | ----- |
| <center>22 / 0x16</center> | <center>✔️</center> | <center>❌</center> | FIFA 09 (WII) |
| <center>24 / 0x18</center> | <center>✔️</center> | <center>❌</center> | ----- |
| <center>25 / 0x19</center> | <center>✔️</center> | <center>❌</center> | FIFA 09 (WII) |
| <center>34 / 0x22</center> | <center>✔️</center> | <center>❌</center> | Need For Speed (1994) (PC/DOS) |
| <center>35 / 0x23</center> | <center>✔️</center> | <center>❌</center> | FIFA 2000 (PS1) <br>NBA Live 97 (PS1) |
| <center>59 / 0x3B</center> | <center>✔️</center> | <center>❌</center> | Madden NFL 08 (PSP) <br> Need For Speed: Undercover (PSP) |
Expand All @@ -60,13 +63,13 @@ More info about EA Image file format can be found on [Xentax Wiki](https://web.a
| <center>92 / 0x5C</center> | <center>✔️</center> | <center>❌</center> | FIFA 2006 (PSP) <br> Madden NFL 08 (PSP) <br> Need For Speed: Undercover (PSP) <br>NHL 07 (PSP) |
| <center>93 / 0x5D</center> | <center>✔️</center> | <center>❌</center> | FIFA 14 (PSP) <br> FIFA 2006 (PSP) <br> FIFA 2009 (PSP) <br> Fight Night Round 3 (PSP) <br> Madden NFL 08 (PSP) <br> Need For Speed: Undercover (PSP) <br>NHL 07 (PSP) |
| <center>96 / 0x60</center> | <center>✔️</center> | <center>❌</center> | Need For Speed: Hot Pursuit 2 (PC) <br> SimCity 4 Deluxe (PC) <br>UEFA Euro 2004 (PC/XBOX) |
| <center>97 / 0x61</center> | <center>✔️</center> | <center>❌</center> | Need For Speed: Hot Pursuit 2 (PC) <br> SimCity 4 Deluxe (PC) <br>UEFA Euro 2004 (XBOX) |
| <center>97 / 0x61</center> | <center>✔️</center> | <center>❌</center> | Medal of Honor: European Assault (XBOX) <br>Need For Speed: Hot Pursuit 2 (PC) <br> SimCity 4 Deluxe (PC) <br>UEFA Euro 2004 (XBOX) |
| <center>109 / 0x6D</center> | <center>✔️</center> | <center>❌</center> | Need For Speed: Porsche Unleashed (PC) <br>UEFA Euro 2004 (PC/XBOX) |
| <center>115 / 0x73</center> | <center>✔️</center> | <center>❌</center> | Need for Speed Carbon: Own the City (PSP/Zeebo) |
| <center>119 / 0x77</center> | <center>✔️</center> | <center>❌</center> | Need for Speed Carbon: Own the City (PSP/Zeebo) |
| <center>120 / 0x78</center> | <center>✔️</center> | <center>❌</center> | Need For Speed: Porsche Unleashed (PC) <br> Need For Speed II (PC) <br> Need For Speed III: Hot Pursuit (PC) <br> Need For Speed: High Stakes (PC) <br>UEFA Euro 2004 (XBOX) <br>Triple Play 2000 (PC) |
| <center>121 / 0x79</center> | <center>✔️</center> | <center>❌</center> | Harry Potter: Quidditch World Cup (PC) |
| <center>123 / 0x7B</center> | <center>✔️</center> | <center>❌</center> | SimCity 4 Deluxe (PC) <br> Need For Speed (1994) (PC/DOS) <br> Need For Speed: Hot Pursuit 2 (PC) <br> Need For Speed: Porsche Unleashed (PC) <br> Need For Speed II (PC) <br> Need For Speed III: Hot Pursuit (PC) <br> Need For Speed: High Stakes (PC) <br>UEFA Euro 2004 (PC/XBOX) <br>Triple Play 2000 (PC) <br>Harry Potter: Quidditch World Cup (PC) <br>FIFA Soccer 97 (PC) |
| <center>123 / 0x7B</center> | <center>✔️</center> | <center>❌</center> | SimCity 4 Deluxe (PC) <br> Medal of Honor: European Assault (XBOX) <br>Need For Speed (1994) (PC/DOS) <br> Need For Speed: Hot Pursuit 2 (PC) <br> Need For Speed: Porsche Unleashed (PC) <br> Need For Speed II (PC) <br> Need For Speed III: Hot Pursuit (PC) <br> Need For Speed: High Stakes (PC) <br>UEFA Euro 2004 (PC/XBOX) <br>Triple Play 2000 (PC) <br>Harry Potter: Quidditch World Cup (PC) <br>FIFA Soccer 97 (PC) |
| <center>125 / 0x7D</center> | <center>✔️</center> | <center>❌</center> | Need For Speed: Hot Pursuit 2 (PC) <br> Need For Speed: Porsche Unleashed (PC) <br> SimCity 4 Deluxe (PC) <br> Need For Speed II (PC) <br> Need For Speed III: Hot Pursuit (PC) <br> Need For Speed: High Stakes (PC) <br>UEFA Euro 2004 (PC/XBOX) <br>Triple Play 2000 (PC) <br>Harry Potter: Quidditch World Cup (PC) |
| <center>126 / 0x7E</center> | <center>✔️</center> | <center>❌</center> | Need For Speed III: Hot Pursuit (PC) <br> Need For Speed: High Stakes (PC) <br>UEFA Euro 2004 (PC/XBOX) <br>Triple Play 2000 (PC) |
| <center>127 / 0x7F</center> | <center>✔️</center> | <center>❌</center> | SimCity 4 Deluxe (PC) <br> Need For Speed II (PC) <br> Need For Speed III: Hot Pursuit (PC) <br> Need For Speed: High Stakes (PC) |
Expand Down
1 change: 1 addition & 0 deletions src/EA_Image/bin_attachment_entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class BinAttachmentEntry(DirEntry):
41: "palette 0x29",
42: "palette 0x2A",
45: "palette 0x2D",
50: "palette 0x32",
58: "palette 0x3A",
59: "palette 0x3B",
105: "metal bin",
Expand Down
4 changes: 2 additions & 2 deletions src/EA_Image/constants.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# EA Image constants

# fmt: off
PALETTE_TYPES = (33, 34, 35, 36, 41, 42, 45, 58, 59)
CONVERT_IMAGES_SUPPORTED_TYPES = [1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 33, 34, 35, 59, 64, 65, 66, 67, 88, 89, 90, 91, 92, 93, 96, 97, 98,
PALETTE_TYPES = (33, 34, 35, 36, 41, 42, 45, 50, 58, 59)
CONVERT_IMAGES_SUPPORTED_TYPES = [1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 22, 24, 25, 33, 34, 35, 59, 64, 65, 66, 67, 88, 89, 90, 91, 92, 93, 96, 97, 98,
104, 109, 115, 119, 120, 121, 123, 125, 126, 127, 130, 131, 192, 193, 194, 237, 248, 251]
# fmt: on
4 changes: 4 additions & 0 deletions src/EA_Image/dir_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ class DirEntry:
13: "13 | 0x0D | GST 222",
14: "14 | 0x0E | GST 422",
15: "15 | 0x0F | GST 822",
22: "22 | 0x16 | ABGR8888",
24: "24 | 0x18 | PAL4_RGB565",
25: "25 | 0x19 | PAL8_RGB565",
33: "33 | 0x21 | PALETTE",
34: "34 | 0x22 | PALETTE",
35: "35 | 0x23 | PALETTE",
36: "36 | 0x24 | PALETTE",
41: "41 | 0x29 | PALETTE",
42: "42 | 0x2A | PALETTE",
45: "45 | 0x2D | PALETTE",
50: "50 | 0x32 | PALETTE",
58: "58 | 0x3A | PALETTE",
59: "59 | 0x3B | PALETTE",
64: "64 | 0x40 | PAL4_RGBX5551",
Expand Down
29 changes: 28 additions & 1 deletion src/EA_Image/ea_image_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ def parse_header(self, in_file, in_file_path, in_file_name):
self.f_endianess = "<"
self.f_endianess_desc = "little"

if self.sign == "SHPG": # fix for GameCube/WII files, endianess can't be determined by file size there
self.f_endianess = ">"
self.f_endianess_desc = "big"

self.num_of_entries = struct.unpack(self.f_endianess + "L", in_file.read(4))[0]
self.dir_id = in_file.read(4).decode("utf8")
# fmt: on
Expand Down Expand Up @@ -319,8 +323,11 @@ def _get_image_format_by_palette_size(palette_size: int) -> ImageFormats:
image_data = unswizzle_ps2_4bit(image_data, ea_dir_entry.h_width, ea_dir_entry.h_height)
elif get_bpp_for_image_type(entry_type) == 8:
image_data = unswizzle_ps2_8bit(image_data, ea_dir_entry.h_width, ea_dir_entry.h_height)
elif self.sign == "SHPG": # for WII/GameCube games
# TODO - implement WII/GameCube swizzling
logger.warning("Image swizzled, but WII/GameCube swizzling is not implemented yet!")
else:
pass # TODO - implement other swizzling methods
pass # image is not swizzled

if entry_type == 1:
palette_data = _get_palette_data_from_dir_entry(ea_dir_entry)
Expand Down Expand Up @@ -446,6 +453,26 @@ def _get_image_format_by_palette_size(palette_size: int) -> ImageFormats:
_get_image_format_by_palette_size(len(palette_data)),
is_swizzled=convert_int_to_bool(ea_dir_entry.h_flag2_swizzled),
)
elif entry_type == 22:
ea_dir_entry.img_convert_data = ea_image_decoder.decode_image(
image_data, ea_dir_entry.h_width, ea_dir_entry.h_height, ImageFormats.ABGR8888
)
elif entry_type == 24:
ea_dir_entry.img_convert_data = ea_image_decoder.decode_indexed_image(
image_data,
_get_palette_data_from_dir_entry(ea_dir_entry),
ea_dir_entry.h_width,
ea_dir_entry.h_height,
ImageFormats.PAL4_RGB565, # TODO - not decoding correctly
)
elif entry_type == 25:
ea_dir_entry.img_convert_data = ea_image_decoder.decode_indexed_image(
image_data,
_get_palette_data_from_dir_entry(ea_dir_entry),
ea_dir_entry.h_width,
ea_dir_entry.h_height,
ImageFormats.PAL8_RGB565, # TODO - not decoding correctly
)
elif entry_type == 33:
ea_dir_entry.img_convert_data = image_data # palette
elif entry_type == 34:
Expand Down
2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from src.GUI.GUI_main import EAManGui

VERSION_NUM = "v0.19.6"
VERSION_NUM = "v0.19.7"

logger = get_logger("main")

Expand Down

0 comments on commit 665e4e8

Please sign in to comment.