File:  [Isaki's NoNo m68k/m88k emulator] / nono / vm / printer.cpp
Revision 1.1.1.11 (vendor branch): download - view: text, annotated - select for diffs
Wed Apr 29 17:05:51 2026 UTC (2 months, 3 weeks ago) by root
Branches: MAIN, Isaki
CVS tags: v027, v026, v025, HEAD
nono 1.5.0

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

//
// プリンタポート
//

#include "printer.h"
#include "event.h"

// InsideOut p.135
/*static*/ const busdata
PrinterDevice::wait = busdata::Wait(7 * 40_nsec);

// コンストラクタ
PrinterDevice::PrinterDevice()
	: inherited(OBJ_PRINTER)
{
}

// デストラクタ
PrinterDevice::~PrinterDevice()
{
}

busdata
PrinterDevice::ReadPort(uint32 offset)
{
	// 書き込み専用
	busdata data = BusData::BusErr;
	data |= wait;
	return data;
}

busdata
PrinterDevice::WritePort(uint32 offset, uint32 data)
{
	busdata r;

	switch (offset) {
	 case 0:
		// データ書き込み
		putlog(0, "Write Data (NOT IMPLEMENTED)");
		r.SetBusErr();
		break;
	 case 1:
		// ストローブ書き込み
		putlog(0, "Write Strobe (NOT IMPLEMENTED)");
		r = 0;
		break;
	 default:
		break;
	}

	r |= wait;
	r |= BusData::Size1;
	return r;
}

busdata
PrinterDevice::PeekPort(uint32 offset)
{
	// XXX
	return 0xff;
}

bool
PrinterDevice::PokePort(uint32 offset, uint32 data)
{
	return false;
}

unix.superglobalmegacorp.com

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