|
|
1.1 root 1: //
2: // nono
3: // Copyright (C) 2024 nono project
4: // Licensed under nono-license.txt
5: //
6:
7: //
8: // Goldfish 割り込みコントローラ
9: //
10:
11: #pragma once
12:
13: #include "interrupt.h"
14:
15: class GFPICDevice : public InterruptDevice
16: {
17: using inherited = InterruptDevice;
18: friend class Virt68kInterrupt;
19:
20: static const uint32 STATUS = 0x00;
21: static const uint32 PENDING = 0x04; // was NUMBER
22: static const uint32 CLEAR_ALL = 0x08; // was DISABLE_ALL
23: static const uint32 DISABLE = 0x0c;
24: static const uint32 ENABLE = 0x10;
25:
26: public:
27: GFPICDevice(int id_);
28: ~GFPICDevice() override;
29:
30: bool Init() override;
31: void ResetHard(bool poweron) override;
32:
33: busdata Read32(uint32 addr) override;
34: busdata Write32(uint32 addr, uint32 data) override;
35: busdata Peek8(uint32 addr) override;
36:
37: busdata InterruptAcknowledge(int lv) override;
38:
39: // IRQ の登録。子デバイスが呼ぶ。irq は 1-32。
40: void RegistIRQ(int irq, const char *name, Device *source);
41:
42: // Virt68kInterrupt の下請け
43: void MonitorUpdateSummary(TextScreen& screen, int x, int y);
44: int MonitorUpdateDetail(TextScreen& screen, int y, int lv);
45:
46: protected:
47: void ChangeInterrupt() override;
48:
49: InterruptDevice *interrupt {};
50: };
51:
52: static inline GFPICDevice *GetGFPICDevice(int id_) {
53: return Object::GetObject<GFPICDevice>(OBJ_GFPIC(id_));
54: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.