|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2022 nono project
4: // Licensed under nono-license.txt
5: //
6:
7: //
8: // NEWS の ROM エミュレーション (-X のみ対応)
9: //
10:
11: #pragma once
12:
1.1.1.3 ! root 13: #include "romemu.h"
1.1 root 14:
15: class MainRAMDevice;
16:
1.1.1.3 ! root 17: class NewsROMEmuDevice : public ROMEmuDevice
1.1 root 18: {
1.1.1.3 ! root 19: using inherited = ROMEmuDevice;
1.1 root 20:
21: protected:
22: // このデバイス先頭アドレス
23: static const uint32 baseaddr = 0xf8000000;
24:
25: // 謎の I/O 空間
26: static const uint32 ROMIO_BASE = 0xf8010000;
27: static const uint32 ROMIO_INIT = (ROMIO_BASE + 0);
28: static const uint32 ROMIO_SYS = (ROMIO_BASE + 4);
29:
30: // NEWS の ROM サービスコール?
31: static const uint32 SYS_reboot = 0;
32: static const uint32 SYS_exit = 1;
33: static const uint32 SYS_read = 3;
34: static const uint32 SYS_write = 4;
35:
36: public:
37: NewsROMEmuDevice();
1.1.1.2 root 38: ~NewsROMEmuDevice() override;
1.1 root 39:
40: bool Init() override;
41: void ResetHard(bool poweron) override;
42:
43: private:
1.1.1.3 ! root 44: uint64 ReadROMIO(busaddr addr) override;
! 45:
1.1 root 46: uint32 ROM_Init();
47: uint32 ROM_Sys();
48:
49: MainRAMDevice *mainram {};
50: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.