source: buchla-emu/emu/all.h@ 2cd18e3

Last change on this file since 2cd18e3 was 2cd18e3, checked in by Thomas Lopatic <thomas@…>, 6 years ago

Initialize RtMidi device's data member.

  • Property mode set to 100644
File size: 5.0 KB
Line 
1/*
2 * Copyright (C) 2017 The Contributors
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or (at
7 * your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * A copy of the GNU General Public License can be found in the file
15 * "gpl-v3.txt" in the top directory of this repository.
16 */
17
18#include <stdbool.h>
19#include <stddef.h>
20#include <stdint.h>
21#include <stdio.h>
22#include <string.h>
23#include <unistd.h>
24
25#include <xmmintrin.h>
26
27#include <m68k.h>
28
29#include <SDL2/SDL.h>
30#include <SDL2/SDL_net.h>
31#include <SDL2/SDL_ttf.h>
32
33// XXX - work around RtMidi's C++-isms; remove when fixed in RtMidi
34
35#pragma GCC diagnostic push
36#pragma GCC diagnostic ignored "-Wstrict-prototypes"
37
38typedef struct RtMidiWrapper RtMidiWrapper;
39
40#include <rtmidi/rtmidi_c.h>
41
42#pragma GCC diagnostic pop
43
44#define inf(...) SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__);
45#define err(...) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__);
46
47#define _ver(_v, _t, ...) { \
48 if (_v > _t) { \
49 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \
50 } \
51}
52
53#define fail(...) { \
54 SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \
55 exit(1); \
56}
57
58#define ARRAY_COUNT(_a) (int32_t)(sizeof (_a) / sizeof (_a)[0])
59
60extern int32_t sdl_verbose;
61extern int32_t gdb_verbose;
62extern int32_t cpu_verbose;
63extern int32_t fpu_verbose;
64extern int32_t vid_verbose;
65extern int32_t tim_verbose;
66extern int32_t lcd_verbose;
67extern int32_t ser_verbose;
68extern int32_t mid_verbose;
69extern int32_t fdd_verbose;
70extern int32_t snd_verbose;
71extern int32_t led_verbose;
72extern int32_t kbd_verbose;
73
74extern const char *bios;
75extern const char *disk;
76extern const char *font;
77
78extern uint32_t mid_port;
79
80extern SDL_atomic_t run;
81
82extern uint32_t vid_win;
83extern uint32_t ser_win;
84extern uint32_t lcd_win;
85
86extern void sdl_init(void);
87extern void sdl_quit(void);
88extern void sdl_loop(void);
89
90extern void gdb_init(void);
91extern void gdb_quit(void);
92extern void gdb_loop(void);
93extern void gdb_inst(bool bp);
94
95extern SDL_mutex *cpu_mutex;
96
97extern void cpu_init(void);
98extern void cpu_quit(void);
99extern void cpu_loop(void);
100
101extern uint8_t cpu_peek(int32_t addr);
102extern void cpu_poke(int32_t addr, uint8_t val);
103
104extern void fpu_init(void);
105extern void fpu_quit(void);
106extern bool fpu_exec(void);
107extern uint32_t fpu_read(uint32_t off, int32_t sz);
108extern void fpu_write(uint32_t off, int32_t sz, uint32_t val);
109
110extern void vid_init(void);
111extern void vid_quit(void);
112extern bool vid_exec(void);
113extern uint32_t vid_read(uint32_t off, int32_t sz);
114extern void vid_write(uint32_t off, int32_t sz, uint32_t val);
115
116extern void vid_sdl(void);
117
118extern void tim_init(void);
119extern void tim_quit(void);
120extern bool tim_exec(void);
121extern uint32_t tim_read(uint32_t off, int32_t sz);
122extern void tim_write(uint32_t off, int32_t sz, uint32_t val);
123
124extern void lcd_init(void);
125extern void lcd_quit(void);
126extern bool lcd_exec(void);
127extern uint32_t lcd_read(uint32_t off, int32_t sz);
128extern void lcd_write(uint32_t off, int32_t sz, uint32_t val);
129
130extern void lcd_sdl(void);
131
132extern void ser_init(void);
133extern void ser_quit(void);
134extern bool ser_exec(void);
135extern uint32_t ser_read(uint32_t off, int32_t sz);
136extern void ser_write(uint32_t off, int32_t sz, uint32_t val);
137
138extern void ser_sdl(void);
139extern void ser_text(SDL_TextInputEvent *ev);
140extern void ser_key(SDL_KeyboardEvent *ev);
141
142extern void ser_mou_res(void);
143extern void ser_mou_mov(SDL_MouseMotionEvent *ev);
144extern void ser_mou_dn(SDL_MouseButtonEvent *ev);
145extern void ser_mou_up(SDL_MouseButtonEvent *ev);
146
147extern void mid_init(void);
148extern void mid_quit(void);
149extern bool mid_exec(void);
150extern uint32_t mid_read(uint32_t off, int32_t sz);
151extern void mid_write(uint32_t off, int32_t sz, uint32_t val);
152extern void mid_list(void);
153
154extern void fdd_init(void);
155extern void fdd_quit(void);
156extern bool fdd_exec(void);
157extern uint32_t fdd_read(uint32_t off, int32_t sz);
158extern void fdd_write(uint32_t off, int32_t sz, uint32_t val);
159
160extern void fdd_set_side(int32_t sid);
161extern void fdd_set_sel(int32_t sel);
162
163extern void snd_init(void);
164extern void snd_quit(void);
165extern bool snd_exec(void);
166extern uint32_t snd_read(uint32_t off, int32_t sz);
167extern void snd_write(uint32_t off, int32_t sz, uint32_t val);
168
169extern void led_init(void);
170extern void led_quit(void);
171extern bool led_exec(void);
172extern uint32_t led_read(uint32_t off, int32_t sz);
173extern void led_write(uint32_t off, int32_t sz, uint32_t val);
174
175extern void kbd_init(void);
176extern void kbd_quit(void);
177extern bool kbd_exec(void);
178extern uint32_t kbd_read(uint32_t off, int32_t sz);
179extern void kbd_write(uint32_t off, int32_t sz, uint32_t val);
180
181extern void kbd_key(SDL_KeyboardEvent *ev, bool vid, bool dn);
Note: See TracBrowser for help on using the repository browser.