rockbox/apps/plugins/rockboy/cpu-gb.h
Tom Ross 2882b26a99 Major Rockboy update.
1) Adapt Rockboy to smaller screens (H10, X5, and iPod Nano).
2) Add the ability to use a preset palette on color targets. Choose 'Set Palette' from the main menu.
3) Clean up the code to remove any unused code and variables.
4) Changed tabs to spaces.
5) Disable reading and writing sound when sound is disabled.
6) Disbable writing to the RTC since it is not implemented yet.
7) Minor optimizations from WAC gnuboy CE and iBoy.
8) Massive clean up of code to make it appear consistent.
9) Change all C++ style comments to C style.
10) Completely reorganize dynarec. Add fixmes to all unimplemented opcodes. Add debug writes for all opcodes. Attempt to implement a few opcodes myself.
11) Silence some warnings when built using dynarec.
12) Minor reshuffling of IRAM, may or not offer a speed increase.
13) Include fixes found in the short-lived gnuboy CVS.

All in all, there's about a 10% improvement on my test roms when sound is disabled and slight improvement with sound. Especially noticable when there are few sprites on screen and less action is occurring. See FS #6567.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12216 a1c6a512-1295-4272-9138-f99709370657
2007-02-06 21:41:08 +00:00

59 lines
1 KiB
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) ICODE_ATTR;
#endif