|
|
nono 0.3.0
//
// nono
// Copyright (C) 2020 nono project
// Licensed under nono-license.txt
//
#include "m88100.h"
// コンストラクタ
m88kcpu::m88kcpu(MPU88xx0Device *dev_)
{
dev = dev_;
cmmu[0].Ctor(this);
cmmu[1].Ctor(this);
// レジスタのうち不定と明記されてるものは、未初期化のまま触ったことが
// 分かりやすいような適当なパターンで埋めておく。ただし最上位も c に
// すると BT454 のレジスタ付近を指してしまうので、それは避けておく。
// XXX Super Reset が出来たらそっちに移動?
const uint32 Undefined = 0x0ccccccc;
for (int i = 1; i < 32; i++) {
r[i] = Undefined;
}
for (int i = 0; i < countof(fcr); i++) {
fcr[i] = Undefined & fcr_mask[i];
}
epsr = Undefined;
ssbr = Undefined;
sfip = Undefined;
snip = Undefined;
sxip = Undefined;
// DMTx は bit0(Valid) をクリア。DMAx/DMDx は不定。
dma0 = Undefined;
dma1 = Undefined;
dma2 = Undefined;
dmd0 = Undefined;
dmd1 = Undefined;
dmd2 = Undefined;
}
// デストラクタ
m88kcpu::~m88kcpu()
{
}
// DOS call エミュレーションのコールバックを設定
void
m88kcpu::SetFLineCallback(bool (*callback)(m88kcpu *, void *), void *arg)
{
fline_callback = callback;
fline_arg = arg;
}
// PID の VERSION フィールドをセットする。初期化時に呼ぶ。
void
m88kcpu::SetVersion(uint32 version)
{
pid &= ~PID_VER_MASK;
pid |= version << 1;
}
// fcr のマスク
/*static*/ const uint32 m88100reg::fcr_mask[11] = {
FPECR_MASK,
0xffffffff, // fphs1
0xffffffff, // fpls1
0xffffffff, // fphs2
0xffffffff, // fpls2
FPPT_MASK,
FPRH_MASK,
0xffffffff, // fprl
FPIT_MASK,
FPSR_MASK,
FPCR_MASK,
};
/*static*/ const char * const m88100reg::sipname[3] = {
"sxip", "snip", "sfip",
};
/*static*/ const char * const m88100reg::dmt_en_str[16] = {
"----",
"---B",
"--B-",
"--HH",
"-B--",
"-1-1", // not used normally
"-11-", // not used normally
"-111", // not used normally
"B---",
"1--1", // not used normally
"1-1-", // not used normally
"1-11", // not used normally
"HH--",
"11-1", // not used normally
"111-", // not used normally
"LLLL",
};
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.