ugBASIC 1.18
An isomorphic BASIC language compiler for retrocomputers
Loading...
Searching...
No Matches
d64.h File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <unistd.h>
#include <ctype.h>

Go to the source code of this file.

Data Structures

struct  _D64Attribute
struct  _D64DirectoryEntry
struct  _D64Directory
struct  _D64SectorData
struct  _D64BAMEntry
struct  _D64BAM
struct  _D64Handle

Macros

#define D64_BAM_TRACK   18
#define D64_BAM_SECTOR   0
#define D64_DIRECTORY_TRACK   18
#define D64_DIRECTORY_SECTOR   1

Typedefs

typedef unsigned char D64Track
typedef unsigned char D64Sector
typedef unsigned char D64DosVersion
typedef unsigned char D64ByteLength
typedef unsigned short D64WordLength
typedef enum _D64FileType D64FileType
typedef struct _D64Attribute D64Attribute
typedef struct _D64DirectoryEntry D64DirectoryEntry
typedef struct _D64Directory D64SectorDirectory
typedef struct _D64SectorData D64SectorData
typedef unsigned short D64DiskId
typedef struct _D64BAMEntry D64BAMEntry
typedef struct _D64BAM D64SectorBAM
typedef enum _D64Variants D64Variants
typedef enum _D64Format D64Format
typedef enum _D64ErrorCode D64ErrorCode
typedef struct _D64Handle D64Handle

Enumerations

enum  _D64FileType {
  FT_DEL = 0 , FT_SEQ = 1 , FT_PRG = 2 , FT_USR = 3 ,
  FT_REL = 4
}
enum  _D64Variants {
  TRACKS35 = 0 , TRACKS35ERRORS = 1 , TRACKS40 = 2 , TRACKS40ERRORS = 3 ,
  TRACKS42 = 4 , TRACKS42ERRORS = 5
}
enum  _D64Format {
  CBMDOS = 0 , SPEEDDOS40 = 1 , PROFESSIONALDOS35 = 2 , PROFESSIONALDOS40 = 3 ,
  PROFESSIONALDOS40B = 4 , DOLPHINDOS35 = 5 , DOLPHINDOS40 = 6 , PROLOGICDOS35 = 7 ,
  PROLOGICDOS40 = 8 , PROSPEED35 = 9 , PROSPEED40 = 10
}
enum  _D64ErrorCode {
  NO_ERRORX = 1 , HEADER_BLOCK_NOT_FOUND = 2 , NO_SYNC_SEQUENCE_FOUND = 3 , CHECKSUM_ERROR_HEADER_BLOCK = 9 ,
  DISK_SECTOR_ID_MISMATCH = 11 , DATA_DESCRIPTOR_BYTE_NOT_FOUND = 4 , CHECKSUM_ERROR_DATA_BLOCK = 5 , WRITE_VERIFY_ON_FORMAT = 6 ,
  WRITE_VERIFY_ERROR = 7 , WRITE_PROTECT_ON = 8 , WRITE_ERROR = 10 , DRIVE_NOT_READY = 16
}

Functions

D64Handled64_create (D64Format _format)
 Create a new D64 disk image.
int d64_get_free_sectors (D64Handle *_handle)
void d64_set_dos_version (D64Handle *_handle, D64DosVersion _version)
 Set the DOS version for the given disk image.
void d64_set_disk_name (D64Handle *_handle, unsigned char *_disk_name)
 Set the disk name for the given disk image.
void d64_set_disk_id (D64Handle *_handle, D64DiskId _disk_id)
 Set the disk id for the given disk image.
void d64_set_dos_type (D64Handle *_handle, unsigned char *_dos_type)
 Set the DOS Type for the given disk image.
int d64_write_file (D64Handle *_handle, unsigned char *_filename, D64FileType _type, unsigned char *_buffer, int _size)
 Write a block of memory on a file on the D64 disk image.
void d64_output (D64Handle *_handle, unsigned char *_filename)
void d64_free (D64Handle *_handle)
 Free the disk image resources.

Macro Definition Documentation

◆ D64_BAM_SECTOR

#define D64_BAM_SECTOR   0

Definition at line 624 of file d64.h.

◆ D64_BAM_TRACK

#define D64_BAM_TRACK   18

Definition at line 623 of file d64.h.

◆ D64_DIRECTORY_SECTOR

#define D64_DIRECTORY_SECTOR   1

Definition at line 626 of file d64.h.

◆ D64_DIRECTORY_TRACK

#define D64_DIRECTORY_TRACK   18

Definition at line 625 of file d64.h.

Typedef Documentation

◆ D64Attribute

typedef struct _D64Attribute D64Attribute

◆ D64BAMEntry

typedef struct _D64BAMEntry D64BAMEntry

◆ D64ByteLength

typedef unsigned char D64ByteLength

Definition at line 106 of file d64.h.

◆ D64DirectoryEntry

◆ D64DiskId

typedef unsigned short D64DiskId

Definition at line 226 of file d64.h.

◆ D64DosVersion

typedef unsigned char D64DosVersion

Definition at line 103 of file d64.h.

◆ D64ErrorCode

◆ D64FileType

typedef enum _D64FileType D64FileType

◆ D64Format

typedef enum _D64Format D64Format

◆ D64Handle

typedef struct _D64Handle D64Handle

◆ D64Sector

typedef unsigned char D64Sector

Definition at line 100 of file d64.h.

◆ D64SectorBAM

typedef struct _D64BAM D64SectorBAM

◆ D64SectorData

typedef struct _D64SectorData D64SectorData

◆ D64SectorDirectory

◆ D64Track

typedef unsigned char D64Track

Definition at line 96 of file d64.h.

◆ D64Variants

typedef enum _D64Variants D64Variants

◆ D64WordLength

typedef unsigned short D64WordLength

Definition at line 109 of file d64.h.

Enumeration Type Documentation

◆ _D64ErrorCode

Enumerator
NO_ERRORX 
HEADER_BLOCK_NOT_FOUND 
NO_SYNC_SEQUENCE_FOUND 
CHECKSUM_ERROR_HEADER_BLOCK 
DISK_SECTOR_ID_MISMATCH 
DATA_DESCRIPTOR_BYTE_NOT_FOUND 
CHECKSUM_ERROR_DATA_BLOCK 
WRITE_VERIFY_ON_FORMAT 
WRITE_VERIFY_ERROR 
WRITE_PROTECT_ON 
WRITE_ERROR 
DRIVE_NOT_READY 

Definition at line 486 of file d64.h.

◆ _D64FileType

Enumerator
FT_DEL 
FT_SEQ 
FT_PRG 
FT_USR 
FT_REL 

Definition at line 117 of file d64.h.

◆ _D64Format

enum _D64Format
Enumerator
CBMDOS 
SPEEDDOS40 
PROFESSIONALDOS35 
PROFESSIONALDOS40 
PROFESSIONALDOS40B 
DOLPHINDOS35 
DOLPHINDOS40 
PROLOGICDOS35 
PROLOGICDOS40 
PROSPEED35 
PROSPEED40 

Definition at line 433 of file d64.h.

◆ _D64Variants

Enumerator
TRACKS35 
TRACKS35ERRORS 
TRACKS40 
TRACKS40ERRORS 
TRACKS42 
TRACKS42ERRORS 

Definition at line 389 of file d64.h.

Function Documentation

◆ d64_create()

D64Handle * d64_create ( D64Format _format)

Create a new D64 disk image.

Parameters
_formatFormat of the disk image
Returns
D64Handle* Handle of the disk image

Definition at line 779 of file d64.c.

◆ d64_free()

void d64_free ( D64Handle * _handle)

Free the disk image resources.

Parameters
_handleHandle to disk image

Definition at line 924 of file d64.c.

◆ d64_get_free_sectors()

int d64_get_free_sectors ( D64Handle * _handle)

Definition at line 290 of file d64.c.

◆ d64_output()

void d64_output ( D64Handle * _handle,
unsigned char * _filename )

Definition at line 932 of file d64.c.

◆ d64_set_disk_id()

void d64_set_disk_id ( D64Handle * _handle,
D64DiskId _disk_id )

Set the disk id for the given disk image.

Parameters
_handleHandle of the disk image
_disk_idDISK ID

Definition at line 740 of file d64.c.

◆ d64_set_disk_name()

void d64_set_disk_name ( D64Handle * _handle,
unsigned char * _disk_name )

Set the disk name for the given disk image.

Parameters
_handleHandle of the disk image
_disk_nameName of the disk

Definition at line 714 of file d64.c.

◆ d64_set_dos_type()

void d64_set_dos_type ( D64Handle * _handle,
unsigned char * _dos_type )

Set the DOS Type for the given disk image.

Parameters
_handleHandle of the disk image
_dos_typeDOS Type

Definition at line 763 of file d64.c.

◆ d64_set_dos_version()

void d64_set_dos_version ( D64Handle * _handle,
D64DosVersion _version )

Set the DOS version for the given disk image.

Parameters
_handleHandle of the disk image
_versionVersion to set

Definition at line 698 of file d64.c.

◆ d64_write_file()

int d64_write_file ( D64Handle * _handle,
unsigned char * _filename,
D64FileType _type,
unsigned char * _buffer,
int _size )

Write a block of memory on a file on the D64 disk image.

Parameters
_handleHandle to the disk image
_filenameName of the file to write
_typeType of the file to write
_bufferBuffer to write
_sizeSize to write (in bytes)

Definition at line 802 of file d64.c.