cpu.h
 1  
 2  
 3  #ifndef __CPU_H__
 4  #define __CPU_H__
 5  
 6  
 7  
 8  #include "defs.h"
 9  
10  
11  union reg
12  {
13  	byte b[2][2];
14  	uint16 w[2];
15  	un32 d; /* padding for alignment, carry */
16  };
17  
18  struct cpu
19  {
20  	union reg pc, sp, bc, de, hl, af;
21  	int ime, ima;
22  	int speed;
23  	int halt;
24  	int div, tim;
25  	int lcdc;
26  	int snd;
27  };
28  
29  extern struct cpu cpu;
30  
31  extern void cpu_reset();
32  extern int cpu_emulate(int cycles);
33  
34  
35  #endif
36  
37