{"id":19,"date":"2025-06-09T09:19:54","date_gmt":"2025-06-09T09:19:54","guid":{"rendered":"https:\/\/blogs.scummvm.org\/shivangnagta\/?p=19"},"modified":"2025-06-09T09:19:54","modified_gmt":"2025-06-09T09:19:54","slug":"week-1","status":"publish","type":"post","link":"https:\/\/blogs.scummvm.org\/shivangnagta\/2025\/06\/09\/week-1\/","title":{"rendered":"Week 1"},"content":{"rendered":"<p>Welcome to this week&#8217;s blog. Most of the time this week was spent fixing the portability of the Mac files. So the plan was to test the working of the mac files on both Python and C++ side. On checking the C++ side halfway through, we realised, that some code was broken and was giving incorrect results. So, Sev decided to take a look at it himself while I started working on the same task on the Python side.<\/p>\n<p>On the Python side, the code had three main issues:<\/p>\n<ul>\n<li>Not all Mac file variants were being covered.\n<p><figure id=\"attachment_20\" aria-describedby=\"caption-attachment-20\" style=\"width: 577px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-20 \" src=\"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.02.31\u202fPM.png\" alt=\"\" width=\"577\" height=\"62\" srcset=\"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.02.31\u202fPM.png 1608w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.02.31\u202fPM-300x32.png 300w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.02.31\u202fPM-1024x110.png 1024w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.02.31\u202fPM-768x82.png 768w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.02.31\u202fPM-1536x164.png 1536w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.02.31\u202fPM-1200x128.png 1200w\" sizes=\"auto, (max-width: 577px) 100vw, 577px\" \/><figcaption id=\"caption-attachment-20\" class=\"wp-caption-text\">Fig. 1 : 7 Mac file variants ( Image taken from macresman.cpp -&gt; MacResManager::open() )<\/figcaption><\/figure><\/li>\n<\/ul>\n<ul>\n<li>Instead of using the data section of the resource fork, the entire resource fork was being used for the checksum calculations, which was different from what the C++ side was doing.\n<p><figure id=\"attachment_21\" aria-describedby=\"caption-attachment-21\" style=\"width: 623px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-21\" src=\"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.04.26\u202fPM-scaled.png\" alt=\"\" width=\"623\" height=\"176\" srcset=\"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.04.26\u202fPM-scaled.png 2560w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.04.26\u202fPM-300x85.png 300w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.04.26\u202fPM-1024x289.png 1024w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.04.26\u202fPM-768x216.png 768w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.04.26\u202fPM-1536x433.png 1536w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.04.26\u202fPM-2048x577.png 2048w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.04.26\u202fPM-1200x338.png 1200w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.04.26\u202fPM-1980x558.png 1980w\" sizes=\"auto, (max-width: 623px) 100vw, 623px\" \/><figcaption id=\"caption-attachment-21\" class=\"wp-caption-text\">Fig. 2 : The data section of the resource fork had to be separately extracted<\/figcaption><\/figure><\/li>\n<li>There was no file filtering, which caused problems when Mac files were present &#8211; specifically, AppleDouble and raw resource fork files, which had their forks spread over multiple files. Instead of showing a single file entry with all the checksums, extra entries were incorrectly displayed as non-Mac files.<\/li>\n<\/ul>\n<figure id=\"attachment_22\" aria-describedby=\"caption-attachment-22\" style=\"width: 438px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-22\" src=\"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.05.21\u202fPM.png\" alt=\"\" width=\"438\" height=\"501\" srcset=\"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.05.21\u202fPM.png 1340w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.05.21\u202fPM-262x300.png 262w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.05.21\u202fPM-896x1024.png 896w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.05.21\u202fPM-768x878.png 768w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.05.21\u202fPM-1200x1372.png 1200w\" sizes=\"auto, (max-width: 438px) 100vw, 438px\" \/><figcaption id=\"caption-attachment-22\" class=\"wp-caption-text\">Fig. 3 : First file entry should not be a part of this game entry.<\/figcaption><\/figure>\n<p>I corrected all these issues. For filtering, I added 7 different categories for each file &#8211; NON_MAC, MAC_BINARY, <span style=\"font-family: 'Inter var', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, sans-serif;letter-spacing: -0.015em\">APPLE_DOUBLE_RSRC, <\/span><span style=\"font-family: 'Inter var', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, sans-serif;letter-spacing: -0.015em\">APPLE_DOUBLE_MACOSX, <\/span><span style=\"font-family: 'Inter var', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, sans-serif;letter-spacing: -0.015em\">APPLE_DOUBLE_DOT_, <\/span><span style=\"font-family: 'Inter var', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, sans-serif;letter-spacing: -0.015em\">RAW_RSRC and <\/span><span style=\"font-family: 'Inter var', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, sans-serif;letter-spacing: -0.015em\">ACTUAL_FORK_MAC.<\/span><\/p>\n<p>Fig. 4 shows consistent output for the all the mac file variants. Next task is to create proper test suites for its verification and check the workflow with the C++ side.<\/p>\n<figure id=\"attachment_23\" aria-describedby=\"caption-attachment-23\" style=\"width: 2560px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-23\" src=\"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.38.35\u202fPM-scaled.png\" alt=\"\" width=\"2560\" height=\"1419\" srcset=\"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.38.35\u202fPM-scaled.png 2560w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.38.35\u202fPM-300x166.png 300w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.38.35\u202fPM-1024x568.png 1024w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.38.35\u202fPM-768x426.png 768w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.38.35\u202fPM-1536x851.png 1536w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.38.35\u202fPM-2048x1135.png 2048w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.38.35\u202fPM-1200x665.png 1200w, https:\/\/blogs.scummvm.org\/shivangnagta\/wp-content\/uploads\/sites\/81\/2025\/06\/Screenshot-2025-06-09-at-2.38.35\u202fPM-1980x1097.png 1980w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><figcaption id=\"caption-attachment-23\" class=\"wp-caption-text\">Fig. 4 : Checksum calculation of all 7 macfile variants on python side<\/figcaption><\/figure>\n<p>Thank you for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to this week&#8217;s blog. Most of the time this week was spent fixing the portability of the Mac files. So the plan was to test the working of the mac files on both Python and C++ side. On checking the C++ side halfway through, we realised, that some code was broken and was giving [&hellip;]<\/p>\n","protected":false},"author":29,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-19","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-json\/wp\/v2\/posts\/19","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-json\/wp\/v2\/users\/29"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-json\/wp\/v2\/comments?post=19"}],"version-history":[{"count":1,"href":"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-json\/wp\/v2\/posts\/19\/revisions"}],"predecessor-version":[{"id":24,"href":"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-json\/wp\/v2\/posts\/19\/revisions\/24"}],"wp:attachment":[{"href":"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-json\/wp\/v2\/media?parent=19"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-json\/wp\/v2\/categories?post=19"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.scummvm.org\/shivangnagta\/wp-json\/wp\/v2\/tags?post=19"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}