forked from mkoloberdin/pasmo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcpc.h
75 lines (55 loc) · 1.42 KB
/
cpc.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
71
72
73
74
75
#ifndef INCLUDE_CPCCRC_H
#define INCLUDE_CPCCRC_H
// cpc.h
// Revision 11-aug-2005
#include "pasmotypes.h"
#include <stdlib.h>
namespace pasmo {
namespace cpc {
unsigned short crc (const unsigned char * data, size_t size);
class Header {
public:
Header ();
Header (const string & filename);
enum Type { Basic, Binary };
void clear ();
void setfilename (const string & filename);
void settype (Type type);
void setblock (byte n);
void firstblock (bool isfirst);
void lastblock (bool islast);
void setlength (address len);
void setblocklength (address blen);
void setloadaddress (address load);
void setentry (address entry);
void write (std::ostream & out);
private:
static const size_t headsize= 64;
byte data [headsize];
};
class AmsdosHeader {
public:
AmsdosHeader ();
AmsdosHeader (const string & filename);
void clear ();
void setfilename (const string & filename);
void setlength (address len);
void setloadaddress (address load);
void setentry (address entry);
void write (std::ostream & out);
private:
static const size_t headsize= 128;
byte amsdos [headsize];
};
// CPC Locomotive Basic generation.
extern const string tokHexNumber;
extern const string tokCALL;
extern const string tokLOAD;
extern const string tokMEMORY;
string number (address n);
string hexnumber (address n);
string basicline (address linenum, const string & line);
} // namespace cpc
} // namespace pasmo
#endif
// End of cpc.h