forked from EtchedPixels/EmulatorKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
intel_8085_emulator.h
45 lines (32 loc) · 1.07 KB
/
intel_8085_emulator.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
#ifndef INTEL_I8085_EMULATOR_H
#define INTEL_I8085_EMULATOR_H
typedef enum
{
B=0, C, D, E, H, L, M, A, FLAGS,
AF, BC, DE, HL, SP, PC
}
reg_t;
extern uint8_t i8085_read(uint16_t addr);
extern void i8085_write(uint16_t addr, uint8_t value);
extern uint8_t i8085_debug_read(uint16_t addr);
extern uint8_t i8085_inport(uint8_t port);
extern void i8085_outport(uint8_t port, uint8_t value);
extern int i8085_get_input(void);
extern void i8085_set_output(int value);
extern void i8085_set_int(int n);
extern void i8085_clear_int(int n);
#define INT_NMI 0x80
#define INT_EXTERN 0x40 /* Assumed to provide 0xFF */
/* These are arranged to line up with SIM for simplicity */
#define INT_RST75 0x04
#define INT_RST65 0x02
#define INT_RST55 0x01
extern uint8_t i8085_read_reg8(reg_t reg);
extern void i8085_write_reg8(reg_t reg, uint8_t value);
extern uint16_t i8085_read_reg16(reg_t reg);
extern void i8085_write_reg16(reg_t reg, uint16_t value);
extern void i8085_reset();
extern int i8085_exec(int cycles);
extern FILE *i8085_log;
extern void i8085_load_symbols(const char *path);
#endif