source: buchla-emu/emu/all.h@ caff491

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

Moved serial console window to ser emulation.

  • Property mode set to 100644
File size: 3.8 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_ttf.h>
31
32#define inf(...) SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__);
33#define err(...) SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__);
34
35#define _ver(_v, _t, ...) { \
36 if (_v > _t) { \
37 SDL_LogVerbose(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \
38 } \
39}
40
41#define fail(...) { \
42 SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, __VA_ARGS__); \
43 exit(1); \
44}
45
46#define ARRAY_COUNT(_a) (int32_t)(sizeof (_a) / sizeof (_a)[0])
47
48#define WIN_W (1520 * 2 / 3)
49#define WIN_H (950 * 2 / 3)
50
51extern int32_t sdl_verbose;
52extern int32_t cpu_verbose;
53extern int32_t fpu_verbose;
54extern int32_t vid_verbose;
55extern int32_t tim_verbose;
56extern int32_t lcd_verbose;
57extern int32_t ser_verbose;
58extern int32_t mid_verbose;
59extern int32_t fdd_verbose;
60extern int32_t snd_verbose;
61extern int32_t led_verbose;
62extern int32_t kbd_verbose;
63
64extern void sdl_init(void);
65extern void sdl_quit(void);
66
67extern void cpu_loop(const char *bios);
68
69extern void fpu_init(void);
70extern void fpu_quit(void);
71extern bool fpu_exec(void);
72extern uint32_t fpu_read(uint32_t off, int32_t sz);
73extern void fpu_write(uint32_t off, int32_t sz, uint32_t val);
74
75extern void vid_init(void);
76extern void vid_quit(void);
77extern bool vid_exec(void);
78extern uint32_t vid_read(uint32_t off, int32_t sz);
79extern void vid_write(uint32_t off, int32_t sz, uint32_t val);
80
81extern void tim_init(void);
82extern void tim_quit(void);
83extern bool tim_exec(void);
84extern uint32_t tim_read(uint32_t off, int32_t sz);
85extern void tim_write(uint32_t off, int32_t sz, uint32_t val);
86
87extern void lcd_init(void);
88extern void lcd_quit(void);
89extern bool lcd_exec(void);
90extern uint32_t lcd_read(uint32_t off, int32_t sz);
91extern void lcd_write(uint32_t off, int32_t sz, uint32_t val);
92
93extern void ser_init(void);
94extern void ser_quit(void);
95extern bool ser_exec(void);
96extern uint32_t ser_read(uint32_t off, int32_t sz);
97extern void ser_write(uint32_t off, int32_t sz, uint32_t val);
98
99extern void ser_text(SDL_TextInputEvent *ev);
100extern void ser_key(SDL_KeyboardEvent *ev);
101
102extern void mid_init(void);
103extern void mid_quit(void);
104extern bool mid_exec(void);
105extern uint32_t mid_read(uint32_t off, int32_t sz);
106extern void mid_write(uint32_t off, int32_t sz, uint32_t val);
107
108extern void fdd_init(void);
109extern void fdd_quit(void);
110extern bool fdd_exec(void);
111extern uint32_t fdd_read(uint32_t off, int32_t sz);
112extern void fdd_write(uint32_t off, int32_t sz, uint32_t val);
113
114extern void snd_init(void);
115extern void snd_quit(void);
116extern bool snd_exec(void);
117extern uint32_t snd_read(uint32_t off, int32_t sz);
118extern void snd_write(uint32_t off, int32_t sz, uint32_t val);
119
120extern void led_init(void);
121extern void led_quit(void);
122extern bool led_exec(void);
123extern uint32_t led_read(uint32_t off, int32_t sz);
124extern void led_write(uint32_t off, int32_t sz, uint32_t val);
125
126extern void kbd_init(void);
127extern void kbd_quit(void);
128extern bool kbd_exec(void);
129extern uint32_t kbd_read(uint32_t off, int32_t sz);
130extern void kbd_write(uint32_t off, int32_t sz, uint32_t val);
Note: See TracBrowser for help on using the repository browser.