--- nono/vm/vm_x68k.cpp 2026/04/29 17:04:36 1.1.1.2 +++ nono/vm/vm_x68k.cpp 2026/04/29 17:04:50 1.1.1.5 @@ -7,11 +7,19 @@ #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 "scheduler.h" +#include "spc.h" #include "x68kkbd.h" #include "xiospace.h" @@ -30,13 +38,20 @@ VM_X68030::VM_X68030() // SPC の入力クロック (5MHz = 200ns) gConfig->Add("!spc-tCLF", 200); + // この機種に不要なパラメータはここで削除する + // (機種が決まるより前に全機種の設定の和集合を用意してあるため) + gConfig->Delete("luna-dipsw1"); + gConfig->Delete("luna-dipsw2"); + gConfig->Delete("prom-image"); + // デバイス (順序に注意) // BusErrDevice は親コンストラクタで作成済み。 + gMPU.reset(new MPU680x0Device(0xff0000)); // required by Scheduler gScheduler.reset(new Scheduler()); // required by * - gMPU.reset(new MPU680x0Device(0xff0000)); + gInterrupt.reset(new X68030Interrupt()); gRAM.reset(new RAMDevice()); // required by XIOSpace - xiospace.reset(new XIOSpaceDevice()); + gXIOSpace.reset(new XIOSpaceDevice()); gKeyboard.reset(new X68030Keyboard()); gRenderer.reset(new X68030Renderer()); @@ -44,7 +59,7 @@ VM_X68030::VM_X68030() // 割り当て // 今は拡張メモリがないので、今は上位8ビット全領域がミラーになっている。 for (int i = 0; i < countof(::devtable); i++) { - ::devtable[i] = xiospace.get(); + ::devtable[i] = gXIOSpace.get(); } } @@ -70,6 +85,54 @@ VM_X68030::PowerButton() DevicePowerOn(); } +// リセットについて +// +// 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 @@ -86,14 +149,27 @@ VM_RXZ::VM_RXZ() // SPC の入力クロック (5MHz = 200ns) gConfig->Add("!spc-tCLF", 200); + // この機種に不要なパラメータはここで削除する + // (機種が決まるより前に全機種の設定の和集合を用意してあるため) + gConfig->Delete("luna-dipsw1"); + gConfig->Delete("luna-dipsw2"); + gConfig->Delete("prom-image"); + // デバイス (順序に注意) // BusErrDevice は親コンストラクタで作成済み。 + gMPU.reset(new MPU680x0Device(0)); // required by Scheduler gScheduler.reset(new Scheduler()); // required by * - gMPU.reset(new MPU680x0Device(0)); + gInterrupt.reset(new X68030Interrupt()); gRAM.reset(new RAMDevice()); // required by Human68k gRTC.reset(new RP5C15Device()); human68k.reset(new Human68k()); + + // 割り当て + // 全域 RAM に見せる。正しくはない。 + for (int i = 0; i < countof(::devtable); i++) { + ::devtable[i] = gRAM.get(); + } } // デストラクタ