Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osdhistory: don't write history to ps1 cards #579

Merged
merged 1 commit into from Nov 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/OSDHistory.c
Expand Up @@ -16,6 +16,8 @@
#include <stdlib.h>
#include <sys/fcntl.h>
#include <sys/unistd.h>
#include <libmc.h>
#include <libmc-common.h>

#include "include/util.h"
#include "include/OSDHistory.h"
Expand Down Expand Up @@ -124,14 +126,20 @@ static u16 GetTimestamp(void)
int AddHistoryRecord(const char *name)
{
struct HistoryEntry HistoryEntries[MAX_HISTORY_ENTRIES], *NewEntry, OldHistoryEntry;
int i, value, LeastUsedRecord, LeastUsedRecordLaunchCount, LeastUsedRecordTimestamp, NewLaunchCount, result;
int i, value, LeastUsedRecord, LeastUsedRecordLaunchCount, LeastUsedRecordTimestamp, NewLaunchCount, result, mcType;
u8 BlankSlotList[MAX_HISTORY_ENTRIES];
int NumBlankSlots, NumSlotsUsed, IsNewRecord;
char SystemRegionLetter;
char path[32];

DEBUG_PRINTF("Adding history record: %s\n", name);

// Don't write history for ps1 cards
mcGetInfo(0, 0, &mcType, 0, 0);
mcSync(0, NULL, &result);
if (mcType == sceMcTypePS1)
return -1;

// For simplicity, create the data folder immediately if the history file does not exist (unlike the original).
sprintf(path, "mc0:/%s", GetSystemDataPath());
if ((result = LoadHistoryFile(path, HistoryEntries)) != 0) {
Expand Down