--- nono/vm/vm_luna.h 2026/04/29 17:04:36 1.1.1.2 +++ nono/vm/vm_luna.h 2026/04/29 17:05:18 1.1.1.11 @@ -4,6 +4,10 @@ // Licensed under nono-license.txt // +// +// VM (LUNA) +// + #pragma once #include "vm.h" @@ -13,36 +17,63 @@ class VM_LUNA : public VM using inherited = VM; public: VM_LUNA(); - ~VM_LUNA() override; + virtual ~VM_LUNA() override; - // 電源ボタンを押す。 - void PowerButton() override; + bool Init() override; - private: - std::unique_ptr crtc2; - std::unique_ptr prom; - std::unique_ptr sysclk; - std::unique_ptr nulldev; + protected: + // ブートページを切り替える。 + void SwitchBootPage(Device *parent, bool isrom) override; + + // デバイスマップから devtable を作成 + void MakeDevtable(const uint8 *maptable); + + // ブートページ切り替え用 (unique_ptr ではない) + IODevice *ram0 {}; + + std::unique_ptr pBT45x {}; + std::unique_ptr pCRTC2 {}; + std::unique_ptr pDipsw {}; + std::unique_ptr pEthernet {}; + std::unique_ptr pLCD {}; + std::unique_ptr pMPU64180 {}; + std::unique_ptr pNopIO {}; + std::unique_ptr pPartialRAM {}; + std::unique_ptr pPlaneVRAM {}; + std::unique_ptr pPROM {}; + std::unique_ptr pPROM0 {}; + std::unique_ptr pPIO0 {}; + std::unique_ptr pPIO1 {}; + std::unique_ptr pRTC {}; + std::unique_ptr pSIO {}; + std::unique_ptr pSPC {}; + std::unique_ptr pSubRAM {}; + std::unique_ptr pSysClk {}; + std::unique_ptr pTAS {}; + std::unique_ptr pXPbus {}; +}; +class VM_LUNA1 final : public VM_LUNA +{ + using inherited = VM_LUNA; + public: + VM_LUNA1(); + ~VM_LUNA1() override; + + private: static const uint8 maptable[256]; }; -class VM_LUNA88K : public VM +class VM_LUNA88K final : public VM_LUNA { - using inherited = VM; + using inherited = VM_LUNA; public: VM_LUNA88K(); ~VM_LUNA88K() override; - // 電源ボタンを押す。 - void PowerButton() override; - private: - std::unique_ptr crtc2; - std::unique_ptr fuserom; - std::unique_ptr prom; - std::unique_ptr sysclk; - std::unique_ptr nulldev; + std::unique_ptr pCMMU {}; + std::unique_ptr pFuseROM {}; static const uint8 maptable[256]; };