mirror of
https://github.com/JaCzekanski/Avocado.git
synced 2024-06-02 19:27:41 -04:00
4001c2f503
* config: uses plain struct instead of json object * utils: changed functions to use string_view * remove cereal includes from avocado core * config: moved json parser to platform/windows package
38 lines
901 B
C++
38 lines
901 B
C++
#pragma once
|
|
#include <cstdint>
|
|
#include <functional>
|
|
#include <string_view>
|
|
#include <unordered_map>
|
|
#include <vector>
|
|
|
|
struct System;
|
|
|
|
namespace bios {
|
|
|
|
enum class Type {
|
|
INT, // 32bit HEX - int
|
|
CHAR, // 8bit char - char
|
|
STRING, // 32bit pointer to string - char*
|
|
POINTER
|
|
};
|
|
|
|
struct Arg {
|
|
Type type;
|
|
std::string_view name;
|
|
};
|
|
|
|
struct Function {
|
|
std::string_view name;
|
|
std::vector<Arg> args;
|
|
std::function<bool(System* sys)> callback;
|
|
|
|
Function(std::string_view prototype, std::function<bool(System* sys)> callback = nullptr);
|
|
};
|
|
|
|
extern const std::unordered_map<uint8_t, Function> A0;
|
|
extern const std::unordered_map<uint8_t, Function> B0;
|
|
extern const std::unordered_map<uint8_t, Function> C0;
|
|
extern const std::array<std::unordered_map<uint8_t, Function>, 3> tables;
|
|
extern const std::unordered_map<uint8_t, Function> SYSCALL;
|
|
}; // namespace bios
|