MCPcopy Create free account
hub / github.com/TASEmulators/fceux / CTRL

Function CTRL

src/unif.cpp:202–228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200}
201
202static int CTRL(FCEUFILE *fp) {
203 int t;
204 uint32 i;
205 if (uchead.info == 1) {
206 if ((t = FCEU_fgetc(fp)) == EOF)
207 return(0);
208 /* The information stored in this byte isn't very helpful, but it's
209 better than nothing...maybe.
210 */
211
212 if (t & 1)
213 GameInfo->input[0] = GameInfo->input[1] = SI_GAMEPAD;
214 else
215 GameInfo->input[0] = GameInfo->input[1] = SI_NONE;
216 if (t & 2)
217 GameInfo->input[1] = SI_ZAPPER;
218 } else {
219 FCEU_printf(" Incorrect Control Chunk Size (%d). Data is:", uchead.info);
220 for (i = 0; i < uchead.info; i++) {
221 t = FCEU_fgetc(fp);
222 FCEU_printf(" %02x", t);
223 }
224 FCEU_printf("\n");
225 GameInfo->input[0] = GameInfo->input[1] = SI_GAMEPAD;
226 }
227 return(1);
228}
229
230static int TVCI(FCEUFILE *fp) {
231 int t;

Callers

nothing calls this directly

Calls 2

FCEU_fgetcFunction · 0.85
FCEU_printfFunction · 0.85

Tested by

no test coverage detected