Skip to content

Commit da14e26

Browse files
committed
feat: FF7SaveInfo: Add RZIP format info
1 parent e27dc3f commit da14e26

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/data/FF7SaveInfo.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ int FF7SaveInfo::fileHeaderSize(FF7SaveInfo::FORMAT format)
5151
case FORMAT::SWITCH: return get()->d->SWITCH_FILE_HEADER_SIZE;
5252
case FORMAT::PGE: return get()->d->PGE_FILE_HEADER_SIZE;
5353
case FORMAT::PDA: return get()->d->PDA_FILE_HEADER_SIZE;
54+
case FORMAT::RZIP: return get()->d->RZIP_FILE_HEADER_SIZE;
5455
default: return 0;
5556
}
5657
}
@@ -65,6 +66,7 @@ int FF7SaveInfo::slotHeaderSize(FF7SaveInfo::FORMAT format)
6566
case FORMAT::DEX:
6667
case FORMAT::PGE:
6768
case FORMAT::PDA:
69+
case FORMAT::RZIP:
6870
case FORMAT::VGS: return get()->d->PSX_SLOT_HEADER_SIZE;
6971
default: return 0;
7072
}
@@ -80,6 +82,7 @@ int FF7SaveInfo::slotFooterSize(FF7SaveInfo::FORMAT format)
8082
case FORMAT::DEX:
8183
case FORMAT::PGE:
8284
case FORMAT::PDA:
85+
case FORMAT::RZIP:
8386
case FORMAT::VGS: return get()->d->PSX_SLOT_FOOTER_SIZE;
8487
default: return 0;
8588
}
@@ -97,6 +100,7 @@ int FF7SaveInfo::slotCount(FF7SaveInfo::FORMAT format)
97100
case FORMAT::DEX:
98101
case FORMAT::VGS:
99102
case FORMAT::SWITCH:
103+
case FORMAT::RZIP:
100104
case FORMAT::PC: return 15;
101105
default: return 0;
102106
}
@@ -113,12 +117,14 @@ QByteArray FF7SaveInfo::fileIdentifier(FF7SaveInfo::FORMAT format)
113117
// case FORMAT::DEX: return get()->d->DEX_FILE_ID;
114118
case FORMAT::VGS: return get()->d->VGS_FILE_ID;
115119
case FORMAT::SWITCH: return get()->d->SWITCH_FILE_ID;
120+
case FORMAT::RZIP: return get()->d->RZIP_FILE_ID;
116121
default: return QByteArray();
117122
}
118123
}
119124

120125
QByteArray FF7SaveInfo::fileHeader(FF7SaveInfo::FORMAT format)
121126
{
127+
//TODO: PROPER FILE HEADER FOR RZIP
122128
switch (format) {
123129
case FORMAT::PC:
124130
case FORMAT::SWITCH:
@@ -142,6 +148,7 @@ QByteArray FF7SaveInfo::slotHeader(FF7SaveInfo::FORMAT format, int slot)
142148
case FORMAT::PS3:
143149
case FORMAT::DEX:
144150
case FORMAT::VGS:
151+
case FORMAT::RZIP:
145152
case FORMAT::VMC: return QByteArray(get()->d->PSX_SLOT_HEADER.at(slot)).append(256, 0x00);
146153
default: return QByteArray();
147154
}
@@ -225,6 +232,7 @@ int FF7SaveInfo::slotSize()
225232

226233
QRegularExpression FF7SaveInfo::validNames(FF7SaveInfo::FORMAT format)
227234
{
235+
//TODO: ADD RZIP INFO
228236
switch (format) {
229237
case FORMAT::PC: return get()->d->PC_VALID_NAME_REGEX;
230238
case FORMAT::PSX: return get()->d->PSX_VALID_NAME_REGEX;
@@ -236,6 +244,7 @@ QRegularExpression FF7SaveInfo::validNames(FF7SaveInfo::FORMAT format)
236244
case FORMAT::SWITCH: return get()->d->SWITCH_VALID_NAME_REGEX;
237245
case FORMAT::PGE: return get()->d->PGE_VALID_NAME_REGEX;
238246
case FORMAT::PDA: return get()->d->PDA_VALID_NAME_REGEX;
247+
case FORMAT::RZIP: return get()->d->RZIP_VALID_NAME_REGEX;
239248
default: return QRegularExpression();
240249
}
241250
}
@@ -253,6 +262,7 @@ QString FF7SaveInfo::typeDescription(FF7SaveInfo::FORMAT format)
253262
case FORMAT::SWITCH: return tr(get()->d->SWITCH_FILE_DESCRIPTION.toUtf8());
254263
case FORMAT::PGE: return tr(get()->d->PGE_FILE_DESCRIPTION.toUtf8());
255264
case FORMAT::PDA: return tr(get()->d->PDA_FILE_DESCRIPTION.toUtf8());
265+
case FORMAT::RZIP: return tr(get()->d->RZIP_FILE_DESCRIPTION.toUtf8());
256266
default: return QString();
257267
}
258268
}
@@ -270,6 +280,7 @@ QStringList FF7SaveInfo::typeExtension(FF7SaveInfo::FORMAT format)
270280
case FORMAT::SWITCH: return get()->d->SWITCH_VALID_EXTENSIONS;
271281
case FORMAT::PGE: return get()->d->PGE_VALID_EXTENSIONS;
272282
case FORMAT::PDA: return get()->d->PDA_VALID_EXTENSIONS;
283+
case FORMAT::RZIP: return get()->d->RZIP_VALID_EXTENSIONS;
273284
default: return QStringList();
274285
}
275286
}
@@ -283,6 +294,7 @@ QString FF7SaveInfo::typeFilter(FF7SaveInfo::FORMAT format)
283294

284295
QString FF7SaveInfo::knownTypesFilter()
285296
{
297+
//TODO INCLUDE RZIP WHEN ITS WORKING
286298
QString space = QStringLiteral(" ");
287299
QString allTypes = QStringLiteral("%1 %2 %3 %4 %5 %6 %7 %8 %9 %10")
288300
.arg(get()->d->PC_VALID_EXTENSIONS.join(space)
@@ -326,6 +338,7 @@ bool FF7SaveInfo::isTypeVMC(FF7SaveInfo::FORMAT format)
326338
case FORMAT::VMC:
327339
case FORMAT::VGS:
328340
case FORMAT::DEX:
341+
case FORMAT::RZIP:
329342
case FORMAT::PSP: return true;
330343
default: return false;
331344
};
@@ -344,6 +357,7 @@ bool FF7SaveInfo::isTypeSSS(FF7SaveInfo::FORMAT format)
344357

345358
int FF7SaveInfo::vmcHeaderOffset(FF7SaveInfo::FORMAT format)
346359
{
360+
//TODO INCLUDE RZIP
347361
switch (format) {
348362
case FORMAT::PSP: return get()->d->PSP_VMC_HEADER_OFFSET;
349363
case FORMAT::DEX: return get()->d->DEX_VMC_HEADER_OFFSET;

0 commit comments

Comments
 (0)