|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2017 [email protected]
4: //
5:
6: #pragma once
7:
8: #include "device.h"
1.1.1.2 ! root 9:
! 10: // VM 種別
! 11: enum vmtype_t {
! 12: VMTYPE_NONE = 0,
! 13: VMTYPE_X68030,
! 14: VMTYPE_LUNA,
! 15: VMTYPE_RXZ, // Human68k .r .x .z console emulation
! 16: VMTYPE_LUNA88K,
! 17: };
1.1 root 18:
19: class VM
20: {
21: public:
1.1.1.2 ! root 22: VM();
1.1 root 23: virtual ~VM();
24:
25: // 動的なコンストラクション
26: bool Create();
27:
28: // 初期化
1.1.1.2 ! root 29: virtual bool Init();
1.1 root 30:
31: // 設定の適用
32: bool Apply();
33:
34: // 電源ボタンを押す。
35: // XXX この辺はもうちょっと検討したほうがいい
36: virtual void PowerButton() = 0;
37:
38: // 電源ボタンの状態を取得する。
39: // モーメンタリスイッチの場合は常に false。
40: virtual bool IsPowerButton() const { return false; }
41:
42: // VM の全デバイスの電源をオフ
43: bool DevicePowerOff();
44:
45: // VM 電源オフ時のコールバックを設定する。(GUI から呼ばれる)
46: void SetPowerOffCallback(void (*callback)());
47:
48: // 外部リセットボタンを押す。
49: void ResetButton() { ResetHard(); }
50:
51: // ハードウェアリセット
52: void ResetHard();
53:
54: // MPU の RESET 命令によるリセット
55: void ResetSoft();
56:
57: protected:
58: // VM の全デバイスの電源をオン
59: bool DevicePowerOn();
60:
1.1.1.2 ! root 61: std::unique_ptr<BusErrDevice> buserr;
1.1 root 62: void (*poweroff_callback)() = NULL;
63: };
64:
1.1.1.2 ! root 65: extern std::unique_ptr<VM> gVM;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.