-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibDisk.h
More file actions
37 lines (30 loc) · 743 Bytes
/
Copy pathLibDisk.h
File metadata and controls
37 lines (30 loc) · 743 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// Disk.h
//
// Emulates a very simple disk (no timing issues). Allows user to
// read and write to the disk just as if it was dealing with sectors
//
//
/***************************/
/* DO NOT MODIFY THIS FILE */
/***************************/
#ifndef __Disk_H__
#define __Disk_H__
// a few disk parameters
#define SECTOR_SIZE 512
#define TOTAL_SECTORS 10000
// disk errors
typedef enum {
E_MEM_OP,
E_INVALID_PARAM,
E_OPENING_FILE,
E_WRITING_FILE,
E_READING_FILE,
} Disk_Error_t;
extern int diskErrno; // used to see what happened w/ disk ops
int Disk_Init();
int Disk_Save(char* file);
int Disk_Load(char* file);
int Disk_Write(int sector, char* buffer);
int Disk_Read(int sector, char* buffer);
#endif // __Disk_H__