mirror of
https://github.com/BoredDevNL/BoredOS.git
synced 2026-05-15 10:48:38 +00:00
DOOM!!!!
This commit is contained in:
parent
9bb62a5ade
commit
d49d082712
226 changed files with 71703 additions and 37 deletions
6
Makefile
6
Makefile
|
|
@ -111,8 +111,12 @@ $(ISO_IMAGE): $(KERNEL_ELF) limine.conf limine-setup
|
|||
fi \
|
||||
done
|
||||
|
||||
# Copy README
|
||||
# Copy README and WAD
|
||||
@if [ -f README.md ]; then cp README.md $(ISO_DIR)/; fi
|
||||
@if [ -f doom1.wad ]; then \
|
||||
cp doom1.wad $(ISO_DIR)/; \
|
||||
echo " module_path: boot():/doom1.wad" >> $(ISO_DIR)/limine.conf; \
|
||||
fi
|
||||
|
||||
# Copy Wallpapers
|
||||
mkdir -p $(ISO_DIR)/Library/images/Wallpapers
|
||||
|
|
|
|||
BIN
boredos.iso
BIN
boredos.iso
Binary file not shown.
533
build.log
Normal file
533
build.log
Normal file
|
|
@ -0,0 +1,533 @@
|
|||
mkdir -p build
|
||||
mkdir -p build
|
||||
Building Limine host utility...
|
||||
make[1]: Nothing to be done for `all'.
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/cmd.c -o build/cmd.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/disk_manager.c -o build/disk_manager.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/e1000.c -o build/e1000.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/e1000_netif.c -o build/e1000_netif.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/elf.c -o build/elf.o
|
||||
src/kernel/elf.c:12:13: warning: 'print_hex' defined but not used [-Wunused-function]
|
||||
12 | static void print_hex(uint64_t n) {
|
||||
| ^~~~~~~~~
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/explorer.c -o build/explorer.o
|
||||
src/kernel/explorer.c: In function 'explorer_draw_file_icon':
|
||||
src/kernel/explorer.c:887:73: warning: unused parameter 'color' [-Wunused-parameter]
|
||||
887 | static void explorer_draw_file_icon(int x, int y, bool is_dir, uint32_t color, const char *filename, const char *current_path) {
|
||||
| ~~~~~~~~~^~~~~
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/fat32.c -o build/fat32.o
|
||||
src/kernel/fat32.c: In function 'fat32_normalize_path':
|
||||
src/kernel/fat32.c:151:10: warning: unused variable 'drive' [-Wunused-variable]
|
||||
151 | char drive = parse_drive_from_path(&p);
|
||||
| ^~~~~
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/font_manager.c -o build/font_manager.o
|
||||
In file included from src/kernel/font_manager.c:4:
|
||||
src/kernel/stb_truetype.h: In function 'stbtt_FreeShape':
|
||||
src/kernel/stb_truetype.h:2672:54: warning: unused parameter 'info' [-Wunused-parameter]
|
||||
2672 | STBTT_DEF void stbtt_FreeShape(const stbtt_fontinfo *info, stbtt_vertex *v)
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~^~~~
|
||||
src/kernel/stb_truetype.h: In function 'stbtt__hheap_alloc':
|
||||
src/kernel/stb_truetype.h:2770:70: warning: unused parameter 'userdata' [-Wunused-parameter]
|
||||
2770 | static void *stbtt__hheap_alloc(stbtt__hheap *hh, size_t size, void *userdata)
|
||||
| ~~~~~~^~~~~~~~
|
||||
src/kernel/stb_truetype.h: In function 'stbtt__hheap_cleanup':
|
||||
src/kernel/stb_truetype.h:2797:58: warning: unused parameter 'userdata' [-Wunused-parameter]
|
||||
2797 | static void stbtt__hheap_cleanup(stbtt__hheap *hh, void *userdata)
|
||||
| ~~~~~~^~~~~~~~
|
||||
src/kernel/stb_truetype.h: In function 'stbtt_FlattenCurves':
|
||||
src/kernel/stb_truetype.h:3618:154: warning: unused parameter 'userdata' [-Wunused-parameter]
|
||||
3618 | static stbtt__point *stbtt_FlattenCurves(stbtt_vertex *vertices, int num_verts, float objspace_flatness, int **contour_lengths, int *num_contours, void *userdata)
|
||||
| ~~~~~~^~~~~~~~
|
||||
src/kernel/stb_truetype.h: In function 'stbtt_FreeBitmap':
|
||||
src/kernel/stb_truetype.h:3708:62: warning: unused parameter 'userdata' [-Wunused-parameter]
|
||||
3708 | STBTT_DEF void stbtt_FreeBitmap(unsigned char *bitmap, void *userdata)
|
||||
| ~~~~~~^~~~~~~~
|
||||
src/kernel/stb_truetype.h: In function 'stbtt_FreeSDF':
|
||||
src/kernel/stb_truetype.h:4767:59: warning: unused parameter 'userdata' [-Wunused-parameter]
|
||||
4767 | STBTT_DEF void stbtt_FreeSDF(unsigned char *bitmap, void *userdata)
|
||||
| ~~~~~~^~~~~~~~
|
||||
src/kernel/font_manager.c: In function 'font_manager_load':
|
||||
src/kernel/font_manager.c:93:9: warning: unused variable 'read' [-Wunused-variable]
|
||||
93 | int read = fat32_read(fh, buffer, fsize);
|
||||
| ^~~~
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/gdt.c -o build/gdt.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/graphics.c -o build/graphics.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/idt.c -o build/idt.o
|
||||
src/kernel/idt.c: In function 'pic_remap':
|
||||
src/kernel/idt.c:110:17: warning: variable 'a2' set but not used [-Wunused-but-set-variable]
|
||||
110 | uint8_t a1, a2;
|
||||
| ^~
|
||||
src/kernel/idt.c:110:13: warning: variable 'a1' set but not used [-Wunused-but-set-variable]
|
||||
110 | uint8_t a1, a2;
|
||||
| ^~
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/kutils.c -o build/kutils.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/licensewr.c -o build/licensewr.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip_port.c -o build/lwip_port.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/main.c -o build/main.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/memory_manager.c -o build/memory_manager.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/nanojpeg.c -o build/nanojpeg.o
|
||||
src/kernel/nanojpeg.c: In function 'njGetVLC':
|
||||
src/kernel/nanojpeg.c:686:24: warning: left shift of negative value [-Wshift-negative-value]
|
||||
686 | value += ((-1) << bits) + 1;
|
||||
| ^~
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/network.c -o build/network.o
|
||||
src/kernel/network.c: In function 'network_dhcp_acquire':
|
||||
src/kernel/network.c:181:9: warning: unused variable 'loops' [-Wunused-variable]
|
||||
181 | int loops = 0;
|
||||
| ^~~~~
|
||||
src/kernel/network.c: In function 'network_init':
|
||||
src/kernel/network.c:97:9: warning: 'ip.bytes[0]' may be used uninitialized [-Wmaybe-uninitialized]
|
||||
97 | k_itoa(ip.bytes[0], buf); serial_write(buf); serial_write(".");
|
||||
| ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
src/kernel/network.c:92:24: note: 'ip.bytes[0]' was declared here
|
||||
92 | ipv4_address_t ip;
|
||||
| ^~
|
||||
src/kernel/network.c:98:9: warning: 'ip.bytes[1]' may be used uninitialized [-Wmaybe-uninitialized]
|
||||
98 | k_itoa(ip.bytes[1], buf); serial_write(buf); serial_write(".");
|
||||
| ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
src/kernel/network.c:92:24: note: 'ip.bytes[1]' was declared here
|
||||
92 | ipv4_address_t ip;
|
||||
| ^~
|
||||
src/kernel/network.c:99:9: warning: 'ip.bytes[2]' may be used uninitialized [-Wmaybe-uninitialized]
|
||||
99 | k_itoa(ip.bytes[2], buf); serial_write(buf); serial_write(".");
|
||||
| ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
src/kernel/network.c:92:24: note: 'ip.bytes[2]' was declared here
|
||||
92 | ipv4_address_t ip;
|
||||
| ^~
|
||||
src/kernel/network.c:100:9: warning: 'ip.bytes[3]' may be used uninitialized [-Wmaybe-uninitialized]
|
||||
100 | k_itoa(ip.bytes[3], buf); serial_write(buf); serial_write("\n");
|
||||
| ^~~~~~~~~~~~~~~~~~~~~~~~
|
||||
src/kernel/network.c:92:24: note: 'ip.bytes[3]' was declared here
|
||||
92 | ipv4_address_t ip;
|
||||
| ^~
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/nj_kernel.c -o build/nj_kernel.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/paging.c -o build/paging.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/panic.c -o build/panic.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/pci.c -o build/pci.o
|
||||
src/kernel/pci.c: In function 'pci_enumerate_devices':
|
||||
src/kernel/pci.c:52:31: warning: comparison is always true due to limited range of data type [-Wtype-limits]
|
||||
52 | for (uint8_t bus = 0; bus < 256 && count < max_devices; bus++) {
|
||||
| ^
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/platform.c -o build/platform.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/process.c -o build/process.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/ps2.c -o build/ps2.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/rtc.c -o build/rtc.o
|
||||
src/kernel/rtc.c: In function 'rtc_get_datetime':
|
||||
src/kernel/rtc.c:28:13: warning: unused variable 'last_century' [-Wunused-variable]
|
||||
28 | uint8_t last_century;
|
||||
| ^~~~~~~~~~~~
|
||||
src/kernel/rtc.c:21:13: warning: unused variable 'century' [-Wunused-variable]
|
||||
21 | uint8_t century;
|
||||
| ^~~~~~~
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/syscall.c -o build/syscall.o
|
||||
src/kernel/syscall.c: In function 'syscall_handler_inner':
|
||||
src/kernel/syscall.c:399:28: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
|
||||
399 | float scale = *(float*)&scale_bits;
|
||||
| ^~~~~~~~~~~~~~~~~~~
|
||||
src/kernel/syscall.c:509:28: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
|
||||
509 | float scale = *(float*)&scale_bits;
|
||||
| ^~~~~~~~~~~~~~~~~~~
|
||||
src/kernel/syscall.c:528:28: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
|
||||
528 | float scale = *(float*)&scale_bits;
|
||||
| ^~~~~~~~~~~~~~~~~~~
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/vm.c -o build/vm.o
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/wallpaper.c -o build/wallpaper.o
|
||||
src/kernel/wallpaper.c:83:13: warning: 'serial_num' defined but not used [-Wunused-function]
|
||||
83 | static void serial_num(int n) {
|
||||
| ^~~~~~~~~~
|
||||
mkdir -p build/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/wm.c -o build/wm.o
|
||||
src/kernel/wm.c: In function 'wm_handle_click':
|
||||
src/kernel/wm.c:1570:29: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
|
||||
1570 | if (col < 0) col = 0; if (row < 0) row = 0;
|
||||
| ^~
|
||||
src/kernel/wm.c:1570:51: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
|
||||
1570 | if (col < 0) col = 0; if (row < 0) row = 0;
|
||||
| ^~
|
||||
src/kernel/wm.c: In function 'wm_handle_mouse':
|
||||
src/kernel/wm.c:2214:41: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
|
||||
2214 | if (col < 0) col = 0; if (row < 0) row = 0;
|
||||
| ^~
|
||||
src/kernel/wm.c:2214:63: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
|
||||
2214 | if (col < 0) col = 0; if (row < 0) row = 0;
|
||||
| ^~
|
||||
src/kernel/wm.c: At top level:
|
||||
src/kernel/wm.c:1124:13: warning: 'erase_cursor' defined but not used [-Wunused-function]
|
||||
1124 | static void erase_cursor(int x, int y) {
|
||||
| ^~~~~~~~~~~~
|
||||
src/kernel/wm.c:1014:13: warning: 'draw_dock_editor' defined but not used [-Wunused-function]
|
||||
1014 | static void draw_dock_editor(int x, int y) {
|
||||
| ^~~~~~~~~~~~~~~~
|
||||
src/kernel/wm.c:87:13: warning: 'cursor_visible' defined but not used [-Wunused-variable]
|
||||
87 | static bool cursor_visible = true;
|
||||
| ^~~~~~~~~~~~~~
|
||||
src/kernel/wm.c:84:12: warning: 'desktop_refresh_timer' defined but not used [-Wunused-variable]
|
||||
84 | static int desktop_refresh_timer = 0;
|
||||
| ^~~~~~~~~~~~~~~~~~~~~
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/altcp.c -o build/lwip/core/altcp.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/altcp_alloc.c -o build/lwip/core/altcp_alloc.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/altcp_tcp.c -o build/lwip/core/altcp_tcp.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/def.c -o build/lwip/core/def.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/dns.c -o build/lwip/core/dns.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/inet_chksum.c -o build/lwip/core/inet_chksum.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/init.c -o build/lwip/core/init.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/ip.c -o build/lwip/core/ip.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/mem.c -o build/lwip/core/mem.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/memp.c -o build/lwip/core/memp.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/netif.c -o build/lwip/core/netif.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/pbuf.c -o build/lwip/core/pbuf.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/raw.c -o build/lwip/core/raw.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/stats.c -o build/lwip/core/stats.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/sys.c -o build/lwip/core/sys.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/tcp.c -o build/lwip/core/tcp.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/tcp_in.c -o build/lwip/core/tcp_in.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/tcp_out.c -o build/lwip/core/tcp_out.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/timeouts.c -o build/lwip/core/timeouts.o
|
||||
mkdir -p build/lwip/core/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/udp.c -o build/lwip/core/udp.o
|
||||
mkdir -p build/lwip/core/ipv4/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/ipv4/autoip.c -o build/lwip/core/ipv4/autoip.o
|
||||
mkdir -p build/lwip/core/ipv4/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/ipv4/dhcp.c -o build/lwip/core/ipv4/dhcp.o
|
||||
mkdir -p build/lwip/core/ipv4/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/ipv4/etharp.c -o build/lwip/core/ipv4/etharp.o
|
||||
mkdir -p build/lwip/core/ipv4/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/ipv4/icmp.c -o build/lwip/core/ipv4/icmp.o
|
||||
mkdir -p build/lwip/core/ipv4/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/ipv4/igmp.c -o build/lwip/core/ipv4/igmp.o
|
||||
mkdir -p build/lwip/core/ipv4/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/ipv4/ip4.c -o build/lwip/core/ipv4/ip4.o
|
||||
mkdir -p build/lwip/core/ipv4/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/ipv4/ip4_addr.c -o build/lwip/core/ipv4/ip4_addr.o
|
||||
mkdir -p build/lwip/core/ipv4/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/core/ipv4/ip4_frag.c -o build/lwip/core/ipv4/ip4_frag.o
|
||||
mkdir -p build/lwip/netif/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/netif/ethernet.c -o build/lwip/netif/ethernet.o
|
||||
mkdir -p build/lwip/netif/
|
||||
x86_64-elf-gcc -g -O2 -pipe -Wall -Wextra -std=gnu11 -ffreestanding -fno-stack-protector -fno-stack-check -fno-lto -fPIE -m64 -march=x86-64 -msse -msse2 -mstackrealign -mno-red-zone -Isrc/kernel -Isrc/kernel/lwip -c src/kernel/lwip/netif/bridgeif.c -o build/lwip/netif/bridgeif.o
|
||||
nasm -f elf64 src/kernel/boot.asm -o build/boot.o
|
||||
nasm -f elf64 src/kernel/gdt_asm.asm -o build/gdt_asm.o
|
||||
nasm -f elf64 src/kernel/interrupts.asm -o build/interrupts.o
|
||||
nasm -f elf64 src/kernel/process_asm.asm -o build/process_asm.o
|
||||
nasm -f elf64 src/kernel/syscalls.asm -o build/syscalls.o
|
||||
nasm -f elf64 src/kernel/test_syscall.asm -o build/test_syscall.o
|
||||
nasm -f elf64 src/kernel/user_test.asm -o build/user_test.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -pie --no-dynamic-linker -z text -z max-page-size=0x1000 -T linker.ld -o build/boredos.elf build/cmd.o build/disk_manager.o build/e1000.o build/e1000_netif.o build/elf.o build/explorer.o build/fat32.o build/font_manager.o build/gdt.o build/graphics.o build/idt.o build/kutils.o build/licensewr.o build/lwip_port.o build/main.o build/memory_manager.o build/nanojpeg.o build/network.o build/nj_kernel.o build/paging.o build/panic.o build/pci.o build/platform.o build/process.o build/ps2.o build/rtc.o build/syscall.o build/vm.o build/wallpaper.o build/wm.o build/lwip/core/altcp.o build/lwip/core/altcp_alloc.o build/lwip/core/altcp_tcp.o build/lwip/core/def.o build/lwip/core/dns.o build/lwip/core/inet_chksum.o build/lwip/core/init.o build/lwip/core/ip.o build/lwip/core/mem.o build/lwip/core/memp.o build/lwip/core/netif.o build/lwip/core/pbuf.o build/lwip/core/raw.o build/lwip/core/stats.o build/lwip/core/sys.o build/lwip/core/tcp.o build/lwip/core/tcp_in.o build/lwip/core/tcp_out.o build/lwip/core/timeouts.o build/lwip/core/udp.o build/lwip/core/ipv4/autoip.o build/lwip/core/ipv4/dhcp.o build/lwip/core/ipv4/etharp.o build/lwip/core/ipv4/icmp.o build/lwip/core/ipv4/igmp.o build/lwip/core/ipv4/ip4.o build/lwip/core/ipv4/ip4_addr.o build/lwip/core/ipv4/ip4_frag.o build/lwip/netif/ethernet.o build/lwip/netif/bridgeif.o build/boot.o build/gdt_asm.o build/interrupts.o build/process_asm.o build/syscalls.o build/test_syscall.o build/user_test.o
|
||||
x86_64-elf-ld: warning: build/boredos.elf has a LOAD segment with RWX permissions
|
||||
/Library/Developer/CommandLineTools/usr/bin/make -C src/kernel/userland
|
||||
mkdir -p bin
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c libc/libui.c -o bin/libui.o
|
||||
libc/libui.c: In function 'ui_draw_string_scaled':
|
||||
libc/libui.c:64:28: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
|
||||
64 | uint32_t scale_bits = *(uint32_t*)&scale;
|
||||
| ^~~~~~~~~~~~~~~~~
|
||||
libc/libui.c: In function 'ui_get_string_width_scaled':
|
||||
libc/libui.c:70:28: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
|
||||
70 | uint32_t scale_bits = *(uint32_t*)&scale;
|
||||
| ^~~~~~~~~~~~~~~~~
|
||||
libc/libui.c: In function 'ui_get_font_height_scaled':
|
||||
libc/libui.c:75:28: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
|
||||
75 | uint32_t scale_bits = *(uint32_t*)&scale;
|
||||
| ^~~~~~~~~~~~~~~~~
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c libc/stdlib.c -o bin/stdlib.o
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c libc/syscall.c -o bin/syscall.o
|
||||
nasm -f elf64 crt0.asm -o bin/crt0.o
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c about.c -o bin/about.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/about.o -o bin/about.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c beep.c -o bin/beep.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/beep.o -o bin/beep.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c browser.c -o bin/browser.o
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c nanojpeg.c -o bin/nanojpeg.o
|
||||
nanojpeg.c: In function 'njGetVLC':
|
||||
nanojpeg.c:685:24: warning: left shift of negative value [-Wshift-negative-value]
|
||||
685 | value += ((-1) << bits) + 1;
|
||||
| ^~
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/browser.o bin/nanojpeg.o -o bin/browser.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c calculator.c -o bin/calculator.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/calculator.o -o bin/calculator.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c cat.c -o bin/cat.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/cat.o -o bin/cat.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c cc.c -o bin/cc.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/cc.o -o bin/cc.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c clear.c -o bin/clear.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/clear.o -o bin/clear.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c clock.c -o bin/clock.o
|
||||
clock.c: In function 'clock_paint':
|
||||
clock.c:89:36: warning: comparison of integer expressions of different signedness: 'tab_t' and 'int' [-Wsign-compare]
|
||||
89 | uint32_t bg = (current_tab == i) ? COLOR_TAB_ACTIVE : COLOR_DARK_PANEL;
|
||||
| ^~
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/clock.o -o bin/clock.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c cowsay.c -o bin/cowsay.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/cowsay.o -o bin/cowsay.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c cp.c -o bin/cp.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/cp.o -o bin/cp.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c crash.c -o bin/crash.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/crash.o -o bin/crash.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c curl.c -o bin/curl.o
|
||||
curl.c: In function 'main':
|
||||
curl.c:60:9: warning: unused variable 'host_len' [-Wunused-variable]
|
||||
60 | int host_len = i;
|
||||
| ^~~~~~~~
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/curl.o -o bin/curl.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c date.c -o bin/date.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/date.o -o bin/date.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c echo.c -o bin/echo.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/echo.o -o bin/echo.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c hello.c -o bin/hello.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/hello.o -o bin/hello.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c help.c -o bin/help.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/help.o -o bin/help.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c ls.c -o bin/ls.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/ls.o -o bin/ls.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c man.c -o bin/man.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/man.o -o bin/man.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c markdown.c -o bin/markdown.o
|
||||
markdown.c:59:12: warning: 'md_strncpy' defined but not used [-Wunused-function]
|
||||
59 | static int md_strncpy(char *dest, const char *src, int n) {
|
||||
| ^~~~~~~~~~
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/markdown.o -o bin/markdown.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c math.c -o bin/math.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/math.o -o bin/math.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c meminfo.c -o bin/meminfo.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/meminfo.o -o bin/meminfo.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c minesweeper.c -o bin/minesweeper.o
|
||||
minesweeper.c: In function 'minesweeper_handle_click':
|
||||
minesweeper.c:195:50: warning: unused parameter 'win' [-Wunused-parameter]
|
||||
195 | static void minesweeper_handle_click(ui_window_t win, int x, int y, int button) {
|
||||
| ~~~~~~~~~~~~^~~
|
||||
minesweeper.c: At top level:
|
||||
minesweeper.c:17:13: warning: 'debug_print' defined but not used [-Wunused-function]
|
||||
17 | static void debug_print(const char *msg) {
|
||||
| ^~~~~~~~~~~
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/minesweeper.o -o bin/minesweeper.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c mkdir.c -o bin/mkdir.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/mkdir.o -o bin/mkdir.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c mv.c -o bin/mv.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/mv.o -o bin/mv.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c net.c -o bin/net.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/net.o -o bin/net.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c notepad.c -o bin/notepad.o
|
||||
notepad.c: In function 'notepad_key':
|
||||
notepad.c:149:37: warning: unused parameter 'win' [-Wunused-parameter]
|
||||
149 | static void notepad_key(ui_window_t win, int h, char c) {
|
||||
| ~~~~~~~~~~~~^~~
|
||||
notepad.c: In function 'main':
|
||||
notepad.c:234:14: warning: unused parameter 'argc' [-Wunused-parameter]
|
||||
234 | int main(int argc, char **argv) {
|
||||
| ~~~~^~~~
|
||||
notepad.c:234:27: warning: unused parameter 'argv' [-Wunused-parameter]
|
||||
234 | int main(int argc, char **argv) {
|
||||
| ~~~~~~~^~~~
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/notepad.o -o bin/notepad.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c paint.c -o bin/paint.o
|
||||
paint.c: In function 'wm_show_message':
|
||||
paint.c:156:41: warning: unused parameter 'title' [-Wunused-parameter]
|
||||
156 | static void wm_show_message(const char *title, const char *msg) {
|
||||
| ~~~~~~~~~~~~^~~~~
|
||||
paint.c:156:60: warning: unused parameter 'msg' [-Wunused-parameter]
|
||||
156 | static void wm_show_message(const char *title, const char *msg) {
|
||||
| ~~~~~~~~~~~~^~~
|
||||
paint.c: At top level:
|
||||
paint.c:38:13: warning: 'debug_print' defined but not used [-Wunused-function]
|
||||
38 | static void debug_print(const char *msg) {
|
||||
| ^~~~~~~~~~~
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/paint.o -o bin/paint.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c pci_list.c -o bin/pci_list.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/pci_list.o -o bin/pci_list.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c ping.c -o bin/ping.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/ping.o -o bin/ping.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c pwd.c -o bin/pwd.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/pwd.o -o bin/pwd.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c reboot.c -o bin/reboot.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/reboot.o -o bin/reboot.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c rm.c -o bin/rm.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/rm.o -o bin/rm.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c settings.c -o bin/settings.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/settings.o bin/nanojpeg.o -o bin/settings.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c shutdown.c -o bin/shutdown.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/shutdown.o -o bin/shutdown.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c sweden.c -o bin/sweden.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/sweden.o -o bin/sweden.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c sysfetch.c -o bin/sysfetch.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/sysfetch.o -o bin/sysfetch.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c telnet.c -o bin/telnet.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/telnet.o -o bin/telnet.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c touch.c -o bin/touch.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/touch.o -o bin/touch.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c txtedit.c -o bin/txtedit.o
|
||||
txtedit.c: In function 'editor_paint':
|
||||
txtedit.c:330:10: warning: unused variable 'status_text' [-Wunused-variable]
|
||||
330 | char status_text[128];
|
||||
| ^~~~~~~~~~~
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/txtedit.o -o bin/txtedit.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c uptime.c -o bin/uptime.o
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/uptime.o -o bin/uptime.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -c viewer.c -o bin/viewer.o
|
||||
viewer.c: In function 'viewer_handle_click':
|
||||
viewer.c:104:45: warning: unused parameter 'win' [-Wunused-parameter]
|
||||
104 | static void viewer_handle_click(ui_window_t win, int x, int y) {
|
||||
| ~~~~~~~~~~~~^~~
|
||||
x86_64-elf-ld -m elf_x86_64 -nostdlib -static -no-pie -Ttext=0x40000000 --no-dynamic-linker -z text -z max-page-size=0x1000 -e _start bin/libui.o bin/stdlib.o bin/syscall.o bin/crt0.o bin/viewer.o bin/nanojpeg.o -o bin/viewer.elf
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -Wno-error -Idoom -c doom/am_map.c -o bin/am_map.o
|
||||
doom/am_map.c: In function 'AM_initVariables':
|
||||
doom/am_map.c:427:5: warning: missing initializer for field 'data4' of 'event_t' [-Wmissing-field-initializers]
|
||||
427 | static event_t st_notify = { ev_keyup, AM_MSGENTERED, 0, 0 };
|
||||
| ^~~~~~
|
||||
In file included from doom/st_stuff.h:25,
|
||||
from doom/am_map.c:27:
|
||||
doom/d_event.h:67:30: note: 'data4' declared here
|
||||
67 | int data1, data2, data3, data4;
|
||||
| ^~~~~
|
||||
doom/am_map.c: In function 'AM_Stop':
|
||||
doom/am_map.c:543:5: warning: missing initializer for field 'data4' of 'event_t' [-Wmissing-field-initializers]
|
||||
543 | static event_t st_notify = { 0, ev_keyup, AM_MSGEXITED, 0 };
|
||||
| ^~~~~~
|
||||
doom/d_event.h:67:30: note: 'data4' declared here
|
||||
67 | int data1, data2, data3, data4;
|
||||
| ^~~~~
|
||||
doom/am_map.c: In function 'AM_drawThings':
|
||||
doom/am_map.c:1293:9: warning: unused parameter 'colorrange' [-Wunused-parameter]
|
||||
1293 | int colorrange)
|
||||
| ~~~~~~^~~~~~~~~~
|
||||
x86_64-elf-gcc -Wall -Wextra -std=gnu11 -ffreestanding -O2 -fno-stack-protector -fno-stack-check -fno-lto -fno-pie -m64 -march=x86-64 -mno-80387 -mno-mmx -mno-sse -mno-sse2 -mno-red-zone -Ilibc -Wno-error -Idoom -c doom/boredos_libc.c -o bin/boredos_libc.o
|
||||
doom/boredos_libc.c:6:27: error: 'false' undeclared here (not in a function)
|
||||
6 | static FILE _stderr = {2, false, false};
|
||||
| ^~~~~
|
||||
doom/boredos_libc.c:3:1: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
|
||||
2 | #include <syscall.h>
|
||||
+++ |+#include <stdbool.h>
|
||||
3 |
|
||||
doom/boredos_libc.c:6:1: warning: missing initializer for field 'eof' of 'FILE' [-Wmissing-field-initializers]
|
||||
6 | static FILE _stderr = {2, false, false};
|
||||
| ^~~~~~
|
||||
In file included from doom/boredos_libc.c:1:
|
||||
doom/boredos_libc.h:17:9: note: 'eof' declared here
|
||||
17 | int eof;
|
||||
| ^~~
|
||||
doom/boredos_libc.c:7:1: warning: missing initializer for field 'eof' of 'FILE' [-Wmissing-field-initializers]
|
||||
7 | static FILE _stdout = {1, false, false};
|
||||
| ^~~~~~
|
||||
doom/boredos_libc.h:17:9: note: 'eof' declared here
|
||||
17 | int eof;
|
||||
| ^~~
|
||||
doom/boredos_libc.c: In function 'fread':
|
||||
doom/boredos_libc.c:37:25: error: 'true' undeclared (first use in this function)
|
||||
37 | stream->error = true;
|
||||
| ^~~~
|
||||
doom/boredos_libc.c:37:25: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
|
||||
doom/boredos_libc.c:37:25: note: each undeclared identifier is reported only once for each function it appears in
|
||||
doom/boredos_libc.c: In function 'fwrite':
|
||||
doom/boredos_libc.c:52:25: error: 'true' undeclared (first use in this function)
|
||||
52 | stream->error = true;
|
||||
| ^~~~
|
||||
doom/boredos_libc.c:52:25: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
|
||||
doom/boredos_libc.c: In function 'rename':
|
||||
doom/boredos_libc.c:73:24: warning: unused parameter 'oldpath' [-Wunused-parameter]
|
||||
73 | int rename(const char *oldpath, const char *newpath) {
|
||||
| ~~~~~~~~~~~~^~~~~~~
|
||||
doom/boredos_libc.c:73:45: warning: unused parameter 'newpath' [-Wunused-parameter]
|
||||
73 | int rename(const char *oldpath, const char *newpath) {
|
||||
| ~~~~~~~~~~~~^~~~~~~
|
||||
doom/boredos_libc.c: In function 'mkdir':
|
||||
doom/boredos_libc.c:94:37: warning: unused parameter 'mode' [-Wunused-parameter]
|
||||
94 | int mkdir(const char *pathname, int mode) {
|
||||
| ~~~~^~~~
|
||||
doom/boredos_libc.c: In function 'access':
|
||||
doom/boredos_libc.c:98:38: warning: unused parameter 'mode' [-Wunused-parameter]
|
||||
98 | int access(const char *pathname, int mode) {
|
||||
| ~~~~^~~~
|
||||
doom/boredos_libc.c: In function 'fprintf':
|
||||
doom/boredos_libc.c:179:19: warning: unused parameter 'stream' [-Wunused-parameter]
|
||||
179 | int fprintf(FILE *stream, const char *format, ...) { return 0; }
|
||||
| ~~~~~~^~~~~~
|
||||
doom/boredos_libc.c:179:39: warning: unused parameter 'format' [-Wunused-parameter]
|
||||
179 | int fprintf(FILE *stream, const char *format, ...) { return 0; }
|
||||
| ~~~~~~~~~~~~^~~~~~
|
||||
doom/boredos_libc.c: In function 'sprintf':
|
||||
doom/boredos_libc.c:180:19: warning: unused parameter 'str' [-Wunused-parameter]
|
||||
180 | int sprintf(char *str, const char *format, ...) { return 0; }
|
||||
| ~~~~~~^~~
|
||||
doom/boredos_libc.c:180:36: warning: unused parameter 'format' [-Wunused-parameter]
|
||||
180 | int sprintf(char *str, const char *format, ...) { return 0; }
|
||||
| ~~~~~~~~~~~~^~~~~~
|
||||
doom/boredos_libc.c: In function 'snprintf':
|
||||
doom/boredos_libc.c:181:20: warning: unused parameter 'str' [-Wunused-parameter]
|
||||
181 | int snprintf(char *str, size_t size, const char *format, ...) { return 0; }
|
||||
| ~~~~~~^~~
|
||||
doom/boredos_libc.c:181:32: warning: unused parameter 'size' [-Wunused-parameter]
|
||||
181 | int snprintf(char *str, size_t size, const char *format, ...) { return 0; }
|
||||
| ~~~~~~~^~~~
|
||||
doom/boredos_libc.c:181:50: warning: unused parameter 'format' [-Wunused-parameter]
|
||||
181 | int snprintf(char *str, size_t size, const char *format, ...) { return 0; }
|
||||
| ~~~~~~~~~~~~^~~~~~
|
||||
doom/boredos_libc.c: In function 'vsnprintf':
|
||||
doom/boredos_libc.c:182:21: warning: unused parameter 'str' [-Wunused-parameter]
|
||||
182 | int vsnprintf(char *str, size_t size, const char *format, va_list ap) { return 0; }
|
||||
| ~~~~~~^~~
|
||||
doom/boredos_libc.c:182:33: warning: unused parameter 'size' [-Wunused-parameter]
|
||||
182 | int vsnprintf(char *str, size_t size, const char *format, va_list ap) { return 0; }
|
||||
| ~~~~~~~^~~~
|
||||
doom/boredos_libc.c:182:51: warning: unused parameter 'format' [-Wunused-parameter]
|
||||
182 | int vsnprintf(char *str, size_t size, const char *format, va_list ap) { return 0; }
|
||||
| ~~~~~~~~~~~~^~~~~~
|
||||
doom/boredos_libc.c:182:67: warning: unused parameter 'ap' [-Wunused-parameter]
|
||||
182 | int vsnprintf(char *str, size_t size, const char *format, va_list ap) { return 0; }
|
||||
| ~~~~~~~~^~
|
||||
doom/boredos_libc.c: In function 'sscanf':
|
||||
doom/boredos_libc.c:183:24: warning: unused parameter 'str' [-Wunused-parameter]
|
||||
183 | int sscanf(const char *str, const char *format, ...) { return 0; }
|
||||
| ~~~~~~~~~~~~^~~
|
||||
doom/boredos_libc.c:183:41: warning: unused parameter 'format' [-Wunused-parameter]
|
||||
183 | int sscanf(const char *str, const char *format, ...) { return 0; }
|
||||
| ~~~~~~~~~~~~^~~~~~
|
||||
make[1]: *** [bin/boredos_libc.o] Error 1
|
||||
rm bin/pwd.o bin/minesweeper.o bin/ls.o bin/echo.o bin/pci_list.o bin/date.o bin/mkdir.o bin/help.o bin/markdown.o bin/cc.o bin/sweden.o bin/rm.o bin/notepad.o bin/man.o bin/clock.o bin/clear.o bin/cat.o bin/cp.o bin/paint.o bin/crash.o bin/reboot.o bin/beep.o bin/meminfo.o bin/net.o bin/calculator.o bin/cowsay.o bin/telnet.o bin/hello.o bin/math.o bin/curl.o bin/uptime.o bin/about.o bin/sysfetch.o bin/ping.o bin/mv.o bin/txtedit.o bin/touch.o bin/shutdown.o
|
||||
make: *** [build/boredos.elf] Error 2
|
||||
BIN
build/cmd.o
BIN
build/cmd.o
Binary file not shown.
BIN
build/explorer.o
BIN
build/explorer.o
Binary file not shown.
BIN
build/ps2.o
BIN
build/ps2.o
Binary file not shown.
BIN
doom1.wad
Normal file
BIN
doom1.wad
Normal file
Binary file not shown.
|
|
@ -13,3 +13,4 @@ backdrop: 000000
|
|||
/BoredOS
|
||||
protocol: limine
|
||||
path: boot():/boredos.elf
|
||||
module_path: boot():/doom1.wad
|
||||
|
|
|
|||
|
|
@ -2004,7 +2004,8 @@ void cmd_set_raw_mode(bool enabled) {
|
|||
terminal_raw_mode = enabled;
|
||||
}
|
||||
|
||||
static void cmd_key(Window *target, char c) {
|
||||
static void cmd_key(Window *target, char c, bool pressed) {
|
||||
if (!pressed) return;
|
||||
(void)target;
|
||||
|
||||
if (terminal_raw_mode) {
|
||||
|
|
|
|||
|
|
@ -1589,7 +1589,8 @@ static void explorer_handle_click(Window *win, int x, int y) {
|
|||
|
||||
// === Key Handler ===
|
||||
|
||||
static void explorer_handle_key(Window *win, char c) {
|
||||
static void explorer_handle_key(Window *win, char c, bool pressed) {
|
||||
if (!pressed) return;
|
||||
ExplorerState *state = (ExplorerState*)win->data;
|
||||
|
||||
// Handle dialog input
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#define GUI_EVENT_MOUSE_DOWN 6
|
||||
#define GUI_EVENT_MOUSE_UP 7
|
||||
#define GUI_EVENT_MOUSE_MOVE 8
|
||||
#define GUI_EVENT_KEYUP 10
|
||||
|
||||
typedef struct {
|
||||
int type;
|
||||
|
|
|
|||
|
|
@ -28,21 +28,20 @@ static bool shift_pressed = false;
|
|||
static bool ctrl_pressed = false;
|
||||
static bool extended_scancode = false;
|
||||
|
||||
// Simple US QWERTY Scan Code Set 1 Map
|
||||
static char scancode_map[128] = {
|
||||
0, 27, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', '\b',
|
||||
'\t', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n',
|
||||
0, 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', 0,
|
||||
21, 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', 0,
|
||||
'\\', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', 0, '*',
|
||||
0, ' ', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
22, ' ', 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
static char scancode_map_shift[128] = {
|
||||
0, 27, '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '+', '\b',
|
||||
'\t', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n',
|
||||
0, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', '~', 0,
|
||||
21, 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"', '~', 0,
|
||||
'|', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', '<', '>', '?', 0, '*',
|
||||
0, ' ', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
22, ' ', 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
|
||||
uint64_t keyboard_handler(registers_t *regs) {
|
||||
|
|
@ -81,24 +80,34 @@ uint64_t keyboard_handler(registers_t *regs) {
|
|||
shift_pressed = false;
|
||||
} else if (!(scancode & 0x80)) { // Key Press (not release)
|
||||
if (extended_scancode) {
|
||||
// Extended scancode - arrow keys and special keys
|
||||
extended_scancode = false;
|
||||
switch (scancode) {
|
||||
case 0x48: wm_handle_key(17); break; // Up arrow
|
||||
case 0x50: wm_handle_key(18); break; // Down arrow
|
||||
case 0x4B: wm_handle_key(19); break; // Left arrow
|
||||
case 0x4D: wm_handle_key(20); break; // Right arrow
|
||||
case 0x48: wm_handle_key(17, true); break; // Up arrow
|
||||
case 0x50: wm_handle_key(18, true); break; // Down arrow
|
||||
case 0x4B: wm_handle_key(19, true); break; // Left arrow
|
||||
case 0x4D: wm_handle_key(20, true); break; // Right arrow
|
||||
}
|
||||
} else {
|
||||
// Regular scancode
|
||||
char c = shift_pressed ? scancode_map_shift[scancode] : scancode_map[scancode];
|
||||
if (c) {
|
||||
wm_handle_key(c);
|
||||
wm_handle_key(c, true);
|
||||
}
|
||||
}
|
||||
} else if (scancode & 0x80) {
|
||||
// Key release
|
||||
} else if (scancode & 0x80) { // Key release
|
||||
if (extended_scancode) {
|
||||
extended_scancode = false;
|
||||
switch (scancode & 0x7F) { // Strip the release bit
|
||||
case 0x48: wm_handle_key(17, false); break; // Up arrow
|
||||
case 0x50: wm_handle_key(18, false); break; // Down arrow
|
||||
case 0x4B: wm_handle_key(19, false); break; // Left arrow
|
||||
case 0x4D: wm_handle_key(20, false); break; // Right arrow
|
||||
}
|
||||
} else {
|
||||
char c = shift_pressed ? scancode_map_shift[scancode & 0x7F] : scancode_map[scancode & 0x7F];
|
||||
if (c) {
|
||||
wm_handle_key(c, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
outb(0x20, 0x20); // EOI
|
||||
|
|
|
|||
|
|
@ -125,10 +125,10 @@ void syscall_send_mouse_up_event(Window *win, int x, int y) {
|
|||
user_window_mouse_up(win, x, y);
|
||||
}
|
||||
|
||||
static void user_window_key(Window *win, char c) {
|
||||
static void user_window_key(Window *win, char c, bool pressed) {
|
||||
process_t *proc = (process_t *)win->data;
|
||||
if (!proc) return;
|
||||
gui_event_t ev = { .type = GUI_EVENT_KEY, .arg1 = (int)c };
|
||||
gui_event_t ev = { .type = pressed ? GUI_EVENT_KEY : GUI_EVENT_KEYUP, .arg1 = (int)c };
|
||||
process_push_gui_event(proc, &ev);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@ LIBC_OBJS = $(patsubst libc/%.c, $(BIN_DIR)/%.o, $(LIBC_SOURCES)) $(BIN_DIR)/crt
|
|||
APP_SOURCES = $(filter-out nanojpeg.c, $(wildcard *.c))
|
||||
APP_ELFS = $(patsubst %.c, $(BIN_DIR)/%.elf, $(APP_SOURCES))
|
||||
|
||||
all: $(BIN_DIR) $(APP_ELFS)
|
||||
DOOM_SOURCES = $(wildcard doom/*.c)
|
||||
DOOM_OBJS = $(patsubst doom/%.c, $(BIN_DIR)/%.o, $(DOOM_SOURCES))
|
||||
|
||||
all: $(BIN_DIR) $(APP_ELFS) $(BIN_DIR)/doom.elf
|
||||
|
||||
$(BIN_DIR):
|
||||
mkdir -p $(BIN_DIR)
|
||||
|
|
@ -42,6 +45,12 @@ $(BIN_DIR)/settings.elf: $(LIBC_OBJS) $(BIN_DIR)/settings.o $(BIN_DIR)/nanojpeg.
|
|||
$(BIN_DIR)/browser.elf: $(LIBC_OBJS) $(BIN_DIR)/browser.o $(BIN_DIR)/nanojpeg.o
|
||||
$(LD) $(LDFLAGS) $^ -o $@
|
||||
|
||||
$(BIN_DIR)/%.o: doom/%.c
|
||||
$(CC) $(CFLAGS) -Wno-error -Idoom -c $< -o $@
|
||||
|
||||
$(BIN_DIR)/doom.elf: $(LIBC_OBJS) $(DOOM_OBJS) $(BIN_DIR)/nanojpeg.o
|
||||
$(LD) $(LDFLAGS) $^ -o $@
|
||||
|
||||
$(BIN_DIR)/%.elf: $(LIBC_OBJS) $(BIN_DIR)/%.o
|
||||
$(LD) $(LDFLAGS) $^ -o $@
|
||||
|
||||
|
|
|
|||
|
|
@ -1197,7 +1197,8 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
}
|
||||
if (!found) { focused_element = -1; needs_repaint = true; }
|
||||
} else if (ev.type == GUI_EVENT_KEY) {
|
||||
} else if (ev.type == GUI_EVENT_KEY || ev.type == GUI_EVENT_KEYUP) {
|
||||
if (ev.type == GUI_EVENT_KEYUP) continue;
|
||||
char c = (char)ev.arg1;
|
||||
if (focused_element == -1) {
|
||||
if (c == 13 || c == 10) {
|
||||
|
|
|
|||
54
src/kernel/userland/doom/Makefile
Normal file
54
src/kernel/userland/doom/Makefile
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
################################################################
|
||||
#
|
||||
# $Id:$
|
||||
#
|
||||
# $Log:$
|
||||
#
|
||||
|
||||
ifeq ($(V),1)
|
||||
VB=''
|
||||
else
|
||||
VB=@
|
||||
endif
|
||||
|
||||
|
||||
CC=clang # gcc or g++
|
||||
CFLAGS+=-ggdb3 -Os
|
||||
LDFLAGS+=-Wl,--gc-sections
|
||||
CFLAGS+=-ggdb3 -Wall -DNORMALUNIX -DLINUX -DSNDSERV -D_DEFAULT_SOURCE # -DUSEASM
|
||||
LIBS+=-lm -lc -lX11
|
||||
|
||||
# subdirectory for objects
|
||||
OBJDIR=build
|
||||
OUTPUT=doomgeneric
|
||||
|
||||
SRC_DOOM = dummy.o am_map.o doomdef.o doomstat.o dstrings.o d_event.o d_items.o d_iwad.o d_loop.o d_main.o d_mode.o d_net.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o info.o i_cdmus.o i_endoom.o i_joystick.o i_scale.o i_sound.o i_system.o i_timer.o memio.o m_argv.o m_bbox.o m_cheat.o m_config.o m_controls.o m_fixed.o m_menu.o m_misc.o m_random.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o sha1.o sounds.o statdump.o st_lib.o st_stuff.o s_sound.o tables.o v_video.o wi_stuff.o w_checksum.o w_file.o w_main.o w_wad.o z_zone.o w_file_stdc.o i_input.o i_video.o doomgeneric.o doomgeneric_xlib.o
|
||||
OBJS += $(addprefix $(OBJDIR)/, $(SRC_DOOM))
|
||||
|
||||
all: $(OUTPUT)
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR)
|
||||
rm -f $(OUTPUT)
|
||||
rm -f $(OUTPUT).gdb
|
||||
rm -f $(OUTPUT).map
|
||||
|
||||
$(OUTPUT): $(OBJS)
|
||||
@echo [Linking $@]
|
||||
$(VB)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) \
|
||||
-o $(OUTPUT) $(LIBS) -Wl,-Map,$(OUTPUT).map
|
||||
@echo [Size]
|
||||
-$(CROSS_COMPILE)size $(OUTPUT)
|
||||
|
||||
$(OBJS): | $(OBJDIR)
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir -p $(OBJDIR)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@echo [Compiling $<]
|
||||
$(VB)$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
print:
|
||||
@echo OBJS: $(OBJS)
|
||||
|
||||
71
src/kernel/userland/doom/Makefile.djgpp
Normal file
71
src/kernel/userland/doom/Makefile.djgpp
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
################################################################
|
||||
#
|
||||
# $Id:$
|
||||
#
|
||||
# $Log:$
|
||||
#
|
||||
|
||||
.PHONY: all clean print
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
ifeq ($(V),1)
|
||||
VB=''
|
||||
else
|
||||
VB=@
|
||||
endif
|
||||
|
||||
|
||||
|
||||
CC:=i386-pc-msdosdjgpp-gcc
|
||||
OPTFLAGS:=-O3
|
||||
CFLAGS+=-std=gnu89
|
||||
CFLAGS+=$(OPTFLAGS)
|
||||
CFLAGS+=-Werror
|
||||
CFLAGS+=-DDOOMGENERIC_RESX=320 -DDOOMGENERIC_RESY=200
|
||||
CFLAGS+=-DFEATURE_SOUND=1
|
||||
CFLAGS+=-DCMAP256
|
||||
|
||||
# link time optimization, no significant effect on performance
|
||||
# CFLAGS+=-flto
|
||||
# LDFLAGS+=-flto $(OPTFLAGS)
|
||||
|
||||
# debug
|
||||
# CFLAGS+=-g
|
||||
# LDFLAGS+=-g
|
||||
|
||||
LIBS+=-lalleg
|
||||
#LIBS+=-lalld # debug library
|
||||
|
||||
# subdirectory for objects
|
||||
OBJDIR:=djgpp
|
||||
OUTPUT:=doomgen.exe
|
||||
|
||||
SRC_DOOM = dummy.o am_map.o doomdef.o doomstat.o dstrings.o d_event.o d_items.o d_iwad.o d_loop.o d_main.o d_mode.o d_net.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o info.o i_cdmus.o i_endoom.o i_joystick.o i_scale.o i_sound.o i_system.o i_timer.o memio.o m_argv.o m_bbox.o m_cheat.o m_config.o m_controls.o m_fixed.o m_menu.o m_misc.o m_random.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o sha1.o sounds.o statdump.o st_lib.o st_stuff.o s_sound.o tables.o v_video.o wi_stuff.o w_checksum.o w_file.o w_main.o w_wad.o z_zone.o w_file_stdc.o i_input.o i_video.o doomgeneric.o doomgeneric_allegro.o mus2mid.o i_allegromusic.o i_allegrosound.o
|
||||
OBJS += $(addprefix $(OBJDIR)/, $(SRC_DOOM))
|
||||
|
||||
all: $(OUTPUT)
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR)
|
||||
rm -f $(OUTPUT)
|
||||
rm -f $(OUTPUT).gdb
|
||||
rm -f $(OUTPUT).map
|
||||
|
||||
$(OUTPUT): $(OBJS)
|
||||
@echo [Linking $@]
|
||||
$(VB)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) \
|
||||
-o $(OUTPUT) $(LIBS)
|
||||
|
||||
$(OBJS): | $(OBJDIR)
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir -p $(OBJDIR)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@echo [Compiling $<]
|
||||
$(VB)$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
print:
|
||||
@echo OBJS: $(OBJS)
|
||||
|
||||
50
src/kernel/userland/doom/Makefile.emscripten
Normal file
50
src/kernel/userland/doom/Makefile.emscripten
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
|
||||
ifeq ($(V),1)
|
||||
VB=''
|
||||
else
|
||||
VB=@
|
||||
endif
|
||||
|
||||
|
||||
SDL_CFLAGS = `sdl2-config --cflags`
|
||||
SDL_LIBS = `sdl2-config --cflags --libs` -lSDL2_mixer
|
||||
|
||||
|
||||
CC=emcc
|
||||
CFLAGS+=-DFEATURE_SOUND -s SDL2_MIXER_FORMATS='["mid"]' $(SDL_CFLAGS)
|
||||
LDFLAGS+=--preload-file doom1.wad #--preload-file timidity.cfg --preload-file dgguspat
|
||||
LIBS+=-lm -lc $(SDL_LIBS)
|
||||
|
||||
# subdirectory for objects
|
||||
OBJDIR=build
|
||||
OUTPUT=doomgeneric
|
||||
|
||||
SRC_DOOM = dummy.o am_map.o doomdef.o doomstat.o dstrings.o d_event.o d_items.o d_iwad.o d_loop.o d_main.o d_mode.o d_net.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o info.o i_cdmus.o i_endoom.o i_joystick.o i_scale.o i_sound.o i_system.o i_timer.o memio.o m_argv.o m_bbox.o m_cheat.o m_config.o m_controls.o m_fixed.o m_menu.o m_misc.o m_random.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o sha1.o sounds.o statdump.o st_lib.o st_stuff.o s_sound.o tables.o v_video.o wi_stuff.o w_checksum.o w_file.o w_main.o w_wad.o z_zone.o w_file_stdc.o i_input.o i_video.o doomgeneric.o doomgeneric_emscripten.o mus2mid.o i_sdlmusic.o i_sdlsound.o
|
||||
OBJS += $(addprefix $(OBJDIR)/, $(SRC_DOOM))
|
||||
|
||||
all: $(OUTPUT)
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR)
|
||||
rm -f $(OUTPUT).html
|
||||
rm -f $(OUTPUT).js
|
||||
rm -f $(OUTPUT).data
|
||||
rm -f $(OUTPUT).wasm
|
||||
|
||||
$(OUTPUT): $(OBJS)
|
||||
@echo [Linking $@]
|
||||
$(VB)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) \
|
||||
-o $(OUTPUT).html $(LIBS)
|
||||
|
||||
$(OBJS): | $(OBJDIR)
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir -p $(OBJDIR)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@echo [Compiling $<]
|
||||
$(VB)$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
print:
|
||||
@echo OBJS: $(OBJS)
|
||||
|
||||
50
src/kernel/userland/doom/Makefile.freebsd
Normal file
50
src/kernel/userland/doom/Makefile.freebsd
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
################################################################
|
||||
#
|
||||
# $Id:$
|
||||
#
|
||||
# $Log:$
|
||||
#
|
||||
|
||||
VB=@
|
||||
|
||||
|
||||
CC=clang # gcc or g++
|
||||
CFLAGS+=-ggdb3 -Os -I/usr/local/include
|
||||
LDFLAGS+=-Wl,--gc-sections -L/usr/local/lib
|
||||
CFLAGS+=-ggdb3 -Wall -DNORMALUNIX -DLINUX -DSNDSERV # -DUSEASM
|
||||
LIBS+=-lm -lc -lX11
|
||||
|
||||
# subdirectory for objects
|
||||
OBJDIR=build
|
||||
OUTPUT=doomgeneric
|
||||
|
||||
SRC_DOOM = dummy.o am_map.o doomdef.o doomstat.o dstrings.o d_event.o d_items.o d_iwad.o d_loop.o d_main.o d_mode.o d_net.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o info.o i_cdmus.o i_endoom.o i_joystick.o i_scale.o i_sound.o i_system.o i_timer.o memio.o m_argv.o m_bbox.o m_cheat.o m_config.o m_controls.o m_fixed.o m_menu.o m_misc.o m_random.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o sha1.o sounds.o statdump.o st_lib.o st_stuff.o s_sound.o tables.o v_video.o wi_stuff.o w_checksum.o w_file.o w_main.o w_wad.o z_zone.o w_file_stdc.o i_input.o i_video.o doomgeneric.o doomgeneric_xlib.o
|
||||
OBJS += $(addprefix $(OBJDIR)/, $(SRC_DOOM))
|
||||
|
||||
all: $(OUTPUT)
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR)
|
||||
rm -f $(OUTPUT)
|
||||
rm -f $(OUTPUT).gdb
|
||||
rm -f $(OUTPUT).map
|
||||
|
||||
$(OUTPUT): $(OBJS)
|
||||
@echo [Linking $@]
|
||||
$(VB)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) \
|
||||
-o $(OUTPUT) $(LIBS) -Wl,-Map,$(OUTPUT).map
|
||||
@echo [Size]
|
||||
-$(CROSS_COMPILE)size $(OUTPUT)
|
||||
|
||||
$(OBJS): | $(OBJDIR)
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir -p $(OBJDIR)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@echo [Compiling $<]
|
||||
$(VB)$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
print:
|
||||
@echo OBJS: $(OBJS)
|
||||
|
||||
51
src/kernel/userland/doom/Makefile.linuxvt
Normal file
51
src/kernel/userland/doom/Makefile.linuxvt
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
################################################################
|
||||
#
|
||||
# $Id:$
|
||||
#
|
||||
# $Log:$
|
||||
#
|
||||
|
||||
ifeq ($(V),1)
|
||||
VB=''
|
||||
else
|
||||
VB=@
|
||||
endif
|
||||
|
||||
CC=clang # gcc or g++
|
||||
CFLAGS+=-ggdb3 -Os
|
||||
LDFLAGS+=-Wl,--gc-sections
|
||||
CFLAGS+=-ggdb3 -Wall -DNORMALUNIX -DLINUX -DSNDSERV -D_DEFAULT_SOURCE # -DUSEASM
|
||||
LIBS+=-lm -lc
|
||||
|
||||
# subdirectory for objects
|
||||
OBJDIR=build
|
||||
OUTPUT=doomgeneric
|
||||
|
||||
SRC_DOOM = dummy.o am_map.o doomdef.o doomstat.o dstrings.o d_event.o d_items.o d_iwad.o d_loop.o d_main.o d_mode.o d_net.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o info.o i_cdmus.o i_endoom.o i_joystick.o i_scale.o i_sound.o i_system.o i_timer.o memio.o m_argv.o m_bbox.o m_cheat.o m_config.o m_controls.o m_fixed.o m_menu.o m_misc.o m_random.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o sha1.o sounds.o statdump.o st_lib.o st_stuff.o s_sound.o tables.o v_video.o wi_stuff.o w_checksum.o w_file.o w_main.o w_wad.o z_zone.o w_file_stdc.o i_input.o i_video.o doomgeneric.o doomgeneric_linuxvt.o mus2mid.o
|
||||
OBJS += $(addprefix $(OBJDIR)/, $(SRC_DOOM))
|
||||
|
||||
all: $(OUTPUT)
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR)
|
||||
rm -f $(OUTPUT)
|
||||
rm -f $(OUTPUT).gdb
|
||||
rm -f $(OUTPUT).map
|
||||
|
||||
$(OUTPUT): $(OBJS)
|
||||
@echo [Linking $@]
|
||||
$(VB)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) \
|
||||
-o $(OUTPUT) $(LIBS)
|
||||
|
||||
$(OBJS): | $(OBJDIR)
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir -p $(OBJDIR)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@echo [Compiling $<]
|
||||
$(VB)$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
print:
|
||||
@echo OBJS: $(OBJS)
|
||||
|
||||
55
src/kernel/userland/doom/Makefile.sdl
Normal file
55
src/kernel/userland/doom/Makefile.sdl
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
################################################################
|
||||
#
|
||||
# $Id:$
|
||||
#
|
||||
# $Log:$
|
||||
#
|
||||
|
||||
ifeq ($(V),1)
|
||||
VB=''
|
||||
else
|
||||
VB=@
|
||||
endif
|
||||
|
||||
|
||||
SDL_CFLAGS = `sdl2-config --cflags`
|
||||
SDL_LIBS = `sdl2-config --cflags --libs` -lSDL2_mixer
|
||||
|
||||
|
||||
CC=clang # gcc or g++
|
||||
CFLAGS+=-DFEATURE_SOUND $(SDL_CFLAGS)
|
||||
LDFLAGS+=
|
||||
LIBS+=-lm -lc $(SDL_LIBS)
|
||||
|
||||
# subdirectory for objects
|
||||
OBJDIR=build
|
||||
OUTPUT=doomgeneric
|
||||
|
||||
SRC_DOOM = dummy.o am_map.o doomdef.o doomstat.o dstrings.o d_event.o d_items.o d_iwad.o d_loop.o d_main.o d_mode.o d_net.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o info.o i_cdmus.o i_endoom.o i_joystick.o i_scale.o i_sound.o i_system.o i_timer.o memio.o m_argv.o m_bbox.o m_cheat.o m_config.o m_controls.o m_fixed.o m_menu.o m_misc.o m_random.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o sha1.o sounds.o statdump.o st_lib.o st_stuff.o s_sound.o tables.o v_video.o wi_stuff.o w_checksum.o w_file.o w_main.o w_wad.o z_zone.o w_file_stdc.o i_input.o i_video.o doomgeneric.o doomgeneric_sdl.o mus2mid.o i_sdlmusic.o i_sdlsound.o
|
||||
OBJS += $(addprefix $(OBJDIR)/, $(SRC_DOOM))
|
||||
|
||||
all: $(OUTPUT)
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR)
|
||||
rm -f $(OUTPUT)
|
||||
rm -f $(OUTPUT).gdb
|
||||
rm -f $(OUTPUT).map
|
||||
|
||||
$(OUTPUT): $(OBJS)
|
||||
@echo [Linking $@]
|
||||
$(VB)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) \
|
||||
-o $(OUTPUT) $(LIBS)
|
||||
|
||||
$(OBJS): | $(OBJDIR)
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir -p $(OBJDIR)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@echo [Compiling $<]
|
||||
$(VB)$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
print:
|
||||
@echo OBJS: $(OBJS)
|
||||
|
||||
53
src/kernel/userland/doom/Makefile.soso
Normal file
53
src/kernel/userland/doom/Makefile.soso
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
################################################################
|
||||
#
|
||||
# $Id:$
|
||||
#
|
||||
# $Log:$
|
||||
#
|
||||
|
||||
ifeq ($(V),1)
|
||||
VB=''
|
||||
else
|
||||
VB=@
|
||||
endif
|
||||
|
||||
|
||||
CC=musl-clang # gcc or g++
|
||||
CFLAGS+=-O3
|
||||
LDFLAGS+=-static
|
||||
CFLAGS+=-Wall -DNORMALUNIX -DLINUX -DSNDSERV -D_DEFAULT_SOURCE # -DUSEASM
|
||||
LIBS+=
|
||||
|
||||
# subdirectory for objects
|
||||
OBJDIR=build
|
||||
OUTPUT=fbdoom
|
||||
|
||||
SRC_DOOM = dummy.o am_map.o doomdef.o doomstat.o dstrings.o d_event.o d_items.o d_iwad.o d_loop.o d_main.o d_mode.o d_net.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o info.o i_cdmus.o i_endoom.o i_joystick.o i_scale.o i_sound.o i_system.o i_timer.o memio.o m_argv.o m_bbox.o m_cheat.o m_config.o m_controls.o m_fixed.o m_menu.o m_misc.o m_random.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o sha1.o sounds.o statdump.o st_lib.o st_stuff.o s_sound.o tables.o v_video.o wi_stuff.o w_checksum.o w_file.o w_main.o w_wad.o z_zone.o w_file_stdc.o i_input.o i_video.o doomgeneric.o doomgeneric_soso.o
|
||||
OBJS += $(addprefix $(OBJDIR)/, $(SRC_DOOM))
|
||||
|
||||
all: $(OUTPUT)
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR)
|
||||
rm -f $(OUTPUT)
|
||||
rm -f $(OUTPUT).gdb
|
||||
rm -f $(OUTPUT).map
|
||||
|
||||
$(OUTPUT): $(OBJS)
|
||||
@echo [Linking $@]
|
||||
musl-clang -v $(LDFLAGS) $(OBJS) -o $(OUTPUT) $(LIBS)
|
||||
@echo [Size]
|
||||
-$(CROSS_COMPILE)size $(OUTPUT)
|
||||
|
||||
$(OBJS): | $(OBJDIR)
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir -p $(OBJDIR)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@echo [Compiling $<]
|
||||
$(VB)$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
print:
|
||||
@echo OBJS: $(OBJS)
|
||||
|
||||
54
src/kernel/userland/doom/Makefile.sosox
Normal file
54
src/kernel/userland/doom/Makefile.sosox
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
################################################################
|
||||
#
|
||||
# $Id:$
|
||||
#
|
||||
# $Log:$
|
||||
#
|
||||
|
||||
ifeq ($(V),1)
|
||||
VB=''
|
||||
else
|
||||
VB=@
|
||||
endif
|
||||
|
||||
|
||||
CC=/opt/musl-i386-clang-debug/bin/musl-clang-debug # gcc or g++
|
||||
CFLAGS+=-g
|
||||
LDFLAGS+=-static
|
||||
CFLAGS+=-I../../microwindows/src/include -Wall -DNORMALUNIX -DLINUX -DSNDSERV -D_DEFAULT_SOURCE # -DUSEASM
|
||||
LIBS+=-L../../microwindows/src/lib -lnano-X
|
||||
|
||||
# subdirectory for objects
|
||||
OBJDIR=build
|
||||
OUTPUT=doom
|
||||
|
||||
SRC_DOOM = dummy.o am_map.o doomdef.o doomstat.o dstrings.o d_event.o d_items.o d_iwad.o d_loop.o d_main.o d_mode.o d_net.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o info.o i_cdmus.o i_endoom.o i_joystick.o i_scale.o i_sound.o i_system.o i_timer.o memio.o m_argv.o m_bbox.o m_cheat.o m_config.o m_controls.o m_fixed.o m_menu.o m_misc.o m_random.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o sha1.o sounds.o statdump.o st_lib.o st_stuff.o s_sound.o tables.o v_video.o wi_stuff.o w_checksum.o w_file.o w_main.o w_wad.o z_zone.o w_file_stdc.o i_input.o i_video.o doomgeneric.o doomgeneric_sosox.o
|
||||
OBJS += $(addprefix $(OBJDIR)/, $(SRC_DOOM))
|
||||
|
||||
all: $(OUTPUT)
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJDIR)
|
||||
rm -f $(OUTPUT)
|
||||
rm -f $(OUTPUT).gdb
|
||||
rm -f $(OUTPUT).map
|
||||
|
||||
$(OUTPUT): $(OBJS)
|
||||
@echo [Linking $@]
|
||||
/opt/musl-i386-clang-debug/bin/musl-clang-debug -v $(LDFLAGS) $(OBJS) -o $(OUTPUT) $(LIBS)
|
||||
@echo [Size]
|
||||
-$(CROSS_COMPILE)size $(OUTPUT)
|
||||
cp $(OUTPUT) ~/git/soso/userspace/bin/
|
||||
|
||||
$(OBJS): | $(OBJDIR)
|
||||
|
||||
$(OBJDIR):
|
||||
mkdir -p $(OBJDIR)
|
||||
|
||||
$(OBJDIR)/%.o: %.c
|
||||
@echo [Compiling $<]
|
||||
$(VB)$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
print:
|
||||
@echo OBJS: $(OBJS)
|
||||
|
||||
1355
src/kernel/userland/doom/am_map.c
Normal file
1355
src/kernel/userland/doom/am_map.c
Normal file
File diff suppressed because it is too large
Load diff
49
src/kernel/userland/doom/am_map.h
Normal file
49
src/kernel/userland/doom/am_map.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// AutoMap module.
|
||||
//
|
||||
|
||||
#ifndef __AMMAP_H__
|
||||
#define __AMMAP_H__
|
||||
|
||||
#include "d_event.h"
|
||||
#include "m_cheat.h"
|
||||
|
||||
// Used by ST StatusBar stuff.
|
||||
#define AM_MSGHEADER (('a'<<24)+('m'<<16))
|
||||
#define AM_MSGENTERED (AM_MSGHEADER | ('e'<<8))
|
||||
#define AM_MSGEXITED (AM_MSGHEADER | ('x'<<8))
|
||||
|
||||
|
||||
// Called by main loop.
|
||||
boolean AM_Responder (event_t* ev);
|
||||
|
||||
// Called by main loop.
|
||||
void AM_Ticker (void);
|
||||
|
||||
// Called by main loop,
|
||||
// called instead of view drawer if automap active.
|
||||
void AM_Drawer (void);
|
||||
|
||||
// Called to force the automap to quit
|
||||
// if the level is completed while it is up.
|
||||
void AM_Stop (void);
|
||||
|
||||
|
||||
extern cheatseq_t cheat_amap;
|
||||
|
||||
|
||||
#endif
|
||||
4
src/kernel/userland/doom/assert.h
Normal file
4
src/kernel/userland/doom/assert.h
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
#ifndef _ASSERT_H
|
||||
#define _ASSERT_H
|
||||
#define assert(x)
|
||||
#endif
|
||||
243
src/kernel/userland/doom/boredos_libc.c
Normal file
243
src/kernel/userland/doom/boredos_libc.c
Normal file
|
|
@ -0,0 +1,243 @@
|
|||
#include "boredos_libc.h"
|
||||
#include <syscall.h>
|
||||
|
||||
int errno = 0;
|
||||
|
||||
static FILE _stderr = {2, 0, 0};
|
||||
static FILE _stdout = {1, 0, 0};
|
||||
static FILE _stdin = {0, 0, 0};
|
||||
|
||||
FILE* stderr = &_stderr;
|
||||
FILE* stdout = &_stdout;
|
||||
FILE* stdin = &_stdin;
|
||||
|
||||
FILE *fopen(const char *path, const char *mode) {
|
||||
int fd = sys_open(path, mode);
|
||||
if (fd < 0) return NULL;
|
||||
FILE *f = malloc(sizeof(FILE));
|
||||
f->fd = fd;
|
||||
f->eof = 0;
|
||||
f->error = 0;
|
||||
return f;
|
||||
}
|
||||
|
||||
int fclose(FILE *stream) {
|
||||
if (!stream) return EOF;
|
||||
if (stream != stderr && stream != stdout && stream != stdin) {
|
||||
sys_close(stream->fd);
|
||||
free(stream);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream) {
|
||||
if (!stream) return 0;
|
||||
int bytes = sys_read(stream->fd, ptr, size * nmemb);
|
||||
if (bytes < 0) {
|
||||
stream->error = 1;
|
||||
return 0;
|
||||
}
|
||||
if (bytes == 0) stream->eof = 1;
|
||||
return bytes / size;
|
||||
}
|
||||
|
||||
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) {
|
||||
if (!stream) return 0;
|
||||
if (stream == stdout || stream == stderr) {
|
||||
sys_write(stream->fd, ptr, size * nmemb);
|
||||
return nmemb;
|
||||
}
|
||||
int bytes = sys_write_fs(stream->fd, ptr, size * nmemb);
|
||||
if (bytes < 0) {
|
||||
stream->error = 1;
|
||||
return 0;
|
||||
}
|
||||
return bytes / size;
|
||||
}
|
||||
|
||||
int fseek(FILE *stream, long offset, int whence) {
|
||||
if (!stream) return -1;
|
||||
stream->eof = 0;
|
||||
return sys_seek(stream->fd, offset, whence);
|
||||
}
|
||||
|
||||
long ftell(FILE *stream) {
|
||||
if (!stream) return -1;
|
||||
return sys_tell(stream->fd);
|
||||
}
|
||||
|
||||
int remove(const char *pathname) {
|
||||
return sys_delete(pathname);
|
||||
}
|
||||
|
||||
int rename(const char *oldpath, const char *newpath) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int fputc(int c, FILE *stream) {
|
||||
unsigned char ch = c;
|
||||
if (fwrite(&ch, 1, 1, stream) != 1) return EOF;
|
||||
return ch;
|
||||
}
|
||||
|
||||
int fputs(const char *s, FILE *stream) {
|
||||
size_t len = strlen(s);
|
||||
if (fwrite(s, 1, len, stream) != len) return EOF;
|
||||
return 0;
|
||||
}
|
||||
|
||||
long filelength(FILE *f) {
|
||||
if (!f) return -1;
|
||||
return sys_size(f->fd);
|
||||
}
|
||||
|
||||
int mkdir(const char *pathname, int mode) {
|
||||
return sys_mkdir(pathname);
|
||||
}
|
||||
|
||||
int access(const char *pathname, int mode) {
|
||||
if (sys_exists(pathname)) return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int stat(const char *pathname, struct stat *statbuf) {
|
||||
if (sys_exists(pathname)) {
|
||||
if (statbuf) {
|
||||
statbuf->st_size = 0;
|
||||
statbuf->st_mode = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int strncasecmp(const char *s1, const char *s2, size_t n) {
|
||||
while (n--) {
|
||||
char c1 = tolower(*s1++);
|
||||
char c2 = tolower(*s2++);
|
||||
if (c1 != c2) return c1 - c2;
|
||||
if (!c1) break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
int strcasecmp(const char *s1, const char *s2) {
|
||||
while (1) {
|
||||
char c1 = tolower(*s1++);
|
||||
char c2 = tolower(*s2++);
|
||||
if (c1 != c2) return c1 - c2;
|
||||
if (!c1) break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
char *strncpy(char *dest, const char *src, size_t n) {
|
||||
char *ret = dest;
|
||||
while (n && *src) { *dest++ = *src++; n--; }
|
||||
while (n) { *dest++ = 0; n--; }
|
||||
return ret;
|
||||
}
|
||||
int strncmp(const char *s1, const char *s2, size_t n) {
|
||||
while (n--) {
|
||||
if (*s1 != *s2) return *s1 - *s2;
|
||||
if (!*s1) break;
|
||||
s1++; s2++;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
char *strrchr(const char *s, int c) {
|
||||
const char *last = NULL;
|
||||
while (*s) { if (*s == c) last = s; s++; }
|
||||
if (c == 0) last = s;
|
||||
return (char*)last;
|
||||
}
|
||||
char *strchr(const char *s, int c) {
|
||||
while (*s) { if (*s == c) return (char*)s; s++; }
|
||||
if (c == 0) return (char*)s;
|
||||
return NULL;
|
||||
}
|
||||
char *strdup(const char *s) {
|
||||
size_t len = strlen(s) + 1;
|
||||
char *dup = malloc(len);
|
||||
if (dup) memcpy(dup, s, len);
|
||||
return dup;
|
||||
}
|
||||
char *strstr(const char *haystack, const char *needle) {
|
||||
size_t n = strlen(needle);
|
||||
if (!n) return (char *)haystack;
|
||||
while (*haystack) {
|
||||
if (!strncmp(haystack, needle, n)) return (char *)haystack;
|
||||
haystack++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int toupper(int c) { return (c >= 'a' && c <= 'z') ? c - 32 : c; }
|
||||
int tolower(int c) { return (c >= 'A' && c <= 'Z') ? c + 32 : c; }
|
||||
int isspace(int c) { return c == ' ' || c == '\n' || c == '\t' || c == '\r' || c == '\v' || c == '\f'; }
|
||||
int isdigit(int c) { return c >= '0' && c <= '9'; }
|
||||
int isprint(int c) { return c >= 32 && c <= 126; }
|
||||
int isalpha(int c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); }
|
||||
int isalnum(int c) { return isalpha(c) || isdigit(c); }
|
||||
int isgraph(int c) { return c > 32 && c <= 126; }
|
||||
int ispunct(int c) { return isprint(c) && !isspace(c) && !isalnum(c); }
|
||||
int isupper(int c) { return c >= 'A' && c <= 'Z'; }
|
||||
|
||||
void _exit(int status) {
|
||||
exit(status);
|
||||
}
|
||||
|
||||
void* memmove(void *dest, const void *src, size_t n) {
|
||||
unsigned char *d = dest;
|
||||
const unsigned char *s = src;
|
||||
if (d < s) {
|
||||
while (n--) *d++ = *s++;
|
||||
} else {
|
||||
d += n; s += n;
|
||||
while (n--) *--d = *--s;
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
int fflush(FILE *stream) { return 0; }
|
||||
int abs(int x) { return x < 0 ? -x : x; }
|
||||
int putchar(int c) { return fputc(c, stdout); }
|
||||
int system(const char *command) { return -1; }
|
||||
#define STB_SPRINTF_IMPLEMENTATION
|
||||
#define STB_SPRINTF_NOFLOAT
|
||||
#include "stb_sprintf.h"
|
||||
|
||||
int vfprintf(FILE *stream, const char *format, va_list ap) {
|
||||
char buf[1024];
|
||||
int len = stbsp_vsnprintf(buf, sizeof(buf), format, ap);
|
||||
if (len > 0) fwrite(buf, 1, len, stream);
|
||||
return len;
|
||||
}
|
||||
|
||||
int fprintf(FILE *stream, const char *format, ...) {
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
int len = vfprintf(stream, format, ap);
|
||||
va_end(ap);
|
||||
return len;
|
||||
}
|
||||
|
||||
int sprintf(char *str, const char *format, ...) {
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
int len = stbsp_vsprintf(str, format, ap);
|
||||
va_end(ap);
|
||||
return len;
|
||||
}
|
||||
|
||||
int snprintf(char *str, size_t size, const char *format, ...) {
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
int len = stbsp_vsnprintf(str, size, format, ap);
|
||||
va_end(ap);
|
||||
return len;
|
||||
}
|
||||
|
||||
int vsnprintf(char *str, size_t size, const char *format, va_list ap) {
|
||||
return stbsp_vsnprintf(str, size, format, ap);
|
||||
}
|
||||
|
||||
int sscanf(const char *str, const char *format, ...) { return 0; }
|
||||
96
src/kernel/userland/doom/boredos_libc.h
Normal file
96
src/kernel/userland/doom/boredos_libc.h
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
#ifndef BOREDOS_LIBC_H
|
||||
#define BOREDOS_LIBC_H
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define SEEK_SET 0
|
||||
#define SEEK_CUR 1
|
||||
#define SEEK_END 2
|
||||
|
||||
#define EOF (-1)
|
||||
|
||||
typedef struct {
|
||||
int fd;
|
||||
int eof;
|
||||
int error;
|
||||
} FILE;
|
||||
|
||||
extern FILE* stderr;
|
||||
extern FILE* stdout;
|
||||
extern FILE* stdin;
|
||||
|
||||
#define O_RDONLY 1
|
||||
#define O_WRONLY 2
|
||||
#define O_RDWR 3
|
||||
#define O_CREAT 4
|
||||
#define O_TRUNC 8
|
||||
#define O_BINARY 0
|
||||
|
||||
#define F_OK 0
|
||||
#define R_OK 4
|
||||
#define W_OK 2
|
||||
#define X_OK 1
|
||||
|
||||
FILE *fopen(const char *path, const char *mode);
|
||||
int fclose(FILE *stream);
|
||||
size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
|
||||
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
|
||||
int fseek(FILE *stream, long offset, int whence);
|
||||
long ftell(FILE *stream);
|
||||
int remove(const char *pathname);
|
||||
int rename(const char *oldpath, const char *newpath);
|
||||
int fflush(FILE *stream);
|
||||
int fprintf(FILE *stream, const char *format, ...);
|
||||
int sprintf(char *str, const char *format, ...);
|
||||
int snprintf(char *str, size_t size, const char *format, ...);
|
||||
int vsnprintf(char *str, size_t size, const char *format, va_list ap);
|
||||
int sscanf(const char *str, const char *format, ...);
|
||||
int fputc(int c, FILE *stream);
|
||||
int fputs(const char *s, FILE *stream);
|
||||
long filelength(FILE *f);
|
||||
|
||||
int strncasecmp(const char *s1, const char *s2, size_t n);
|
||||
int strcasecmp(const char *s1, const char *s2);
|
||||
char *strncpy(char *dest, const char *src, size_t n);
|
||||
int strncmp(const char *s1, const char *s2, size_t n);
|
||||
char *strrchr(const char *s, int c);
|
||||
char *strchr(const char *s, int c);
|
||||
char *strdup(const char *s);
|
||||
|
||||
int toupper(int c);
|
||||
int tolower(int c);
|
||||
int isspace(int c);
|
||||
int isdigit(int c);
|
||||
int isprint(int c);
|
||||
int isalpha(int c);
|
||||
int isalnum(int c);
|
||||
int isgraph(int c);
|
||||
int ispunct(int c);
|
||||
int isupper(int c);
|
||||
|
||||
int mkdir(const char *pathname, int mode);
|
||||
int access(const char *pathname, int mode);
|
||||
|
||||
struct stat {
|
||||
int st_size;
|
||||
int st_mode;
|
||||
};
|
||||
int stat(const char *pathname, struct stat *statbuf);
|
||||
|
||||
char *strstr(const char *haystack, const char *needle);
|
||||
extern int errno;
|
||||
|
||||
#define M_PI 3.14159265358979323846
|
||||
|
||||
void _exit(int status);
|
||||
void _exit(int status);
|
||||
void *memmove(void *dest, const void *src, size_t n);
|
||||
int abs(int j);
|
||||
int putchar(int c);
|
||||
int system(const char *command);
|
||||
int vfprintf(FILE *stream, const char *format, va_list ap);
|
||||
|
||||
#endif
|
||||
100
src/kernel/userland/doom/config.h
Normal file
100
src/kernel/userland/doom/config.h
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
/* config.hin. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <dev/isa/spkrio.h> header file. */
|
||||
#undef HAVE_DEV_ISA_SPKRIO_H
|
||||
|
||||
/* Define to 1 if you have the <dev/speaker/speaker.h> header file. */
|
||||
#undef HAVE_DEV_SPEAKER_SPEAKER_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the `ioperm' function. */
|
||||
#undef HAVE_IOPERM
|
||||
|
||||
/* Define to 1 if you have the `amd64' library (-lamd64). */
|
||||
#undef HAVE_LIBAMD64
|
||||
|
||||
/* Define to 1 if you have the `i386' library (-li386). */
|
||||
#undef HAVE_LIBI386
|
||||
|
||||
/* Define to 1 if you have the `m' library (-lm). */
|
||||
#undef HAVE_LIBM
|
||||
|
||||
/* Define to 1 if you have the `png' library (-lpng). */
|
||||
#undef HAVE_LIBPNG
|
||||
|
||||
/* Define to 1 if you have the `samplerate' library (-lsamplerate). */
|
||||
#undef HAVE_LIBSAMPLERATE
|
||||
|
||||
/* Define to 1 if you have the `z' library (-lz). */
|
||||
#undef HAVE_LIBZ
|
||||
|
||||
/* Define to 1 if you have the <linux/kd.h> header file. */
|
||||
#undef HAVE_LINUX_KD_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `mmap' function. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define to 1 if you have the `sched_setaffinity' function. */
|
||||
#undef HAVE_SCHED_SETAFFINITY
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#define HAVE_STDLIB_H 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "Doom"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME "Doom Generic"
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING "Doom Generic 0.1"
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME "doomgeneric.tar"
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#define PACKAGE_URL ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION 0.1
|
||||
|
||||
/* Change this when you create your awesome forked version */
|
||||
#define PROGRAM_PREFIX "doomgeneric"
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION 0.1
|
||||
|
||||
/* Define to 1 if you want to compile the unmodified code */
|
||||
#undef ORIGCODE
|
||||
|
||||
/* Define to the directory where all game files are located */
|
||||
#define FILES_DIR "."
|
||||
1
src/kernel/userland/doom/ctype.h
Normal file
1
src/kernel/userland/doom/ctype.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include "boredos_libc.h"
|
||||
693
src/kernel/userland/doom/d_englsh.h
Normal file
693
src/kernel/userland/doom/d_englsh.h
Normal file
|
|
@ -0,0 +1,693 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Printed strings for translation.
|
||||
// English language support (default).
|
||||
//
|
||||
|
||||
#ifndef __D_ENGLSH__
|
||||
#define __D_ENGLSH__
|
||||
|
||||
//
|
||||
// Printed strings for translation
|
||||
//
|
||||
|
||||
//
|
||||
// D_Main.C
|
||||
//
|
||||
#define D_DEVSTR "Development mode ON.\n"
|
||||
#define D_CDROM "CD-ROM Version: default.cfg from c:\\doomdata\n"
|
||||
|
||||
//
|
||||
// M_Menu.C
|
||||
//
|
||||
#define PRESSKEY "press a key."
|
||||
#define PRESSYN "press y or n."
|
||||
#define QUITMSG "are you sure you want to\nquit this great game?"
|
||||
#define LOADNET "you can't do load while in a net game!\n\n"PRESSKEY
|
||||
#define QLOADNET "you can't quickload during a netgame!\n\n"PRESSKEY
|
||||
#define QSAVESPOT "you haven't picked a quicksave slot yet!\n\n"PRESSKEY
|
||||
#define SAVEDEAD "you can't save if you aren't playing!\n\n"PRESSKEY
|
||||
#define QSPROMPT "quicksave over your game named\n\n'%s'?\n\n"PRESSYN
|
||||
#define QLPROMPT "do you want to quickload the game named\n\n'%s'?\n\n"PRESSYN
|
||||
|
||||
#define NEWGAME \
|
||||
"you can't start a new game\n"\
|
||||
"while in a network game.\n\n"PRESSKEY
|
||||
|
||||
#define NIGHTMARE \
|
||||
"are you sure? this skill level\n"\
|
||||
"isn't even remotely fair.\n\n"PRESSYN
|
||||
|
||||
#define SWSTRING \
|
||||
"this is the shareware version of doom.\n\n"\
|
||||
"you need to order the entire trilogy.\n\n"PRESSKEY
|
||||
|
||||
#define MSGOFF "Messages OFF"
|
||||
#define MSGON "Messages ON"
|
||||
#define NETEND "you can't end a netgame!\n\n"PRESSKEY
|
||||
#define ENDGAME "are you sure you want to end the game?\n\n"PRESSYN
|
||||
|
||||
#define DOSY "(press y to quit to dos.)"
|
||||
|
||||
#define DETAILHI "High detail"
|
||||
#define DETAILLO "Low detail"
|
||||
#define GAMMALVL0 "Gamma correction OFF"
|
||||
#define GAMMALVL1 "Gamma correction level 1"
|
||||
#define GAMMALVL2 "Gamma correction level 2"
|
||||
#define GAMMALVL3 "Gamma correction level 3"
|
||||
#define GAMMALVL4 "Gamma correction level 4"
|
||||
#define EMPTYSTRING "empty slot"
|
||||
|
||||
//
|
||||
// P_inter.C
|
||||
//
|
||||
#define GOTARMOR "Picked up the armor."
|
||||
#define GOTMEGA "Picked up the MegaArmor!"
|
||||
#define GOTHTHBONUS "Picked up a health bonus."
|
||||
#define GOTARMBONUS "Picked up an armor bonus."
|
||||
#define GOTSTIM "Picked up a stimpack."
|
||||
#define GOTMEDINEED "Picked up a medikit that you REALLY need!"
|
||||
#define GOTMEDIKIT "Picked up a medikit."
|
||||
#define GOTSUPER "Supercharge!"
|
||||
|
||||
#define GOTBLUECARD "Picked up a blue keycard."
|
||||
#define GOTYELWCARD "Picked up a yellow keycard."
|
||||
#define GOTREDCARD "Picked up a red keycard."
|
||||
#define GOTBLUESKUL "Picked up a blue skull key."
|
||||
#define GOTYELWSKUL "Picked up a yellow skull key."
|
||||
#define GOTREDSKULL "Picked up a red skull key."
|
||||
|
||||
#define GOTINVUL "Invulnerability!"
|
||||
#define GOTBERSERK "Berserk!"
|
||||
#define GOTINVIS "Partial Invisibility"
|
||||
#define GOTSUIT "Radiation Shielding Suit"
|
||||
#define GOTMAP "Computer Area Map"
|
||||
#define GOTVISOR "Light Amplification Visor"
|
||||
#define GOTMSPHERE "MegaSphere!"
|
||||
|
||||
#define GOTCLIP "Picked up a clip."
|
||||
#define GOTCLIPBOX "Picked up a box of bullets."
|
||||
#define GOTROCKET "Picked up a rocket."
|
||||
#define GOTROCKBOX "Picked up a box of rockets."
|
||||
#define GOTCELL "Picked up an energy cell."
|
||||
#define GOTCELLBOX "Picked up an energy cell pack."
|
||||
#define GOTSHELLS "Picked up 4 shotgun shells."
|
||||
#define GOTSHELLBOX "Picked up a box of shotgun shells."
|
||||
#define GOTBACKPACK "Picked up a backpack full of ammo!"
|
||||
|
||||
#define GOTBFG9000 "You got the BFG9000! Oh, yes."
|
||||
#define GOTCHAINGUN "You got the chaingun!"
|
||||
#define GOTCHAINSAW "A chainsaw! Find some meat!"
|
||||
#define GOTLAUNCHER "You got the rocket launcher!"
|
||||
#define GOTPLASMA "You got the plasma gun!"
|
||||
#define GOTSHOTGUN "You got the shotgun!"
|
||||
#define GOTSHOTGUN2 "You got the super shotgun!"
|
||||
|
||||
//
|
||||
// P_Doors.C
|
||||
//
|
||||
#define PD_BLUEO "You need a blue key to activate this object"
|
||||
#define PD_REDO "You need a red key to activate this object"
|
||||
#define PD_YELLOWO "You need a yellow key to activate this object"
|
||||
#define PD_BLUEK "You need a blue key to open this door"
|
||||
#define PD_REDK "You need a red key to open this door"
|
||||
#define PD_YELLOWK "You need a yellow key to open this door"
|
||||
|
||||
//
|
||||
// G_game.C
|
||||
//
|
||||
#define GGSAVED "game saved."
|
||||
|
||||
//
|
||||
// HU_stuff.C
|
||||
//
|
||||
#define HUSTR_MSGU "[Message unsent]"
|
||||
|
||||
#define HUSTR_E1M1 "E1M1: Hangar"
|
||||
#define HUSTR_E1M2 "E1M2: Nuclear Plant"
|
||||
#define HUSTR_E1M3 "E1M3: Toxin Refinery"
|
||||
#define HUSTR_E1M4 "E1M4: Command Control"
|
||||
#define HUSTR_E1M5 "E1M5: Phobos Lab"
|
||||
#define HUSTR_E1M6 "E1M6: Central Processing"
|
||||
#define HUSTR_E1M7 "E1M7: Computer Station"
|
||||
#define HUSTR_E1M8 "E1M8: Phobos Anomaly"
|
||||
#define HUSTR_E1M9 "E1M9: Military Base"
|
||||
|
||||
#define HUSTR_E2M1 "E2M1: Deimos Anomaly"
|
||||
#define HUSTR_E2M2 "E2M2: Containment Area"
|
||||
#define HUSTR_E2M3 "E2M3: Refinery"
|
||||
#define HUSTR_E2M4 "E2M4: Deimos Lab"
|
||||
#define HUSTR_E2M5 "E2M5: Command Center"
|
||||
#define HUSTR_E2M6 "E2M6: Halls of the Damned"
|
||||
#define HUSTR_E2M7 "E2M7: Spawning Vats"
|
||||
#define HUSTR_E2M8 "E2M8: Tower of Babel"
|
||||
#define HUSTR_E2M9 "E2M9: Fortress of Mystery"
|
||||
|
||||
#define HUSTR_E3M1 "E3M1: Hell Keep"
|
||||
#define HUSTR_E3M2 "E3M2: Slough of Despair"
|
||||
#define HUSTR_E3M3 "E3M3: Pandemonium"
|
||||
#define HUSTR_E3M4 "E3M4: House of Pain"
|
||||
#define HUSTR_E3M5 "E3M5: Unholy Cathedral"
|
||||
#define HUSTR_E3M6 "E3M6: Mt. Erebus"
|
||||
#define HUSTR_E3M7 "E3M7: Limbo"
|
||||
#define HUSTR_E3M8 "E3M8: Dis"
|
||||
#define HUSTR_E3M9 "E3M9: Warrens"
|
||||
|
||||
#define HUSTR_E4M1 "E4M1: Hell Beneath"
|
||||
#define HUSTR_E4M2 "E4M2: Perfect Hatred"
|
||||
#define HUSTR_E4M3 "E4M3: Sever The Wicked"
|
||||
#define HUSTR_E4M4 "E4M4: Unruly Evil"
|
||||
#define HUSTR_E4M5 "E4M5: They Will Repent"
|
||||
#define HUSTR_E4M6 "E4M6: Against Thee Wickedly"
|
||||
#define HUSTR_E4M7 "E4M7: And Hell Followed"
|
||||
#define HUSTR_E4M8 "E4M8: Unto The Cruel"
|
||||
#define HUSTR_E4M9 "E4M9: Fear"
|
||||
|
||||
#define HUSTR_1 "level 1: entryway"
|
||||
#define HUSTR_2 "level 2: underhalls"
|
||||
#define HUSTR_3 "level 3: the gantlet"
|
||||
#define HUSTR_4 "level 4: the focus"
|
||||
#define HUSTR_5 "level 5: the waste tunnels"
|
||||
#define HUSTR_6 "level 6: the crusher"
|
||||
#define HUSTR_7 "level 7: dead simple"
|
||||
#define HUSTR_8 "level 8: tricks and traps"
|
||||
#define HUSTR_9 "level 9: the pit"
|
||||
#define HUSTR_10 "level 10: refueling base"
|
||||
#define HUSTR_11 "level 11: 'o' of destruction!"
|
||||
|
||||
#define HUSTR_12 "level 12: the factory"
|
||||
#define HUSTR_13 "level 13: downtown"
|
||||
#define HUSTR_14 "level 14: the inmost dens"
|
||||
#define HUSTR_15 "level 15: industrial zone"
|
||||
#define HUSTR_16 "level 16: suburbs"
|
||||
#define HUSTR_17 "level 17: tenements"
|
||||
#define HUSTR_18 "level 18: the courtyard"
|
||||
#define HUSTR_19 "level 19: the citadel"
|
||||
#define HUSTR_20 "level 20: gotcha!"
|
||||
|
||||
#define HUSTR_21 "level 21: nirvana"
|
||||
#define HUSTR_22 "level 22: the catacombs"
|
||||
#define HUSTR_23 "level 23: barrels o' fun"
|
||||
#define HUSTR_24 "level 24: the chasm"
|
||||
#define HUSTR_25 "level 25: bloodfalls"
|
||||
#define HUSTR_26 "level 26: the abandoned mines"
|
||||
#define HUSTR_27 "level 27: monster condo"
|
||||
#define HUSTR_28 "level 28: the spirit world"
|
||||
#define HUSTR_29 "level 29: the living end"
|
||||
#define HUSTR_30 "level 30: icon of sin"
|
||||
|
||||
#define HUSTR_31 "level 31: wolfenstein"
|
||||
#define HUSTR_32 "level 32: grosse"
|
||||
|
||||
#define PHUSTR_1 "level 1: congo"
|
||||
#define PHUSTR_2 "level 2: well of souls"
|
||||
#define PHUSTR_3 "level 3: aztec"
|
||||
#define PHUSTR_4 "level 4: caged"
|
||||
#define PHUSTR_5 "level 5: ghost town"
|
||||
#define PHUSTR_6 "level 6: baron's lair"
|
||||
#define PHUSTR_7 "level 7: caughtyard"
|
||||
#define PHUSTR_8 "level 8: realm"
|
||||
#define PHUSTR_9 "level 9: abattoire"
|
||||
#define PHUSTR_10 "level 10: onslaught"
|
||||
#define PHUSTR_11 "level 11: hunted"
|
||||
|
||||
#define PHUSTR_12 "level 12: speed"
|
||||
#define PHUSTR_13 "level 13: the crypt"
|
||||
#define PHUSTR_14 "level 14: genesis"
|
||||
#define PHUSTR_15 "level 15: the twilight"
|
||||
#define PHUSTR_16 "level 16: the omen"
|
||||
#define PHUSTR_17 "level 17: compound"
|
||||
#define PHUSTR_18 "level 18: neurosphere"
|
||||
#define PHUSTR_19 "level 19: nme"
|
||||
#define PHUSTR_20 "level 20: the death domain"
|
||||
|
||||
#define PHUSTR_21 "level 21: slayer"
|
||||
#define PHUSTR_22 "level 22: impossible mission"
|
||||
#define PHUSTR_23 "level 23: tombstone"
|
||||
#define PHUSTR_24 "level 24: the final frontier"
|
||||
#define PHUSTR_25 "level 25: the temple of darkness"
|
||||
#define PHUSTR_26 "level 26: bunker"
|
||||
#define PHUSTR_27 "level 27: anti-christ"
|
||||
#define PHUSTR_28 "level 28: the sewers"
|
||||
#define PHUSTR_29 "level 29: odyssey of noises"
|
||||
#define PHUSTR_30 "level 30: the gateway of hell"
|
||||
|
||||
#define PHUSTR_31 "level 31: cyberden"
|
||||
#define PHUSTR_32 "level 32: go 2 it"
|
||||
|
||||
#define THUSTR_1 "level 1: system control"
|
||||
#define THUSTR_2 "level 2: human bbq"
|
||||
#define THUSTR_3 "level 3: power control"
|
||||
#define THUSTR_4 "level 4: wormhole"
|
||||
#define THUSTR_5 "level 5: hanger"
|
||||
#define THUSTR_6 "level 6: open season"
|
||||
#define THUSTR_7 "level 7: prison"
|
||||
#define THUSTR_8 "level 8: metal"
|
||||
#define THUSTR_9 "level 9: stronghold"
|
||||
#define THUSTR_10 "level 10: redemption"
|
||||
#define THUSTR_11 "level 11: storage facility"
|
||||
|
||||
#define THUSTR_12 "level 12: crater"
|
||||
#define THUSTR_13 "level 13: nukage processing"
|
||||
#define THUSTR_14 "level 14: steel works"
|
||||
#define THUSTR_15 "level 15: dead zone"
|
||||
#define THUSTR_16 "level 16: deepest reaches"
|
||||
#define THUSTR_17 "level 17: processing area"
|
||||
#define THUSTR_18 "level 18: mill"
|
||||
#define THUSTR_19 "level 19: shipping/respawning"
|
||||
#define THUSTR_20 "level 20: central processing"
|
||||
|
||||
#define THUSTR_21 "level 21: administration center"
|
||||
#define THUSTR_22 "level 22: habitat"
|
||||
#define THUSTR_23 "level 23: lunar mining project"
|
||||
#define THUSTR_24 "level 24: quarry"
|
||||
#define THUSTR_25 "level 25: baron's den"
|
||||
#define THUSTR_26 "level 26: ballistyx"
|
||||
#define THUSTR_27 "level 27: mount pain"
|
||||
#define THUSTR_28 "level 28: heck"
|
||||
#define THUSTR_29 "level 29: river styx"
|
||||
#define THUSTR_30 "level 30: last call"
|
||||
|
||||
#define THUSTR_31 "level 31: pharaoh"
|
||||
#define THUSTR_32 "level 32: caribbean"
|
||||
|
||||
#define HUSTR_CHATMACRO1 "I'm ready to kick butt!"
|
||||
#define HUSTR_CHATMACRO2 "I'm OK."
|
||||
#define HUSTR_CHATMACRO3 "I'm not looking too good!"
|
||||
#define HUSTR_CHATMACRO4 "Help!"
|
||||
#define HUSTR_CHATMACRO5 "You suck!"
|
||||
#define HUSTR_CHATMACRO6 "Next time, scumbag..."
|
||||
#define HUSTR_CHATMACRO7 "Come here!"
|
||||
#define HUSTR_CHATMACRO8 "I'll take care of it."
|
||||
#define HUSTR_CHATMACRO9 "Yes"
|
||||
#define HUSTR_CHATMACRO0 "No"
|
||||
|
||||
#define HUSTR_TALKTOSELF1 "You mumble to yourself"
|
||||
#define HUSTR_TALKTOSELF2 "Who's there?"
|
||||
#define HUSTR_TALKTOSELF3 "You scare yourself"
|
||||
#define HUSTR_TALKTOSELF4 "You start to rave"
|
||||
#define HUSTR_TALKTOSELF5 "You've lost it..."
|
||||
|
||||
#define HUSTR_MESSAGESENT "[Message Sent]"
|
||||
|
||||
// The following should NOT be changed unless it seems
|
||||
// just AWFULLY necessary
|
||||
|
||||
#define HUSTR_PLRGREEN "Green: "
|
||||
#define HUSTR_PLRINDIGO "Indigo: "
|
||||
#define HUSTR_PLRBROWN "Brown: "
|
||||
#define HUSTR_PLRRED "Red: "
|
||||
|
||||
#define HUSTR_KEYGREEN 'g'
|
||||
#define HUSTR_KEYINDIGO 'i'
|
||||
#define HUSTR_KEYBROWN 'b'
|
||||
#define HUSTR_KEYRED 'r'
|
||||
|
||||
//
|
||||
// AM_map.C
|
||||
//
|
||||
|
||||
#define AMSTR_FOLLOWON "Follow Mode ON"
|
||||
#define AMSTR_FOLLOWOFF "Follow Mode OFF"
|
||||
|
||||
#define AMSTR_GRIDON "Grid ON"
|
||||
#define AMSTR_GRIDOFF "Grid OFF"
|
||||
|
||||
#define AMSTR_MARKEDSPOT "Marked Spot"
|
||||
#define AMSTR_MARKSCLEARED "All Marks Cleared"
|
||||
|
||||
//
|
||||
// ST_stuff.C
|
||||
//
|
||||
|
||||
#define STSTR_MUS "Music Change"
|
||||
#define STSTR_NOMUS "IMPOSSIBLE SELECTION"
|
||||
#define STSTR_DQDON "Degreelessness Mode On"
|
||||
#define STSTR_DQDOFF "Degreelessness Mode Off"
|
||||
|
||||
#define STSTR_KFAADDED "Very Happy Ammo Added"
|
||||
#define STSTR_FAADDED "Ammo (no keys) Added"
|
||||
|
||||
#define STSTR_NCON "No Clipping Mode ON"
|
||||
#define STSTR_NCOFF "No Clipping Mode OFF"
|
||||
|
||||
#define STSTR_BEHOLD "inVuln, Str, Inviso, Rad, Allmap, or Lite-amp"
|
||||
#define STSTR_BEHOLDX "Power-up Toggled"
|
||||
|
||||
#define STSTR_CHOPPERS "... doesn't suck - GM"
|
||||
#define STSTR_CLEV "Changing Level..."
|
||||
|
||||
//
|
||||
// F_Finale.C
|
||||
//
|
||||
#define E1TEXT \
|
||||
"Once you beat the big badasses and\n"\
|
||||
"clean out the moon base you're supposed\n"\
|
||||
"to win, aren't you? Aren't you? Where's\n"\
|
||||
"your fat reward and ticket home? What\n"\
|
||||
"the hell is this? It's not supposed to\n"\
|
||||
"end this way!\n"\
|
||||
"\n" \
|
||||
"It stinks like rotten meat, but looks\n"\
|
||||
"like the lost Deimos base. Looks like\n"\
|
||||
"you're stuck on The Shores of Hell.\n"\
|
||||
"The only way out is through.\n"\
|
||||
"\n"\
|
||||
"To continue the DOOM experience, play\n"\
|
||||
"The Shores of Hell and its amazing\n"\
|
||||
"sequel, Inferno!\n"
|
||||
|
||||
|
||||
#define E2TEXT \
|
||||
"You've done it! The hideous cyber-\n"\
|
||||
"demon lord that ruled the lost Deimos\n"\
|
||||
"moon base has been slain and you\n"\
|
||||
"are triumphant! But ... where are\n"\
|
||||
"you? You clamber to the edge of the\n"\
|
||||
"moon and look down to see the awful\n"\
|
||||
"truth.\n" \
|
||||
"\n"\
|
||||
"Deimos floats above Hell itself!\n"\
|
||||
"You've never heard of anyone escaping\n"\
|
||||
"from Hell, but you'll make the bastards\n"\
|
||||
"sorry they ever heard of you! Quickly,\n"\
|
||||
"you rappel down to the surface of\n"\
|
||||
"Hell.\n"\
|
||||
"\n" \
|
||||
"Now, it's on to the final chapter of\n"\
|
||||
"DOOM! -- Inferno."
|
||||
|
||||
|
||||
#define E3TEXT \
|
||||
"The loathsome spiderdemon that\n"\
|
||||
"masterminded the invasion of the moon\n"\
|
||||
"bases and caused so much death has had\n"\
|
||||
"its ass kicked for all time.\n"\
|
||||
"\n"\
|
||||
"A hidden doorway opens and you enter.\n"\
|
||||
"You've proven too tough for Hell to\n"\
|
||||
"contain, and now Hell at last plays\n"\
|
||||
"fair -- for you emerge from the door\n"\
|
||||
"to see the green fields of Earth!\n"\
|
||||
"Home at last.\n" \
|
||||
"\n"\
|
||||
"You wonder what's been happening on\n"\
|
||||
"Earth while you were battling evil\n"\
|
||||
"unleashed. It's good that no Hell-\n"\
|
||||
"spawn could have come through that\n"\
|
||||
"door with you ..."
|
||||
|
||||
|
||||
#define E4TEXT \
|
||||
"the spider mastermind must have sent forth\n"\
|
||||
"its legions of hellspawn before your\n"\
|
||||
"final confrontation with that terrible\n"\
|
||||
"beast from hell. but you stepped forward\n"\
|
||||
"and brought forth eternal damnation and\n"\
|
||||
"suffering upon the horde as a true hero\n"\
|
||||
"would in the face of something so evil.\n"\
|
||||
"\n"\
|
||||
"besides, someone was gonna pay for what\n"\
|
||||
"happened to daisy, your pet rabbit.\n"\
|
||||
"\n"\
|
||||
"but now, you see spread before you more\n"\
|
||||
"potential pain and gibbitude as a nation\n"\
|
||||
"of demons run amok among our cities.\n"\
|
||||
"\n"\
|
||||
"next stop, hell on earth!"
|
||||
|
||||
|
||||
// after level 6, put this:
|
||||
|
||||
#define C1TEXT \
|
||||
"YOU HAVE ENTERED DEEPLY INTO THE INFESTED\n" \
|
||||
"STARPORT. BUT SOMETHING IS WRONG. THE\n" \
|
||||
"MONSTERS HAVE BROUGHT THEIR OWN REALITY\n" \
|
||||
"WITH THEM, AND THE STARPORT'S TECHNOLOGY\n" \
|
||||
"IS BEING SUBVERTED BY THEIR PRESENCE.\n" \
|
||||
"\n"\
|
||||
"AHEAD, YOU SEE AN OUTPOST OF HELL, A\n" \
|
||||
"FORTIFIED ZONE. IF YOU CAN GET PAST IT,\n" \
|
||||
"YOU CAN PENETRATE INTO THE HAUNTED HEART\n" \
|
||||
"OF THE STARBASE AND FIND THE CONTROLLING\n" \
|
||||
"SWITCH WHICH HOLDS EARTH'S POPULATION\n" \
|
||||
"HOSTAGE."
|
||||
|
||||
// After level 11, put this:
|
||||
|
||||
#define C2TEXT \
|
||||
"YOU HAVE WON! YOUR VICTORY HAS ENABLED\n" \
|
||||
"HUMANKIND TO EVACUATE EARTH AND ESCAPE\n"\
|
||||
"THE NIGHTMARE. NOW YOU ARE THE ONLY\n"\
|
||||
"HUMAN LEFT ON THE FACE OF THE PLANET.\n"\
|
||||
"CANNIBAL MUTATIONS, CARNIVOROUS ALIENS,\n"\
|
||||
"AND EVIL SPIRITS ARE YOUR ONLY NEIGHBORS.\n"\
|
||||
"YOU SIT BACK AND WAIT FOR DEATH, CONTENT\n"\
|
||||
"THAT YOU HAVE SAVED YOUR SPECIES.\n"\
|
||||
"\n"\
|
||||
"BUT THEN, EARTH CONTROL BEAMS DOWN A\n"\
|
||||
"MESSAGE FROM SPACE: \"SENSORS HAVE LOCATED\n"\
|
||||
"THE SOURCE OF THE ALIEN INVASION. IF YOU\n"\
|
||||
"GO THERE, YOU MAY BE ABLE TO BLOCK THEIR\n"\
|
||||
"ENTRY. THE ALIEN BASE IS IN THE HEART OF\n"\
|
||||
"YOUR OWN HOME CITY, NOT FAR FROM THE\n"\
|
||||
"STARPORT.\" SLOWLY AND PAINFULLY YOU GET\n"\
|
||||
"UP AND RETURN TO THE FRAY."
|
||||
|
||||
|
||||
// After level 20, put this:
|
||||
|
||||
#define C3TEXT \
|
||||
"YOU ARE AT THE CORRUPT HEART OF THE CITY,\n"\
|
||||
"SURROUNDED BY THE CORPSES OF YOUR ENEMIES.\n"\
|
||||
"YOU SEE NO WAY TO DESTROY THE CREATURES'\n"\
|
||||
"ENTRYWAY ON THIS SIDE, SO YOU CLENCH YOUR\n"\
|
||||
"TEETH AND PLUNGE THROUGH IT.\n"\
|
||||
"\n"\
|
||||
"THERE MUST BE A WAY TO CLOSE IT ON THE\n"\
|
||||
"OTHER SIDE. WHAT DO YOU CARE IF YOU'VE\n"\
|
||||
"GOT TO GO THROUGH HELL TO GET TO IT?"
|
||||
|
||||
|
||||
// After level 29, put this:
|
||||
|
||||
#define C4TEXT \
|
||||
"THE HORRENDOUS VISAGE OF THE BIGGEST\n"\
|
||||
"DEMON YOU'VE EVER SEEN CRUMBLES BEFORE\n"\
|
||||
"YOU, AFTER YOU PUMP YOUR ROCKETS INTO\n"\
|
||||
"HIS EXPOSED BRAIN. THE MONSTER SHRIVELS\n"\
|
||||
"UP AND DIES, ITS THRASHING LIMBS\n"\
|
||||
"DEVASTATING UNTOLD MILES OF HELL'S\n"\
|
||||
"SURFACE.\n"\
|
||||
"\n"\
|
||||
"YOU'VE DONE IT. THE INVASION IS OVER.\n"\
|
||||
"EARTH IS SAVED. HELL IS A WRECK. YOU\n"\
|
||||
"WONDER WHERE BAD FOLKS WILL GO WHEN THEY\n"\
|
||||
"DIE, NOW. WIPING THE SWEAT FROM YOUR\n"\
|
||||
"FOREHEAD YOU BEGIN THE LONG TREK BACK\n"\
|
||||
"HOME. REBUILDING EARTH OUGHT TO BE A\n"\
|
||||
"LOT MORE FUN THAN RUINING IT WAS.\n"
|
||||
|
||||
|
||||
|
||||
// Before level 31, put this:
|
||||
|
||||
#define C5TEXT \
|
||||
"CONGRATULATIONS, YOU'VE FOUND THE SECRET\n"\
|
||||
"LEVEL! LOOKS LIKE IT'S BEEN BUILT BY\n"\
|
||||
"HUMANS, RATHER THAN DEMONS. YOU WONDER\n"\
|
||||
"WHO THE INMATES OF THIS CORNER OF HELL\n"\
|
||||
"WILL BE."
|
||||
|
||||
|
||||
// Before level 32, put this:
|
||||
|
||||
#define C6TEXT \
|
||||
"CONGRATULATIONS, YOU'VE FOUND THE\n"\
|
||||
"SUPER SECRET LEVEL! YOU'D BETTER\n"\
|
||||
"BLAZE THROUGH THIS ONE!\n"
|
||||
|
||||
|
||||
// after map 06
|
||||
|
||||
#define P1TEXT \
|
||||
"You gloat over the steaming carcass of the\n"\
|
||||
"Guardian. With its death, you've wrested\n"\
|
||||
"the Accelerator from the stinking claws\n"\
|
||||
"of Hell. You relax and glance around the\n"\
|
||||
"room. Damn! There was supposed to be at\n"\
|
||||
"least one working prototype, but you can't\n"\
|
||||
"see it. The demons must have taken it.\n"\
|
||||
"\n"\
|
||||
"You must find the prototype, or all your\n"\
|
||||
"struggles will have been wasted. Keep\n"\
|
||||
"moving, keep fighting, keep killing.\n"\
|
||||
"Oh yes, keep living, too."
|
||||
|
||||
|
||||
// after map 11
|
||||
|
||||
#define P2TEXT \
|
||||
"Even the deadly Arch-Vile labyrinth could\n"\
|
||||
"not stop you, and you've gotten to the\n"\
|
||||
"prototype Accelerator which is soon\n"\
|
||||
"efficiently and permanently deactivated.\n"\
|
||||
"\n"\
|
||||
"You're good at that kind of thing."
|
||||
|
||||
|
||||
// after map 20
|
||||
|
||||
#define P3TEXT \
|
||||
"You've bashed and battered your way into\n"\
|
||||
"the heart of the devil-hive. Time for a\n"\
|
||||
"Search-and-Destroy mission, aimed at the\n"\
|
||||
"Gatekeeper, whose foul offspring is\n"\
|
||||
"cascading to Earth. Yeah, he's bad. But\n"\
|
||||
"you know who's worse!\n"\
|
||||
"\n"\
|
||||
"Grinning evilly, you check your gear, and\n"\
|
||||
"get ready to give the bastard a little Hell\n"\
|
||||
"of your own making!"
|
||||
|
||||
// after map 30
|
||||
|
||||
#define P4TEXT \
|
||||
"The Gatekeeper's evil face is splattered\n"\
|
||||
"all over the place. As its tattered corpse\n"\
|
||||
"collapses, an inverted Gate forms and\n"\
|
||||
"sucks down the shards of the last\n"\
|
||||
"prototype Accelerator, not to mention the\n"\
|
||||
"few remaining demons. You're done. Hell\n"\
|
||||
"has gone back to pounding bad dead folks \n"\
|
||||
"instead of good live ones. Remember to\n"\
|
||||
"tell your grandkids to put a rocket\n"\
|
||||
"launcher in your coffin. If you go to Hell\n"\
|
||||
"when you die, you'll need it for some\n"\
|
||||
"final cleaning-up ..."
|
||||
|
||||
// before map 31
|
||||
|
||||
#define P5TEXT \
|
||||
"You've found the second-hardest level we\n"\
|
||||
"got. Hope you have a saved game a level or\n"\
|
||||
"two previous. If not, be prepared to die\n"\
|
||||
"aplenty. For master marines only."
|
||||
|
||||
// before map 32
|
||||
|
||||
#define P6TEXT \
|
||||
"Betcha wondered just what WAS the hardest\n"\
|
||||
"level we had ready for ya? Now you know.\n"\
|
||||
"No one gets out alive."
|
||||
|
||||
|
||||
#define T1TEXT \
|
||||
"You've fought your way out of the infested\n"\
|
||||
"experimental labs. It seems that UAC has\n"\
|
||||
"once again gulped it down. With their\n"\
|
||||
"high turnover, it must be hard for poor\n"\
|
||||
"old UAC to buy corporate health insurance\n"\
|
||||
"nowadays..\n"\
|
||||
"\n"\
|
||||
"Ahead lies the military complex, now\n"\
|
||||
"swarming with diseased horrors hot to get\n"\
|
||||
"their teeth into you. With luck, the\n"\
|
||||
"complex still has some warlike ordnance\n"\
|
||||
"laying around."
|
||||
|
||||
|
||||
#define T2TEXT \
|
||||
"You hear the grinding of heavy machinery\n"\
|
||||
"ahead. You sure hope they're not stamping\n"\
|
||||
"out new hellspawn, but you're ready to\n"\
|
||||
"ream out a whole herd if you have to.\n"\
|
||||
"They might be planning a blood feast, but\n"\
|
||||
"you feel about as mean as two thousand\n"\
|
||||
"maniacs packed into one mad killer.\n"\
|
||||
"\n"\
|
||||
"You don't plan to go down easy."
|
||||
|
||||
|
||||
#define T3TEXT \
|
||||
"The vista opening ahead looks real damn\n"\
|
||||
"familiar. Smells familiar, too -- like\n"\
|
||||
"fried excrement. You didn't like this\n"\
|
||||
"place before, and you sure as hell ain't\n"\
|
||||
"planning to like it now. The more you\n"\
|
||||
"brood on it, the madder you get.\n"\
|
||||
"Hefting your gun, an evil grin trickles\n"\
|
||||
"onto your face. Time to take some names."
|
||||
|
||||
#define T4TEXT \
|
||||
"Suddenly, all is silent, from one horizon\n"\
|
||||
"to the other. The agonizing echo of Hell\n"\
|
||||
"fades away, the nightmare sky turns to\n"\
|
||||
"blue, the heaps of monster corpses start \n"\
|
||||
"to evaporate along with the evil stench \n"\
|
||||
"that filled the air. Jeeze, maybe you've\n"\
|
||||
"done it. Have you really won?\n"\
|
||||
"\n"\
|
||||
"Something rumbles in the distance.\n"\
|
||||
"A blue light begins to glow inside the\n"\
|
||||
"ruined skull of the demon-spitter."
|
||||
|
||||
|
||||
#define T5TEXT \
|
||||
"What now? Looks totally different. Kind\n"\
|
||||
"of like King Tut's condo. Well,\n"\
|
||||
"whatever's here can't be any worse\n"\
|
||||
"than usual. Can it? Or maybe it's best\n"\
|
||||
"to let sleeping gods lie.."
|
||||
|
||||
|
||||
#define T6TEXT \
|
||||
"Time for a vacation. You've burst the\n"\
|
||||
"bowels of hell and by golly you're ready\n"\
|
||||
"for a break. You mutter to yourself,\n"\
|
||||
"Maybe someone else can kick Hell's ass\n"\
|
||||
"next time around. Ahead lies a quiet town,\n"\
|
||||
"with peaceful flowing water, quaint\n"\
|
||||
"buildings, and presumably no Hellspawn.\n"\
|
||||
"\n"\
|
||||
"As you step off the transport, you hear\n"\
|
||||
"the stomp of a cyberdemon's iron shoe."
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Character cast strings F_FINALE.C
|
||||
//
|
||||
#define CC_ZOMBIE "ZOMBIEMAN"
|
||||
#define CC_SHOTGUN "SHOTGUN GUY"
|
||||
#define CC_HEAVY "HEAVY WEAPON DUDE"
|
||||
#define CC_IMP "IMP"
|
||||
#define CC_DEMON "DEMON"
|
||||
#define CC_LOST "LOST SOUL"
|
||||
#define CC_CACO "CACODEMON"
|
||||
#define CC_HELL "HELL KNIGHT"
|
||||
#define CC_BARON "BARON OF HELL"
|
||||
#define CC_ARACH "ARACHNOTRON"
|
||||
#define CC_PAIN "PAIN ELEMENTAL"
|
||||
#define CC_REVEN "REVENANT"
|
||||
#define CC_MANCU "MANCUBUS"
|
||||
#define CC_ARCH "ARCH-VILE"
|
||||
#define CC_SPIDER "THE SPIDER MASTERMIND"
|
||||
#define CC_CYBER "THE CYBERDEMON"
|
||||
#define CC_HERO "OUR HERO"
|
||||
|
||||
|
||||
#endif
|
||||
63
src/kernel/userland/doom/d_event.c
Normal file
63
src/kernel/userland/doom/d_event.c
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
//
|
||||
// DESCRIPTION: Event handling.
|
||||
//
|
||||
// Events are asynchronous inputs generally generated by the game user.
|
||||
// Events can be discarded if no responder claims them
|
||||
//
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "d_event.h"
|
||||
|
||||
#define MAXEVENTS 64
|
||||
|
||||
static event_t events[MAXEVENTS];
|
||||
static int eventhead;
|
||||
static int eventtail;
|
||||
|
||||
//
|
||||
// D_PostEvent
|
||||
// Called by the I/O functions when input is detected
|
||||
//
|
||||
void D_PostEvent (event_t* ev)
|
||||
{
|
||||
events[eventhead] = *ev;
|
||||
eventhead = (eventhead + 1) % MAXEVENTS;
|
||||
}
|
||||
|
||||
// Read an event from the queue.
|
||||
|
||||
event_t *D_PopEvent(void)
|
||||
{
|
||||
event_t *result;
|
||||
|
||||
// No more events waiting.
|
||||
|
||||
if (eventtail == eventhead)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
result = &events[eventtail];
|
||||
|
||||
// Advance to the next event in the queue.
|
||||
|
||||
eventtail = (eventtail + 1) % MAXEVENTS;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
137
src/kernel/userland/doom/d_event.h
Normal file
137
src/kernel/userland/doom/d_event.h
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
#ifndef __D_EVENT__
|
||||
#define __D_EVENT__
|
||||
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
|
||||
//
|
||||
// Event handling.
|
||||
//
|
||||
|
||||
// Input event types.
|
||||
typedef enum
|
||||
{
|
||||
ev_keydown,
|
||||
ev_keyup,
|
||||
ev_mouse,
|
||||
ev_joystick,
|
||||
ev_quit
|
||||
} evtype_t;
|
||||
|
||||
// Event structure.
|
||||
typedef struct
|
||||
{
|
||||
evtype_t type;
|
||||
|
||||
// Event-related data that depends on the type of event:
|
||||
//
|
||||
// ev_keydown/ev_keyup:
|
||||
// data1: Key code (from doomkeys.h) of the key that was
|
||||
// pressed or released.
|
||||
// data2: Ascii text of the character that was pressed,
|
||||
// shifted appropriately (eg. '$' if 4 was pressed
|
||||
// while shift was held).
|
||||
//
|
||||
// ev_mouse:
|
||||
// data1: Bitfield of buttons currently held down.
|
||||
// (bit 0 = left; bit 1 = right; bit 2 = middle).
|
||||
// data2: X axis mouse movement (turn).
|
||||
// data3: Y axis mouse movement (forward/backward).
|
||||
//
|
||||
// ev_joystick:
|
||||
// data1: Bitfield of buttons currently pressed.
|
||||
// data2: X axis mouse movement (turn).
|
||||
// data3: Y axis mouse movement (forward/backward).
|
||||
// data4: Third axis mouse movement (strafe).
|
||||
|
||||
int data1, data2, data3, data4;
|
||||
} event_t;
|
||||
|
||||
|
||||
//
|
||||
// Button/action code definitions.
|
||||
//
|
||||
typedef enum
|
||||
{
|
||||
// Press "Fire".
|
||||
BT_ATTACK = 1,
|
||||
// Use button, to open doors, activate switches.
|
||||
BT_USE = 2,
|
||||
|
||||
// Flag: game events, not really buttons.
|
||||
BT_SPECIAL = 128,
|
||||
BT_SPECIALMASK = 3,
|
||||
|
||||
// Flag, weapon change pending.
|
||||
// If true, the next 3 bits hold weapon num.
|
||||
BT_CHANGE = 4,
|
||||
// The 3bit weapon mask and shift, convenience.
|
||||
BT_WEAPONMASK = (8+16+32),
|
||||
BT_WEAPONSHIFT = 3,
|
||||
|
||||
// Pause the game.
|
||||
BTS_PAUSE = 1,
|
||||
// Save the game at each console.
|
||||
BTS_SAVEGAME = 2,
|
||||
|
||||
// Savegame slot numbers
|
||||
// occupy the second byte of buttons.
|
||||
BTS_SAVEMASK = (4+8+16),
|
||||
BTS_SAVESHIFT = 2,
|
||||
|
||||
} buttoncode_t;
|
||||
|
||||
// villsa [STRIFE] Strife specific buttons
|
||||
// TODO - not finished
|
||||
typedef enum
|
||||
{
|
||||
// Player view look up
|
||||
BT2_LOOKUP = 1,
|
||||
// Player view look down
|
||||
BT2_LOOKDOWN = 2,
|
||||
// Center player's view
|
||||
BT2_CENTERVIEW = 4,
|
||||
// Use inventory item
|
||||
BT2_INVUSE = 8,
|
||||
// Drop inventory item
|
||||
BT2_INVDROP = 16,
|
||||
// Jump up and down
|
||||
BT2_JUMP = 32,
|
||||
// Use medkit
|
||||
BT2_HEALTH = 128,
|
||||
|
||||
} buttoncode2_t;
|
||||
|
||||
|
||||
|
||||
|
||||
// Called by IO functions when input is detected.
|
||||
void D_PostEvent (event_t *ev);
|
||||
|
||||
// Read an event from the event queue
|
||||
|
||||
event_t *D_PopEvent(void);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
128
src/kernel/userland/doom/d_items.c
Normal file
128
src/kernel/userland/doom/d_items.c
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
//
|
||||
|
||||
|
||||
// We are referring to sprite numbers.
|
||||
#include "info.h"
|
||||
|
||||
#include "d_items.h"
|
||||
|
||||
|
||||
//
|
||||
// PSPRITE ACTIONS for waepons.
|
||||
// This struct controls the weapon animations.
|
||||
//
|
||||
// Each entry is:
|
||||
// ammo/amunition type
|
||||
// upstate
|
||||
// downstate
|
||||
// readystate
|
||||
// atkstate, i.e. attack/fire/hit frame
|
||||
// flashstate, muzzle flash
|
||||
//
|
||||
weaponinfo_t weaponinfo[NUMWEAPONS] =
|
||||
{
|
||||
{
|
||||
// fist
|
||||
am_noammo,
|
||||
S_PUNCHUP,
|
||||
S_PUNCHDOWN,
|
||||
S_PUNCH,
|
||||
S_PUNCH1,
|
||||
S_NULL
|
||||
},
|
||||
{
|
||||
// pistol
|
||||
am_clip,
|
||||
S_PISTOLUP,
|
||||
S_PISTOLDOWN,
|
||||
S_PISTOL,
|
||||
S_PISTOL1,
|
||||
S_PISTOLFLASH
|
||||
},
|
||||
{
|
||||
// shotgun
|
||||
am_shell,
|
||||
S_SGUNUP,
|
||||
S_SGUNDOWN,
|
||||
S_SGUN,
|
||||
S_SGUN1,
|
||||
S_SGUNFLASH1
|
||||
},
|
||||
{
|
||||
// chaingun
|
||||
am_clip,
|
||||
S_CHAINUP,
|
||||
S_CHAINDOWN,
|
||||
S_CHAIN,
|
||||
S_CHAIN1,
|
||||
S_CHAINFLASH1
|
||||
},
|
||||
{
|
||||
// missile launcher
|
||||
am_misl,
|
||||
S_MISSILEUP,
|
||||
S_MISSILEDOWN,
|
||||
S_MISSILE,
|
||||
S_MISSILE1,
|
||||
S_MISSILEFLASH1
|
||||
},
|
||||
{
|
||||
// plasma rifle
|
||||
am_cell,
|
||||
S_PLASMAUP,
|
||||
S_PLASMADOWN,
|
||||
S_PLASMA,
|
||||
S_PLASMA1,
|
||||
S_PLASMAFLASH1
|
||||
},
|
||||
{
|
||||
// bfg 9000
|
||||
am_cell,
|
||||
S_BFGUP,
|
||||
S_BFGDOWN,
|
||||
S_BFG,
|
||||
S_BFG1,
|
||||
S_BFGFLASH1
|
||||
},
|
||||
{
|
||||
// chainsaw
|
||||
am_noammo,
|
||||
S_SAWUP,
|
||||
S_SAWDOWN,
|
||||
S_SAW,
|
||||
S_SAW1,
|
||||
S_NULL
|
||||
},
|
||||
{
|
||||
// super shotgun
|
||||
am_shell,
|
||||
S_DSGUNUP,
|
||||
S_DSGUNDOWN,
|
||||
S_DSGUN,
|
||||
S_DSGUN1,
|
||||
S_DSGUNFLASH1
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
41
src/kernel/userland/doom/d_items.h
Normal file
41
src/kernel/userland/doom/d_items.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Items: key cards, artifacts, weapon, ammunition.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __D_ITEMS__
|
||||
#define __D_ITEMS__
|
||||
|
||||
#include "doomdef.h"
|
||||
|
||||
|
||||
|
||||
// Weapon info: sprite frames, ammunition use.
|
||||
typedef struct
|
||||
{
|
||||
ammotype_t ammo;
|
||||
int upstate;
|
||||
int downstate;
|
||||
int readystate;
|
||||
int atkstate;
|
||||
int flashstate;
|
||||
|
||||
} weaponinfo_t;
|
||||
|
||||
extern weaponinfo_t weaponinfo[NUMWEAPONS];
|
||||
|
||||
#endif
|
||||
848
src/kernel/userland/doom/d_iwad.c
Normal file
848
src/kernel/userland/doom/d_iwad.c
Normal file
|
|
@ -0,0 +1,848 @@
|
|||
//
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Search for and locate an IWAD file, and initialize according
|
||||
// to the IWAD type.
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "deh_str.h"
|
||||
#include "doomkeys.h"
|
||||
#include "d_iwad.h"
|
||||
#include "i_system.h"
|
||||
#include "m_argv.h"
|
||||
#include "m_config.h"
|
||||
#include "m_misc.h"
|
||||
#include "w_wad.h"
|
||||
#include "z_zone.h"
|
||||
|
||||
static const iwad_t iwads[] =
|
||||
{
|
||||
{ "doom2.wad", doom2, commercial, "Doom II" },
|
||||
{ "plutonia.wad", pack_plut, commercial, "Final Doom: Plutonia Experiment" },
|
||||
{ "tnt.wad", pack_tnt, commercial, "Final Doom: TNT: Evilution" },
|
||||
{ "doom.wad", doom, retail, "Doom" },
|
||||
{ "doom1.wad", doom, shareware, "Doom Shareware" },
|
||||
{ "chex.wad", pack_chex, shareware, "Chex Quest" },
|
||||
{ "hacx.wad", pack_hacx, commercial, "Hacx" },
|
||||
{ "freedm.wad", doom2, commercial, "FreeDM" },
|
||||
{ "freedoom2.wad", doom2, commercial, "Freedoom: Phase 2" },
|
||||
{ "freedoom1.wad", doom, retail, "Freedoom: Phase 1" },
|
||||
{ "heretic.wad", heretic, retail, "Heretic" },
|
||||
{ "heretic1.wad", heretic, shareware, "Heretic Shareware" },
|
||||
{ "hexen.wad", hexen, commercial, "Hexen" },
|
||||
//{ "strife0.wad", strife, commercial, "Strife" }, // haleyjd: STRIFE-FIXME
|
||||
{ "strife1.wad", strife, commercial, "Strife" },
|
||||
};
|
||||
|
||||
// Array of locations to search for IWAD files
|
||||
//
|
||||
// "128 IWAD search directories should be enough for anybody".
|
||||
|
||||
#define MAX_IWAD_DIRS 128
|
||||
|
||||
static boolean iwad_dirs_built = false;
|
||||
static char *iwad_dirs[MAX_IWAD_DIRS];
|
||||
static int num_iwad_dirs = 0;
|
||||
|
||||
static void AddIWADDir(char *dir)
|
||||
{
|
||||
if (num_iwad_dirs < MAX_IWAD_DIRS)
|
||||
{
|
||||
iwad_dirs[num_iwad_dirs] = dir;
|
||||
++num_iwad_dirs;
|
||||
}
|
||||
}
|
||||
|
||||
// This is Windows-specific code that automatically finds the location
|
||||
// of installed IWAD files. The registry is inspected to find special
|
||||
// keys installed by the Windows installers for various CD versions
|
||||
// of Doom. From these keys we can deduce where to find an IWAD.
|
||||
|
||||
#if defined(_WIN32) && !defined(_WIN32_WCE)
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
typedef struct
|
||||
{
|
||||
HKEY root;
|
||||
char *path;
|
||||
char *value;
|
||||
} registry_value_t;
|
||||
|
||||
#define UNINSTALLER_STRING "\\uninstl.exe /S "
|
||||
|
||||
// Keys installed by the various CD editions. These are actually the
|
||||
// commands to invoke the uninstaller and look like this:
|
||||
//
|
||||
// C:\Program Files\Path\uninstl.exe /S C:\Program Files\Path
|
||||
//
|
||||
// With some munging we can find where Doom was installed.
|
||||
|
||||
// [AlexMax] From the persepctive of a 64-bit executable, 32-bit registry
|
||||
// keys are located in a different spot.
|
||||
#if _WIN64
|
||||
#define SOFTWARE_KEY "Software\\Wow6432Node"
|
||||
#else
|
||||
#define SOFTWARE_KEY "Software"
|
||||
#endif
|
||||
|
||||
static registry_value_t uninstall_values[] =
|
||||
{
|
||||
// Ultimate Doom, CD version (Depths of Doom trilogy)
|
||||
|
||||
{
|
||||
HKEY_LOCAL_MACHINE,
|
||||
SOFTWARE_KEY "\\Microsoft\\Windows\\CurrentVersion\\"
|
||||
"Uninstall\\Ultimate Doom for Windows 95",
|
||||
"UninstallString",
|
||||
},
|
||||
|
||||
// Doom II, CD version (Depths of Doom trilogy)
|
||||
|
||||
{
|
||||
HKEY_LOCAL_MACHINE,
|
||||
SOFTWARE_KEY "\\Microsoft\\Windows\\CurrentVersion\\"
|
||||
"Uninstall\\Doom II for Windows 95",
|
||||
"UninstallString",
|
||||
},
|
||||
|
||||
// Final Doom
|
||||
|
||||
{
|
||||
HKEY_LOCAL_MACHINE,
|
||||
SOFTWARE_KEY "\\Microsoft\\Windows\\CurrentVersion\\"
|
||||
"Uninstall\\Final Doom for Windows 95",
|
||||
"UninstallString",
|
||||
},
|
||||
|
||||
// Shareware version
|
||||
|
||||
{
|
||||
HKEY_LOCAL_MACHINE,
|
||||
SOFTWARE_KEY "\\Microsoft\\Windows\\CurrentVersion\\"
|
||||
"Uninstall\\Doom Shareware for Windows 95",
|
||||
"UninstallString",
|
||||
},
|
||||
};
|
||||
|
||||
// Value installed by the Collector's Edition when it is installed
|
||||
|
||||
static registry_value_t collectors_edition_value =
|
||||
{
|
||||
HKEY_LOCAL_MACHINE,
|
||||
SOFTWARE_KEY "\\Activision\\DOOM Collector's Edition\\v1.0",
|
||||
"INSTALLPATH",
|
||||
};
|
||||
|
||||
// Subdirectories of the above install path, where IWADs are installed.
|
||||
|
||||
static char *collectors_edition_subdirs[] =
|
||||
{
|
||||
"Doom2",
|
||||
"Final Doom",
|
||||
"Ultimate Doom",
|
||||
};
|
||||
|
||||
// Location where Steam is installed
|
||||
|
||||
static registry_value_t steam_install_location =
|
||||
{
|
||||
HKEY_LOCAL_MACHINE,
|
||||
SOFTWARE_KEY "\\Valve\\Steam",
|
||||
"InstallPath",
|
||||
};
|
||||
|
||||
// Subdirs of the steam install directory where IWADs are found
|
||||
|
||||
static char *steam_install_subdirs[] =
|
||||
{
|
||||
"steamapps\\common\\doom 2\\base",
|
||||
"steamapps\\common\\final doom\\base",
|
||||
"steamapps\\common\\ultimate doom\\base",
|
||||
"steamapps\\common\\heretic shadow of the serpent riders\\base",
|
||||
"steamapps\\common\\hexen\\base",
|
||||
"steamapps\\common\\hexen deathkings of the dark citadel\\base",
|
||||
|
||||
// From Doom 3: BFG Edition:
|
||||
|
||||
"steamapps\\common\\DOOM 3 BFG Edition\\base\\wads",
|
||||
};
|
||||
|
||||
#define STEAM_BFG_GUS_PATCHES \
|
||||
"steamapps\\common\\DOOM 3 BFG Edition\\base\\classicmusic\\instruments"
|
||||
|
||||
static char *GetRegistryString(registry_value_t *reg_val)
|
||||
{
|
||||
HKEY key;
|
||||
DWORD len;
|
||||
DWORD valtype;
|
||||
char *result;
|
||||
|
||||
// Open the key (directory where the value is stored)
|
||||
|
||||
if (RegOpenKeyEx(reg_val->root, reg_val->path,
|
||||
0, KEY_READ, &key) != ERROR_SUCCESS)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
result = NULL;
|
||||
|
||||
// Find the type and length of the string, and only accept strings.
|
||||
|
||||
if (RegQueryValueEx(key, reg_val->value,
|
||||
NULL, &valtype, NULL, &len) == ERROR_SUCCESS
|
||||
&& valtype == REG_SZ)
|
||||
{
|
||||
// Allocate a buffer for the value and read the value
|
||||
|
||||
result = malloc(len);
|
||||
|
||||
if (RegQueryValueEx(key, reg_val->value, NULL, &valtype,
|
||||
(unsigned char *) result, &len) != ERROR_SUCCESS)
|
||||
{
|
||||
free(result);
|
||||
result = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Close the key
|
||||
|
||||
RegCloseKey(key);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Check for the uninstall strings from the CD versions
|
||||
|
||||
static void CheckUninstallStrings(void)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i=0; i<arrlen(uninstall_values); ++i)
|
||||
{
|
||||
char *val;
|
||||
char *path;
|
||||
char *unstr;
|
||||
|
||||
val = GetRegistryString(&uninstall_values[i]);
|
||||
|
||||
if (val == NULL)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
unstr = strstr(val, UNINSTALLER_STRING);
|
||||
|
||||
if (unstr == NULL)
|
||||
{
|
||||
free(val);
|
||||
}
|
||||
else
|
||||
{
|
||||
path = unstr + strlen(UNINSTALLER_STRING);
|
||||
|
||||
AddIWADDir(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check for Doom: Collector's Edition
|
||||
|
||||
static void CheckCollectorsEdition(void)
|
||||
{
|
||||
char *install_path;
|
||||
char *subpath;
|
||||
unsigned int i;
|
||||
|
||||
install_path = GetRegistryString(&collectors_edition_value);
|
||||
|
||||
if (install_path == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0; i<arrlen(collectors_edition_subdirs); ++i)
|
||||
{
|
||||
subpath = M_StringJoin(install_path, DIR_SEPARATOR_S,
|
||||
collectors_edition_subdirs[i], NULL);
|
||||
|
||||
AddIWADDir(subpath);
|
||||
}
|
||||
|
||||
free(install_path);
|
||||
}
|
||||
|
||||
|
||||
// Check for Doom downloaded via Steam
|
||||
|
||||
static void CheckSteamEdition(void)
|
||||
{
|
||||
char *install_path;
|
||||
char *subpath;
|
||||
size_t i;
|
||||
|
||||
install_path = GetRegistryString(&steam_install_location);
|
||||
|
||||
if (install_path == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0; i<arrlen(steam_install_subdirs); ++i)
|
||||
{
|
||||
subpath = M_StringJoin(install_path, DIR_SEPARATOR_S,
|
||||
steam_install_subdirs[i], NULL);
|
||||
|
||||
AddIWADDir(subpath);
|
||||
}
|
||||
|
||||
free(install_path);
|
||||
}
|
||||
|
||||
// The BFG edition ships with a full set of GUS patches. If we find them,
|
||||
// we can autoconfigure to use them.
|
||||
|
||||
static void CheckSteamGUSPatches(void)
|
||||
{
|
||||
const char *current_path;
|
||||
char *install_path;
|
||||
char *patch_path;
|
||||
int len;
|
||||
|
||||
// Already configured? Don't stomp on the user's choices.
|
||||
current_path = M_GetStrVariable("gus_patch_path");
|
||||
if (current_path != NULL && strlen(current_path) > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
install_path = GetRegistryString(&steam_install_location);
|
||||
|
||||
if (install_path == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
len = strlen(install_path) + strlen(STEAM_BFG_GUS_PATCHES) + 20;
|
||||
patch_path = malloc(len);
|
||||
M_snprintf(patch_path, len, "%s\\%s\\ACBASS.PAT",
|
||||
install_path, STEAM_BFG_GUS_PATCHES);
|
||||
|
||||
// Does acbass.pat exist? If so, then set gus_patch_path.
|
||||
if (M_FileExists(patch_path))
|
||||
{
|
||||
M_snprintf(patch_path, len, "%s\\%s",
|
||||
install_path, STEAM_BFG_GUS_PATCHES);
|
||||
M_SetVariable("gus_patch_path", patch_path);
|
||||
}
|
||||
|
||||
free(patch_path);
|
||||
free(install_path);
|
||||
}
|
||||
|
||||
// Default install directories for DOS Doom
|
||||
|
||||
static void CheckDOSDefaults(void)
|
||||
{
|
||||
// These are the default install directories used by the deice
|
||||
// installer program:
|
||||
|
||||
AddIWADDir("\\doom2"); // Doom II
|
||||
AddIWADDir("\\plutonia"); // Final Doom
|
||||
AddIWADDir("\\tnt");
|
||||
AddIWADDir("\\doom_se"); // Ultimate Doom
|
||||
AddIWADDir("\\doom"); // Shareware / Registered Doom
|
||||
AddIWADDir("\\dooms"); // Shareware versions
|
||||
AddIWADDir("\\doomsw");
|
||||
|
||||
AddIWADDir("\\heretic"); // Heretic
|
||||
AddIWADDir("\\hrtic_se"); // Heretic Shareware from Quake disc
|
||||
|
||||
AddIWADDir("\\hexen"); // Hexen
|
||||
AddIWADDir("\\hexendk"); // Hexen Deathkings of the Dark Citadel
|
||||
|
||||
AddIWADDir("\\strife"); // Strife
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Returns true if the specified path is a path to a file
|
||||
// of the specified name.
|
||||
|
||||
static boolean DirIsFile(char *path, char *filename)
|
||||
{
|
||||
size_t path_len;
|
||||
size_t filename_len;
|
||||
|
||||
path_len = strlen(path);
|
||||
filename_len = strlen(filename);
|
||||
|
||||
return path_len >= filename_len + 1
|
||||
&& path[path_len - filename_len - 1] == DIR_SEPARATOR
|
||||
&& !strcasecmp(&path[path_len - filename_len], filename);
|
||||
}
|
||||
|
||||
// Check if the specified directory contains the specified IWAD
|
||||
// file, returning the full path to the IWAD if found, or NULL
|
||||
// if not found.
|
||||
|
||||
static char *CheckDirectoryHasIWAD(char *dir, char *iwadname)
|
||||
{
|
||||
char *filename;
|
||||
|
||||
// As a special case, the "directory" may refer directly to an
|
||||
// IWAD file if the path comes from DOOMWADDIR or DOOMWADPATH.
|
||||
|
||||
if (DirIsFile(dir, iwadname) && M_FileExists(dir))
|
||||
{
|
||||
return strdup(dir);
|
||||
}
|
||||
|
||||
// Construct the full path to the IWAD if it is located in
|
||||
// this directory, and check if it exists.
|
||||
|
||||
if (!strcmp(dir, "."))
|
||||
{
|
||||
filename = strdup(iwadname);
|
||||
}
|
||||
else
|
||||
{
|
||||
filename = M_StringJoin(dir, DIR_SEPARATOR_S, iwadname, NULL);
|
||||
}
|
||||
|
||||
printf("Trying IWAD file:%s\n", filename);
|
||||
|
||||
if (M_FileExists(filename))
|
||||
{
|
||||
return filename;
|
||||
}
|
||||
|
||||
free(filename);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Search a directory to try to find an IWAD
|
||||
// Returns the location of the IWAD if found, otherwise NULL.
|
||||
|
||||
static char *SearchDirectoryForIWAD(char *dir, int mask, GameMission_t *mission)
|
||||
{
|
||||
char *filename;
|
||||
size_t i;
|
||||
|
||||
for (i=0; i<arrlen(iwads); ++i)
|
||||
{
|
||||
if (((1 << iwads[i].mission) & mask) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
filename = CheckDirectoryHasIWAD(dir, DEH_String(iwads[i].name));
|
||||
|
||||
if (filename != NULL)
|
||||
{
|
||||
*mission = iwads[i].mission;
|
||||
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// When given an IWAD with the '-iwad' parameter,
|
||||
// attempt to identify it by its name.
|
||||
|
||||
static GameMission_t IdentifyIWADByName(char *name, int mask)
|
||||
{
|
||||
size_t i;
|
||||
GameMission_t mission;
|
||||
char *p;
|
||||
|
||||
p = strrchr(name, DIR_SEPARATOR);
|
||||
|
||||
if (p != NULL)
|
||||
{
|
||||
name = p + 1;
|
||||
}
|
||||
|
||||
mission = none;
|
||||
|
||||
for (i=0; i<arrlen(iwads); ++i)
|
||||
{
|
||||
// Check if the filename is this IWAD name.
|
||||
|
||||
// Only use supported missions:
|
||||
|
||||
if (((1 << iwads[i].mission) & mask) == 0)
|
||||
continue;
|
||||
|
||||
// Check if it ends in this IWAD name.
|
||||
|
||||
if (!strcasecmp(name, iwads[i].name))
|
||||
{
|
||||
mission = iwads[i].mission;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return mission;
|
||||
}
|
||||
|
||||
#if ORIGCODE
|
||||
//
|
||||
// Add directories from the list in the DOOMWADPATH environment variable.
|
||||
//
|
||||
|
||||
static void AddDoomWadPath(void)
|
||||
{
|
||||
char *doomwadpath;
|
||||
char *p;
|
||||
|
||||
// Check the DOOMWADPATH environment variable.
|
||||
|
||||
doomwadpath = getenv("DOOMWADPATH");
|
||||
|
||||
if (doomwadpath == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
doomwadpath = strdup(doomwadpath);
|
||||
|
||||
// Add the initial directory
|
||||
|
||||
AddIWADDir(doomwadpath);
|
||||
|
||||
// Split into individual dirs within the list.
|
||||
|
||||
p = doomwadpath;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
p = strchr(p, PATH_SEPARATOR);
|
||||
|
||||
if (p != NULL)
|
||||
{
|
||||
// Break at the separator and store the right hand side
|
||||
// as another iwad dir
|
||||
|
||||
*p = '\0';
|
||||
p += 1;
|
||||
|
||||
AddIWADDir(p);
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// Build a list of IWAD files
|
||||
//
|
||||
|
||||
static void BuildIWADDirList(void)
|
||||
{
|
||||
#if ORIGCODE
|
||||
char *doomwaddir;
|
||||
|
||||
if (iwad_dirs_built)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Look in the current directory. Doom always does this.
|
||||
|
||||
AddIWADDir(".");
|
||||
|
||||
// Add DOOMWADDIR if it is in the environment
|
||||
|
||||
doomwaddir = getenv("DOOMWADDIR");
|
||||
|
||||
if (doomwaddir != NULL)
|
||||
{
|
||||
AddIWADDir(doomwaddir);
|
||||
}
|
||||
|
||||
// Add dirs from DOOMWADPATH
|
||||
|
||||
AddDoomWadPath();
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
// Search the registry and find where IWADs have been installed.
|
||||
|
||||
CheckUninstallStrings();
|
||||
CheckCollectorsEdition();
|
||||
CheckSteamEdition();
|
||||
CheckDOSDefaults();
|
||||
|
||||
// Check for GUS patches installed with the BFG edition!
|
||||
|
||||
CheckSteamGUSPatches();
|
||||
|
||||
#else
|
||||
|
||||
// Standard places where IWAD files are installed under Unix.
|
||||
|
||||
AddIWADDir("/usr/share/games/doom");
|
||||
AddIWADDir("/usr/local/share/games/doom");
|
||||
|
||||
#endif
|
||||
#else
|
||||
AddIWADDir (FILES_DIR);
|
||||
|
||||
// Don't run this function again.
|
||||
|
||||
iwad_dirs_built = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Searches WAD search paths for an WAD with a specific filename.
|
||||
//
|
||||
|
||||
char *D_FindWADByName(char *name)
|
||||
{
|
||||
char *path;
|
||||
int i;
|
||||
|
||||
// Absolute path?
|
||||
|
||||
if (M_FileExists(name))
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
BuildIWADDirList();
|
||||
|
||||
// Search through all IWAD paths for a file with the given name.
|
||||
|
||||
for (i=0; i<num_iwad_dirs; ++i)
|
||||
{
|
||||
// As a special case, if this is in DOOMWADDIR or DOOMWADPATH,
|
||||
// the "directory" may actually refer directly to an IWAD
|
||||
// file.
|
||||
|
||||
if (DirIsFile(iwad_dirs[i], name) && M_FileExists(iwad_dirs[i]))
|
||||
{
|
||||
return strdup(iwad_dirs[i]);
|
||||
}
|
||||
|
||||
// Construct a string for the full path
|
||||
|
||||
path = M_StringJoin(iwad_dirs[i], DIR_SEPARATOR_S, name, NULL);
|
||||
|
||||
if (M_FileExists(path))
|
||||
{
|
||||
return path;
|
||||
}
|
||||
|
||||
free(path);
|
||||
}
|
||||
|
||||
// File not found
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// D_TryWADByName
|
||||
//
|
||||
// Searches for a WAD by its filename, or passes through the filename
|
||||
// if not found.
|
||||
//
|
||||
|
||||
char *D_TryFindWADByName(char *filename)
|
||||
{
|
||||
char *result;
|
||||
|
||||
result = D_FindWADByName(filename);
|
||||
|
||||
if (result != NULL)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return filename;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// FindIWAD
|
||||
// Checks availability of IWAD files by name,
|
||||
// to determine whether registered/commercial features
|
||||
// should be executed (notably loading PWADs).
|
||||
//
|
||||
|
||||
char *D_FindIWAD(int mask, GameMission_t *mission)
|
||||
{
|
||||
char *result;
|
||||
char *iwadfile;
|
||||
int iwadparm;
|
||||
int i;
|
||||
|
||||
// Check for the -iwad parameter
|
||||
|
||||
//!
|
||||
// Specify an IWAD file to use.
|
||||
//
|
||||
// @arg <file>
|
||||
//
|
||||
|
||||
iwadparm = M_CheckParmWithArgs("-iwad", 1);
|
||||
|
||||
if (iwadparm)
|
||||
{
|
||||
// Search through IWAD dirs for an IWAD with the given name.
|
||||
|
||||
iwadfile = myargv[iwadparm + 1];
|
||||
|
||||
result = D_FindWADByName(iwadfile);
|
||||
|
||||
if (result == NULL)
|
||||
{
|
||||
I_Error("IWAD file '%s' not found!", iwadfile);
|
||||
}
|
||||
|
||||
*mission = IdentifyIWADByName(result, mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Search through the list and look for an IWAD
|
||||
|
||||
printf("-iwad not specified, trying a few iwad names\n");
|
||||
|
||||
result = NULL;
|
||||
|
||||
BuildIWADDirList();
|
||||
|
||||
for (i=0; result == NULL && i<num_iwad_dirs; ++i)
|
||||
{
|
||||
result = SearchDirectoryForIWAD(iwad_dirs[i], mask, mission);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Find all IWADs in the IWAD search path matching the given mask.
|
||||
|
||||
const iwad_t **D_FindAllIWADs(int mask)
|
||||
{
|
||||
const iwad_t **result;
|
||||
int result_len;
|
||||
char *filename;
|
||||
int i;
|
||||
|
||||
result = malloc(sizeof(iwad_t *) * (arrlen(iwads) + 1));
|
||||
result_len = 0;
|
||||
|
||||
// Try to find all IWADs
|
||||
|
||||
for (i=0; i<arrlen(iwads); ++i)
|
||||
{
|
||||
if (((1 << iwads[i].mission) & mask) == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
filename = D_FindWADByName(iwads[i].name);
|
||||
|
||||
if (filename != NULL)
|
||||
{
|
||||
result[result_len] = &iwads[i];
|
||||
++result_len;
|
||||
}
|
||||
}
|
||||
|
||||
// End of list
|
||||
|
||||
result[result_len] = NULL;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
//
|
||||
// Get the IWAD name used for savegames.
|
||||
//
|
||||
|
||||
char *D_SaveGameIWADName(GameMission_t gamemission)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
// Determine the IWAD name to use for savegames.
|
||||
// This determines the directory the savegame files get put into.
|
||||
//
|
||||
// Note that we match on gamemission rather than on IWAD name.
|
||||
// This ensures that doom1.wad and doom.wad saves are stored
|
||||
// in the same place.
|
||||
|
||||
for (i=0; i<arrlen(iwads); ++i)
|
||||
{
|
||||
if (gamemission == iwads[i].mission)
|
||||
{
|
||||
return iwads[i].name;
|
||||
}
|
||||
}
|
||||
|
||||
// Default fallback:
|
||||
|
||||
return "unknown.wad";
|
||||
}
|
||||
|
||||
char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < arrlen(iwads); ++i)
|
||||
{
|
||||
if (iwads[i].mission == mission && iwads[i].mode == mode)
|
||||
{
|
||||
return iwads[i].name;
|
||||
}
|
||||
}
|
||||
|
||||
return "unknown.wad";
|
||||
}
|
||||
|
||||
char *D_SuggestGameName(GameMission_t mission, GameMode_t mode)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < arrlen(iwads); ++i)
|
||||
{
|
||||
if (iwads[i].mission == mission
|
||||
&& (mode == indetermined || iwads[i].mode == mode))
|
||||
{
|
||||
return iwads[i].description;
|
||||
}
|
||||
}
|
||||
|
||||
return "Unknown game?";
|
||||
}
|
||||
|
||||
52
src/kernel/userland/doom/d_iwad.h
Normal file
52
src/kernel/userland/doom/d_iwad.h
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
//
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Find IWAD and initialize according to IWAD type.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __D_IWAD__
|
||||
#define __D_IWAD__
|
||||
|
||||
#include "d_mode.h"
|
||||
|
||||
#define IWAD_MASK_DOOM ((1 << doom) \
|
||||
| (1 << doom2) \
|
||||
| (1 << pack_tnt) \
|
||||
| (1 << pack_plut) \
|
||||
| (1 << pack_chex) \
|
||||
| (1 << pack_hacx))
|
||||
#define IWAD_MASK_HERETIC (1 << heretic)
|
||||
#define IWAD_MASK_HEXEN (1 << hexen)
|
||||
#define IWAD_MASK_STRIFE (1 << strife)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
GameMission_t mission;
|
||||
GameMode_t mode;
|
||||
char *description;
|
||||
} iwad_t;
|
||||
|
||||
char *D_FindWADByName(char *filename);
|
||||
char *D_TryFindWADByName(char *filename);
|
||||
char *D_FindIWAD(int mask, GameMission_t *mission);
|
||||
const iwad_t **D_FindAllIWADs(int mask);
|
||||
char *D_SaveGameIWADName(GameMission_t gamemission);
|
||||
char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode);
|
||||
char *D_SuggestGameName(GameMission_t mission, GameMode_t mode);
|
||||
void D_CheckCorrectIWAD(GameMission_t mission);
|
||||
|
||||
#endif
|
||||
|
||||
826
src/kernel/userland/doom/d_loop.c
Normal file
826
src/kernel/userland/doom/d_loop.c
Normal file
|
|
@ -0,0 +1,826 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Main loop code.
|
||||
//
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "doomfeatures.h"
|
||||
|
||||
#include "d_event.h"
|
||||
#include "d_loop.h"
|
||||
#include "d_ticcmd.h"
|
||||
|
||||
#include "i_system.h"
|
||||
#include "i_timer.h"
|
||||
#include "i_video.h"
|
||||
|
||||
#include "m_argv.h"
|
||||
#include "m_fixed.h"
|
||||
|
||||
#include "net_client.h"
|
||||
#include "net_gui.h"
|
||||
#include "net_io.h"
|
||||
#include "net_query.h"
|
||||
#include "net_server.h"
|
||||
#include "net_sdl.h"
|
||||
#include "net_loop.h"
|
||||
|
||||
// The complete set of data for a particular tic.
|
||||
|
||||
typedef struct
|
||||
{
|
||||
ticcmd_t cmds[NET_MAXPLAYERS];
|
||||
boolean ingame[NET_MAXPLAYERS];
|
||||
} ticcmd_set_t;
|
||||
|
||||
//
|
||||
// gametic is the tic about to (or currently being) run
|
||||
// maketic is the tic that hasn't had control made for it yet
|
||||
// recvtic is the latest tic received from the server.
|
||||
//
|
||||
// a gametic cannot be run until ticcmds are received for it
|
||||
// from all players.
|
||||
//
|
||||
|
||||
static ticcmd_set_t ticdata[BACKUPTICS];
|
||||
|
||||
// The index of the next tic to be made (with a call to BuildTiccmd).
|
||||
|
||||
static int maketic;
|
||||
|
||||
// The number of complete tics received from the server so far.
|
||||
|
||||
static int recvtic;
|
||||
|
||||
// The number of tics that have been run (using RunTic) so far.
|
||||
|
||||
int gametic;
|
||||
|
||||
// When set to true, a single tic is run each time TryRunTics() is called.
|
||||
// This is used for -timedemo mode.
|
||||
|
||||
boolean singletics = false;
|
||||
|
||||
// Index of the local player.
|
||||
|
||||
static int localplayer;
|
||||
|
||||
// Used for original sync code.
|
||||
|
||||
static int skiptics = 0;
|
||||
|
||||
// Reduce the bandwidth needed by sampling game input less and transmitting
|
||||
// less. If ticdup is 2, sample half normal, 3 = one third normal, etc.
|
||||
|
||||
int ticdup;
|
||||
|
||||
// Amount to offset the timer for game sync.
|
||||
|
||||
fixed_t offsetms;
|
||||
|
||||
// Use new client syncronisation code
|
||||
|
||||
static boolean new_sync = true;
|
||||
|
||||
// Callback functions for loop code.
|
||||
|
||||
static loop_interface_t *loop_interface = NULL;
|
||||
|
||||
// Current players in the multiplayer game.
|
||||
// This is distinct from playeringame[] used by the game code, which may
|
||||
// modify playeringame[] when playing back multiplayer demos.
|
||||
|
||||
static boolean local_playeringame[NET_MAXPLAYERS];
|
||||
|
||||
// Requested player class "sent" to the server on connect.
|
||||
// If we are only doing a single player game then this needs to be remembered
|
||||
// and saved in the game settings.
|
||||
|
||||
static int player_class;
|
||||
|
||||
|
||||
// 35 fps clock adjusted by offsetms milliseconds
|
||||
|
||||
static int GetAdjustedTime(void)
|
||||
{
|
||||
int time_ms;
|
||||
|
||||
time_ms = I_GetTimeMS();
|
||||
|
||||
if (new_sync)
|
||||
{
|
||||
// Use the adjustments from net_client.c only if we are
|
||||
// using the new sync mode.
|
||||
|
||||
time_ms += (offsetms / FRACUNIT);
|
||||
}
|
||||
|
||||
return (time_ms * TICRATE) / 1000;
|
||||
}
|
||||
|
||||
static boolean BuildNewTic(void)
|
||||
{
|
||||
int gameticdiv;
|
||||
ticcmd_t cmd;
|
||||
|
||||
gameticdiv = gametic/ticdup;
|
||||
|
||||
I_StartTic ();
|
||||
loop_interface->ProcessEvents();
|
||||
|
||||
// Always run the menu
|
||||
|
||||
loop_interface->RunMenu();
|
||||
|
||||
if (drone)
|
||||
{
|
||||
// In drone mode, do not generate any ticcmds.
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (new_sync)
|
||||
{
|
||||
// If playing single player, do not allow tics to buffer
|
||||
// up very far
|
||||
|
||||
if (!net_client_connected && maketic - gameticdiv > 2)
|
||||
return false;
|
||||
|
||||
// Never go more than ~200ms ahead
|
||||
|
||||
if (maketic - gameticdiv > 8)
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (maketic - gameticdiv >= 5)
|
||||
return false;
|
||||
}
|
||||
|
||||
//printf ("mk:%i ",maketic);
|
||||
memset(&cmd, 0, sizeof(ticcmd_t));
|
||||
loop_interface->BuildTiccmd(&cmd, maketic);
|
||||
|
||||
#ifdef FEATURE_MULTIPLAYER
|
||||
|
||||
if (net_client_connected)
|
||||
{
|
||||
NET_CL_SendTiccmd(&cmd, maketic);
|
||||
}
|
||||
|
||||
#endif
|
||||
ticdata[maketic % BACKUPTICS].cmds[localplayer] = cmd;
|
||||
ticdata[maketic % BACKUPTICS].ingame[localplayer] = true;
|
||||
|
||||
++maketic;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
// NetUpdate
|
||||
// Builds ticcmds for console player,
|
||||
// sends out a packet
|
||||
//
|
||||
int lasttime;
|
||||
|
||||
void NetUpdate (void)
|
||||
{
|
||||
int nowtime;
|
||||
int newtics;
|
||||
int i;
|
||||
|
||||
// If we are running with singletics (timing a demo), this
|
||||
// is all done separately.
|
||||
|
||||
if (singletics)
|
||||
return;
|
||||
|
||||
#ifdef FEATURE_MULTIPLAYER
|
||||
|
||||
// Run network subsystems
|
||||
|
||||
NET_CL_Run();
|
||||
NET_SV_Run();
|
||||
|
||||
#endif
|
||||
|
||||
// check time
|
||||
nowtime = GetAdjustedTime() / ticdup;
|
||||
newtics = nowtime - lasttime;
|
||||
|
||||
lasttime = nowtime;
|
||||
|
||||
if (skiptics <= newtics)
|
||||
{
|
||||
newtics -= skiptics;
|
||||
skiptics = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
skiptics -= newtics;
|
||||
newtics = 0;
|
||||
}
|
||||
|
||||
// build new ticcmds for console player
|
||||
|
||||
for (i=0 ; i<newtics ; i++)
|
||||
{
|
||||
if (!BuildNewTic())
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void D_Disconnected(void)
|
||||
{
|
||||
// In drone mode, the game cannot continue once disconnected.
|
||||
|
||||
if (drone)
|
||||
{
|
||||
I_Error("Disconnected from server in drone mode.");
|
||||
}
|
||||
|
||||
// disconnected from server
|
||||
|
||||
printf("Disconnected from server.\n");
|
||||
}
|
||||
|
||||
//
|
||||
// Invoked by the network engine when a complete set of ticcmds is
|
||||
// available.
|
||||
//
|
||||
|
||||
void D_ReceiveTic(ticcmd_t *ticcmds, boolean *players_mask)
|
||||
{
|
||||
int i;
|
||||
|
||||
// Disconnected from server?
|
||||
|
||||
if (ticcmds == NULL && players_mask == NULL)
|
||||
{
|
||||
D_Disconnected();
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < NET_MAXPLAYERS; ++i)
|
||||
{
|
||||
if (!drone && i == localplayer)
|
||||
{
|
||||
// This is us. Don't overwrite it.
|
||||
}
|
||||
else
|
||||
{
|
||||
ticdata[recvtic % BACKUPTICS].cmds[i] = ticcmds[i];
|
||||
ticdata[recvtic % BACKUPTICS].ingame[i] = players_mask[i];
|
||||
}
|
||||
}
|
||||
|
||||
++recvtic;
|
||||
}
|
||||
|
||||
//
|
||||
// Start game loop
|
||||
//
|
||||
// Called after the screen is set but before the game starts running.
|
||||
//
|
||||
|
||||
void D_StartGameLoop(void)
|
||||
{
|
||||
lasttime = GetAdjustedTime() / ticdup;
|
||||
}
|
||||
|
||||
#if ORIGCODE
|
||||
//
|
||||
// Block until the game start message is received from the server.
|
||||
//
|
||||
|
||||
static void BlockUntilStart(net_gamesettings_t *settings,
|
||||
netgame_startup_callback_t callback)
|
||||
{
|
||||
while (!NET_CL_GetSettings(settings))
|
||||
{
|
||||
NET_CL_Run();
|
||||
NET_SV_Run();
|
||||
|
||||
if (!net_client_connected)
|
||||
{
|
||||
I_Error("Lost connection to server");
|
||||
}
|
||||
|
||||
if (callback != NULL && !callback(net_client_wait_data.ready_players,
|
||||
net_client_wait_data.num_players))
|
||||
{
|
||||
I_Error("Netgame startup aborted.");
|
||||
}
|
||||
|
||||
I_Sleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void D_StartNetGame(net_gamesettings_t *settings,
|
||||
netgame_startup_callback_t callback)
|
||||
{
|
||||
#if ORIGCODE
|
||||
int i;
|
||||
|
||||
offsetms = 0;
|
||||
recvtic = 0;
|
||||
|
||||
settings->consoleplayer = 0;
|
||||
settings->num_players = 1;
|
||||
settings->player_classes[0] = player_class;
|
||||
|
||||
//!
|
||||
// @category net
|
||||
//
|
||||
// Use new network client sync code rather than the classic
|
||||
// sync code. This is currently disabled by default because it
|
||||
// has some bugs.
|
||||
//
|
||||
if (M_CheckParm("-newsync") > 0)
|
||||
settings->new_sync = 1;
|
||||
else
|
||||
settings->new_sync = 0;
|
||||
|
||||
// TODO: New sync code is not enabled by default because it's
|
||||
// currently broken.
|
||||
//if (M_CheckParm("-oldsync") > 0)
|
||||
// settings->new_sync = 0;
|
||||
//else
|
||||
// settings->new_sync = 1;
|
||||
|
||||
//!
|
||||
// @category net
|
||||
// @arg <n>
|
||||
//
|
||||
// Send n extra tics in every packet as insurance against dropped
|
||||
// packets.
|
||||
//
|
||||
|
||||
i = M_CheckParmWithArgs("-extratics", 1);
|
||||
|
||||
if (i > 0)
|
||||
settings->extratics = atoi(myargv[i+1]);
|
||||
else
|
||||
settings->extratics = 1;
|
||||
|
||||
//!
|
||||
// @category net
|
||||
// @arg <n>
|
||||
//
|
||||
// Reduce the resolution of the game by a factor of n, reducing
|
||||
// the amount of network bandwidth needed.
|
||||
//
|
||||
|
||||
i = M_CheckParmWithArgs("-dup", 1);
|
||||
|
||||
if (i > 0)
|
||||
settings->ticdup = atoi(myargv[i+1]);
|
||||
else
|
||||
settings->ticdup = 1;
|
||||
|
||||
if (net_client_connected)
|
||||
{
|
||||
// Send our game settings and block until game start is received
|
||||
// from the server.
|
||||
|
||||
NET_CL_StartGame(settings);
|
||||
BlockUntilStart(settings, callback);
|
||||
|
||||
// Read the game settings that were received.
|
||||
|
||||
NET_CL_GetSettings(settings);
|
||||
}
|
||||
|
||||
if (drone)
|
||||
{
|
||||
settings->consoleplayer = 0;
|
||||
}
|
||||
|
||||
// Set the local player and playeringame[] values.
|
||||
|
||||
localplayer = settings->consoleplayer;
|
||||
|
||||
for (i = 0; i < NET_MAXPLAYERS; ++i)
|
||||
{
|
||||
local_playeringame[i] = i < settings->num_players;
|
||||
}
|
||||
|
||||
// Copy settings to global variables.
|
||||
|
||||
ticdup = settings->ticdup;
|
||||
new_sync = settings->new_sync;
|
||||
|
||||
// TODO: Message disabled until we fix new_sync.
|
||||
//if (!new_sync)
|
||||
//{
|
||||
// printf("Syncing netgames like Vanilla Doom.\n");
|
||||
//}
|
||||
#else
|
||||
settings->consoleplayer = 0;
|
||||
settings->num_players = 1;
|
||||
settings->player_classes[0] = player_class;
|
||||
settings->new_sync = 0;
|
||||
settings->extratics = 1;
|
||||
settings->ticdup = 1;
|
||||
|
||||
ticdup = settings->ticdup;
|
||||
new_sync = settings->new_sync;
|
||||
#endif
|
||||
}
|
||||
|
||||
boolean D_InitNetGame(net_connect_data_t *connect_data)
|
||||
{
|
||||
boolean result = false;
|
||||
#ifdef FEATURE_MULTIPLAYER
|
||||
net_addr_t *addr = NULL;
|
||||
int i;
|
||||
#endif
|
||||
|
||||
// Call D_QuitNetGame on exit:
|
||||
|
||||
I_AtExit(D_QuitNetGame, true);
|
||||
|
||||
player_class = connect_data->player_class;
|
||||
|
||||
#ifdef FEATURE_MULTIPLAYER
|
||||
|
||||
//!
|
||||
// @category net
|
||||
//
|
||||
// Start a multiplayer server, listening for connections.
|
||||
//
|
||||
|
||||
if (M_CheckParm("-server") > 0
|
||||
|| M_CheckParm("-privateserver") > 0)
|
||||
{
|
||||
NET_SV_Init();
|
||||
NET_SV_AddModule(&net_loop_server_module);
|
||||
NET_SV_AddModule(&net_sdl_module);
|
||||
NET_SV_RegisterWithMaster();
|
||||
|
||||
net_loop_client_module.InitClient();
|
||||
addr = net_loop_client_module.ResolveAddress(NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
//!
|
||||
// @category net
|
||||
//
|
||||
// Automatically search the local LAN for a multiplayer
|
||||
// server and join it.
|
||||
//
|
||||
|
||||
i = M_CheckParm("-autojoin");
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
addr = NET_FindLANServer();
|
||||
|
||||
if (addr == NULL)
|
||||
{
|
||||
I_Error("No server found on local LAN");
|
||||
}
|
||||
}
|
||||
|
||||
//!
|
||||
// @arg <address>
|
||||
// @category net
|
||||
//
|
||||
// Connect to a multiplayer server running on the given
|
||||
// address.
|
||||
//
|
||||
|
||||
i = M_CheckParmWithArgs("-connect", 1);
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
net_sdl_module.InitClient();
|
||||
addr = net_sdl_module.ResolveAddress(myargv[i+1]);
|
||||
|
||||
if (addr == NULL)
|
||||
{
|
||||
I_Error("Unable to resolve '%s'\n", myargv[i+1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (addr != NULL)
|
||||
{
|
||||
if (M_CheckParm("-drone") > 0)
|
||||
{
|
||||
connect_data->drone = true;
|
||||
}
|
||||
|
||||
if (!NET_CL_Connect(addr, connect_data))
|
||||
{
|
||||
I_Error("D_InitNetGame: Failed to connect to %s\n",
|
||||
NET_AddrToString(addr));
|
||||
}
|
||||
|
||||
printf("D_InitNetGame: Connected to %s\n", NET_AddrToString(addr));
|
||||
|
||||
// Wait for launch message received from server.
|
||||
|
||||
NET_WaitForLaunch();
|
||||
|
||||
result = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// D_QuitNetGame
|
||||
// Called before quitting to leave a net game
|
||||
// without hanging the other players
|
||||
//
|
||||
void D_QuitNetGame (void)
|
||||
{
|
||||
#ifdef FEATURE_MULTIPLAYER
|
||||
NET_SV_Shutdown();
|
||||
NET_CL_Disconnect();
|
||||
#endif
|
||||
}
|
||||
|
||||
static int GetLowTic(void)
|
||||
{
|
||||
int lowtic;
|
||||
|
||||
lowtic = maketic;
|
||||
|
||||
#ifdef FEATURE_MULTIPLAYER
|
||||
if (net_client_connected)
|
||||
{
|
||||
if (drone || recvtic < lowtic)
|
||||
{
|
||||
lowtic = recvtic;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return lowtic;
|
||||
}
|
||||
|
||||
static int frameon;
|
||||
static int frameskip[4];
|
||||
static int oldnettics;
|
||||
|
||||
static void OldNetSync(void)
|
||||
{
|
||||
unsigned int i;
|
||||
int keyplayer = -1;
|
||||
|
||||
frameon++;
|
||||
|
||||
// ideally maketic should be 1 - 3 tics above lowtic
|
||||
// if we are consistantly slower, speed up time
|
||||
|
||||
for (i=0 ; i<NET_MAXPLAYERS ; i++)
|
||||
{
|
||||
if (local_playeringame[i])
|
||||
{
|
||||
keyplayer = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (keyplayer < 0)
|
||||
{
|
||||
// If there are no players, we can never advance anyway
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (localplayer == keyplayer)
|
||||
{
|
||||
// the key player does not adapt
|
||||
}
|
||||
else
|
||||
{
|
||||
if (maketic <= recvtic)
|
||||
{
|
||||
lasttime--;
|
||||
// printf ("-");
|
||||
}
|
||||
|
||||
frameskip[frameon & 3] = oldnettics > recvtic;
|
||||
oldnettics = maketic;
|
||||
|
||||
if (frameskip[0] && frameskip[1] && frameskip[2] && frameskip[3])
|
||||
{
|
||||
skiptics = 1;
|
||||
// printf ("+");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Returns true if there are players in the game:
|
||||
|
||||
static boolean PlayersInGame(void)
|
||||
{
|
||||
boolean result = false;
|
||||
unsigned int i;
|
||||
|
||||
// If we are connected to a server, check if there are any players
|
||||
// in the game.
|
||||
|
||||
if (net_client_connected)
|
||||
{
|
||||
for (i = 0; i < NET_MAXPLAYERS; ++i)
|
||||
{
|
||||
result = result || local_playeringame[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Whether single or multi-player, unless we are running as a drone,
|
||||
// we are in the game.
|
||||
|
||||
if (!drone)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// When using ticdup, certain values must be cleared out when running
|
||||
// the duplicate ticcmds.
|
||||
|
||||
static void TicdupSquash(ticcmd_set_t *set)
|
||||
{
|
||||
ticcmd_t *cmd;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < NET_MAXPLAYERS ; ++i)
|
||||
{
|
||||
cmd = &set->cmds[i];
|
||||
cmd->chatchar = 0;
|
||||
if (cmd->buttons & BT_SPECIAL)
|
||||
cmd->buttons = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// When running in single player mode, clear all the ingame[] array
|
||||
// except the local player.
|
||||
|
||||
static void SinglePlayerClear(ticcmd_set_t *set)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < NET_MAXPLAYERS; ++i)
|
||||
{
|
||||
if (i != localplayer)
|
||||
{
|
||||
set->ingame[i] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// TryRunTics
|
||||
//
|
||||
|
||||
void TryRunTics (void)
|
||||
{
|
||||
int i;
|
||||
int lowtic;
|
||||
int entertic;
|
||||
static int oldentertics;
|
||||
int realtics;
|
||||
int availabletics;
|
||||
int counts;
|
||||
|
||||
// get real tics
|
||||
entertic = I_GetTime() / ticdup;
|
||||
realtics = entertic - oldentertics;
|
||||
oldentertics = entertic;
|
||||
|
||||
// in singletics mode, run a single tic every time this function
|
||||
// is called.
|
||||
|
||||
if (singletics)
|
||||
{
|
||||
BuildNewTic();
|
||||
}
|
||||
else
|
||||
{
|
||||
NetUpdate ();
|
||||
}
|
||||
|
||||
lowtic = GetLowTic();
|
||||
|
||||
availabletics = lowtic - gametic/ticdup;
|
||||
|
||||
// decide how many tics to run
|
||||
|
||||
if (new_sync)
|
||||
{
|
||||
counts = availabletics;
|
||||
}
|
||||
else
|
||||
{
|
||||
// decide how many tics to run
|
||||
if (realtics < availabletics-1)
|
||||
counts = realtics+1;
|
||||
else if (realtics < availabletics)
|
||||
counts = realtics;
|
||||
else
|
||||
counts = availabletics;
|
||||
|
||||
if (counts < 1)
|
||||
counts = 1;
|
||||
|
||||
if (net_client_connected)
|
||||
{
|
||||
OldNetSync();
|
||||
}
|
||||
}
|
||||
|
||||
if (counts < 1)
|
||||
counts = 1;
|
||||
|
||||
// wait for new tics if needed
|
||||
|
||||
while (!PlayersInGame() || lowtic < gametic/ticdup + counts)
|
||||
{
|
||||
NetUpdate ();
|
||||
|
||||
lowtic = GetLowTic();
|
||||
|
||||
if (lowtic < gametic/ticdup)
|
||||
I_Error ("TryRunTics: lowtic < gametic");
|
||||
|
||||
// Don't stay in this loop forever. The menu is still running,
|
||||
// so return to update the screen
|
||||
|
||||
if (I_GetTime() / ticdup - entertic > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
I_Sleep(1);
|
||||
}
|
||||
|
||||
// run the count * ticdup dics
|
||||
while (counts--)
|
||||
{
|
||||
ticcmd_set_t *set;
|
||||
|
||||
if (!PlayersInGame())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
set = &ticdata[(gametic / ticdup) % BACKUPTICS];
|
||||
|
||||
if (!net_client_connected)
|
||||
{
|
||||
SinglePlayerClear(set);
|
||||
}
|
||||
|
||||
for (i=0 ; i<ticdup ; i++)
|
||||
{
|
||||
if (gametic/ticdup > lowtic)
|
||||
I_Error ("gametic>lowtic");
|
||||
|
||||
memcpy(local_playeringame, set->ingame, sizeof(local_playeringame));
|
||||
|
||||
loop_interface->RunTic(set->cmds, set->ingame);
|
||||
gametic++;
|
||||
|
||||
// modify command for duplicated tics
|
||||
|
||||
TicdupSquash(set);
|
||||
}
|
||||
|
||||
NetUpdate (); // check for new console commands
|
||||
}
|
||||
}
|
||||
|
||||
void D_RegisterLoopCallbacks(loop_interface_t *i)
|
||||
{
|
||||
loop_interface = i;
|
||||
}
|
||||
81
src/kernel/userland/doom/d_loop.h
Normal file
81
src/kernel/userland/doom/d_loop.h
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Main loop stuff.
|
||||
//
|
||||
|
||||
#ifndef __D_LOOP__
|
||||
#define __D_LOOP__
|
||||
|
||||
#include "net_defs.h"
|
||||
|
||||
// Callback function invoked while waiting for the netgame to start.
|
||||
// The callback is invoked when new players are ready. The callback
|
||||
// should return true, or return false to abort startup.
|
||||
|
||||
typedef boolean (*netgame_startup_callback_t)(int ready_players,
|
||||
int num_players);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// Read events from the event queue, and process them.
|
||||
|
||||
void (*ProcessEvents)();
|
||||
|
||||
// Given the current input state, fill in the fields of the specified
|
||||
// ticcmd_t structure with data for a new tic.
|
||||
|
||||
void (*BuildTiccmd)(ticcmd_t *cmd, int maketic);
|
||||
|
||||
// Advance the game forward one tic, using the specified player input.
|
||||
|
||||
void (*RunTic)(ticcmd_t *cmds, boolean *ingame);
|
||||
|
||||
// Run the menu (runs independently of the game).
|
||||
|
||||
void (*RunMenu)();
|
||||
} loop_interface_t;
|
||||
|
||||
// Register callback functions for the main loop code to use.
|
||||
void D_RegisterLoopCallbacks(loop_interface_t *i);
|
||||
|
||||
// Create any new ticcmds and broadcast to other players.
|
||||
void NetUpdate (void);
|
||||
|
||||
// Broadcasts special packets to other players
|
||||
// to notify of game exit
|
||||
void D_QuitNetGame (void);
|
||||
|
||||
//? how many ticks to run?
|
||||
void TryRunTics (void);
|
||||
|
||||
// Called at start of game loop to initialize timers
|
||||
void D_StartGameLoop(void);
|
||||
|
||||
// Initialize networking code and connect to server.
|
||||
|
||||
boolean D_InitNetGame(net_connect_data_t *connect_data);
|
||||
|
||||
// Start game with specified settings. The structure will be updated
|
||||
// with the actual settings for the game.
|
||||
|
||||
void D_StartNetGame(net_gamesettings_t *settings,
|
||||
netgame_startup_callback_t callback);
|
||||
|
||||
extern boolean singletics;
|
||||
extern int gametic, ticdup;
|
||||
|
||||
#endif
|
||||
|
||||
1845
src/kernel/userland/doom/d_main.c
Normal file
1845
src/kernel/userland/doom/d_main.c
Normal file
File diff suppressed because it is too large
Load diff
50
src/kernel/userland/doom/d_main.h
Normal file
50
src/kernel/userland/doom/d_main.h
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// System specific interface stuff.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __D_MAIN__
|
||||
#define __D_MAIN__
|
||||
|
||||
#include "doomdef.h"
|
||||
|
||||
|
||||
|
||||
|
||||
// Read events from all input devices
|
||||
|
||||
void D_ProcessEvents (void);
|
||||
|
||||
|
||||
//
|
||||
// BASE LEVEL
|
||||
//
|
||||
void D_PageTicker (void);
|
||||
void D_PageDrawer (void);
|
||||
void D_AdvanceDemo (void);
|
||||
void D_DoAdvanceDemo (void);
|
||||
void D_StartTitle (void);
|
||||
|
||||
//
|
||||
// GLOBAL VARIABLES
|
||||
//
|
||||
|
||||
extern gameaction_t gameaction;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
209
src/kernel/userland/doom/d_mode.c
Normal file
209
src/kernel/userland/doom/d_mode.c
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
//
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Functions and definitions relating to the game type and operational
|
||||
// mode.
|
||||
//
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "d_mode.h"
|
||||
|
||||
// Valid game mode/mission combinations, with the number of
|
||||
// episodes/maps for each.
|
||||
|
||||
static struct
|
||||
{
|
||||
GameMission_t mission;
|
||||
GameMode_t mode;
|
||||
int episode;
|
||||
int map;
|
||||
} valid_modes[] = {
|
||||
{ pack_chex, shareware, 1, 5 },
|
||||
{ doom, shareware, 1, 9 },
|
||||
{ doom, registered, 3, 9 },
|
||||
{ doom, retail, 4, 9 },
|
||||
{ doom2, commercial, 1, 32 },
|
||||
{ pack_tnt, commercial, 1, 32 },
|
||||
{ pack_plut, commercial, 1, 32 },
|
||||
{ pack_hacx, commercial, 1, 32 },
|
||||
{ heretic, shareware, 1, 9 },
|
||||
{ heretic, registered, 3, 9 },
|
||||
{ heretic, retail, 5, 9 },
|
||||
{ hexen, commercial, 1, 60 },
|
||||
{ strife, commercial, 1, 34 },
|
||||
};
|
||||
|
||||
// Check that a gamemode+gamemission received over the network is valid.
|
||||
|
||||
boolean D_ValidGameMode(GameMission_t mission, GameMode_t mode)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<arrlen(valid_modes); ++i)
|
||||
{
|
||||
if (valid_modes[i].mode == mode && valid_modes[i].mission == mission)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean D_ValidEpisodeMap(GameMission_t mission, GameMode_t mode,
|
||||
int episode, int map)
|
||||
{
|
||||
int i;
|
||||
|
||||
// Hacks for Heretic secret episodes
|
||||
|
||||
if (mission == heretic)
|
||||
{
|
||||
if (mode == retail && episode == 6)
|
||||
{
|
||||
return map >= 1 && map <= 3;
|
||||
}
|
||||
else if (mode == registered && episode == 4)
|
||||
{
|
||||
return map == 1;
|
||||
}
|
||||
}
|
||||
|
||||
// Find the table entry for this mission/mode combination.
|
||||
|
||||
for (i=0; i<arrlen(valid_modes); ++i)
|
||||
{
|
||||
if (mission == valid_modes[i].mission
|
||||
&& mode == valid_modes[i].mode)
|
||||
{
|
||||
return episode >= 1 && episode <= valid_modes[i].episode
|
||||
&& map >= 1 && map <= valid_modes[i].map;
|
||||
}
|
||||
}
|
||||
|
||||
// Unknown mode/mission combination
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the number of valid episodes for the specified mission/mode.
|
||||
|
||||
int D_GetNumEpisodes(GameMission_t mission, GameMode_t mode)
|
||||
{
|
||||
int episode;
|
||||
|
||||
episode = 1;
|
||||
|
||||
while (D_ValidEpisodeMap(mission, mode, episode, 1))
|
||||
{
|
||||
++episode;
|
||||
}
|
||||
|
||||
return episode - 1;
|
||||
}
|
||||
|
||||
// Table of valid versions
|
||||
|
||||
static struct {
|
||||
GameMission_t mission;
|
||||
GameVersion_t version;
|
||||
} valid_versions[] = {
|
||||
{ doom, exe_doom_1_9 },
|
||||
{ doom, exe_hacx },
|
||||
{ doom, exe_ultimate },
|
||||
{ doom, exe_final },
|
||||
{ doom, exe_final2 },
|
||||
{ doom, exe_chex },
|
||||
{ heretic, exe_heretic_1_3 },
|
||||
{ hexen, exe_hexen_1_1 },
|
||||
{ strife, exe_strife_1_2 },
|
||||
{ strife, exe_strife_1_31 },
|
||||
};
|
||||
|
||||
boolean D_ValidGameVersion(GameMission_t mission, GameVersion_t version)
|
||||
{
|
||||
int i;
|
||||
|
||||
// All Doom variants can use the Doom versions.
|
||||
|
||||
if (mission == doom2 || mission == pack_plut || mission == pack_tnt
|
||||
|| mission == pack_hacx || mission == pack_chex)
|
||||
{
|
||||
mission = doom;
|
||||
}
|
||||
|
||||
for (i=0; i<arrlen(valid_versions); ++i)
|
||||
{
|
||||
if (valid_versions[i].mission == mission
|
||||
&& valid_versions[i].version == version)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Does this mission type use ExMy form, rather than MAPxy form?
|
||||
|
||||
boolean D_IsEpisodeMap(GameMission_t mission)
|
||||
{
|
||||
switch (mission)
|
||||
{
|
||||
case doom:
|
||||
case heretic:
|
||||
case pack_chex:
|
||||
return true;
|
||||
|
||||
case none:
|
||||
case hexen:
|
||||
case doom2:
|
||||
case pack_hacx:
|
||||
case pack_tnt:
|
||||
case pack_plut:
|
||||
case strife:
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
char *D_GameMissionString(GameMission_t mission)
|
||||
{
|
||||
switch (mission)
|
||||
{
|
||||
case none:
|
||||
default:
|
||||
return "none";
|
||||
case doom:
|
||||
return "doom";
|
||||
case doom2:
|
||||
return "doom2";
|
||||
case pack_tnt:
|
||||
return "tnt";
|
||||
case pack_plut:
|
||||
return "plutonia";
|
||||
case pack_hacx:
|
||||
return "hacx";
|
||||
case pack_chex:
|
||||
return "chex";
|
||||
case heretic:
|
||||
return "heretic";
|
||||
case hexen:
|
||||
return "hexen";
|
||||
case strife:
|
||||
return "strife";
|
||||
}
|
||||
}
|
||||
|
||||
98
src/kernel/userland/doom/d_mode.h
Normal file
98
src/kernel/userland/doom/d_mode.h
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Functions and definitions relating to the game type and operational
|
||||
// mode.
|
||||
//
|
||||
|
||||
#ifndef __D_MODE__
|
||||
#define __D_MODE__
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
// The "mission" controls what game we are playing.
|
||||
|
||||
typedef enum
|
||||
{
|
||||
doom, // Doom 1
|
||||
doom2, // Doom 2
|
||||
pack_tnt, // Final Doom: TNT: Evilution
|
||||
pack_plut, // Final Doom: The Plutonia Experiment
|
||||
pack_chex, // Chex Quest (modded doom)
|
||||
pack_hacx, // Hacx (modded doom2)
|
||||
heretic, // Heretic
|
||||
hexen, // Hexen
|
||||
strife, // Strife
|
||||
|
||||
none
|
||||
} GameMission_t;
|
||||
|
||||
// The "mode" allows more accurate specification of the game mode we are
|
||||
// in: eg. shareware vs. registered. So doom1.wad and doom.wad are the
|
||||
// same mission, but a different mode.
|
||||
|
||||
typedef enum
|
||||
{
|
||||
shareware, // Doom/Heretic shareware
|
||||
registered, // Doom/Heretic registered
|
||||
commercial, // Doom II/Hexen
|
||||
retail, // Ultimate Doom
|
||||
indetermined // Unknown.
|
||||
} GameMode_t;
|
||||
|
||||
// What version are we emulating?
|
||||
|
||||
typedef enum
|
||||
{
|
||||
exe_doom_1_2, // Doom 1.2: shareware and registered
|
||||
exe_doom_1_666, // Doom 1.666: for shareware, registered and commercial
|
||||
exe_doom_1_7, // Doom 1.7/1.7a: "
|
||||
exe_doom_1_8, // Doom 1.8: "
|
||||
exe_doom_1_9, // Doom 1.9: "
|
||||
exe_hacx, // Hacx
|
||||
exe_ultimate, // Ultimate Doom (retail)
|
||||
exe_final, // Final Doom
|
||||
exe_final2, // Final Doom (alternate exe)
|
||||
exe_chex, // Chex Quest executable (based on Final Doom)
|
||||
|
||||
exe_heretic_1_3, // Heretic 1.3
|
||||
|
||||
exe_hexen_1_1, // Hexen 1.1
|
||||
exe_strife_1_2, // Strife v1.2
|
||||
exe_strife_1_31 // Strife v1.31
|
||||
} GameVersion_t;
|
||||
|
||||
// Skill level.
|
||||
|
||||
typedef enum
|
||||
{
|
||||
sk_noitems = -1, // the "-skill 0" hack
|
||||
sk_baby = 0,
|
||||
sk_easy,
|
||||
sk_medium,
|
||||
sk_hard,
|
||||
sk_nightmare
|
||||
} skill_t;
|
||||
|
||||
boolean D_ValidGameMode(GameMission_t mission, GameMode_t mode);
|
||||
boolean D_ValidGameVersion(GameMission_t mission, GameVersion_t version);
|
||||
boolean D_ValidEpisodeMap(GameMission_t mission, GameMode_t mode,
|
||||
int episode, int map);
|
||||
int D_GetNumEpisodes(GameMission_t mission, GameMode_t mode);
|
||||
boolean D_IsEpisodeMap(GameMission_t mission);
|
||||
char *D_GameMissionString(GameMission_t mission);
|
||||
|
||||
#endif /* #ifndef __D_MODE__ */
|
||||
|
||||
281
src/kernel/userland/doom/d_net.c
Normal file
281
src/kernel/userland/doom/d_net.c
Normal file
|
|
@ -0,0 +1,281 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// DOOM Network game communication and protocol,
|
||||
// all OS independend parts.
|
||||
//
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "doomfeatures.h"
|
||||
|
||||
#include "d_main.h"
|
||||
#include "m_argv.h"
|
||||
#include "m_menu.h"
|
||||
#include "m_misc.h"
|
||||
#include "i_system.h"
|
||||
#include "i_timer.h"
|
||||
#include "i_video.h"
|
||||
#include "g_game.h"
|
||||
#include "doomdef.h"
|
||||
#include "doomstat.h"
|
||||
#include "w_checksum.h"
|
||||
#include "w_wad.h"
|
||||
|
||||
#include "deh_main.h"
|
||||
|
||||
#include "d_loop.h"
|
||||
|
||||
ticcmd_t *netcmds;
|
||||
|
||||
// Called when a player leaves the game
|
||||
|
||||
static void PlayerQuitGame(player_t *player)
|
||||
{
|
||||
static char exitmsg[80];
|
||||
unsigned int player_num;
|
||||
|
||||
player_num = player - players;
|
||||
|
||||
// Do this the same way as Vanilla Doom does, to allow dehacked
|
||||
// replacements of this message
|
||||
|
||||
M_StringCopy(exitmsg, DEH_String("Player 1 left the game"),
|
||||
sizeof(exitmsg));
|
||||
|
||||
exitmsg[7] += player_num;
|
||||
|
||||
playeringame[player_num] = false;
|
||||
players[consoleplayer].message = exitmsg;
|
||||
|
||||
// TODO: check if it is sensible to do this:
|
||||
|
||||
if (demorecording)
|
||||
{
|
||||
G_CheckDemoStatus ();
|
||||
}
|
||||
}
|
||||
|
||||
static void RunTic(ticcmd_t *cmds, boolean *ingame)
|
||||
{
|
||||
extern boolean advancedemo;
|
||||
unsigned int i;
|
||||
|
||||
// Check for player quits.
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
if (!demoplayback && playeringame[i] && !ingame[i])
|
||||
{
|
||||
PlayerQuitGame(&players[i]);
|
||||
}
|
||||
}
|
||||
|
||||
netcmds = cmds;
|
||||
|
||||
// check that there are players in the game. if not, we cannot
|
||||
// run a tic.
|
||||
|
||||
if (advancedemo)
|
||||
D_DoAdvanceDemo ();
|
||||
|
||||
G_Ticker ();
|
||||
}
|
||||
|
||||
static loop_interface_t doom_loop_interface = {
|
||||
D_ProcessEvents,
|
||||
G_BuildTiccmd,
|
||||
RunTic,
|
||||
M_Ticker
|
||||
};
|
||||
|
||||
|
||||
// Load game settings from the specified structure and
|
||||
// set global variables.
|
||||
|
||||
static void LoadGameSettings(net_gamesettings_t *settings)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
deathmatch = settings->deathmatch;
|
||||
startepisode = settings->episode;
|
||||
startmap = settings->map;
|
||||
startskill = settings->skill;
|
||||
startloadgame = settings->loadgame;
|
||||
lowres_turn = settings->lowres_turn;
|
||||
nomonsters = settings->nomonsters;
|
||||
fastparm = settings->fast_monsters;
|
||||
respawnparm = settings->respawn_monsters;
|
||||
timelimit = settings->timelimit;
|
||||
consoleplayer = settings->consoleplayer;
|
||||
|
||||
if (lowres_turn)
|
||||
{
|
||||
printf("NOTE: Turning resolution is reduced; this is probably "
|
||||
"because there is a client recording a Vanilla demo.\n");
|
||||
}
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
{
|
||||
playeringame[i] = i < settings->num_players;
|
||||
}
|
||||
}
|
||||
|
||||
// Save the game settings from global variables to the specified
|
||||
// game settings structure.
|
||||
|
||||
static void SaveGameSettings(net_gamesettings_t *settings)
|
||||
{
|
||||
// Fill in game settings structure with appropriate parameters
|
||||
// for the new game
|
||||
|
||||
settings->deathmatch = deathmatch;
|
||||
settings->episode = startepisode;
|
||||
settings->map = startmap;
|
||||
settings->skill = startskill;
|
||||
settings->loadgame = startloadgame;
|
||||
settings->gameversion = gameversion;
|
||||
settings->nomonsters = nomonsters;
|
||||
settings->fast_monsters = fastparm;
|
||||
settings->respawn_monsters = respawnparm;
|
||||
settings->timelimit = timelimit;
|
||||
|
||||
settings->lowres_turn = M_CheckParm("-record") > 0
|
||||
&& M_CheckParm("-longtics") == 0;
|
||||
}
|
||||
|
||||
static void InitConnectData(net_connect_data_t *connect_data)
|
||||
{
|
||||
connect_data->max_players = MAXPLAYERS;
|
||||
connect_data->drone = false;
|
||||
|
||||
//!
|
||||
// @category net
|
||||
//
|
||||
// Run as the left screen in three screen mode.
|
||||
//
|
||||
|
||||
if (M_CheckParm("-left") > 0)
|
||||
{
|
||||
viewangleoffset = ANG90;
|
||||
connect_data->drone = true;
|
||||
}
|
||||
|
||||
//!
|
||||
// @category net
|
||||
//
|
||||
// Run as the right screen in three screen mode.
|
||||
//
|
||||
|
||||
if (M_CheckParm("-right") > 0)
|
||||
{
|
||||
viewangleoffset = ANG270;
|
||||
connect_data->drone = true;
|
||||
}
|
||||
|
||||
//
|
||||
// Connect data
|
||||
//
|
||||
|
||||
// Game type fields:
|
||||
|
||||
connect_data->gamemode = gamemode;
|
||||
connect_data->gamemission = gamemission;
|
||||
|
||||
// Are we recording a demo? Possibly set lowres turn mode
|
||||
|
||||
connect_data->lowres_turn = M_CheckParm("-record") > 0
|
||||
&& M_CheckParm("-longtics") == 0;
|
||||
|
||||
// Read checksums of our WAD directory and dehacked information
|
||||
|
||||
W_Checksum(connect_data->wad_sha1sum);
|
||||
|
||||
#if ORIGCODE
|
||||
DEH_Checksum(connect_data->deh_sha1sum);
|
||||
#endif
|
||||
|
||||
// Are we playing with the Freedoom IWAD?
|
||||
|
||||
connect_data->is_freedoom = W_CheckNumForName("FREEDOOM") >= 0;
|
||||
}
|
||||
|
||||
void D_ConnectNetGame(void)
|
||||
{
|
||||
net_connect_data_t connect_data;
|
||||
|
||||
InitConnectData(&connect_data);
|
||||
netgame = D_InitNetGame(&connect_data);
|
||||
|
||||
//!
|
||||
// @category net
|
||||
//
|
||||
// Start the game playing as though in a netgame with a single
|
||||
// player. This can also be used to play back single player netgame
|
||||
// demos.
|
||||
//
|
||||
|
||||
if (M_CheckParm("-solo-net") > 0)
|
||||
{
|
||||
netgame = true;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// D_CheckNetGame
|
||||
// Works out player numbers among the net participants
|
||||
//
|
||||
void D_CheckNetGame (void)
|
||||
{
|
||||
net_gamesettings_t settings;
|
||||
|
||||
if (netgame)
|
||||
{
|
||||
autostart = true;
|
||||
}
|
||||
|
||||
D_RegisterLoopCallbacks(&doom_loop_interface);
|
||||
|
||||
SaveGameSettings(&settings);
|
||||
D_StartNetGame(&settings, NULL);
|
||||
LoadGameSettings(&settings);
|
||||
|
||||
DEH_printf("startskill %i deathmatch: %i startmap: %i startepisode: %i\n",
|
||||
startskill, deathmatch, startmap, startepisode);
|
||||
|
||||
DEH_printf("player %i of %i (%i nodes)\n",
|
||||
consoleplayer+1, settings.num_players, settings.num_players);
|
||||
|
||||
// Show players here; the server might have specified a time limit
|
||||
|
||||
if (timelimit > 0 && deathmatch)
|
||||
{
|
||||
// Gross hack to work like Vanilla:
|
||||
|
||||
if (timelimit == 20 && M_CheckParm("-avg"))
|
||||
{
|
||||
DEH_printf("Austin Virtual Gaming: Levels will end "
|
||||
"after 20 minutes\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
DEH_printf("Levels will end after %d minute", timelimit);
|
||||
if (timelimit > 1)
|
||||
printf("s");
|
||||
printf(".\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
209
src/kernel/userland/doom/d_player.h
Normal file
209
src/kernel/userland/doom/d_player.h
Normal file
|
|
@ -0,0 +1,209 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
#ifndef __D_PLAYER__
|
||||
#define __D_PLAYER__
|
||||
|
||||
|
||||
// The player data structure depends on a number
|
||||
// of other structs: items (internal inventory),
|
||||
// animation states (closely tied to the sprites
|
||||
// used to represent them, unfortunately).
|
||||
#include "d_items.h"
|
||||
#include "p_pspr.h"
|
||||
|
||||
// In addition, the player is just a special
|
||||
// case of the generic moving object/actor.
|
||||
#include "p_mobj.h"
|
||||
|
||||
// Finally, for odd reasons, the player input
|
||||
// is buffered within the player data struct,
|
||||
// as commands per game tick.
|
||||
#include "d_ticcmd.h"
|
||||
|
||||
#include "net_defs.h"
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Player states.
|
||||
//
|
||||
typedef enum
|
||||
{
|
||||
// Playing or camping.
|
||||
PST_LIVE,
|
||||
// Dead on the ground, view follows killer.
|
||||
PST_DEAD,
|
||||
// Ready to restart/respawn???
|
||||
PST_REBORN
|
||||
|
||||
} playerstate_t;
|
||||
|
||||
|
||||
//
|
||||
// Player internal flags, for cheats and debug.
|
||||
//
|
||||
typedef enum
|
||||
{
|
||||
// No clipping, walk through barriers.
|
||||
CF_NOCLIP = 1,
|
||||
// No damage, no health loss.
|
||||
CF_GODMODE = 2,
|
||||
// Not really a cheat, just a debug aid.
|
||||
CF_NOMOMENTUM = 4
|
||||
|
||||
} cheat_t;
|
||||
|
||||
|
||||
//
|
||||
// Extended player object info: player_t
|
||||
//
|
||||
typedef struct player_s
|
||||
{
|
||||
mobj_t* mo;
|
||||
playerstate_t playerstate;
|
||||
ticcmd_t cmd;
|
||||
|
||||
// Determine POV,
|
||||
// including viewpoint bobbing during movement.
|
||||
// Focal origin above r.z
|
||||
fixed_t viewz;
|
||||
// Base height above floor for viewz.
|
||||
fixed_t viewheight;
|
||||
// Bob/squat speed.
|
||||
fixed_t deltaviewheight;
|
||||
// bounded/scaled total momentum.
|
||||
fixed_t bob;
|
||||
|
||||
// This is only used between levels,
|
||||
// mo->health is used during levels.
|
||||
int health;
|
||||
int armorpoints;
|
||||
// Armor type is 0-2.
|
||||
int armortype;
|
||||
|
||||
// Power ups. invinc and invis are tic counters.
|
||||
int powers[NUMPOWERS];
|
||||
boolean cards[NUMCARDS];
|
||||
boolean backpack;
|
||||
|
||||
// Frags, kills of other players.
|
||||
int frags[MAXPLAYERS];
|
||||
weapontype_t readyweapon;
|
||||
|
||||
// Is wp_nochange if not changing.
|
||||
weapontype_t pendingweapon;
|
||||
|
||||
boolean weaponowned[NUMWEAPONS];
|
||||
int ammo[NUMAMMO];
|
||||
int maxammo[NUMAMMO];
|
||||
|
||||
// True if button down last tic.
|
||||
int attackdown;
|
||||
int usedown;
|
||||
|
||||
// Bit flags, for cheats and debug.
|
||||
// See cheat_t, above.
|
||||
int cheats;
|
||||
|
||||
// Refired shots are less accurate.
|
||||
int refire;
|
||||
|
||||
// For intermission stats.
|
||||
int killcount;
|
||||
int itemcount;
|
||||
int secretcount;
|
||||
|
||||
// Hint messages.
|
||||
char* message;
|
||||
|
||||
// For screen flashing (red or bright).
|
||||
int damagecount;
|
||||
int bonuscount;
|
||||
|
||||
// Who did damage (NULL for floors/ceilings).
|
||||
mobj_t* attacker;
|
||||
|
||||
// So gun flashes light up areas.
|
||||
int extralight;
|
||||
|
||||
// Current PLAYPAL, ???
|
||||
// can be set to REDCOLORMAP for pain, etc.
|
||||
int fixedcolormap;
|
||||
|
||||
// Player skin colorshift,
|
||||
// 0-3 for which color to draw player.
|
||||
int colormap;
|
||||
|
||||
// Overlay view sprites (gun, etc).
|
||||
pspdef_t psprites[NUMPSPRITES];
|
||||
|
||||
// True if secret level has been done.
|
||||
boolean didsecret;
|
||||
|
||||
} player_t;
|
||||
|
||||
|
||||
//
|
||||
// INTERMISSION
|
||||
// Structure passed e.g. to WI_Start(wb)
|
||||
//
|
||||
typedef struct
|
||||
{
|
||||
boolean in; // whether the player is in game
|
||||
|
||||
// Player stats, kills, collected items etc.
|
||||
int skills;
|
||||
int sitems;
|
||||
int ssecret;
|
||||
int stime;
|
||||
int frags[4];
|
||||
int score; // current score on entry, modified on return
|
||||
|
||||
} wbplayerstruct_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int epsd; // episode # (0-2)
|
||||
|
||||
// if true, splash the secret level
|
||||
boolean didsecret;
|
||||
|
||||
// previous and next levels, origin 0
|
||||
int last;
|
||||
int next;
|
||||
|
||||
int maxkills;
|
||||
int maxitems;
|
||||
int maxsecret;
|
||||
int maxfrags;
|
||||
|
||||
// the par time
|
||||
int partime;
|
||||
|
||||
// index of this player in game
|
||||
int pnum;
|
||||
|
||||
wbplayerstruct_t plyr[MAXPLAYERS];
|
||||
|
||||
} wbstartstruct_t;
|
||||
|
||||
|
||||
#endif
|
||||
43
src/kernel/userland/doom/d_textur.h
Normal file
43
src/kernel/userland/doom/d_textur.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Typedefs related to to textures etc.,
|
||||
// isolated here to make it easier separating modules.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __D_TEXTUR__
|
||||
#define __D_TEXTUR__
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Flats?
|
||||
//
|
||||
// a pic is an unmasked block of pixels
|
||||
typedef struct
|
||||
{
|
||||
byte width;
|
||||
byte height;
|
||||
byte data;
|
||||
} pic_t;
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
68
src/kernel/userland/doom/d_think.h
Normal file
68
src/kernel/userland/doom/d_think.h
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// MapObj data. Map Objects or mobjs are actors, entities,
|
||||
// thinker, take-your-pick... anything that moves, acts, or
|
||||
// suffers state changes of more or less violent nature.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __D_THINK__
|
||||
#define __D_THINK__
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Experimental stuff.
|
||||
// To compile this as "ANSI C with classes"
|
||||
// we will need to handle the various
|
||||
// action functions cleanly.
|
||||
//
|
||||
typedef void (*actionf_v)();
|
||||
typedef void (*actionf_p1)( void* );
|
||||
typedef void (*actionf_p2)( void*, void* );
|
||||
|
||||
typedef union
|
||||
{
|
||||
actionf_v acv;
|
||||
actionf_p1 acp1;
|
||||
actionf_p2 acp2;
|
||||
|
||||
} actionf_t;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Historically, "think_t" is yet another
|
||||
// function pointer to a routine to handle
|
||||
// an actor.
|
||||
typedef actionf_t think_t;
|
||||
|
||||
|
||||
// Doubly linked list of actors.
|
||||
typedef struct thinker_s
|
||||
{
|
||||
struct thinker_s* prev;
|
||||
struct thinker_s* next;
|
||||
think_t function;
|
||||
|
||||
} thinker_t;
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
56
src/kernel/userland/doom/d_ticcmd.h
Normal file
56
src/kernel/userland/doom/d_ticcmd.h
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 1993-2008 Raven Software
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// System specific interface stuff.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __D_TICCMD__
|
||||
#define __D_TICCMD__
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
|
||||
// The data sampled per tick (single player)
|
||||
// and transmitted to other peers (multiplayer).
|
||||
// Mainly movements/button commands per game tick,
|
||||
// plus a checksum for internal state consistency.
|
||||
|
||||
typedef struct
|
||||
{
|
||||
signed char forwardmove; // *2048 for move
|
||||
signed char sidemove; // *2048 for move
|
||||
short angleturn; // <<16 for angle delta
|
||||
byte chatchar;
|
||||
byte buttons;
|
||||
// villsa [STRIFE] according to the asm,
|
||||
// consistancy is a short, not a byte
|
||||
byte consistancy; // checks for net game
|
||||
|
||||
// villsa - Strife specific:
|
||||
|
||||
byte buttons2;
|
||||
int inventory;
|
||||
|
||||
// Heretic/Hexen specific:
|
||||
|
||||
byte lookfly; // look/fly up/down/centering
|
||||
byte arti; // artitype_t to use
|
||||
} ticcmd_t;
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
48
src/kernel/userland/doom/deh_main.h
Normal file
48
src/kernel/userland/doom/deh_main.h
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
//
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
//
|
||||
// Dehacked entrypoint and common code
|
||||
//
|
||||
|
||||
#ifndef DEH_MAIN_H
|
||||
#define DEH_MAIN_H
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "doomfeatures.h"
|
||||
#include "deh_str.h"
|
||||
#include "sha1.h"
|
||||
|
||||
// These are the limits that dehacked uses (from dheinit.h in the dehacked
|
||||
// source). If these limits are exceeded, it does not generate an error, but
|
||||
// a warning is displayed.
|
||||
|
||||
#define DEH_VANILLA_NUMSTATES 966
|
||||
#define DEH_VANILLA_NUMSFX 107
|
||||
|
||||
void DEH_ParseCommandLine(void);
|
||||
int DEH_LoadFile(char *filename);
|
||||
int DEH_LoadLump(int lumpnum, boolean allow_long, boolean allow_error);
|
||||
int DEH_LoadLumpByName(char *name, boolean allow_long, boolean allow_error);
|
||||
|
||||
boolean DEH_ParseAssignment(char *line, char **variable_name, char **value);
|
||||
|
||||
void DEH_Checksum(sha1_digest_t digest);
|
||||
|
||||
extern boolean deh_allow_extended_strings;
|
||||
extern boolean deh_allow_long_strings;
|
||||
extern boolean deh_allow_long_cheats;
|
||||
extern boolean deh_apply_cheats;
|
||||
|
||||
#endif /* #ifndef DEH_MAIN_H */
|
||||
|
||||
83
src/kernel/userland/doom/deh_misc.h
Normal file
83
src/kernel/userland/doom/deh_misc.h
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
//
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
//
|
||||
// Parses "Misc" sections in dehacked files
|
||||
//
|
||||
|
||||
#ifndef DEH_MISC_H
|
||||
#define DEH_MISC_H
|
||||
|
||||
#include "doomfeatures.h"
|
||||
|
||||
#define DEH_DEFAULT_INITIAL_HEALTH 100
|
||||
#define DEH_DEFAULT_INITIAL_BULLETS 50
|
||||
#define DEH_DEFAULT_MAX_HEALTH 200
|
||||
#define DEH_DEFAULT_MAX_ARMOR 200
|
||||
#define DEH_DEFAULT_GREEN_ARMOR_CLASS 1
|
||||
#define DEH_DEFAULT_BLUE_ARMOR_CLASS 2
|
||||
#define DEH_DEFAULT_MAX_SOULSPHERE 200
|
||||
#define DEH_DEFAULT_SOULSPHERE_HEALTH 100
|
||||
#define DEH_DEFAULT_MEGASPHERE_HEALTH 200
|
||||
#define DEH_DEFAULT_GOD_MODE_HEALTH 100
|
||||
#define DEH_DEFAULT_IDFA_ARMOR 200
|
||||
#define DEH_DEFAULT_IDFA_ARMOR_CLASS 2
|
||||
#define DEH_DEFAULT_IDKFA_ARMOR 200
|
||||
#define DEH_DEFAULT_IDKFA_ARMOR_CLASS 2
|
||||
#define DEH_DEFAULT_BFG_CELLS_PER_SHOT 40
|
||||
#define DEH_DEFAULT_SPECIES_INFIGHTING 0
|
||||
|
||||
#ifdef FEATURE_DEHACKED
|
||||
|
||||
extern int deh_initial_health;
|
||||
extern int deh_initial_bullets;
|
||||
extern int deh_max_health;
|
||||
extern int deh_max_armor;
|
||||
extern int deh_green_armor_class;
|
||||
extern int deh_blue_armor_class;
|
||||
extern int deh_max_soulsphere;
|
||||
extern int deh_soulsphere_health;
|
||||
extern int deh_megasphere_health;
|
||||
extern int deh_god_mode_health;
|
||||
extern int deh_idfa_armor;
|
||||
extern int deh_idfa_armor_class;
|
||||
extern int deh_idkfa_armor;
|
||||
extern int deh_idkfa_armor_class;
|
||||
extern int deh_bfg_cells_per_shot;
|
||||
extern int deh_species_infighting;
|
||||
|
||||
#else
|
||||
|
||||
// If dehacked is disabled, hard coded values
|
||||
|
||||
#define deh_initial_health DEH_DEFAULT_INITIAL_HEALTH
|
||||
#define deh_initial_bullets DEH_DEFAULT_INITIAL_BULLETS
|
||||
#define deh_max_health DEH_DEFAULT_MAX_HEALTH
|
||||
#define deh_max_armor DEH_DEFAULT_MAX_ARMOR
|
||||
#define deh_green_armor_class DEH_DEFAULT_GREEN_ARMOR_CLASS
|
||||
#define deh_blue_armor_class DEH_DEFAULT_BLUE_ARMOR_CLASS
|
||||
#define deh_max_soulsphere DEH_DEFAULT_MAX_SOULSPHERE
|
||||
#define deh_soulsphere_health DEH_DEFAULT_SOULSPHERE_HEALTH
|
||||
#define deh_megasphere_health DEH_DEFAULT_MEGASPHERE_HEALTH
|
||||
#define deh_god_mode_health DEH_DEFAULT_GOD_MODE_HEALTH
|
||||
#define deh_idfa_armor DEH_DEFAULT_IDFA_ARMOR
|
||||
#define deh_idfa_armor_class DEH_DEFAULT_IDFA_ARMOR_CLASS
|
||||
#define deh_idkfa_armor DEH_DEFAULT_IDKFA_ARMOR
|
||||
#define deh_idkfa_armor_class DEH_DEFAULT_IDKFA_ARMOR_CLASS
|
||||
#define deh_bfg_cells_per_shot DEH_DEFAULT_BFG_CELLS_PER_SHOT
|
||||
#define deh_species_infighting DEH_DEFAULT_SPECIES_INFIGHTING
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef DEH_MISC_H */
|
||||
|
||||
47
src/kernel/userland/doom/deh_str.h
Normal file
47
src/kernel/userland/doom/deh_str.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
//
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
//
|
||||
// Dehacked string replacements
|
||||
//
|
||||
|
||||
#ifndef DEH_STR_H
|
||||
#define DEH_STR_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "doomfeatures.h"
|
||||
|
||||
// Used to do dehacked text substitutions throughout the program
|
||||
|
||||
#ifdef FEATURE_DEHACKED
|
||||
|
||||
char *DEH_String(char *s);
|
||||
void DEH_printf(char *fmt, ...);
|
||||
void DEH_fprintf(FILE *fstream, char *fmt, ...);
|
||||
void DEH_snprintf(char *buffer, size_t len, char *fmt, ...);
|
||||
void DEH_AddStringReplacement(char *from_text, char *to_text);
|
||||
|
||||
|
||||
#else
|
||||
|
||||
#define DEH_String(x) (x)
|
||||
#define DEH_printf printf
|
||||
#define DEH_fprintf fprintf
|
||||
#define DEH_snprintf snprintf
|
||||
#define DEH_AddStringReplacement(x, y)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef DEH_STR_H */
|
||||
|
||||
42
src/kernel/userland/doom/doom.h
Normal file
42
src/kernel/userland/doom/doom.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* doom.h
|
||||
*
|
||||
* Created on: 18.02.2015
|
||||
* Author: Florian
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SRC_CHOCDOOM_DOOM_H_
|
||||
#define SRC_CHOCDOOM_DOOM_H_
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* additional includes *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* global definitions *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* type declarations *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* function prototypes *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
void D_DoomMain (void);
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* global data *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* inline functions and function-like macros *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* eof *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#endif /* SRC_CHOCDOOM_DOOM_H_ */
|
||||
213
src/kernel/userland/doom/doomdata.h
Normal file
213
src/kernel/userland/doom/doomdata.h
Normal file
|
|
@ -0,0 +1,213 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// all external data is defined here
|
||||
// most of the data is loaded into different structures at run time
|
||||
// some internal structures shared by many modules are here
|
||||
//
|
||||
|
||||
#ifndef __DOOMDATA__
|
||||
#define __DOOMDATA__
|
||||
|
||||
// The most basic types we use, portability.
|
||||
#include "doomtype.h"
|
||||
|
||||
// Some global defines, that configure the game.
|
||||
#include "doomdef.h"
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Map level types.
|
||||
// The following data structures define the persistent format
|
||||
// used in the lumps of the WAD files.
|
||||
//
|
||||
|
||||
// Lump order in a map WAD: each map needs a couple of lumps
|
||||
// to provide a complete scene geometry description.
|
||||
enum
|
||||
{
|
||||
ML_LABEL, // A separator, name, ExMx or MAPxx
|
||||
ML_THINGS, // Monsters, items..
|
||||
ML_LINEDEFS, // LineDefs, from editing
|
||||
ML_SIDEDEFS, // SideDefs, from editing
|
||||
ML_VERTEXES, // Vertices, edited and BSP splits generated
|
||||
ML_SEGS, // LineSegs, from LineDefs split by BSP
|
||||
ML_SSECTORS, // SubSectors, list of LineSegs
|
||||
ML_NODES, // BSP nodes
|
||||
ML_SECTORS, // Sectors, from editing
|
||||
ML_REJECT, // LUT, sector-sector visibility
|
||||
ML_BLOCKMAP // LUT, motion clipping, walls/grid element
|
||||
};
|
||||
|
||||
|
||||
// A single Vertex.
|
||||
typedef struct
|
||||
{
|
||||
short x;
|
||||
short y;
|
||||
} PACKEDATTR mapvertex_t;
|
||||
|
||||
|
||||
// A SideDef, defining the visual appearance of a wall,
|
||||
// by setting textures and offsets.
|
||||
typedef struct
|
||||
{
|
||||
short textureoffset;
|
||||
short rowoffset;
|
||||
char toptexture[8];
|
||||
char bottomtexture[8];
|
||||
char midtexture[8];
|
||||
// Front sector, towards viewer.
|
||||
short sector;
|
||||
} PACKEDATTR mapsidedef_t;
|
||||
|
||||
|
||||
|
||||
// A LineDef, as used for editing, and as input
|
||||
// to the BSP builder.
|
||||
typedef struct
|
||||
{
|
||||
short v1;
|
||||
short v2;
|
||||
short flags;
|
||||
short special;
|
||||
short tag;
|
||||
// sidenum[1] will be -1 if one sided
|
||||
short sidenum[2];
|
||||
} PACKEDATTR maplinedef_t;
|
||||
|
||||
|
||||
//
|
||||
// LineDef attributes.
|
||||
//
|
||||
|
||||
// Solid, is an obstacle.
|
||||
#define ML_BLOCKING 1
|
||||
|
||||
// Blocks monsters only.
|
||||
#define ML_BLOCKMONSTERS 2
|
||||
|
||||
// Backside will not be present at all
|
||||
// if not two sided.
|
||||
#define ML_TWOSIDED 4
|
||||
|
||||
// If a texture is pegged, the texture will have
|
||||
// the end exposed to air held constant at the
|
||||
// top or bottom of the texture (stairs or pulled
|
||||
// down things) and will move with a height change
|
||||
// of one of the neighbor sectors.
|
||||
// Unpegged textures allways have the first row of
|
||||
// the texture at the top pixel of the line for both
|
||||
// top and bottom textures (use next to windows).
|
||||
|
||||
// upper texture unpegged
|
||||
#define ML_DONTPEGTOP 8
|
||||
|
||||
// lower texture unpegged
|
||||
#define ML_DONTPEGBOTTOM 16
|
||||
|
||||
// In AutoMap: don't map as two sided: IT'S A SECRET!
|
||||
#define ML_SECRET 32
|
||||
|
||||
// Sound rendering: don't let sound cross two of these.
|
||||
#define ML_SOUNDBLOCK 64
|
||||
|
||||
// Don't draw on the automap at all.
|
||||
#define ML_DONTDRAW 128
|
||||
|
||||
// Set if already seen, thus drawn in automap.
|
||||
#define ML_MAPPED 256
|
||||
|
||||
|
||||
|
||||
|
||||
// Sector definition, from editing.
|
||||
typedef struct
|
||||
{
|
||||
short floorheight;
|
||||
short ceilingheight;
|
||||
char floorpic[8];
|
||||
char ceilingpic[8];
|
||||
short lightlevel;
|
||||
short special;
|
||||
short tag;
|
||||
} PACKEDATTR mapsector_t;
|
||||
|
||||
// SubSector, as generated by BSP.
|
||||
typedef struct
|
||||
{
|
||||
short numsegs;
|
||||
// Index of first one, segs are stored sequentially.
|
||||
short firstseg;
|
||||
} PACKEDATTR mapsubsector_t;
|
||||
|
||||
|
||||
// LineSeg, generated by splitting LineDefs
|
||||
// using partition lines selected by BSP builder.
|
||||
typedef struct
|
||||
{
|
||||
short v1;
|
||||
short v2;
|
||||
short angle;
|
||||
short linedef;
|
||||
short side;
|
||||
short offset;
|
||||
} PACKEDATTR mapseg_t;
|
||||
|
||||
|
||||
|
||||
// BSP node structure.
|
||||
|
||||
// Indicate a leaf.
|
||||
#define NF_SUBSECTOR 0x8000
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// Partition line from (x,y) to x+dx,y+dy)
|
||||
short x;
|
||||
short y;
|
||||
short dx;
|
||||
short dy;
|
||||
|
||||
// Bounding box for each child,
|
||||
// clip against view frustum.
|
||||
short bbox[2][4];
|
||||
|
||||
// If NF_SUBSECTOR its a subsector,
|
||||
// else it's a node of another subtree.
|
||||
unsigned short children[2];
|
||||
|
||||
} PACKEDATTR mapnode_t;
|
||||
|
||||
|
||||
|
||||
|
||||
// Thing definition, position, orientation and type,
|
||||
// plus skill/visibility flags and attributes.
|
||||
typedef struct
|
||||
{
|
||||
short x;
|
||||
short y;
|
||||
short angle;
|
||||
short type;
|
||||
short options;
|
||||
} PACKEDATTR mapthing_t;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // __DOOMDATA__
|
||||
28
src/kernel/userland/doom/doomdef.c
Normal file
28
src/kernel/userland/doom/doomdef.c
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// DoomDef - basic defines for DOOM, e.g. Version, game mode
|
||||
// and skill level, and display parameters.
|
||||
//
|
||||
|
||||
|
||||
|
||||
#include "doomdef.h"
|
||||
|
||||
// Location for any defines turned variables.
|
||||
|
||||
// None.
|
||||
|
||||
|
||||
168
src/kernel/userland/doom/doomdef.h
Normal file
168
src/kernel/userland/doom/doomdef.h
Normal file
|
|
@ -0,0 +1,168 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Internally used data structures for virtually everything,
|
||||
// lots of other stuff.
|
||||
//
|
||||
|
||||
#ifndef __DOOMDEF__
|
||||
#define __DOOMDEF__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "i_timer.h"
|
||||
#include "d_mode.h"
|
||||
|
||||
//
|
||||
// Global parameters/defines.
|
||||
//
|
||||
// DOOM version
|
||||
#define DOOM_VERSION 109
|
||||
|
||||
// Version code for cph's longtics hack ("v1.91")
|
||||
#define DOOM_191_VERSION 111
|
||||
|
||||
|
||||
// If rangecheck is undefined,
|
||||
// most parameter validation debugging code will not be compiled
|
||||
#define RANGECHECK
|
||||
|
||||
// The maximum number of players, multiplayer/networking.
|
||||
#define MAXPLAYERS 4
|
||||
|
||||
// The current state of the game: whether we are
|
||||
// playing, gazing at the intermission screen,
|
||||
// the game final animation, or a demo.
|
||||
typedef enum
|
||||
{
|
||||
GS_LEVEL,
|
||||
GS_INTERMISSION,
|
||||
GS_FINALE,
|
||||
GS_DEMOSCREEN,
|
||||
} gamestate_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ga_nothing,
|
||||
ga_loadlevel,
|
||||
ga_newgame,
|
||||
ga_loadgame,
|
||||
ga_savegame,
|
||||
ga_playdemo,
|
||||
ga_completed,
|
||||
ga_victory,
|
||||
ga_worlddone,
|
||||
ga_screenshot
|
||||
} gameaction_t;
|
||||
|
||||
//
|
||||
// Difficulty/skill settings/filters.
|
||||
//
|
||||
|
||||
// Skill flags.
|
||||
#define MTF_EASY 1
|
||||
#define MTF_NORMAL 2
|
||||
#define MTF_HARD 4
|
||||
|
||||
// Deaf monsters/do not react to sound.
|
||||
#define MTF_AMBUSH 8
|
||||
|
||||
|
||||
//
|
||||
// Key cards.
|
||||
//
|
||||
typedef enum
|
||||
{
|
||||
it_bluecard,
|
||||
it_yellowcard,
|
||||
it_redcard,
|
||||
it_blueskull,
|
||||
it_yellowskull,
|
||||
it_redskull,
|
||||
|
||||
NUMCARDS
|
||||
|
||||
} card_t;
|
||||
|
||||
|
||||
|
||||
// The defined weapons,
|
||||
// including a marker indicating
|
||||
// user has not changed weapon.
|
||||
typedef enum
|
||||
{
|
||||
wp_fist,
|
||||
wp_pistol,
|
||||
wp_shotgun,
|
||||
wp_chaingun,
|
||||
wp_missile,
|
||||
wp_plasma,
|
||||
wp_bfg,
|
||||
wp_chainsaw,
|
||||
wp_supershotgun,
|
||||
|
||||
NUMWEAPONS,
|
||||
|
||||
// No pending weapon change.
|
||||
wp_nochange
|
||||
|
||||
} weapontype_t;
|
||||
|
||||
|
||||
// Ammunition types defined.
|
||||
typedef enum
|
||||
{
|
||||
am_clip, // Pistol / chaingun ammo.
|
||||
am_shell, // Shotgun / double barreled shotgun.
|
||||
am_cell, // Plasma rifle, BFG.
|
||||
am_misl, // Missile launcher.
|
||||
NUMAMMO,
|
||||
am_noammo // Unlimited for chainsaw / fist.
|
||||
|
||||
} ammotype_t;
|
||||
|
||||
|
||||
// Power up artifacts.
|
||||
typedef enum
|
||||
{
|
||||
pw_invulnerability,
|
||||
pw_strength,
|
||||
pw_invisibility,
|
||||
pw_ironfeet,
|
||||
pw_allmap,
|
||||
pw_infrared,
|
||||
NUMPOWERS
|
||||
|
||||
} powertype_t;
|
||||
|
||||
|
||||
|
||||
//
|
||||
// Power up durations,
|
||||
// how many seconds till expiration,
|
||||
// assuming TICRATE is 35 ticks/second.
|
||||
//
|
||||
typedef enum
|
||||
{
|
||||
INVULNTICS = (30*TICRATE),
|
||||
INVISTICS = (60*TICRATE),
|
||||
INFRATICS = (120*TICRATE),
|
||||
IRONTICS = (60*TICRATE)
|
||||
|
||||
} powerduration_t;
|
||||
|
||||
#endif // __DOOMDEF__
|
||||
40
src/kernel/userland/doom/doomfeatures.h
Normal file
40
src/kernel/userland/doom/doomfeatures.h
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
//
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// List of features which can be enabled/disabled to slim down the
|
||||
// program.
|
||||
//
|
||||
|
||||
#ifndef DOOM_FEATURES_H
|
||||
#define DOOM_FEATURES_H
|
||||
|
||||
// Enables wad merging (the '-merge' command line parameter)
|
||||
|
||||
#undef FEATURE_WAD_MERGE
|
||||
|
||||
// Enables dehacked support ('-deh')
|
||||
|
||||
#undef FEATURE_DEHACKED
|
||||
|
||||
// Enables multiplayer support (network games)
|
||||
|
||||
#undef FEATURE_MULTIPLAYER
|
||||
|
||||
// Enables sound output
|
||||
|
||||
//#undef FEATURE_SOUND
|
||||
|
||||
#endif /* #ifndef DOOM_FEATURES_H */
|
||||
|
||||
|
||||
27
src/kernel/userland/doom/doomgeneric.c
Normal file
27
src/kernel/userland/doom/doomgeneric.c
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#include "m_argv.h"
|
||||
|
||||
#include "doomgeneric.h"
|
||||
|
||||
pixel_t* DG_ScreenBuffer = NULL;
|
||||
|
||||
void M_FindResponseFile(void);
|
||||
void D_DoomMain (void);
|
||||
|
||||
|
||||
void doomgeneric_Create(int argc, char **argv)
|
||||
{
|
||||
// save arguments
|
||||
myargc = argc;
|
||||
myargv = argv;
|
||||
|
||||
M_FindResponseFile();
|
||||
|
||||
DG_ScreenBuffer = malloc(DOOMGENERIC_RESX * DOOMGENERIC_RESY * 4);
|
||||
|
||||
DG_Init();
|
||||
|
||||
D_DoomMain ();
|
||||
}
|
||||
|
||||
49
src/kernel/userland/doom/doomgeneric.h
Normal file
49
src/kernel/userland/doom/doomgeneric.h
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
#ifndef DOOM_GENERIC
|
||||
#define DOOM_GENERIC
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef DOOMGENERIC_RESX
|
||||
#define DOOMGENERIC_RESX 640
|
||||
#endif // DOOMGENERIC_RESX
|
||||
|
||||
#ifndef DOOMGENERIC_RESY
|
||||
#define DOOMGENERIC_RESY 400
|
||||
#endif // DOOMGENERIC_RESY
|
||||
|
||||
|
||||
#ifdef CMAP256
|
||||
|
||||
typedef uint8_t pixel_t;
|
||||
|
||||
#else // CMAP256
|
||||
|
||||
typedef uint32_t pixel_t;
|
||||
|
||||
#endif // CMAP256
|
||||
|
||||
|
||||
extern pixel_t* DG_ScreenBuffer;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void doomgeneric_Create(int argc, char **argv);
|
||||
void doomgeneric_Tick();
|
||||
|
||||
|
||||
//Implement below functions for your platform
|
||||
void DG_Init();
|
||||
void DG_DrawFrame();
|
||||
void DG_SleepMs(uint32_t ms);
|
||||
uint32_t DG_GetTicksMs();
|
||||
int DG_GetKey(int* pressed, unsigned char* key);
|
||||
void DG_SetWindowTitle(const char * title);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //DOOM_GENERIC
|
||||
339
src/kernel/userland/doom/doomgeneric.vcxproj
Normal file
339
src/kernel/userland/doom/doomgeneric.vcxproj
Normal file
|
|
@ -0,0 +1,339 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{95A126D2-CC94-4840-BF05-80305041B5FB}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>doomgeneric</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>4146;4996</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>4146;4996</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>false</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>4146;4996</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<DisableSpecificWarnings>4146;4996</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="am_map.c" />
|
||||
<ClCompile Include="doomdef.c" />
|
||||
<ClCompile Include="doomgeneric.c" />
|
||||
<ClCompile Include="doomgeneric_win.c" />
|
||||
<ClCompile Include="doomstat.c" />
|
||||
<ClCompile Include="dstrings.c" />
|
||||
<ClCompile Include="dummy.c" />
|
||||
<ClCompile Include="d_event.c" />
|
||||
<ClCompile Include="d_items.c" />
|
||||
<ClCompile Include="d_iwad.c" />
|
||||
<ClCompile Include="d_loop.c" />
|
||||
<ClCompile Include="d_main.c" />
|
||||
<ClCompile Include="d_mode.c" />
|
||||
<ClCompile Include="d_net.c" />
|
||||
<ClCompile Include="f_finale.c" />
|
||||
<ClCompile Include="f_wipe.c" />
|
||||
<ClCompile Include="gusconf.c" />
|
||||
<ClCompile Include="g_game.c" />
|
||||
<ClCompile Include="hu_lib.c" />
|
||||
<ClCompile Include="hu_stuff.c" />
|
||||
<ClCompile Include="icon.c" />
|
||||
<ClCompile Include="info.c" />
|
||||
<ClCompile Include="i_cdmus.c" />
|
||||
<ClCompile Include="i_endoom.c" />
|
||||
<ClCompile Include="i_input.c" />
|
||||
<ClCompile Include="i_joystick.c" />
|
||||
<ClCompile Include="i_scale.c" />
|
||||
<ClCompile Include="i_sound.c" />
|
||||
<ClCompile Include="i_system.c" />
|
||||
<ClCompile Include="i_timer.c" />
|
||||
<ClCompile Include="i_video.c" />
|
||||
<ClCompile Include="memio.c" />
|
||||
<ClCompile Include="m_argv.c" />
|
||||
<ClCompile Include="m_bbox.c" />
|
||||
<ClCompile Include="m_cheat.c" />
|
||||
<ClCompile Include="m_config.c" />
|
||||
<ClCompile Include="m_controls.c" />
|
||||
<ClCompile Include="m_fixed.c" />
|
||||
<ClCompile Include="m_menu.c" />
|
||||
<ClCompile Include="m_misc.c" />
|
||||
<ClCompile Include="m_random.c" />
|
||||
<ClCompile Include="p_ceilng.c" />
|
||||
<ClCompile Include="p_doors.c" />
|
||||
<ClCompile Include="p_enemy.c" />
|
||||
<ClCompile Include="p_floor.c" />
|
||||
<ClCompile Include="p_inter.c" />
|
||||
<ClCompile Include="p_lights.c" />
|
||||
<ClCompile Include="p_map.c" />
|
||||
<ClCompile Include="p_maputl.c" />
|
||||
<ClCompile Include="p_mobj.c" />
|
||||
<ClCompile Include="p_plats.c" />
|
||||
<ClCompile Include="p_pspr.c" />
|
||||
<ClCompile Include="p_saveg.c" />
|
||||
<ClCompile Include="p_setup.c" />
|
||||
<ClCompile Include="p_sight.c" />
|
||||
<ClCompile Include="p_spec.c" />
|
||||
<ClCompile Include="p_switch.c" />
|
||||
<ClCompile Include="p_telept.c" />
|
||||
<ClCompile Include="p_tick.c" />
|
||||
<ClCompile Include="p_user.c" />
|
||||
<ClCompile Include="r_bsp.c" />
|
||||
<ClCompile Include="r_data.c" />
|
||||
<ClCompile Include="r_draw.c" />
|
||||
<ClCompile Include="r_main.c" />
|
||||
<ClCompile Include="r_plane.c" />
|
||||
<ClCompile Include="r_segs.c" />
|
||||
<ClCompile Include="r_sky.c" />
|
||||
<ClCompile Include="r_things.c" />
|
||||
<ClCompile Include="sha1.c" />
|
||||
<ClCompile Include="sounds.c" />
|
||||
<ClCompile Include="statdump.c" />
|
||||
<ClCompile Include="st_lib.c" />
|
||||
<ClCompile Include="st_stuff.c" />
|
||||
<ClCompile Include="s_sound.c" />
|
||||
<ClCompile Include="tables.c" />
|
||||
<ClCompile Include="v_video.c" />
|
||||
<ClCompile Include="wi_stuff.c" />
|
||||
<ClCompile Include="w_checksum.c" />
|
||||
<ClCompile Include="w_file.c" />
|
||||
<ClCompile Include="w_file_stdc.c" />
|
||||
<ClCompile Include="w_main.c" />
|
||||
<ClCompile Include="w_wad.c" />
|
||||
<ClCompile Include="z_zone.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="am_map.h" />
|
||||
<ClInclude Include="config.h" />
|
||||
<ClInclude Include="deh_main.h" />
|
||||
<ClInclude Include="deh_misc.h" />
|
||||
<ClInclude Include="deh_str.h" />
|
||||
<ClInclude Include="doom.h" />
|
||||
<ClInclude Include="doomdata.h" />
|
||||
<ClInclude Include="doomdef.h" />
|
||||
<ClInclude Include="doomfeatures.h" />
|
||||
<ClInclude Include="doomgeneric.h" />
|
||||
<ClInclude Include="doomkeys.h" />
|
||||
<ClInclude Include="doomstat.h" />
|
||||
<ClInclude Include="doomtype.h" />
|
||||
<ClInclude Include="dstrings.h" />
|
||||
<ClInclude Include="d_englsh.h" />
|
||||
<ClInclude Include="d_event.h" />
|
||||
<ClInclude Include="d_items.h" />
|
||||
<ClInclude Include="d_iwad.h" />
|
||||
<ClInclude Include="d_loop.h" />
|
||||
<ClInclude Include="d_main.h" />
|
||||
<ClInclude Include="d_mode.h" />
|
||||
<ClInclude Include="d_player.h" />
|
||||
<ClInclude Include="d_textur.h" />
|
||||
<ClInclude Include="d_think.h" />
|
||||
<ClInclude Include="d_ticcmd.h" />
|
||||
<ClInclude Include="f_finale.h" />
|
||||
<ClInclude Include="f_wipe.h" />
|
||||
<ClInclude Include="gusconf.h" />
|
||||
<ClInclude Include="g_game.h" />
|
||||
<ClInclude Include="hu_lib.h" />
|
||||
<ClInclude Include="hu_stuff.h" />
|
||||
<ClInclude Include="info.h" />
|
||||
<ClInclude Include="i_cdmus.h" />
|
||||
<ClInclude Include="i_endoom.h" />
|
||||
<ClInclude Include="i_joystick.h" />
|
||||
<ClInclude Include="i_scale.h" />
|
||||
<ClInclude Include="i_sound.h" />
|
||||
<ClInclude Include="i_swap.h" />
|
||||
<ClInclude Include="i_system.h" />
|
||||
<ClInclude Include="i_timer.h" />
|
||||
<ClInclude Include="i_video.h" />
|
||||
<ClInclude Include="memio.h" />
|
||||
<ClInclude Include="m_argv.h" />
|
||||
<ClInclude Include="m_bbox.h" />
|
||||
<ClInclude Include="m_cheat.h" />
|
||||
<ClInclude Include="m_config.h" />
|
||||
<ClInclude Include="m_controls.h" />
|
||||
<ClInclude Include="m_fixed.h" />
|
||||
<ClInclude Include="m_menu.h" />
|
||||
<ClInclude Include="m_misc.h" />
|
||||
<ClInclude Include="m_random.h" />
|
||||
<ClInclude Include="net_client.h" />
|
||||
<ClInclude Include="net_dedicated.h" />
|
||||
<ClInclude Include="net_defs.h" />
|
||||
<ClInclude Include="net_gui.h" />
|
||||
<ClInclude Include="net_io.h" />
|
||||
<ClInclude Include="net_loop.h" />
|
||||
<ClInclude Include="net_packet.h" />
|
||||
<ClInclude Include="net_query.h" />
|
||||
<ClInclude Include="net_sdl.h" />
|
||||
<ClInclude Include="net_server.h" />
|
||||
<ClInclude Include="p_inter.h" />
|
||||
<ClInclude Include="p_local.h" />
|
||||
<ClInclude Include="p_mobj.h" />
|
||||
<ClInclude Include="p_pspr.h" />
|
||||
<ClInclude Include="p_saveg.h" />
|
||||
<ClInclude Include="p_setup.h" />
|
||||
<ClInclude Include="p_spec.h" />
|
||||
<ClInclude Include="p_tick.h" />
|
||||
<ClInclude Include="r_bsp.h" />
|
||||
<ClInclude Include="r_data.h" />
|
||||
<ClInclude Include="r_defs.h" />
|
||||
<ClInclude Include="r_draw.h" />
|
||||
<ClInclude Include="r_local.h" />
|
||||
<ClInclude Include="r_main.h" />
|
||||
<ClInclude Include="r_plane.h" />
|
||||
<ClInclude Include="r_segs.h" />
|
||||
<ClInclude Include="r_sky.h" />
|
||||
<ClInclude Include="r_state.h" />
|
||||
<ClInclude Include="r_things.h" />
|
||||
<ClInclude Include="sha1.h" />
|
||||
<ClInclude Include="sounds.h" />
|
||||
<ClInclude Include="statdump.h" />
|
||||
<ClInclude Include="st_lib.h" />
|
||||
<ClInclude Include="st_stuff.h" />
|
||||
<ClInclude Include="s_sound.h" />
|
||||
<ClInclude Include="tables.h" />
|
||||
<ClInclude Include="v_patch.h" />
|
||||
<ClInclude Include="v_video.h" />
|
||||
<ClInclude Include="wi_stuff.h" />
|
||||
<ClInclude Include="w_checksum.h" />
|
||||
<ClInclude Include="w_file.h" />
|
||||
<ClInclude Include="w_main.h" />
|
||||
<ClInclude Include="w_merge.h" />
|
||||
<ClInclude Include="w_wad.h" />
|
||||
<ClInclude Include="z_zone.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
558
src/kernel/userland/doom/doomgeneric.vcxproj.filters
Normal file
558
src/kernel/userland/doom/doomgeneric.vcxproj.filters
Normal file
|
|
@ -0,0 +1,558 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="am_map.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="d_event.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="d_items.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="d_iwad.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="d_loop.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="d_main.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="d_mode.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="d_net.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="doomdef.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="doomstat.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dstrings.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="dummy.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="f_finale.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="f_wipe.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="g_game.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="gusconf.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="hu_lib.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="hu_stuff.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="i_cdmus.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="i_endoom.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="i_joystick.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="i_scale.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="i_sound.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="i_system.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="i_timer.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="icon.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="info.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="m_argv.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="m_bbox.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="m_cheat.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="m_config.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="m_controls.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="m_fixed.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="m_menu.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="m_misc.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="m_random.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="memio.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_ceilng.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_doors.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_enemy.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_floor.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_inter.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_lights.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_map.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_maputl.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_mobj.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_plats.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_pspr.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_saveg.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_setup.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_sight.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_spec.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_switch.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_telept.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_tick.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="p_user.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="r_bsp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="r_data.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="r_draw.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="r_main.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="r_plane.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="r_segs.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="r_sky.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="r_things.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="s_sound.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="sha1.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="sounds.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="st_lib.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="st_stuff.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="statdump.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="tables.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="v_video.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="w_checksum.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="w_file.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="w_file_stdc.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="w_main.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="w_wad.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="wi_stuff.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="z_zone.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="doomgeneric.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="doomgeneric_win.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="i_input.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="i_video.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="am_map.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="config.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d_englsh.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d_event.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d_items.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d_iwad.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d_loop.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d_main.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d_mode.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d_player.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d_textur.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d_think.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="d_ticcmd.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="deh_main.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="deh_misc.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="deh_str.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="doom.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="doomdata.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="doomdef.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="doomfeatures.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="doomkeys.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="doomstat.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="doomtype.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="dstrings.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="f_finale.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="f_wipe.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="g_game.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="gusconf.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="hu_lib.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="hu_stuff.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="i_cdmus.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="i_endoom.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="i_joystick.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="i_scale.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="i_sound.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="i_swap.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="i_system.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="i_timer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="i_video.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="info.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="m_argv.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="m_bbox.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="m_cheat.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="m_config.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="m_controls.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="m_fixed.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="m_menu.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="m_misc.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="m_random.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="memio.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="net_client.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="net_dedicated.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="net_defs.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="net_gui.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="net_io.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="net_loop.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="net_packet.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="net_query.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="net_sdl.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="net_server.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="p_inter.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="p_local.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="p_mobj.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="p_pspr.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="p_saveg.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="p_setup.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="p_spec.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="p_tick.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="r_bsp.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="r_data.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="r_defs.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="r_draw.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="r_local.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="r_main.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="r_plane.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="r_segs.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="r_sky.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="r_state.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="r_things.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="s_sound.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="sha1.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="sounds.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="st_lib.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="st_stuff.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="statdump.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="tables.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="v_patch.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="v_video.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="w_checksum.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="w_file.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="w_main.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="w_merge.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="w_wad.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="wi_stuff.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="z_zone.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="doomgeneric.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
133
src/kernel/userland/doom/doomgeneric_boredos.c
Normal file
133
src/kernel/userland/doom/doomgeneric_boredos.c
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
#include "doomgeneric.h"
|
||||
#include "doomkeys.h"
|
||||
#include <libui.h>
|
||||
#include <syscall.h>
|
||||
|
||||
static ui_window_t doom_win = 0;
|
||||
|
||||
void DG_Init(void) {
|
||||
doom_win = ui_window_create("Yes, it's DOOM.", (1920 - DOOMGENERIC_RESX) / 2, (1080 - DOOMGENERIC_RESY) / 2, DOOMGENERIC_RESX, DOOMGENERIC_RESY);
|
||||
}
|
||||
|
||||
static uint32_t scaled_buffer[600 * 900]; // DOOMGENERIC_RESX * DOOMGENERIC_RESY
|
||||
|
||||
void DG_DrawFrame(void) {
|
||||
if (doom_win) {
|
||||
// Doom's internal rendering is always 320x200.
|
||||
// But doomgeneric seems to expect DOOMGENERIC_RESX x DOOMGENERIC_RESY.
|
||||
// Actually, if we set DOOMGENERIC_RESX = 600, doom builds its internal tables based on DOOMGENERIC_RESX.
|
||||
// Wait, Doom's standard resolution is 320x200. Let's find out what DG_ScreenBuffer dimensions are.
|
||||
// According to Doom source, SCREENWIDTH and SCREENHEIGHT define the buffer size.
|
||||
// So DG_ScreenBuffer is indeed DOOMGENERIC_RESX x DOOMGENERIC_RESY.
|
||||
// However, the issue shown in the image is that the *game itself* only drew a 320x200 or 640x400 block in the corner!
|
||||
|
||||
// So the image wasn't scaled by Doom. Let's let LibUI do the scaling!
|
||||
// We will tell Doom its resolution is 640x400 (which it knows how to handle correctly for the 16:10 aspect ratio),
|
||||
// but we'll scale it to 600x900 (or whatever window size) before sending it to ui_draw_image.
|
||||
|
||||
// Wait, ui_draw_image doesn't scale natively yet. Let's do nearest-neighbor scaling.
|
||||
int src_w = 640;
|
||||
int src_h = 400;
|
||||
int dst_w = DOOMGENERIC_RESX;
|
||||
int dst_h = DOOMGENERIC_RESY;
|
||||
|
||||
for (int y = 0; y < dst_h; y++) {
|
||||
int sy = y * src_h / dst_h;
|
||||
for (int x = 0; x < dst_w; x++) {
|
||||
int sx = x * src_w / dst_w;
|
||||
scaled_buffer[y * dst_w + x] = ((uint32_t*)DG_ScreenBuffer)[sy * src_w + sx];
|
||||
}
|
||||
}
|
||||
|
||||
ui_draw_image(doom_win, 0, 0, dst_w, dst_h, scaled_buffer);
|
||||
ui_mark_dirty(doom_win, 0, 0, dst_w, dst_h);
|
||||
}
|
||||
}
|
||||
|
||||
void DG_SleepMs(uint32_t ms) {
|
||||
uint32_t end_ticks = DG_GetTicksMs() + ms;
|
||||
while (DG_GetTicksMs() < end_ticks) {
|
||||
for(volatile int x=0; x<1000; x++);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t DG_GetTicksMs(void) {
|
||||
uint64_t ticks = sys_system(16, 0, 0, 0, 0); // SYSTEM_CMD_UPTIME = 16 (100Hz)
|
||||
return (uint32_t)(ticks * 10);
|
||||
}
|
||||
|
||||
void DG_SetWindowTitle(const char * title) {
|
||||
}
|
||||
|
||||
#define KQ_SIZE 64
|
||||
static struct { int pressed; unsigned char key; } key_queue[KQ_SIZE];
|
||||
static int kq_head = 0;
|
||||
static int kq_tail = 0;
|
||||
static uint32_t key_held_until[256];
|
||||
|
||||
static void push_key(int pressed, unsigned char key) {
|
||||
int next = (kq_head + 1) % KQ_SIZE;
|
||||
if (next != kq_tail) {
|
||||
key_queue[kq_head].pressed = pressed;
|
||||
key_queue[kq_head].key = key;
|
||||
kq_head = next;
|
||||
}
|
||||
}
|
||||
|
||||
int DG_GetKey(int* pressed, unsigned char* key) {
|
||||
if (kq_tail != kq_head) {
|
||||
*pressed = key_queue[kq_tail].pressed;
|
||||
*key = key_queue[kq_tail].key;
|
||||
kq_tail = (kq_tail + 1) % KQ_SIZE;
|
||||
return 1;
|
||||
}
|
||||
|
||||
gui_event_t ev;
|
||||
while (ui_get_event(doom_win, &ev)) {
|
||||
if (ev.type == GUI_EVENT_CLOSE) {
|
||||
sys_exit(0);
|
||||
} else if (ev.type == GUI_EVENT_KEY || ev.type == GUI_EVENT_KEYUP) {
|
||||
unsigned char k = (unsigned char)ev.arg1;
|
||||
unsigned char dk = k;
|
||||
if (k == 17) dk = KEY_UPARROW;
|
||||
else if (k == 18) dk = KEY_DOWNARROW;
|
||||
else if (k == 19) dk = KEY_LEFTARROW;
|
||||
else if (k == 20) dk = KEY_RIGHTARROW;
|
||||
else if (k == 21) dk = KEY_FIRE;
|
||||
else if (k == 22) dk = KEY_RALT;
|
||||
else if (k == 23) dk = KEY_CAPSLOCK;
|
||||
else if (k == 27) dk = KEY_ESCAPE;
|
||||
else if (k == ' ') dk = KEY_USE;
|
||||
else if (k == '\n' || k == '\r') dk = KEY_ENTER;
|
||||
else if (k >= 'A' && k <= 'Z') dk = k + 32;
|
||||
|
||||
if (ev.type == GUI_EVENT_KEY) {
|
||||
push_key(1, dk);
|
||||
} else if (ev.type == GUI_EVENT_KEYUP) {
|
||||
push_key(0, dk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (kq_tail != kq_head) {
|
||||
*pressed = key_queue[kq_tail].pressed;
|
||||
*key = key_queue[kq_tail].key;
|
||||
kq_tail = (kq_tail + 1) % KQ_SIZE;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
(void)argc;
|
||||
(void)argv;
|
||||
char* fake_argv[] = {"doom", "-iwad", "A:/doom1.wad"};
|
||||
doomgeneric_Create(3, fake_argv);
|
||||
|
||||
while (1) {
|
||||
doomgeneric_Tick();
|
||||
sleep(1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
96
src/kernel/userland/doom/doomkeys.h
Normal file
96
src/kernel/userland/doom/doomkeys.h
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Key definitions
|
||||
//
|
||||
|
||||
#ifndef __DOOMKEYS__
|
||||
#define __DOOMKEYS__
|
||||
|
||||
//
|
||||
// DOOM keyboard definition.
|
||||
// This is the stuff configured by Setup.Exe.
|
||||
// Most key data are simple ascii (uppercased).
|
||||
//
|
||||
#define KEY_RIGHTARROW 0xae
|
||||
#define KEY_LEFTARROW 0xac
|
||||
#define KEY_UPARROW 0xad
|
||||
#define KEY_DOWNARROW 0xaf
|
||||
#define KEY_STRAFE_L 0xa0
|
||||
#define KEY_STRAFE_R 0xa1
|
||||
#define KEY_USE 0xa2
|
||||
#define KEY_FIRE 0xa3
|
||||
#define KEY_ESCAPE 27
|
||||
#define KEY_ENTER 13
|
||||
#define KEY_TAB 9
|
||||
#define KEY_F1 (0x80+0x3b)
|
||||
#define KEY_F2 (0x80+0x3c)
|
||||
#define KEY_F3 (0x80+0x3d)
|
||||
#define KEY_F4 (0x80+0x3e)
|
||||
#define KEY_F5 (0x80+0x3f)
|
||||
#define KEY_F6 (0x80+0x40)
|
||||
#define KEY_F7 (0x80+0x41)
|
||||
#define KEY_F8 (0x80+0x42)
|
||||
#define KEY_F9 (0x80+0x43)
|
||||
#define KEY_F10 (0x80+0x44)
|
||||
#define KEY_F11 (0x80+0x57)
|
||||
#define KEY_F12 (0x80+0x58)
|
||||
|
||||
#define KEY_BACKSPACE 0x7f
|
||||
#define KEY_PAUSE 0xff
|
||||
|
||||
#define KEY_EQUALS 0x3d
|
||||
#define KEY_MINUS 0x2d
|
||||
|
||||
#define KEY_RSHIFT (0x80+0x36)
|
||||
#define KEY_RCTRL (0x80+0x1d)
|
||||
#define KEY_RALT (0x80+0x38)
|
||||
|
||||
#define KEY_LALT KEY_RALT
|
||||
|
||||
|
||||
#define KEY_CAPSLOCK (0x80+0x3a)
|
||||
#define KEY_NUMLOCK (0x80+0x45)
|
||||
#define KEY_SCRLCK (0x80+0x46)
|
||||
#define KEY_PRTSCR (0x80+0x59)
|
||||
|
||||
#define KEY_HOME (0x80+0x47)
|
||||
#define KEY_END (0x80+0x4f)
|
||||
#define KEY_PGUP (0x80+0x49)
|
||||
#define KEY_PGDN (0x80+0x51)
|
||||
#define KEY_INS (0x80+0x52)
|
||||
#define KEY_DEL (0x80+0x53)
|
||||
|
||||
#define KEYP_0 0
|
||||
#define KEYP_1 KEY_END
|
||||
#define KEYP_2 KEY_DOWNARROW
|
||||
#define KEYP_3 KEY_PGDN
|
||||
#define KEYP_4 KEY_LEFTARROW
|
||||
#define KEYP_5 '5'
|
||||
#define KEYP_6 KEY_RIGHTARROW
|
||||
#define KEYP_7 KEY_HOME
|
||||
#define KEYP_8 KEY_UPARROW
|
||||
#define KEYP_9 KEY_PGUP
|
||||
|
||||
#define KEYP_DIVIDE '/'
|
||||
#define KEYP_PLUS '+'
|
||||
#define KEYP_MINUS '-'
|
||||
#define KEYP_MULTIPLY '*'
|
||||
#define KEYP_PERIOD 0
|
||||
#define KEYP_EQUALS KEY_EQUALS
|
||||
#define KEYP_ENTER KEY_ENTER
|
||||
|
||||
#endif // __DOOMKEYS__
|
||||
|
||||
35
src/kernel/userland/doom/doomstat.c
Normal file
35
src/kernel/userland/doom/doomstat.c
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Put all global tate variables here.
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "doomstat.h"
|
||||
|
||||
|
||||
// Game Mode - identify IWAD as shareware, retail etc.
|
||||
GameMode_t gamemode = indetermined;
|
||||
GameMission_t gamemission = doom;
|
||||
GameVersion_t gameversion = exe_final2;
|
||||
char *gamedescription;
|
||||
|
||||
// Set if homebrew PWAD stuff has been added.
|
||||
boolean modifiedgame;
|
||||
|
||||
|
||||
|
||||
|
||||
281
src/kernel/userland/doom/doomstat.h
Normal file
281
src/kernel/userland/doom/doomstat.h
Normal file
|
|
@ -0,0 +1,281 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// All the global variables that store the internal state.
|
||||
// Theoretically speaking, the internal state of the engine
|
||||
// should be found by looking at the variables collected
|
||||
// here, and every relevant module will have to include
|
||||
// this header file.
|
||||
// In practice, things are a bit messy.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __D_STATE__
|
||||
#define __D_STATE__
|
||||
|
||||
// We need globally shared data structures,
|
||||
// for defining the global state variables.
|
||||
#include "doomdata.h"
|
||||
#include "d_loop.h"
|
||||
|
||||
// We need the playr data structure as well.
|
||||
#include "d_player.h"
|
||||
|
||||
// Game mode/mission
|
||||
#include "d_mode.h"
|
||||
|
||||
#include "net_defs.h"
|
||||
|
||||
|
||||
|
||||
// ------------------------
|
||||
// Command line parameters.
|
||||
//
|
||||
extern boolean nomonsters; // checkparm of -nomonsters
|
||||
extern boolean respawnparm; // checkparm of -respawn
|
||||
extern boolean fastparm; // checkparm of -fast
|
||||
|
||||
extern boolean devparm; // DEBUG: launched with -devparm
|
||||
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Game Mode - identify IWAD as shareware, retail etc.
|
||||
//
|
||||
extern GameMode_t gamemode;
|
||||
extern GameMission_t gamemission;
|
||||
extern GameVersion_t gameversion;
|
||||
extern char *gamedescription;
|
||||
|
||||
// If true, we're using one of the mangled BFG edition IWADs.
|
||||
extern boolean bfgedition;
|
||||
|
||||
// Convenience macro.
|
||||
// 'gamemission' can be equal to pack_chex or pack_hacx, but these are
|
||||
// just modified versions of doom and doom2, and should be interpreted
|
||||
// as the same most of the time.
|
||||
|
||||
#define logical_gamemission \
|
||||
(gamemission == pack_chex ? doom : \
|
||||
gamemission == pack_hacx ? doom2 : gamemission)
|
||||
|
||||
// Set if homebrew PWAD stuff has been added.
|
||||
extern boolean modifiedgame;
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
// Selected skill type, map etc.
|
||||
//
|
||||
|
||||
// Defaults for menu, methinks.
|
||||
extern skill_t startskill;
|
||||
extern int startepisode;
|
||||
extern int startmap;
|
||||
|
||||
// Savegame slot to load on startup. This is the value provided to
|
||||
// the -loadgame option. If this has not been provided, this is -1.
|
||||
|
||||
extern int startloadgame;
|
||||
|
||||
extern boolean autostart;
|
||||
|
||||
// Selected by user.
|
||||
extern skill_t gameskill;
|
||||
extern int gameepisode;
|
||||
extern int gamemap;
|
||||
|
||||
// If non-zero, exit the level after this number of minutes
|
||||
extern int timelimit;
|
||||
|
||||
// Nightmare mode flag, single player.
|
||||
extern boolean respawnmonsters;
|
||||
|
||||
// Netgame? Only true if >1 player.
|
||||
extern boolean netgame;
|
||||
|
||||
// 0=Cooperative; 1=Deathmatch; 2=Altdeath
|
||||
extern int deathmatch;
|
||||
|
||||
// -------------------------
|
||||
// Internal parameters for sound rendering.
|
||||
// These have been taken from the DOS version,
|
||||
// but are not (yet) supported with Linux
|
||||
// (e.g. no sound volume adjustment with menu.
|
||||
|
||||
// From m_menu.c:
|
||||
// Sound FX volume has default, 0 - 15
|
||||
// Music volume has default, 0 - 15
|
||||
// These are multiplied by 8.
|
||||
extern int sfxVolume;
|
||||
extern int musicVolume;
|
||||
|
||||
// Current music/sfx card - index useless
|
||||
// w/o a reference LUT in a sound module.
|
||||
// Ideally, this would use indices found
|
||||
// in: /usr/include/linux/soundcard.h
|
||||
extern int snd_MusicDevice;
|
||||
extern int snd_SfxDevice;
|
||||
// Config file? Same disclaimer as above.
|
||||
extern int snd_DesiredMusicDevice;
|
||||
extern int snd_DesiredSfxDevice;
|
||||
|
||||
|
||||
// -------------------------
|
||||
// Status flags for refresh.
|
||||
//
|
||||
|
||||
// Depending on view size - no status bar?
|
||||
// Note that there is no way to disable the
|
||||
// status bar explicitely.
|
||||
extern boolean statusbaractive;
|
||||
|
||||
extern boolean automapactive; // In AutoMap mode?
|
||||
extern boolean menuactive; // Menu overlayed?
|
||||
extern boolean paused; // Game Pause?
|
||||
|
||||
|
||||
extern boolean viewactive;
|
||||
|
||||
extern boolean nodrawers;
|
||||
|
||||
|
||||
extern boolean testcontrols;
|
||||
extern int testcontrols_mousespeed;
|
||||
|
||||
|
||||
|
||||
|
||||
// This one is related to the 3-screen display mode.
|
||||
// ANG90 = left side, ANG270 = right
|
||||
extern int viewangleoffset;
|
||||
|
||||
// Player taking events, and displaying.
|
||||
extern int consoleplayer;
|
||||
extern int displayplayer;
|
||||
|
||||
|
||||
// -------------------------------------
|
||||
// Scores, rating.
|
||||
// Statistics on a given map, for intermission.
|
||||
//
|
||||
extern int totalkills;
|
||||
extern int totalitems;
|
||||
extern int totalsecret;
|
||||
|
||||
// Timer, for scores.
|
||||
extern int levelstarttic; // gametic at level start
|
||||
extern int leveltime; // tics in game play for par
|
||||
|
||||
|
||||
|
||||
// --------------------------------------
|
||||
// DEMO playback/recording related stuff.
|
||||
// No demo, there is a human player in charge?
|
||||
// Disable save/end game?
|
||||
extern boolean usergame;
|
||||
|
||||
//?
|
||||
extern boolean demoplayback;
|
||||
extern boolean demorecording;
|
||||
|
||||
// Round angleturn in ticcmds to the nearest 256. This is used when
|
||||
// recording Vanilla demos in netgames.
|
||||
|
||||
extern boolean lowres_turn;
|
||||
|
||||
// Quit after playing a demo from cmdline.
|
||||
extern boolean singledemo;
|
||||
|
||||
|
||||
|
||||
|
||||
//?
|
||||
extern gamestate_t gamestate;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------
|
||||
// Internal parameters, fixed.
|
||||
// These are set by the engine, and not changed
|
||||
// according to user inputs. Partly load from
|
||||
// WAD, partly set at startup time.
|
||||
|
||||
|
||||
|
||||
// Bookkeeping on players - state.
|
||||
extern player_t players[MAXPLAYERS];
|
||||
|
||||
// Alive? Disconnected?
|
||||
extern boolean playeringame[MAXPLAYERS];
|
||||
|
||||
|
||||
// Player spawn spots for deathmatch.
|
||||
#define MAX_DM_STARTS 10
|
||||
extern mapthing_t deathmatchstarts[MAX_DM_STARTS];
|
||||
extern mapthing_t* deathmatch_p;
|
||||
|
||||
// Player spawn spots.
|
||||
extern mapthing_t playerstarts[MAXPLAYERS];
|
||||
|
||||
// Intermission stats.
|
||||
// Parameters for world map / intermission.
|
||||
extern wbstartstruct_t wminfo;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Internal parameters, used for engine.
|
||||
//
|
||||
|
||||
// File handling stuff.
|
||||
extern char * savegamedir;
|
||||
extern char basedefault[1024];
|
||||
|
||||
// if true, load all graphics at level load
|
||||
extern boolean precache;
|
||||
|
||||
|
||||
// wipegamestate can be set to -1
|
||||
// to force a wipe on the next draw
|
||||
extern gamestate_t wipegamestate;
|
||||
|
||||
extern int mouseSensitivity;
|
||||
|
||||
extern int bodyqueslot;
|
||||
|
||||
|
||||
|
||||
// Needed to store the number of the dummy sky flat.
|
||||
// Used for rendering,
|
||||
// as well as tracking projectiles etc.
|
||||
extern int skyflatnum;
|
||||
|
||||
|
||||
|
||||
// Netgame stuff (buffers and pointers, i.e. indices).
|
||||
|
||||
|
||||
extern int rndindex;
|
||||
|
||||
extern ticcmd_t *netcmds;
|
||||
|
||||
|
||||
#endif
|
||||
103
src/kernel/userland/doom/doomtype.h
Normal file
103
src/kernel/userland/doom/doomtype.h
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Simple basic typedefs, isolated here to make it easier
|
||||
// separating modules.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __DOOMTYPE__
|
||||
#define __DOOMTYPE__
|
||||
|
||||
// #define macros to provide functions missing in Windows.
|
||||
// Outside Windows, we use strings.h for str[n]casecmp.
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#define strcasecmp _stricmp
|
||||
#define strncasecmp _strnicmp
|
||||
|
||||
#else
|
||||
|
||||
#include <strings.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// The packed attribute forces structures to be packed into the minimum
|
||||
// space necessary. If this is not done, the compiler may align structure
|
||||
// fields differently to optimize memory access, inflating the overall
|
||||
// structure size. It is important to use the packed attribute on certain
|
||||
// structures where alignment is important, particularly data read/written
|
||||
// to disk.
|
||||
//
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define PACKEDATTR __attribute__((packed))
|
||||
#else
|
||||
#define PACKEDATTR
|
||||
#endif
|
||||
|
||||
// C99 integer types; with gcc we just use this. Other compilers
|
||||
// should add conditional statements that define the C99 types.
|
||||
|
||||
// What is really wanted here is stdint.h; however, some old versions
|
||||
// of Solaris don't have stdint.h and only have inttypes.h (the
|
||||
// pre-standardisation version). inttypes.h is also in the C99
|
||||
// standard and defined to include stdint.h, so include this.
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
// Use builtin bool type with C++.
|
||||
|
||||
typedef bool boolean;
|
||||
|
||||
#else
|
||||
|
||||
typedef enum
|
||||
{
|
||||
false = 0,
|
||||
true = 1,
|
||||
undef = 0xFFFFFFFF
|
||||
} boolean;
|
||||
|
||||
#endif
|
||||
|
||||
typedef uint8_t byte;
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#if defined(_WIN32) || defined(__DJGPP__)
|
||||
|
||||
#define DIR_SEPARATOR '\\'
|
||||
#define DIR_SEPARATOR_S "\\"
|
||||
#define PATH_SEPARATOR ';'
|
||||
|
||||
#else
|
||||
|
||||
#define DIR_SEPARATOR '/'
|
||||
#define DIR_SEPARATOR_S "/"
|
||||
#define PATH_SEPARATOR ':'
|
||||
|
||||
#endif
|
||||
|
||||
#define arrlen(array) (sizeof(array) / sizeof(*array))
|
||||
|
||||
#endif
|
||||
|
||||
73
src/kernel/userland/doom/dstrings.c
Normal file
73
src/kernel/userland/doom/dstrings.c
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Globally defined strings.
|
||||
//
|
||||
|
||||
|
||||
|
||||
#include "dstrings.h"
|
||||
|
||||
char *doom1_endmsg[] =
|
||||
{
|
||||
"are you sure you want to\nquit this great game?",
|
||||
"please don't leave, there's more\ndemons to toast!",
|
||||
"let's beat it -- this is turning\ninto a bloodbath!",
|
||||
"i wouldn't leave if i were you.\ndos is much worse.",
|
||||
"you're trying to say you like dos\nbetter than me, right?",
|
||||
"don't leave yet -- there's a\ndemon around that corner!",
|
||||
"ya know, next time you come in here\ni'm gonna toast ya.",
|
||||
"go ahead and leave. see if i care.",
|
||||
};
|
||||
|
||||
char *doom2_endmsg[] =
|
||||
{
|
||||
// QuitDOOM II messages
|
||||
"are you sure you want to\nquit this great game?",
|
||||
"you want to quit?\nthen, thou hast lost an eighth!",
|
||||
"don't go now, there's a \ndimensional shambler waiting\nat the dos prompt!",
|
||||
"get outta here and go back\nto your boring programs.",
|
||||
"if i were your boss, i'd \n deathmatch ya in a minute!",
|
||||
"look, bud. you leave now\nand you forfeit your body count!",
|
||||
"just leave. when you come\nback, i'll be waiting with a bat.",
|
||||
"you're lucky i don't smack\nyou for thinking about leaving.",
|
||||
};
|
||||
|
||||
#if 0
|
||||
|
||||
// UNUSED messages included in the source release
|
||||
|
||||
char* endmsg[] =
|
||||
{
|
||||
// DOOM1
|
||||
QUITMSG,
|
||||
// FinalDOOM?
|
||||
"fuck you, pussy!\nget the fuck out!",
|
||||
"you quit and i'll jizz\nin your cystholes!",
|
||||
"if you leave, i'll make\nthe lord drink my jizz.",
|
||||
"hey, ron! can we say\n'fuck' in the game?",
|
||||
"i'd leave: this is just\nmore monsters and levels.\nwhat a load.",
|
||||
"suck it down, asshole!\nyou're a fucking wimp!",
|
||||
"don't quit now! we're \nstill spending your money!",
|
||||
|
||||
// Internal debug. Different style, too.
|
||||
"THIS IS NO MESSAGE!\nPage intentionally left blank."
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
41
src/kernel/userland/doom/dstrings.h
Normal file
41
src/kernel/userland/doom/dstrings.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// DOOM strings, by language.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __DSTRINGS__
|
||||
#define __DSTRINGS__
|
||||
|
||||
|
||||
// All important printed strings.
|
||||
|
||||
#include "d_englsh.h"
|
||||
|
||||
// Misc. other strings.
|
||||
#define SAVEGAMENAME "doomsav"
|
||||
|
||||
|
||||
// QuitDOOM messages
|
||||
// 8 per each game type
|
||||
#define NUM_QUITMESSAGES 8
|
||||
|
||||
extern char *doom1_endmsg[];
|
||||
extern char *doom2_endmsg[];
|
||||
|
||||
|
||||
#endif
|
||||
53
src/kernel/userland/doom/dummy.c
Normal file
53
src/kernel/userland/doom/dummy.c
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
* dummy.c
|
||||
*
|
||||
* Created on: 16.02.2015
|
||||
* Author: Florian
|
||||
*/
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* include files *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* local definitions *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* external declarations *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* public data *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
boolean net_client_connected = false;
|
||||
|
||||
boolean drone = false;
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* private data *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* private functions *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* public functions *
|
||||
*---------------------------------------------------------------------*/
|
||||
|
||||
#ifndef FEATURE_SOUND
|
||||
|
||||
void I_InitTimidityConfig(void)
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------*
|
||||
* eof *
|
||||
*---------------------------------------------------------------------*/
|
||||
2
src/kernel/userland/doom/errno.h
Normal file
2
src/kernel/userland/doom/errno.h
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
#include "boredos_libc.h"
|
||||
#define EISDIR 21
|
||||
718
src/kernel/userland/doom/f_finale.c
Normal file
718
src/kernel/userland/doom/f_finale.c
Normal file
|
|
@ -0,0 +1,718 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Game completion, final screen animation.
|
||||
//
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
// Functions.
|
||||
#include "deh_main.h"
|
||||
#include "i_system.h"
|
||||
#include "i_swap.h"
|
||||
#include "z_zone.h"
|
||||
#include "v_video.h"
|
||||
#include "w_wad.h"
|
||||
#include "s_sound.h"
|
||||
|
||||
// Data.
|
||||
#include "d_main.h"
|
||||
#include "dstrings.h"
|
||||
#include "sounds.h"
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "r_state.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
F_STAGE_TEXT,
|
||||
F_STAGE_ARTSCREEN,
|
||||
F_STAGE_CAST,
|
||||
} finalestage_t;
|
||||
|
||||
// ?
|
||||
//#include "doomstat.h"
|
||||
//#include "r_local.h"
|
||||
//#include "f_finale.h"
|
||||
|
||||
// Stage of animation:
|
||||
finalestage_t finalestage;
|
||||
|
||||
unsigned int finalecount;
|
||||
|
||||
#define TEXTSPEED 3
|
||||
#define TEXTWAIT 250
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GameMission_t mission;
|
||||
int episode, level;
|
||||
char *background;
|
||||
char *text;
|
||||
} textscreen_t;
|
||||
|
||||
static textscreen_t textscreens[] =
|
||||
{
|
||||
{ doom, 1, 8, "FLOOR4_8", E1TEXT},
|
||||
{ doom, 2, 8, "SFLR6_1", E2TEXT},
|
||||
{ doom, 3, 8, "MFLR8_4", E3TEXT},
|
||||
{ doom, 4, 8, "MFLR8_3", E4TEXT},
|
||||
|
||||
{ doom2, 1, 6, "SLIME16", C1TEXT},
|
||||
{ doom2, 1, 11, "RROCK14", C2TEXT},
|
||||
{ doom2, 1, 20, "RROCK07", C3TEXT},
|
||||
{ doom2, 1, 30, "RROCK17", C4TEXT},
|
||||
{ doom2, 1, 15, "RROCK13", C5TEXT},
|
||||
{ doom2, 1, 31, "RROCK19", C6TEXT},
|
||||
|
||||
{ pack_tnt, 1, 6, "SLIME16", T1TEXT},
|
||||
{ pack_tnt, 1, 11, "RROCK14", T2TEXT},
|
||||
{ pack_tnt, 1, 20, "RROCK07", T3TEXT},
|
||||
{ pack_tnt, 1, 30, "RROCK17", T4TEXT},
|
||||
{ pack_tnt, 1, 15, "RROCK13", T5TEXT},
|
||||
{ pack_tnt, 1, 31, "RROCK19", T6TEXT},
|
||||
|
||||
{ pack_plut, 1, 6, "SLIME16", P1TEXT},
|
||||
{ pack_plut, 1, 11, "RROCK14", P2TEXT},
|
||||
{ pack_plut, 1, 20, "RROCK07", P3TEXT},
|
||||
{ pack_plut, 1, 30, "RROCK17", P4TEXT},
|
||||
{ pack_plut, 1, 15, "RROCK13", P5TEXT},
|
||||
{ pack_plut, 1, 31, "RROCK19", P6TEXT},
|
||||
};
|
||||
|
||||
char* finaletext;
|
||||
char* finaleflat;
|
||||
|
||||
void F_StartCast (void);
|
||||
void F_CastTicker (void);
|
||||
boolean F_CastResponder (event_t *ev);
|
||||
void F_CastDrawer (void);
|
||||
|
||||
//
|
||||
// F_StartFinale
|
||||
//
|
||||
void F_StartFinale (void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
gameaction = ga_nothing;
|
||||
gamestate = GS_FINALE;
|
||||
viewactive = false;
|
||||
automapactive = false;
|
||||
|
||||
if (logical_gamemission == doom)
|
||||
{
|
||||
S_ChangeMusic(mus_victor, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
S_ChangeMusic(mus_read_m, true);
|
||||
}
|
||||
|
||||
// Find the right screen and set the text and background
|
||||
|
||||
for (i=0; i<arrlen(textscreens); ++i)
|
||||
{
|
||||
textscreen_t *screen = &textscreens[i];
|
||||
|
||||
// Hack for Chex Quest
|
||||
|
||||
if (gameversion == exe_chex && screen->mission == doom)
|
||||
{
|
||||
screen->level = 5;
|
||||
}
|
||||
|
||||
if (logical_gamemission == screen->mission
|
||||
&& (logical_gamemission != doom || gameepisode == screen->episode)
|
||||
&& gamemap == screen->level)
|
||||
{
|
||||
finaletext = screen->text;
|
||||
finaleflat = screen->background;
|
||||
}
|
||||
}
|
||||
|
||||
// Do dehacked substitutions of strings
|
||||
|
||||
finaletext = DEH_String(finaletext);
|
||||
finaleflat = DEH_String(finaleflat);
|
||||
|
||||
finalestage = F_STAGE_TEXT;
|
||||
finalecount = 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
boolean F_Responder (event_t *event)
|
||||
{
|
||||
if (finalestage == F_STAGE_CAST)
|
||||
return F_CastResponder (event);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// F_Ticker
|
||||
//
|
||||
void F_Ticker (void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
// check for skipping
|
||||
if ( (gamemode == commercial)
|
||||
&& ( finalecount > 50) )
|
||||
{
|
||||
// go on to the next level
|
||||
for (i=0 ; i<MAXPLAYERS ; i++)
|
||||
if (players[i].cmd.buttons)
|
||||
break;
|
||||
|
||||
if (i < MAXPLAYERS)
|
||||
{
|
||||
if (gamemap == 30)
|
||||
F_StartCast ();
|
||||
else
|
||||
gameaction = ga_worlddone;
|
||||
}
|
||||
}
|
||||
|
||||
// advance animation
|
||||
finalecount++;
|
||||
|
||||
if (finalestage == F_STAGE_CAST)
|
||||
{
|
||||
F_CastTicker ();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( gamemode == commercial)
|
||||
return;
|
||||
|
||||
if (finalestage == F_STAGE_TEXT
|
||||
&& finalecount>strlen (finaletext)*TEXTSPEED + TEXTWAIT)
|
||||
{
|
||||
finalecount = 0;
|
||||
finalestage = F_STAGE_ARTSCREEN;
|
||||
wipegamestate = -1; // force a wipe
|
||||
if (gameepisode == 3)
|
||||
S_StartMusic (mus_bunny);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// F_TextWrite
|
||||
//
|
||||
|
||||
#include "hu_stuff.h"
|
||||
extern patch_t *hu_font[HU_FONTSIZE];
|
||||
|
||||
|
||||
void F_TextWrite (void)
|
||||
{
|
||||
byte* src;
|
||||
byte* dest;
|
||||
|
||||
int x,y,w;
|
||||
signed int count;
|
||||
char* ch;
|
||||
int c;
|
||||
int cx;
|
||||
int cy;
|
||||
|
||||
// erase the entire screen to a tiled background
|
||||
src = W_CacheLumpName ( finaleflat , PU_CACHE);
|
||||
dest = I_VideoBuffer;
|
||||
|
||||
for (y=0 ; y<SCREENHEIGHT ; y++)
|
||||
{
|
||||
for (x=0 ; x<SCREENWIDTH/64 ; x++)
|
||||
{
|
||||
memcpy (dest, src+((y&63)<<6), 64);
|
||||
dest += 64;
|
||||
}
|
||||
if (SCREENWIDTH&63)
|
||||
{
|
||||
memcpy (dest, src+((y&63)<<6), SCREENWIDTH&63);
|
||||
dest += (SCREENWIDTH&63);
|
||||
}
|
||||
}
|
||||
|
||||
V_MarkRect (0, 0, SCREENWIDTH, SCREENHEIGHT);
|
||||
|
||||
// draw some of the text onto the screen
|
||||
cx = 10;
|
||||
cy = 10;
|
||||
ch = finaletext;
|
||||
|
||||
count = ((signed int) finalecount - 10) / TEXTSPEED;
|
||||
if (count < 0)
|
||||
count = 0;
|
||||
for ( ; count ; count-- )
|
||||
{
|
||||
c = *ch++;
|
||||
if (!c)
|
||||
break;
|
||||
if (c == '\n')
|
||||
{
|
||||
cx = 10;
|
||||
cy += 11;
|
||||
continue;
|
||||
}
|
||||
|
||||
c = toupper(c) - HU_FONTSTART;
|
||||
if (c < 0 || c> HU_FONTSIZE)
|
||||
{
|
||||
cx += 4;
|
||||
continue;
|
||||
}
|
||||
|
||||
w = SHORT (hu_font[c]->width);
|
||||
if (cx+w > SCREENWIDTH)
|
||||
break;
|
||||
V_DrawPatch(cx, cy, hu_font[c]);
|
||||
cx+=w;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// Final DOOM 2 animation
|
||||
// Casting by id Software.
|
||||
// in order of appearance
|
||||
//
|
||||
typedef struct
|
||||
{
|
||||
char *name;
|
||||
mobjtype_t type;
|
||||
} castinfo_t;
|
||||
|
||||
castinfo_t castorder[] = {
|
||||
{CC_ZOMBIE, MT_POSSESSED},
|
||||
{CC_SHOTGUN, MT_SHOTGUY},
|
||||
{CC_HEAVY, MT_CHAINGUY},
|
||||
{CC_IMP, MT_TROOP},
|
||||
{CC_DEMON, MT_SERGEANT},
|
||||
{CC_LOST, MT_SKULL},
|
||||
{CC_CACO, MT_HEAD},
|
||||
{CC_HELL, MT_KNIGHT},
|
||||
{CC_BARON, MT_BRUISER},
|
||||
{CC_ARACH, MT_BABY},
|
||||
{CC_PAIN, MT_PAIN},
|
||||
{CC_REVEN, MT_UNDEAD},
|
||||
{CC_MANCU, MT_FATSO},
|
||||
{CC_ARCH, MT_VILE},
|
||||
{CC_SPIDER, MT_SPIDER},
|
||||
{CC_CYBER, MT_CYBORG},
|
||||
{CC_HERO, MT_PLAYER},
|
||||
|
||||
{NULL,0}
|
||||
};
|
||||
|
||||
int castnum;
|
||||
int casttics;
|
||||
state_t* caststate;
|
||||
boolean castdeath;
|
||||
int castframes;
|
||||
int castonmelee;
|
||||
boolean castattacking;
|
||||
|
||||
|
||||
//
|
||||
// F_StartCast
|
||||
//
|
||||
void F_StartCast (void)
|
||||
{
|
||||
wipegamestate = -1; // force a screen wipe
|
||||
castnum = 0;
|
||||
caststate = &states[mobjinfo[castorder[castnum].type].seestate];
|
||||
casttics = caststate->tics;
|
||||
castdeath = false;
|
||||
finalestage = F_STAGE_CAST;
|
||||
castframes = 0;
|
||||
castonmelee = 0;
|
||||
castattacking = false;
|
||||
S_ChangeMusic(mus_evil, true);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// F_CastTicker
|
||||
//
|
||||
void F_CastTicker (void)
|
||||
{
|
||||
int st;
|
||||
int sfx;
|
||||
|
||||
if (--casttics > 0)
|
||||
return; // not time to change state yet
|
||||
|
||||
if (caststate->tics == -1 || caststate->nextstate == S_NULL)
|
||||
{
|
||||
// switch from deathstate to next monster
|
||||
castnum++;
|
||||
castdeath = false;
|
||||
if (castorder[castnum].name == NULL)
|
||||
castnum = 0;
|
||||
if (mobjinfo[castorder[castnum].type].seesound)
|
||||
S_StartSound (NULL, mobjinfo[castorder[castnum].type].seesound);
|
||||
caststate = &states[mobjinfo[castorder[castnum].type].seestate];
|
||||
castframes = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// just advance to next state in animation
|
||||
if (caststate == &states[S_PLAY_ATK1])
|
||||
goto stopattack; // Oh, gross hack!
|
||||
st = caststate->nextstate;
|
||||
caststate = &states[st];
|
||||
castframes++;
|
||||
|
||||
// sound hacks....
|
||||
switch (st)
|
||||
{
|
||||
case S_PLAY_ATK1: sfx = sfx_dshtgn; break;
|
||||
case S_POSS_ATK2: sfx = sfx_pistol; break;
|
||||
case S_SPOS_ATK2: sfx = sfx_shotgn; break;
|
||||
case S_VILE_ATK2: sfx = sfx_vilatk; break;
|
||||
case S_SKEL_FIST2: sfx = sfx_skeswg; break;
|
||||
case S_SKEL_FIST4: sfx = sfx_skepch; break;
|
||||
case S_SKEL_MISS2: sfx = sfx_skeatk; break;
|
||||
case S_FATT_ATK8:
|
||||
case S_FATT_ATK5:
|
||||
case S_FATT_ATK2: sfx = sfx_firsht; break;
|
||||
case S_CPOS_ATK2:
|
||||
case S_CPOS_ATK3:
|
||||
case S_CPOS_ATK4: sfx = sfx_shotgn; break;
|
||||
case S_TROO_ATK3: sfx = sfx_claw; break;
|
||||
case S_SARG_ATK2: sfx = sfx_sgtatk; break;
|
||||
case S_BOSS_ATK2:
|
||||
case S_BOS2_ATK2:
|
||||
case S_HEAD_ATK2: sfx = sfx_firsht; break;
|
||||
case S_SKULL_ATK2: sfx = sfx_sklatk; break;
|
||||
case S_SPID_ATK2:
|
||||
case S_SPID_ATK3: sfx = sfx_shotgn; break;
|
||||
case S_BSPI_ATK2: sfx = sfx_plasma; break;
|
||||
case S_CYBER_ATK2:
|
||||
case S_CYBER_ATK4:
|
||||
case S_CYBER_ATK6: sfx = sfx_rlaunc; break;
|
||||
case S_PAIN_ATK3: sfx = sfx_sklatk; break;
|
||||
default: sfx = 0; break;
|
||||
}
|
||||
|
||||
if (sfx)
|
||||
S_StartSound (NULL, sfx);
|
||||
}
|
||||
|
||||
if (castframes == 12)
|
||||
{
|
||||
// go into attack frame
|
||||
castattacking = true;
|
||||
if (castonmelee)
|
||||
caststate=&states[mobjinfo[castorder[castnum].type].meleestate];
|
||||
else
|
||||
caststate=&states[mobjinfo[castorder[castnum].type].missilestate];
|
||||
castonmelee ^= 1;
|
||||
if (caststate == &states[S_NULL])
|
||||
{
|
||||
if (castonmelee)
|
||||
caststate=
|
||||
&states[mobjinfo[castorder[castnum].type].meleestate];
|
||||
else
|
||||
caststate=
|
||||
&states[mobjinfo[castorder[castnum].type].missilestate];
|
||||
}
|
||||
}
|
||||
|
||||
if (castattacking)
|
||||
{
|
||||
if (castframes == 24
|
||||
|| caststate == &states[mobjinfo[castorder[castnum].type].seestate] )
|
||||
{
|
||||
stopattack:
|
||||
castattacking = false;
|
||||
castframes = 0;
|
||||
caststate = &states[mobjinfo[castorder[castnum].type].seestate];
|
||||
}
|
||||
}
|
||||
|
||||
casttics = caststate->tics;
|
||||
if (casttics == -1)
|
||||
casttics = 15;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// F_CastResponder
|
||||
//
|
||||
|
||||
boolean F_CastResponder (event_t* ev)
|
||||
{
|
||||
if (ev->type != ev_keydown)
|
||||
return false;
|
||||
|
||||
if (castdeath)
|
||||
return true; // already in dying frames
|
||||
|
||||
// go into death frame
|
||||
castdeath = true;
|
||||
caststate = &states[mobjinfo[castorder[castnum].type].deathstate];
|
||||
casttics = caststate->tics;
|
||||
castframes = 0;
|
||||
castattacking = false;
|
||||
if (mobjinfo[castorder[castnum].type].deathsound)
|
||||
S_StartSound (NULL, mobjinfo[castorder[castnum].type].deathsound);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
void F_CastPrint (char* text)
|
||||
{
|
||||
char* ch;
|
||||
int c;
|
||||
int cx;
|
||||
int w;
|
||||
int width;
|
||||
|
||||
// find width
|
||||
ch = text;
|
||||
width = 0;
|
||||
|
||||
while (ch)
|
||||
{
|
||||
c = *ch++;
|
||||
if (!c)
|
||||
break;
|
||||
c = toupper(c) - HU_FONTSTART;
|
||||
if (c < 0 || c> HU_FONTSIZE)
|
||||
{
|
||||
width += 4;
|
||||
continue;
|
||||
}
|
||||
|
||||
w = SHORT (hu_font[c]->width);
|
||||
width += w;
|
||||
}
|
||||
|
||||
// draw it
|
||||
cx = 160-width/2;
|
||||
ch = text;
|
||||
while (ch)
|
||||
{
|
||||
c = *ch++;
|
||||
if (!c)
|
||||
break;
|
||||
c = toupper(c) - HU_FONTSTART;
|
||||
if (c < 0 || c> HU_FONTSIZE)
|
||||
{
|
||||
cx += 4;
|
||||
continue;
|
||||
}
|
||||
|
||||
w = SHORT (hu_font[c]->width);
|
||||
V_DrawPatch(cx, 180, hu_font[c]);
|
||||
cx+=w;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// F_CastDrawer
|
||||
//
|
||||
|
||||
void F_CastDrawer (void)
|
||||
{
|
||||
spritedef_t* sprdef;
|
||||
spriteframe_t* sprframe;
|
||||
int lump;
|
||||
boolean flip;
|
||||
patch_t* patch;
|
||||
|
||||
// erase the entire screen to a background
|
||||
V_DrawPatch (0, 0, W_CacheLumpName (DEH_String("BOSSBACK"), PU_CACHE));
|
||||
|
||||
F_CastPrint (DEH_String(castorder[castnum].name));
|
||||
|
||||
// draw the current frame in the middle of the screen
|
||||
sprdef = &sprites[caststate->sprite];
|
||||
sprframe = &sprdef->spriteframes[ caststate->frame & FF_FRAMEMASK];
|
||||
lump = sprframe->lump[0];
|
||||
flip = (boolean)sprframe->flip[0];
|
||||
|
||||
patch = W_CacheLumpNum (lump+firstspritelump, PU_CACHE);
|
||||
if (flip)
|
||||
V_DrawPatchFlipped(160, 170, patch);
|
||||
else
|
||||
V_DrawPatch(160, 170, patch);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// F_DrawPatchCol
|
||||
//
|
||||
void
|
||||
F_DrawPatchCol
|
||||
( int x,
|
||||
patch_t* patch,
|
||||
int col )
|
||||
{
|
||||
column_t* column;
|
||||
byte* source;
|
||||
byte* dest;
|
||||
byte* desttop;
|
||||
int count;
|
||||
|
||||
column = (column_t *)((byte *)patch + LONG(patch->columnofs[col]));
|
||||
desttop = I_VideoBuffer + x;
|
||||
|
||||
// step through the posts in a column
|
||||
while (column->topdelta != 0xff )
|
||||
{
|
||||
source = (byte *)column + 3;
|
||||
dest = desttop + column->topdelta*SCREENWIDTH;
|
||||
count = column->length;
|
||||
|
||||
while (count--)
|
||||
{
|
||||
*dest = *source++;
|
||||
dest += SCREENWIDTH;
|
||||
}
|
||||
column = (column_t *)( (byte *)column + column->length + 4 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// F_BunnyScroll
|
||||
//
|
||||
void F_BunnyScroll (void)
|
||||
{
|
||||
signed int scrolled;
|
||||
int x;
|
||||
patch_t* p1;
|
||||
patch_t* p2;
|
||||
char name[10];
|
||||
int stage;
|
||||
static int laststage;
|
||||
|
||||
p1 = W_CacheLumpName (DEH_String("PFUB2"), PU_LEVEL);
|
||||
p2 = W_CacheLumpName (DEH_String("PFUB1"), PU_LEVEL);
|
||||
|
||||
V_MarkRect (0, 0, SCREENWIDTH, SCREENHEIGHT);
|
||||
|
||||
scrolled = (320 - ((signed int) finalecount-230)/2);
|
||||
if (scrolled > 320)
|
||||
scrolled = 320;
|
||||
if (scrolled < 0)
|
||||
scrolled = 0;
|
||||
|
||||
for ( x=0 ; x<SCREENWIDTH ; x++)
|
||||
{
|
||||
if (x+scrolled < 320)
|
||||
F_DrawPatchCol (x, p1, x+scrolled);
|
||||
else
|
||||
F_DrawPatchCol (x, p2, x+scrolled - 320);
|
||||
}
|
||||
|
||||
if (finalecount < 1130)
|
||||
return;
|
||||
if (finalecount < 1180)
|
||||
{
|
||||
V_DrawPatch((SCREENWIDTH - 13 * 8) / 2,
|
||||
(SCREENHEIGHT - 8 * 8) / 2,
|
||||
W_CacheLumpName(DEH_String("END0"), PU_CACHE));
|
||||
laststage = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
stage = (finalecount-1180) / 5;
|
||||
if (stage > 6)
|
||||
stage = 6;
|
||||
if (stage > laststage)
|
||||
{
|
||||
S_StartSound (NULL, sfx_pistol);
|
||||
laststage = stage;
|
||||
}
|
||||
|
||||
DEH_snprintf(name, 10, "END%i", stage);
|
||||
V_DrawPatch((SCREENWIDTH - 13 * 8) / 2,
|
||||
(SCREENHEIGHT - 8 * 8) / 2,
|
||||
W_CacheLumpName (name,PU_CACHE));
|
||||
}
|
||||
|
||||
static void F_ArtScreenDrawer(void)
|
||||
{
|
||||
char *lumpname;
|
||||
|
||||
if (gameepisode == 3)
|
||||
{
|
||||
F_BunnyScroll();
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (gameepisode)
|
||||
{
|
||||
case 1:
|
||||
if (gamemode == retail)
|
||||
{
|
||||
lumpname = "CREDIT";
|
||||
}
|
||||
else
|
||||
{
|
||||
lumpname = "HELP2";
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
lumpname = "VICTORY2";
|
||||
break;
|
||||
case 4:
|
||||
lumpname = "ENDPIC";
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
lumpname = DEH_String(lumpname);
|
||||
|
||||
V_DrawPatch (0, 0, W_CacheLumpName(lumpname, PU_CACHE));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// F_Drawer
|
||||
//
|
||||
void F_Drawer (void)
|
||||
{
|
||||
switch (finalestage)
|
||||
{
|
||||
case F_STAGE_CAST:
|
||||
F_CastDrawer();
|
||||
break;
|
||||
case F_STAGE_TEXT:
|
||||
F_TextWrite();
|
||||
break;
|
||||
case F_STAGE_ARTSCREEN:
|
||||
F_ArtScreenDrawer();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
45
src/kernel/userland/doom/f_finale.h
Normal file
45
src/kernel/userland/doom/f_finale.h
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
//
|
||||
//
|
||||
|
||||
|
||||
#ifndef __F_FINALE__
|
||||
#define __F_FINALE__
|
||||
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "d_event.h"
|
||||
//
|
||||
// FINALE
|
||||
//
|
||||
|
||||
// Called by main loop.
|
||||
boolean F_Responder (event_t* ev);
|
||||
|
||||
// Called by main loop.
|
||||
void F_Ticker (void);
|
||||
|
||||
// Called by main loop.
|
||||
void F_Drawer (void);
|
||||
|
||||
|
||||
void F_StartFinale (void);
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
294
src/kernel/userland/doom/f_wipe.c
Normal file
294
src/kernel/userland/doom/f_wipe.c
Normal file
|
|
@ -0,0 +1,294 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Mission begin melt/wipe screen special effect.
|
||||
//
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "z_zone.h"
|
||||
#include "i_video.h"
|
||||
#include "v_video.h"
|
||||
#include "m_random.h"
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
#include "f_wipe.h"
|
||||
|
||||
//
|
||||
// SCREEN WIPE PACKAGE
|
||||
//
|
||||
|
||||
// when zero, stop the wipe
|
||||
static boolean go = 0;
|
||||
|
||||
static byte* wipe_scr_start;
|
||||
static byte* wipe_scr_end;
|
||||
static byte* wipe_scr;
|
||||
|
||||
|
||||
void
|
||||
wipe_shittyColMajorXform
|
||||
( short* array,
|
||||
int width,
|
||||
int height )
|
||||
{
|
||||
int x;
|
||||
int y;
|
||||
short* dest;
|
||||
|
||||
dest = (short*) Z_Malloc(width*height*2, PU_STATIC, 0);
|
||||
|
||||
for(y=0;y<height;y++)
|
||||
for(x=0;x<width;x++)
|
||||
dest[x*height+y] = array[y*width+x];
|
||||
|
||||
memcpy(array, dest, width*height*2);
|
||||
|
||||
Z_Free(dest);
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
wipe_initColorXForm
|
||||
( int width,
|
||||
int height,
|
||||
int ticks )
|
||||
{
|
||||
memcpy(wipe_scr, wipe_scr_start, width*height);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
wipe_doColorXForm
|
||||
( int width,
|
||||
int height,
|
||||
int ticks )
|
||||
{
|
||||
boolean changed;
|
||||
byte* w;
|
||||
byte* e;
|
||||
int newval;
|
||||
|
||||
changed = false;
|
||||
w = wipe_scr;
|
||||
e = wipe_scr_end;
|
||||
|
||||
while (w!=wipe_scr+width*height)
|
||||
{
|
||||
if (*w != *e)
|
||||
{
|
||||
if (*w > *e)
|
||||
{
|
||||
newval = *w - ticks;
|
||||
if (newval < *e)
|
||||
*w = *e;
|
||||
else
|
||||
*w = newval;
|
||||
changed = true;
|
||||
}
|
||||
else if (*w < *e)
|
||||
{
|
||||
newval = *w + ticks;
|
||||
if (newval > *e)
|
||||
*w = *e;
|
||||
else
|
||||
*w = newval;
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
w++;
|
||||
e++;
|
||||
}
|
||||
|
||||
return !changed;
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
wipe_exitColorXForm
|
||||
( int width,
|
||||
int height,
|
||||
int ticks )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int* y;
|
||||
|
||||
int
|
||||
wipe_initMelt
|
||||
( int width,
|
||||
int height,
|
||||
int ticks )
|
||||
{
|
||||
int i, r;
|
||||
|
||||
// copy start screen to main screen
|
||||
memcpy(wipe_scr, wipe_scr_start, width*height);
|
||||
|
||||
// makes this wipe faster (in theory)
|
||||
// to have stuff in column-major format
|
||||
wipe_shittyColMajorXform((short*)wipe_scr_start, width/2, height);
|
||||
wipe_shittyColMajorXform((short*)wipe_scr_end, width/2, height);
|
||||
|
||||
// setup initial column positions
|
||||
// (y<0 => not ready to scroll yet)
|
||||
y = (int *) Z_Malloc(width*sizeof(int), PU_STATIC, 0);
|
||||
y[0] = -(M_Random()%16);
|
||||
for (i=1;i<width;i++)
|
||||
{
|
||||
r = (M_Random()%3) - 1;
|
||||
y[i] = y[i-1] + r;
|
||||
if (y[i] > 0) y[i] = 0;
|
||||
else if (y[i] == -16) y[i] = -15;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
wipe_doMelt
|
||||
( int width,
|
||||
int height,
|
||||
int ticks )
|
||||
{
|
||||
int i;
|
||||
int j;
|
||||
int dy;
|
||||
int idx;
|
||||
|
||||
short* s;
|
||||
short* d;
|
||||
boolean done = true;
|
||||
|
||||
width/=2;
|
||||
|
||||
while (ticks--)
|
||||
{
|
||||
for (i=0;i<width;i++)
|
||||
{
|
||||
if (y[i]<0)
|
||||
{
|
||||
y[i]++; done = false;
|
||||
}
|
||||
else if (y[i] < height)
|
||||
{
|
||||
dy = (y[i] < 16) ? y[i]+1 : 8;
|
||||
if (y[i]+dy >= height) dy = height - y[i];
|
||||
s = &((short *)wipe_scr_end)[i*height+y[i]];
|
||||
d = &((short *)wipe_scr)[y[i]*width+i];
|
||||
idx = 0;
|
||||
for (j=dy;j;j--)
|
||||
{
|
||||
d[idx] = *(s++);
|
||||
idx += width;
|
||||
}
|
||||
y[i] += dy;
|
||||
s = &((short *)wipe_scr_start)[i*height];
|
||||
d = &((short *)wipe_scr)[y[i]*width+i];
|
||||
idx = 0;
|
||||
for (j=height-y[i];j;j--)
|
||||
{
|
||||
d[idx] = *(s++);
|
||||
idx += width;
|
||||
}
|
||||
done = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return done;
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
wipe_exitMelt
|
||||
( int width,
|
||||
int height,
|
||||
int ticks )
|
||||
{
|
||||
Z_Free(y);
|
||||
Z_Free(wipe_scr_start);
|
||||
Z_Free(wipe_scr_end);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
wipe_StartScreen
|
||||
( int x,
|
||||
int y,
|
||||
int width,
|
||||
int height )
|
||||
{
|
||||
wipe_scr_start = Z_Malloc(SCREENWIDTH * SCREENHEIGHT, PU_STATIC, NULL);
|
||||
I_ReadScreen(wipe_scr_start);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
wipe_EndScreen
|
||||
( int x,
|
||||
int y,
|
||||
int width,
|
||||
int height )
|
||||
{
|
||||
wipe_scr_end = Z_Malloc(SCREENWIDTH * SCREENHEIGHT, PU_STATIC, NULL);
|
||||
I_ReadScreen(wipe_scr_end);
|
||||
V_DrawBlock(x, y, width, height, wipe_scr_start); // restore start scr.
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
wipe_ScreenWipe
|
||||
( int wipeno,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
int ticks )
|
||||
{
|
||||
int rc;
|
||||
static int (*wipes[])(int, int, int) =
|
||||
{
|
||||
wipe_initColorXForm, wipe_doColorXForm, wipe_exitColorXForm,
|
||||
wipe_initMelt, wipe_doMelt, wipe_exitMelt
|
||||
};
|
||||
|
||||
// initial stuff
|
||||
if (!go)
|
||||
{
|
||||
go = 1;
|
||||
// wipe_scr = (byte *) Z_Malloc(width*height, PU_STATIC, 0); // DEBUG
|
||||
wipe_scr = I_VideoBuffer;
|
||||
(*wipes[wipeno*3])(width, height, ticks);
|
||||
}
|
||||
|
||||
// do a piece of wipe-in
|
||||
V_MarkRect(0, 0, width, height);
|
||||
rc = (*wipes[wipeno*3+1])(width, height, ticks);
|
||||
// V_DrawBlock(x, y, 0, width, height, wipe_scr); // DEBUG
|
||||
|
||||
// final stuff
|
||||
if (rc)
|
||||
{
|
||||
go = 0;
|
||||
(*wipes[wipeno*3+2])(width, height, ticks);
|
||||
}
|
||||
|
||||
return !go;
|
||||
}
|
||||
|
||||
63
src/kernel/userland/doom/f_wipe.h
Normal file
63
src/kernel/userland/doom/f_wipe.h
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Mission start screen wipe/melt, special effects.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __F_WIPE_H__
|
||||
#define __F_WIPE_H__
|
||||
|
||||
//
|
||||
// SCREEN WIPE PACKAGE
|
||||
//
|
||||
|
||||
enum
|
||||
{
|
||||
// simple gradual pixel change for 8-bit only
|
||||
wipe_ColorXForm,
|
||||
|
||||
// weird screen melt
|
||||
wipe_Melt,
|
||||
|
||||
wipe_NUMWIPES
|
||||
};
|
||||
|
||||
int
|
||||
wipe_StartScreen
|
||||
( int x,
|
||||
int y,
|
||||
int width,
|
||||
int height );
|
||||
|
||||
|
||||
int
|
||||
wipe_EndScreen
|
||||
( int x,
|
||||
int y,
|
||||
int width,
|
||||
int height );
|
||||
|
||||
|
||||
int
|
||||
wipe_ScreenWipe
|
||||
( int wipeno,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
int height,
|
||||
int ticks );
|
||||
|
||||
#endif
|
||||
1
src/kernel/userland/doom/fcntl.h
Normal file
1
src/kernel/userland/doom/fcntl.h
Normal file
|
|
@ -0,0 +1 @@
|
|||
#include "boredos_libc.h"
|
||||
2302
src/kernel/userland/doom/g_game.c
Normal file
2302
src/kernel/userland/doom/g_game.c
Normal file
File diff suppressed because it is too large
Load diff
80
src/kernel/userland/doom/g_game.h
Normal file
80
src/kernel/userland/doom/g_game.h
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Duh.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __G_GAME__
|
||||
#define __G_GAME__
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "d_event.h"
|
||||
#include "d_ticcmd.h"
|
||||
|
||||
|
||||
//
|
||||
// GAME
|
||||
//
|
||||
void G_DeathMatchSpawnPlayer (int playernum);
|
||||
|
||||
void G_InitNew (skill_t skill, int episode, int map);
|
||||
|
||||
// Can be called by the startup code or M_Responder.
|
||||
// A normal game starts at map 1,
|
||||
// but a warp test can start elsewhere
|
||||
void G_DeferedInitNew (skill_t skill, int episode, int map);
|
||||
|
||||
void G_DeferedPlayDemo (char* demo);
|
||||
|
||||
// Can be called by the startup code or M_Responder,
|
||||
// calls P_SetupLevel or W_EnterWorld.
|
||||
void G_LoadGame (char* name);
|
||||
|
||||
void G_DoLoadGame (void);
|
||||
|
||||
// Called by M_Responder.
|
||||
void G_SaveGame (int slot, char* description);
|
||||
|
||||
// Only called by startup code.
|
||||
void G_RecordDemo (char* name);
|
||||
|
||||
void G_BeginRecording (void);
|
||||
|
||||
void G_PlayDemo (char* name);
|
||||
void G_TimeDemo (char* name);
|
||||
boolean G_CheckDemoStatus (void);
|
||||
|
||||
void G_ExitLevel (void);
|
||||
void G_SecretExitLevel (void);
|
||||
|
||||
void G_WorldDone (void);
|
||||
|
||||
// Read current data from inputs and build a player movement command.
|
||||
|
||||
void G_BuildTiccmd (ticcmd_t *cmd, int maketic);
|
||||
|
||||
void G_Ticker (void);
|
||||
boolean G_Responder (event_t* ev);
|
||||
|
||||
void G_ScreenShot (void);
|
||||
|
||||
void G_DrawMouseSpeedBox(void);
|
||||
int G_VanillaVersionCode(void);
|
||||
|
||||
extern int vanilla_savegame_limit;
|
||||
extern int vanilla_demo_limit;
|
||||
#endif
|
||||
|
||||
271
src/kernel/userland/doom/gusconf.c
Normal file
271
src/kernel/userland/doom/gusconf.c
Normal file
|
|
@ -0,0 +1,271 @@
|
|||
//
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// GUS emulation code.
|
||||
//
|
||||
// Actually emulating a GUS is far too much work; fortunately
|
||||
// GUS "emulation" already exists in the form of Timidity, which
|
||||
// supports GUS patch files. This code therefore converts Doom's
|
||||
// DMXGUS lump into an equivalent Timidity configuration file.
|
||||
//
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "w_wad.h"
|
||||
#include "z_zone.h"
|
||||
|
||||
#define MAX_INSTRUMENTS 256
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *patch_names[MAX_INSTRUMENTS];
|
||||
int mapping[MAX_INSTRUMENTS];
|
||||
} gus_config_t;
|
||||
|
||||
char *gus_patch_path = "";
|
||||
unsigned int gus_ram_kb = 1024;
|
||||
|
||||
static unsigned int MappingIndex(void)
|
||||
{
|
||||
unsigned int result = gus_ram_kb / 256;
|
||||
|
||||
if (result < 1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else if (result > 4)
|
||||
{
|
||||
return 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
static int SplitLine(char *line, char **fields, unsigned int max_fields)
|
||||
{
|
||||
unsigned int num_fields;
|
||||
char *p;
|
||||
|
||||
fields[0] = line;
|
||||
num_fields = 1;
|
||||
|
||||
for (p = line; *p != '\0'; ++p)
|
||||
{
|
||||
if (*p == ',')
|
||||
{
|
||||
*p = '\0';
|
||||
|
||||
// Skip spaces following the comma.
|
||||
do
|
||||
{
|
||||
++p;
|
||||
} while (*p != '\0' && isspace(*p));
|
||||
|
||||
fields[num_fields] = p;
|
||||
++num_fields;
|
||||
--p;
|
||||
|
||||
if (num_fields >= max_fields)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (*p == '#')
|
||||
{
|
||||
*p = '\0';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Strip off trailing whitespace from the end of the line.
|
||||
p = fields[num_fields - 1] + strlen(fields[num_fields - 1]);
|
||||
while (p > fields[num_fields - 1] && isspace(*(p - 1)))
|
||||
{
|
||||
--p;
|
||||
*p = '\0';
|
||||
}
|
||||
|
||||
return num_fields;
|
||||
}
|
||||
|
||||
static void ParseLine(gus_config_t *config, char *line)
|
||||
{
|
||||
char *fields[6];
|
||||
unsigned int num_fields;
|
||||
unsigned int instr_id, mapped_id;
|
||||
|
||||
num_fields = SplitLine(line, fields, 6);
|
||||
|
||||
if (num_fields < 6)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
instr_id = atoi(fields[0]);
|
||||
mapped_id = atoi(fields[MappingIndex()]);
|
||||
|
||||
free(config->patch_names[instr_id]);
|
||||
config->patch_names[instr_id] = strdup(fields[5]);
|
||||
config->mapping[instr_id] = mapped_id;
|
||||
}
|
||||
|
||||
static void ParseDMXConfig(char *dmxconf, gus_config_t *config)
|
||||
{
|
||||
char *p, *newline;
|
||||
unsigned int i;
|
||||
|
||||
memset(config, 0, sizeof(gus_config_t));
|
||||
|
||||
for (i = 0; i < MAX_INSTRUMENTS; ++i)
|
||||
{
|
||||
config->mapping[i] = -1;
|
||||
}
|
||||
|
||||
p = dmxconf;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
newline = strchr(p, '\n');
|
||||
|
||||
if (newline != NULL)
|
||||
{
|
||||
*newline = '\0';
|
||||
}
|
||||
|
||||
ParseLine(config, p);
|
||||
|
||||
if (newline == NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
p = newline + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void FreeDMXConfig(gus_config_t *config)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < MAX_INSTRUMENTS; ++i)
|
||||
{
|
||||
free(config->patch_names[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static char *ReadDMXConfig(void)
|
||||
{
|
||||
int lumpnum;
|
||||
unsigned int len;
|
||||
char *data;
|
||||
|
||||
// TODO: This should be chosen based on gamemode == commercial:
|
||||
|
||||
lumpnum = W_CheckNumForName("DMXGUS");
|
||||
|
||||
if (lumpnum < 0)
|
||||
{
|
||||
lumpnum = W_GetNumForName("DMXGUSC");
|
||||
}
|
||||
|
||||
len = W_LumpLength(lumpnum);
|
||||
data = Z_Malloc(len + 1, PU_STATIC, NULL);
|
||||
W_ReadLump(lumpnum, data);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
static boolean WriteTimidityConfig(char *path, gus_config_t *config)
|
||||
{
|
||||
FILE *fstream;
|
||||
unsigned int i;
|
||||
|
||||
fstream = fopen(path, "w");
|
||||
|
||||
if (fstream == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
fprintf(fstream, "# Autogenerated Timidity config.\n\n");
|
||||
|
||||
fprintf(fstream, "dir %s\n", gus_patch_path);
|
||||
|
||||
fprintf(fstream, "\nbank 0\n\n");
|
||||
|
||||
for (i = 0; i < 128; ++i)
|
||||
{
|
||||
if (config->mapping[i] >= 0 && config->mapping[i] < MAX_INSTRUMENTS
|
||||
&& config->patch_names[config->mapping[i]] != NULL)
|
||||
{
|
||||
fprintf(fstream, "%i %s\n",
|
||||
i, config->patch_names[config->mapping[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fstream, "\ndrumset 0\n\n");
|
||||
|
||||
for (i = 128 + 25; i < MAX_INSTRUMENTS; ++i)
|
||||
{
|
||||
if (config->mapping[i] >= 0 && config->mapping[i] < MAX_INSTRUMENTS
|
||||
&& config->patch_names[config->mapping[i]] != NULL)
|
||||
{
|
||||
fprintf(fstream, "%i %s\n",
|
||||
i - 128, config->patch_names[config->mapping[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(fstream, "\n");
|
||||
|
||||
fclose(fstream);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean GUS_WriteConfig(char *path)
|
||||
{
|
||||
boolean result;
|
||||
char *dmxconf;
|
||||
gus_config_t config;
|
||||
|
||||
if (!strcmp(gus_patch_path, ""))
|
||||
{
|
||||
printf("You haven't configured gus_patch_path.\n");
|
||||
printf("gus_patch_path needs to point to the location of "
|
||||
"your GUS patch set.\n"
|
||||
"To get a copy of the \"standard\" GUS patches, "
|
||||
"download a copy of dgguspat.zip.\n");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
dmxconf = ReadDMXConfig();
|
||||
ParseDMXConfig(dmxconf, &config);
|
||||
|
||||
result = WriteTimidityConfig(path, &config);
|
||||
|
||||
FreeDMXConfig(&config);
|
||||
Z_Free(dmxconf);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
29
src/kernel/userland/doom/gusconf.h
Normal file
29
src/kernel/userland/doom/gusconf.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// GUS emulation code.
|
||||
//
|
||||
|
||||
#ifndef __GUSCONF_H__
|
||||
#define __GUSCONF_H__
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
extern char *gus_patch_path;
|
||||
extern unsigned int gus_ram_kb;
|
||||
|
||||
boolean GUS_WriteConfig(char *path);
|
||||
|
||||
#endif /* #ifndef __GUSCONF_H__ */
|
||||
|
||||
347
src/kernel/userland/doom/hu_lib.c
Normal file
347
src/kernel/userland/doom/hu_lib.c
Normal file
|
|
@ -0,0 +1,347 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION: heads-up text and input code
|
||||
//
|
||||
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "doomkeys.h"
|
||||
|
||||
#include "v_video.h"
|
||||
#include "i_swap.h"
|
||||
|
||||
#include "hu_lib.h"
|
||||
#include "r_local.h"
|
||||
#include "r_draw.h"
|
||||
|
||||
// boolean : whether the screen is always erased
|
||||
#define noterased viewwindowx
|
||||
|
||||
extern boolean automapactive; // in AM_map.c
|
||||
|
||||
void HUlib_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
void HUlib_clearTextLine(hu_textline_t* t)
|
||||
{
|
||||
t->len = 0;
|
||||
t->l[0] = 0;
|
||||
t->needsupdate = true;
|
||||
}
|
||||
|
||||
void
|
||||
HUlib_initTextLine
|
||||
( hu_textline_t* t,
|
||||
int x,
|
||||
int y,
|
||||
patch_t** f,
|
||||
int sc )
|
||||
{
|
||||
t->x = x;
|
||||
t->y = y;
|
||||
t->f = f;
|
||||
t->sc = sc;
|
||||
HUlib_clearTextLine(t);
|
||||
}
|
||||
|
||||
boolean
|
||||
HUlib_addCharToTextLine
|
||||
( hu_textline_t* t,
|
||||
char ch )
|
||||
{
|
||||
|
||||
if (t->len == HU_MAXLINELENGTH)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
t->l[t->len++] = ch;
|
||||
t->l[t->len] = 0;
|
||||
t->needsupdate = 4;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
boolean HUlib_delCharFromTextLine(hu_textline_t* t)
|
||||
{
|
||||
|
||||
if (!t->len) return false;
|
||||
else
|
||||
{
|
||||
t->l[--t->len] = 0;
|
||||
t->needsupdate = 4;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
HUlib_drawTextLine
|
||||
( hu_textline_t* l,
|
||||
boolean drawcursor )
|
||||
{
|
||||
|
||||
int i;
|
||||
int w;
|
||||
int x;
|
||||
unsigned char c;
|
||||
|
||||
// draw the new stuff
|
||||
x = l->x;
|
||||
for (i=0;i<l->len;i++)
|
||||
{
|
||||
c = toupper((int)l->l[i]);
|
||||
if (c != ' '
|
||||
&& c >= l->sc
|
||||
&& c <= '_')
|
||||
{
|
||||
w = SHORT(l->f[c - l->sc]->width);
|
||||
if (x+w > SCREENWIDTH)
|
||||
break;
|
||||
V_DrawPatchDirect(x, l->y, l->f[c - l->sc]);
|
||||
x += w;
|
||||
}
|
||||
else
|
||||
{
|
||||
x += 4;
|
||||
if (x >= SCREENWIDTH)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// draw the cursor if requested
|
||||
if (drawcursor
|
||||
&& x + SHORT(l->f['_' - l->sc]->width) <= SCREENWIDTH)
|
||||
{
|
||||
V_DrawPatchDirect(x, l->y, l->f['_' - l->sc]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// sorta called by HU_Erase and just better darn get things straight
|
||||
void HUlib_eraseTextLine(hu_textline_t* l)
|
||||
{
|
||||
int lh;
|
||||
int y;
|
||||
int yoffset;
|
||||
|
||||
// Only erases when NOT in automap and the screen is reduced,
|
||||
// and the text must either need updating or refreshing
|
||||
// (because of a recent change back from the automap)
|
||||
|
||||
if (!automapactive &&
|
||||
viewwindowx && l->needsupdate)
|
||||
{
|
||||
lh = SHORT(l->f[0]->height) + 1;
|
||||
for (y=l->y,yoffset=y*SCREENWIDTH ; y<l->y+lh ; y++,yoffset+=SCREENWIDTH)
|
||||
{
|
||||
if (y < viewwindowy || y >= viewwindowy + viewheight)
|
||||
R_VideoErase(yoffset, SCREENWIDTH); // erase entire line
|
||||
else
|
||||
{
|
||||
R_VideoErase(yoffset, viewwindowx); // erase left border
|
||||
R_VideoErase(yoffset + viewwindowx + viewwidth, viewwindowx);
|
||||
// erase right border
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (l->needsupdate) l->needsupdate--;
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
HUlib_initSText
|
||||
( hu_stext_t* s,
|
||||
int x,
|
||||
int y,
|
||||
int h,
|
||||
patch_t** font,
|
||||
int startchar,
|
||||
boolean* on )
|
||||
{
|
||||
|
||||
int i;
|
||||
|
||||
s->h = h;
|
||||
s->on = on;
|
||||
s->laston = true;
|
||||
s->cl = 0;
|
||||
for (i=0;i<h;i++)
|
||||
HUlib_initTextLine(&s->l[i],
|
||||
x, y - i*(SHORT(font[0]->height)+1),
|
||||
font, startchar);
|
||||
|
||||
}
|
||||
|
||||
void HUlib_addLineToSText(hu_stext_t* s)
|
||||
{
|
||||
|
||||
int i;
|
||||
|
||||
// add a clear line
|
||||
if (++s->cl == s->h)
|
||||
s->cl = 0;
|
||||
HUlib_clearTextLine(&s->l[s->cl]);
|
||||
|
||||
// everything needs updating
|
||||
for (i=0 ; i<s->h ; i++)
|
||||
s->l[i].needsupdate = 4;
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
HUlib_addMessageToSText
|
||||
( hu_stext_t* s,
|
||||
char* prefix,
|
||||
char* msg )
|
||||
{
|
||||
HUlib_addLineToSText(s);
|
||||
if (prefix)
|
||||
while (*prefix)
|
||||
HUlib_addCharToTextLine(&s->l[s->cl], *(prefix++));
|
||||
|
||||
while (*msg)
|
||||
HUlib_addCharToTextLine(&s->l[s->cl], *(msg++));
|
||||
}
|
||||
|
||||
void HUlib_drawSText(hu_stext_t* s)
|
||||
{
|
||||
int i, idx;
|
||||
hu_textline_t *l;
|
||||
|
||||
if (!*s->on)
|
||||
return; // if not on, don't draw
|
||||
|
||||
// draw everything
|
||||
for (i=0 ; i<s->h ; i++)
|
||||
{
|
||||
idx = s->cl - i;
|
||||
if (idx < 0)
|
||||
idx += s->h; // handle queue of lines
|
||||
|
||||
l = &s->l[idx];
|
||||
|
||||
// need a decision made here on whether to skip the draw
|
||||
HUlib_drawTextLine(l, false); // no cursor, please
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void HUlib_eraseSText(hu_stext_t* s)
|
||||
{
|
||||
|
||||
int i;
|
||||
|
||||
for (i=0 ; i<s->h ; i++)
|
||||
{
|
||||
if (s->laston && !*s->on)
|
||||
s->l[i].needsupdate = 4;
|
||||
HUlib_eraseTextLine(&s->l[i]);
|
||||
}
|
||||
s->laston = *s->on;
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
HUlib_initIText
|
||||
( hu_itext_t* it,
|
||||
int x,
|
||||
int y,
|
||||
patch_t** font,
|
||||
int startchar,
|
||||
boolean* on )
|
||||
{
|
||||
it->lm = 0; // default left margin is start of text
|
||||
it->on = on;
|
||||
it->laston = true;
|
||||
HUlib_initTextLine(&it->l, x, y, font, startchar);
|
||||
}
|
||||
|
||||
|
||||
// The following deletion routines adhere to the left margin restriction
|
||||
void HUlib_delCharFromIText(hu_itext_t* it)
|
||||
{
|
||||
if (it->l.len != it->lm)
|
||||
HUlib_delCharFromTextLine(&it->l);
|
||||
}
|
||||
|
||||
void HUlib_eraseLineFromIText(hu_itext_t* it)
|
||||
{
|
||||
while (it->lm != it->l.len)
|
||||
HUlib_delCharFromTextLine(&it->l);
|
||||
}
|
||||
|
||||
// Resets left margin as well
|
||||
void HUlib_resetIText(hu_itext_t* it)
|
||||
{
|
||||
it->lm = 0;
|
||||
HUlib_clearTextLine(&it->l);
|
||||
}
|
||||
|
||||
void
|
||||
HUlib_addPrefixToIText
|
||||
( hu_itext_t* it,
|
||||
char* str )
|
||||
{
|
||||
while (*str)
|
||||
HUlib_addCharToTextLine(&it->l, *(str++));
|
||||
it->lm = it->l.len;
|
||||
}
|
||||
|
||||
// wrapper function for handling general keyed input.
|
||||
// returns true if it ate the key
|
||||
boolean
|
||||
HUlib_keyInIText
|
||||
( hu_itext_t* it,
|
||||
unsigned char ch )
|
||||
{
|
||||
ch = toupper(ch);
|
||||
|
||||
if (ch >= ' ' && ch <= '_')
|
||||
HUlib_addCharToTextLine(&it->l, (char) ch);
|
||||
else
|
||||
if (ch == KEY_BACKSPACE)
|
||||
HUlib_delCharFromIText(it);
|
||||
else
|
||||
if (ch != KEY_ENTER)
|
||||
return false; // did not eat key
|
||||
|
||||
return true; // ate the key
|
||||
|
||||
}
|
||||
|
||||
void HUlib_drawIText(hu_itext_t* it)
|
||||
{
|
||||
|
||||
hu_textline_t *l = &it->l;
|
||||
|
||||
if (!*it->on)
|
||||
return;
|
||||
HUlib_drawTextLine(l, true); // draw the line w/ cursor
|
||||
|
||||
}
|
||||
|
||||
void HUlib_eraseIText(hu_itext_t* it)
|
||||
{
|
||||
if (it->laston && !*it->on)
|
||||
it->l.needsupdate = 4;
|
||||
HUlib_eraseTextLine(&it->l);
|
||||
it->laston = *it->on;
|
||||
}
|
||||
|
||||
182
src/kernel/userland/doom/hu_lib.h
Normal file
182
src/kernel/userland/doom/hu_lib.h
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION: none
|
||||
//
|
||||
|
||||
#ifndef __HULIB__
|
||||
#define __HULIB__
|
||||
|
||||
// We are referring to patches.
|
||||
#include "r_defs.h"
|
||||
|
||||
// font stuff
|
||||
#define HU_CHARERASE KEY_BACKSPACE
|
||||
|
||||
#define HU_MAXLINES 4
|
||||
#define HU_MAXLINELENGTH 80
|
||||
|
||||
//
|
||||
// Typedefs of widgets
|
||||
//
|
||||
|
||||
// Text Line widget
|
||||
// (parent of Scrolling Text and Input Text widgets)
|
||||
typedef struct
|
||||
{
|
||||
// left-justified position of scrolling text window
|
||||
int x;
|
||||
int y;
|
||||
|
||||
patch_t** f; // font
|
||||
int sc; // start character
|
||||
char l[HU_MAXLINELENGTH+1]; // line of text
|
||||
int len; // current line length
|
||||
|
||||
// whether this line needs to be udpated
|
||||
int needsupdate;
|
||||
|
||||
} hu_textline_t;
|
||||
|
||||
|
||||
|
||||
// Scrolling Text window widget
|
||||
// (child of Text Line widget)
|
||||
typedef struct
|
||||
{
|
||||
hu_textline_t l[HU_MAXLINES]; // text lines to draw
|
||||
int h; // height in lines
|
||||
int cl; // current line number
|
||||
|
||||
// pointer to boolean stating whether to update window
|
||||
boolean* on;
|
||||
boolean laston; // last value of *->on.
|
||||
|
||||
} hu_stext_t;
|
||||
|
||||
|
||||
|
||||
// Input Text Line widget
|
||||
// (child of Text Line widget)
|
||||
typedef struct
|
||||
{
|
||||
hu_textline_t l; // text line to input on
|
||||
|
||||
// left margin past which I am not to delete characters
|
||||
int lm;
|
||||
|
||||
// pointer to boolean stating whether to update window
|
||||
boolean* on;
|
||||
boolean laston; // last value of *->on;
|
||||
|
||||
} hu_itext_t;
|
||||
|
||||
|
||||
//
|
||||
// Widget creation, access, and update routines
|
||||
//
|
||||
|
||||
// initializes heads-up widget library
|
||||
void HUlib_init(void);
|
||||
|
||||
//
|
||||
// textline code
|
||||
//
|
||||
|
||||
// clear a line of text
|
||||
void HUlib_clearTextLine(hu_textline_t *t);
|
||||
|
||||
void HUlib_initTextLine(hu_textline_t *t, int x, int y, patch_t **f, int sc);
|
||||
|
||||
// returns success
|
||||
boolean HUlib_addCharToTextLine(hu_textline_t *t, char ch);
|
||||
|
||||
// returns success
|
||||
boolean HUlib_delCharFromTextLine(hu_textline_t *t);
|
||||
|
||||
// draws tline
|
||||
void HUlib_drawTextLine(hu_textline_t *l, boolean drawcursor);
|
||||
|
||||
// erases text line
|
||||
void HUlib_eraseTextLine(hu_textline_t *l);
|
||||
|
||||
|
||||
//
|
||||
// Scrolling Text window widget routines
|
||||
//
|
||||
|
||||
// ?
|
||||
void
|
||||
HUlib_initSText
|
||||
( hu_stext_t* s,
|
||||
int x,
|
||||
int y,
|
||||
int h,
|
||||
patch_t** font,
|
||||
int startchar,
|
||||
boolean* on );
|
||||
|
||||
// add a new line
|
||||
void HUlib_addLineToSText(hu_stext_t* s);
|
||||
|
||||
// ?
|
||||
void
|
||||
HUlib_addMessageToSText
|
||||
( hu_stext_t* s,
|
||||
char* prefix,
|
||||
char* msg );
|
||||
|
||||
// draws stext
|
||||
void HUlib_drawSText(hu_stext_t* s);
|
||||
|
||||
// erases all stext lines
|
||||
void HUlib_eraseSText(hu_stext_t* s);
|
||||
|
||||
// Input Text Line widget routines
|
||||
void
|
||||
HUlib_initIText
|
||||
( hu_itext_t* it,
|
||||
int x,
|
||||
int y,
|
||||
patch_t** font,
|
||||
int startchar,
|
||||
boolean* on );
|
||||
|
||||
// enforces left margin
|
||||
void HUlib_delCharFromIText(hu_itext_t* it);
|
||||
|
||||
// enforces left margin
|
||||
void HUlib_eraseLineFromIText(hu_itext_t* it);
|
||||
|
||||
// resets line and left margin
|
||||
void HUlib_resetIText(hu_itext_t* it);
|
||||
|
||||
// left of left-margin
|
||||
void
|
||||
HUlib_addPrefixToIText
|
||||
( hu_itext_t* it,
|
||||
char* str );
|
||||
|
||||
// whether eaten
|
||||
boolean
|
||||
HUlib_keyInIText
|
||||
( hu_itext_t* it,
|
||||
unsigned char ch );
|
||||
|
||||
void HUlib_drawIText(hu_itext_t* it);
|
||||
|
||||
// erases all itext lines
|
||||
void HUlib_eraseIText(hu_itext_t* it);
|
||||
|
||||
#endif
|
||||
641
src/kernel/userland/doom/hu_stuff.c
Normal file
641
src/kernel/userland/doom/hu_stuff.c
Normal file
|
|
@ -0,0 +1,641 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION: Heads-up displays
|
||||
//
|
||||
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "doomkeys.h"
|
||||
|
||||
#include "z_zone.h"
|
||||
|
||||
#include "deh_main.h"
|
||||
#include "i_swap.h"
|
||||
#include "i_video.h"
|
||||
|
||||
#include "hu_stuff.h"
|
||||
#include "hu_lib.h"
|
||||
#include "m_controls.h"
|
||||
#include "m_misc.h"
|
||||
#include "w_wad.h"
|
||||
|
||||
#include "s_sound.h"
|
||||
|
||||
#include "doomstat.h"
|
||||
|
||||
// Data.
|
||||
#include "dstrings.h"
|
||||
#include "sounds.h"
|
||||
|
||||
//
|
||||
// Locally used constants, shortcuts.
|
||||
//
|
||||
#define HU_TITLE (mapnames[(gameepisode-1)*9+gamemap-1])
|
||||
#define HU_TITLE2 (mapnames_commercial[gamemap-1])
|
||||
#define HU_TITLEP (mapnames_commercial[gamemap-1 + 32])
|
||||
#define HU_TITLET (mapnames_commercial[gamemap-1 + 64])
|
||||
#define HU_TITLE_CHEX (mapnames[gamemap - 1])
|
||||
#define HU_TITLEHEIGHT 1
|
||||
#define HU_TITLEX 0
|
||||
#define HU_TITLEY (167 - SHORT(hu_font[0]->height))
|
||||
|
||||
#define HU_INPUTTOGGLE 't'
|
||||
#define HU_INPUTX HU_MSGX
|
||||
#define HU_INPUTY (HU_MSGY + HU_MSGHEIGHT*(SHORT(hu_font[0]->height) +1))
|
||||
#define HU_INPUTWIDTH 64
|
||||
#define HU_INPUTHEIGHT 1
|
||||
|
||||
|
||||
|
||||
char *chat_macros[10] =
|
||||
{
|
||||
HUSTR_CHATMACRO0,
|
||||
HUSTR_CHATMACRO1,
|
||||
HUSTR_CHATMACRO2,
|
||||
HUSTR_CHATMACRO3,
|
||||
HUSTR_CHATMACRO4,
|
||||
HUSTR_CHATMACRO5,
|
||||
HUSTR_CHATMACRO6,
|
||||
HUSTR_CHATMACRO7,
|
||||
HUSTR_CHATMACRO8,
|
||||
HUSTR_CHATMACRO9
|
||||
};
|
||||
|
||||
char* player_names[] =
|
||||
{
|
||||
HUSTR_PLRGREEN,
|
||||
HUSTR_PLRINDIGO,
|
||||
HUSTR_PLRBROWN,
|
||||
HUSTR_PLRRED
|
||||
};
|
||||
|
||||
char chat_char; // remove later.
|
||||
static player_t* plr;
|
||||
patch_t* hu_font[HU_FONTSIZE];
|
||||
static hu_textline_t w_title;
|
||||
boolean chat_on;
|
||||
static hu_itext_t w_chat;
|
||||
static boolean always_off = false;
|
||||
static char chat_dest[MAXPLAYERS];
|
||||
static hu_itext_t w_inputbuffer[MAXPLAYERS];
|
||||
|
||||
static boolean message_on;
|
||||
boolean message_dontfuckwithme;
|
||||
static boolean message_nottobefuckedwith;
|
||||
|
||||
static hu_stext_t w_message;
|
||||
static int message_counter;
|
||||
|
||||
extern int showMessages;
|
||||
|
||||
static boolean headsupactive = false;
|
||||
|
||||
//
|
||||
// Builtin map names.
|
||||
// The actual names can be found in DStrings.h.
|
||||
//
|
||||
|
||||
char* mapnames[] = // DOOM shareware/registered/retail (Ultimate) names.
|
||||
{
|
||||
|
||||
HUSTR_E1M1,
|
||||
HUSTR_E1M2,
|
||||
HUSTR_E1M3,
|
||||
HUSTR_E1M4,
|
||||
HUSTR_E1M5,
|
||||
HUSTR_E1M6,
|
||||
HUSTR_E1M7,
|
||||
HUSTR_E1M8,
|
||||
HUSTR_E1M9,
|
||||
|
||||
HUSTR_E2M1,
|
||||
HUSTR_E2M2,
|
||||
HUSTR_E2M3,
|
||||
HUSTR_E2M4,
|
||||
HUSTR_E2M5,
|
||||
HUSTR_E2M6,
|
||||
HUSTR_E2M7,
|
||||
HUSTR_E2M8,
|
||||
HUSTR_E2M9,
|
||||
|
||||
HUSTR_E3M1,
|
||||
HUSTR_E3M2,
|
||||
HUSTR_E3M3,
|
||||
HUSTR_E3M4,
|
||||
HUSTR_E3M5,
|
||||
HUSTR_E3M6,
|
||||
HUSTR_E3M7,
|
||||
HUSTR_E3M8,
|
||||
HUSTR_E3M9,
|
||||
|
||||
HUSTR_E4M1,
|
||||
HUSTR_E4M2,
|
||||
HUSTR_E4M3,
|
||||
HUSTR_E4M4,
|
||||
HUSTR_E4M5,
|
||||
HUSTR_E4M6,
|
||||
HUSTR_E4M7,
|
||||
HUSTR_E4M8,
|
||||
HUSTR_E4M9,
|
||||
|
||||
"NEWLEVEL",
|
||||
"NEWLEVEL",
|
||||
"NEWLEVEL",
|
||||
"NEWLEVEL",
|
||||
"NEWLEVEL",
|
||||
"NEWLEVEL",
|
||||
"NEWLEVEL",
|
||||
"NEWLEVEL",
|
||||
"NEWLEVEL"
|
||||
};
|
||||
|
||||
// List of names for levels in commercial IWADs
|
||||
// (doom2.wad, plutonia.wad, tnt.wad). These are stored in a
|
||||
// single large array; WADs like pl2.wad have a MAP33, and rely on
|
||||
// the layout in the Vanilla executable, where it is possible to
|
||||
// overflow the end of one array into the next.
|
||||
|
||||
char *mapnames_commercial[] =
|
||||
{
|
||||
// DOOM 2 map names.
|
||||
|
||||
HUSTR_1,
|
||||
HUSTR_2,
|
||||
HUSTR_3,
|
||||
HUSTR_4,
|
||||
HUSTR_5,
|
||||
HUSTR_6,
|
||||
HUSTR_7,
|
||||
HUSTR_8,
|
||||
HUSTR_9,
|
||||
HUSTR_10,
|
||||
HUSTR_11,
|
||||
|
||||
HUSTR_12,
|
||||
HUSTR_13,
|
||||
HUSTR_14,
|
||||
HUSTR_15,
|
||||
HUSTR_16,
|
||||
HUSTR_17,
|
||||
HUSTR_18,
|
||||
HUSTR_19,
|
||||
HUSTR_20,
|
||||
|
||||
HUSTR_21,
|
||||
HUSTR_22,
|
||||
HUSTR_23,
|
||||
HUSTR_24,
|
||||
HUSTR_25,
|
||||
HUSTR_26,
|
||||
HUSTR_27,
|
||||
HUSTR_28,
|
||||
HUSTR_29,
|
||||
HUSTR_30,
|
||||
HUSTR_31,
|
||||
HUSTR_32,
|
||||
|
||||
// Plutonia WAD map names.
|
||||
|
||||
PHUSTR_1,
|
||||
PHUSTR_2,
|
||||
PHUSTR_3,
|
||||
PHUSTR_4,
|
||||
PHUSTR_5,
|
||||
PHUSTR_6,
|
||||
PHUSTR_7,
|
||||
PHUSTR_8,
|
||||
PHUSTR_9,
|
||||
PHUSTR_10,
|
||||
PHUSTR_11,
|
||||
|
||||
PHUSTR_12,
|
||||
PHUSTR_13,
|
||||
PHUSTR_14,
|
||||
PHUSTR_15,
|
||||
PHUSTR_16,
|
||||
PHUSTR_17,
|
||||
PHUSTR_18,
|
||||
PHUSTR_19,
|
||||
PHUSTR_20,
|
||||
|
||||
PHUSTR_21,
|
||||
PHUSTR_22,
|
||||
PHUSTR_23,
|
||||
PHUSTR_24,
|
||||
PHUSTR_25,
|
||||
PHUSTR_26,
|
||||
PHUSTR_27,
|
||||
PHUSTR_28,
|
||||
PHUSTR_29,
|
||||
PHUSTR_30,
|
||||
PHUSTR_31,
|
||||
PHUSTR_32,
|
||||
|
||||
// TNT WAD map names.
|
||||
|
||||
THUSTR_1,
|
||||
THUSTR_2,
|
||||
THUSTR_3,
|
||||
THUSTR_4,
|
||||
THUSTR_5,
|
||||
THUSTR_6,
|
||||
THUSTR_7,
|
||||
THUSTR_8,
|
||||
THUSTR_9,
|
||||
THUSTR_10,
|
||||
THUSTR_11,
|
||||
|
||||
THUSTR_12,
|
||||
THUSTR_13,
|
||||
THUSTR_14,
|
||||
THUSTR_15,
|
||||
THUSTR_16,
|
||||
THUSTR_17,
|
||||
THUSTR_18,
|
||||
THUSTR_19,
|
||||
THUSTR_20,
|
||||
|
||||
THUSTR_21,
|
||||
THUSTR_22,
|
||||
THUSTR_23,
|
||||
THUSTR_24,
|
||||
THUSTR_25,
|
||||
THUSTR_26,
|
||||
THUSTR_27,
|
||||
THUSTR_28,
|
||||
THUSTR_29,
|
||||
THUSTR_30,
|
||||
THUSTR_31,
|
||||
THUSTR_32
|
||||
};
|
||||
|
||||
void HU_Init(void)
|
||||
{
|
||||
|
||||
int i;
|
||||
int j;
|
||||
char buffer[9];
|
||||
|
||||
// load the heads-up font
|
||||
j = HU_FONTSTART;
|
||||
for (i=0;i<HU_FONTSIZE;i++)
|
||||
{
|
||||
DEH_snprintf(buffer, 9, "STCFN%.3d", j++);
|
||||
hu_font[i] = (patch_t *) W_CacheLumpName(buffer, PU_STATIC);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void HU_Stop(void)
|
||||
{
|
||||
headsupactive = false;
|
||||
}
|
||||
|
||||
void HU_Start(void)
|
||||
{
|
||||
|
||||
int i;
|
||||
char* s;
|
||||
|
||||
if (headsupactive)
|
||||
HU_Stop();
|
||||
|
||||
plr = &players[consoleplayer];
|
||||
message_on = false;
|
||||
message_dontfuckwithme = false;
|
||||
message_nottobefuckedwith = false;
|
||||
chat_on = false;
|
||||
|
||||
// create the message widget
|
||||
HUlib_initSText(&w_message,
|
||||
HU_MSGX, HU_MSGY, HU_MSGHEIGHT,
|
||||
hu_font,
|
||||
HU_FONTSTART, &message_on);
|
||||
|
||||
// create the map title widget
|
||||
HUlib_initTextLine(&w_title,
|
||||
HU_TITLEX, HU_TITLEY,
|
||||
hu_font,
|
||||
HU_FONTSTART);
|
||||
|
||||
switch ( logical_gamemission )
|
||||
{
|
||||
case doom:
|
||||
s = HU_TITLE;
|
||||
break;
|
||||
case doom2:
|
||||
s = HU_TITLE2;
|
||||
break;
|
||||
case pack_plut:
|
||||
s = HU_TITLEP;
|
||||
break;
|
||||
case pack_tnt:
|
||||
s = HU_TITLET;
|
||||
break;
|
||||
default:
|
||||
s = "Unknown level";
|
||||
break;
|
||||
}
|
||||
|
||||
// Chex.exe always uses the episode 1 level title
|
||||
// eg. E2M1 gives the title for E1M1
|
||||
|
||||
if (gameversion == exe_chex)
|
||||
{
|
||||
s = HU_TITLE_CHEX;
|
||||
}
|
||||
|
||||
// dehacked substitution to get modified level name
|
||||
|
||||
s = DEH_String(s);
|
||||
|
||||
while (*s)
|
||||
HUlib_addCharToTextLine(&w_title, *(s++));
|
||||
|
||||
// create the chat widget
|
||||
HUlib_initIText(&w_chat,
|
||||
HU_INPUTX, HU_INPUTY,
|
||||
hu_font,
|
||||
HU_FONTSTART, &chat_on);
|
||||
|
||||
// create the inputbuffer widgets
|
||||
for (i=0 ; i<MAXPLAYERS ; i++)
|
||||
HUlib_initIText(&w_inputbuffer[i], 0, 0, 0, 0, &always_off);
|
||||
|
||||
headsupactive = true;
|
||||
|
||||
}
|
||||
|
||||
void HU_Drawer(void)
|
||||
{
|
||||
|
||||
HUlib_drawSText(&w_message);
|
||||
HUlib_drawIText(&w_chat);
|
||||
if (automapactive)
|
||||
HUlib_drawTextLine(&w_title, false);
|
||||
|
||||
}
|
||||
|
||||
void HU_Erase(void)
|
||||
{
|
||||
|
||||
HUlib_eraseSText(&w_message);
|
||||
HUlib_eraseIText(&w_chat);
|
||||
HUlib_eraseTextLine(&w_title);
|
||||
|
||||
}
|
||||
|
||||
void HU_Ticker(void)
|
||||
{
|
||||
|
||||
int i, rc;
|
||||
char c;
|
||||
|
||||
// tick down message counter if message is up
|
||||
if (message_counter && !--message_counter)
|
||||
{
|
||||
message_on = false;
|
||||
message_nottobefuckedwith = false;
|
||||
}
|
||||
|
||||
if (showMessages || message_dontfuckwithme)
|
||||
{
|
||||
|
||||
// display message if necessary
|
||||
if ((plr->message && !message_nottobefuckedwith)
|
||||
|| (plr->message && message_dontfuckwithme))
|
||||
{
|
||||
HUlib_addMessageToSText(&w_message, 0, plr->message);
|
||||
plr->message = 0;
|
||||
message_on = true;
|
||||
message_counter = HU_MSGTIMEOUT;
|
||||
message_nottobefuckedwith = message_dontfuckwithme;
|
||||
message_dontfuckwithme = 0;
|
||||
}
|
||||
|
||||
} // else message_on = false;
|
||||
|
||||
// check for incoming chat characters
|
||||
if (netgame)
|
||||
{
|
||||
for (i=0 ; i<MAXPLAYERS; i++)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
if (i != consoleplayer
|
||||
&& (c = players[i].cmd.chatchar))
|
||||
{
|
||||
if (c <= HU_BROADCAST)
|
||||
chat_dest[i] = c;
|
||||
else
|
||||
{
|
||||
rc = HUlib_keyInIText(&w_inputbuffer[i], c);
|
||||
if (rc && c == KEY_ENTER)
|
||||
{
|
||||
if (w_inputbuffer[i].l.len
|
||||
&& (chat_dest[i] == consoleplayer+1
|
||||
|| chat_dest[i] == HU_BROADCAST))
|
||||
{
|
||||
HUlib_addMessageToSText(&w_message,
|
||||
DEH_String(player_names[i]),
|
||||
w_inputbuffer[i].l.l);
|
||||
|
||||
message_nottobefuckedwith = true;
|
||||
message_on = true;
|
||||
message_counter = HU_MSGTIMEOUT;
|
||||
if ( gamemode == commercial )
|
||||
S_StartSound(0, sfx_radio);
|
||||
else
|
||||
S_StartSound(0, sfx_tink);
|
||||
}
|
||||
HUlib_resetIText(&w_inputbuffer[i]);
|
||||
}
|
||||
}
|
||||
players[i].cmd.chatchar = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#define QUEUESIZE 128
|
||||
|
||||
static char chatchars[QUEUESIZE];
|
||||
static int head = 0;
|
||||
static int tail = 0;
|
||||
|
||||
|
||||
void HU_queueChatChar(char c)
|
||||
{
|
||||
if (((head + 1) & (QUEUESIZE-1)) == tail)
|
||||
{
|
||||
plr->message = DEH_String(HUSTR_MSGU);
|
||||
}
|
||||
else
|
||||
{
|
||||
chatchars[head] = c;
|
||||
head = (head + 1) & (QUEUESIZE-1);
|
||||
}
|
||||
}
|
||||
|
||||
char HU_dequeueChatChar(void)
|
||||
{
|
||||
char c;
|
||||
|
||||
if (head != tail)
|
||||
{
|
||||
c = chatchars[tail];
|
||||
tail = (tail + 1) & (QUEUESIZE-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
c = 0;
|
||||
}
|
||||
|
||||
return c;
|
||||
}
|
||||
|
||||
boolean HU_Responder(event_t *ev)
|
||||
{
|
||||
|
||||
static char lastmessage[HU_MAXLINELENGTH+1];
|
||||
char* macromessage;
|
||||
boolean eatkey = false;
|
||||
static boolean altdown = false;
|
||||
unsigned char c;
|
||||
int i;
|
||||
int numplayers;
|
||||
|
||||
static int num_nobrainers = 0;
|
||||
|
||||
numplayers = 0;
|
||||
for (i=0 ; i<MAXPLAYERS ; i++)
|
||||
numplayers += playeringame[i];
|
||||
|
||||
if (ev->data1 == KEY_RSHIFT)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (ev->data1 == KEY_RALT || ev->data1 == KEY_LALT)
|
||||
{
|
||||
altdown = ev->type == ev_keydown;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ev->type != ev_keydown)
|
||||
return false;
|
||||
|
||||
if (!chat_on)
|
||||
{
|
||||
if (ev->data1 == key_message_refresh)
|
||||
{
|
||||
message_on = true;
|
||||
message_counter = HU_MSGTIMEOUT;
|
||||
eatkey = true;
|
||||
}
|
||||
else if (netgame && ev->data2 == key_multi_msg)
|
||||
{
|
||||
eatkey = chat_on = true;
|
||||
HUlib_resetIText(&w_chat);
|
||||
HU_queueChatChar(HU_BROADCAST);
|
||||
}
|
||||
else if (netgame && numplayers > 2)
|
||||
{
|
||||
for (i=0; i<MAXPLAYERS ; i++)
|
||||
{
|
||||
if (ev->data2 == key_multi_msgplayer[i])
|
||||
{
|
||||
if (playeringame[i] && i!=consoleplayer)
|
||||
{
|
||||
eatkey = chat_on = true;
|
||||
HUlib_resetIText(&w_chat);
|
||||
HU_queueChatChar(i+1);
|
||||
break;
|
||||
}
|
||||
else if (i == consoleplayer)
|
||||
{
|
||||
num_nobrainers++;
|
||||
if (num_nobrainers < 3)
|
||||
plr->message = DEH_String(HUSTR_TALKTOSELF1);
|
||||
else if (num_nobrainers < 6)
|
||||
plr->message = DEH_String(HUSTR_TALKTOSELF2);
|
||||
else if (num_nobrainers < 9)
|
||||
plr->message = DEH_String(HUSTR_TALKTOSELF3);
|
||||
else if (num_nobrainers < 32)
|
||||
plr->message = DEH_String(HUSTR_TALKTOSELF4);
|
||||
else
|
||||
plr->message = DEH_String(HUSTR_TALKTOSELF5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// send a macro
|
||||
if (altdown)
|
||||
{
|
||||
c = ev->data1 - '0';
|
||||
if (c > 9)
|
||||
return false;
|
||||
// fprintf(stderr, "got here\n");
|
||||
macromessage = chat_macros[c];
|
||||
|
||||
// kill last message with a '\n'
|
||||
HU_queueChatChar(KEY_ENTER); // DEBUG!!!
|
||||
|
||||
// send the macro message
|
||||
while (*macromessage)
|
||||
HU_queueChatChar(*macromessage++);
|
||||
HU_queueChatChar(KEY_ENTER);
|
||||
|
||||
// leave chat mode and notify that it was sent
|
||||
chat_on = false;
|
||||
M_StringCopy(lastmessage, chat_macros[c], sizeof(lastmessage));
|
||||
plr->message = lastmessage;
|
||||
eatkey = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
c = ev->data2;
|
||||
|
||||
eatkey = HUlib_keyInIText(&w_chat, c);
|
||||
if (eatkey)
|
||||
{
|
||||
// static unsigned char buf[20]; // DEBUG
|
||||
HU_queueChatChar(c);
|
||||
|
||||
// M_snprintf(buf, sizeof(buf), "KEY: %d => %d", ev->data1, c);
|
||||
// plr->message = buf;
|
||||
}
|
||||
if (c == KEY_ENTER)
|
||||
{
|
||||
chat_on = false;
|
||||
if (w_chat.l.len)
|
||||
{
|
||||
M_StringCopy(lastmessage, w_chat.l.l, sizeof(lastmessage));
|
||||
plr->message = lastmessage;
|
||||
}
|
||||
}
|
||||
else if (c == KEY_ESCAPE)
|
||||
chat_on = false;
|
||||
}
|
||||
}
|
||||
|
||||
return eatkey;
|
||||
|
||||
}
|
||||
59
src/kernel/userland/doom/hu_stuff.h
Normal file
59
src/kernel/userland/doom/hu_stuff.h
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION: Head up display
|
||||
//
|
||||
|
||||
#ifndef __HU_STUFF_H__
|
||||
#define __HU_STUFF_H__
|
||||
|
||||
#include "d_event.h"
|
||||
|
||||
|
||||
//
|
||||
// Globally visible constants.
|
||||
//
|
||||
#define HU_FONTSTART '!' // the first font characters
|
||||
#define HU_FONTEND '_' // the last font characters
|
||||
|
||||
// Calculate # of glyphs in font.
|
||||
#define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1)
|
||||
|
||||
#define HU_BROADCAST 5
|
||||
|
||||
#define HU_MSGX 0
|
||||
#define HU_MSGY 0
|
||||
#define HU_MSGWIDTH 64 // in characters
|
||||
#define HU_MSGHEIGHT 1 // in lines
|
||||
|
||||
#define HU_MSGTIMEOUT (4*TICRATE)
|
||||
|
||||
//
|
||||
// HEADS UP TEXT
|
||||
//
|
||||
|
||||
void HU_Init(void);
|
||||
void HU_Start(void);
|
||||
|
||||
boolean HU_Responder(event_t* ev);
|
||||
|
||||
void HU_Ticker(void);
|
||||
void HU_Drawer(void);
|
||||
char HU_dequeueChatChar(void);
|
||||
void HU_Erase(void);
|
||||
|
||||
extern char *chat_macros[10];
|
||||
|
||||
#endif
|
||||
|
||||
41
src/kernel/userland/doom/i_cdmus.h
Normal file
41
src/kernel/userland/doom/i_cdmus.h
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 1993-2008 Raven Software
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
|
||||
// i_cdmus.h
|
||||
|
||||
#ifndef __ICDMUS__
|
||||
#define __ICDMUS__
|
||||
|
||||
#define CDERR_NOTINSTALLED 10 // MSCDEX not installed
|
||||
#define CDERR_NOAUDIOSUPPORT 11 // CD-ROM Doesn't support audio
|
||||
#define CDERR_NOAUDIOTRACKS 12 // Current CD has no audio tracks
|
||||
#define CDERR_BADDRIVE 20 // Bad drive number
|
||||
#define CDERR_BADTRACK 21 // Bad track number
|
||||
#define CDERR_IOCTLBUFFMEM 22 // Not enough low memory for IOCTL
|
||||
#define CDERR_DEVREQBASE 100 // DevReq errors
|
||||
|
||||
extern int cd_Error;
|
||||
|
||||
int I_CDMusInit(void);
|
||||
void I_CDMusPrintStartup(void);
|
||||
int I_CDMusPlay(int track);
|
||||
int I_CDMusStop(void);
|
||||
int I_CDMusResume(void);
|
||||
int I_CDMusSetVolume(int volume);
|
||||
int I_CDMusFirstTrack(void);
|
||||
int I_CDMusLastTrack(void);
|
||||
int I_CDMusTrackLength(int track);
|
||||
|
||||
#endif
|
||||
101
src/kernel/userland/doom/i_endoom.c
Normal file
101
src/kernel/userland/doom/i_endoom.c
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
//
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Exit text-mode ENDOOM screen.
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "doomtype.h"
|
||||
#include "i_video.h"
|
||||
|
||||
#ifdef ORIGCODE
|
||||
#include "txt_main.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __DJGPP__
|
||||
#include <go32.h>
|
||||
#endif // __DJGPP__
|
||||
|
||||
|
||||
#define ENDOOM_W 80
|
||||
#define ENDOOM_H 25
|
||||
|
||||
//
|
||||
// Displays the text mode ending screen after the game quits
|
||||
//
|
||||
|
||||
void I_Endoom(byte *endoom_data)
|
||||
{
|
||||
#ifdef ORIGCODE
|
||||
unsigned char *screendata;
|
||||
int y;
|
||||
int indent;
|
||||
|
||||
// Set up text mode screen
|
||||
|
||||
TXT_Init();
|
||||
I_InitWindowTitle();
|
||||
I_InitWindowIcon();
|
||||
|
||||
// Write the data to the screen memory
|
||||
|
||||
screendata = TXT_GetScreenData();
|
||||
|
||||
indent = (ENDOOM_W - TXT_SCREEN_W) / 2;
|
||||
|
||||
for (y=0; y<TXT_SCREEN_H; ++y)
|
||||
{
|
||||
memcpy(screendata + (y * TXT_SCREEN_W * 2),
|
||||
endoom_data + (y * ENDOOM_W + indent) * 2,
|
||||
TXT_SCREEN_W * 2);
|
||||
}
|
||||
|
||||
// Wait for a keypress
|
||||
|
||||
while (true)
|
||||
{
|
||||
TXT_UpdateScreen();
|
||||
|
||||
if (TXT_GetChar() > 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
TXT_Sleep(0);
|
||||
}
|
||||
|
||||
// Shut down text mode screen
|
||||
|
||||
TXT_Shutdown();
|
||||
|
||||
#elif defined(__DJGPP__)
|
||||
|
||||
int y;
|
||||
|
||||
// move cursor to bottom
|
||||
// there's a direct call for moving cursor somewhere but this is simpler to write
|
||||
for (y = 0; y < ENDOOM_H; y++) {
|
||||
puts("\n");
|
||||
}
|
||||
|
||||
// allegro exit should have been run already and so we should be in text mode again
|
||||
movedata(_my_ds(), (unsigned) endoom_data, _dos_ds, 0xB8000UL, ENDOOM_W * ENDOOM_H * 2);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
29
src/kernel/userland/doom/i_endoom.h
Normal file
29
src/kernel/userland/doom/i_endoom.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Exit text-mode ENDOOM screen.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __I_ENDOOM__
|
||||
#define __I_ENDOOM__
|
||||
|
||||
// Display the Endoom screen on shutdown. Pass a pointer to the
|
||||
// ENDOOM lump.
|
||||
|
||||
void I_Endoom(byte *data);
|
||||
|
||||
#endif
|
||||
|
||||
341
src/kernel/userland/doom/i_input.c
Normal file
341
src/kernel/userland/doom/i_input.c
Normal file
|
|
@ -0,0 +1,341 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "deh_str.h"
|
||||
#include "doomtype.h"
|
||||
#include "doomkeys.h"
|
||||
#include "i_joystick.h"
|
||||
#include "i_system.h"
|
||||
#include "i_swap.h"
|
||||
#include "i_timer.h"
|
||||
#include "i_video.h"
|
||||
#include "i_scale.h"
|
||||
#include "m_argv.h"
|
||||
#include "m_config.h"
|
||||
#include "m_misc.h"
|
||||
#include "tables.h"
|
||||
#include "v_video.h"
|
||||
#include "w_wad.h"
|
||||
#include "z_zone.h"
|
||||
|
||||
#include "doomgeneric.h"
|
||||
|
||||
int vanilla_keyboard_mapping = 1;
|
||||
|
||||
// Is the shift key currently down?
|
||||
|
||||
static int shiftdown = 0;
|
||||
|
||||
// Lookup table for mapping AT keycodes to their doom keycode
|
||||
static const char at_to_doom[] =
|
||||
{
|
||||
/* 0x00 */ 0x00,
|
||||
/* 0x01 */ KEY_ESCAPE,
|
||||
/* 0x02 */ '1',
|
||||
/* 0x03 */ '2',
|
||||
/* 0x04 */ '3',
|
||||
/* 0x05 */ '4',
|
||||
/* 0x06 */ '5',
|
||||
/* 0x07 */ '6',
|
||||
/* 0x08 */ '7',
|
||||
/* 0x09 */ '8',
|
||||
/* 0x0a */ '9',
|
||||
/* 0x0b */ '0',
|
||||
/* 0x0c */ '-',
|
||||
/* 0x0d */ '=',
|
||||
/* 0x0e */ KEY_BACKSPACE,
|
||||
/* 0x0f */ KEY_TAB,
|
||||
/* 0x10 */ 'q',
|
||||
/* 0x11 */ 'w',
|
||||
/* 0x12 */ 'e',
|
||||
/* 0x13 */ 'r',
|
||||
/* 0x14 */ 't',
|
||||
/* 0x15 */ 'y',
|
||||
/* 0x16 */ 'u',
|
||||
/* 0x17 */ 'i',
|
||||
/* 0x18 */ 'o',
|
||||
/* 0x19 */ 'p',
|
||||
/* 0x1a */ '[',
|
||||
/* 0x1b */ ']',
|
||||
/* 0x1c */ KEY_ENTER,
|
||||
/* 0x1d */ KEY_FIRE, /* KEY_RCTRL, */
|
||||
/* 0x1e */ 'a',
|
||||
/* 0x1f */ 's',
|
||||
/* 0x20 */ 'd',
|
||||
/* 0x21 */ 'f',
|
||||
/* 0x22 */ 'g',
|
||||
/* 0x23 */ 'h',
|
||||
/* 0x24 */ 'j',
|
||||
/* 0x25 */ 'k',
|
||||
/* 0x26 */ 'l',
|
||||
/* 0x27 */ ';',
|
||||
/* 0x28 */ '\'',
|
||||
/* 0x29 */ '`',
|
||||
/* 0x2a */ KEY_RSHIFT,
|
||||
/* 0x2b */ '\\',
|
||||
/* 0x2c */ 'z',
|
||||
/* 0x2d */ 'x',
|
||||
/* 0x2e */ 'c',
|
||||
/* 0x2f */ 'v',
|
||||
/* 0x30 */ 'b',
|
||||
/* 0x31 */ 'n',
|
||||
/* 0x32 */ 'm',
|
||||
/* 0x33 */ ',',
|
||||
/* 0x34 */ '.',
|
||||
/* 0x35 */ '/',
|
||||
/* 0x36 */ KEY_RSHIFT,
|
||||
/* 0x37 */ KEYP_MULTIPLY,
|
||||
/* 0x38 */ KEY_LALT,
|
||||
/* 0x39 */ KEY_USE,
|
||||
/* 0x3a */ KEY_CAPSLOCK,
|
||||
/* 0x3b */ KEY_F1,
|
||||
/* 0x3c */ KEY_F2,
|
||||
/* 0x3d */ KEY_F3,
|
||||
/* 0x3e */ KEY_F4,
|
||||
/* 0x3f */ KEY_F5,
|
||||
/* 0x40 */ KEY_F6,
|
||||
/* 0x41 */ KEY_F7,
|
||||
/* 0x42 */ KEY_F8,
|
||||
/* 0x43 */ KEY_F9,
|
||||
/* 0x44 */ KEY_F10,
|
||||
/* 0x45 */ KEY_NUMLOCK,
|
||||
/* 0x46 */ 0x0,
|
||||
/* 0x47 */ 0x0, /* 47 (Keypad-7/Home) */
|
||||
/* 0x48 */ 0x0, /* 48 (Keypad-8/Up) */
|
||||
/* 0x49 */ 0x0, /* 49 (Keypad-9/PgUp) */
|
||||
/* 0x4a */ 0x0, /* 4a (Keypad--) */
|
||||
/* 0x4b */ 0x0, /* 4b (Keypad-4/Left) */
|
||||
/* 0x4c */ 0x0, /* 4c (Keypad-5) */
|
||||
/* 0x4d */ 0x0, /* 4d (Keypad-6/Right) */
|
||||
/* 0x4e */ 0x0, /* 4e (Keypad-+) */
|
||||
/* 0x4f */ 0x0, /* 4f (Keypad-1/End) */
|
||||
/* 0x50 */ 0x0, /* 50 (Keypad-2/Down) */
|
||||
/* 0x51 */ 0x0, /* 51 (Keypad-3/PgDn) */
|
||||
/* 0x52 */ 0x0, /* 52 (Keypad-0/Ins) */
|
||||
/* 0x53 */ 0x0, /* 53 (Keypad-./Del) */
|
||||
/* 0x54 */ 0x0, /* 54 (Alt-SysRq) on a 84+ key keyboard */
|
||||
/* 0x55 */ 0x0,
|
||||
/* 0x56 */ 0x0,
|
||||
/* 0x57 */ 0x0,
|
||||
/* 0x58 */ 0x0,
|
||||
/* 0x59 */ 0x0,
|
||||
/* 0x5a */ 0x0,
|
||||
/* 0x5b */ 0x0,
|
||||
/* 0x5c */ 0x0,
|
||||
/* 0x5d */ 0x0,
|
||||
/* 0x5e */ 0x0,
|
||||
/* 0x5f */ 0x0,
|
||||
/* 0x60 */ 0x0,
|
||||
/* 0x61 */ 0x0,
|
||||
/* 0x62 */ 0x0,
|
||||
/* 0x63 */ 0x0,
|
||||
/* 0x64 */ 0x0,
|
||||
/* 0x65 */ 0x0,
|
||||
/* 0x66 */ 0x0,
|
||||
/* 0x67 */ KEY_UPARROW,
|
||||
/* 0x68 */ 0x0,
|
||||
/* 0x69 */ KEY_LEFTARROW,
|
||||
/* 0x6a */ KEY_RIGHTARROW,
|
||||
/* 0x6b */ 0x0,
|
||||
/* 0x6c */ KEY_DOWNARROW,
|
||||
/* 0x6d */ 0x0,
|
||||
/* 0x6e */ 0x0,
|
||||
/* 0x6f */ 0x0,
|
||||
/* 0x70 */ 0x0,
|
||||
/* 0x71 */ 0x0,
|
||||
/* 0x72 */ 0x0,
|
||||
/* 0x73 */ 0x0,
|
||||
/* 0x74 */ 0x0,
|
||||
/* 0x75 */ 0x0,
|
||||
/* 0x76 */ 0x0,
|
||||
/* 0x77 */ 0x0,
|
||||
/* 0x78 */ 0x0,
|
||||
/* 0x79 */ 0x0,
|
||||
/* 0x7a */ 0x0,
|
||||
/* 0x7b */ 0x0,
|
||||
/* 0x7c */ 0x0,
|
||||
/* 0x7d */ 0x0,
|
||||
/* 0x7e */ 0x0,
|
||||
/* 0x7f */ KEY_FIRE, //KEY_RCTRL,
|
||||
};
|
||||
|
||||
// Lookup table for mapping ASCII characters to their equivalent when
|
||||
// shift is pressed on an American layout keyboard:
|
||||
static const char shiftxform[] =
|
||||
{
|
||||
0, 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, ' ', '!', '"', '#', '$', '%', '&',
|
||||
'"', // shift-'
|
||||
'(', ')', '*', '+',
|
||||
'<', // shift-,
|
||||
'_', // shift--
|
||||
'>', // shift-.
|
||||
'?', // shift-/
|
||||
')', // shift-0
|
||||
'!', // shift-1
|
||||
'@', // shift-2
|
||||
'#', // shift-3
|
||||
'$', // shift-4
|
||||
'%', // shift-5
|
||||
'^', // shift-6
|
||||
'&', // shift-7
|
||||
'*', // shift-8
|
||||
'(', // shift-9
|
||||
':',
|
||||
':', // shift-;
|
||||
'<',
|
||||
'+', // shift-=
|
||||
'>', '?', '@',
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
|
||||
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'[', // shift-[
|
||||
'!', // shift-backslash - OH MY GOD DOES WATCOM SUCK
|
||||
']', // shift-]
|
||||
'"', '_',
|
||||
'\'', // shift-`
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
|
||||
'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'{', '|', '}', '~', 127
|
||||
};
|
||||
|
||||
|
||||
static unsigned char TranslateKey(unsigned char key)
|
||||
{
|
||||
return key;
|
||||
|
||||
/*
|
||||
if (key < sizeof(at_to_doom))
|
||||
return at_to_doom[key];
|
||||
else
|
||||
return 0x0;
|
||||
*/
|
||||
|
||||
//default:
|
||||
// return tolower(key);
|
||||
}
|
||||
|
||||
// Get the equivalent ASCII (Unicode?) character for a keypress.
|
||||
|
||||
static unsigned char GetTypedChar(unsigned char key)
|
||||
{
|
||||
key = TranslateKey(key);
|
||||
|
||||
// Is shift held down? If so, perform a translation.
|
||||
|
||||
if (shiftdown > 0)
|
||||
{
|
||||
if (key >= 0 && key < arrlen(shiftxform))
|
||||
{
|
||||
key = shiftxform[key];
|
||||
}
|
||||
else
|
||||
{
|
||||
key = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
static void UpdateShiftStatus(int pressed, unsigned char key)
|
||||
{
|
||||
int change;
|
||||
|
||||
if (pressed) {
|
||||
change = 1;
|
||||
} else {
|
||||
change = -1;
|
||||
}
|
||||
|
||||
if (key == KEY_RSHIFT) {
|
||||
shiftdown += change;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void I_GetEvent(void)
|
||||
{
|
||||
event_t event;
|
||||
int pressed;
|
||||
unsigned char key;
|
||||
|
||||
|
||||
while (DG_GetKey(&pressed, &key))
|
||||
{
|
||||
UpdateShiftStatus(pressed, key);
|
||||
|
||||
// process event
|
||||
|
||||
if (pressed)
|
||||
{
|
||||
// data1 has the key pressed, data2 has the character
|
||||
// (shift-translated, etc)
|
||||
event.type = ev_keydown;
|
||||
event.data1 = TranslateKey(key);
|
||||
event.data2 = GetTypedChar(key);
|
||||
|
||||
if (event.data1 != 0)
|
||||
{
|
||||
D_PostEvent(&event);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
event.type = ev_keyup;
|
||||
event.data1 = TranslateKey(key);
|
||||
|
||||
// data2 is just initialized to zero for ev_keyup.
|
||||
// For ev_keydown it's the shifted Unicode character
|
||||
// that was typed, but if something wants to detect
|
||||
// key releases it should do so based on data1
|
||||
// (key ID), not the printable char.
|
||||
|
||||
event.data2 = 0;
|
||||
|
||||
if (event.data1 != 0)
|
||||
{
|
||||
D_PostEvent(&event);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
case SDL_MOUSEMOTION:
|
||||
event.type = ev_mouse;
|
||||
event.data1 = mouse_button_state;
|
||||
event.data2 = AccelerateMouse(sdlevent.motion.xrel);
|
||||
event.data3 = -AccelerateMouse(sdlevent.motion.yrel);
|
||||
D_PostEvent(&event);
|
||||
break;
|
||||
*/
|
||||
}
|
||||
|
||||
void I_InitInput(void)
|
||||
{
|
||||
}
|
||||
|
||||
359
src/kernel/userland/doom/i_joystick.c
Normal file
359
src/kernel/userland/doom/i_joystick.c
Normal file
|
|
@ -0,0 +1,359 @@
|
|||
//
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// SDL Joystick code.
|
||||
//
|
||||
|
||||
#ifdef ORIGCODE
|
||||
#include "SDL.h"
|
||||
#include "SDL_joystick.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "d_event.h"
|
||||
#include "i_joystick.h"
|
||||
#include "i_system.h"
|
||||
|
||||
#include "m_config.h"
|
||||
#include "m_misc.h"
|
||||
|
||||
// When an axis is within the dead zone, it is set to zero.
|
||||
// This is 5% of the full range:
|
||||
|
||||
#define DEAD_ZONE (32768 / 3)
|
||||
|
||||
#ifdef ORIGCODE
|
||||
static SDL_Joystick *joystick = NULL;
|
||||
#endif
|
||||
|
||||
// Configuration variables:
|
||||
|
||||
// Standard default.cfg Joystick enable/disable
|
||||
|
||||
static int usejoystick = 0;
|
||||
|
||||
// Joystick to use, as an SDL joystick index:
|
||||
|
||||
static int joystick_index = -1;
|
||||
|
||||
// Which joystick axis to use for horizontal movement, and whether to
|
||||
// invert the direction:
|
||||
|
||||
static int joystick_x_axis = 0;
|
||||
static int joystick_x_invert = 0;
|
||||
|
||||
// Which joystick axis to use for vertical movement, and whether to
|
||||
// invert the direction:
|
||||
|
||||
static int joystick_y_axis = 1;
|
||||
static int joystick_y_invert = 0;
|
||||
|
||||
// Which joystick axis to use for strafing?
|
||||
|
||||
static int joystick_strafe_axis = -1;
|
||||
static int joystick_strafe_invert = 0;
|
||||
|
||||
// Virtual to physical button joystick button mapping. By default this
|
||||
// is a straight mapping.
|
||||
static int joystick_physical_buttons[NUM_VIRTUAL_BUTTONS] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
|
||||
};
|
||||
|
||||
void I_ShutdownJoystick(void)
|
||||
{
|
||||
#ifdef ORIGCODE
|
||||
if (joystick != NULL)
|
||||
{
|
||||
SDL_JoystickClose(joystick);
|
||||
joystick = NULL;
|
||||
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef ORIGCODE
|
||||
static boolean IsValidAxis(int axis)
|
||||
{
|
||||
int num_axes;
|
||||
|
||||
if (axis < 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (IS_BUTTON_AXIS(axis))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (IS_HAT_AXIS(axis))
|
||||
{
|
||||
return HAT_AXIS_HAT(axis) < SDL_JoystickNumHats(joystick);
|
||||
}
|
||||
|
||||
num_axes = SDL_JoystickNumAxes(joystick);
|
||||
|
||||
return axis < num_axes;
|
||||
}
|
||||
#endif
|
||||
|
||||
void I_InitJoystick(void)
|
||||
{
|
||||
#ifdef ORIGCODE
|
||||
if (!usejoystick)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (SDL_Init(SDL_INIT_JOYSTICK) < 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (joystick_index < 0 || joystick_index >= SDL_NumJoysticks())
|
||||
{
|
||||
printf("I_InitJoystick: Invalid joystick ID: %i\n", joystick_index);
|
||||
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
|
||||
return;
|
||||
}
|
||||
|
||||
// Open the joystick
|
||||
|
||||
joystick = SDL_JoystickOpen(joystick_index);
|
||||
|
||||
if (joystick == NULL)
|
||||
{
|
||||
printf("I_InitJoystick: Failed to open joystick #%i\n",
|
||||
joystick_index);
|
||||
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!IsValidAxis(joystick_x_axis)
|
||||
|| !IsValidAxis(joystick_y_axis)
|
||||
|| !IsValidAxis(joystick_strafe_axis))
|
||||
{
|
||||
printf("I_InitJoystick: Invalid joystick axis for joystick #%i "
|
||||
"(run joystick setup again)\n",
|
||||
joystick_index);
|
||||
|
||||
SDL_JoystickClose(joystick);
|
||||
joystick = NULL;
|
||||
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
|
||||
}
|
||||
|
||||
SDL_JoystickEventState(SDL_ENABLE);
|
||||
|
||||
// Initialized okay!
|
||||
|
||||
printf("I_InitJoystick: %s\n", SDL_JoystickName(joystick_index));
|
||||
|
||||
I_AtExit(I_ShutdownJoystick, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef ORIGCODE
|
||||
static boolean IsAxisButton(int physbutton)
|
||||
{
|
||||
if (IS_BUTTON_AXIS(joystick_x_axis))
|
||||
{
|
||||
if (physbutton == BUTTON_AXIS_NEG(joystick_x_axis)
|
||||
|| physbutton == BUTTON_AXIS_POS(joystick_x_axis))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (IS_BUTTON_AXIS(joystick_y_axis))
|
||||
{
|
||||
if (physbutton == BUTTON_AXIS_NEG(joystick_y_axis)
|
||||
|| physbutton == BUTTON_AXIS_POS(joystick_y_axis))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (IS_BUTTON_AXIS(joystick_strafe_axis))
|
||||
{
|
||||
if (physbutton == BUTTON_AXIS_NEG(joystick_strafe_axis)
|
||||
|| physbutton == BUTTON_AXIS_POS(joystick_strafe_axis))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the state of the given virtual button.
|
||||
|
||||
static int ReadButtonState(int vbutton)
|
||||
{
|
||||
int physbutton;
|
||||
|
||||
// Map from virtual button to physical (SDL) button.
|
||||
if (vbutton < NUM_VIRTUAL_BUTTONS)
|
||||
{
|
||||
physbutton = joystick_physical_buttons[vbutton];
|
||||
}
|
||||
else
|
||||
{
|
||||
physbutton = vbutton;
|
||||
}
|
||||
|
||||
// Never read axis buttons as buttons.
|
||||
if (IsAxisButton(physbutton))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return SDL_JoystickGetButton(joystick, physbutton);
|
||||
}
|
||||
|
||||
// Get a bitmask of all currently-pressed buttons
|
||||
|
||||
static int GetButtonsState(void)
|
||||
{
|
||||
int i;
|
||||
int result;
|
||||
|
||||
result = 0;
|
||||
|
||||
for (i = 0; i < 20; ++i)
|
||||
{
|
||||
if (ReadButtonState(i))
|
||||
{
|
||||
result |= 1 << i;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Read the state of an axis, inverting if necessary.
|
||||
|
||||
static int GetAxisState(int axis, int invert)
|
||||
{
|
||||
int result;
|
||||
|
||||
// Axis -1 means disabled.
|
||||
|
||||
if (axis < 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Is this a button axis, or a hat axis?
|
||||
// If so, we need to handle it specially.
|
||||
|
||||
result = 0;
|
||||
|
||||
if (IS_BUTTON_AXIS(axis))
|
||||
{
|
||||
if (SDL_JoystickGetButton(joystick, BUTTON_AXIS_NEG(axis)))
|
||||
{
|
||||
result -= 32767;
|
||||
}
|
||||
if (SDL_JoystickGetButton(joystick, BUTTON_AXIS_POS(axis)))
|
||||
{
|
||||
result += 32767;
|
||||
}
|
||||
}
|
||||
else if (IS_HAT_AXIS(axis))
|
||||
{
|
||||
int direction = HAT_AXIS_DIRECTION(axis);
|
||||
int hatval = SDL_JoystickGetHat(joystick, HAT_AXIS_HAT(axis));
|
||||
|
||||
if (direction == HAT_AXIS_HORIZONTAL)
|
||||
{
|
||||
if ((hatval & SDL_HAT_LEFT) != 0)
|
||||
{
|
||||
result -= 32767;
|
||||
}
|
||||
else if ((hatval & SDL_HAT_RIGHT) != 0)
|
||||
{
|
||||
result += 32767;
|
||||
}
|
||||
}
|
||||
else if (direction == HAT_AXIS_VERTICAL)
|
||||
{
|
||||
if ((hatval & SDL_HAT_UP) != 0)
|
||||
{
|
||||
result -= 32767;
|
||||
}
|
||||
else if ((hatval & SDL_HAT_DOWN) != 0)
|
||||
{
|
||||
result += 32767;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = SDL_JoystickGetAxis(joystick, axis);
|
||||
|
||||
if (result < DEAD_ZONE && result > -DEAD_ZONE)
|
||||
{
|
||||
result = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (invert)
|
||||
{
|
||||
result = -result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
void I_UpdateJoystick(void)
|
||||
{
|
||||
#ifdef ORIGCODE
|
||||
if (joystick != NULL)
|
||||
{
|
||||
event_t ev;
|
||||
|
||||
ev.type = ev_joystick;
|
||||
ev.data1 = GetButtonsState();
|
||||
ev.data2 = GetAxisState(joystick_x_axis, joystick_x_invert);
|
||||
ev.data3 = GetAxisState(joystick_y_axis, joystick_y_invert);
|
||||
ev.data4 = GetAxisState(joystick_strafe_axis, joystick_strafe_invert);
|
||||
|
||||
D_PostEvent(&ev);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void I_BindJoystickVariables(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
M_BindVariable("use_joystick", &usejoystick);
|
||||
M_BindVariable("joystick_index", &joystick_index);
|
||||
M_BindVariable("joystick_x_axis", &joystick_x_axis);
|
||||
M_BindVariable("joystick_y_axis", &joystick_y_axis);
|
||||
M_BindVariable("joystick_strafe_axis", &joystick_strafe_axis);
|
||||
M_BindVariable("joystick_x_invert", &joystick_x_invert);
|
||||
M_BindVariable("joystick_y_invert", &joystick_y_invert);
|
||||
M_BindVariable("joystick_strafe_invert",&joystick_strafe_invert);
|
||||
|
||||
for (i = 0; i < NUM_VIRTUAL_BUTTONS; ++i)
|
||||
{
|
||||
char name[32];
|
||||
M_snprintf(name, sizeof(name), "joystick_physical_button%i", i);
|
||||
M_BindVariable(name, &joystick_physical_buttons[i]);
|
||||
}
|
||||
}
|
||||
|
||||
70
src/kernel/userland/doom/i_joystick.h
Normal file
70
src/kernel/userland/doom/i_joystick.h
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
//
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// System-specific joystick interface.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __I_JOYSTICK__
|
||||
#define __I_JOYSTICK__
|
||||
|
||||
// Number of "virtual" joystick buttons defined in configuration files.
|
||||
// This needs to be at least as large as the number of different key
|
||||
// bindings supported by the higher-level game code (joyb* variables).
|
||||
#define NUM_VIRTUAL_BUTTONS 10
|
||||
|
||||
// If this bit is set in a configuration file axis value, the axis is
|
||||
// not actually a joystick axis, but instead is a "button axis". This
|
||||
// means that instead of reading an SDL joystick axis, we read the
|
||||
// state of two buttons to get the axis value. This is needed for eg.
|
||||
// the PS3 SIXAXIS controller, where the D-pad buttons register as
|
||||
// buttons, not as two axes.
|
||||
#define BUTTON_AXIS 0x10000
|
||||
|
||||
// Query whether a given axis value describes a button axis.
|
||||
#define IS_BUTTON_AXIS(axis) ((axis) >= 0 && ((axis) & BUTTON_AXIS) != 0)
|
||||
|
||||
// Get the individual buttons from a button axis value.
|
||||
#define BUTTON_AXIS_NEG(axis) ((axis) & 0xff)
|
||||
#define BUTTON_AXIS_POS(axis) (((axis) >> 8) & 0xff)
|
||||
|
||||
// Create a button axis value from two button values.
|
||||
#define CREATE_BUTTON_AXIS(neg, pos) (BUTTON_AXIS | (neg) | ((pos) << 8))
|
||||
|
||||
// If this bit is set in an axis value, the axis is not actually a
|
||||
// joystick axis, but is a "hat" axis. This means that we read (one of)
|
||||
// the hats on the joystick.
|
||||
#define HAT_AXIS 0x20000
|
||||
|
||||
#define IS_HAT_AXIS(axis) ((axis) >= 0 && ((axis) & HAT_AXIS) != 0)
|
||||
|
||||
// Get the hat number from a hat axis value.
|
||||
#define HAT_AXIS_HAT(axis) ((axis) & 0xff)
|
||||
// Which axis of the hat? (horizonal or vertical)
|
||||
#define HAT_AXIS_DIRECTION(axis) (((axis) >> 8) & 0xff)
|
||||
|
||||
#define CREATE_HAT_AXIS(hat, direction) \
|
||||
(HAT_AXIS | (hat) | ((direction) << 8))
|
||||
|
||||
#define HAT_AXIS_HORIZONTAL 1
|
||||
#define HAT_AXIS_VERTICAL 2
|
||||
|
||||
void I_InitJoystick(void);
|
||||
void I_ShutdownJoystick(void);
|
||||
void I_UpdateJoystick(void);
|
||||
|
||||
void I_BindJoystickVariables(void);
|
||||
|
||||
#endif /* #ifndef __I_JOYSTICK__ */
|
||||
|
||||
1452
src/kernel/userland/doom/i_scale.c
Normal file
1452
src/kernel/userland/doom/i_scale.c
Normal file
File diff suppressed because it is too large
Load diff
53
src/kernel/userland/doom/i_scale.h
Normal file
53
src/kernel/userland/doom/i_scale.h
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Pixel-doubling scale up functions.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __I_SCALE__
|
||||
#define __I_SCALE__
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
void I_InitScale(byte *_src_buffer, byte *_dest_buffer, int _dest_pitch);
|
||||
void I_ResetScaleTables(byte *palette);
|
||||
|
||||
// Scaled modes (direct multiples of 320x200)
|
||||
|
||||
extern screen_mode_t mode_scale_1x;
|
||||
extern screen_mode_t mode_scale_2x;
|
||||
extern screen_mode_t mode_scale_3x;
|
||||
extern screen_mode_t mode_scale_4x;
|
||||
extern screen_mode_t mode_scale_5x;
|
||||
|
||||
// Vertically stretched modes (320x200 -> multiples of 320x240)
|
||||
|
||||
extern screen_mode_t mode_stretch_1x;
|
||||
extern screen_mode_t mode_stretch_2x;
|
||||
extern screen_mode_t mode_stretch_3x;
|
||||
extern screen_mode_t mode_stretch_4x;
|
||||
extern screen_mode_t mode_stretch_5x;
|
||||
|
||||
// Horizontally squashed modes (320x200 -> multiples of 256x200)
|
||||
|
||||
extern screen_mode_t mode_squash_1x;
|
||||
extern screen_mode_t mode_squash_2x;
|
||||
extern screen_mode_t mode_squash_3x;
|
||||
extern screen_mode_t mode_squash_4x;
|
||||
extern screen_mode_t mode_squash_5x;
|
||||
|
||||
#endif /* #ifndef __I_SCALE__ */
|
||||
|
||||
420
src/kernel/userland/doom/i_sound.c
Normal file
420
src/kernel/userland/doom/i_sound.c
Normal file
|
|
@ -0,0 +1,420 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION: none
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(FEATURE_SOUND) && !defined(__DJGPP__)
|
||||
#include <SDL_mixer.h>
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "doomfeatures.h"
|
||||
#include "doomtype.h"
|
||||
|
||||
#ifdef ORIGCODE
|
||||
#include "gusconf.h"
|
||||
#endif
|
||||
#include "i_sound.h"
|
||||
#include "i_video.h"
|
||||
#include "m_argv.h"
|
||||
#include "m_config.h"
|
||||
|
||||
// Sound sample rate to use for digital output (Hz)
|
||||
|
||||
int snd_samplerate = 44100;
|
||||
|
||||
// Maximum number of bytes to dedicate to allocated sound effects.
|
||||
// (Default: 64MB)
|
||||
|
||||
int snd_cachesize = 64 * 1024 * 1024;
|
||||
|
||||
// Config variable that controls the sound buffer size.
|
||||
// We default to 28ms (1000 / 35fps = 1 buffer per tic).
|
||||
|
||||
int snd_maxslicetime_ms = 28;
|
||||
|
||||
// External command to invoke to play back music.
|
||||
|
||||
char *snd_musiccmd = "";
|
||||
|
||||
// Low-level sound and music modules we are using
|
||||
|
||||
static sound_module_t *sound_module = NULL;
|
||||
static music_module_t *music_module = NULL;
|
||||
|
||||
int snd_musicdevice = SNDDEVICE_SB;
|
||||
int snd_sfxdevice = SNDDEVICE_SB;
|
||||
|
||||
// DOS-specific options: These are unused but should be maintained
|
||||
// so that the config file can be shared between chocolate
|
||||
// doom and doom.exe
|
||||
|
||||
static int snd_sbport = 0;
|
||||
static int snd_sbirq = 0;
|
||||
static int snd_sbdma = 0;
|
||||
static int snd_mport = 0;
|
||||
|
||||
// Compiled-in sound modules:
|
||||
|
||||
static sound_module_t *sound_modules[] =
|
||||
{
|
||||
#ifdef FEATURE_SOUND
|
||||
&DG_sound_module,
|
||||
#endif
|
||||
NULL,
|
||||
};
|
||||
|
||||
// Check if a sound device is in the given list of devices
|
||||
|
||||
static boolean SndDeviceInList(snddevice_t device, snddevice_t *list,
|
||||
int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<len; ++i)
|
||||
{
|
||||
if (device == list[i])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Find and initialize a sound_module_t appropriate for the setting
|
||||
// in snd_sfxdevice.
|
||||
|
||||
static void InitSfxModule(boolean use_sfx_prefix)
|
||||
{
|
||||
int i;
|
||||
|
||||
sound_module = NULL;
|
||||
|
||||
for (i=0; sound_modules[i] != NULL; ++i)
|
||||
{
|
||||
// Is the sfx device in the list of devices supported by
|
||||
// this module?
|
||||
|
||||
if (SndDeviceInList(snd_sfxdevice,
|
||||
sound_modules[i]->sound_devices,
|
||||
sound_modules[i]->num_sound_devices))
|
||||
{
|
||||
// Initialize the module
|
||||
|
||||
if (sound_modules[i]->Init(use_sfx_prefix))
|
||||
{
|
||||
sound_module = sound_modules[i];
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize music according to snd_musicdevice.
|
||||
|
||||
static void InitMusicModule(void)
|
||||
{
|
||||
#ifdef FEATURE_SOUND
|
||||
music_module = &DG_music_module;
|
||||
#endif /* FEATURE_SOUND */
|
||||
}
|
||||
|
||||
//
|
||||
// Initializes sound stuff, including volume
|
||||
// Sets channels, SFX and music volume,
|
||||
// allocates channel buffer, sets S_sfx lookup.
|
||||
//
|
||||
|
||||
void I_InitSound(boolean use_sfx_prefix)
|
||||
{
|
||||
boolean nosound, nosfx, nomusic;
|
||||
|
||||
//!
|
||||
// @vanilla
|
||||
//
|
||||
// Disable all sound output.
|
||||
//
|
||||
|
||||
nosound = M_CheckParm("-nosound") > 0;
|
||||
|
||||
//!
|
||||
// @vanilla
|
||||
//
|
||||
// Disable sound effects.
|
||||
//
|
||||
|
||||
nosfx = M_CheckParm("-nosfx") > 0;
|
||||
|
||||
//!
|
||||
// @vanilla
|
||||
//
|
||||
// Disable music.
|
||||
//
|
||||
|
||||
nomusic = M_CheckParm("-nomusic") > 0;
|
||||
|
||||
// Initialize the sound and music subsystems.
|
||||
|
||||
if (!nosound && !screensaver_mode)
|
||||
{
|
||||
// This is kind of a hack. If native MIDI is enabled, set up
|
||||
// the TIMIDITY_CFG environment variable here before SDL_mixer
|
||||
// is opened.
|
||||
|
||||
if (!nomusic
|
||||
&& (snd_musicdevice == SNDDEVICE_GENMIDI
|
||||
|| snd_musicdevice == SNDDEVICE_GUS))
|
||||
{
|
||||
//I_InitTimidityConfig();
|
||||
}
|
||||
|
||||
if (!nosfx)
|
||||
{
|
||||
InitSfxModule(use_sfx_prefix);
|
||||
}
|
||||
|
||||
if (!nomusic)
|
||||
{
|
||||
InitMusicModule();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void I_ShutdownSound(void)
|
||||
{
|
||||
if (sound_module != NULL)
|
||||
{
|
||||
sound_module->Shutdown();
|
||||
}
|
||||
|
||||
if (music_module != NULL)
|
||||
{
|
||||
music_module->Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
int I_GetSfxLumpNum(sfxinfo_t *sfxinfo)
|
||||
{
|
||||
if (sound_module != NULL)
|
||||
{
|
||||
return sound_module->GetSfxLumpNum(sfxinfo);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void I_UpdateSound(void)
|
||||
{
|
||||
if (sound_module != NULL)
|
||||
{
|
||||
sound_module->Update();
|
||||
}
|
||||
|
||||
if (music_module != NULL && music_module->Poll != NULL)
|
||||
{
|
||||
music_module->Poll();
|
||||
}
|
||||
}
|
||||
|
||||
static void CheckVolumeSeparation(int *vol, int *sep)
|
||||
{
|
||||
if (*sep < 0)
|
||||
{
|
||||
*sep = 0;
|
||||
}
|
||||
else if (*sep > 254)
|
||||
{
|
||||
*sep = 254;
|
||||
}
|
||||
|
||||
if (*vol < 0)
|
||||
{
|
||||
*vol = 0;
|
||||
}
|
||||
else if (*vol > 127)
|
||||
{
|
||||
*vol = 127;
|
||||
}
|
||||
}
|
||||
|
||||
void I_UpdateSoundParams(int channel, int vol, int sep)
|
||||
{
|
||||
if (sound_module != NULL)
|
||||
{
|
||||
CheckVolumeSeparation(&vol, &sep);
|
||||
sound_module->UpdateSoundParams(channel, vol, sep);
|
||||
}
|
||||
}
|
||||
|
||||
int I_StartSound(sfxinfo_t *sfxinfo, int channel, int vol, int sep)
|
||||
{
|
||||
if (sound_module != NULL)
|
||||
{
|
||||
CheckVolumeSeparation(&vol, &sep);
|
||||
return sound_module->StartSound(sfxinfo, channel, vol, sep);
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void I_StopSound(int channel)
|
||||
{
|
||||
if (sound_module != NULL)
|
||||
{
|
||||
sound_module->StopSound(channel);
|
||||
}
|
||||
}
|
||||
|
||||
boolean I_SoundIsPlaying(int channel)
|
||||
{
|
||||
if (sound_module != NULL)
|
||||
{
|
||||
return sound_module->SoundIsPlaying(channel);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void I_PrecacheSounds(sfxinfo_t *sounds, int num_sounds)
|
||||
{
|
||||
if (sound_module != NULL && sound_module->CacheSounds != NULL)
|
||||
{
|
||||
sound_module->CacheSounds(sounds, num_sounds);
|
||||
}
|
||||
}
|
||||
|
||||
void I_InitMusic(void)
|
||||
{
|
||||
if(music_module != NULL)
|
||||
{
|
||||
music_module->Init();
|
||||
}
|
||||
}
|
||||
|
||||
void I_ShutdownMusic(void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void I_SetMusicVolume(int volume)
|
||||
{
|
||||
if (music_module != NULL)
|
||||
{
|
||||
music_module->SetMusicVolume(volume);
|
||||
}
|
||||
}
|
||||
|
||||
void I_PauseSong(void)
|
||||
{
|
||||
if (music_module != NULL)
|
||||
{
|
||||
music_module->PauseMusic();
|
||||
}
|
||||
}
|
||||
|
||||
void I_ResumeSong(void)
|
||||
{
|
||||
if (music_module != NULL)
|
||||
{
|
||||
music_module->ResumeMusic();
|
||||
}
|
||||
}
|
||||
|
||||
void *I_RegisterSong(void *data, int len)
|
||||
{
|
||||
if (music_module != NULL)
|
||||
{
|
||||
return music_module->RegisterSong(data, len);
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void I_UnRegisterSong(void *handle)
|
||||
{
|
||||
if (music_module != NULL)
|
||||
{
|
||||
music_module->UnRegisterSong(handle);
|
||||
}
|
||||
}
|
||||
|
||||
void I_PlaySong(void *handle, boolean looping)
|
||||
{
|
||||
if (music_module != NULL)
|
||||
{
|
||||
music_module->PlaySong(handle, looping);
|
||||
}
|
||||
}
|
||||
|
||||
void I_StopSong(void)
|
||||
{
|
||||
if (music_module != NULL)
|
||||
{
|
||||
music_module->StopSong();
|
||||
}
|
||||
}
|
||||
|
||||
boolean I_MusicIsPlaying(void)
|
||||
{
|
||||
if (music_module != NULL)
|
||||
{
|
||||
return music_module->MusicIsPlaying();
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void I_BindSoundVariables(void)
|
||||
{
|
||||
extern int use_libsamplerate;
|
||||
extern float libsamplerate_scale;
|
||||
|
||||
M_BindVariable("snd_musicdevice", &snd_musicdevice);
|
||||
M_BindVariable("snd_sfxdevice", &snd_sfxdevice);
|
||||
M_BindVariable("snd_sbport", &snd_sbport);
|
||||
M_BindVariable("snd_sbirq", &snd_sbirq);
|
||||
M_BindVariable("snd_sbdma", &snd_sbdma);
|
||||
M_BindVariable("snd_mport", &snd_mport);
|
||||
M_BindVariable("snd_maxslicetime_ms", &snd_maxslicetime_ms);
|
||||
M_BindVariable("snd_musiccmd", &snd_musiccmd);
|
||||
M_BindVariable("snd_samplerate", &snd_samplerate);
|
||||
M_BindVariable("snd_cachesize", &snd_cachesize);
|
||||
|
||||
#ifdef FEATURE_SOUND
|
||||
M_BindVariable("use_libsamplerate", &use_libsamplerate);
|
||||
M_BindVariable("libsamplerate_scale", &libsamplerate_scale);
|
||||
#endif
|
||||
|
||||
// Before SDL_mixer version 1.2.11, MIDI music caused the game
|
||||
// to crash when it looped. If this is an old SDL_mixer version,
|
||||
// disable MIDI.
|
||||
}
|
||||
|
||||
256
src/kernel/userland/doom/i_sound.h
Normal file
256
src/kernel/userland/doom/i_sound.h
Normal file
|
|
@ -0,0 +1,256 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// The not so system specific sound interface.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __I_SOUND__
|
||||
#define __I_SOUND__
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
|
||||
//
|
||||
// SoundFX struct.
|
||||
//
|
||||
typedef struct sfxinfo_struct sfxinfo_t;
|
||||
|
||||
struct sfxinfo_struct
|
||||
{
|
||||
// tag name, used for hexen.
|
||||
char *tagname;
|
||||
|
||||
// lump name. If we are running with use_sfx_prefix=true, a
|
||||
// 'DS' (or 'DP' for PC speaker sounds) is prepended to this.
|
||||
|
||||
char name[9];
|
||||
|
||||
// Sfx priority
|
||||
int priority;
|
||||
|
||||
// referenced sound if a link
|
||||
sfxinfo_t *link;
|
||||
|
||||
// pitch if a link
|
||||
int pitch;
|
||||
|
||||
// volume if a link
|
||||
int volume;
|
||||
|
||||
// this is checked every second to see if sound
|
||||
// can be thrown out (if 0, then decrement, if -1,
|
||||
// then throw out, if > 0, then it is in use)
|
||||
int usefulness;
|
||||
|
||||
// lump number of sfx
|
||||
int lumpnum;
|
||||
|
||||
// Maximum number of channels that the sound can be played on
|
||||
// (Heretic)
|
||||
int numchannels;
|
||||
|
||||
// data used by the low level code
|
||||
void *driver_data;
|
||||
};
|
||||
|
||||
//
|
||||
// MusicInfo struct.
|
||||
//
|
||||
typedef struct
|
||||
{
|
||||
// up to 6-character name
|
||||
char *name;
|
||||
|
||||
// lump number of music
|
||||
int lumpnum;
|
||||
|
||||
// music data
|
||||
void *data;
|
||||
|
||||
// music handle once registered
|
||||
void *handle;
|
||||
|
||||
} musicinfo_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SNDDEVICE_NONE = 0,
|
||||
SNDDEVICE_PCSPEAKER = 1,
|
||||
SNDDEVICE_ADLIB = 2,
|
||||
SNDDEVICE_SB = 3,
|
||||
SNDDEVICE_PAS = 4,
|
||||
SNDDEVICE_GUS = 5,
|
||||
SNDDEVICE_WAVEBLASTER = 6,
|
||||
SNDDEVICE_SOUNDCANVAS = 7,
|
||||
SNDDEVICE_GENMIDI = 8,
|
||||
SNDDEVICE_AWE32 = 9,
|
||||
SNDDEVICE_CD = 10,
|
||||
} snddevice_t;
|
||||
|
||||
// Interface for sound modules
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// List of sound devices that this sound module is used for.
|
||||
|
||||
snddevice_t *sound_devices;
|
||||
int num_sound_devices;
|
||||
|
||||
// Initialise sound module
|
||||
// Returns true if successfully initialised
|
||||
|
||||
boolean (*Init)(boolean use_sfx_prefix);
|
||||
|
||||
// Shutdown sound module
|
||||
|
||||
void (*Shutdown)(void);
|
||||
|
||||
// Returns the lump index of the given sound.
|
||||
|
||||
int (*GetSfxLumpNum)(sfxinfo_t *sfxinfo);
|
||||
|
||||
// Called periodically to update the subsystem.
|
||||
|
||||
void (*Update)(void);
|
||||
|
||||
// Update the sound settings on the given channel.
|
||||
|
||||
void (*UpdateSoundParams)(int channel, int vol, int sep);
|
||||
|
||||
// Start a sound on a given channel. Returns the channel id
|
||||
// or -1 on failure.
|
||||
|
||||
int (*StartSound)(sfxinfo_t *sfxinfo, int channel, int vol, int sep);
|
||||
|
||||
// Stop the sound playing on the given channel.
|
||||
|
||||
void (*StopSound)(int channel);
|
||||
|
||||
// Query if a sound is playing on the given channel
|
||||
|
||||
boolean (*SoundIsPlaying)(int channel);
|
||||
|
||||
// Called on startup to precache sound effects (if necessary)
|
||||
|
||||
void (*CacheSounds)(sfxinfo_t *sounds, int num_sounds);
|
||||
|
||||
} sound_module_t;
|
||||
|
||||
void I_InitSound(boolean use_sfx_prefix);
|
||||
void I_ShutdownSound(void);
|
||||
int I_GetSfxLumpNum(sfxinfo_t *sfxinfo);
|
||||
void I_UpdateSound(void);
|
||||
void I_UpdateSoundParams(int channel, int vol, int sep);
|
||||
int I_StartSound(sfxinfo_t *sfxinfo, int channel, int vol, int sep);
|
||||
void I_StopSound(int channel);
|
||||
boolean I_SoundIsPlaying(int channel);
|
||||
void I_PrecacheSounds(sfxinfo_t *sounds, int num_sounds);
|
||||
|
||||
// Interface for music modules
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// List of sound devices that this music module is used for.
|
||||
|
||||
snddevice_t *sound_devices;
|
||||
int num_sound_devices;
|
||||
|
||||
// Initialise the music subsystem
|
||||
|
||||
boolean (*Init)(void);
|
||||
|
||||
// Shutdown the music subsystem
|
||||
|
||||
void (*Shutdown)(void);
|
||||
|
||||
// Set music volume - range 0-127
|
||||
|
||||
void (*SetMusicVolume)(int volume);
|
||||
|
||||
// Pause music
|
||||
|
||||
void (*PauseMusic)(void);
|
||||
|
||||
// Un-pause music
|
||||
|
||||
void (*ResumeMusic)(void);
|
||||
|
||||
// Register a song handle from data
|
||||
// Returns a handle that can be used to play the song
|
||||
|
||||
void *(*RegisterSong)(void *data, int len);
|
||||
|
||||
// Un-register (free) song data
|
||||
|
||||
void (*UnRegisterSong)(void *handle);
|
||||
|
||||
// Play the song
|
||||
|
||||
void (*PlaySong)(void *handle, boolean looping);
|
||||
|
||||
// Stop playing the current song.
|
||||
|
||||
void (*StopSong)(void);
|
||||
|
||||
// Query if music is playing.
|
||||
|
||||
boolean (*MusicIsPlaying)(void);
|
||||
|
||||
// Invoked periodically to poll.
|
||||
|
||||
void (*Poll)(void);
|
||||
} music_module_t;
|
||||
|
||||
void I_InitMusic(void);
|
||||
void I_ShutdownMusic(void);
|
||||
void I_SetMusicVolume(int volume);
|
||||
void I_PauseSong(void);
|
||||
void I_ResumeSong(void);
|
||||
void *I_RegisterSong(void *data, int len);
|
||||
void I_UnRegisterSong(void *handle);
|
||||
void I_PlaySong(void *handle, boolean looping);
|
||||
void I_StopSong(void);
|
||||
boolean I_MusicIsPlaying(void);
|
||||
|
||||
extern int snd_sfxdevice;
|
||||
extern int snd_musicdevice;
|
||||
extern int snd_samplerate;
|
||||
extern int snd_cachesize;
|
||||
extern int snd_maxslicetime_ms;
|
||||
extern char *snd_musiccmd;
|
||||
|
||||
void I_BindSoundVariables(void);
|
||||
|
||||
// Sound modules
|
||||
|
||||
void I_InitTimidityConfig(void);
|
||||
#ifdef FEATURE_SOUND
|
||||
extern sound_module_t DG_sound_module;
|
||||
extern music_module_t DG_music_module;
|
||||
#endif
|
||||
extern sound_module_t sound_pcsound_module;
|
||||
extern music_module_t music_opl_module;
|
||||
|
||||
// For OPL module:
|
||||
|
||||
extern int opl_io_port;
|
||||
|
||||
// For native music module:
|
||||
|
||||
extern char *timidity_cfg_path;
|
||||
|
||||
#endif
|
||||
|
||||
73
src/kernel/userland/doom/i_swap.h
Normal file
73
src/kernel/userland/doom/i_swap.h
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Endianess handling, swapping 16bit and 32bit.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __I_SWAP__
|
||||
#define __I_SWAP__
|
||||
|
||||
#ifdef __DJGPP__
|
||||
|
||||
|
||||
#define SHORT(x) ((signed short) (x))
|
||||
#define LONG(x) ((signed int) (x))
|
||||
|
||||
#define SYS_LITTLE_ENDIAN
|
||||
|
||||
|
||||
#else // __DJGPP__
|
||||
|
||||
|
||||
#if ( __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ )
|
||||
#define SYS_LITTLE_ENDIAN
|
||||
#define SHORT(x) ((signed short) (x))
|
||||
#define LONG(x) ((signed int) (x))
|
||||
#elif ( __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ )
|
||||
#define SYS_BIG_ENDIAN
|
||||
|
||||
static inline unsigned short swapLE16(unsigned short val) {
|
||||
return ((val << 8) | (val >> 8));
|
||||
}
|
||||
|
||||
static inline unsigned long swapLE32(unsigned long val) {
|
||||
return ((val << 24) | ((val << 8) & 0x00FF0000) | ((val >> 8) & 0x0000FF00) | (val >> 24));
|
||||
}
|
||||
|
||||
#define SHORT(x) ((signed short) swapLE16(x))
|
||||
#define LONG(x) ((signed int) swapLE32(x))
|
||||
#else
|
||||
#error "Unknown byte order"
|
||||
#endif
|
||||
|
||||
|
||||
// cosmito from lsdldoom
|
||||
#define doom_swap_s(x) \
|
||||
((short int)((((unsigned short int)(x) & 0x00ff) << 8) | \
|
||||
(((unsigned short int)(x) & 0xff00) >> 8)))
|
||||
|
||||
#if ( __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ )
|
||||
#define doom_wtohs(x) doom_swap_s(x)
|
||||
#else
|
||||
#define doom_wtohs(x) (short int)(x)
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __DJGPP__
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
578
src/kernel/userland/doom/i_system.c
Normal file
578
src/kernel/userland/doom/i_system.c
Normal file
|
|
@ -0,0 +1,578 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
//
|
||||
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef ORIGCODE
|
||||
#include "SDL.h"
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "deh_str.h"
|
||||
#include "doomtype.h"
|
||||
#include "m_argv.h"
|
||||
#include "m_config.h"
|
||||
#include "m_misc.h"
|
||||
#include "i_joystick.h"
|
||||
#include "i_sound.h"
|
||||
#include "i_timer.h"
|
||||
#include "i_video.h"
|
||||
|
||||
#include "i_system.h"
|
||||
|
||||
#include "w_wad.h"
|
||||
#include "z_zone.h"
|
||||
|
||||
#ifdef __MACOSX__
|
||||
#include <CoreFoundation/CFUserNotification.h>
|
||||
#endif
|
||||
|
||||
#define DEFAULT_RAM 6 /* MiB */
|
||||
#define MIN_RAM 6 /* MiB */
|
||||
|
||||
|
||||
typedef struct atexit_listentry_s atexit_listentry_t;
|
||||
|
||||
struct atexit_listentry_s
|
||||
{
|
||||
atexit_func_t func;
|
||||
boolean run_on_error;
|
||||
atexit_listentry_t *next;
|
||||
};
|
||||
|
||||
static atexit_listentry_t *exit_funcs = NULL;
|
||||
|
||||
void I_AtExit(atexit_func_t func, boolean run_on_error)
|
||||
{
|
||||
atexit_listentry_t *entry;
|
||||
|
||||
entry = malloc(sizeof(*entry));
|
||||
|
||||
entry->func = func;
|
||||
entry->run_on_error = run_on_error;
|
||||
entry->next = exit_funcs;
|
||||
exit_funcs = entry;
|
||||
}
|
||||
|
||||
// Tactile feedback function, probably used for the Logitech Cyberman
|
||||
|
||||
void I_Tactile(int on, int off, int total)
|
||||
{
|
||||
}
|
||||
|
||||
// Zone memory auto-allocation function that allocates the zone size
|
||||
// by trying progressively smaller zone sizes until one is found that
|
||||
// works.
|
||||
|
||||
static byte *AutoAllocMemory(int *size, int default_ram, int min_ram)
|
||||
{
|
||||
byte *zonemem;
|
||||
|
||||
// Allocate the zone memory. This loop tries progressively smaller
|
||||
// zone sizes until a size is found that can be allocated.
|
||||
// If we used the -mb command line parameter, only the parameter
|
||||
// provided is accepted.
|
||||
|
||||
zonemem = NULL;
|
||||
|
||||
while (zonemem == NULL)
|
||||
{
|
||||
// We need a reasonable minimum amount of RAM to start.
|
||||
|
||||
if (default_ram < min_ram)
|
||||
{
|
||||
I_Error("Unable to allocate %i MiB of RAM for zone", default_ram);
|
||||
}
|
||||
|
||||
// Try to allocate the zone memory.
|
||||
|
||||
*size = default_ram * 1024 * 1024;
|
||||
|
||||
zonemem = malloc(*size);
|
||||
|
||||
// Failed to allocate? Reduce zone size until we reach a size
|
||||
// that is acceptable.
|
||||
|
||||
if (zonemem == NULL)
|
||||
{
|
||||
default_ram -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return zonemem;
|
||||
}
|
||||
|
||||
byte *I_ZoneBase (int *size)
|
||||
{
|
||||
byte *zonemem;
|
||||
int min_ram, default_ram;
|
||||
int p;
|
||||
|
||||
//!
|
||||
// @arg <mb>
|
||||
//
|
||||
// Specify the heap size, in MiB (default 16).
|
||||
//
|
||||
|
||||
p = M_CheckParmWithArgs("-mb", 1);
|
||||
|
||||
if (p > 0)
|
||||
{
|
||||
default_ram = atoi(myargv[p+1]);
|
||||
min_ram = default_ram;
|
||||
}
|
||||
else
|
||||
{
|
||||
default_ram = DEFAULT_RAM;
|
||||
min_ram = MIN_RAM;
|
||||
}
|
||||
|
||||
zonemem = AutoAllocMemory(size, default_ram, min_ram);
|
||||
|
||||
printf("zone memory: %p, %x allocated for zone\n",
|
||||
zonemem, *size);
|
||||
|
||||
return zonemem;
|
||||
}
|
||||
|
||||
void I_PrintBanner(char *msg)
|
||||
{
|
||||
int i;
|
||||
int spaces = 35 - (strlen(msg) / 2);
|
||||
|
||||
for (i=0; i<spaces; ++i)
|
||||
putchar(' ');
|
||||
|
||||
puts(msg);
|
||||
}
|
||||
|
||||
void I_PrintDivider(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; i<75; ++i)
|
||||
{
|
||||
putchar('=');
|
||||
}
|
||||
|
||||
putchar('\n');
|
||||
}
|
||||
|
||||
void I_PrintStartupBanner(char *gamedescription)
|
||||
{
|
||||
I_PrintDivider();
|
||||
I_PrintBanner(gamedescription);
|
||||
I_PrintDivider();
|
||||
|
||||
printf(
|
||||
" " PACKAGE_NAME " is free software, covered by the GNU General Public\n"
|
||||
" License. There is NO warranty; not even for MERCHANTABILITY or FITNESS\n"
|
||||
" FOR A PARTICULAR PURPOSE. You are welcome to change and distribute\n"
|
||||
" copies under certain conditions. See the source for more information.\n");
|
||||
|
||||
I_PrintDivider();
|
||||
}
|
||||
|
||||
//
|
||||
// I_ConsoleStdout
|
||||
//
|
||||
// Returns true if stdout is a real console, false if it is a file
|
||||
//
|
||||
|
||||
boolean I_ConsoleStdout(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
// SDL "helpfully" always redirects stdout to a file.
|
||||
return 0;
|
||||
#else
|
||||
#if ORIGCODE
|
||||
return isatty(fileno(stdout));
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// I_Init
|
||||
//
|
||||
/*
|
||||
void I_Init (void)
|
||||
{
|
||||
I_CheckIsScreensaver();
|
||||
I_InitTimer();
|
||||
I_InitJoystick();
|
||||
}
|
||||
void I_BindVariables(void)
|
||||
{
|
||||
I_BindVideoVariables();
|
||||
I_BindJoystickVariables();
|
||||
I_BindSoundVariables();
|
||||
}
|
||||
*/
|
||||
|
||||
//
|
||||
// I_Quit
|
||||
//
|
||||
|
||||
void I_Quit (void)
|
||||
{
|
||||
atexit_listentry_t *entry;
|
||||
|
||||
// Run through all exit functions
|
||||
|
||||
entry = exit_funcs;
|
||||
|
||||
while (entry != NULL)
|
||||
{
|
||||
entry->func();
|
||||
entry = entry->next;
|
||||
}
|
||||
|
||||
#if ORIGCODE
|
||||
SDL_Quit();
|
||||
|
||||
exit(0);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(_WIN32) && !defined(__MACOSX__) && !defined(__DJGPP__)
|
||||
#define ZENITY_BINARY "/usr/bin/zenity"
|
||||
|
||||
// returns non-zero if zenity is available
|
||||
|
||||
static int ZenityAvailable(void)
|
||||
{
|
||||
return system(ZENITY_BINARY " --help >/dev/null 2>&1") == 0;
|
||||
}
|
||||
|
||||
// Escape special characters in the given string so that they can be
|
||||
// safely enclosed in shell quotes.
|
||||
|
||||
static char *EscapeShellString(char *string)
|
||||
{
|
||||
char *result;
|
||||
char *r, *s;
|
||||
|
||||
// In the worst case, every character might be escaped.
|
||||
result = malloc(strlen(string) * 2 + 3);
|
||||
r = result;
|
||||
|
||||
// Enclosing quotes.
|
||||
*r = '"';
|
||||
++r;
|
||||
|
||||
for (s = string; *s != '\0'; ++s)
|
||||
{
|
||||
// From the bash manual:
|
||||
//
|
||||
// "Enclosing characters in double quotes preserves the literal
|
||||
// value of all characters within the quotes, with the exception
|
||||
// of $, `, \, and, when history expansion is enabled, !."
|
||||
//
|
||||
// Therefore, escape these characters by prefixing with a backslash.
|
||||
|
||||
if (strchr("$`\\!", *s) != NULL)
|
||||
{
|
||||
*r = '\\';
|
||||
++r;
|
||||
}
|
||||
|
||||
*r = *s;
|
||||
++r;
|
||||
}
|
||||
|
||||
// Enclosing quotes.
|
||||
*r = '"';
|
||||
++r;
|
||||
*r = '\0';
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Open a native error box with a message using zenity
|
||||
|
||||
static int ZenityErrorBox(char *message)
|
||||
{
|
||||
int result;
|
||||
char *escaped_message;
|
||||
char *errorboxpath;
|
||||
static size_t errorboxpath_size;
|
||||
|
||||
if (!ZenityAvailable())
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
escaped_message = EscapeShellString(message);
|
||||
|
||||
errorboxpath_size = strlen(ZENITY_BINARY) + strlen(escaped_message) + 19;
|
||||
errorboxpath = malloc(errorboxpath_size);
|
||||
M_snprintf(errorboxpath, errorboxpath_size, "%s --error --text=%s",
|
||||
ZENITY_BINARY, escaped_message);
|
||||
|
||||
result = system(errorboxpath);
|
||||
|
||||
free(errorboxpath);
|
||||
free(escaped_message);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif /* !defined(_WIN32) && !defined(__MACOSX__) && !defined(__DJGPP__) */
|
||||
|
||||
|
||||
//
|
||||
// I_Error
|
||||
//
|
||||
|
||||
static boolean already_quitting = false;
|
||||
|
||||
void I_Error (char *error, ...)
|
||||
{
|
||||
char msgbuf[512];
|
||||
va_list argptr;
|
||||
atexit_listentry_t *entry;
|
||||
boolean exit_gui_popup;
|
||||
|
||||
if (already_quitting)
|
||||
{
|
||||
fprintf(stderr, "Warning: recursive call to I_Error detected.\n");
|
||||
#if ORIGCODE
|
||||
exit(-1);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
already_quitting = true;
|
||||
}
|
||||
|
||||
// Message first.
|
||||
va_start(argptr, error);
|
||||
//fprintf(stderr, "\nError: ");
|
||||
vfprintf(stderr, error, argptr);
|
||||
fprintf(stderr, "\n\n");
|
||||
va_end(argptr);
|
||||
fflush(stderr);
|
||||
|
||||
// Write a copy of the message into buffer.
|
||||
va_start(argptr, error);
|
||||
memset(msgbuf, 0, sizeof(msgbuf));
|
||||
M_vsnprintf(msgbuf, sizeof(msgbuf), error, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
// Shutdown. Here might be other errors.
|
||||
|
||||
entry = exit_funcs;
|
||||
|
||||
while (entry != NULL)
|
||||
{
|
||||
if (entry->run_on_error)
|
||||
{
|
||||
entry->func();
|
||||
}
|
||||
|
||||
entry = entry->next;
|
||||
}
|
||||
|
||||
exit_gui_popup = !M_ParmExists("-nogui");
|
||||
|
||||
// Pop up a GUI dialog box to show the error message, if the
|
||||
// game was not run from the console (and the user will
|
||||
// therefore be unable to otherwise see the message).
|
||||
if (exit_gui_popup && !I_ConsoleStdout())
|
||||
#ifdef _WIN32
|
||||
{
|
||||
wchar_t wmsgbuf[512];
|
||||
|
||||
MultiByteToWideChar(CP_ACP, 0,
|
||||
msgbuf, strlen(msgbuf) + 1,
|
||||
wmsgbuf, sizeof(wmsgbuf));
|
||||
|
||||
MessageBoxW(NULL, wmsgbuf, L"", MB_OK);
|
||||
}
|
||||
#elif defined(__MACOSX__)
|
||||
{
|
||||
CFStringRef message;
|
||||
int i;
|
||||
|
||||
// The CoreFoundation message box wraps text lines, so replace
|
||||
// newline characters with spaces so that multiline messages
|
||||
// are continuous.
|
||||
|
||||
for (i = 0; msgbuf[i] != '\0'; ++i)
|
||||
{
|
||||
if (msgbuf[i] == '\n')
|
||||
{
|
||||
msgbuf[i] = ' ';
|
||||
}
|
||||
}
|
||||
|
||||
message = CFStringCreateWithCString(NULL, msgbuf,
|
||||
kCFStringEncodingUTF8);
|
||||
|
||||
CFUserNotificationDisplayNotice(0,
|
||||
kCFUserNotificationCautionAlertLevel,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
CFSTR(PACKAGE_STRING),
|
||||
message,
|
||||
NULL);
|
||||
}
|
||||
#elif defined(__DJGPP__)
|
||||
{
|
||||
printf("%s\n", msgbuf);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
#else
|
||||
{
|
||||
ZenityErrorBox(msgbuf);
|
||||
}
|
||||
#endif
|
||||
|
||||
// abort();
|
||||
#if ORIGCODE
|
||||
SDL_Quit();
|
||||
|
||||
exit(-1);
|
||||
#else
|
||||
exit(-1);
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Read Access Violation emulation.
|
||||
//
|
||||
// From PrBoom+, by entryway.
|
||||
//
|
||||
|
||||
// C:\>debug
|
||||
// -d 0:0
|
||||
//
|
||||
// DOS 6.22:
|
||||
// 0000:0000 (57 92 19 00) F4 06 70 00-(16 00)
|
||||
// DOS 7.1:
|
||||
// 0000:0000 (9E 0F C9 00) 65 04 70 00-(16 00)
|
||||
// Win98:
|
||||
// 0000:0000 (9E 0F C9 00) 65 04 70 00-(16 00)
|
||||
// DOSBox under XP:
|
||||
// 0000:0000 (00 00 00 F1) ?? ?? ?? 00-(07 00)
|
||||
|
||||
#define DOS_MEM_DUMP_SIZE 10
|
||||
|
||||
static const unsigned char mem_dump_dos622[DOS_MEM_DUMP_SIZE] = {
|
||||
0x57, 0x92, 0x19, 0x00, 0xF4, 0x06, 0x70, 0x00, 0x16, 0x00};
|
||||
static const unsigned char mem_dump_win98[DOS_MEM_DUMP_SIZE] = {
|
||||
0x9E, 0x0F, 0xC9, 0x00, 0x65, 0x04, 0x70, 0x00, 0x16, 0x00};
|
||||
static const unsigned char mem_dump_dosbox[DOS_MEM_DUMP_SIZE] = {
|
||||
0x00, 0x00, 0x00, 0xF1, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00};
|
||||
static unsigned char mem_dump_custom[DOS_MEM_DUMP_SIZE];
|
||||
|
||||
static const unsigned char *dos_mem_dump = mem_dump_dos622;
|
||||
|
||||
boolean I_GetMemoryValue(unsigned int offset, void *value, int size)
|
||||
{
|
||||
static boolean firsttime = true;
|
||||
|
||||
if (firsttime)
|
||||
{
|
||||
int p, i, val;
|
||||
|
||||
firsttime = false;
|
||||
i = 0;
|
||||
|
||||
//!
|
||||
// @category compat
|
||||
// @arg <version>
|
||||
//
|
||||
// Specify DOS version to emulate for NULL pointer dereference
|
||||
// emulation. Supported versions are: dos622, dos71, dosbox.
|
||||
// The default is to emulate DOS 7.1 (Windows 98).
|
||||
//
|
||||
|
||||
p = M_CheckParmWithArgs("-setmem", 1);
|
||||
|
||||
if (p > 0)
|
||||
{
|
||||
if (!strcasecmp(myargv[p + 1], "dos622"))
|
||||
{
|
||||
dos_mem_dump = mem_dump_dos622;
|
||||
}
|
||||
if (!strcasecmp(myargv[p + 1], "dos71"))
|
||||
{
|
||||
dos_mem_dump = mem_dump_win98;
|
||||
}
|
||||
else if (!strcasecmp(myargv[p + 1], "dosbox"))
|
||||
{
|
||||
dos_mem_dump = mem_dump_dosbox;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < DOS_MEM_DUMP_SIZE; ++i)
|
||||
{
|
||||
++p;
|
||||
|
||||
if (p >= myargc || myargv[p][0] == '-')
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
M_StrToInt(myargv[p], &val);
|
||||
mem_dump_custom[i++] = (unsigned char) val;
|
||||
}
|
||||
|
||||
dos_mem_dump = mem_dump_custom;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (size)
|
||||
{
|
||||
case 1:
|
||||
*((unsigned char *) value) = dos_mem_dump[offset];
|
||||
return true;
|
||||
case 2:
|
||||
*((unsigned short *) value) = dos_mem_dump[offset]
|
||||
| (dos_mem_dump[offset + 1] << 8);
|
||||
return true;
|
||||
case 4:
|
||||
*((unsigned int *) value) = dos_mem_dump[offset]
|
||||
| (dos_mem_dump[offset + 1] << 8)
|
||||
| (dos_mem_dump[offset + 2] << 16)
|
||||
| (dos_mem_dump[offset + 3] << 24);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
84
src/kernel/userland/doom/i_system.h
Normal file
84
src/kernel/userland/doom/i_system.h
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// System specific interface stuff.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __I_SYSTEM__
|
||||
#define __I_SYSTEM__
|
||||
|
||||
#include "d_ticcmd.h"
|
||||
#include "d_event.h"
|
||||
|
||||
|
||||
typedef void (*atexit_func_t)(void);
|
||||
|
||||
// Called by DoomMain.
|
||||
void I_Init (void);
|
||||
|
||||
// Called by startup code
|
||||
// to get the ammount of memory to malloc
|
||||
// for the zone management.
|
||||
byte* I_ZoneBase (int *size);
|
||||
|
||||
boolean I_ConsoleStdout(void);
|
||||
|
||||
|
||||
// Asynchronous interrupt functions should maintain private queues
|
||||
// that are read by the synchronous functions
|
||||
// to be converted into events.
|
||||
|
||||
// Either returns a null ticcmd,
|
||||
// or calls a loadable driver to build it.
|
||||
// This ticcmd will then be modified by the gameloop
|
||||
// for normal input.
|
||||
ticcmd_t* I_BaseTiccmd (void);
|
||||
|
||||
|
||||
// Called by M_Responder when quit is selected.
|
||||
// Clean exit, displays sell blurb.
|
||||
void I_Quit (void);
|
||||
|
||||
void I_Error (char *error, ...);
|
||||
|
||||
void I_Tactile (int on, int off, int total);
|
||||
|
||||
boolean I_GetMemoryValue(unsigned int offset, void *value, int size);
|
||||
|
||||
// Schedule a function to be called when the program exits.
|
||||
// If run_if_error is true, the function is called if the exit
|
||||
// is due to an error (I_Error)
|
||||
|
||||
void I_AtExit(atexit_func_t func, boolean run_if_error);
|
||||
|
||||
// Add all system-specific config file variable bindings.
|
||||
|
||||
void I_BindVariables(void);
|
||||
|
||||
// Print startup banner copyright message.
|
||||
|
||||
void I_PrintStartupBanner(char *gamedescription);
|
||||
|
||||
// Print a centered text banner displaying the given string.
|
||||
|
||||
void I_PrintBanner(char *text);
|
||||
|
||||
// Print a dividing line for startup banners.
|
||||
|
||||
void I_PrintDivider(void);
|
||||
|
||||
#endif
|
||||
|
||||
96
src/kernel/userland/doom/i_timer.c
Normal file
96
src/kernel/userland/doom/i_timer.c
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// Timer functions.
|
||||
//
|
||||
|
||||
#include "i_timer.h"
|
||||
#include "doomtype.h"
|
||||
|
||||
#include "doomgeneric.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
//#include <sys/time.h>
|
||||
//#include <unistd.h>
|
||||
|
||||
|
||||
//
|
||||
// I_GetTime
|
||||
// returns time in 1/35th second tics
|
||||
//
|
||||
|
||||
static uint32_t basetime = 0;
|
||||
|
||||
|
||||
int I_GetTicks(void)
|
||||
{
|
||||
return DG_GetTicksMs();
|
||||
}
|
||||
|
||||
int I_GetTime (void)
|
||||
{
|
||||
uint32_t ticks;
|
||||
|
||||
ticks = I_GetTicks();
|
||||
|
||||
if (basetime == 0)
|
||||
basetime = ticks;
|
||||
|
||||
ticks -= basetime;
|
||||
|
||||
return (ticks * TICRATE) / 1000;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Same as I_GetTime, but returns time in milliseconds
|
||||
//
|
||||
|
||||
int I_GetTimeMS(void)
|
||||
{
|
||||
uint32_t ticks;
|
||||
|
||||
ticks = I_GetTicks();
|
||||
|
||||
if (basetime == 0)
|
||||
basetime = ticks;
|
||||
|
||||
return ticks - basetime;
|
||||
}
|
||||
|
||||
// Sleep for a specified number of ms
|
||||
|
||||
void I_Sleep(int ms)
|
||||
{
|
||||
//SDL_Delay(ms);
|
||||
//usleep (ms * 1000);
|
||||
|
||||
DG_SleepMs(ms);
|
||||
}
|
||||
|
||||
void I_WaitVBL(int count)
|
||||
{
|
||||
//I_Sleep((count * 1000) / 70);
|
||||
}
|
||||
|
||||
|
||||
void I_InitTimer(void)
|
||||
{
|
||||
// initialize timer
|
||||
|
||||
//SDL_Init(SDL_INIT_TIMER);
|
||||
}
|
||||
|
||||
42
src/kernel/userland/doom/i_timer.h
Normal file
42
src/kernel/userland/doom/i_timer.h
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// System-specific timer interface
|
||||
//
|
||||
|
||||
|
||||
#ifndef __I_TIMER__
|
||||
#define __I_TIMER__
|
||||
|
||||
#define TICRATE 35
|
||||
|
||||
// Called by D_DoomLoop,
|
||||
// returns current time in tics.
|
||||
int I_GetTime (void);
|
||||
|
||||
// returns current time in ms
|
||||
int I_GetTimeMS (void);
|
||||
|
||||
// Pause for a specified number of ms
|
||||
void I_Sleep(int ms);
|
||||
|
||||
// Initialize timer
|
||||
void I_InitTimer(void);
|
||||
|
||||
// Wait for vertical retrace or pause a bit.
|
||||
void I_WaitVBL(int count);
|
||||
|
||||
#endif
|
||||
|
||||
495
src/kernel/userland/doom/i_video.c
Normal file
495
src/kernel/userland/doom/i_video.c
Normal file
|
|
@ -0,0 +1,495 @@
|
|||
// Emacs style mode select -*- C++ -*-
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Id:$
|
||||
//
|
||||
// Copyright (C) 1993-1996 by id Software, Inc.
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// $Log:$
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// DOOM graphics stuff for X11, UNIX.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
static const char
|
||||
rcsid[] = "$Id: i_x.c,v 1.6 1997/02/03 22:45:10 b1 Exp $";
|
||||
|
||||
#include "config.h"
|
||||
#include "v_video.h"
|
||||
#include "m_argv.h"
|
||||
#include "d_event.h"
|
||||
#include "d_main.h"
|
||||
#include "i_video.h"
|
||||
#include "i_system.h"
|
||||
#include "z_zone.h"
|
||||
|
||||
#include "tables.h"
|
||||
#include "doomkeys.h"
|
||||
|
||||
#include "doomgeneric.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
//#define CMAP256
|
||||
|
||||
struct FB_BitField
|
||||
{
|
||||
uint32_t offset; /* beginning of bitfield */
|
||||
uint32_t length; /* length of bitfield */
|
||||
};
|
||||
|
||||
struct FB_ScreenInfo
|
||||
{
|
||||
uint32_t xres; /* visible resolution */
|
||||
uint32_t yres;
|
||||
uint32_t xres_virtual; /* virtual resolution */
|
||||
uint32_t yres_virtual;
|
||||
|
||||
uint32_t bits_per_pixel; /* guess what */
|
||||
|
||||
/* >1 = FOURCC */
|
||||
struct FB_BitField red; /* bitfield in s_Fb mem if true color, */
|
||||
struct FB_BitField green; /* else only length is significant */
|
||||
struct FB_BitField blue;
|
||||
struct FB_BitField transp; /* transparency */
|
||||
};
|
||||
|
||||
static struct FB_ScreenInfo s_Fb;
|
||||
int fb_scaling = 1;
|
||||
int usemouse = 0;
|
||||
|
||||
|
||||
#ifdef CMAP256
|
||||
|
||||
boolean palette_changed;
|
||||
struct color colors[256];
|
||||
|
||||
#else // CMAP256
|
||||
|
||||
static struct color colors[256];
|
||||
|
||||
|
||||
#endif // CMAP256
|
||||
|
||||
|
||||
void I_GetEvent(void);
|
||||
|
||||
// The screen buffer; this is modified to draw things to the screen
|
||||
|
||||
byte *I_VideoBuffer = NULL;
|
||||
|
||||
// If true, game is running as a screensaver
|
||||
|
||||
boolean screensaver_mode = false;
|
||||
|
||||
// Flag indicating whether the screen is currently visible:
|
||||
// when the screen isnt visible, don't render the screen
|
||||
|
||||
boolean screenvisible;
|
||||
|
||||
// Mouse acceleration
|
||||
//
|
||||
// This emulates some of the behavior of DOS mouse drivers by increasing
|
||||
// the speed when the mouse is moved fast.
|
||||
//
|
||||
// The mouse input values are input directly to the game, but when
|
||||
// the values exceed the value of mouse_threshold, they are multiplied
|
||||
// by mouse_acceleration to increase the speed.
|
||||
|
||||
int mouse_acceleration = 2;
|
||||
int mouse_threshold = 10;
|
||||
|
||||
// Gamma correction level to use
|
||||
|
||||
int usegamma = 0;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
byte r;
|
||||
byte g;
|
||||
byte b;
|
||||
} col_t;
|
||||
|
||||
// Palette converted to RGB565
|
||||
|
||||
static uint16_t rgb565_palette[256];
|
||||
|
||||
void cmap_to_rgb565(uint16_t * out, uint8_t * in, int in_pixels)
|
||||
{
|
||||
int i, j;
|
||||
struct color c;
|
||||
uint16_t r, g, b;
|
||||
|
||||
for (i = 0; i < in_pixels; i++)
|
||||
{
|
||||
c = colors[*in];
|
||||
r = ((uint16_t)(c.r >> 3)) << 11;
|
||||
g = ((uint16_t)(c.g >> 2)) << 5;
|
||||
b = ((uint16_t)(c.b >> 3)) << 0;
|
||||
*out = (r | g | b);
|
||||
|
||||
in++;
|
||||
for (j = 0; j < fb_scaling; j++) {
|
||||
out++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void cmap_to_fb(uint8_t *out, uint8_t *in, int in_pixels)
|
||||
{
|
||||
int i, k;
|
||||
struct color c;
|
||||
uint32_t pix;
|
||||
|
||||
for (i = 0; i < in_pixels; i++)
|
||||
{
|
||||
c = colors[*in]; // R:8 G:8 B:8
|
||||
|
||||
if (s_Fb.bits_per_pixel == 16)
|
||||
{
|
||||
// RGB565 packing
|
||||
uint16_t p = ((c.r & 0xF8) << 8) |
|
||||
((c.g & 0xFC) << 3) |
|
||||
(c.b >> 3);
|
||||
|
||||
#ifdef SYS_BIG_ENDIAN
|
||||
p = swapeLE16(p); // can't use SHORT() because this needs to stay unsigned
|
||||
#endif
|
||||
for (k = 0; k < fb_scaling; k++) {
|
||||
*(uint16_t *)out = p;
|
||||
out += 2;
|
||||
}
|
||||
}
|
||||
else if (s_Fb.bits_per_pixel == 32)
|
||||
{
|
||||
// Assuming RGBA8888
|
||||
pix = (c.r << s_Fb.red.offset) |
|
||||
(c.g << s_Fb.green.offset) |
|
||||
(c.b << s_Fb.blue.offset);
|
||||
|
||||
#ifdef SYS_BIG_ENDIAN
|
||||
pix = swapLE32(pix);
|
||||
#endif
|
||||
for (k = 0; k < fb_scaling; k++) {
|
||||
*(uint32_t *)out = pix;
|
||||
out += 4;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// no clue how to convert this
|
||||
I_Error("No idea how to convert %d bpp pixels", s_Fb.bits_per_pixel);
|
||||
}
|
||||
|
||||
in++;
|
||||
}
|
||||
}
|
||||
|
||||
void I_InitGraphics (void)
|
||||
{
|
||||
int i, gfxmodeparm;
|
||||
char *mode;
|
||||
|
||||
memset(&s_Fb, 0, sizeof(struct FB_ScreenInfo));
|
||||
s_Fb.xres = DOOMGENERIC_RESX;
|
||||
s_Fb.yres = DOOMGENERIC_RESY;
|
||||
s_Fb.xres_virtual = s_Fb.xres;
|
||||
s_Fb.yres_virtual = s_Fb.yres;
|
||||
|
||||
#ifdef CMAP256
|
||||
|
||||
s_Fb.bits_per_pixel = 8;
|
||||
|
||||
#else // CMAP256
|
||||
|
||||
gfxmodeparm = M_CheckParmWithArgs("-gfxmode", 1);
|
||||
|
||||
if (gfxmodeparm) {
|
||||
mode = myargv[gfxmodeparm + 1];
|
||||
}
|
||||
else {
|
||||
// default to rgba8888 like the old behavior, for compatibility
|
||||
// maybe could warn here?
|
||||
mode = "rgba8888";
|
||||
}
|
||||
|
||||
if (strcmp(mode, "rgba8888") == 0) {
|
||||
// default mode
|
||||
s_Fb.bits_per_pixel = 32;
|
||||
|
||||
s_Fb.blue.length = 8;
|
||||
s_Fb.green.length = 8;
|
||||
s_Fb.red.length = 8;
|
||||
s_Fb.transp.length = 8;
|
||||
|
||||
s_Fb.blue.offset = 0;
|
||||
s_Fb.green.offset = 8;
|
||||
s_Fb.red.offset = 16;
|
||||
s_Fb.transp.offset = 24;
|
||||
}
|
||||
|
||||
else if (strcmp(mode, "rgb565") == 0) {
|
||||
s_Fb.bits_per_pixel = 16;
|
||||
|
||||
s_Fb.blue.length = 5;
|
||||
s_Fb.green.length = 6;
|
||||
s_Fb.red.length = 5;
|
||||
s_Fb.transp.length = 0;
|
||||
|
||||
s_Fb.blue.offset = 11;
|
||||
s_Fb.green.offset = 5;
|
||||
s_Fb.red.offset = 0;
|
||||
s_Fb.transp.offset = 16;
|
||||
}
|
||||
else
|
||||
I_Error("Unknown gfxmode value: %s\n", mode);
|
||||
|
||||
|
||||
#endif // CMAP256
|
||||
|
||||
printf("I_InitGraphics: framebuffer: x_res: %d, y_res: %d, x_virtual: %d, y_virtual: %d, bpp: %d\n",
|
||||
s_Fb.xres, s_Fb.yres, s_Fb.xres_virtual, s_Fb.yres_virtual, s_Fb.bits_per_pixel);
|
||||
|
||||
printf("I_InitGraphics: framebuffer: RGBA: %d%d%d%d, red_off: %d, green_off: %d, blue_off: %d, transp_off: %d\n",
|
||||
s_Fb.red.length, s_Fb.green.length, s_Fb.blue.length, s_Fb.transp.length, s_Fb.red.offset, s_Fb.green.offset, s_Fb.blue.offset, s_Fb.transp.offset);
|
||||
|
||||
printf("I_InitGraphics: DOOM screen size: w x h: %d x %d\n", SCREENWIDTH, SCREENHEIGHT);
|
||||
|
||||
|
||||
i = M_CheckParmWithArgs("-scaling", 1);
|
||||
if (i > 0) {
|
||||
i = atoi(myargv[i + 1]);
|
||||
fb_scaling = i;
|
||||
printf("I_InitGraphics: Scaling factor: %d\n", fb_scaling);
|
||||
} else {
|
||||
fb_scaling = s_Fb.xres / SCREENWIDTH;
|
||||
if (s_Fb.yres / SCREENHEIGHT < fb_scaling)
|
||||
fb_scaling = s_Fb.yres / SCREENHEIGHT;
|
||||
printf("I_InitGraphics: Auto-scaling factor: %d\n", fb_scaling);
|
||||
}
|
||||
|
||||
|
||||
/* Allocate screen to draw to */
|
||||
I_VideoBuffer = (byte*)Z_Malloc (SCREENWIDTH * SCREENHEIGHT, PU_STATIC, NULL); // For DOOM to draw on
|
||||
|
||||
screenvisible = true;
|
||||
|
||||
extern void I_InitInput(void);
|
||||
I_InitInput();
|
||||
}
|
||||
|
||||
void I_ShutdownGraphics (void)
|
||||
{
|
||||
Z_Free (I_VideoBuffer);
|
||||
}
|
||||
|
||||
void I_StartFrame (void)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void I_StartTic (void)
|
||||
{
|
||||
I_GetEvent();
|
||||
}
|
||||
|
||||
void I_UpdateNoBlit (void)
|
||||
{
|
||||
}
|
||||
|
||||
//
|
||||
// I_FinishUpdate
|
||||
//
|
||||
|
||||
void I_FinishUpdate (void)
|
||||
{
|
||||
int y;
|
||||
int x_offset, y_offset, x_offset_end;
|
||||
unsigned char *line_in, *line_out;
|
||||
|
||||
/* Offsets in case FB is bigger than DOOM */
|
||||
/* 600 = s_Fb heigt, 200 screenheight */
|
||||
/* 600 = s_Fb heigt, 200 screenheight */
|
||||
/* 2048 =s_Fb width, 320 screenwidth */
|
||||
y_offset = (((s_Fb.yres - (SCREENHEIGHT * fb_scaling)) * s_Fb.bits_per_pixel/8)) / 2;
|
||||
x_offset = (((s_Fb.xres - (SCREENWIDTH * fb_scaling)) * s_Fb.bits_per_pixel/8)) / 2; // XXX: siglent FB hack: /4 instead of /2, since it seems to handle the resolution in a funny way
|
||||
//x_offset = 0;
|
||||
x_offset_end = ((s_Fb.xres - (SCREENWIDTH * fb_scaling)) * s_Fb.bits_per_pixel/8) - x_offset;
|
||||
|
||||
/* DRAW SCREEN */
|
||||
line_in = (unsigned char *) I_VideoBuffer;
|
||||
line_out = (unsigned char *) DG_ScreenBuffer;
|
||||
|
||||
y = SCREENHEIGHT;
|
||||
|
||||
while (y--)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < fb_scaling; i++) {
|
||||
line_out += x_offset;
|
||||
#ifdef CMAP256
|
||||
if (fb_scaling == 1) {
|
||||
memcpy(line_out, line_in, SCREENWIDTH); /* fb_width is bigger than Doom SCREENWIDTH... */
|
||||
} else {
|
||||
int j;
|
||||
|
||||
for (j = 0; j < SCREENWIDTH; j++) {
|
||||
int k;
|
||||
for (k = 0; k < fb_scaling; k++) {
|
||||
line_out[j * fb_scaling + k] = line_in[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
//cmap_to_rgb565((void*)line_out, (void*)line_in, SCREENWIDTH);
|
||||
cmap_to_fb((void*)line_out, (void*)line_in, SCREENWIDTH);
|
||||
#endif
|
||||
line_out += (SCREENWIDTH * fb_scaling * (s_Fb.bits_per_pixel/8)) + x_offset_end;
|
||||
}
|
||||
line_in += SCREENWIDTH;
|
||||
}
|
||||
|
||||
DG_DrawFrame();
|
||||
}
|
||||
|
||||
//
|
||||
// I_ReadScreen
|
||||
//
|
||||
void I_ReadScreen (byte* scr)
|
||||
{
|
||||
memcpy (scr, I_VideoBuffer, SCREENWIDTH * SCREENHEIGHT);
|
||||
}
|
||||
|
||||
//
|
||||
// I_SetPalette
|
||||
//
|
||||
#define GFX_RGB565(r, g, b) ((((r & 0xF8) >> 3) << 11) | (((g & 0xFC) >> 2) << 5) | ((b & 0xF8) >> 3))
|
||||
#define GFX_RGB565_R(color) ((0xF800 & color) >> 11)
|
||||
#define GFX_RGB565_G(color) ((0x07E0 & color) >> 5)
|
||||
#define GFX_RGB565_B(color) (0x001F & color)
|
||||
|
||||
void I_SetPalette (byte* palette)
|
||||
{
|
||||
int i;
|
||||
//col_t* c;
|
||||
|
||||
//for (i = 0; i < 256; i++)
|
||||
//{
|
||||
// c = (col_t*)palette;
|
||||
|
||||
// rgb565_palette[i] = GFX_RGB565(gammatable[usegamma][c->r],
|
||||
// gammatable[usegamma][c->g],
|
||||
// gammatable[usegamma][c->b]);
|
||||
|
||||
// palette += 3;
|
||||
//}
|
||||
|
||||
|
||||
/* performance boost:
|
||||
* map to the right pixel format over here! */
|
||||
|
||||
for (i=0; i<256; ++i ) {
|
||||
colors[i].a = 0;
|
||||
colors[i].r = gammatable[usegamma][*palette++];
|
||||
colors[i].g = gammatable[usegamma][*palette++];
|
||||
colors[i].b = gammatable[usegamma][*palette++];
|
||||
}
|
||||
|
||||
#ifdef CMAP256
|
||||
|
||||
palette_changed = true;
|
||||
|
||||
#endif // CMAP256
|
||||
}
|
||||
|
||||
// Given an RGB value, find the closest matching palette index.
|
||||
|
||||
int I_GetPaletteIndex (int r, int g, int b)
|
||||
{
|
||||
int best, best_diff, diff;
|
||||
int i;
|
||||
col_t color;
|
||||
|
||||
printf("I_GetPaletteIndex\n");
|
||||
|
||||
best = 0;
|
||||
best_diff = INT_MAX;
|
||||
|
||||
for (i = 0; i < 256; ++i)
|
||||
{
|
||||
color.r = GFX_RGB565_R(rgb565_palette[i]);
|
||||
color.g = GFX_RGB565_G(rgb565_palette[i]);
|
||||
color.b = GFX_RGB565_B(rgb565_palette[i]);
|
||||
|
||||
diff = (r - color.r) * (r - color.r)
|
||||
+ (g - color.g) * (g - color.g)
|
||||
+ (b - color.b) * (b - color.b);
|
||||
|
||||
if (diff < best_diff)
|
||||
{
|
||||
best = i;
|
||||
best_diff = diff;
|
||||
}
|
||||
|
||||
if (diff == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return best;
|
||||
}
|
||||
|
||||
void I_BeginRead (void)
|
||||
{
|
||||
}
|
||||
|
||||
void I_EndRead (void)
|
||||
{
|
||||
}
|
||||
|
||||
void I_SetWindowTitle (char *title)
|
||||
{
|
||||
DG_SetWindowTitle(title);
|
||||
}
|
||||
|
||||
void I_GraphicsCheckCommandLine (void)
|
||||
{
|
||||
}
|
||||
|
||||
void I_SetGrabMouseCallback (grabmouse_callback_t func)
|
||||
{
|
||||
}
|
||||
|
||||
void I_EnableLoadingDisk(void)
|
||||
{
|
||||
}
|
||||
|
||||
void I_BindVideoVariables (void)
|
||||
{
|
||||
}
|
||||
|
||||
void I_DisplayFPSDots (boolean dots_on)
|
||||
{
|
||||
}
|
||||
|
||||
void I_CheckIsScreensaver (void)
|
||||
{
|
||||
}
|
||||
175
src/kernel/userland/doom/i_video.h
Normal file
175
src/kernel/userland/doom/i_video.h
Normal file
|
|
@ -0,0 +1,175 @@
|
|||
//
|
||||
// Copyright(C) 1993-1996 Id Software, Inc.
|
||||
// Copyright(C) 2005-2014 Simon Howard
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// System specific interface stuff.
|
||||
//
|
||||
|
||||
|
||||
#ifndef __I_VIDEO__
|
||||
#define __I_VIDEO__
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
// Screen width and height.
|
||||
|
||||
#define SCREENWIDTH 320
|
||||
#define SCREENHEIGHT 200
|
||||
|
||||
// Screen width used for "squash" scale functions
|
||||
|
||||
#define SCREENWIDTH_4_3 256
|
||||
|
||||
// Screen height used for "stretch" scale functions.
|
||||
|
||||
#define SCREENHEIGHT_4_3 240
|
||||
|
||||
#define MAX_MOUSE_BUTTONS 8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
// Screen width and height
|
||||
|
||||
int width;
|
||||
int height;
|
||||
|
||||
// Initialisation function to call when using this mode.
|
||||
// Called with a pointer to the Doom palette.
|
||||
//
|
||||
// If NULL, no init function is called.
|
||||
|
||||
void (*InitMode)(byte *palette);
|
||||
|
||||
// Function to call to draw the screen from the source buffer.
|
||||
// Return true if draw was successful.
|
||||
|
||||
boolean (*DrawScreen)(int x1, int y1, int x2, int y2);
|
||||
|
||||
// If true, this is a "poor quality" mode. The autoadjust
|
||||
// code should always attempt to use a different mode to this
|
||||
// mode in fullscreen.
|
||||
//
|
||||
// Some notes about what "poor quality" means in this context:
|
||||
//
|
||||
// The aspect ratio correction works by scaling up to the larger
|
||||
// screen size and then drawing pixels on the edges between the
|
||||
// "virtual" pixels so that an authentic blocky look-and-feel is
|
||||
// achieved.
|
||||
//
|
||||
// For a mode like 640x480, you can imagine the grid of the
|
||||
// "original" pixels spaced out, with extra "blurry" pixels added
|
||||
// in the space between them to fill it out. However, when you're
|
||||
// running at a resolution like 320x240, this is not the case. In
|
||||
// the small screen case, every single pixel has to be a blurry
|
||||
// interpolation of two pixels from the original image.
|
||||
//
|
||||
// If you run in 320x240 and put your face up close to the screen
|
||||
// you can see this: it's particularly visible in the small yellow
|
||||
// status bar numbers for example. Overall it still looks "okay"
|
||||
// but there's an obvious - albeit small - deterioration in
|
||||
// quality.
|
||||
//
|
||||
// Once you get to 640x480, all the original pixels are there at
|
||||
// least once and it's okay (the higher the resolution, the more
|
||||
// accurate it is). When I first wrote the code I was expecting
|
||||
// that even higher resolutions would be needed before it would
|
||||
// look acceptable, but it turned out to be okay even at 640x480.
|
||||
|
||||
boolean poor_quality;
|
||||
} screen_mode_t;
|
||||
|
||||
typedef boolean (*grabmouse_callback_t)(void);
|
||||
|
||||
// Called by D_DoomMain,
|
||||
// determines the hardware configuration
|
||||
// and sets up the video mode
|
||||
void I_InitGraphics (void);
|
||||
|
||||
void I_GraphicsCheckCommandLine(void);
|
||||
|
||||
void I_ShutdownGraphics(void);
|
||||
|
||||
// Takes full 8 bit values.
|
||||
void I_SetPalette (byte* palette);
|
||||
int I_GetPaletteIndex(int r, int g, int b);
|
||||
|
||||
void I_UpdateNoBlit (void);
|
||||
void I_FinishUpdate (void);
|
||||
|
||||
void I_ReadScreen (byte* scr);
|
||||
|
||||
void I_BeginRead (void);
|
||||
|
||||
void I_SetWindowTitle(char *title);
|
||||
|
||||
void I_CheckIsScreensaver(void);
|
||||
void I_SetGrabMouseCallback(grabmouse_callback_t func);
|
||||
|
||||
void I_DisplayFPSDots(boolean dots_on);
|
||||
void I_BindVideoVariables(void);
|
||||
|
||||
void I_InitWindowTitle(void);
|
||||
void I_InitWindowIcon(void);
|
||||
|
||||
// Called before processing any tics in a frame (just after displaying a frame).
|
||||
// Time consuming syncronous operations are performed here (joystick reading).
|
||||
|
||||
void I_StartFrame (void);
|
||||
|
||||
// Called before processing each tic in a frame.
|
||||
// Quick syncronous operations are performed here.
|
||||
|
||||
void I_StartTic (void);
|
||||
|
||||
// Enable the loading disk image displayed when reading from disk.
|
||||
|
||||
void I_EnableLoadingDisk(void);
|
||||
|
||||
void I_EndRead (void);
|
||||
|
||||
struct color {
|
||||
uint32_t b:8;
|
||||
uint32_t g:8;
|
||||
uint32_t r:8;
|
||||
uint32_t a:8;
|
||||
};
|
||||
|
||||
|
||||
extern char *video_driver;
|
||||
extern boolean screenvisible;
|
||||
|
||||
extern int mouse_acceleration;
|
||||
extern int mouse_threshold;
|
||||
extern int vanilla_keyboard_mapping;
|
||||
extern boolean screensaver_mode;
|
||||
extern int usegamma;
|
||||
extern byte *I_VideoBuffer;
|
||||
|
||||
extern int screen_width;
|
||||
extern int screen_height;
|
||||
extern int screen_bpp;
|
||||
extern int fullscreen;
|
||||
extern int aspect_ratio_correct;
|
||||
|
||||
extern int show_diskicon;
|
||||
extern int diskicon_readbytes;
|
||||
|
||||
#ifdef CMAP256
|
||||
|
||||
extern boolean palette_changed;
|
||||
extern struct color colors[256];
|
||||
|
||||
#endif // CMAP256
|
||||
|
||||
#endif
|
||||
262
src/kernel/userland/doom/icon.c
Normal file
262
src/kernel/userland/doom/icon.c
Normal file
|
|
@ -0,0 +1,262 @@
|
|||
static int icon_w = 32;
|
||||
static int icon_h = 32;
|
||||
|
||||
static unsigned char icon_data[] = {
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0xa2,0x86,0x73,
|
||||
0xa9,0x8d,0x7a, 0xbd,0xa0,0x8c, 0xda,0xba,0xa0, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0xbd,0x8d,0x67, 0xd7,0xb9,0xa5, 0xeb,0xd8,0xcd, 0xd3,0xbf,0xae,
|
||||
0xbd,0xa0,0x8c, 0xeb,0xd8,0xcd, 0xc2,0x9d,0x86, 0x95,0x5d,0x38,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x9b,0x7e,0x66,
|
||||
0xc5,0x9e,0x81, 0xd3,0xb3,0x99, 0xd4,0xac,0x8e, 0xee,0xdc,0xd1,
|
||||
0xb9,0x93,0x76, 0xad,0x71,0x45, 0xd4,0xac,0x8e, 0xb9,0x93,0x76,
|
||||
0xa3,0x77,0x58, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x39,0x1d,0x2d, 0x55,0x20,0x22, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0xda,0xb4,0x9c, 0xd3,0xa3,0x83,
|
||||
0xaf,0x91,0x78, 0xa7,0x83,0x6d, 0xc4,0xa7,0x93, 0xee,0xe2,0xd5,
|
||||
0xeb,0xd8,0xcd, 0x8c,0x60,0x3d, 0x9b,0x7e,0x66, 0xce,0x9f,0x7e,
|
||||
0x84,0x54,0x33, 0xba,0x83,0x5b, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x24,0x1c,0x35, 0x00,0x0f,0x32, 0x29,0x18,0x2e, 0x55,0x20,0x22,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0xd3,0xb3,0x99, 0xca,0x93,0x6f, 0xc4,0x94,0x6e,
|
||||
0x98,0x66,0x45, 0x78,0x50,0x2d, 0xd7,0xb9,0xa5, 0xee,0xdc,0xd1,
|
||||
0xc4,0x9b,0x79, 0xa1,0x6d,0x45, 0x66,0x40,0x24, 0xb8,0x7a,0x4f,
|
||||
0xcf,0xa6,0x83, 0x98,0x6d,0x4e, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x30,0x1c,0x2f, 0x08,0x13,0x30, 0x00,0x0f,0x32, 0x00,0x0f,0x32,
|
||||
0x39,0x1d,0x2d, 0x52,0x1c,0x1a, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x9e,0x7b,0x65, 0xb9,0x89,0x64, 0xaa,0x7d,0x5e, 0x9e,0x72,0x53,
|
||||
0x88,0x5e,0x40, 0xc4,0xa7,0x93, 0xb9,0x89,0x64, 0x90,0x6c,0x51,
|
||||
0x7f,0x50,0x2f, 0x90,0x5e,0x37, 0x75,0x4d,0x30, 0x7f,0x50,0x2f,
|
||||
0xd3,0xa3,0x83, 0xd4,0xac,0x8e, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x29,0x18,0x2e, 0x08,0x13,0x30, 0x08,0x13,0x30, 0x08,0x13,0x30,
|
||||
0x00,0x0f,0x32, 0x08,0x13,0x30, 0x49,0x1e,0x2b, 0x49,0x1a,0x16,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0xda,0xba,0xa0,
|
||||
0xd4,0xac,0x8e, 0xc4,0x9b,0x79, 0xaa,0x7d,0x5e, 0xaa,0x7d,0x5e,
|
||||
0xbd,0xa0,0x8c, 0x8c,0x60,0x3d, 0x70,0x49,0x2c, 0x89,0x60,0x42,
|
||||
0x57,0x38,0x20, 0x6c,0x45,0x29, 0x66,0x40,0x24, 0x51,0x35,0x21,
|
||||
0x7e,0x55,0x38, 0xce,0x9f,0x7e, 0xc2,0x8a,0x61, 0x00,0x00,0x00,
|
||||
0x30,0x1c,0x2f, 0x00,0x0f,0x32, 0x00,0x0f,0x32, 0x08,0x13,0x30,
|
||||
0x00,0x0f,0x32, 0x00,0x0f,0x32, 0x08,0x13,0x30, 0x08,0x13,0x30,
|
||||
0x59,0x25,0x2b, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0xcb,0x9a,0x74,
|
||||
0xb7,0x81,0x58, 0x8c,0x60,0x3d, 0x79,0x4b,0x2b, 0x89,0x58,0x31,
|
||||
0x89,0x58,0x31, 0x7f,0x50,0x2f, 0x9e,0x64,0x39, 0x75,0x4c,0x2a,
|
||||
0x51,0x35,0x21, 0x84,0x54,0x33, 0x54,0x36,0x1d, 0x98,0x6d,0x4e,
|
||||
0xb4,0x7f,0x5c, 0xba,0x83,0x5b, 0xb8,0x7a,0x4f, 0x00,0x00,0x00,
|
||||
0x3e,0x28,0x36, 0x08,0x13,0x30, 0x00,0x0f,0x32, 0x08,0x13,0x30,
|
||||
0x00,0x0f,0x32, 0x00,0x0f,0x32, 0x00,0x0f,0x32, 0x08,0x13,0x30,
|
||||
0x20,0x1f,0x36, 0x35,0x19,0x12, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0xc2,0x8a,0x61,
|
||||
0x89,0x60,0x42, 0x84,0x54,0x33, 0x7f,0x50,0x2f, 0x86,0x56,0x35,
|
||||
0x8d,0x5b,0x35, 0x75,0x4c,0x2a, 0x8d,0x5b,0x35, 0x5c,0x38,0x22,
|
||||
0x5e,0x3f,0x27, 0x75,0x4d,0x30, 0x9d,0x64,0x3f, 0x75,0x4c,0x2a,
|
||||
0x78,0x50,0x2d, 0x7f,0x50,0x2f, 0xb7,0x81,0x58, 0x00,0x00,0x00,
|
||||
0x46,0x35,0x42, 0x04,0x18,0x3a, 0x08,0x13,0x30, 0x5d,0x30,0x28,
|
||||
0x20,0x1f,0x36, 0x08,0x13,0x30, 0x08,0x13,0x30, 0x04,0x18,0x3a,
|
||||
0x19,0x1c,0x37, 0x3a,0x1d,0x16, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x91,0x5f,0x3e,
|
||||
0x84,0x54,0x33, 0x89,0x58,0x31, 0x7e,0x6e,0x64, 0xc4,0x94,0x6e,
|
||||
0x78,0x50,0x2d, 0x92,0x6f,0x59, 0xa1,0x7c,0x60, 0x9c,0x6f,0x4b,
|
||||
0x8d,0x5b,0x35, 0xbc,0x7f,0x53, 0xad,0x71,0x45, 0x75,0x4d,0x30,
|
||||
0x51,0x35,0x21, 0x4b,0x2f,0x1c, 0x70,0x49,0x2c, 0x00,0x00,0x00,
|
||||
0x59,0x44,0x4d, 0x1e,0x28,0x42, 0x1e,0x28,0x42, 0x48,0x19,0x10,
|
||||
0x42,0x19,0x12, 0x53,0x2b,0x30, 0x0c,0x26,0x48, 0x1e,0x28,0x42,
|
||||
0x24,0x2d,0x48, 0x5f,0x2c,0x1d, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x89,0x58,0x31,
|
||||
0xa1,0x84,0x6c, 0xc4,0x94,0x6e, 0x88,0x64,0x44, 0xb5,0x8f,0x73,
|
||||
0x9e,0x72,0x53, 0xa1,0x6d,0x45, 0x93,0x60,0x3a, 0xad,0x71,0x45,
|
||||
0xb4,0x7f,0x5c, 0xbd,0x8d,0x67, 0xc2,0x8a,0x61, 0xb3,0x76,0x4b,
|
||||
0xb8,0x7a,0x4f, 0x88,0x64,0x44, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x61,0x50,0x52, 0x1c,0x34,0x52, 0x1c,0x34,0x52, 0x54,0x27,0x16,
|
||||
0x29,0x17,0x09, 0x5d,0x30,0x28, 0x1c,0x34,0x52, 0x1c,0x34,0x52,
|
||||
0x24,0x35,0x4f, 0x69,0x34,0x24, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0xa7,0x83,0x6d,
|
||||
0xac,0x86,0x6a, 0x74,0x47,0x2d, 0x84,0x54,0x33, 0x5c,0x38,0x22,
|
||||
0x54,0x36,0x1d, 0x6c,0x45,0x29, 0x96,0x63,0x3c, 0xa3,0x6e,0x41,
|
||||
0xb3,0x76,0x4b, 0xb3,0x76,0x4b, 0xa2,0x68,0x3d, 0x7c,0x4e,0x2d,
|
||||
0x63,0x3e,0x27, 0x96,0x63,0x3c, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x6b,0x5d,0x59, 0x22,0x42,0x5f, 0x22,0x42,0x5f, 0x5d,0x34,0x1a,
|
||||
0x38,0x23,0x0f, 0x5c,0x38,0x22, 0x22,0x42,0x5f, 0x22,0x42,0x5f,
|
||||
0x2c,0x45,0x5e, 0x6f,0x3e,0x2b, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0xb7,0x81,0x58,
|
||||
0x98,0x74,0x59, 0x6c,0x45,0x29, 0x4b,0x35,0x25, 0x78,0x50,0x2d,
|
||||
0x78,0x50,0x2d, 0x78,0x50,0x2d, 0x7f,0x50,0x2f, 0x84,0x54,0x33,
|
||||
0x8d,0x5b,0x35, 0x96,0x63,0x3c, 0x74,0x47,0x2d, 0x65,0x45,0x26,
|
||||
0x65,0x45,0x26, 0x7c,0x4e,0x2d, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x77,0x69,0x64, 0x30,0x4e,0x6d, 0x32,0x52,0x6b, 0x69,0x42,0x26,
|
||||
0x49,0x31,0x11, 0x6c,0x47,0x2f, 0x27,0x4f,0x6d, 0x27,0x4f,0x6d,
|
||||
0x32,0x52,0x6b, 0x70,0x49,0x2c, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0xb7,0x81,0x58,
|
||||
0x8a,0x5a,0x39, 0x8a,0x5a,0x39, 0x91,0x5f,0x3e, 0x5e,0x3f,0x27,
|
||||
0x5c,0x38,0x22, 0x89,0x58,0x31, 0x89,0x58,0x31, 0x95,0x5d,0x38,
|
||||
0x9d,0x64,0x3f, 0x65,0x45,0x26, 0x4b,0x2f,0x1c, 0x7f,0x50,0x2f,
|
||||
0x78,0x50,0x2d, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x77,0x69,0x64, 0x36,0x5c,0x7a, 0x3e,0x5e,0x78, 0x76,0x52,0x2e,
|
||||
0x5d,0x42,0x22, 0x75,0x4d,0x30, 0x36,0x5c,0x7a, 0x36,0x5c,0x7a,
|
||||
0x3e,0x5e,0x78, 0x74,0x47,0x2d, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x89,0x58,0x31, 0x63,0x3e,0x27, 0xa8,0x6d,0x42, 0x4b,0x2f,0x1c,
|
||||
0x65,0x45,0x26, 0x70,0x49,0x2c, 0x51,0x35,0x21, 0x78,0x50,0x2d,
|
||||
0x42,0x30,0x14, 0x49,0x31,0x11, 0x59,0x44,0x22, 0x7c,0x5c,0x2a,
|
||||
0x8a,0x71,0x27, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x71,0x67,0x5c, 0x37,0x52,0x66, 0x3f,0x55,0x64, 0x80,0x55,0x27,
|
||||
0x64,0x4c,0x1f, 0x7e,0x59,0x2e, 0x37,0x52,0x66, 0x37,0x52,0x66,
|
||||
0x3f,0x55,0x64, 0x6c,0x47,0x2f, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x70,0x49,0x2c, 0x65,0x45,0x26, 0x65,0x45,0x26, 0x63,0x3e,0x27,
|
||||
0x76,0x4d,0x25, 0x5d,0x42,0x22, 0x5e,0x3f,0x27, 0x4e,0x43,0x18,
|
||||
0x4e,0x43,0x18, 0x6a,0x5b,0x1c, 0x4e,0x43,0x18, 0x5f,0x51,0x19,
|
||||
0x8a,0x76,0x2a, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x63,0x38,0x19, 0x34,0x11,0x04, 0x32,0x0f,0x00, 0x86,0x58,0x1e,
|
||||
0x74,0x59,0x25, 0x86,0x58,0x1e, 0x34,0x15,0x00, 0x32,0x0f,0x00,
|
||||
0x34,0x15,0x00, 0x4e,0x31,0x18, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x7e,0x6c,0x27, 0x5a,0x4d,0x1c,
|
||||
0x4d,0x3e,0x15, 0x67,0x58,0x21, 0x5a,0x4d,0x1c, 0x57,0x4b,0x1a,
|
||||
0x5f,0x51,0x19, 0x64,0x55,0x1e, 0x5a,0x4d,0x1c, 0x8a,0x71,0x27,
|
||||
0x8e,0x79,0x26, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x63,0x38,0x19, 0x34,0x11,0x04, 0x32,0x0f,0x00, 0x8d,0x63,0x1f,
|
||||
0x83,0x66,0x2c, 0x8d,0x63,0x1f, 0x32,0x0f,0x00, 0x35,0x19,0x12,
|
||||
0x34,0x11,0x04, 0x53,0x3a,0x20, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0xac,0x93,0x39, 0x76,0x65,0x20,
|
||||
0x6a,0x5b,0x1c, 0x6a,0x5b,0x1c, 0x67,0x58,0x21, 0x4e,0x43,0x18,
|
||||
0x4e,0x43,0x18, 0x9b,0x85,0x32, 0xb8,0x9e,0x3c, 0xb1,0x8d,0x36,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x63,0x38,0x19, 0x34,0x15,0x00, 0x32,0x0f,0x00, 0x8d,0x63,0x1f,
|
||||
0x83,0x66,0x2c, 0x8d,0x63,0x1f, 0x32,0x0f,0x00, 0x32,0x0f,0x00,
|
||||
0x34,0x15,0x00, 0x53,0x3a,0x20, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0xb0,0x96,0x34, 0x76,0x65,0x20,
|
||||
0x7e,0x66,0x23, 0x8e,0x79,0x26, 0x8a,0x71,0x27, 0x7e,0x6c,0x27,
|
||||
0x8a,0x71,0x27, 0x8a,0x71,0x27, 0xb0,0x96,0x34, 0x98,0x82,0x2f,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x75,0x4c,0x2a, 0x38,0x19,0x05, 0x38,0x19,0x05, 0x99,0x6d,0x22,
|
||||
0x96,0x70,0x2a, 0x99,0x6d,0x22, 0x38,0x19,0x05, 0x38,0x19,0x05,
|
||||
0x38,0x19,0x05, 0x59,0x3f,0x25, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0xac,0x93,0x39, 0x8a,0x76,0x2a,
|
||||
0x7e,0x66,0x23, 0x76,0x65,0x20, 0x93,0x7d,0x2a, 0x82,0x6f,0x23,
|
||||
0x9f,0x88,0x35, 0xb8,0xa0,0x4c, 0xb8,0xa0,0x4c, 0xc4,0xa8,0x3f,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x7c,0x5c,0x2a, 0x52,0x2e,0x0d, 0x52,0x2e,0x0d, 0xa4,0x7b,0x27,
|
||||
0xa1,0x80,0x37, 0x9f,0x77,0x1a, 0x52,0x2e,0x0d, 0x52,0x2e,0x0d,
|
||||
0x52,0x2e,0x0d, 0x5f,0x4e,0x2a, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x86,0x72,0x26,
|
||||
0xac,0x93,0x39, 0x97,0x82,0x36, 0xb1,0x8d,0x36, 0xac,0x93,0x39,
|
||||
0x97,0x82,0x36, 0xa4,0x8c,0x32, 0xbd,0xa2,0x41, 0x8a,0x71,0x27,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x8b,0x6d,0x32, 0x66,0x44,0x14, 0x6d,0x4a,0x20, 0xab,0x86,0x29,
|
||||
0xb1,0x8d,0x36, 0xa4,0x7b,0x27, 0x66,0x44,0x14, 0x66,0x44,0x14,
|
||||
0x66,0x44,0x14, 0x69,0x56,0x2c, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0xac,0x93,0x31,
|
||||
0x7e,0x6c,0x27, 0x9f,0x88,0x35, 0x97,0x82,0x36, 0x7e,0x66,0x23,
|
||||
0x7e,0x66,0x23, 0xb2,0x99,0x3f, 0xbd,0xa2,0x41, 0x8a,0x76,0x2a,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x99,0x7a,0x38, 0x86,0x58,0x1e, 0x7f,0x59,0x22, 0xb2,0x8b,0x1c,
|
||||
0x94,0x6e,0x21, 0x7f,0x59,0x22, 0x7f,0x59,0x22, 0x7f,0x59,0x22,
|
||||
0x7f,0x59,0x22, 0x69,0x56,0x2c, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0xac,0x93,0x39,
|
||||
0x8a,0x71,0x27, 0xb4,0x9c,0x48, 0x7e,0x66,0x23, 0xac,0x93,0x39,
|
||||
0x9c,0x87,0x3a, 0x9c,0x87,0x3a, 0xbd,0xa2,0x41, 0x8e,0x79,0x26,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0xa8,0x86,0x3d, 0x96,0x70,0x2a, 0x96,0x70,0x2a, 0x96,0x70,0x2a,
|
||||
0x96,0x70,0x2a, 0x96,0x70,0x2a, 0x96,0x70,0x2a, 0x96,0x70,0x2a,
|
||||
0xa1,0x80,0x37, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0xb4,0x9c,0x48,
|
||||
0xac,0x93,0x31, 0x93,0x7d,0x2a, 0xbd,0xa3,0x48, 0x93,0x7d,0x2a,
|
||||
0xb8,0xa0,0x4c, 0xb4,0x9c,0x48, 0xcc,0xa5,0x4e, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0xa8,0x86,0x3d, 0xaf,0x85,0x31, 0xaf,0x85,0x31, 0xaf,0x85,0x31,
|
||||
0xaf,0x85,0x31, 0xaf,0x85,0x31, 0xaf,0x85,0x31, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x97,0x82,0x36, 0xb4,0x9c,0x48, 0xb2,0x99,0x3f, 0xb4,0x9c,0x48,
|
||||
0xb0,0x96,0x34, 0xc1,0xa7,0x4c, 0x9b,0x84,0x2a, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0xbd,0x9e,0x4c, 0xc7,0x9a,0x3f, 0xc7,0x9a,0x3f, 0xc7,0x9a,0x3f,
|
||||
0xc7,0x9a,0x3f, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x9b,0x85,0x32, 0xa7,0x8e,0x2c, 0xac,0x93,0x39, 0xb5,0x91,0x41,
|
||||
0x76,0x65,0x20, 0xa7,0x8e,0x2c, 0xb4,0x9a,0x38, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0xcc,0xa5,0x4e, 0xe0,0xaf,0x45, 0xe0,0xaf,0x45, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0xa4,0x8c,0x32, 0xb8,0x9e,0x44, 0x86,0x72,0x26, 0x9f,0x88,0x35,
|
||||
0xbd,0xa3,0x48, 0x9b,0x85,0x32, 0xa3,0x81,0x32, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0xd1,0xae,0x4e, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0xb0,0x97,0x3c, 0xb4,0x9a,0x38, 0xac,0x94,0x41, 0xb2,0x99,0x3f,
|
||||
0xb4,0x9a,0x38, 0xb8,0x9e,0x3c, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0xcc,0xa5,0x4e, 0xa6,0x8f,0x3c, 0xb2,0x99,0x3f, 0xb4,0x9c,0x48,
|
||||
0xa8,0x90,0x36, 0x9f,0x88,0x35, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00, 0x00,0x00,0x00,
|
||||
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue