Started work on cpm disk emulation, read only for now

This commit is contained in:
2021-06-08 23:28:28 +02:00
parent e9eccf43c1
commit a92ab3c71e
4 changed files with 274 additions and 70 deletions

View File

@@ -2,17 +2,43 @@
#define CONTROL_H
#include "stm32f4xx_hal.h"
#include "fatfs.h"
#include <sys/types.h>
enum Type {
TYPE_NONE,
TYPE_FILE,
TYPE_DIR
};
typedef struct {
uint8_t dirty;
uint8_t action;
// Block and size are in blocks of 128
uint32_t start;
uint32_t size;
char* filename;
char name[8];
char ext[3];
} DiskEntry;
typedef struct {
uint8_t entry_count;
uint8_t current;
DiskEntry entries[127];
uint32_t end;
} Disk;
typedef struct {
FATFS *fs;
FIL *file;
uint8_t command;
uint8_t ready;
uint8_t lba_1;
uint8_t lba_2;
uint8_t lba_3;
uint32_t lba;
uint32_t counter;
uint32_t lba;
uint32_t offset;
uint8_t* buffer;
unsigned int size;
enum Type type;
Disk A;
} Storage;
typedef struct {