void OpenInGameMenu() { currentLoopFunction = InGameMenuLoop; JOY_setEventHandler(joyEventCallback); menuItem = 0; MyVDP_waitVSync(); VDP_setEnable(0); VDP_setReg(0x0b, 0x00); // set scroll mode to plane/plane VDP_resetSprites(); VDP_setVerticalScroll(PLAN_A, 0); VDP_setVerticalScroll(PLAN_B, 0); VDP_setHorizontalScroll(PLAN_A, 0); VDP_setHorizontalScroll(PLAN_B, 0); VDP_updateSprites(); VDP_fillTileMapRect(APLAN, 0, 0, 0, 64, 64); VDP_fillTileMapRect(BPLAN, 0, 0, 0, 64, 64); VDP_setTextPalette(0); DrawText(); VDP_setEnable(1); }
static void beastScrollingFX(){ u32 hscrollInc = 0; u16 vblCount = 0; u16 vramIndex = TILE_USERINDEX; short i; Sprite sprites[BALL_COUNT]; SYS_disableInts(); VDP_clearPlan(APLAN, 0); VDP_clearPlan(BPLAN, 0); /* Set a larger tileplan to be able to scroll */ VDP_setPlanSize(64, 32); /* Draw the foreground */ VDP_setPalette(PAL1, ground.palette->data); VDP_drawImageEx(BPLAN, &ground, TILE_ATTR_FULL(PAL1, FALSE, FALSE, FALSE, vramIndex), 0, 4, FALSE, FALSE); VDP_drawImageEx(BPLAN, &ground, TILE_ATTR_FULL(PAL1, FALSE, FALSE, FALSE, vramIndex), 24, 4, FALSE, FALSE); vramIndex += ground.tileset->numTile; VDP_setPalette(PAL0, rse_logo.palette->data); VDP_drawImageEx(APLAN, &rse_logo, TILE_ATTR_FULL(PAL0, FALSE, FALSE, FALSE, vramIndex), 0, 6, FALSE, FALSE); vramIndex += rse_logo.tileset->numTile; for(i = 0; i < BALL_COUNT; i++) SPR_initSprite(&sprites[i], &ball_metal, 0, 0, TILE_ATTR_FULL(PAL2, TRUE, FALSE, FALSE, 0)); VDP_setPalette(PAL2, ball_metal.palette->data); SPR_init(BALL_COUNT); SYS_enableInts(); SND_startPlay_XGM(midnight); while (1){ hscrollInc = 0; VDP_waitVSync(); VDP_setHorizontalScroll(PLAN_B, -vblCount); VDP_setHorizontalScroll(PLAN_A, sinFix16(vblCount << 2)); for(i = 0; i < BALL_COUNT; i++) { // SPR_setPosition(&sprites[i], 160 + sinFix16((vblCount << 2) + (i << 5)), 100 + cosFix16((vblCount << 3) + (i << 3))); sprites[i].x = (160 + 0x80) + sinFix16((vblCount << 2) + (i << 5)); sprites[i].y = (100 + 0x80) + cosFix16((vblCount << 3) + (i << 3)); } SPR_update(sprites, BALL_COUNT); vblCount += 1; } }
void tool_reset_plan ( VDPPlan plan ) { if ( plan.value == PLAN_A.value ) _plan_dir_a = 0; else _plan_dir_b = 0; SYS_disableInts(); VDP_setHorizontalScroll( plan, 0 ); SYS_enableInts(); }
void tool_move_plan ( VDPPlan plan, s16 dir ) { if ( plan.value == PLAN_A.value ) { _plan_dir_a += dir; SYS_disableInts(); VDP_setHorizontalScroll( plan, _plan_dir_a ); SYS_enableInts(); } else { _plan_dir_b += dir; SYS_disableInts(); VDP_setHorizontalScroll( plan, _plan_dir_b ); SYS_enableInts(); } }
static _voidCallback *VIntCallback() { if ( VINT_SCROLL_FLAG ) { VDP_setHorizontalScroll ( PLAN_B, h_scroll-- ); // Updating Horizontal Scroll (CLOUDS) } if ( VINT_JOY_UPDATE ) { _JOYupdate ( ); SPR_setPosition ( pointer, _JOYgetPosX(), _JOYgetPosY() ); } if ( IS_PALSYSTEM || ( !IS_PALSYSTEM && ( vtimer % 6 ) ) ) { sfxpsg_frame(); } SPR_update ( sprlist, sd_cnt() ); return 0; }
static void displayFullScreenPicture(){ s16 i,j,k; u16 tmp_tile_index; SYS_disableInts(); VDP_clearPlan(APLAN, 0); VDP_clearPlan(BPLAN, 0); /* Set a larger tileplan to be able to scroll */ VDP_setPlanSize(64, 32); /* Draw the background */ // VDP_drawImageEx(BPLAN, &pic00, TILE_ATTR_FULL(PAL0, TRUE, FALSE, FALSE, vramIndex), 0, 0, TRUE, TRUE); // vramIndex += pic00.tileset->numTile; VDP_setScrollingMode(HSCROLL_PLANE, VSCROLL_PLANE); VDP_setVerticalScroll(PLAN_B, 0); VDP_setVerticalScroll(PLAN_A, 0); VDP_setHorizontalScroll(PLAN_B, 0); VDP_setHorizontalScroll(PLAN_A, 0); SYS_enableInts(); // vramIndex = 0; VDP_waitDMACompletion(); while (1){ /* Pic 0 */ // tmp_tile_index = curTileInd; SYS_disableInts(); VDP_drawImageEx(APLAN, &pic00, TILE_ATTR_FULL(PAL0, TRUE, FALSE, FALSE, vramIndex), 0, 0, TRUE, TRUE); SYS_enableInts(); RSE_pause(RSE_FRAMES(1*60)); RSE_pause(RSE_FRAMES(2*60)); VDP_fadeOut(1, 63, 16, FALSE); RSE_turn_screen_to_black(); VDP_waitDMACompletion(); for(i = 0; i < 224 >> 3; i++) { VDP_waitVSync(); RSE_clearTileRowB(i); RSE_clearTileRowA(i); } /* Pic 1 */ // curTileInd = tmp_tile_index; SYS_disableInts(); VDP_drawImageEx(APLAN, &pic01a, TILE_ATTR_FULL(PAL0, TRUE, FALSE, FALSE, vramIndex), 0, 12 >> 3, TRUE, TRUE); VDP_waitDMACompletion(); VDP_drawImageEx(BPLAN, &pic01b, TILE_ATTR_FULL(PAL1, TRUE, FALSE, FALSE, vramIndex + pic01a.tileset->numTile), 0, 12 >> 3, TRUE, TRUE); SYS_enableInts(); RSE_pause(RSE_FRAMES(3*60)); VDP_fadeOut(1, 63, 16, FALSE); RSE_turn_screen_to_black(); VDP_waitDMACompletion(); for(i = 0; i < 224 >> 3; i++) { VDP_waitVSync(); RSE_clearTileRowB(i); RSE_clearTileRowA(i); } /* Pic 2 */ // curTileInd = tmp_tile_index; SYS_disableInts(); VDP_drawImageEx(APLAN, &pic02a, TILE_ATTR_FULL(PAL0, TRUE, FALSE, FALSE, vramIndex), (320 - 256) >> 4, 0, TRUE, TRUE); VDP_waitDMACompletion(); VDP_drawImageEx(BPLAN, &pic02b, TILE_ATTR_FULL(PAL1, TRUE, FALSE, FALSE, vramIndex + pic02a.tileset->numTile), (320 - 256) >> 4, 0, TRUE, TRUE); SYS_enableInts(); RSE_pause(RSE_FRAMES(3*60)); VDP_fadeOut(1, 63, 16, FALSE); RSE_turn_screen_to_black(); VDP_waitDMACompletion(); for(i = 0; i < 224 >> 3; i++) { VDP_waitVSync(); RSE_clearTileRowB(i); RSE_clearTileRowA(i); } /* Pic 9 */ // curTileInd = tmp_tile_index; SYS_disableInts(); VDP_drawImageEx(APLAN, &pic09, TILE_ATTR_FULL(PAL0, TRUE, FALSE, FALSE, vramIndex), 0, 0, TRUE, TRUE); SYS_enableInts(); RSE_pause(RSE_FRAMES(3*60)); VDP_fadeOut(1, 63, 16, FALSE); RSE_turn_screen_to_black(); VDP_waitDMACompletion(); for(i = 0; i < 224 >> 3; i++) { VDP_waitVSync(); RSE_clearTileRowB(i); RSE_clearTileRowA(i); } } }