summaryrefslogtreecommitdiff
path: root/apps/plugins/zxbox/spect.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/zxbox/spect.c')
-rw-r--r--apps/plugins/zxbox/spect.c75
1 files changed, 75 insertions, 0 deletions
diff --git a/apps/plugins/zxbox/spect.c b/apps/plugins/zxbox/spect.c
new file mode 100644
index 0000000000..8e9291f704
--- /dev/null
+++ b/apps/plugins/zxbox/spect.c
@@ -0,0 +1,75 @@
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 "z80.h"
22#include "spperif.h"
23#include "spscr.h"
24
25#define SOUNDPORT 0x10
26
27int SPNM(halfframe)(int firsttick, int numlines)
28{
29
30 int tc, linesleft;
31 int feport, scline, border;
32 byte *scrptr;
33 qbyte cmark = 0;
34
35 scrptr = (byte *) SPNM(image);
36
37 tc = firsttick - CHKTICK;
38
39 for(linesleft = numlines; linesleft; linesleft--) {
40 DANM(next_scri) = SPNM(scri)[SPNM(scline)];
41 tc += CHKTICK;
42
43 tc = PRNM(step)(tc);
44
45 scline = SPNM(scline);
46
47 /* store sound */
48 SPNM(sound_buf)[scline] = DANM(sound_sam);
49 feport = DANM(ula_outport);
50
51 if(feport & SOUNDPORT) DANM(sound_sam) = 240;
52 else DANM(sound_sam) = 16;
53
54 /* change EAR bit, store MIC bit*/
55
56 SPNM(fe_outport_time)[scline] = feport;
57 if(DANM(imp_change)) DANM(ula_inport) ^= 0x40;
58 DANM(imp_change) = SPNM(tape_impinfo)[scline];
59
60 /* Check if updating screen */
61
62 if(SPNM(updating)) {
63 border = SPNM(lastborder);
64 if((feport & 0x07) != border) {
65 SPNM(border_update) = 2;
66 SPNM(lastborder) = feport & 0x07;
67 }
68 scrptr = update_screen_line(scrptr, SPNM(coli)[scline], DANM(next_scri),
69 border, &cmark);
70
71 }
72 SPNM(scline)++;
73 }
74 return tc;
75}