mirror of
https://github.com/micsthepick/dsi2key.git
synced 2025-06-19 09:15:32 -04:00
57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
// main - it all begins and ends here
|
|
|
|
// windows
|
|
#include "windows/lockedWindow.h"
|
|
#include "windows/turboWindow.h" // D2K::GUI::Turbo::GetKeys()
|
|
|
|
// core
|
|
#include "core.h"
|
|
#include "common/udp.h"
|
|
#include "config.h"
|
|
|
|
#ifdef _3DS
|
|
#include "gui.h" // this has guitarGrip stuff in it for now
|
|
#endif
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
if(D2K::Init(argc, argv)) // DS hardware setup
|
|
{
|
|
D2K::DeInit();
|
|
|
|
return 1; // halt on error
|
|
}
|
|
|
|
// wait a few seconds on nds
|
|
#ifdef _NDS
|
|
for (int i = 0; i < 60*5; i++)
|
|
{
|
|
D2K::WaitForVBlank();
|
|
}
|
|
#endif
|
|
|
|
D2K::GUI::Locked::g_window.SetVisible(true); // Show locked window
|
|
|
|
while(D2K::Loop()) // DS hardware loop
|
|
{
|
|
D2K::UDP::Update(D2K::g_keys_held, // Update ds2key network
|
|
D2K::GUI::Turbo::GetKeys(),
|
|
&D2K::g_stylus_position, // No touch position
|
|
&D2K::g_circle_position,
|
|
&D2K::g_cstick_position,
|
|
&D2K::g_accel_status,
|
|
&D2K::g_gyro_status,
|
|
&D2K::g_slider_volume_status,
|
|
&D2K::g_slider_3d_status,
|
|
0); // No keyboard press
|
|
|
|
D2K::GUI::Locked::g_window.Update(); // Update the window
|
|
}
|
|
|
|
D2K::UDP::DeInit(); // Disconnect network
|
|
D2K::Config::Save(); // Save settings
|
|
D2K::DeInit();
|
|
|
|
return 0;
|
|
}
|