Revision: 46088
http://sourceforge.net/p/vice-emu/code/46088
Author: gpz
Date: 2026-05-01 21:26:08 +0000 (Fri, 01 May 2026)
Log Message:
-----------
Try to use unique names for snapshot modules (2/3, this renames some snapshot modules)
Modified Paths:
--------------
trunk/vice/src/c64/c64gluelogic.c
trunk/vice/src/c64/cart/c64-generic.c
trunk/vice/src/c64/vsidmemsnapshot.c
trunk/vice/src/c64dtv/c64dtvmemsnapshot.c
trunk/vice/src/cbm2/cart/cbm2-generic.c
trunk/vice/src/event.c
trunk/vice/src/mainc64cpu.c
trunk/vice/src/mainviccpu.c
trunk/vice/src/plus4/cart/plus4-generic.c
trunk/vice/src/scpu64/scpu64gluelogic.c
trunk/vice/src/scpu64/scpu64memsnapshot.c
trunk/vice/src/sid/sid-snapshot.c
trunk/vice/src/vic20/cart/vic20-generic.c
trunk/vice/src/vicii/viciidtv-snapshot.c
trunk/vice/src/viciisc/vicii-snapshot.c
Modified: trunk/vice/src/c64/c64gluelogic.c
===================================================================
--- trunk/vice/src/c64/c64gluelogic.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/c64/c64gluelogic.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -166,7 +166,7 @@
/* ------------------------------------------------------------------------- */
-/* GLUE snapshot module format:
+/* C64GLUE 1.1 snapshot module format:
type | name | description
------------------------------
@@ -173,11 +173,13 @@
BYTE | type | glue logic type
BYTE | old vbank | old video bank
BYTE | alarm active | alarm is active
+
+ NOTE: renamed from "GLUE" to "C64GLUE" in 1.1
*/
-static char snap_module_name[] = "GLUE";
+static char snap_module_name[] = "C64GLUE";
#define SNAP_MAJOR 1
-#define SNAP_MINOR 0
+#define SNAP_MINOR 1
int c64_glue_snapshot_write_module(snapshot_t *s)
{
Modified: trunk/vice/src/c64/cart/c64-generic.c
===================================================================
--- trunk/vice/src/c64/cart/c64-generic.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/c64/cart/c64-generic.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -394,7 +394,7 @@
/* ---------------------------------------------------------------------*/
-/* CARTGENERIC snapshot module format:
+/* CARTGENERICC64 0.1 snapshot module format:
type | name | description
--------------------------
@@ -405,11 +405,13 @@
type | name | description
--------------------------
ARRAY | ROMH | 8192 BYTES of ROMH data
+
+ NOTE: renamed from "CARTGENERIC" to "CARTGENERICC64" in 0.1
*/
-static char snap_module_name[] = "CARTGENERIC";
+static char snap_module_name[] = "CARTGENERICC64";
#define SNAP_MAJOR 0
-#define SNAP_MINOR 0
+#define SNAP_MINOR 1
int generic_snapshot_write_module(snapshot_t *s, int type)
{
Modified: trunk/vice/src/c64/vsidmemsnapshot.c
===================================================================
--- trunk/vice/src/c64/vsidmemsnapshot.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/c64/vsidmemsnapshot.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -52,12 +52,24 @@
#include "c64acia.h"
#endif
+
+/* C64VSIDROM 0.1 snapshot module format:
+
+ type | name | description
+ -----------------------------
+ ARRAY | KERNAL | 8192 BYTES of KERNAL ROM data
+ ARRAY | BASIC | 8192 BYTES of BASIC ROM data
+ ARRAY | CHARGEN | 4096 BYTES of CHARGEN ROM data
+
+ NOTE: renamed from "C64ROM" to "C64VSIDROM" in 0.1
+*/
+
#define SNAP_ROM_MAJOR 0
-#define SNAP_ROM_MINOR 0
+#define SNAP_ROM_MINOR 1
static log_t c64_snapshot_log = LOG_DEFAULT;
-static const char snap_rom_module_name[] = "C64ROM";
+static const char snap_rom_module_name[] = "C64VSIDROM";
static int c64_snapshot_write_rom_module(snapshot_t *s)
{
@@ -133,9 +145,25 @@
return -1;
}
+/* C64VSIDMEM 0.1 snapshot module format:
+
+ type | name | version | description
+ ---------------------------------------------------
+ BYTE | pport data | 0.0+ | CPU port data register
+ BYTE | pport dir | 0.0+ | CPU port direction register
+ BYTE | EXROM | 0.0+ | EXROM line state
+ BYTE | GAME | 0.0+ | GAME line state
+ ARRAY | RAM | 0.0+ | 65536 BYTES of RAM data
+ BYTE | pport data out | 0.0+ | CPU port data out lines state
+ BYTE | pport data read | 0.0+ | CPU port data in lines state
+ BYTE | pport dir read | 0.0+ | CPU port direction in lines state
+
+ NOTE: renamed from "C64MEM" to "C64VSIDMEM" in 0.1
+*/
+
#define SNAP_MAJOR 0
-#define SNAP_MINOR 0
-static const char snap_mem_module_name[] = "C64MEM";
+#define SNAP_MINOR 1
+static const char snap_mem_module_name[] = "C64VSIDMEM";
int c64_snapshot_write_module(snapshot_t *s, int save_roms)
{
Modified: trunk/vice/src/c64dtv/c64dtvmemsnapshot.c
===================================================================
--- trunk/vice/src/c64dtv/c64dtvmemsnapshot.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/c64dtv/c64dtvmemsnapshot.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -51,12 +51,24 @@
#include "c64dtvmemsnapshot.h"
#include "hummeradc.h"
+
+/* C64DTVROM 0.1 snapshot module format:
+
+ type | name | description
+ ------------------------------------------
+ ARRAY | c64dtvflash_mem | 0x200000
+ BYTE | c64dtvflash_state |
+ ARRAY | c64dtvflash_mem_lock | 39
+
+ NOTE: renamed from "C64ROM" to "C64DTVROM" in 0.1
+*/
+
#define SNAP_ROM_MAJOR 0
-#define SNAP_ROM_MINOR 0
+#define SNAP_ROM_MINOR 1
static log_t c64_snapshot_log = LOG_DEFAULT;
-static const char snap_rom_module_name[] = "C64ROM";
+static const char snap_rom_module_name[] = "C64DTVROM";
#define NUM_TRAP_DEVICES 9 /* FIXME: is there a better constant ? */
static int trapfl[NUM_TRAP_DEVICES];
@@ -178,10 +190,27 @@
return -1;
}
+/* C64DTVMEM 0.1 snapshot module format:
+ type | name | description
+ -----------------------------------------------
+ BYTE | pport.data |
+ BYTE | pport.dir |
+ ARRAY | mem_ram | 0x200000
+ BYTE | c64dtvmem_memmapper[0] |
+ BYTE | c64dtvmem_memmapper[1] |
+ BYTE | pport.data_out |
+ BYTE | pport.data_read |
+ BYTE | pport.dir_read |
+
+ followed by ROM modules
+
+ NOTE: renamed from "C64MEM" to "C64DTVMEM" in 0.1
+*/
+
#define SNAP_MAJOR 0
-#define SNAP_MINOR 0
-static const char snap_mem_module_name[] = "C64MEM";
+#define SNAP_MINOR 1
+static const char snap_mem_module_name[] = "C64DTVMEM";
int c64dtv_snapshot_write_module(snapshot_t *s, int save_roms)
{
Modified: trunk/vice/src/cbm2/cart/cbm2-generic.c
===================================================================
--- trunk/vice/src/cbm2/cart/cbm2-generic.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/cbm2/cart/cbm2-generic.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -471,7 +471,7 @@
/* ---------------------------------------------------------------------*/
-/* CARTGENERIC snapshot module format:
+/* CARTGENERICCBM2 0.2 snapshot module format:
type | name | version | description
-------------------------------------------------
@@ -479,13 +479,15 @@
ARRAY | ROM C2 | 0.1+ | 8kiB of ROM data
ARRAY | ROM C4 | 0.1+ | 8kiB of ROM data
ARRAY | ROM C6 | 0.1+ | 8kiB of ROM data
+
+ NOTE: renamed from "CARTGENERIC" to "CARTGENERICCBM2" in 0.2
*/
/* FIXME: the following is completely untested */
-static const char snap_module_name[] = "CARTGENERIC";
+static const char snap_module_name[] = "CARTGENERICCBM2";
#define SNAP_MAJOR 0
-#define SNAP_MINOR 1
+#define SNAP_MINOR 2
int generic_snapshot_write_module(snapshot_t *s)
{
Modified: trunk/vice/src/event.c
===================================================================
--- trunk/vice/src/event.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/event.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -1025,6 +1025,24 @@
/*-----------------------------------------------------------------------*/
+/*
+ EVENT 0.1 snapshot module format:
+
+ Type | Name | Description
+ ----------------------------------------------
+
+ for each event_list_t this is NOT EVENT_TIMESTAMP
+
+ DWORD | type |
+ CLOCK | clock |
+ DWORD | size |
+ ARRAY | data |
+*/
+
+static char snap_module_name[] = "EVENT";
+#define SNAP_MAJOR 0
+#define SNAP_MINOR 1
+
int event_snapshot_read_module(struct snapshot_s *s, int event_mode)
{
snapshot_module_t *m;
@@ -1036,7 +1054,7 @@
return 0;
}
- m = snapshot_module_open(s, "EVENT", &major_version, &minor_version);
+ m = snapshot_module_open(s, snap_module_name, &major_version, &minor_version);
/* This module is not mandatory. */
if (m == NULL) {
@@ -1144,7 +1162,7 @@
return 0;
}
- m = snapshot_module_create(s, "EVENT", 0, 1);
+ m = snapshot_module_create(s, snap_module_name, SNAP_MAJOR, SNAP_MINOR);
if (m == NULL) {
return -1;
Modified: trunk/vice/src/mainc64cpu.c
===================================================================
--- trunk/vice/src/mainc64cpu.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/mainc64cpu.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -880,9 +880,29 @@
/* ------------------------------------------------------------------------- */
-static char snap_module_name[] = "MAINCPU";
+/* MAINC64CPU 1.5 snapshot module format:
+
+ type | name | description
+ ------------------------------------------
+ CLOCK | main clock |
+ UBYTE | a |
+ UBYTE | x |
+ UBYTE | y |
+ UBYTE | sp |
+ WORD | pc |
+ UBYTE | status |
+ DWORD | last_opcode_info |
+ DWORD | ane_log_level |
+ DWORD | lxa_log_level |
+ DWORD | maincpu_jammed |
+ DWORD | maincpu_ba_low_flags |
+
+ Note: renamed "MAINCPU" to "MAINC64CPU" in 1.5
+*/
+
+static char snap_module_name[] = "MAINC64CPU";
#define SNAP_MAJOR 1
-#define SNAP_MINOR 4
+#define SNAP_MINOR 5
int maincpu_snapshot_write_module(snapshot_t *s)
{
Modified: trunk/vice/src/mainviccpu.c
===================================================================
--- trunk/vice/src/mainviccpu.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/mainviccpu.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -707,9 +707,28 @@
/* ------------------------------------------------------------------------- */
-static char snap_module_name[] = "MAINCPU";
+/* MAINVIC20CPU 1.5 snapshot module format:
+
+ type | name | description
+ ------------------------------------------
+ CLOCK | main clock |
+ UBYTE | a |
+ UBYTE | x |
+ UBYTE | y |
+ UBYTE | sp |
+ WORD | pc |
+ UBYTE | status |
+ DWORD | last_opcode_info |
+ DWORD | ane_log_level |
+ DWORD | lxa_log_level |
+ DWORD | maincpu_jammed |
+
+ NOTE: renamed from "MAINCPU" to "MAINVIC20CPU" in 1.5
+*/
+
+static char snap_module_name[] = "MAINVIC20CPU";
#define SNAP_MAJOR 1
-#define SNAP_MINOR 4
+#define SNAP_MINOR 5
int maincpu_snapshot_write_module(snapshot_t *s)
{
Modified: trunk/vice/src/plus4/cart/plus4-generic.c
===================================================================
--- trunk/vice/src/plus4/cart/plus4-generic.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/plus4/cart/plus4-generic.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -413,20 +413,22 @@
/* ---------------------------------------------------------------------*/
-/* CARTGENERIC snapshot module format:
+/* CARTGENERICPLUS4 0.2 snapshot module format:
type | name | version | description
-------------------------------------------------
ARRAY | ROM C1LO | 0.1+ | 16kiB of ROM data
ARRAY | ROM C1HI | 0.1+ | 16kiB of ROM data
+
+ NOTE: renamed from "CARTGENERIC" to "CARTGENERICPLUS4" in 0.2
*/
/* FIXME: since we cant actually make snapshots due to TED bugs, the following
is completely untested */
-static const char snap_module_name[] = "CARTGENERIC";
+static const char snap_module_name[] = "CARTGENERICPLUS4";
#define SNAP_MAJOR 0
-#define SNAP_MINOR 1
+#define SNAP_MINOR 2
int generic_snapshot_write_module(snapshot_t *s)
{
Modified: trunk/vice/src/scpu64/scpu64gluelogic.c
===================================================================
--- trunk/vice/src/scpu64/scpu64gluelogic.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/scpu64/scpu64gluelogic.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -158,9 +158,20 @@
/* ------------------------------------------------------------------------- */
-static char snap_module_name[] = "GLUE";
+/* SCPU64GLUE 1.1 snapshot module format:
+
+ type | name | description
+ -----------------------------------------
+ BYTE | glue_logic_type |
+ BYTE | old_vbank |
+ BYTE | glue_alarm_active |
+
+ NOTE: renamed from "GLUE" to "SCPU64GLUE" in 1.1
+ */
+
+static char snap_module_name[] = "SCPU64GLUE";
#define SNAP_MAJOR 1
-#define SNAP_MINOR 0
+#define SNAP_MINOR 1
int scpu64_glue_snapshot_write_module(snapshot_t *s)
{
Modified: trunk/vice/src/scpu64/scpu64memsnapshot.c
===================================================================
--- trunk/vice/src/scpu64/scpu64memsnapshot.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/scpu64/scpu64memsnapshot.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -51,14 +51,24 @@
#include "c64acia.h"
#endif
+/* C64SCPUROM 0.1 snapshot module format:
+
+ type | name | description
+ ------------------------------------------
+ ARRAY | mem_chargen_rom | SCPU64_CHARGEN_ROM_SIZE
+ ARRAY | scpu64rom_scpu64_rom | SCPU64_SCPU64_ROM_MAXSIZE
+
+ NOTE: renamed from "C64ROM" to "C64SCPUROM" in 0.1
+*/
+
#define SNAP_ROM_MAJOR 0
-#define SNAP_ROM_MINOR 0
+#define SNAP_ROM_MINOR 1
/* ------------------------ */
static log_t c64_snapshot_log = LOG_DEFAULT;
-static const char snap_rom_module_name[] = "C64ROM";
+static const char snap_rom_module_name[] = "C64SCPUROM";
#define NUM_TRAP_DEVICES 9 /* FIXME: is there a better constant ? */
static int trapfl[NUM_TRAP_DEVICES];
@@ -172,9 +182,35 @@
return -1;
}
+/* C64SCPUMEM 0.1 snapshot module format:
+
+ type | name | description
+ ------------------------------------------
+ BYTE | mem_pport |
+ BYTE | mem_reg_soft_1mhz |
+ BYTE | mem_reg_sys_1mhz |
+ BYTE | mem_reg_hwenable |
+ BYTE | mem_reg_dosext |
+ BYTE | mem_reg_ramlink |
+ BYTE | mem_reg_optim |
+ BYTE | mem_reg_bootmap |
+ BYTE | mem_reg_simm |
+ BYTE | exrom |
+ BYTE | game |
+
+ FIXME: cpu state scpu64_snapshot_write_cpu_state()
+
+ DWORD | mem_simm_ram_mask |
+ ARRAY | mem_ram | SCPU64_RAM_SIZE
+ ARRAY | mem_sram | SCPU64_SRAM_SIZE
+ ARRAY | mem_simm_ram | mem_simm_ram_mask + 1
+
+ NOTE: renamed from "C64MEM" to "C64SCPUMEM" in 0.1
+*/
+
#define SNAP_MAJOR 0
-#define SNAP_MINOR 0
-static const char snap_mem_module_name[] = "C64MEM";
+#define SNAP_MINOR 1
+static const char snap_mem_module_name[] = "C64SCPUMEM";
int scpu64_snapshot_write_module(snapshot_t *s, int save_roms)
{
Modified: trunk/vice/src/sid/sid-snapshot.c
===================================================================
--- trunk/vice/src/sid/sid-snapshot.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/sid/sid-snapshot.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -62,7 +62,7 @@
/* ---------------------------------------------------------------------*/
-/* SID snapshot module format:
+/* SID 1.5 snapshot module format:
type | name | version | description
----------------------------------------
@@ -73,7 +73,7 @@
ARRAY | sid data | 1.1+ | 32 BYTES of SID registers
*/
-/* SID2 snapshot module format:
+/* SID2 1.5 snapshot module format:
type | name | version | description
----------------------------------------
@@ -81,7 +81,7 @@
ARRAY | sid data | 1.2+ | 32 BYTES of SID registers
*/
-/* SID3 snapshot module format:
+/* SID3 1.5 snapshot module format:
type | name | version | description
----------------------------------------
@@ -89,7 +89,7 @@
ARRAY | sid data | 1.2+ | 32 BYTES of SID registers
*/
-/* SID4 snapshot module format:
+/* SID4 1.5 snapshot module format:
type | name | version | description
----------------------------------------
@@ -97,7 +97,7 @@
ARRAY | sid data | 1.4+ | 32 BYTES of SID registers
*/
-/* SID5 snapshot module format:
+/* SID5 1.5 snapshot module format:
type | name | version | description
----------------------------------------
@@ -105,7 +105,7 @@
ARRAY | sid data | 1.5+ | 32 BYTES of SID registers
*/
-/* SID6 snapshot module format:
+/* SID6 1.5 snapshot module format:
type | name | version | description
----------------------------------------
@@ -113,7 +113,7 @@
ARRAY | sid data | 1.5+ | 32 BYTES of SID registers
*/
-/* SID7 snapshot module format:
+/* SID7 1.5 snapshot module format:
type | name | version | description
----------------------------------------
@@ -121,7 +121,7 @@
ARRAY | sid data | 1.5+ | 32 BYTES of SID registers
*/
-/* SID8 snapshot module format:
+/* SID8 1.5 snapshot module format:
type | name | version | description
----------------------------------------
@@ -397,7 +397,7 @@
/* ---------------------------------------------------------------------*/
-/* SIDEXTENDED (for fastsid engine) snapshot module format:
+/* SIDFASTSID 1.4 (for fastsid engine) snapshot module format:
type | name | description
--------------------------------------
@@ -626,7 +626,7 @@
/* ---------------------------------------------------------------------*/
-/* SIDEXTENDED (for resid engine) snapshot module format:
+/* SIDRESID 1.4 (for resid engine) snapshot module format:
type | name | description
------------------------------------------------
@@ -737,7 +737,7 @@
/* ---------------------------------------------------------------------*/
-/* SIDEXTENDED (for catweasel engine) snapshot module format:
+/* SIDCWMKIII 1.4 (for catweasel engine) snapshot module format:
type | name | description
---------------------------------------
@@ -781,7 +781,7 @@
/* ---------------------------------------------------------------------*/
-/* SIDEXTENDED (for hardsid engine) snapshot module format:
+/* SIDHARDSID 1.4 (for hardsid engine) snapshot module format:
type | name | version | description
--------------------------------------------------
@@ -853,7 +853,7 @@
/* ---------------------------------------------------------------------*/
-/* SIDEXTENDED (for parsid engine) snapshot module format:
+/* SIDPARSID 1.4 snapshot module format:
type | name | description
-------------------------------
@@ -894,6 +894,16 @@
#endif
#endif
+/* SIDUSBSID 1.4 snapshot module format:
+
+ type | name | description
+ -------------------------------------------
+ ARRAY | registers | (0x20 * 4) BYTES of register data
+ QWORD | main clk |
+ QWORD | alarm clk |
+ BYTE | lastaccess_chipno |
+ */
+
#ifdef HAVE_USBSID
static int sid_snapshot_write_us_module(snapshot_module_t *m, int sidnr)
{
@@ -932,41 +942,71 @@
/* ---------------------------------------------------------------------*/
-static const char snap_module_name_extended1[] = "SIDEXTENDED";
-static const char snap_module_name_extended2[] = "SIDEXTENDED2";
-static const char snap_module_name_extended3[] = "SIDEXTENDED3";
-static const char snap_module_name_extended4[] = "SIDEXTENDED4";
#define SNAP_MAJOR_EXTENDED 1
#define SNAP_MINOR_EXTENDED 4
-static int sid_snapshot_write_module_extended(snapshot_t *s, int sidnr)
+static char snap_module_name_extended[0x20];
+
+static char *sid_snapshot_module_name(int sidnr, int sid_engine)
{
- snapshot_module_t *m;
- int sound;
- int sid_engine = 0;
- const char *snap_module_name_extended = NULL;
-
- switch (sidnr) {
- default:
- case 0:
- snap_module_name_extended = snap_module_name_extended1;
+ char *engine = "EXTENDED";
+ switch (sid_engine) {
+#ifdef HAVE_RESID
+ case SID_ENGINE_RESID:
+ engine = "RESID";
break;
- case 1:
- snap_module_name_extended = snap_module_name_extended2;
+#endif
+#ifdef HAVE_CATWEASELMKIII
+ case SID_ENGINE_CATWEASELMKIII:
+ engine = "CWMKIII";
break;
- case 2:
- snap_module_name_extended = snap_module_name_extended3;
+#endif
+#ifdef HAVE_HARDSID
+ case SID_ENGINE_HARDSID:
+ engine = "HARDSID";
break;
- case 3:
- snap_module_name_extended = snap_module_name_extended4;
+#endif
+#ifdef HAVE_PARSID
+#if !defined(WINDOWS_COMPILE) || (defined(WINDOWS_COMPILE) && defined(HAVE_LIBIEEE1284))
+ case SID_ENGINE_PARSID:
+ engine = "PARSID";
break;
+#endif
+#endif
+#ifdef HAVE_FASTSID
+ case SID_ENGINE_FASTSID:
+ engine = "FASTSID";
+ break;
+#endif
+#ifdef HAVE_USBSID
+ case SID_ENGINE_USBSID:
+ engine = "USBSID";
+ break;
+#endif
}
+ if (sidnr) {
+ sprintf(snap_module_name_extended, "SID%s%d", engine, sidnr);
+ } else {
+ sprintf(snap_module_name_extended, "SID%s", engine);
+ }
+ printf("sid_snapshot_module_name %d '%s' -> '%s'\n", sidnr, engine, snap_module_name_extended);
+ return snap_module_name_extended;
+}
+static int sid_snapshot_write_module_extended(snapshot_t *s, int sidnr)
+{
+ snapshot_module_t *m;
+ int sound;
+ int sid_engine = 0;
+ char *snap_name;
+
resources_get_int("Sound", &sound);
resources_get_int("SidEngine", &sid_engine);
- m = snapshot_module_create(s, snap_module_name_extended, SNAP_MAJOR_EXTENDED, SNAP_MINOR_EXTENDED);
+ snap_name = sid_snapshot_module_name(sidnr, sid_engine);
+ m = snapshot_module_create(s, snap_name, SNAP_MAJOR_EXTENDED, SNAP_MINOR_EXTENDED);
+
if (m == NULL) {
return -1;
}
@@ -1029,29 +1069,15 @@
uint8_t major_version, minor_version;
snapshot_module_t *m;
int sid_engine;
- const char *snap_module_name_extended = NULL;
+ char *snap_name;
int i;
uint8_t *siddata;
resources_get_int("SidEngine", &sid_engine);
- switch (sidnr) {
- default:
- case 0:
- snap_module_name_extended = snap_module_name_extended1;
- break;
- case 1:
- snap_module_name_extended = snap_module_name_extended2;
- break;
- case 2:
- snap_module_name_extended = snap_module_name_extended3;
- break;
- case 3:
- snap_module_name_extended = snap_module_name_extended4;
- break;
- }
+ snap_name = sid_snapshot_module_name(sidnr, sid_engine);
- /* If the sid engine data that was save does not match the current engine
+ /* If the sid engine data that was saved does not match the current engine
then don't try to load the data */
if (intended_sid_engine != sid_engine) {
siddata = sid_get_siddata(sidnr);
@@ -1077,7 +1103,7 @@
return 0;
}
- m = snapshot_module_open(s, snap_module_name_extended, &major_version, &minor_version);
+ m = snapshot_module_open(s, snap_name, &major_version, &minor_version);
if (m == NULL) {
return -1;
@@ -1164,10 +1190,11 @@
}
}
+ /* number of active SIDs */
resources_get_int("SidStereo", &sids);
-
++sids;
+ /* for each SID, write 'simple' and 'extended' snapshot module */
for (i = 0; i < sids; ++i) {
if (sid_snapshot_write_module_simple(s, i) < 0) {
return -1;
@@ -1186,6 +1213,7 @@
int sids = 0;
int i;
+ /* always read 'simple' and 'extended' snapshot module for the first SID */
if (sid_snapshot_read_module_simple(s, 0) < 0) {
return -1;
}
@@ -1194,6 +1222,7 @@
return -1;
}
+ /* number of active SIDs */
resources_get_int("SidStereo", &sids);
++sids;
Modified: trunk/vice/src/vic20/cart/vic20-generic.c
===================================================================
--- trunk/vice/src/vic20/cart/vic20-generic.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/vic20/cart/vic20-generic.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -836,9 +836,21 @@
/* ------------------------------------------------------------------------- */
+/* CARTGENERICVIC20 2.1 snapshot module format:
+
+ type | name | description
+ --------------------------------------
+ DWORD | generic_ram_blocks | flags for ram blocks
+ DWORD | generic_rom_blocks | flags for rom blocks
+ ARRAY | cart_ram | 0x9000 bytes of RAM data
+ ARRAY | cart_rom | 0x9000 bytes of ROM data
+
+ NOTE: renamed from "GENERICCART" to "CARTGENERICVIC20" in 2.1
+*/
+
#define VIC20CART_DUMP_VER_MAJOR 2
-#define VIC20CART_DUMP_VER_MINOR 0
-#define SNAP_MODULE_NAME "GENERICCART"
+#define VIC20CART_DUMP_VER_MINOR 1
+#define SNAP_MODULE_NAME "CARTGENERICVIC20"
int generic_snapshot_write_module(snapshot_t *s)
{
Modified: trunk/vice/src/vicii/viciidtv-snapshot.c
===================================================================
--- trunk/vice/src/vicii/viciidtv-snapshot.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/vicii/viciidtv-snapshot.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -67,52 +67,51 @@
/*
+ DTVVIC 1.3 snapshot module format:
- This is the format of the VIC-II snapshot module.
+ Type | Name | Description
+ ----------------------------------------------
+ BYTE | AllowBadLines | flag: if true, bad lines can happen
+ BYTE | BadLine | flag: this is a bad line
+ BYTE | Blank | flag: draw lines in border color
+ 40*BYTE | ColorBuf | character memory buffer (loaded at bad line)
+ BYTE | IdleState | flag: idle state enabled
+ BYTE | LPTrigger | flag: light pen has been triggered
+ BYTE | LPX | light pen X
+ BYTE | LPY | light pen Y
+ 40*BYTE | MatrixBuf | video matrix buffer (loaded at bad line)
+ BYTE | NewSpriteDmaMask | value for SpriteDmaMask after drawing sprites
+ DWORD | RamBase | pointer to the start of RAM seen by the VIC
+ BYTE | RasterCycle | current vicii.raster cycle
+ WORD | RasterLine | current vicii.raster line
+ 80*BYTE | Registers | VIC-II registers
+ x | DTVstuff | DTV stuff goes here
+ BYTE | SbCollMask | sprite-background collisions so far
+ BYTE | SpriteDmaMask | sprites having DMA turned on
+ BYTE | SsCollMask | sprite-sprite collisions so far
+ BYTE | VBank | location of memory bank
+ WORD | Vc | internal VIC-II counter
+ BYTE | VcAdd | value to add to Vc at the end of this line (vicii.mem_counter_inc)
+ WORD | VcBase | internal VIC-II memory pointer
+ BYTE | VideoInt | status of VIC-II IRQ (vicii.irq_status)
- Name Type Size Description
-
- AllowBadLines BYTE 1 flag: if true, bad lines can happen
- BadLine BYTE 1 flag: this is a bad line
- Blank BYTE 1 flag: draw lines in border color
- ColorBuf BYTE 40 character memory buffer (loaded at bad line)
- IdleState BYTE 1 flag: idle state enabled
- LPTrigger BYTE 1 flag: light pen has been triggered
- LPX BYTE 1 light pen X
- LPY BYTE 1 light pen Y
- MatrixBuf BYTE 40 video matrix buffer (loaded at bad line)
- NewSpriteDmaMask BYTE 1 value for SpriteDmaMask after drawing
- sprites
- RamBase DWORD 1 pointer to the start of RAM seen by the VIC
- RasterCycle BYTE 1 current vicii.raster cycle
- RasterLine WORD 1 current vicii.raster line
- Registers BYTE 80 VIC-II registers
- DTVstuff x x DTV stuff goes here
- SbCollMask BYTE 1 sprite-background collisions so far
- SpriteDmaMask BYTE 1 sprites having DMA turned on
- SsCollMask BYTE 1 sprite-sprite collisions so far
- VBank BYTE 1 location of memory bank
- Vc WORD 1 internal VIC-II counter
- VcAdd BYTE 1 value to add to Vc at the end of this line
- (vicii.mem_counter_inc)
- VcBase WORD 1 internal VIC-II memory pointer
- VideoInt BYTE 1 status of VIC-II IRQ (vicii.irq_status)
-
[Sprite section: (repeat 8 times)]
- SpriteXMemPtr BYTE 1 sprite memory pointer
- SpriteXMemPtrInc BYTE 1 value to add to the MemPtr after fetch
- SpriteXExpFlipFlop BYTE 1 sprite expansion flip-flop
+ BYTE | SpriteXMemPtr | sprite memory pointer
+ BYTE | SpriteXMemPtrInc | value to add to the MemPtr after fetch
+ BYTE | SpriteXExpFlipFlop | sprite expansion flip-flop
[Alarm section]
- FetchEventTick DWORD 1 ticks for the next "fetch" (DMA) event
- FetchEventType BYTE 1 type of event (0: matrix, 1: sprite check, 2: sprite fetch)
+ DWORD | FetchEventTick | ticks for the next "fetch" (DMA) event
+ BYTE | FetchEventType | type of event (0: matrix, 1: sprite check, 2: sprite fetch)
+ NOTE: renamed from "VIC-II" to "DTVVIC" in 1.3
+
*/
-static char snap_module_name[] = "VIC-II";
+static char snap_module_name[] = "DTVVIC";
#define SNAP_MAJOR 1
-#define SNAP_MINOR 2
+#define SNAP_MINOR 3
int vicii_snapshot_write_module(snapshot_t *s)
{
Modified: trunk/vice/src/viciisc/vicii-snapshot.c
===================================================================
--- trunk/vice/src/viciisc/vicii-snapshot.c 2026-05-01 21:17:47 UTC (rev 46087)
+++ trunk/vice/src/viciisc/vicii-snapshot.c 2026-05-01 21:26:08 UTC (rev 46088)
@@ -52,18 +52,61 @@
/*
+ VIC-IISC 1.4 snapshot module format:
- This is the format of the VIC-II snapshot module.
+ Type | Name | Description
+ ------------------------------------------------------
+ ARRAY | regs | 0x40 BYTES state from vicii_s, in the same order
+ DWORD | raster_cycle |
+ DWORD | cycle_flags |
+ DWORD | raster_line |
+ BYTE | start_of_frame |
+ BYTE | irq_status |
+ DWORD | raster_irq_line |
+ BYTE | raster_irq_triggered |
+ ARRAY | vbuf | VICII_SCREEN_TEXTCOLS
+ ARRAY | cbuf | VICII_SCREEN_TEXTCOLS
+ BYTE | gbuf |
+ DWORD | dbuf_offset |
+ ARRAY | dbuf | VICII_DRAW_BUFFER_SIZE
+ DWORD | ysmooth |
+ BYTE | allow_bad_lines |
+ BYTE | sprite_sprite_collisions |
+ BYTE | sprite_background_collisions |
+ BYTE | clear_collisions |
+ DWORD | idle_state |
+ DWORD | vcbase |
+ DWORD | vc |
+ DWORD | rc |
+ DWORD | vmli |
+ DWORD | bad_line |
+ BYTE | light_pen.state |
+ BYTE | light_pen.triggered |
+ DWORD | light_pen.x |
+ DWORD | light_pen.y |
+ DWORD | light_pen.x_extra_bits |
+ CLOCK | light_pen.trigger_cycle |
+ BYTE | reg11_delay |
+ DWORD | prefetch_cycles |
+ DWORD | sprite_display_bits |
+ BYTE | sprite_dma |
+ BYTE | last_color_reg |
+ BYTE | last_color_value |
+ BYTE | last_read_phi1 |
+ BYTE | last_bus_phi2 |
+ BYTE | vborder |
+ BYTE | set_vborder |
+ BYTE | main_border |
+ BYTE | refresh_counter |
+ ARRAY | color_ram | 0x400
- Name Type Size Description
+ NOTE: renamed from "VIC-II" to "VIC-IISC" in 1.4
- (FIXME)
+ */
-*/
-
-static const char snap_module_name[] = "VIC-II";
+static const char snap_module_name[] = "VIC-IISC";
#define SNAP_MAJOR 1
-#define SNAP_MINOR 3
+#define SNAP_MINOR 4
int vicii_snapshot_write_module(snapshot_t *s)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|