forked from libsdl-org/SDL-1.2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.DC
More file actions
121 lines (79 loc) · 4.17 KB
/
Copy pathREADME.DC
File metadata and controls
121 lines (79 loc) · 4.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# SDL 1.2 — Dreamcast (KallistiOS)
Dreamcast support for SDL 1.2 targeting the **KallistiOS (KOS)** SDK. Optional OpenGL support uses **GLdc** (provided by **kos-ports**).
**Scope:** Community-maintained. Changes are isolated to Dreamcast code paths and do not affect other platforms.
## Prerequisites
* KOS toolchain installed; environment sourced:
```sh
. /opt/toolchains/dc/kos/environ.sh
```
* (Optional) OpenGL via **GLdc** from **kos-ports**.
## Building (no autoconf)
Use the platform makefile:
```sh
# Plain (no GL)
make -f Makefile.dc
# With OpenGL (GLdc)
# set GL=1 in Makefile.dc or
make -f Makefile.dc clean && make -f Makefile.dc GL=1
# (equivalently) GL=1 make -f Makefile.dc
# remove installed headers/lib under KOS/addons
make -f Makefile.dc uninstall
# clean local objects only (does NOT remove installed files)
make -f Makefile.dc clean
# clean + uninstall
make -f Makefile.dc distclean
```
### Artifacts & Installation
* Builds produce `libSDL.a` (and `libSDL_gl.a` when `GL=1`) and headers under `include/`.
* **Current behavior:** `Makefile.dc` **automatically installs** after a successful build to:
* `KOS/addons/include/$(KOS_ARCH)/SDL` (headers)
* `KOS/addons/lib/$(KOS_ARCH)` (library)
* `make -f Makefile.dc uninstall` removes the installed headers/lib from `KOS/addons`.
* `make -f Makefile.dc distclean` does both: `clean` + `uninstall`.
## Video backends (Dreamcast)
* **DMA** – double-buffered blits to PVR via DMA (default).
* **TEXTURED** – virtual resolutions + scaling via textured blits.
* **DIRECT** – direct framebuffer path (uses SH-4 store queues; may be faster in some cases).
Select a backend via `Makefile.dc` or by API before `SDL_SetVideoMode`.
## Additional capabilities
* **OpenGL via GLdc** — optional GL 1.x path when `GL=1`.
* **Analog-pad mouse emulation** — map the analog pad to mouse input when enabled.
* **Button→key mapping** — map controller buttons to `SDLKey`.
* **Texture formats** — supports 16-bit formats commonly used on Dreamcast (e.g., **RGB5551**, **RGB4444**).
## Dreamcast-specific API (`SDL_dreamcast.h`)
**Video & display**
* `SDL_DC_SetVideoDriver(SDL_DC_DMA_VIDEO | SDL_DC_TEXTURED_VIDEO | SDL_DC_DIRECT_VIDEO)` — choose backend (call before `SDL_SetVideoMode`).
* `SDL_DC_SetWindow(width, height)` — set virtual window size (textured mode).
**Timing / refresh**
* `SDL_DC_VerticalWait(enable)` — wait for vertical retrace before presenting.
* `SDL_DC_ShowAskHz(enable)` — (PAL) show 50/60 Hz selector at startup.
* `SDL_DC_Default60Hz(enable)` — (PAL) default to 60 Hz.
**Input mapping**
* `SDL_DC_MapKey(joy, button, key)` — map a Dreamcast controller button to an `SDLKey`.
**Controller emulation helpers**
* `SDL_DC_EmulateVirtualKeyboard(enable)` — simple BIOS-font on-screen keyboard.
*Runtime controls:* **A** submits; **Right Trigger** toggles.
* `SDL_DC_EmulateKeyboard(enable)` — controller→keyboard emulation.
* `SDL_DC_EmulateMouse(enable)` — controller→mouse emulation.
**Audio**
* `SDL_DC_SetSoundBuffer(ptr)` / `SDL_DC_RestoreSoundBuffer()` — override/restore audio buffer.
> These functions are Dreamcast-only; they are no-ops on other platforms.
### Defaults
* **Audio:** AICA backend
* **Concurrency:** KOS threads & timers
## Tests
SDL’s generic `test/` programs don’t include Dreamcast makefiles. Validate on hardware or an emulator using your own minimal harness or application (video/input/audio).
## License
SDL 1.2 is licensed under **LGPL-2.1**. See `COPYING`.
### Third-party notices
* This Dreamcast backend includes **only** SH-4 optimized memory routines (`memcpy`, `memset`, `memmove`, `memcmp`) derived from DreamHAL. These files are **Public Domain**; original file headers are retained in-file.
* No other DreamHAL components are included.
## Acknowledgments
* **Troy Davis (GPF)** — Dreamcast updates/maintenance, GLdc integration, virtual keyboard.
* **BERO** — original Dreamcast SDL work
* **Chui** — Dreamcast improvements
* **Ian Michael** — Dreamcast DreamHAL/GLdc lineage
* **Kazade** — GLdc
* **MRNEO240** — GLdc optimizations and support
* **DreamHAL project** — related Dreamcast work
* **Contributors** — fixes and maintenance over time