|
|
1.1 root 1: //
2: // nono
1.1.1.2 root 3: // Copyright (C) 2020 nono project
4: // Licensed under nono-license.txt
1.1 root 5: //
6:
7: #include "m88100.h"
8:
9: // コンストラクタ
1.1.1.10! root 10: m88kcpu::m88kcpu(MPU88xx0Device *dev_)
1.1 root 11: {
1.1.1.10! root 12: dev = dev_;
! 13:
1.1.1.2 root 14: cmmu[0].Ctor(this);
15: cmmu[1].Ctor(this);
1.1.1.6 root 16:
17: // レジスタのうち不定と明記されてるものは、未初期化のまま触ったことが
18: // 分かりやすいような適当なパターンで埋めておく。ただし最上位も c に
19: // すると BT454 のレジスタ付近を指してしまうので、それは避けておく。
20: // XXX Super Reset が出来たらそっちに移動?
21: const uint32 Undefined = 0x0ccccccc;
22: for (int i = 1; i < 32; i++) {
23: r[i] = Undefined;
24: }
1.1.1.9 root 25: for (int i = 0; i < countof(fcr); i++) {
26: fcr[i] = Undefined & fcr_mask[i];
1.1.1.6 root 27: }
1.1.1.9 root 28:
1.1.1.6 root 29: epsr = Undefined;
30: ssbr = Undefined;
31: sfip = Undefined;
32: snip = Undefined;
33: sxip = Undefined;
34: // DMTx は bit0(Valid) をクリア。DMAx/DMDx は不定。
35: dma0 = Undefined;
36: dma1 = Undefined;
37: dma2 = Undefined;
38: dmd0 = Undefined;
39: dmd1 = Undefined;
40: dmd2 = Undefined;
1.1 root 41: }
42:
43: // デストラクタ
44: m88kcpu::~m88kcpu()
45: {
46: }
47:
1.1.1.8 root 48: // DOS call エミュレーションのコールバックを設定
49: void
50: m88kcpu::SetFLineCallback(bool (*callback)(m88kcpu *, void *), void *arg)
51: {
52: fline_callback = callback;
53: fline_arg = arg;
54: }
55:
1.1.1.2 root 56: // PID の VERSION フィールドをセットする。初期化時に呼ぶ。
57: void
58: m88kcpu::SetVersion(uint32 version)
59: {
60: pid &= ~PID_VER_MASK;
61: pid |= version << 1;
62: }
63:
1.1.1.9 root 64: // fcr のマスク
65: /*static*/ const uint32 m88100reg::fcr_mask[11] = {
66: FPECR_MASK,
67: 0xffffffff, // fphs1
68: 0xffffffff, // fpls1
69: 0xffffffff, // fphs2
70: 0xffffffff, // fpls2
71: FPPT_MASK,
72: FPRH_MASK,
73: 0xffffffff, // fprl
74: FPIT_MASK,
75: FPSR_MASK,
76: FPCR_MASK,
77: };
78:
1.1 root 79: /*static*/ const char * const m88100reg::sipname[3] = {
80: "sxip", "snip", "sfip",
81: };
82:
1.1.1.2 root 83: /*static*/ const char * const m88100reg::dmt_en_str[16] = {
84: "----",
85: "---B",
86: "--B-",
87: "--HH",
88: "-B--",
89: "-1-1", // not used normally
90: "-11-", // not used normally
91: "-111", // not used normally
92: "B---",
93: "1--1", // not used normally
94: "1-1-", // not used normally
95: "1-11", // not used normally
96: "HH--",
97: "11-1", // not used normally
98: "111-", // not used normally
99: "LLLL",
100: };
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.