comparison src/video/ps3/SDL_ps3spe.c @ 3157:cce01ba54174 gsoc2009_ps3

Added comments, clean up.
author Martin Lowinski <martin@goldtopf.org>
date Thu, 27 Aug 2009 11:33:56 +0000
parents 0cf7bff804ad
children
comparison
equal deleted inserted replaced
3156:4ead4cef6b7b 3157:cce01ba54174
24 #include "SDL_video.h" 24 #include "SDL_video.h"
25 #include "SDL_ps3spe_c.h" 25 #include "SDL_ps3spe_c.h"
26 26
27 #include "SDL_ps3video.h" 27 #include "SDL_ps3video.h"
28 #include "SDL_ps3render_c.h" 28 #include "SDL_ps3render_c.h"
29
30
31 /* This SPE API basically provides 3 ways to run and control a program
32 * on the SPE:
33 * - Start and stop the program (keepalive=0).
34 * SPE_Start() will implicitly boot up the program, create a thread and run
35 * the context.
36 * SPE_Stop() will join the (terminated) thread (may block) and return.
37 * - Boot the program and run it (keepalive=0).
38 * SPE_Boot() will create a context and load the program and finally start
39 * the context with SPE_Start().
40 * SPE_Stop() will savely end the program.
41 * - Boot, Run and send messages to the program (keepalive=1).
42 * Start the program by using one of the methods described above. When
43 * received the READY-message the program is in its infinite loop waiting
44 * for new messages.
45 * Every time you run the program, send SPU_START and the address of the
46 * according struct using SPE_SendMsg().
47 * SPE_WaitForMsg() will than wait for SPU_FIN and is blocking.
48 * SPE_Shutdown() sends SPU_EXIT and finally stops the program.
49 *
50 * Therefor the SPE program
51 * - either runs once and returns
52 * - or runs in an infinite loop and is controlled by messages.
53 */
54 29
55 /* Start the SPE thread */ 30 /* Start the SPE thread */
56 int SPE_Start(spu_data_t * spe_data) 31 int SPE_Start(spu_data_t * spe_data)
57 { 32 {
58 deprintf(2, "[PS3->SPU] Start SPE: %s\n", spe_data->program_name); 33 deprintf(2, "[PS3->SPU] Start SPE: %s\n", spe_data->program_name);