-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlibspectrum.h
More file actions
1784 lines (1441 loc) · 87.4 KB
/
libspectrum.h
File metadata and controls
1784 lines (1441 loc) · 87.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* libspectrum.h: the library for dealing with ZX Spectrum emulator files
Copyright (c) 2001-2018 Philip Kendall, Darren Salt, Fredrick Meunier
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Author contact information:
E-mail: philip-fuse@shadowmagic.org.uk
*/
/* NB: This file is autogenerated from libspectrum.h.in. Do not edit
unless you know what you're doing */
#ifndef LIBSPECTRUM_LIBSPECTRUM_H
#define LIBSPECTRUM_LIBSPECTRUM_H
#ifdef __cplusplus
extern "C" {
#endif /* #ifdef __cplusplus */
#include <stdarg.h>
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef _WIN32
/* Exclude rarely used stuff from Windows headers */
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN /**/
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
#else
#include <windows.h>
#endif /* #ifndef WIN32_LEAN_AND_MEAN */
#ifdef LIBSPECTRUM_EXPORTS
#define WIN32_DLL __declspec( dllexport )
#else /* #ifdef LIBSPECTRUM_EXPORTS */
#define WIN32_DLL __declspec( dllimport )
#endif /* #ifdef LIBSPECTRUM_EXPORTS */
#else /* #ifdef _WIN32 */
#define WIN32_DLL
#endif /* #ifdef _WIN32 */
#ifdef __GNUC__
#define DEPRECATED __attribute__((deprecated))
#else /* #ifdef __GNUC__ */
#define DEPRECATED
#endif /* #ifdef __GNUC__ */
/* Standard typedefs */
#include <stdint.h>
typedef uint8_t libspectrum_byte;
typedef int8_t libspectrum_signed_byte;
typedef uint16_t libspectrum_word;
typedef int16_t libspectrum_signed_word;
typedef uint32_t libspectrum_dword;
typedef int32_t libspectrum_signed_dword;
typedef uint64_t libspectrum_qword;
typedef int64_t libspectrum_signed_qword;
/* glib replacement (if necessary) */
#define LIBSPECTRUM_HAS_GLIB_REPLACEMENT 1
#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif
typedef char gchar;
typedef int gint;
typedef long glong;
typedef gint gboolean;
typedef unsigned int guint;
typedef unsigned long gulong;
typedef const void * gconstpointer;
typedef void * gpointer;
typedef struct _GSList GSList;
struct _GSList {
gpointer data;
GSList *next;
};
typedef void (*GFunc) (gpointer data,
gpointer user_data);
typedef gint (*GCompareFunc) (gconstpointer a,
gconstpointer b);
typedef void (*GDestroyNotify) (gpointer data);
typedef void (*GFreeFunc) (gpointer data);
WIN32_DLL GSList *g_slist_insert_sorted (GSList *list,
gpointer data,
GCompareFunc func);
WIN32_DLL GSList *g_slist_insert (GSList *list,
gpointer data,
gint position);
WIN32_DLL GSList *g_slist_append (GSList *list,
gpointer data);
WIN32_DLL GSList *g_slist_prepend (GSList *list,
gpointer data);
WIN32_DLL GSList *g_slist_remove (GSList *list,
gconstpointer data);
WIN32_DLL GSList *g_slist_last (GSList *list);
WIN32_DLL GSList *g_slist_reverse (GSList *list);
WIN32_DLL GSList *g_slist_delete_link (GSList *list,
GSList *link);
WIN32_DLL guint g_slist_length (GSList *list);
WIN32_DLL void g_slist_foreach (GSList *list,
GFunc func,
gpointer user_data);
WIN32_DLL void g_slist_free (GSList *list);
WIN32_DLL GSList *g_slist_nth (GSList *list,
guint n);
WIN32_DLL GSList *g_slist_find_custom (GSList *list,
gconstpointer data,
GCompareFunc func );
WIN32_DLL gint g_slist_position (GSList *list,
GSList *llink);
typedef struct _GHashTable GHashTable;
typedef guint (*GHashFunc) (gconstpointer key);
typedef void (*GHFunc) (gpointer key,
gpointer value,
gpointer user_data);
typedef gboolean (*GHRFunc) (gpointer key,
gpointer value,
gpointer user_data);
WIN32_DLL gint g_int_equal (gconstpointer v,
gconstpointer v2);
WIN32_DLL guint g_int_hash (gconstpointer v);
WIN32_DLL gint g_str_equal (gconstpointer v,
gconstpointer v2);
WIN32_DLL guint g_str_hash (gconstpointer v);
WIN32_DLL GHashTable *g_hash_table_new (GHashFunc hash_func,
GCompareFunc key_compare_func);
WIN32_DLL GHashTable *g_hash_table_new_full (GHashFunc hash_func,
GCompareFunc key_equal_func,
GDestroyNotify key_destroy_func,
GDestroyNotify value_destroy_func);
WIN32_DLL void g_hash_table_destroy (GHashTable *hash_table);
WIN32_DLL void g_hash_table_insert (GHashTable *hash_table,
gpointer key,
gpointer value);
WIN32_DLL gpointer g_hash_table_lookup (GHashTable *hash_table,
gconstpointer key);
WIN32_DLL void g_hash_table_foreach (GHashTable *hash_table,
GHFunc func,
gpointer user_data);
WIN32_DLL guint g_hash_table_foreach_remove (GHashTable *hash_table,
GHRFunc func,
gpointer user_data);
WIN32_DLL guint g_hash_table_size (GHashTable *hash_table);
typedef struct _GArray GArray;
struct _GArray {
/* Public */
gchar *data;
guint len;
/* Private */
guint element_size;
guint allocated;
};
WIN32_DLL GArray* g_array_new( gboolean zero_terminated, gboolean clear,
guint element_size );
WIN32_DLL GArray* g_array_sized_new( gboolean zero_terminated, gboolean clear,
guint element_size, guint reserved_size );
#define g_array_append_val(a,v) g_array_append_vals( a, &(v), 1 );
WIN32_DLL GArray* g_array_append_vals( GArray *array, gconstpointer data, guint len );
#define g_array_index(a,t,i) (*(((t*)a->data)+i))
WIN32_DLL GArray* g_array_set_size( GArray *array, guint length );
WIN32_DLL GArray* g_array_remove_index_fast( GArray *array, guint index );
WIN32_DLL gchar* g_array_free( GArray *array, gboolean free_segment );
#include <TargetConditionals.h>
#ifdef TARGET_RT_64_BIT
#define GINT_TO_POINTER(i) ((gpointer) (glong)(i))
#define GPOINTER_TO_INT(p) ((gint) (glong)(p))
#define GPOINTER_TO_UINT(p) ((guint) (gulong)(p))
#else
#define GINT_TO_POINTER(i) ((gpointer) (i))
#define GPOINTER_TO_INT(p) ((gint) (p))
#define GPOINTER_TO_UINT(p) ((guint) (p))
#endif
/*
* General libspectrum routines
*/
/* Error handling */
/* The various errors which can occur */
typedef enum libspectrum_error {
LIBSPECTRUM_ERROR_NONE = 0,
LIBSPECTRUM_ERROR_WARNING,
LIBSPECTRUM_ERROR_MEMORY,
LIBSPECTRUM_ERROR_UNKNOWN,
LIBSPECTRUM_ERROR_CORRUPT,
LIBSPECTRUM_ERROR_SIGNATURE,
LIBSPECTRUM_ERROR_SLT, /* .slt data found at end of a .z80 file */
LIBSPECTRUM_ERROR_INVALID, /* Invalid parameter supplied */
LIBSPECTRUM_ERROR_LOGIC = -1,
} libspectrum_error;
/* Library capabilities */
/* we support snapshots etc. requiring zlib (e.g. compressed szx) */
#define LIBSPECTRUM_SUPPORTS_ZLIB_COMPRESSION (1)
/* zlib (de)compression routines */
WIN32_DLL libspectrum_error
libspectrum_zlib_inflate( const libspectrum_byte *gzptr, size_t gzlength,
libspectrum_byte **outptr, size_t *outlength );
WIN32_DLL libspectrum_error
libspectrum_zlib_compress( const libspectrum_byte *data, size_t length,
libspectrum_byte **gzptr, size_t *gzlength );
/* Initialisation */
WIN32_DLL libspectrum_error libspectrum_init( void );
WIN32_DLL void libspectrum_end( void );
/* Version checking */
WIN32_DLL int libspectrum_check_version( const char *version );
WIN32_DLL const char *libspectrum_version( void );
WIN32_DLL const char *libspectrum_gcrypt_version( void );
/* Error handling */
typedef libspectrum_error
(*libspectrum_error_function_t)( libspectrum_error error,
const char *format, va_list ap );
extern WIN32_DLL libspectrum_error_function_t libspectrum_error_function;
WIN32_DLL libspectrum_error
libspectrum_default_error_function( libspectrum_error error,
const char *format, va_list ap );
/* Memory allocators */
typedef void* (*libspectrum_malloc_fn_t)( size_t size );
typedef void* (*libspectrum_calloc_fn_t)( size_t nmemb, size_t size );
typedef void* (*libspectrum_realloc_fn_t)( void *ptr, size_t size );
typedef void (*libspectrum_free_fn_t)( void *ptr );
typedef struct libspectrum_mem_vtable_t {
libspectrum_malloc_fn_t malloc;
libspectrum_calloc_fn_t calloc;
libspectrum_realloc_fn_t realloc;
libspectrum_free_fn_t free;
} libspectrum_mem_vtable_t;
WIN32_DLL void* libspectrum_malloc( size_t size );
WIN32_DLL void* libspectrum_malloc_n( size_t nmemb, size_t size );
WIN32_DLL void* libspectrum_malloc0_n( size_t nmemb, size_t size );
WIN32_DLL void* libspectrum_realloc( void *ptr, size_t size );
WIN32_DLL void* libspectrum_realloc_n( void *ptr, size_t nmemb, size_t size );
WIN32_DLL void libspectrum_free( void *ptr );
WIN32_DLL void libspectrum_mem_set_vtable( libspectrum_mem_vtable_t *table );
#define libspectrum_new( type, count ) \
( ( type * ) libspectrum_malloc_n( (count), sizeof( type ) ) )
#define libspectrum_new0( type, count ) \
( ( type * ) libspectrum_malloc0_n( (count), sizeof( type ) ) )
#define libspectrum_renew( type, mem, count ) \
( ( type * ) libspectrum_realloc_n( (void *)mem, (count), sizeof( type ) ) )
/* Deprecated */
#define libspectrum_calloc libspectrum_malloc0_n
/* Attempt to identify a given file */
/* Various types of file we might manage to identify */
typedef enum libspectrum_id_t {
/* These types present in all versions of libspectrum */
LIBSPECTRUM_ID_UNKNOWN = 0, /* Unidentified file */
LIBSPECTRUM_ID_RECORDING_RZX, /* RZX input recording */
LIBSPECTRUM_ID_SNAPSHOT_SNA, /* .sna snapshot */
LIBSPECTRUM_ID_SNAPSHOT_Z80, /* .z80 snapshot */
LIBSPECTRUM_ID_TAPE_TAP, /* Z80-style .tap tape image */
LIBSPECTRUM_ID_TAPE_TZX, /* TZX tape image */
/* Below here, present only in 0.1.1 and later */
/* The next entry is deprecated in favour of the more specific
LIBSPECTRUM_ID_DISK_CPC and LIBSPECTRUM_ID_DISK_ECPC */
LIBSPECTRUM_ID_DISK_DSK, /* .dsk +3 disk image */
LIBSPECTRUM_ID_DISK_SCL, /* .scl TR-DOS disk image */
LIBSPECTRUM_ID_DISK_TRD, /* .trd TR-DOS disk image */
LIBSPECTRUM_ID_CARTRIDGE_DCK, /* .dck Timex cartridge image */
/* Below here, present only in 0.2.0 and later */
LIBSPECTRUM_ID_TAPE_WARAJEVO, /* Warajevo-style .tap tape image */
LIBSPECTRUM_ID_SNAPSHOT_PLUSD, /* DISCiPLE/+D snapshot */
LIBSPECTRUM_ID_SNAPSHOT_SP, /* .sp snapshot */
LIBSPECTRUM_ID_SNAPSHOT_SNP, /* .snp snapshot */
LIBSPECTRUM_ID_SNAPSHOT_ZXS, /* .zxs snapshot (zx32) */
LIBSPECTRUM_ID_SNAPSHOT_SZX, /* .szx snapshot (Spectaculator) */
/* Below here, present only in 0.2.1 and later */
LIBSPECTRUM_ID_COMPRESSED_BZ2, /* bzip2 compressed file */
LIBSPECTRUM_ID_COMPRESSED_GZ, /* gzip compressed file */
/* Below here, present only in 0.2.2 and later */
LIBSPECTRUM_ID_HARDDISK_HDF, /* .hdf hard disk image */
LIBSPECTRUM_ID_CARTRIDGE_IF2, /* .rom Interface 2 cartridge image */
/* Below here, present only in 0.3.0 and later */
LIBSPECTRUM_ID_MICRODRIVE_MDR, /* .mdr microdrive cartridge */
LIBSPECTRUM_ID_TAPE_CSW, /* .csw tape image */
LIBSPECTRUM_ID_TAPE_Z80EM, /* Z80Em tape image */
/* Below here, present only in 0.4.0 and later */
LIBSPECTRUM_ID_TAPE_WAV, /* .wav tape image */
LIBSPECTRUM_ID_TAPE_SPC, /* SP-style .spc tape image */
LIBSPECTRUM_ID_TAPE_STA, /* Speculator-style .sta tape image */
LIBSPECTRUM_ID_TAPE_LTP, /* Nuclear ZX-style .ltp tape image */
LIBSPECTRUM_ID_COMPRESSED_XFD, /* xfdmaster (Amiga) compressed file */
LIBSPECTRUM_ID_DISK_IMG, /* .img DISCiPLE/+D disk image */
LIBSPECTRUM_ID_DISK_MGT, /* .mgt DISCiPLE/+D disk image */
/* Below here, present only in 0.5.0 and later */
LIBSPECTRUM_ID_DISK_UDI, /* .udi generic disk image */
LIBSPECTRUM_ID_DISK_FDI, /* .fdi generic disk image */
LIBSPECTRUM_ID_DISK_CPC, /* .dsk plain CPC +3 disk image */
LIBSPECTRUM_ID_DISK_ECPC, /* .dsk extended CPC +3 disk image */
LIBSPECTRUM_ID_DISK_SAD, /* .sad generic disk image */
LIBSPECTRUM_ID_DISK_TD0, /* .td0 generic disk image */
/* Below here, present only in 1.0.0 and later */
LIBSPECTRUM_ID_DISK_OPD, /* .opu/.opd Opus Discovery disk image */
/* Below here, present only in 1.1.0 and later */
LIBSPECTRUM_ID_TAPE_PZX, /* PZX tape image */
LIBSPECTRUM_ID_AUX_POK, /* POKE file */
/* Below here, present only in 1.2.0 and later */
LIBSPECTRUM_ID_DISK_D80, /* .d80/.d40 Didaktik disk image */
/* Below here, present only in 1.2.2 and later */
LIBSPECTRUM_ID_COMPRESSED_ZIP, /* zip compressed file */
/* Below here, present only in 1.3.5 and later */
LIBSPECTRUM_ID_SCREEN_SCR, /* .scr screen file */
/* Below here, present only in 1.4.0 and later */
LIBSPECTRUM_ID_SCREEN_MLT, /* .mlt screen file */
} libspectrum_id_t;
/* And 'classes' of file */
typedef enum libspectrum_class_t {
LIBSPECTRUM_CLASS_UNKNOWN,
LIBSPECTRUM_CLASS_CARTRIDGE_TIMEX, /* Timex cartridges */
LIBSPECTRUM_CLASS_DISK_PLUS3, /* +3 disk */
LIBSPECTRUM_CLASS_DISK_TRDOS, /* TR-DOS disk */
LIBSPECTRUM_CLASS_DISK_OPUS, /* Opus Discovery disk*/
LIBSPECTRUM_CLASS_RECORDING, /* Input recording */
LIBSPECTRUM_CLASS_SNAPSHOT, /* Snapshot */
LIBSPECTRUM_CLASS_TAPE, /* Tape */
/* Below here, present only in 0.2.1 and later */
LIBSPECTRUM_CLASS_COMPRESSED, /* A compressed file */
/* Below here, present only in 0.2.2 and later */
LIBSPECTRUM_CLASS_HARDDISK, /* A hard disk image */
LIBSPECTRUM_CLASS_CARTRIDGE_IF2, /* Interface 2 cartridges */
/* Below here, present only in 0.3.0 and later */
LIBSPECTRUM_CLASS_MICRODRIVE, /* Microdrive cartridges */
/* Below here, present only in 0.4.0 and later */
LIBSPECTRUM_CLASS_DISK_PLUSD, /* DISCiPLE/+D disk image */
/* Below here, present only in 0.5.0 and later */
LIBSPECTRUM_CLASS_DISK_GENERIC, /* generic disk image */
/* Below here, present only in 1.1.0 and later */
LIBSPECTRUM_CLASS_AUXILIARY, /* auxiliary supported file */
/* Below here, present only in 1.2.0 and later */
LIBSPECTRUM_CLASS_DISK_DIDAKTIK, /* Didaktik disk */
/* Below here, present only in 1.3.5 and later */
LIBSPECTRUM_CLASS_SCREENSHOT, /* Screenshot */
} libspectrum_class_t;
typedef struct libspectrum_buffer libspectrum_buffer;
WIN32_DLL libspectrum_buffer*
libspectrum_buffer_alloc( void );
WIN32_DLL void
libspectrum_buffer_reallocate( libspectrum_buffer *buffer, size_t new_size );
WIN32_DLL void
libspectrum_buffer_free( libspectrum_buffer *buffer );
WIN32_DLL int
libspectrum_buffer_is_empty( const libspectrum_buffer *buffer );
WIN32_DLL int
libspectrum_buffer_is_not_empty( const libspectrum_buffer *buffer );
WIN32_DLL void
libspectrum_buffer_write_byte( libspectrum_buffer *buffer,
libspectrum_byte data );
WIN32_DLL void
libspectrum_buffer_write_word( libspectrum_buffer *buffer,
libspectrum_word data );
WIN32_DLL void
libspectrum_buffer_write_dword( libspectrum_buffer *buffer,
libspectrum_dword data );
WIN32_DLL void
libspectrum_buffer_write_buffer( libspectrum_buffer *dest,
const libspectrum_buffer *src );
WIN32_DLL void
libspectrum_buffer_write( libspectrum_buffer *buffer, const void *data,
size_t size );
WIN32_DLL void
libspectrum_buffer_set( libspectrum_buffer *buffer, libspectrum_byte value,
size_t size );
WIN32_DLL size_t
libspectrum_buffer_get_data_size( const libspectrum_buffer *buffer );
WIN32_DLL libspectrum_byte*
libspectrum_buffer_get_data( const libspectrum_buffer *buffer );
WIN32_DLL void
libspectrum_buffer_clear( libspectrum_buffer *buffer );
WIN32_DLL void
libspectrum_buffer_append( libspectrum_byte **buffer, size_t *length,
libspectrum_byte **ptr,
const libspectrum_buffer *src );
WIN32_DLL libspectrum_error
libspectrum_identify_file( libspectrum_id_t *type, const char *filename,
const unsigned char *buffer, size_t length );
WIN32_DLL libspectrum_error
libspectrum_identify_file_with_class(
libspectrum_id_t *type, libspectrum_class_t *libspectrum_class,
const char *filename, const unsigned char *buffer, size_t length );
WIN32_DLL libspectrum_error
libspectrum_identify_file_raw( libspectrum_id_t *type, const char *filename,
const unsigned char *buffer, size_t length );
WIN32_DLL libspectrum_error
libspectrum_identify_class( libspectrum_class_t *libspectrum_class,
libspectrum_id_t type );
/* Different Spectrum variants and their capabilities */
/* The machine types we can handle */
typedef enum libspectrum_machine {
LIBSPECTRUM_MACHINE_48,
LIBSPECTRUM_MACHINE_TC2048,
LIBSPECTRUM_MACHINE_128,
LIBSPECTRUM_MACHINE_PLUS2,
LIBSPECTRUM_MACHINE_PENT,
LIBSPECTRUM_MACHINE_PLUS2A,
LIBSPECTRUM_MACHINE_PLUS3,
/* Used by libspectrum_tape_guess_hardware if we can't work out what
hardware should be used */
LIBSPECTRUM_MACHINE_UNKNOWN,
LIBSPECTRUM_MACHINE_16,
LIBSPECTRUM_MACHINE_TC2068,
LIBSPECTRUM_MACHINE_SCORP,
LIBSPECTRUM_MACHINE_PLUS3E,
LIBSPECTRUM_MACHINE_SE,
LIBSPECTRUM_MACHINE_TS2068,
LIBSPECTRUM_MACHINE_PENT512,
LIBSPECTRUM_MACHINE_PENT1024,
LIBSPECTRUM_MACHINE_48_NTSC,
LIBSPECTRUM_MACHINE_128E,
} libspectrum_machine;
WIN32_DLL const char* libspectrum_machine_name( libspectrum_machine type );
/* The various capabilities of the different machines */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_AY; /* AY-3-8192 */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_128_MEMORY; /* 128-style memory paging */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_PLUS3_MEMORY; /* +3-style memory paging */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_PLUS3_DISK; /* +3-style disk drive */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_MEMORY; /* Timex-style memory paging */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_VIDEO; /* Timex-style video modes */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_TRDOS_DISK; /* TRDOS-style disk drive */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_DOCK; /* T[SC]2068-style cartridge port */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_SINCLAIR_JOYSTICK;
/* Sinclair-style joystick ports */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_KEMPSTON_JOYSTICK;
/* Kempston-style joystick ports */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_SCORP_MEMORY; /* Scorpion-style memory paging */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_EVEN_M1;
/* M1 cycles always start on even tstate counts */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_SE_MEMORY; /* SE-style memory paging */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_NTSC; /* NTSC display */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_PENT512_MEMORY; /* Pentagon 512 memory paging */
extern WIN32_DLL const int
LIBSPECTRUM_MACHINE_CAPABILITY_PENT1024_MEMORY;
/* Pentagon 1024 memory paging */
/* Get the capabilities of a machine */
WIN32_DLL int libspectrum_machine_capabilities( libspectrum_machine type );
/* Get the timings of a machine */
WIN32_DLL libspectrum_dword
libspectrum_timings_processor_speed( libspectrum_machine machine );
WIN32_DLL libspectrum_dword
libspectrum_timings_ay_speed( libspectrum_machine machine );
WIN32_DLL libspectrum_word
libspectrum_timings_left_border( libspectrum_machine machine );
WIN32_DLL libspectrum_word
libspectrum_timings_horizontal_screen( libspectrum_machine machine );
WIN32_DLL libspectrum_word
libspectrum_timings_right_border( libspectrum_machine machine );
WIN32_DLL libspectrum_word
libspectrum_timings_horizontal_retrace( libspectrum_machine machine );
WIN32_DLL libspectrum_word
libspectrum_timings_top_border( libspectrum_machine machine );
WIN32_DLL libspectrum_word
libspectrum_timings_vertical_screen( libspectrum_machine machine );
WIN32_DLL libspectrum_word
libspectrum_timings_bottom_border( libspectrum_machine machine );
WIN32_DLL libspectrum_word
libspectrum_timings_vertical_retrace( libspectrum_machine machine );
WIN32_DLL libspectrum_word
libspectrum_timings_interrupt_length( libspectrum_machine machine );
WIN32_DLL libspectrum_word
libspectrum_timings_top_left_pixel( libspectrum_machine machine );
WIN32_DLL libspectrum_word
libspectrum_timings_tstates_per_line( libspectrum_machine machine );
WIN32_DLL libspectrum_word
libspectrum_timings_lines_per_frame( libspectrum_machine machine );
WIN32_DLL libspectrum_dword
libspectrum_timings_tstates_per_frame( libspectrum_machine machine );
/* Creator information */
typedef struct libspectrum_creator libspectrum_creator;
WIN32_DLL libspectrum_creator*
libspectrum_creator_alloc( void );
WIN32_DLL libspectrum_error
libspectrum_creator_free( libspectrum_creator *creator );
WIN32_DLL libspectrum_error
libspectrum_creator_set_program( libspectrum_creator *creator,
const char *program );
WIN32_DLL const char *
libspectrum_creator_program( libspectrum_creator *creator );
WIN32_DLL libspectrum_error
libspectrum_creator_set_major( libspectrum_creator *creator,
libspectrum_word major );
WIN32_DLL libspectrum_word
libspectrum_creator_major( libspectrum_creator *creator );
WIN32_DLL libspectrum_error
libspectrum_creator_set_minor( libspectrum_creator *creator,
libspectrum_word minor );
WIN32_DLL libspectrum_word
libspectrum_creator_minor( libspectrum_creator *creator );
WIN32_DLL libspectrum_error
libspectrum_creator_set_competition_code( libspectrum_creator *creator,
libspectrum_dword competition_code );
WIN32_DLL libspectrum_dword
libspectrum_creator_competition_code( libspectrum_creator *creator );
WIN32_DLL libspectrum_error
libspectrum_creator_set_custom( libspectrum_creator *creator,
libspectrum_byte *data, size_t length );
WIN32_DLL libspectrum_byte *
libspectrum_creator_custom( libspectrum_creator *creator );
WIN32_DLL size_t
libspectrum_creator_custom_length( libspectrum_creator *creator );
/*
* Snap handling routines
*/
typedef struct libspectrum_snap libspectrum_snap;
WIN32_DLL libspectrum_snap* libspectrum_snap_alloc( void );
WIN32_DLL libspectrum_error libspectrum_snap_free( libspectrum_snap *snap );
/* Read in a snapshot, optionally guessing what type it is */
WIN32_DLL libspectrum_error
libspectrum_snap_read( libspectrum_snap *snap, const libspectrum_byte *buffer,
size_t length, libspectrum_id_t type,
const char *filename );
/* Write a snapshot */
WIN32_DLL libspectrum_error
libspectrum_snap_write( libspectrum_byte **buffer, size_t *length,
int *out_flags, libspectrum_snap *snap,
libspectrum_id_t type, libspectrum_creator *creator,
int in_flags );
/* The flags that can be given to libspectrum_snap_write() */
extern WIN32_DLL const int LIBSPECTRUM_FLAG_SNAPSHOT_NO_COMPRESSION;
extern WIN32_DLL const int LIBSPECTRUM_FLAG_SNAPSHOT_ALWAYS_COMPRESS;
/* The flags that may be returned from libspectrum_snap_write() */
extern WIN32_DLL const int LIBSPECTRUM_FLAG_SNAPSHOT_MINOR_INFO_LOSS;
extern WIN32_DLL const int LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS;
/* The joystick types we can handle */
typedef enum libspectrum_joystick {
LIBSPECTRUM_JOYSTICK_NONE,
LIBSPECTRUM_JOYSTICK_CURSOR,
LIBSPECTRUM_JOYSTICK_KEMPSTON,
LIBSPECTRUM_JOYSTICK_SINCLAIR_1,
LIBSPECTRUM_JOYSTICK_SINCLAIR_2,
LIBSPECTRUM_JOYSTICK_TIMEX_1,
LIBSPECTRUM_JOYSTICK_TIMEX_2,
LIBSPECTRUM_JOYSTICK_FULLER,
} libspectrum_joystick;
WIN32_DLL const char* libspectrum_joystick_name( libspectrum_joystick type );
extern WIN32_DLL const int LIBSPECTRUM_JOYSTICK_INPUT_NONE;
extern WIN32_DLL const int LIBSPECTRUM_JOYSTICK_INPUT_KEYBOARD;
extern WIN32_DLL const int LIBSPECTRUM_JOYSTICK_INPUT_JOYSTICK_1;
extern WIN32_DLL const int LIBSPECTRUM_JOYSTICK_INPUT_JOYSTICK_2;
/* Accessor functions */
WIN32_DLL libspectrum_machine libspectrum_snap_machine( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_machine( libspectrum_snap *snap, libspectrum_machine machine );
WIN32_DLL libspectrum_byte libspectrum_snap_a( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_a( libspectrum_snap *snap, libspectrum_byte a );
WIN32_DLL libspectrum_byte libspectrum_snap_f( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_f( libspectrum_snap *snap, libspectrum_byte f );
WIN32_DLL libspectrum_word libspectrum_snap_bc( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_bc( libspectrum_snap *snap, libspectrum_word bc );
WIN32_DLL libspectrum_word libspectrum_snap_de( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_de( libspectrum_snap *snap, libspectrum_word de );
WIN32_DLL libspectrum_word libspectrum_snap_hl( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_hl( libspectrum_snap *snap, libspectrum_word hl );
WIN32_DLL libspectrum_byte libspectrum_snap_a_( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_a_( libspectrum_snap *snap, libspectrum_byte a_ );
WIN32_DLL libspectrum_byte libspectrum_snap_f_( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_f_( libspectrum_snap *snap, libspectrum_byte f_ );
WIN32_DLL libspectrum_word libspectrum_snap_bc_( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_bc_( libspectrum_snap *snap, libspectrum_word bc_ );
WIN32_DLL libspectrum_word libspectrum_snap_de_( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_de_( libspectrum_snap *snap, libspectrum_word de_ );
WIN32_DLL libspectrum_word libspectrum_snap_hl_( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_hl_( libspectrum_snap *snap, libspectrum_word hl_ );
WIN32_DLL libspectrum_word libspectrum_snap_ix( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_ix( libspectrum_snap *snap, libspectrum_word ix );
WIN32_DLL libspectrum_word libspectrum_snap_iy( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_iy( libspectrum_snap *snap, libspectrum_word iy );
WIN32_DLL libspectrum_byte libspectrum_snap_i( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_i( libspectrum_snap *snap, libspectrum_byte i );
WIN32_DLL libspectrum_byte libspectrum_snap_r( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_r( libspectrum_snap *snap, libspectrum_byte r );
WIN32_DLL libspectrum_word libspectrum_snap_sp( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_sp( libspectrum_snap *snap, libspectrum_word sp );
WIN32_DLL libspectrum_word libspectrum_snap_pc( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_pc( libspectrum_snap *snap, libspectrum_word pc );
WIN32_DLL libspectrum_word libspectrum_snap_memptr( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_memptr( libspectrum_snap *snap, libspectrum_word memptr );
WIN32_DLL libspectrum_byte libspectrum_snap_iff1( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_iff1( libspectrum_snap *snap, libspectrum_byte iff1 );
WIN32_DLL libspectrum_byte libspectrum_snap_iff2( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_iff2( libspectrum_snap *snap, libspectrum_byte iff2 );
WIN32_DLL libspectrum_byte libspectrum_snap_im( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_im( libspectrum_snap *snap, libspectrum_byte im );
WIN32_DLL libspectrum_dword libspectrum_snap_tstates( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_tstates( libspectrum_snap *snap, libspectrum_dword tstates );
WIN32_DLL int libspectrum_snap_halted( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_halted( libspectrum_snap *snap, int halted );
WIN32_DLL int libspectrum_snap_last_instruction_ei( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_last_instruction_ei( libspectrum_snap *snap, int last_instruction_ei );
WIN32_DLL int libspectrum_snap_last_instruction_set_f( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_last_instruction_set_f( libspectrum_snap *snap, int last_instruction_set_f );
WIN32_DLL int libspectrum_snap_custom_rom( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_custom_rom( libspectrum_snap *snap, int custom_rom );
WIN32_DLL size_t libspectrum_snap_custom_rom_pages( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_custom_rom_pages( libspectrum_snap *snap, size_t custom_rom_pages );
WIN32_DLL libspectrum_byte * libspectrum_snap_roms( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_roms( libspectrum_snap *snap, int idx, libspectrum_byte* roms );
WIN32_DLL size_t libspectrum_snap_rom_length( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_rom_length( libspectrum_snap *snap, int idx, size_t rom_length );
WIN32_DLL libspectrum_byte * libspectrum_snap_pages( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_pages( libspectrum_snap *snap, int idx, libspectrum_byte* pages );
WIN32_DLL libspectrum_byte * libspectrum_snap_slt( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_slt( libspectrum_snap *snap, int idx, libspectrum_byte* slt );
WIN32_DLL size_t libspectrum_snap_slt_length( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_slt_length( libspectrum_snap *snap, int idx, size_t slt_length );
WIN32_DLL libspectrum_byte * libspectrum_snap_slt_screen( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_slt_screen( libspectrum_snap *snap, libspectrum_byte* slt_screen );
WIN32_DLL int libspectrum_snap_slt_screen_level( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_slt_screen_level( libspectrum_snap *snap, int slt_screen_level );
WIN32_DLL libspectrum_byte libspectrum_snap_out_ula( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_out_ula( libspectrum_snap *snap, libspectrum_byte out_ula );
WIN32_DLL libspectrum_byte libspectrum_snap_out_128_memoryport( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_out_128_memoryport( libspectrum_snap *snap, libspectrum_byte out_128_memoryport );
WIN32_DLL libspectrum_byte libspectrum_snap_out_plus3_memoryport( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_out_plus3_memoryport( libspectrum_snap *snap, libspectrum_byte out_plus3_memoryport );
WIN32_DLL libspectrum_byte libspectrum_snap_out_ay_registerport( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_out_ay_registerport( libspectrum_snap *snap, libspectrum_byte out_ay_registerport );
WIN32_DLL libspectrum_byte libspectrum_snap_ay_registers( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_ay_registers( libspectrum_snap *snap, int idx, libspectrum_byte ay_registers );
WIN32_DLL libspectrum_byte libspectrum_snap_out_scld_hsr( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_out_scld_hsr( libspectrum_snap *snap, libspectrum_byte out_scld_hsr );
WIN32_DLL libspectrum_byte libspectrum_snap_out_scld_dec( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_out_scld_dec( libspectrum_snap *snap, libspectrum_byte out_scld_dec );
WIN32_DLL int libspectrum_snap_interface1_active( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_interface1_active( libspectrum_snap *snap, int interface1_active );
WIN32_DLL int libspectrum_snap_interface1_paged( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_interface1_paged( libspectrum_snap *snap, int interface1_paged );
WIN32_DLL int libspectrum_snap_interface1_drive_count( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_interface1_drive_count( libspectrum_snap *snap, int interface1_drive_count );
WIN32_DLL int libspectrum_snap_interface1_custom_rom( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_interface1_custom_rom( libspectrum_snap *snap, int interface1_custom_rom );
WIN32_DLL libspectrum_byte * libspectrum_snap_interface1_rom( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_interface1_rom( libspectrum_snap *snap, int idx, libspectrum_byte* interface1_rom );
WIN32_DLL size_t libspectrum_snap_interface1_rom_length( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_interface1_rom_length( libspectrum_snap *snap, int idx, size_t interface1_rom_length );
WIN32_DLL int libspectrum_snap_beta_active( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_beta_active( libspectrum_snap *snap, int beta_active );
WIN32_DLL int libspectrum_snap_beta_paged( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_beta_paged( libspectrum_snap *snap, int beta_paged );
WIN32_DLL int libspectrum_snap_beta_autoboot( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_beta_autoboot( libspectrum_snap *snap, int beta_autoboot );
WIN32_DLL int libspectrum_snap_beta_drive_count( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_beta_drive_count( libspectrum_snap *snap, int beta_drive_count );
WIN32_DLL int libspectrum_snap_beta_custom_rom( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_beta_custom_rom( libspectrum_snap *snap, int beta_custom_rom );
WIN32_DLL int libspectrum_snap_beta_direction( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_beta_direction( libspectrum_snap *snap, int beta_direction );
WIN32_DLL libspectrum_byte libspectrum_snap_beta_system( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_beta_system( libspectrum_snap *snap, libspectrum_byte beta_system );
WIN32_DLL libspectrum_byte libspectrum_snap_beta_track( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_beta_track( libspectrum_snap *snap, libspectrum_byte beta_track );
WIN32_DLL libspectrum_byte libspectrum_snap_beta_sector( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_beta_sector( libspectrum_snap *snap, libspectrum_byte beta_sector );
WIN32_DLL libspectrum_byte libspectrum_snap_beta_data( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_beta_data( libspectrum_snap *snap, libspectrum_byte beta_data );
WIN32_DLL libspectrum_byte libspectrum_snap_beta_status( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_beta_status( libspectrum_snap *snap, libspectrum_byte beta_status );
WIN32_DLL libspectrum_byte * libspectrum_snap_beta_rom( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_beta_rom( libspectrum_snap *snap, int idx, libspectrum_byte* beta_rom );
WIN32_DLL int libspectrum_snap_plusd_active( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_plusd_active( libspectrum_snap *snap, int plusd_active );
WIN32_DLL int libspectrum_snap_plusd_paged( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_plusd_paged( libspectrum_snap *snap, int plusd_paged );
WIN32_DLL int libspectrum_snap_plusd_drive_count( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_plusd_drive_count( libspectrum_snap *snap, int plusd_drive_count );
WIN32_DLL int libspectrum_snap_plusd_custom_rom( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_plusd_custom_rom( libspectrum_snap *snap, int plusd_custom_rom );
WIN32_DLL int libspectrum_snap_plusd_direction( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_plusd_direction( libspectrum_snap *snap, int plusd_direction );
WIN32_DLL libspectrum_byte libspectrum_snap_plusd_control( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_plusd_control( libspectrum_snap *snap, libspectrum_byte plusd_control );
WIN32_DLL libspectrum_byte libspectrum_snap_plusd_track( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_plusd_track( libspectrum_snap *snap, libspectrum_byte plusd_track );
WIN32_DLL libspectrum_byte libspectrum_snap_plusd_sector( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_plusd_sector( libspectrum_snap *snap, libspectrum_byte plusd_sector );
WIN32_DLL libspectrum_byte libspectrum_snap_plusd_data( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_plusd_data( libspectrum_snap *snap, libspectrum_byte plusd_data );
WIN32_DLL libspectrum_byte libspectrum_snap_plusd_status( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_plusd_status( libspectrum_snap *snap, libspectrum_byte plusd_status );
WIN32_DLL libspectrum_byte * libspectrum_snap_plusd_rom( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_plusd_rom( libspectrum_snap *snap, int idx, libspectrum_byte* plusd_rom );
WIN32_DLL libspectrum_byte * libspectrum_snap_plusd_ram( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_plusd_ram( libspectrum_snap *snap, int idx, libspectrum_byte* plusd_ram );
WIN32_DLL int libspectrum_snap_opus_active( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_active( libspectrum_snap *snap, int opus_active );
WIN32_DLL int libspectrum_snap_opus_paged( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_paged( libspectrum_snap *snap, int opus_paged );
WIN32_DLL int libspectrum_snap_opus_drive_count( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_drive_count( libspectrum_snap *snap, int opus_drive_count );
WIN32_DLL int libspectrum_snap_opus_custom_rom( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_custom_rom( libspectrum_snap *snap, int opus_custom_rom );
WIN32_DLL int libspectrum_snap_opus_direction( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_direction( libspectrum_snap *snap, int opus_direction );
WIN32_DLL libspectrum_byte libspectrum_snap_opus_track( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_track( libspectrum_snap *snap, libspectrum_byte opus_track );
WIN32_DLL libspectrum_byte libspectrum_snap_opus_sector( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_sector( libspectrum_snap *snap, libspectrum_byte opus_sector );
WIN32_DLL libspectrum_byte libspectrum_snap_opus_data( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_data( libspectrum_snap *snap, libspectrum_byte opus_data );
WIN32_DLL libspectrum_byte libspectrum_snap_opus_status( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_status( libspectrum_snap *snap, libspectrum_byte opus_status );
WIN32_DLL libspectrum_byte libspectrum_snap_opus_data_reg_a( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_data_reg_a( libspectrum_snap *snap, libspectrum_byte opus_data_reg_a );
WIN32_DLL libspectrum_byte libspectrum_snap_opus_data_dir_a( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_data_dir_a( libspectrum_snap *snap, libspectrum_byte opus_data_dir_a );
WIN32_DLL libspectrum_byte libspectrum_snap_opus_control_a( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_control_a( libspectrum_snap *snap, libspectrum_byte opus_control_a );
WIN32_DLL libspectrum_byte libspectrum_snap_opus_data_reg_b( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_data_reg_b( libspectrum_snap *snap, libspectrum_byte opus_data_reg_b );
WIN32_DLL libspectrum_byte libspectrum_snap_opus_data_dir_b( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_data_dir_b( libspectrum_snap *snap, libspectrum_byte opus_data_dir_b );
WIN32_DLL libspectrum_byte libspectrum_snap_opus_control_b( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_opus_control_b( libspectrum_snap *snap, libspectrum_byte opus_control_b );
WIN32_DLL libspectrum_byte * libspectrum_snap_opus_rom( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_opus_rom( libspectrum_snap *snap, int idx, libspectrum_byte* opus_rom );
WIN32_DLL libspectrum_byte * libspectrum_snap_opus_ram( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_opus_ram( libspectrum_snap *snap, int idx, libspectrum_byte* opus_ram );
WIN32_DLL int libspectrum_snap_zxatasp_active( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_zxatasp_active( libspectrum_snap *snap, int zxatasp_active );
WIN32_DLL int libspectrum_snap_zxatasp_upload( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_zxatasp_upload( libspectrum_snap *snap, int zxatasp_upload );
WIN32_DLL int libspectrum_snap_zxatasp_writeprotect( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_zxatasp_writeprotect( libspectrum_snap *snap, int zxatasp_writeprotect );
WIN32_DLL libspectrum_byte libspectrum_snap_zxatasp_port_a( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_zxatasp_port_a( libspectrum_snap *snap, libspectrum_byte zxatasp_port_a );
WIN32_DLL libspectrum_byte libspectrum_snap_zxatasp_port_b( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_zxatasp_port_b( libspectrum_snap *snap, libspectrum_byte zxatasp_port_b );
WIN32_DLL libspectrum_byte libspectrum_snap_zxatasp_port_c( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_zxatasp_port_c( libspectrum_snap *snap, libspectrum_byte zxatasp_port_c );
WIN32_DLL libspectrum_byte libspectrum_snap_zxatasp_control( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_zxatasp_control( libspectrum_snap *snap, libspectrum_byte zxatasp_control );
WIN32_DLL size_t libspectrum_snap_zxatasp_pages( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_zxatasp_pages( libspectrum_snap *snap, size_t zxatasp_pages );
WIN32_DLL size_t libspectrum_snap_zxatasp_current_page( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_zxatasp_current_page( libspectrum_snap *snap, size_t zxatasp_current_page );
WIN32_DLL libspectrum_byte * libspectrum_snap_zxatasp_ram( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_zxatasp_ram( libspectrum_snap *snap, int idx, libspectrum_byte* zxatasp_ram );
WIN32_DLL int libspectrum_snap_zxcf_active( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_zxcf_active( libspectrum_snap *snap, int zxcf_active );
WIN32_DLL int libspectrum_snap_zxcf_upload( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_zxcf_upload( libspectrum_snap *snap, int zxcf_upload );
WIN32_DLL libspectrum_byte libspectrum_snap_zxcf_memctl( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_zxcf_memctl( libspectrum_snap *snap, libspectrum_byte zxcf_memctl );
WIN32_DLL size_t libspectrum_snap_zxcf_pages( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_zxcf_pages( libspectrum_snap *snap, size_t zxcf_pages );
WIN32_DLL libspectrum_byte * libspectrum_snap_zxcf_ram( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_zxcf_ram( libspectrum_snap *snap, int idx, libspectrum_byte* zxcf_ram );
WIN32_DLL int libspectrum_snap_interface2_active( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_interface2_active( libspectrum_snap *snap, int interface2_active );
WIN32_DLL libspectrum_byte * libspectrum_snap_interface2_rom( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_interface2_rom( libspectrum_snap *snap, int idx, libspectrum_byte* interface2_rom );
WIN32_DLL int libspectrum_snap_dock_active( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_dock_active( libspectrum_snap *snap, int dock_active );
WIN32_DLL libspectrum_byte libspectrum_snap_exrom_ram( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_exrom_ram( libspectrum_snap *snap, int idx, libspectrum_byte exrom_ram );
WIN32_DLL libspectrum_byte * libspectrum_snap_exrom_cart( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_exrom_cart( libspectrum_snap *snap, int idx, libspectrum_byte* exrom_cart );
WIN32_DLL libspectrum_byte libspectrum_snap_dock_ram( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_dock_ram( libspectrum_snap *snap, int idx, libspectrum_byte dock_ram );
WIN32_DLL libspectrum_byte * libspectrum_snap_dock_cart( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_dock_cart( libspectrum_snap *snap, int idx, libspectrum_byte* dock_cart );
WIN32_DLL int libspectrum_snap_issue2( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_issue2( libspectrum_snap *snap, int issue2 );
WIN32_DLL size_t libspectrum_snap_joystick_active_count( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_joystick_active_count( libspectrum_snap *snap, size_t joystick_active_count );
WIN32_DLL libspectrum_joystick libspectrum_snap_joystick_list( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_joystick_list( libspectrum_snap *snap, int idx, libspectrum_joystick joystick_list );
WIN32_DLL int libspectrum_snap_joystick_inputs( libspectrum_snap *snap, int idx );
WIN32_DLL void libspectrum_snap_set_joystick_inputs( libspectrum_snap *snap, int idx, int joystick_inputs );
WIN32_DLL int libspectrum_snap_kempston_mouse_active( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_kempston_mouse_active( libspectrum_snap *snap, int kempston_mouse_active );
WIN32_DLL int libspectrum_snap_simpleide_active( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_simpleide_active( libspectrum_snap *snap, int simpleide_active );
WIN32_DLL int libspectrum_snap_divide_active( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_divide_active( libspectrum_snap *snap, int divide_active );
WIN32_DLL int libspectrum_snap_divide_eprom_writeprotect( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_divide_eprom_writeprotect( libspectrum_snap *snap, int divide_eprom_writeprotect );
WIN32_DLL int libspectrum_snap_divide_paged( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_divide_paged( libspectrum_snap *snap, int divide_paged );
WIN32_DLL libspectrum_byte libspectrum_snap_divide_control( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_divide_control( libspectrum_snap *snap, libspectrum_byte divide_control );
WIN32_DLL size_t libspectrum_snap_divide_pages( libspectrum_snap *snap );
WIN32_DLL void libspectrum_snap_set_divide_pages( libspectrum_snap *snap, size_t divide_pages );
WIN32_DLL libspectrum_byte * libspectrum_snap_divide_eprom( libspectrum_snap *snap, int idx );