mirror of
https://gitlab.com/niansa/llama_nds.git
synced 2025-03-06 20:53:28 +01:00
53 lines
1.1 KiB
C++
53 lines
1.1 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();
|
|
}
|
|
};
|
|
|
|
#define IPPROTO_TCP 0
|
|
#endif
|