Esempio n. 1
0
int main(int argc, char ** argv)
{
	if ( argc == 2 || argc == 3 )
	{
        int32_t sample_rate;
        
        state = (unsigned char *) malloc(usf_get_state_size());
        
        usf_clear(state);
 
		if ( psf_load( argv[1], &stdio_callbacks, 0x21, usf_loader, 0, usf_info, 0, 1 ) <= 0 )
            return 1;
        
        usf_set_compare(state, enable_compare);
        usf_set_fifo_full(state, enable_fifo_full);
        
        if (argc == 3)
            usf_set_hle_audio(state, 1);
        
        usf_render(state, 0, 0, &sample_rate);
        
        usf_render(state, 0, length_ms * sample_rate / 1000, &sample_rate);
        
        usf_shutdown(state);
        
        free(state);
	}
    
    return 0;
}
Esempio n. 2
0
bool DeInit(void* context)
{
  USFContext* usf = (USFContext*)context;
  usf_shutdown(usf->state);
  delete[] usf->state;
  delete usf;

  return true;
}
Esempio n. 3
0
	~USFPlayer() {
		usf_shutdown(usf_state->emu_state);
	}