summaryrefslogtreecommitdiff
path: root/apps/plugins/rockboy
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/rockboy')
-rw-r--r--apps/plugins/rockboy/HACKING12
-rw-r--r--apps/plugins/rockboy/emu.c2
-rw-r--r--apps/plugins/rockboy/menu.c2
-rw-r--r--apps/plugins/rockboy/pcm.h6
-rw-r--r--apps/plugins/rockboy/rbsound.c12
-rw-r--r--apps/plugins/rockboy/rockboy.c4
-rw-r--r--apps/plugins/rockboy/sound.c2
7 files changed, 20 insertions, 20 deletions
diff --git a/apps/plugins/rockboy/HACKING b/apps/plugins/rockboy/HACKING
index 3efd85ed9b..b0b9169ae9 100644
--- a/apps/plugins/rockboy/HACKING
+++ b/apps/plugins/rockboy/HACKING
@@ -364,22 +364,22 @@ called before reading or writing a sound register, and at the end of
364each frame. 364each frame.
365 365
366The main sound module interfaces with the system-specific code through 366The main sound module interfaces with the system-specific code through
367one structure, pcm, and a few functions: pcm_init, pcm_close, and 367one structure, pcm, and a few functions: rockboy_pcm_init, rockboy_pcm_close, and
368pcm_submit. While the first two should be obvious, pcm_submit needs 368rockboy_pcm_submit. While the first two should be obvious, rockboy_pcm_submit needs
369some explaining. Whenever realtime sound output is operational, 369some explaining. Whenever realtime sound output is operational,
370pcm_submit is responsible for timing, and should not return until it 370rockboy_pcm_submit is responsible for timing, and should not return until it
371has successfully processed all the data in its input buffer (pcm.buf). 371has successfully processed all the data in its input buffer (pcm.buf).
372On *nix sound devices, this typically means just waiting for the write 372On *nix sound devices, this typically means just waiting for the write
373syscall to return, but on systems such as DOS where low level IO must 373syscall to return, but on systems such as DOS where low level IO must
374be handled in the program, pcm_submit needs to delay until the current 374be handled in the program, rockboy_pcm_submit needs to delay until the current
375position in the DMA buffer has advanced sufficiently to make space for 375position in the DMA buffer has advanced sufficiently to make space for
376the new samples, then copy them. 376the new samples, then copy them.
377 377
378For special sound output implementations like write-to-file or the 378For special sound output implementations like write-to-file or the
379dummy sound device, pcm_submit should write the data immediately and 379dummy sound device, rockboy_pcm_submit should write the data immediately and
380return 0, indicating to the caller that other methods must be used for 380return 0, indicating to the caller that other methods must be used for
381timing. On real sound devices that are presently functional, 381timing. On real sound devices that are presently functional,
382pcm_submit should return 1, regardless of whether it buffered or 382rockboy_pcm_submit should return 1, regardless of whether it buffered or
383actually wrote the sound data. 383actually wrote the sound data.
384 384
385And yes, for unices without OSS, we hope to add piped audio output 385And yes, for unices without OSS, we hope to add piped audio output
diff --git a/apps/plugins/rockboy/emu.c b/apps/plugins/rockboy/emu.c
index 08c4dabf89..57b82cfbb1 100644
--- a/apps/plugins/rockboy/emu.c
+++ b/apps/plugins/rockboy/emu.c
@@ -56,7 +56,7 @@ void emu_run(void)
56 if (options.sound || !plugbuf) 56 if (options.sound || !plugbuf)
57 { 57 {
58 sound_mix(); 58 sound_mix();
59 pcm_submit(); 59 rockboy_pcm_submit();
60 } 60 }
61 61
62 doevents(); 62 doevents();
diff --git a/apps/plugins/rockboy/menu.c b/apps/plugins/rockboy/menu.c
index b1a7389a18..6e8df5c0ea 100644
--- a/apps/plugins/rockboy/menu.c
+++ b/apps/plugins/rockboy/menu.c
@@ -85,7 +85,7 @@ int do_user_menu(void) {
85 "Load Game", "Save Game", 85 "Load Game", "Save Game",
86 "Options", "Quit"); 86 "Options", "Quit");
87 87
88 pcm_init(); 88 rockboy_pcm_init();
89 89
90 while(!done) 90 while(!done)
91 { 91 {
diff --git a/apps/plugins/rockboy/pcm.h b/apps/plugins/rockboy/pcm.h
index b90bba087f..795b2be7a9 100644
--- a/apps/plugins/rockboy/pcm.h
+++ b/apps/plugins/rockboy/pcm.h
@@ -15,9 +15,9 @@ struct pcm
15 15
16extern struct pcm pcm; 16extern struct pcm pcm;
17 17
18void pcm_init(void); 18void rockboy_pcm_init(void);
19int pcm_submit(void); 19int rockboy_pcm_submit(void);
20void pcm_close(void); 20void rockboy_pcm_close(void);
21 21
22#endif 22#endif
23 23
diff --git a/apps/plugins/rockboy/rbsound.c b/apps/plugins/rockboy/rbsound.c
index ac5a29c517..c0d0277915 100644
--- a/apps/plugins/rockboy/rbsound.c
+++ b/apps/plugins/rockboy/rbsound.c
@@ -24,7 +24,7 @@ static void get_more(unsigned char** start, size_t* size)
24 doneplay=1; 24 doneplay=1;
25} 25}
26 26
27void pcm_init(void) 27void rockboy_pcm_init(void)
28{ 28{
29 if(plugbuf) 29 if(plugbuf)
30 return; 30 return;
@@ -61,7 +61,7 @@ void pcm_init(void)
61 rb->pcm_set_frequency(pcm.hz); /* 44100 22050 11025 */ 61 rb->pcm_set_frequency(pcm.hz); /* 44100 22050 11025 */
62} 62}
63 63
64void pcm_close(void) 64void rockboy_pcm_close(void)
65{ 65{
66 memset(&pcm, 0, sizeof pcm); 66 memset(&pcm, 0, sizeof pcm);
67 newly_started = true; 67 newly_started = true;
@@ -69,7 +69,7 @@ void pcm_close(void)
69 rb->pcm_set_frequency(HW_SAMPR_DEFAULT); 69 rb->pcm_set_frequency(HW_SAMPR_DEFAULT);
70} 70}
71 71
72int pcm_submit(void) 72int rockboy_pcm_submit(void)
73{ 73{
74 if (!pcm.buf) return 0; 74 if (!pcm.buf) return 0;
75 if (pcm.pos < pcm.len) return 1; 75 if (pcm.pos < pcm.len) return 1;
@@ -91,7 +91,7 @@ int pcm_submit(void)
91 91
92#else 92#else
93 93
94void pcm_init(void) 94void rockboy_pcm_init(void)
95{ 95{
96 pcm.hz = 44100; 96 pcm.hz = 44100;
97 pcm.stereo = 1; 97 pcm.stereo = 1;
@@ -100,12 +100,12 @@ void pcm_init(void)
100 pcm.pos = 0; 100 pcm.pos = 0;
101} 101}
102 102
103void pcm_close(void) 103void rockboy_pcm_close(void)
104{ 104{
105 memset(&pcm, 0, sizeof pcm); 105 memset(&pcm, 0, sizeof pcm);
106} 106}
107 107
108int pcm_submit(void) 108int rockboy_pcm_submit(void)
109{ 109{
110 pcm.pos =0; 110 pcm.pos =0;
111 return 0; 111 return 0;
diff --git a/apps/plugins/rockboy/rockboy.c b/apps/plugins/rockboy/rockboy.c
index 82f966763d..b95cd6d0ff 100644
--- a/apps/plugins/rockboy/rockboy.c
+++ b/apps/plugins/rockboy/rockboy.c
@@ -361,7 +361,7 @@ static int gnuboy_main(const char *rom)
361 rb->lcd_puts(0,0,"Init video"); 361 rb->lcd_puts(0,0,"Init video");
362 vid_init(); 362 vid_init();
363 rb->lcd_puts(0,1,"Init sound"); 363 rb->lcd_puts(0,1,"Init sound");
364 pcm_init(); 364 rockboy_pcm_init();
365 rb->lcd_puts(0,2,"Loading rom"); 365 rb->lcd_puts(0,2,"Loading rom");
366 loader_init(rom); 366 loader_init(rom);
367 if(shut) 367 if(shut)
@@ -438,7 +438,7 @@ enum plugin_status plugin_start(const void* parameter)
438 return PLUGIN_ERROR; 438 return PLUGIN_ERROR;
439 } 439 }
440 if(!rb->audio_status()) 440 if(!rb->audio_status())
441 pcm_close(); 441 rockboy_pcm_close();
442 442
443 rb->splash(HZ/2, "Closing Rockboy"); 443 rb->splash(HZ/2, "Closing Rockboy");
444 444
diff --git a/apps/plugins/rockboy/sound.c b/apps/plugins/rockboy/sound.c
index 6efc01b11c..e8b8c6924c 100644
--- a/apps/plugins/rockboy/sound.c
+++ b/apps/plugins/rockboy/sound.c
@@ -422,7 +422,7 @@ void sound_mix(void)
422 if (pcm.buf) 422 if (pcm.buf)
423 { 423 {
424 if (pcm.pos >= pcm.len) 424 if (pcm.pos >= pcm.len)
425 pcm_submit(); 425 rockboy_pcm_submit();
426 if (pcm.stereo) 426 if (pcm.stereo)
427 { 427 {
428 pcm.buf[pcm.pos++] = l; 428 pcm.buf[pcm.pos++] = l;