예제 #1
0
/*
// open & setup audio device
// return: 1=success 0=fail
 */
static int init(int rate, int channels, int format, int flags) {
        xenon_sound_init();

        ao_data.buffersize = XENON_BUFFER_SIZE;
        ao_data.outburst = 2048;
        ao_data.channels = 2;
        ao_data.samplerate = 48000;
        ao_data.format = AF_FORMAT_S16_LE;
        ao_data.bps = ao_data.channels * ao_data.samplerate * sizeof (signed short);

        return 1;
}
예제 #2
0
int main(int argc, char *argv[])
{
	xenon_make_it_faster(XENON_SPEED_FULL);
	InitVideo();
	
	usb_init();
	usb_do_poll();
	xenon_ata_init();
	
	xenon_sound_init();
	
	SetupPads();
	mount_all_devices();
	// Set defaults
	DefaultSettings(); 
	// Initialize font system
	InitFreeType((u8*)font_ttf, font_ttf_size); 
	
	browserList = (BROWSERENTRY *)malloc(sizeof(BROWSERENTRY)*MAX_BROWSER_SIZE);
		
	while (1) // main loop
	{
		MainMenu(MENU_GAMESELECTION);
		EmuLaunch();
		
		if(EmuRunning)
			MainMenu(MENU_GAME);
		else
			MainMenu(MENU_GAMESELECTION);		

		if(EmuRunning)
			EmuResume();
		else
			EmuLaunch();
		
		if(EmuConfigRequested) {				
			EmuConfigRequested = 0;
			break;
		}
		if(EmuResetRequested) {
			EmuResetRequested = 0;
			EmuReset();
		}
	}
	
	return 0;
}
예제 #3
0
int main() {
    xenon_make_it_faster(XENON_SPEED_FULL);
    xenos_init(VIDEO_MODE_AUTO);

    console_init();
    xenon_sound_init();
    pAudioStart = pAudioBuffer = (uint16_t*) malloc(48000 * sizeof (uint16_t));
    memset(pAudioBuffer, 0, 48000 * sizeof (uint16_t));

    usb_init();
    usb_do_poll();
    SYSVideoInit();

    //    Allocates and initializes memory.  Should only be called once, before
    //    any calls to other FCEU functions.
    FCEUI_Initialize();

    //-------------------------------------------------------------------------------------
    // Set some setting
    //-------------------------------------------------------------------------------------
    //    Specifies the base FCE Ultra directory.  This should be called
    //    immediately after FCEUI_Initialize() and any time afterwards.
    std::string base = "uda:/";
    //FCEUI_SetBaseDirectory(base); // doesn't work ? newlib bug ?
    FCEUI_SetVidSystem(0);

    //Apply settings
    FCEUI_Sound(48000);
    FCEUI_SetSoundVolume(50);
    FCEUI_SetLowPass(0);


    if (FCEUI_LoadGame("uda:/Super Mario Bros. (Europe) (Rev 0A).zip", 0) != NULL) {
        FCEUI_SetInput(0, SI_GAMEPAD, (void*) &powerpadbuf, 0);
        FCEUI_SetInput(1, SI_GAMEPAD, (void*) &powerpadbuf, 0);

        //set to ntsc
        extern FCEUGI * GameInfo;
        GameInfo->vidsys = GIV_NTSC;
    }

    int32 * snd = NULL;
    int32 sndsize;

    //    Copy contents of XBuf over to video memory(or whatever needs to be 
    //    done to make the contents of XBuf visible on screen).
    //    Each line is 256 pixels(and bytes) in width, and there can be 240
    //    lines.  The pitch for each line is 272 bytes.
    //    XBuf will be 0 if the symbol FRAMESKIP is defined and this frame
    //    was skipped.

    uint8 * bitmap;
    while (1) {
        FCEUI_Emulate(&bitmap, &snd, &sndsize, 0);
        for (int i = 0; i < (256 * 240); i++) {
            //Make an ARGB bitmap
            nesBitmap[i] = ((pcpalette[bitmap[i]].r) << 16) | ((pcpalette[bitmap[i]].g) << 8) | (pcpalette[bitmap[i]].b) | (0xFF << 24);
        }
        SYSVideoUpdate();
        // Add Sound
        update_sound(snd,sndsize);
        // Add Input
        update_input();
    }

    return 0;
}
예제 #4
0
static void sound_reset(void) {
        xenon_sound_init();
}
예제 #5
0
int main() {

	printf("main\n");

	xenos_init(VIDEO_MODE_HDMI_720P);
	xenon_make_it_faster(XENON_SPEED_FULL);

	xenon_sound_init();
	//xenos_init(VIDEO_MODE_YUV_720P);
	//console_init();
	usb_init();
	usb_do_poll();
	xenon_ata_init();
	xenon_atapi_init();

	//fatInitDefault();
	
	//char mount[10];
	//sprintf(mount, "uda0");
	//fatMount(mount, &usb2mass_ops_0, 0, 2, 64);
	
	ntfs_md *mounts;
	//ntfsMountAll (&mounts, NTFS_READ_ONLY);
	
	
	XTAFMount();
	
	findDevices();
	
	init_miss();
	
	time_t rawtime;
	time ( &rawtime );
	printf ( "The current local time is: %s", ctime (&rawtime) );
	
	/*

	 */
	memset(&Config, 0, sizeof (PcsxConfig));

	//    network_init();
	//    network_print_config();

	//console_close();

	xenon_smc_start_bootanim(); // tell me that telnet or http are ready

	// telnet_console_init();
	// mdelay(5000);

	//httpd_start();

	// uart speed patch 115200 - jtag/freeboot
	// *(volatile uint32_t*)(0xea001000+0x1c) = 0xe6010000;

	//memset(&Config, 0, sizeof (PcsxConfig));
	strcpy(Config.Net, "Disabled");
	strcpy(Config.Cdr, "CDR");
	strcpy(Config.Gpu, "GPU");
	strcpy(Config.Spu, "SPU");
	strcpy(Config.Pad1, "PAD1");
	strcpy(Config.Pad2, "PAD2");

	strcpy(Config.Bios, "SCPH1001.BIN"); // Use actual BIOS
	//strcpy(Config.Bios, "scph7502.bin"); // Use actual BIOS
	//strcpy(Config.Bios, "HLE"); // Use HLE
	strcpy(Config.BiosDir, "sda0:/devkit/pcsxr/bios");
	strcpy(Config.PatchesDir, "sda0:/devkit/pcsxr/patches_/");

	Config.PsxAuto = 1; // autodetect system
	
	Config.Cpu = CPU_DYNAREC;
	//Config.Cpu =  CPU_INTERPRETER;

	strcpy(Config.Mcd1, "sda0:/devkit/pcsxr/memcards/card1.mcd");
	strcpy(Config.Mcd2, "sda0:/devkit/pcsxr/memcards/card2.mcd");

	// useSoftGpu();
	/*
		strcpy(Config.Mcd1, "sda:/hdd1/xenon/memcards/card1.mcd");
		strcpy(Config.Mcd2, "sda:/hdd1/xenon/memcards/card2.mcd");
	 */

	//InitVideo();

	SetIso(cdfile);
	if (LoadPlugins() == 0) {
		if (OpenPlugins() == 0) {
			if (SysInit() == -1) {
				printf("SysInit() Error!\n");
				return -1;
			}

			SysReset();
			// Check for hle ...
			if (Config.HLE == 1) {
				printf("Can't continue ... bios not found ...\r\n");
				//exit(0);
			}

			CheckCdrom();
			LoadCdrom();

			psxCpu->Execute();
		}
	}

	printf("Pcsx exit ...\r\n");
	return 0;
}
예제 #6
0
static int _xenon_sound_init() {
    static int first_run = 1;
    if (first_run)
        xenon_sound_init();
    first_run = 0;
}