Tuesday, July 30, 2024

Snapshot feature implemented for MINIMUM 6502 mode

 


This snapshot feature is for the minimum 6502 emulation target included in c-simple-emu6502-cbm (unified branch).  (This is a bare bones 6502 target with CPU/RAM/ROM/UART.  The UART is MC6850.  See SWEET-16 and vwas6502 previous discussions.)

Ooo.  The screen is so fancy.  F2 or F3 to bring up this screen.  Up/Down make a selection.  Return performs load or save for that slot, or return on the slot number allows up/down to change the slot number.  When loading, the current state is replaced by the state loaded from disk.  When saving, the current state is backed up to disk.  (The reason for the Up/Down/Enter UI choices is that it can be performed by three buttons or touch equivalents with the supported M5Stack devices.)

F2 defaults to SAVE

F3 defaults to LOAD

This is about the simplest way to provide a general load/save functionality without implementing a higher level monitor.  The state includes 6502 CPU, RAM, ROM, minimum settings (where MC6850 is mapped in memory), terminal state, and UART state.  The data is serialized to a binary blob and stored as a single file with the name state01 or such.   Pretty imaginative huh?

So, now you can use the machine language monitor, or Apple 1 BASIC, or whatever you have ported or implemented to this system, and save a current snapshot of the system to restore later.

Example:

6502 hello world

In the example screenshot, I have restored a snapshot from a previous session where I created a program to display the visible ASCII characters 32 through 127.

So in the future, I can expand on the program, save the current state, and resume where I left off another time.  Also the snapshots can be transferred between systems running the emulator.  In my case, I can run on Windows, or M5Stack CoreS3, or Sunton 7".   Switching is a breeze of copying files to/from microSD. 

I hope this feature is useful to others as well!

No comments:

Post a Comment