20 #include <QDataStream> 21 #include <QTextStream> 22 #include <QCryptographicHash> 24 #if defined(OPENSSL) && (OPENSSL == 1) 25 #include <openssl/evp.h> 26 #include <openssl/hmac.h> 27 #include <openssl/aes.h> 53 if(fileName.isEmpty()){
return false;}
55 if(!file.open(QIODevice::ReadOnly)){
return false;}
56 int file_size = file.size();
87 if((fileName.contains(
"00867")) || (fileName.contains(
"00869")) || (fileName.contains(
"00900")) ||
88 (fileName.contains(
"94163")) || (fileName.contains(
"00700")) || (fileName.contains(
"01057")) ||
89 (fileName.contains(
"00868")))
92 string = fileName.mid(fileName.lastIndexOf(
"/")+1,fileName.lastIndexOf(
".")-1-fileName.lastIndexOf(
"/"));
93 SG_Region_String[0]=
string.mid(
string.lastIndexOf(
"BA")-1,
string.lastIndexOf(
"FF7-S")+8);
108 QByteArray mc_header;
110 if(
SG_TYPE ==
"PSP"){offset = 0x80;}
111 if(
SG_TYPE ==
"VGS"){offset = 0x40;}
112 if(
SG_TYPE ==
"DEX"){offset = 0xF40;}
115 for(
int i=0; i<15;i++)
117 int index = (128*i) +138;
137 if(data.size() !=
SG_HEADER){
return false;}
154 if(s<0 || s>14){
return false;}
170 if(data.size() !=
SG_FOOTER){
return false;}
185 if(s<0 || s>14){
return false;}
193 if(
filename.isEmpty()){
return QByteArray(
"\x00");}
194 else if (
type() ==
"PC"){
return QByteArray(
"\x00");}
195 else if ((
type() ==
"PSV") || (
type() ==
"PSX"))
198 if(!file.open(QIODevice::ReadOnly)){
return QByteArray(
"\x00");}
199 QByteArray temp(file.readAll());
200 if(
type()==
"PSV"){temp.remove(0,0x84);}
208 for(
int i=0; i<blocks;i++)
220 if(s<0 || s>14){
return false;}
221 int blocks = data.length()/0x2000;
223 for(
int i=0; i< blocks ; i++)
225 int offset = (i*0x2000);
239 if(fileName.isEmpty()){
return false;}
247 QFile file(fileName);
248 if(!file.open(QIODevice::ReadWrite)){
return false;}
262 metadata.chop(metadata.length()-metadata.lastIndexOf(
"/"));
263 metadata.append(
"/metadata.xml");
271 if(fileName.isEmpty()){
return false;}
274 if(newType ==
"PC"){
return exportPC(fileName);}
275 else if(newType ==
"PSX"){
return exportPSX(s,fileName);}
276 else if(newType ==
"MC"){
return exportVMC(fileName);}
277 else if(newType ==
"VGS"){
return exportVGS(fileName);}
278 else if(newType ==
"DEX"){
return exportDEX(fileName);}
287 if(fileName.isEmpty()){
return false;}
298 for(
int i=0;i<15;i++)
324 if(fileName.isEmpty()){
return false;}
357 QFile file(fileName);
358 if(!file.open(QIODevice::ReadWrite)){
return false;}
360 for(
int i=0;i<blocks;i++)
377 if(fileName.isEmpty()){
return false;}
405 if(fileName.isEmpty()){
return false;}
408 if(prev_type !=
"VGS")
441 if(fileName.isEmpty()){
return false;}
489 if(s<0 || s>14){
return;}
490 if(fileName.isEmpty()){
return;}
491 QFile file(fileName);
492 if(!file.open(QIODevice::ReadOnly)){
return;}
493 int file_size = file.size();
537 else{file.close();
return;}
545 if(
slot[s].checksum != 0x0000 &&
slot[s].checksum != 0x4D1D)
547 setRegion(s,QString(
"BASCUS-94163FF7-S%1").arg(QString::number(s).toInt(),2,10,QChar(
'0').toUpper()));
551 else if (inType ==
"MC" || inType ==
"PSP" || inType ==
"VGS" ||inType==
"DEX")
554 QByteArray mc_header;
561 mc_header = file.read(headerSize);
563 index = (128*fileSlot) +138;
564 setRegion(s,QString(mc_header.mid(index,19)));
566 else if (inType ==
"PSX")
568 if((file.fileName().contains(
"00867")) || (file.fileName().contains(
"00869")) || (file.fileName().contains(
"00900")) ||
569 (file.fileName().contains(
"94163")) || (file.fileName().contains(
"00700")) || (file.fileName().contains(
"01057")) || (file.fileName().contains(
"00868")))
572 string = file.fileName().mid(file.fileName().lastIndexOf(
"/")+1,file.fileName().lastIndexOf(
".")-1-file.fileName().lastIndexOf(
"/"));
573 setRegion(s,
string.mid(
string.lastIndexOf(
"BA")-1,
string.lastIndexOf(
"FF7-S")+8));
577 else if (inType==
"PSV")
595 temp.fill(0x00,0x10f4);
597 memcpy(&
slot[rmslot],temp,0x10f4);
602 int index = (128+(128*rmslot));
603 if (
SG_TYPE ==
"PSP"){index +=0x80;}
604 else if (
SG_TYPE ==
"VGS"){index +=0x40;}
605 else if (
SG_TYPE ==
"DEX"){index +=0xF40;}
618 QFile file(fileName);
619 if(!file.open(QIODevice::ReadWrite)){
return false;}
633 if(checksum == 0x4D1D){
slot[i].checksum=0x0000; }
634 else{
slot[i].checksum = checksum;}
643 quint16 r = 0xFFFF, len =4336, pbit = 0x8000;
650 if( r & pbit ){r = ( r << 1 ) ^ 0x1021;}
653 r &= ( 1 << 16 ) - 1;
655 return ((r^0xFFFF)&0xFFFF);
662 #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN 664 #elif Q_BYTE_ORDER == Q_BIG_ENDIAN 665 item = ((itemraw & 0xFF) << 8) | ((itemraw >> 8) & 0xFF);
688 item = ((itemraw & 0xFF) << 8) | ((itemraw >> 8) & 0xFF);
696 item = ((itemraw & 0xFF) << 8) | ((itemraw >> 8) & 0xFF);
704 quint16
item,itemraw;
706 #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN 707 item = ((qty << 9) & 0xFE00) | (
id & 0x1FF);
709 #elif Q_BYTE_ORDER == Q_BIG_ENDIAN 710 item = ((qty << 9) & 0xFE00) | (
id & 0x1FF);
711 itemraw = ((item & 0xFF) << 8) | ((item >> 8) & 0xFF);
725 item = ((qty << 9) & 0xFE00) | (
id & 0x1FF);
741 item = ((qty << 9) & 0xFE00) | (
id & 0x1FF);
742 itemraw = ((item & 0xFF) << 8) | ((item >> 8) & 0xFF);
749 item = ((qty << 9) & 0xFE00) | (
id & 0x1FF);
754 item = ((qty << 9) & 0xFE00) | (
id & 0x1FF);
755 itemraw = ((item & 0xFF) << 8) | ((item >> 8) & 0xFF);
766 slot[s].items[item_num]=rawitem;
771 if(
region(s).contains(
"SLPS-00700") &&(new_qty>99) &&(new_id != 0x1FF)){new_qty = 99;}
781 QList<quint16> item_list;
782 for (
int i=0;i<320;i++){item_list.append(
slot[s].
items[i]);}
788 if(
region(s).contains(
"SLPS-00700"))
790 for(
int i=0;i<320;i++)
793 else{
slot[s].items[i]= items.at(i);}
796 else{
for(
int i=0;i<320;i++){
slot[s].items[i]= items.at(i);}}
808 quint8 newheader[0x09] = {0x71,0x73,0x27,0x06,0x00,0x00,0x00,0x00,0x00};
812 case 0: newheader[4]=0x00;
break;
813 case 1: newheader[4]=0x01;
break;
814 default:newheader[4]= (16 * (s-2))+2;
break;
819 if(
isFF7(i)){mask |= (1<<i);}
824 for(
int i=8;i<15;i++)
826 if(
isFF7(i)){mask |= (1<<(i-8));}
835 if((
slot[s].
time/3600)>99){
hf[s].sl_header[27]=0x58;
hf[s].sl_header[29]=0x58;}
838 hf[s].sl_header[27] = ((
slot[s].time/3600)/10)+0x4F;
839 hf[s].sl_header[29] = ((
slot[s].time/3600)%10)+0x4F;
841 hf[s].sl_header[33] = ((
slot[s].time/60%60)/10)+0x4F;
842 hf[s].sl_header[35] = ((
slot[s].time/60%60)%10)+0x4F;
853 QByteArray keySeed =
fileHeader().mid(0x08,20);
856 QByteArray hmacDigest =
fileHeader().mid(0x1C,20);
857 QByteArray signedData =
fileHeader().mid(0x30);
859 QByteArray decryptedKeySeed;decryptedKeySeed.resize(keySeed.size()+16);
861 const EVP_CIPHER *cipher = EVP_aes_128_cbc();
862 int inLen=keySeed.length();
866 EVP_CIPHER_CTX_init(&ctx);
867 EVP_DecryptInit(&ctx, cipher, (
const unsigned char*)
ps3Key().data(), (
const unsigned char*)
ps3Seed().data());
868 EVP_DecryptUpdate(&ctx, (
unsigned char*)decryptedKeySeed.data(), &outLen, (
const unsigned char*)keySeed.data(), inLen);
870 EVP_DecryptFinal(&ctx,(
unsigned char*)decryptedKeySeed.data()+tempLen,&outLen);
871 EVP_CIPHER_CTX_cleanup(&ctx);
873 decryptedKeySeed.resize(tempLen);
877 QByteArray newHMAC; newHMAC.resize(0x14);
878 unsigned int result_len = 0x14;
882 HMAC_CTX_init(&ctx2);
883 HMAC_Init(&ctx2, decryptedKeySeed.data(), decryptedKeySeed.length(), EVP_sha1());
884 HMAC_Update(&ctx2, (
unsigned char *)signedData.data(), signedData.length());
885 HMAC_Final(&ctx2, (
unsigned char*)newHMAC.data(), &result_len);
886 HMAC_CTX_cleanup(&ctx2);
890 QByteArray temp =
fileHeader().replace(0x1C,0x14,newHMAC);
898 QByteArray mc_header_2;
903 quint8 xor_byte = 0x00;
904 mc_header_2.append(
"MC");
910 if(
SG_TYPE ==
"MC"){
for(
int x=0;x<127;x++){xor_byte^=mc_header_2[x];}}
911 if(
SG_TYPE ==
"PSP"){
for(
int x=128;x<256;x++){xor_byte^=mc_header_2[x];}}
912 if(
SG_TYPE ==
"VGS"){
for(
int x=64;x<192;x++){xor_byte^=mc_header_2[x];}}
913 if(
SG_TYPE ==
"DEX"){
for(
int x=0xF40;x<0x1000;x++){xor_byte^=mc_header_2[x];}}
915 mc_header_2.append(xor_byte);
917 for(
int i=0;i<15;i++)
920 index= (128 +(128*i));
921 if(
SG_TYPE ==
"PSP"){index+=0x80;}
922 if(
SG_TYPE ==
"VGS"){index+=0x40;}
923 if(
SG_TYPE ==
"DEX"){index+=0xF40;}
928 temp[0]=0x51;temp[1]=0x00;temp[2]=0x00;temp[3]=0x00;temp[4]=0x00;
929 temp[5]=0x20;temp[6]=0x00;temp[7]=0x00;temp[8]=0xFF;temp[9]=0xFF;
930 mc_header_2.append(temp);
931 mc_header_2.append(
region(i));
933 for(
int f=0;f<98;f++){temp[f]=0x00;}
934 mc_header_2.append(temp);
936 for(
int x=0;x<127;x++){xor_byte^=mc_header_2[x+index];}
937 mc_header_2.append(xor_byte);
939 if(
region(i).endsWith(
"FF7-S01"))
940 {
for(
int P=0;P<512;P++)
943 else{
hf[i].sl_header[P]= 0x00;}
946 if(
region(i).endsWith(
"FF7-S02"))
947 {
for(
int P=0;P<512;P++)
950 else{
hf[i].sl_header[P]= 0x00;}
953 if(
region(i).endsWith(
"FF7-S03"))
954 {
for(
int P=0;P<512;P++)
957 else{
hf[i].sl_header[P]= 0x00;}
960 if(
region(i).endsWith(
"FF7-S04"))
961 {
for(
int P=0;P<512;P++)
964 else{
hf[i].sl_header[P]= 0x00;}
967 if(
region(i).endsWith(
"FF7-S05"))
968 {
for(
int P=0;P<512;P++)
971 else{
hf[i].sl_header[P]= 0x00;}
974 if(
region(i).endsWith(
"FF7-S06"))
975 {
for(
int P=0;P<512;P++)
978 else{
hf[i].sl_header[P]= 0x00;}
981 if(
region(i).endsWith(
"FF7-S07"))
982 {
for(
int P=0;P<512;P++)
985 else{
hf[i].sl_header[P]= 0x00;}
988 if(
region(i).endsWith(
"FF7-S08"))
989 {
for(
int P=0;P<512;P++)
992 else{
hf[i].sl_header[P]= 0x00;}
995 if(
region(i).endsWith(
"FF7-S09"))
996 {
for(
int P=0;P<512;P++)
999 else{
hf[i].sl_header[P]= 0x00;}
1002 if(
region(i).endsWith(
"FF7-S10"))
1003 {
for(
int P=0;P<512;P++)
1006 else{
hf[i].sl_header[P]= 0x00;}
1009 if(
region(i).endsWith(
"FF7-S11"))
1010 {
for(
int P=0;P<512;P++)
1013 else{
hf[i].sl_header[P]= 0x00;}
1016 if(
region(i).endsWith(
"FF7-S12"))
1017 {
for(
int P=0;P<512;P++)
1020 else{
hf[i].sl_header[P]= 0x00;}
1023 if(
region(i).endsWith(
"FF7-S13"))
1024 {
for(
int P=0;P<512;P++)
1027 else{
hf[i].sl_header[P]= 0x00;}
1030 if(
region(i).endsWith(
"FF7-S14"))
1031 {
for(
int P=0;P<512;P++)
1034 else{
hf[i].sl_header[P]= 0x00;}
1037 if(
region(i).endsWith(
"FF7-S15"))
1038 {
for(
int P=0;P<512;P++)
1041 else{
hf[i].sl_header[P]= 0x00;}
1058 mc_header_2.append(
"\xA0\x00\x00\x00\x00\x00\x00\x00\xFF\xFF",10);
1059 for (
int j=0;j<117;j++){mc_header_2.append(
'\x00');}
1060 mc_header_2.append(
'\xA0');
1075 for(
int i=0;i<6143;i++){mc_header_2.append(
file_header_mc[index+i]);}
1081 for(
int i=0;i<6143;i++){mc_header_2.append(
file_header_psp[index+i]);}
1088 for(
int i=0;i<6143;i++){mc_header_2.append(
file_header_vgs[index+i]);}
1094 for(
int i=0;i<6143;i++){mc_header_2.append(
file_header_dex[index+i]);}
1104 SG_Region_String[s].append(QString(
"%1").arg(QString::number(saveNum),2,QChar(
'0')));
1112 if( (new_region ==
"USA") || (new_region ==
"NTSC-U") || (new_region ==
"1") )
1114 SG_Region_String[s]= QString(
"BASCUS-94163FF7-S%1").arg(QString::number(s+1),2,QChar(
'0'));
1116 else if( (new_region ==
"UK") || (new_region ==
"PAL-E") || (new_region ==
"2") )
1118 SG_Region_String[s]= QString(
"BESCES-00867FF7-S%1").arg(QString::number(s+1),2,QChar(
'0'));
1120 else if( (new_region ==
"French") || (new_region ==
"PAL-FR") || (new_region ==
"3") )
1122 SG_Region_String[s]= QString(
"BESCES-00868FF7-S%1").arg(QString::number(s+1),2,QChar(
'0'));
1124 else if( (new_region ==
"German") || (new_region ==
"PAL-DE") || (new_region ==
"4") )
1126 SG_Region_String[s]= QString(
"BESCES-00869FF7-S%1").arg(QString::number(s+1),2,QChar(
'0'));
1128 else if( (new_region ==
"Spanish")||(new_region ==
"PAL-ES")||(new_region ==
"5") )
1130 SG_Region_String[s]= QString(
"BESCES-00900FF7-S%1").arg(QString::number(s+1),2,QChar(
'0'));
1132 else if( (new_region ==
"Japanese")||(new_region ==
"NTSC-J")||(new_region ==
"6") )
1134 SG_Region_String[s]= QString(
"BISLPS-00700FF7-S%1").arg(QString::number(s+1),2,QChar(
'0'));
1136 else if( (new_region ==
"International")||(new_region ==
"NTSC-JI")||(new_region ==
"7") )
1138 SG_Region_String[s]= QString(
"BISLPS-01057FF7-S%1").arg(QString::number(s+1),2,QChar(
'0'));
1163 int index=128+(128*s);
1164 if (
type() ==
"PSP"){index+=0x80;}
1165 else if (
type() ==
"VGS"){index+=0x40;}
1166 else if (
type() ==
"DEX"){index+=0xF40;}
1176 int index=128+(128*s);
1177 if (
type() ==
"PSP"){index+=0x80;}
1178 else if (
type() ==
"VGS"){index+=0x40;}
1179 else if (
type() ==
"DEX"){index+=0xF40;}
1187 if(
type()==
"PC" ||
type()==
"PSX" ||
type()==
"PSV"){
return;}
1188 if(next <0 || next >14){
return;}
1189 if(s <0 || s >14){
return;}
1190 if(next==s){
return;}
1192 int index=128+(128*s);
1193 if (
type() ==
"PSP"){index+=0x80;}
1194 else if (
type() ==
"VGS"){index+=0x40;}
1195 else if (
type() ==
"DEX"){index+=0xF40;}
1204 int index=128+(128*s);
1205 if (
type() ==
"PSP"){index+=0x80;}
1206 else if (
type() ==
"VGS"){index+=0x40;}
1207 else if (
type() ==
"DEX"){index+=0xF40;}
1216 if(
type()==
"PC" ||
type()==
"PSX" ||
type()==
"PSV"){
return;}
1217 if(s <0 || s >14){
return;}
1218 if(blockSize>15){
return;}
1220 int index=128+(128*s);
1221 if (
type() ==
"PSP"){index+=0x80;}
1222 else if (
type() ==
"VGS"){index+=0x40;}
1223 else if (
type() ==
"DEX"){index+=0xF40;}
1225 qint32 filesize= blockSize *0x2000;
1228 file_headerp[index+0x06] = (filesize & 0xff0000) >> 16;
1232 if(
type() ==
"PC"){
return 0;}
1233 else if(
type()==
"PSV")
1235 qint64 size = QFile(
fileName()).size();
1237 quint8 v = size / 0x2000;
1240 else if(
type()==
"PSX")
1246 int index=128+(128*s);
1247 if (
type() ==
"PSP"){index+=0x80;}
1248 else if (
type() ==
"VGS"){index+=0x40;}
1249 else if (
type() ==
"DEX"){index+=0xF40;}
1252 return value/0x2000;
1259 QTextCodec *codec = QTextCodec::codecForName(QByteArray(
"Shift-JIS"));
1262 if((index = desc.indexOf(
'\x00')) != -1) {desc.truncate(index);}
1263 if(codec == 0){
return "";}
1264 else{
return codec->toUnicode(desc);}
1268 QTextCodec *codec = QTextCodec::codecForName(QByteArray(
"Shift-JIS"));
1271 qDebug() <<
"Failed to Load Codec";
1274 QByteArray temp = codec->fromUnicode(newDesc);
1276 QByteArray codedText;
1277 codedText.fill(
'\x00',64);
1278 codedText.replace(0,temp.size(),temp);
1281 header.replace(4,64,codedText);
1294 if(
region(s).contains(
"00867") ||
region(s).contains(
"00869") ||
1295 region(s).contains(
"00900") ||
region(s).contains(
"94163") ||
1296 region(s).contains(
"00700") ||
region(s).contains(
"01057") ||
1297 region(s).contains(
"00868"))
1304 if(
region(s).contains(
"00867") ||
region(s).contains(
"00869") ||
1305 region(s).contains(
"00900") ||
region(s).contains(
"00868"))
1312 if(
region(s).contains(
"00700") ||
region(s).contains(
"94163") ||
region(s).contains(
"01057"))
1318 if(
region(s).contains(
"00700") ||
region(s).contains(
"01057")){
return true;}
1348 else if(type ==
"PSX")
1376 else if(type==
"PSV")
1390 else if(type==
"PSP")
1404 else if(type==
"VGS")
1418 else if(type==
"DEX")
1435 if(fileName.isEmpty() || fileName.isNull())
1441 QFile file(fileName);
1442 if(!file.open(QFile::ReadOnly)){
return;}
1444 ff7file = file.readAll();
1447 temp = ff7file.mid(index,0x10f4);
1448 memcpy(&
slot[s],temp,0x10f4);
1452 for(
int c=0;c<9;c++){
setCharName(s,c,
"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff");}
1467 else if(
region(s).isEmpty()){
setRegion(s,QString(
"BASCUS-94163FF7-S%1").arg(QString::number(s+1),2,QChar(
'0')));
Text.
init(0);}
1473 if(fileName.isEmpty() || fileName.isNull())
1479 QFile file(fileName);
1480 if(!file.open(QFile::ReadOnly)){
return;}
1482 ff7file = file.readAll();
1485 temp = ff7file.mid(index,0x10f4);
1492 for(
int i=0;i<9;i++)
1499 outFile.append(CharFileName);
1500 outFile.append(
"-cait_sith");
1501 if(
type() !=
"PSX" ||
type() !=
"PSV")
1503 outFile.append(
"-");
1506 outFile.append(str);
1511 outFile.append(CharFileName);
1512 outFile.append(
"-vincent");
1513 if(
type() !=
"PSX" ||
type() !=
"PSV")
1515 outFile.append(
"-");
1518 outFile.append(str);
1521 outFile.append(
".char");
1549 setLocation(s,QT_TRANSLATE_NOOP(
"FF7Save",
"New Game +"));
1555 if(disc<1 || disc>3){
return;}
1560 if(s<0 || s>14){
return 0;}
1561 else{
return slot[s].mprogress;}
1565 if(s<0 || s>14){
return;}
1568 if(mProgress<0){mProgress =0;}
1569 else if(mProgress>0xFFFF){mProgress=0xFFFF;}
1570 if(mProgress !=
slot[s].mprogress)
1572 slot[s].mprogress = mProgress;
1580 QList<QByteArray> icon;
1607 for (
int n=0;n<12;n++){text.append(
slot[s].chars[char_num].name[n]);}
1614 for (
int i=0;i<12;i++){
slot[s].chars[char_num].name[i] =0xFF;}
1616 memcpy(
slot[s].chars[char_num].name,temp,temp.length());
1625 for (
int n=0;n<16;n++){text.append(
slot[s].desc.name[n]);}
1632 for (
int i=0;i<16;i++){
slot[s].desc.name[i] =0xFF;}
1634 memcpy(
slot[s].desc.name,temp,temp.length());
1643 for (
int n=0;n<24;n++){text.append(
slot[s].desc.location[n]);}
1652 for (
int i=0;i<32;i++){
slot[s].desc.location[i] =0xFF;}
1653 QByteArray temp =
Text.
toFF7(new_desc_location);
1654 memcpy(
slot[s].desc.location,temp,temp.length());
1661 return slot[s].desc.party[char_num];
1684 slot[s].time=new_time;
1695 for (
int n=0;n<24;n++){text.append(
slot[s].
location[n]);}
1703 for (
int i=0;i<24;i++){
slot[s].location[i] =0xFF;}
1704 QByteArray temp =
Text.
toFF7(new_location);
1720 default:
return 0;
break;
1731 default:
return 0;
break;
1768 default:
return false;
1776 if(isEmpty){
slot[s].materiacaves |= (1<<0);}
1777 else{
slot[s].materiacaves &= ~(1<<0);}
1782 if(isEmpty){
slot[s].materiacaves |= (1<<1);}
1783 else{
slot[s].materiacaves &= ~(1<<1);}
1788 if(isEmpty){
slot[s].materiacaves |= (1<<2);}
1789 else{
slot[s].materiacaves &= ~(1<<2);}
1794 if(isEmpty){
slot[s].materiacaves |= (1<<3);}
1795 else{
slot[s].materiacaves &= ~(1<<3);}
1806 case 1:
return slot[s].coster_1;
break;
1807 case 2:
return slot[s].coster_2;
break;
1808 case 3:
return slot[s].coster_3;
break;
1809 default:
return 0;
break;
1828 for (
int n=0;n<6;n++){text.append(
slot[s].chocobonames[choco_num][n]);}
1836 for (
int i=0;i<6;i++){
slot[s].chocobonames[choco_num][i] =0xFF;}
1837 memcpy(
slot[s].chocobonames[choco_num],temp,temp.length());
1842 if( (
id<91) && ((ap>=0)&&(ap<=16777215)))
1844 slot[s].materias[mat_num].id = id;
1845 int a = (ap & 0xff);
1846 int b = (ap & 0xff00) >> 8;
1847 int c = (ap & 0xff0000) >> 16;
1848 slot[s].materias[mat_num].ap[0]=a;
1849 slot[s].materias[mat_num].ap[1]=b;
1850 slot[s].materias[mat_num].ap[2]=c;
1854 slot[s].materias[mat_num].id =0xFF;
1855 slot[s].materias[mat_num].ap[0]=0xFF;
1856 slot[s].materias[mat_num].ap[1]=0xFF;
1857 slot[s].materias[mat_num].ap[2]=0xFF;
1864 qint32 ap_temp =
slot[s].materias[mat_num].ap[0] |(
slot[s].materias[mat_num].ap[1] << 8) |
slot[s].materias[mat_num].ap[2]<<16;
1869 if( (
id<91) && ((ap>=0)&&(ap<=16777215)))
1871 slot[s].stolen[mat_num].id = id;
1872 int a = (ap & 0xff);
1873 int b = (ap & 0xff00) >> 8;
1874 int c = (ap & 0xff0000) >> 16;
1875 slot[s].stolen[mat_num].ap[0]=a;
1876 slot[s].stolen[mat_num].ap[1]=b;
1877 slot[s].stolen[mat_num].ap[2]=c;
1881 slot[s].stolen[mat_num].id =0xFF;
1882 slot[s].stolen[mat_num].ap[0]=0xFF;
1883 slot[s].stolen[mat_num].ap[1]=0xFF;
1884 slot[s].stolen[mat_num].ap[2]=0xFF;
1892 qint32 ap_temp =
slot[s].stolen[mat_num].ap[0] |(
slot[s].stolen[mat_num].ap[1] << 8) |
slot[s].stolen[mat_num].ap[2]<<16;
1902 slot[s].colors[0][0]=color.red();
1903 slot[s].colors[0][1]=color.green();
1904 slot[s].colors[0][2]= color.blue();
1909 slot[s].colors[1][0]=color.red();
1910 slot[s].colors[1][1]=color.green();
1911 slot[s].colors[1][2]= color.blue();
1916 slot[s].colors[2][0]=color.red();
1917 slot[s].colors[2][1]=color.green();
1918 slot[s].colors[2][2]= color.blue();
1923 slot[s].colors[3][0]=color.red();
1924 slot[s].colors[3][1]=color.green();
1925 slot[s].colors[3][2]= color.blue();
1935 temp.setRawData(reinterpret_cast <char *>(&
slot[s].chars[char_num]),132);
1965 case 1:
return slot[s].chars[char_num].timesused1;
break;
1966 case 2:
return slot[s].chars[char_num].timesused2;
break;
1967 case 3:
return slot[s].chars[char_num].timesused3;
break;
2025 if( (
id<91) && ((ap>=0)&&(ap<=16777215)))
2027 slot[s].chars[who].materias[mat_num].id = id;
2028 int a = (ap & 0xff);
2029 int b = (ap & 0xff00) >> 8;
2030 int c = (ap & 0xff0000) >> 16;
2031 slot[s].chars[who].materias[mat_num].ap[0]=a;
2032 slot[s].chars[who].materias[mat_num].ap[1]=b;
2033 slot[s].chars[who].materias[mat_num].ap[2]=c;
2037 slot[s].chars[who].materias[mat_num].id =0xFF;
2038 slot[s].chars[who].materias[mat_num].ap[0]=0xFF;
2039 slot[s].chars[who].materias[mat_num].ap[1]=0xFF;
2040 slot[s].chars[who].materias[mat_num].ap[2]=0xFF;
2048 qint32 ap_temp =
slot[s].chars[who].materias[mat_num].ap[0] |(
slot[s].chars[who].materias[mat_num].ap[1] << 8) |
slot[s].chars[who].materias[mat_num].ap[2]<<16;
2053 if(chocoSlot >-1 && chocoSlot <4){
return slot[s].chocobos[chocoSlot];}
2054 else if (chocoSlot ==4){
return slot[s].choco56[0];}
2055 else if (chocoSlot ==5){
return slot[s].choco56[1];}
2061 memcpy(&bob,temp,16);
2069 if(chocoSlot >-1 && chocoSlot <4){
return slot[s].chocobos[chocoSlot].speed;}
2070 else if (chocoSlot ==4){
return slot[s].choco56[0].speed;}
2071 else if (chocoSlot ==5){
return slot[s].choco56[1].speed;}
2076 if(chocoSlot >-1 && chocoSlot <4){
return slot[s].chocobos[chocoSlot].maxspeed;}
2077 else if (chocoSlot ==4){
return slot[s].choco56[0].maxspeed;}
2078 else if (chocoSlot ==5){
return slot[s].choco56[1].maxspeed;}
2083 if(chocoSlot >-1 && chocoSlot <4){
return slot[s].chocobos[chocoSlot].sprintspd;}
2084 else if (chocoSlot ==4){
return slot[s].choco56[0].sprintspd;}
2085 else if (chocoSlot ==5){
return slot[s].choco56[1].sprintspd;}
2090 if(chocoSlot >-1 && chocoSlot <4){
return slot[s].chocobos[chocoSlot].maxsprintspd;}
2091 else if (chocoSlot ==4){
return slot[s].choco56[0].maxsprintspd;}
2092 else if (chocoSlot ==5){
return slot[s].choco56[1].maxsprintspd;}
2097 if(chocoSlot >-1 && chocoSlot <4){
return slot[s].chocobos[chocoSlot].sex;}
2098 else if (chocoSlot ==4){
return slot[s].choco56[0].sex;}
2099 else if (chocoSlot ==5){
return slot[s].choco56[1].sex;}
2104 if(chocoSlot >-1 && chocoSlot <4){
return slot[s].chocobos[chocoSlot].type;}
2105 else if (chocoSlot ==4){
return slot[s].choco56[0].type;}
2106 else if (chocoSlot ==5){
return slot[s].choco56[1].type;}
2111 if(chocoSlot >-1 && chocoSlot <4){
return slot[s].chocobos[chocoSlot].coop;}
2112 else if (chocoSlot ==4){
return slot[s].choco56[0].coop;}
2113 else if (chocoSlot ==5){
return slot[s].choco56[1].coop;}
2118 if(chocoSlot >-1 && chocoSlot <4){
return slot[s].chocobos[chocoSlot].accel;}
2119 else if (chocoSlot ==4){
return slot[s].choco56[0].accel;}
2120 else if (chocoSlot ==5){
return slot[s].choco56[1].accel;}
2125 if(chocoSlot >-1 && chocoSlot <4){
return slot[s].chocobos[chocoSlot].intelligence;}
2126 else if (chocoSlot ==4){
return slot[s].choco56[0].intelligence;}
2127 else if (chocoSlot ==5){
return slot[s].choco56[1].intelligence;}
2132 if(chocoSlot >-1 && chocoSlot <4){
return slot[s].chocobos[chocoSlot].raceswon;}
2133 else if (chocoSlot ==4){
return slot[s].choco56[0].raceswon;}
2134 else if (chocoSlot ==5){
return slot[s].choco56[1].raceswon;}
2139 if(chocoSlot >-1 && chocoSlot <4){
return slot[s].chocobos[chocoSlot].pcount;}
2140 else if (chocoSlot ==4){
return slot[s].choco56[0].pcount;}
2141 else if (chocoSlot ==5){
return slot[s].choco56[1].pcount;}
2146 if(chocoSlot >-1 && chocoSlot <4){
return slot[s].chocobos[chocoSlot].personality;}
2147 else if (chocoSlot ==4){
return slot[s].choco56[0].personality;}
2148 else if (chocoSlot ==5){
return slot[s].choco56[1].personality;}
2156 if(chocoSlot >-1 && chocoSlot <4){
slot[s].chocobos[chocoSlot].speed = speed;
setFileModified(
true,s);}
2162 if(chocoSlot >-1 && chocoSlot <4){
slot[s].chocobos[chocoSlot].maxspeed = maxspeed;
setFileModified(
true,s);}
2168 if(chocoSlot >-1 && chocoSlot <4){
slot[s].chocobos[chocoSlot].sprintspd = sprintSpeed;
setFileModified(
true,s);}
2169 else if (chocoSlot ==4){
slot[s].choco56[0].sprintspd = sprintSpeed;
setFileModified(
true,s);}
2170 else if (chocoSlot ==5){
slot[s].choco56[1].sprintspd = sprintSpeed;
setFileModified(
true,s);}
2174 if(chocoSlot >-1 && chocoSlot <4){
slot[s].chocobos[chocoSlot].maxsprintspd = maxsprintSpeed;
setFileModified(
true,s);}
2175 else if (chocoSlot ==4){
slot[s].choco56[0].maxsprintspd = maxsprintSpeed;
setFileModified(
true,s);}
2176 else if (chocoSlot ==5){
slot[s].choco56[1].maxsprintspd = maxsprintSpeed;
setFileModified(
true,s);}
2180 if(chocoSlot >-1 && chocoSlot <4){
slot[s].chocobos[chocoSlot].sex = value;
setFileModified(
true,s);}
2186 if(chocoSlot >-1 && chocoSlot <4){
slot[s].chocobos[chocoSlot].type = value;
setFileModified(
true,s);}
2192 if(chocoSlot >-1 && chocoSlot <4){
slot[s].chocobos[chocoSlot].coop = value;
setFileModified(
true,s);}
2198 if(chocoSlot >-1 && chocoSlot <4){
slot[s].chocobos[chocoSlot].accel = value;
setFileModified(
true,s);}
2204 if(chocoSlot >-1 && chocoSlot <4){
slot[s].chocobos[chocoSlot].intelligence = value;
setFileModified(
true,s);}
2205 else if (chocoSlot ==4){
slot[s].choco56[0].intelligence = value;
setFileModified(
true,s);}
2206 else if (chocoSlot ==5){
slot[s].choco56[1].intelligence = value;
setFileModified(
true,s);}
2210 if(chocoSlot >-1 && chocoSlot <4){
slot[s].chocobos[chocoSlot].raceswon = value;
setFileModified(
true,s);}
2216 if(chocoSlot >-1 && chocoSlot <4){
slot[s].chocobos[chocoSlot].pcount = value;
setFileModified(
true,s);}
2222 if(chocoSlot >-1 && chocoSlot <4){
slot[s].chocobos[chocoSlot].personality = value;
setFileModified(
true,s);}
2228 if(cantMate){
slot[s].chocomated |= (1 << chocoSlot);}
2229 else{
slot[s].chocomated &=~(1<< chocoSlot);}
2244 if(gp >65535){gp = 65535;}
2251 if(battles <0){battles = 0;}
2252 if(battles >65535){battles = 65535;}
2259 if(runs <0){runs = 0;}
2260 if(runs >65535){runs = 65535;}
2267 if(pos >=0 && pos <3)
2269 if(new_id >=0 && new_id<12){
slot[s].party[pos] = new_id;}
2270 else{
slot[s].party[pos] =0xFF;}
2280 time =
slot[s].SnowBegFastTime;
2283 time =
slot[s].SnowExpFastTime;
2286 time =
slot[s].SnowCrazyFastTime;
2290 return QString(
"%1").arg(time, 8, 16, QChar(
'0'));
2297 slot[s].SnowBegFastTime= value.toInt(0,16);
2301 slot[s].SnowExpFastTime= value.toInt(0,16);
2305 slot[s].SnowCrazyFastTime= value.toInt(0,16);
2316 case 0:
return slot[s].SnowBegScore;
break;
2317 case 1:
return slot[s].SnowExpScore;
break;
2318 case 2:
return slot[s].SnowCrazyScore;
break;
2319 default:
return 0;
break;
2339 if(s<0 || s>14){
return;}
2340 else if(
slot[s].battlepoints==bp){
return;}
2343 slot[s].battlepoints=bp;
2351 QFile file(fileName);
2354 if(file.open(QIODevice::ReadOnly)){ff7file = file.readAll();}
2359 for(
int i=0;i<UserID.length();i++)
2361 if(UserID.at(i).isDigit()){digitcount ++;}
2363 if (digitcount ==UserID.length())
2365 ff7file.append(UserID.toLatin1());
2368 QCryptographicHash md5(QCryptographicHash::Md5);
2369 md5.addData(ff7file);
2370 return md5.result().toHex().toLower();
2376 else{
for(
int i=0;i<15;i++){
slotChanged[i]=
false;}}
2382 QVector< SubContainer > vector( 10,
SubContainer( 16 ) );
2383 QString Md5 =
md5sum(fileName,UserID);
2386 if(number ==
"-1"){}
2387 else {number = QString::number(number.toInt()+1);}
2389 QFile* file2 =
new QFile(metadataPath);
2390 if (!file2->open(QIODevice::ReadOnly)){}
2391 QDomDocument doc(
"metadata");
2392 bool setdoc = doc.setContent(file2);
2395 QDomElement docElem = doc.documentElement();
2396 if(docElem.tagName() !=
"gamestatus"){}
2397 QDomNodeList nodeList = docElem.elementsByTagName(
"savefiles");
2398 for(
int ii = 0;ii < nodeList.count(); ii++)
2400 QDomElement el = nodeList.at(ii).toElement();
2401 QDomNode pEntries = el.firstChild();
2403 while(!pEntries.isNull() && iii <= 15)
2405 QDomElement peData = pEntries.toElement();
2406 vector[ii][iii] = peData.text();
2407 if(el.attribute(
"block") == number)
2409 if(iii==15){vector[ii][iii] = Md5;}
2411 else if(
region(iii).isEmpty()){vector[ii][iii] =
"";}
2412 else if(vector[ii][iii] ==
""){vector[ii][iii] = timestamp;}
2414 pEntries = pEntries.nextSibling();
2423 QVector< SubContainer > vector( 10,
SubContainer( 16 ) );
2424 QString Md5 =
md5sum(fileName,UserID);
2428 if(number ==
"-1"){
return vector;}
2430 for(
int i=0;i<10; i++)
2432 if(i == number.toInt()){
for(
int j=0; j<16; j++)
2434 if(j==15){vector[i][j] = Md5;}
2436 else if(
region(j).isEmpty()){vector[i][j] =
"";}
2437 else if(vector[i][j] ==
""){vector[i][j] = timestamp;}
2445 if(fileName==QString(
"")){fileName=
filename;}
2446 if(OutPath==QString(
""))
2449 temp.truncate(temp.lastIndexOf(
"/"));
2453 Path.chop(Path.length()-Path.lastIndexOf(
"/"));
2454 QString metadataPath = Path;
2455 metadataPath.append(
"/metadata.xml");
2459 QFile Metadata(metadataPath);
2461 QVector< SubContainer > vector( 10,
SubContainer( 16 ) );
2463 if(Metadata.exists())
2465 Path.remove(0,Path.lastIndexOf(
"_")+1);
2467 vector =
parseXML(fileName, metadataPath, UserId);
2474 if (!Metadata.open(QIODevice::ReadWrite)){
return 0;}
2475 QTextStream out (&Metadata);
2477 out << QString (
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
2478 out << QString(
"<gamestatus>\n");
2480 for(
int i=0;i<10; i++)
2482 out << (QString(
" <savefiles block=\"%1\">\n").arg(QString::number(i+1)));
2484 for(
int j=0; j<15; j++)
2486 out << (QString(
" <timestamp slot=\"%1\">%2</timestamp>\n").arg(QString::number(j+1),vector[i][j]));
2488 out << (QString(
" <signature>%1</signature>\n").arg(vector[i][15]));
2489 out << QString(
" </savefiles>\n");
2491 out << QString(
"</gamestatus>\n");
2492 Metadata.resize(Metadata.pos());
2501 number.remove(0,number.lastIndexOf(
"/")+5);
2503 bool isNumber =
false;
2504 number = QString::number(number.toInt(&isNumber));
2505 if(isNumber){
return number;}
2510 QFile tempFile(fileName);
2511 if(tempFile.exists()){QFileInfo file(fileName);
return QString::number(file.lastModified().toMSecsSinceEpoch());}
2516 if(s<0 || s>14){
return QByteArray(0x00);}
2518 temp.setRawData(reinterpret_cast<char *>(&
slot[s]),0x10F4);
2523 if(s<0 || s>14){
return false;}
2524 if(data.size()!=0x10F4){
return false;}
2525 memcpy(&
slot[s],data,0x10F4);
2532 if(s<0 || s>14){
return false;}
2540 if(s<0 || s>14){
return false;}
2541 else if(flyer <0 || flyer >7){
return false;}
2542 else{
return ((
slot[s].turtleflyers) &(1<<flyer));}
2546 if(s<0 || s> 14){
return 0;}
2547 else{
return slot[s].turtleflyers;}
2552 if(s<0 || s>14){
return;}
2553 else if(flyer <0 || flyer >7){
return;}
2556 if(seen){
slot[s].turtleflyers |= (1<<flyer);}
2557 else{
slot[s].turtleflyers &= ~(1<<flyer);}
2563 if(s<0 || s>14){
return;}
2566 slot[s].turtleflyers = flyersSeen;
2572 if(bit <0 || bit> 7){
return false;}
2573 else{
return ((
slot[s].itemsmask_1)& (1<<bit) );}
2577 if(s<0 || s>14){
return;}
2578 else if(bit<0 || bit >7){
return;}
2581 if(pickedUp){
slot[s].itemsmask_1 |= (1<<bit);}
2582 else{
slot[s].itemsmask_1 &= ~(1<<bit);}
2589 if(bit <0 || bit> 7){
return false;}
2590 else{
return ((
slot[s].bm_progress1)& (1<<bit) );}
2594 if(s<0 || s>14){
return;}
2595 else if(bit<0 || bit >7){
return;}
2598 if(isTrue){
slot[s].bm_progress1 |= (1<<bit);}
2599 else{
slot[s].bm_progress1 &= ~(1<<bit);}
2605 if(s<0 ||s>14){
return;}
2608 if(value<0){value=0;}
2609 else if(value>0xFF){value=0xFF;}
2610 if(value !=
slot[s].bm_progress1)
2612 slot[s].bm_progress1 = value;
2619 if(bit <0 || bit> 7){
return false;}
2620 else{
return ((
slot[s].bm_progress2)& (1<<bit) );}
2624 if(s<0 || s>14){
return;}
2625 else if(bit<0 || bit >7){
return;}
2628 if(isTrue){
slot[s].bm_progress2 |= (1<<bit);}
2629 else{
slot[s].bm_progress2 &= ~(1<<bit);}
2635 if(s<0 ||s>14){
return;}
2638 if(value<0){value=0;}
2639 else if(value>0xFF){value=0xFF;}
2640 if(value !=
slot[s].bm_progress3)
2642 slot[s].bm_progress2 = value;
2649 if(bit <0 || bit> 7){
return false;}
2650 else{
return ((
slot[s].bm_progress3)& (1<<bit) );}
2654 if(s<0 || s>14){
return;}
2655 else if(bit<0 || bit >7){
return;}
2658 if(isTrue){
slot[s].bm_progress3 |= (1<<bit);}
2659 else{
slot[s].bm_progress3 &= ~(1<<bit);}
2665 if(s<0 ||s>14){
return;}
2668 if(value<0){value=0;}
2669 else if(value>0xFF){value=0xFF;}
2670 if(value !=
slot[s].bm_progress3)
2672 slot[s].bm_progress3 = value;
2680 if(bit <0 || bit> 7){
return false;}
2681 else{
return ((
slot[s].midgartrainflags)& (1<<bit) );}
2685 if(s<0 || s>14){
return;}
2686 else if(bit<0 || bit >7){
return;}
2689 if(isTrue){
slot[s].midgartrainflags |= (1<<bit);}
2690 else{
slot[s].midgartrainflags &= ~(1<<bit);}
2696 if(s<0 ||s>14){
return;}
2699 if(value<0){value=0;}
2700 else if(value>0xFF){value=0xFF;}
2701 if(value !=
slot[s].midgartrainflags)
2703 slot[s].midgartrainflags = value;
2711 if(s<0 || s>14){
return QByteArray(
"\x00");}
2715 temp.setRawData(reinterpret_cast<char *>(&
slot[s].keyitems),
sizeof(
slot[s].keyitems));
2721 if(s<0 || s>14){
return false;}
2722 else if(keyItem <0 || keyItem>51){
return false;}
2723 else{
return ((
slot[s].keyitems[keyItem/8]) & (1<< (keyItem%8)));}
2727 if(s<0 || s>14){return ;}
2728 else if(keyItem <0 || keyItem>51){
return;}
2731 if(pickedUp){
slot[s].keyitems[keyItem/8] |= (1<< (keyItem%8));}
2732 else{
slot[s].keyitems[keyItem/8] &= ~(1<< (keyItem%8));}
2739 if(data.size() !=
sizeof(
slot[s].keyitems)) {
return false;}
2742 memcpy(&
slot[s].keyitems,data,
sizeof(
slot[s].keyitems));
2749 if(s<0 || s>14){
return QByteArray(0x00);}
2753 case 0: temp.setRawData(0x00,1);
break;
2754 case 1: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_1),
sizeof(
slot[s].z_1));
break;
2755 case 2: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_2),
sizeof(
slot[s].z_2));
break;
2756 case 3: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_3),
sizeof(
slot[s].z_3));
break;
2757 case 4: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_4),
sizeof(
slot[s].z_4));
break;
2758 case 5: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_5),
sizeof(
slot[s].z_5));
break;
2759 case 6: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_6),
sizeof(
slot[s].z_6));
break;
2760 case 7: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_7),
sizeof(
slot[s].z_7));
break;
2761 case 8: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_8),
sizeof(
slot[s].z_8));
break;
2762 case 9: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_9),
sizeof(
slot[s].z_9));
break;
2763 case 10: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_10),
sizeof(
slot[s].z_10));
break;
2764 case 11: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_11),
sizeof(
slot[s].z_11));
break;
2765 case 12: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_12),
sizeof(
slot[s].z_12));
break;
2766 case 13: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_13),
sizeof(
slot[s].z_13));
break;
2767 case 14: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_14),
sizeof(
slot[s].z_14));
break;
2768 case 15: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_15),
sizeof(
slot[s].z_15));
break;
2769 case 16: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_16),
sizeof(
slot[s].z_16));
break;
2770 case 17: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_17),
sizeof(
slot[s].z_17));
break;
2771 case 18: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_18),
sizeof(
slot[s].z_18));
break;
2772 case 19: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_19),
sizeof(
slot[s].z_19));
break;
2773 case 20: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_20),
sizeof(
slot[s].z_20));
break;
2774 case 21: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_21),
sizeof(
slot[s].z_21));
break;
2775 case 22: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_22),
sizeof(
slot[s].z_22));
break;
2776 case 23: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_23),
sizeof(
slot[s].z_23));
break;
2777 case 24: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_24),
sizeof(
slot[s].z_24));
break;
2778 case 25: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_25),
sizeof(
slot[s].z_25));
break;
2779 case 26: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_26),
sizeof(
slot[s].z_26));
break;
2780 case 27: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_27),
sizeof(
slot[s].z_27));
break;
2781 case 28: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_28),
sizeof(
slot[s].z_28));
break;
2782 case 29: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_29),
sizeof(
slot[s].z_29));
break;
2783 case 30: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_30),
sizeof(
slot[s].z_30));
break;
2784 case 31: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_31),
sizeof(
slot[s].z_31));
break;
2785 case 32: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_32),
sizeof(
slot[s].z_32));
break;
2786 case 33: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_33),
sizeof(
slot[s].z_33));
break;
2787 case 34: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_34),
sizeof(
slot[s].z_34));
break;
2788 case 35: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_35),
sizeof(
slot[s].z_35));
break;
2789 case 36: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_36),
sizeof(
slot[s].z_36));
break;
2790 case 37: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_37),
sizeof(
slot[s].z_37));
break;
2791 case 38: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_38),
sizeof(
slot[s].z_38));
break;
2792 case 39: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_39),
sizeof(
slot[s].z_39));
break;
2793 case 40: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_40),
sizeof(
slot[s].z_40));
break;
2794 case 41: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_41),
sizeof(
slot[s].z_41));
break;
2795 case 42: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_42),
sizeof(
slot[s].z_42));
break;
2796 case 43: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_43),
sizeof(
slot[s].z_43));
break;
2797 case 44: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_44),
sizeof(
slot[s].z_44));
break;
2798 case 45: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_45),
sizeof(
slot[s].z_45));
break;
2799 case 46: temp.setRawData(reinterpret_cast<char *>(&
slot[s].z_46),
sizeof(
slot[s].z_46));
break;
2800 default: temp.setRawData(0x00,1);
break;
2807 if(s<0 || s>14){
return false;}
2811 case 0: result=
false;
break;
2813 if(data.size() !=
sizeof(
slot[s].z_1)) {result=
false;
break;}
2814 else{memcpy(&
slot[s].z_1,data,
sizeof(
slot[s].z_1)); result=
true;
break;}
2816 if(data.size() !=
sizeof(
slot[s].z_2)) {result=
false;
break;}
2817 else{memcpy(&
slot[s].z_2,data,
sizeof(
slot[s].z_2)); result=
true;
break;}
2819 if(data.size() !=
sizeof(
slot[s].z_3)) {result=
false;
break;}
2820 else{memcpy(&
slot[s].z_3,data,
sizeof(
slot[s].z_3)); result=
true;
break;}
2822 if(data.size() !=
sizeof(
slot[s].z_4)) {result=
false;
break;}
2823 else{memcpy(&
slot[s].z_4,data,
sizeof(
slot[s].z_4)); result=
true;
break;}
2825 if(data.size() !=
sizeof(
slot[s].z_5)) {result=
false;
break;}
2826 else{memcpy(&
slot[s].z_5,data,
sizeof(
slot[s].z_5)); result=
true;
break;}
2828 if(data.size() !=
sizeof(
slot[s].z_6)) {result=
false;
break;}
2829 else{memcpy(&
slot[s].z_6,data,
sizeof(
slot[s].z_6)); result=
true;
break;}
2831 if(data.size() !=
sizeof(
slot[s].z_7)) {result=
false;
break;}
2832 else{memcpy(&
slot[s].z_7,data,
sizeof(
slot[s].z_7)); result=
true;
break;}
2834 if(data.size() !=
sizeof(
slot[s].z_8)) {result=
false;
break;}
2835 else{memcpy(&
slot[s].z_8,data,
sizeof(
slot[s].z_8)); result=
true;
break;}
2837 if(data.size() !=
sizeof(
slot[s].z_9)) {result=
false;
break;}
2838 else{memcpy(&
slot[s].z_9,data,
sizeof(
slot[s].z_9)); result=
true;
break;}
2840 if(data.size() !=
sizeof(
slot[s].z_10)) {result=
false;
break;}
2841 else{memcpy(&
slot[s].z_10,data,
sizeof(
slot[s].z_10)); result=
true;
break;}
2843 if(data.size() !=
sizeof(
slot[s].z_11)) {result=
false;
break;}
2844 else{memcpy(&
slot[s].z_11,data,
sizeof(
slot[s].z_11)); result=
true;
break;}
2846 if(data.size() !=
sizeof(
slot[s].z_12)) {result=
false;
break;}
2847 else{memcpy(&
slot[s].z_12,data,
sizeof(
slot[s].z_12)); result=
true;
break;}
2849 if(data.size() !=
sizeof(
slot[s].z_13)) {result=
false;
break;}
2850 else{memcpy(&
slot[s].z_13,data,
sizeof(
slot[s].z_13)); result=
true;
break;}
2852 if(data.size() !=
sizeof(
slot[s].z_14)) {result=
false;
break;}
2853 else{memcpy(&
slot[s].z_14,data,
sizeof(
slot[s].z_14)); result=
true;
break;}
2855 if(data.size() !=
sizeof(
slot[s].z_15)) {result=
false;
break;}
2856 else{memcpy(&
slot[s].z_15,data,
sizeof(
slot[s].z_15)); result=
true;
break;}
2858 if(data.size() !=
sizeof(
slot[s].z_16)) {result=
false;
break;}
2859 else{memcpy(&
slot[s].z_16,data,
sizeof(
slot[s].z_16)); result=
true;
break;}
2861 if(data.size() !=
sizeof(
slot[s].z_17)) {result=
false;
break;}
2862 else{memcpy(&
slot[s].z_17,data,
sizeof(
slot[s].z_17)); result=
true;
break;}
2864 if(data.size() !=
sizeof(
slot[s].z_18)) {result=
false;
break;}
2865 else{memcpy(&
slot[s].z_18,data,
sizeof(
slot[s].z_18)); result=
true;
break;}
2867 if(data.size() !=
sizeof(
slot[s].z_19)) {result=
false;
break;}
2868 else{memcpy(&
slot[s].z_19,data,
sizeof(
slot[s].z_19)); result=
true;
break;}
2870 if(data.size() !=
sizeof(
slot[s].z_20)) {result=
false;
break;}
2871 else{memcpy(&
slot[s].z_20,data,
sizeof(
slot[s].z_20)); result=
true;
break;}
2873 if(data.size() !=
sizeof(
slot[s].z_21)) {result=
false;
break;}
2874 else{memcpy(&
slot[s].z_21,data,
sizeof(
slot[s].z_21)); result=
true;
break;}
2876 if(data.size() !=
sizeof(
slot[s].z_22)) {result=
false;
break;}
2877 else{memcpy(&
slot[s].z_22,data,
sizeof(
slot[s].z_22)); result=
true;
break;}
2879 if(data.size() !=
sizeof(
slot[s].z_23)) {result=
false;
break;}
2880 else{memcpy(&
slot[s].z_23,data,
sizeof(
slot[s].z_23)); result=
true;
break;}
2882 if(data.size() !=
sizeof(
slot[s].z_24)) {result=
false;
break;}
2883 else{memcpy(&
slot[s].z_24,data,
sizeof(
slot[s].z_24)); result=
true;
break;}
2885 if(data.size() !=
sizeof(
slot[s].z_25)) {result=
false;
break;}
2886 else{memcpy(&
slot[s].z_25,data,
sizeof(
slot[s].z_25)); result=
true;
break;}
2888 if(data.size() !=
sizeof(
slot[s].z_26)) {result=
false;
break;}
2889 else{memcpy(&
slot[s].z_26,data,
sizeof(
slot[s].z_26)); result=
true;
break;}
2891 if(data.size() !=
sizeof(
slot[s].z_27)) {result=
false;
break;}
2892 else{memcpy(&
slot[s].z_27,data,
sizeof(
slot[s].z_27)); result=
true;
break;}
2894 if(data.size() !=
sizeof(
slot[s].z_28)) {result=
false;
break;}
2895 else{memcpy(&
slot[s].z_28,data,
sizeof(
slot[s].z_28)); result=
true;
break;}
2897 if(data.size() !=
sizeof(
slot[s].z_29)) {result=
false;
break;}
2898 else{memcpy(&
slot[s].z_29,data,
sizeof(
slot[s].z_29)); result=
true;
break;}
2900 if(data.size() !=
sizeof(
slot[s].z_30)) {result=
false;
break;}
2901 else{memcpy(&
slot[s].z_30,data,
sizeof(
slot[s].z_30)); result=
true;
break;}
2903 if(data.size() !=
sizeof(
slot[s].z_31)) {result=
false;
break;}
2904 else{memcpy(&
slot[s].z_31,data,
sizeof(
slot[s].z_31)); result=
true;
break;}
2906 if(data.size() !=
sizeof(
slot[s].z_32)) {result=
false;
break;}
2907 else{memcpy(&
slot[s].z_32,data,
sizeof(
slot[s].z_32)); result=
true;
break;}
2909 if(data.size() !=
sizeof(
slot[s].z_33)) {result=
false;
break;}
2910 else{memcpy(&
slot[s].z_33,data,
sizeof(
slot[s].z_33)); result=
true;
break;}
2912 if(data.size() !=
sizeof(
slot[s].z_34)) {result=
false;
break;}
2913 else{memcpy(&
slot[s].z_34,data,
sizeof(
slot[s].z_34)); result=
true;
break;}
2915 if(data.size() !=
sizeof(
slot[s].z_35)) {result=
false;
break;}
2916 else{memcpy(&
slot[s].z_35,data,
sizeof(
slot[s].z_35)); result=
true;
break;}
2918 if(data.size() !=
sizeof(
slot[s].z_36)) {result=
false;
break;}
2919 else{memcpy(&
slot[s].z_36,data,
sizeof(
slot[s].z_36)); result=
true;
break;}
2921 if(data.size() !=
sizeof(
slot[s].z_37)) {result=
false;
break;}
2922 else{memcpy(&
slot[s].z_37,data,
sizeof(
slot[s].z_37)); result=
true;
break;}
2924 if(data.size() !=
sizeof(
slot[s].z_38)) {result=
false;
break;}
2925 else{memcpy(&
slot[s].z_38,data,
sizeof(
slot[s].z_38)); result=
true;
break;}
2927 if(data.size() !=
sizeof(
slot[s].z_39)) {result=
false;
break;}
2928 else{memcpy(&
slot[s].z_39,data,
sizeof(
slot[s].z_39)); result=
true;
break;}
2930 if(data.size() !=
sizeof(
slot[s].z_40)) {result=
false;
break;}
2931 else{memcpy(&
slot[s].z_40,data,
sizeof(
slot[s].z_40)); result=
true;
break;}
2933 if(data.size() !=
sizeof(
slot[s].z_41)) {result=
false;
break;}
2934 else{memcpy(&
slot[s].z_41,data,
sizeof(
slot[s].z_41)); result=
true;
break;}
2936 if(data.size() !=
sizeof(
slot[s].z_42)) {result=
false;
break;}
2937 else{memcpy(&
slot[s].z_42,data,
sizeof(
slot[s].z_42)); result=
true;
break;}
2939 if(data.size() !=
sizeof(
slot[s].z_43)) {result=
false;
break;}
2940 else{memcpy(&
slot[s].z_43,data,
sizeof(
slot[s].z_43)); result=
true;
break;}
2942 if(data.size() !=
sizeof(
slot[s].z_44)) {result=
false;
break;}
2943 else{memcpy(&
slot[s].z_44,data,
sizeof(
slot[s].z_44)); result=
true;
break;}
2945 if(data.size() !=
sizeof(
slot[s].z_45)) {result=
false;
break;}
2946 else{memcpy(&
slot[s].z_45,data,
sizeof(
slot[s].z_45)); result=
true;
break;}
2948 if(data.size() !=
sizeof(
slot[s].z_46)) {result=
false;
break;}
2949 else{memcpy(&
slot[s].z_46,data,
sizeof(
slot[s].z_46)); result=
true;
break;}
2950 default: result=
false;
break;
2965 default:
slot[s].options &= ~(1<<0) ;
break;
2974 if(mode){
slot[s].options |= (1<<0);}
2975 else{
slot[s].options &=~(1<<0);}
2989 default:
slot[s].options &= ~(1<<2) ;
break;
2999 if(mode){
slot[s].options |= (1<<2);}
3000 else{
slot[s].options &=~(1<<2);}
3014 default:
slot[s].options &= ~(1<<2) ;
break;
3023 if(mode){
slot[s].options |= (1<<4);}
3024 else{
slot[s].options &=~(1<<4);}
3043 case ATB_WAIT:
slot[s].options &= ~(1<<6);
slot[s].options |= (1<<7);
break;
3044 default:
slot[s].options &=~(1<<6);
slot[s].options&= ~(1<<7);
break;
3067 if(mode){
slot[s].options |= (1<<8);}
3068 else{
slot[s].options &=~(1<<8);}
3087 case MAGIC_RAI:
slot[s].options &=~(1<<10);
slot[s].options &=~(1<<11);
slot[s].options &= ~(1<<12);
break;
3088 case MAGIC_RIA:
slot[s].options |=(1<<10);
slot[s].options &=~(1<<11);
slot[s].options &= ~(1<<12);
break;
3089 case MAGIC_AIR:
slot[s].options &=~(1<<10);
slot[s].options |=(1<<11);
slot[s].options &= ~(1<<12);
break;
3090 case MAGIC_ARI:
slot[s].options |=(1<<10);
slot[s].options |=(1<<11);
slot[s].options &= ~(1<<12);
break;
3091 case MAGIC_IRA:
slot[s].options &=~(1<<10);
slot[s].options &=~(1<<11);
slot[s].options |= (1<<12);
break;
3092 case MAGIC_IAR:
slot[s].options |=(1<<10);
slot[s].options &=~(1<<11);
slot[s].options |= (1<<12);
break;
3093 default:
slot[s].options &=~(1<<10);
slot[s].options &=~(1<<11);
slot[s].options &= ~(1<<12);
break;
3104 if(shown){
slot[s].options |=(1<<14);}
3105 else{
slot[s].options &= ~(1<<14);}
3113 if(speed !=
slot[s].battlespeed)
3115 if(speed<0 || speed>255){speed=0;}
3116 else{
slot[s].battlespeed=speed;}
3124 if(speed !=
slot[s].fieldmspeed)
3126 if(speed<0 || speed>255){speed=0;}
3127 else{
slot[s].fieldmspeed=speed;}
3135 if(speed !=
slot[s].battlemspeed)
3137 if(speed<0 || speed>255){speed=0;}
3138 else{
slot[s].battlemspeed=speed;}
3147 if(shown){
slot[s].field_help |= (1<<0);}
3148 else{
slot[s].field_help &= ~(1<<0);}
3157 if(shown){
slot[s].tut_sub |= (1<<6);}
3158 else{
slot[s].tut_sub &= ~(1<<6);}
3168 slot[s].options= opt;
3175 for(
int i=0;i<16;i++){temp.append(
slot[s].controller_map[i]);}
3182 if(map.length()>16){map.chop(16);}
3185 memcpy(&
slot[s].controller_map,map,16);
3191 if(button<0 || button >15){
return;}
3194 if(
slot[s].controller_map[action] != button)
3196 slot[s].controller_map[action]= button;
3203 if(s<0 || s>14){
return false;}
3204 if(who<0 || who>8){
return false;}
3205 else{
return ((
slot[s].phsvisible) & (1<<who));}
3209 if(s<0 || s>14){
return;}
3210 else if(who<0 || who >8){
return;}
3213 if(checked){
slot[s].phsvisible |= (1<<who);}
3214 else {
slot[s].phsvisible &= ~(1<<who);}
3220 if(s<0 || s>14){
return;}
3221 if(phs_visible!=
slot[s].phsvisible)
3223 slot[s].phsvisible=phs_visible;
3229 if(s<0 || s>14){
return 0;}
3230 else{
return slot[s].phsvisible;}
3235 if(s<0 || s>14){
return false;}
3236 if(who<0 || who>8){
return false;}
3237 else{
return ((
slot[s].phsallowed) & (1<<who));}
3241 if(s<0 || s>14){
return 0;}
3242 else{
return slot[s].phsallowed;}
3247 if(s<0 || s>14){
return;}
3248 else if(who<0 || who >8){
return;}
3251 if(checked){
slot[s].phsallowed |= (1<<who);}
3252 else {
slot[s].phsallowed &= ~(1<<who);}
3258 if(s<0 || s>14){
return;}
3259 if(phs_visible!=
slot[s].phsallowed)
3261 slot[s].phsallowed=phs_visible;
3267 if(s<0 || s>14){
return false;}
3268 if(index<0 || index>9){
return false;}
3269 else{
return ((
slot[s].menu_visible) & (1<<index));}
3273 if(s<0 || s>14){
return;}
3274 else if(index<0 || index >9){
return;}
3277 if(checked){
slot[s].menu_visible |= (1<<index);}
3278 else {
slot[s].menu_visible &= ~(1<<index);}
3284 if(s<0 || s>14){
return;}
3285 if(menu_visible!=
slot[s].menu_visible)
3287 slot[s].menu_visible=menu_visible;
3293 if(s<0 || s>14){
return 0;}
3294 else{
return slot[s].menu_visible;}
3299 if(s<0 || s>14){
return false;}
3300 if(index<0 || index>9){
return false;}
3301 else{
return ((
slot[s].menu_locked) & (1<<index));}
3305 if(s<0 || s>14){
return;}
3306 else if(index<0 || index >9){
return;}
3309 if(checked){
slot[s].menu_locked |= (1<<index);}
3310 else {
slot[s].menu_locked &= ~(1<<index);}
3316 if(s<0 || s>14){
return;}
3317 if(menu_locked!=
slot[s].menu_locked)
3319 slot[s].menu_locked=menu_locked;
3325 if(s<0 || s>14){
return 0;}
3326 else{
return slot[s].menu_locked;}
3330 if(s<0 || s>14){
return 0;}
3331 else{
return slot[s].locationid;}
3336 if(s<0 || s>14){
return;}
3337 else if (locationID ==
locationId(s)){
return;}
3340 slot[s].locationid = locationID;
3346 if(s<0 || s>14){
return 0;}
3347 else{
return slot[s].mapid;}
3352 if(s<0 || s>14){
return;}
3353 else if (mapID ==
mapId(s)){
return;}
3356 slot[s].mapid = mapID;
3362 if(s<0 || s>14){
return 0;}
3363 else{
return slot[s].coord.x;}
3368 if(s<0 || s>14){
return;}
3372 slot[s].coord.x = x;
3378 if(s<0 || s>14){
return 0;}
3379 else{
return slot[s].coord.y;}
3384 if(s<0 || s>14){
return;}
3388 slot[s].coord.y = y;
3394 if(s<0 || s>14){
return 0;}
3395 else{
return slot[s].coord.t;}
3400 if(s<0 || s>14){
return;}
3404 slot[s].coord.t = t;
3410 if(s<0 || s>14){
return 0;}
3411 else{
return slot[s].coord.d;}
3416 if(s<0 || s>14){
return;}
3420 slot[s].coord.d = d;
3427 if(s<0 || s>14){
return 0;}
3430 return slot[s].condorfunds;
3438 slot[s].condorfunds=value;
3444 if(s<0 || s>14){
return 0;}
3445 else{
return slot[s].condorwins;}
3454 if(s<0 || s>14){
return 0;}
3455 else{
return slot[s].condorlosses;}
3465 QList<FF7CHOCOBO> chocos;
3466 for(
int i=0;i<6;i++){chocos.append(
chocobo(s,i));}
3472 QList<quint16> stamina;
3473 for(
int i=0;i<6;i++){stamina.append(this->
chocoStamina(s,i));}
3479 QList<QString> names;
3480 for(
int i=0;i<6;i++){names.append(
chocoName(s,i));}
3491 if(s<0 ||s>14){
return 0;}
3492 else{
return slot[s].stables;}
3496 if(s<0 ||s>14){
return;}
3497 else if(value<0 || value>6){
return;}
3503 if(s<0 ||s>14){
return 0;}
3504 else{
return slot[s].stablesoccupied;}
3508 if(s<0 ||s>14){
return;}
3509 else if(value<0 || value>6){
return;}
3515 if(s<0 ||s>14){
return 0;}
3516 else{
return slot[s].chocobomask;}
3521 if(s<0 ||s>14){
return;}
3528 for(
int i=0;i<4;i++){pens.append(
slot[s].pennedchocos[i]);}
3533 if(s<0 || s>14 || pen<0 || pen>3){
return 0;}
3534 else{
return slot[s].pennedchocos[pen];}
3538 if(s<0 || s>14 || pen<0 || pen>3 || value<0 || value>8){
return;}
3544 if(s<0 || s>14){
return 0;}
3546 qint32 seconds =
slot[s].timer[0] |(
slot[s].timer[1] << 8) | (
slot[s].timer[2]<<16);
3552 if(s<0 ||s>14){
return;}
3555 slot[s].timer[0]=(time & 0xff);
3556 slot[s].timer[1]=((time & 0xff00) >> 8);
3557 slot[s].timer[2]=((time & 0xff0000) >> 16);
3563 if(s<0 ||s>14){
return false;}
3564 else{
return (
slot[s].seenpandora&(1<<0));}
3568 if(seen){
slot[s].seenpandora |= (1<<0);}
3569 else{
slot[s].seenpandora &= ~(1<<0);}
3574 if(s<0 || s>14){
return 0;}
3575 else{
return slot[s].steps;}
3579 if(s<0 || s>14){
return;}
3582 if(steps<0){steps=0;}
3583 else if(steps>0xFFFF){steps=0xFFFF;}
3584 if(steps !=
slot[s].mprogress)
3593 if(s<0 || s>14){
return 0;}
3594 else{
return slot[s].aeris_church;}
3598 if(s<0 || s>14){
return;}
3601 if(progress<0){progress=0;}
3602 if(progress>0xFF){progress=0xFF;}
3603 if(progress !=
slot[s].aeris_church)
3605 slot[s].aeris_church = progress;
3613 if(s<0 || s>14){
return 0;}
3614 else{
return slot[s].donprogress;}
3618 if(s<0 || s>14){
return;}
3621 if(progress<0){progress=0;}
3622 if(progress>0xFF){progress=0xFF;}
3623 if(progress !=
slot[s].donprogress)
3625 slot[s].donprogress = progress;
3632 if(s<0 || s>14){
return false;}
3635 if(
slot[s].intbombing == 0x14){
return true;}
3641 if(s<0 || s>14){
return;}
3645 if(isTrue &&
slot[s].intbombing !=0x14)
3647 slot[s].intbombing = 0x14;
3652 if(
slot[s].intbombing!=0x56)
3654 slot[s].intbombing = 0x56;
3662 if(s<0 || s>14){
return 0;}
3663 else{
return (
slot[s].u_weapon_hp[0] |(
slot[s].u_weapon_hp[1] << 8) | (
slot[s].u_weapon_hp[2] << 16));}
3667 if(s<0 || s>14){
return;}
3672 int a = (hp & 0xff);
3673 int b = (hp & 0xff00) >> 8;
3674 int c = (hp & 0xff0000) >> 16;
3675 slot[s].u_weapon_hp[0] = a;
3676 slot[s].u_weapon_hp[1] = b;
3677 slot[s].u_weapon_hp[2] = c;
3684 if(s<0 || s>14){
return false;}
3687 if((
slot[s].ruby_emerald)&(1<<4)){
return true;}
3693 if(s<0 ||s>14){
return;}
3698 if(isTrue){
slot[s].ruby_emerald |= (1<<4);}
3699 else{
slot[s].ruby_emerald &= ~(1<<4);}
3707 if(s<0 || s>14){
return false;}
3710 if((
slot[s].ruby_emerald)&(1<<3)){
return true;}
3717 if(s<0 ||s>14){
return;}
3722 if(isTrue){
slot[s].ruby_emerald |= (1<<3);}
3723 else{
slot[s].ruby_emerald &= ~(1<<3);}
3730 if(s<0 || s>14){
return 0;}
3731 else{
return slot[s].tut_save;}
3735 if(s<0 || s>14){
return;}
3736 if(value<0){value =0;}
3737 if(value>0xFF){value =0xFF;}
3738 if(value !=
slot[s].tut_save)
3740 slot[s].tut_save=value;
3746 if(s<0 || s>14){
return false;}
3747 else{
return (
slot[s].yuffieforest) & (1<<0);}
3751 if(s<0 ||s>14){
return;}
3756 if(isTrue){
slot[s].yuffieforest |= (1<<0);}
3757 else{
slot[s].yuffieforest &= ~(1<<0);}
3764 if(s<0 || s>14){
return 0;}
3765 else{
return slot[s].tut_sub;}
3769 if(bit <0 || bit> 7){
return false;}
3770 else{
return ((
slot[s].tut_sub)& (1<<bit) );}
3774 if(s<0 || s>14){
return;}
3775 else if(bit<0 || bit >7){
return;}
3779 if(isTrue){
slot[s].tut_sub |= (1<<bit);}
3780 else{
slot[s].tut_sub &= ~(1<<bit);}
3786 if(s<0||s>14){
return;}
3789 if(value<0){value=0;}
3790 else if(value>0xFF){value=0xFF;}
3791 if(value !=
slot[s].tut_sub)
3793 slot[s].tut_sub = value;
3800 if(s<0 || s>14){
return false;}
3801 else{
return (
slot[s].reg_yuffie & (1<<0));}
3805 if(s<0 || s>14){
return;}
3808 if(isUnlocked){
slot[s].reg_yuffie |= (1<<0);}
3809 else{
slot[s].reg_yuffie &= ~(1<<0);}
3816 if(s<0 || s>14){
return false;}
3817 else{
return (
slot[s].reg_vinny&(1<<2));}
3822 if(s<0 || s>14){
return;}
3825 if(isUnlocked){
slot[s].reg_vinny |= (1<<2);}
3826 else{
slot[s].reg_vinny &= ~(1<<2);}
3833 if(bit <0 || bit> 7){
return false;}
3834 else{
return ((
slot[s].world_map_chocobos)& (1<<bit) );}
3839 if(s<0 || s>14){
return;}
3840 else if(bit<0 || bit >7){
return;}
3843 if(isTrue){
slot[s].world_map_chocobos |= (1<<bit);}
3844 else{
slot[s].world_map_chocobos &= ~(1<<bit);}
3851 if(bit <0 || bit> 7){
return false;}
3852 else{
return ((
slot[s].world_map_vehicles)& (1<<bit) );}
3857 if(s<0 || s>14){
return;}
3858 else if(bit<0 || bit >7){
return;}
3861 if(isTrue){
slot[s].world_map_vehicles |= (1<<bit);}
3862 else{
slot[s].world_map_vehicles &= ~(1<<bit);}
3868 if(s<0 || s>14){
return 0;}
3871 if(firstChunk){
return slot[s].l_world;}
3872 else{
return slot[s].l_world2;}
3877 if(s<0 || s>14){
return 0;}
3878 else{
return (
slot[s].l_world &0x7FFFF);}
3882 if(s<0 || s>14){
return 0;}
3883 else{
return ((
slot[s].l_world >> 19)&0x1F);}
3887 if(s<0 || s>14){
return 0;}
3888 else{
return ((
slot[s].l_world) >> 24);}
3892 if(s<0 || s>14){
return 0;}
3893 else{
return ((
slot[s].l_world2) & 0x3FFFF);}
3897 if(s<0 || s>14){
return 0;}
3898 else{
return ((
slot[s].l_world2) >> 18);}
3902 if(s<0 || s>14){
return;}
3903 if(value<0){value =0;}
3904 if(value>0xFFFF){value =0xFFFF;}
3907 slot[s].l_world=value;
3914 slot[s].l_world2=value;
3921 if(s<0 || s>14){
return;}
3922 if(value<0){value=0;}
3923 if(value>295000){value=295000;}
3932 if(s<0 || s>14){
return;}
3933 if(value<0){value=0;}
3934 if(value>255){value=255;}
3943 if(s<0 || s>14){
return;}
3944 if(value<0){value=0;}
3945 if(value>360){value=360;}
3954 if(s<0 || s>14){
return;}
3955 if(value<0){value=0;}
3956 if(value>230000){value=230000;}
3966 if(s<0 || s>14){
return;}
3967 if(value<0){value=0;}
3968 if(value>255){value=255;}
3977 if(s<0 || s>14){
return 0;}
3980 if(firstChunk){
return slot[s].tc_world;}
3981 else{
return slot[s].tc_world2;}
3986 if(s<0 || s>14){
return 0;}
3987 else{
return (
slot[s].tc_world &0x7FFFF);}
3991 if(s<0 || s>14){
return 0;}
3992 else{
return ((
slot[s].tc_world >> 19)&0x1F);}
3996 if(s<0 || s>14){
return 0;}
3997 else{
return ((
slot[s].tc_world) >> 24);}
4001 if(s<0 || s>14){
return 0;}
4002 else{
return ((
slot[s].tc_world2) & 0x3FFFF);}
4006 if(s<0 || s>14){
return 0;}
4007 else{
return ((
slot[s].tc_world2) >> 18);}
4011 if(s<0 || s>14){
return;}
4012 if(value<0){value =0;}
4013 if(value>0xFFFF){value =0xFFFF;}
4016 slot[s].tc_world=value;
4023 slot[s].tc_world2=value;
4030 if(s<0 || s>14){
return;}
4031 if(value<0){value=0;}
4032 if(value>295000){value=295000;}
4041 if(s<0 || s>14){
return;}
4042 if(value<0){value=0;}
4043 if(value>255){value=255;}
4052 if(s<0 || s>14){
return;}
4053 if(value<0){value=0;}
4054 if(value>360){value=360;}
4063 if(s<0 || s>14){
return;}
4064 if(value<0){value=0;}
4065 if(value>230000){value=230000;}
4075 if(s<0 || s>14){
return;}
4076 if(value<0){value=0;}
4077 if(value>255){value=255;}
4086 if(s<0 || s>14){
return 0;}
4089 if(firstChunk){
return slot[s].bh_world;}
4090 else{
return slot[s].bh_world2;}
4095 if(s<0 || s>14){
return 0;}
4096 else{
return (
slot[s].bh_world &0x7FFFF);}
4100 if(s<0 || s>14){
return 0;}
4101 else{
return ((
slot[s].bh_world >> 19)&0x1F);}
4105 if(s<0 || s>14){
return 0;}
4106 else{
return ((
slot[s].bh_world) >> 24);}
4110 if(s<0 || s>14){
return 0;}
4111 else{
return ((
slot[s].bh_world2) & 0x3FFFF);}
4115 if(s<0 || s>14){
return 0;}
4116 else{
return ((
slot[s].bh_world2) >> 18);}
4120 if(s<0 || s>14){
return;}
4121 if(value<0){value =0;}
4122 if(value>0xFFFF){value =0xFFFF;}
4125 slot[s].bh_world=value;
4132 slot[s].bh_world2=value;
4139 if(s<0 || s>14){
return;}
4140 if(value<0){value=0;}
4141 if(value>295000){value=295000;}
4150 if(s<0 || s>14){
return;}
4151 if(value<0){value=0;}
4152 if(value>255){value=255;}
4161 if(s<0 || s>14){
return;}
4162 if(value<0){value=0;}
4163 if(value>360){value=360;}
4172 if(s<0 || s>14){
return;}
4173 if(value<0){value=0;}
4174 if(value>230000){value=230000;}
4184 if(s<0 || s>14){
return;}
4185 if(value<0){value=0;}
4186 if(value>255){value=255;}
4196 if(s<0 || s>14){
return 0;}
4199 if(firstChunk){
return slot[s].sub_world;}
4200 else{
return slot[s].sub_world2;}
4205 if(s<0 || s>14){
return 0;}
4206 else{
return (
slot[s].sub_world &0x7FFFF);}
4210 if(s<0 || s>14){
return 0;}
4211 else{
return ((
slot[s].sub_world >> 19)&0x1F);}
4215 if(s<0 || s>14){
return 0;}
4216 else{
return ((
slot[s].sub_world) >> 24);}
4220 if(s<0 || s>14){
return 0;}
4221 else{
return ((
slot[s].sub_world2) & 0x3FFFF);}
4225 if(s<0 || s>14){
return 0;}
4226 else{
return ((
slot[s].sub_world2) >> 18);}
4230 if(s<0 || s>14){
return;}
4231 if(value<0){value =0;}
4232 if(value>0xFFFF){value =0xFFFF;}
4235 slot[s].sub_world=value;
4242 slot[s].sub_world2=value;
4249 if(s<0 || s>14){
return;}
4250 if(value<0){value=0;}
4251 if(value>295000){value=295000;}
4260 if(s<0 || s>14){
return;}
4261 if(value<0){value=0;}
4262 if(value>255){value=255;}
4271 if(s<0 || s>14){
return;}
4272 if(value<0){value=0;}
4273 if(value>360){value=360;}
4282 if(s<0 || s>14){
return;}
4283 if(value<0){value=0;}
4284 if(value>230000){value=230000;}
4294 if(s<0 || s>14){
return;}
4295 if(value<0){value=0;}
4296 if(value>255){value=255;}
4306 if(s<0 || s>14){
return 0;}
4309 if(firstChunk){
return slot[s].wc_world;}
4310 else{
return slot[s].wc_world2;}
4315 if(s<0 || s>14){
return 0;}
4316 else{
return (
slot[s].wc_world &0x7FFFF);}
4320 if(s<0 || s>14){
return 0;}
4321 else{
return ((
slot[s].wc_world >> 19)&0x1F);}
4325 if(s<0 || s>14){
return 0;}
4326 else{
return ((
slot[s].wc_world) >> 24);}
4330 if(s<0 || s>14){
return 0;}
4331 else{
return ((
slot[s].wc_world2) & 0x3FFFF);}
4335 if(s<0 || s>14){
return 0;}
4336 else{
return ((
slot[s].wc_world2) >> 18);}
4340 if(s<0 || s>14){
return;}
4341 if(value<0){value =0;}
4342 if(value>0xFFFF){value =0xFFFF;}
4345 slot[s].wc_world=value;
4352 slot[s].wc_world2=value;
4359 if(s<0 || s>14){
return;}
4360 if(value<0){value=0;}
4361 if(value>295000){value=295000;}
4370 if(s<0 || s>14){
return;}
4371 if(value<0){value=0;}
4372 if(value>255){value=255;}
4381 if(s<0 || s>14){
return;}
4382 if(value<0){value=0;}
4383 if(value>360){value=360;}
4392 if(s<0 || s>14){
return;}
4393 if(value<0){value=0;}
4394 if(value>230000){value=230000;}
4404 if(s<0 || s>14){
return;}
4405 if(value<0){value=0;}
4406 if(value>255){value=255;}
4417 if(s<0 || s>14){
return 0;}
4420 if(firstChunk){
return slot[s].durw_world;}
4421 else{
return slot[s].durw_world2;}
4426 if(s<0 || s>14){
return 0;}
4427 else{
return (
slot[s].durw_world &0x7FFFF);}
4431 if(s<0 || s>14){
return 0;}
4432 else{
return ((
slot[s].durw_world >> 19)&0x1F);}
4436 if(s<0 || s>14){
return 0;}
4437 else{
return ((
slot[s].durw_world) >> 24);}
4441 if(s<0 || s>14){
return 0;}
4442 else{
return ((
slot[s].durw_world2) & 0x3FFFF);}
4446 if(s<0 || s>14){
return 0;}
4447 else{
return ((
slot[s].durw_world2) >> 18);}
4451 if(s<0 || s>14){
return;}
4452 if(value<0){value =0;}
4453 if(value>0xFFFF){value =0xFFFF;}
4456 slot[s].durw_world=value;
4463 slot[s].durw_world2=value;
4470 if(s<0 || s>14){
return;}
4471 if(value<0){value=0;}
4472 if(value>295000){value=295000;}
4481 if(s<0 || s>14){
return;}
4482 if(value<0){value=0;}
4483 if(value>255){value=255;}
4492 if(s<0 || s>14){
return;}
4493 if(value<0){value=0;}
4494 if(value>360){value=360;}
4503 if(s<0 || s>14){
return;}
4504 if(value<0){value=0;}
4505 if(value>230000){value=230000;}
4515 if(s<0 || s>14){
return;}
4516 if(value<0){value=0;}
4517 if(value>255){value=255;}
4526 if(s<0 || s>14){
return 0;}
4529 return slot[s].cratersaveMapId;
4534 if(s<0 || s>14){
return;}
4535 else if(value<0 || value>999){
return;}
4538 slot[s].cratersaveMapId=value;
4544 if(s<0 || s>14){
return 0;}
4547 return slot[s].cratersaveX;
4552 if(s<0 || s>14){
return;}
4553 else if(value<-32767 || value > 32767){
return;}
4556 slot[s].cratersaveX=value;
4563 if(s<0 || s>14){
return 0;}
4566 return slot[s].cratersaveY;
4571 if(s<0 || s>14){
return;}
4572 else if(value<-32767 || value > 32767){
return;}
4575 slot[s].cratersaveY=value;
4581 if(s<0 || s>14){
return 0;}
4584 return slot[s].cratersaveZ;
4589 if(s<0 || s>14){
return;}
4590 else if(value<-32767 || value > 32767){
return;}
4593 slot[s].cratersaveZ=value;
4601 QStringList us = QStringList()<<QString(
"FF7-S01")<<QString(
"FF7-S02")<<QString(
"FF7-S03")<<QString(
"FF7-S04")<<QString(
"FF7-S05")<<QString(
"FF7-S06")<<QString(
"FF7-S07")<<QString(
"FF7-S08")<<QString(
"FF7-S09")<<QString(
"FF7-S10")<<QString(
"FF7-S11")<<QString(
"FF7-S12")<<QString(
"FF7-S13")<<QString(
"FF7-S14")<<QString(
"FF7-S15");
4602 QStringList uk = us;
4603 QStringList fr = us;
4604 QStringList ge = us;
4605 QStringList es = us;
4606 QStringList jp = us;
4607 QStringList in = us;
4608 for (
int i=0;i<s;i++)
4610 if(
region(i).contains(
"BASCUS-94163"))
4612 us.replace(
region(i).mid(17,2).toInt()-1,QString(
""));
4614 else if(
region(i).contains(
"BESCES-00867"))
4616 uk.replace(
region(i).mid(17,2).toInt()-1,QString(
""));
4618 else if(
region(i).contains(
"BESCES-00868"))
4620 fr.removeAt(
region(i).mid(17,2).toInt()-1);
4622 else if(
region(i).contains(
"BESCES-00869"))
4624 ge.removeAt(
region(i).mid(17,2).toInt()-1);
4626 else if(
region(i).contains(
"BESCES-00900"))
4628 es.removeAt(
region(i).mid(17,2).toInt()-1);
4630 else if(
region(i).contains(
"BISLPS-00700"))
4632 jp.removeAt(
region(i).mid(17,2).toInt()-1);
4634 else if(
region(i).contains(
"BISLPS-01057"))
4636 in.removeAt(
region(i).mid(17,2).toInt()-1);
4639 QString newRegionString =
region(s).mid(0,12);
4640 if(
region(s).contains(
"BASCUS-94163"))
4642 for(
int i=0;i<15;i++)
4644 if(us.at(i) == QString(
"")){
continue;}
4645 else{newRegionString.append(us.at(i));
break;}
4648 else if(
region(s).contains(
"BESCES-00867"))
4650 for(
int i=0;i<15;i++)
4652 if(uk.at(i).isEmpty()){
continue;}
4653 else{newRegionString.append(uk.at(i));
break;}
4656 else if(
region(s).contains(
"BESCES-00868"))
4658 for(
int i=0;i<15;i++)
4660 if(fr.at(i).isEmpty()){
continue;}
4661 else{newRegionString.append(fr.at(i));
break;}
4664 else if(
region(s).contains(
"BESCES-00869"))
4666 for(
int i=0;i<15;i++)
4668 if(ge.at(i).isEmpty()){
continue;}
4669 else{newRegionString.append(ge.at(i));
break;}
4672 else if(
region(s).contains(
"BESCES-00900"))
4674 for(
int i=0;i<15;i++)
4676 if(es.at(i).isEmpty()){
continue;}
4677 else{newRegionString.append(es.at(i));
break;}
4680 else if(
region(s).contains(
"BISLPS-00700"))
4682 for(
int i=0;i<15;i++)
4684 if(jp.at(i).isEmpty()){
continue;}
4685 else{newRegionString.append(jp.at(i));
break;}
4688 else if(
region(s).contains(
"BISLPS-01057"))
4690 for(
int i=0;i<15;i++)
4692 if(in.at(i).isEmpty()){
continue;}
4693 else{newRegionString.append(in.at(i));
break;}
4700 if(s<0 || s>14){
return false;}
4702 if(
slot[s].wonsubgame == 1){
return true;}
4707 if(s<0 || s>14){
return;}
4708 int temp =
slot[s].wonsubgame;
4709 if(won){
slot[s].wonsubgame = 1; }
4710 else{
slot[s].wonsubgame = 0;}
4715 if(s<0 || s>14){
return 0;}
4718 return slot[s].stablechocorating[stable];
4723 if(s<0 || s>14 || stable <0 || stable >5 || rating <0 || rating >8){
return;}
4724 else if(rating ==
slot[s].stablechocorating[stable]){
return;}
4727 slot[s].stablechocorating[stable] = rating;
4733 QList<quint8>ratings;
4734 if(s<0 || s>14){
for(
int i=0;i<6;i++){ratings.append(0);};}
4737 for(
int i=0;i<6;i++){ratings.append(
slot[s].stablechocorating[i]);}
static const QByteArray MC_SAVE_GAME_FILE_ID
quint8 locationD(int s)
direction player is facing on field map
void setCharBaseMp(int s, int char_num, quint16 baseMp)
int worldCoordsLeaderY(int s)
static const int FF7_MC_SAVE_GAME_FOOTER
qint32 charMateriaAp(int s, int who, int mat_num)
quint16 itemDecode(quint16 itemraw)
quint8 chocoPCount(int s, int chocoSlot)
void setWorldCoordsBhX(int s, int value)
static const int FF7_VGS_SAVE_GAME_SIZE
qint8 stablesOccupied(int s)
static const quint8 PSX_SAVE_GAME_FILE_HEADER_S06[0x100]
QByteArray rawCharacterData(int s, int char_num)
void setMessageSpeed(int s, int speed)
quint8 charFlag(int s, int char_num, int flag_num)
QList< QByteArray > slotIcon(int s)
return slots save icon. each new frame will be appended to the list.
quint16 charBaseMp(int s, int char_num)
void setSpeedScore(int s, int rank, quint16 score)
QList< qint8 > chocoboPens(int s)
return the chocobos in the pen outside of the chocobo farm
void setCharMaxHp(int s, int char_num, quint16 maxHp)
void setWorldCoordsBhY(int s, int value)
quint8 charWeapon(int s, int char_num)
static const quint8 PSX_SAVE_GAME_FILE_HEADER_S10[0x100]
QByteArray slotFooter(int s)
Footer for a slot as QByteArray.
void setWorldCoordsTcID(int s, int value)
quint8 itemQty(int s, int item_num)
static const int FF7_DEX_SAVE_GAME_DATA_SIZE
quint8 chocoIntelligence(int s, int chocoSlot)
void setVincentUnlocked(int s, bool isUnlocked)
set if vincent has been unlocked
bool exportVGS(const QString &fileName)
attempt to save fileName as a Virtual Game Station format memory card file
void setPsx_block_next(int s, int next)
void setCharSpi(int s, int char_num, quint8 spi)
void setCraterSavePointMapID(int s, int value)
set the map that the placeable save point is on
void setCharCurrentHp(int s, int char_num, quint16 curHp)
void setCraterSavePointZ(int s, int value)
set z coordinate of the placeable save point
int worldCoordsDurwX(int s)
quint8 stolenMateriaId(int s, int mat_num)
static const int FF7_MC_SAVE_GAME_DATA_SIZE
void setLocationId(int s, quint16 locationID)
set location id save is located on
quint16 charMaxMp(int s, int char_num)
bool setSlotPsxRawData(int s, QByteArray data)
set the slots raw psx data
static const QByteArray PSX_SAVE_GAME_FILE_ID
void setCharDexBonus(int s, int char_num, quint8 dexbonus)
void setPhsAllowed(int s, int who, bool checked)
void setCharLck(int s, int char_num, quint8 lck)
void importSlot(int s=0, QString fileName="", int fileSlot=0)
import from a file into a slot
static const QByteArray PSV_SAVE_GAME_FILE_ID
quint32 countdownTimer(int s)
void setDialogColorUL(int s, QColor color)
void setWorldCoordsDurwAngle(int s, int value)
static const quint8 PSX_SAVE_GAME_FILE_HEADER_S07[0x100]
QByteArray slotPsxRawData(int s)
QByteArray of a psx save (multiblock saves are ok)
void setWorldCoordsWchocoY(int s, int value)
bool setKeyItems(int s, QByteArray data)
int worldCoordsSubID(int s)
bool isFileModified(void)