--- nono/vm/sram.cpp 2026/04/29 17:04:36 1.1.1.4 +++ nono/vm/sram.cpp 2026/04/29 17:05:10 1.1.1.9 @@ -4,29 +4,31 @@ // Licensed under nono-license.txt // -#include "sram.h" -#include "mainapp.h" -#include "mystring.h" - // // SRAM // + // SRAM はビッグエンディアンのままメモリに置かれるので、 // 必要ならアクセス時に都度変換すること。 -// -std::unique_ptr gSRAM; +#include "sram.h" +#include "mainapp.h" + +// グローバル参照用 +SRAMDevice *gSRAM; +// コンストラクタ SRAMDevice::SRAMDevice() + : inherited("SRAM") { - logname = "sram"; - devname = "SRAM"; devaddr = baseaddr; devlen = 0x4000; } +// デストラクタ SRAMDevice::~SRAMDevice() { + gSRAM = NULL; } bool @@ -43,6 +45,14 @@ SRAMDevice::Init() return true; } +// リセット +void +SRAMDevice::ResetHard(bool poweron) +{ + // XXX 未調査 + writeable = false; +} + // アドレスデコーダ inline uint64 SRAMDevice::Decoder(uint32 addr) const @@ -60,7 +70,7 @@ SRAMDevice::Read8(uint32 addr) uint32 data; // ホストファイル起動モードなら起動アドレスとして Pluto-X を見せる。 - if (gMainApp.host_file) { + if (gMainApp.exec_file) { data = PeekHostBoot(offset); if ((int32)data >= 0) { if ((offset & 1) == 0) { @@ -83,7 +93,7 @@ SRAMDevice::Read16(uint32 addr) uint32 data; // ホストファイル起動モードなら起動アドレスとして Pluto-X を見せる。 - if (gMainApp.host_file) { + if (gMainApp.exec_file) { data = PeekHostBoot(offset); if ((int32)data >= 0) { return data; @@ -132,7 +142,7 @@ SRAMDevice::Peek8(uint32 addr) uint32 offset = Decoder(addr); // ホストファイル起動モードなら起動アドレスとして Pluto-X を見せる。 - if (gMainApp.host_file) { + if (gMainApp.exec_file) { uint32 data = PeekHostBoot(offset); if ((int32)data >= 0) { if ((offset & 1) == 0) {