1 #include "rockmacros.h"
13 * emu_reset is called to initialize the state of the emulated
14 * system. It should set cpu registers, hardware registers, etc. to
15 * their appropriate values at powerup time.
27 static void emu_step(void)
29 cpu_emulate(cpu
.lcdc
);
32 /* This mess needs to be moved to another module; it's just here to
33 * make things work in the mean time. */
36 int framesin
=0,frames
=0,timeten
=*rb
->current_tick
, timehun
=*rb
->current_tick
;
41 #ifdef HAVE_ADJUSTABLE_CPU_FREQ
51 while (R_LY
> 0 && R_LY
< 144)
56 if (options
.sound
|| !plugbuf
)
68 while (R_LY
> 0) /* wait for next frame */
77 if(*rb
->current_tick
-timeten
>=10)
79 timeten
=*rb
->current_tick
;
80 if(framesin
<6) options
.frameskip
++;
81 if(framesin
>6) options
.frameskip
--;
82 if(options
.frameskip
>options
.maxskip
) options
.frameskip
=options
.maxskip
;
83 if(options
.frameskip
<0) options
.frameskip
=0;
88 if(*rb
->current_tick
-timehun
>=100)
92 timehun
=*rb
->current_tick
;
96 #ifdef HAVE_ADJUSTABLE_CPU_FREQ