Skip to content

Commit

Permalink
Add capacity for PS1
Browse files Browse the repository at this point in the history
  • Loading branch information
RedPanda4552 committed Feb 23, 2025
1 parent 915a3af commit 19ac446
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
12 changes: 12 additions & 0 deletions pcsx2/SIO/Memcard/MemcardPS1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "PrecompiledHeader.h"

#include "SIO/Memcard/MemcardPS1.h"
#include "SIO/Memcard/MemcardHostBase.h"

MemcardPS1::MemcardPS1(u32 unifiedSlot)
: MemcardBase(unifiedSlot)
Expand All @@ -15,6 +16,17 @@ Memcard::Type MemcardPS1::GetType()
return Memcard::Type::PS1;
}

bool MemcardPS1::ValidateCapacity()
{
if (this->GetMemcardHost() != nullptr)
{
const u32 fileSize = this->GetMemcardHost()->GetSize();
return fileSize == MemcardPS1::CARD_SIZE_BYTES;
}

return false;
}

void MemcardPS1::ExecuteCommand()
{

Expand Down
3 changes: 3 additions & 0 deletions pcsx2/SIO/Memcard/MemcardPS1.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
class MemcardPS1 : public MemcardBase
{
private:
static constexpr u32 CARD_SIZE_BYTES = 128 * 1024;

u32 currentCommandByte = 0;
bool isMemcardCommand = false;
Memcard::Command currentCommand = Memcard::Command::NOT_SET;
Expand All @@ -15,5 +17,6 @@ class MemcardPS1 : public MemcardBase
~MemcardPS1();

Memcard::Type GetType() override;
bool ValidateCapacity() override;
void ExecuteCommand() override;
};

0 comments on commit 19ac446

Please sign in to comment.