cbmimage
Loading...
Searching...
No Matches
D64/D71/D40 specific functions

Functions

static uint16_t cbmimage_i_d40_d64_d71_get_sectors_in_track (cbmimage_image_settings *settings, uint16_t track)
 
static int cbmimage_i_d40_d64_d71_ts_to_blockaddress (cbmimage_image_settings *settings, cbmimage_blockaddress *block)
 
static int cbmimage_i_d40_d64_d71_lba_to_blockaddress (cbmimage_image_settings *settings, cbmimage_blockaddress *block)
 
static void cbmimage_i_d40_d64_d71_calculate_track_lba_start_table (cbmimage_image_settings *settings)
 
static int cbmimage_i_d71_set_bam (cbmimage_image_settings *settings)
 
static int cbmimage_i_d40_d64_d71_get_geos_infoblock (cbmimage_image_settings *settings)
 
static int cbmimage_i_d40_d64_d71_chdir_partition_init (cbmimage_image_settings *settings, cbmimage_imagetype imagetype, unsigned char *imagetype_name, uint8_t maxtracks)
 
static void cbmimage_i_d40_d64_d71_image_create (cbmimage_fileimage *image, cbmimage_imagetype imagetype, unsigned char *imagetype_name, uint8_t maxtracks)
 

Variables

static const cbmimage_fileimage_functions d64_fileimage_functions
 
static const cbmimage_fileimage_functions d71_fileimage_functions
 

Detailed Description

Function Documentation

◆ cbmimage_i_d40_d64_d71_calculate_track_lba_start_table()

static void cbmimage_i_d40_d64_d71_calculate_track_lba_start_table ( cbmimage_image_settings * settings)
static

create the "LBA start table"

In order to ease the calculation of LBA to T/S or vice versa (cf. cbmimage_i_d40_d64_d71_ts_to_blockaddress(), cbmimage_i_d40_d64_d71_lba_to_blockaddress()) an internal table of the first LBA on a track is used internally.
This function initializes this table.

Parameters
[in]settingspointer to the image data internal settings

◆ cbmimage_i_d40_d64_d71_chdir_partition_init()

static int cbmimage_i_d40_d64_d71_chdir_partition_init ( cbmimage_image_settings * settings,
cbmimage_imagetype imagetype,
unsigned char * imagetype_name,
uint8_t maxtracks )
static

create structures for a D40, D64 or D71 image

Parameters
[in]settingspointer to the image settings
[in]imagetypeThe type of image that should be created
[in]imagetype_nameThe name of the image type that should be stored in the images.
This value is only informational and can be asked for by the user; it is not used internally.
[in]maxtracksThe maximum number of tracks of this image
Returns
  • 0 on success
  • -1 on error

◆ cbmimage_i_d40_d64_d71_get_geos_infoblock()

static int cbmimage_i_d40_d64_d71_get_geos_infoblock ( cbmimage_image_settings * settings)
static

get the GEOS info block of this image has one

Parameters
[in]settingspointer to the image data internal settings
Returns
  • 0 if this is a non-GEOS image
  • != 0 if this is a GEOS image

◆ cbmimage_i_d40_d64_d71_get_sectors_in_track()

static uint16_t cbmimage_i_d40_d64_d71_get_sectors_in_track ( cbmimage_image_settings * settings,
uint16_t track )
static

get the number of sectors on a specific track of the D64 image

Parameters
[in]settingspointer to the image data internal settings
[in]trackthe track number for which to obtain the number of sectors
Returns
Number of sectors on this specific track in the image
Remarks
  • This is the number of sectors on this specific track. Due to the nature of many CBM disk images, including D64, D71 and D40 images, the number of sectors can vary from track to track.
    To obtain the maximum number of sectors on any track, use cbmimage_get_max_sectors() instead!
  • As the CBM sector numbering goes, the sector range is from 0 to the result of this call minus 1.
    For example, for D64 images on the first speed zone (i.e., tracks 1 to 17), this function will return 21, giving a range of 0 .. 20.

◆ cbmimage_i_d40_d64_d71_image_create()

static void cbmimage_i_d40_d64_d71_image_create ( cbmimage_fileimage * image,
cbmimage_imagetype imagetype,
unsigned char * imagetype_name,
uint8_t maxtracks )
static

create a D64, D71 or D40 image

Parameters
[in]imagepointer to the image data
[in]imagetypeThe type of image that should be created
[in]imagetype_nameThe name of the image type that should be stored in the images.
This value is only informational and can be asked for by the user; it is not used internally.
[in]maxtracksThe maximum number of tracks of this image

◆ cbmimage_i_d40_d64_d71_lba_to_blockaddress()

static int cbmimage_i_d40_d64_d71_lba_to_blockaddress ( cbmimage_image_settings * settings,
cbmimage_blockaddress * block )
static

convert the LBA to T/S block address

Parameters
[in]settingspointer to the image data internal settings
[in,out]blockpointer to a block address with an initialized LBA address
Returns
  • 0 if no error occurred
  • != 0 if an error occurred
Remarks
  • the block address is completely created from the lba parameter
  • an error occurs if the lba block does not exist on this type of image

◆ cbmimage_i_d40_d64_d71_ts_to_blockaddress()

static int cbmimage_i_d40_d64_d71_ts_to_blockaddress ( cbmimage_image_settings * settings,
cbmimage_blockaddress * block )
static

convert the T/S to LBA block address

Parameters
[in]settingspointer to the image data internal settings
[in,out]blockpointer to a block address witn an initialized T/S address
Returns
  • 0 if no error occurred
  • != 0 if an error occurred
Remarks
  • the block address is completely created from the ts parameter
  • an error occurs if the track/sector combination does not exist on this type of image

◆ cbmimage_i_d71_set_bam()

static int cbmimage_i_d71_set_bam ( cbmimage_image_settings * settings)
static

Occupy additional BAM entries for 1571 second directory track

Parameters
[in]settingspointer to the image data internal settings
Returns
  • 0 if no error occurred
  • != 0 if an error occurred
Remarks
  • The 1571 marks the 2nd dir track as used. Mimic that behaviour.

Variable Documentation

◆ d64_fileimage_functions

const cbmimage_fileimage_functions d64_fileimage_functions
static
Initial value:
= {
}
static int cbmimage_i_d40_d64_d71_lba_to_blockaddress(cbmimage_image_settings *settings, cbmimage_blockaddress *block)
Definition d40_d64_d71.c:198
static uint16_t cbmimage_i_d40_d64_d71_get_sectors_in_track(cbmimage_image_settings *settings, uint16_t track)
Definition d40_d64_d71.c:122
static int cbmimage_i_d40_d64_d71_ts_to_blockaddress(cbmimage_image_settings *settings, cbmimage_blockaddress *block)
Definition d40_d64_d71.c:158

template for the file image functions for D40 or D64 images

This is a template that is copied into the image specific data. This template defines the functions for D40 and D64 images.

◆ d71_fileimage_functions

const cbmimage_fileimage_functions d71_fileimage_functions
static
Initial value:
= {
}
static int cbmimage_i_d71_set_bam(cbmimage_image_settings *settings)
Definition d40_d64_d71.c:273

template for the file image functions for D71 images

This is a template that is copied into the image specific data. This template defines the functions for D71 images.