ZXSTSPECTRA Paul Farrow's SPECTRA video interface for the 16k and 48k ZX Spectrum. This provides new colour modes, a Kempston joystick interface, an Interface1 compatible RS232 port and an Interface2 compatible rom port with optional Interface1 compatible rom switching hooks. If the joystick is enabled, then a block ZXSTKEYBOARD or ZXSTJOYSTICK for KEMPSTON emulation is used to store the SPECTRA's joystick port state. A block ZXSTIF2ROM is used to store the rom contents of a rom module plugged into the SPECTRA's rom slot. // Flags #define ZXSTSPECTRA_new_colour_modes_enabled 1 #define ZXSTSPECTRA_rs232_enabled 2 #define ZXSTSPECTRA_joystick_enabled 4 #define ZXSTSPECTRA_if1_rom_hooks_enabled 8 #define ZXSTSPECTRA_rom_paged_in 16 #define ZXSTSPECTRA_port_239_comms_out_bit 32 #define ZXSTSPECTRA_port_239_cts_out_bit 64 #define ZXSTSPECTRA_port_247_data_out_bit 128 #define ZXSTSPECTRA_ram_page_0_embedded 0x100 #define ZXSTSPECTRA_ram_page_1_embedded 0x200 #define ZXSTSPECTRA_compressed 0x400 // SPECTRA video interface typedef struct ZXSTSPECTRA { ZXSTBLOCK blk; WORD flags; BYTE port_7fdf; BYTE port_fe; WORD compressed_size_ram0; WORD compressed_size_ram1; BYTE data[1]; }; Members blk The block header. The block id is ZXSTBID_SPECTRA ('S', 'P', 'R', 'A'). flags Various flags. This can be a combination of: new_colour_modes_enabled Setting of the corresponding DIP switch on the interface rs232_enabled Setting of the corresponding DIP switch on the interface joystick_enabled Setting of the corresponding DIP switch on the interface if1_rom_hooks_enabled Setting of the corresponding DIP switch on the interface rom_paged_in the rom module, if present, was paged in at the moment the snapshot was made. port_239_comms_out_bit state of the COMMS_OUT bit in port 239. port_239_cts_out_bit state of the CTS output bit in port 239. port_247_data_out_bit state of the data bit as written to port 247. ram_page_0_embedded whether a dump of the first ram page is included in DATA[]. if not embedded, use data from contended ram. ram_page_1_embedded whether a dump of the second ram page is included in DATA[]. if not embedded, use data from contended ram. compressed data of ram page 0 and 1 is zlib compressed. they are compressed in 2 chunks, one per page, not in one chunk. port_7fdf last out to port 0x7FDF (colour mode register) port_fe last out to port 0xFE in enhanced border mode compressed_size_ram0 0 if not included compressed_size_ram1 0 if not included data[1] data of ram[0] and/or ram[1] depending on bits set in 'flags'