-
Notifications
You must be signed in to change notification settings - Fork 68
Add save state support #478
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
Open
mattgodbolt
wants to merge
15
commits into
main
Choose a base branch
from
claude/save-state-implementation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit includes: - A comprehensive design document describing the save state implementation plan - Initial skeleton code for the save state functionality - Support for serialization, time travel, and local storage Part of the work for issue #74. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This commit includes: - Unit tests for the SaveState class with component state serialization - Tests for typed array handling in save states - Tests for the TimeTravel class with buffer management - Tests for the SaveStateStorage class with localStorage integration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Add details about: - Unit testing for core save state components - Integration testing for the complete system - Format compatibility testing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Export Flags class from 6502.js to make it available for testing - Fix tests that depend on the Flags class - Remove unused SaveState import in test-6502.js - Update CLAUDE.md with save state implementation details and best practices - Add tests for CPU flags state saving/loading 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Added save state methods to VIA, ACIA, SoundChip, DiscDrive, FDC, and CMOS - Added comprehensive unit tests for all component save state implementations - Fixed WD-FDC loadState to properly update CPU flags - Made Via class exported to facilitate better testing - Ensured all tests are passing with high fidelity state preservation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Created a detailed document describing the B-Em .snp snapshot file format, which will: - Support potential future compatibility with B-Em snapshots - Serve as a reference for testing save state implementations - Document all peripheral state formats in B-Em The documentation covers file structure, section formats, and detailed layouts of all major peripheral components including CPU, memory, VIAs, video, and sound. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Implemented BemSnapshotConverter that: - Imports B-Em .snp files into jsbeeb's SaveState format - Exports jsbeeb SaveState back to B-Em format - Handles different B-Em versions and snapshots components Added both unit and integration tests to verify: - The B-Em snapshot file format is correctly parsed - B-Em snapshot data is correctly converted to jsbeeb format - jsbeeb SaveState data is correctly converted back to B-Em format This provides compatibility with B-Em snapshots for testing and allows users to migrate their saved states between emulators. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
This addresses the issue #74 where loading the same save state multiple times causes keyboard unresponsiveness: 1. Fixed scheduler to clear all tasks when loading state to prevent stale tasks 2. Ensured peripherals (VIA, ACIA) save and load their state properly 3. Added proper error handling in snapshot-ui.js for failed state loads 4. Improved B-Em snapshot support with special handling for version 2 format 5. Added documentation about save state load order importance The key improvement is ensuring the scheduler clears its task queue and peripheral components are properly restored when loading a save state.
- Added saveState/loadState methods to Music5000, ADC, Serial, and TeletextAdaptor - Created comprehensive unit tests for each component - Updated CPU to call the new methods during state saving/loading - Fixed bug in Serial loadState that was overwriting state values 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Wired up the existing saveState/loadState implementations in the SoundChip and WdFdc components to ensure they're properly saved and loaded as part of the emulator state. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Added saveState/loadState methods to the Intel8271 FDC component to properly save and restore disk controller state. Created unit tests to verify the FDC state is correctly persisted and restored. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Simplified SnapshotUI to only require the processor reference, as it handles saving/loading state for all components including the FDC. This fixes the TypeError that occurred when trying to access this.fdc.saveState directly from SnapshotUI. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Added comprehensive saveState and loadState methods to the Tube class to properly save and restore the state of the second processor interface. The implementation preserves all critical tube state including status registers, FIFO buffers, data, and interrupt flags. Created unit tests to verify the Tube state is correctly persisted and restored, and wired up the Tube component to the CPU's state save/load methods. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Update SaveState class to require and store model information - Add ModelManager for creating models from save state info - Update UI to pass model to SaveState constructor - Add model-aware loading process documentation - Export Model and CpuModel classes for testing - Update tests to use model in SaveState TODO: Fix remaining tests to use a mock model for SaveState creation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Features
Closes #74
🤖 Generated with Claude Code