|
|
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:
13: #include "rom.h"
14:
15: class MainRAMDevice;
16:
17: class NewsROMEmuDevice : public ROMDevice
18: {
19: using inherited = ROMDevice;
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:
1.1.1.2 ! root 43: busdata Read32(uint32 addr) override;
1.1 root 44:
45: private:
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.