-
Notifications
You must be signed in to change notification settings - Fork 7
/
Floppy.h
71 lines (51 loc) · 1.46 KB
/
Floppy.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//
// Floppy.h
// The Omega Project
// https://github.com/h5n1xp/Omega
//
// Created by Matt Parsons on 02/02/2019.
// Copyright © 2019 Matt Parsons. All rights reserved.
// <[email protected]>
//
//
// This Source Code Form is subject to the terms of the
// Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
/* UAE-1ADF (ADF_EXT2)
* W reserved
* W number of tracks (default 2*80=160)
*
* W reserved
* W type, 0=normal AmigaDOS track, 1 = raw MFM (upper byte = disk revolutions - 1)
* L available space for track in bytes (must be even)
* L track length in bits
*
*/
#ifndef Floppy_h
#define Floppy_h
#include <stdio.h>
#include "CIA.h"
#include "Chipset.h"
typedef struct{
uint8_t pra;
uint8_t prb;
int idMode;
int index;
int cylinder;
int side;
uint8_t mfmData[12798*82*2]; //trackSize * tracks * sides
}Fd_t;
extern Fd_t df[4];
extern int floppySync;
extern int driveSelected;
void floppyEject();
uint8_t floppyDataRead();
void floppyInsert(int);
uint8_t* floppyInit(int); // returns the mfm data buffer
void floppyIndexReset();
void floppyState(); //Get the drive state for the CIA
void floppySetState(); //Set the Drive State for the CIA
void encodeBlock(uint8_t* source, uint8_t* destination,int size);
uint8_t addClockBits(uint8_t previous, uint8_t value);
void ADF2MFM(int fd, uint8_t* mfm);
#endif /* Floppy_h */