This repository has been archived by the owner on Jun 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pause.c
199 lines (196 loc) · 6 KB
/
pause.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
/* Beatbox - pause.c
* Copyright (c) 2011 Tanner Babcock */
#include <oslib/oslib.h>
#include <pspsdk.h>
#include <stdio.h>
#include "main.h"
void BBpause(void) {
int x = FALSE, y = FALSE, z = FALSE;
char mstr[20];
while (!osl_quit) {
oslStartDrawing();
oslReadKeys();
oslCls();
oslDrawImage(bgimage);
if (colorsb == TRUE)
BBdrawgrid();
oslDrawFillRect(0, 0, 480, 272, RGBA(0, 0, 0, 100));
if (menuoption == METRONOMEM) {
if (metronomeb == FALSE)
oslDrawString(10, 80, "-> Metronome: off");
else
oslDrawString(10, 80, "-> Metronome: on");
} else {
if (metronomeb == FALSE)
oslDrawString(10, 80, " Metronome: off");
else
oslDrawString(10, 80, " Metronome: on");
} if (menuoption == SOUNDSETM) {
if (soundset == ROCK)
oslDrawString(10, 90, "-> Sound set: rock");
else if (soundset == HIPHOP)
oslDrawString(10, 90, "-> Sound set: hip hop");
else if (soundset == BONGO)
oslDrawString(10, 90, "-> Sound set: bongo");
else
oslDrawString(10, 90, "-> Sound set: tones");
} else {
if (soundset == ROCK)
oslDrawString(10, 90, " Sound set: rock");
else if (soundset == HIPHOP)
oslDrawString(10, 90, " Sound set: hip hop");
else if (soundset == BONGO)
oslDrawString(10, 90, " Sound set: bongo");
else
oslDrawString(10, 90, " Sound set: tones");
} if (menuoption == MODEM) {
if (mode == FOURKEY)
oslDrawString(10, 100, "-> Mode: four-key");
else
oslDrawString(10, 100, "-> Mode: eight-key");
} else {
if (mode == FOURKEY)
oslDrawString(10, 100, " Mode: four-key");
else
oslDrawString(10, 100, " Mode: eight-key");
} if (menuoption == SCHEMEM) {
if (colorset == BLACK)
oslDrawString(10, 120, "-> Grid style: black");
else
oslDrawString(10, 120, "-> Grid style: white");
} else {
if (colorset == BLACK)
oslDrawString(10, 120, " Grid style: black");
else
oslDrawString(10, 120, " Grid style: white");
} if (menuoption == EDITCOLORS)
oslDrawString(10, 130, "-> Edit colors");
else
oslDrawString(10, 130, " Edit colors");
if (menuoption == HELP)
oslDrawString(10, 140, "-> Help me");
else
oslDrawString(10, 140, " Help me");
if (menuoption == QUIT)
oslDrawString(10, 150, "-> Quit");
else
oslDrawString(10, 150, " Quit");
if ((osl_keys->pressed.down) && (menuoption != QUIT))
menuoption++;
if ((osl_keys->pressed.up) && (menuoption != METRONOMEM))
menuoption--;
if (osl_keys->pressed.right) {
if (menuoption == METRONOMEM) {
if (metronomeb == FALSE) {
oslSetSoundLoop(metronome, 1);
oslPlaySound(metronome, 7);
metronomeb++;
}
} if (menuoption == SOUNDSETM) {
if (soundset != TONE)
soundset++;
x = TRUE;
} else if (menuoption == MODEM) {
if (mode == FOURKEY)
mode++;
} else if (menuoption == SCHEMEM) {
if (colorset == WHITE)
colorset = BLACK;
y = TRUE;
}
}
if (osl_keys->pressed.left) {
if (menuoption == METRONOMEM) {
if (metronomeb == TRUE) {
oslStopSound(metronome);
metronomeb--;
}
} if (menuoption == SOUNDSETM) {
if (soundset != ROCK)
soundset--;
x = TRUE;
} else if (menuoption == MODEM) {
if (mode == EIGHTKEY)
mode--;
} else if (menuoption == SCHEMEM) {
if (colorset == BLACK)
colorset = WHITE;
y = TRUE;
}
}
if (osl_keys->pressed.cross) {
if (menuoption == QUIT) {
oslEndGfx();
oslQuit();
break;
} else if (menuoption == HELP)
BBhelp();
else if (menuoption == EDITCOLORS)
BBeditcolors();
}
if (osl_keys->pressed.start)
break;
oslAudioVSync();
oslEndDrawing();
oslSyncFrame();
}
if (x == TRUE)
BBsoundsetswitch(soundset);
if (y == TRUE)
BBcolorsetswitch(colorset);
return;
}
void BBhelp(void) {
while (!osl_quit) {
oslStartDrawing();
oslReadKeys();
oslDrawImage(bgimage);
if (colorsb == TRUE)
BBdrawgrid();
oslDrawFillRect(0, 0, 480, 272, RGBA(0, 0, 0, 100));
oslDrawString(10, 10, "Beatbox is a drum machine for the PlayStation Portable.");
oslDrawString(10, 20, "There are four sound sets: rock and roll drums, hip hop");
oslDrawString(10, 30, "drums, bongo drums, and tones.");
oslDrawString(10, 50, "Change the sound set in the pause menu.");
oslDrawString(10, 70, "Eight-key mode allows you to play eight different drum");
oslDrawString(10, 80, "sounds, as opposed to four-key mode, which only allows you");
oslDrawString(10, 90, "to play four different drum sounds.");
oslDrawString(10, 110, "Toggle eight-key mode in the pause menu.");
oslDrawString(10, 130, "As you play, lights will flash in the middle of");
oslDrawString(10, 140, "the screen. You can edit the colors in the pause menu.");
oslDrawString(10, 160, "Or, you can disable this function in the pause menu.");
oslDrawString(10, 180, "You can play along with your own music in the ms0:/MUSIC");
oslDrawString(10, 190, "folder. Hold SELECT while playing to use the music");
oslDrawString(10, 200, "player.");
oslDrawString(10, 220, "The Music PRX has been fixed in version 1.6.");
oslDrawString(10, 230, "Music PRX plugin by joek2100.");
oslDrawString(10, 250, "Press O to hide this screen.");
if (osl_keys->pressed.circle)
break;
oslEndDrawing();
oslSyncFrame();
}
return;
}
void BBmusic(void) {
oslDrawFillRect(0, 0, 480, 272, RGBA(0, 0, 0, 100));
if (musexist == FALSE)
oslDrawString(12, 80, "Music plug-in is disabled.");
else {
oslDrawString(12, 80, "SELECT + L Trigger");
oslDrawString(200, 80, "Play / pause");
oslDrawString(12, 90, "SELECT + R Trigger");
oslDrawString(200, 90, "Toggle random");
oslDrawString(12, 100, "SELECT + Left");
oslDrawString(200, 100, "Previous track");
oslDrawString(12, 110, "SELECT + Right");
oslDrawString(200, 110, "Next track");
oslDrawString(12, 120, "SELECT + Up");
oslDrawString(200, 120, "Increase music volume");
oslDrawString(12, 130, "SELECT + Down");
oslDrawString(200, 130, "Decrease music volume");
oslDrawString(12, 140, "SELECT + Square");
oslDrawString(200, 140, "Display");
}
return;
}