summaryrefslogtreecommitdiff
path: root/apps/plugins/rockboy/emu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/rockboy/emu.c')
-rw-r--r--apps/plugins/rockboy/emu.c39
1 files changed, 12 insertions, 27 deletions
diff --git a/apps/plugins/rockboy/emu.c b/apps/plugins/rockboy/emu.c
index 8ee925cd02..50fc442713 100644
--- a/apps/plugins/rockboy/emu.c
+++ b/apps/plugins/rockboy/emu.c
@@ -5,24 +5,9 @@
5#include "cpu-gb.h" 5#include "cpu-gb.h"
6#include "mem.h" 6#include "mem.h"
7#include "lcd-gb.h" 7#include "lcd-gb.h"
8#include "rc.h"
9#include "sound.h" 8#include "sound.h"
10#include "rtc-gb.h" 9#include "rtc-gb.h"
11 10
12static int framelen = 16743;
13static int framecount;
14
15rcvar_t emu_exports[] =
16{
17 RCV_INT("framelen", &framelen),
18 RCV_INT("framecount", &framecount),
19 RCV_END
20};
21
22void emu_init(void)
23{
24}
25
26/* 11/*
27 * emu_reset is called to initialize the state of the emulated 12 * emu_reset is called to initialize the state of the emulated
28 * system. It should set cpu registers, hardware registers, etc. to 13 * system. It should set cpu registers, hardware registers, etc. to
@@ -47,9 +32,8 @@ void emu_step(void)
47 * make things work in the mean time. */ 32 * make things work in the mean time. */
48void emu_run(void) 33void emu_run(void)
49{ 34{
50// void *timer = sys_timer(); 35 /*void *timer = sys_timer();*/
51 int framesin=0,frames=0,timeten=*rb->current_tick, timehun=*rb->current_tick; 36 int framesin=0,frames=0,timeten=*rb->current_tick, timehun=*rb->current_tick;
52// int delay;
53 37
54 setvidmode(options.fullscreen); 38 setvidmode(options.fullscreen);
55 vid_begin(); 39 vid_begin();
@@ -63,24 +47,25 @@ void emu_run(void)
63 while (R_LY > 0 && R_LY < 144) 47 while (R_LY > 0 && R_LY < 144)
64 emu_step(); 48 emu_step();
65 49
66 rtc_tick(); 50 /* rtc_tick(); */ /* RTC support not implemented */
67 sound_mix(); 51
68 if (!pcm_submit()) 52 if(options.sound)
69 { 53 {
70/* delay = framelen - sys_elapsed(timer); 54 sound_mix();
71 sys_sleep(delay); 55 pcm_submit();
72 sys_elapsed(timer);*/
73 } 56 }
74 57
75 doevents(); 58 doevents();
76 vid_begin(); 59 vid_begin();
77 60
78 if (!(R_LCDC & 0x80)) 61 if (!(R_LCDC & 0x80))
79 cpu_emulate(32832); 62 cpu_emulate(32832);
80 63
81 while (R_LY > 0) /* wait for next frame */ 64 while (R_LY > 0) /* wait for next frame */
65 {
82 emu_step(); 66 emu_step();
83 rb->yield(); 67 rb->yield();
68 }
84 69
85 frames++; 70 frames++;
86 framesin++; 71 framesin++;