--- nono/vm/human68k.h 2026/04/29 17:04:41 1.1.1.4 +++ nono/vm/human68k.h 2026/04/29 17:05:18 1.1.1.9 @@ -4,18 +4,26 @@ // Licensed under nono-license.txt // +// +// Human68k .r .x .z console emulator +// + #pragma once #include "device.h" -#include "ram.h" -#include "m68030.h" +#include "mainram.h" -// Human68k console emulator +class MPU680x0Device; // Human68k 構造 class Human68k : public Device { using inherited = Device; + + static const uint32 default_load_addr = 0x20000; + + static const int FilesCount = 256; + public: // .X ファイルのヘッダ構造 struct XFileHeader { @@ -54,11 +62,14 @@ class Human68k : public Device }; Human68k(); - ~Human68k() override; + virtual ~Human68k() override; bool Init() override; - bool FLineOp(m68kcpu *cpu); + bool FLineOp(); + + // MSXDOSDevice からも呼ぶ + static void RequestExit(int code); private: // Human Emulation API @@ -67,19 +78,19 @@ class Human68k : public Device int32 WriteFile(int32 fileno, uint32 dataaddr, uint32 size); void FputsFile(int32 fileno, uint32 dataaddr); - void IOCS(m68kcpu *cpu); + void IOCS(); + void DOS_PRINT(uint32 dataptr); bool LoadR(uint8 *memfile, uint size); bool LoadX(uint8 *memfile, uint size); bool LoadZ(uint8 *memfile, uint size); + bool LoadELF(uint8 *memfile, uint size); bool LoadMem(uint32 addr, uint8 *src, uint size); bool isext(const char *file, const char *ext); - RAMDevice *ram {}; - const char *human68k_file {}; - const char *human68k_arg {}; + std::string human68k_arg {}; uint32 boot_addr {}; // ローダプログラムアドレス uint32 load_addr {}; // ロードアドレス @@ -93,8 +104,8 @@ class Human68k : public Device uint32 data_size {}; // データセクションサイズ uint32 bss_size {}; // BSS セクションサイズ(記録用) - const uint32 default_load_addr = 0x20000; - - static const int FilesCount = 256; File Files[FilesCount] {}; + + MainRAMDevice *ram {}; + MPU680x0Device *mpu {}; };