MCPcopy Create free account
hub / github.com/doldecomp/mkdd / calc

Method calc

src/Osako/PlayerSelectApp.cpp:199–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199void PlayerSelectApp::calc() {
200 if (msCallFlag & 1) {
201 reset();
202 msCallFlag &= ~1;
203 }
204
205 if (gpaKartPad[0]->testRepeat(KartGamePad::MAINSTICK_UP)) {
206 GetGameAudioMain()->startSystemSe(0x20000);
207 if (--mCursorY < 0) {
208 mCursorY = mKartCount - 1;
209 }
210 }
211 else if (gpaKartPad[0]->testRepeat(KartGamePad::MAINSTICK_DOWN)) {
212 GetGameAudioMain()->startSystemSe(0x20000);
213 if (++mCursorY >= mKartCount) {
214 mCursorY = 0;
215 }
216 }
217 else if (gpaKartPad[0]->testRepeat(KartGamePad::MAINSTICK_LEFT)) {
218 GetGameAudioMain()->startSystemSe(0x20000);
219 if (gpaKartPad[0]->testButton(KartGamePad::L)) {
220 if (--_20[mCursorY].mCharId1 <= cCharIDNone) {
221 _20[mCursorY].mCharId1 = PETEY;
222 }
223 }
224 else if (gpaKartPad[0]->testButton(KartGamePad::R)) {
225 if (--_20[mCursorY].mCharId2 <= cCharIDNone) {
226 _20[mCursorY].mCharId2 = PETEY;
227 }
228 }
229 else {
230 if (--_20[mCursorY].mKartIdx < 0) {
231 _20[mCursorY].mKartIdx = PARADE_KART;
232 }
233 _20[mCursorY].mCharId1 = scaaCharPair[_20[mCursorY].mKartIdx][0];
234 _20[mCursorY].mCharId2 = scaaCharPair[_20[mCursorY].mKartIdx][1];
235 }
236 }
237 else if (gpaKartPad[0]->testRepeat(KartGamePad::MAINSTICK_RIGHT)) {
238 GetGameAudioMain()->startSystemSe(0x20000);
239 if (gpaKartPad[0]->testButton(KartGamePad::L)) {
240 if (++_20[mCursorY].mCharId1 >= cCharIDMax) {
241 _20[mCursorY].mCharId1 = BABY_MARIO;
242 }
243 }
244 else if (gpaKartPad[0]->testButton(KartGamePad::R)) {
245 if (++_20[mCursorY].mCharId2 >= cCharIDMax) {
246 _20[mCursorY].mCharId2 = BABY_MARIO;
247 }
248 }
249 else {
250 if (++_20[mCursorY].mKartIdx >= cKartIDMax) {
251 _20[mCursorY].mKartIdx = RED_FIRE;
252 }
253 _20[mCursorY].mCharId1 = scaaCharPair[_20[mCursorY].mKartIdx][0];
254 _20[mCursorY].mCharId2 = scaaCharPair[_20[mCursorY].mKartIdx][1];
255 }
256 }

Callers

nothing calls this directly

Calls 6

testRepeatMethod · 0.80
startSystemSeMethod · 0.80
testButtonMethod · 0.80
testTriggerMethod · 0.80
getPlayerKartNumberMethod · 0.80
resetFunction · 0.70

Tested by

no test coverage detected