-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEngine6502.h
More file actions
56 lines (45 loc) · 1.33 KB
/
Copy pathEngine6502.h
File metadata and controls
56 lines (45 loc) · 1.33 KB
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
#ifndef _ENGINE_6502_H_
#define _ENGINE_6502_H_
#include "DXEngine.h"
class Engine6502 : DXEngine {
private:
enum AddressMode {
_illegal, _xind, _zpg, _impl, _immed, _accum, _abs, _indy, _zpgx,
_absy, _absx, _rel, _zpgy, _ind
};
enum InstCode
{
_undoc, _adc, _and, _asl, _bcc, _bcs, _beq, _bit, _bmi, _bne,
_bpl, _brk, _bvc, _bvs, _clc, _cld, _cli, _clv, _cmp, _cpx, _cpy,
_dec, _dex, _dey, _eor, _inc, _inx, _iny, _jmp, _jsr, _lda,
_ldx, _ldy, _lsr, _nop, _ora, _pha, _php, _pla, _plp, _rol, _ror,
_rti, _rts, _sbc, _sec, _sed, _sei, _sta, _stx, _sty, _tax, _tay,
_tsx, _txa, _txs, _tya
};
static const char *mne[];
struct Opcode
{
int code;
int mode;
};
static struct Opcode codes[256];
static const long RESETVec = 0xfffc;
static const long NMIVec = 0xfffe;
static const long IRQVec = 0xfffa;
protected:
public:
private:
protected:
public:
Engine6502() : DXEngine() {};
Engine6502(Args *args, long beg, long end, long mask, const char *file) : DXEngine(args, beg, end, mask, file) {};
virtual void initialise();
virtual void usage();
virtual bool willBranch(long addr);
virtual bool canBranch(long addr);
virtual long branchAddress(long addr);
virtual bool validCode(long addr);
virtual int codeSize(long addr);
virtual int disassemble(long addr);
};
#endif