--- nono/vm/rp5c15.h 2026/04/29 17:05:17 1.1.1.13 +++ nono/vm/rp5c15.h 2026/04/29 17:05:28 1.1.1.15 @@ -10,12 +10,11 @@ #pragma once -#include "device.h" -#include "monitor.h" #include "rtc.h" +#include "monitor.h" class MFPDevice; -class PowerDevice; +class X68030PowerDevice; struct RP5C15 { @@ -64,49 +63,49 @@ struct RP5C15 static const uint8 mask[16 + 13]; // バンク0 - static const int SEC1 = 0x00; // $E8A001 - static const int SEC10 = 0x01; // $E8A003 - static const int MIN1 = 0x02; // $E8A005 - static const int MIN10 = 0x03; // $E8A007 - static const int HOUR1 = 0x04; // $E8A009 - static const int HOUR10 = 0x05; // $E8A00B - static const int WDAY = 0x06; // $E8A00D - static const int DAY1 = 0x07; // $E8A00F - static const int DAY10 = 0x08; // $E8A011 - static const int MON1 = 0x09; // $E8A013 - static const int MON10 = 0x0a; // $E8A015 - static const int YEAR1 = 0x0b; // $E8A017 - static const int YEAR10 = 0x0c; // $E8A019 - static const int MODE = 0x0d; // $E8A01B - static const int TEST = 0x0e; // $E8A01D - static const int RESET = 0x0f; // $E8A01F + static const uint SEC1 = 0x00; // $E8A001 + static const uint SEC10 = 0x01; // $E8A003 + static const uint MIN1 = 0x02; // $E8A005 + static const uint MIN10 = 0x03; // $E8A007 + static const uint HOUR1 = 0x04; // $E8A009 + static const uint HOUR10 = 0x05; // $E8A00B + static const uint WDAY = 0x06; // $E8A00D + static const uint DAY1 = 0x07; // $E8A00F + static const uint DAY10 = 0x08; // $E8A011 + static const uint MON1 = 0x09; // $E8A013 + static const uint MON10 = 0x0a; // $E8A015 + static const uint YEAR1 = 0x0b; // $E8A017 + static const uint YEAR10 = 0x0c; // $E8A019 + static const uint MODE = 0x0d; // $E8A01B + static const uint TEST = 0x0e; // $E8A01D + static const uint RESET = 0x0f; // $E8A01F // バンク1 - static const int CLKSEL = 0x10; // $E8A001 - static const int ADJUST = 0x11; // $E8A003 - static const int ALARM_MIN1 = 0x12; // $E8A005 - static const int ALARM_MIN10 = 0x13; // $E8A007 - static const int ALARM_HOUR1 = 0x14; // $E8A009 - static const int ALARM_HOUR10 = 0x15; // $E8A00B - static const int ALARM_WDAY = 0x16; // $E8A00D - static const int ALARM_DAY1 = 0x17; // $E8A00F - static const int ALARM_DAY10 = 0x18; // $E8A011 - static const int notused1 = 0x19; // $E8A013 - static const int SEL24 = 0x1a; // $E8A015 - static const int LEAP = 0x1b; // $E8A017 - static const int notused2 = 0x1c; // $E8A019 + static const uint CLKSEL = 0x10; // $E8A001 + static const uint ADJUST = 0x11; // $E8A003 + static const uint ALARM_MIN1 = 0x12; // $E8A005 + static const uint ALARM_MIN10 = 0x13; // $E8A007 + static const uint ALARM_HOUR1 = 0x14; // $E8A009 + static const uint ALARM_HOUR10 = 0x15; // $E8A00B + static const uint ALARM_WDAY = 0x16; // $E8A00D + static const uint ALARM_DAY1 = 0x17; // $E8A00F + static const uint ALARM_DAY10 = 0x18; // $E8A011 + static const uint notused1 = 0x19; // $E8A013 + static const uint SEL24 = 0x1a; // $E8A015 + static const uint LEAP = 0x1b; // $E8A017 + static const uint notused2 = 0x1c; // $E8A019 // バンク1 の 13, 14, 15 はバンク0 と共通 - static const int MODE_BANK1 = 0x1d; // $E8A01B - static const int TEST_BANK1 = 0x1e; // $E8A01D - static const int RESET_BANK1 = 0x1f; // $E8A01F - - static const int MODE_TIMER_EN = 0x08; - static const int MODE_ALARM_EN = 0x04; - static const int MODE_BANK = 0x01; - - static const int RESET_1Hz = 0x08; - static const int RESET_16Hz = 0x04; - static const int RESET_TIMER = 0x02; - static const int RESET_ALARM = 0x01; + static const uint MODE_BANK1 = 0x1d; // $E8A01B + static const uint TEST_BANK1 = 0x1e; // $E8A01D + static const uint RESET_BANK1 = 0x1f; // $E8A01F + + static const uint MODE_TIMER_EN = 0x08; + static const uint MODE_ALARM_EN = 0x04; + static const uint MODE_BANK = 0x01; + + static const uint RESET_1Hz = 0x08; + static const uint RESET_16Hz = 0x04; + static const uint RESET_TIMER = 0x02; + static const uint RESET_ALARM = 0x01; }; class RP5C15Device : public RTCDevice @@ -114,7 +113,7 @@ class RP5C15Device : public RTCDevice using inherited = RTCDevice; public: RP5C15Device(); - virtual ~RP5C15Device() override; + ~RP5C15Device() override; bool Init() override; @@ -130,9 +129,10 @@ class RP5C15Device : public RTCDevice protected: // BusIO インタフェース static const uint32 NPORT = 16; - uint64 Read(uint32 offset); - uint64 Write(uint32 offset, uint32 data); - uint64 Peek(uint32 offset); + busdata ReadPort(uint32 offset); + busdata WritePort(uint32 offset, uint32 data); + busdata PeekPort(uint32 offset); + bool PokePort(uint32 offset, uint32 data); // 仮想 RTC からのクロック void Tick32Hz() override; @@ -179,7 +179,7 @@ class RP5C15Device : public RTCDevice bool alarm_on {}; MFPDevice *mfp {}; - PowerDevice *power {}; + X68030PowerDevice *power {}; Monitor monitor { this }; };