106 u8 selectorBlinkTimer[2] = {0, 0};
121 VDP_setPlaneSize(128, 64, TRUE);
122 VDP_setScrollingMode(HSCROLL_LINE, VSCROLL_PLANE);
128 s16 *scrollLine = (s16 *)malloc(
SCREEN_HEIGHT *
sizeof(s16));
130 XGM2_playPCMEx(snd_gongo,
sizeof(snd_gongo), SOUND_PCM_CH2, 0, FALSE, 0);
158 for (
int ind = 0; ind < 2; ind++)
174 else if (countDown == 0)
178 else if (countDown == 50)
181 PAL_fadeOutAll(18, FALSE);
183 VDP_clearPlane(BG_A, TRUE);
184 VDP_clearPlane(BG_B, TRUE);
192 static char stri[64];
193 sprintf(stri,
"p1: %d",
player[0].
id);
194 VDP_drawText(stri, 1, 1);
195 sprintf(stri,
"p2: %d",
player[1].
id);
196 VDP_drawText(stri, 1, 2);
197 sprintf(stri,
"gframes: %ld",
gFrames);
198 VDP_drawText(stri, 1, 3);
202 SYS_doVBlankProcess();
245 if (
GE[ind].sprite->visibility == HIDDEN)
248 int prevId =
player[ind].id;
254 if (
player[ind].key_JOY_LEFT_status == 1)
258 player[ind].id = JOHNNY_CAGE;
260 else if (
player[ind].key_JOY_RIGHT_status == 1)
266 else if (
player[ind].key_JOY_DOWN_status == 1)
276 if (
player[ind].key_JOY_RIGHT_status == 1)
282 else if (
player[ind].key_JOY_LEFT_status == 1)
292 if (
player[ind].key_JOY_LEFT_status == 1)
298 else if (
player[ind].key_JOY_RIGHT_status == 1)
304 else if (
player[ind].key_JOY_DOWN_status == 1)
308 player[ind].id = SCORPION;
314 if (
player[ind].key_JOY_LEFT_status == 1)
320 else if (
player[ind].key_JOY_RIGHT_status == 1)
324 player[ind].id = JOHNNY_CAGE;
330 if (
player[ind].key_JOY_LEFT_status == 1)
334 player[ind].id = LIU_KANG;
336 else if (
player[ind].key_JOY_UP_status == 1)
346 if (
player[ind].key_JOY_RIGHT_status == 1)
350 player[ind].id = SCORPION;
352 else if (
player[ind].key_JOY_LEFT_status == 1)
362 if (
player[ind].key_JOY_RIGHT_status == 1)
366 player[ind].id = LIU_KANG;
368 else if (
player[ind].key_JOY_UP_status == 1)
381 if (prevId !=
player[ind].
id)
433 VDP_loadTileSet(stage_char_select_a.tileset,
gInd_tileset, DMA);
434 VDP_setTileMapEx(BG_A, stage_char_select_a.tilemap,
435 TILE_ATTR_FULL(PAL0, FALSE, FALSE, FALSE,
gInd_tileset),
439 PAL_setPalette(PAL0, char_select_a_pal.data, DMA);
443 VDP_loadTileSet(stage_char_select_b.tileset,
gInd_tileset, DMA);
444 VDP_setTileMapEx(BG_B, stage_char_select_b.tilemap,
445 TILE_ATTR_FULL(PAL1, FALSE, FALSE, FALSE,
gInd_tileset),
449 PAL_setPalette(PAL1, char_select_b_pal.data, DMA);
458 struct VenetianBlindsEffect
466 struct VenetianBlindsEffect persiana[7] = {
479 if (y >= persiana[0].startLine && y <= persiana[0].endLine)
481 persiana[0].currentLine = y;
482 scrollLine[persiana[0].currentLine] = 0;
483 scrollLine[persiana[0].currentLine + 1] = 0;
484 VDP_setHorizontalScrollLine(BG_A, y, &scrollLine[persiana[0].currentLine],
LINE_HEIGHT, DMA);
485 VDP_setHorizontalScrollLine(BG_B, y, &scrollLine[persiana[0].currentLine],
LINE_HEIGHT, DMA);
488 if (y >= persiana[0].nextLine && persiana[1].currentLine <= persiana[1].endLine)
490 if (persiana[0].nextLine == y)
491 persiana[1].currentLine = persiana[1].startLine;
493 persiana[1].currentLine += 1;
494 scrollLine[persiana[1].currentLine] = 0;
495 scrollLine[persiana[1].currentLine + 1] = 0;
496 VDP_setHorizontalScrollLine(BG_A, persiana[1].currentLine, &scrollLine[persiana[1].currentLine],
LINE_HEIGHT, DMA);
497 VDP_setHorizontalScrollLine(BG_B, persiana[1].currentLine, &scrollLine[persiana[1].currentLine],
LINE_HEIGHT, DMA);
500 if (persiana[1].currentLine >= persiana[1].nextLine && persiana[2].currentLine <= persiana[2].endLine)
502 if (persiana[1].nextLine == persiana[1].currentLine)
503 persiana[2].currentLine = persiana[2].startLine;
505 persiana[2].currentLine += 1;
506 scrollLine[persiana[2].currentLine] = 0;
507 scrollLine[persiana[2].currentLine + 1] = 0;
508 VDP_setHorizontalScrollLine(BG_A, persiana[2].currentLine, &scrollLine[persiana[2].currentLine],
LINE_HEIGHT, DMA);
509 VDP_setHorizontalScrollLine(BG_B, persiana[2].currentLine, &scrollLine[persiana[2].currentLine],
LINE_HEIGHT, DMA);
512 if (persiana[2].currentLine >= persiana[2].nextLine && persiana[3].currentLine <= persiana[3].endLine)
514 if (persiana[2].nextLine == persiana[2].currentLine)
515 persiana[3].currentLine = persiana[3].startLine;
517 persiana[3].currentLine += 1;
518 scrollLine[persiana[3].currentLine] = 0;
519 scrollLine[persiana[3].currentLine + 1] = 0;
520 VDP_setHorizontalScrollLine(BG_A, persiana[3].currentLine, &scrollLine[persiana[3].currentLine],
LINE_HEIGHT, DMA);
521 VDP_setHorizontalScrollLine(BG_B, persiana[3].currentLine, &scrollLine[persiana[3].currentLine],
LINE_HEIGHT, DMA);
524 if (persiana[3].currentLine >= persiana[3].nextLine && persiana[4].currentLine <= persiana[4].endLine)
526 if (persiana[3].nextLine == persiana[3].currentLine)
527 persiana[4].currentLine = persiana[4].startLine;
529 persiana[4].currentLine += 1;
530 scrollLine[persiana[4].currentLine] = 0;
531 scrollLine[persiana[4].currentLine + 1] = 0;
532 VDP_setHorizontalScrollLine(BG_A, persiana[4].currentLine, &scrollLine[persiana[4].currentLine],
LINE_HEIGHT, DMA);
533 VDP_setHorizontalScrollLine(BG_B, persiana[4].currentLine, &scrollLine[persiana[4].currentLine],
LINE_HEIGHT, DMA);
536 if (persiana[4].currentLine >= persiana[4].nextLine && persiana[5].currentLine <= persiana[5].endLine)
538 if (persiana[4].nextLine == persiana[4].currentLine)
539 persiana[5].currentLine = persiana[5].startLine;
541 persiana[5].currentLine += 1;
542 scrollLine[persiana[5].currentLine] = 0;
543 scrollLine[persiana[5].currentLine + 1] = 0;
544 VDP_setHorizontalScrollLine(BG_A, persiana[5].currentLine, &scrollLine[persiana[5].currentLine],
LINE_HEIGHT, DMA);
545 VDP_setHorizontalScrollLine(BG_B, persiana[5].currentLine, &scrollLine[persiana[5].currentLine],
LINE_HEIGHT, DMA);
548 if (persiana[5].currentLine >= persiana[5].nextLine && persiana[6].currentLine <= persiana[6].endLine)
550 if (persiana[5].nextLine == persiana[5].currentLine)
551 persiana[6].currentLine = persiana[6].startLine;
553 persiana[6].currentLine += 1;
554 scrollLine[persiana[6].currentLine] = 0;
555 scrollLine[persiana[6].currentLine + 1] = 0;
556 VDP_setHorizontalScrollLine(BG_A, persiana[6].currentLine, &scrollLine[persiana[6].currentLine],
LINE_HEIGHT, DMA);
557 VDP_setHorizontalScrollLine(BG_B, persiana[6].currentLine, &scrollLine[persiana[6].currentLine],
LINE_HEIGHT, DMA);
560 SYS_doVBlankProcess();