1
0
Fork 0
mirror of https://gitlab.com/niansa/llama_nds.git synced 2025-03-06 20:53:28 +01:00
llama_nds/Runtime.hpp
2023-04-07 18:43:33 +02:00

57 lines
1.2 KiB
C++

#ifndef _RUNTIME_HPP
#define _RUNTIME_HPP
#include <iostream>
#include <string>
#include <string_view>
#include <thread>
#include <chrono>
#include <exception>
#include <stdexcept>
#include <malloc.h>
#include <nds.h>
#include <dswifi9.h>
class Runtime {
Keyboard *swkbd;
public:
Runtime() {
// Configure displays
videoSetMode(MODE_0_3D);
lcdMainOnTop();
// Initialize console
consoleDemoInit();
// Initialize WiFi
std::cout << "Connecting via WFC data" << std::endl;
if (!Wifi_InitDefault(WFC_CONNECT)) {
throw std::runtime_error("Failed to enable WiFi");
}
}
Runtime(Runtime&) = delete;
Runtime(const Runtime&) = delete;
Runtime(Runtime&&) = delete;
~Runtime() {}
static inline
bool cooperate() noexcept {
// The Nintendo DS does not support multitasking
return true;
}
static const char *readInput(const char *hint) {
std::cout << hint << ": " << std::flush;
static std::string outstr;
std::getline(std::cin, outstr);
return outstr.c_str();
}
static void clearScreen() {
consoleClear();
}
};
#define IPPROTO_TCP 0
#endif