--- nono/lib/mainapp.h 2026/04/29 17:05:08 1.1.1.11 +++ nono/lib/mainapp.h 2026/04/29 17:05:12 1.1.1.12 @@ -10,11 +10,33 @@ #pragma once -#include "vm.h" +#include "object.h" class Config; class Logger; class MonitorManager; +class VM; + +// VM 種別 +enum class VMType { + NONE = 0, + X68030, + LUNA1, + LUNA88K, +}; + +// VM ケーパビリティ (ビットマスク表現) +enum class VMCap : uint32 { + NONE = 0, + X68030 = (1U << (int)VMType::X68030), + LUNA1 = (1U << (int)VMType::LUNA1), + LUNA88K = (1U << (int)VMType::LUNA88K), + + LUNA = VMCap::LUNA1 | VMCap::LUNA88K, + M68K = VMCap::X68030 | VMCap::LUNA1, + M88K = VMCap::LUNA88K, + ALL = 0xffffffff, +}; class MainApp { @@ -34,12 +56,12 @@ class MainApp std::string SearchFile(const std::string& name) const; - // vmtype (VMTYPE_*) を返す。 + // VM 種別を返す。 // (Config が持っているのは文字列) - vmtype_t GetVMType() const { return vmtype; } + VMType GetVMType() const { return vmtype; } - // 現在の VM が指定の feature を持っているか? - bool HasVMFeature(vmf_t flag) const; + // 現在の VM が指定のケーパビリティを持っているか? + bool Has(VMCap cap) const; // VM ディレクトリを返す const std::string& GetVMDir() const { return vmdir; } @@ -127,13 +149,13 @@ class MainApp std::vector objects {}; // VM - std::unique_ptr pVM {}; + std::unique_ptr pVM /*{}*/; // 設定項目 std::unique_ptr pConfig /*{}*/; // VM 種別 - vmtype_t vmtype {}; + VMType vmtype {}; // モニタマネージャ std::unique_ptr pMonitorManager /*{}*/;