ZX Interface 1 functions (zxinterface1.h)

Header {z88dk}/include/zxinterface1.h
Source {z88dk}/libsrc/spectrum
Include #include <zxinterface1.h>
Linking n/a
Compile n/a
Comments

This library permits low-level operations on the Interface 1 and Microdrives.

Some of these functions are used by the fcntl driver performing the direct control of the ZX Microdrives (zxmdv.lib). Such driver requires the “malloc” library too.

ZX Microdrive

This group of functions mainly work by calling directly the ROM routines to overcome some limitations and bugs.

The buffers aren’t stored before the BASIC program area anymore and the number of files being opened at once is limited by the tape and memory space only.

The sectors can be identified both as a unique block in the whole tape and as a specific record in a file. They can be loaded, created or modified an then saved on the same or on a different sector.

int if1_load_record (int drive, char *filename, int record, struct M_CHAN buffer)

Load a sector identified by file name and record number. An M_CHAN buffer structure pointing to a valid memory space must be passed.

int if1_load_sector (int drive, int sector, struct M_CHAN buffer)

Load a sector identified by the sector number An M_CHAN buffer structure pointing to a valid memory space must be passed.

int if1_write_sector (int drive, int sector, struct M_CHAN buffer)

Write the sector present in “buffer” An M_CHAN buffer structure pointing to a valid memory space and initialized with the proper values must be passed.

int if1_write_record (int drive, struct M_CHAN buffer)

Add a record containing additional data in “buffer” An M_CHAN buffer structure pointing to a valid memory space and initialized with the proper values must be passed.

int if1_setname(char* name, char *location)

Put a 10 characters file name at the specified location; return with the file name length

char *if1_getname(char *location)

Pick the file name at the given location and convert it into the C standard string format.

int if1_remove_file(int drive, char *filename)

Delete a file

int if1_touch_file(int drive, char *filename)

Create a file if it doesn’t exist

int if1_init_file (int drive, char *filename, struct M_CHAN buffer)

Create a file and return a file handle. An M_CHAN buffer structure pointing to a valid memory space must be passed.

void if1_update_map (int drive, char *mdvmap)

Load the map values for the specified drive

int if1_find_sector (int drive)

Find a free sector

int if1_find_sector_map (char *mdvmap)

Find a free sector in the specified map

Diagnostics

int if1_from_mdv()

Returns true if the current program has been loaded from microdrive

int if1_installed()

Returns true if the system variables are already present

int zx_interface1()

Returns true if the Interface 1 is present

 
library/zxspectrum/zxinterface1.txt · Last modified: 2007/06/03 13:01 by stefano
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki