Skip to content

Add timestamps and overwrite protection to EEPROM dumps - #25

Open
2Crazy4Nick wants to merge 1 commit into
ps2homebrew:masterfrom
2Crazy4Nick:fix/eeprom-dump-timestamp-overwrite
Open

2Crazy4Nick wants to merge 1 commit into
ps2homebrew:masterfrom
2Crazy4Nick:fix/eeprom-dump-timestamp-overwrite

Conversation

@2Crazy4Nick

@2Crazy4Nick 2Crazy4Nick commented Oct 2, 2026 •

Copy link
Copy Markdown

Pull Request checklist

Note: these are not necessarily requirements

  • I reformatted the code with clang-format
  • I checked to make sure my submission worked
  • I am the author of submission or have permission from the original author
  • Requires update of the PS2SDK or other dependencies
  • Others (please specify below)

Pull Request description

  • add a timestamp to the default EEPROM dump filename
  • warn before overwriting an existing dump
  • report cancelled overwrites as Dump cancelled.

This prevents repeated EEPROM dumps from silently overwriting an existing backup.

Tested with the Unix build and verified both overwrite confirmation paths (Y / N).

No dependency changes are required.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The overwrite check can miss unreadable files, and EOF during confirmation causes an infinite loop.

2 open findings
What changed in this PR

Adds timestamped EEPROM dump filenames and overwrite confirmation.

Changes:

  • Appends local timestamps to default dump filenames.
  • Prompts before overwriting existing files.
  • Reports cancelled dumps separately.
File Description
base/​eeprom-main.c Implements timestamped filenames and overwrite handling.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread base/eeprom-main.c
u16 data;

/* Prevent accidental overwrites of existing dumps. */
if ((dump = fopen(filename, "rb")) != NULL)
Comment thread base/eeprom-main.c
Comment on lines +23 to +33
char choice;

fclose(dump);

do
{
PlatShowMessage("File '%s' already exists. Overwrite? (Y/N): ", filename);
choice = getchar();
while (getchar() != '\n')
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants