emu: added text color control for memview
[zymosis.git] / src / ZXEmuT / machines.c
blob860a900622dff0db143e4ca7a0a14971bbdcb548
1 /***************************************************************************
3 * ZXEmuT -- ZX Spectrum Emulator with Tcl scripting
5 * Copyright (C) 2012-2022 Ketmar Dark <ketmar@ketmar.no-ip.org>
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, version 3 of the License ONLY.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 **************************************************************************/
20 #include "machines.h"
23 // WARNING! keep in sync with `ZX_MACHINE_XXX` enum in "emuvars.h"!
24 const ZXBasicMachineInfo basicMachineInfo[ZX_MACHINE_MAX] = {
25 // 48k
26 { // 224 per line, 69888 per frame
27 .modelname = "48",
28 .cpuSpeed = 3500000,
29 .aySpeed = 1750000,
30 .romPages = 1,
31 .leftBorder = 24,
32 .hscreen = 128,
33 .rightBorder = 24,
34 .hretrace = 48,
35 .topBorder = 48,
36 .vscreen = 192,
37 .bottomBorder = 48,
38 .vretrace = 24,
39 .topleftpixts = 14336,
40 .intrlen = 32,
41 .port7ffd = -1,
42 .port1ffd = -1,
43 .evenM1 = 0,
44 .haveSnow = 1,
45 .floatingBus = 1,
46 .contention = 1,
47 .iocontention = 1,
48 .genuine = 1,
49 .usePlus3Contention = 0,
50 .p3dos = 0,
51 .port7ffDbug = 0,
53 // 128k
54 { // 228 per line, 70908 per frame
55 .modelname = "128",
56 .cpuSpeed = 3546900,
57 .aySpeed = 1773400,
58 .romPages = 2,
59 .leftBorder = 24,
60 .hscreen = 128,
61 .rightBorder = 24,
62 .hretrace = 52,
63 .topBorder = 48,
64 .vscreen = 192,
65 .bottomBorder = 48,
66 .vretrace = 23,
67 .topleftpixts = 14362,
68 .intrlen = 36,
69 .port7ffd = 0x00,
70 .port1ffd = -1,
71 .evenM1 = 0,
72 .haveSnow = 1,
73 .floatingBus = 1,
74 .contention = 1,
75 .iocontention = 1,
76 .genuine = 1,
77 .usePlus3Contention = 0,
78 .p3dos = 0,
79 .port7ffDbug = 1,
81 // plus2
82 { // 228 per line, 70908 per frame
83 .modelname = "plus2",
84 .cpuSpeed = 3546900,
85 .aySpeed = 1773400,
86 .romPages = 2,
87 .leftBorder = 24,
88 .hscreen = 128,
89 .rightBorder = 24,
90 .hretrace = 52,
91 .topBorder = 48,
92 .vscreen = 192,
93 .bottomBorder = 48,
94 .vretrace = 23,
95 .topleftpixts = 14362,
96 .intrlen = 36,
97 .port7ffd = 0x00,
98 .port1ffd = -1,
99 .evenM1 = 0,
100 .haveSnow = 1,
101 .floatingBus = 1,
102 .contention = 1,
103 .iocontention = 1,
104 .genuine = 1,
105 .usePlus3Contention = 0,
106 .p3dos = 0,
107 .port7ffDbug = 0,
109 // plus2a
110 { // 228 per line, 70908 per frame
111 .modelname = "plus2a",
112 .cpuSpeed = 3546900,
113 .aySpeed = 1773400,
114 .romPages = 4,
115 .leftBorder = 24,
116 .hscreen = 128,
117 .rightBorder = 24,
118 .hretrace = 52,
119 .topBorder = 48,
120 .vscreen = 192,
121 .bottomBorder = 48,
122 .vretrace = 23,
123 //.topleftpixts = 14365,
124 .topleftpixts = 14362,
125 .intrlen = 32,
126 .port7ffd = 0x00,
127 .port1ffd = 0,
128 .evenM1 = 0,
129 .haveSnow = 0,
130 .floatingBus = 2,
131 .contention = 1,
132 .iocontention = 0,
133 .genuine = 1,
134 .usePlus3Contention = 1,
135 .p3dos = 1,
136 .port7ffDbug = 0,
138 // plus3
139 { // 228 per line, 70908 per frame
140 .modelname = "plus3",
141 .cpuSpeed = 3546900,
142 .aySpeed = 1773400,
143 .romPages = 4,
144 .leftBorder = 24,
145 .hscreen = 128,
146 .rightBorder = 24,
147 .hretrace = 52,
148 .topBorder = 48,
149 .vscreen = 192,
150 .bottomBorder = 48,
151 .vretrace = 23,
152 //.topleftpixts = 14365,
153 .topleftpixts = 14362,
154 .intrlen = 32,
155 .port7ffd = 0x00,
156 .port1ffd = 0,
157 .evenM1 = 0,
158 .haveSnow = 0,
159 .floatingBus = 2,
160 .contention = 1,
161 .iocontention = 0,
162 .genuine = 1,
163 .usePlus3Contention = 1,
164 .p3dos = 1,
165 .port7ffDbug = 0,
167 // Pentagon
168 { // 228 per line, 71680 per frame
169 .modelname = "pentagon",
170 .cpuSpeed = 3584000,
171 .aySpeed = 1792000,
172 .romPages = 2,
173 .leftBorder = 36,
174 .hscreen = 128,
175 .rightBorder = 28,
176 .hretrace = 32,
177 .topBorder = 64,
178 .vscreen = 192,
179 .bottomBorder = 48,
180 .vretrace = 16,
181 .topleftpixts = 17988,
182 .intrlen = 36,
183 .port7ffd = 0x00,
184 .port1ffd = -1,
185 .evenM1 = 0,
186 .haveSnow = 0,
187 .floatingBus = 0,
188 .contention = 0,
189 .iocontention = 0,
190 .genuine = 0,
191 .usePlus3Contention = 0,
192 .p3dos = 0,
193 .port7ffDbug = 0,
195 // Scorpion
196 { // 228 per line, 69888 per frame
197 .modelname = "scorpion",
198 .cpuSpeed = 3500000,
199 .aySpeed = 1750000,
200 .romPages = 3, // page 4: TR-DOS
201 .leftBorder = 24,
202 .hscreen = 128,
203 .rightBorder = 32,
204 .hretrace = 40,
205 .topBorder = 48,
206 .vscreen = 192,
207 .bottomBorder = 48,
208 .vretrace = 24,
209 .topleftpixts = 14336,
210 .intrlen = 36,
211 .port7ffd = 0x00,
212 .port1ffd = 0,
213 .evenM1 = 1,
214 .haveSnow = 0,
215 .floatingBus = 0,
216 .contention = 0,
217 .iocontention = 0,
218 .genuine = 0,
219 .usePlus3Contention = 0,
220 .p3dos = 0,
221 .port7ffDbug = 0,
226 void fillMachineInfo (ZXMachineInfo *mi, const ZXBasicMachineInfo *bmi) {
227 mi->modelname = bmi->modelname;
228 mi->cpuSpeed = bmi->cpuSpeed;
229 mi->aySpeed = bmi->aySpeed;
230 mi->romPages = bmi->romPages;
231 mi->leftBorder = bmi->leftBorder;
232 mi->hscreen = bmi->hscreen;
233 mi->rightBorder = bmi->rightBorder;
234 mi->hretrace = bmi->hretrace;
235 mi->topBorder = bmi->topBorder;
236 mi->vscreen = bmi->vscreen;
237 mi->bottomBorder = bmi->bottomBorder;
238 mi->vretrace = bmi->vretrace;
239 mi->topleftpixts = bmi->topleftpixts;
240 mi->intrlen = bmi->intrlen;
241 mi->port7ffd = bmi->port7ffd;
242 mi->port1ffd = bmi->port1ffd;
243 mi->evenM1 = bmi->evenM1;
244 mi->haveSnow = bmi->haveSnow;
245 mi->floatingBus = bmi->floatingBus;
246 mi->contention = mi->origContention = bmi->contention;
247 mi->iocontention = mi->origIOContention = bmi->iocontention;
248 mi->genuine = bmi->genuine;
249 mi->usePlus3Contention = bmi->usePlus3Contention;
250 mi->p3dos = bmi->p3dos;
251 mi->port7ffDbug = bmi->port7ffDbug;
253 mi->linesperframe = mi->topBorder+mi->vscreen+mi->bottomBorder+mi->vretrace;
254 mi->tsperline = mi->leftBorder+mi->hscreen+mi->rightBorder+mi->hretrace;
255 mi->tsperframe = mi->tsperline*mi->linesperframe;
256 mi->tsdrawstart = mi->topleftpixts-(mi->tsperline*mi->topBorder);