MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / ZDSP_doCommand

Function ZDSP_doCommand

src/SB/Game/zDispatcher.cpp:164–335  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162 ctx.indata = indata;
163 ctx.inxtra = inxtra;
164 ctx.result = result;
165 ZDSP_doCommand(dspdata, &ctx);
166}
167
168static S32 ZDSP_doCommand(st_ZDISPATCH_DATA* dspdata, st_ZDISPATCH_CONTEXT* cmdCtxt)
169{
170 S32 iv;
171 en_DISPATCH_COMMAND cmd = cmdCtxt->cmd;
172 void* indata = cmdCtxt->indata;
173 void* result = cmdCtxt->result;
174 static S32 warned;
175 static S8 init;
176
177 if ((S32)init == 0)
178 {
179 warned = 0;
180 init = 1;
181 }
182 if (warned == 0)
183 {
184 warned = 1;
185 }
186
187 switch (cmd)
188 {
189 case ZDSP_CMD_CTRL_CFGGET:
190 *(S32*)result = 0;
191 break;
192 case ZDSP_CMD_CTRL_CFGSET:
193 if (result != NULL)
194 {
195 *(S32*)result = 0;
196 }
197 break;
198 case ZDSP_CMD_CTRL_VIBEGET:
199 *(S32*)result = zVarEntryCB_VibrationOn(NULL);
200 break;
201 case ZDSP_CMD_CTRL_VIBESET:
202 if (globals.option_vibration != *(S32*)indata)
203 {
204 globals.option_vibration = *(S32*)indata;
205 xPadRumbleEnable(globals.currentActivePad, globals.option_vibration);
206 zRumbleStart(globals.currentActivePad, SDR_Test);
207 }
208 break;
209 case ZDSP_CMD_SNDMOD_GET:
210 *(S32*)result = zVarEntryCB_SndMode(NULL);
211 break;
212 case ZDSP_CMD_SNDMOD_SET:
213 if (*(S32*)indata == 0)
214 {
215 iSndStereo(0);
216 }
217 else if (*(S32*)indata == 1)
218 {
219 iSndStereo(1);
220 }
221

Callers 1

ZDSP_injectCmdFunction · 0.70

Calls 13

zVarEntryCB_VibrationOnFunction · 0.85
zRumbleStartFunction · 0.85
zVarEntryCB_SndModeFunction · 0.85
iSndStereoFunction · 0.85
WRAP_xsnd_setMusicVolumeFunction · 0.85
WRAP_xsnd_setSFXVolumeFunction · 0.85
zGameStateGetFunction · 0.85
zGameModeGetFunction · 0.85
zVarEntryCB_SndMusicVolFunction · 0.70
zVarEntryCB_SndFXVolFunction · 0.70
zGameStateSwitchFunction · 0.70
zGameModeSwitchFunction · 0.70

Tested by

no test coverage detected