File:  [Isaki's NoNo m68k/m88k emulator] / nono / vm / romemu_news.h
Revision 1.1.1.3 (vendor branch): download - view: text, annotated - select for diffs
Wed Apr 29 17:05:29 2026 UTC (2 months, 3 weeks ago) by root
Branches: MAIN, Isaki
CVS tags: v027, v026, v025, v024, v023, v022, v021, v020, HEAD
nono 1.0.0

//
// nono
// Copyright (C) 2022 nono project
// Licensed under nono-license.txt
//

//
// NEWS の ROM エミュレーション (-X のみ対応)
//

#pragma once

#include "romemu.h"

class MainRAMDevice;

class NewsROMEmuDevice : public ROMEmuDevice
{
	using inherited = ROMEmuDevice;

 protected:
	// このデバイス先頭アドレス
	static const uint32 baseaddr		= 0xf8000000;

	// 謎の I/O 空間
	static const uint32 ROMIO_BASE		= 0xf8010000;
	static const uint32 ROMIO_INIT		= (ROMIO_BASE + 0);
	static const uint32 ROMIO_SYS		= (ROMIO_BASE + 4);

	// NEWS の ROM サービスコール?
	static const uint32 SYS_reboot	= 0;
	static const uint32 SYS_exit	= 1;
	static const uint32 SYS_read	= 3;
	static const uint32 SYS_write	= 4;

 public:
	NewsROMEmuDevice();
	~NewsROMEmuDevice() override;

	bool Init() override;
	void ResetHard(bool poweron) override;

 private:
	uint64 ReadROMIO(busaddr addr) override;

	uint32 ROM_Init();
	uint32 ROM_Sys();

	MainRAMDevice *mainram {};
};

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.