A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita
audio
rust
zig
deno
mpris
rockbox
mpd
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 = 0;
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#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;
68 }
69#else
70 SPNM(border_update) = 0;
71#endif
72 scrptr = update_screen_line(scrptr, SPNM(coli)[scline], DANM(next_scri),
73 border, &cmark);
74
75 }
76 SPNM(scline)++;
77 }
78 return tc;
79}