diff options
Diffstat (limited to 'apps/plugins/zxbox/spperif.c')
-rw-r--r-- | apps/plugins/zxbox/spperif.c | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/apps/plugins/zxbox/spperif.c b/apps/plugins/zxbox/spperif.c new file mode 100644 index 0000000000..6255ba689a --- /dev/null +++ b/apps/plugins/zxbox/spperif.c | |||
@@ -0,0 +1,99 @@ | |||
1 | /* | ||
2 | * Copyright (C) 1996-1998 Szeredi Miklos | ||
3 | * Email: mszeredi@inf.bme.hu | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. See the file COPYING. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
18 | * | ||
19 | */ | ||
20 | |||
21 | #include "spperif.h" | ||
22 | #include "z80.h" | ||
23 | |||
24 | extern unsigned char rom_imag[]; | ||
25 | |||
26 | int SPNM(quick_load) = 1; | ||
27 | int SPNM(load_trapped); | ||
28 | |||
29 | qbyte SPNM(scr_mark)[SCRMARK_SIZE]; | ||
30 | byte SPNM(fe_inport_high)[256]; | ||
31 | |||
32 | int SPNM(scline); | ||
33 | |||
34 | |||
35 | unsigned char SPNM(colors)[16]; | ||
36 | |||
37 | int SPNM(flash_state); | ||
38 | |||
39 | qbyte *SPNM(scr_f0_table); | ||
40 | qbyte *SPNM(scr_f1_table); | ||
41 | |||
42 | byte SPNM(tape_impinfo)[PORT_TIME_NUM]; | ||
43 | byte SPNM(fe_inport_default); | ||
44 | byte SPNM(fe_outport_time)[PORT_TIME_NUM]; | ||
45 | byte SPNM(sound_buf)[PORT_TIME_NUM]; | ||
46 | signed char SPNM(tape_sound)[TMNUM]; | ||
47 | int SPNM(scri)[PORT_TIME_NUM]; | ||
48 | int SPNM(coli)[PORT_TIME_NUM]; | ||
49 | |||
50 | int SPNM(playing_tape) = 0; | ||
51 | int SPNM(paused) = 0; | ||
52 | |||
53 | char *SPNM(image); | ||
54 | int SPNM(updating); | ||
55 | qbyte SPNM(imag_mark)[192]; | ||
56 | qbyte SPNM(imag_horiz); | ||
57 | qbyte SPNM(imag_vert); | ||
58 | int SPNM(border_update); | ||
59 | int SPNM(lastborder); | ||
60 | |||
61 | void SPNM(init_screen_mark)(void) | ||
62 | { | ||
63 | int i; | ||
64 | |||
65 | for(i = 0x200; i < 0x2D8; i++) SPNM(scr_mark)[i] = ~((qbyte) 0); | ||
66 | |||
67 | SPNM(border_update) = 1; | ||
68 | } | ||
69 | |||
70 | void SPNM(init)(void) | ||
71 | { | ||
72 | int i; | ||
73 | |||
74 | PRNM(init)(); | ||
75 | PRNM(reset)(); | ||
76 | |||
77 | SPNM(load_trapped) = 0; | ||
78 | |||
79 | for(i = 0; i < PORTNUM; i++) PRNM(inports)[i] = 0x00; | ||
80 | |||
81 | DANM(inport_mask) = 0x20; | ||
82 | /* TODO: Kempston is always present, this is not nice */ | ||
83 | |||
84 | SPNM(fe_inport_default) = 0xBF; /* Issue 3 */ | ||
85 | |||
86 | DANM(ula_outport) = 0xFF; | ||
87 | |||
88 | for(i = 0; i < 256; i++) SPNM(fe_inport_high)[i] = 0xFF; | ||
89 | |||
90 | for(i = 0; i < PORT_TIME_NUM; i++) SPNM(tape_impinfo)[i] = 0; | ||
91 | DANM(imp_change) = 0; | ||
92 | DANM(ula_inport) = SPNM(fe_inport_default); | ||
93 | |||
94 | SPNM(scline) = 0; | ||
95 | |||
96 | for(i = 0; i < 0x4000; i++) PRNM(proc).mem[i] = rom_imag[i]; | ||
97 | |||
98 | SPNM(init_screen_mark)(); | ||
99 | } | ||