Bump version numbers for 3.13
[maemo-rb.git] / apps / plugins / zxbox / spect.c
blob879905de47c3dd106d11e692802caf34331c9b5b
1 /*
2 * Copyright (C) 1996-1998 Szeredi Miklos
3 * Email: mszeredi@inf.bme.hu
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.
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.
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.
21 #include "z80.h"
22 #include "spperif.h"
23 #include "spscr.h"
25 #define SOUNDPORT 0x10
27 int SPNM(halfframe)(int firsttick, int numlines)
30 int tc, linesleft;
31 int feport, scline, border = 0;
32 byte *scrptr;
33 qbyte cmark = 0;
35 scrptr = (byte *) SPNM(image);
37 tc = firsttick - CHKTICK;
39 for(linesleft = numlines; linesleft; linesleft--) {
40 DANM(next_scri) = SPNM(scri)[SPNM(scline)];
41 tc += CHKTICK;
43 tc = PRNM(step)(tc);
45 scline = SPNM(scline);
47 /* store sound */
48 SPNM(sound_buf)[scline] = DANM(sound_sam);
49 feport = DANM(ula_outport);
51 if(feport & SOUNDPORT) DANM(sound_sam) = 240;
52 else DANM(sound_sam) = 16;
54 /* change EAR bit, store MIC bit*/
56 SPNM(fe_outport_time)[scline] = feport;
57 if(DANM(imp_change)) DANM(ula_inport) ^= 0x40;
58 DANM(imp_change) = SPNM(tape_impinfo)[scline];
60 /* Check if updating screen */
62 if(SPNM(updating)) {
63 #if LCD_WIDTH == 320 && ( LCD_HEIGHT == 240 || LCD_HEIGHT == 200 )
64 border = SPNM(lastborder);
65 if((feport & 0x07) != border) {
66 SPNM(border_update) = 2;
67 SPNM(lastborder) = feport & 0x07;
69 #else
70 SPNM(border_update) = 0;
71 #endif
72 scrptr = update_screen_line(scrptr, SPNM(coli)[scline], DANM(next_scri),
73 border, &cmark);
76 SPNM(scline)++;
78 return tc;