Skip to content

Commit

Permalink
Added default config settings to default cclcc save creation
Browse files Browse the repository at this point in the history
  • Loading branch information
PringlesGang committed Feb 8, 2025
1 parent ac26310 commit f500762
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/games/cclcc/savesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,38 @@ SaveError SaveSystem::CreateSaveFile() {
std::vector<uint8_t> emptyData(SaveFileSize, 0);
Io::WriteArrayBE<uint8_t>(emptyData.data(), stream, SaveFileSize);
assert(stream->Position == SaveFileSize);

stream->Seek(0x8AC, SEEK_SET);
Io::WriteLE(stream, (Uint16)(Default::TextSpeed * 60));
Io::WriteLE(stream, (Uint16)(Default::AutoSpeed * 60));
Io::WriteLE(stream, (Uint8)(Default::GroupVolumes[Audio::ACG_Voice] *
128)); // VOICE2vol
Io::WriteLE(stream, (Uint8)(Default::GroupVolumes[Audio::ACG_Voice] *
128)); // VOICEvol
Io::WriteLE(stream, (Uint8)(Default::GroupVolumes[Audio::ACG_BGM] * 128));
Io::WriteLE(stream,
(Uint8)(Default::GroupVolumes[Audio::ACG_SE] * 128)); // SEvol
Io::WriteLE(
stream,
(Uint8)(Default::GroupVolumes[Audio::ACG_SE] * 0.6 * 128)); // SYSSEvol
Io::WriteLE(stream, (Uint8)(Default::GroupVolumes[Audio::ACG_Movie] * 128));
Io::WriteLE(stream, Default::SyncVoice);
Io::WriteLE(stream, !Default::SkipRead);

stream->Seek(0x8BE, SEEK_SET);
for (size_t i = 0; i < 33; i++) Io::WriteLE(stream, !Default::VoiceMuted[i]);
for (size_t i = 0; i < 33; i++)
Io::WriteLE(stream, (Uint8)(Default::VoiceVolume[i] * 128));

stream->Seek(0x901, SEEK_SET);
Io::WriteLE(stream, Default::SkipVoice);
Io::WriteLE(stream, Default::ShowTipsNotification);

stream->Seek(0x905, SEEK_SET);
Io::WriteLE(stream, Default::AdvanceTextOnDirectionalInput);
Io::WriteLE(stream, Default::DirectionalInputForTrigger);
Io::WriteLE(stream, Default::TriggerStopSkip);

delete stream;

return MountSaveFile();
Expand Down

0 comments on commit f500762

Please sign in to comment.