void game_manager::vblank_func()
{
	// If a bug was automatically detected.
	if ( curr_game_mode == gm_do_halt )
	{
		// Stop the sound stuff
		if (mmActive())
		{
			//mmPause();
			mmSetModuleVolume(static_cast<mm_word>(0));
			mmSetJingleVolume(static_cast<mm_word>(0));
			mmEffectCancelAll();
			
			mmFrame();
			
			//mmPause();
			//mmStop();
		}
		
		
		// Enable forced blank
		reg_dispcnt = dcnt_blank_on;
		
		return;
	}
	
	
	gfx_manager::copy_bgofs_mirror_to_registers();
	
	//mmFrame();
	
	key_poll();
	//pause_or_unpause_music();
	
	if ( curr_game_mode != gm_title_screen 
		&& curr_game_mode != gm_initializing_the_game )
	{
		mmFrame();
	}
	
	switch ( curr_game_mode )
	{
		// When on the title screen.
		case gm_title_screen:
			break;
		
		// When initializing the game
		case gm_initializing_the_game:
			break;
		
		// When loading a level.
		case gm_loading_level:
			hud_manager::hud_was_generated = false;
			break;
		
		// When changing from one sublevel to another.
		case gm_changing_sublevel:
			break;
		
		// When in a sublevel.
		case gm_in_sublevel:
			//gfx_manager::copy_bgofs_mirror_to_registers();
			gfx_manager::upload_bg_tiles_to_vram();
			copy_oam_mirror_to_oam();
			
			active_level_manager
				::copy_sublevel_from_array_2d_helper_to_vram();
			sprite_manager::upload_tiles_of_active_sprites_to_vram();
			
			hud_manager::update_hud_in_screenblock_mirror_2d();
			hud_manager::copy_hud_from_array_2d_helper_to_vram();
			break;
		
		// If a bug was automatically detected (this should never be the
		// case since gm_do_halt is handled at the start of this function).
		case gm_do_halt:
			break;
		
		default:
			break;
	}
}
예제 #2
0
파일: DSGM_sound.c 프로젝트: CTurt/dsgmLib
void DSGM_SetSoundInstanceVolumeFull(DSGM_SoundInstance *soundInstance, int volume) {
	if(soundInstance->sound->type == DSGM_SOUND_STREAM) mmSetModuleVolume(volume);
	if(soundInstance->sound->type == DSGM_SOUND_EFFECT) mmEffectVolume(soundInstance->effectNumber, volume);
}