From: <fr...@us...> - 2016-05-11 12:02:15
|
Revision: 5477 http://sourceforge.net/p/fuse-emulator/code/5477 Author: fredm Date: 2016-05-11 12:02:13 +0000 (Wed, 11 May 2016) Log Message: ----------- Add skeleton of support for DISCiPLE snapshots [patches:#365]. Modified Paths: -------------- trunk/libspectrum/accessor.pl trunk/libspectrum/doc/libspectrum.txt trunk/libspectrum/hacking/ChangeLog trunk/libspectrum/sna.c trunk/libspectrum/snap_accessors.txt trunk/libspectrum/snapshot.c trunk/libspectrum/szx.c trunk/libspectrum/z80.c Modified: trunk/libspectrum/accessor.pl =================================================================== --- trunk/libspectrum/accessor.pl 2016-05-11 11:35:35 UTC (rev 5476) +++ trunk/libspectrum/accessor.pl 2016-05-11 12:02:13 UTC (rev 5477) @@ -247,6 +247,22 @@ int usource_custom_rom; libspectrum_byte* usource_rom[1]; size_t usource_rom_length[1]; /* Length of the ROM */ + + /* DISCiPLE emulation */ + int disciple_active; + int disciple_paged; + int disciple_inhibit_button; + int disciple_drive_count; + int disciple_custom_rom; + int disciple_direction; + libspectrum_byte disciple_control; + libspectrum_byte disciple_track; + libspectrum_byte disciple_sector; + libspectrum_byte disciple_data; + libspectrum_byte disciple_status; + libspectrum_byte* disciple_rom[1]; + size_t disciple_rom_length[1]; + libspectrum_byte* disciple_ram[1]; }; /* Initialise a libspectrum_snap structure */ Modified: trunk/libspectrum/doc/libspectrum.txt =================================================================== --- trunk/libspectrum/doc/libspectrum.txt 2016-05-11 11:35:35 UTC (rev 5476) +++ trunk/libspectrum/doc/libspectrum.txt 2016-05-11 12:02:13 UTC (rev 5477) @@ -718,6 +718,21 @@ * libspectrum_byte* usource_rom[1] * size_t usource_rom_length[1] +* int disciple_active +* int disciple_paged +* int disciple_inhibit_button +* int disciple_drive_count +* int disciple_custom_rom +* int disciple_direction +* libspectrum_byte disciple_control +* libspectrum_byte disciple_track +* libspectrum_byte disciple_sector +* libspectrum_byte disciple_data +* libspectrum_byte disciple_status +* libspectrum_byte* disciple_rom[1] +* size_t disciple_rom_length[1] +* libspectrum_byte* disciple_ram[1] + Most of those should be fairly self-explanatory; those which may not be are: Modified: trunk/libspectrum/hacking/ChangeLog =================================================================== --- trunk/libspectrum/hacking/ChangeLog 2016-05-11 11:35:35 UTC (rev 5476) +++ trunk/libspectrum/hacking/ChangeLog 2016-05-11 12:02:13 UTC (rev 5477) @@ -1049,3 +1049,6 @@ szx.c,z80.c: add skeleton of support for Currah uSource snapshots (patch #363) (Fred and Sergio). 20160508 szx.c: use Opus flags when writing chunk (Sergio). +20160511 accessor.pl,doc/libspectrum.txt,sna.c,snap_accessors.txt,snapshot.c, + szx.c,z80.c: add skeleton of support for DISCiPLE snapshots (patch + #365) (Fred). Modified: trunk/libspectrum/sna.c =================================================================== --- trunk/libspectrum/sna.c 2016-05-11 11:35:35 UTC (rev 5476) +++ trunk/libspectrum/sna.c 2016-05-11 12:02:13 UTC (rev 5477) @@ -340,6 +340,10 @@ if( libspectrum_snap_usource_active( snap ) ) *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; + /* We don't save the DISCiPLE state at all */ + if( libspectrum_snap_disciple_active( snap ) ) + *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; + ptr = *buffer; write_header( buffer, &ptr, length, snap ); Modified: trunk/libspectrum/snap_accessors.txt =================================================================== --- trunk/libspectrum/snap_accessors.txt 2016-05-11 11:35:35 UTC (rev 5476) +++ trunk/libspectrum/snap_accessors.txt 2016-05-11 12:02:13 UTC (rev 5477) @@ -200,3 +200,18 @@ int usource_custom_rom libspectrum_byte* usource_rom 1 size_t usource_rom_length 1 + +int disciple_active +int disciple_paged +int disciple_inhibit_button +int disciple_drive_count +int disciple_custom_rom +size_t disciple_rom_length 1 +int disciple_direction +libspectrum_byte disciple_control +libspectrum_byte disciple_track +libspectrum_byte disciple_sector +libspectrum_byte disciple_data +libspectrum_byte disciple_status +libspectrum_byte* disciple_rom 1 +libspectrum_byte* disciple_ram 1 Modified: trunk/libspectrum/snapshot.c =================================================================== --- trunk/libspectrum/snapshot.c 2016-05-11 11:35:35 UTC (rev 5476) +++ trunk/libspectrum/snapshot.c 2016-05-11 12:02:13 UTC (rev 5477) @@ -229,6 +229,21 @@ libspectrum_snap_set_usource_rom( snap, 0, NULL ); libspectrum_snap_set_usource_rom_length( snap, 0, 0 ); + libspectrum_snap_set_disciple_active( snap, 0 ); + libspectrum_snap_set_disciple_paged( snap, 0 ); + libspectrum_snap_set_disciple_inhibit_button( snap, 0 ); + libspectrum_snap_set_disciple_drive_count( snap, 0 ); + libspectrum_snap_set_disciple_custom_rom( snap, 0 ); + libspectrum_snap_set_disciple_direction( snap, 0 ); + libspectrum_snap_set_disciple_control( snap, 0 ); + libspectrum_snap_set_disciple_track ( snap, 0 ); + libspectrum_snap_set_disciple_sector( snap, 0 ); + libspectrum_snap_set_disciple_data ( snap, 0 ); + libspectrum_snap_set_disciple_status( snap, 0 ); + libspectrum_snap_set_disciple_rom( snap, 0, NULL ); + libspectrum_snap_set_disciple_rom_length( snap, 0, 0 ); + libspectrum_snap_set_disciple_ram( snap, 0, NULL ); + return snap; } @@ -280,6 +295,11 @@ if( libspectrum_snap_usource_rom( snap, 0 ) ) libspectrum_free( libspectrum_snap_usource_rom( snap, 0 ) ); + if( libspectrum_snap_disciple_rom( snap, 0 ) ) + libspectrum_free( libspectrum_snap_disciple_rom( snap, 0 ) ); + if( libspectrum_snap_disciple_ram( snap, 0 ) ) + libspectrum_free( libspectrum_snap_disciple_ram( snap, 0 ) ); + libspectrum_free( snap ); return LIBSPECTRUM_ERROR_NONE; Modified: trunk/libspectrum/szx.c =================================================================== --- trunk/libspectrum/szx.c 2016-05-11 11:35:35 UTC (rev 5476) +++ trunk/libspectrum/szx.c 2016-05-11 12:02:13 UTC (rev 5477) @@ -2432,6 +2432,10 @@ if( libspectrum_snap_usource_active( snap ) ) *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; + /* We don't save the DISCiPLE state at all */ + if( libspectrum_snap_disciple_active( snap ) ) + *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; + capabilities = libspectrum_machine_capabilities( libspectrum_snap_machine( snap ) ); Modified: trunk/libspectrum/z80.c =================================================================== --- trunk/libspectrum/z80.c 2016-05-11 11:35:35 UTC (rev 5476) +++ trunk/libspectrum/z80.c 2016-05-11 12:02:13 UTC (rev 5477) @@ -1186,6 +1186,11 @@ if( libspectrum_snap_usource_active( snap ) ) *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; + /* .z80 format doesn't save the DISCiPLE state well but we don't support + what is there either */ + if( libspectrum_snap_disciple_active( snap ) ) + *out_flags |= LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; + error = write_header( buffer, &ptr, length, out_flags, snap ); if( error != LIBSPECTRUM_ERROR_NONE ) return error; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |