Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1088 | alone | 1 | #include "std.h" |
2 | |||
3 | #include "emul.h" |
||
4 | #include "funcs.h" |
||
5 | #include "vars.h" |
||
6 | #include "draw.h" |
||
7 | #include "memory.h" |
||
8 | #include "atm.h" |
||
9 | #include "profi.h" |
||
10 | #include "sndrender/sndcounter.h" |
||
11 | #include "sound.h" |
||
12 | #include "gs.h" |
||
13 | #include "sdcard.h" |
||
14 | #include "zc.h" |
||
15 | #include "tape.h" |
||
16 | #include "zxevo.h" //NEDOREPO |
||
17 | #include "upd765.h" |
||
18 | #include "zxusbnet.h" //NEDOREPO |
||
19 | |||
20 | |||
21 | |||
22 | |||
23 | |||
24 | #define NO_KEY 0xFF |
||
25 | |||
26 | // [NS] ���� ���� ������� ������� �������� ���� � ������� ��������� |
||
27 | // � �� ���� ����� ������� |
||
28 | unsigned char ps2_2_atm620_xt_keyb_code[256] = |
||
29 | { |
||
30 | |||
31 | NO_KEY, // 00 // nope |
||
32 | NO_KEY, // 0x0001, // DIK_F9 |
||
33 | NO_KEY, // 02 |
||
34 | NO_KEY, // 0x0003, // DIK_F5 |
||
35 | |||
36 | NO_KEY, // 0x0004, // DIK_F3 |
||
37 | NO_KEY, // 0x0005, // DIK_F1 |
||
38 | NO_KEY, // 0x0006, // DIK_F2 |
||
39 | NO_KEY, // 0x0007, // DIK_F12 |
||
40 | |||
41 | NO_KEY, // 08 |
||
42 | NO_KEY, // 0x0009, // DIK_F10 |
||
43 | NO_KEY, // 0x000A, // DIK_F8 |
||
44 | NO_KEY, // 0x000B, // DIK_F6 |
||
45 | |||
46 | NO_KEY, // 0x000C, // DIK_F4 |
||
47 | 0xF0, //tab // 0x000D, // DIK_TAB |
||
48 | 0x94, //` // 0x000E, // DIK_GRAVE ` ����� 1 !!! |
||
49 | NO_KEY, // 0F |
||
50 | |||
51 | NO_KEY, // 10 |
||
52 | NO_KEY, // 0x0011, // DIK_LMENU (left Alt) !!! |
||
53 | NO_KEY, // 0x0012, // DIK_LSHIFT |
||
54 | NO_KEY, // 13 |
||
55 | |||
56 | NO_KEY, // 0x0014, // DIK_LCONTROL !!! |
||
57 | 0x08, //Q q // 0x0015, // DIK_Q |
||
58 | 0x40, //1 // 0x0016, // DIK_1 |
||
59 | NO_KEY, // 17 |
||
60 | |||
61 | NO_KEY, // 18 |
||
62 | NO_KEY, // 19 |
||
63 | 0x34, //Z z // 0x001A, // DIK_Z |
||
64 | 0xF8, //S s // 0x001B, // DIK_S |
||
65 | |||
66 | 0x78, //A a // 0x001C, // DIK_A |
||
67 | 0x88, //W w // 0x001D, // DIK_W |
||
68 | 0xC0, //2 // 0x001E, // DIK_2 |
||
69 | NO_KEY, // 1f |
||
70 | |||
71 | NO_KEY, // 20 |
||
72 | 0x74, //C c // 0x0021, // DIK_C |
||
73 | 0xB4, //X x // 0x0022, // DIK_X |
||
74 | 0x04, //D d // 0x0023, // DIK_D |
||
75 | |||
76 | 0x48, //E e // 0x0024, // DIK_E |
||
77 | 0xA0, //4 // 0x0025, // DIK_4 |
||
78 | 0x20, //3 // 0x0026, // DIK_3 |
||
79 | NO_KEY, // 27 |
||
80 | |||
81 | NO_KEY, // 28 |
||
82 | 0x9C, //space // 0x0029, // DIK_SPACE |
||
83 | 0xF4, //V v // 0x002A, // DIK_V |
||
84 | 0x84, //F f // 0x002B, // DIK_F |
||
85 | |||
86 | 0x28, //T t // 0x002C, // DIK_T |
||
87 | 0xC8, //R r // 0x002D, // DIK_R |
||
88 | 0x60, //5 // 0x002E, // DIK_5 |
||
89 | NO_KEY, // 2f |
||
90 | |||
91 | NO_KEY, // 30 |
||
92 | 0x8C, //N n // 0x0031, // DIK_N |
||
93 | 0x0C, //B b // 0x0032, // DIK_B |
||
94 | 0xC4, //H h // 0x0033, // DIK_H |
||
95 | |||
96 | 0x44, //G g // 0x0034, // DIK_G |
||
97 | 0xA8, //Y y // 0x0035, // DIK_Y |
||
98 | 0xE0, //6 // 0x0036, // DIK_6 |
||
99 | NO_KEY, // 37 |
||
100 | |||
101 | NO_KEY, // 38 |
||
102 | NO_KEY, // 39 |
||
103 | 0x4C, //M m // 0x003A, // DIK_M |
||
104 | 0x24, //J j // 0x003B, // DIK_J |
||
105 | |||
106 | 0x68, //U u // 0x003C, // DIK_U |
||
107 | 0x10, //7 // 0x003D, // DIK_7 |
||
108 | 0x90, //8 // 0x003E, // DIK_8 |
||
109 | NO_KEY, // 3f |
||
110 | |||
111 | NO_KEY, // 40 |
||
112 | 0xCC, //, // 0x0041, // DIK_COMMA |
||
113 | 0xA4, //K k // 0x0042, // DIK_K |
||
114 | 0xE8, //I i // 0x0043, // DIK_I |
||
115 | |||
116 | 0x18, //O o // 0x0044, // DIK_O char??? |
||
117 | 0xD0, //0 // 0x0045, // DIK_0 zero??? |
||
118 | 0x50, //9 // 0x0046, // DIK_9 |
||
119 | NO_KEY, // 47 |
||
120 | |||
121 | NO_KEY, // 48 |
||
122 | 0x2C, //. // 0x0049, // DIK_PERIOD /* . on main keyboard */ |
||
123 | 0xAC, // / // 0x004A, // DIK_SLASH /* / on main keyboard */ |
||
124 | 0x64, //L l // 0x004B, // DIK_L |
||
125 | |||
126 | 0xE4, //; ???? // 0x004C, // DIK_SEMICOLON |
||
127 | 0x98, //P p // 0x004D, // DIK_P |
||
128 | 0x30, //- _ // 0x004E, // DIK_MINUS |
||
129 | NO_KEY, // 4f |
||
130 | |||
131 | NO_KEY, // 50 |
||
132 | NO_KEY, // 51 |
||
133 | 0x14, //' ???? // 0x0052, // DIK_APOSTROPHE |
||
134 | NO_KEY, // 53 |
||
135 | |||
136 | 0x58, //[ { // 0x0054, // DIK_LBRACKET [ { |
||
137 | 0xB0, //= + // 0x0055, // DIK_EQUALS |
||
138 | NO_KEY, // 56 |
||
139 | NO_KEY, // 57 |
||
140 | |||
141 | 0x00, //???? // 0x0058, // DIK_CAPITAL |
||
142 | NO_KEY, // 0x0059, // DIK_RSHIFT |
||
143 | 0x38, //ENT?? // 0x005A, // DIK_RETURN MAIN ENTER !!! |
||
144 | 0xD8, //] } // 0x005B, // DIK_RBRACKET ] } !!! |
||
145 | |||
146 | NO_KEY, // 5c |
||
147 | 0xD4, // \ ??? // 0x005D, // DIK_BACKSLASH |
||
148 | NO_KEY, // 5e |
||
149 | NO_KEY, // 5f |
||
150 | |||
151 | NO_KEY, // 60 |
||
152 | NO_KEY, // 61 |
||
153 | NO_KEY, // 62 |
||
154 | NO_KEY, // 63 |
||
155 | |||
156 | NO_KEY, // 64 |
||
157 | NO_KEY, // 65 |
||
158 | 0x70, //bcksp?? // 0x0066, // DIK_BACK |
||
159 | NO_KEY, // 67 |
||
160 | |||
161 | NO_KEY, // 68 |
||
162 | NO_KEY, // 0x0069, // DIK_NUMPAD1 |
||
163 | NO_KEY, // 6a |
||
164 | NO_KEY, // 0x006B, // DIK_NUMPAD4 |
||
165 | |||
166 | NO_KEY, // 0x006C, // DIK_NUMPAD7 |
||
167 | NO_KEY, // 6d |
||
168 | NO_KEY, // 6e |
||
169 | NO_KEY, // 6f |
||
170 | |||
171 | NO_KEY, // 0x0070, // DIK_NUMPAD0 |
||
172 | NO_KEY, // 0x0071, // DIK_DECIMAL . on numeric keypad |
||
173 | NO_KEY, // 0x0072, // DIK_NUMPAD2 |
||
174 | NO_KEY, // 0x0073, // DIK_NUMPAD5 |
||
175 | |||
176 | NO_KEY, // 0x0074, // DIK_NUMPAD6 |
||
177 | NO_KEY, // 0x0075, // DIK_NUMPAD8 |
||
178 | NO_KEY, // 0x0076, // DIK_ESCAPE |
||
179 | NO_KEY, // 0x0077, // DIK_NUMLOCK |
||
180 | |||
181 | NO_KEY, // 0x0078, // DIK_F11 |
||
182 | 0x72, //+(num) // 0x0079, // DIK_ADD + on numeric keypad !!! |
||
183 | NO_KEY, // 0x007A, // DIK_NUMPAD3 |
||
184 | 0x52, //-(num) // 0x007B, // DIK_SUBTRACT - on numeric keypad |
||
185 | |||
186 | 0xEC, //*(num) // 0x007C, // DIK_MULTIPLY * on numeric keypad |
||
187 | NO_KEY, // 0x007D, // DIK_NUMPAD9 |
||
188 | NO_KEY, // 0x007E, // DIK_SCROLL /* Scroll Lock */ |
||
189 | NO_KEY, // 7f |
||
190 | |||
191 | NO_KEY, // 80 |
||
192 | NO_KEY, // 81 |
||
193 | NO_KEY, // 82 |
||
194 | NO_KEY // 0x0083, // DIK_F7 |
||
195 | |||
196 | |||
197 | // 0x0111, // DIK_RMENU /* right Alt */ |
||
198 | // 0x0112, // DIK_SYSRQ |
||
199 | // 0x0114, // DIK_RCONTROL |
||
200 | // 0x011F, // DIK_LWIN /* Left Windows key */ |
||
201 | // 0x0127, // DIK_RWIN /* Right Windows key */ |
||
202 | // 0x012F, // DIK_APPS /* AppMenu key */ |
||
203 | // 0x0137, // DIK_POWER /* System Power */ |
||
204 | // 0x013F, // DIK_SLEEP /* System Sleep */ |
||
205 | // 0x014A, // DIK_DIVIDE /* / on numeric keypad */ |
||
206 | // 0x015A, // DIK_NUMPADENTER /* Enter on numeric keypad */ |
||
207 | // 0x015E, // DIK_WAKE /* System Wake */ |
||
208 | // 0x0169, // DIK_END /* End on arrow keypad */ |
||
209 | // 0x016B, // DIK_LEFT /* LeftArrow on arrow keypad */ |
||
210 | // 0x016C, // DIK_HOME /* Home on arrow keypad */ |
||
211 | // 0x0170, // DIK_INSERT /* Insert on arrow keypad */ |
||
212 | // 0x0171, // DIK_DELETE /* Delete on arrow keypad */ |
||
213 | // 0x0172, // DIK_DOWN /* DownArrow on arrow keypad */ |
||
214 | // 0x0174, // DIK_RIGHT /* RightArrow on arrow keypad */ |
||
215 | // 0x0175, // DIK_UP /* UpArrow on arrow keypad */ |
||
216 | // 0x017A, // DIK_NEXT /* PgDn on arrow keypad */ |
||
217 | // 0x017D, // DIK_PRIOR /* PgUp on arrow keypad */ |
||
218 | |||
219 | }; |
||
220 | |||
221 | |||
222 | // 2DO |
||
223 | // |
||
224 | // - ����� ������ goto ***_hdd ������� inline ��������? |
||
225 | |||
226 | |||
227 | |||
228 | |||
229 | |||
230 | //============================================================================= |
||
231 | // MEMORY |
||
232 | //============================================================================= |
||
233 | |||
234 | //============================================================================= |
||
235 | // Cache FB - IN |
||
236 | //============================================================================= |
||
237 | inline int dc_in__Cache_FB( unsigned port) |
||
238 | { |
||
239 | // ��� ���������� ������ ������� |
||
240 | // � �� ��������� ��� ������ ��������� ��� �������� |
||
241 | // ������� ���� �������� �����! |
||
242 | |||
243 | // if ((port & 0x7F) == 0x7B) { // FB/7B |
||
244 | |||
245 | if ((port & 0x04) == 0x00) |
||
246 | { |
||
247 | // ���� ��������� � ������������ ���� |
||
248 | // �� ���� ��� ��� ��� �� ��� � ���1 |
||
249 | //--------------------------------------------------------------------- |
||
250 | // FB/7B //Alone Coder 0.36.6 (for MODPLAYi) |
||
251 | if (conf.mem_model == MM_ATM450) |
||
252 | { |
||
253 | comp.aFB = (unsigned char)port; |
||
254 | set_banks(); |
||
255 | } |
||
256 | //--------------------------------------------------------------------- |
||
257 | else if (conf.cache) |
||
258 | { |
||
259 | comp.flags &= ~CF_CACHEON; |
||
260 | if (port & 0x80) |
||
261 | comp.flags |= CF_CACHEON; |
||
262 | set_banks(); |
||
263 | }//--------------------------------------------------------------------- |
||
264 | return 0xFF; // ������� !!! ��� ��� �� �� ���� ������� � ������ ������������ ��������� �����!!! |
||
265 | //--------------------------------------------------------------------- |
||
266 | } |
||
267 | return -1; // ���������� ������ ����� |
||
268 | } |
||
269 | //============================================================================= |
||
270 | |||
271 | |||
272 | //============================================================================= |
||
273 | // VIDEO |
||
274 | //============================================================================= |
||
275 | |||
276 | |||
277 | |||
278 | |||
279 | //============================================================================= |
||
280 | // ULA Plus - Out |
||
281 | |||
282 | inline int dc_out__Ula_Plus( unsigned port, unsigned char val ) |
||
283 | { |
||
284 | if (conf.ula_plus) |
||
285 | { |
||
286 | //--------------------------------------------------------------------- |
||
287 | if (port == 0xBF3B) |
||
288 | { |
||
289 | comp.ula_plus_group = val >> 6; |
||
290 | if (comp.ula_plus_group == 0) |
||
291 | { |
||
292 | comp.ula_plus_pal_idx = val & 0x3F; |
||
293 | } |
||
294 | return 1; //out end |
||
295 | } |
||
296 | //--------------------------------------------------------------------- |
||
297 | if (port == 0xFF3B) |
||
298 | { |
||
299 | //----------------------------------------------------------------- |
||
300 | if (comp.ula_plus_group == 0) |
||
301 | { |
||
302 | comp.comp_pal[comp.ula_plus_pal_idx] = val; |
||
303 | temp.comp_pal_changed = 1; |
||
304 | return 1; //out end |
||
305 | } |
||
306 | //----------------------------------------------------------------- |
||
307 | if (comp.ula_plus_group == 1) |
||
308 | { |
||
309 | bool en = (val & 1) != 0; |
||
310 | if (comp.ula_plus_en != en) |
||
311 | { |
||
312 | comp.ula_plus_en = en; |
||
313 | if (comp.ula_plus_en) |
||
314 | { |
||
315 | temp.rflags |= RF_COMPPAL | RF_PALB; |
||
316 | } |
||
317 | else |
||
318 | { |
||
319 | temp.rflags &= unsigned(~(RF_COMPPAL | RF_PALB)); |
||
320 | } |
||
321 | video_color_tables(); |
||
322 | temp.comp_pal_changed = 1; |
||
323 | } |
||
324 | return 1; //out end |
||
325 | } |
||
326 | //----------------------------------------------------------------- |
||
327 | return 1; //out end |
||
328 | } |
||
329 | //--------------------------------------------------------------------- |
||
330 | } |
||
331 | return 0; // ���������� ������ ����� |
||
332 | } |
||
333 | //============================================================================= |
||
334 | // ULA Plus - In |
||
335 | |||
336 | inline int dc_in__Ula_Plus( unsigned port ) |
||
337 | { |
||
338 | if (conf.ula_plus) |
||
339 | { |
||
340 | if (port == 0xFF3B) |
||
341 | { |
||
342 | //----------------------------------------------------------------- |
||
343 | if (comp.ula_plus_group == 0) |
||
344 | { |
||
345 | return comp.comp_pal[comp.ula_plus_pal_idx]; |
||
346 | } |
||
347 | //----------------------------------------------------------------- |
||
348 | if (comp.ula_plus_group == 1) |
||
349 | { |
||
350 | u8 val = comp.ula_plus_en ? 1 : 0; |
||
351 | return val; |
||
352 | } |
||
353 | //----------------------------------------------------------------- |
||
354 | return 0xFF; |
||
355 | } |
||
356 | } |
||
357 | return -1; // ���������� ������ ����� |
||
358 | } |
||
359 | //============================================================================= |
||
360 | |||
361 | |||
362 | |||
363 | |||
364 | |||
365 | |||
366 | |||
367 | |||
368 | |||
369 | |||
370 | |||
371 | |||
372 | |||
373 | //============================================================================= |
||
374 | // SOUND |
||
375 | //============================================================================= |
||
376 | |||
377 | |||
378 | |||
379 | //============================================================================= |
||
380 | // NGS - Out |
||
381 | //============================================================================= |
||
382 | inline int dc_out__NGS( unsigned port, u8 p1, unsigned char val ) |
||
383 | { |
||
384 | //----------------------------------------------------------------------------- |
||
385 | #ifdef MOD_GS |
||
386 | if (conf.gs_type) //0 - nope |
||
387 | { //1 - Z80 |
||
388 | //2 - BASS |
||
389 | // 10111011 | BB |
||
390 | // 10110011 | B3 |
||
391 | // 00110011 | 33 |
||
392 | |||
393 | // mask 11111111 ? |
||
394 | if ((port & 0xFF) == 0x33) // 33 |
||
395 | { |
||
396 | out_gs(p1, val); |
||
397 | return 1; //out end |
||
398 | } |
||
399 | // mask 11110111 |
||
400 | if ((port & 0xF7) == 0xB3) // BB, B3 |
||
401 | { |
||
402 | out_gs(p1, val); |
||
403 | return 1; //out end |
||
404 | } |
||
405 | |||
406 | } |
||
407 | #endif |
||
408 | //----------------------------------------------------------------------------- |
||
409 | |||
410 | return 0; // ���������� ������ ����� |
||
411 | } |
||
412 | //============================================================================= |
||
413 | // NGS - In |
||
414 | //============================================================================= |
||
415 | inline int dc_in__NGS( unsigned port, u8 p1 ) |
||
416 | { |
||
417 | |||
418 | #ifdef MOD_GS |
||
419 | if (conf.gs_type) //0 - nope |
||
420 | { //1 - Z80 |
||
421 | //2 - BASS |
||
422 | // ngs |
||
423 | if ( (port & 0xF7) == 0xB3) |
||
424 | return in_gs(p1); |
||
425 | } |
||
426 | #endif |
||
427 | return -1; // ���������� ������ ����� |
||
428 | } |
||
429 | //============================================================================= |
||
430 | |||
431 | |||
432 | |||
433 | |||
434 | //============================================================================= |
||
435 | // AY, TS, TSFM, TSFM Pro, pseudo, quadro, POS ������� ����������� - OUT |
||
436 | //============================================================================= |
||
437 | inline int dc_out__AY_TS_TSFM_nedoSAA_etc( unsigned port, unsigned char val ) |
||
438 | { |
||
439 | |||
440 | // // #xD //������ ��� ��� ����� �������� �� ����� ������ |
||
441 | // if (!(port & 2)) |
||
442 | // { |
||
443 | // ������� �� n ����� ��������� ����� ay |
||
444 | if (conf.sound.ay_scheme >= AY_SCHEME_SINGLE) |
||
445 | { |
||
446 | if ((port & 0xC0FF) == 0xC0FD ) //�������������� ������� |
||
447 | { |
||
448 | //------------------------------------------------------------- |
||
449 | // A15=A14=1, FxFD - AY select register |
||
450 | // if ((conf.sound.ay_scheme == AY_SCHEME_CHRV) && ((val & 0xF8) == 0xF8)) //Alone Coder 0.39.0 |
||
451 | if ((conf.sound.ay_scheme == AY_SCHEME_CHRV) && ((val & 0xF0) == 0xF0)) //Alone Coder NEDOREPO |
||
452 | { |
||
453 | //--------------------------------------------------------- |
||
454 | if (conf.sound.ay_chip == (SNDCHIP::CHIP_YM2203)) |
||
455 | { |
||
456 | comp.tfmstat = val; //NEDOREPO |
||
457 | fmsoundon0 = val & 4; |
||
458 | tfmstatuson0 = val & 2; |
||
459 | } //Alone Coder 0.36.6 |
||
460 | //--------------------------------------------------------- |
||
461 | comp.active_ay = val & 1; |
||
462 | return 1; //out end //������ � NEDOREPO |
||
463 | }; |
||
464 | //------------------------------------------------------------- |
||
465 | if ((conf.sound.saa1099 == SAA_TFM_PRO) && ((comp.tfmstat & CF_TFM_SAA) == 0)) |
||
466 | { |
||
467 | Saa1099.WrCtl(val); |
||
468 | } |
||
469 | //------------------------------------------------------------- |
||
470 | else |
||
471 | { |
||
472 | unsigned n_ay = (conf.sound.ay_scheme == AY_SCHEME_QUADRO)? (port >> 12) & 1 : comp.active_ay; |
||
473 | ay[n_ay].select(val); |
||
474 | } |
||
475 | //------------------------------------------------------------- |
||
476 | return 1; //out end |
||
477 | } |
||
478 | } |
||
479 | //--------------------------------------------------------------------- |
||
480 | // if ((port & 0xC000)==0x8000 && conf.sound.ay_scheme >= AY_SCHEME_SINGLE) |
||
481 | //--------------------------------------------------------------------- |
||
482 | // TSFM PRO SAA PART? |
||
483 | |||
484 | if (conf.sound.ay_scheme) |
||
485 | { |
||
486 | if ((port & 0xC000) == 0x8000) //NEDOREPO |
||
487 | { |
||
488 | // BFFD - AY data register |
||
489 | if ( (conf.sound.saa1099 == SAA_TFM_PRO) && |
||
490 | ( (comp.tfmstat & CF_TFM_SAA) == 0) |
||
491 | ) |
||
492 | { |
||
493 | Saa1099.WrData(temp.sndblock ? 0 : cpu.t, val); |
||
494 | } |
||
495 | else |
||
496 | { |
||
497 | unsigned n_ay = (conf.sound.ay_scheme == AY_SCHEME_QUADRO) ? (port >> 12) & 1 : comp.active_ay; |
||
498 | ay[n_ay].write(temp.sndblock ? 0 : cpu.t, val); |
||
499 | |||
500 | if ( (conf.input.mouse == 2) && (ay[n_ay].get_activereg() == 14) ) |
||
501 | input.aymouse_wr(val); |
||
502 | } |
||
503 | return 1; //out end |
||
504 | } |
||
505 | } |
||
506 | |||
507 | |||
508 | // } |
||
509 | return 0; // OUT - ���������� ������ ����� |
||
510 | } |
||
511 | //============================================================================= |
||
512 | // AY, TS, TSFM, TSFM Pro, pseudo, quadro, POS ������� ����������� - IN |
||
513 | //============================================================================= |
||
514 | inline int dc_in__AY_TS_TSFM_etc( unsigned port) |
||
515 | { |
||
516 | if (conf.sound.ay_scheme >= AY_SCHEME_SINGLE) |
||
517 | { |
||
518 | if ((unsigned char)port == 0xFD) |
||
519 | { |
||
520 | //----------------------------------------------------------------- |
||
521 | if ( (conf.sound.ay_scheme == AY_SCHEME_CHRV) && |
||
522 | (conf.sound.ay_chip == (SNDCHIP::CHIP_YM2203)) && |
||
523 | (tfmstatuson0 == 0) |
||
524 | ) |
||
525 | { |
||
526 | return 0x7F; //always ready //Alone Coder 0.36.6 |
||
527 | } |
||
528 | //----------------------------------------------------------------- |
||
529 | if ((port & 0xC0FF) != 0xC0FD) |
||
530 | return 0xFF; |
||
531 | //----------------------------------------------------------------- |
||
532 | unsigned n_ay = (conf.sound.ay_scheme == AY_SCHEME_QUADRO) ? (port >> 12) & 1 : |
||
533 | comp.active_ay; |
||
534 | //----------------------------------------------------------------- |
||
535 | // AY Mouse |
||
536 | if (conf.input.mouse == 2) |
||
537 | { |
||
538 | if (ay[n_ay].get_activereg() == 14) |
||
539 | { |
||
540 | input.mouse_joy_led |= 1; |
||
541 | return input.aymouse_rd(); |
||
542 | } |
||
543 | } |
||
544 | //----------------------------------------------------------------- |
||
545 | // else FxFD - read selected AY register |
||
546 | return ay[n_ay].read(); |
||
547 | //----------------------------------------------------------------- |
||
548 | } |
||
549 | } |
||
550 | return -1; // IN - ���������� ������ ����� |
||
551 | } |
||
552 | //============================================================================= |
||
553 | |||
554 | |||
555 | |||
556 | |||
557 | |||
558 | |||
559 | |||
560 | |||
561 | //============================================================================= |
||
562 | // Fuller AY |
||
563 | |||
564 | inline int dc_out__Fuller_AY( u8 p1, unsigned char val ) |
||
565 | { |
||
566 | if (conf.sound.ay_scheme == AY_SCHEME_FULLER) |
||
567 | { |
||
568 | //--------------------------------------------------------------------- |
||
569 | // fuller AY register select |
||
570 | if (p1 == 0x3F) |
||
571 | { |
||
572 | ay[0].select(val); |
||
573 | return 1; //out end |
||
574 | } |
||
575 | //--------------------------------------------------------------------- |
||
576 | // fuller AY data |
||
577 | if (p1 == 0x5F) |
||
578 | { |
||
579 | ay[0].write( temp.sndblock ? 0 : cpu.t, val ); |
||
580 | return 1; //out end |
||
581 | } |
||
582 | //--------------------------------------------------------------------- |
||
583 | } |
||
584 | return 0; // ���������� ������ ����� |
||
585 | } |
||
586 | //============================================================================= |
||
587 | |||
588 | |||
589 | //============================================================================= |
||
590 | // POS AY |
||
591 | |||
592 | inline int dc_out__POS_AY( unsigned port, unsigned char val ) |
||
593 | { |
||
594 | if (conf.sound.ay_scheme == AY_SCHEME_POS) |
||
595 | { |
||
596 | if ( (unsigned char) port == 0x1F ) |
||
597 | { |
||
598 | comp.active_ay = val & 1; |
||
599 | return 1; //out end |
||
600 | } |
||
601 | } |
||
602 | return 0; // ���������� ������ ����� |
||
603 | } |
||
604 | //============================================================================= |
||
605 | |||
606 | |||
607 | //============================================================================= |
||
608 | // ZXI TSFM - OUT //[NS] |
||
609 | //============================================================================= |
||
610 | inline int dc_out__ZXI_TSFM_Mirror( unsigned port, unsigned char val ) |
||
611 | { |
||
612 | if (conf.ZXI_TSFM_Mirror != 0) |
||
613 | { |
||
614 | //--------------------------------------------------------------------- |
||
615 | if (port == 0x7F3B) //select reg ������ FFFB |
||
616 | { |
||
617 | if (((val & 0xF0) == 0xF0)) |
||
618 | { |
||
619 | if (conf.sound.ay_chip == (SNDCHIP::CHIP_YM2203)) |
||
620 | { |
||
621 | comp.tfmstat = val; |
||
622 | fmsoundon0 = val & 4; |
||
623 | tfmstatuson0 = val & 2; |
||
624 | } |
||
625 | comp.active_ay = val & 1; |
||
626 | } |
||
627 | else |
||
628 | { |
||
629 | unsigned n_ay = comp.active_ay; |
||
630 | ay[n_ay].select(val); |
||
631 | } |
||
632 | return 1; //out end |
||
633 | } |
||
634 | //--------------------------------------------------------------------- |
||
635 | if (port == 0x7E3B) //data reg ������ BFFB |
||
636 | { |
||
637 | unsigned n_ay = comp.active_ay; |
||
638 | ay[n_ay].write(temp.sndblock? 0 : cpu.t, val); |
||
639 | return 1; //out end |
||
640 | } |
||
641 | //--------------------------------------------------------------------- |
||
642 | } |
||
643 | return 0; // OUT - ���������� ������ ����� |
||
644 | } |
||
645 | //============================================================================= |
||
646 | // ZXI TSFM - IN //[NS] |
||
647 | //============================================================================= |
||
648 | inline int dc_in__ZXI_TSFM_Mirror( unsigned port ) |
||
649 | { |
||
650 | if (conf.ZXI_TSFM_Mirror) |
||
651 | { |
||
652 | if (port == 0x7F3B) |
||
653 | { |
||
654 | //----------------------------------------------------------------- |
||
655 | if ((conf.sound.ay_chip == (SNDCHIP::CHIP_YM2203)) && (tfmstatuson0 == 0)) |
||
656 | return 0x7f; //always ready |
||
657 | //----------------------------------------------------------------- |
||
658 | unsigned n_ay = comp.active_ay; |
||
659 | // else FxFD - read selected AY register |
||
660 | return ay[n_ay].read(); |
||
661 | //----------------------------------------------------------------- |
||
662 | } |
||
663 | } |
||
664 | return -1; // IN - ���������� ������ ����� |
||
665 | } |
||
666 | //============================================================================= |
||
667 | |||
668 | |||
669 | |||
670 | //============================================================================= |
||
671 | // ZXM saa1099 |
||
672 | |||
673 | inline int dc_out__ZXM_saa1099( unsigned port, unsigned char val ) |
||
674 | { |
||
675 | if (conf.sound.saa1099 == SAA_ZXM) //NEDOREPO |
||
676 | { |
||
677 | // saa1099 |
||
678 | if (((port & 0xFF) == 0xFF)) |
||
679 | { |
||
680 | if (port & 0x100) |
||
681 | Saa1099.WrCtl(val); |
||
682 | else |
||
683 | Saa1099.WrData( temp.sndblock ? 0 : cpu.t, val ); |
||
684 | return 1; //out endv |
||
685 | } |
||
686 | } |
||
687 | return 0; // ���������� ������ ����� |
||
688 | } |
||
689 | //============================================================================= |
||
690 | |||
691 | |||
692 | |||
693 | //============================================================================= |
||
694 | // Covox DD |
||
695 | |||
696 | inline int dc_out__Covox_DD( unsigned port, unsigned char val ) |
||
697 | { |
||
698 | // if (!(port & 2)) //������ ��� |
||
699 | // { |
||
700 | if (conf.sound.covoxDD) |
||
701 | { |
||
702 | // port DD - covox |
||
703 | if ((unsigned char)port == 0xDD) |
||
704 | { |
||
705 | // __debugbreak(); |
||
706 | // flush_dig_snd(); //���������� �� ������ |
||
707 | covDD_vol = val * conf.sound.covoxDD_vol / 0x100; |
||
708 | flush_dig_snd(); //[NS] FIX? |
||
709 | return 1; //out end |
||
710 | } |
||
711 | } |
||
712 | // } |
||
713 | return 0; // ���������� ������ ����� |
||
714 | } |
||
715 | //============================================================================= |
||
716 | |||
717 | |||
718 | //============================================================================= |
||
719 | // Covox FB |
||
720 | |||
721 | inline int dc_out__Covox_FB( unsigned port, unsigned char val ) |
||
722 | { |
||
723 | if (conf.sound.covoxFB) |
||
724 | { |
||
725 | // port FB - covox |
||
726 | if (!(port & 4)) |
||
727 | { |
||
728 | // __debugbreak(); |
||
729 | // flush_dig_snd(); //���������� �� ������ |
||
730 | covFB_vol = val * conf.sound.covoxFB_vol / 0x100; |
||
731 | flush_dig_snd(); //[NS] FIX |
||
732 | return 1; //out end |
||
733 | } |
||
734 | } |
||
735 | return 0; // ���������� ������ ����� |
||
736 | } |
||
737 | //============================================================================= |
||
738 | |||
739 | |||
740 | //============================================================================= |
||
741 | // Soundrive |
||
742 | |||
743 | inline int dc_out__Soundrive( unsigned port, unsigned char val ) |
||
744 | { |
||
745 | if (conf.sound.sd) |
||
746 | { |
||
747 | // soundrive |
||
748 | // ����� 1.1.1111 - AF ? |
||
749 | // |
||
750 | // ....1111 - 0F |
||
751 | // ...11111 - 1F |
||
752 | // .1..1111 - 4F |
||
753 | // .1.11111 - 5F |
||
754 | if ((port & 0xAF) == 0x0F) |
||
755 | { |
||
756 | // __debugbreak(); |
||
757 | // � ��� �������� ���������� ���� ���� �����? |
||
758 | if ( (unsigned char) port == 0x0F ) comp.p0F = val; |
||
759 | if ( (unsigned char) port == 0x1F ) comp.p1F = val; |
||
760 | if ( (unsigned char) port == 0x4F ) comp.p4F = val; |
||
761 | if ( (unsigned char) port == 0x5F ) comp.p5F = val; |
||
762 | // flush_dig_snd(); //���������� �� ������ !!! |
||
763 | sd_l = (conf.sound.sd_vol * (comp.p0F+comp.p1F)) >> 8; |
||
764 | sd_r = (conf.sound.sd_vol * (comp.p4F+comp.p5F)) >> 8; |
||
765 | flush_dig_snd(); //[NS] FIX |
||
766 | return 1; //out end |
||
767 | } |
||
768 | } |
||
769 | return 0; // ���������� ������ ����� |
||
770 | } |
||
771 | //============================================================================= |
||
772 | |||
773 | |||
774 | |||
775 | |||
776 | |||
777 | |||
778 | |||
779 | |||
780 | //============================================================================= |
||
781 | // IDE |
||
782 | //============================================================================= |
||
783 | |||
784 | |||
785 | //============================================================================= |
||
786 | // NEMO IDE - OUT |
||
787 | //============================================================================= |
||
788 | inline int dc_out__NEMO_IDE( unsigned port, unsigned char val ) |
||
789 | { |
||
790 | if (conf.ide_scheme == IDE_NEMO || conf.ide_scheme == IDE_NEMO_A8) |
||
791 | { |
||
792 | if (!(port & 6)) |
||
793 | { |
||
794 | unsigned hi_byte = (conf.ide_scheme == IDE_NEMO) ? (port & 1) : (port & 0x100); |
||
795 | //----------------------------------------------------------------- |
||
796 | if (hi_byte) |
||
797 | { |
||
798 | comp.ide_write = val; |
||
799 | return 1; //out end |
||
800 | } |
||
801 | //----------------------------------------------------------------- |
||
802 | if ((port & 0x18) == 0x08) |
||
803 | { |
||
804 | if ((port & 0xE0) == 0xC0) |
||
805 | hdd.write(8, val); |
||
806 | return 1; //out end |
||
807 | } // CS1=0,CS0=1,reg=6 |
||
808 | //----------------------------------------------------------------- |
||
809 | if ((port & 0x18) != 0x10) |
||
810 | return 1; //out end // invalid CS0,CS1 |
||
811 | //----------------------------------------------------------------- |
||
812 | //goto write_hdd_5; |
||
813 | { |
||
814 | //write_hdd_5: |
||
815 | port >>= 5; |
||
816 | //write_hdd: |
||
817 | port &= 7; |
||
818 | if (port) |
||
819 | hdd.write(port, val); |
||
820 | else |
||
821 | hdd.write_data(unsigned(val | (comp.ide_write << 8))); |
||
822 | return 1; //out end |
||
823 | } |
||
824 | } |
||
825 | } |
||
826 | return 0; // OUT - ���������� ������ ����� |
||
827 | } |
||
828 | //============================================================================= |
||
829 | // NEMO IDE - IN |
||
830 | //============================================================================= |
||
831 | inline int dc_in__NEMO_IDE( unsigned port ) //NO SHADOW |
||
832 | { |
||
833 | if (conf.ide_scheme == IDE_NEMO || conf.ide_scheme == IDE_NEMO_A8) |
||
834 | { |
||
835 | if (!(port & 6)) |
||
836 | { |
||
837 | //----------------------------------------------------------------- |
||
838 | unsigned hi_byte = (conf.ide_scheme == IDE_NEMO) ? (port & 1) : |
||
839 | (port & 0x100); |
||
840 | if (hi_byte) |
||
841 | return comp.ide_read; |
||
842 | //----------------------------------------------------------------- |
||
843 | comp.ide_read = 0xFF; |
||
844 | //----------------------------------------------------------------- |
||
845 | if ((port & 0x18) == 0x08) |
||
846 | return ((port & 0xE0) == 0xC0) ? hdd.read(8) : |
||
847 | 0xFF; // CS1=0,CS0=1,reg=6 |
||
848 | //----------------------------------------------------------------- |
||
849 | if ((port & 0x18) != 0x10) |
||
850 | return 0xFF; // invalid CS0,CS1 |
||
851 | //----------------------------------------------------------------- |
||
852 | //goto read_hdd_5; |
||
853 | //read_hdd_5: |
||
854 | { |
||
855 | port >>= 5; |
||
856 | //read_hdd: |
||
857 | port &= 7; |
||
858 | if (port) |
||
859 | return hdd.read(port); |
||
860 | unsigned v = hdd.read_data(); |
||
861 | comp.ide_read = (unsigned char)(v >> 8); |
||
862 | return (unsigned char) v; |
||
863 | } |
||
864 | } |
||
865 | } |
||
866 | return -1; // IN - ���������� ������ ����� |
||
867 | } |
||
868 | //============================================================================= |
||
869 | |||
870 | |||
871 | |||
872 | //============================================================================= |
||
873 | // DivIDE �� nemo ������ - OUT |
||
874 | //============================================================================= |
||
875 | inline int dc_out__NEMO_DivIDE( unsigned port, unsigned char val ) |
||
876 | { |
||
877 | if (conf.ide_scheme == IDE_NEMO_DIVIDE) |
||
878 | { |
||
879 | //------------------------------------------------------------------------- |
||
880 | // 00011110 mask? |
||
881 | if ((port & 0x1E) == 0x10) // rrr1000x |
||
882 | { |
||
883 | //----------------------------------------------------------------- |
||
884 | if ((port & 0xFF) == 0x11) |
||
885 | { |
||
886 | comp.ide_write = val; |
||
887 | comp.ide_hi_byte_w = 0; |
||
888 | comp.ide_hi_byte_w1 = 1; |
||
889 | return 1; //out end |
||
890 | } |
||
891 | //----------------------------------------------------------------- |
||
892 | if ((port & 0xFE) == 0x10) |
||
893 | { |
||
894 | comp.ide_hi_byte_w ^= 1; |
||
895 | |||
896 | // ���� ������ � ���� 0x11 (������� ���� ��� ��������) |
||
897 | if (comp.ide_hi_byte_w1) |
||
898 | { |
||
899 | comp.ide_hi_byte_w1 = 0; |
||
900 | } |
||
901 | // �� ���� ������ ??? |
||
902 | else |
||
903 | { |
||
904 | if (comp.ide_hi_byte_w) |
||
905 | { |
||
906 | // ���������� ������� ���� |
||
907 | comp.ide_write = val; |
||
908 | return 1; //out end |
||
909 | } |
||
910 | else |
||
911 | { |
||
912 | // ������ ������� � ������� ����� ������� (��� ����� ������� write_hdd_5) |
||
913 | u8 tmp = comp.ide_write; |
||
914 | comp.ide_write = val; |
||
915 | val = tmp; |
||
916 | } |
||
917 | } |
||
918 | } |
||
919 | //----------------------------------------------------------------- |
||
920 | else |
||
921 | { |
||
922 | comp.ide_hi_byte_w = 0; |
||
923 | } |
||
924 | //goto write_hdd_5; |
||
925 | { |
||
926 | //write_hdd_5: |
||
927 | port >>= 5; |
||
928 | //write_hdd: |
||
929 | port &= 7; |
||
930 | if (port) |
||
931 | hdd.write(port, val); |
||
932 | else |
||
933 | hdd.write_data(unsigned(val | (comp.ide_write << 8))); |
||
934 | return 1; //out end |
||
935 | } |
||
936 | } |
||
937 | //------------------------------------------------------------------------- |
||
938 | else if ((port & 0xFF) == 0xC8) |
||
939 | { |
||
940 | hdd.write(8, val); |
||
941 | return 1; //out end |
||
942 | } |
||
943 | //------------------------------------------------------------------------- |
||
944 | } |
||
945 | return 0; // OUT ���������� ������ ����� |
||
946 | } |
||
947 | //============================================================================= |
||
948 | // DivIDE �� nemo ������ - IN |
||
949 | //============================================================================= |
||
950 | inline int dc_in__NEMO_DivIDE( unsigned port ) |
||
951 | { |
||
952 | if (conf.ide_scheme == IDE_NEMO_DIVIDE) |
||
953 | { |
||
954 | //--------------------------------------------------------------------- |
||
955 | // divide �� nemo ������ |
||
956 | if (((port & 0x1E) == 0x10)) // rrr1000x |
||
957 | { |
||
958 | //----------------------------------------------------------------- |
||
959 | if ((port & 0xFF) == 0x11) |
||
960 | { |
||
961 | comp.ide_hi_byte_r = 0; |
||
962 | return comp.ide_read; |
||
963 | } |
||
964 | //----------------------------------------------------------------- |
||
965 | if ((port & 0xFE) == 0x10) |
||
966 | { |
||
967 | comp.ide_hi_byte_r ^= 1; |
||
968 | |||
969 | if (!comp.ide_hi_byte_r) |
||
970 | { |
||
971 | return comp.ide_read; |
||
972 | } |
||
973 | } |
||
974 | //----------------------------------------------------------------- |
||
975 | else |
||
976 | { |
||
977 | comp.ide_hi_byte_r = 0; |
||
978 | } |
||
979 | //----------------------------------------------------------------- |
||
980 | //goto read_hdd_5; |
||
981 | //read_hdd_5: |
||
982 | { |
||
983 | port >>= 5; |
||
984 | //read_hdd: |
||
985 | port &= 7; |
||
986 | if (port) |
||
987 | return hdd.read(port); |
||
988 | unsigned v = hdd.read_data(); |
||
989 | comp.ide_read = (unsigned char)(v >> 8); |
||
990 | return (unsigned char) v; |
||
991 | } |
||
992 | //----------------------------------------------------------------- |
||
993 | } |
||
994 | //--------------------------------------------------------------------- |
||
995 | else if ((port & 0xFF) == 0xC8) |
||
996 | { |
||
997 | return hdd.read(8); |
||
998 | } |
||
999 | //--------------------------------------------------------------------- |
||
1000 | } |
||
1001 | return -1; // IN ���������� ������ ����� |
||
1002 | } |
||
1003 | //============================================================================= |
||
1004 | |||
1005 | |||
1006 | |||
1007 | //============================================================================= |
||
1008 | // ATM IDE - OUT |
||
1009 | //============================================================================= |
||
1010 | inline int dc_out__ATM_IDE( unsigned port, unsigned char val ) |
||
1011 | { |
||
1012 | if (conf.ide_scheme == IDE_ATM && (port & 0x1F) == 0x0F) |
||
1013 | { |
||
1014 | if (port & 0x100) |
||
1015 | { |
||
1016 | comp.ide_write = val; |
||
1017 | return 1; //out end |
||
1018 | } |
||
1019 | //write_hdd_5: |
||
1020 | port >>= 5; |
||
1021 | //write_hdd: |
||
1022 | port &= 7; |
||
1023 | |||
1024 | if (port) |
||
1025 | hdd.write(port, val); |
||
1026 | else |
||
1027 | hdd.write_data(unsigned(val | (comp.ide_write << 8))); |
||
1028 | return 1; //out end |
||
1029 | } |
||
1030 | return 0; // OUT - ���������� ������ ����� |
||
1031 | } |
||
1032 | //============================================================================= |
||
1033 | // ATM IDE - IN |
||
1034 | //============================================================================= |
||
1035 | inline int dc_in__ATM_IDE( unsigned port ) |
||
1036 | { |
||
1037 | // if (comp.flags & CF_DOSPORTS) // ��� shadow �������� �� ������ |
||
1038 | // { |
||
1039 | if (conf.ide_scheme == IDE_ATM) |
||
1040 | { |
||
1041 | if ((port & 0x1F) == 0x0F) |
||
1042 | { |
||
1043 | //------------------------------------------------------------- |
||
1044 | if (port & 0x100) |
||
1045 | return comp.ide_read; |
||
1046 | //------------------------------------------------------------- |
||
1047 | //read_hdd_5: |
||
1048 | port >>= 5; |
||
1049 | //read_hdd: |
||
1050 | port &= 7; |
||
1051 | if (port) |
||
1052 | return hdd.read(port); |
||
1053 | //------------------------------------------------------------- |
||
1054 | unsigned v = hdd.read_data(); |
||
1055 | comp.ide_read = (unsigned char)(v >> 8); |
||
1056 | return (unsigned char) v; |
||
1057 | //------------------------------------------------------------- |
||
1058 | } |
||
1059 | } |
||
1060 | // } |
||
1061 | return -1; // IN - ���������� ������ ����� |
||
1062 | } |
||
1063 | //============================================================================= |
||
1064 | // ATM IDE - IN //NO SHADOW? |
||
1065 | //============================================================================= |
||
1066 | inline int dc_in__ATM_IDE_intrq( unsigned port ) |
||
1067 | { |
||
1068 | if ((conf.mem_model == MM_ATM710) || (conf.ide_scheme == IDE_ATM)) |
||
1069 | { |
||
1070 | if ((port & 0x8202) == (0x7FFD & 0x8202)) |
||
1071 | { |
||
1072 | //----------------------------------------------------------------- |
||
1073 | // ATM-2 IDE+DAC/ADC |
||
1074 | unsigned char irq = 0x40; |
||
1075 | //----------------------------------------------------------------- |
||
1076 | if (conf.ide_scheme == IDE_ATM) |
||
1077 | irq = (hdd.read_intrq() & 0x40); |
||
1078 | //----------------------------------------------------------------- |
||
1079 | // MSX DOS |
||
1080 | // in #7FFD (�������: %0nnnnn1n nnnnnn0n) |
||
1081 | // ��� 6.40 - ��� ������ � XT-����������, ��� (D7=0) - ������ ���������� ��� |
||
1082 | if (conf.atm620_force_xt_keyb_ready) |
||
1083 | irq |= 0x80; // [NS] |
||
1084 | //----------------------------------------------------------------- |
||
1085 | return irq + 0x3F; |
||
1086 | //----------------------------------------------------------------- |
||
1087 | } |
||
1088 | } |
||
1089 | return -1; // IN - ���������� ������ ����� |
||
1090 | } |
||
1091 | //============================================================================= |
||
1092 | |||
1093 | |||
1094 | |||
1095 | //============================================================================= |
||
1096 | // Profi IDE - OUT |
||
1097 | //============================================================================= |
||
1098 | inline int dc_out__Profi_IDE( unsigned port, u8 p1, unsigned char val ) |
||
1099 | { |
||
1100 | // �������� �� ����� ������ |
||
1101 | // ������ ���� ���� �������� � MM_PROFI � IDE_PROFI ������������ |
||
1102 | if (conf.ide_scheme == IDE_PROFI) |
||
1103 | { |
||
1104 | // ���� ��� ����� ������ � ��������� |
||
1105 | if ((comp.p7FFD & 0x10) && (comp.pDFFD & 0x20)) // modified ports |
||
1106 | { |
||
1107 | // IDE (AB=10101011, CB=11001011, EB=11101011) |
||
1108 | if ((p1 & 0x9F) == 0x8B ) |
||
1109 | { |
||
1110 | //------------------------------------------------------------- |
||
1111 | if (p1 & 0x40) |
||
1112 | { |
||
1113 | // cs1 |
||
1114 | if (!(p1 & 0x20)) |
||
1115 | { |
||
1116 | comp.ide_write = val; |
||
1117 | return 1; //out end |
||
1118 | } |
||
1119 | //--------------------------------------------------------- |
||
1120 | port >>= 8; |
||
1121 | //goto write_hdd; |
||
1122 | { |
||
1123 | //write_hdd: |
||
1124 | port &= 7; |
||
1125 | if (port) |
||
1126 | hdd.write(port, val); |
||
1127 | else |
||
1128 | hdd.write_data(unsigned(val | (comp.ide_write << 8))); |
||
1129 | return 1; //out end |
||
1130 | } |
||
1131 | } |
||
1132 | //------------------------------------------------------------- |
||
1133 | // cs3 |
||
1134 | if (p1 & 0x20) |
||
1135 | { |
||
1136 | if (((port>>8) & 7) == 6) |
||
1137 | hdd.write(8, val); |
||
1138 | return 1; //out end |
||
1139 | } |
||
1140 | //------------------------------------------------------------- |
||
1141 | } |
||
1142 | } |
||
1143 | } |
||
1144 | return 0; // OUT - ���������� ������ ����� |
||
1145 | } |
||
1146 | //============================================================================= |
||
1147 | // Profi IDE - IN |
||
1148 | //============================================================================= |
||
1149 | inline int dc_in__Profi_IDE( unsigned port, u8 p1 ) |
||
1150 | { |
||
1151 | if (conf.ide_scheme == IDE_PROFI) |
||
1152 | { |
||
1153 | // if (comp.flags & CF_DOSPORTS) //��� ������ |
||
1154 | // { |
||
1155 | // modified ports |
||
1156 | if ((comp.p7FFD & 0x10) && (comp.pDFFD & 0x20)) |
||
1157 | { |
||
1158 | // IDE |
||
1159 | if ((p1 & 0x9F) == 0x8B) //&& (conf.ide_scheme == IDE_PROFI) |
||
1160 | { |
||
1161 | if (p1 & 0x40) // cs1 |
||
1162 | { |
||
1163 | if (p1 & 0x20) |
||
1164 | return comp.ide_read; |
||
1165 | port >>= 8; |
||
1166 | //goto read_hdd; |
||
1167 | //read_hdd: |
||
1168 | { |
||
1169 | port &= 7; |
||
1170 | if (port) |
||
1171 | return hdd.read(port); |
||
1172 | //----------------------------------------------------- |
||
1173 | unsigned v = hdd.read_data(); |
||
1174 | comp.ide_read = (unsigned char)(v >> 8); |
||
1175 | return (unsigned char) v; |
||
1176 | //----------------------------------------------------- |
||
1177 | } |
||
1178 | } |
||
1179 | } |
||
1180 | } |
||
1181 | // } |
||
1182 | } |
||
1183 | return -1; // IN - ���������� ������ ����� |
||
1184 | } |
||
1185 | //============================================================================= |
||
1186 | |||
1187 | |||
1188 | |||
1189 | //============================================================================= |
||
1190 | // DivIDE - OUT |
||
1191 | //============================================================================= |
||
1192 | inline int dc_out__DivIDE( unsigned port, unsigned char val ) |
||
1193 | { |
||
1194 | if (conf.ide_scheme == IDE_DIVIDE) |
||
1195 | { |
||
1196 | //--------------------------------------------------------------------- |
||
1197 | if ((port & 0xA3) == 0xA3) //�������? |
||
1198 | { |
||
1199 | //----------------------------------------------------------------- |
||
1200 | if ((port & 0xFF) == 0xA3) |
||
1201 | { |
||
1202 | comp.ide_hi_byte_w ^= 1; |
||
1203 | if (comp.ide_hi_byte_w) |
||
1204 | { |
||
1205 | comp.ide_write = val; |
||
1206 | return 1; //out end |
||
1207 | } |
||
1208 | u8 tmp = comp.ide_write; |
||
1209 | comp.ide_write = val; |
||
1210 | val = tmp; |
||
1211 | } |
||
1212 | //----------------------------------------------------------------- |
||
1213 | else |
||
1214 | { |
||
1215 | comp.ide_hi_byte_w = 0; |
||
1216 | } |
||
1217 | //----------------------------------------------------------------- |
||
1218 | port >>= 2; |
||
1219 | //goto write_hdd; |
||
1220 | { |
||
1221 | //write_hdd: |
||
1222 | port &= 7; |
||
1223 | if (port) |
||
1224 | hdd.write(port, val); |
||
1225 | else |
||
1226 | hdd.write_data(unsigned(val | (comp.ide_write << 8))); |
||
1227 | return 1; //out end |
||
1228 | } |
||
1229 | } |
||
1230 | //--------------------------------------------------------------------- |
||
1231 | } |
||
1232 | return 0; // ���������� ������ ����� |
||
1233 | } |
||
1234 | //============================================================================= |
||
1235 | // DivIDE - IN |
||
1236 | //============================================================================= |
||
1237 | inline int dc_in__DivIDE( unsigned port) // NO SHADOW |
||
1238 | { |
||
1239 | if (conf.ide_scheme == IDE_DIVIDE) |
||
1240 | { |
||
1241 | if (((port & 0xA3) == 0xA3)) |
||
1242 | { |
||
1243 | //----------------------------------------------------------------- |
||
1244 | if((port & 0xFF) == 0xA3) |
||
1245 | { |
||
1246 | comp.ide_hi_byte_r ^= 1; |
||
1247 | if (!comp.ide_hi_byte_r) |
||
1248 | { |
||
1249 | return comp.ide_read; |
||
1250 | } |
||
1251 | } |
||
1252 | //----------------------------------------------------------------- |
||
1253 | else |
||
1254 | { |
||
1255 | comp.ide_hi_byte_r = 0; |
||
1256 | } |
||
1257 | //----------------------------------------------------------------- |
||
1258 | port >>= 2; |
||
1259 | //goto read_hdd; |
||
1260 | //read_hdd: |
||
1261 | { |
||
1262 | //------------------------------------------------------------- |
||
1263 | port &= 7; |
||
1264 | if (port) |
||
1265 | return hdd.read(port); |
||
1266 | //------------------------------------------------------------- |
||
1267 | unsigned v = hdd.read_data(); |
||
1268 | comp.ide_read = (unsigned char)(v >> 8); |
||
1269 | return (unsigned char) v; |
||
1270 | //------------------------------------------------------------- |
||
1271 | } |
||
1272 | } |
||
1273 | } |
||
1274 | return -1; // IN - ���������� ������ ����� |
||
1275 | } |
||
1276 | //============================================================================= |
||
1277 | |||
1278 | |||
1279 | |||
1280 | |||
1281 | //============================================================================= |
||
1282 | // SMUC - OUT (+ SMUC IDE ����� �� ���������� ��� ����) |
||
1283 | //============================================================================= |
||
1284 | inline int dc_out__SMUC( unsigned port, unsigned char val ) |
||
1285 | { |
||
1286 | // if (comp.flags & CF_DOSPORTS) //��� ������ |
||
1287 | // { |
||
1288 | if ( (port & 0x18A3) == (0xFFFE & 0x18A3) ) //�������? �_� |
||
1289 | { |
||
1290 | //--------------------------------------------------------------------- |
||
1291 | // SMUC |
||
1292 | if (conf.smuc) |
||
1293 | { |
||
1294 | //----------------------------------------------------------------- |
||
1295 | if ( (port & 0xA044) == (0xDFBA & 0xA044) ) |
||
1296 | { |
||
1297 | // clock |
||
1298 | if (comp.pFFBA & 0x80) |
||
1299 | cmos_write(val); |
||
1300 | else |
||
1301 | comp.cmos_addr = val; |
||
1302 | return 1; //out end |
||
1303 | } |
||
1304 | //----------------------------------------------------------------- |
||
1305 | // SMUC system port |
||
1306 | if ( (port & 0xA044) == (0xFFBA & 0xA044) ) |
||
1307 | { |
||
1308 | if ( (val & 1) && (conf.ide_scheme == IDE_SMUC) ) |
||
1309 | hdd.reset(); |
||
1310 | comp.nvram.write(val); |
||
1311 | comp.pFFBA = val; |
||
1312 | return 1; //out end |
||
1313 | } |
||
1314 | //----------------------------------------------------------------- |
||
1315 | if ( (port & 0xA044) == (0x7FBA & 0xA044) ) |
||
1316 | { |
||
1317 | comp.p7FBA = val; |
||
1318 | return 1; //out end |
||
1319 | } |
||
1320 | //----------------------------------------------------------------- |
||
1321 | } |
||
1322 | //--------------------------------------------------------------------- |
||
1323 | // SMUC IDE |
||
1324 | if ( ((port & 0x8044) == (0xFFBE & 0x8044)) && (conf.ide_scheme == IDE_SMUC) ) |
||
1325 | { |
||
1326 | // FFBE, FEBE |
||
1327 | if (comp.pFFBA & 0x80) |
||
1328 | { |
||
1329 | if(!(port & 0x100)) |
||
1330 | hdd.write(8, val); // control register |
||
1331 | return 1; //out end |
||
1332 | } |
||
1333 | //----------------------------------------------------------------- |
||
1334 | if (!(port & 0x2000)) |
||
1335 | { |
||
1336 | comp.ide_write = val; |
||
1337 | return 1; //out end |
||
1338 | } |
||
1339 | port >>= 8; |
||
1340 | //goto write_hdd; |
||
1341 | { |
||
1342 | //write_hdd: |
||
1343 | port &= 7; |
||
1344 | if (port) |
||
1345 | hdd.write(port, val); |
||
1346 | else |
||
1347 | hdd.write_data(unsigned(val | (comp.ide_write << 8))); |
||
1348 | return 1; //out end |
||
1349 | } |
||
1350 | } |
||
1351 | //--------------------------------------------------------------------- |
||
1352 | } |
||
1353 | // } |
||
1354 | return 0; // ���������� ������ ����� |
||
1355 | } |
||
1356 | //============================================================================= |
||
1357 | // SMUC - IN (+ SMUC IDE ����� �� ���������� ��� ����) |
||
1358 | //============================================================================= |
||
1359 | inline int dc_in__SMUC( unsigned port ) |
||
1360 | { |
||
1361 | // if (comp.flags & CF_DOSPORTS) |
||
1362 | // { |
||
1363 | if ((port & 0x18A3) == (0xFFFE & 0x18A3)) |
||
1364 | { |
||
1365 | //----------------------------------------------------------------- |
||
1366 | // SMUC |
||
1367 | if (conf.smuc) |
||
1368 | { |
||
1369 | if ((port & 0xA044) == (0xDFBA & 0xA044)) return cmos_read(); // clock |
||
1370 | if ((port & 0xA044) == (0xFFBA & 0xA044)) return comp.nvram.out; // SMUC system port |
||
1371 | if ((port & 0xA044) == (0x7FBA & 0xA044)) return comp.p7FBA | 0x3F; |
||
1372 | if ((port & 0xA044) == (0x5FBA & 0xA044)) return 0x3F; |
||
1373 | if ((port & 0xA044) == (0x5FBE & 0xA044)) return 0x57; |
||
1374 | if ((port & 0xA044) == (0x7FBE & 0xA044)) return 0x57; |
||
1375 | } |
||
1376 | //----------------------------------------------------------------- |
||
1377 | if (conf.ide_scheme == IDE_SMUC) |
||
1378 | { |
||
1379 | if ((port & 0x8044) == (0xFFBE & 0x8044)) |
||
1380 | { // FFBE, FEBE |
||
1381 | //--------------------------------------------------------- |
||
1382 | if (comp.pFFBA & 0x80) |
||
1383 | { |
||
1384 | if (!(port & 0x100)) |
||
1385 | return hdd.read(8); // alternate status |
||
1386 | return 0xFF; // obsolete register |
||
1387 | } |
||
1388 | //--------------------------------------------------------- |
||
1389 | if (!(port & 0x2000)) |
||
1390 | return comp.ide_read; |
||
1391 | //--------------------------------------------------------- |
||
1392 | port >>= 8; |
||
1393 | //goto read_hdd; |
||
1394 | //read_hdd: |
||
1395 | { |
||
1396 | port &= 7; |
||
1397 | if (port) |
||
1398 | return hdd.read(port); |
||
1399 | //----------------------------------------------------- |
||
1400 | unsigned v = hdd.read_data(); |
||
1401 | comp.ide_read = (unsigned char)(v >> 8); |
||
1402 | return (unsigned char) v; |
||
1403 | //----------------------------------------------------- |
||
1404 | } |
||
1405 | //--------------------------------------------------------- |
||
1406 | } |
||
1407 | } |
||
1408 | //----------------------------------------------------------------- |
||
1409 | } |
||
1410 | // } |
||
1411 | return -1; // IN - ���������� ������ ����� |
||
1412 | } |
||
1413 | //============================================================================= |
||
1414 | |||
1415 | |||
1416 | |||
1417 | |||
1418 | |||
1419 | |||
1420 | |||
1421 | //============================================================================= |
||
1422 | // SD |
||
1423 | //============================================================================= |
||
1424 | |||
1425 | //============================================================================= |
||
1426 | // Z-Controller - Out |
||
1427 | //============================================================================= |
||
1428 | inline int dc_out__zc( unsigned port, unsigned char val ) |
||
1429 | { |
||
1430 | if (conf.zc) |
||
1431 | { |
||
1432 | //------------------------------------------------------------------------- |
||
1433 | if ((port & 0xFF) == 0x57) |
||
1434 | { |
||
1435 | //port 0x57 |
||
1436 | Zc.Wr(port, val); |
||
1437 | return 1; //out end |
||
1438 | } |
||
1439 | //------------------------------------------------------------------------- |
||
1440 | // if ((port & 0xFF) == 0x77) // [NS] |
||
1441 | // { // ��� ������ ���� ������� ���? |
||
1442 | // //port 0x77 // �� ���������� ����� ����� ��� |
||
1443 | // return 1; //out end // � ���������� ������ � ������ ����� � IRL ���� |
||
1444 | // } // �� �� ������� ��� �����������? � ���2 |
||
1445 | // �������� � ���� �� ������������ ZC !!!! |
||
1446 | //------------------------------------------------------------------------- |
||
1447 | } |
||
1448 | return 0; // ���������� ������ ����� |
||
1449 | } |
||
1450 | //============================================================================= |
||
1451 | // Z-Controller in ATM3 (ZX-Evo) - Out |
||
1452 | //============================================================================= |
||
1453 | inline int dc_out__zc__ATM3( unsigned port, unsigned char val ) |
||
1454 | { |
||
1455 | if (conf.zc) |
||
1456 | { |
||
1457 | //------------------------------------------------------------------------- |
||
1458 | // Shadow mode |
||
1459 | if (comp.flags & CF_DOSPORTS) |
||
1460 | { |
||
1461 | //port 0x57 - 0x77 mode // � ZX-Evo ��� (a15 = 1) + shadow mode $57 ��������� ���� ����� $77 |
||
1462 | if ((port & 0x80FF) == 0x8057) // (�� $77 ����� � shadow mode ATM-� !!!1) |
||
1463 | { // ������� �� �����������? |
||
1464 | return 1; //out end |
||
1465 | } |
||
1466 | //port 0x57 - 0x57 mode |
||
1467 | if ((port & 0x80FF) == 0x0057) |
||
1468 | { |
||
1469 | Zc.Wr(port, val); |
||
1470 | return 1; //out end |
||
1471 | } |
||
1472 | } |
||
1473 | //------------------------------------------------------------------------- |
||
1474 | // NO shadow mode |
||
1475 | else |
||
1476 | { |
||
1477 | //--------------------------------------------------------------------- |
||
1478 | // ������� ����� � SD-����� �� SPI |
||
1479 | if ((port & 0xFF) == 0x57) |
||
1480 | { |
||
1481 | //port 0x57 |
||
1482 | Zc.Wr(port, val); |
||
1483 | return 1; //out end |
||
1484 | } |
||
1485 | //--------------------------------------------------------------------- |
||
1486 | // ���������� �������� CS // [NS] ��� ������ ���� ������� ���? |
||
1487 | if ((port & 0xFF) == 0x77) // �� ���������� ����� ����� ��� |
||
1488 | { // � ���������� ������ � ������ ����� ���� ����� �� ������� |
||
1489 | //port 0x77 // d7 = 0 - ��� ������������� |
||
1490 | return 1; //out end // d6 = 0 - ��� ������������� |
||
1491 | // d5 = 0 - ��� ������������� |
||
1492 | // d4 = 0 - ��� ������������� |
||
1493 | // d3 = 0 - ��� ������������� |
||
1494 | // d2 = 0 - ��� ������������� |
||
1495 | // d1 = X - ������ CS (1 - ����� ������) |
||
1496 | // (0 - ��� ������ SD �����) |
||
1497 | // d0 = 1 - ��� ������������� |
||
1498 | } // |
||
1499 | //--------------------------------------------------------------------- |
||
1500 | } |
||
1501 | //------------------------------------------------------------------------- |
||
1502 | } |
||
1503 | return 0; // ���������� ������ ����� |
||
1504 | } |
||
1505 | //----------------------------------------------------------------------------- |
||
1506 | |||
1507 | // zxevo_base_configuration.pdf |
||
1508 | // ������: � ����� ������ �� SPI, ������������ ������� ���! ������� ����� #xx57, |
||
1509 | // ���������� ������������ ������� ����� � SD-����� � ���� ����� �� ��. |
||
1510 | // ���� ���� ������ ����������� ������� - ���������� ���� ��� ��, ��� ������� � ���� ���� |
||
1511 | // ���� ���� ������ ����������� ������� ����� - ���������� ���� #FF !!! |
||
1512 | // �������� ���� ������������ �� ���������� ������ � �������� ��� ������������ ������ �� ����� �� �����. |
||
1513 | // ������ ������ ����� ���������� ���� ������ � �. �. , |
||
1514 | // ����������� ������/������ ���� #xx57 ��������� INIR � OTIR. |
||
1515 | |||
1516 | //============================================================================= |
||
1517 | // Z-Controller - In |
||
1518 | //============================================================================= |
||
1519 | inline int dc_in__zc( unsigned port ) |
||
1520 | { |
||
1521 | if (conf.zc) |
||
1522 | { |
||
1523 | // z-controller |
||
1524 | // if ( (port & 0xDF) == 0x57 ) //0.39.0 |
||
1525 | if ( (port & 0xFF) == 0x57 ) //NEDOREPO ����� ������������ ������� �����? ��� � ���������� |
||
1526 | { |
||
1527 | // no shadow-mode ZXEVO patch here since 0x57 port in read mode is the same |
||
1528 | // as in noshadow-mode, i.e. no A15 is used to decode port. |
||
1529 | return Zc.Rd(port); |
||
1530 | } |
||
1531 | } |
||
1532 | return -1; // ���������� ������ ����� |
||
1533 | } |
||
1534 | //============================================================================= |
||
1535 | |||
1536 | |||
1537 | |||
1538 | |||
1539 | |||
1540 | |||
1541 | //============================================================================= |
||
1542 | // NET |
||
1543 | //============================================================================= |
||
1544 | |||
1545 | //============================================================================= |
||
1546 | // Wiznet - OUT |
||
1547 | //============================================================================= |
||
1548 | inline int dc_out__wiznet( unsigned port, unsigned char val ) |
||
1549 | { |
||
1550 | if (conf.wiznet) |
||
1551 | { |
||
1552 | if ((port & 0xFF) == 0xAB) //������� ������������ |
||
1553 | { |
||
1554 | pXXAB_Write(port,val); |
||
1555 | return 1; //out end |
||
1556 | } |
||
1557 | } |
||
1558 | return 0; // ���������� ������ ����� |
||
1559 | } |
||
1560 | //============================================================================= |
||
1561 | // Wiznet - IN |
||
1562 | //============================================================================= |
||
1563 | inline int dc_in__wiznet( unsigned port ) |
||
1564 | { |
||
1565 | if (conf.wiznet) |
||
1566 | { |
||
1567 | if ((port & 0xFF) == 0xAB) |
||
1568 | { |
||
1569 | return pXXAB_Read(port); |
||
1570 | } |
||
1571 | } |
||
1572 | return -1; // ���������� ������ ����� |
||
1573 | } |
||
1574 | //============================================================================= |
||
1575 | |||
1576 | |||
1577 | |||
1578 | //============================================================================= |
||
1579 | // ����� �� Modem - OUT |
||
1580 | //============================================================================= |
||
1581 | inline int dc_out__Modem_HZ( unsigned port, unsigned char val ) |
||
1582 | { |
||
1583 | if (modem.open_port) |
||
1584 | { |
||
1585 | if ((port & 0xF8FF) == 0xF8EF) |
||
1586 | modem.write((port >> 8) & 7, val); |
||
1587 | return 1; //out end |
||
1588 | } |
||
1589 | return 0; // OUT - ���������� ������ ����� |
||
1590 | } |
||
1591 | //============================================================================= |
||
1592 | // ����� �� Modem - IN |
||
1593 | //============================================================================= |
||
1594 | inline int dc_in__Modem_HZ( unsigned port) |
||
1595 | { |
||
1596 | if (modem.open_port) |
||
1597 | { |
||
1598 | if ((port & 0xF8FF) == 0xF8EF) |
||
1599 | return modem.read((port >> 8) & 7); |
||
1600 | } |
||
1601 | return -1; // IN - ���������� ������ ����� |
||
1602 | } |
||
1603 | //============================================================================= |
||
1604 | |||
1605 | |||
1606 | //============================================================================= |
||
1607 | // INPUT |
||
1608 | //============================================================================= |
||
1609 | |||
1610 | |||
1611 | //============================================================================= |
||
1612 | // Kemston Mouse - IN |
||
1613 | //============================================================================= |
||
1614 | inline int dc_in__Kempston_Mouse( unsigned port ) |
||
1615 | { |
||
1616 | if (conf.input.mouse == 1) //Kempston Mouse |
||
1617 | { |
||
1618 | if (!(port & 0x20)) //NEDOREPO |
||
1619 | { |
||
1620 | // kempstons |
||
1621 | port = (port & 0xFFFF) | 0xFA00; // A13,A15 not used in decoding |
||
1622 | // mouse |
||
1623 | if ((port == 0xFADF || port == 0xFBDF || port == 0xFFDF)) |
||
1624 | { |
||
1625 | input.mouse_joy_led |= 1; |
||
1626 | //----------------------------------------------------- |
||
1627 | if (port == 0xFBDF) |
||
1628 | return input.kempston_mx(); |
||
1629 | //----------------------------------------------------- |
||
1630 | if (port == 0xFFDF) |
||
1631 | return input.kempston_my(); |
||
1632 | //----------------------------------------------------- |
||
1633 | return input.mbuttons; |
||
1634 | } |
||
1635 | } |
||
1636 | } |
||
1637 | return -1; // IN - ���������� ������ ����� |
||
1638 | } |
||
1639 | //============================================================================= |
||
1640 | |||
1641 | |||
1642 | //============================================================================= |
||
1643 | // Kemston Joystick - IN |
||
1644 | //============================================================================= |
||
1645 | inline int dc_in__Kempston_Joystick( unsigned port ) |
||
1646 | { |
||
1647 | if (!(port & 0x20)) //NEDOREPO |
||
1648 | { |
||
1649 | //------------------------------------------------------------- |
||
1650 | input.mouse_joy_led |= 2; |
||
1651 | unsigned char res = (conf.input.kjoy) ? input.kjoy : //kempston on |
||
1652 | 0xFF; //kempston off |
||
1653 | return res; |
||
1654 | //------------------------------------------------------------- |
||
1655 | } |
||
1656 | return -1; // IN - ���������� ������ ����� |
||
1657 | } |
||
1658 | //============================================================================= |
||
1659 | // Kemston Joystick Scorp - IN |
||
1660 | //============================================================================= |
||
1661 | inline int dc_in__Kempston_Joystick_Scorp( unsigned port ) |
||
1662 | { |
||
1663 | if (!(port & 0x20)) //NEDOREPO |
||
1664 | { |
||
1665 | //------------------------------------------------------------- |
||
1666 | input.mouse_joy_led |= 2; |
||
1667 | unsigned char res = (conf.input.kjoy) ? input.kjoy : |
||
1668 | 0xFF; |
||
1669 | // if (conf.mem_model == MM_SCORP || conf.mem_model == MM_PROFSCORP) |
||
1670 | // � ������ ������� ���� ��������� ������� ��� ������� ����� ��� ������ ��-��� |
||
1671 | res = (res & 0x1F) | (comp.wd.in(0xFF) & 0xE0); |
||
1672 | return res; |
||
1673 | //------------------------------------------------------------- |
||
1674 | } |
||
1675 | return -1; // IN - ���������� ������ ����� |
||
1676 | } |
||
1677 | //============================================================================= |
||
1678 | |||
1679 | |||
1680 | //============================================================================= |
||
1681 | // Fuller Joystick - IN |
||
1682 | //============================================================================= |
||
1683 | inline int dc_in__Fuller_Joystick( u8 p1 ) |
||
1684 | { |
||
1685 | if (conf.input.fjoy) |
||
1686 | { |
||
1687 | // fuller joystick |
||
1688 | if (p1 == 0x7F) |
||
1689 | { |
||
1690 | input.mouse_joy_led |= 2; |
||
1691 | return input.fjoy; |
||
1692 | } |
||
1693 | } |
||
1694 | return -1; // IN - ���������� ������ ����� |
||
1695 | } |
||
1696 | //============================================================================= |
||
1697 | |||
1698 | //============================================================================= |
||
1699 | // ATM 6.20 fake XT Keyboard - IN |
||
1700 | //============================================================================= |
||
1701 | inline int dc_in__atm620_xt_keyb( unsigned port ) // [NS] |
||
1702 | { |
||
1703 | // ����� ��� � ���620 ��� ������ ��� XT ���� ����� |
||
1704 | // ���� ������ ����������/���������� ����� |
||
1705 | // � ����� ��� �������� zx ����� � ����������� �� NMI |
||
1706 | // �� � ��� ���� XT ���� �����������! |
||
1707 | |||
1708 | // ��� �� ������ ����� �� ����� ��� � ps/2 ����� |
||
1709 | // �� ��� �����... |
||
1710 | // ...���� � ������ ����������� ������ ����� ���������� |
||
1711 | // � ����� ���������� ����� �� ����... |
||
1712 | // ���� ��� �� ��� �������� ����� |
||
1713 | // ��� ��� ���� ����� � ������ �� �������? |
||
1714 | |||
1715 | |||
1716 | |||
1717 | // //����������� (��� �� ��������) |
||
1718 | // return ( |
||
1719 | // ((atm620_xt_keyb_code & 0b00000001) << 7) | //X... .... |
||
1720 | // ((atm620_xt_keyb_code & 0b00000010) << 5) | //.X.. .... |
||
1721 | // ((atm620_xt_keyb_code & 0b00000100) << 3) | //..X. .... |
||
1722 | // ((atm620_xt_keyb_code & 0b00001000) << 1) | //...X .... |
||
1723 | // ((atm620_xt_keyb_code & 0b00010000) >> 1) | //.... X... |
||
1724 | // ((atm620_xt_keyb_code & 0b00100000) >> 3) | //.... .X.. |
||
1725 | // ((atm620_xt_keyb_code & 0b01000000) >> 5) | //.... ..X. |
||
1726 | // ((atm620_xt_keyb_code & 0b10000000) >> 7) //.... ...X |
||
1727 | // ); |
||
1728 | |||
1729 | if (conf.atm620_xt_keyb) |
||
1730 | { |
||
1731 | //--------------------------------------------------------------------- |
||
1732 | if (port == 0x7DFD) |
||
1733 | { |
||
1734 | //int return_val = input.atm620_xt_keyb_buffer.Pop(); |
||
1735 | //if (return_val) printf("%02X\n",return_val); |
||
1736 | //return return_val; |
||
1737 | return input.atm620_xt_keyb_buffer.Pop(); |
||
1738 | } |
||
1739 | //--------------------------------------------------------------------- |
||
1740 | } |
||
1741 | return -1; // IN - ���������� ������ ����� |
||
1742 | } |
||
1743 | //============================================================================= |
||
1744 | |||
1745 | |||
1746 | |||
1747 | //============================================================================= |
||
1748 | // MISC |
||
1749 | //============================================================================= |
||
1750 | |||
1751 | |||
1752 | //============================================================================= |
||
1753 | // Port FF - IN |
||
1754 | //============================================================================= |
||
1755 | inline int dc_in__Port_FF( unsigned port ) |
||
1756 | { |
||
1757 | if (conf.portff) |
||
1758 | { |
||
1759 | if (((port & 0xFF) == 0xFF)) |
||
1760 | { |
||
1761 | update_screen(); |
||
1762 | //----------------------------------------------------------------- |
||
1763 | if (vmode != 2) |
||
1764 | return 0xFF; // ray is not in paper |
||
1765 | //----------------------------------------------------------------- |
||
1766 | unsigned ula_t = (cpu.t+temp.border_add) & temp.border_and; |
||
1767 | return temp.base[vcurr->atr_offs + (ula_t - vcurr[-1].next_t) / 4]; |
||
1768 | } |
||
1769 | } |
||
1770 | return -1; // IN - ���������� ������ ����� |
||
1771 | } |
||
1772 | //============================================================================= |
||
1773 | |||
1774 | |||
1775 | |||
1776 | |||
1777 | |||
1778 | |||
1779 | |||
1780 | |||
1781 | |||
1782 | |||
1783 | |||
1784 | |||
1785 | |||
1786 | |||
1787 | |||
1788 | // ��������� |
||
1789 | // |
||
1790 | // //������ � emul.h |
||
1791 | // switch (conf.mem_model) |
||
1792 | // { |
||
1793 | // //--------------------------------------------------------------------- |
||
1794 | // case MM_PENTAGON: |
||
1795 | // break; |
||
1796 | // //--------------------------------------------------------------------- |
||
1797 | // case MM_SCORP: |
||
1798 | // break; |
||
1799 | // //--------------------------------------------------------------------- |
||
1800 | // case MM_PROFSCORP: |
||
1801 | // break; |
||
1802 | // //--------------------------------------------------------------------- |
||
1803 | // case MM_PROFI: |
||
1804 | // break; |
||
1805 | // //--------------------------------------------------------------------- |
||
1806 | // case MM_ATM450: |
||
1807 | // break; |
||
1808 | // //--------------------------------------------------------------------- |
||
1809 | // case MM_ATM710: |
||
1810 | // break; |
||
1811 | // //--------------------------------------------------------------------- |
||
1812 | // case MM_ATM3: |
||
1813 | // break; |
||
1814 | // //--------------------------------------------------------------------- |
||
1815 | // case MM_KAY: |
||
1816 | // break; |
||
1817 | // //----------------------------------------------------------------- |
||
1818 | // case MM_PLUS3: |
||
1819 | // break; |
||
1820 | // //----------------------------------------------------------------- |
||
1821 | // case MM_QUORUM: |
||
1822 | // break; |
||
1823 | // //--------------------------------------------------------------------- |
||
1824 | // } |
||
1825 | |||
1826 | |||
1827 | |||
1828 | |||
1829 | |||
1830 | |||
1831 | |||
1832 | |||
1833 | |||
1834 | |||
1835 | |||
1836 | |||
1837 | |||
1838 | |||
1839 | |||
1840 | |||
1841 | |||
1842 | |||
1843 | |||
1844 | |||
1845 | |||
1846 | |||
1847 | //============================================================================= |
||
1848 | void out(unsigned port, unsigned char val) |
||
1849 | { |
||
1850 | port &= 0xFFFF; |
||
1851 | u8 p1 = (port & 0xFF); |
||
1852 | brk_port_out = port; |
||
1853 | brk_port_val = val; |
||
1854 | |||
1855 | |||
1856 | //----------------------------------------------------------------------------- |
||
1857 | // � ������ ���������� ������ �� ������ 8��� |
||
1858 | //----------------------------------------------------------------------------- |
||
1859 | |||
1860 | |||
1861 | // dc_* ������ ��� inline ������� |
||
1862 | // ���� ���������� ������������ � ���������� �� Port/P1 |
||
1863 | |||
1864 | |||
1865 | // ���������� ���������� ������������� �� ���� ������� ��� ��������� ��� ������ ����� |
||
1866 | // �� �� ��� ������ ������� ����� ��� � ������ ������������������ ����������� ������ |
||
1867 | // � ��� ����� if *** && (!ATM3 == �) || (ATM2 == 0) �� ����� ���� ���������� ������� ��� �������� |
||
1868 | // �� ������ ���� ��� ������... |
||
1869 | |||
1870 | //----------------------------------------------------------------------------- |
||
1871 | // NO SHADOW + SHADOW |
||
1872 | //----------------------------------------------------------------------------- |
||
1873 | if ( dc_out__ZXI_TSFM_Mirror( port, val )) return; // ZXI TSFM |
||
1874 | //----------------------------------------------------------------------------- |
||
1875 | if ( dc_out__Ula_Plus( port, val )) return; // ULA Plus |
||
1876 | //----------------------------------------------------------------------------- |
||
1877 | if ( dc_out__NGS( port, p1, val )) return; // NGS |
||
1878 | //----------------------------------------------------------------------------- |
||
1879 | if (conf.mem_model == MM_ATM3) // Z-Controller |
||
1880 | if ( dc_out__zc__ATM3( port, val )) return; // � ATM3 ���������� $77 � Shadow mode |
||
1881 | else |
||
1882 | if ( dc_out__zc( port, val )) return; // ��� � ������ ����������� �� !!!!! |
||
1883 | //----------------------------------------------------------------------------- |
||
1884 | if ( dc_out__wiznet( port, val )) return; // Wiznet |
||
1885 | //----------------------------------------------------------------------------- |
||
1886 | if ( dc_out__NEMO_DivIDE( port, val )) return; // DivIDE �� NEMO ������ |
||
1887 | //----------------------------------------------------------------------------- |
||
1888 | |||
1889 | |||
1890 | |||
1891 | |||
1892 | |||
1893 | |||
1894 | |||
1895 | |||
1896 | |||
1897 | |||
1898 | //������ � emul.h |
||
1899 | switch (conf.mem_model) |
||
1900 | { |
||
1901 | // //--------------------------------------------------------------------- |
||
1902 | // case MM_PENTAGON: |
||
1903 | // break; |
||
1904 | // //--------------------------------------------------------------------- |
||
1905 | // case MM_SCORP: |
||
1906 | // break; |
||
1907 | // //--------------------------------------------------------------------- |
||
1908 | // case MM_PROFSCORP: |
||
1909 | // break; |
||
1910 | // //--------------------------------------------------------------------- |
||
1911 | // case MM_PROFI: |
||
1912 | // break; |
||
1913 | // //--------------------------------------------------------------------- |
||
1914 | // case MM_ATM450: |
||
1915 | // break; |
||
1916 | // //--------------------------------------------------------------------- |
||
1917 | // case MM_ATM710: |
||
1918 | // break; |
||
1919 | |||
1920 | //--------------------------------------------------------------------- |
||
1921 | case MM_ATM3: |
||
1922 | |||
1923 | // // ���� ���������� ���3 0.39.0 |
||
1924 | // if((port & 0xFF) == 0xBF) |
||
1925 | // { |
||
1926 | // if((comp.pBF ^ val) & comp.pBF & 8) // D3: 1->0 |
||
1927 | // nmi_pending = 1; |
||
1928 | // comp.pBF = val; |
||
1929 | // set_banks(); |
||
1930 | // return; |
||
1931 | |||
1932 | // // ���� ������������� RAM0 ���3 |
||
1933 | // if((port & 0xFF) == 0xBE) |
||
1934 | // { |
||
1935 | // comp.pBE = 2; // ������� ��� ������ �� nmi |
||
1936 | // return; |
||
1937 | // } |
||
1938 | // } |
||
1939 | |||
1940 | switch (port & 0xFF) |
||
1941 | { |
||
1942 | //----------------------------------------------------------------- |
||
1943 | // ���� ���������� ������� |
||
1944 | case 0xBF: |
||
1945 | //d3 - (������� �� 1 � 0) - force NMI |
||
1946 | if ((comp.pBF ^ val) & comp.pBF & 8) // D3: 1->0 |
||
1947 | { |
||
1948 | nmi_pending = 1; |
||
1949 | trdos_in_nmi = (comp.flags & CF_TRDOS); |
||
1950 | } |
||
1951 | comp.pBF = val; |
||
1952 | set_banks(); |
||
1953 | return; |
||
1954 | //----------------------------------------------------------------- |
||
1955 | // ���� ������������� RAM0 ���3 |
||
1956 | case 0xBE: |
||
1957 | if (cpu.nmi_in_progress && (cpu.nmi_in_progress == conf.trdos_IORam) ) |
||
1958 | { |
||
1959 | if (trdos_in_nmi) |
||
1960 | comp.flags |= (CF_SETDOSROM | CF_TRDOS); |
||
1961 | cpu.nmi_in_progress = false; |
||
1962 | set_banks(); |
||
1963 | return; |
||
1964 | } |
||
1965 | comp.pBE = 2; // ������� ��� ������ �� nmi |
||
1966 | return; |
||
1967 | //----------------------------------------------------------------- |
||
1968 | // ���� ������ ���������� � ����� ��������� ������ FDD |
||
1969 | case 0xBD: |
||
1970 | switch(port & 0xEFFF) |
||
1971 | { |
||
1972 | //------------------------------------------------------------- |
||
1973 | // hardware break LOW |
||
1974 | case 0x00BD: |
||
1975 | comp.brk_addr &= 0xFF00; |
||
1976 | comp.brk_addr |= ((u16)val) & 0x00FF; |
||
1977 | break; |
||
1978 | //------------------------------------------------------------- |
||
1979 | // hardware break HIGH |
||
1980 | case 0x01BD: |
||
1981 | comp.brk_addr &= 0x00FF; |
||
1982 | comp.brk_addr |= ( ((u16)val) << 8 ) & 0xFF00; |
||
1983 | break; |
||
1984 | //------------------------------------------------------------- |
||
1985 | case 0x03BD: |
||
1986 | comp.fddIO2Ram_mask = val; |
||
1987 | break; |
||
1988 | //------------------------------------------------------------- |
||
1989 | } |
||
1990 | return; |
||
1991 | //----------------------------------------------------------------- |
||
1992 | } |
||
1993 | //--------------------------------------------------------------------- |
||
1994 | |||
1995 | break; |
||
1996 | //--------------------------------------------------------------------- |
||
1997 | // case MM_KAY: |
||
1998 | // break; |
||
1999 | // //--------------------------------------------------------------------- |
||
2000 | // case MM_PLUS3: |
||
2001 | // break; |
||
2002 | // //--------------------------------------------------------------------- |
||
2003 | // case MM_QUORUM: |
||
2004 | // break; |
||
2005 | // //--------------------------------------------------------------------- |
||
2006 | } |
||
2007 | |||
2008 | |||
2009 | |||
2010 | |||
2011 | |||
2012 | |||
2013 | |||
2014 | |||
2015 | //----------------------------------------------------------------------------- |
||
2016 | // SHADOW PORTS ������� NO RETURN !!!!??? |
||
2017 | //----------------------------------------------------------------------------- |
||
2018 | if (comp.flags & CF_DOSPORTS) |
||
2019 | { |
||
2020 | |||
2021 | //������ � emul.h |
||
2022 | switch (conf.mem_model) |
||
2023 | { |
||
2024 | // //----------------------------------------------------------------- |
||
2025 | // case MM_PENTAGON: |
||
2026 | // break; |
||
2027 | // //----------------------------------------------------------------- |
||
2028 | // case MM_SCORP: |
||
2029 | // break; |
||
2030 | // //----------------------------------------------------------------- |
||
2031 | // case MM_PROFSCORP: |
||
2032 | // break; |
||
2033 | //================================================================= |
||
2034 | case MM_PROFI: |
||
2035 | //------------------------------------------------------------- |
||
2036 | if ((comp.p7FFD & 0x10) && (comp.pDFFD & 0x20)) // modified ports |
||
2037 | { |
||
2038 | //--------------------------------------------------------- |
||
2039 | // BDI ports |
||
2040 | if ((p1 & 0x9F) == 0x83) // WD93 ports |
||
2041 | { |
||
2042 | comp.wd.out((p1 & 0x60) | 0x1F, val); |
||
2043 | return; |
||
2044 | } |
||
2045 | //--------------------------------------------------------- |
||
2046 | if ((p1 & 0xE3) == 0x23) // port FF |
||
2047 | { |
||
2048 | comp.wd.out(0xFF, val); |
||
2049 | return; |
||
2050 | } |
||
2051 | //--------------------------------------------------------- |
||
2052 | // RTC |
||
2053 | if ( ((port & 0x9F) == 0x9F) && conf.cmos) |
||
2054 | { |
||
2055 | if (port & 0x20) |
||
2056 | { |
||
2057 | comp.cmos_addr = val; |
||
2058 | return; |
||
2059 | } |
||
2060 | cmos_write(val); |
||
2061 | return; |
||
2062 | } |
||
2063 | //--------------------------------------------------------- |
||
2064 | // IDE_PROFI |
||
2065 | // Profi IDE ��� ��� |
||
2066 | // �� ������� � ����� ����� dc_out__Profi_IDE |
||
2067 | // ��� ����������� �������� ��������������� |
||
2068 | |||
2069 | //--------------------------------------------------------- |
||
2070 | } |
||
2071 | else |
||
2072 | { |
||
2073 | //--------------------------------------------------------- |
||
2074 | // BDI ports |
||
2075 | if ((p1 & 0x83) == 0x03) // WD93 ports 1F, 3F, 5F, 7F |
||
2076 | { |
||
2077 | comp.wd.out((p1 & 0x60) | 0x1F,val); |
||
2078 | return; |
||
2079 | } |
||
2080 | //--------------------------------------------------------- |
||
2081 | if ((p1 & 0xE3) == ((comp.pDFFD & 0x20) ? 0xA3 : 0xE3)) // port FF |
||
2082 | { |
||
2083 | comp.wd.out(0xFF,val); |
||
2084 | return; |
||
2085 | } |
||
2086 | } |
||
2087 | //------------------------------------------------------------- |
||
2088 | //------------------------------------------------------------- |
||
2089 | //------------------------------------------------------------- |
||
2090 | //------------------------------------------------------------- |
||
2091 | //------------------------------------------------------------- |
||
2092 | //------------------------------------------------------------- |
||
2093 | break; |
||
2094 | //----------------------------------------------------------------- |
||
2095 | // case MM_ATM450: |
||
2096 | // break; |
||
2097 | //================================================================= |
||
2098 | case MM_ATM710: //SHADOW |
||
2099 | { |
||
2100 | //------------------------------------------------------------- |
||
2101 | if (p1 == 0x77) // xx77 |
||
2102 | { |
||
2103 | set_atm_FF77(port, val); |
||
2104 | return; |
||
2105 | } |
||
2106 | //------------------------------------------------------------- |
||
2107 | //0.39.0 |
||
2108 | // u32 mask = (conf.mem_model == MM_ATM3) ? 0x3FFF : 0x00FF; |
||
2109 | //NEDOREPO |
||
2110 | // lvd fix: pentevo hardware decodes fully only low byte, |
||
2111 | u32 mask = (conf.mem_model == MM_ATM3) ? /*0x3FFF*/ 0x0FFF : 0x00FF; |
||
2112 | // so using eff7 in shadow mode lead to outting to fff7, |
||
2113 | // unlike this was in unreal! |
||
2114 | //------------------------------------------------------------- |
||
2115 | if ((port & mask) == (0x3FF7 & mask)) // xff7 |
||
2116 | { |
||
2117 | comp.pFFF7[((comp.p7FFD & 0x10) >> 2) | ((port >> 14) & 3)] = unsigned(((val & 0xC0) << 2) | (val & 0x3F)) ^ 0x33FU; |
||
2118 | set_banks(); |
||
2119 | return; |
||
2120 | } |
||
2121 | //------------------------------------------------------------- |
||
2122 | if ((p1 & 0x9F) == 0x9F && !(comp.aFF77 & 0x4000)) |
||
2123 | { |
||
2124 | // atm_writepal(val); // don't return - write to TR-DOS system port |
||
2125 | atm_writepal(port, val); // don't return - write to TR-DOS system port //NEDOREPO |
||
2126 | } |
||
2127 | //------------------------------------------------------------- |
||
2128 | //------------------------------------------------------------- |
||
2129 | //------------------------------------------------------------- |
||
2130 | break; |
||
2131 | } |
||
2132 | //================================================================= |
||
2133 | case MM_ATM3: //SHADOW |
||
2134 | { |
||
2135 | //------------------------------------------------------------- |
||
2136 | // NO OUT RETURN ??????? |
||
2137 | // if ( ((p1 & 0x1F) == 0x0F) && (((p1 >> 5) - 1) < 5) ) //0.39.0 |
||
2138 | if ( ((p1 & 0x1F) == 0x0F) && !(((p1 >> 5) - 1) & 4) ) //NEDOREPO |
||
2139 | { |
||
2140 | // 2F = 001|01111b |
||
2141 | // 4F = 010|01111b |
||
2142 | // 6F = 011|01111b |
||
2143 | // 8F = 100|01111b |
||
2144 | // AF = 101|01111b //AF ������ � NEDOREPO !!! |
||
2145 | // ��� � zxevo_base_configuration.pdf 2015 ���� |
||
2146 | comp.wd_shadow[(p1 >> 5) - 1] = val; |
||
2147 | // NO OUT RETURN ??????? |
||
2148 | } |
||
2149 | //------------------------------------------------------------- |
||
2150 | if ((port & 0x3FFF) == 0x37F7) // x7f7 ATM3 4Mb memory manager |
||
2151 | { |
||
2152 | unsigned idx = ((comp.p7FFD & 0x10) >> 2) | ((port >> 14) & 3); |
||
2153 | comp.pFFF7[idx] = (comp.pFFF7[idx] & ~0x1FFU) | (val ^ 0xFF); // always ram |
||
2154 | set_banks(); |
||
2155 | return; |
||
2156 | } |
||
2157 | //------------------------------------------------------------- |
||
2158 | if (p1 == 0x77) // xx77 // ����� �� � MM_ATM710 |
||
2159 | { |
||
2160 | set_atm_FF77(port, val); |
||
2161 | return; |
||
2162 | } |
||
2163 | //------------------------------------------------------------- |
||
2164 | //0.39.0 |
||
2165 | // u32 mask = (conf.mem_model == MM_ATM3) ? 0x3FFF : 0x00FF; |
||
2166 | //NEDOREPO |
||
2167 | // lvd fix: pentevo hardware decodes fully only low byte, [NS] ����� low nibble? |
||
2168 | u32 mask = (conf.mem_model == MM_ATM3) ? /*0x3FFF*/ 0x0FFF : 0x00FF; |
||
2169 | // so using eff7 in shadow mode lead to outting to fff7, |
||
2170 | // unlike this was in unreal! |
||
2171 | //------------------------------------------------------------- |
||
2172 | if ((port & mask) == (0x3FF7 & mask)) // xff7 // ����� �� � MM_ATM710 |
||
2173 | { |
||
2174 | comp.pFFF7[((comp.p7FFD & 0x10) >> 2) | ((port >> 14) & 3)] = unsigned(((val & 0xC0) << 2) | (val & 0x3F)) ^ 0x33FU; |
||
2175 | set_banks(); |
||
2176 | return; |
||
2177 | } |
||
2178 | //------------------------------------------------------------- |
||
2179 | if ((p1 & 0x9F) == 0x9F && !(comp.aFF77 & 0x4000)) // ����� �� � MM_ATM710 |
||
2180 | { |
||
2181 | // atm_writepal(val); // don't return - write to TR-DOS system port |
||
2182 | atm_writepal(port, val); // don't return - write to TR-DOS system port //NEDOREPO |
||
2183 | } |
||
2184 | //------------------------------------------------------------- |
||
2185 | //------------------------------------------------------------- |
||
2186 | //------------------------------------------------------------- |
||
2187 | break; |
||
2188 | } |
||
2189 | // //================================================================= |
||
2190 | // case MM_KAY: |
||
2191 | // break; |
||
2192 | // //----------------------------------------------------------------- |
||
2193 | // case MM_PLUS3: |
||
2194 | // break; |
||
2195 | //----------------------------------------------------------------- |
||
2196 | case MM_QUORUM: |
||
2197 | |||
2198 | // if(conf.mem_model == MM_QUORUM /* && !(comp.p00 & Q_TR_DOS)*/) // cpm ports |
||
2199 | // ����� ����� ����� quorum trdos? ����������! |
||
2200 | // ���� ���� ����������� ����� �������� �� ����� ��� ���������� �������������* |
||
2201 | |||
2202 | //------------------------------------------------------------- |
||
2203 | if ((p1 & 0xFC) == 0x80) // 80, 81, 82, 83 |
||
2204 | { |
||
2205 | p1 = u8(((p1 & 3) << 5) | 0x1F); |
||
2206 | comp.wd.out(p1, val); |
||
2207 | return; |
||
2208 | } |
||
2209 | //------------------------------------------------------------- |
||
2210 | if (p1 == 0x85) // 85 |
||
2211 | { |
||
2212 | // 01 -> 00 A |
||
2213 | // 10 -> 01 B |
||
2214 | // 00 -> 11 D (unused) |
||
2215 | // 11 -> 11 D (unused) |
||
2216 | static const u8 drv_decode[] = { 3, 0, 1, 3 }; |
||
2217 | u8 drv = drv_decode[val & 3]; |
||
2218 | comp.wd.out(0xFF, ((val & ~3) ^ 0x10) | 0xCC | 8 | drv); |
||
2219 | return; |
||
2220 | } |
||
2221 | //------------------------------------------------------------- |
||
2222 | //------------------------------------------------------------- |
||
2223 | //------------------------------------------------------------- |
||
2224 | //------------------------------------------------------------- |
||
2225 | //------------------------------------------------------------- |
||
2226 | //------------------------------------------------------------- |
||
2227 | break; |
||
2228 | } |
||
2229 | //--------------------------------------------------------------------- |
||
2230 | // ����� shadow ����� |
||
2231 | //--------------------------------------------------------------------- |
||
2232 | if ( dc_out__ATM_IDE( port, val )) return; //ATM IDE |
||
2233 | //--------------------------------------------------------------------- |
||
2234 | if ( dc_out__SMUC( port, val )) return; //SMUC |
||
2235 | //--------------------------------------------------------------------- |
||
2236 | if ( dc_out__Profi_IDE( port, p1, val )) return; // Profi IDE (������� �� �����) |
||
2237 | //--------------------------------------------------------------------- |
||
2238 | |||
2239 | // ����� �������� ��� ������� � ��������� �� ������� |
||
2240 | // ������ �������� ������� � ���-� |
||
2241 | if (conf.mem_model != MM_QUORUM) |
||
2242 | { |
||
2243 | // NOT IN QUORUM !!! |
||
2244 | if ((p1 & 0x1F) == 0x1F) // 1F, 3F, 5F, 7F, FF |
||
2245 | { |
||
2246 | //0.39.0 |
||
2247 | //comp.wd.out(p1, val); //� ��������� ��� ���� 1 ������ |
||
2248 | //return; |
||
2249 | |||
2250 | // �������? |
||
2251 | // ����� �������� ��� � ��������� ��������� � ������ ������... |
||
2252 | // � ����� ������������ |
||
2253 | //------------------------------------------------------------- |
||
2254 | if (p1 & 0x80) |
||
2255 | { |
||
2256 | comp.trdos_last_ff = val & 0x1f; |
||
2257 | } |
||
2258 | //------------------------------------------------------------- |
||
2259 | if ( (comp.flags & CF_TRDOS) && |
||
2260 | conf.trdos_IORam && |
||
2261 | (bankr[0] == base_dos_rom) && |
||
2262 | (p1 & 0x80) |
||
2263 | ) |
||
2264 | { |
||
2265 | comp.wd.out(p1, val); |
||
2266 | |||
2267 | if ((1<<comp.wd.drive)&comp.fddIO2Ram_mask) |
||
2268 | { |
||
2269 | trdos_in_nmi = (comp.flags & CF_TRDOS); |
||
2270 | cpu.nmi_in_progress=conf.trdos_IORam; |
||
2271 | set_banks(); |
||
2272 | } |
||
2273 | } |
||
2274 | //------------------------------------------------------------- |
||
2275 | else if ( (comp.flags & CF_TRDOS) && |
||
2276 | conf.trdos_IORam && |
||
2277 | (bankr[0] == base_dos_rom) && |
||
2278 | ((1<<comp.wd.drive) & comp.fddIO2Ram_mask) |
||
2279 | |||
2280 | ) |
||
2281 | { |
||
2282 | trdos_in_nmi = comp.flags&CF_TRDOS; |
||
2283 | cpu.nmi_in_progress=conf.trdos_IORam; |
||
2284 | set_banks(); |
||
2285 | } |
||
2286 | //------------------------------------------------------------- |
||
2287 | else |
||
2288 | { |
||
2289 | comp.wd.out(p1, val); |
||
2290 | } |
||
2291 | //------------------------------------------------------------- |
||
2292 | return; |
||
2293 | } |
||
2294 | } |
||
2295 | //--------------------------------------------------------------------- |
||
2296 | |||
2297 | // ������������ ������ �_� |
||
2298 | // don't return - out to port #FE works in trdos! |
||
2299 | } |
||
2300 | else |
||
2301 | //----------------------------------------------------------------------------- |
||
2302 | // NOT shadow ports |
||
2303 | //----------------------------------------------------------------------------- |
||
2304 | { |
||
2305 | //--------------------------------------------------------------------- |
||
2306 | if ( dc_out__Fuller_AY( p1, val )) return; // Fuller AY |
||
2307 | //--------------------------------------------------------------------- |
||
2308 | if ( dc_out__DivIDE( port, val )) return; // DivIDE |
||
2309 | //--------------------------------------------------------------------- |
||
2310 | if ( dc_out__POS_AY( port, val )) return; // POS AY |
||
2311 | //--------------------------------------------------------------------- |
||
2312 | if ( dc_out__NEMO_IDE( port, val )) return; // NEMO IDE |
||
2313 | //--------------------------------------------------------------------- |
||
2314 | } |
||
2315 | //----------------------------------------------------------------------------- |
||
2316 | |||
2317 | |||
2318 | |||
2319 | |||
2320 | |||
2321 | //----------------------------------------------------------------------------- |
||
2322 | // ��� ������� NO shadow ����� |
||
2323 | //----------------------------------------------------------------------------- |
||
2324 | |||
2325 | |||
2326 | |||
2327 | |||
2328 | //������ � emul.h |
||
2329 | switch (conf.mem_model) |
||
2330 | { |
||
2331 | // //--------------------------------------------------------------------- |
||
2332 | // case MM_PENTAGON: |
||
2333 | // break; |
||
2334 | // //--------------------------------------------------------------------- |
||
2335 | // case MM_SCORP: |
||
2336 | // break; |
||
2337 | // //--------------------------------------------------------------------- |
||
2338 | // case MM_PROFSCORP: |
||
2339 | // break; |
||
2340 | // //--------------------------------------------------------------------- |
||
2341 | // case MM_PROFI: |
||
2342 | // break; |
||
2343 | // //--------------------------------------------------------------------- |
||
2344 | // case MM_ATM450: |
||
2345 | // break; |
||
2346 | // //--------------------------------------------------------------------- |
||
2347 | // case MM_ATM710: |
||
2348 | // break; |
||
2349 | // //--------------------------------------------------------------------- |
||
2350 | // case MM_ATM3: |
||
2351 | // break; |
||
2352 | // //--------------------------------------------------------------------- |
||
2353 | // case MM_KAY: |
||
2354 | // break; |
||
2355 | // //--------------------------------------------------------------------- |
||
2356 | // case MM_PLUS3: |
||
2357 | // break; |
||
2358 | //--------------------------------------------------------------------- |
||
2359 | case MM_QUORUM: |
||
2360 | //----------------------------------------------------------------- |
||
2361 | if ((port & 0xFF) == 0x00) |
||
2362 | { |
||
2363 | comp.p00 = val; |
||
2364 | set_banks(); |
||
2365 | return; |
||
2366 | } |
||
2367 | //----------------------------------------------------------------- |
||
2368 | break; |
||
2369 | //--------------------------------------------------------------------- |
||
2370 | |||
2371 | } |
||
2372 | |||
2373 | //----------------------------------------------------------------------------- |
||
2374 | // ��� ������� NO shadow ����� ����� |
||
2375 | //----------------------------------------------------------------------------- |
||
2376 | |||
2377 | |||
2378 | //----------------------------------------------------------------------------- |
||
2379 | // Video Drive by SAM style |
||
2380 | #ifdef MOD_VID_VD |
||
2381 | if ((unsigned char)port == 0xDF) |
||
2382 | { |
||
2383 | comp.pVD = val; |
||
2384 | comp.vdbase = (comp.pVD & 4) ? vdmem[comp.pVD & 3] : |
||
2385 | 0; |
||
2386 | return; |
||
2387 | } |
||
2388 | #endif |
||
2389 | //----------------------------------------------------------------------------- |
||
2390 | |||
2391 | |||
2392 | //----------------------------------------------------------------------------- |
||
2393 | // PORT FE - OUT |
||
2394 | //----------------------------------------------------------------------------- |
||
2395 | |||
2396 | // port #FE |
||
2397 | bool pFE; |
||
2398 | |||
2399 | //������ � emul.h |
||
2400 | switch (conf.mem_model) |
||
2401 | { |
||
2402 | // //--------------------------------------------------------------------- |
||
2403 | // case MM_PENTAGON: |
||
2404 | // break; |
||
2405 | //===================================================================== |
||
2406 | case MM_SCORP: |
||
2407 | // scorp xx1xxx10 /dos=1 (sc16 green) |
||
2408 | // if ((conf.mem_model == MM_SCORP || conf.mem_model == MM_PROFSCORP)) |
||
2409 | pFE = ((port & 0x23) == (0xFE & 0x23)) && !(comp.flags & CF_DOSPORTS); |
||
2410 | //----------------------------------------------------------------- |
||
2411 | if (pFE) |
||
2412 | { |
||
2413 | //[vv] assert(!(val & 0x08)); |
||
2414 | //------------------------------------------------------------- |
||
2415 | spkr_dig = (val & 0x10) ? conf.sound.beeper_vol : 0; |
||
2416 | mic_dig = (val & 0x08) ? conf.sound.micout_vol : 0; |
||
2417 | //------------------------------------------------------------- |
||
2418 | // speaker & mic |
||
2419 | if ((comp.pFE ^ val) & 0x18) |
||
2420 | { |
||
2421 | // __debugbreak(); |
||
2422 | flush_dig_snd(); |
||
2423 | } |
||
2424 | //------------------------------------------------------------- |
||
2425 | unsigned char new_border = (val & 7); |
||
2426 | if (comp.border_attr ^ new_border) |
||
2427 | update_screen(); |
||
2428 | comp.border_attr = new_border; |
||
2429 | //------------------------------------------------------------- |
||
2430 | comp.pFE = val; |
||
2431 | // do not return! intro to navy seals (by rst7) uses out #FC for to both FE and 7FFD |
||
2432 | //------------------------------------------------------------- |
||
2433 | } |
||
2434 | //----------------------------------------------------------------- |
||
2435 | break; |
||
2436 | //===================================================================== |
||
2437 | case MM_PROFSCORP: |
||
2438 | // scorp xx1xxx10 /dos=1 (sc16 green) |
||
2439 | // if ((conf.mem_model == MM_SCORP || conf.mem_model == MM_PROFSCORP)) |
||
2440 | pFE = ((port & 0x23) == (0xFE & 0x23)) && !(comp.flags & CF_DOSPORTS); |
||
2441 | //----------------------------------------------------------------- |
||
2442 | if (pFE) |
||
2443 | { |
||
2444 | //[vv] assert(!(val & 0x08)); |
||
2445 | //------------------------------------------------------------- |
||
2446 | spkr_dig = (val & 0x10) ? conf.sound.beeper_vol : 0; |
||
2447 | mic_dig = (val & 0x08) ? conf.sound.micout_vol : 0; |
||
2448 | //------------------------------------------------------------- |
||
2449 | // speaker & mic |
||
2450 | if ((comp.pFE ^ val) & 0x18) |
||
2451 | { |
||
2452 | // __debugbreak(); |
||
2453 | flush_dig_snd(); |
||
2454 | } |
||
2455 | //------------------------------------------------------------- |
||
2456 | unsigned char new_border = (val & 7); |
||
2457 | if (comp.border_attr ^ new_border) |
||
2458 | update_screen(); |
||
2459 | comp.border_attr = new_border; |
||
2460 | //------------------------------------------------------------- |
||
2461 | comp.pFE = val; |
||
2462 | // do not return! intro to navy seals (by rst7) uses out #FC for to both FE and 7FFD |
||
2463 | //------------------------------------------------------------- |
||
2464 | } |
||
2465 | //----------------------------------------------------------------- |
||
2466 | break; |
||
2467 | //===================================================================== |
||
2468 | case MM_PROFI: |
||
2469 | //----------------------------------------------------------------- |
||
2470 | pFE = !(port & 1); //DEFAULT FE |
||
2471 | //----------------------------------------------------------------- |
||
2472 | if (pFE) |
||
2473 | { |
||
2474 | //[vv] assert(!(val & 0x08)); |
||
2475 | //------------------------------------------------------------- |
||
2476 | spkr_dig = (val & 0x10) ? conf.sound.beeper_vol : 0; |
||
2477 | mic_dig = (val & 0x08) ? conf.sound.micout_vol : 0; |
||
2478 | //------------------------------------------------------------- |
||
2479 | // speaker & mic |
||
2480 | if ((comp.pFE ^ val) & 0x18) |
||
2481 | { |
||
2482 | // __debugbreak(); |
||
2483 | flush_dig_snd(); |
||
2484 | } |
||
2485 | //------------------------------------------------------------- |
||
2486 | unsigned char new_border = (val & 7); |
||
2487 | if (comp.border_attr ^ new_border) |
||
2488 | update_screen(); |
||
2489 | comp.border_attr = new_border; |
||
2490 | //------------------------------------------------------------- |
||
2491 | if (!(port & 0x80) && (comp.pDFFD & 0x80)) |
||
2492 | { |
||
2493 | profi_writepal(u8(~(port >> 8))); |
||
2494 | } |
||
2495 | //------------------------------------------------------------- |
||
2496 | comp.pFE = val; |
||
2497 | // do not return! intro to navy seals (by rst7) uses out #FC for to both FE and 7FFD |
||
2498 | //------------------------------------------------------------- |
||
2499 | } |
||
2500 | //----------------------------------------------------------------- |
||
2501 | break; |
||
2502 | //===================================================================== |
||
2503 | case MM_ATM450: |
||
2504 | //----------------------------------------------------------------- |
||
2505 | pFE = !(port & 1); //DEFAULT FE |
||
2506 | //----------------------------------------------------------------- |
||
2507 | if (pFE) |
||
2508 | { |
||
2509 | //[vv] assert(!(val & 0x08)); |
||
2510 | //------------------------------------------------------------- |
||
2511 | spkr_dig = (val & 0x10) ? conf.sound.beeper_vol : 0; |
||
2512 | mic_dig = (val & 0x08) ? conf.sound.micout_vol : 0; |
||
2513 | //------------------------------------------------------------- |
||
2514 | // speaker & mic |
||
2515 | if ((comp.pFE ^ val) & 0x18) |
||
2516 | { |
||
2517 | // __debugbreak(); |
||
2518 | flush_dig_snd(); |
||
2519 | } |
||
2520 | //------------------------------------------------------------- |
||
2521 | unsigned char new_border = (val & 7); |
||
2522 | //if (conf.mem_model == MM_ATM710 || conf.mem_model == MM_ATM3 || conf.mem_model == MM_ATM450) |
||
2523 | new_border |= ((port & 8) ^ 8); // port F6, bright border |
||
2524 | if (comp.border_attr ^ new_border) |
||
2525 | update_screen(); |
||
2526 | comp.border_attr = new_border; |
||
2527 | //------------------------------------------------------------- |
||
2528 | //if (conf.mem_model == MM_ATM450) |
||
2529 | set_atm_aFE((unsigned char)port); |
||
2530 | //------------------------------------------------------------- |
||
2531 | comp.pFE = val; |
||
2532 | // do not return! intro to navy seals (by rst7) uses out #FC for to both FE and 7FFD |
||
2533 | } |
||
2534 | //----------------------------------------------------------------- |
||
2535 | break; |
||
2536 | //===================================================================== |
||
2537 | case MM_ATM710: |
||
2538 | //----------------------------------------------------------------- |
||
2539 | pFE = !(port & 1); //DEFAULT FE |
||
2540 | //----------------------------------------------------------------- |
||
2541 | if (pFE) |
||
2542 | { |
||
2543 | //[vv] assert(!(val & 0x08)); |
||
2544 | //------------------------------------------------------------- |
||
2545 | spkr_dig = (val & 0x10) ? conf.sound.beeper_vol : 0; |
||
2546 | mic_dig = (val & 0x08) ? conf.sound.micout_vol : 0; |
||
2547 | //------------------------------------------------------------- |
||
2548 | // speaker & mic |
||
2549 | if ((comp.pFE ^ val) & 0x18) |
||
2550 | { |
||
2551 | // __debugbreak(); |
||
2552 | flush_dig_snd(); |
||
2553 | } |
||
2554 | //------------------------------------------------------------- |
||
2555 | unsigned char new_border = (val & 7); |
||
2556 | //if (conf.mem_model == MM_ATM710 || conf.mem_model == MM_ATM3 || conf.mem_model == MM_ATM450) |
||
2557 | new_border |= ((port & 8) ^ 8); // port F6, bright border |
||
2558 | if (comp.border_attr ^ new_border) |
||
2559 | update_screen(); |
||
2560 | comp.border_attr = new_border; |
||
2561 | //------------------------------------------------------------- |
||
2562 | comp.pFE = val; |
||
2563 | // do not return! intro to navy seals (by rst7) uses out #FC for to both FE and 7FFD |
||
2564 | } |
||
2565 | //----------------------------------------------------------------- |
||
2566 | break; |
||
2567 | //===================================================================== |
||
2568 | case MM_ATM3: |
||
2569 | //----------------------------------------------------------------- |
||
2570 | pFE = !(port & 1); //DEFAULT FE |
||
2571 | //----------------------------------------------------------------- |
||
2572 | if (pFE) |
||
2573 | { |
||
2574 | //[vv] assert(!(val & 0x08)); |
||
2575 | //------------------------------------------------------------- |
||
2576 | spkr_dig = (val & 0x10) ? conf.sound.beeper_vol : 0; |
||
2577 | mic_dig = (val & 0x08) ? conf.sound.micout_vol : 0; |
||
2578 | //------------------------------------------------------------- |
||
2579 | // speaker & mic |
||
2580 | if ((comp.pFE ^ val) & 0x18) |
||
2581 | { |
||
2582 | // __debugbreak(); |
||
2583 | flush_dig_snd(); |
||
2584 | } |
||
2585 | //------------------------------------------------------------- |
||
2586 | unsigned char new_border = (val & 7); |
||
2587 | //if (conf.mem_model == MM_ATM710 || conf.mem_model == MM_ATM3 || conf.mem_model == MM_ATM450) |
||
2588 | new_border |= ((port & 8) ^ 8); // port F6, bright border |
||
2589 | if (comp.border_attr ^ new_border) |
||
2590 | update_screen(); |
||
2591 | comp.border_attr = new_border; |
||
2592 | //------------------------------------------------------------- |
||
2593 | comp.pFE = val; |
||
2594 | // do not return! intro to navy seals (by rst7) uses out #FC for to both FE and 7FFD |
||
2595 | //------------------------------------------------------------- |
||
2596 | } |
||
2597 | //----------------------------------------------------------------- |
||
2598 | break; |
||
2599 | // //===================================================================== |
||
2600 | // case MM_KAY: |
||
2601 | // break; |
||
2602 | // //--------------------------------------------------------------------- |
||
2603 | // case MM_PLUS3: |
||
2604 | // break; |
||
2605 | // //===================================================================== |
||
2606 | case MM_QUORUM: |
||
2607 | // if (conf.mem_model == MM_QUORUM) // 1xx11xx0 |
||
2608 | pFE = ((port & 0x99) == (0xFE & 0x99)); |
||
2609 | //----------------------------------------------------------------- |
||
2610 | if (pFE) |
||
2611 | { |
||
2612 | //[vv] assert(!(val & 0x08)); |
||
2613 | //------------------------------------------------------------- |
||
2614 | spkr_dig = (val & 0x10) ? conf.sound.beeper_vol : 0; |
||
2615 | mic_dig = (val & 0x08) ? conf.sound.micout_vol : 0; |
||
2616 | //------------------------------------------------------------- |
||
2617 | // speaker & mic |
||
2618 | if ((comp.pFE ^ val) & 0x18) |
||
2619 | { |
||
2620 | // __debugbreak(); |
||
2621 | flush_dig_snd(); |
||
2622 | } |
||
2623 | //------------------------------------------------------------- |
||
2624 | unsigned char new_border = (val & 7); |
||
2625 | if (comp.border_attr ^ new_border) |
||
2626 | update_screen(); |
||
2627 | comp.border_attr = new_border; |
||
2628 | //------------------------------------------------------------- |
||
2629 | comp.pFE = val; |
||
2630 | // do not return! intro to navy seals (by rst7) uses out #FC for to both FE and 7FFD |
||
2631 | //------------------------------------------------------------- |
||
2632 | } |
||
2633 | //----------------------------------------------------------------- |
||
2634 | break; |
||
2635 | //===================================================================== |
||
2636 | default: |
||
2637 | // else // others xxxxxxx0 //���������� ���� ��� ������������� ����� |
||
2638 | pFE = !(port & 1); |
||
2639 | //----------------------------------------------------------------- |
||
2640 | if (pFE) |
||
2641 | { |
||
2642 | //[vv] assert(!(val & 0x08)); |
||
2643 | //------------------------------------------------------------- |
||
2644 | spkr_dig = (val & 0x10) ? conf.sound.beeper_vol : 0; |
||
2645 | mic_dig = (val & 0x08) ? conf.sound.micout_vol : 0; |
||
2646 | //------------------------------------------------------------- |
||
2647 | // speaker & mic |
||
2648 | if ((comp.pFE ^ val) & 0x18) |
||
2649 | { |
||
2650 | // __debugbreak(); |
||
2651 | flush_dig_snd(); |
||
2652 | } |
||
2653 | //------------------------------------------------------------- |
||
2654 | unsigned char new_border = (val & 7); |
||
2655 | if (comp.border_attr ^ new_border) |
||
2656 | update_screen(); |
||
2657 | comp.border_attr = new_border; |
||
2658 | //------------------------------------------------------------- |
||
2659 | comp.pFE = val; |
||
2660 | // do not return! intro to navy seals (by rst7) uses out #FC for to both FE and 7FFD |
||
2661 | //------------------------------------------------------------- |
||
2662 | } |
||
2663 | //----------------------------------------------------------------- |
||
2664 | // break; |
||
2665 | //===================================================================== |
||
2666 | } //FE |
||
2667 | |||
2668 | //----------------------------------------------------------------------------- |
||
2669 | |||
2670 | |||
2671 | |||
2672 | //----------------------------------------------------------------------------- |
||
2673 | // PORT xD |
||
2674 | //----------------------------------------------------------------------------- |
||
2675 | |||
2676 | |||
2677 | // ������� ���� �� ������ ������ !!! |
||
2678 | |||
2679 | //������ � emul.h |
||
2680 | switch (conf.mem_model) |
||
2681 | { |
||
2682 | //===================================================================== |
||
2683 | case MM_PENTAGON: |
||
2684 | // #xD |
||
2685 | if (!(port & 2)) |
||
2686 | { |
||
2687 | //------------------------------------------------------------- |
||
2688 | if ( dc_out__Covox_DD( port, val )) return; // Covox_DD |
||
2689 | //------------------------------------------------------------- |
||
2690 | if (!(port & 0x8000)) // zx128 port |
||
2691 | { |
||
2692 | // 0001xxxxxxxxxx0x (bcig4) // 1FFD |
||
2693 | // 0010xxxxxxxxxx0x (bcig4) // 2FFD |
||
2694 | // 0011xxxxxxxxxx0x (bcig4) // 3FFD |
||
2695 | //--------------------------------------------------------- |
||
2696 | // 7FFD |
||
2697 | if (comp.p7FFD & 0x20) |
||
2698 | { // 48k lock |
||
2699 | //----------------------------------------------------- |
||
2700 | // #EFF7.2 forces lock |
||
2701 | if ( (comp.pEFF7 & EFF7_LOCKMEM) && //&& conf.mem_model == MM_PENTAGON |
||
2702 | (conf.ramsize == 1024) |
||
2703 | ) |
||
2704 | return; |
||
2705 | //----------------------------------------------------- |
||
2706 | //0.39.0 |
||
2707 | // if not pentagon-1024 or profi with #DFFD.4 set, apply lock |
||
2708 | //NEDOREPO |
||
2709 | // if not pentagon-1024 or pentevo (atm3) --(added by lvd)-- or profi with #DFFD.4 set, apply lock |
||
2710 | |||
2711 | //0.39.0 |
||
2712 | // if (!((conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
2713 | // (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)))) molodcov_alex |
||
2714 | if (!( (conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
2715 | (conf.mem_model == MM_ATM3) || |
||
2716 | (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)) |
||
2717 | )) // molodcov_alex |
||
2718 | return; |
||
2719 | } |
||
2720 | //--------------------------------------------------------- |
||
2721 | if ((comp.p7FFD ^ val) & 0x08) |
||
2722 | update_screen(); |
||
2723 | //--------------------------------------------------------- |
||
2724 | comp.p7FFD = val; |
||
2725 | set_banks(); |
||
2726 | return; |
||
2727 | } |
||
2728 | //------------------------------------------------------------- |
||
2729 | if ( dc_out__AY_TS_TSFM_nedoSAA_etc( port, val )) return; // AY_TS_TSFM_nedoSAA_etc |
||
2730 | //------------------------------------------------------------- |
||
2731 | |||
2732 | // � ����� �����? |
||
2733 | // ������ � �� �������� �_� |
||
2734 | return; |
||
2735 | } |
||
2736 | break; |
||
2737 | //===================================================================== |
||
2738 | case MM_SCORP: |
||
2739 | // #xD |
||
2740 | if (!(port & 2)) |
||
2741 | { |
||
2742 | //------------------------------------------------------------- |
||
2743 | if ( dc_out__Covox_DD( port, val )) return; // Covox_DD |
||
2744 | //------------------------------------------------------------- |
||
2745 | if (!(port & 0x8000)) // zx128 port |
||
2746 | { |
||
2747 | // 0001xxxxxxxxxx0x (bcig4) // 1FFD |
||
2748 | // 0010xxxxxxxxxx0x (bcig4) // 2FFD |
||
2749 | // 0011xxxxxxxxxx0x (bcig4) // 3FFD |
||
2750 | //----------------------------------------------------- |
||
2751 | // 00xxxxxxxx1xxx01 (sc16 green) |
||
2752 | if ((port & 0xC023) == (0x1FFD & 0xC023)) //&& (conf.mem_model == MM_SCORP, MM_PROFSCORP |
||
2753 | { |
||
2754 | //set1FFD: |
||
2755 | comp.p1FFD = val; |
||
2756 | set_banks(); |
||
2757 | return; |
||
2758 | } |
||
2759 | //--------------------------------------------------------- |
||
2760 | // 01xxxxxxxx1xxx01 (sc16 green) |
||
2761 | if ((port & 0xC023) != (0x7FFD & 0xC023)) //&& (conf.mem_model == MM_SCORP, MM_PROFSCORP |
||
2762 | return; |
||
2763 | //--------------------------------------------------------- |
||
2764 | // 7FFD |
||
2765 | if (comp.p7FFD & 0x20) |
||
2766 | { // 48k lock |
||
2767 | //0.39.0 |
||
2768 | // if not pentagon-1024 or profi with #DFFD.4 set, apply lock |
||
2769 | //NEDOREPO |
||
2770 | // if not pentagon-1024 or pentevo (atm3) --(added by lvd)-- or profi with #DFFD.4 set, apply lock |
||
2771 | //0.39.0 |
||
2772 | // if (!((conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
2773 | // (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)))) molodcov_alex |
||
2774 | if (!( (conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
2775 | (conf.mem_model == MM_ATM3) || |
||
2776 | (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)) |
||
2777 | )) // molodcov_alex |
||
2778 | return; |
||
2779 | } |
||
2780 | //--------------------------------------------------------- |
||
2781 | if ((comp.p7FFD ^ val) & 0x08) |
||
2782 | update_screen(); |
||
2783 | //--------------------------------------------------------- |
||
2784 | comp.p7FFD = val; |
||
2785 | set_banks(); |
||
2786 | return; |
||
2787 | } |
||
2788 | //------------------------------------------------------------- |
||
2789 | if ( dc_out__AY_TS_TSFM_nedoSAA_etc( port, val )) return; // AY_TS_TSFM_nedoSAA_etc |
||
2790 | //------------------------------------------------------------- |
||
2791 | |||
2792 | // � ����� �����? |
||
2793 | // ������ � �� �������� �_� |
||
2794 | return; |
||
2795 | } |
||
2796 | break; |
||
2797 | //===================================================================== |
||
2798 | case MM_PROFSCORP: |
||
2799 | // #xD |
||
2800 | if (!(port & 2)) |
||
2801 | { |
||
2802 | //------------------------------------------------------------- |
||
2803 | if ( dc_out__Covox_DD( port, val )) return; // Covox_DD |
||
2804 | //------------------------------------------------------------- |
||
2805 | if (!(port & 0x8000)) // zx128 port |
||
2806 | { |
||
2807 | // 0001xxxxxxxxxx0x (bcig4) // 1FFD |
||
2808 | // 0010xxxxxxxxxx0x (bcig4) // 2FFD |
||
2809 | // 0011xxxxxxxxxx0x (bcig4) // 3FFD |
||
2810 | //--------------------------------------------------------- |
||
2811 | // 00xxxxxxxx1xxx01 (sc16 green) |
||
2812 | if ((port & 0xC023) == (0x1FFD & 0xC023)) //&& (conf.mem_model == MM_SCORP, MM_PROFSCORP |
||
2813 | { |
||
2814 | //set1FFD: |
||
2815 | comp.p1FFD = val; |
||
2816 | set_banks(); |
||
2817 | return; |
||
2818 | } |
||
2819 | //--------------------------------------------------------- |
||
2820 | // gmx |
||
2821 | if (port == 0x7EFD) // && conf.mem_model == MM_PROFSCORP |
||
2822 | { |
||
2823 | comp.p7EFD = val; |
||
2824 | set_banks(); |
||
2825 | return; |
||
2826 | } |
||
2827 | //--------------------------------------------------------- |
||
2828 | // 01xxxxxxxx1xxx01 (sc16 green) |
||
2829 | if ((port & 0xC023) != (0x7FFD & 0xC023)) // && (conf.mem_model == MM_SCORP, MM_PROFSCORP |
||
2830 | return; |
||
2831 | //--------------------------------------------------------- |
||
2832 | // 7FFD |
||
2833 | if (comp.p7FFD & 0x20) |
||
2834 | { // 48k lock |
||
2835 | //0.39.0 |
||
2836 | // if not pentagon-1024 or profi with #DFFD.4 set, apply lock |
||
2837 | //NEDOREPO |
||
2838 | // if not pentagon-1024 or pentevo (atm3) --(added by lvd)-- or profi with #DFFD.4 set, apply lock |
||
2839 | //0.39.0 |
||
2840 | // if (!((conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
2841 | // (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)))) molodcov_alex |
||
2842 | if (!( (conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
2843 | (conf.mem_model == MM_ATM3) || |
||
2844 | (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)) |
||
2845 | )) // molodcov_alex |
||
2846 | return; |
||
2847 | } |
||
2848 | //--------------------------------------------------------- |
||
2849 | if ((comp.p7FFD ^ val) & 0x08) |
||
2850 | update_screen(); |
||
2851 | //--------------------------------------------------------- |
||
2852 | comp.p7FFD = val; |
||
2853 | set_banks(); |
||
2854 | return; |
||
2855 | } |
||
2856 | //------------------------------------------------------------- |
||
2857 | if ( dc_out__AY_TS_TSFM_nedoSAA_etc( port, val )) return; // AY_TS_TSFM_nedoSAA_etc |
||
2858 | //------------------------------------------------------------- |
||
2859 | |||
2860 | // � ����� �����? |
||
2861 | // ������ � �� �������� �_� |
||
2862 | return; |
||
2863 | } |
||
2864 | break; |
||
2865 | //===================================================================== |
||
2866 | case MM_PROFI: |
||
2867 | // #xD |
||
2868 | if (!(port & 2)) |
||
2869 | { |
||
2870 | //------------------------------------------------------------- |
||
2871 | if ( dc_out__Covox_DD( port, val )) return; // Covox_DD |
||
2872 | //------------------------------------------------------------- |
||
2873 | if (!(port & 0x8000)) // zx128 port |
||
2874 | { |
||
2875 | // 0001xxxxxxxxxx0x (bcig4) // 1FFD |
||
2876 | // 0010xxxxxxxxxx0x (bcig4) // 2FFD |
||
2877 | // 0011xxxxxxxxxx0x (bcig4) // 3FFD |
||
2878 | //--------------------------------------------------------- |
||
2879 | // 7FFD |
||
2880 | if (comp.p7FFD & 0x20) |
||
2881 | { // 48k lock |
||
2882 | |||
2883 | // 0.39.0 |
||
2884 | // if not pentagon-1024 or profi with #DFFD.4 set, apply lock |
||
2885 | // NEDOREPO |
||
2886 | // if not pentagon-1024 or pentevo (atm3) --(added by lvd)-- or profi with #DFFD.4 set, apply lock |
||
2887 | //0.39.0 |
||
2888 | // if (!((conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
2889 | // (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)))) molodcov_alex |
||
2890 | if (!( (conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
2891 | (conf.mem_model == MM_ATM3) || |
||
2892 | (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)) |
||
2893 | )) // molodcov_alex |
||
2894 | return; |
||
2895 | } |
||
2896 | //--------------------------------------------------------- |
||
2897 | if ((comp.p7FFD ^ val) & 0x08) |
||
2898 | update_screen(); |
||
2899 | //--------------------------------------------------------- |
||
2900 | comp.p7FFD = val; |
||
2901 | set_banks(); |
||
2902 | return; |
||
2903 | } |
||
2904 | //------------------------------------------------------------- |
||
2905 | // xx0xxxxxxxxxxx0x (3.2) [vv] |
||
2906 | if ((port & 0x2002) == (0xDFFD & 0x2002)) // && conf.mem_model == MM_PROFI) |
||
2907 | { |
||
2908 | comp.pDFFD = val; |
||
2909 | set_banks(); |
||
2910 | return; |
||
2911 | } |
||
2912 | //------------------------------------------------------------- |
||
2913 | if ( dc_out__AY_TS_TSFM_nedoSAA_etc( port, val )) return; // AY_TS_TSFM_nedoSAA_etc |
||
2914 | //------------------------------------------------------------- |
||
2915 | // � ����� �����? |
||
2916 | // ������ � �� �������� �_� |
||
2917 | return; |
||
2918 | } |
||
2919 | break; |
||
2920 | //===================================================================== |
||
2921 | case MM_ATM450: |
||
2922 | // #xD |
||
2923 | if (!(port & 2)) |
||
2924 | { |
||
2925 | //------------------------------------------------------------- |
||
2926 | if ( dc_out__Covox_DD( port, val )) return; // Covox_DD |
||
2927 | //------------------------------------------------------------- |
||
2928 | if (!(port & 0x8000)) // zx128 port |
||
2929 | { |
||
2930 | // 0001xxxxxxxxxx0x (bcig4) // 1FFD |
||
2931 | // 0010xxxxxxxxxx0x (bcig4) // 2FFD |
||
2932 | // 0011xxxxxxxxxx0x (bcig4) // 3FFD |
||
2933 | //--------------------------------------------------------- |
||
2934 | if ((port & 0x8202) == (0x7DFD & 0x8202)) //&& conf.mem_model == MM_ATM450 |
||
2935 | { |
||
2936 | //atm_writepal(val); |
||
2937 | atm_writepal(port, val); //NEDOREPO |
||
2938 | return; |
||
2939 | } |
||
2940 | //--------------------------------------------------------- |
||
2941 | // 7FFD |
||
2942 | if (comp.p7FFD & 0x20) |
||
2943 | { // 48k lock |
||
2944 | // 0.39.0 |
||
2945 | // if not pentagon-1024 or profi with #DFFD.4 set, apply lock |
||
2946 | // NEDOREPO |
||
2947 | // if not pentagon-1024 or pentevo (atm3) --(added by lvd)-- or profi with #DFFD.4 set, apply lock |
||
2948 | //0.39.0 |
||
2949 | // if (!((conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
2950 | // (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)))) molodcov_alex |
||
2951 | if (!( (conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
2952 | (conf.mem_model == MM_ATM3) || |
||
2953 | (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)) |
||
2954 | )) // molodcov_alex |
||
2955 | return; |
||
2956 | } |
||
2957 | //--------------------------------------------------------- |
||
2958 | if ((comp.p7FFD ^ val) & 0x08) |
||
2959 | update_screen(); |
||
2960 | //--------------------------------------------------------- |
||
2961 | comp.p7FFD = val; |
||
2962 | set_banks(); |
||
2963 | return; |
||
2964 | } |
||
2965 | //------------------------------------------------------------- |
||
2966 | if ((port & 0x8202) == (0xFDFD & 0x8202)) //&& conf.mem_model == MM_ATM450 |
||
2967 | { |
||
2968 | comp.pFDFD = val; |
||
2969 | set_banks(); |
||
2970 | return; |
||
2971 | } |
||
2972 | //------------------------------------------------------------- |
||
2973 | if ( dc_out__AY_TS_TSFM_nedoSAA_etc( port, val )) return; // AY_TS_TSFM_nedoSAA_etc |
||
2974 | //------------------------------------------------------------- |
||
2975 | // � ����� �����? |
||
2976 | // ������ � �� �������� �_� |
||
2977 | return; |
||
2978 | } |
||
2979 | break; |
||
2980 | //===================================================================== |
||
2981 | case MM_ATM710: |
||
2982 | // #xD |
||
2983 | if (!(port & 2)) |
||
2984 | { |
||
2985 | //------------------------------------------------------------- |
||
2986 | if ( dc_out__Covox_DD( port, val )) return; // Covox_DD |
||
2987 | //------------------------------------------------------------- |
||
2988 | if (!(port & 0x8000)) // zx128 port |
||
2989 | { |
||
2990 | // 0001xxxxxxxxxx0x (bcig4) // 1FFD |
||
2991 | // 0010xxxxxxxxxx0x (bcig4) // 2FFD |
||
2992 | // 0011xxxxxxxxxx0x (bcig4) // 3FFD |
||
2993 | //------------------------------------------------------------- |
||
2994 | // �� ��� ��� (�� ������ ����� �������� �� ���� ���� � ����� ��������� ������!!!) |
||
2995 | // |
||
2996 | // if (conf.mem_model == MM_ATM710 && (port & 0x8202) != (0x7FFD & 0x8202)) return; // strict 7FFD decoding on ATM-2 |
||
2997 | //--------------------------------------------------------- |
||
2998 | // 7FFD |
||
2999 | if (comp.p7FFD & 0x20) |
||
3000 | { // 48k lock |
||
3001 | // 0.39.0 |
||
3002 | // if not pentagon-1024 or profi with #DFFD.4 set, apply lock |
||
3003 | // NEDOREPO |
||
3004 | // if not pentagon-1024 or pentevo (atm3) --(added by lvd)-- or profi with #DFFD.4 set, apply lock |
||
3005 | // 0.39.0 |
||
3006 | // if (!((conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
3007 | // (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)))) molodcov_alex |
||
3008 | if (!( (conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
3009 | (conf.mem_model == MM_ATM3) || |
||
3010 | (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)) |
||
3011 | )) // molodcov_alex |
||
3012 | return; |
||
3013 | } |
||
3014 | //--------------------------------------------------------- |
||
3015 | if ((comp.p7FFD ^ val) & 0x08) |
||
3016 | update_screen(); |
||
3017 | //--------------------------------------------------------- |
||
3018 | comp.p7FFD = val; |
||
3019 | set_banks(); |
||
3020 | return; |
||
3021 | } |
||
3022 | //------------------------------------------------------------- |
||
3023 | if ( dc_out__AY_TS_TSFM_nedoSAA_etc( port, val )) return; // AY_TS_TSFM_nedoSAA_etc |
||
3024 | //------------------------------------------------------------- |
||
3025 | // � ����� �����? |
||
3026 | // ������ � �� �������� �_� |
||
3027 | return; |
||
3028 | } |
||
3029 | break; |
||
3030 | //===================================================================== |
||
3031 | case MM_ATM3: |
||
3032 | // #xD |
||
3033 | if (!(port & 2)) |
||
3034 | { |
||
3035 | //------------------------------------------------------------- |
||
3036 | if ( dc_out__Covox_DD( port, val )) return; // Covox_DD |
||
3037 | //------------------------------------------------------------- |
||
3038 | if (!(port & 0x8000)) // zx128 port |
||
3039 | { |
||
3040 | // 0001xxxxxxxxxx0x (bcig4) // 1FFD |
||
3041 | // 0010xxxxxxxxxx0x (bcig4) // 2FFD |
||
3042 | // 0011xxxxxxxxxx0x (bcig4) // 3FFD |
||
3043 | //--------------------------------------------------------- |
||
3044 | // 7FFD |
||
3045 | if (comp.p7FFD & 0x20) |
||
3046 | { // 48k lock |
||
3047 | if ((comp.pEFF7 & EFF7_LOCKMEM) ) // lvd added eff7 to atm3 //&& conf.mem_model == MM_ATM3 |
||
3048 | return; |
||
3049 | |||
3050 | // 0.39.0 |
||
3051 | // if not pentagon-1024 or profi with #DFFD.4 set, apply lock |
||
3052 | // NEDOREPO |
||
3053 | // if not pentagon-1024 or pentevo (atm3) --(added by lvd)-- or profi with #DFFD.4 set, apply lock |
||
3054 | //0.39.0 |
||
3055 | // if (!((conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
3056 | // (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)))) molodcov_alex |
||
3057 | if (!( (conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
3058 | (conf.mem_model == MM_ATM3) || |
||
3059 | (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)) |
||
3060 | )) // molodcov_alex |
||
3061 | return; |
||
3062 | } |
||
3063 | //--------------------------------------------------------- |
||
3064 | if ((comp.p7FFD ^ val) & 0x08) |
||
3065 | update_screen(); |
||
3066 | //--------------------------------------------------------- |
||
3067 | comp.p7FFD = val; |
||
3068 | set_banks(); |
||
3069 | return; |
||
3070 | } |
||
3071 | //------------------------------------------------------------- |
||
3072 | if ( dc_out__AY_TS_TSFM_nedoSAA_etc( port, val )) return; // AY_TS_TSFM_nedoSAA_etc |
||
3073 | //------------------------------------------------------------- |
||
3074 | // � ����� �����? |
||
3075 | // ������ � �� �������� �_� |
||
3076 | return; |
||
3077 | } |
||
3078 | break; |
||
3079 | //===================================================================== |
||
3080 | case MM_KAY: |
||
3081 | // #xD |
||
3082 | if (!(port & 2)) |
||
3083 | { |
||
3084 | //------------------------------------------------------------- |
||
3085 | if ( dc_out__Covox_DD( port, val )) return; // Covox_DD |
||
3086 | //------------------------------------------------------------- |
||
3087 | if (!(port & 0x8000)) // zx128 port |
||
3088 | { |
||
3089 | // 0001xxxxxxxxxx0x (bcig4) // 1FFD |
||
3090 | // 0010xxxxxxxxxx0x (bcig4) // 2FFD |
||
3091 | // 0011xxxxxxxxxx0x (bcig4) // 3FFD |
||
3092 | //--------------------------------------------------------- |
||
3093 | if ((port & 0xC003) == (0x1FFD & 0xC003)) //&& conf.mem_model == MM_KAY |
||
3094 | { |
||
3095 | //goto set1FFD; |
||
3096 | //set1FFD: |
||
3097 | comp.p1FFD = val; |
||
3098 | set_banks(); |
||
3099 | return; |
||
3100 | } |
||
3101 | //--------------------------------------------------------- |
||
3102 | // 7FFD |
||
3103 | if (comp.p7FFD & 0x20) |
||
3104 | { // 48k lock |
||
3105 | // 0.39.0 |
||
3106 | // if not pentagon-1024 or profi with #DFFD.4 set, apply lock |
||
3107 | // NEDOREPO |
||
3108 | // if not pentagon-1024 or pentevo (atm3) --(added by lvd)-- or profi with #DFFD.4 set, apply lock |
||
3109 | // 0.39.0 |
||
3110 | // if (!((conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
3111 | // (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)))) molodcov_alex |
||
3112 | if (!( (conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
3113 | (conf.mem_model == MM_ATM3) || |
||
3114 | (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)) |
||
3115 | )) // molodcov_alex |
||
3116 | return; |
||
3117 | } |
||
3118 | //--------------------------------------------------------- |
||
3119 | if ((comp.p7FFD ^ val) & 0x08) |
||
3120 | update_screen(); |
||
3121 | //--------------------------------------------------------- |
||
3122 | comp.p7FFD = val; |
||
3123 | set_banks(); |
||
3124 | return; |
||
3125 | } |
||
3126 | //------------------------------------------------------------- |
||
3127 | if ( dc_out__AY_TS_TSFM_nedoSAA_etc( port, val )) return; // AY_TS_TSFM_nedoSAA_etc |
||
3128 | //------------------------------------------------------------- |
||
3129 | // � ����� �����? |
||
3130 | // ������ � �� �������� �_� |
||
3131 | return; |
||
3132 | } |
||
3133 | break; |
||
3134 | //===================================================================== |
||
3135 | case MM_PLUS3: |
||
3136 | // #xD |
||
3137 | if (!(port & 2)) |
||
3138 | { |
||
3139 | //------------------------------------------------------------- |
||
3140 | if ( dc_out__Covox_DD( port, val )) return; // Covox_DD |
||
3141 | //------------------------------------------------------------- |
||
3142 | if (!(port & 0x8000)) // zx128 port |
||
3143 | { |
||
3144 | // 0001xxxxxxxxxx0x (bcig4) // 1FFD |
||
3145 | // 0010xxxxxxxxxx0x (bcig4) // 2FFD |
||
3146 | // 0011xxxxxxxxxx0x (bcig4) // 3FFD |
||
3147 | //--------------------------------------------------------- |
||
3148 | if ((port & (3 << 14)) == 0) // && conf.mem_model == MM_PLUS3 |
||
3149 | { |
||
3150 | unsigned Idx = (port >> 12) & 3; |
||
3151 | switch(Idx) |
||
3152 | { |
||
3153 | case 1: // 1FFD |
||
3154 | //goto set1FFD; |
||
3155 | //set1FFD: |
||
3156 | comp.p1FFD = val; |
||
3157 | set_banks(); |
||
3158 | return; |
||
3159 | case 3: // 3FFD |
||
3160 | Upd765.out(val); |
||
3161 | return; |
||
3162 | } |
||
3163 | } |
||
3164 | //--------------------------------------------------------- |
||
3165 | // 7FFD |
||
3166 | if (comp.p7FFD & 0x20) |
||
3167 | { // 48k lock |
||
3168 | // 0.39.0 |
||
3169 | // if not pentagon-1024 or profi with #DFFD.4 set, apply lock |
||
3170 | // NEDOREPO |
||
3171 | // if not pentagon-1024 or pentevo (atm3) --(added by lvd)-- or profi with #DFFD.4 set, apply lock |
||
3172 | // 0.39.0 |
||
3173 | // if (!((conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
3174 | // (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)))) molodcov_alex |
||
3175 | if (!( (conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
3176 | (conf.mem_model == MM_ATM3) || |
||
3177 | (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)) |
||
3178 | )) // molodcov_alex |
||
3179 | return; |
||
3180 | } |
||
3181 | //--------------------------------------------------------- |
||
3182 | if ((comp.p7FFD ^ val) & 0x08) |
||
3183 | update_screen(); |
||
3184 | //--------------------------------------------------------- |
||
3185 | comp.p7FFD = val; |
||
3186 | set_banks(); |
||
3187 | return; |
||
3188 | } |
||
3189 | //------------------------------------------------------------- |
||
3190 | if ( dc_out__AY_TS_TSFM_nedoSAA_etc( port, val )) return; // AY_TS_TSFM_nedoSAA_etc |
||
3191 | //------------------------------------------------------------- |
||
3192 | // � ����� �����? |
||
3193 | // ������ � �� �������� �_� |
||
3194 | return; |
||
3195 | } |
||
3196 | break; |
||
3197 | //===================================================================== |
||
3198 | case MM_QUORUM: |
||
3199 | // #xD |
||
3200 | if (!(port & 2)) |
||
3201 | { |
||
3202 | //------------------------------------------------------------- |
||
3203 | if ( dc_out__Covox_DD( port, val )) return; // Covox_DD |
||
3204 | //------------------------------------------------------------- |
||
3205 | if (!(port & 0x8000)) // zx128 port |
||
3206 | { |
||
3207 | // 0001xxxxxxxxxx0x (bcig4) // 1FFD |
||
3208 | // 0010xxxxxxxxxx0x (bcig4) // 2FFD |
||
3209 | // 0011xxxxxxxxxx0x (bcig4) // 3FFD |
||
3210 | //--------------------------------------------------------- |
||
3211 | // 0xxxxxxxxxx11x0x |
||
3212 | if ((port & 0x801A) != (0x7FFD & 0x801A)) // && (conf.mem_model == MM_QUORUM |
||
3213 | return; |
||
3214 | //--------------------------------------------------------- |
||
3215 | // 7FFD |
||
3216 | if (comp.p7FFD & 0x20) |
||
3217 | { // 48k lock |
||
3218 | // 0.39.0 |
||
3219 | // if not pentagon-1024 or profi with #DFFD.4 set, apply lock |
||
3220 | // NEDOREPO |
||
3221 | // if not pentagon-1024 or pentevo (atm3) --(added by lvd)-- or profi with #DFFD.4 set, apply lock |
||
3222 | // 0.39.0 |
||
3223 | // if (!((conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
3224 | // (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)))) molodcov_alex |
||
3225 | if (!( (conf.ramsize == 1024 && conf.mem_model == MM_PENTAGON) || |
||
3226 | (conf.mem_model == MM_ATM3) || |
||
3227 | (conf.mem_model == MM_PROFI && (comp.pDFFD & 0x10)) |
||
3228 | )) // molodcov_alex |
||
3229 | return; |
||
3230 | } |
||
3231 | //--------------------------------------------------------- |
||
3232 | if ((comp.p7FFD ^ val) & 0x08) |
||
3233 | update_screen(); |
||
3234 | //--------------------------------------------------------- |
||
3235 | comp.p7FFD = val; |
||
3236 | set_banks(); |
||
3237 | return; |
||
3238 | } |
||
3239 | //------------------------------------------------------------- |
||
3240 | // 1x0xxxxxxxx11x0x |
||
3241 | if ((port & 0xA01A) == (0x80FD & 0xA01A)) // && conf.mem_model == MM_QUORUM |
||
3242 | { |
||
3243 | comp.p80FD = val; |
||
3244 | set_banks(); |
||
3245 | return; |
||
3246 | } |
||
3247 | //------------------------------------------------------------- |
||
3248 | if ( dc_out__AY_TS_TSFM_nedoSAA_etc( port, val )) return; // AY_TS_TSFM_nedoSAA_etc |
||
3249 | //------------------------------------------------------------- |
||
3250 | // � ����� �����? |
||
3251 | // ������ � �� �������� �_� |
||
3252 | return; |
||
3253 | } |
||
3254 | break; |
||
3255 | //===================================================================== |
||
3256 | } |
||
3257 | |||
3258 | //----------------------------------------------------------------------------- |
||
3259 | // ����� ����� ����� |
||
3260 | //----------------------------------------------------------------------------- |
||
3261 | |||
3262 | //------------------------------------------------------------- |
||
3263 | if ( dc_out__Soundrive( port, val )) return; // Soundrive |
||
3264 | //------------------------------------------------------------- |
||
3265 | if ( dc_out__Covox_FB( port, val )) return; // Covox FB |
||
3266 | //------------------------------------------------------------- |
||
3267 | if ( dc_out__ZXM_saa1099( port, val )) return; // ZXM saa1099 |
||
3268 | //------------------------------------------------------------- |
||
3269 | |||
3270 | |||
3271 | |||
3272 | //----------------------------------------------------------------------------- |
||
3273 | // ����� ������������������ |
||
3274 | //----------------------------------------------------------------------------- |
||
3275 | |||
3276 | |||
3277 | |||
3278 | //������ � emul.h |
||
3279 | switch (conf.mem_model) |
||
3280 | { |
||
3281 | //===================================================================== |
||
3282 | case MM_PENTAGON: |
||
3283 | //--------------------------------------------------------------------- |
||
3284 | if (port == 0xEFF7) // && conf.mem_model == MM_PENTAGON, MM_ATM3, MM_ATM710 |
||
3285 | { |
||
3286 | unsigned char oldpEFF7 = comp.pEFF7; //Alone Coder 0.36.4 |
||
3287 | comp.pEFF7 = (comp.pEFF7 & conf.EFF7_mask) | (val & ~conf.EFF7_mask); |
||
3288 | //------------------------------------------------------------- |
||
3289 | comp.pEFF7 |= EFF7_GIGASCREEN; // [vv] disable turbo |
||
3290 | // if ((comp.pEFF7 ^ oldpEFF7) & EFF7_GIGASCREEN) |
||
3291 | // { |
||
3292 | // conf.frame = frametime; |
||
3293 | // if ((conf.mem_model == MM_PENTAGON)&&(comp.pEFF7 & EFF7_GIGASCREEN))conf.frame = 71680; |
||
3294 | // apply_sound(); |
||
3295 | // } //Alone Coder removed 0.37.1 |
||
3296 | //------------------------------------------------------------- |
||
3297 | if (!(comp.pEFF7 & EFF7_4BPP)) |
||
3298 | { |
||
3299 | temp.offset_vscroll = 0; |
||
3300 | temp.offset_vscroll_prev = 0; |
||
3301 | temp.offset_hscroll = 0; |
||
3302 | temp.offset_hscroll_prev = 0; |
||
3303 | } |
||
3304 | //------------------------------------------------------------- |
||
3305 | if ((comp.pEFF7 ^ oldpEFF7) & (EFF7_ROCACHE | EFF7_LOCKMEM)) |
||
3306 | set_banks(); //Alone Coder 0.36.4 |
||
3307 | //------------------------------------------------------------- |
||
3308 | return; |
||
3309 | } |
||
3310 | //----------------------------------------------------------------- |
||
3311 | if (conf.cmos && (comp.pEFF7 & EFF7_CMOS)) // && conf.mem_model == MM_PENTAGON |
||
3312 | { //��� ��������� ������ � (comp.pEFF7 & EFF7_CMOS) |
||
3313 | |||
3314 | unsigned mask = (conf.mem_model == MM_ATM3 && (comp.flags & CF_DOSPORTS)) ? ~0x100U : 0xFFFF; |
||
3315 | |||
3316 | //------------------------------------------------------------- |
||
3317 | if (port == (0xDFF7 & mask)) |
||
3318 | { |
||
3319 | comp.cmos_addr = val; |
||
3320 | return; |
||
3321 | } |
||
3322 | //------------------------------------------------------------- |
||
3323 | if (port == (0xBFF7 & mask)) |
||
3324 | { |
||
3325 | cmos_write(val); //��� MM_PENTAGON ��� � 0.39.0 |
||
3326 | return; |
||
3327 | } |
||
3328 | //------------------------------------------------------------- |
||
3329 | } |
||
3330 | //----------------------------------------------------------------- |
||
3331 | break; |
||
3332 | //===================================================================== |
||
3333 | // case MM_SCORP: |
||
3334 | // break; |
||
3335 | // //--------------------------------------------------------------------- |
||
3336 | // case MM_PROFSCORP: |
||
3337 | // break; |
||
3338 | // //--------------------------------------------------------------------- |
||
3339 | // case MM_PROFI: |
||
3340 | // break; |
||
3341 | // //--------------------------------------------------------------------- |
||
3342 | // case MM_ATM450: |
||
3343 | // break; |
||
3344 | //===================================================================== |
||
3345 | case MM_ATM710: |
||
3346 | //----------------------------------------------------------------- |
||
3347 | if (port == 0xEFF7) // && conf.mem_model == MM_PENTAGON, MM_ATM3, MM_ATM710 |
||
3348 | { // lvd added eff7 to atm3 NEDOREPO |
||
3349 | // [NS] ���� �� �������, �� � ���� ��� ���2 ??? o_O |
||
3350 | // ������ ����� �����������???? |
||
3351 | unsigned char oldpEFF7 = comp.pEFF7; //Alone Coder 0.36.4 |
||
3352 | comp.pEFF7 = (comp.pEFF7 & conf.EFF7_mask) | (val & ~conf.EFF7_mask); |
||
3353 | //------------------------------------------------------------- |
||
3354 | if (conf.mem_model == MM_ATM710) //NEDOREPO |
||
3355 | return; |
||
3356 | //------------------------------------------------------------- |
||
3357 | // ��������� !!! |
||
3358 | comp.pEFF7 |= EFF7_GIGASCREEN; // [vv] disable turbo |
||
3359 | // if ((comp.pEFF7 ^ oldpEFF7) & EFF7_GIGASCREEN) |
||
3360 | // { |
||
3361 | // conf.frame = frametime; |
||
3362 | // if ((conf.mem_model == MM_PENTAGON)&&(comp.pEFF7 & EFF7_GIGASCREEN))conf.frame = 71680; |
||
3363 | // apply_sound(); |
||
3364 | // } //Alone Coder removed 0.37.1 |
||
3365 | //------------------------------------------------------------- |
||
3366 | // ��������� !!! |
||
3367 | if (!(comp.pEFF7 & EFF7_4BPP)) |
||
3368 | { |
||
3369 | temp.offset_vscroll = 0; |
||
3370 | temp.offset_vscroll_prev = 0; |
||
3371 | temp.offset_hscroll = 0; |
||
3372 | temp.offset_hscroll_prev = 0; |
||
3373 | } |
||
3374 | //------------------------------------------------------------- |
||
3375 | // ��������� !!! |
||
3376 | if ((comp.pEFF7 ^ oldpEFF7) & (EFF7_ROCACHE | EFF7_LOCKMEM)) |
||
3377 | set_banks(); //Alone Coder 0.36.4 |
||
3378 | //------------------------------------------------------------- |
||
3379 | return; |
||
3380 | } |
||
3381 | //----------------------------------------------------------------- |
||
3382 | if (conf.cmos && (comp.pEFF7 & EFF7_CMOS)) //conf.mem_model == MM_ATM710 |
||
3383 | { //��� MM_ATM710 ������ � (comp.pEFF7 & EFF7_CMOS) !!! (������ ������ ������ ��� MM_ATM710) |
||
3384 | |||
3385 | unsigned mask = (conf.mem_model == MM_ATM3 && (comp.flags & CF_DOSPORTS)) ? ~0x100U : 0xFFFF; |
||
3386 | |||
3387 | //------------------------------------------------------------- |
||
3388 | if (port == (0xDFF7 & mask)) |
||
3389 | { |
||
3390 | comp.cmos_addr = val; |
||
3391 | return; |
||
3392 | } |
||
3393 | //------------------------------------------------------------- |
||
3394 | if (port == (0xBFF7 & mask)) |
||
3395 | { |
||
3396 | cmos_write(val); ////��� MM_ATM710 ��� � 0.39.0 |
||
3397 | return; |
||
3398 | } |
||
3399 | //------------------------------------------------------------- |
||
3400 | } |
||
3401 | //----------------------------------------------------------------- |
||
3402 | break; |
||
3403 | //===================================================================== |
||
3404 | case MM_ATM3: |
||
3405 | //----------------------------------------------------------------------------- |
||
3406 | if (port == 0xEFF7) // && conf.mem_model == MM_PENTAGON, MM_ATM3, MM_ATM710 |
||
3407 | { // lvd added eff7 to atm3 NEDOREPO |
||
3408 | unsigned char oldpEFF7 = comp.pEFF7; //Alone Coder 0.36.4 |
||
3409 | comp.pEFF7 = (comp.pEFF7 & conf.EFF7_mask) | (val & ~conf.EFF7_mask); |
||
3410 | //------------------------------------------------------------- |
||
3411 | comp.pEFF7 |= EFF7_GIGASCREEN; // [vv] disable turbo |
||
3412 | // if ((comp.pEFF7 ^ oldpEFF7) & EFF7_GIGASCREEN) |
||
3413 | // { |
||
3414 | // conf.frame = frametime; |
||
3415 | // if ((conf.mem_model == MM_PENTAGON)&&(comp.pEFF7 & EFF7_GIGASCREEN))conf.frame = 71680; |
||
3416 | // apply_sound(); |
||
3417 | // } //Alone Coder removed 0.37.1 |
||
3418 | //------------------------------------------------------------- |
||
3419 | if (!(comp.pEFF7 & EFF7_4BPP)) |
||
3420 | { |
||
3421 | temp.offset_vscroll = 0; |
||
3422 | temp.offset_vscroll_prev = 0; |
||
3423 | temp.offset_hscroll = 0; |
||
3424 | temp.offset_hscroll_prev = 0; |
||
3425 | } |
||
3426 | //------------------------------------------------------------- |
||
3427 | if ((comp.pEFF7 ^ oldpEFF7) & (EFF7_ROCACHE | EFF7_LOCKMEM)) |
||
3428 | set_banks(); //Alone Coder 0.36.4 |
||
3429 | //------------------------------------------------------------- |
||
3430 | return; |
||
3431 | } |
||
3432 | //----------------------------------------------------------------- |
||
3433 | if (conf.cmos) //&& conf.mem_model == MM_ATM3 |
||
3434 | { //��� MM_ATM3 ������ ������ �������� (comp.pEFF7 & EFF7_CMOS) !!!! |
||
3435 | |||
3436 | unsigned mask = ((conf.mem_model == MM_ATM3) && (comp.flags & CF_DOSPORTS)) ? ~0x100U : 0xFFFF; |
||
3437 | |||
3438 | //------------------------------------------------------------- |
||
3439 | if (port == (0xDFF7 & mask)) |
||
3440 | { |
||
3441 | comp.cmos_addr = val; |
||
3442 | return; |
||
3443 | } |
||
3444 | //------------------------------------------------------------- |
||
3445 | if (port == (0xBFF7 & mask)) |
||
3446 | { |
||
3447 | //cmos_write(val); //���� � 0.39.0 |
||
3448 | //return; |
||
3449 | |||
3450 | // ���� ���� ����������� (������� � NEDOREPO) |
||
3451 | // if (comp.cmos_addr >= 0xF0 && (val & 0xf0) == 0x10 && conf.mem_model == MM_ATM3) |
||
3452 | // { |
||
3453 | // comp.fddIO2Ram_mask=val; |
||
3454 | // } |
||
3455 | // else |
||
3456 | if (comp.cmos_addr >= 0xF0 && val <= 2) // && conf.mem_model == MM_ATM3 |
||
3457 | {//thims added |
||
3458 | if (val < 2) |
||
3459 | { |
||
3460 | input.buffer_enabled = false; |
||
3461 | static unsigned version = 0; |
||
3462 | |||
3463 | if (!version) |
||
3464 | { |
||
3465 | unsigned day, year; |
||
3466 | char month[8]; |
||
3467 | static const char months[] = "JanFebMarAprMayJunJulAugSepOctNovDec"; |
||
3468 | sscanf(__DATE__, "%s %d %d", month, &day, &year); |
||
3469 | version = day | ((strstr( months, month) - months) / 3 + 1) << 5 | (year - 2000) << 9; |
||
3470 | } |
||
3471 | |||
3472 | //strcpy((char*)cmos + 0xF0, "UnrealSpeccy"); |
||
3473 | strcpy( (char*) cmos + 0xF0, "Unreal_NS"); //[NS] |
||
3474 | *(unsigned*) (cmos + 0xFC) = version; |
||
3475 | } |
||
3476 | else |
||
3477 | { |
||
3478 | input.buffer_enabled = true; |
||
3479 | } |
||
3480 | } |
||
3481 | else |
||
3482 | { |
||
3483 | cmos_write( val); |
||
3484 | } |
||
3485 | return; |
||
3486 | } |
||
3487 | //------------------------------------------------------------- |
||
3488 | } |
||
3489 | //----------------------------------------------------------------- |
||
3490 | break; |
||
3491 | //===================================================================== |
||
3492 | // case MM_KAY: |
||
3493 | // break; |
||
3494 | // //----------------------------------------------------------------- |
||
3495 | // case MM_PLUS3: |
||
3496 | // break; |
||
3497 | // //----------------------------------------------------------------- |
||
3498 | // case MM_QUORUM: |
||
3499 | // break; |
||
3500 | // //--------------------------------------------------------------------- |
||
3501 | } |
||
3502 | |||
3503 | |||
3504 | //----------------------------------------------------------------------------- |
||
3505 | // ����� � ����� ����� ����� ����� |
||
3506 | //----------------------------------------------------------------------------- |
||
3507 | |||
3508 | //------------------------------------------------------------- |
||
3509 | if ( dc_out__Modem_HZ( port, val )) return; // Modem_HZ |
||
3510 | //------------------------------------------------------------- |
||
3511 | |||
3512 | } //out end |
||
3513 | //============================================================================= |
||
3514 | |||
3515 | |||
3516 | |||
3517 | |||
3518 | |||
3519 | |||
3520 | |||
3521 | |||
3522 | |||
3523 | |||
3524 | |||
3525 | |||
3526 | |||
3527 | |||
3528 | |||
3529 | |||
3530 | |||
3531 | |||
3532 | |||
3533 | |||
3534 | |||
3535 | |||
3536 | |||
3537 | |||
3538 | |||
3539 | |||
3540 | |||
3541 | |||
3542 | |||
3543 | |||
3544 | |||
3545 | |||
3546 | |||
3547 | |||
3548 | |||
3549 | |||
3550 | |||
3551 | |||
3552 | |||
3553 | |||
3554 | |||
3555 | |||
3556 | //============================================================================= |
||
3557 | __inline unsigned char in1(unsigned port) |
||
3558 | { |
||
3559 | port &= 0xFFFF; |
||
3560 | brk_port_in = port; |
||
3561 | |||
3562 | u8 p1 = (port & 0xFF); |
||
3563 | |||
3564 | /* |
||
3565 | if((port & 0xFF) == 0xF0) |
||
3566 | __debugbreak(); |
||
3567 | |||
3568 | if((comp.flags & CF_DOSPORTS) && port == 0xFADF) |
||
3569 | __debugbreak(); |
||
3570 | */ |
||
3571 | |||
3572 | // � ������ ���������� ������ �� ������ 8��� |
||
3573 | |||
3574 | |||
3575 | |||
3576 | |||
3577 | //----------------------------------------------------------------------------- |
||
3578 | { register int in_v = dc_in__atm620_xt_keyb( port ); if (in_v >= 0) return in_v; } // ATM620 XT Keyb |
||
3579 | //----------------------------------------------------------------------------- |
||
3580 | |||
3581 | |||
3582 | //----------------------------------------------------------------------------- |
||
3583 | { register int in_v = dc_in__ZXI_TSFM_Mirror( port ); if (in_v >= 0) return in_v; } // ZXI TSFM |
||
3584 | //----------------------------------------------------------------------------- |
||
3585 | { register int in_v = dc_in__Ula_Plus( port ); if (in_v >= 0) return in_v; } // ULA PLUS |
||
3586 | //----------------------------------------------------------------------------- |
||
3587 | { register int in_v = dc_in__NGS( port, p1 ); if (in_v >= 0) return in_v; } // NGS |
||
3588 | //----------------------------------------------------------------------------- |
||
3589 | { register int in_v = dc_in__zc( port ); if (in_v >= 0) return in_v; } // Z-Controller |
||
3590 | //----------------------------------------------------------------------------- |
||
3591 | { register int in_v = dc_in__wiznet( port ); if (in_v >= 0) return in_v; } // Wiznet |
||
3592 | //----------------------------------------------------------------------------- |
||
3593 | |||
3594 | |||
3595 | |||
3596 | |||
3597 | //------------------------------------------------------------------------- |
||
3598 | if (conf.mem_model == MM_ATM3) |
||
3599 | { |
||
3600 | //--------------------------------------------------------------------- |
||
3601 | // ���� ���������� ���3 |
||
3602 | if ((port & 0xFF) == 0xBF) |
||
3603 | return comp.pBF; |
||
3604 | //--------------------------------------------------------------------- |
||
3605 | // xxBE - ���� ������ (15.05.2014) |
||
3606 | // xxBD - ������ ������������ ���������� zxevo_base_configuration.pdf (07.01.2022) |
||
3607 | // if ( (port & 0xFF) == 0xBE) |
||
3608 | if (((port & 0xFF) == 0xBE) || ((port & 0xFF) == 0xBD)) //NEDOREPO |
||
3609 | { |
||
3610 | u8 port_hi = (port >> 8) & 0xFF; |
||
3611 | //----------------------------------------------------------------- |
||
3612 | // 00BE...07BE ������ �� ���������������� ������ �������� |
||
3613 | if ((port_hi & ~7) == 0) |
||
3614 | { |
||
3615 | unsigned PgIdx = port_hi & 7; |
||
3616 | return (comp.pFFF7[PgIdx] & 0xFF) ^ 0xFF; |
||
3617 | } |
||
3618 | //----------------------------------------------------------------- |
||
3619 | switch (port_hi) |
||
3620 | { |
||
3621 | //------------------------------------------------------------- |
||
3622 | // ram/rom |
||
3623 | case 0x08: |
||
3624 | { |
||
3625 | u8 RamRomMask = 0; |
||
3626 | for(unsigned i = 0; i < 8; i++) |
||
3627 | RamRomMask |= ((comp.pFFF7[i] >> 8) & 1) << i; |
||
3628 | return ~RamRomMask; |
||
3629 | } |
||
3630 | //------------------------------------------------------------- |
||
3631 | // dos7ffd |
||
3632 | case 0x09: |
||
3633 | { |
||
3634 | u8 RamRomMask = 0; |
||
3635 | for(unsigned i = 0; i < 8; i++) |
||
3636 | RamRomMask |= ((comp.pFFF7[i] >> 9) & 1) << i; |
||
3637 | return ~RamRomMask; |
||
3638 | } |
||
3639 | //------------------------------------------------------------- |
||
3640 | // ��������� ���������� �������� � ���� #7FFD |
||
3641 | case 0x0A: |
||
3642 | return comp.p7FFD; |
||
3643 | //------------------------------------------------------------- |
||
3644 | // ��������� ���������� �������� � ���� #EFF7 |
||
3645 | // case 0x0B:; //����������� � 0.39.0 |
||
3646 | case 0x0B: //NEDOREPO |
||
3647 | return comp.pEFF7; // lvd - added EFF7 reading in pentevo (atm3) |
||
3648 | //------------------------------------------------------------- |
||
3649 | // ��������� ���������� �������� � ���� #xx77. |
||
3650 | case 0x0C: |
||
3651 | // lvd: fixed bug with no-anding bits from aFF77, added CF_TRDOS to bit 4 |
||
3652 | // lvd: changed bit 4 to dos state, remembered during nmi |
||
3653 | // |
||
3654 | // return u8( ((( comp.aFF77 >> 14) & 1) << 7 ) | // 0.39.0 |
||
3655 | // ((( comp.aFF77 >> 9) & 1) << 6 ) | |
||
3656 | // ((( comp.aFF77 >> 8) & 1) << 5 ) | |
||
3657 | // ( (comp.flags & CF_TRDOS) ? 0x10 : |
||
3658 | // 0 ) | |
||
3659 | // ( comp.pFF77 & 0xF) |
||
3660 | // ); |
||
3661 | return ( ((( comp.aFF77 >> 14) << 7) & 0x0080 ) | // NEDOREPO |
||
3662 | ((( comp.aFF77 >> 9 ) << 6) & 0x0040 ) | |
||
3663 | ((( comp.aFF77 >> 8 ) << 5) & 0x0020 ) | |
||
3664 | ( trdos_in_nmi ? 0x0010 : |
||
3665 | |||
3666 | ( comp.pFF77 & 0x0F ) |
||
3667 | ); |
||
3668 | //------------------------------------------------------------- |
||
3669 | // ������ �������� ������������� ����� (��� ������ �������) |
||
3670 | case 0x0D: |
||
3671 | return atm_readpal(); |
||
3672 | //------------------------------------------------------------- |
||
3673 | // ������ �������� ������������� ����� � ��������� ������ (��� ���������� ������) |
||
3674 | case 0x0E: |
||
3675 | return zxevo_readfont(); |
||
3676 | //------------------------------------------------------------- |
||
3677 | // ������ ���������� �������������� ����� ������� |
||
3678 | // case 0x0F: |
||
3679 | //------------------------------------------------------------- |
||
3680 | // breakpoint address readback LOW |
||
3681 | case 0x10: |
||
3682 | return comp.brk_addr & 0x00FF; |
||
3683 | //------------------------------------------------------------- |
||
3684 | // breakpoint address readback HIGH |
||
3685 | case 0x11: |
||
3686 | return (comp.brk_addr >> 8) & 0x00FF; |
||
3687 | //------------------------------------------------------------- |
||
3688 | // ���� ������ �� ������ |
||
3689 | // case 0x12: |
||
3690 | //------------------------------------------------------------- |
||
3691 | // read fddIO2Ram_mask |
||
3692 | case 0x13: |
||
3693 | return comp.fddIO2Ram_mask; |
||
3694 | //------------------------------------------------------------- |
||
3695 | // read scanline (UNDOC) !!! |
||
3696 | case 0x14: |
||
3697 | return ((cpu.t / 224) >> 1) & 0x00FF; |
||
3698 | //------------------------------------------------------------- |
||
3699 | } |
||
3700 | } |
||
3701 | //--------------------------------------------------------------------- |
||
3702 | } |
||
3703 | //------------------------------------------------------------------------- |
||
3704 | |||
3705 | |||
3706 | |||
3707 | //----------------------------------------------------------------------------- |
||
3708 | { register int in_v = dc_in__NEMO_DivIDE( port ); if (in_v >= 0) return in_v; } // NEMO DivIDE |
||
3709 | //----------------------------------------------------------------------------- |
||
3710 | |||
3711 | |||
3712 | //------------------------------------------------------------------------- |
||
3713 | // quorum additional keyboard port |
||
3714 | if (conf.mem_model == MM_QUORUM) |
||
3715 | { |
||
3716 | if ((port & 0xFF) == 0x7E) |
||
3717 | { |
||
3718 | u8 val = input.read_quorum( u8 (port >> 8)); |
||
3719 | return val; |
||
3720 | } |
||
3721 | } |
||
3722 | //------------------------------------------------------------------------- |
||
3723 | |||
3724 | |||
3725 | |||
3726 | |||
3727 | |||
3728 | |||
3729 | |||
3730 | |||
3731 | //----------------------------------------------------------------------------- |
||
3732 | // SHADOW PORTS - ������������������ |
||
3733 | //----------------------------------------------------------------------------- |
||
3734 | if (comp.flags & CF_DOSPORTS) |
||
3735 | { |
||
3736 | |||
3737 | |||
3738 | |||
3739 | //������ � emul.h |
||
3740 | switch (conf.mem_model) |
||
3741 | { |
||
3742 | //--------------------------------------------------------------------- |
||
3743 | // case MM_PENTAGON: |
||
3744 | // break; |
||
3745 | // //--------------------------------------------------------------------- |
||
3746 | // case MM_SCORP: |
||
3747 | // break; |
||
3748 | // //--------------------------------------------------------------------- |
||
3749 | // case MM_PROFSCORP: |
||
3750 | // break; |
||
3751 | //===================================================================== |
||
3752 | case MM_PROFI: |
||
3753 | // if (conf.mem_model == MM_PROFI) // molodcov_alex |
||
3754 | //----------------------------------------------------------------- |
||
3755 | // modified ports |
||
3756 | if ((comp.p7FFD & 0x10) && (comp.pDFFD & 0x20)) |
||
3757 | { |
||
3758 | //------------------------------------------------------------- |
||
3759 | // BDI ports |
||
3760 | if ((p1 & 0x9F) == 0x83) |
||
3761 | return comp.wd.in((p1 & 0x60) | 0x1F); // WD93 ports (1F, 3F, 7F) |
||
3762 | //------------------------------------------------------------- |
||
3763 | // port FF |
||
3764 | if ((p1 & 0xE3) == 0x23) |
||
3765 | return comp.wd.in(0xFF); |
||
3766 | //------------------------------------------------------------- |
||
3767 | // RTC |
||
3768 | if (conf.cmos) |
||
3769 | { |
||
3770 | if ((port & 0x9F) == 0x9F) |
||
3771 | { |
||
3772 | if (!(port & 0x20)) |
||
3773 | return cmos_read(); |
||
3774 | } |
||
3775 | } |
||
3776 | //------------------------------------------------------------- |
||
3777 | // |
||
3778 | // IDE_PROFI |
||
3779 | // Profi IDE ��� ��� |
||
3780 | // �� ������� � ����� ����� dc_in__Profi_IDE |
||
3781 | // ��� ����������� �������� ��������������� |
||
3782 | // |
||
3783 | //------------------------------------------------------------- |
||
3784 | } |
||
3785 | //----------------------------------------------------------------- |
||
3786 | // not? modified ports |
||
3787 | else |
||
3788 | { |
||
3789 | //------------------------------------------------------------- |
||
3790 | // BDI ports |
||
3791 | if ((p1 & 0x83) == 0x03) |
||
3792 | return comp.wd.in((p1 & 0x60) | 0x1F); // WD93 ports |
||
3793 | //------------------------------------------------------------- |
||
3794 | // port FF |
||
3795 | if ((p1 & 0xE3) == ((comp.pDFFD & 0x20) ? 0xA3 : |
||
3796 | 0xE3 |
||
3797 | )) |
||
3798 | return comp.wd.in(0xFF); |
||
3799 | //------------------------------------------------------------- |
||
3800 | } |
||
3801 | //----------------------------------------------------------------- |
||
3802 | |||
3803 | break; |
||
3804 | //===================================================================== |
||
3805 | // case MM_ATM450: |
||
3806 | // break; |
||
3807 | // //--------------------------------------------------------------------- |
||
3808 | // case MM_ATM710: |
||
3809 | // break; |
||
3810 | //===================================================================== |
||
3811 | case MM_ATM3: |
||
3812 | //----------------------------------------------------------------- |
||
3813 | // if (((p1 & 0x1F) == 0x0F) && (((p1 >> 5) - 1) < 5)) // 0.39.0 |
||
3814 | if (((p1 & 0x1F) == 0x0F) && !(((p1 >> 5) - 1) & 4)) //&& conf.mem_model == MM_ATM3 // NEDOREPO |
||
3815 | { |
||
3816 | // 2F = 001|01111b |
||
3817 | // 4F = 010|01111b |
||
3818 | // 6F = 011|01111b |
||
3819 | // 8F = 100|01111b |
||
3820 | // AF = 101|01111b //���� � NEDOREPO |
||
3821 | return comp.wd_shadow[(p1 >> 5) - 1]; |
||
3822 | } |
||
3823 | //----------------------------------------------------------------- |
||
3824 | break; |
||
3825 | //===================================================================== |
||
3826 | // case MM_KAY: |
||
3827 | // break; |
||
3828 | // //----------------------------------------------------------------- |
||
3829 | // case MM_PLUS3: |
||
3830 | // break; |
||
3831 | //----------------------------------------------------------------- |
||
3832 | case MM_QUORUM: |
||
3833 | //----------------------------------------------------------------- |
||
3834 | //conf.mem_model == MM_QUORUM /* && !(comp.p00 & Q_TR_DOS) */) // cpm ports |
||
3835 | if ((p1 & 0xFC) == 0x80) // 80, 81, 82, 83 |
||
3836 | { |
||
3837 | p1 = u8(((p1 & 3) << 5) | 0x1F); |
||
3838 | return comp.wd.in(p1); |
||
3839 | } |
||
3840 | //----------------------------------------------------------------- |
||
3841 | break; |
||
3842 | //--------------------------------------------------------------------- |
||
3843 | } |
||
3844 | |||
3845 | //----------------------------------------------------------------------------- |
||
3846 | // SHADOW PORTS - ����� |
||
3847 | //----------------------------------------------------------------------------- |
||
3848 | |||
3849 | |||
3850 | //----------------------------------------------------------------------------- |
||
3851 | { register int in_v = dc_in__ATM_IDE( port ); if (in_v >= 0) return in_v; } // ATM IDE |
||
3852 | //----------------------------------------------------------------------------- |
||
3853 | { register int in_v = dc_in__SMUC( port ); if (in_v >= 0) return in_v; } // SMUC |
||
3854 | //----------------------------------------------------------------------------- |
||
3855 | { register int in_v = dc_in__Profi_IDE( port, p1 ); if (in_v >= 0) return in_v; } // Profi IDE |
||
3856 | //----------------------------------------------------------------------------- |
||
3857 | |||
3858 | //--------------------------------------------------------------------- |
||
3859 | // |
||
3860 | // 1F = 0001|1111b |
||
3861 | // 3F = 0011|1111b |
||
3862 | // 5F = 0101|1111b |
||
3863 | // 7F = 0111|1111b |
||
3864 | // DF = 1101|1111b ���� ���� |
||
3865 | // FF = 1111|1111b |
||
3866 | // |
||
3867 | // not quorum |
||
3868 | // ��� ����? |
||
3869 | // if ((p1 & 0x9F) == 0x1F || p1 == 0xFF) // 1F, 3F, 5F, 7F, FF |
||
3870 | // return comp.wd.in(p1); 0.39.0 |
||
3871 | // |
||
3872 | // ����� ������� ��������������� ����������� ���� ������ ����� ������ |
||
3873 | if ((p1 & 0x9F) == 0x1F || p1 == 0xFF) |
||
3874 | {// 1F, 3F, 5F, 7F, FF |
||
3875 | if ( (comp.flags & CF_TRDOS) && |
||
3876 | conf.trdos_IORam && |
||
3877 | ((1<<comp.wd.drive)&comp.fddIO2Ram_mask) && |
||
3878 | (bankr[0] == base_dos_rom) |
||
3879 | ) |
||
3880 | { |
||
3881 | comp.fddIO2Ram_wr_disable = true; |
||
3882 | cpu.nmi_in_progress=conf.trdos_IORam; |
||
3883 | trdos_in_nmi = comp.flags & CF_TRDOS; |
||
3884 | set_banks(); |
||
3885 | return 0xff; |
||
3886 | } |
||
3887 | else |
||
3888 | { |
||
3889 | if (conf.trdos_IORam && (p1&0x80)) |
||
3890 | return (comp.wd.in(p1) & 0xE0) | comp.trdos_last_ff; |
||
3891 | |||
3892 | return comp.wd.in(p1); |
||
3893 | } |
||
3894 | } |
||
3895 | //--------------------------------------------------------------------- |
||
3896 | |||
3897 | |||
3898 | |||
3899 | |||
3900 | |||
3901 | } |
||
3902 | //----------------------------------------------------------------------------- |
||
3903 | // NO shadow ports (�����) |
||
3904 | //----------------------------------------------------------------------------- |
||
3905 | else |
||
3906 | { |
||
3907 | |||
3908 | //----------------------------------------------------------------------------- |
||
3909 | { register int in_v = dc_in__DivIDE( port ); if (in_v >= 0) return in_v; } // DivIDE |
||
3910 | //----------------------------------------------------------------------------- |
||
3911 | { register int in_v = dc_in__NEMO_IDE( port ); if (in_v >= 0) return in_v; } // NEMO IDE |
||
3912 | //----------------------------------------------------------------------------- |
||
3913 | |||
3914 | } |
||
3915 | |||
3916 | //----------------------------------------------------------------------------- |
||
3917 | // ����� NO shadow ports (�����) |
||
3918 | //----------------------------------------------------------------------------- |
||
3919 | |||
3920 | //----------------------------------------------------------------------------- |
||
3921 | { register int in_v = dc_in__Kempston_Mouse( port ); if (in_v >= 0) return in_v; } // Kempston Mouse |
||
3922 | //----------------------------------------------------------------------------- |
||
3923 | |||
3924 | |||
3925 | //----------------------------------------------------------------------------- |
||
3926 | |||
3927 | // if (((conf.mem_model != MM_ATM3) && !(port & 0x20)) || // ������� ������� �� ��������� |
||
3928 | // ((conf.mem_model == MM_ATM3) && (p1 == 0x1F || p1 == 0xDF))) // ��� ������� ���� ������������ |
||
3929 | |||
3930 | if ((conf.mem_model == MM_SCORP) || (conf.mem_model == MM_PROFSCORP)) |
||
3931 | { |
||
3932 | // � ������ ���� ����� �������� |
||
3933 | { register int in_v = dc_in__Kempston_Joystick_Scorp( port ); if (in_v >= 0) return in_v; } // Kempston Joystick Scorp |
||
3934 | } |
||
3935 | else |
||
3936 | { |
||
3937 | { register int in_v = dc_in__Kempston_Joystick( port ); if (in_v >= 0) return in_v; } // Kempston Joystick |
||
3938 | } |
||
3939 | //----------------------------------------------------------------------------- |
||
3940 | { register int in_v = dc_in__Fuller_Joystick( p1 ); if (in_v >= 0) return in_v; } // Fuller Joystick |
||
3941 | //----------------------------------------------------------------------------- |
||
3942 | |||
3943 | |||
3944 | |||
3945 | |||
3946 | //----------------------------------------------------------------------------- |
||
3947 | // Port FE - IN |
||
3948 | //-----------------------------------------------------------------------------v |
||
3949 | |||
3950 | // port #FE |
||
3951 | bool pFE; |
||
3952 | |||
3953 | // //������ � emul.h |
||
3954 | switch (conf.mem_model) |
||
3955 | { |
||
3956 | // //===================================================================== |
||
3957 | // case MM_PENTAGON: |
||
3958 | // DEFAULT |
||
3959 | // break; |
||
3960 | // //===================================================================== |
||
3961 | case MM_SCORP: |
||
3962 | //----------------------------------------------------------------- |
||
3963 | // scorp xx1xxx10 (sc16) // conf.mem_model == MM_SCORP, MM_PROFSCORP |
||
3964 | pFE = ((port & 0x23) == (0xFE & 0x23)) && !(comp.flags & CF_DOSPORTS); |
||
3965 | //----------------------------------------------------------------- |
||
3966 | if (pFE) |
||
3967 | { |
||
3968 | //------------------------------------------------------------- |
||
3969 | if ( ((cpu.pc & 0xFFFF) == 0x0564) && |
||
3970 | (bankr[0][0x0564] == 0x1F) && |
||
3971 | conf.tape_autostart && |
||
3972 | comp.tape.stopped |
||
3973 | ) |
||
3974 | { |
||
3975 | start_tape(); |
||
3976 | } |
||
3977 | //------------------------------------------------------------- |
||
3978 | u8 val = input.read(u8(port >> 8)); |
||
3979 | return val; |
||
3980 | //------------------------------------------------------------- |
||
3981 | } |
||
3982 | //----------------------------------------------------------------- |
||
3983 | break; |
||
3984 | // //===================================================================== |
||
3985 | case MM_PROFSCORP: |
||
3986 | //----------------------------------------------------------------- |
||
3987 | // scorp xx1xxx10 (sc16) // conf.mem_model == MM_SCORP, MM_PROFSCORP |
||
3988 | pFE = ((port & 0x23) == (0xFE & 0x23)) && !(comp.flags & CF_DOSPORTS); |
||
3989 | //----------------------------------------------------------------- |
||
3990 | if (pFE) |
||
3991 | { |
||
3992 | //------------------------------------------------------------- |
||
3993 | if ( ((cpu.pc & 0xFFFF) == 0x0564) && |
||
3994 | (bankr[0][0x0564] == 0x1F) && |
||
3995 | conf.tape_autostart && |
||
3996 | comp.tape.stopped |
||
3997 | ) |
||
3998 | { |
||
3999 | start_tape(); |
||
4000 | } |
||
4001 | //------------------------------------------------------------- |
||
4002 | u8 val = input.read(u8(port >> 8)); |
||
4003 | return val; |
||
4004 | //------------------------------------------------------------- |
||
4005 | } |
||
4006 | //----------------------------------------------------------------- |
||
4007 | break; |
||
4008 | // //===================================================================== |
||
4009 | // case MM_PROFI: |
||
4010 | // DEFAULT |
||
4011 | // break; |
||
4012 | // //===================================================================== |
||
4013 | case MM_ATM450: |
||
4014 | //----------------------------------------------------------------- |
||
4015 | // others xxxxxxx0 //DEFAULT |
||
4016 | pFE = !(port & 1); |
||
4017 | //----------------------------------------------------------------- |
||
4018 | if (pFE) |
||
4019 | { |
||
4020 | //------------------------------------------------------------- |
||
4021 | if ( ((cpu.pc & 0xFFFF) == 0x0564) && |
||
4022 | (bankr[0][0x0564] == 0x1F) && |
||
4023 | conf.tape_autostart && |
||
4024 | comp.tape.stopped |
||
4025 | ) |
||
4026 | { |
||
4027 | start_tape(); |
||
4028 | } |
||
4029 | //------------------------------------------------------------- |
||
4030 | u8 val = input.read(u8(port >> 8)); |
||
4031 | val = (val & 0x7F) | atm450_z(cpu.t); // conf.mem_model == MM_ATM450 |
||
4032 | return val; |
||
4033 | //------------------------------------------------------------- |
||
4034 | } |
||
4035 | //----------------------------------------------------------------- |
||
4036 | break; |
||
4037 | // //===================================================================== |
||
4038 | case MM_ATM710: |
||
4039 | //----------------------------------------------------------------- |
||
4040 | // others xxxxxxx0 //DEFAULT |
||
4041 | pFE = !(port & 1); |
||
4042 | //----------------------------------------------------------------- |
||
4043 | if (pFE) |
||
4044 | { |
||
4045 | //------------------------------------------------------------- |
||
4046 | if ( ((cpu.pc & 0xFFFF) == 0x0564) && |
||
4047 | (bankr[0][0x0564] == 0x1F) && |
||
4048 | conf.tape_autostart && |
||
4049 | comp.tape.stopped |
||
4050 | ) |
||
4051 | { |
||
4052 | start_tape(); |
||
4053 | } |
||
4054 | //------------------------------------------------------------- |
||
4055 | u8 val = input.read(u8(port >> 8)); |
||
4056 | if (conf.atm620_hl8_z) // ���������� ��� ������� MSX-DOS [NS] |
||
4057 | val = (val & 0xDF) | atm620_z(cpu.t); |
||
4058 | return val; |
||
4059 | //------------------------------------------------------------- |
||
4060 | } |
||
4061 | break; |
||
4062 | // //===================================================================== |
||
4063 | // case MM_ATM3: |
||
4064 | // DEFAULT |
||
4065 | // break; |
||
4066 | // //===================================================================== |
||
4067 | // case MM_KAY: |
||
4068 | // DEFAULT |
||
4069 | // break; |
||
4070 | // //===================================================================== |
||
4071 | // case MM_PLUS3: |
||
4072 | // DEFAULT |
||
4073 | // break; |
||
4074 | // //===================================================================== |
||
4075 | case MM_QUORUM: |
||
4076 | //----------------------------------------------------------------- |
||
4077 | // 1xx11xx0 //conf.mem_model == MM_QUORUM) |
||
4078 | pFE = ((port & 0x99) == (0xFE & 0x99)); |
||
4079 | //----------------------------------------------------------------- |
||
4080 | if (pFE) |
||
4081 | { |
||
4082 | //------------------------------------------------------------- |
||
4083 | if ( ((cpu.pc & 0xFFFF) == 0x0564) && |
||
4084 | (bankr[0][0x0564] == 0x1F) && |
||
4085 | conf.tape_autostart && |
||
4086 | comp.tape.stopped |
||
4087 | ) |
||
4088 | { |
||
4089 | start_tape(); |
||
4090 | } |
||
4091 | //------------------------------------------------------------- |
||
4092 | u8 val = input.read(u8(port >> 8)); |
||
4093 | return val; |
||
4094 | //------------------------------------------------------------- |
||
4095 | } |
||
4096 | //----------------------------------------------------------------- |
||
4097 | break; |
||
4098 | //===================================================================== |
||
4099 | default: |
||
4100 | //----------------------------------------------------------------- |
||
4101 | // others xxxxxxx0 |
||
4102 | pFE = !(port & 1); |
||
4103 | //----------------------------------------------------------------- |
||
4104 | if (pFE) |
||
4105 | { |
||
4106 | //------------------------------------------------------------- |
||
4107 | if ( ((cpu.pc & 0xFFFF) == 0x0564) && |
||
4108 | (bankr[0][0x0564] == 0x1F) && |
||
4109 | conf.tape_autostart && |
||
4110 | comp.tape.stopped |
||
4111 | ) |
||
4112 | { |
||
4113 | start_tape(); |
||
4114 | } |
||
4115 | //------------------------------------------------------------- |
||
4116 | u8 val = input.read(u8(port >> 8)); |
||
4117 | return val; |
||
4118 | //------------------------------------------------------------- |
||
4119 | } |
||
4120 | //----------------------------------------------------------------- |
||
4121 | //===================================================================== |
||
4122 | } |
||
4123 | |||
4124 | |||
4125 | |||
4126 | |||
4127 | //----------------------------------------------------------------------------- |
||
4128 | { register int in_v = dc_in__ATM_IDE_intrq( port ); if (in_v >= 0) return in_v; } // ATM IDE intrq |
||
4129 | //----------------------------------------------------------------------------- |
||
4130 | |||
4131 | |||
4132 | |||
4133 | |||
4134 | |||
4135 | |||
4136 | |||
4137 | //������ � emul.h |
||
4138 | switch (conf.mem_model) |
||
4139 | { |
||
4140 | // //--------------------------------------------------------------------- |
||
4141 | // case MM_PENTAGON: |
||
4142 | // break; |
||
4143 | // //--------------------------------------------------------------------- |
||
4144 | // case MM_SCORP: |
||
4145 | // break; |
||
4146 | // //--------------------------------------------------------------------- |
||
4147 | // case MM_PROFSCORP: |
||
4148 | // break; |
||
4149 | // //--------------------------------------------------------------------- |
||
4150 | // case MM_PROFI: |
||
4151 | // break; |
||
4152 | // //--------------------------------------------------------------------- |
||
4153 | // case MM_ATM450: |
||
4154 | // break; |
||
4155 | // //--------------------------------------------------------------------- |
||
4156 | // case MM_ATM710: |
||
4157 | // break; |
||
4158 | // //--------------------------------------------------------------------- |
||
4159 | // case MM_ATM3: |
||
4160 | // break; |
||
4161 | // //--------------------------------------------------------------------- |
||
4162 | // case MM_KAY: |
||
4163 | // break; |
||
4164 | //===================================================================== |
||
4165 | case MM_PLUS3: |
||
4166 | //----------------------------------------------------------------- |
||
4167 | // 0001xxxxxxxxxx0x (bcig4) // 1FFD |
||
4168 | // 0010xxxxxxxxxx0x (bcig4) // 2FFD |
||
4169 | // 0011xxxxxxxxxx0x (bcig4) // 3FFD |
||
4170 | if ( (port & ((3 << 14) | 2)) == 0 ) //&& conf.mem_model == MM_PLUS3 |
||
4171 | { |
||
4172 | unsigned Idx = (port >> 12) & 3; |
||
4173 | switch (Idx) |
||
4174 | { |
||
4175 | //--------------------------------------------------------- |
||
4176 | // 2FFD |
||
4177 | case 2: |
||
4178 | return Upd765.in(Idx); |
||
4179 | //--------------------------------------------------------- |
||
4180 | // 3FFD |
||
4181 | case 3: |
||
4182 | return Upd765.in(Idx); //����������??? �_� |
||
4183 | //--------------------------------------------------------- |
||
4184 | } |
||
4185 | } |
||
4186 | //----------------------------------------------------------------- |
||
4187 | break; |
||
4188 | //===================================================================== |
||
4189 | // case MM_QUORUM: |
||
4190 | // break; |
||
4191 | // //--------------------------------------------------------------------- |
||
4192 | } |
||
4193 | |||
4194 | |||
4195 | |||
4196 | |||
4197 | //----------------------------------------------------------------------------- |
||
4198 | { register int in_v = dc_in__AY_TS_TSFM_etc( port ); if (in_v >= 0) return in_v; } // AY TS TSFM etc |
||
4199 | //----------------------------------------------------------------------------- |
||
4200 | { register int in_v = dc_in__Cache_FB( port ); if (in_v >= 0) return in_v; } // Cache FB |
||
4201 | //----------------------------------------------------------------------------- |
||
4202 | |||
4203 | // ���� ��������� � ������������ ���� |
||
4204 | //------------------------------------------------------------------------- |
||
4205 | // if (conf.cmos && ((comp.pEFF7 & EFF7_CMOS) || conf.mem_model == MM_ATM3)) |
||
4206 | // |
||
4207 | if (conf.cmos && ( (comp.pEFF7 & EFF7_CMOS) || // NEDOREPO |
||
4208 | (conf.mem_model == MM_ATM3) || |
||
4209 | (conf.mem_model == MM_ATM710) |
||
4210 | ) |
||
4211 | ) |
||
4212 | { |
||
4213 | unsigned mask = ((conf.mem_model == MM_ATM3) && (comp.flags & CF_DOSPORTS)) ? ~0x100U : |
||
4214 | 0xFFFF; |
||
4215 | if (port == (0xBFF7 & mask)) |
||
4216 | return cmos_read(); |
||
4217 | } |
||
4218 | //------------------------------------------------------------------------- |
||
4219 | |||
4220 | //----------------------------------------------------------------------------- |
||
4221 | { register int in_v = dc_in__Modem_HZ( port ); if (in_v >= 0) return in_v; } // Modem HZ |
||
4222 | //----------------------------------------------------------------------------- |
||
4223 | |||
4224 | |||
4225 | |||
4226 | |||
4227 | |||
4228 | |||
4229 | // ����� ��������� ���� FF !!! |
||
4230 | //----------------------------------------------------------------------------- |
||
4231 | { register int in_v = dc_in__Port_FF( port ); if (in_v >= 0) return in_v; } // Port FF |
||
4232 | //----------------------------------------------------------------------------- |
||
4233 | |||
4234 | |||
4235 | |||
4236 | |||
4237 | //----------------------------------------------------------------------------- |
||
4238 | return 0xFF; // ������ ������� � ����� ����� |
||
4239 | //----------------------------------------------------------------------------- |
||
4240 | } |
||
4241 | //============================================================================= |
||
4242 | |||
4243 | |||
4244 | //============================================================================= |
||
4245 | unsigned char in(unsigned port) |
||
4246 | { |
||
4247 | brk_port_val = in1(port); // � ����� ��� ���? �_� |
||
4248 | return brk_port_val; // ��� ������? |
||
4249 | } |
||
4250 | //============================================================================= |
||
4251 | |||
4252 | #undef in_trdos |
||
4253 | #undef out_trdos |