-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathemulator.h
More file actions
35 lines (29 loc) · 734 Bytes
/
Copy pathemulator.h
File metadata and controls
35 lines (29 loc) · 734 Bytes
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
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct ConditionCodes {
uint8_t zero: 1;
uint8_t parity: 1;
uint8_t auxcarry: 1;
uint8_t carry: 1;
uint8_t sign: 1;
} ConditionCodes;
typedef struct State8080 {
uint8_t a;
uint8_t b;
uint8_t c;
uint8_t d;
uint8_t e;
uint8_t h;
uint8_t l;
uint16_t pc;
uint16_t sp;
uint8_t *memory;
uint8_t int_enable;
struct ConditionCodes cc;
} State8080;
void read_rom_into_memory(State8080 *emu, unsigned int start_addr, char *rom_files[], unsigned int rom_count);
int emulate(State8080 *emu);
void generate_interrupt(State8080* emu, int interrupt_num);
void print_last_1000_instructions();