diff options
author | Rafaël Carré <rafael.carre@gmail.com> | 2010-05-27 12:00:23 +0000 |
---|---|---|
committer | Rafaël Carré <rafael.carre@gmail.com> | 2010-05-27 12:00:23 +0000 |
commit | b36e721aa66e20595eb4441edaaddac76f8d5147 (patch) | |
tree | 09bf0d917cb6d04714ef9c21c26ee9f1a2a3d4d1 | |
parent | b0146de64cdcd581f4d179262d2361622c8de096 (diff) | |
download | rockbox-b36e721aa66e20595eb4441edaaddac76f8d5147.tar.gz rockbox-b36e721aa66e20595eb4441edaaddac76f8d5147.zip |
rockboy: rename pcm_*() functions to avoid namespace clash with rockbox
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26327 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/rockboy/HACKING | 12 | ||||
-rw-r--r-- | apps/plugins/rockboy/emu.c | 2 | ||||
-rw-r--r-- | apps/plugins/rockboy/menu.c | 2 | ||||
-rw-r--r-- | apps/plugins/rockboy/pcm.h | 6 | ||||
-rw-r--r-- | apps/plugins/rockboy/rbsound.c | 12 | ||||
-rw-r--r-- | apps/plugins/rockboy/rockboy.c | 4 | ||||
-rw-r--r-- | apps/plugins/rockboy/sound.c | 2 |
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 | |||
364 | each frame. | 364 | each frame. |
365 | 365 | ||
366 | The main sound module interfaces with the system-specific code through | 366 | The main sound module interfaces with the system-specific code through |
367 | one structure, pcm, and a few functions: pcm_init, pcm_close, and | 367 | one structure, pcm, and a few functions: rockboy_pcm_init, rockboy_pcm_close, and |
368 | pcm_submit. While the first two should be obvious, pcm_submit needs | 368 | rockboy_pcm_submit. While the first two should be obvious, rockboy_pcm_submit needs |
369 | some explaining. Whenever realtime sound output is operational, | 369 | some explaining. Whenever realtime sound output is operational, |
370 | pcm_submit is responsible for timing, and should not return until it | 370 | rockboy_pcm_submit is responsible for timing, and should not return until it |
371 | has successfully processed all the data in its input buffer (pcm.buf). | 371 | has successfully processed all the data in its input buffer (pcm.buf). |
372 | On *nix sound devices, this typically means just waiting for the write | 372 | On *nix sound devices, this typically means just waiting for the write |
373 | syscall to return, but on systems such as DOS where low level IO must | 373 | syscall to return, but on systems such as DOS where low level IO must |
374 | be handled in the program, pcm_submit needs to delay until the current | 374 | be handled in the program, rockboy_pcm_submit needs to delay until the current |
375 | position in the DMA buffer has advanced sufficiently to make space for | 375 | position in the DMA buffer has advanced sufficiently to make space for |
376 | the new samples, then copy them. | 376 | the new samples, then copy them. |
377 | 377 | ||
378 | For special sound output implementations like write-to-file or the | 378 | For special sound output implementations like write-to-file or the |
379 | dummy sound device, pcm_submit should write the data immediately and | 379 | dummy sound device, rockboy_pcm_submit should write the data immediately and |
380 | return 0, indicating to the caller that other methods must be used for | 380 | return 0, indicating to the caller that other methods must be used for |
381 | timing. On real sound devices that are presently functional, | 381 | timing. On real sound devices that are presently functional, |
382 | pcm_submit should return 1, regardless of whether it buffered or | 382 | rockboy_pcm_submit should return 1, regardless of whether it buffered or |
383 | actually wrote the sound data. | 383 | actually wrote the sound data. |
384 | 384 | ||
385 | And yes, for unices without OSS, we hope to add piped audio output | 385 | And 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 | ||
16 | extern struct pcm pcm; | 16 | extern struct pcm pcm; |
17 | 17 | ||
18 | void pcm_init(void); | 18 | void rockboy_pcm_init(void); |
19 | int pcm_submit(void); | 19 | int rockboy_pcm_submit(void); |
20 | void pcm_close(void); | 20 | void 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 | ||
27 | void pcm_init(void) | 27 | void 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 | ||
64 | void pcm_close(void) | 64 | void 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 | ||
72 | int pcm_submit(void) | 72 | int 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 | ||
94 | void pcm_init(void) | 94 | void 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 | ||
103 | void pcm_close(void) | 103 | void rockboy_pcm_close(void) |
104 | { | 104 | { |
105 | memset(&pcm, 0, sizeof pcm); | 105 | memset(&pcm, 0, sizeof pcm); |
106 | } | 106 | } |
107 | 107 | ||
108 | int pcm_submit(void) | 108 | int 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; |