@@ -30,6 +30,8 @@ int FF7SaveInfo::fileSize(FF7SaveInfo::FORMAT format)
3030 case FORMAT::VMC: return get ()->d ->VMC_FILE_SIZE ;
3131 case FORMAT::PSP: return get ()->d ->PSP_FILE_SIZE ;
3232 case FORMAT::PS3: return get ()->d ->PS3_FILE_SIZE ;
33+ case FORMAT::PS4: return get ()->d ->PS4_FILE_SIZE ;
34+ case FORMAT::PS4BIN: return get ()->d ->PS4_BINFILE_SIZE ;
3335 case FORMAT::DEX: return get ()->d ->DEX_FILE_SIZE ;
3436 case FORMAT::VGS: return get ()->d ->VGS_FILE_SIZE ;
3537 case FORMAT::SWITCH: return get ()->d ->SWITCH_FILE_SIZE ;
@@ -46,6 +48,8 @@ int FF7SaveInfo::fileHeaderSize(FF7SaveInfo::FORMAT format)
4648 case FORMAT::VMC: return get ()->d ->VMC_FILE_HEADER_SIZE ;
4749 case FORMAT::PSP: return get ()->d ->PSP_FILE_HEADER_SIZE ;
4850 case FORMAT::PS3: return get ()->d ->PS3_FILE_HEADER_SIZE ;
51+ case FORMAT::PS4: return get ()->d ->PS4_FILE_HEADER_SIZE ;
52+ case FORMAT::PS4BIN: return get ()->d ->PS4_BINFILE_FILE_ID_SIZE ;
4953 case FORMAT::DEX: return get ()->d ->DEX_FILE_HEADER_SIZE ;
5054 case FORMAT::VGS: return get ()->d ->VGS_FILE_HEADER_SIZE ;
5155 case FORMAT::SWITCH: return get ()->d ->SWITCH_FILE_HEADER_SIZE ;
@@ -62,6 +66,7 @@ int FF7SaveInfo::slotHeaderSize(FF7SaveInfo::FORMAT format)
6266 case FORMAT::VMC:
6367 case FORMAT::PSP:
6468 case FORMAT::PS3:
69+ case FORMAT::PS4:
6570 case FORMAT::DEX:
6671 case FORMAT::PGE:
6772 case FORMAT::PDA:
@@ -77,6 +82,7 @@ int FF7SaveInfo::slotFooterSize(FF7SaveInfo::FORMAT format)
7782 case FORMAT::VMC:
7883 case FORMAT::PSP:
7984 case FORMAT::PS3:
85+ case FORMAT::PS4:
8086 case FORMAT::DEX:
8187 case FORMAT::PGE:
8288 case FORMAT::PDA:
@@ -91,7 +97,8 @@ int FF7SaveInfo::slotCount(FF7SaveInfo::FORMAT format)
9197 case FORMAT::PDA:
9298 case FORMAT::PGE:
9399 case FORMAT::PSX:
94- case FORMAT::PS3: return 1 ;
100+ case FORMAT::PS3:
101+ case FORMAT::PS4: return 1 ;
95102 case FORMAT::VMC:
96103 case FORMAT::PSP:
97104 case FORMAT::DEX:
@@ -110,6 +117,8 @@ QByteArray FF7SaveInfo::fileIdentifier(FF7SaveInfo::FORMAT format)
110117 case FORMAT::VMC: return get ()->d ->VMC_FILE_ID ;
111118 case FORMAT::PSP: return get ()->d ->PSP_FILE_ID ;
112119 case FORMAT::PS3: return get ()->d ->PS3_FILE_ID ;
120+ case FORMAT::PS4: return get ()->d ->PS4_FILE_ID ;
121+ case FORMAT::PS4BIN: return get ()->d ->PS4_BINFILE_FILE_ID ;
113122 case FORMAT::DEX: return get ()->d ->DEX_FILE_ID ;
114123 case FORMAT::VGS: return get ()->d ->VGS_FILE_ID ;
115124 case FORMAT::SWITCH: return get ()->d ->SWITCH_FILE_ID ;
@@ -127,6 +136,7 @@ QByteArray FF7SaveInfo::fileHeader(FF7SaveInfo::FORMAT format)
127136 case FORMAT::VMC: return QByteArray (fileIdentifier (format)).append (fileHeaderSize (format) - fileIdentifier (format).length (), 0x00 );
128137 case FORMAT::PSP: return get ()->d ->PSP_FILE_HEADER ;
129138 case FORMAT::PS3: return get ()->d ->PS3_FILE_HEADER ;
139+ case FORMAT::PS4: return get ()->d ->PS4_FILE_HEADER ;
130140 default : return QByteArray ();
131141 }
132142}
@@ -140,6 +150,7 @@ QByteArray FF7SaveInfo::slotHeader(FF7SaveInfo::FORMAT format, int slot)
140150 case FORMAT::PSX:
141151 case FORMAT::PSP:
142152 case FORMAT::PS3:
153+ case FORMAT::PS4:
143154 case FORMAT::DEX:
144155 case FORMAT::VGS:
145156 case FORMAT::VMC: return QByteArray (get ()->d ->PSX_SLOT_HEADER .at (slot)).append (256 , 0x00 );
@@ -155,6 +166,7 @@ QByteArray FF7SaveInfo::slotFooter(FF7SaveInfo::FORMAT format)
155166 case FORMAT::PSX:
156167 case FORMAT::PSP:
157168 case FORMAT::PS3:
169+ case FORMAT::PS4:
158170 case FORMAT::DEX:
159171 case FORMAT::VGS:
160172 case FORMAT::VMC: return QByteArray (get ()->d ->PSX_SLOT_FOOTER_SIZE , 0x00 );
@@ -167,6 +179,7 @@ QByteArray FF7SaveInfo::signingKey(FF7SaveInfo::FORMAT format)
167179 switch (format) {
168180 case FORMAT::PSP:
169181 case FORMAT::PS3: return get ()->d ->PS_SIGNING_KEY ;
182+ case FORMAT::PS4: return get ()->d ->PS4_SIGNING_KEY ;
170183 default : return QByteArray ();
171184 }
172185}
@@ -187,6 +200,7 @@ QByteArray FF7SaveInfo::signingIV(FF7SaveInfo::FORMAT format)
187200 switch (format) {
188201 case FORMAT::PSP:
189202 case FORMAT::PS3: return get ()->d ->PS_SIGNING_IV ;
203+ case FORMAT::PS4: return get ()->d ->PS4_SIGNING_IV ;
190204 default : return QByteArray ();
191205 }
192206}
@@ -196,6 +210,7 @@ int FF7SaveInfo::fileSeedOffset(FF7SaveInfo::FORMAT format)
196210 switch (format) {
197211 case FORMAT::PSP: return get ()->d ->PSP_SEED_OFFSET ;
198212 case FORMAT::PS3: return get ()->d ->PS3_SEED_OFFSET ;
213+ case FORMAT::PS4: return get ()->d ->PS4_SEED_OFFSET ;
199214 default : return -1 ;
200215 }
201216}
@@ -205,6 +220,7 @@ int FF7SaveInfo::fileSignatureOffset(FF7SaveInfo::FORMAT format)
205220 switch (format) {
206221 case FORMAT::PSP: return get ()->d ->PSP_SIGNATURE_OFFSET ;
207222 case FORMAT::PS3: return get ()->d ->PS3_SIGNATURE_OFFSET ;
223+ case FORMAT::PS4: return get ()->d ->PS4_SIGNATURE_OFFSET ;
208224 default : return -1 ;
209225 }
210226}
@@ -214,6 +230,7 @@ int FF7SaveInfo::fileSignatureSize(FF7SaveInfo::FORMAT format)
214230 switch (format) {
215231 case FORMAT::PSP:
216232 case FORMAT::PS3: return get ()->d ->PS_SIGNATURE_SIZE ;
233+ case FORMAT::PS4: return get ()->d ->PS4_SIGNATURE_SIZE ;
217234 default : return 0 ;
218235 }
219236}
@@ -230,6 +247,7 @@ QRegularExpression FF7SaveInfo::validNames(FF7SaveInfo::FORMAT format)
230247 case FORMAT::PSX: return get ()->d ->PSX_VALID_NAME_REGEX ;
231248 case FORMAT::PSP: return get ()->d ->PSP_VALID_NAME_REGEX ;
232249 case FORMAT::PS3: return get ()->d ->PS3_VALID_NAME_REGEX ;
250+ case FORMAT::PS4: return get ()->d ->PS4_VALID_NAME_REGEX ;
233251 case FORMAT::DEX: return get ()->d ->DEX_VALID_NAME_REGEX ;
234252 case FORMAT::VGS: return get ()->d ->VGS_VALID_NAME_REGEX ;
235253 case FORMAT::VMC: return get ()->d ->VMC_VALID_NAME_REGEX ;
@@ -247,6 +265,7 @@ QString FF7SaveInfo::typeDescription(FF7SaveInfo::FORMAT format)
247265 case FORMAT::PSX: return tr (get ()->d ->PSX_FILE_DESCRIPTION .toUtf8 ());
248266 case FORMAT::PSP: return tr (get ()->d ->PSP_FILE_DESCRIPTION .toUtf8 ());
249267 case FORMAT::PS3: return tr (get ()->d ->PS3_FILE_DESCRIPTION .toUtf8 ());
268+ case FORMAT::PS4: return tr (get ()->d ->PS4_FILE_DESCRIPTION .toUtf8 ());
250269 case FORMAT::DEX: return tr (get ()->d ->DEX_FILE_DESCRIPTION .toUtf8 ());
251270 case FORMAT::VGS: return tr (get ()->d ->VGS_FILE_DESCRIPTION .toUtf8 ());
252271 case FORMAT::VMC: return tr (get ()->d ->VMC_FILE_DESCRIPTION .toUtf8 ());
@@ -264,6 +283,7 @@ QStringList FF7SaveInfo::typeExtension(FF7SaveInfo::FORMAT format)
264283 case FORMAT::PSX: return get ()->d ->PSX_VALID_EXTENSIONS ;
265284 case FORMAT::PSP: return get ()->d ->PSP_VALID_EXTENSIONS ;
266285 case FORMAT::PS3: return get ()->d ->PS3_VALID_EXTENSIONS ;
286+ case FORMAT::PS4: return get ()->d ->PS4_VALID_EXTENSIONS ;
267287 case FORMAT::DEX: return get ()->d ->DEX_VALID_EXTENSIONS ;
268288 case FORMAT::VGS: return get ()->d ->VGS_VALID_EXTENSIONS ;
269289 case FORMAT::VMC: return get ()->d ->VMC_VALID_EXTENSIONS ;
@@ -284,25 +304,27 @@ QString FF7SaveInfo::typeFilter(FF7SaveInfo::FORMAT format)
284304QString FF7SaveInfo::knownTypesFilter ()
285305{
286306 QString space = QStringLiteral (" " );
287- QString allTypes = QStringLiteral (" %1 %2 %3 %4 %5 %6 %7 %8 %9 %10" )
307+ QString allTypes = QStringLiteral (" %1 %2 %3 %4 %5 %6 %7 %8 %9 %10 %11 " )
288308 .arg (get ()->d ->PC_VALID_EXTENSIONS .join (space)
289309 , get ()->d ->PSX_VALID_EXTENSIONS .join (space)
290310 , get ()->d ->PSP_VALID_EXTENSIONS .join (space)
291311 , get ()->d ->PS3_VALID_EXTENSIONS .join (space)
312+ , get ()->d ->PS4_VALID_EXTENSIONS .join (space)
292313 , get ()->d ->DEX_VALID_EXTENSIONS .join (space)
293314 , get ()->d ->VGS_VALID_EXTENSIONS .join (space)
294315 , get ()->d ->VMC_VALID_EXTENSIONS .join (space)
295316 , get ()->d ->SWITCH_VALID_EXTENSIONS .join (space)
296317 , get ()->d ->PGE_VALID_EXTENSIONS .join (space)
297318 , get ()->d ->PDA_VALID_EXTENSIONS .join (space));
298319
299- return QStringLiteral (" %1;;%2;;%3;;%4;;%5;;%6;;%7;;%8;;%9;;%10;;%11;;%12" )
320+ return QStringLiteral (" %1;;%2;;%3;;%4;;%5;;%6;;%7;;%8;;%9;;%10;;%11;;%12;;%13 " )
300321 .arg (tr (" Known FF7 Save Types (%1)" ).arg (allTypes)
301322 , typeFilter (FORMAT::PC)
302323 , typeFilter (FORMAT::SWITCH)
303324 , typeFilter (FORMAT::VMC)
304325 , typeFilter (FORMAT::PSX)
305326 , typeFilter (FORMAT::PS3)
327+ , typeFilter (FORMAT::PS4)
306328 , typeFilter (FORMAT::PSP)
307329 , typeFilter (FORMAT::DEX)
308330 , typeFilter (FORMAT::VGS)
@@ -315,6 +337,7 @@ bool FF7SaveInfo::isTypePC(FF7SaveInfo::FORMAT format)
315337{
316338 switch (format) {
317339 case FORMAT::SWITCH:
340+ case FORMAT::PS4:
318341 case FORMAT::PC: return true ;
319342 default : return false ;
320343 };
@@ -368,4 +391,3 @@ QByteArray FF7SaveInfo::defaultSaveData()
368391{
369392 return get ()->d ->DEFAULT_SAVE ;
370393}
371-
0 commit comments