--- nono/vm/vm_x68k.cpp 2026/04/29 17:04:45 1.1.1.4 +++ nono/vm/vm_x68k.cpp 2026/04/29 17:04:53 1.1.1.6 @@ -7,12 +7,20 @@ #include "vm_x68k.h" #include "bus.h" #include "config.h" +#include "dmac.h" +#include "fdc.h" #include "human68k.h" #include "interrupt.h" +#include "mfp.h" #include "mpu680x0.h" +#include "pedec.h" +#include "pluto.h" +#include "pio.h" #include "renderer.h" #include "rp5c15.h" +#include "romimg_x68k.h" #include "scheduler.h" +#include "spc.h" #include "x68kkbd.h" #include "xiospace.h" @@ -40,11 +48,12 @@ VM_X68030::VM_X68030() // デバイス (順序に注意) // BusErrDevice は親コンストラクタで作成済み。 - gMPU.reset(new MPU680x0Device(0xff0000)); // required by Scheduler + gMPU.reset(new MPU680x0Device()); // required by Scheduler gScheduler.reset(new Scheduler()); // required by * gInterrupt.reset(new X68030Interrupt()); gRAM.reset(new RAMDevice()); // required by XIOSpace - xiospace.reset(new XIOSpaceDevice()); + gXIOSpace.reset(new XIOSpaceDevice()); + gIPLROM0.reset(new IPLROM0Device()); gKeyboard.reset(new X68030Keyboard()); gRenderer.reset(new X68030Renderer()); @@ -52,7 +61,7 @@ VM_X68030::VM_X68030() // 割り当て // 今は拡張メモリがないので、今は上位8ビット全領域がミラーになっている。 for (int i = 0; i < countof(::devtable); i++) { - ::devtable[i] = xiospace.get(); + ::devtable[i] = gXIOSpace.get(); } } @@ -74,10 +83,69 @@ VM_X68030::PowerButton() // ボタンの状態を更新して.. power_button = !power_button; - // デバイスに指示 - DevicePowerOn(); + // スケジューラに指示 + gScheduler->RequestPowerOn(); } +// ブートページを切り替える。 +void +VM_X68030::SwitchBootPage(Device *parent, bool isrom) +{ + // 共通処理 + inherited::SwitchBootPage(parent, isrom); + + // X68030 では XIOSpace が担当している + gXIOSpace->SwitchBootPage(isrom); +} + +// リセットについて +// +// PWRRESET +// 電源オン ----------+--> VIPS +// (7505) +--> VideoCtlr +// +--> OSCIAN2 +// | +// | +------+ +// +-->| | +// 本体 SWRESET | YUKI | IPLRESET +// リセット ------------->| |-----------> FPU +// スイッチ +------+ +// | +// ▽ +// RESET | +// |<-> MPU (68030) +// +--> PPI +// +--> PEDEC +// +--> SPC +// +--> ADPCM +// +--> FDC +// +--> MFP +// | +// | EXRESET +// +---|>-----------> 外部バス +// ▽ +// SYSRESET | +// |<-> SAKI ---+ +// | | BEC0,BEC1 +// +--> DMAC <--+ +// +--> CYNTHIA +// リセットされない? +// o CACHY +// o YM2151 (FM音源) +// o SCC + +// MPU の RESET 命令によるリセット +void +VM_X68030::ResetByMPU() +{ + gDMAC->ResetHard(); + gFDC->ResetHard(); + gMFP->ResetHard(); + gPEDEC->ResetHard(); + gPluto->ResetHard(); + gPPI->ResetHard(); + gSPC->ResetHard(); +} // // RXZ .r .x .z human68k console emulator @@ -103,7 +171,7 @@ VM_RXZ::VM_RXZ() // デバイス (順序に注意) // BusErrDevice は親コンストラクタで作成済み。 - gMPU.reset(new MPU680x0Device(0)); // required by Scheduler + gMPU.reset(new MPU680x0Device()); // required by Scheduler gScheduler.reset(new Scheduler()); // required by * gInterrupt.reset(new X68030Interrupt()); gRAM.reset(new RAMDevice()); // required by Human68k @@ -131,6 +199,13 @@ VM_RXZ::PowerButton() // ON PUSH (何も起きない) // OFF PUSH 電源オン - // デバイスに指示 - DevicePowerOn(); + // スケジューラに指示 + gScheduler->RequestPowerOn(); +} + +// ブートページを切り替える。 +void +VM_RXZ::SwitchBootPage(Device *parent, bool isrom) +{ + // 何もしない }