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

Function gbsCheckInput

arm9/source/gbs.cpp:142–169  ·  view source on GitHub ↗

Called at vblank each frame

Source from the content-addressed store, hash-verified

140
141// Called at vblank each frame
142void gbsCheckInput() {
143 if (keyPressedAutoRepeat(mapGbKey(KEY_GB_LEFT))) {
144 if (gbsSelectedSong == 0)
145 gbsSelectedSong = gbsNumSongs-1;
146 else
147 gbsSelectedSong--;
148 }
149 if (keyPressedAutoRepeat(mapGbKey(KEY_GB_RIGHT))) {
150 gbsSelectedSong++;
151 if (gbsSelectedSong == gbsNumSongs)
152 gbsSelectedSong = 0;
153 }
154 if (keyJustPressed(mapGbKey(KEY_GB_A))) {
155 gbsLoadSong();
156 }
157 if (keyJustPressed(mapGbKey(KEY_GB_B))) { // Stop playing music
158 gbsPlayingSong = -1;
159 ime = 0;
160 writeIO(0xff, 0);
161 initSND();
162 }
163 gbsRedraw();
164
165 if (gbsPlayingSong != -1)
166 disableSleepMode();
167 else
168 enableSleepMode();
169}

Callers 1

gameboyUpdateVBlankFunction · 0.85

Calls 9

keyPressedAutoRepeatFunction · 0.85
mapGbKeyFunction · 0.85
keyJustPressedFunction · 0.85
gbsLoadSongFunction · 0.85
writeIOFunction · 0.85
initSNDFunction · 0.85
gbsRedrawFunction · 0.85
disableSleepModeFunction · 0.85
enableSleepModeFunction · 0.85

Tested by

no test coverage detected