Beispiel #1
0
void my_task_Startup() {
	DebugManager(1, 0x1F, 0x180000, 0x40000, 0x1C0000);

	dmstart();
	dmProcInit();

#ifdef ENABLE_MASSIVE_DEBUG
	// the 2nd level is 32 flags for debug classes
	// the 3rd arg is log level, 0 == full debug, >0 == less debug
	dmSetStoreLevel(hDbgMgr, 0xFF, 0);
	dmSetPrintLevel(hDbgMgr, 0xFF, 0);
#endif

	initialize();
	
	sub_FFAFE5BC();
	SetAssert();
	EventProcedureServiceInit();
	ShutDownProcInit();
	Install3VMemory(0xF8000000);
	RomManagerInit();
	CreateParamPubInstance();
	PropertyServiceInit();
	ErrorNumberListInit();
	FatalErrorsProcInit();
	RegisterISRs_OCH();
	BlockUntilAfterTimeoutProcInit(50);

	sub_FFB07740(0x10, 8, 0x1BBC);
	ResourceNameServiceInit();

	MemorySuite(0);

	sysClockRateSet_100(3);

	sub_FFB2BD6C();

	InitializeSerialIO();

	RtcInit(0x386D4380);

	AdjDefectsInit();

	CameraAdjsInit();

	SetAssertProc(AssertPrepare, 0);

	my_InitializeIntercom(); // InitializeIntercom();

	AfeGainCmosParamInit();

	EngineInit();

	EDmacPriorityManager();

	EngineResourceInit();

	PowerMgrInit(0);

	ClockInit(1);

	RegisterISR_CAPREADY();

	FaceSensorInit();

	RemDrvInit();
	ActSweepInit();

	LcdInit();

	DisplayInit1();

	DisplayInit2();

	PowerSaveProcInit();

	sub_FFA03B0C();

	sub_FFA05114();

	InitializeImagePlayDriver();

	LensNameTblInit();

	LensPOTblInit();

	FlyingInit();

	CaptureInit();

	BathtubSaturateInit();

	Module_CaptureImagePass();

	ClearSomeCapMem();

	ColorAdjustmentsInit();

	Module_PreDarkPassInit();

	LoadSystemInfo();

	SharedBufferInit(0x10800000, 0x18000000, 0xEE0000, 0xEE0000);

	FileCacheInit();
	PackMemInit();

	ImagePropInit();
	DigPropInit();

	ShootMainInit();

	OlcInfoInit();

	RegisterISR_EMERGENCY_CARDDOOR();

	my_MainCtrlInit();

	CaptureSemaphoreInit();

	VShadingInit();

	Module_CaptureDarkPassInit();

	Module_DarkSubtractionPassInit();
	BathtubInit();

	Module_BathtubCorrectPassInit();

	Module_VObIntegPassInit();

	SetProjectionInit();
	Module_DefectsDetectPassInit();

	DefsInit();
	WbDetectionInit();
	ObInit();

	Module_WbDetectionPassInit();
	DefsProcInit();

	Module_ObAreaCopyPassInit();
	Module_AdditionVTwoLinePassInit();

	VShadingProcInit();
	Module_VShadingCorrectPassInit();

	sub_FFA24838();
	HuffmanInit();

	RawToJpegPass_L_Init();
	RawToJpegPass_M2_Init();

	RawToJpegPass_S_Init();
	YcToJpegLargeFastInit();

	YcToJpegM2FastInit();
	YcToJpegSFastInit();

	RawToLosslessInit();
	Module_YcToTwainInit();

	RawToYcPass_S_Init();
	RawToYPackPass_S_Init();

	DvlpInit();
	DecodeJpegPassInit();
	HistPassInit();
	RectangleColorPassInit();
	RectangleCopyPassInit();

	ResizeYuvPassInit();
	sub_FFA35354();
	LpfPassInit();

	EncodeJpegPassInit();
	AdjRgbGainInit();
	LuckyInit();

	SysInfoProcInit();

	TablesInit();

	ColorInit();

	CtrlManRecursiveLock();

	CtrlSrvInit(0x19);

	LangConInit();
	sub_FF926E40();

	CreateDispSwControlPubInstance();

	CreateMemoryManagerPubInstance();

	my_GUIInit(); //GUIInit();
	GUIApiCalls();

	InitializeImagePlayer();

	ColorBarProcsInit();
	LcdAdjustProcsInit();

	sub_FFB29348();
	CMOSParamInit();

	CameraSettingsInit();
	BootDiskProcsInit();

	DDDInit();
	TFTInit();

	RegisterResourceName(hResourceName, "USR ROOT DEVICE HANDLE", 0x7B);

	RegisterResource_env(0xC02200B8, "U2VBUS");
	RegisterResource_env(1, "USBC20 VBUS SUPPORT");

	RegisterResource_env(0x14, "DEVICESPEED");
	USBC20_Init();
	USBC20_USBIF_Init();

	USBC20_BUFCON_Init();
	USBC20_CLK_Init();
	USBC20_HDMAC_Init();

	DCPClassFunctionsInit();
	USBDriverInit();
	RapiSwitcherInit();

	DCPClassInit();
	RAPITransportUSBInit();
	PTPRespondInit();

	PTPFrameworkInit();
	StartupPtpResponder();

	RapiTransportManagerInit();
	DCPClassInit();

	EventProcServerInit();
	sub_FFA5D8A0();
	DCPInit();

	SesnMngrInit();
	MemMngrInit();
	InitializeRapiTransportManager();

	PrintInit();
	sub_FF95EC54();
	SomePrintInit();
	sub_FF9EB94C();

	InitializeUSBDriver();
	TransMemoryInit();
	InitializeComCtrl();

	FactoryModeInit();
	DP_Init(0, 0x1B, 0, 0);
	return_0();

	sub_FF98CF4C();
	EdLedProcsInit();
	CallBacksInit();

	RegistNotifyConnectDT();
	DPOF_Initialize();

	MpuMonInit();

	StartConsole();
}
Beispiel #2
0
void PlayState::init()
{
    //assetManager.loadTexture("oasisnewhood.png");
    assetManager.loadTexture("grass_tile_test.png");
    assetManager.loadTexture("arrows.png");
    assetManager.loadFont("VeraMono.ttf");

    ///THIS NONSENSE IS JUST DEBUGGING----------------------------------------*/
    eManager.addEntity();
    eManager.addComponent(0, COMPONENT_POSITION);
    eManager.addComponent(0, COMPONENT_VELOCITY);
    eManager.addComponent(0, COMPONENT_HITBOX);
    eManager.addComponent(0, COMPONENT_SPRITE);
    eManager.addComponent(0, COMPONENT_INPUT);
    eManager.positionComponent[0] = {0, 129};

    eManager.spriteComponent[0].sprite.setTexture(assetManager.getTexture("oasisnewhood.png"));
    //eManager.spriteComponent[0].sprite.setTexture(assetManager.loadedTexture["oasisnewhood.png"]);

    eManager.spriteComponent[0].sprite.setTextureRect(sf::IntRect(0,0, 19, 55));
    eManager.spriteComponent[0].layer = 0;
    eManager.velocityComponent[0].velocity = {0.f, 0.f};
    eManager.hitboxComponent[0].xOffset = {-3, 11};
    eManager.hitboxComponent[0].yOffset = {1, 0};
    eManager.hitboxComponent[0].xHitbox.width = 25;
    eManager.hitboxComponent[0].xHitbox.height = 23;
    eManager.hitboxComponent[0].yHitbox.width = 20;
    eManager.hitboxComponent[0].yHitbox.height = 56;

    debug.setFont(assetManager.loadedFont["VeraMono.ttf"]);
    //debug.setString("Position: " + eManager.positionComponent[0].position.x + "," + eManager.positionComponent[0].position.y);
    debug.setCharacterSize(24);
    debug.setColor(sf::Color::Cyan);
    debug.setPosition(2, 334);

    /*eManager.addEntity();
    eManager.addComponent(1, COMPONENT_POSITION);
    eManager.addComponent(1, COMPONENT_VELOCITY);
    eManager.addComponent(1, COMPONENT_SPRITE);
    eManager.addComponent(1, COMPONENT_HITBOX);
    eManager.spriteComponent[1].sprite.setTexture(assetManager.loadedTexture["arrows.png"]);
    eManager.spriteComponent[1].sprite.setTextureRect(sf::IntRect(0,0, 31, 31));
    eManager.spriteComponent[1].layer = 0;
    eManager.positionComponent[1].position = {50, 50};
    eManager.hitboxComponent[1].xHitbox.width = 32.f;
    eManager.hitboxComponent[1].xHitbox.height = 32.f;
    eManager.hitboxComponent[1].yHitbox.width = 32.f;
    eManager.hitboxComponent[1].yHitbox.height = 32.f;
    */
    while(eManager.entityCount < 20)
    {
        eManager.addEntity();
        eManager.addComponent(eManager.entityCount, COMPONENT_POSITION);
        //eManager.addComponent(eManager.entityCount, COMPONENT_VELOCITY);
        eManager.addComponent(eManager.entityCount, COMPONENT_SPRITE);
        eManager.addComponent(eManager.entityCount, COMPONENT_HITBOX);
        eManager.spriteComponent[eManager.entityCount].sprite.setTexture(assetManager.loadedTexture["grass_tile_test.png"]);
        eManager.spriteComponent[eManager.entityCount].sprite.setTextureRect((eManager.entityCount%3 == 0 ? sf::IntRect(0, 32, 32, 32) : sf::IntRect(32,32,32,32)));
        eManager.spriteComponent[eManager.entityCount].layer = 0;
        eManager.positionComponent[eManager.entityCount].position = {eManager.entityCount*32.f, 200.f};
        if(eManager.entityCount == 2)
        {
            eManager.addComponent(eManager.entityCount, COMPONENT_VELOCITY);
            eManager.positionComponent[eManager.entityCount].position = {32, 32};
            eManager.velocityComponent[eManager.entityCount].velocity = {32.f, 32.f};
        }
        eManager.hitboxComponent[eManager.entityCount].xHitbox.width = 32.f;
        eManager.hitboxComponent[eManager.entityCount].xHitbox.height = 28.f;
        eManager.hitboxComponent[eManager.entityCount].yHitbox.width = 28.f;
        eManager.hitboxComponent[eManager.entityCount].yHitbox.height = 32.f;
        eManager.hitboxComponent[eManager.entityCount].xOffset = {0, 2};
        eManager.hitboxComponent[eManager.entityCount].yOffset = {2, 0};
    }
    while(eManager.entityCount < 40)
    {
        eManager.addEntity();
        eManager.addComponent(eManager.entityCount, COMPONENT_POSITION);
        eManager.addComponent(eManager.entityCount, COMPONENT_SPRITE);
        eManager.spriteComponent[eManager.entityCount].sprite.setTexture(assetManager.loadedTexture["grass_tile_test.png"]);
        eManager.spriteComponent[eManager.entityCount].sprite.setTextureRect((eManager.entityCount%5 == 0 ? sf::IntRect(32, 0, 32, 32) : sf::IntRect(0,0,32,32)));
        eManager.spriteComponent[eManager.entityCount].layer = 1;
        eManager.positionComponent[eManager.entityCount].position = {(eManager.entityCount-20)*32.f, 200.f-32.f};
    }

    /*
    if(!((*eManager.prototype["test_entity2"]).isNil()))
    eManager.spriteComponent[eManager.entityCount].sprite.setTexture(assetManager.loadedTexture[((*eManager.prototype["test_entity1"])["sprite"]["spritesheet"].cast<std::string>())]);
    */
    /*eManager.addEntity();
    eManager.addComponent(2, COMPONENT_POSITION);
    eManager.addComponent(2, COMPONENT_VELOCITY);
    eManager.addComponent(2, COMPONENT_SPRITE);
    eManager.addComponent(2, COMPONENT_HITBOX);
    eManager.spriteComponent[2].sprite.setTexture(assetManager.loadedTexture["arrows.png"]);
    eManager.spriteComponent[2].sprite.setTextureRect(sf::IntRect(0,0, 31, 31));
    eManager.spriteComponent[2].layer = 0;
    eManager.positionComponent[2].position = {18, 82};
    eManager.hitboxComponent[2].xHitbox.width = 32.f;
    eManager.hitboxComponent[2].xHitbox.height = 32.f;
    eManager.hitboxComponent[2].yHitbox.width = 32.f;
    eManager.hitboxComponent[2].yHitbox.height = 32.f;*/
    /*
    eManager.addEntity();
    eManager.addComponent(2, COMPONENT_POSITION);
    eManager.addComponent(2, COMPONENT_VELOCITY);
    eManager.addComponent(2, COMPONENT_SPRITE);
    eManager.spriteComponent[2].sprite.setTexture(arrows);
    eManager.spriteComponent[2].layer = 0;
    eManager.positionComponent[2].position = {80, 150};
    //world.velocityComponent[0]->velocity.x = 0.001;*/

    if(eManager.worldChanged)
    {
        moveSys.registerEntities(eManager);
        collSys.registerEntities(eManager);
        drawSys.registerEntities(eManager);
        eManager.worldChanged = false;
    }

    debugManager = DebugManager(&eManager, &assetManager);
}