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 "spperif.h"
22#include "z80.h"
23
24extern unsigned char rom_imag[];
25
26int SPNM(quick_load) = 1;
27int SPNM(load_trapped);
28
29qbyte SPNM(scr_mark)[SCRMARK_SIZE];
30byte SPNM(fe_inport_high)[256];
31
32int SPNM(scline);
33
34
35unsigned char SPNM(colors)[16];
36
37int SPNM(flash_state);
38
39qbyte *SPNM(scr_f0_table);
40qbyte *SPNM(scr_f1_table);
41
42byte SPNM(tape_impinfo)[PORT_TIME_NUM];
43byte SPNM(fe_inport_default);
44byte SPNM(fe_outport_time)[PORT_TIME_NUM];
45byte SPNM(sound_buf)[PORT_TIME_NUM];
46signed char SPNM(tape_sound)[TMNUM];
47int SPNM(scri)[PORT_TIME_NUM];
48int SPNM(coli)[PORT_TIME_NUM];
49
50int SPNM(playing_tape) = 0;
51
52char *SPNM(image);
53int SPNM(updating);
54qbyte SPNM(imag_mark)[192];
55qbyte SPNM(imag_horiz);
56qbyte SPNM(imag_vert);
57int SPNM(border_update);
58int SPNM(lastborder);
59
60void SPNM(init_screen_mark)(void)
61{
62 int i;
63
64 for(i = 0x200; i < 0x2D8; i++) SPNM(scr_mark)[i] = ~((qbyte) 0);
65
66 SPNM(border_update) = 1;
67}
68
69void SPNM(init)(void)
70{
71 int i;
72
73 PRNM(init)();
74 PRNM(reset)();
75
76 SPNM(load_trapped) = 0;
77
78 for(i = 0; i < PORTNUM; i++) PRNM(inports)[i] = 0x00;
79
80 DANM(inport_mask) = 0x20;
81/* TODO: Kempston is always present, this is not nice */
82
83 SPNM(fe_inport_default) = 0xBF; /* Issue 3 */
84
85 DANM(ula_outport) = 0xFF;
86
87 for(i = 0; i < 256; i++) SPNM(fe_inport_high)[i] = 0xFF;
88
89 for(i = 0; i < PORT_TIME_NUM; i++) SPNM(tape_impinfo)[i] = 0;
90 DANM(imp_change) = 0;
91 DANM(ula_inport) = SPNM(fe_inport_default);
92
93 SPNM(scline) = 0;
94
95 for(i = 0; i < 0x4000; i++) PRNM(proc).mem[i] = rom_imag[i];
96
97 SPNM(init_screen_mark)();
98}