File: cpc.h

package info (click to toggle)
pasmo 0.5.3-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 868 kB
  • sloc: cpp: 8,508; asm: 3,027; sh: 804; makefile: 114
file content (73 lines) | stat: -rw-r--r-- 1,473 bytes parent folder | download | duplicates (8)
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
#ifndef INCLUDE_CPCCRC_H
#define INCLUDE_CPCCRC_H

// cpc.h
// Revision 5-dec-2004

#include <stdlib.h>

#include "pasmotypes.h"

namespace cpc {


unsigned short crc (const unsigned char * data, size_t size);

class Header {
public:
	Header ();
	Header (const std::string & filename);

	enum Type { Basic, Binary };

	void clear ();
	void setfilename (const std::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 std::string & filename);

	void clear ();
	void setfilename (const std::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 std::string tokHexNumber;

extern const std::string tokCALL;
extern const std::string tokLOAD;
extern const std::string tokMEMORY;

std::string number (address n);
std::string hexnumber (address n);
std::string basicline (address linenum, const std::string & line);


} // namespace cpc


#endif

// End of cpc.h