[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx:[640] trunk
Brought to you by:
fredm
From: <fr...@us...> - 2010-05-26 12:46:47
|
Revision: 640 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=640&view=rev Author: fredm Date: 2010-05-26 12:46:40 +0000 (Wed, 26 May 2010) Log Message: ----------- Update libspectrum.h for FuseGenerator and FuseImporter. Modified Paths: -------------- trunk/FuseGenerator/libspectrum.h trunk/FuseImporter/libspectrum.h Modified: trunk/FuseGenerator/libspectrum.h =================================================================== --- trunk/FuseGenerator/libspectrum.h 2010-05-24 14:23:37 UTC (rev 639) +++ trunk/FuseGenerator/libspectrum.h 2010-05-26 12:46:40 UTC (rev 640) @@ -1,7 +1,7 @@ /* libspectrum.h: the library for dealing with ZX Spectrum emulator files Copyright (c) 2001-2007 Philip Kendall, Darren Salt, Fredrick Meunier - $Id: libspectrum.h.in 4060 2009-07-30 13:21:38Z fredm $ + $Id: libspectrum.h.in 4120 2010-02-21 05:06:56Z fredm $ 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 @@ -38,8 +38,6 @@ #include <stdlib.h> #include <stdio.h> -#include <TargetConditionals.h> - #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN /* Exclude rarely used stuff from Windows @@ -202,6 +200,8 @@ #define g_array_index(a,t,i) (*(((t*)a->data)+i)) GArray* WIN32_DLL g_array_set_size( GArray *array, guint length ); +#include <TargetConditionals.h> + #ifdef TARGET_RT_64_BIT #define GINT_TO_POINTER(i) ((gpointer) (glong)(i)) #define GPOINTER_TO_INT(p) ((gint) (glong)(p)) @@ -210,11 +210,6 @@ #define GPOINTER_TO_INT(p) ((gint) (p)) #endif -/* Library capabilities */ - -/* we support snapshots etc. requiring zlib (e.g. compressed szx) */ -#define LIBSPECTRUM_SUPPORTS_ZLIB_COMPRESSION (1) - /* * General libspectrum routines */ @@ -239,24 +234,40 @@ } 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 */ -libspectrum_error WIN32_DLL libspectrum_init( void ); +WIN32_DLL libspectrum_error libspectrum_init( void ); /* Version checking */ -int WIN32_DLL libspectrum_check_version( const char *version ); -const char WIN32_DLL *libspectrum_version( void ); -const char WIN32_DLL *libspectrum_gcrypt_version( void ); +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 libspectrum_error_function_t WIN32_DLL libspectrum_error_function; +extern WIN32_DLL libspectrum_error_function_t libspectrum_error_function; -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_default_error_function( libspectrum_error error, const char *format, va_list ap ); @@ -274,12 +285,12 @@ libspectrum_free_fn_t free; } libspectrum_mem_vtable_t; -void* WIN32_DLL libspectrum_malloc( size_t size ); -void* WIN32_DLL libspectrum_calloc( size_t nmemb, size_t size ); -void* WIN32_DLL libspectrum_realloc( void *ptr, size_t size ); -void WIN32_DLL libspectrum_free( void *ptr ); +WIN32_DLL void* libspectrum_malloc( size_t size ); +WIN32_DLL void* libspectrum_calloc( size_t nmemb, size_t size ); +WIN32_DLL void* libspectrum_realloc( void *ptr, size_t size ); +WIN32_DLL void libspectrum_free( void *ptr ); -void WIN32_DLL libspectrum_mem_set_vtable( libspectrum_mem_vtable_t *table ); +WIN32_DLL void libspectrum_mem_set_vtable( libspectrum_mem_vtable_t *table ); /* Attempt to identify a given file */ @@ -394,20 +405,20 @@ } libspectrum_class_t; -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_identify_file( libspectrum_id_t *type, const char *filename, const unsigned char *buffer, size_t length ); -libspectrum_error WIN32_DLL +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 ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_identify_file_raw( libspectrum_id_t *type, const char *filename, const unsigned char *buffer, size_t length ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_identify_class( libspectrum_class_t *libspectrum_class, libspectrum_id_t type ); @@ -442,122 +453,122 @@ } libspectrum_machine; -const char* WIN32_DLL libspectrum_machine_name( libspectrum_machine type ); +WIN32_DLL const char* libspectrum_machine_name( libspectrum_machine type ); /* The various capabilities of the different machines */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_AY; /* AY-3-8192 */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_128_MEMORY; /* 128-style memory paging */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_PLUS3_MEMORY; /* +3-style memory paging */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_PLUS3_DISK; /* +3-style disk drive */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_MEMORY; /* Timex-style memory paging */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_VIDEO; /* Timex-style video modes */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_TRDOS_DISK; /* TRDOS-style disk drive */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_DOCK; /* T[SC]2068-style cartridge port */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_SINCLAIR_JOYSTICK; /* Sinclair-style joystick ports */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_KEMPSTON_JOYSTICK; /* Kempston-style joystick ports */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_SCORP_MEMORY; /* Scorpion-style memory paging */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_EVEN_M1; /* M1 cycles always start on even tstate counts */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_SE_MEMORY; /* SE-style memory paging */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_NTSC; /* NTSC display */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_PENT512_MEMORY; /* Pentagon 512 memory paging */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_PENT1024_MEMORY; /* Pentagon 1024 memory paging */ /* Get the capabilities of a machine */ -int WIN32_DLL libspectrum_machine_capabilities( libspectrum_machine type ); +WIN32_DLL int libspectrum_machine_capabilities( libspectrum_machine type ); /* Get the timings of a machine */ -libspectrum_dword WIN32_DLL +WIN32_DLL libspectrum_dword libspectrum_timings_processor_speed( libspectrum_machine machine ); -libspectrum_dword WIN32_DLL +WIN32_DLL libspectrum_dword libspectrum_timings_ay_speed( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_left_border( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_horizontal_screen( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_right_border( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_horizontal_retrace( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_top_border( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_vertical_screen( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_bottom_border( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_vertical_retrace( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_interrupt_length( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_top_left_pixel( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_tstates_per_line( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_lines_per_frame( libspectrum_machine machine ); -libspectrum_dword WIN32_DLL +WIN32_DLL libspectrum_dword libspectrum_timings_tstates_per_frame( libspectrum_machine machine ); /* Creator information */ typedef struct libspectrum_creator libspectrum_creator; -libspectrum_creator* WIN32_DLL +WIN32_DLL libspectrum_creator* libspectrum_creator_alloc( void ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_creator_free( libspectrum_creator *creator ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_creator_set_program( libspectrum_creator *creator, const char *program ); -const char WIN32_DLL * +WIN32_DLL const char * libspectrum_creator_program( libspectrum_creator *creator ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_creator_set_major( libspectrum_creator *creator, libspectrum_word major ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_creator_major( libspectrum_creator *creator ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_creator_set_minor( libspectrum_creator *creator, libspectrum_word minor ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_creator_minor( libspectrum_creator *creator ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_creator_set_competition_code( libspectrum_creator *creator, libspectrum_dword competition_code ); -libspectrum_dword WIN32_DLL +WIN32_DLL libspectrum_dword libspectrum_creator_competition_code( libspectrum_creator *creator ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_creator_set_custom( libspectrum_creator *creator, libspectrum_byte *data, size_t length ); -libspectrum_byte WIN32_DLL * +WIN32_DLL libspectrum_byte * libspectrum_creator_custom( libspectrum_creator *creator ); -size_t WIN32_DLL +WIN32_DLL size_t libspectrum_creator_custom_length( libspectrum_creator *creator ); /* @@ -566,29 +577,29 @@ typedef struct libspectrum_snap libspectrum_snap; -libspectrum_snap* WIN32_DLL libspectrum_snap_alloc( void ); -libspectrum_error WIN32_DLL libspectrum_snap_free( libspectrum_snap *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 */ -libspectrum_error WIN32_DLL +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 */ -libspectrum_error WIN32_DLL +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 const int WIN32_DLL LIBSPECTRUM_FLAG_SNAPSHOT_NO_COMPRESSION; -extern const int WIN32_DLL LIBSPECTRUM_FLAG_SNAPSHOT_ALWAYS_COMPRESS; +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 const int WIN32_DLL LIBSPECTRUM_FLAG_SNAPSHOT_MINOR_INFO_LOSS; -extern const int WIN32_DLL LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; +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 { @@ -605,12 +616,12 @@ } libspectrum_joystick; -const char* WIN32_DLL libspectrum_joystick_name( libspectrum_joystick type ); +WIN32_DLL const char* libspectrum_joystick_name( libspectrum_joystick type ); -extern const int WIN32_DLL LIBSPECTRUM_JOYSTICK_INPUT_NONE; -extern const int WIN32_DLL LIBSPECTRUM_JOYSTICK_INPUT_KEYBOARD; -extern const int WIN32_DLL LIBSPECTRUM_JOYSTICK_INPUT_JOYSTICK_1; -extern const int WIN32_DLL LIBSPECTRUM_JOYSTICK_INPUT_JOYSTICK_2; +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 */ libspectrum_machine WIN32_DLL libspectrum_snap_machine( libspectrum_snap *snap ); @@ -856,8 +867,7 @@ int WIN32_DLL libspectrum_snap_fuller_box_active( libspectrum_snap *snap ); void WIN32_DLL libspectrum_snap_set_fuller_box_active( libspectrum_snap *snap, int fuller_box_active ); int WIN32_DLL libspectrum_snap_melodik_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_melodik_active( libspectrum_snap *snap, int - melodik_active ); +void WIN32_DLL libspectrum_snap_set_melodik_active( libspectrum_snap *snap, int melodik_active ); /* * Tape handling routines @@ -911,15 +921,15 @@ typedef struct _GSList *libspectrum_tape_iterator; /* Some flags */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_BLOCK; /* End of block */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_STOP; /* Stop tape */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_STOP48; /* Stop tape if in 48K mode */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_NO_EDGE; /* Edge isn't really an edge */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LEVEL_LOW; /* Set level low */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LEVEL_HIGH; /* Set level high */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LENGTH_SHORT; -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LENGTH_LONG; -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_TAPE; /* Tape has finished */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_BLOCK; /* End of block */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_STOP; /* Stop tape */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_STOP48; /* Stop tape if in 48K mode */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_NO_EDGE; /* Edge isn't really an edge */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_LEVEL_LOW; /* Set level low */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_LEVEL_HIGH; /* Set level high */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_LENGTH_SHORT; +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_LENGTH_LONG; +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_TAPE; /* Tape has finished */ /* The states which a block can be in */ typedef enum libspectrum_tape_state_type { @@ -936,28 +946,28 @@ } libspectrum_tape_state_type; /* Routines to manipulate tape blocks */ -libspectrum_tape_block* WIN32_DLL +WIN32_DLL libspectrum_tape_block* libspectrum_tape_block_alloc( libspectrum_tape_type type ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_block_free( libspectrum_tape_block *block ); -libspectrum_tape_type WIN32_DLL +WIN32_DLL libspectrum_tape_type libspectrum_tape_block_type( libspectrum_tape_block *block ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_block_set_type( libspectrum_tape_block *block, libspectrum_tape_type type ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_block_init( libspectrum_tape_block *block, libspectrum_tape_block_state *state ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_block_description( char *buffer, size_t length, libspectrum_tape_block *block ); -int WIN32_DLL +WIN32_DLL int libspectrum_tape_block_metadata( libspectrum_tape_block *block ); -libspectrum_dword WIN32_DLL +WIN32_DLL libspectrum_dword libspectrum_tape_block_length( libspectrum_tape_block *block ); /* Accessor functions */ @@ -1019,86 +1029,86 @@ /* A linked list of tape blocks */ typedef struct libspectrum_tape libspectrum_tape; -libspectrum_tape* WIN32_DLL libspectrum_tape_alloc( void ); -libspectrum_error WIN32_DLL libspectrum_tape_clear( libspectrum_tape *tape ); -libspectrum_error WIN32_DLL libspectrum_tape_free( libspectrum_tape *tape ); +WIN32_DLL libspectrum_tape* libspectrum_tape_alloc( void ); +WIN32_DLL libspectrum_error libspectrum_tape_clear( libspectrum_tape *tape ); +WIN32_DLL libspectrum_error libspectrum_tape_free( libspectrum_tape *tape ); /* Read in a tape file, optionally guessing what sort of file it is */ -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_read( libspectrum_tape *tape, const libspectrum_byte *buffer, size_t length, libspectrum_id_t type, const char *filename ); /* Write a tape file */ -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_write( libspectrum_byte **buffer, size_t *length, libspectrum_tape *tape, libspectrum_id_t type ); /* Does this tape structure actually contain a tape? */ -int WIN32_DLL libspectrum_tape_present( const libspectrum_tape *tape ); +WIN32_DLL int libspectrum_tape_present( const libspectrum_tape *tape ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_get_next_edge( libspectrum_dword *tstates, int *flags, libspectrum_tape *tape ); /* Get the current block from the tape */ -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_current_block( libspectrum_tape *tape ); /* Get the state of the active block on the tape */ -libspectrum_tape_state_type WIN32_DLL +WIN32_DLL libspectrum_tape_state_type libspectrum_tape_state( libspectrum_tape *tape ); /* Set the state of the active block on the tape */ -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_set_state( libspectrum_tape *tape, libspectrum_tape_state_type state ); /* Peek at the next block on the tape */ -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_peek_next_block( libspectrum_tape *tape ); /* Peek at the last block on the tape */ -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_peek_last_block( libspectrum_tape *tape ); /* Cause the next block on the tape to be active, initialise it and return it */ -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_select_next_block( libspectrum_tape *tape ); /* Get the position on the tape of the current block */ -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_position( int *n, libspectrum_tape *tape ); /* Select the nth block on the tape */ -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_nth_block( libspectrum_tape *tape, int n ); /* Append a block to the current tape */ -void WIN32_DLL +WIN32_DLL void libspectrum_tape_append_block( libspectrum_tape *tape, libspectrum_tape_block *block ); -void WIN32_DLL +WIN32_DLL void libspectrum_tape_remove_block( libspectrum_tape *tape, libspectrum_tape_iterator it ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_insert_block( libspectrum_tape *tape, libspectrum_tape_block *block, size_t position ); /*** Routines for iterating through a tape ***/ -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_iterator_init( libspectrum_tape_iterator *iterator, libspectrum_tape *tape ); -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_iterator_current( libspectrum_tape_iterator iterator ); -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_iterator_next( libspectrum_tape_iterator *iterator ); /*** Routines for handling the TZX generalised data block symbol table @@ -1115,13 +1125,13 @@ typedef struct libspectrum_tape_generalised_data_symbol libspectrum_tape_generalised_data_symbol; -libspectrum_dword WIN32_DLL libspectrum_tape_generalised_data_symbol_table_symbols_in_block( const libspectrum_tape_generalised_data_symbol_table *table ); -libspectrum_byte WIN32_DLL libspectrum_tape_generalised_data_symbol_table_max_pulses( const libspectrum_tape_generalised_data_symbol_table *table ); -libspectrum_word WIN32_DLL libspectrum_tape_generalised_data_symbol_table_symbols_in_table( const libspectrum_tape_generalised_data_symbol_table *table ); -libspectrum_tape_generalised_data_symbol* WIN32_DLL libspectrum_tape_generalised_data_symbol_table_symbol( const libspectrum_tape_generalised_data_symbol_table *table, size_t which ); +WIN32_DLL libspectrum_dword libspectrum_tape_generalised_data_symbol_table_symbols_in_block( const libspectrum_tape_generalised_data_symbol_table *table ); +WIN32_DLL libspectrum_byte libspectrum_tape_generalised_data_symbol_table_max_pulses( const libspectrum_tape_generalised_data_symbol_table *table ); +WIN32_DLL libspectrum_word libspectrum_tape_generalised_data_symbol_table_symbols_in_table( const libspectrum_tape_generalised_data_symbol_table *table ); +WIN32_DLL libspectrum_tape_generalised_data_symbol* libspectrum_tape_generalised_data_symbol_table_symbol( const libspectrum_tape_generalised_data_symbol_table *table, size_t which ); -libspectrum_tape_generalised_data_symbol_edge_type WIN32_DLL libspectrum_tape_generalised_data_symbol_type( const libspectrum_tape_generalised_data_symbol *symbol ); -libspectrum_word WIN32_DLL libspectrum_tape_generalised_data_symbol_pulse( const libspectrum_tape_generalised_data_symbol *symbol, size_t which ); +WIN32_DLL libspectrum_tape_generalised_data_symbol_edge_type libspectrum_tape_generalised_data_symbol_type( const libspectrum_tape_generalised_data_symbol *symbol ); +WIN32_DLL libspectrum_word libspectrum_tape_generalised_data_symbol_pulse( const libspectrum_tape_generalised_data_symbol *symbol, size_t which ); /* @@ -1130,40 +1140,40 @@ typedef struct libspectrum_rzx libspectrum_rzx; -libspectrum_rzx* WIN32_DLL libspectrum_rzx_alloc( void ); -libspectrum_error WIN32_DLL libspectrum_rzx_free( libspectrum_rzx *rzx ); +WIN32_DLL libspectrum_rzx* libspectrum_rzx_alloc( void ); +WIN32_DLL libspectrum_error libspectrum_rzx_free( libspectrum_rzx *rzx ); -void WIN32_DLL +WIN32_DLL void libspectrum_rzx_start_input( libspectrum_rzx *rzx, libspectrum_dword tstates ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_stop_input( libspectrum_rzx *rzx ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_add_snap( libspectrum_rzx *rzx, libspectrum_snap *snap, int automatic ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_rollback( libspectrum_rzx *rzx, libspectrum_snap **snap ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_rollback_to( libspectrum_rzx *rzx, libspectrum_snap **snap, size_t which ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_store_frame( libspectrum_rzx *rzx, size_t instructions, size_t count, libspectrum_byte *in_bytes ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_start_playback( libspectrum_rzx *rzx, int which, libspectrum_snap **snap ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_playback_frame( libspectrum_rzx *rzx, int *finished, libspectrum_snap **snap ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_playback( libspectrum_rzx *rzx, libspectrum_byte *byte ); /* Get and set the tstate counter */ -size_t WIN32_DLL libspectrum_rzx_tstates( libspectrum_rzx *rzx ); +WIN32_DLL size_t libspectrum_rzx_tstates( libspectrum_rzx *rzx ); /* Get the current frame's instruction count */ -size_t WIN32_DLL libspectrum_rzx_instructions( libspectrum_rzx *rzx ); +WIN32_DLL size_t libspectrum_rzx_instructions( libspectrum_rzx *rzx ); -libspectrum_dword WIN32_DLL libspectrum_rzx_get_keyid( libspectrum_rzx *rzx ); +WIN32_DLL libspectrum_dword libspectrum_rzx_get_keyid( libspectrum_rzx *rzx ); typedef struct libspectrum_signature { @@ -1174,7 +1184,7 @@ } libspectrum_signature; -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_get_signature( libspectrum_rzx *rzx, libspectrum_signature *signature ); @@ -1186,11 +1196,11 @@ } libspectrum_rzx_dsa_key; -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_read( libspectrum_rzx *rzx, const libspectrum_byte *buffer, size_t length ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_write( libspectrum_byte **buffer, size_t *length, libspectrum_rzx *rzx, libspectrum_id_t snap_format, libspectrum_creator *creator, int compress, @@ -1217,22 +1227,22 @@ libspectrum_rzx_insert_snap( libspectrum_rzx *rzx, libspectrum_snap *snap, int where ); -libspectrum_rzx_iterator WIN32_DLL +WIN32_DLL libspectrum_rzx_iterator libspectrum_rzx_iterator_begin( libspectrum_rzx *rzx ); -libspectrum_rzx_iterator WIN32_DLL +WIN32_DLL libspectrum_rzx_iterator libspectrum_rzx_iterator_next( libspectrum_rzx_iterator it ); -libspectrum_rzx_block_id WIN32_DLL +WIN32_DLL libspectrum_rzx_block_id libspectrum_rzx_iterator_get_type( libspectrum_rzx_iterator it ); -size_t WIN32_DLL +WIN32_DLL size_t libspectrum_rzx_iterator_get_frames( libspectrum_rzx_iterator it ); -void WIN32_DLL +WIN32_DLL void libspectrum_rzx_iterator_delete( libspectrum_rzx *rzx, libspectrum_rzx_iterator it ); -libspectrum_snap* WIN32_DLL +WIN32_DLL libspectrum_snap* libspectrum_rzx_iterator_get_snap( libspectrum_rzx_iterator it ); -int WIN32_DLL +WIN32_DLL int libspectrum_rzx_iterator_snap_is_automatic( libspectrum_rzx_iterator it ); /* @@ -1252,41 +1262,41 @@ /* Constructor/destructor */ -libspectrum_microdrive* WIN32_DLL +WIN32_DLL libspectrum_microdrive* libspectrum_microdrive_alloc( void ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_microdrive_free( libspectrum_microdrive *microdrive ); /* Accessors */ -libspectrum_byte WIN32_DLL +WIN32_DLL libspectrum_byte libspectrum_microdrive_data( const libspectrum_microdrive *microdrive, size_t which ); -void WIN32_DLL +WIN32_DLL void libspectrum_microdrive_set_data( libspectrum_microdrive *microdrive, size_t which, libspectrum_byte data ); -int WIN32_DLL +WIN32_DLL int libspectrum_microdrive_write_protect( const libspectrum_microdrive *microdrive ); -void WIN32_DLL +WIN32_DLL void libspectrum_microdrive_set_write_protect( libspectrum_microdrive *microdrive, int write_protect ); -libspectrum_byte WIN32_DLL +WIN32_DLL libspectrum_byte libspectrum_microdrive_cartridge_len( const libspectrum_microdrive *microdrive ); -void WIN32_DLL +WIN32_DLL void libspectrum_microdrive_set_cartridge_len( libspectrum_microdrive *microdrive, libspectrum_byte len ); /* .mdr format routines */ -int WIN32_DLL +WIN32_DLL int libspectrum_microdrive_checksum( libspectrum_microdrive *microdrive, libspectrum_byte what ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_microdrive_mdr_read( libspectrum_microdrive *microdrive, libspectrum_byte *buffer, size_t length ); -void WIN32_DLL +WIN32_DLL void libspectrum_microdrive_mdr_write( const libspectrum_microdrive *microdrive, libspectrum_byte **buffer, size_t *length ); @@ -1322,17 +1332,17 @@ libspectrum_dck_block *dck[256]; /* dck block data */ } libspectrum_dck; -libspectrum_dck* WIN32_DLL libspectrum_dck_alloc( void ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_dck* libspectrum_dck_alloc( void ); +WIN32_DLL libspectrum_error libspectrum_dck_free( libspectrum_dck *dck, int keep_pages ); /* Read in a DCK file */ -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_dck_read( libspectrum_dck *dck, const libspectrum_byte *buffer, size_t length ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_dck_read2( libspectrum_dck *dck, const libspectrum_byte *buffer, size_t length, const char *filename ); @@ -1340,10 +1350,10 @@ * Crypto functions */ -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_verify_signature( libspectrum_signature *signature, libspectrum_rzx_dsa_key *key ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_signature_free( libspectrum_signature *signature ); /* @@ -1382,33 +1392,33 @@ typedef struct libspectrum_ide_channel libspectrum_ide_channel; -libspectrum_ide_channel* WIN32_DLL +WIN32_DLL libspectrum_ide_channel* libspectrum_ide_alloc( libspectrum_ide_databus databus ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_ide_free( libspectrum_ide_channel *chn ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_ide_insert( libspectrum_ide_channel *chn, libspectrum_ide_unit unit, const char *filename ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_ide_commit( libspectrum_ide_channel *chn, libspectrum_ide_unit unit ); -int WIN32_DLL +WIN32_DLL int libspectrum_ide_dirty( libspectrum_ide_channel *chn, libspectrum_ide_unit unit ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_ide_eject( libspectrum_ide_channel *chn, libspectrum_ide_unit unit ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_ide_reset( libspectrum_ide_channel *chn ); -libspectrum_byte WIN32_DLL +WIN32_DLL libspectrum_byte libspectrum_ide_read( libspectrum_ide_channel *chn, libspectrum_ide_register reg ); -void WIN32_DLL +WIN32_DLL void libspectrum_ide_write( libspectrum_ide_channel *chn, libspectrum_ide_register reg, libspectrum_byte data ); Modified: trunk/FuseImporter/libspectrum.h =================================================================== --- trunk/FuseImporter/libspectrum.h 2010-05-24 14:23:37 UTC (rev 639) +++ trunk/FuseImporter/libspectrum.h 2010-05-26 12:46:40 UTC (rev 640) @@ -1,7 +1,7 @@ /* libspectrum.h: the library for dealing with ZX Spectrum emulator files Copyright (c) 2001-2007 Philip Kendall, Darren Salt, Fredrick Meunier - $Id: libspectrum.h.in 4060 2009-07-30 13:21:38Z fredm $ + $Id: libspectrum.h.in 4120 2010-02-21 05:06:56Z fredm $ 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 @@ -38,8 +38,6 @@ #include <stdlib.h> #include <stdio.h> -#include <TargetConditionals.h> - #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN /* Exclude rarely used stuff from Windows @@ -202,6 +200,8 @@ #define g_array_index(a,t,i) (*(((t*)a->data)+i)) GArray* WIN32_DLL g_array_set_size( GArray *array, guint length ); +#include <TargetConditionals.h> + #ifdef TARGET_RT_64_BIT #define GINT_TO_POINTER(i) ((gpointer) (glong)(i)) #define GPOINTER_TO_INT(p) ((gint) (glong)(p)) @@ -210,11 +210,6 @@ #define GPOINTER_TO_INT(p) ((gint) (p)) #endif -/* Library capabilities */ - -/* we support snapshots etc. requiring zlib (e.g. compressed szx) */ -#define LIBSPECTRUM_SUPPORTS_ZLIB_COMPRESSION (1) - /* * General libspectrum routines */ @@ -239,24 +234,40 @@ } 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 */ -libspectrum_error WIN32_DLL libspectrum_init( void ); +WIN32_DLL libspectrum_error libspectrum_init( void ); /* Version checking */ -int WIN32_DLL libspectrum_check_version( const char *version ); -const char WIN32_DLL *libspectrum_version( void ); -const char WIN32_DLL *libspectrum_gcrypt_version( void ); +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 libspectrum_error_function_t WIN32_DLL libspectrum_error_function; +extern WIN32_DLL libspectrum_error_function_t libspectrum_error_function; -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_default_error_function( libspectrum_error error, const char *format, va_list ap ); @@ -274,12 +285,12 @@ libspectrum_free_fn_t free; } libspectrum_mem_vtable_t; -void* WIN32_DLL libspectrum_malloc( size_t size ); -void* WIN32_DLL libspectrum_calloc( size_t nmemb, size_t size ); -void* WIN32_DLL libspectrum_realloc( void *ptr, size_t size ); -void WIN32_DLL libspectrum_free( void *ptr ); +WIN32_DLL void* libspectrum_malloc( size_t size ); +WIN32_DLL void* libspectrum_calloc( size_t nmemb, size_t size ); +WIN32_DLL void* libspectrum_realloc( void *ptr, size_t size ); +WIN32_DLL void libspectrum_free( void *ptr ); -void WIN32_DLL libspectrum_mem_set_vtable( libspectrum_mem_vtable_t *table ); +WIN32_DLL void libspectrum_mem_set_vtable( libspectrum_mem_vtable_t *table ); /* Attempt to identify a given file */ @@ -394,20 +405,20 @@ } libspectrum_class_t; -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_identify_file( libspectrum_id_t *type, const char *filename, const unsigned char *buffer, size_t length ); -libspectrum_error WIN32_DLL +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 ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_identify_file_raw( libspectrum_id_t *type, const char *filename, const unsigned char *buffer, size_t length ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_identify_class( libspectrum_class_t *libspectrum_class, libspectrum_id_t type ); @@ -442,122 +453,122 @@ } libspectrum_machine; -const char* WIN32_DLL libspectrum_machine_name( libspectrum_machine type ); +WIN32_DLL const char* libspectrum_machine_name( libspectrum_machine type ); /* The various capabilities of the different machines */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_AY; /* AY-3-8192 */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_128_MEMORY; /* 128-style memory paging */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_PLUS3_MEMORY; /* +3-style memory paging */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_PLUS3_DISK; /* +3-style disk drive */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_MEMORY; /* Timex-style memory paging */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_VIDEO; /* Timex-style video modes */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_TRDOS_DISK; /* TRDOS-style disk drive */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_TIMEX_DOCK; /* T[SC]2068-style cartridge port */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_SINCLAIR_JOYSTICK; /* Sinclair-style joystick ports */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_KEMPSTON_JOYSTICK; /* Kempston-style joystick ports */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_SCORP_MEMORY; /* Scorpion-style memory paging */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_EVEN_M1; /* M1 cycles always start on even tstate counts */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_SE_MEMORY; /* SE-style memory paging */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_NTSC; /* NTSC display */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_PENT512_MEMORY; /* Pentagon 512 memory paging */ -extern const int WIN32_DLL +extern WIN32_DLL const int LIBSPECTRUM_MACHINE_CAPABILITY_PENT1024_MEMORY; /* Pentagon 1024 memory paging */ /* Get the capabilities of a machine */ -int WIN32_DLL libspectrum_machine_capabilities( libspectrum_machine type ); +WIN32_DLL int libspectrum_machine_capabilities( libspectrum_machine type ); /* Get the timings of a machine */ -libspectrum_dword WIN32_DLL +WIN32_DLL libspectrum_dword libspectrum_timings_processor_speed( libspectrum_machine machine ); -libspectrum_dword WIN32_DLL +WIN32_DLL libspectrum_dword libspectrum_timings_ay_speed( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_left_border( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_horizontal_screen( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_right_border( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_horizontal_retrace( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_top_border( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_vertical_screen( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_bottom_border( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_vertical_retrace( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_interrupt_length( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_top_left_pixel( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_tstates_per_line( libspectrum_machine machine ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_timings_lines_per_frame( libspectrum_machine machine ); -libspectrum_dword WIN32_DLL +WIN32_DLL libspectrum_dword libspectrum_timings_tstates_per_frame( libspectrum_machine machine ); /* Creator information */ typedef struct libspectrum_creator libspectrum_creator; -libspectrum_creator* WIN32_DLL +WIN32_DLL libspectrum_creator* libspectrum_creator_alloc( void ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_creator_free( libspectrum_creator *creator ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_creator_set_program( libspectrum_creator *creator, const char *program ); -const char WIN32_DLL * +WIN32_DLL const char * libspectrum_creator_program( libspectrum_creator *creator ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_creator_set_major( libspectrum_creator *creator, libspectrum_word major ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_creator_major( libspectrum_creator *creator ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_creator_set_minor( libspectrum_creator *creator, libspectrum_word minor ); -libspectrum_word WIN32_DLL +WIN32_DLL libspectrum_word libspectrum_creator_minor( libspectrum_creator *creator ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_creator_set_competition_code( libspectrum_creator *creator, libspectrum_dword competition_code ); -libspectrum_dword WIN32_DLL +WIN32_DLL libspectrum_dword libspectrum_creator_competition_code( libspectrum_creator *creator ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_creator_set_custom( libspectrum_creator *creator, libspectrum_byte *data, size_t length ); -libspectrum_byte WIN32_DLL * +WIN32_DLL libspectrum_byte * libspectrum_creator_custom( libspectrum_creator *creator ); -size_t WIN32_DLL +WIN32_DLL size_t libspectrum_creator_custom_length( libspectrum_creator *creator ); /* @@ -566,29 +577,29 @@ typedef struct libspectrum_snap libspectrum_snap; -libspectrum_snap* WIN32_DLL libspectrum_snap_alloc( void ); -libspectrum_error WIN32_DLL libspectrum_snap_free( libspectrum_snap *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 */ -libspectrum_error WIN32_DLL +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 */ -libspectrum_error WIN32_DLL +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 const int WIN32_DLL LIBSPECTRUM_FLAG_SNAPSHOT_NO_COMPRESSION; -extern const int WIN32_DLL LIBSPECTRUM_FLAG_SNAPSHOT_ALWAYS_COMPRESS; +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 const int WIN32_DLL LIBSPECTRUM_FLAG_SNAPSHOT_MINOR_INFO_LOSS; -extern const int WIN32_DLL LIBSPECTRUM_FLAG_SNAPSHOT_MAJOR_INFO_LOSS; +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 { @@ -605,12 +616,12 @@ } libspectrum_joystick; -const char* WIN32_DLL libspectrum_joystick_name( libspectrum_joystick type ); +WIN32_DLL const char* libspectrum_joystick_name( libspectrum_joystick type ); -extern const int WIN32_DLL LIBSPECTRUM_JOYSTICK_INPUT_NONE; -extern const int WIN32_DLL LIBSPECTRUM_JOYSTICK_INPUT_KEYBOARD; -extern const int WIN32_DLL LIBSPECTRUM_JOYSTICK_INPUT_JOYSTICK_1; -extern const int WIN32_DLL LIBSPECTRUM_JOYSTICK_INPUT_JOYSTICK_2; +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 */ libspectrum_machine WIN32_DLL libspectrum_snap_machine( libspectrum_snap *snap ); @@ -856,8 +867,7 @@ int WIN32_DLL libspectrum_snap_fuller_box_active( libspectrum_snap *snap ); void WIN32_DLL libspectrum_snap_set_fuller_box_active( libspectrum_snap *snap, int fuller_box_active ); int WIN32_DLL libspectrum_snap_melodik_active( libspectrum_snap *snap ); -void WIN32_DLL libspectrum_snap_set_melodik_active( libspectrum_snap *snap, int - melodik_active ); +void WIN32_DLL libspectrum_snap_set_melodik_active( libspectrum_snap *snap, int melodik_active ); /* * Tape handling routines @@ -911,15 +921,15 @@ typedef struct _GSList *libspectrum_tape_iterator; /* Some flags */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_BLOCK; /* End of block */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_STOP; /* Stop tape */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_STOP48; /* Stop tape if in 48K mode */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_NO_EDGE; /* Edge isn't really an edge */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LEVEL_LOW; /* Set level low */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LEVEL_HIGH; /* Set level high */ -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LENGTH_SHORT; -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_LENGTH_LONG; -extern const int WIN32_DLL LIBSPECTRUM_TAPE_FLAGS_TAPE; /* Tape has finished */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_BLOCK; /* End of block */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_STOP; /* Stop tape */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_STOP48; /* Stop tape if in 48K mode */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_NO_EDGE; /* Edge isn't really an edge */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_LEVEL_LOW; /* Set level low */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_LEVEL_HIGH; /* Set level high */ +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_LENGTH_SHORT; +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_LENGTH_LONG; +extern WIN32_DLL const int LIBSPECTRUM_TAPE_FLAGS_TAPE; /* Tape has finished */ /* The states which a block can be in */ typedef enum libspectrum_tape_state_type { @@ -936,28 +946,28 @@ } libspectrum_tape_state_type; /* Routines to manipulate tape blocks */ -libspectrum_tape_block* WIN32_DLL +WIN32_DLL libspectrum_tape_block* libspectrum_tape_block_alloc( libspectrum_tape_type type ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_block_free( libspectrum_tape_block *block ); -libspectrum_tape_type WIN32_DLL +WIN32_DLL libspectrum_tape_type libspectrum_tape_block_type( libspectrum_tape_block *block ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_block_set_type( libspectrum_tape_block *block, libspectrum_tape_type type ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_block_init( libspectrum_tape_block *block, libspectrum_tape_block_state *state ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_block_description( char *buffer, size_t length, libspectrum_tape_block *block ); -int WIN32_DLL +WIN32_DLL int libspectrum_tape_block_metadata( libspectrum_tape_block *block ); -libspectrum_dword WIN32_DLL +WIN32_DLL libspectrum_dword libspectrum_tape_block_length( libspectrum_tape_block *block ); /* Accessor functions */ @@ -1019,86 +1029,86 @@ /* A linked list of tape blocks */ typedef struct libspectrum_tape libspectrum_tape; -libspectrum_tape* WIN32_DLL libspectrum_tape_alloc( void ); -libspectrum_error WIN32_DLL libspectrum_tape_clear( libspectrum_tape *tape ); -libspectrum_error WIN32_DLL libspectrum_tape_free( libspectrum_tape *tape ); +WIN32_DLL libspectrum_tape* libspectrum_tape_alloc( void ); +WIN32_DLL libspectrum_error libspectrum_tape_clear( libspectrum_tape *tape ); +WIN32_DLL libspectrum_error libspectrum_tape_free( libspectrum_tape *tape ); /* Read in a tape file, optionally guessing what sort of file it is */ -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_read( libspectrum_tape *tape, const libspectrum_byte *buffer, size_t length, libspectrum_id_t type, const char *filename ); /* Write a tape file */ -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_write( libspectrum_byte **buffer, size_t *length, libspectrum_tape *tape, libspectrum_id_t type ); /* Does this tape structure actually contain a tape? */ -int WIN32_DLL libspectrum_tape_present( const libspectrum_tape *tape ); +WIN32_DLL int libspectrum_tape_present( const libspectrum_tape *tape ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_get_next_edge( libspectrum_dword *tstates, int *flags, libspectrum_tape *tape ); /* Get the current block from the tape */ -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_current_block( libspectrum_tape *tape ); /* Get the state of the active block on the tape */ -libspectrum_tape_state_type WIN32_DLL +WIN32_DLL libspectrum_tape_state_type libspectrum_tape_state( libspectrum_tape *tape ); /* Set the state of the active block on the tape */ -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_set_state( libspectrum_tape *tape, libspectrum_tape_state_type state ); /* Peek at the next block on the tape */ -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_peek_next_block( libspectrum_tape *tape ); /* Peek at the last block on the tape */ -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_peek_last_block( libspectrum_tape *tape ); /* Cause the next block on the tape to be active, initialise it and return it */ -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_select_next_block( libspectrum_tape *tape ); /* Get the position on the tape of the current block */ -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_position( int *n, libspectrum_tape *tape ); /* Select the nth block on the tape */ -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_nth_block( libspectrum_tape *tape, int n ); /* Append a block to the current tape */ -void WIN32_DLL +WIN32_DLL void libspectrum_tape_append_block( libspectrum_tape *tape, libspectrum_tape_block *block ); -void WIN32_DLL +WIN32_DLL void libspectrum_tape_remove_block( libspectrum_tape *tape, libspectrum_tape_iterator it ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_tape_insert_block( libspectrum_tape *tape, libspectrum_tape_block *block, size_t position ); /*** Routines for iterating through a tape ***/ -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_iterator_init( libspectrum_tape_iterator *iterator, libspectrum_tape *tape ); -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_iterator_current( libspectrum_tape_iterator iterator ); -libspectrum_tape_block WIN32_DLL * +WIN32_DLL libspectrum_tape_block * libspectrum_tape_iterator_next( libspectrum_tape_iterator *iterator ); /*** Routines for handling the TZX generalised data block symbol table @@ -1115,13 +1125,13 @@ typedef struct libspectrum_tape_generalised_data_symbol libspectrum_tape_generalised_data_symbol; -libspectrum_dword WIN32_DLL libspectrum_tape_generalised_data_symbol_table_symbols_in_block( const libspectrum_tape_generalised_data_symbol_table *table ); -libspectrum_byte WIN32_DLL libspectrum_tape_generalised_data_symbol_table_max_pulses( const libspectrum_tape_generalised_data_symbol_table *table ); -libspectrum_word WIN32_DLL libspectrum_tape_generalised_data_symbol_table_symbols_in_table( const libspectrum_tape_generalised_data_symbol_table *table ); -libspectrum_tape_generalised_data_symbol* WIN32_DLL libspectrum_tape_generalised_data_symbol_table_symbol( const libspectrum_tape_generalised_data_symbol_table *table, size_t which ); +WIN32_DLL libspectrum_dword libspectrum_tape_generalised_data_symbol_table_symbols_in_block( const libspectrum_tape_generalised_data_symbol_table *table ); +WIN32_DLL libspectrum_byte libspectrum_tape_generalised_data_symbol_table_max_pulses( const libspectrum_tape_generalised_data_symbol_table *table ); +WIN32_DLL libspectrum_word libspectrum_tape_generalised_data_symbol_table_symbols_in_table( const libspectrum_tape_generalised_data_symbol_table *table ); +WIN32_DLL libspectrum_tape_generalised_data_symbol* libspectrum_tape_generalised_data_symbol_table_symbol( const libspectrum_tape_generalised_data_symbol_table *table, size_t which ); -libspectrum_tape_generalised_data_symbol_edge_type WIN32_DLL libspectrum_tape_generalised_data_symbol_type( const libspectrum_tape_generalised_data_symbol *symbol ); -libspectrum_word WIN32_DLL libspectrum_tape_generalised_data_symbol_pulse( const libspectrum_tape_generalised_data_symbol *symbol, size_t which ); +WIN32_DLL libspectrum_tape_generalised_data_symbol_edge_type libspectrum_tape_generalised_data_symbol_type( const libspectrum_tape_generalised_data_symbol *symbol ); +WIN32_DLL libspectrum_word libspectrum_tape_generalised_data_symbol_pulse( const libspectrum_tape_generalised_data_symbol *symbol, size_t which ); /* @@ -1130,40 +1140,40 @@ typedef struct libspectrum_rzx libspectrum_rzx; -libspectrum_rzx* WIN32_DLL libspectrum_rzx_alloc( void ); -libspectrum_error WIN32_DLL libspectrum_rzx_free( libspectrum_rzx *rzx ); +WIN32_DLL libspectrum_rzx* libspectrum_rzx_alloc( void ); +WIN32_DLL libspectrum_error libspectrum_rzx_free( libspectrum_rzx *rzx ); -void WIN32_DLL +WIN32_DLL void libspectrum_rzx_start_input( libspectrum_rzx *rzx, libspectrum_dword tstates ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_stop_input( libspectrum_rzx *rzx ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_add_snap( libspectrum_rzx *rzx, libspectrum_snap *snap, int automatic ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_rollback( libspectrum_rzx *rzx, libspectrum_snap **snap ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_rollback_to( libspectrum_rzx *rzx, libspectrum_snap **snap, size_t which ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_store_frame( libspectrum_rzx *rzx, size_t instructions, size_t count, libspectrum_byte *in_bytes ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_start_playback( libspectrum_rzx *rzx, int which, libspectrum_snap **snap ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_playback_frame( libspectrum_rzx *rzx, int *finished, libspectrum_snap **snap ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_playback( libspectrum_rzx *rzx, libspectrum_byte *byte ); /* Get and set the tstate counter */ -size_t WIN32_DLL libspectrum_rzx_tstates( libspectrum_rzx *rzx ); +WIN32_DLL size_t libspectrum_rzx_tstates( libspectrum_rzx *rzx ); /* Get the current frame's instruction count */ -size_t WIN32_DLL libspectrum_rzx_instructions( libspectrum_rzx *rzx ); +WIN32_DLL size_t libspectrum_rzx_instructions( libspectrum_rzx *rzx ); -libspectrum_dword WIN32_DLL libspectrum_rzx_get_keyid( libspectrum_rzx *rzx ); +WIN32_DLL libspectrum_dword libspectrum_rzx_get_keyid( libspectrum_rzx *rzx ); typedef struct libspectrum_signature { @@ -1174,7 +1184,7 @@ } libspectrum_signature; -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_get_signature( libspectrum_rzx *rzx, libspectrum_signature *signature ); @@ -1186,11 +1196,11 @@ } libspectrum_rzx_dsa_key; -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_read( libspectrum_rzx *rzx, const libspectrum_byte *buffer, size_t length ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_rzx_write( libspectrum_byte **buffer, size_t *length, libspectrum_rzx *rzx, libspectrum_id_t snap_format, libspectrum_creator *creator, int compress, @@ -1217,22 +1227,22 @@ libspectrum_rzx_insert_snap( libspectrum_rzx *rzx, libspectrum_snap *snap, int where ); -libspectrum_rzx_iterator WIN32_DLL +WIN32_DLL libspectrum_rzx_iterator libspectrum_rzx_iterator_begin( libspectrum_rzx *rzx ); -libspectrum_rzx_iterator WIN32_DLL +WIN32_DLL libspectrum_rzx_iterator libspectrum_rzx_iterator_next( libspectrum_rzx_iterator it ); -libspectrum_rzx_block_id WIN32_DLL +WIN32_DLL libspectrum_rzx_block_id libspectrum_rzx_iterator_get_type( libspectrum_rzx_iterator it ); -size_t WIN32_DLL +WIN32_DLL size_t libspectrum_rzx_iterator_get_frames( libspectrum_rzx_iterator it ); -void WIN32_DLL +WIN32_DLL void libspectrum_rzx_iterator_delete( libspectrum_rzx *rzx, libspectrum_rzx_iterator it ); -libspectrum_snap* WIN32_DLL +WIN32_DLL libspectrum_snap* libspectrum_rzx_iterator_get_snap( libspectrum_rzx_iterator it ); -int WIN32_DLL +WIN32_DLL int libspectrum_rzx_iterator_snap_is_automatic( libspectrum_rzx_iterator it ); /* @@ -1252,41 +1262,41 @@ /* Constructor/destructor */ -libspectrum_microdrive* WIN32_DLL +WIN32_DLL libspectrum_microdrive* libspectrum_microdrive_alloc( void ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_microdrive_free( libspectrum_microdrive *microdrive ); /* Accessors */ -libspectrum_byte WIN32_DLL +WIN32_DLL libspectrum_byte libspectrum_microdrive_data( const libspectrum_microdrive *microdrive, size_t which ); -void WIN32_DLL +WIN32_DLL void libspectrum_microdrive_set_data( libspectrum_microdrive *microdrive, size_t which, libspectrum_byte data ); -int WIN32_DLL +WIN32_DLL int libspectrum_microdrive_write_protect( const libspectrum_microdrive *microdrive ); -void WIN32_DLL +WIN32_DLL void libspectrum_microdrive_set_write_protect( libspectrum_microdrive *microdrive, int write_protect ); -libspectrum_byte WIN32_DLL +WIN32_DLL libspectrum_byte libspectrum_microdrive_cartridge_len( const libspectrum_microdrive *microdrive ); -void WIN32_DLL +WIN32_DLL void libspectrum_microdrive_set_cartridge_len( libspectrum_microdrive *microdrive, libspectrum_byte len ); /* .mdr format routines */ -int WIN32_DLL +WIN32_DLL int libspectrum_microdrive_checksum( libspectrum_microdrive *microdrive, libspectrum_byte what ); -libspectrum_error WIN32_DLL +WIN32_DLL libspectrum_error libspectrum_microdrive_mdr_read( libspectrum_microdrive *microdrive, libspectrum_byte *buffer, size_t length ); -void WIN32_DLL +WIN32_DLL void libspectrum_microdrive_mdr_write( const libspectrum_microdrive *microdrive, libspectrum_byte **buffer, size_t *length ); @@ -1322,17 +1332,17 @@ libspectrum_dck_block *dck[256]; /* dck block data */ } libspectrum_dck; -libspectrum_dck* WIN32_DLL libspectrum_dck_alloc( void ); -libspectrum_error ... [truncated message content] |