--- nono/vm/human68k.h 2026/04/29 17:04:55 1.1.1.6 +++ nono/vm/human68k.h 2026/04/29 17:05:25 1.1.1.10 @@ -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" -// Human68k console emulator +class MainbusDevice; +class MainRAMDevice; +class MPU680x0Device; -// Human68k 構造 -class Human68k : public Device +class Human68kDevice : public Device { using inherited = Device; + + static const uint32 default_load_addr = 0x20000; + + static const int FilesCount = 256; + public: // .X ファイルのヘッダ構造 struct XFileHeader { @@ -53,22 +61,25 @@ class Human68k : public Device std::string filename {}; }; - Human68k(); - virtual ~Human68k() override; + Human68kDevice(); + ~Human68kDevice() override; bool Init() override; - bool FLineOp(m68kcpu *cpu); + bool FLineOp(); + + // MSXDOSDevice からも呼ぶ + static void RequestExit(int code); private: // Human Emulation API - void RequestExit(int code); int32 OpenFile(uint32 fileaddr, uint16 atr, int mode); int32 CloseFile(int32 fileno); 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); @@ -78,10 +89,8 @@ class Human68k : public Device 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 {}; // ロードアドレス @@ -95,8 +104,9 @@ 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] {}; + + MainbusDevice *mainbus {}; + MainRAMDevice *ram {}; + MPU680x0Device *mpu680x0 {}; };