PREV UP next The Ftape Tools Manual - API


8.4.2.5: Retrieving bad sector information.

Library Function: void ftvt_init_bsm (u_int8_t *HSEG, ft_format_type FMT_CODE, int ERASE)

Initializes bad sector map handling. This must be called before any of the other bad sector map handling functions.

Arguments
u_int8_t *HSEG

A pointer to the header segment, as filled by ftvt_read_header_segment(). The memory this points to must be valid throughout all calls to the bad sector map handling functions.


int FMT_CODE

The format code of the cartridge, as returned by ftvt_read_header_segment()


int ERASE

Setting this to 1 will cause the bad sector map to be cleared; use 0 to avoid clobbering it.


Side effects

Global variables in the bad sector map handling code are set up to handle this particular cartridge.

Library Function: SectorMap ftvt_get_bsm_entry(int SEGMENT_ID)

Retrieves the bad sector map for the given segment.

Arguments
int SEGMENT_ID

The segment number of the bad sector map entry required. Every bit in the return value represents a single 1k sector of the 32k segment, and is set to 1 if damaged.


Side effects

None.

Library function: void ftvt_print_bad_sector_map(int VERBOSE)

Prints the bad sector map of the current cartridge to stdout.

Arguments
int VERBOSE

If non-zero, then the map for every segment which contains bad sectors is printed, along with a summary. Otherwise, only the summary is printed.


Side effects

stdout is written to.


ftape logo Use these buttons to jump to the top menu

TOP (previous node) TOP (parent node) TOP (next node) TOP (this node)