source: buchla-emu/emu/all.h@ 9b204fa

Last change on this file since 9b204fa was 81d7cdc, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Support LCD buttons.

  • Property mode set to 100644
File size: 4.7 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#define inf(...) SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__);
34#define err(...) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__);
35
36#define _ver(_v, _t, ...) { \
37 if (_v > _t) { \
38 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \
39 } \
40}
41
42#define fail(...) { \
43 SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \
44 exit(1); \
45}
46
47#define ARRAY_COUNT(_a) (int32_t)(sizeof (_a) / sizeof (_a)[0])
48
49extern int32_t sdl_verbose;
50extern int32_t gdb_verbose;
51extern int32_t cpu_verbose;
52extern int32_t fpu_verbose;
53extern int32_t vid_verbose;
54extern int32_t tim_verbose;
55extern int32_t lcd_verbose;
56extern int32_t ser_verbose;
57extern int32_t mid_verbose;
58extern int32_t fdd_verbose;
59extern int32_t snd_verbose;
60extern int32_t led_verbose;
61extern int32_t kbd_verbose;
62
63extern const char *bios;
64extern const char *disk;
65extern const char *font;
66
67extern SDL_atomic_t run;
68
69extern uint32_t vid_win;
70extern uint32_t ser_win;
71extern uint32_t lcd_win;
72
73extern void sdl_init(void);
74extern void sdl_quit(void);
75extern void sdl_loop(void);
76
77extern void gdb_init(void);
78extern void gdb_quit(void);
79extern void gdb_loop(void);
80extern void gdb_inst(bool bp);
81
82extern SDL_mutex *cpu_mutex;
83
84extern void cpu_init(void);
85extern void cpu_quit(void);
86extern void cpu_loop(void);
87
88extern uint8_t cpu_peek(int32_t addr);
89extern void cpu_poke(int32_t addr, uint8_t val);
90
91extern void fpu_init(void);
92extern void fpu_quit(void);
93extern bool fpu_exec(void);
94extern uint32_t fpu_read(uint32_t off, int32_t sz);
95extern void fpu_write(uint32_t off, int32_t sz, uint32_t val);
96
97extern void vid_init(void);
98extern void vid_quit(void);
99extern bool vid_exec(void);
100extern uint32_t vid_read(uint32_t off, int32_t sz);
101extern void vid_write(uint32_t off, int32_t sz, uint32_t val);
102
103extern void vid_sdl(void);
104
105extern void tim_init(void);
106extern void tim_quit(void);
107extern bool tim_exec(void);
108extern uint32_t tim_read(uint32_t off, int32_t sz);
109extern void tim_write(uint32_t off, int32_t sz, uint32_t val);
110
111extern void lcd_init(void);
112extern void lcd_quit(void);
113extern bool lcd_exec(void);
114extern uint32_t lcd_read(uint32_t off, int32_t sz);
115extern void lcd_write(uint32_t off, int32_t sz, uint32_t val);
116
117extern void lcd_sdl(void);
118
119extern void ser_init(void);
120extern void ser_quit(void);
121extern bool ser_exec(void);
122extern uint32_t ser_read(uint32_t off, int32_t sz);
123extern void ser_write(uint32_t off, int32_t sz, uint32_t val);
124
125extern void ser_sdl(void);
126extern void ser_text(SDL_TextInputEvent *ev);
127extern void ser_key(SDL_KeyboardEvent *ev);
128
129extern void ser_mou_res(void);
130extern void ser_mou_mov(SDL_MouseMotionEvent *ev);
131extern void ser_mou_dn(SDL_MouseButtonEvent *ev);
132extern void ser_mou_up(SDL_MouseButtonEvent *ev);
133
134extern void mid_init(void);
135extern void mid_quit(void);
136extern bool mid_exec(void);
137extern uint32_t mid_read(uint32_t off, int32_t sz);
138extern void mid_write(uint32_t off, int32_t sz, uint32_t val);
139
140extern void fdd_init(void);
141extern void fdd_quit(void);
142extern bool fdd_exec(void);
143extern uint32_t fdd_read(uint32_t off, int32_t sz);
144extern void fdd_write(uint32_t off, int32_t sz, uint32_t val);
145
146extern void fdd_set_side(int32_t sid);
147extern void fdd_set_sel(int32_t sel);
148
149extern void snd_init(void);
150extern void snd_quit(void);
151extern bool snd_exec(void);
152extern uint32_t snd_read(uint32_t off, int32_t sz);
153extern void snd_write(uint32_t off, int32_t sz, uint32_t val);
154
155extern void led_init(void);
156extern void led_quit(void);
157extern bool led_exec(void);
158extern uint32_t led_read(uint32_t off, int32_t sz);
159extern void led_write(uint32_t off, int32_t sz, uint32_t val);
160
161extern void kbd_init(void);
162extern void kbd_quit(void);
163extern bool kbd_exec(void);
164extern uint32_t kbd_read(uint32_t off, int32_t sz);
165extern void kbd_write(uint32_t off, int32_t sz, uint32_t val);
166
167extern void kbd_key(SDL_KeyboardEvent *ev, bool vid, bool dn);
Note: See TracBrowser for help on using the repository browser.