--- nono/vm/human68k.h 2026/04/29 17:04:28 1.1 +++ nono/vm/human68k.h 2026/04/29 17:04:55 1.1.1.6 @@ -1,6 +1,7 @@ // // nono -// Copyright (C) 2017 Y.Sugahara (moveccr) +// Copyright (C) 2020 nono project +// Licensed under nono-license.txt // #pragma once @@ -12,8 +13,9 @@ // Human68k console emulator // Human68k 構造 -class Human68k : public Device { - typedef Device inherited; +class Human68k : public Device +{ + using inherited = Device; public: // .X ファイルのヘッダ構造 struct XFileHeader { @@ -48,18 +50,19 @@ class Human68k : public Device { // Human68k File struct File { int fd = -1; // unix fd - char *filename = NULL; + std::string filename {}; }; - Human68k(const char *file, const char *arg); - virtual ~Human68k(); + Human68k(); + virtual ~Human68k() override; - virtual bool Init(); + bool Init() override; bool FLineOp(m68kcpu *cpu); 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); @@ -70,26 +73,27 @@ class Human68k : public Device { 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 = NULL; + RAMDevice *ram {}; - const char *human68k_file = NULL; - const char *human68k_arg = NULL; + const char *human68k_file {}; + const char *human68k_arg {}; - uint32 boot_addr = 0; // ローダプログラムアドレス - uint32 load_addr = 0; // ロードアドレス - uint32 load_size = 0; // ロードサイズ + uint32 boot_addr {}; // ローダプログラムアドレス + uint32 load_addr {}; // ロードアドレス + uint32 load_size {}; // ロードサイズ - uint32 base_addr = 0; // ベースアドレス(ファイルの値) + uint32 base_addr {}; // ベースアドレス(ファイルの値) // ベースアドレスはload_addr決定で使用される - uint32 exec_addr = 0; // 実行開始アドレス + uint32 exec_addr {}; // 実行開始アドレス - uint32 text_size = 0; // テキストセクションサイズ - uint32 data_size = 0; // データセクションサイズ - uint32 bss_size = 0; // BSS セクションサイズ(記録用) + uint32 text_size {}; // テキストセクションサイズ + uint32 data_size {}; // データセクションサイズ + uint32 bss_size {}; // BSS セクションサイズ(記録用) const uint32 default_load_addr = 0x20000;