rockbox/apps/plugins/rockboy/cpu-gb.h
Daniel Stenberg 137fb6cb9f Karl Kurbjun's patch #1407719:
Here's another patch for rockboy that adds automatic frameskip (it's pretty
rough as I haven't figured out an accurate timer), fullscreen support on the
H300, and a bit of assembly and some IRAM stuff. I'm not sure if I'm doing the
IRAM stuff correct though as it doesn't seem to make much of a difference if
any. I've also added a statistics option that will show how many frames per
second the gameboy is seeing (not what the player is getting) and what the
frameskip is at. When you enable stats sometimes you have to go back into the
menu and then come out to clear erronous values.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8397 a1c6a512-1295-4272-9138-f99709370657
2006-01-20 13:05:52 +00:00

59 lines
990 B
C

#ifndef __CPU_GB_H__
#define __CPU_GB_H__
#include "defs.h"
union reg
{
byte b[2][2];
word w[2];
un32 d; /* padding for alignment, carry */
};
struct cpu
{
#ifdef DYNAREC
union reg a,b,c,d,e,hl,f,sp,pc;
#else
union reg pc, sp, bc, de, hl, af;
#endif
int ime, ima;
int speed;
int halt;
int div, tim;
int lcdc;
int snd;
};
extern struct cpu cpu;
#ifdef DYNAREC
struct dynarec_block {
union reg address;
void *block;
int length;
struct dynarec_block *next;
};
#define HASH_SIGNIFICANT_LOWER_BITS 8
#define HASH_BITMASK ((1<<HASH_SIGNIFICANT_LOWER_BITS)-1)
extern struct dynarec_block *address_map[1<<HASH_SIGNIFICANT_LOWER_BITS];
extern int blockclen;
#endif
void cpu_reset(void);
void div_advance(int cnt) ICODE_ATTR;
void timer_advance(int cnt) ICODE_ATTR;
void lcdc_advance(int cnt) ICODE_ATTR;
void sound_advance(int cnt) ICODE_ATTR;
void cpu_timers(int cnt) ICODE_ATTR;
int cpu_emulate(int cycles) ICODE_ATTR;
inline int cpu_step(int max);
#endif