MCPcopy Create free account
hub / github.com/Stewmath/GameYob / updateCheatMenu

Function updateCheatMenu

arm9/source/cheats.cpp:245–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

243}
244
245void updateCheatMenu() {
246 bool redraw=false;
247 if (cheatMenuSelection >= numCheats) {
248 cheatMenuSelection = 0;
249 }
250
251 if (keyPressedAutoRepeat(KEY_UP)) {
252 if (cheatMenuSelection > 0) {
253 cheatMenuSelection--;
254 redraw = true;
255 }
256 }
257 else if (keyPressedAutoRepeat(KEY_DOWN)) {
258 if (cheatMenuSelection < numCheats-1) {
259 cheatMenuSelection++;
260 redraw = true;
261 }
262 }
263 else if (keyJustPressed(KEY_RIGHT | KEY_LEFT)) {
264 toggleCheat(cheatMenuSelection, !(cheats[cheatMenuSelection].flags & FLAG_ENABLED));
265 redraw = true;
266 }
267 else if (keyJustPressed(KEY_R)) {
268 cheatMenuSelection += cheatsPerPage;
269 if (cheatMenuSelection >= numCheats)
270 cheatMenuSelection = 0;
271 redraw = true;
272 }
273 else if (keyJustPressed(KEY_L)) {
274 cheatMenuSelection -= cheatsPerPage;
275 if (cheatMenuSelection < 0)
276 cheatMenuSelection = numCheats-1;
277 redraw = true;
278 }
279 if (keyJustPressed(KEY_B)) {
280 closeSubMenu();
281 if (!cheatMenu_gameboyWasPaused)
282 unpauseGameboy();
283 }
284
285 if (redraw)
286 doAtVBlank(redrawCheatMenu);
287}
288
289bool startCheatMenu() {
290 if (numCheats == 0)

Callers

nothing calls this directly

Calls 6

keyPressedAutoRepeatFunction · 0.85
keyJustPressedFunction · 0.85
toggleCheatFunction · 0.85
closeSubMenuFunction · 0.85
unpauseGameboyFunction · 0.85
doAtVBlankFunction · 0.85

Tested by

no test coverage detected