├── .gitignore ├── KNOWN_GAME_BUGS.md ├── LICENSE ├── NOTES_MPEG.md ├── README.md ├── RMDOS_API.md ├── RMPORTIO_NOTES.md ├── ci └── win32-cross │ ├── README.md │ ├── cross_compile_dosbox.sh │ ├── install_dosbox_sdl_deps.sh │ └── make_dosbox_zip_package.sh ├── dosbox-0.74-3 ├── AUTHORS ├── COPYING ├── ChangeLog ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── THANKS ├── acinclude.m4 ├── aclocal.m4 ├── autogen.sh ├── compile ├── config.guess ├── config.h.in ├── config.sub ├── configure ├── configure.ac ├── depcomp ├── docs │ ├── Makefile.am │ ├── Makefile.in │ ├── PORTING │ ├── README.video │ └── dosbox.1 ├── include │ ├── Makefile.am │ ├── Makefile.in │ ├── bios.h │ ├── bios_disk.h │ ├── callback.h │ ├── control.h │ ├── cpu.h │ ├── cross.h │ ├── debug.h │ ├── dma.h │ ├── dos_inc.h │ ├── dos_system.h │ ├── dosbox.h │ ├── fpu.h │ ├── hardware.h │ ├── inout.h │ ├── ipx.h │ ├── ipxserver.h │ ├── joystick.h │ ├── keyboard.h │ ├── logging.h │ ├── mapper.h │ ├── mem.h │ ├── mixer.h │ ├── modules.h │ ├── mouse.h │ ├── paging.h │ ├── pic.h │ ├── programs.h │ ├── reelmagic.h │ ├── regs.h │ ├── render.h │ ├── serialport.h │ ├── setup.h │ ├── shell.h │ ├── support.h │ ├── timer.h │ ├── vga.h │ ├── vga_reelmagic_override.h │ └── video.h ├── install-sh ├── missing ├── src │ ├── Makefile.am │ ├── Makefile.in │ ├── cpu │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── callback.cpp │ │ ├── core_dyn_x86.cpp │ │ ├── core_dyn_x86 │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── cache.h │ │ │ ├── decoder.h │ │ │ ├── dyn_fpu.h │ │ │ ├── dyn_fpu_dh.h │ │ │ ├── helpers.h │ │ │ ├── risc_x86.h │ │ │ └── string.h │ │ ├── core_dynrec.cpp │ │ ├── core_dynrec │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── cache.h │ │ │ ├── decoder.h │ │ │ ├── decoder_basic.h │ │ │ ├── decoder_opcodes.h │ │ │ ├── dyn_fpu.h │ │ │ ├── operators.h │ │ │ ├── risc_armv4le-common.h │ │ │ ├── risc_armv4le-o3.h │ │ │ ├── risc_armv4le-s3.h │ │ │ ├── risc_armv4le-thumb-iw.h │ │ │ ├── risc_armv4le-thumb-niw.h │ │ │ ├── risc_armv4le-thumb.h │ │ │ ├── risc_armv4le.h │ │ │ ├── risc_mipsel32.h │ │ │ ├── risc_x64.h │ │ │ └── risc_x86.h │ │ ├── core_full.cpp │ │ ├── core_full │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── ea_lookup.h │ │ │ ├── load.h │ │ │ ├── loadwrite.h │ │ │ ├── op.h │ │ │ ├── optable.h │ │ │ ├── save.h │ │ │ ├── string.h │ │ │ └── support.h │ │ ├── core_normal.cpp │ │ ├── core_normal │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── helpers.h │ │ │ ├── prefix_0f.h │ │ │ ├── prefix_66.h │ │ │ ├── prefix_66_0f.h │ │ │ ├── prefix_none.h │ │ │ ├── string.h │ │ │ ├── support.h │ │ │ └── table_ea.h │ │ ├── core_prefetch.cpp │ │ ├── core_simple.cpp │ │ ├── cpu.cpp │ │ ├── flags.cpp │ │ ├── instructions.h │ │ ├── lazyflags.h │ │ ├── modrm.cpp │ │ ├── modrm.h │ │ └── paging.cpp │ ├── debug │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── debug.cpp │ │ ├── debug_disasm.cpp │ │ ├── debug_gui.cpp │ │ ├── debug_inc.h │ │ ├── debug_win32.cpp │ │ └── disasm_tables.h │ ├── dos │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── cdrom.cpp │ │ ├── cdrom.h │ │ ├── cdrom_aspi_win32.cpp │ │ ├── cdrom_image.cpp │ │ ├── cdrom_ioctl_linux.cpp │ │ ├── cdrom_ioctl_os2.cpp │ │ ├── cdrom_ioctl_win32.cpp │ │ ├── dev_con.h │ │ ├── dos.cpp │ │ ├── dos_classes.cpp │ │ ├── dos_codepages.h │ │ ├── dos_devices.cpp │ │ ├── dos_execute.cpp │ │ ├── dos_files.cpp │ │ ├── dos_ioctl.cpp │ │ ├── dos_keyboard_layout.cpp │ │ ├── dos_keyboard_layout_data.h │ │ ├── dos_memory.cpp │ │ ├── dos_misc.cpp │ │ ├── dos_mscdex.cpp │ │ ├── dos_programs.cpp │ │ ├── dos_tables.cpp │ │ ├── drive_cache.cpp │ │ ├── drive_fat.cpp │ │ ├── drive_iso.cpp │ │ ├── drive_local.cpp │ │ ├── drive_virtual.cpp │ │ ├── drives.cpp │ │ ├── drives.h │ │ ├── scsidefs.h │ │ └── wnaspi32.h │ ├── dosbox.cpp │ ├── dosbox.ico │ ├── fpu │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── fpu.cpp │ │ ├── fpu_instructions.h │ │ └── fpu_instructions_x86.h │ ├── gui │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── dosbox_logo.h │ │ ├── dosbox_splash.h │ │ ├── midi.cpp │ │ ├── midi_alsa.h │ │ ├── midi_coreaudio.h │ │ ├── midi_coremidi.h │ │ ├── midi_oss.h │ │ ├── midi_win32.h │ │ ├── render.cpp │ │ ├── render_loops.h │ │ ├── render_scalers.cpp │ │ ├── render_scalers.h │ │ ├── render_simple.h │ │ ├── render_templates.h │ │ ├── render_templates_hq.h │ │ ├── render_templates_hq2x.h │ │ ├── render_templates_hq3x.h │ │ ├── render_templates_sai.h │ │ ├── sdl_gui.cpp │ │ ├── sdl_mapper.cpp │ │ └── sdlmain.cpp │ ├── hardware │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── adlib.cpp │ │ ├── adlib.h │ │ ├── cmos.cpp │ │ ├── dbopl.cpp │ │ ├── dbopl.h │ │ ├── disney.cpp │ │ ├── dma.cpp │ │ ├── gameblaster.cpp │ │ ├── gus.cpp │ │ ├── hardware.cpp │ │ ├── iohandler.cpp │ │ ├── ipx.cpp │ │ ├── ipxserver.cpp │ │ ├── joystick.cpp │ │ ├── keyboard.cpp │ │ ├── mame │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── emu.h │ │ │ ├── saa1099.cpp │ │ │ ├── saa1099.h │ │ │ ├── sn76496.cpp │ │ │ └── sn76496.h │ │ ├── memory.cpp │ │ ├── mixer.cpp │ │ ├── mpu401.cpp │ │ ├── opl.cpp │ │ ├── opl.h │ │ ├── pcspeaker.cpp │ │ ├── pic.cpp │ │ ├── reelmagic_driver.cpp │ │ ├── reelmagic_pl_mpeg.h │ │ ├── reelmagic_player.cpp │ │ ├── reelmagic_videomixer.cpp │ │ ├── sblaster.cpp │ │ ├── serialport │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── directserial.cpp │ │ │ ├── directserial.h │ │ │ ├── libserial.cpp │ │ │ ├── libserial.h │ │ │ ├── misc_util.cpp │ │ │ ├── misc_util.h │ │ │ ├── nullmodem.cpp │ │ │ ├── nullmodem.h │ │ │ ├── serialdummy.cpp │ │ │ ├── serialdummy.h │ │ │ ├── serialport.cpp │ │ │ ├── softmodem.cpp │ │ │ └── softmodem.h │ │ ├── tandy_sound.cpp │ │ ├── timer.cpp │ │ ├── vga.cpp │ │ ├── vga_attr.cpp │ │ ├── vga_crtc.cpp │ │ ├── vga_dac.cpp │ │ ├── vga_draw.cpp │ │ ├── vga_gfx.cpp │ │ ├── vga_memory.cpp │ │ ├── vga_misc.cpp │ │ ├── vga_other.cpp │ │ ├── vga_paradise.cpp │ │ ├── vga_s3.cpp │ │ ├── vga_seq.cpp │ │ ├── vga_tseng.cpp │ │ └── vga_xga.cpp │ ├── ints │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── bios.cpp │ │ ├── bios_disk.cpp │ │ ├── bios_keyboard.cpp │ │ ├── ems.cpp │ │ ├── int10.cpp │ │ ├── int10.h │ │ ├── int10_char.cpp │ │ ├── int10_memory.cpp │ │ ├── int10_misc.cpp │ │ ├── int10_modes.cpp │ │ ├── int10_pal.cpp │ │ ├── int10_put_pixel.cpp │ │ ├── int10_vesa.cpp │ │ ├── int10_video_state.cpp │ │ ├── int10_vptable.cpp │ │ ├── mouse.cpp │ │ ├── xms.cpp │ │ └── xms.h │ ├── libs │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── gui_tk │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── gui_tk.cpp │ │ │ └── gui_tk.h │ │ └── zmbv │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── zmbv.cpp │ │ │ └── zmbv.h │ ├── misc │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── cross.cpp │ │ ├── messages.cpp │ │ ├── programs.cpp │ │ ├── setup.cpp │ │ └── support.cpp │ ├── platform │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── sdl-win32.diff │ │ └── visualc │ │ │ ├── Makefile.am │ │ │ ├── Makefile.in │ │ │ ├── config.h │ │ │ ├── ntddcdrm.h │ │ │ ├── ntddscsi.h │ │ │ └── unistd.h │ ├── shell │ │ ├── Makefile.am │ │ ├── Makefile.in │ │ ├── shell.cpp │ │ ├── shell_batch.cpp │ │ ├── shell_cmds.cpp │ │ └── shell_misc.cpp │ └── winres.rc └── visualc_net │ ├── Makefile.am │ ├── Makefile.in │ ├── dosbox.sln │ └── dosbox.vcproj ├── example.dosbox.conf └── tools ├── Makefile ├── find_magical_f_code.c ├── is_magical_asset.c ├── original_pl_mpeg.h ├── superanalyze_mpeg_ps.c ├── superanalyze_mpeg_ps_f_code.pl ├── unlock_the_magic_mpeg_ps.c └── wincompat.h /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | dosbox-*/**/*.o 3 | dosbox-*/**/*.a 4 | dosbox-*/**/Makefile 5 | dosbox-*/config.h 6 | dosbox-*/config.log 7 | dosbox-*/autom4te.cache/ 8 | dosbox-*/config.status 9 | dosbox-*/**/.deps 10 | dosbox-*/stamp-h1 11 | dosbox-*/src/dosbox 12 | dosbox-*/src/dosbox.exe 13 | dosbox-*/src/dosbox_heavydebug.exe 14 | 15 | 16 | 17 | tools/find_magical_f_code 18 | tools/find_magical_f_code.exe 19 | tools/is_magical_asset 20 | tools/is_magical_asset.exe 21 | tools/superanalyze_mpeg_ps 22 | tools/superanalyze_mpeg_ps.exe 23 | tools/unlock_the_magic_mpeg_ps 24 | tools/unlock_the_magic_mpeg_ps.exe 25 | -------------------------------------------------------------------------------- /KNOWN_GAME_BUGS.md: -------------------------------------------------------------------------------- 1 | 2 | This file captures the known bugs that already exist in the games that are not introduced by this emulator. 3 | 4 | 5 | 6 | # Return to Zork 7 | 8 | * This game has no subtitles. (https://www.vogons.org/viewtopic.php?f=32&t=86635) 9 | * The lack of the flashing effect when taking a photo is accurate. The game behaves this way on hardware, as well. (https://www.vogons.org/viewtopic.php?p=1052487#p1052487) 10 | * The awful borders around the crank and box overlays in the hardware store are also accurate. (https://www.vogons.org/viewtopic.php?p=1052487#p1052487) 11 | * When the Guardian disappears, the background appears far before the overlays fade in. This is also accurate. (https://www.vogons.org/viewtopic.php?p=1052487#p1052487) 12 | 13 | 14 | # Lord of the Rings 15 | 16 | 17 | * Hitting space+esc locks things up real good. 18 | * Loading the demo on the title screen gives a "FMPOpen Error Code: 0" error message (https://www.vogons.org/viewtopic.php?p=1049075#p1049075) 19 | 20 | 21 | 22 | # Man Enough 23 | 24 | * No subtitles in first scene (see: https://www.vogons.org/viewtopic.php?p=1048737#p1048737) 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ci/win32-cross/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Cross-Compiling Win32 DOSBox from Ubuntu 20.04 3 | 4 | ## Ubuntu Machine One-Time Setup 5 | 6 | ``` 7 | sudo apt-get install mingw-w64 wget build-essential autoconf automake-1.15 autotools-dev m4 zip 8 | ./install_dosbox_sdl_deps.sh 9 | ``` 10 | 11 | ## Compiling DOSBox 12 | 13 | ``` 14 | ./cross_compile_dosbox.sh 15 | ``` 16 | 17 | ## Creating Release Package 18 | 19 | ``` 20 | ./make_dosbox_zip_package.sh 21 | ``` 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /ci/win32-cross/cross_compile_dosbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -x 5 | 6 | INSTALL_PREFIX='/usr/i686-w64-mingw32' 7 | TOOLCHAIN='i686-w64-mingw32' 8 | 9 | export PATH="$INSTALL_PREFIX/bin:$PATH" 10 | 11 | cd ../../dosbox-0.74-3 12 | ./autogen.sh 13 | ./configure --host="$TOOLCHAIN" --prefix="$INSTALL_PREFIX" --with-sdl-prefix="$INSTALL_PREFIX" \ 14 | --enable-debug=heavy LDFLAGS="-static-libgcc -static-libstdc++ -s" LIBS="-lvorbisfile -lvorbis -logg" 15 | make -j 16 | mv src/dosbox.exe src/dosbox_heavydebug.exe 17 | 18 | ./configure --host="$TOOLCHAIN" --prefix="$INSTALL_PREFIX" --with-sdl-prefix="$INSTALL_PREFIX" \ 19 | --enable-core-inline LDFLAGS="-static-libgcc -static-libstdc++ -s" LIBS="-lvorbisfile -lvorbis -logg" 20 | make -j 21 | cd - 22 | 23 | cd ../../tools 24 | CC="$TOOLCHAIN-gcc" ENABLE_WINCOMPAT=1 make clean 25 | CC="$TOOLCHAIN-gcc" ENABLE_WINCOMPAT=1 make -j 26 | cd - 27 | 28 | 29 | -------------------------------------------------------------------------------- /ci/win32-cross/install_dosbox_sdl_deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -x 5 | 6 | INSTALL_PREFIX='/usr/i686-w64-mingw32' 7 | TOOLCHAIN='i686-w64-mingw32' 8 | 9 | export PATH="$INSTALL_PREFIX/bin:$PATH" 10 | 11 | # 12 | # Adding the SDL libraries to MinGW 13 | # 14 | if [ ! -e 'SDL-devel-1.2.15-mingw32.tar.gz' ]; then 15 | wget 'http://www.libsdl.org/release/SDL-devel-1.2.15-mingw32.tar.gz' 16 | fi 17 | rm -Rf 'SDL-1.2.15' 18 | tar zxvf 'SDL-devel-1.2.15-mingw32.tar.gz' 19 | sudo make -C 'SDL-1.2.15' install-sdl prefix="$INSTALL_PREFIX" 20 | 21 | 22 | # 23 | # Adding Direct Draw support to DOSBox (Optional) 24 | # 25 | if [ ! -e 'directx-devel.tar.gz' ]; then 26 | wget 'http://www.libsdl.org/extras/win32/common/directx-devel.tar.gz' 27 | fi 28 | sudo tar -C "$INSTALL_PREFIX" -zxvf 'directx-devel.tar.gz' 29 | 30 | 31 | # 32 | # Adding networking support to DOSBox (Optional) 33 | # 34 | if [ ! -e 'SDL_net-1.2.8.tar.gz' ]; then 35 | wget 'https://www.libsdl.org/projects/SDL_net/release/SDL_net-1.2.8.tar.gz' 36 | fi 37 | rm -Rf 'SDL_net-1.2.8' 38 | tar zxvf 'SDL_net-1.2.8.tar.gz' 39 | cd 'SDL_net-1.2.8' 40 | ./configure --host="$TOOLCHAIN" --prefix="$INSTALL_PREFIX" 41 | echo '#include ' | cat - SDLnet.c > SDLnet.c.patch 42 | mv SDLnet.c.patch SDLnet.c 43 | make 44 | sudo make install 45 | cd - 46 | 47 | 48 | # 49 | # Adding screenshot support (Optional) 50 | # 51 | if [ ! -e 'zlib-1.2.8.tar.xz' ]; then 52 | wget 'http://sourceforge.net/projects/libpng/files/zlib/1.2.8/zlib-1.2.8.tar.xz/download' 53 | mv download zlib-1.2.8.tar.xz 54 | fi 55 | 56 | rm -Rf 'zlib-1.2.8' 57 | tar xvf 'zlib-1.2.8.tar.xz' 58 | make PREFIX="$TOOLCHAIN"- -C 'zlib-1.2.8' -f 'win32/Makefile.gcc' 59 | sudo cp -v zlib-1.2.8/libz.a "$INSTALL_PREFIX/lib/" 60 | sudo cp -v zlib-1.2.8/{zlib.h,zconf.h} "$INSTALL_PREFIX/include/" 61 | 62 | if [ ! -e 'libpng-1.6.18.tar.xz' ]; then 63 | wget 'https://sourceforge.net/projects/libpng/files/libpng16/older-releases/1.6.18/libpng-1.6.18.tar.xz/download' 64 | mv download libpng-1.6.18.tar.xz 65 | fi 66 | rm -Rf 'libpng-1.6.18' 67 | tar xvf 'libpng-1.6.18.tar.xz' 68 | cd 'libpng-1.6.18' 69 | ./configure --host="$TOOLCHAIN" --disable-shared --prefix="$INSTALL_PREFIX" 70 | make 71 | sudo make install 72 | cd - 73 | 74 | 75 | # 76 | # Adding support for compressed audio on diskimages (Optional) 77 | # 78 | if [ ! -e 'libogg-1.3.2.tar.gz' ]; then 79 | wget 'http://downloads.xiph.org/releases/ogg/libogg-1.3.2.tar.gz' 80 | fi 81 | rm -Rf 'libogg-1.3.2' 82 | tar xvf 'libogg-1.3.2.tar.gz' 83 | cd 'libogg-1.3.2' 84 | ./configure --host="$TOOLCHAIN" --disable-shared --prefix="$INSTALL_PREFIX" 85 | make 86 | sudo make install 87 | cd - 88 | 89 | if [ ! -e 'libvorbis-1.3.5.tar.gz' ]; then 90 | wget 'http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz' 91 | fi 92 | rm -Rf 'libvorbis-1.3.5' 93 | tar xvf 'libvorbis-1.3.5.tar.gz' 94 | cd 'libvorbis-1.3.5' 95 | ./configure --host="$TOOLCHAIN" --disable-shared --prefix="$INSTALL_PREFIX" 96 | make 97 | sudo make install 98 | cd - 99 | 100 | if [ ! -e 'SDL_sound-1.0.3.tar.gz' ]; then 101 | wget 'https://www.icculus.org/SDL_sound/downloads/SDL_sound-1.0.3.tar.gz' 102 | fi 103 | rm -Rf 'SDL_sound-1.0.3' 104 | tar xvf 'SDL_sound-1.0.3.tar.gz' 105 | cd 'SDL_sound-1.0.3' 106 | ./configure --host="$TOOLCHAIN" --disable-shared --prefix="$INSTALL_PREFIX" LIBS="-lvorbisfile -lvorbis -logg" 107 | make 108 | sudo make install 109 | cd - 110 | 111 | 112 | # 113 | # Enabling the debugger (You probably don't want this) 114 | # 115 | if [ ! -e 'PDCurses-3.4.tar.gz' ]; then 116 | wget 'http://sourceforge.net/projects/pdcurses/files/pdcurses/3.4/PDCurses-3.4.tar.gz' 117 | fi 118 | rm -Rf 'PDCurses-3.4' 119 | tar xvf 'PDCurses-3.4.tar.gz' 120 | make -C PDCurses-3.4/win32 -f gccwin32.mak DLL=N CC="$TOOLCHAIN-gcc" LINK="$TOOLCHAIN-gcc" 121 | sudo cp PDCurses-3.4/win32/pdcurses.a "$INSTALL_PREFIX/lib/libpdcurses.a" 122 | sudo cp PDCurses-3.4/{curses.h,panel.h} "$INSTALL_PREFIX/include/" 123 | 124 | 125 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /ci/win32-cross/make_dosbox_zip_package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | set -x 5 | 6 | INSTALL_PREFIX='/usr/i686-w64-mingw32' 7 | PACKAGE_DIR="dosbox_reelmagic_`git describe --abbrev=0 --tags 2>/dev/null || echo 'notag'`" 8 | 9 | rm -Rf "$PACKAGE_DIR" "$PACKAGE_DIR.zip" 10 | mkdir -p "$PACKAGE_DIR" 11 | cp ../../example.dosbox.conf "$PACKAGE_DIR/dosbox.conf" 12 | cp ../../dosbox-0.74-3/src/dosbox.exe "$PACKAGE_DIR/" 13 | cp ../../dosbox-0.74-3/src/dosbox_heavydebug.exe "$PACKAGE_DIR/" 14 | cp "$INSTALL_PREFIX/bin/"{SDL.dll,SDL_net.dll} "$PACKAGE_DIR/" 15 | 16 | mkdir -p "$PACKAGE_DIR/diagtools" 17 | cp ../../tools/*.exe "$PACKAGE_DIR/diagtools/" 18 | 19 | zip -9r "$PACKAGE_DIR.zip" "$PACKAGE_DIR" 20 | -------------------------------------------------------------------------------- /dosbox-0.74-3/AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jrdennisoss/dosboxrm/ecde5ad459e2773b50a780fa0a667b250f4c89db/dosbox-0.74-3/AUTHORS -------------------------------------------------------------------------------- /dosbox-0.74-3/INSTALL: -------------------------------------------------------------------------------- 1 | Things needed for compilation. 2 | 3 | SDL 4 | The Simple DirectMedia Library available at http://www.libsdl.org 5 | The dll distributed with the windows version of DOSBox is slightly 6 | modified. You can find the changes in the sourcepackage of DOSBox 7 | (src/platform/sdl-win32.diff). If you want the patched sourcetree 8 | send us an email. (see README) 9 | Licensed under LGPL 10 | Note that only version 1.2 and its subversions (1.2.8, 1.2.13 etc.) 11 | are currently supported. 12 | 13 | Curses (optional) 14 | If you want to enable the debugger you need a curses library. 15 | ncurses should be installed on just about every unix distro. 16 | For win32 get pdcurses at http://pdcurses.sourceforge.net 17 | License: Open source 18 | 19 | Libpng (optional) 20 | Needed for the screenshots. 21 | For win32 get libpng from http://gnuwin32.sourceforge.net/packages.html 22 | See http://www.libpng.org/pub/png/ for more details. 23 | License: Open Source 24 | 25 | Zlib (optional) 26 | Needed by libpng. 27 | For win32 get libz (rename to zlib) from http://gnuwin32.sourceforge.net/packages.html 28 | See http://www.zlib.net for more details. 29 | License: Open Source 30 | 31 | SDL_Net (optional) 32 | For modem/ipx support. Get it from http://www.libsdl.org/projects/SDL_net/ 33 | Licensed under LGPL 34 | 35 | SDL_Sound 36 | For compressed audio on diskimages. (optional) 37 | This is for cue/bin cdrom images with compressed (mp3/ogg) audio tracks. 38 | Get it from http://icculus.org/SDL_sound 39 | Licenced under LGPL 40 | 41 | ALSA_Headers 42 | (optional) 43 | for Alsa support under linux. Part of the linux kernel sources 44 | Licensed under LGPL 45 | 46 | If you want compile from the CVS under a unix system, you'll also need 47 | automake (>=1.6), autoconf(>=2.50). Should be available at http://www.gnu.org 48 | 49 | For building on unix systems. 50 | If you are building from the cvs run ./autogen.sh first before doing the following. 51 | 52 | 1. ./configure 53 | 2. make 54 | 55 | In step 1 you could add the following switches: 56 | --enable-debug 57 | enables the internal debugger. --enable-debug=heavy enables even more 58 | debug options. DOSBox should then be run from a xterm and when the sdl- 59 | window is active press alt-pause to enter the debugger. 60 | 61 | --enable-core-inline 62 | enables some memory increasing inlines. This greatly increases 63 | compiletime for maybe a increase in speed. 64 | 65 | --disable-fpu 66 | disables the emulated fpu. Although the fpu emulation code isn't 67 | finished and isn't entirely accurate it's advised to leave it on. 68 | 69 | --disable-fpu-x86 70 | disables the assembly fpu core. Although relatively new the x86 fpu 71 | core has more accuracy then the regular fpu core. 72 | 73 | --disable-dynamic-x86 74 | disables the dynamic x86 specific cpu core. Although it might be 75 | be a bit unstable, it can greatly improve the speed of dosbox on x86 76 | hosts. 77 | Please note that this option on x86 will result in a different 78 | dynamic/recompiling cpu core being compiled then the default. 79 | For more information see the option --disable-dynrec 80 | 81 | --disable-dynrec 82 | disables the recompiling cpu core. Currently x86 and x86_64 only. 83 | You can activate this core on x86 by disabling the dynamic-x86 core. 84 | 85 | --disable-dynamic-core 86 | disables all dynamic cores. (same effect as 87 | --disable-dynamic-x86 --disable-dynrec) 88 | 89 | --disable-opengl 90 | disables OpenGL-support (output mode that can be selected in the 91 | DOSBox configuration file). 92 | 93 | --disable-unaligned-memory 94 | disables unaligned memory access. 95 | 96 | Check the src subdir for the binary. 97 | 98 | NOTE: If capslock and numlock appear to be broken. open 99 | src/ints/bios_keyboard.cpp and go to line 30 and read there how to fix it. 100 | 101 | 102 | Build instructions for VC++6 103 | Don't use VC++ 6: it creates faulty code in core_normal.cpp 104 | Later Visual Studio versions work fine (vs2003/.net, vs2005, vs2008) 105 | -------------------------------------------------------------------------------- /dosbox-0.74-3/Makefile.am: -------------------------------------------------------------------------------- 1 | # Main Makefile for DOSBox 2 | 3 | EXTRA_DIST = autogen.sh 4 | SUBDIRS = src include docs visualc_net 5 | -------------------------------------------------------------------------------- /dosbox-0.74-3/THANKS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jrdennisoss/dosboxrm/ecde5ad459e2773b50a780fa0a667b250f4c89db/dosbox-0.74-3/THANKS -------------------------------------------------------------------------------- /dosbox-0.74-3/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo "Generating build information using aclocal, autoheader, automake and autoconf" 4 | echo "This may take a while ..." 5 | 6 | # Regenerate configuration files. 7 | 8 | aclocal 9 | autoheader 10 | automake --include-deps --add-missing --copy 11 | autoconf 12 | 13 | echo "Now you are ready to run ./configure." 14 | echo "You can also run ./configure --help for extra features to enable/disable." 15 | -------------------------------------------------------------------------------- /dosbox-0.74-3/docs/Makefile.am: -------------------------------------------------------------------------------- 1 | # Main Makefile for DOSBox 2 | 3 | man_MANS = dosbox.1 4 | EXTRA_DIST = $(man_MANS) README.video PORTING 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /dosbox-0.74-3/docs/PORTING: -------------------------------------------------------------------------------- 1 | Some notes about porting DOSBox to systems with certain restrictions, 2 | like handheld devices. 3 | 4 | General: 5 | - depending on where you start off with the port, assure that the 6 | config.h entries are correct/exhausting, like GCC_ATTRIBUTE is 7 | required (struct packing) but is undefined if you base the port 8 | on msvc sources which have a special config.h 9 | 10 | If memory is a constraint: 11 | - in paging.h out-comment the USE_FULL_TLB define to enable special 12 | TLB linking code that uses less memory 13 | drawback: none (the code is not heavily tested though) 14 | gain: reduces memory requirements about ~15mb 15 | - in render.h lower the scaler integration: 16 | #define RENDER_USE_ADVANCED_SCALERS 1 17 | or 18 | #define RENDER_USE_ADVANCED_SCALERS 0 19 | drawback: complex scalers and the scaler cache are disabled, 20 | be sure to test if this affects speed! 21 | with define RENDER_USE_ADVANCED_SCALERS==0 most simple 22 | scalers are disabled as well, some graphics modes won't 23 | work due to reduced cache sizes 24 | gain: ~2mb with RENDER_USE_ADVANCED_SCALERS==1 25 | ~5mb with RENDER_USE_ADVANCED_SCALERS==0 26 | - in dos_system.h reduce the drive cache entries: 27 | #define MAX_OPENDIRS 256 28 | drawback: some apps might not work with large directory trees 29 | gain: ~1mb per mounted drive 30 | - remove the GUS emulation (gus.cpp, especially GUSRam[1024*1024] ) 31 | drawback: no gravis ultrasound 32 | gain: reduces memory requirements about 1mb 33 | - reduce the size of the emulated graphics memory: 34 | see the memory sizing in SVGA_Setup_*, especially the defaults 35 | in vga_s3.cpp's SVGA_Setup_S3Trio 36 | drawback: some graphics modes won't work then 37 | gain: reduces memory requirements 38 | TODO: fully check this, introduce hard limits 39 | 40 | If speed is a constraint: 41 | - see if the simple core is faster, possibly remove the normal core 42 | set the simple core as default 43 | drawback: one game is known to not work with the simple core; 44 | the simple core does only work for games which don't use paging 45 | (when paging is requested the normal core is used automatically) 46 | gain: the simple core should be somewhat faster 47 | TODO: add possibility to easily remove the normal core, use fullcore fallback 48 | - raise the default frameskip value 49 | drawback: minor graphics smoothness loss for some games (video playback) 50 | gain: reduces graphics load 51 | -------------------------------------------------------------------------------- /dosbox-0.74-3/docs/README.video: -------------------------------------------------------------------------------- 1 | Starting with version 0.65, DOSBox allows you to create movies out of screen 2 | output. 3 | 4 | To record a movie, you have to press CTRL-ALT-F5. 5 | To stop/end the recording, you have to press CTRL-ALT-F5 again. 6 | 7 | To play the recorded movie, you need a movie player which can handle the 8 | ZMBV codec. MS Windows users can find this codec in the start menu entry of 9 | DOSBox. Users of Linux and other OSes should look for a movie player that 10 | uses the ffmpeg libary (you may need to update or ask your distribution to 11 | upgrade). 12 | 13 | FAQ: 14 | Q: During the display of the movies the sound is lagging. 15 | A: Check your display properties to see whether your refresh rate is set to 16 | at least 70 hz. Try playing the movie in virtualdub (http://virtualdub.sf.net) 17 | 18 | Q: Why does the resulting movie consist of multiple files? 19 | A: Each time the game changes resolution, DOSBox creates a new movie file, 20 | because a movie file can only contain one resolution. 21 | 22 | Q: Can I set the cycles higher than my PC can handle during recording? 23 | A: Yes. During recording, the game might play slowly and stuttering, but the 24 | resulting movie should play at the intended speed and have no stuttering. 25 | 26 | Q: CTRL-ALT-F5 switches to the console under linux. 27 | A: 1. Start DOSBox like this: dosbox -startmapper 28 | 2. Click on Video, click on Add 29 | 3. Press the key you want (for example scroll lock or printscreen) 30 | 4. Click exit. 31 | 5. You can make movies by pressing scroll lock or whichever key you 32 | selected. 33 | 34 | Q: The colours are wrong and I'm using 64 bit windows 35 | A: Look here: http://vogons.zetafleet.com/viewtopic.php?t=12133 36 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_HEADERS = \ 2 | bios.h \ 3 | bios_disk.h \ 4 | callback.h \ 5 | cpu.h \ 6 | cross.h \ 7 | control.h \ 8 | debug.h \ 9 | dma.h \ 10 | dos_inc.h \ 11 | dos_system.h \ 12 | dosbox.h \ 13 | fpu.h \ 14 | hardware.h \ 15 | inout.h \ 16 | joystick.h \ 17 | ipx.h \ 18 | ipxserver.h \ 19 | keyboard.h \ 20 | logging.h \ 21 | mapper.h \ 22 | mem.h \ 23 | mixer.h \ 24 | modules.h \ 25 | mouse.h \ 26 | paging.h \ 27 | pic.h \ 28 | programs.h \ 29 | render.h \ 30 | regs.h \ 31 | render.h \ 32 | serialport.h \ 33 | setup.h \ 34 | shell.h \ 35 | support.h \ 36 | timer.h \ 37 | vga.h \ 38 | video.h 39 | 40 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/bios_disk.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef DOSBOX_BIOS_DISK_H 20 | #define DOSBOX_BIOS_DISK_H 21 | 22 | #include 23 | #ifndef DOSBOX_MEM_H 24 | #include "mem.h" 25 | #endif 26 | #ifndef DOSBOX_DOS_INC_H 27 | #include "dos_inc.h" 28 | #endif 29 | #ifndef DOSBOX_BIOS_H 30 | #include "bios.h" 31 | #endif 32 | 33 | /* The Section handling Bios Disk Access */ 34 | #define BIOS_MAX_DISK 10 35 | 36 | #define MAX_SWAPPABLE_DISKS 20 37 | struct diskGeo { 38 | Bit32u ksize; /* Size in kilobytes */ 39 | Bit16u secttrack; /* Sectors per track */ 40 | Bit16u headscyl; /* Heads per cylinder */ 41 | Bit16u cylcount; /* Cylinders per side */ 42 | Bit16u biosval; /* Type to return from BIOS */ 43 | }; 44 | extern diskGeo DiskGeometryList[]; 45 | 46 | class imageDisk { 47 | public: 48 | Bit8u Read_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,void * data); 49 | Bit8u Write_Sector(Bit32u head,Bit32u cylinder,Bit32u sector,void * data); 50 | Bit8u Read_AbsoluteSector(Bit32u sectnum, void * data); 51 | Bit8u Write_AbsoluteSector(Bit32u sectnum, void * data); 52 | 53 | void Set_Geometry(Bit32u setHeads, Bit32u setCyl, Bit32u setSect, Bit32u setSectSize); 54 | void Get_Geometry(Bit32u * getHeads, Bit32u *getCyl, Bit32u *getSect, Bit32u *getSectSize); 55 | Bit8u GetBiosType(void); 56 | Bit32u getSectSize(void); 57 | imageDisk(FILE *imgFile, Bit8u *imgName, Bit32u imgSizeK, bool isHardDisk); 58 | ~imageDisk() { if(diskimg != NULL) { fclose(diskimg); } }; 59 | 60 | bool hardDrive; 61 | bool active; 62 | FILE *diskimg; 63 | Bit8u diskname[512]; 64 | Bit8u floppytype; 65 | 66 | Bit32u sector_size; 67 | Bit32u heads,cylinders,sectors; 68 | }; 69 | 70 | void updateDPT(void); 71 | 72 | #define MAX_HDD_IMAGES 2 73 | #define MAX_DISK_IMAGES (2 + MAX_HDD_IMAGES) 74 | 75 | extern imageDisk *imageDiskList[MAX_DISK_IMAGES]; 76 | extern imageDisk *diskSwap[MAX_SWAPPABLE_DISKS]; 77 | 78 | extern Bits swapPosition; 79 | extern Bit16u imgDTASeg; /* Real memory location of temporary DTA pointer for fat image disk access */ 80 | extern RealPt imgDTAPtr; /* Real memory location of temporary DTA pointer for fat image disk access */ 81 | extern DOS_DTA *imgDTA; 82 | 83 | void swapInDisks(void); 84 | void swapInNextDisk(void); 85 | bool getSwapRequest(void); 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/callback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: callback.h,v 1.26 2009-08-23 17:24:54 c2woody Exp $ */ 20 | 21 | #ifndef DOSBOX_CALLBACK_H 22 | #define DOSBOX_CALLBACK_H 23 | 24 | #ifndef DOSBOX_MEM_H 25 | #include "mem.h" 26 | #endif 27 | 28 | typedef Bitu (*CallBack_Handler)(void); 29 | extern CallBack_Handler CallBack_Handlers[]; 30 | 31 | enum { CB_RETN,CB_RETF,CB_RETF8,CB_IRET,CB_IRETD,CB_IRET_STI,CB_IRET_EOI_PIC1, 32 | CB_IRQ0,CB_IRQ1,CB_IRQ9,CB_IRQ12,CB_IRQ12_RET,CB_IRQ6_PCJR,CB_MOUSE, 33 | CB_INT29,CB_INT16,CB_HOOKABLE,CB_TDE_IRET,CB_IPXESR,CB_IPXESR_RET, 34 | CB_INT21 }; 35 | 36 | #define CB_MAX 128 37 | #define CB_SIZE 32 38 | #define CB_SEG 0xF000 39 | #define CB_SOFFSET 0x1000 40 | 41 | enum { 42 | CBRET_NONE=0,CBRET_STOP=1 43 | }; 44 | 45 | extern Bit8u lastint; 46 | 47 | static INLINE RealPt CALLBACK_RealPointer(Bitu callback) { 48 | return RealMake(CB_SEG,(Bit16u)(CB_SOFFSET+callback*CB_SIZE)); 49 | } 50 | static INLINE PhysPt CALLBACK_PhysPointer(Bitu callback) { 51 | return PhysMake(CB_SEG,(Bit16u)(CB_SOFFSET+callback*CB_SIZE)); 52 | } 53 | 54 | static INLINE PhysPt CALLBACK_GetBase(void) { 55 | return (CB_SEG << 4) + CB_SOFFSET; 56 | } 57 | 58 | Bitu CALLBACK_Allocate(); 59 | 60 | void CALLBACK_Idle(void); 61 | 62 | 63 | void CALLBACK_RunRealInt(Bit8u intnum); 64 | void CALLBACK_RunRealFar(Bit16u seg,Bit16u off); 65 | 66 | bool CALLBACK_Setup(Bitu callback,CallBack_Handler handler,Bitu type,const char* descr); 67 | Bitu CALLBACK_Setup(Bitu callback,CallBack_Handler handler,Bitu type,PhysPt addr,const char* descr); 68 | 69 | const char* CALLBACK_GetDescription(Bitu callback); 70 | bool CALLBACK_Free(Bitu callback); 71 | 72 | void CALLBACK_SCF(bool val); 73 | void CALLBACK_SZF(bool val); 74 | void CALLBACK_SIF(bool val); 75 | 76 | extern Bitu call_priv_io; 77 | 78 | 79 | class CALLBACK_HandlerObject{ 80 | private: 81 | bool installed; 82 | Bitu m_callback; 83 | enum {NONE,SETUP,SETUPAT} m_type; 84 | struct { 85 | RealPt old_vector; 86 | Bit8u interrupt; 87 | bool installed; 88 | } vectorhandler; 89 | public: 90 | CALLBACK_HandlerObject():installed(false),m_type(NONE) { 91 | vectorhandler.installed=false; 92 | } 93 | ~CALLBACK_HandlerObject(); 94 | 95 | //Install and allocate a callback. 96 | void Install(CallBack_Handler handler,Bitu type,const char* description); 97 | void Install(CallBack_Handler handler,Bitu type,PhysPt addr,const char* description); 98 | 99 | //Only allocate a callback number 100 | void Allocate(CallBack_Handler handler,const char* description=0); 101 | Bit16u Get_callback() { 102 | return (Bit16u)m_callback; 103 | } 104 | RealPt Get_RealPointer() { 105 | return CALLBACK_RealPointer(m_callback); 106 | } 107 | void Set_RealVec(Bit8u vec); 108 | }; 109 | #endif 110 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/control.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: control.h,v 1.2 2009-05-27 09:15:40 qbix79 Exp $ */ 20 | 21 | #ifndef DOSBOX_CONTROL_H 22 | #define DOSBOX_CONTROL_H 23 | 24 | #ifdef _MSC_VER 25 | #pragma warning ( disable : 4786 ) 26 | #pragma warning ( disable : 4290 ) 27 | #endif 28 | 29 | #ifndef DOSBOX_PROGRAMS_H 30 | #include "programs.h" 31 | #endif 32 | #ifndef DOSBOX_SETUP_H 33 | #include "setup.h" 34 | #endif 35 | 36 | #ifndef CH_LIST 37 | #define CH_LIST 38 | #include 39 | #endif 40 | 41 | #ifndef CH_VECTOR 42 | #define CH_VECTOR 43 | #include 44 | #endif 45 | 46 | #ifndef CH_STRING 47 | #define CH_STRING 48 | #include 49 | #endif 50 | 51 | 52 | 53 | 54 | class Config{ 55 | public: 56 | CommandLine * cmdline; 57 | private: 58 | std::list sectionlist; 59 | typedef std::list::iterator it; 60 | typedef std::list::reverse_iterator reverse_it; 61 | typedef std::list::const_iterator const_it; 62 | typedef std::list::const_reverse_iterator const_reverse_it; 63 | void (* _start_function)(void); 64 | bool secure_mode; //Sandbox mode 65 | public: 66 | Config(CommandLine * cmd):cmdline(cmd),secure_mode(false){} 67 | ~Config(); 68 | 69 | Section_line * AddSection_line(char const * const _name,void (*_initfunction)(Section*)); 70 | Section_prop * AddSection_prop(char const * const _name,void (*_initfunction)(Section*),bool canchange=false); 71 | 72 | Section* GetSection(int index); 73 | Section* GetSection(std::string const&_sectionname) const; 74 | Section* GetSectionFromProperty(char const * const prop) const; 75 | 76 | void SetStartUp(void (*_function)(void)); 77 | void Init(); 78 | void ShutDown(); 79 | void StartUp(); 80 | bool PrintConfig(char const * const configfilename) const; 81 | bool ParseConfigFile(char const * const configfilename); 82 | void ParseEnv(char ** envp); 83 | bool SecureMode() const { return secure_mode; } 84 | void SwitchToSecureMode() { secure_mode = true; }//can't be undone 85 | }; 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/cross.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: cross.h,v 1.21 2009-03-14 18:02:34 qbix79 Exp $ */ 20 | 21 | #ifndef DOSBOX_CROSS_H 22 | #define DOSBOX_CROSS_H 23 | 24 | #ifndef DOSBOX_DOSBOX_H 25 | #include "dosbox.h" 26 | #endif 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #if defined (_MSC_VER) /* MS Visual C++ */ 34 | #include 35 | #include 36 | #define LONGTYPE(a) a##i64 37 | #define snprintf _snprintf 38 | #define vsnprintf _vsnprintf 39 | #else /* LINUX / GCC */ 40 | #include 41 | #include 42 | #define LONGTYPE(a) a##LL 43 | #endif 44 | 45 | #define CROSS_LEN 512 /* Maximum filename size */ 46 | 47 | 48 | #if defined (WIN32) || defined (OS2) /* Win 32 & OS/2*/ 49 | #define CROSS_FILENAME(blah) 50 | #define CROSS_FILESPLIT '\\' 51 | #define F_OK 0 52 | #else 53 | #define CROSS_FILENAME(blah) strreplace(blah,'\\','/') 54 | #define CROSS_FILESPLIT '/' 55 | #endif 56 | 57 | #define CROSS_NONE 0 58 | #define CROSS_FILE 1 59 | #define CROSS_DIR 2 60 | #if defined (WIN32) 61 | #define ftruncate(blah,blah2) chsize(blah,blah2) 62 | #endif 63 | 64 | //Solaris maybe others 65 | #if defined (DB_HAVE_NO_POWF) 66 | #include 67 | static inline float powf (float x, float y) { return (float) pow (x,y); } 68 | #endif 69 | 70 | class Cross { 71 | public: 72 | static void GetPlatformConfigDir(std::string& in); 73 | static void GetPlatformConfigName(std::string& in); 74 | static void CreatePlatformConfigDir(std::string& in); 75 | static void ResolveHomedir(std::string & temp_line); 76 | static void CreateDir(std::string const& temp); 77 | }; 78 | 79 | 80 | #if defined (WIN32) 81 | 82 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from 83 | #include 84 | 85 | typedef struct dir_struct { 86 | HANDLE handle; 87 | char base_path[MAX_PATH+4]; 88 | WIN32_FIND_DATA search_data; 89 | } dir_information; 90 | 91 | #else 92 | 93 | //#include //Included above 94 | #include 95 | 96 | typedef struct dir_struct { 97 | DIR* dir; 98 | char base_path[CROSS_LEN]; 99 | } dir_information; 100 | 101 | #endif 102 | 103 | dir_information* open_directory(const char* dirname); 104 | bool read_directory_first(dir_information* dirp, char* entry_name, bool& is_directory); 105 | bool read_directory_next(dir_information* dirp, char* entry_name, bool& is_directory); 106 | void close_directory(dir_information* dirp); 107 | 108 | FILE *fopen_wrap(const char *path, const char *mode); 109 | #endif 110 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | void DEBUG_SetupConsole(void); 20 | void DEBUG_DrawScreen(void); 21 | bool DEBUG_Breakpoint(void); 22 | bool DEBUG_IntBreakpoint(Bit8u intNum); 23 | void DEBUG_Enable(bool pressed); 24 | void DEBUG_CheckExecuteBreakpoint(Bit16u seg, Bit32u off); 25 | bool DEBUG_ExitLoop(void); 26 | void DEBUG_RefreshPage(char scroll); 27 | Bitu DEBUG_EnableDebugger(void); 28 | 29 | extern Bitu cycle_count; 30 | extern Bitu debugCallback; 31 | 32 | #ifdef C_HEAVY_DEBUG 33 | bool DEBUG_HeavyIsBreakpoint(void); 34 | void DEBUG_HeavyWriteLogInstruction(void); 35 | #endif 36 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/dma.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: dma.h,v 1.20 2009-07-24 09:56:14 c2woody Exp $ */ 20 | 21 | #ifndef DOSBOX_DMA_H 22 | #define DOSBOX_DMA_H 23 | 24 | enum DMAEvent { 25 | DMA_REACHED_TC, 26 | DMA_MASKED, 27 | DMA_UNMASKED, 28 | DMA_TRANSFEREND 29 | }; 30 | 31 | class DmaChannel; 32 | typedef void (* DMA_CallBack)(DmaChannel * chan,DMAEvent event); 33 | 34 | class DmaChannel { 35 | public: 36 | Bit32u pagebase; 37 | Bit16u baseaddr; 38 | Bit32u curraddr; 39 | Bit16u basecnt; 40 | Bit16u currcnt; 41 | Bit8u channum; 42 | Bit8u pagenum; 43 | Bit8u DMA16; 44 | bool increment; 45 | bool autoinit; 46 | Bit8u trantype; 47 | bool masked; 48 | bool tcount; 49 | bool request; 50 | DMA_CallBack callback; 51 | 52 | DmaChannel(Bit8u num, bool dma16); 53 | void DoCallBack(DMAEvent event) { 54 | if (callback) (*callback)(this,event); 55 | } 56 | void SetMask(bool _mask) { 57 | masked=_mask; 58 | DoCallBack(masked ? DMA_MASKED : DMA_UNMASKED); 59 | } 60 | void Register_Callback(DMA_CallBack _cb) { 61 | callback = _cb; 62 | SetMask(masked); 63 | if (callback) Raise_Request(); 64 | else Clear_Request(); 65 | } 66 | void ReachedTC(void) { 67 | tcount=true; 68 | DoCallBack(DMA_REACHED_TC); 69 | } 70 | void SetPage(Bit8u val) { 71 | pagenum=val; 72 | pagebase=(pagenum >> DMA16) << (16+DMA16); 73 | } 74 | void Raise_Request(void) { 75 | request=true; 76 | } 77 | void Clear_Request(void) { 78 | request=false; 79 | } 80 | Bitu Read(Bitu size, Bit8u * buffer); 81 | Bitu Write(Bitu size, Bit8u * buffer); 82 | }; 83 | 84 | class DmaController { 85 | private: 86 | Bit8u ctrlnum; 87 | bool flipflop; 88 | DmaChannel *DmaChannels[4]; 89 | public: 90 | IO_ReadHandleObject DMA_ReadHandler[0x11]; 91 | IO_WriteHandleObject DMA_WriteHandler[0x11]; 92 | DmaController(Bit8u num) { 93 | flipflop = false; 94 | ctrlnum = num; /* first or second DMA controller */ 95 | for(Bit8u i=0;i<4;i++) { 96 | DmaChannels[i] = new DmaChannel(i+ctrlnum*4,ctrlnum==1); 97 | } 98 | } 99 | ~DmaController(void) { 100 | for(Bit8u i=0;i<4;i++) { 101 | delete DmaChannels[i]; 102 | } 103 | } 104 | DmaChannel * GetChannel(Bit8u chan) { 105 | if (chan<4) return DmaChannels[chan]; 106 | else return NULL; 107 | } 108 | void WriteControllerReg(Bitu reg,Bitu val,Bitu len); 109 | Bitu ReadControllerReg(Bitu reg,Bitu len); 110 | }; 111 | 112 | DmaChannel * GetDMAChannel(Bit8u chan); 113 | 114 | void CloseSecondDMAController(void); 115 | bool SecondDMAControllerAvailable(void); 116 | 117 | static Bit32u dma_wrapping = 0xffff; 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/dosbox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: dosbox.h,v 1.32 2009-05-27 09:15:41 qbix79 Exp $ */ 20 | 21 | #ifndef DOSBOX_DOSBOX_H 22 | #define DOSBOX_DOSBOX_H 23 | 24 | #include "config.h" 25 | 26 | GCC_ATTRIBUTE(noreturn) void E_Exit(const char * message,...) GCC_ATTRIBUTE( __format__(__printf__, 1, 2)); 27 | 28 | void MSG_Add(const char*,const char*); //add messages to the internal langaugefile 29 | const char* MSG_Get(char const *); //get messages from the internal langaugafile 30 | 31 | class Section; 32 | 33 | typedef Bitu (LoopHandler)(void); 34 | 35 | void DOSBOX_RunMachine(); 36 | void DOSBOX_SetLoop(LoopHandler * handler); 37 | void DOSBOX_SetNormalLoop(); 38 | 39 | void DOSBOX_Init(void); 40 | 41 | class Config; 42 | extern Config * control; 43 | 44 | enum MachineType { 45 | MCH_HERC, 46 | MCH_CGA, 47 | MCH_TANDY, 48 | MCH_PCJR, 49 | MCH_EGA, 50 | MCH_VGA 51 | }; 52 | 53 | enum SVGACards { 54 | SVGA_None, 55 | SVGA_S3Trio, 56 | SVGA_TsengET4K, 57 | SVGA_TsengET3K, 58 | SVGA_ParadisePVGA1A 59 | }; 60 | 61 | extern SVGACards svgaCard; 62 | extern MachineType machine; 63 | extern bool SDLNetInited; 64 | 65 | #define IS_TANDY_ARCH ((machine==MCH_TANDY) || (machine==MCH_PCJR)) 66 | #define IS_EGAVGA_ARCH ((machine==MCH_EGA) || (machine==MCH_VGA)) 67 | #define IS_VGA_ARCH (machine==MCH_VGA) 68 | #define TANDY_ARCH_CASE MCH_TANDY: case MCH_PCJR 69 | #define EGAVGA_ARCH_CASE MCH_EGA: case MCH_VGA 70 | #define VGA_ARCH_CASE MCH_VGA 71 | 72 | #ifndef DOSBOX_LOGGING_H 73 | #include "logging.h" 74 | #endif // the logging system. 75 | 76 | #endif /* DOSBOX_DOSBOX_H */ 77 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/fpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef DOSBOX_FPU_H 20 | #define DOSBOX_FPU_H 21 | 22 | #ifndef DOSBOX_MEM_H 23 | #include "mem.h" 24 | #endif 25 | 26 | void FPU_ESC0_Normal(Bitu rm); 27 | void FPU_ESC0_EA(Bitu func,PhysPt ea); 28 | void FPU_ESC1_Normal(Bitu rm); 29 | void FPU_ESC1_EA(Bitu func,PhysPt ea); 30 | void FPU_ESC2_Normal(Bitu rm); 31 | void FPU_ESC2_EA(Bitu func,PhysPt ea); 32 | void FPU_ESC3_Normal(Bitu rm); 33 | void FPU_ESC3_EA(Bitu func,PhysPt ea); 34 | void FPU_ESC4_Normal(Bitu rm); 35 | void FPU_ESC4_EA(Bitu func,PhysPt ea); 36 | void FPU_ESC5_Normal(Bitu rm); 37 | void FPU_ESC5_EA(Bitu func,PhysPt ea); 38 | void FPU_ESC6_Normal(Bitu rm); 39 | void FPU_ESC6_EA(Bitu func,PhysPt ea); 40 | void FPU_ESC7_Normal(Bitu rm); 41 | void FPU_ESC7_EA(Bitu func,PhysPt ea); 42 | 43 | 44 | typedef union { 45 | double d; 46 | #ifndef WORDS_BIGENDIAN 47 | struct { 48 | Bit32u lower; 49 | Bit32s upper; 50 | } l; 51 | #else 52 | struct { 53 | Bit32s upper; 54 | Bit32u lower; 55 | } l; 56 | #endif 57 | Bit64s ll; 58 | } FPU_Reg; 59 | 60 | typedef struct { 61 | Bit32u m1; 62 | Bit32u m2; 63 | Bit16u m3; 64 | 65 | Bit16u d1; 66 | Bit32u d2; 67 | } FPU_P_Reg; 68 | 69 | enum FPU_Tag { 70 | TAG_Valid = 0, 71 | TAG_Zero = 1, 72 | TAG_Weird = 2, 73 | TAG_Empty = 3 74 | }; 75 | 76 | enum FPU_Round { 77 | ROUND_Nearest = 0, 78 | ROUND_Down = 1, 79 | ROUND_Up = 2, 80 | ROUND_Chop = 3 81 | }; 82 | 83 | typedef struct { 84 | FPU_Reg regs[9]; 85 | FPU_P_Reg p_regs[9]; 86 | FPU_Tag tags[9]; 87 | Bit16u cw,cw_mask_all; 88 | Bit16u sw; 89 | Bit32u top; 90 | FPU_Round round; 91 | } FPU_rec; 92 | 93 | 94 | //get pi from a real library 95 | #define PI 3.14159265358979323846 96 | #define L2E 1.4426950408889634 97 | #define L2T 3.3219280948873623 98 | #define LN2 0.69314718055994531 99 | #define LG2 0.3010299956639812 100 | 101 | 102 | extern FPU_rec fpu; 103 | 104 | #define TOP fpu.top 105 | #define STV(i) ( (fpu.top+ (i) ) & 7 ) 106 | 107 | 108 | Bit16u FPU_GetTag(void); 109 | void FPU_FLDCW(PhysPt addr); 110 | 111 | static INLINE void FPU_SetTag(Bit16u tag){ 112 | for(Bitu i=0;i<8;i++) 113 | fpu.tags[i] = static_cast((tag >>(2*i))&3); 114 | } 115 | 116 | static INLINE void FPU_SetCW(Bitu word){ 117 | fpu.cw = (Bit16u)word; 118 | fpu.cw_mask_all = (Bit16u)(word | 0x3f); 119 | fpu.round = (FPU_Round)((word >> 10) & 3); 120 | } 121 | 122 | 123 | static INLINE Bitu FPU_GET_TOP(void) { 124 | return (fpu.sw & 0x3800)>>11; 125 | } 126 | 127 | static INLINE void FPU_SET_TOP(Bitu val){ 128 | fpu.sw &= ~0x3800; 129 | fpu.sw |= (val&7)<<11; 130 | } 131 | 132 | 133 | static INLINE void FPU_SET_C0(Bitu C){ 134 | fpu.sw &= ~0x0100; 135 | if(C) fpu.sw |= 0x0100; 136 | } 137 | 138 | static INLINE void FPU_SET_C1(Bitu C){ 139 | fpu.sw &= ~0x0200; 140 | if(C) fpu.sw |= 0x0200; 141 | } 142 | 143 | static INLINE void FPU_SET_C2(Bitu C){ 144 | fpu.sw &= ~0x0400; 145 | if(C) fpu.sw |= 0x0400; 146 | } 147 | 148 | static INLINE void FPU_SET_C3(Bitu C){ 149 | fpu.sw &= ~0x4000; 150 | if(C) fpu.sw |= 0x4000; 151 | } 152 | 153 | 154 | #endif 155 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/hardware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: hardware.h,v 1.17 2009-06-23 17:46:05 c2woody Exp $ */ 20 | 21 | #ifndef DOSBOX_HARDWARE_H 22 | #define DOSBOX_HARDWARE_H 23 | 24 | #include 25 | 26 | class Section; 27 | enum OPL_Mode { 28 | OPL_none,OPL_cms,OPL_opl2,OPL_dualopl2,OPL_opl3 29 | }; 30 | #define CAPTURE_WAVE 0x01 31 | #define CAPTURE_OPL 0x02 32 | #define CAPTURE_MIDI 0x04 33 | #define CAPTURE_IMAGE 0x08 34 | #define CAPTURE_VIDEO 0x10 35 | 36 | extern Bitu CaptureState; 37 | 38 | void OPL_Init(Section* sec,OPL_Mode mode); 39 | void CMS_Init(Section* sec); 40 | void OPL_ShutDown(Section* sec); 41 | void CMS_ShutDown(Section* sec); 42 | 43 | bool SB_Get_Address(Bitu& sbaddr, Bitu& sbirq, Bitu& sbdma); 44 | bool TS_Get_Address(Bitu& tsaddr, Bitu& tsirq, Bitu& tsdma); 45 | 46 | extern Bit8u adlib_commandreg; 47 | FILE * OpenCaptureFile(const char * type,const char * ext); 48 | 49 | void CAPTURE_AddWave(Bit32u freq, Bit32u len, Bit16s * data); 50 | #define CAPTURE_FLAG_DBLW 0x1 51 | #define CAPTURE_FLAG_DBLH 0x2 52 | void CAPTURE_AddImage(Bitu width, Bitu height, Bitu bpp, Bitu pitch, Bitu flags, float fps, Bit8u * data, Bit8u * pal); 53 | void CAPTURE_AddMidi(bool sysex, Bitu len, Bit8u * data); 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/inout.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: inout.h,v 1.13 2009-05-27 09:15:41 qbix79 Exp $ */ 20 | 21 | #ifndef DOSBOX_INOUT_H 22 | #define DOSBOX_INOUT_H 23 | 24 | #define IO_MAX (64*1024+3) 25 | 26 | #define IO_MB 0x1 27 | #define IO_MW 0x2 28 | #define IO_MD 0x4 29 | #define IO_MA (IO_MB | IO_MW | IO_MD ) 30 | 31 | typedef Bitu IO_ReadHandler(Bitu port,Bitu iolen); 32 | typedef void IO_WriteHandler(Bitu port,Bitu val,Bitu iolen); 33 | 34 | extern IO_WriteHandler * io_writehandlers[3][IO_MAX]; 35 | extern IO_ReadHandler * io_readhandlers[3][IO_MAX]; 36 | 37 | void IO_RegisterReadHandler(Bitu port,IO_ReadHandler * handler,Bitu mask,Bitu range=1); 38 | void IO_RegisterWriteHandler(Bitu port,IO_WriteHandler * handler,Bitu mask,Bitu range=1); 39 | 40 | void IO_FreeReadHandler(Bitu port,Bitu mask,Bitu range=1); 41 | void IO_FreeWriteHandler(Bitu port,Bitu mask,Bitu range=1); 42 | 43 | void IO_WriteB(Bitu port,Bitu val); 44 | void IO_WriteW(Bitu port,Bitu val); 45 | void IO_WriteD(Bitu port,Bitu val); 46 | 47 | Bitu IO_ReadB(Bitu port); 48 | Bitu IO_ReadW(Bitu port); 49 | Bitu IO_ReadD(Bitu port); 50 | 51 | /* Classes to manage the IO objects created by the various devices. 52 | * The io objects will remove itself on destruction.*/ 53 | class IO_Base{ 54 | protected: 55 | bool installed; 56 | Bitu m_port, m_mask,m_range; 57 | public: 58 | IO_Base():installed(false){}; 59 | }; 60 | class IO_ReadHandleObject: private IO_Base{ 61 | public: 62 | void Install(Bitu port,IO_ReadHandler * handler,Bitu mask,Bitu range=1); 63 | ~IO_ReadHandleObject(); 64 | }; 65 | class IO_WriteHandleObject: private IO_Base{ 66 | public: 67 | void Install(Bitu port,IO_WriteHandler * handler,Bitu mask,Bitu range=1); 68 | ~IO_WriteHandleObject(); 69 | }; 70 | 71 | static INLINE void IO_Write(Bitu port,Bit8u val) { 72 | IO_WriteB(port,val); 73 | } 74 | static INLINE Bit8u IO_Read(Bitu port){ 75 | return (Bit8u)IO_ReadB(port); 76 | } 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/ipx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: ipx.h,v 1.13 2009-05-27 09:15:41 qbix79 Exp $ */ 20 | 21 | #ifndef DOSBOX_IPX_H 22 | #define DOSBOX_IPX_H 23 | 24 | // Uncomment this for a lot of debug messages: 25 | //#define IPX_DEBUGMSG 26 | 27 | #ifdef IPX_DEBUGMSG 28 | #define LOG_IPX LOG_MSG 29 | #else 30 | #if defined (_MSC_VER) 31 | #define LOG_IPX 32 | #else 33 | #define LOG_IPX(...) 34 | #endif 35 | #endif 36 | 37 | #ifndef DOSBOX_DOSBOX_H 38 | #include "dosbox.h" 39 | #endif 40 | #ifndef DOSBOX_MEM_H 41 | #include "mem.h" 42 | #endif 43 | 44 | // In Use Flag codes 45 | #define USEFLAG_AVAILABLE 0x00 46 | #define USEFLAG_AESTEMP 0xe0 47 | #define USEFLAG_IPXCRIT 0xf8 48 | #define USEFLAG_SPXLISTEN 0xf9 49 | #define USEFLAG_PROCESSING 0xfa 50 | #define USEFLAG_HOLDING 0xfb 51 | #define USEFLAG_AESWAITING 0xfc 52 | #define USEFLAG_AESCOUNT 0xfd 53 | #define USEFLAG_LISTENING 0xfe 54 | #define USEFLAG_SENDING 0xff 55 | 56 | // Completion codes 57 | #define COMP_SUCCESS 0x00 58 | #define COMP_REMOTETERM 0xec 59 | #define COMP_DISCONNECT 0xed 60 | #define COMP_INVALIDID 0xee 61 | #define COMP_SPXTABLEFULL 0xef 62 | #define COMP_EVENTNOTCANCELED 0xf9 63 | #define COMP_NOCONNECTION 0xfa 64 | #define COMP_CANCELLED 0xfc 65 | #define COMP_MALFORMED 0xfd 66 | #define COMP_UNDELIVERABLE 0xfe 67 | #define COMP_HARDWAREERROR 0xff 68 | 69 | #ifdef _MSC_VER 70 | #pragma pack(1) 71 | #endif 72 | 73 | // For Uint8 type 74 | #include "SDL_net.h" 75 | 76 | struct PackedIP { 77 | Uint32 host; 78 | Uint16 port; 79 | } GCC_ATTRIBUTE(packed); 80 | 81 | struct nodeType { 82 | Uint8 node[6]; 83 | } GCC_ATTRIBUTE(packed) ; 84 | 85 | struct IPXHeader { 86 | Uint8 checkSum[2]; 87 | Uint8 length[2]; 88 | Uint8 transControl; // Transport control 89 | Uint8 pType; // Packet type 90 | 91 | struct transport { 92 | Uint8 network[4]; 93 | union addrtype { 94 | nodeType byNode; 95 | PackedIP byIP ; 96 | } GCC_ATTRIBUTE(packed) addr; 97 | Uint8 socket[2]; 98 | } dest, src; 99 | } GCC_ATTRIBUTE(packed); 100 | 101 | struct fragmentDescriptor { 102 | Bit16u offset; 103 | Bit16u segment; 104 | Bit16u size; 105 | }; 106 | 107 | #define IPXBUFFERSIZE 1424 108 | 109 | class ECBClass { 110 | public: 111 | RealPt ECBAddr; 112 | bool isInESRList; 113 | ECBClass *prevECB; // Linked List 114 | ECBClass *nextECB; 115 | 116 | Bit8u iuflag; // Need to save data since we are not always in 117 | Bit16u mysocket; // real mode 118 | 119 | Bit8u* databuffer; // received data is stored here until we get called 120 | Bitu buflen; // by Interrupt 121 | 122 | #ifdef IPX_DEBUGMSG 123 | Bitu SerialNumber; 124 | #endif 125 | 126 | ECBClass(Bit16u segment, Bit16u offset); 127 | Bit16u getSocket(void); 128 | 129 | Bit8u getInUseFlag(void); 130 | 131 | void setInUseFlag(Bit8u flagval); 132 | 133 | void setCompletionFlag(Bit8u flagval); 134 | 135 | Bit16u getFragCount(void); 136 | 137 | bool writeData(); 138 | void writeDataBuffer(Bit8u* buffer, Bit16u length); 139 | 140 | void getFragDesc(Bit16u descNum, fragmentDescriptor *fragDesc); 141 | RealPt getESRAddr(void); 142 | 143 | void NotifyESR(void); 144 | 145 | void setImmAddress(Bit8u *immAddr); 146 | void getImmAddress(Bit8u* immAddr); 147 | 148 | ~ECBClass(); 149 | }; 150 | 151 | // The following routines may not be needed on all systems. On my build of SDL the IPaddress structure is 8 octects 152 | // and therefore screws up my IPXheader structure since it needs to be packed. 153 | 154 | void UnpackIP(PackedIP ipPack, IPaddress * ipAddr); 155 | void PackIP(IPaddress ipAddr, PackedIP *ipPack); 156 | 157 | #ifdef _MSC_VER 158 | #pragma pack() 159 | #endif 160 | 161 | #endif 162 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/ipxserver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef DOSBOX_IPXSERVER_H_ 20 | #define DOSBOX_IPXSERVER_H_ 21 | 22 | #if C_IPX 23 | 24 | #include "SDL_net.h" 25 | 26 | struct packetBuffer { 27 | Bit8u buffer[1024]; 28 | Bit16s packetSize; // Packet size remaining in read 29 | Bit16s packetRead; // Bytes read of total packet 30 | bool inPacket; // In packet reception flag 31 | bool connected; // Connected flag 32 | bool waitsize; 33 | }; 34 | 35 | #define SOCKETTABLESIZE 16 36 | #define CONVIP(hostvar) hostvar & 0xff, (hostvar >> 8) & 0xff, (hostvar >> 16) & 0xff, (hostvar >> 24) & 0xff 37 | #define CONVIPX(hostvar) hostvar[0], hostvar[1], hostvar[2], hostvar[3], hostvar[4], hostvar[5] 38 | 39 | 40 | void IPX_StopServer(); 41 | bool IPX_StartServer(Bit16u portnum); 42 | bool IPX_isConnectedToServer(Bits tableNum, IPaddress ** ptrAddr); 43 | 44 | Bit8u packetCRC(Bit8u *buffer, Bit16u bufSize); 45 | 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/joystick.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: joystick.h,v 1.13 2009-05-27 09:15:41 qbix79 Exp $ */ 20 | #ifndef DOSBOX_JOYSTICK_H 21 | #define DOSBOX_JOYSTICK_H 22 | void JOYSTICK_Enable(Bitu which,bool enabled); 23 | 24 | void JOYSTICK_Button(Bitu which,Bitu num,bool pressed); 25 | 26 | void JOYSTICK_Move_X(Bitu which,float x); 27 | 28 | void JOYSTICK_Move_Y(Bitu which,float y); 29 | 30 | bool JOYSTICK_IsEnabled(Bitu which); 31 | 32 | bool JOYSTICK_GetButton(Bitu which, Bitu num); 33 | 34 | float JOYSTICK_GetMove_X(Bitu which); 35 | 36 | float JOYSTICK_GetMove_Y(Bitu which); 37 | 38 | enum JoystickType { 39 | JOY_NONE, 40 | JOY_AUTO, 41 | JOY_2AXIS, 42 | JOY_4AXIS, 43 | JOY_4AXIS_2, 44 | JOY_FCS, 45 | JOY_CH 46 | }; 47 | 48 | extern JoystickType joytype; 49 | extern bool button_wrapping_enabled; 50 | #endif 51 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/keyboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef DOSBOX_KEYBOARD_H 20 | #define DOSBOX_KEYBOARD_H 21 | 22 | enum KBD_KEYS { 23 | KBD_NONE, 24 | KBD_1, KBD_2, KBD_3, KBD_4, KBD_5, KBD_6, KBD_7, KBD_8, KBD_9, KBD_0, 25 | KBD_q, KBD_w, KBD_e, KBD_r, KBD_t, KBD_y, KBD_u, KBD_i, KBD_o, KBD_p, 26 | KBD_a, KBD_s, KBD_d, KBD_f, KBD_g, KBD_h, KBD_j, KBD_k, KBD_l, KBD_z, 27 | KBD_x, KBD_c, KBD_v, KBD_b, KBD_n, KBD_m, 28 | KBD_f1, KBD_f2, KBD_f3, KBD_f4, KBD_f5, KBD_f6, KBD_f7, KBD_f8, KBD_f9, KBD_f10,KBD_f11,KBD_f12, 29 | 30 | /*Now the weirder keys */ 31 | 32 | KBD_esc,KBD_tab,KBD_backspace,KBD_enter,KBD_space, 33 | KBD_leftalt,KBD_rightalt,KBD_leftctrl,KBD_rightctrl,KBD_leftshift,KBD_rightshift, 34 | KBD_capslock,KBD_scrolllock,KBD_numlock, 35 | 36 | KBD_grave,KBD_minus,KBD_equals,KBD_backslash,KBD_leftbracket,KBD_rightbracket, 37 | KBD_semicolon,KBD_quote,KBD_period,KBD_comma,KBD_slash,KBD_extra_lt_gt, 38 | 39 | KBD_printscreen,KBD_pause, 40 | KBD_insert,KBD_home,KBD_pageup,KBD_delete,KBD_end,KBD_pagedown, 41 | KBD_left,KBD_up,KBD_down,KBD_right, 42 | 43 | KBD_kp1,KBD_kp2,KBD_kp3,KBD_kp4,KBD_kp5,KBD_kp6,KBD_kp7,KBD_kp8,KBD_kp9,KBD_kp0, 44 | KBD_kpdivide,KBD_kpmultiply,KBD_kpminus,KBD_kpplus,KBD_kpenter,KBD_kpperiod, 45 | 46 | 47 | KBD_LAST 48 | }; 49 | 50 | void KEYBOARD_ClrBuffer(void); 51 | void KEYBOARD_AddKey(KBD_KEYS keytype,bool pressed); 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/logging.h: -------------------------------------------------------------------------------- 1 | #ifndef DOSBOX_LOGGING_H 2 | #define DOSBOX_LOGGING_H 3 | enum LOG_TYPES { 4 | LOG_ALL, 5 | LOG_VGA, LOG_VGAGFX,LOG_VGAMISC,LOG_INT10, 6 | LOG_SB,LOG_DMACONTROL, 7 | LOG_FPU,LOG_CPU,LOG_PAGING, 8 | LOG_FCB,LOG_FILES,LOG_IOCTL,LOG_EXEC,LOG_DOSMISC, 9 | LOG_PIT,LOG_KEYBOARD,LOG_PIC, 10 | LOG_MOUSE,LOG_BIOS,LOG_GUI,LOG_MISC, 11 | LOG_IO, 12 | LOG_REELMAGIC, 13 | LOG_MAX 14 | }; 15 | 16 | enum LOG_SEVERITIES { 17 | LOG_NORMAL, 18 | LOG_WARN, 19 | LOG_ERROR 20 | }; 21 | 22 | #if C_DEBUG 23 | class LOG 24 | { 25 | LOG_TYPES d_type; 26 | LOG_SEVERITIES d_severity; 27 | public: 28 | 29 | LOG (LOG_TYPES type , LOG_SEVERITIES severity): 30 | d_type(type), 31 | d_severity(severity) 32 | {} 33 | void operator() (char const* buf, ...) GCC_ATTRIBUTE(__format__(__printf__, 2, 3)); //../src/debug/debug_gui.cpp 34 | 35 | }; 36 | 37 | void DEBUG_ShowMsg(char const* format,...) GCC_ATTRIBUTE(__format__(__printf__, 1, 2)); 38 | #define LOG_MSG DEBUG_ShowMsg 39 | 40 | #else //C_DEBUG 41 | 42 | struct LOG 43 | { 44 | inline LOG(LOG_TYPES , LOG_SEVERITIES ) { } 45 | inline void operator()(char const* , ... ) { } 46 | 47 | 48 | }; //add missing operators to here 49 | //try to avoid anything smaller than bit32... 50 | void GFX_ShowMsg(char const* format,...) GCC_ATTRIBUTE(__format__(__printf__, 1, 2)); 51 | #define LOG_MSG GFX_ShowMsg 52 | 53 | #endif //C_DEBUG 54 | 55 | 56 | #endif //DOSBOX_LOGGING_H 57 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/mapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef DOSBOX_MAPPER_H 20 | #define DOSBOX_MAPPER_H 21 | 22 | enum MapKeys { 23 | MK_f1,MK_f2,MK_f3,MK_f4,MK_f5,MK_f6,MK_f7,MK_f8,MK_f9,MK_f10,MK_f11,MK_f12, 24 | MK_return,MK_kpminus,MK_scrolllock,MK_printscreen,MK_pause 25 | 26 | }; 27 | 28 | typedef void (MAPPER_Handler)(bool pressed); 29 | void MAPPER_AddHandler(MAPPER_Handler * handler,MapKeys key,Bitu mods,char const * const eventname,char const * const buttonname); 30 | void MAPPER_Init(void); 31 | void MAPPER_StartUp(Section * sec); 32 | void MAPPER_Run(bool pressed); 33 | void MAPPER_RunInternal(); 34 | void MAPPER_LosingFocus(void); 35 | 36 | 37 | #define MMOD1 0x1 38 | #define MMOD2 0x2 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/mixer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: mixer.h,v 1.19 2009-04-28 21:48:24 harekiet Exp $ */ 20 | 21 | #ifndef DOSBOX_MIXER_H 22 | #define DOSBOX_MIXER_H 23 | 24 | #ifndef DOSBOX_DOSBOX_H 25 | #include "dosbox.h" 26 | #endif 27 | 28 | typedef void (*MIXER_MixHandler)(Bit8u * sampdate,Bit32u len); 29 | typedef void (*MIXER_Handler)(Bitu len); 30 | 31 | enum BlahModes { 32 | MIXER_8MONO,MIXER_8STEREO, 33 | MIXER_16MONO,MIXER_16STEREO 34 | }; 35 | 36 | enum MixerModes { 37 | M_8M,M_8S, 38 | M_16M,M_16S 39 | }; 40 | 41 | #define MIXER_BUFSIZE (16*1024) 42 | #define MIXER_BUFMASK (MIXER_BUFSIZE-1) 43 | extern Bit8u MixTemp[MIXER_BUFSIZE]; 44 | 45 | #define MAX_AUDIO ((1<<(16-1))-1) 46 | #define MIN_AUDIO -(1<<(16-1)) 47 | 48 | class MixerChannel { 49 | public: 50 | void SetVolume(float _left,float _right); 51 | void SetScale( float f ); 52 | void UpdateVolume(void); 53 | void SetFreq(Bitu _freq); 54 | void Mix(Bitu _needed); 55 | void AddSilence(void); //Fill up until needed 56 | 57 | template 58 | void AddSamples(Bitu len, const Type* data); 59 | 60 | void AddSamples_m8(Bitu len, const Bit8u * data); 61 | void AddSamples_s8(Bitu len, const Bit8u * data); 62 | void AddSamples_m8s(Bitu len, const Bit8s * data); 63 | void AddSamples_s8s(Bitu len, const Bit8s * data); 64 | void AddSamples_m16(Bitu len, const Bit16s * data); 65 | void AddSamples_s16(Bitu len, const Bit16s * data); 66 | void AddSamples_m16u(Bitu len, const Bit16u * data); 67 | void AddSamples_s16u(Bitu len, const Bit16u * data); 68 | void AddSamples_m32(Bitu len, const Bit32s * data); 69 | void AddSamples_s32(Bitu len, const Bit32s * data); 70 | void AddSamples_m16_nonnative(Bitu len, const Bit16s * data); 71 | void AddSamples_s16_nonnative(Bitu len, const Bit16s * data); 72 | void AddSamples_m16u_nonnative(Bitu len, const Bit16u * data); 73 | void AddSamples_s16u_nonnative(Bitu len, const Bit16u * data); 74 | void AddSamples_m32_nonnative(Bitu len, const Bit32s * data); 75 | void AddSamples_s32_nonnative(Bitu len, const Bit32s * data); 76 | 77 | void AddStretched(Bitu len,Bit16s * data); //Strech block up into needed data 78 | void FillUp(void); 79 | void Enable(bool _yesno); 80 | MIXER_Handler handler; 81 | float volmain[2]; 82 | float scale; 83 | Bit32s volmul[2]; 84 | Bitu freq_add,freq_index; 85 | Bitu done,needed; 86 | Bits last[2]; 87 | const char * name; 88 | bool enabled; 89 | MixerChannel * next; 90 | }; 91 | 92 | MixerChannel * MIXER_AddChannel(MIXER_Handler handler,Bitu freq,const char * name); 93 | MixerChannel * MIXER_FindChannel(const char * name); 94 | /* Find the device you want to delete with findchannel "delchan gets deleted" */ 95 | void MIXER_DelChannel(MixerChannel* delchan); 96 | 97 | /* Object to maintain a mixerchannel; As all objects it registers itself with create 98 | * and removes itself when destroyed. */ 99 | class MixerObject{ 100 | private: 101 | bool installed; 102 | char m_name[32]; 103 | public: 104 | MixerObject():installed(false){}; 105 | MixerChannel* Install(MIXER_Handler handler,Bitu freq,const char * name); 106 | ~MixerObject(); 107 | }; 108 | 109 | 110 | /* PC Speakers functions, tightly related to the timer functions */ 111 | void PCSPEAKER_SetCounter(Bitu cntr,Bitu mode); 112 | void PCSPEAKER_SetType(Bitu mode); 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/mouse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: mouse.h,v 1.15 2009-05-27 09:15:41 qbix79 Exp $ */ 20 | 21 | 22 | #ifndef DOSBOX_MOUSE_H 23 | #define DOSBOX_MOUSE_H 24 | 25 | 26 | void Mouse_ShowCursor(void); 27 | void Mouse_HideCursor(void); 28 | 29 | bool Mouse_SetPS2State(bool use); 30 | 31 | void Mouse_ChangePS2Callback(Bit16u pseg, Bit16u pofs); 32 | 33 | 34 | void Mouse_CursorMoved(float xrel,float yrel,float x,float y,bool emulate); 35 | void Mouse_CursorSet(float x,float y); 36 | void Mouse_ButtonPressed(Bit8u button); 37 | void Mouse_ButtonReleased(Bit8u button); 38 | 39 | void Mouse_AutoLock(bool enable); 40 | void Mouse_NewVideoMode(void); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/pic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef DOSBOX_PIC_H 20 | #define DOSBOX_PIC_H 21 | 22 | 23 | /* CPU Cycle Timing */ 24 | extern Bit32s CPU_Cycles; 25 | extern Bit32s CPU_CycleLeft; 26 | extern Bit32s CPU_CycleMax; 27 | 28 | typedef void (PIC_EOIHandler) (void); 29 | typedef void (* PIC_EventHandler)(Bitu val); 30 | 31 | 32 | #define PIC_MAXIRQ 15 33 | #define PIC_NOIRQ 0xFF 34 | 35 | extern Bitu PIC_IRQCheck; 36 | extern Bitu PIC_IRQActive; 37 | extern Bitu PIC_Ticks; 38 | 39 | static INLINE float PIC_TickIndex(void) { 40 | return (CPU_CycleMax-CPU_CycleLeft-CPU_Cycles)/(float)CPU_CycleMax; 41 | } 42 | 43 | static INLINE Bits PIC_TickIndexND(void) { 44 | return CPU_CycleMax-CPU_CycleLeft-CPU_Cycles; 45 | } 46 | 47 | static INLINE Bits PIC_MakeCycles(double amount) { 48 | return (Bits)(CPU_CycleMax*amount); 49 | } 50 | 51 | static INLINE double PIC_FullIndex(void) { 52 | return PIC_Ticks+(double)PIC_TickIndex(); 53 | } 54 | 55 | void PIC_ActivateIRQ(Bitu irq); 56 | void PIC_DeActivateIRQ(Bitu irq); 57 | 58 | void PIC_runIRQs(void); 59 | bool PIC_RunQueue(void); 60 | 61 | //Delay in milliseconds 62 | void PIC_AddEvent(PIC_EventHandler handler,float delay,Bitu val=0); 63 | void PIC_RemoveEvents(PIC_EventHandler handler); 64 | void PIC_RemoveSpecificEvents(PIC_EventHandler handler, Bitu val); 65 | 66 | void PIC_SetIRQMask(Bitu irq, bool masked); 67 | #endif 68 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/programs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: programs.h,v 1.19 2009-05-27 09:15:41 qbix79 Exp $ */ 20 | 21 | #ifndef DOSBOX_PROGRAMS_H 22 | #define DOSBOX_PROGRAMS_H 23 | 24 | #ifndef DOSBOX_DOSBOX_H 25 | #include "dosbox.h" 26 | #endif 27 | #ifndef DOSBOX_DOS_INC_H 28 | #include "dos_inc.h" 29 | #endif 30 | 31 | #ifndef CH_LIST 32 | #define CH_LIST 33 | #include 34 | #endif 35 | 36 | #ifndef CH_STRING 37 | #define CH_STRING 38 | #include 39 | #endif 40 | 41 | class CommandLine { 42 | public: 43 | CommandLine(int argc,char const * const argv[]); 44 | CommandLine(char const * const name,char const * const cmdline); 45 | const char * GetFileName(){ return file_name.c_str();} 46 | 47 | bool FindExist(char const * const name,bool remove=false); 48 | bool FindHex(char const * const name,int & value,bool remove=false); 49 | bool FindInt(char const * const name,int & value,bool remove=false); 50 | bool FindString(char const * const name,std::string & value,bool remove=false); 51 | bool FindCommand(unsigned int which,std::string & value); 52 | bool FindStringBegin(char const * const begin,std::string & value, bool remove=false); 53 | bool FindStringRemain(char const * const name,std::string & value); 54 | bool GetStringRemain(std::string & value); 55 | unsigned int GetCount(void); 56 | void Shift(unsigned int amount=1); 57 | Bit16u Get_arglength(); 58 | 59 | private: 60 | typedef std::list::iterator cmd_it; 61 | std::list cmds; 62 | std::string file_name; 63 | bool FindEntry(char const * const name,cmd_it & it,bool neednext=false); 64 | }; 65 | 66 | class Program { 67 | public: 68 | Program(); 69 | virtual ~Program(){ 70 | delete cmd; 71 | delete psp; 72 | } 73 | std::string temp_line; 74 | CommandLine * cmd; 75 | DOS_PSP * psp; 76 | virtual void Run(void)=0; 77 | bool GetEnvStr(const char * entry,std::string & result); 78 | bool GetEnvNum(Bitu num,std::string & result); 79 | Bitu GetEnvCount(void); 80 | bool SetEnv(const char * entry,const char * new_string); 81 | void WriteOut(const char * format,...); /* Write to standard output */ 82 | void WriteOut_NoParsing(const char * format); /* Write to standard output, no parsing */ 83 | void ChangeToLongCmd(); 84 | 85 | }; 86 | 87 | typedef void (PROGRAMS_Main)(Program * * make); 88 | void PROGRAMS_MakeFile(char const * const name,PROGRAMS_Main * main); 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/reelmagic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Jon Dennis 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef DOSBOX_REELMAGIC_H 20 | #define DOSBOX_REELMAGIC_H 21 | 22 | #include "dosbox.h" 23 | 24 | 25 | // 26 | // video mixer stuff 27 | // 28 | struct ReelMagic_PlayerConfiguration; 29 | struct ReelMagic_PlayerAttributes; 30 | struct ReelMagic_VideoMixerMPEGProvider { 31 | virtual ~ReelMagic_VideoMixerMPEGProvider() {} 32 | virtual void OnVerticalRefresh(void * const outputBuffer, const float fps) = 0; 33 | virtual const ReelMagic_PlayerConfiguration& GetConfig() const = 0; 34 | virtual const ReelMagic_PlayerAttributes& GetAttrs() const = 0; 35 | }; 36 | 37 | void ReelMagic_RENDER_SetPal(Bit8u entry,Bit8u red,Bit8u green,Bit8u blue); 38 | void ReelMagic_RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool dblw,bool dblh); 39 | bool ReelMagic_RENDER_StartUpdate(void); 40 | //void ReelMagic_RENDER_EndUpdate(bool abort); 41 | //void ReelMagic_RENDER_DrawLine(const void *src); 42 | typedef void (*ReelMagic_ScalerLineHandler_t)(const void *src); 43 | extern ReelMagic_ScalerLineHandler_t ReelMagic_RENDER_DrawLine; 44 | 45 | void ReelMagic_ResetVideoMixer(); 46 | void ReelMagic_SetVideoMixerEnabled(const bool enabled); 47 | ReelMagic_VideoMixerMPEGProvider *ReelMagic_GetVideoMixerMPEGProvider(); 48 | void ReelMagic_SetVideoMixerMPEGProvider(ReelMagic_VideoMixerMPEGProvider * const provider); 49 | void ReelMagic_InitVideoMixer(Section* /*sec*/); 50 | 51 | 52 | 53 | 54 | // 55 | // player stuff 56 | // 57 | 58 | #define REELMAGIC_MAX_HANDLES (16) 59 | typedef Bit8u ReelMagic_MediaPlayer_Handle; 60 | struct ReelMagic_PlayerConfiguration { 61 | bool VideoOutputVisible; 62 | bool UnderVga; 63 | Bit8u VgaAlphaIndex; 64 | Bit32u MagicDecodeKey; 65 | Bit32u UserData; 66 | struct { 67 | Bit16u X, Y; 68 | } DisplayPosition; 69 | struct { 70 | Bit16u Width, Height; 71 | } DisplaySize; 72 | }; 73 | struct ReelMagic_PlayerAttributes { 74 | struct { 75 | ReelMagic_MediaPlayer_Handle Master; 76 | ReelMagic_MediaPlayer_Handle Demux; 77 | ReelMagic_MediaPlayer_Handle Video; 78 | ReelMagic_MediaPlayer_Handle Audio; 79 | } Handles; 80 | struct { 81 | Bit16u Width, Height; 82 | } PictureSize; 83 | }; 84 | struct ReelMagic_MediaPlayerFile { 85 | virtual ~ReelMagic_MediaPlayerFile() {} 86 | virtual const char *GetFileName() const = 0; 87 | virtual Bit32u GetFileSize() const = 0; 88 | virtual Bit32u Read(Bit8u *data, Bit32u amount) = 0; 89 | virtual void Seek(Bit32u pos, Bit32u type) = 0; // type can be either DOS_SEEK_SET || DOS_SEEK_CUR... 90 | }; 91 | struct ReelMagic_MediaPlayer { 92 | virtual ~ReelMagic_MediaPlayer() {} 93 | virtual ReelMagic_PlayerConfiguration& Config() = 0; 94 | virtual const ReelMagic_PlayerAttributes& GetAttrs() const = 0; 95 | 96 | virtual bool HasSystem() const = 0; 97 | virtual bool HasVideo() const = 0; 98 | virtual bool HasAudio() const = 0; 99 | virtual bool IsPlaying() const = 0; 100 | virtual Bitu GetBytesDecoded() const = 0; 101 | 102 | enum PlayMode { 103 | MPPM_PAUSEONCOMPLETE, 104 | MPPM_STOPONCOMPLETE, 105 | MPPM_LOOP, 106 | }; 107 | virtual void Play(const PlayMode playMode = MPPM_PAUSEONCOMPLETE) = 0; 108 | virtual void Pause() = 0; 109 | virtual void Stop() = 0; 110 | virtual void SeekToByteOffset(const Bit32u offset) = 0; 111 | virtual void NotifyConfigChange() = 0; 112 | }; 113 | 114 | //note: once a player file object is handed to new/delete player, regardless of success, it will be cleaned up 115 | ReelMagic_MediaPlayer_Handle ReelMagic_NewPlayer(struct ReelMagic_MediaPlayerFile * const playerFile); 116 | void ReelMagic_DeletePlayer(const ReelMagic_MediaPlayer_Handle handle); 117 | ReelMagic_MediaPlayer& ReelMagic_HandleToMediaPlayer(const ReelMagic_MediaPlayer_Handle handle); //throws on invalid handle 118 | void ReelMagic_DeleteAllPlayers(); 119 | 120 | void ReelMagic_InitPlayer(Section* /*sec*/); 121 | void ReelMagic_ResetPlayers(); 122 | ReelMagic_PlayerConfiguration& ReelMagic_GlobalDefaultPlayerConfig(); 123 | 124 | 125 | 126 | 127 | // 128 | // driver and general stuff 129 | // 130 | void ReelMagic_Init(Section* /*sec*/); 131 | 132 | 133 | 134 | 135 | #endif /* #ifndef DOSBOX_REELMAGIC_H */ 136 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/render.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef DOSBOX_RENDER_H 20 | #define DOSBOX_RENDER_H 21 | 22 | // 0: complex scalers off, scaler cache off, some simple scalers off, memory requirements reduced 23 | // 1: complex scalers off, scaler cache off, all simple scalers on 24 | // 2: complex scalers off, scaler cache on 25 | // 3: complex scalers on 26 | #define RENDER_USE_ADVANCED_SCALERS 3 27 | 28 | #include "../src/gui/render_scalers.h" 29 | 30 | #define RENDER_SKIP_CACHE 16 31 | //Enable this for scalers to support 0 input for empty lines 32 | //#define RENDER_NULL_INPUT 33 | 34 | typedef struct { 35 | struct { 36 | Bit8u red; 37 | Bit8u green; 38 | Bit8u blue; 39 | Bit8u unused; 40 | } rgb[256]; 41 | union { 42 | Bit16u b16[256]; 43 | Bit32u b32[256]; 44 | } lut; 45 | bool changed; 46 | Bit8u modified[256]; 47 | Bitu first; 48 | Bitu last; 49 | } RenderPal_t; 50 | 51 | typedef struct { 52 | struct { 53 | Bitu width, start; 54 | Bitu height; 55 | Bitu bpp; 56 | bool dblw,dblh; 57 | double ratio; 58 | float fps; 59 | } src; 60 | struct { 61 | Bitu count; 62 | Bitu max; 63 | Bitu index; 64 | Bit8u hadSkip[RENDER_SKIP_CACHE]; 65 | } frameskip; 66 | struct { 67 | Bitu size; 68 | scalerMode_t inMode; 69 | scalerMode_t outMode; 70 | scalerOperation_t op; 71 | bool clearCache; 72 | bool forced; 73 | ScalerLineHandler_t lineHandler; 74 | ScalerLineHandler_t linePalHandler; 75 | ScalerComplexHandler_t complexHandler; 76 | Bitu blocks, lastBlock; 77 | Bitu outPitch; 78 | Bit8u *outWrite; 79 | Bitu cachePitch; 80 | Bit8u *cacheRead; 81 | Bitu inHeight, inLine, outLine; 82 | } scale; 83 | RenderPal_t pal; 84 | bool updating; 85 | bool active; 86 | bool aspect; 87 | bool fullFrame; 88 | } Render_t; 89 | 90 | extern Render_t render; 91 | extern ScalerLineHandler_t RENDER_DrawLine; 92 | void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool dblw,bool dblh); 93 | bool RENDER_StartUpdate(void); 94 | void RENDER_EndUpdate(bool abort); 95 | void RENDER_SetPal(Bit8u entry,Bit8u red,Bit8u green,Bit8u blue); 96 | 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/shell.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: shell.h,v 1.28 2009-07-03 19:36:57 qbix79 Exp $ */ 20 | 21 | #ifndef DOSBOX_SHELL_H 22 | #define DOSBOX_SHELL_H 23 | 24 | #include 25 | #ifndef DOSBOX_DOSBOX_H 26 | #include "dosbox.h" 27 | #endif 28 | #ifndef DOSBOX_PROGRAMS_H 29 | #include "programs.h" 30 | #endif 31 | 32 | #include 33 | #include 34 | 35 | #define CMD_MAXLINE 4096 36 | #define CMD_MAXCMDS 20 37 | #define CMD_OLDSIZE 4096 38 | extern Bitu call_shellstop; 39 | /* first_shell is used to add and delete stuff from the shell env 40 | * by "external" programs. (config) */ 41 | extern Program * first_shell; 42 | 43 | class DOS_Shell; 44 | 45 | class BatchFile { 46 | public: 47 | BatchFile(DOS_Shell * host,char const* const resolved_name,char const* const entered_name, char const * const cmd_line); 48 | virtual ~BatchFile(); 49 | virtual bool ReadLine(char * line); 50 | bool Goto(char * where); 51 | void Shift(void); 52 | Bit16u file_handle; 53 | Bit32u location; 54 | bool echo; 55 | DOS_Shell * shell; 56 | BatchFile * prev; 57 | CommandLine * cmd; 58 | std::string filename; 59 | }; 60 | 61 | class AutoexecEditor; 62 | class DOS_Shell : public Program { 63 | private: 64 | friend class AutoexecEditor; 65 | std::list l_history, l_completion; 66 | 67 | char *completion_start; 68 | Bit16u completion_index; 69 | 70 | public: 71 | 72 | DOS_Shell(); 73 | 74 | void Run(void); 75 | void RunInternal(void); //for command /C 76 | /* A load of subfunctions */ 77 | void ParseLine(char * line); 78 | Bitu GetRedirection(char *s, char **ifn, char **ofn,bool * append); 79 | void InputCommand(char * line); 80 | void ShowPrompt(); 81 | void DoCommand(char * cmd); 82 | bool Execute(char * name,char * args); 83 | /* Checks if it matches a hardware-property */ 84 | bool CheckConfig(char* cmd_in,char*line); 85 | /* Some internal used functions */ 86 | char * Which(char * name); 87 | /* Some supported commands */ 88 | void CMD_HELP(char * args); 89 | void CMD_CLS(char * args); 90 | void CMD_COPY(char * args); 91 | void CMD_DIR(char * args); 92 | void CMD_DELETE(char * args); 93 | void CMD_ECHO(char * args); 94 | void CMD_EXIT(char * args); 95 | void CMD_MKDIR(char * args); 96 | void CMD_CHDIR(char * args); 97 | void CMD_RMDIR(char * args); 98 | void CMD_SET(char * args); 99 | void CMD_IF(char * args); 100 | void CMD_GOTO(char * args); 101 | void CMD_TYPE(char * args); 102 | void CMD_REM(char * args); 103 | void CMD_RENAME(char * args); 104 | void CMD_CALL(char * args); 105 | void SyntaxError(void); 106 | void CMD_PAUSE(char * args); 107 | void CMD_SUBST(char* args); 108 | void CMD_LOADHIGH(char* args); 109 | void CMD_CHOICE(char * args); 110 | void CMD_ATTRIB(char * args); 111 | void CMD_PATH(char * args); 112 | void CMD_SHIFT(char * args); 113 | void CMD_VER(char * args); 114 | /* The shell's variables */ 115 | Bit16u input_handle; 116 | BatchFile * bf; 117 | bool echo; 118 | bool exit; 119 | bool call; 120 | }; 121 | 122 | struct SHELL_Cmd { 123 | const char * name; /* Command name*/ 124 | Bit32u flags; /* Flags about the command */ 125 | void (DOS_Shell::*handler)(char * args); /* Handler for this command */ 126 | const char * help; /* String with command help */ 127 | }; 128 | 129 | /* Object to manage lines in the autoexec.bat The lines get removed from 130 | * the file if the object gets destroyed. The environment is updated 131 | * as well if the line set a a variable */ 132 | class AutoexecObject{ 133 | private: 134 | bool installed; 135 | std::string buf; 136 | public: 137 | AutoexecObject():installed(false){ }; 138 | void Install(std::string const &in); 139 | void InstallBefore(std::string const &in); 140 | ~AutoexecObject(); 141 | private: 142 | void CreateAutoexec(void); 143 | }; 144 | 145 | #endif 146 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/support.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: support.h,v 1.18 2009-05-27 09:15:41 qbix79 Exp $ */ 20 | 21 | #ifndef DOSBOX_SUPPORT_H 22 | #define DOSBOX_SUPPORT_H 23 | 24 | #include 25 | #include 26 | #include 27 | #ifndef DOSBOX_DOSBOX_H 28 | #include "dosbox.h" 29 | #endif 30 | 31 | #if defined (_MSC_VER) /* MS Visual C++ */ 32 | #define strcasecmp(a,b) stricmp(a,b) 33 | #define strncasecmp(a,b,n) _strnicmp(a,b,n) 34 | #endif 35 | 36 | #define safe_strncpy(a,b,n) do { strncpy((a),(b),(n)-1); (a)[(n)-1] = 0; } while (0) 37 | 38 | #ifdef HAVE_STRINGS_H 39 | #include 40 | #endif 41 | 42 | void strreplace(char * str,char o,char n); 43 | char *ltrim(char *str); 44 | char *rtrim(char *str); 45 | char *trim(char * str); 46 | char * upcase(char * str); 47 | char * lowcase(char * str); 48 | 49 | bool ScanCMDBool(char * cmd,char const * const check); 50 | char * ScanCMDRemain(char * cmd); 51 | char * StripWord(char *&cmd); 52 | bool IsDecWord(char * word); 53 | bool IsHexWord(char * word); 54 | Bits ConvDecWord(char * word); 55 | Bits ConvHexWord(char * word); 56 | 57 | void upcase(std::string &str); 58 | void lowcase(std::string &str); 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef DOSBOX_TIMER_H 20 | #define DOSBOX_TIMER_H 21 | 22 | /* underlying clock rate in HZ */ 23 | #include 24 | 25 | #define PIT_TICK_RATE 1193182 26 | 27 | #define GetTicks() SDL_GetTicks() 28 | 29 | typedef void (*TIMER_TickHandler)(void); 30 | 31 | /* Register a function that gets called everytime if 1 or more ticks pass */ 32 | void TIMER_AddTickHandler(TIMER_TickHandler handler); 33 | void TIMER_DelTickHandler(TIMER_TickHandler handler); 34 | 35 | /* This will add 1 milliscond to all timers */ 36 | void TIMER_AddTick(void); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/vga_reelmagic_override.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Jon Dennis 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef DOSBOX_VGA_REELMAGIC_OVERRIDE_H 20 | #define DOSBOX_VGA_REELMAGIC_OVERRIDE_H 21 | 22 | 23 | #include "reelmagic.h" 24 | 25 | 26 | #define RENDER_SetPal ReelMagic_RENDER_SetPal 27 | #define RENDER_SetSize ReelMagic_RENDER_SetSize 28 | #define RENDER_StartUpdate ReelMagic_RENDER_StartUpdate 29 | #define RENDER_DrawLine ReelMagic_RENDER_DrawLine 30 | //#define RENDER_EndUpdate ReelMagic_RENDER_EndUpdate 31 | 32 | 33 | #endif /* #ifndef DOSBOX_VGA_REELMAGIC_OVERRIDE_H */ 34 | -------------------------------------------------------------------------------- /dosbox-0.74-3/include/video.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: video.h,v 1.26 2009-05-27 09:15:41 qbix79 Exp $ */ 20 | 21 | #ifndef DOSBOX_VIDEO_H 22 | #define DOSBOX_VIDEO_H 23 | 24 | #define REDUCE_JOYSTICK_POLLING 25 | 26 | typedef enum { 27 | GFX_CallBackReset, 28 | GFX_CallBackStop, 29 | GFX_CallBackRedraw 30 | } GFX_CallBackFunctions_t; 31 | 32 | typedef void (*GFX_CallBack_t)( GFX_CallBackFunctions_t function ); 33 | 34 | struct GFX_PalEntry { 35 | Bit8u r; 36 | Bit8u g; 37 | Bit8u b; 38 | Bit8u unused; 39 | }; 40 | 41 | #define GFX_CAN_8 0x0001 42 | #define GFX_CAN_15 0x0002 43 | #define GFX_CAN_16 0x0004 44 | #define GFX_CAN_32 0x0008 45 | 46 | #define GFX_LOVE_8 0x0010 47 | #define GFX_LOVE_15 0x0020 48 | #define GFX_LOVE_16 0x0040 49 | #define GFX_LOVE_32 0x0080 50 | 51 | #define GFX_RGBONLY 0x0100 52 | 53 | #define GFX_SCALING 0x1000 54 | #define GFX_HARDWARE 0x2000 55 | 56 | #define GFX_CAN_RANDOM 0x4000 //If the interface can also do random access surface 57 | 58 | void GFX_Events(void); 59 | void GFX_SetPalette(Bitu start,Bitu count,GFX_PalEntry * entries); 60 | Bitu GFX_GetBestMode(Bitu flags); 61 | Bitu GFX_GetRGB(Bit8u red,Bit8u green,Bit8u blue); 62 | Bitu GFX_SetSize(Bitu width,Bitu height,Bitu flags,double scalex,double scaley,GFX_CallBack_t cb); 63 | 64 | void GFX_ResetScreen(void); 65 | void GFX_Start(void); 66 | void GFX_Stop(void); 67 | void GFX_SwitchFullScreen(void); 68 | bool GFX_StartUpdate(Bit8u * & pixels,Bitu & pitch); 69 | void GFX_EndUpdate( const Bit16u *changedLines ); 70 | void GFX_GetSize(int &width, int &height, bool &fullscreen); 71 | void GFX_LosingFocus(void); 72 | 73 | #if defined (WIN32) 74 | bool GFX_SDLUsingWinDIB(void); 75 | #endif 76 | 77 | #if defined (REDUCE_JOYSTICK_POLLING) 78 | void MAPPER_UpdateJoysticks(void); 79 | #endif 80 | 81 | /* Mouse related */ 82 | void GFX_CaptureMouse(void); 83 | extern bool mouselocked; //true if mouse is confined to window 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | SUBDIRS = cpu debug dos fpu gui hardware libs ints misc shell platform 4 | 5 | bin_PROGRAMS = dosbox 6 | 7 | if HAVE_WINDRES 8 | ico_stuff = winres.rc 9 | endif 10 | 11 | .rc.o: 12 | $(WINDRES) -o $@ $< 13 | 14 | dosbox_SOURCES = dosbox.cpp $(ico_stuff) 15 | dosbox_LDADD = cpu/libcpu.a debug/libdebug.a dos/libdos.a fpu/libfpu.a hardware/libhardware.a gui/libgui.a \ 16 | ints/libints.a misc/libmisc.a shell/libshell.a hardware/mame/libmame.a \ 17 | hardware/serialport/libserial.a libs/gui_tk/libgui_tk.a 18 | 19 | EXTRA_DIST = winres.rc dosbox.ico 20 | 21 | 22 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = core_full core_normal core_dyn_x86 core_dynrec 2 | AM_CPPFLAGS = -I$(top_srcdir)/include 3 | 4 | noinst_LIBRARIES = libcpu.a 5 | libcpu_a_SOURCES = callback.cpp cpu.cpp flags.cpp modrm.cpp modrm.h core_full.cpp instructions.h \ 6 | paging.cpp lazyflags.h core_normal.cpp core_simple.cpp core_prefetch.cpp \ 7 | core_dyn_x86.cpp core_dynrec.cpp 8 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/core_dyn_x86/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_HEADERS = cache.h helpers.h decoder.h risc_x86.h string.h \ 2 | dyn_fpu.h dyn_fpu_dh.h -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/core_dyn_x86/helpers.h: -------------------------------------------------------------------------------- 1 | static bool dyn_helper_divb(Bit8u val) { 2 | if (!val) return CPU_PrepareException(0,0); 3 | Bitu quo=reg_ax / val; 4 | Bit8u rem=(Bit8u)(reg_ax % val); 5 | Bit8u quo8=(Bit8u)(quo&0xff); 6 | if (quo>0xff) return CPU_PrepareException(0,0); 7 | reg_ah=rem; 8 | reg_al=quo8; 9 | return false; 10 | } 11 | 12 | static bool dyn_helper_idivb(Bit8s val) { 13 | if (!val) return CPU_PrepareException(0,0); 14 | Bits quo=(Bit16s)reg_ax / val; 15 | Bit8s rem=(Bit8s)((Bit16s)reg_ax % val); 16 | Bit8s quo8s=(Bit8s)(quo&0xff); 17 | if (quo!=(Bit16s)quo8s) return CPU_PrepareException(0,0); 18 | reg_ah=rem; 19 | reg_al=quo8s; 20 | return false; 21 | } 22 | 23 | static bool dyn_helper_divw(Bit16u val) { 24 | if (!val) return CPU_PrepareException(0,0); 25 | Bitu num=(reg_dx<<16)|reg_ax; 26 | Bitu quo=num/val; 27 | Bit16u rem=(Bit16u)(num % val); 28 | Bit16u quo16=(Bit16u)(quo&0xffff); 29 | if (quo!=(Bit32u)quo16) return CPU_PrepareException(0,0); 30 | reg_dx=rem; 31 | reg_ax=quo16; 32 | return false; 33 | } 34 | 35 | static bool dyn_helper_idivw(Bit16s val) { 36 | if (!val) return CPU_PrepareException(0,0); 37 | Bits num=(reg_dx<<16)|reg_ax; 38 | Bits quo=num/val; 39 | Bit16s rem=(Bit16s)(num % val); 40 | Bit16s quo16s=(Bit16s)quo; 41 | if (quo!=(Bit32s)quo16s) return CPU_PrepareException(0,0); 42 | reg_dx=rem; 43 | reg_ax=quo16s; 44 | return false; 45 | } 46 | 47 | static bool dyn_helper_divd(Bit32u val) { 48 | if (!val) return CPU_PrepareException(0,0); 49 | Bit64u num=(((Bit64u)reg_edx)<<32)|reg_eax; 50 | Bit64u quo=num/val; 51 | Bit32u rem=(Bit32u)(num % val); 52 | Bit32u quo32=(Bit32u)(quo&0xffffffff); 53 | if (quo!=(Bit64u)quo32) return CPU_PrepareException(0,0); 54 | reg_edx=rem; 55 | reg_eax=quo32; 56 | return false; 57 | } 58 | 59 | static bool dyn_helper_idivd(Bit32s val) { 60 | if (!val) return CPU_PrepareException(0,0); 61 | Bit64s num=(((Bit64u)reg_edx)<<32)|reg_eax; 62 | Bit64s quo=num/val; 63 | Bit32s rem=(Bit32s)(num % val); 64 | Bit32s quo32s=(Bit32s)(quo&0xffffffff); 65 | if (quo!=(Bit64s)quo32s) return CPU_PrepareException(0,0); 66 | reg_edx=rem; 67 | reg_eax=quo32s; 68 | return false; 69 | } 70 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/core_dynrec/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_HEADERS = cache.h decoder.h decoder_basic.h decoder_opcodes.h \ 2 | dyn_fpu.h operators.h risc_x64.h risc_x86.h risc_mipsel32.h \ 3 | risc_armv4le.h risc_armv4le-common.h \ 4 | risc_armv4le-s3.h risc_armv4le-o3.h risc_armv4le-thumb.h \ 5 | risc_armv4le-thumb-iw.h risc_armv4le-thumb-niw.h 6 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/core_dynrec/risc_armv4le-common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: risc_armv4le-common.h,v 1.3 2009-05-16 21:52:47 c2woody Exp $ */ 20 | 21 | 22 | /* ARMv4 (little endian) backend by M-HT (common data/functions) */ 23 | 24 | 25 | // some configuring defines that specify the capabilities of this architecture 26 | // or aspects of the recompiling 27 | 28 | // protect FC_ADDR over function calls if necessaray 29 | // #define DRC_PROTECT_ADDR_REG 30 | 31 | // try to use non-flags generating functions if possible 32 | #define DRC_FLAGS_INVALIDATION 33 | // try to replace _simple functions by code 34 | #define DRC_FLAGS_INVALIDATION_DCODE 35 | 36 | // type with the same size as a pointer 37 | #define DRC_PTR_SIZE_IM Bit32u 38 | 39 | // calling convention modifier 40 | #define DRC_CALL_CONV /* nothing */ 41 | #define DRC_FC /* nothing */ 42 | 43 | // use FC_REGS_ADDR to hold the address of "cpu_regs" and to access it using FC_REGS_ADDR 44 | #define DRC_USE_REGS_ADDR 45 | // use FC_SEGS_ADDR to hold the address of "Segs" and to access it using FC_SEGS_ADDR 46 | #define DRC_USE_SEGS_ADDR 47 | 48 | // register mapping 49 | typedef Bit8u HostReg; 50 | 51 | // "lo" registers 52 | #define HOST_r0 0 53 | #define HOST_r1 1 54 | #define HOST_r2 2 55 | #define HOST_r3 3 56 | #define HOST_r4 4 57 | #define HOST_r5 5 58 | #define HOST_r6 6 59 | #define HOST_r7 7 60 | // "hi" registers 61 | #define HOST_r8 8 62 | #define HOST_r9 9 63 | #define HOST_r10 10 64 | #define HOST_r11 11 65 | #define HOST_r12 12 66 | #define HOST_r13 13 67 | #define HOST_r14 14 68 | #define HOST_r15 15 69 | 70 | // register aliases 71 | // "lo" registers 72 | #define HOST_a1 HOST_r0 73 | #define HOST_a2 HOST_r1 74 | #define HOST_a3 HOST_r2 75 | #define HOST_a4 HOST_r3 76 | #define HOST_v1 HOST_r4 77 | #define HOST_v2 HOST_r5 78 | #define HOST_v3 HOST_r6 79 | #define HOST_v4 HOST_r7 80 | // "hi" registers 81 | #define HOST_v5 HOST_r8 82 | #define HOST_v6 HOST_r9 83 | #define HOST_v7 HOST_r10 84 | #define HOST_v8 HOST_r11 85 | #define HOST_ip HOST_r12 86 | #define HOST_sp HOST_r13 87 | #define HOST_lr HOST_r14 88 | #define HOST_pc HOST_r15 89 | 90 | 91 | static void cache_block_closing(Bit8u* block_start,Bitu block_size) { 92 | #if (__ARM_EABI__) 93 | //flush cache - eabi 94 | register unsigned long _beg __asm ("a1") = (unsigned long)(block_start); // block start 95 | register unsigned long _end __asm ("a2") = (unsigned long)(block_start+block_size); // block end 96 | register unsigned long _flg __asm ("a3") = 0; 97 | register unsigned long _par __asm ("r7") = 0xf0002; // sys_cacheflush 98 | __asm __volatile ("swi 0x0" 99 | : // no outputs 100 | : "r" (_beg), "r" (_end), "r" (_flg), "r" (_par) 101 | ); 102 | #else 103 | // GP2X BEGIN 104 | //flush cache - old abi 105 | register unsigned long _beg __asm ("a1") = (unsigned long)(block_start); // block start 106 | register unsigned long _end __asm ("a2") = (unsigned long)(block_start+block_size); // block end 107 | register unsigned long _flg __asm ("a3") = 0; 108 | __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" 109 | : // no outputs 110 | : "r" (_beg), "r" (_end), "r" (_flg) 111 | ); 112 | // GP2X END 113 | #endif 114 | } 115 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/core_dynrec/risc_armv4le.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: risc_armv4le.h,v 1.3 2009-05-27 09:15:41 qbix79 Exp $ */ 20 | 21 | 22 | /* ARMv4 (little endian) backend (switcher) by M-HT */ 23 | 24 | #include "risc_armv4le-common.h" 25 | 26 | // choose your destiny: 27 | #include "risc_armv4le-thumb-niw.h" 28 | //#include "risc_armv4le-thumb-iw.h" 29 | //#include "risc_armv4le-thumb.h" 30 | //#include "risc_armv4le-s3.h" 31 | //#include "risc_armv4le-o3.h" 32 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/core_full.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #include "dosbox.h" 20 | 21 | #include "pic.h" 22 | #include "regs.h" 23 | #include "cpu.h" 24 | #include "lazyflags.h" 25 | #include "paging.h" 26 | #include "fpu.h" 27 | #include "debug.h" 28 | #include "inout.h" 29 | #include "callback.h" 30 | 31 | 32 | typedef PhysPt EAPoint; 33 | #define SegBase(c) SegPhys(c) 34 | 35 | #define LoadMb(off) mem_readb_inline(off) 36 | #define LoadMw(off) mem_readw_inline(off) 37 | #define LoadMd(off) mem_readd_inline(off) 38 | 39 | #define LoadMbs(off) (Bit8s)(LoadMb(off)) 40 | #define LoadMws(off) (Bit16s)(LoadMw(off)) 41 | #define LoadMds(off) (Bit32s)(LoadMd(off)) 42 | 43 | #define SaveMb(off,val) mem_writeb_inline(off,val) 44 | #define SaveMw(off,val) mem_writew_inline(off,val) 45 | #define SaveMd(off,val) mem_writed_inline(off,val) 46 | 47 | #define LoadD(reg) reg 48 | #define SaveD(reg,val) reg=val 49 | 50 | 51 | 52 | #include "core_full/loadwrite.h" 53 | #include "core_full/support.h" 54 | #include "core_full/optable.h" 55 | #include "instructions.h" 56 | 57 | #define EXCEPTION(blah) \ 58 | { \ 59 | Bit8u new_num=blah; \ 60 | CPU_Exception(new_num,0); \ 61 | continue; \ 62 | } 63 | 64 | Bits CPU_Core_Full_Run(void) { 65 | FullData inst; 66 | while (CPU_Cycles-->0) { 67 | #if C_DEBUG 68 | cycle_count++; 69 | #if C_HEAVY_DEBUG 70 | if (DEBUG_HeavyIsBreakpoint()) { 71 | FillFlags(); 72 | return debugCallback; 73 | }; 74 | #endif 75 | #endif 76 | LoadIP(); 77 | inst.entry=cpu.code.big*0x200; 78 | inst.prefix=cpu.code.big; 79 | restartopcode: 80 | inst.entry=(inst.entry & 0xffffff00) | Fetchb(); 81 | inst.code=OpCodeTable[inst.entry]; 82 | #include "core_full/load.h" 83 | #include "core_full/op.h" 84 | #include "core_full/save.h" 85 | nextopcode:; 86 | SaveIP(); 87 | continue; 88 | illegalopcode: 89 | LOG(LOG_CPU,LOG_NORMAL)("Illegal opcode"); 90 | CPU_Exception(0x6,0); 91 | } 92 | FillFlags(); 93 | return CBRET_NONE; 94 | } 95 | 96 | 97 | void CPU_Core_Full_Init(void) { 98 | 99 | } 100 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/core_full/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | noinst_HEADERS = ea_lookup.h load.h loadwrite.h op.h optable.h save.h \ 3 | string.h support.h 4 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/core_full/loadwrite.h: -------------------------------------------------------------------------------- 1 | #define SaveIP() reg_eip=(Bit32u)(inst.cseip-SegBase(cs)); 2 | #define LoadIP() inst.cseip=SegBase(cs)+reg_eip; 3 | #define GetIP() (inst.cseip-SegBase(cs)) 4 | 5 | #define RunException() { \ 6 | CPU_Exception(cpu.exception.which,cpu.exception.error); \ 7 | continue; \ 8 | } 9 | 10 | static INLINE Bit8u the_Fetchb(EAPoint & loc) { 11 | Bit8u temp=LoadMb(loc); 12 | loc+=1; 13 | return temp; 14 | } 15 | 16 | static INLINE Bit16u the_Fetchw(EAPoint & loc) { 17 | Bit16u temp=LoadMw(loc); 18 | loc+=2; 19 | return temp; 20 | } 21 | static INLINE Bit32u the_Fetchd(EAPoint & loc) { 22 | Bit32u temp=LoadMd(loc); 23 | loc+=4; 24 | return temp; 25 | } 26 | 27 | #define Fetchb() the_Fetchb(inst.cseip) 28 | #define Fetchw() the_Fetchw(inst.cseip) 29 | #define Fetchd() the_Fetchd(inst.cseip) 30 | 31 | #define Fetchbs() (Bit8s)the_Fetchb(inst.cseip) 32 | #define Fetchws() (Bit16s)the_Fetchw(inst.cseip) 33 | #define Fetchds() (Bit32s)the_Fetchd(inst.cseip) 34 | 35 | #define Push_16 CPU_Push16 36 | #define Push_32 CPU_Push32 37 | #define Pop_16 CPU_Pop16 38 | #define Pop_32 CPU_Pop32 39 | 40 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/core_full/save.h: -------------------------------------------------------------------------------- 1 | /* Write the data from the opcode */ 2 | switch (inst.code.save) { 3 | /* Byte */ 4 | case S_C_Eb: 5 | inst_op1_b=inst.cond ? 1 : 0; 6 | case S_Eb: 7 | if (inst.rm<0xc0) SaveMb(inst.rm_eaa,inst_op1_b); 8 | else reg_8(inst.rm_eai)=inst_op1_b; 9 | break; 10 | case S_Gb: 11 | reg_8(inst.rm_index)=inst_op1_b; 12 | break; 13 | case S_EbGb: 14 | if (inst.rm<0xc0) SaveMb(inst.rm_eaa,inst_op1_b); 15 | else reg_8(inst.rm_eai)=inst_op1_b; 16 | reg_8(inst.rm_index)=inst_op2_b; 17 | break; 18 | /* Word */ 19 | case S_Ew: 20 | if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst_op1_w); 21 | else reg_16(inst.rm_eai)=inst_op1_w; 22 | break; 23 | case S_Gw: 24 | reg_16(inst.rm_index)=inst_op1_w; 25 | break; 26 | case S_EwGw: 27 | if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst_op1_w); 28 | else reg_16(inst.rm_eai)=inst_op1_w; 29 | reg_16(inst.rm_index)=inst_op2_w; 30 | break; 31 | /* Dword */ 32 | case S_Ed: 33 | if (inst.rm<0xc0) SaveMd(inst.rm_eaa,inst_op1_d); 34 | else reg_32(inst.rm_eai)=inst_op1_d; 35 | break; 36 | case S_EdMw: /* Special one 16 to memory, 32 zero extend to reg */ 37 | if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst_op1_w); 38 | else reg_32(inst.rm_eai)=inst_op1_d; 39 | break; 40 | case S_Gd: 41 | reg_32(inst.rm_index)=inst_op1_d; 42 | break; 43 | case S_EdGd: 44 | if (inst.rm<0xc0) SaveMd(inst.rm_eaa,inst_op1_d); 45 | else reg_32(inst.rm_eai)=inst_op1_d; 46 | reg_32(inst.rm_index)=inst_op2_d; 47 | break; 48 | 49 | case S_REGb: 50 | reg_8(inst.code.extra)=inst_op1_b; 51 | break; 52 | case S_REGw: 53 | reg_16(inst.code.extra)=inst_op1_w; 54 | break; 55 | case S_REGd: 56 | reg_32(inst.code.extra)=inst_op1_d; 57 | break; 58 | case S_SEGm: 59 | if (CPU_SetSegGeneral((SegNames)inst.rm_index,inst_op1_w)) RunException(); 60 | break; 61 | case S_SEGGw: 62 | if (CPU_SetSegGeneral((SegNames)inst.code.extra,inst_op2_w)) RunException(); 63 | reg_16(inst.rm_index)=inst_op1_w; 64 | break; 65 | case S_SEGGd: 66 | if (CPU_SetSegGeneral((SegNames)inst.code.extra,inst_op2_w)) RunException(); 67 | reg_32(inst.rm_index)=inst_op1_d; 68 | break; 69 | case S_PUSHw: 70 | Push_16(inst_op1_w); 71 | break; 72 | case S_PUSHd: 73 | Push_32(inst_op1_d); 74 | break; 75 | 76 | case S_C_AIPw: 77 | if (!inst.cond) goto nextopcode; 78 | case S_AIPw: 79 | SaveIP(); 80 | reg_eip+=inst_op1_d; 81 | reg_eip&=0xffff; 82 | continue; 83 | case S_C_AIPd: 84 | if (!inst.cond) goto nextopcode; 85 | case S_AIPd: 86 | SaveIP(); 87 | reg_eip+=inst_op1_d; 88 | continue; 89 | case S_IPIw: 90 | reg_esp+=Fetchw(); 91 | case S_IP: 92 | SaveIP(); 93 | reg_eip=inst_op1_d; 94 | continue; 95 | case 0: 96 | break; 97 | default: 98 | LOG(LOG_CPU,LOG_ERROR)("SAVE:Unhandled code %d entry %X",inst.code.save,inst.entry); 99 | } 100 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/core_normal/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | noinst_HEADERS = helpers.h prefix_none.h prefix_66.h prefix_0f.h support.h table_ea.h \ 3 | prefix_66_0f.h string.h 4 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/core_normal/support.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | #define LoadMbs(off) (Bit8s)(LoadMb(off)) 21 | #define LoadMws(off) (Bit16s)(LoadMw(off)) 22 | #define LoadMds(off) (Bit32s)(LoadMd(off)) 23 | 24 | #define LoadRb(reg) reg 25 | #define LoadRw(reg) reg 26 | #define LoadRd(reg) reg 27 | 28 | #define SaveRb(reg,val) reg=val 29 | #define SaveRw(reg,val) reg=val 30 | #define SaveRd(reg,val) reg=val 31 | 32 | static INLINE Bit8s Fetchbs() { 33 | return Fetchb(); 34 | } 35 | static INLINE Bit16s Fetchws() { 36 | return Fetchw(); 37 | } 38 | 39 | static INLINE Bit32s Fetchds() { 40 | return Fetchd(); 41 | } 42 | 43 | 44 | #define RUNEXCEPTION() { \ 45 | CPU_Exception(cpu.exception.which,cpu.exception.error); \ 46 | continue; \ 47 | } 48 | 49 | #define EXCEPTION(blah) \ 50 | { \ 51 | CPU_Exception(blah); \ 52 | continue; \ 53 | } 54 | 55 | //TODO Could probably make all byte operands fast? 56 | #define JumpCond16_b(COND) { \ 57 | SAVEIP; \ 58 | if (COND) reg_ip+=Fetchbs(); \ 59 | reg_ip+=1; \ 60 | continue; \ 61 | } 62 | 63 | #define JumpCond16_w(COND) { \ 64 | SAVEIP; \ 65 | if (COND) reg_ip+=Fetchws(); \ 66 | reg_ip+=2; \ 67 | continue; \ 68 | } 69 | 70 | #define JumpCond32_b(COND) { \ 71 | SAVEIP; \ 72 | if (COND) reg_eip+=Fetchbs(); \ 73 | reg_eip+=1; \ 74 | continue; \ 75 | } 76 | 77 | #define JumpCond32_d(COND) { \ 78 | SAVEIP; \ 79 | if (COND) reg_eip+=Fetchds(); \ 80 | reg_eip+=4; \ 81 | continue; \ 82 | } 83 | 84 | 85 | #define SETcc(cc) \ 86 | { \ 87 | GetRM; \ 88 | if (rm >= 0xc0 ) {GetEArb;*earb=(cc) ? 1 : 0;} \ 89 | else {GetEAa;SaveMb(eaa,(cc) ? 1 : 0);} \ 90 | } 91 | 92 | #include "helpers.h" 93 | #include "table_ea.h" 94 | #include "../modrm.h" 95 | 96 | 97 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/lazyflags.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #if !defined __LAZYFLAGS_H 20 | #define __LAZYFLAGS_H 21 | 22 | //Flag Handling 23 | Bit32u get_CF(void); 24 | Bit32u get_AF(void); 25 | Bit32u get_ZF(void); 26 | Bit32u get_SF(void); 27 | Bit32u get_OF(void); 28 | Bit32u get_PF(void); 29 | 30 | Bitu FillFlags(void); 31 | void FillFlagsNoCFOF(void); 32 | void DestroyConditionFlags(void); 33 | 34 | #include "regs.h" 35 | 36 | struct LazyFlags { 37 | GenReg32 var1,var2,res; 38 | Bitu type; 39 | Bitu prev_type; 40 | Bitu oldcf; 41 | }; 42 | 43 | extern LazyFlags lfags; 44 | 45 | #define lf_var1b lflags.var1.byte[BL_INDEX] 46 | #define lf_var2b lflags.var2.byte[BL_INDEX] 47 | #define lf_resb lflags.res.byte[BL_INDEX] 48 | 49 | #define lf_var1w lflags.var1.word[W_INDEX] 50 | #define lf_var2w lflags.var2.word[W_INDEX] 51 | #define lf_resw lflags.res.word[W_INDEX] 52 | 53 | #define lf_var1d lflags.var1.dword[DW_INDEX] 54 | #define lf_var2d lflags.var2.dword[DW_INDEX] 55 | #define lf_resd lflags.res.dword[DW_INDEX] 56 | 57 | 58 | extern LazyFlags lflags; 59 | 60 | #define SETFLAGSb(FLAGB) \ 61 | { \ 62 | SETFLAGBIT(OF,get_OF()); \ 63 | lflags.type=t_UNKNOWN; \ 64 | CPU_SetFlags(FLAGB,FMASK_NORMAL & 0xff); \ 65 | } 66 | 67 | #define SETFLAGSw(FLAGW) \ 68 | { \ 69 | lflags.type=t_UNKNOWN; \ 70 | CPU_SetFlagsw(FLAGW); \ 71 | } 72 | 73 | #define SETFLAGSd(FLAGD) \ 74 | { \ 75 | lflags.type=t_UNKNOWN; \ 76 | CPU_SetFlagsd(FLAGD); \ 77 | } 78 | 79 | #define LoadCF SETFLAGBIT(CF,get_CF()); 80 | #define LoadZF SETFLAGBIT(ZF,get_ZF()); 81 | #define LoadSF SETFLAGBIT(SF,get_SF()); 82 | #define LoadOF SETFLAGBIT(OF,get_OF()); 83 | #define LoadAF SETFLAGBIT(AF,get_AF()); 84 | 85 | #define TFLG_O (get_OF()) 86 | #define TFLG_NO (!get_OF()) 87 | #define TFLG_B (get_CF()) 88 | #define TFLG_NB (!get_CF()) 89 | #define TFLG_Z (get_ZF()) 90 | #define TFLG_NZ (!get_ZF()) 91 | #define TFLG_BE (get_CF() || get_ZF()) 92 | #define TFLG_NBE (!get_CF() && !get_ZF()) 93 | #define TFLG_S (get_SF()) 94 | #define TFLG_NS (!get_SF()) 95 | #define TFLG_P (get_PF()) 96 | #define TFLG_NP (!get_PF()) 97 | #define TFLG_L ((get_SF()!=0) != (get_OF()!=0)) 98 | #define TFLG_NL ((get_SF()!=0) == (get_OF()!=0)) 99 | #define TFLG_LE (get_ZF() || ((get_SF()!=0) != (get_OF()!=0))) 100 | #define TFLG_NLE (!get_ZF() && ((get_SF()!=0) == (get_OF()!=0))) 101 | 102 | //Types of Flag changing instructions 103 | enum { 104 | t_UNKNOWN=0, 105 | t_ADDb,t_ADDw,t_ADDd, 106 | t_ORb,t_ORw,t_ORd, 107 | t_ADCb,t_ADCw,t_ADCd, 108 | t_SBBb,t_SBBw,t_SBBd, 109 | t_ANDb,t_ANDw,t_ANDd, 110 | t_SUBb,t_SUBw,t_SUBd, 111 | t_XORb,t_XORw,t_XORd, 112 | t_CMPb,t_CMPw,t_CMPd, 113 | t_INCb,t_INCw,t_INCd, 114 | t_DECb,t_DECw,t_DECd, 115 | t_TESTb,t_TESTw,t_TESTd, 116 | t_SHLb,t_SHLw,t_SHLd, 117 | t_SHRb,t_SHRw,t_SHRd, 118 | t_SARb,t_SARw,t_SARd, 119 | t_ROLb,t_ROLw,t_ROLd, 120 | t_RORb,t_RORw,t_RORd, 121 | t_RCLb,t_RCLw,t_RCLd, 122 | t_RCRb,t_RCRw,t_RCRd, 123 | t_NEGb,t_NEGw,t_NEGd, 124 | 125 | t_DSHLw,t_DSHLd, 126 | t_DSHRw,t_DSHRd, 127 | t_MUL,t_DIV, 128 | t_NOTDONE, 129 | t_LASTFLAG 130 | }; 131 | 132 | #endif 133 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/cpu/modrm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | extern Bit8u * lookupRMregb[]; 20 | extern Bit16u * lookupRMregw[]; 21 | extern Bit32u * lookupRMregd[]; 22 | extern Bit8u * lookupRMEAregb[256]; 23 | extern Bit16u * lookupRMEAregw[256]; 24 | extern Bit32u * lookupRMEAregd[256]; 25 | 26 | #define GetRM \ 27 | Bit8u rm=Fetchb(); 28 | 29 | #define Getrb \ 30 | Bit8u * rmrb; \ 31 | rmrb=lookupRMregb[rm]; 32 | 33 | #define Getrw \ 34 | Bit16u * rmrw; \ 35 | rmrw=lookupRMregw[rm]; 36 | 37 | #define Getrd \ 38 | Bit32u * rmrd; \ 39 | rmrd=lookupRMregd[rm]; 40 | 41 | 42 | #define GetRMrb \ 43 | GetRM; \ 44 | Getrb; 45 | 46 | #define GetRMrw \ 47 | GetRM; \ 48 | Getrw; 49 | 50 | #define GetRMrd \ 51 | GetRM; \ 52 | Getrd; 53 | 54 | 55 | #define GetEArb \ 56 | Bit8u * earb=lookupRMEAregb[rm]; 57 | 58 | #define GetEArw \ 59 | Bit16u * earw=lookupRMEAregw[rm]; 60 | 61 | #define GetEArd \ 62 | Bit32u * eard=lookupRMEAregd[rm]; 63 | 64 | 65 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/debug/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | noinst_LIBRARIES = libdebug.a 4 | libdebug_a_SOURCES = debug.cpp debug_gui.cpp debug_disasm.cpp debug_inc.h disasm_tables.h debug_win32.cpp -------------------------------------------------------------------------------- /dosbox-0.74-3/src/debug/debug_inc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* Local Debug Function */ 20 | 21 | /* $Id: debug_inc.h,v 1.12 2009-05-27 09:15:41 qbix79 Exp $ */ 22 | 23 | #include 24 | #include "mem.h" 25 | 26 | #define PAIR_BLACK_BLUE 1 27 | #define PAIR_BYELLOW_BLACK 2 28 | #define PAIR_GREEN_BLACK 3 29 | #define PAIR_BLACK_GREY 4 30 | #define PAIR_GREY_RED 5 31 | 32 | 33 | void DBGUI_StartUp(void); 34 | 35 | struct DBGBlock { 36 | WINDOW * win_main; /* The Main Window */ 37 | WINDOW * win_reg; /* Register Window */ 38 | WINDOW * win_data; /* Data Output window */ 39 | WINDOW * win_code; /* Disassembly/Debug point Window */ 40 | WINDOW * win_var; /* Variable Window */ 41 | WINDOW * win_out; /* Text Output Window */ 42 | Bit32u active_win; /* Current active window */ 43 | Bit32u input_y; 44 | Bit32u global_mask; /* Current msgmask */ 45 | }; 46 | 47 | 48 | struct DASMLine { 49 | Bit32u pc; 50 | char dasm[80]; 51 | PhysPt ea; 52 | Bit16u easeg; 53 | Bit32u eaoff; 54 | }; 55 | 56 | extern DBGBlock dbg; 57 | 58 | /* Local Debug Stuff */ 59 | Bitu DasmI386(char* buffer, PhysPt pc, Bitu cur_ip, bool bit32); 60 | int DasmLastOperandSize(void); 61 | 62 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/debug/debug_win32.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifdef WIN32 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #ifndef min 26 | #define min(a,b) ((a)<(b)?(a):(b)) 27 | #endif 28 | 29 | /* 30 | Have to remember where i ripped this code sometime ago. 31 | 32 | */ 33 | static void ResizeConsole( HANDLE hConsole, SHORT xSize, SHORT ySize ) { 34 | CONSOLE_SCREEN_BUFFER_INFO csbi; // Hold Current Console Buffer Info 35 | BOOL bSuccess; 36 | SMALL_RECT srWindowRect; // Hold the New Console Size 37 | COORD coordScreen; 38 | 39 | bSuccess = GetConsoleScreenBufferInfo( hConsole, &csbi ); 40 | 41 | // Get the Largest Size we can size the Console Window to 42 | coordScreen = GetLargestConsoleWindowSize( hConsole ); 43 | 44 | // Define the New Console Window Size and Scroll Position 45 | srWindowRect.Right = (SHORT)(min(xSize, coordScreen.X) - 1); 46 | srWindowRect.Bottom = (SHORT)(min(ySize, coordScreen.Y) - 1); 47 | srWindowRect.Left = srWindowRect.Top = (SHORT)0; 48 | 49 | // Define the New Console Buffer Size 50 | coordScreen.X = xSize; 51 | coordScreen.Y = ySize; 52 | 53 | // If the Current Buffer is Larger than what we want, Resize the 54 | // Console Window First, then the Buffer 55 | if( (DWORD)csbi.dwSize.X * csbi.dwSize.Y > (DWORD) xSize * ySize) 56 | { 57 | bSuccess = SetConsoleWindowInfo( hConsole, TRUE, &srWindowRect ); 58 | bSuccess = SetConsoleScreenBufferSize( hConsole, coordScreen ); 59 | } 60 | 61 | // If the Current Buffer is Smaller than what we want, Resize the 62 | // Buffer First, then the Console Window 63 | if( (DWORD)csbi.dwSize.X * csbi.dwSize.Y < (DWORD) xSize * ySize ) 64 | { 65 | bSuccess = SetConsoleScreenBufferSize( hConsole, coordScreen ); 66 | bSuccess = SetConsoleWindowInfo( hConsole, TRUE, &srWindowRect ); 67 | } 68 | 69 | // If the Current Buffer *is* the Size we want, Don't do anything! 70 | return; 71 | } 72 | 73 | 74 | void WIN32_Console() { 75 | AllocConsole(); 76 | SetConsoleTitle("DOSBox Debugger"); 77 | ResizeConsole(GetStdHandle(STD_OUTPUT_HANDLE),80,50); 78 | } 79 | #endif 80 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/dos/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | noinst_LIBRARIES = libdos.a 4 | EXTRA_DIST = scsidefs.h wnaspi32.h dos_codepages.h dos_keyboard_layout_data.h 5 | libdos_a_SOURCES = dos.cpp dos_devices.cpp dos_execute.cpp dos_files.cpp dos_ioctl.cpp dos_memory.cpp \ 6 | dos_misc.cpp dos_classes.cpp dos_programs.cpp dos_tables.cpp \ 7 | drives.cpp drives.h drive_virtual.cpp drive_local.cpp drive_cache.cpp drive_fat.cpp \ 8 | drive_iso.cpp dev_con.h dos_mscdex.cpp dos_keyboard_layout.cpp \ 9 | cdrom.h cdrom.cpp cdrom_ioctl_win32.cpp cdrom_aspi_win32.cpp cdrom_ioctl_linux.cpp cdrom_image.cpp \ 10 | cdrom_ioctl_os2.cpp 11 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/dos/cdrom_ioctl_linux.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | #include 21 | #include "cdrom.h" 22 | #include "support.h" 23 | 24 | #if defined (LINUX) 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | CDROM_Interface_Ioctl::CDROM_Interface_Ioctl(void) : CDROM_Interface_SDL() 33 | { 34 | strcpy(device_name, ""); 35 | } 36 | 37 | bool CDROM_Interface_Ioctl::GetUPC(unsigned char& attr, char* upc) 38 | { 39 | int cdrom_fd = open(device_name, O_RDONLY | O_NONBLOCK); 40 | if (cdrom_fd == -1) return false; 41 | 42 | struct cdrom_mcn cdrom_mcn; 43 | int ret = ioctl(cdrom_fd, CDROM_GET_MCN, &cdrom_mcn); 44 | 45 | close(cdrom_fd); 46 | 47 | if (ret > 0) { 48 | attr = 0; 49 | safe_strncpy(upc, (char*)cdrom_mcn.medium_catalog_number, 14); 50 | } 51 | 52 | return (ret > 0); 53 | } 54 | 55 | bool CDROM_Interface_Ioctl::ReadSectors(PhysPt buffer, bool raw, unsigned long sector, unsigned long num) 56 | { 57 | int cdrom_fd = open(device_name, O_RDONLY | O_NONBLOCK); 58 | if (cdrom_fd == -1) return false; 59 | 60 | Bits buflen = raw ? num * CD_FRAMESIZE_RAW : num * CD_FRAMESIZE; 61 | Bit8u* buf = new Bit8u[buflen]; 62 | int ret; 63 | 64 | if (raw) { 65 | struct cdrom_read cdrom_read; 66 | cdrom_read.cdread_lba = sector; 67 | cdrom_read.cdread_bufaddr = (char*)buf; 68 | cdrom_read.cdread_buflen = buflen; 69 | 70 | ret = ioctl(cdrom_fd, CDROMREADRAW, &cdrom_read); 71 | } else { 72 | ret = lseek(cdrom_fd, sector * CD_FRAMESIZE, SEEK_SET); 73 | if (ret >= 0) ret = read(cdrom_fd, buf, buflen); 74 | if (ret != buflen) ret = -1; 75 | } 76 | close(cdrom_fd); 77 | 78 | MEM_BlockWrite(buffer, buf, buflen); 79 | delete[] buf; 80 | 81 | return (ret > 0); 82 | } 83 | 84 | bool CDROM_Interface_Ioctl::SetDevice(char* path, int forceCD) 85 | { 86 | bool success = CDROM_Interface_SDL::SetDevice(path, forceCD); 87 | 88 | if (success) { 89 | const char* tmp = SDL_CDName(forceCD); 90 | if (tmp) safe_strncpy(device_name, tmp, 512); 91 | else success = false; 92 | } 93 | 94 | return success; 95 | } 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/dosbox.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jrdennisoss/dosboxrm/ecde5ad459e2773b50a780fa0a667b250f4c89db/dosbox-0.74-3/src/dosbox.ico -------------------------------------------------------------------------------- /dosbox-0.74-3/src/fpu/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | noinst_LIBRARIES = libfpu.a 4 | libfpu_a_SOURCES = fpu.cpp fpu_instructions.h \ 5 | fpu_instructions_x86.h 6 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/gui/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | noinst_LIBRARIES = libgui.a 4 | libgui_a_SOURCES = sdlmain.cpp sdl_mapper.cpp dosbox_logo.h \ 5 | render.cpp render_scalers.cpp render_scalers.h \ 6 | render_templates.h render_loops.h render_simple.h \ 7 | render_templates_sai.h render_templates_hq.h \ 8 | render_templates_hq2x.h render_templates_hq3x.h \ 9 | midi.cpp midi_win32.h midi_oss.h midi_coreaudio.h midi_alsa.h \ 10 | midi_coremidi.h sdl_gui.cpp dosbox_splash.h 11 | 12 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/gui/midi_coremidi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This program is free software; you can redistribute it and/or modify 3 | * it under the terms of the GNU General Public License as published by 4 | * the Free Software Foundation; either version 2 of the License, or 5 | * (at your option) any later version. 6 | * 7 | * This program is distributed in the hope that it will be useful, 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | * GNU General Public License for more details. 11 | * 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program; if not, write to the Free Software 14 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 15 | */ 16 | 17 | #include 18 | 19 | class MidiHandler_coremidi : public MidiHandler { 20 | private: 21 | MIDIPortRef m_port; 22 | MIDIClientRef m_client; 23 | MIDIEndpointRef m_endpoint; 24 | MIDIPacket* m_pCurPacket; 25 | public: 26 | MidiHandler_coremidi() {m_pCurPacket = 0;} 27 | const char * GetName(void) { return "coremidi"; } 28 | bool Open(const char * conf) { 29 | 30 | // Get the MIDIEndPoint 31 | m_endpoint = 0; 32 | OSStatus result; 33 | Bitu numDests = MIDIGetNumberOfDestinations(); 34 | Bitu destId = 0; 35 | if(conf && conf[0]) destId = atoi(conf); 36 | if (destId < numDests) 37 | { 38 | m_endpoint = MIDIGetDestination(destId); 39 | } 40 | 41 | // Create a MIDI client and port 42 | MIDIClientCreate(CFSTR("MyClient"), 0, 0, &m_client); 43 | 44 | if (!m_client) 45 | { 46 | LOG_MSG("MIDI:coremidi: No client created."); 47 | return false; 48 | } 49 | 50 | MIDIOutputPortCreate(m_client, CFSTR("MyOutPort"), &m_port); 51 | 52 | if (!m_port) 53 | { 54 | LOG_MSG("MIDI:coremidi: No port created."); 55 | return false; 56 | } 57 | 58 | 59 | return true; 60 | } 61 | 62 | void Close(void) { 63 | // Dispose the port 64 | MIDIPortDispose(m_port); 65 | 66 | // Dispose the client 67 | MIDIClientDispose(m_client); 68 | 69 | // Dispose the endpoint 70 | MIDIEndpointDispose(m_endpoint); 71 | } 72 | 73 | void PlayMsg(Bit8u * msg) { 74 | // Acquire a MIDIPacketList 75 | Byte packetBuf[128]; 76 | MIDIPacketList *packetList = (MIDIPacketList *)packetBuf; 77 | m_pCurPacket = MIDIPacketListInit(packetList); 78 | 79 | // Determine the length of msg 80 | Bitu len=MIDI_evt_len[*msg]; 81 | 82 | // Add msg to the MIDIPacketList 83 | MIDIPacketListAdd(packetList, (ByteCount)sizeof(packetBuf), m_pCurPacket, (MIDITimeStamp)0, len, msg); 84 | 85 | // Send the MIDIPacketList 86 | MIDISend(m_port,m_endpoint,packetList); 87 | } 88 | 89 | void PlaySysex(Bit8u * sysex, Bitu len) { 90 | // Acquire a MIDIPacketList 91 | Byte packetBuf[SYSEX_SIZE*4]; 92 | Bitu pos=0; 93 | MIDIPacketList *packetList = (MIDIPacketList *)packetBuf; 94 | m_pCurPacket = MIDIPacketListInit(packetList); 95 | 96 | // Add msg to the MIDIPacketList 97 | MIDIPacketListAdd(packetList, (ByteCount)sizeof(packetBuf), m_pCurPacket, (MIDITimeStamp)0, len, sysex); 98 | 99 | // Send the MIDIPacketList 100 | MIDISend(m_port,m_endpoint,packetList); 101 | } 102 | }; 103 | 104 | MidiHandler_coremidi Midi_coremidi; 105 | 106 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/gui/midi_oss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #include 20 | #define SEQ_MIDIPUTC 5 21 | 22 | class MidiHandler_oss: public MidiHandler { 23 | private: 24 | int device; 25 | Bit8u device_num; 26 | bool isOpen; 27 | public: 28 | MidiHandler_oss() : MidiHandler(),isOpen(false) {}; 29 | const char * GetName(void) { return "oss";}; 30 | bool Open(const char * conf) { 31 | char devname[512]; 32 | if (conf && conf[0]) safe_strncpy(devname,conf,512); 33 | else strcpy(devname,"/dev/sequencer"); 34 | char * devfind=(strrchr(devname,',')); 35 | if (devfind) { 36 | *devfind++=0; 37 | device_num=atoi(devfind); 38 | } else device_num=0; 39 | if (isOpen) return false; 40 | device=open(devname, O_WRONLY, 0); 41 | if (device<0) return false; 42 | return true; 43 | }; 44 | void Close(void) { 45 | if (!isOpen) return; 46 | if (device>0) close(device); 47 | }; 48 | void PlayMsg(Bit8u * msg) { 49 | Bit8u buf[128];Bitu pos=0; 50 | Bitu len=MIDI_evt_len[*msg]; 51 | for (;len>0;len--) { 52 | buf[pos++] = SEQ_MIDIPUTC; 53 | buf[pos++] = *msg; 54 | buf[pos++] = device_num; 55 | buf[pos++] = 0; 56 | msg++; 57 | } 58 | write(device,buf,pos); 59 | }; 60 | void PlaySysex(Bit8u * sysex,Bitu len) { 61 | Bit8u buf[SYSEX_SIZE*4];Bitu pos=0; 62 | for (;len>0;len--) { 63 | buf[pos++] = SEQ_MIDIPUTC; 64 | buf[pos++] = *sysex++; 65 | buf[pos++] = device_num; 66 | buf[pos++] = 0; 67 | } 68 | write(device,buf,pos); 69 | } 70 | }; 71 | 72 | MidiHandler_oss Midi_oss; 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/gui/midi_win32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: midi_win32.h,v 1.16 2009-05-27 09:15:41 qbix79 Exp $ */ 20 | 21 | #ifndef WIN32_LEAN_AND_MEAN 22 | #define WIN32_LEAN_AND_MEAN 23 | #endif 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | class MidiHandler_win32: public MidiHandler { 30 | private: 31 | HMIDIOUT m_out; 32 | MIDIHDR m_hdr; 33 | HANDLE m_event; 34 | bool isOpen; 35 | public: 36 | MidiHandler_win32() : MidiHandler(),isOpen(false) {}; 37 | const char * GetName(void) { return "win32";}; 38 | bool Open(const char * conf) { 39 | if (isOpen) return false; 40 | m_event = CreateEvent (NULL, true, true, NULL); 41 | MMRESULT res = MMSYSERR_NOERROR; 42 | if(conf && *conf) { 43 | std::string strconf(conf); 44 | std::istringstream configmidi(strconf); 45 | unsigned int nummer = midiOutGetNumDevs(); 46 | configmidi >> nummer; 47 | if(nummer < midiOutGetNumDevs()){ 48 | MIDIOUTCAPS mididev; 49 | midiOutGetDevCaps(nummer, &mididev, sizeof(MIDIOUTCAPS)); 50 | LOG_MSG("MIDI:win32 selected %s",mididev.szPname); 51 | res = midiOutOpen(&m_out, nummer, (DWORD)m_event, 0, CALLBACK_EVENT); 52 | } 53 | } else { 54 | res = midiOutOpen(&m_out, MIDI_MAPPER, (DWORD)m_event, 0, CALLBACK_EVENT); 55 | } 56 | if (res != MMSYSERR_NOERROR) return false; 57 | isOpen=true; 58 | return true; 59 | }; 60 | 61 | void Close(void) { 62 | if (!isOpen) return; 63 | isOpen=false; 64 | midiOutClose(m_out); 65 | CloseHandle (m_event); 66 | }; 67 | void PlayMsg(Bit8u * msg) { 68 | midiOutShortMsg(m_out, *(Bit32u*)msg); 69 | }; 70 | void PlaySysex(Bit8u * sysex,Bitu len) { 71 | if (WaitForSingleObject (m_event, 2000) == WAIT_TIMEOUT) { 72 | LOG(LOG_MISC,LOG_ERROR)("Can't send midi message"); 73 | return; 74 | } 75 | midiOutUnprepareHeader (m_out, &m_hdr, sizeof (m_hdr)); 76 | 77 | m_hdr.lpData = (char *) sysex; 78 | m_hdr.dwBufferLength = len ; 79 | m_hdr.dwBytesRecorded = len ; 80 | m_hdr.dwUser = 0; 81 | 82 | MMRESULT result = midiOutPrepareHeader (m_out, &m_hdr, sizeof (m_hdr)); 83 | if (result != MMSYSERR_NOERROR) return; 84 | ResetEvent (m_event); 85 | result = midiOutLongMsg (m_out,&m_hdr,sizeof(m_hdr)); 86 | if (result != MMSYSERR_NOERROR) { 87 | SetEvent (m_event); 88 | return; 89 | } 90 | } 91 | }; 92 | 93 | MidiHandler_win32 Midi_win32; 94 | 95 | 96 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/gui/render_scalers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef _RENDER_SCALERS_H 20 | #define _RENDER_SCALERS_H 21 | 22 | //#include "render.h" 23 | #include "video.h" 24 | #if RENDER_USE_ADVANCED_SCALERS>0 25 | #define SCALER_MAXWIDTH 1280 26 | #define SCALER_MAXHEIGHT 1024 27 | #else 28 | // reduced to save some memory 29 | #define SCALER_MAXWIDTH 800 30 | #define SCALER_MAXHEIGHT 600 31 | #endif 32 | 33 | #if RENDER_USE_ADVANCED_SCALERS>1 34 | #define SCALER_COMPLEXWIDTH 800 35 | #define SCALER_COMPLEXHEIGHT 600 36 | #endif 37 | 38 | #define SCALER_BLOCKSIZE 16 39 | 40 | typedef enum { 41 | scalerMode8, scalerMode15, scalerMode16, scalerMode32 42 | } scalerMode_t; 43 | 44 | typedef enum scalerOperation { 45 | scalerOpNormal, 46 | #if RENDER_USE_ADVANCED_SCALERS>2 47 | scalerOpAdvMame, 48 | scalerOpAdvInterp, 49 | scalerOpHQ, 50 | scalerOpSaI, 51 | scalerOpSuperSaI, 52 | scalerOpSuperEagle, 53 | #endif 54 | #if RENDER_USE_ADVANCED_SCALERS>0 55 | scalerOpTV, 56 | scalerOpRGB, 57 | scalerOpScan, 58 | #endif 59 | scalerLast 60 | } scalerOperation_t; 61 | 62 | typedef void (*ScalerLineHandler_t)(const void *src); 63 | typedef void (*ScalerComplexHandler_t)(void); 64 | 65 | extern Bit8u Scaler_Aspect[]; 66 | extern Bit8u diff_table[]; 67 | extern Bitu Scaler_ChangedLineIndex; 68 | extern Bit16u Scaler_ChangedLines[]; 69 | #if RENDER_USE_ADVANCED_SCALERS>1 70 | /* Not entirely happy about those +2's since they make a non power of 2, with muls instead of shift */ 71 | typedef Bit8u scalerChangeCache_t [SCALER_COMPLEXHEIGHT][SCALER_COMPLEXWIDTH / SCALER_BLOCKSIZE] ; 72 | typedef union { 73 | Bit32u b32 [SCALER_COMPLEXHEIGHT] [SCALER_COMPLEXWIDTH]; 74 | Bit16u b16 [SCALER_COMPLEXHEIGHT] [SCALER_COMPLEXWIDTH]; 75 | Bit8u b8 [SCALER_COMPLEXHEIGHT] [SCALER_COMPLEXWIDTH]; 76 | } scalerFrameCache_t; 77 | #endif 78 | typedef union { 79 | Bit32u b32 [SCALER_MAXHEIGHT] [SCALER_MAXWIDTH]; 80 | Bit16u b16 [SCALER_MAXHEIGHT] [SCALER_MAXWIDTH]; 81 | Bit8u b8 [SCALER_MAXHEIGHT] [SCALER_MAXWIDTH]; 82 | } scalerSourceCache_t; 83 | extern scalerSourceCache_t scalerSourceCache; 84 | #if RENDER_USE_ADVANCED_SCALERS>1 85 | extern scalerChangeCache_t scalerChangeCache; 86 | #endif 87 | typedef ScalerLineHandler_t ScalerLineBlock_t[5][4]; 88 | 89 | typedef struct { 90 | const char *name; 91 | Bitu gfxFlags; 92 | Bitu xscale,yscale; 93 | ScalerComplexHandler_t Linear[4]; 94 | ScalerComplexHandler_t Random[4]; 95 | } ScalerComplexBlock_t; 96 | 97 | typedef struct { 98 | const char *name; 99 | Bitu gfxFlags; 100 | Bitu xscale,yscale; 101 | ScalerLineBlock_t Linear; 102 | ScalerLineBlock_t Random; 103 | } ScalerSimpleBlock_t; 104 | 105 | 106 | #define SCALE_LEFT 0x1 107 | #define SCALE_RIGHT 0x2 108 | #define SCALE_FULL 0x4 109 | 110 | /* Simple scalers */ 111 | extern ScalerSimpleBlock_t ScaleNormal1x; 112 | extern ScalerSimpleBlock_t ScaleNormalDw; 113 | extern ScalerSimpleBlock_t ScaleNormalDh; 114 | extern ScalerSimpleBlock_t ScaleNormal2x; 115 | extern ScalerSimpleBlock_t ScaleNormal3x; 116 | #if RENDER_USE_ADVANCED_SCALERS>0 117 | extern ScalerSimpleBlock_t ScaleTV2x; 118 | extern ScalerSimpleBlock_t ScaleTV3x; 119 | extern ScalerSimpleBlock_t ScaleRGB2x; 120 | extern ScalerSimpleBlock_t ScaleRGB3x; 121 | extern ScalerSimpleBlock_t ScaleScan2x; 122 | extern ScalerSimpleBlock_t ScaleScan3x; 123 | #endif 124 | /* Complex scalers */ 125 | #if RENDER_USE_ADVANCED_SCALERS>2 126 | extern ScalerComplexBlock_t ScaleHQ2x; 127 | extern ScalerComplexBlock_t ScaleHQ3x; 128 | extern ScalerComplexBlock_t Scale2xSaI; 129 | extern ScalerComplexBlock_t ScaleSuper2xSaI; 130 | extern ScalerComplexBlock_t ScaleSuperEagle; 131 | extern ScalerComplexBlock_t ScaleAdvMame2x; 132 | extern ScalerComplexBlock_t ScaleAdvMame3x; 133 | extern ScalerComplexBlock_t ScaleAdvInterp2x; 134 | extern ScalerComplexBlock_t ScaleAdvInterp3x; 135 | #endif 136 | #if RENDER_USE_ADVANCED_SCALERS>1 137 | extern ScalerLineBlock_t ScalerCache; 138 | #endif 139 | #endif 140 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/gui/render_simple.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: render_simple.h,v 1.7 2009-05-27 09:15:41 qbix79 Exp $ */ 20 | 21 | #if defined (SCALERLINEAR) 22 | static void conc4d(SCALERNAME,SBPP,DBPP,L)(const void *s) { 23 | #else 24 | static void conc4d(SCALERNAME,SBPP,DBPP,R)(const void *s) { 25 | #endif 26 | #ifdef RENDER_NULL_INPUT 27 | if (!s) { 28 | render.scale.cacheRead += render.scale.cachePitch; 29 | #if defined(SCALERLINEAR) 30 | Bitu skipLines = SCALERHEIGHT; 31 | #else 32 | Bitu skipLines = Scaler_Aspect[ render.scale.outLine++ ]; 33 | #endif 34 | ScalerAddLines( 0, skipLines ); 35 | return; 36 | } 37 | #endif 38 | /* Clear the complete line marker */ 39 | Bitu hadChange = 0; 40 | const SRCTYPE *src = (SRCTYPE*)s; 41 | SRCTYPE *cache = (SRCTYPE*)(render.scale.cacheRead); 42 | render.scale.cacheRead += render.scale.cachePitch; 43 | PTYPE * line0=(PTYPE *)(render.scale.outWrite); 44 | #if (SBPP == 9) 45 | for (Bits x=render.src.width;x>0;) { 46 | if (*(Bit32u const*)src == *(Bit32u*)cache && !( 47 | render.pal.modified[src[0]] | 48 | render.pal.modified[src[1]] | 49 | render.pal.modified[src[2]] | 50 | render.pal.modified[src[3]] )) { 51 | x-=4; 52 | src+=4; 53 | cache+=4; 54 | line0+=4*SCALERWIDTH; 55 | #else 56 | for (Bits x=render.src.width;x>0;) { 57 | if (*(Bitu const*)src == *(Bitu*)cache) { 58 | x-=(sizeof(Bitu)/sizeof(SRCTYPE)); 59 | src+=(sizeof(Bitu)/sizeof(SRCTYPE)); 60 | cache+=(sizeof(Bitu)/sizeof(SRCTYPE)); 61 | line0+=(sizeof(Bitu)/sizeof(SRCTYPE))*SCALERWIDTH; 62 | #endif 63 | } else { 64 | #if defined(SCALERLINEAR) 65 | #if (SCALERHEIGHT > 1) 66 | PTYPE *line1 = WC[0]; 67 | #endif 68 | #if (SCALERHEIGHT > 2) 69 | PTYPE *line2 = WC[1]; 70 | #endif 71 | #else 72 | #if (SCALERHEIGHT > 1) 73 | PTYPE *line1 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch); 74 | #endif 75 | #if (SCALERHEIGHT > 2) 76 | PTYPE *line2 = (PTYPE *)(((Bit8u*)line0)+ render.scale.outPitch * 2); 77 | #endif 78 | #endif //defined(SCALERLINEAR) 79 | hadChange = 1; 80 | for (Bitu i = x > 32 ? 32 : x;i>0;i--,x--) { 81 | const SRCTYPE S = *src; 82 | *cache = S; 83 | src++;cache++; 84 | const PTYPE P = PMAKE(S); 85 | SCALERFUNC; 86 | line0 += SCALERWIDTH; 87 | #if (SCALERHEIGHT > 1) 88 | line1 += SCALERWIDTH; 89 | #endif 90 | #if (SCALERHEIGHT > 2) 91 | line2 += SCALERWIDTH; 92 | #endif 93 | } 94 | #if defined(SCALERLINEAR) 95 | #if (SCALERHEIGHT > 1) 96 | Bitu copyLen = (Bitu)((Bit8u*)line1 - (Bit8u*)WC[0]); 97 | BituMove(((Bit8u*)line0)-copyLen+render.scale.outPitch ,WC[0], copyLen ); 98 | #endif 99 | #if (SCALERHEIGHT > 2) 100 | BituMove(((Bit8u*)line0)-copyLen+render.scale.outPitch*2,WC[1], copyLen ); 101 | #endif 102 | #endif //defined(SCALERLINEAR) 103 | } 104 | } 105 | #if defined(SCALERLINEAR) 106 | Bitu scaleLines = SCALERHEIGHT; 107 | #else 108 | Bitu scaleLines = Scaler_Aspect[ render.scale.outLine++ ]; 109 | if ( scaleLines - SCALERHEIGHT && hadChange ) { 110 | BituMove( render.scale.outWrite + render.scale.outPitch * SCALERHEIGHT, 111 | render.scale.outWrite + render.scale.outPitch * (SCALERHEIGHT-1), 112 | render.src.width * SCALERWIDTH * PSIZE); 113 | } 114 | #endif 115 | ScalerAddLines( hadChange, scaleLines ); 116 | } 117 | 118 | #if !defined(SCALERLINEAR) 119 | #define SCALERLINEAR 1 120 | #include "render_simple.h" 121 | #undef SCALERLINEAR 122 | #endif 123 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/gui/render_templates_hq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* 20 | * The HQ3x high quality 3x graphics filter. 21 | * Original author Maxim Stepin (see http://www.hiend3d.com/hq3x.html). 22 | * Adapted for DOSBox from ScummVM and HiEnd3D code by Kronuz. 23 | */ 24 | 25 | #include 26 | 27 | #ifndef RENDER_TEMPLATES_HQNX_TABLE_H 28 | #define RENDER_TEMPLATES_HQNX_TABLE_H 29 | 30 | static Bit32u *_RGBtoYUV = 0; 31 | static inline bool diffYUV(Bit32u yuv1, Bit32u yuv2) 32 | { 33 | static const Bit32u Ymask = 0x00FF0000; 34 | static const Bit32u Umask = 0x0000FF00; 35 | static const Bit32u Vmask = 0x000000FF; 36 | static const Bit32u trY = 0x00300000; 37 | static const Bit32u trU = 0x00000700; 38 | static const Bit32u trV = 0x00000006; 39 | 40 | Bit32u diff; 41 | Bit32u mask; 42 | 43 | diff = ((yuv1 & Ymask) - (yuv2 & Ymask)); 44 | mask = ((Bit32s)diff) >> 31; // ~1/-1 if value < 0, 0 otherwise 45 | diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value 46 | if (diff > trY) return true; 47 | 48 | diff = ((yuv1 & Umask) - (yuv2 & Umask)); 49 | mask = ((Bit32s)diff)>> 31; // ~1/-1 if value < 0, 0 otherwise 50 | diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value 51 | if (diff > trU) return true; 52 | 53 | diff = ((yuv1 & Vmask) - (yuv2 & Vmask)); 54 | mask = ((Bit32s)diff) >> 31; // ~1/-1 if value < 0, 0 otherwise 55 | diff = (diff ^ mask) - mask; //-1: ~value + 1; 0: value 56 | if (diff > trV) return true; 57 | 58 | return false; 59 | } 60 | 61 | #endif 62 | 63 | static inline void conc2d(InitLUTs,SBPP)(void) 64 | { 65 | int r, g, b; 66 | int Y, u, v; 67 | 68 | _RGBtoYUV = (Bit32u *)malloc(65536 * sizeof(Bit32u)); 69 | 70 | for (int color = 0; color < 65536; ++color) { 71 | #if SBPP == 32 72 | r = ((color & 0xF800) >> 11) << (8 - 5); 73 | g = ((color & 0x07E0) >> 5) << (8 - 6); 74 | b = ((color & 0x001F) >> 0) << (8 - 5); 75 | #else 76 | r = ((color & redMask) >> redShift) << (8 - redBits); 77 | g = ((color & greenMask) >> greenShift) << (8 - greenBits); 78 | b = ((color & blueMask) >> blueShift) << (8 - blueBits); 79 | #endif 80 | Y = (r + g + b) >> 2; 81 | u = 128 + ((r - b) >> 2); 82 | v = 128 + ((-r + 2 * g - b) >> 3); 83 | _RGBtoYUV[color] = (Y << 16) | (u << 8) | v; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/hardware/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | SUBDIRS = serialport mame 4 | 5 | EXTRA_DIST = opl.cpp opl.h adlib.h dbopl.h 6 | 7 | noinst_LIBRARIES = libhardware.a 8 | 9 | libhardware_a_SOURCES = adlib.cpp dma.cpp gameblaster.cpp hardware.cpp iohandler.cpp joystick.cpp keyboard.cpp \ 10 | memory.cpp mixer.cpp pcspeaker.cpp pic.cpp sblaster.cpp tandy_sound.cpp timer.cpp \ 11 | vga.cpp vga_attr.cpp vga_crtc.cpp vga_dac.cpp vga_draw.cpp vga_gfx.cpp vga_other.cpp \ 12 | vga_memory.cpp vga_misc.cpp vga_seq.cpp vga_xga.cpp vga_s3.cpp vga_tseng.cpp vga_paradise.cpp \ 13 | cmos.cpp disney.cpp gus.cpp mpu401.cpp ipx.cpp ipxserver.cpp dbopl.cpp \ 14 | reelmagic_driver.cpp reelmagic_player.cpp reelmagic_videomixer.cpp 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/hardware/adlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: adlib.h,v 1.5 2009-04-28 21:45:43 c2woody Exp $ */ 20 | 21 | #ifndef DOSBOX_ADLIB_H 22 | #define DOSBOX_ADLIB_H 23 | 24 | #include "dosbox.h" 25 | #include "mixer.h" 26 | #include "inout.h" 27 | #include "setup.h" 28 | #include "pic.h" 29 | #include "hardware.h" 30 | 31 | 32 | namespace Adlib { 33 | 34 | struct Timer { 35 | double start; 36 | double delay; 37 | bool enabled, overflow, masked; 38 | Bit8u counter; 39 | Timer() { 40 | masked = false; 41 | overflow = false; 42 | enabled = false; 43 | counter = 0; 44 | delay = 0; 45 | } 46 | //Call update before making any further changes 47 | void Update( double time ) { 48 | if ( !enabled || !delay ) 49 | return; 50 | double deltaStart = time - start; 51 | //Only set the overflow flag when not masked 52 | if ( deltaStart >= 0 && !masked ) { 53 | overflow = 1; 54 | } 55 | } 56 | //On a reset make sure the start is in sync with the next cycle 57 | void Reset(const double& time ) { 58 | overflow = false; 59 | if ( !delay || !enabled ) 60 | return; 61 | double delta = (time - start); 62 | double rem = fmod( delta, delay ); 63 | double next = delay - rem; 64 | start = time + next; 65 | } 66 | void Stop( ) { 67 | enabled = false; 68 | } 69 | void Start( const double& time, Bits scale ) { 70 | //Don't enable again 71 | if ( enabled ) { 72 | return; 73 | } 74 | enabled = true; 75 | delay = 0.001 * (256 - counter ) * scale; 76 | start = time + delay; 77 | } 78 | 79 | }; 80 | 81 | struct Chip { 82 | //Last selected register 83 | Timer timer[2]; 84 | //Check for it being a write to the timer 85 | bool Write( Bit32u addr, Bit8u val ); 86 | //Read the current timer state, will use current double 87 | Bit8u Read( ); 88 | }; 89 | 90 | //The type of handler this is 91 | typedef enum { 92 | MODE_OPL2, 93 | MODE_DUALOPL2, 94 | MODE_OPL3 95 | } Mode; 96 | 97 | class Handler { 98 | public: 99 | //Write an address to a chip, returns the address the chip sets 100 | virtual Bit32u WriteAddr( Bit32u port, Bit8u val ) = 0; 101 | //Write to a specific register in the chip 102 | virtual void WriteReg( Bit32u addr, Bit8u val ) = 0; 103 | //Generate a certain amount of samples 104 | virtual void Generate( MixerChannel* chan, Bitu samples ) = 0; 105 | //Initialize at a specific sample rate and mode 106 | virtual void Init( Bitu rate ) = 0; 107 | virtual ~Handler() { 108 | } 109 | }; 110 | 111 | //The cache for 2 chips or an opl3 112 | typedef Bit8u RegisterCache[512]; 113 | 114 | //Internal class used for dro capturing 115 | class Capture; 116 | 117 | class Module: public Module_base { 118 | IO_ReadHandleObject ReadHandler[3]; 119 | IO_WriteHandleObject WriteHandler[3]; 120 | MixerObject mixerObject; 121 | 122 | //Mode we're running in 123 | Mode mode; 124 | //Last selected address in the chip for the different modes 125 | union { 126 | Bit32u normal; 127 | Bit8u dual[2]; 128 | } reg; 129 | void CacheWrite( Bit32u reg, Bit8u val ); 130 | void DualWrite( Bit8u index, Bit8u reg, Bit8u val ); 131 | public: 132 | static OPL_Mode oplmode; 133 | MixerChannel* mixerChan; 134 | Bit32u lastUsed; //Ticks when adlib was last used to turn of mixing after a few second 135 | 136 | Handler* handler; //Handler that will generate the sound 137 | RegisterCache cache; 138 | Capture* capture; 139 | Chip chip[2]; 140 | 141 | //Handle port writes 142 | void PortWrite( Bitu port, Bitu val, Bitu iolen ); 143 | Bitu PortRead( Bitu port, Bitu iolen ); 144 | void Init( Mode m ); 145 | 146 | Module( Section* configuration); 147 | ~Module(); 148 | }; 149 | 150 | 151 | } //Adlib namespace 152 | 153 | #endif 154 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/hardware/gameblaster.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2018 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #include "dosbox.h" 20 | #include "inout.h" 21 | #include "mixer.h" 22 | #include "mem.h" 23 | #include "hardware.h" 24 | #include "setup.h" 25 | #include "support.h" 26 | #include "pic.h" 27 | #include 28 | #include 29 | 30 | #include "mame/emu.h" 31 | #include "mame/saa1099.h" 32 | 33 | #define MASTER_CLOCK 7159090 34 | 35 | //My mixer channel 36 | static MixerChannel * cms_chan; 37 | //Timer to disable the channel after a while 38 | static Bit32u lastWriteTicks; 39 | static Bit32u cmsBase; 40 | static saa1099_device* device[2]; 41 | 42 | static void write_cms(Bitu port, Bitu val, Bitu /* iolen */) { 43 | if(cms_chan && (!cms_chan->enabled)) cms_chan->Enable(true); 44 | lastWriteTicks = PIC_Ticks; 45 | switch ( port - cmsBase ) { 46 | case 1: 47 | device[0]->control_w(0, 0, val); 48 | break; 49 | case 0: 50 | device[0]->data_w(0, 0, val); 51 | break; 52 | case 3: 53 | device[1]->control_w(0, 0, val); 54 | break; 55 | case 2: 56 | device[1]->data_w(0, 0, val); 57 | break; 58 | } 59 | } 60 | 61 | static void CMS_CallBack(Bitu len) { 62 | enum { 63 | BUFFER_SIZE = 2048 64 | }; 65 | 66 | if ( len > BUFFER_SIZE ) 67 | return; 68 | 69 | if ( cms_chan ) { 70 | 71 | //Have there been 10 seconds of no commands, disable channel 72 | if ( lastWriteTicks + 10000 < PIC_Ticks ) { 73 | cms_chan->Enable( false ); 74 | return; 75 | } 76 | Bit32s result[BUFFER_SIZE][2]; 77 | Bit16s work[2][BUFFER_SIZE]; 78 | Bit16s* buffers[2] = { work[0], work[1] }; 79 | device_sound_interface::sound_stream stream; 80 | device[0]->sound_stream_update(stream, 0, buffers, len); 81 | for (Bitu i = 0; i < len; i++) { 82 | result[i][0] = work[0][i]; 83 | result[i][1] = work[1][i]; 84 | } 85 | device[1]->sound_stream_update(stream, 0, buffers, len); 86 | for (Bitu i = 0; i < len; i++) { 87 | result[i][0] += work[0][i]; 88 | result[i][1] += work[1][i]; 89 | } 90 | cms_chan->AddSamples_s32( len, result[0] ); 91 | } 92 | } 93 | 94 | // The Gameblaster detection 95 | static Bit8u cms_detect_register = 0xff; 96 | 97 | static void write_cms_detect(Bitu port, Bitu val, Bitu /* iolen */) { 98 | switch ( port - cmsBase ) { 99 | case 0x6: 100 | case 0x7: 101 | cms_detect_register = val; 102 | break; 103 | } 104 | } 105 | 106 | static Bitu read_cms_detect(Bitu port, Bitu /* iolen */) { 107 | Bit8u retval = 0xff; 108 | switch ( port - cmsBase ) { 109 | case 0x4: 110 | retval = 0x7f; 111 | break; 112 | case 0xa: 113 | case 0xb: 114 | retval = cms_detect_register; 115 | break; 116 | } 117 | return retval; 118 | } 119 | 120 | 121 | class CMS:public Module_base { 122 | private: 123 | IO_WriteHandleObject WriteHandler; 124 | IO_WriteHandleObject DetWriteHandler; 125 | IO_ReadHandleObject DetReadHandler; 126 | MixerObject MixerChan; 127 | 128 | public: 129 | CMS(Section* configuration):Module_base(configuration) { 130 | Section_prop * section = static_cast(configuration); 131 | Bitu sampleRate = section->Get_int( "oplrate" ); 132 | cmsBase = section->Get_hex("sbbase"); 133 | WriteHandler.Install( cmsBase, write_cms, IO_MB, 4 ); 134 | 135 | // A standalone Gameblaster has a magic chip on it which is 136 | // sometimes used for detection. 137 | const char * sbtype=section->Get_string("sbtype"); 138 | if (!strcasecmp(sbtype,"gb")) { 139 | DetWriteHandler.Install( cmsBase + 4, write_cms_detect, IO_MB, 12 ); 140 | DetReadHandler.Install(cmsBase,read_cms_detect,IO_MB,16); 141 | } 142 | 143 | /* Register the Mixer CallBack */ 144 | cms_chan = MixerChan.Install(CMS_CallBack,sampleRate,"CMS"); 145 | 146 | lastWriteTicks = PIC_Ticks; 147 | 148 | Bit32u freq = 7159000; //14318180 isa clock / 2 149 | 150 | machine_config config; 151 | device[0] = new saa1099_device(config, "", 0, 7159090); 152 | device[1] = new saa1099_device(config, "", 0, 7159090); 153 | 154 | device[0]->device_start(); 155 | device[1]->device_start(); 156 | } 157 | 158 | ~CMS() { 159 | cms_chan = 0; 160 | delete device[0]; 161 | delete device[1]; 162 | } 163 | }; 164 | 165 | 166 | static CMS* test; 167 | 168 | void CMS_Init(Section* sec) { 169 | test = new CMS(sec); 170 | } 171 | void CMS_ShutDown(Section* sec) { 172 | delete test; 173 | } 174 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/hardware/mame/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | noinst_LIBRARIES = libmame.a 4 | libmame_a_SOURCES = emu.h \ 5 | saa1099.cpp saa1099.h \ 6 | sn76496.cpp sn76496.h 7 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/hardware/mame/emu.h: -------------------------------------------------------------------------------- 1 | #ifndef DOSBOX_EMU_H 2 | #define DOSBOX_EMU_H 3 | 4 | 5 | #include "dosbox.h" 6 | #if defined(_MSC_VER) && (_MSC_VER <= 1500) 7 | #include 8 | #else 9 | #include 10 | #endif 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #if C_DEBUG 17 | #include 18 | #include 19 | #endif 20 | 21 | #ifndef M_PI 22 | #define M_PI 3.14159265358979323846 23 | #endif 24 | 25 | typedef Bit16s stream_sample_t; 26 | 27 | typedef Bit8u u8; 28 | typedef Bit32u u32; 29 | 30 | class device_t; 31 | struct machine_config; 32 | 33 | #define NAME( _ASDF_ ) 0 34 | #define BIT( _INPUT_, _BIT_ ) ( ( _INPUT_) >> (_BIT_)) & 1 35 | 36 | #define ATTR_UNUSED 37 | #define DECLARE_READ8_MEMBER(name) u8 name( int, int) 38 | #define DECLARE_WRITE8_MEMBER(name) void name( int, int, u8 data) 39 | #define READ8_MEMBER(name) u8 name( int, int) 40 | #define WRITE8_MEMBER(name) void name( int offset, int space, u8 data) 41 | 42 | #define DECLARE_DEVICE_TYPE(Type, Class) \ 43 | extern const device_type Type; \ 44 | class Class; 45 | 46 | #define DEFINE_DEVICE_TYPE(Type, Class, ShortName, FullName) \ 47 | const device_type Type = 0; 48 | 49 | 50 | class device_sound_interface { 51 | public: 52 | struct sound_stream { 53 | void update() { 54 | } 55 | }; 56 | sound_stream temp; 57 | 58 | sound_stream* stream_alloc(int whatever, int channels, int size) { 59 | return &temp; 60 | }; 61 | 62 | 63 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) = 0; 64 | 65 | device_sound_interface(const machine_config &mconfig, device_t& _device) { 66 | } 67 | 68 | }; 69 | 70 | struct attotime { 71 | int whatever; 72 | 73 | static attotime from_hz(int hz) { 74 | return attotime(); 75 | } 76 | }; 77 | 78 | struct machine_config { 79 | }; 80 | 81 | typedef int device_type; 82 | 83 | class device_t { 84 | u32 clockRate; 85 | public: 86 | struct machine_t { 87 | int describe_context() const { 88 | return 0; 89 | } 90 | }; 91 | 92 | machine_t machine() const { 93 | return machine_t(); 94 | } 95 | 96 | //int offset, space; 97 | 98 | u32 clock() const { 99 | return clockRate; 100 | } 101 | 102 | void logerror(const char* msg, ...) { 103 | } 104 | 105 | static int tag() { 106 | return 0; 107 | } 108 | 109 | virtual void device_start() { 110 | } 111 | 112 | void save_item(int wtf, int blah= 0) { 113 | } 114 | 115 | device_t(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 _clock) : clockRate( _clock ) { 116 | } 117 | 118 | }; 119 | 120 | 121 | 122 | static void auto_free(const device_t::machine_t& machine, void * buffer) { 123 | free(buffer); 124 | } 125 | 126 | #define auto_alloc_array_clear(m, t, c) calloc(c, sizeof(t) ) 127 | #define auto_alloc_clear(m, t) static_cast( calloc(1, sizeof(t) ) ) 128 | 129 | 130 | 131 | 132 | #endif 133 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/hardware/mame/saa1099.h: -------------------------------------------------------------------------------- 1 | // license:BSD-3-Clause 2 | // copyright-holders:Juergen Buchmueller, Manuel Abadia 3 | /********************************************** 4 | Philips SAA1099 Sound driver 5 | **********************************************/ 6 | 7 | #ifndef MAME_SOUND_SAA1099_H 8 | #define MAME_SOUND_SAA1099_H 9 | 10 | #pragma once 11 | 12 | //************************************************************************** 13 | // INTERFACE CONFIGURATION MACROS 14 | //************************************************************************** 15 | 16 | #define MCFG_SAA1099_ADD(_tag, _clock) \ 17 | MCFG_DEVICE_ADD(_tag, SAA1099, _clock) 18 | #define MCFG_SAA1099_REPLACE(_tag, _clock) \ 19 | MCFG_DEVICE_REPLACE(_tag, SAA1099, _clock) 20 | 21 | 22 | //************************************************************************** 23 | // TYPE DEFINITIONS 24 | //************************************************************************** 25 | 26 | //Container class for int that just initalizes to 0 27 | class NullInt { 28 | int value; 29 | public: 30 | operator int& () { 31 | return value; 32 | } 33 | 34 | int& operator= ( int set ) { 35 | value = set; 36 | return value; 37 | } 38 | 39 | NullInt( int set = 0 ) : value( set ) { 40 | } 41 | }; 42 | 43 | // ======================> saa1099_device 44 | 45 | class saa1099_device : public device_t, 46 | public device_sound_interface 47 | { 48 | public: 49 | saa1099_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); 50 | 51 | DECLARE_WRITE8_MEMBER( control_w ); 52 | DECLARE_WRITE8_MEMBER( data_w ); 53 | 54 | DECLARE_WRITE8_MEMBER( write ); 55 | 56 | //protected: 57 | // device-level overrides 58 | virtual void device_start(); 59 | 60 | // sound stream update overrides 61 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); 62 | 63 | private: 64 | struct saa1099_channel 65 | { 66 | saa1099_channel() { 67 | //Quite hacky, but let's see how it goes 68 | memset( this, 0, sizeof( *this ) ); 69 | } 70 | 71 | int frequency ; /* frequency (0x00..0xff) */ 72 | int freq_enable ; /* frequency enable */ 73 | int noise_enable ; /* noise enable */ 74 | int octave ; /* octave (0x00..0x07) */ 75 | int amplitude[2]; /* amplitude (0x00..0x0f) */ 76 | int envelope[2]; /* envelope (0x00..0x0f or 0x10 == off) */ 77 | 78 | /* vars to simulate the square wave */ 79 | double counter ; 80 | double freq ; 81 | int level ; 82 | 83 | }; 84 | 85 | struct saa1099_noise 86 | { 87 | saa1099_noise() { 88 | counter = 0; 89 | freq = 0; 90 | level = 0xFFFFFFFF; 91 | } 92 | 93 | /* vars to simulate the noise generator output */ 94 | double counter; 95 | double freq; 96 | uint32_t level; /* noise polynomial shifter */ 97 | }; 98 | 99 | void envelope_w(int ch); 100 | 101 | sound_stream *m_stream; /* our stream */ 102 | int m_noise_params[2]; /* noise generators parameters */ 103 | int m_env_enable[2]; /* envelope generators enable */ 104 | int m_env_reverse_right[2]; /* envelope reversed for right channel */ 105 | int m_env_mode[2]; /* envelope generators mode */ 106 | int m_env_bits[2]; /* non zero = 3 bits resolution */ 107 | int m_env_clock[2]; /* envelope clock mode (non-zero external) */ 108 | int m_env_step[2]; /* current envelope step */ 109 | int m_all_ch_enable; /* all channels enable */ 110 | int m_sync_state; /* sync all channels */ 111 | int m_selected_reg; /* selected register */ 112 | saa1099_channel m_channels[6]; /* channels */ 113 | saa1099_noise m_noise[2]; /* noise generators */ 114 | double m_sample_rate; 115 | int m_master_clock; 116 | }; 117 | 118 | DECLARE_DEVICE_TYPE(SAA1099, saa1099_device) 119 | 120 | #endif // MAME_SOUND_SAA1099_H 121 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/hardware/serialport/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | noinst_LIBRARIES = libserial.a 4 | 5 | libserial_a_SOURCES = directserial.cpp directserial.h \ 6 | libserial.cpp libserial.h \ 7 | serialdummy.cpp serialdummy.h serialport.cpp \ 8 | softmodem.cpp softmodem.h misc_util.cpp misc_util.h \ 9 | nullmodem.cpp nullmodem.h 10 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/hardware/serialport/directserial.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: directserial.h,v 1.2 2009-09-26 09:15:19 h-a-l-9000 Exp $ */ 20 | 21 | // include guard 22 | #ifndef DOSBOX_DIRECTSERIAL_WIN32_H 23 | #define DOSBOX_DIRECTSERIAL_WIN32_H 24 | 25 | #include "dosbox.h" 26 | 27 | #if C_DIRECTSERIAL 28 | 29 | #define DIRECTSERIAL_AVAILIBLE 30 | #include "serialport.h" 31 | 32 | #include "libserial.h" 33 | 34 | class CDirectSerial : public CSerial { 35 | public: 36 | CDirectSerial(Bitu id, CommandLine* cmd); 37 | ~CDirectSerial(); 38 | 39 | void updatePortConfig(Bit16u divider, Bit8u lcr); 40 | void updateMSR(); 41 | void transmitByte(Bit8u val, bool first); 42 | void setBreak(bool value); 43 | 44 | void setRTSDTR(bool rts, bool dtr); 45 | void setRTS(bool val); 46 | void setDTR(bool val); 47 | void handleUpperEvent(Bit16u type); 48 | 49 | private: 50 | COMPORT comport; 51 | 52 | Bitu rx_state; 53 | #define D_RX_IDLE 0 54 | #define D_RX_WAIT 1 55 | #define D_RX_BLOCKED 2 56 | #define D_RX_FASTWAIT 3 57 | 58 | Bitu rx_retry; // counter of retries (every millisecond) 59 | Bitu rx_retry_max; // how many POLL_EVENTS to wait before causing 60 | // an overrun error. 61 | bool doReceive(); 62 | 63 | #if SERIAL_DEBUG 64 | bool dbgmsg_poll_block; 65 | bool dbgmsg_rx_block; 66 | #endif 67 | 68 | }; 69 | 70 | #endif // C_DIRECTSERIAL 71 | #endif // include guard 72 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/hardware/serialport/libserial.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: libserial.h,v 1.2 2009-09-26 09:15:19 h-a-l-9000 Exp $ */ 20 | 21 | #include 22 | 23 | typedef struct _COMPORT *COMPORT; 24 | 25 | bool SERIAL_open(const char* portname, COMPORT* port); 26 | void SERIAL_close(COMPORT port); 27 | void SERIAL_getErrorString(char* buffer, size_t length); 28 | 29 | #define SERIAL_1STOP 1 30 | #define SERIAL_2STOP 2 31 | #define SERIAL_15STOP 0 32 | 33 | // parity: n, o, e, m, s 34 | 35 | bool SERIAL_setCommParameters(COMPORT port, 36 | int baudrate, char parity, int stopbits, int length); 37 | 38 | void SERIAL_setDTR(COMPORT port, bool value); 39 | void SERIAL_setRTS(COMPORT port, bool value); 40 | void SERIAL_setBREAK(COMPORT port, bool value); 41 | 42 | #define SERIAL_CTS 0x10 43 | #define SERIAL_DSR 0x20 44 | #define SERIAL_RI 0x40 45 | #define SERIAL_CD 0x80 46 | 47 | int SERIAL_getmodemstatus(COMPORT port); 48 | bool SERIAL_setmodemcontrol(COMPORT port, int flags); 49 | 50 | bool SERIAL_sendchar(COMPORT port, char data); 51 | 52 | // 0-7 char data, higher=flags 53 | #define SERIAL_BREAK_ERR 0x10 54 | #define SERIAL_FRAMING_ERR 0x08 55 | #define SERIAL_PARITY_ERR 0x04 56 | #define SERIAL_OVERRUN_ERR 0x02 57 | 58 | int SERIAL_getextchar(COMPORT port); 59 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/hardware/serialport/misc_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: misc_util.h,v 1.5 2009-09-25 23:40:47 h-a-l-9000 Exp $ */ 20 | 21 | #ifndef SDLNETWRAPPER_H 22 | #define SDLNETWRAPPER_H 23 | 24 | #ifndef DOSBOX_DOSBOX_H 25 | #include "dosbox.h" 26 | #endif 27 | 28 | #if C_MODEM 29 | 30 | # ifndef DOSBOX_SUPPORT_H 31 | #include "support.h" 32 | #endif 33 | 34 | // Netwrapper Capabilities 35 | #define NETWRAPPER_TCP 1 36 | #define NETWRAPPER_TCP_NATIVESOCKET 2 37 | 38 | #if defined WIN32 39 | #define NATIVESOCKETS 40 | #include 41 | #include //for socklen_t 42 | //typedef int socklen_t; 43 | 44 | //Tests for BSD/OS2/LINUX 45 | #elif defined HAVE_STDLIB_H && defined HAVE_SYS_TYPES_H && defined HAVE_SYS_SOCKET_H && defined HAVE_NETINET_IN_H 46 | #define NATIVESOCKETS 47 | #define SOCKET int 48 | #include //darwin 49 | #include //darwin 50 | #include 51 | #include 52 | #include 53 | //socklen_t should be handled by configure 54 | #endif 55 | 56 | #ifdef NATIVESOCKETS 57 | #define CAPWORD (NETWRAPPER_TCP|NETWRAPPER_TCP_NATIVESOCKET) 58 | #else 59 | #define CAPWORD NETWRAPPER_TCP 60 | #endif 61 | 62 | #include "SDL_net.h" 63 | 64 | 65 | 66 | Bit32u Netwrapper_GetCapabilities(); 67 | 68 | 69 | class TCPClientSocket { 70 | public: 71 | TCPClientSocket(TCPsocket source); 72 | TCPClientSocket(const char* destination, Bit16u port); 73 | #ifdef NATIVESOCKETS 74 | Bit8u* nativetcpstruct; 75 | TCPClientSocket(int platformsocket); 76 | #endif 77 | ~TCPClientSocket(); 78 | 79 | // return: 80 | // -1: no data 81 | // -2: socket closed 82 | // >0: data char 83 | Bits GetcharNonBlock(); 84 | 85 | 86 | bool Putchar(Bit8u data); 87 | bool SendArray(Bit8u* data, Bitu bufsize); 88 | bool ReceiveArray(Bit8u* data, Bitu* size); 89 | bool isopen; 90 | 91 | bool GetRemoteAddressString(Bit8u* buffer); 92 | 93 | void FlushBuffer(); 94 | void SetSendBufferSize(Bitu bufsize); 95 | 96 | // buffered send functions 97 | bool SendByteBuffered(Bit8u data); 98 | bool SendArrayBuffered(Bit8u* data, Bitu bufsize); 99 | 100 | private: 101 | TCPsocket mysock; 102 | SDLNet_SocketSet listensocketset; 103 | 104 | // Items for send buffering 105 | Bitu sendbuffersize; 106 | Bitu sendbufferindex; 107 | 108 | Bit8u* sendbuffer; 109 | }; 110 | 111 | class TCPServerSocket { 112 | public: 113 | bool isopen; 114 | TCPsocket mysock; 115 | TCPServerSocket(Bit16u port); 116 | ~TCPServerSocket(); 117 | TCPClientSocket* Accept(); 118 | }; 119 | 120 | 121 | #endif //C_MODEM 122 | 123 | #endif //# SDLNETWRAPPER_H 124 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/hardware/serialport/nullmodem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: nullmodem.h,v 1.4 2009-09-25 23:40:47 h-a-l-9000 Exp $ */ 20 | 21 | // include guard 22 | #ifndef DOSBOX_NULLMODEM_WIN32_H 23 | #define DOSBOX_NULLMODEM_WIN32_H 24 | 25 | #include "dosbox.h" 26 | 27 | #if C_MODEM 28 | 29 | #include "misc_util.h" 30 | #include "serialport.h" 31 | 32 | #define SERIAL_SERVER_POLLING_EVENT SERIAL_BASE_EVENT_COUNT+1 33 | #define SERIAL_TX_REDUCTION SERIAL_BASE_EVENT_COUNT+2 34 | #define SERIAL_NULLMODEM_DTR_EVENT SERIAL_BASE_EVENT_COUNT+3 35 | #define SERIAL_NULLMODEM_EVENT_COUNT SERIAL_BASE_EVENT_COUNT+3 36 | 37 | class CNullModem : public CSerial { 38 | public: 39 | TCPServerSocket* serversocket; 40 | TCPClientSocket* clientsocket; 41 | 42 | CNullModem(Bitu id, CommandLine* cmd); 43 | ~CNullModem(); 44 | bool receiveblock; // It's not a block of data it rather blocks 45 | Bit16u serverport; // we are a server if this is nonzero 46 | Bit16u clientport; 47 | 48 | Bit8u hostnamebuffer[128]; // the name passed to us by the user 49 | 50 | void updatePortConfig(Bit16u divider, Bit8u lcr); 51 | void updateMSR(); 52 | void transmitByte(Bit8u val, bool first); 53 | void setBreak(bool value); 54 | 55 | void setRTSDTR(bool rts, bool dtr); 56 | void setRTS(bool val); 57 | void setDTR(bool val); 58 | void handleUpperEvent(Bit16u type); 59 | 60 | Bitu rx_state; 61 | #define N_RX_IDLE 0 62 | #define N_RX_WAIT 1 63 | #define N_RX_BLOCKED 2 64 | #define N_RX_FASTWAIT 3 65 | #define N_RX_DISC 4 66 | 67 | bool doReceive(); 68 | void ClientConnect(); 69 | void Disconnect(); 70 | Bits readChar(); 71 | void WriteChar(Bit8u data); 72 | 73 | bool tx_block; // true while the SERIAL_TX_REDUCTION event 74 | // is pending 75 | 76 | Bitu rx_retry; // counter of retries 77 | 78 | Bitu rx_retry_max; // how many POLL_EVENTS to wait before causing 79 | // a overrun error. 80 | 81 | Bitu tx_gather; // how long to gather tx data before 82 | // sending all of them [milliseconds] 83 | 84 | 85 | bool dtrrespect; // dtr behavior - only send data to the serial 86 | // port when DTR is on 87 | 88 | bool transparent; // if true, don't send 0xff 0xXX to toggle 89 | // DSR/CTS. 90 | 91 | bool telnet; // Do Telnet parsing. 92 | 93 | // Telnet's brain 94 | #define TEL_CLIENT 0 95 | #define TEL_SERVER 1 96 | 97 | Bits TelnetEmulation(Bit8u data); 98 | 99 | // Telnet's memory 100 | struct { 101 | bool binary[2]; 102 | bool echo[2]; 103 | bool supressGA[2]; 104 | bool timingMark[2]; 105 | 106 | bool inIAC; 107 | bool recCommand; 108 | Bit8u command; 109 | } telClient; 110 | }; 111 | 112 | #endif // C_MODEM 113 | #endif // include guard 114 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/hardware/serialport/serialdummy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: serialdummy.cpp,v 1.5 2009-05-27 09:15:41 qbix79 Exp $ */ 20 | 21 | #include "dosbox.h" 22 | 23 | #include "setup.h" 24 | #include "serialdummy.h" 25 | #include "serialport.h" 26 | 27 | CSerialDummy::CSerialDummy(Bitu id, CommandLine* cmd):CSerial(id, cmd) { 28 | CSerial::Init_Registers(); 29 | setRI(false); 30 | setDSR(false); 31 | setCD(false); 32 | setCTS(false); 33 | InstallationSuccessful=true; 34 | } 35 | 36 | CSerialDummy::~CSerialDummy() { 37 | // clear events 38 | removeEvent(SERIAL_TX_EVENT); 39 | } 40 | 41 | void CSerialDummy::handleUpperEvent(Bit16u type) { 42 | if(type==SERIAL_TX_EVENT) { 43 | //LOG_MSG("SERIAL_TX_EVENT"); 44 | #ifdef CHECKIT_TESTPLUG 45 | receiveByte(loopbackdata); 46 | #endif 47 | ByteTransmitted(); // tx timeout 48 | } 49 | else if(type==SERIAL_THR_EVENT){ 50 | //LOG_MSG("SERIAL_THR_EVENT"); 51 | ByteTransmitting(); 52 | setEvent(SERIAL_TX_EVENT,bytetime); 53 | } 54 | 55 | } 56 | 57 | /*****************************************************************************/ 58 | /* updatePortConfig is called when emulated app changes the serial port **/ 59 | /* parameters baudrate, stopbits, number of databits, parity. **/ 60 | /*****************************************************************************/ 61 | void CSerialDummy::updatePortConfig(Bit16u divider, Bit8u lcr) { 62 | //LOG_MSG("Serial port at 0x%x: Port params changed: %d Baud", base,dcb.BaudRate); 63 | } 64 | 65 | void CSerialDummy::updateMSR() { 66 | } 67 | void CSerialDummy::transmitByte(Bit8u val, bool first) { 68 | 69 | if(first) setEvent(SERIAL_THR_EVENT, bytetime/10); 70 | else setEvent(SERIAL_TX_EVENT, bytetime); 71 | 72 | #ifdef CHECKIT_TESTPLUG 73 | loopbackdata=val; 74 | #endif 75 | } 76 | 77 | /*****************************************************************************/ 78 | /* setBreak(val) switches break on or off **/ 79 | /*****************************************************************************/ 80 | 81 | void CSerialDummy::setBreak(bool value) { 82 | //LOG_MSG("UART 0x%x: Break toggeled: %d", base, value); 83 | } 84 | 85 | /*****************************************************************************/ 86 | /* setRTSDTR sets the modem control lines **/ 87 | /*****************************************************************************/ 88 | void CSerialDummy::setRTSDTR(bool rts, bool dtr) { 89 | setRTS(rts); 90 | setDTR(dtr); 91 | } 92 | void CSerialDummy::setRTS(bool val) { 93 | #ifdef CHECKIT_TESTPLUG 94 | setCTS(val); 95 | #endif 96 | } 97 | void CSerialDummy::setDTR(bool val) { 98 | #ifdef CHECKIT_TESTPLUG 99 | setDSR(val); 100 | setRI(val); 101 | setCD(val); 102 | #endif 103 | } 104 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/hardware/serialport/serialdummy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: serialdummy.h,v 1.5 2009-05-27 09:15:41 qbix79 Exp $ */ 20 | 21 | #ifndef INCLUDEGUARD_SERIALDUMMY_H 22 | #define INCLUDEGUARD_SERIALDUMMY_H 23 | 24 | #include "serialport.h" 25 | 26 | //#define CHECKIT_TESTPLUG 27 | 28 | class CSerialDummy : public CSerial { 29 | public: 30 | CSerialDummy(Bitu id, CommandLine* cmd); 31 | ~CSerialDummy(); 32 | 33 | void setRTSDTR(bool rts, bool dtr); 34 | void setRTS(bool val); 35 | void setDTR(bool val); 36 | 37 | void updatePortConfig(Bit16u, Bit8u lcr); 38 | void updateMSR(); 39 | void transmitByte(Bit8u val, bool first); 40 | void setBreak(bool value); 41 | void handleUpperEvent(Bit16u type); 42 | 43 | #ifdef CHECKIT_TESTPLUG 44 | Bit8u loopbackdata; 45 | #endif 46 | 47 | }; 48 | 49 | #endif // INCLUDEGUARD 50 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/ints/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | noinst_LIBRARIES = libints.a 4 | libints_a_SOURCES = mouse.cpp xms.cpp xms.h ems.cpp \ 5 | int10.cpp int10.h int10_char.cpp int10_memory.cpp int10_misc.cpp int10_modes.cpp \ 6 | int10_vesa.cpp int10_pal.cpp int10_put_pixel.cpp int10_video_state.cpp int10_vptable.cpp \ 7 | bios.cpp bios_disk.cpp bios_keyboard.cpp 8 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/ints/xms.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef __XMS_H__ 20 | #define __XMS_H__ 21 | 22 | Bitu XMS_QueryFreeMemory (Bit16u& largestFree, Bit16u& totalFree); 23 | Bitu XMS_AllocateMemory (Bitu size, Bit16u& handle); 24 | Bitu XMS_FreeMemory (Bitu handle); 25 | Bitu XMS_MoveMemory (PhysPt bpt); 26 | Bitu XMS_LockMemory (Bitu handle, Bit32u& address); 27 | Bitu XMS_UnlockMemory (Bitu handle); 28 | Bitu XMS_GetHandleInformation(Bitu handle, Bit8u& lockCount, Bit8u& numFree, Bit16u& size); 29 | Bitu XMS_ResizeMemory (Bitu handle, Bitu newSize); 30 | 31 | Bitu XMS_EnableA20 (bool enable); 32 | Bitu XMS_GetEnabledA20 (void); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/libs/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | SUBDIRS = zmbv gui_tk 4 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/libs/gui_tk/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | noinst_LIBRARIES = libgui_tk.a 4 | libgui_tk_a_SOURCES = gui_tk.cpp gui_tk.h 5 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/libs/zmbv/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = zmbv.cpp zmbv.h 2 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/libs/zmbv/zmbv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #ifndef DOSBOX_DOSBOX_H 20 | #ifdef _MSC_VER 21 | #define INLINE __forceinline 22 | #else 23 | #define INLINE inline 24 | #endif 25 | #endif 26 | 27 | #define CODEC_4CC "ZMBV" 28 | 29 | typedef enum { 30 | ZMBV_FORMAT_NONE = 0x00, 31 | ZMBV_FORMAT_1BPP = 0x01, 32 | ZMBV_FORMAT_2BPP = 0x02, 33 | ZMBV_FORMAT_4BPP = 0x03, 34 | ZMBV_FORMAT_8BPP = 0x04, 35 | ZMBV_FORMAT_15BPP = 0x05, 36 | ZMBV_FORMAT_16BPP = 0x06, 37 | ZMBV_FORMAT_24BPP = 0x07, 38 | ZMBV_FORMAT_32BPP = 0x08 39 | } zmbv_format_t; 40 | 41 | void Msg(const char fmt[], ...); 42 | class VideoCodec { 43 | private: 44 | struct FrameBlock { 45 | int start; 46 | int dx,dy; 47 | }; 48 | struct CodecVector { 49 | int x,y; 50 | int slot; 51 | }; 52 | struct KeyframeHeader { 53 | unsigned char high_version; 54 | unsigned char low_version; 55 | unsigned char compression; 56 | unsigned char format; 57 | unsigned char blockwidth,blockheight; 58 | }; 59 | 60 | struct { 61 | int linesDone; 62 | int writeSize; 63 | int writeDone; 64 | unsigned char *writeBuf; 65 | } compress; 66 | 67 | CodecVector VectorTable[512]; 68 | int VectorCount; 69 | 70 | unsigned char *oldframe, *newframe; 71 | unsigned char *buf1, *buf2, *work; 72 | int bufsize; 73 | 74 | int blockcount; 75 | FrameBlock * blocks; 76 | 77 | int workUsed, workPos; 78 | 79 | int palsize; 80 | char palette[256*4]; 81 | int height, width, pitch; 82 | zmbv_format_t format; 83 | int pixelsize; 84 | 85 | z_stream zstream; 86 | 87 | // methods 88 | void FreeBuffers(void); 89 | void CreateVectorTable(void); 90 | bool SetupBuffers(zmbv_format_t format, int blockwidth, int blockheight); 91 | 92 | template 93 | void AddXorFrame(void); 94 | template 95 | void UnXorFrame(void); 96 | template 97 | INLINE int PossibleBlock(int vx,int vy,FrameBlock * block); 98 | template 99 | INLINE int CompareBlock(int vx,int vy,FrameBlock * block); 100 | template 101 | INLINE void AddXorBlock(int vx,int vy,FrameBlock * block); 102 | template 103 | INLINE void UnXorBlock(int vx,int vy,FrameBlock * block); 104 | template 105 | INLINE void CopyBlock(int vx, int vy,FrameBlock * block); 106 | public: 107 | VideoCodec(); 108 | bool SetupCompress( int _width, int _height); 109 | bool SetupDecompress( int _width, int _height); 110 | zmbv_format_t BPPFormat( int bpp ); 111 | int NeededSize( int _width, int _height, zmbv_format_t _format); 112 | 113 | void CompressLines(int lineCount, void *lineData[]); 114 | bool PrepareCompressFrame(int flags, zmbv_format_t _format, char * pal, void *writeBuf, int writeSize); 115 | int FinishCompressFrame( void ); 116 | bool DecompressFrame(void * framedata, int size); 117 | void Output_UpsideDown_24(void * output); 118 | }; 119 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/misc/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | noinst_LIBRARIES = libmisc.a 4 | libmisc_a_SOURCES = cross.cpp messages.cpp programs.cpp setup.cpp support.cpp 5 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/misc/messages.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: messages.cpp,v 1.23 2009-06-17 08:52:35 qbix79 Exp $ */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include "dosbox.h" 25 | #include "cross.h" 26 | #include "support.h" 27 | #include "setup.h" 28 | #include "control.h" 29 | #include 30 | #include 31 | using namespace std; 32 | 33 | 34 | 35 | #define LINE_IN_MAXLEN 2048 36 | 37 | struct MessageBlock { 38 | string name; 39 | string val; 40 | MessageBlock(const char* _name, const char* _val): 41 | name(_name),val(_val){} 42 | }; 43 | 44 | static list Lang; 45 | typedef list::iterator itmb; 46 | 47 | void MSG_Add(const char * _name, const char* _val) { 48 | /* Find the message */ 49 | for(itmb tel=Lang.begin();tel!=Lang.end();tel++) { 50 | if((*tel).name==_name) { 51 | // LOG_MSG("double entry for %s",_name); //Message file might be loaded before default text messages 52 | return; 53 | } 54 | } 55 | /* if the message doesn't exist add it */ 56 | Lang.push_back(MessageBlock(_name,_val)); 57 | } 58 | 59 | void MSG_Replace(const char * _name, const char* _val) { 60 | /* Find the message */ 61 | for(itmb tel=Lang.begin();tel!=Lang.end();tel++) { 62 | if((*tel).name==_name) { 63 | Lang.erase(tel); 64 | break; 65 | } 66 | } 67 | /* Even if the message doesn't exist add it */ 68 | Lang.push_back(MessageBlock(_name,_val)); 69 | } 70 | 71 | static void LoadMessageFile(const char * fname) { 72 | if (!fname) return; 73 | if(*fname=='\0') return;//empty string=no languagefile 74 | FILE * mfile=fopen(fname,"rt"); 75 | /* This should never happen and since other modules depend on this use a normal printf */ 76 | if (!mfile) { 77 | E_Exit("MSG:Can't load messages: %s",fname); 78 | } 79 | char linein[LINE_IN_MAXLEN]; 80 | char name[LINE_IN_MAXLEN]; 81 | char string[LINE_IN_MAXLEN*10]; 82 | /* Start out with empty strings */ 83 | name[0]=0;string[0]=0; 84 | while(fgets(linein, LINE_IN_MAXLEN, mfile)!=0) { 85 | /* Parse the read line */ 86 | /* First remove characters 10 and 13 from the line */ 87 | char * parser=linein; 88 | char * writer=linein; 89 | while (*parser) { 90 | if (*parser!=10 && *parser!=13) { 91 | *writer++=*parser; 92 | } 93 | *parser++; 94 | } 95 | *writer=0; 96 | /* New string name */ 97 | if (linein[0]==':') { 98 | string[0]=0; 99 | strcpy(name,linein+1); 100 | /* End of string marker */ 101 | } else if (linein[0]=='.') { 102 | /* Replace/Add the string to the internal langaugefile */ 103 | /* Remove last newline (marker is \n.\n) */ 104 | size_t ll = strlen(string); 105 | if(ll && string[ll - 1] == '\n') string[ll - 1] = 0; //Second if should not be needed, but better be safe. 106 | MSG_Replace(name,string); 107 | } else { 108 | /* Normal string to be added */ 109 | strcat(string,linein); 110 | strcat(string,"\n"); 111 | } 112 | } 113 | fclose(mfile); 114 | } 115 | 116 | const char * MSG_Get(char const * msg) { 117 | for(itmb tel=Lang.begin();tel!=Lang.end();tel++){ 118 | if((*tel).name==msg) 119 | { 120 | return (*tel).val.c_str(); 121 | } 122 | } 123 | return "Message not Found!\n"; 124 | } 125 | 126 | 127 | void MSG_Write(const char * location) { 128 | FILE* out=fopen(location,"w+t"); 129 | if(out==NULL) return;//maybe an error? 130 | for(itmb tel=Lang.begin();tel!=Lang.end();tel++){ 131 | fprintf(out,":%s\n%s\n.\n",(*tel).name.c_str(),(*tel).val.c_str()); 132 | } 133 | fclose(out); 134 | } 135 | 136 | void MSG_Init(Section_prop * section) { 137 | std::string file_name; 138 | if (control->cmdline->FindString("-lang",file_name,true)) { 139 | LoadMessageFile(file_name.c_str()); 140 | } else { 141 | Prop_path* pathprop = section->Get_path("language"); 142 | if(pathprop) LoadMessageFile(pathprop->realpath.c_str()); 143 | } 144 | } 145 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/misc/support.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2010 The DOSBox Team 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | /* $Id: support.cpp,v 1.37 2009-05-27 09:15:42 qbix79 Exp $ */ 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #include "dosbox.h" 33 | #include "debug.h" 34 | #include "support.h" 35 | #include "video.h" 36 | 37 | 38 | void upcase(std::string &str) { 39 | int (*tf)(int) = std::toupper; 40 | std::transform(str.begin(), str.end(), str.begin(), tf); 41 | } 42 | 43 | void lowcase(std::string &str) { 44 | int (*tf)(int) = std::tolower; 45 | std::transform(str.begin(), str.end(), str.begin(), tf); 46 | } 47 | 48 | 49 | /* 50 | Ripped some source from freedos for this one. 51 | 52 | */ 53 | 54 | 55 | /* 56 | * replaces all instances of character o with character c 57 | */ 58 | 59 | 60 | void strreplace(char * str,char o,char n) { 61 | while (*str) { 62 | if (*str==o) *str=n; 63 | str++; 64 | } 65 | } 66 | char *ltrim(char *str) { 67 | while (*str && isspace(*reinterpret_cast(str))) str++; 68 | return str; 69 | } 70 | 71 | char *rtrim(char *str) { 72 | char *p; 73 | p = strchr(str, '\0'); 74 | while (--p >= str && isspace(*reinterpret_cast(p))) {}; 75 | p[1] = '\0'; 76 | return str; 77 | } 78 | 79 | char *trim(char *str) { 80 | return ltrim(rtrim(str)); 81 | } 82 | 83 | char * upcase(char * str) { 84 | for (char* idx = str; *idx ; idx++) *idx = toupper(*reinterpret_cast(idx)); 85 | return str; 86 | } 87 | 88 | char * lowcase(char * str) { 89 | for(char* idx = str; *idx ; idx++) *idx = tolower(*reinterpret_cast(idx)); 90 | return str; 91 | } 92 | 93 | 94 | 95 | bool ScanCMDBool(char * cmd,char const * const check) { 96 | char * scan=cmd;size_t c_len=strlen(check); 97 | while ((scan=strchr(scan,'/'))) { 98 | /* found a / now see behind it */ 99 | scan++; 100 | if (strncasecmp(scan,check,c_len)==0 && (scan[c_len]==' ' || scan[c_len]=='\t' || scan[c_len]=='/' || scan[c_len]==0)) { 101 | /* Found a math now remove it from the string */ 102 | memmove(scan-1,scan+c_len,strlen(scan+c_len)+1); 103 | trim(scan-1); 104 | return true; 105 | } 106 | } 107 | return false; 108 | } 109 | 110 | /* This scans the command line for a remaining switch and reports it else returns 0*/ 111 | char * ScanCMDRemain(char * cmd) { 112 | char * scan,*found;; 113 | if ((scan=found=strchr(cmd,'/'))) { 114 | while ( *scan && !isspace(*reinterpret_cast(scan)) ) scan++; 115 | *scan=0; 116 | return found; 117 | } else return 0; 118 | } 119 | 120 | char * StripWord(char *&line) { 121 | char * scan=line; 122 | scan=ltrim(scan); 123 | if (*scan=='"') { 124 | char * end_quote=strchr(scan+1,'"'); 125 | if (end_quote) { 126 | *end_quote=0; 127 | line=ltrim(++end_quote); 128 | return (scan+1); 129 | } 130 | } 131 | char * begin=scan; 132 | for (char c = *scan ;(c = *scan);scan++) { 133 | if (isspace(*reinterpret_cast(&c))) { 134 | *scan++=0; 135 | break; 136 | } 137 | } 138 | line=scan; 139 | return begin; 140 | } 141 | 142 | Bits ConvDecWord(char * word) { 143 | bool negative=false;Bitu ret=0; 144 | if (*word=='-') { 145 | negative=true; 146 | word++; 147 | } 148 | while (char c=*word) { 149 | ret*=10; 150 | ret+=c-'0'; 151 | word++; 152 | } 153 | if (negative) return 0-ret; 154 | else return ret; 155 | } 156 | 157 | Bits ConvHexWord(char * word) { 158 | Bitu ret=0; 159 | while (char c=toupper(*reinterpret_cast(word))) { 160 | ret*=16; 161 | if (c>='0' && c<='9') ret+=c-'0'; 162 | else if (c>='A' && c<='F') ret+=10+(c-'A'); 163 | word++; 164 | } 165 | return ret; 166 | } 167 | 168 | double ConvDblWord(char * word) { 169 | return 0.0f; 170 | } 171 | 172 | 173 | static char buf[1024]; //greater scope as else it doesn't always gets thrown right (linux/gcc2.95) 174 | void E_Exit(const char * format,...) { 175 | #if C_DEBUG && C_HEAVY_DEBUG 176 | DEBUG_HeavyWriteLogInstruction(); 177 | #endif 178 | va_list msg; 179 | va_start(msg,format); 180 | vsprintf(buf,format,msg); 181 | va_end(msg); 182 | strcat(buf,"\n"); 183 | 184 | throw(buf); 185 | } 186 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/platform/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = visualc 2 | 3 | EXTRA_DIST = sdl-win32.diff -------------------------------------------------------------------------------- /dosbox-0.74-3/src/platform/sdl-win32.diff: -------------------------------------------------------------------------------- 1 | diff -ru SDL-1.2.12/src/main/win32/version.rc SDL-1.2.12release/src/main/win32/version.rc 2 | --- SDL-1.2.12/src/main/win32/version.rc 2007-07-20 07:52:05.000000000 +0200 3 | +++ SDL-1.2.12release/src/main/win32/version.rc 2007-08-17 19:03:42.000000000 +0200 4 | @@ -13,7 +13,7 @@ 5 | FILEVERSION 1,2,12,0 6 | PRODUCTVERSION 1,2,12,0 7 | FILEFLAGSMASK 0x3fL 8 | - FILEFLAGS 0x0L 9 | + FILEFLAGS 0x4L 10 | FILEOS 0x40004L 11 | FILETYPE 0x2L 12 | FILESUBTYPE 0x0L 13 | diff -ru SDL-1.2.12/src/video/SDL_video.c SDL-1.2.12release/src/video/SDL_video.c 14 | --- SDL-1.2.12/src/video/SDL_video.c 2007-07-20 07:52:25.000000000 +0200 15 | +++ SDL-1.2.12release/src/video/SDL_video.c 2007-08-17 02:51:52.000000000 +0200 16 | @@ -75,12 +75,12 @@ 17 | #if SDL_VIDEO_DRIVER_GAPI 18 | &GAPI_bootstrap, 19 | #endif 20 | -#if SDL_VIDEO_DRIVER_WINDIB 21 | - &WINDIB_bootstrap, 22 | -#endif 23 | #if SDL_VIDEO_DRIVER_DDRAW 24 | &DIRECTX_bootstrap, 25 | #endif 26 | +#if SDL_VIDEO_DRIVER_WINDIB 27 | + &WINDIB_bootstrap, 28 | +#endif 29 | #if SDL_VIDEO_DRIVER_BWINDOW 30 | &BWINDOW_bootstrap, 31 | #endif 32 | diff -ru SDL-1.2.12/src/video/windx5/SDL_dx5events.c SDL-1.2.12release/src/video/windx5/SDL_dx5events.c 33 | --- SDL-1.2.12/src/video/windx5/SDL_dx5events.c 2007-07-20 07:52:25.000000000 +0200 34 | +++ SDL-1.2.12release/src/video/windx5/SDL_dx5events.c 2007-08-17 02:51:52.000000000 +0200 35 | @@ -519,7 +519,7 @@ 36 | case WM_SYSKEYDOWN: { 37 | /* Pass syskey to DefWindwoProc (ALT-F4, etc.) */ 38 | } 39 | - break; 40 | +// break; 41 | case WM_KEYUP: 42 | case WM_KEYDOWN: { 43 | /* Ignore windows keyboard messages */; 44 | diff -ru SDL-1.2.12/src/video/windx5/SDL_dx5video.c SDL-1.2.12release/src/video/windx5/SDL_dx5video.c 45 | --- SDL-1.2.12/src/video/windx5/SDL_dx5video.c 2007-07-20 07:52:25.000000000 +0200 46 | +++ SDL-1.2.12release/src/video/windx5/SDL_dx5video.c 2007-08-17 02:51:52.000000000 +0200 47 | @@ -1496,7 +1496,7 @@ 48 | } 49 | } 50 | dd_surface3 = NULL; 51 | -#if 0 /* FIXME: enable this when SDL consistently reports lost surfaces */ 52 | +#if 1 /* FIXME: enable this when SDL consistently reports lost surfaces */ 53 | if ( (flags & SDL_HWSURFACE) == SDL_HWSURFACE ) { 54 | video->flags |= SDL_HWSURFACE; 55 | } else { 56 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/platform/visualc/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = unistd.h config.h ntddscsi.h ntddcdrm.h 2 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/platform/visualc/config.h: -------------------------------------------------------------------------------- 1 | #define VERSION "0.74-3" 2 | 3 | /* Define to 1 to enable internal debugger, requires libcurses */ 4 | #define C_DEBUG 0 5 | 6 | /* Define to 1 to enable screenshots, requires libpng */ 7 | #define C_SSHOT 1 8 | 9 | /* Define to 1 to use opengl display output support */ 10 | #define C_OPENGL 1 11 | 12 | /* Define to 1 to enable internal modem support, requires SDL_net */ 13 | #define C_MODEM 1 14 | 15 | /* Define to 1 to enable IPX networking support, requires SDL_net */ 16 | #define C_IPX 1 17 | 18 | /* Enable some heavy debugging options */ 19 | #define C_HEAVY_DEBUG 0 20 | 21 | /* The type of cpu this host has */ 22 | #define C_TARGETCPU X86 23 | //#define C_TARGETCPU X86_64 24 | 25 | /* Define to 1 to use x86 dynamic cpu core */ 26 | #define C_DYNAMIC_X86 1 27 | 28 | /* Define to 1 to use recompiling cpu core. Can not be used together with the dynamic-x86 core */ 29 | #define C_DYNREC 0 30 | 31 | /* Enable memory function inlining in */ 32 | #define C_CORE_INLINE 0 33 | 34 | /* Enable the FPU module, still only for beta testing */ 35 | #define C_FPU 1 36 | 37 | /* Define to 1 to use a x86 assembly fpu core */ 38 | #define C_FPU_X86 1 39 | 40 | /* Define to 1 to use a unaligned memory access */ 41 | #define C_UNALIGNED_MEMORY 1 42 | 43 | /* environ is defined */ 44 | #define ENVIRON_INCLUDED 1 45 | 46 | /* environ can be linked */ 47 | #define ENVIRON_LINKED 1 48 | 49 | /* Define to 1 if you have the header file. */ 50 | #define HAVE_DDRAW_H 1 51 | 52 | /* Define to 1 if you want serial passthrough support (Win32 only). */ 53 | #define C_DIRECTSERIAL 1 54 | 55 | #define GCC_ATTRIBUTE(x) /* attribute not supported */ 56 | #define GCC_UNLIKELY(x) (x) 57 | #define GCC_LIKELY(x) (x) 58 | 59 | #define INLINE __forceinline 60 | #define DB_FASTCALL __fastcall 61 | 62 | #if defined(_MSC_VER) && (_MSC_VER >= 1400) 63 | #pragma warning(disable : 4996) 64 | #endif 65 | 66 | typedef double Real64; 67 | /* The internal types */ 68 | typedef unsigned char Bit8u; 69 | typedef signed char Bit8s; 70 | typedef unsigned short Bit16u; 71 | typedef signed short Bit16s; 72 | typedef unsigned long Bit32u; 73 | typedef signed long Bit32s; 74 | typedef unsigned __int64 Bit64u; 75 | typedef signed __int64 Bit64s; 76 | typedef unsigned int Bitu; 77 | typedef signed int Bits; 78 | 79 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/platform/visualc/unistd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Mingw32 package. 3 | * 4 | * unistd.h maps (roughly) to io.h 5 | */ 6 | 7 | #ifndef __STRICT_ANSI__ 8 | #include 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/shell/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | noinst_LIBRARIES = libshell.a 4 | libshell_a_SOURCES = shell.cpp shell_batch.cpp shell_cmds.cpp shell_misc.cpp 5 | -------------------------------------------------------------------------------- /dosbox-0.74-3/src/winres.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jrdennisoss/dosboxrm/ecde5ad459e2773b50a780fa0a667b250f4c89db/dosbox-0.74-3/src/winres.rc -------------------------------------------------------------------------------- /dosbox-0.74-3/visualc_net/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = dosbox.sln dosbox.vcproj -------------------------------------------------------------------------------- /dosbox-0.74-3/visualc_net/dosbox.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dosbox", "dosbox.vcproj", "{7FCFFB9B-8629-4D51-849C-8490CECF8AB7}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {7FCFFB9B-8629-4D51-849C-8490CECF8AB7}.Debug.ActiveCfg = Debug|Win32 13 | {7FCFFB9B-8629-4D51-849C-8490CECF8AB7}.Debug.Build.0 = Debug|Win32 14 | {7FCFFB9B-8629-4D51-849C-8490CECF8AB7}.Release.ActiveCfg = Release|Win32 15 | {7FCFFB9B-8629-4D51-849C-8490CECF8AB7}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /tools/Makefile: -------------------------------------------------------------------------------- 1 | ## Copyright (C) 2022 Jon Dennis 2 | ## 3 | ## This program is free software; you can redistribute it and/or modify 4 | ## it under the terms of the GNU General Public License as published by 5 | ## the Free Software Foundation; either version 2 of the License, or 6 | ## (at your option) any later version. 7 | ## 8 | ## This program is distributed in the hope that it will be useful, 9 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | ## GNU General Public License for more details. 12 | ## 13 | ## You should have received a copy of the GNU General Public License 14 | ## along with this program; if not, write to the Free Software 15 | ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 | 17 | CFLAGS := 18 | 19 | ifeq ($(ENABLE_WINCOMPAT),1) 20 | CFLAGS := -include wincompat.h 21 | else 22 | CFLAGS := 23 | endif 24 | 25 | OUTPUTS := $(patsubst %.c,%,$(wildcard *.c)) 26 | OUTPUTS_EXE := $(patsubst %.c,%.exe,$(wildcard *.c)) 27 | 28 | HEADERS := $(wildcard *.h) 29 | 30 | .PHONY: all clean 31 | 32 | all: 33 | $(MAKE) $(OUTPUTS) 34 | 35 | clean: 36 | rm -f $(OUTPUTS) $(OUTPUTS_EXE) 37 | 38 | %: %.c $(HEADERS) 39 | $(CC) $(CFLAGS) -O3 -Wall -s -o "$@" "$<" 40 | 41 | 42 | -------------------------------------------------------------------------------- /tools/find_magical_f_code.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Jon Dennis 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #include 20 | 21 | #define PL_MPEG_IMPLEMENTATION 22 | #include "./original_pl_mpeg.h" 23 | 24 | 25 | int 26 | main(int argc, char *argv[]) { 27 | unsigned result; 28 | unsigned temporal_seqnum; 29 | unsigned picture_type; 30 | 31 | if (argc != 2) { 32 | fprintf(stderr, "Usage: %s INPUT_FILE\n", argv[0]); 33 | return 1; 34 | } 35 | 36 | plm_t *plm = plm_create_with_filename(argv[1]); 37 | if (!plm) { 38 | printf("Couldn't open file %s\n", argv[1]); 39 | return 1; 40 | } 41 | 42 | plm_set_audio_enabled(plm, FALSE); 43 | plm_set_loop(plm, FALSE); 44 | if (!plm->video_decoder) { 45 | if (plm->audio_decoder) { 46 | plm_audio_destroy(plm->audio_decoder); 47 | plm->audio_decoder = NULL; 48 | } 49 | plm_demux_rewind(plm->demux); 50 | plm->has_decoders = TRUE; 51 | plm->video_packet_type = PLM_DEMUX_PACKET_VIDEO_1; 52 | if (plm->video_decoder) plm_video_destroy(plm->video_decoder); 53 | plm->video_decoder = plm_video_create_with_buffer(plm->demux->buffer, FALSE); 54 | } 55 | plm_rewind(plm); 56 | /* XXX read rate code here !!! */ 57 | if (plm_video_get_framerate(plm->video_decoder) != 0.000) { 58 | printf("Error not a magical asset\n"); 59 | plm_destroy(plm); 60 | return 1; 61 | } 62 | 63 | /* this is some mighty fine half-assery... */ 64 | result = 0; 65 | do { 66 | if (plm_buffer_find_start_code(plm->video_decoder->buffer, PLM_START_PICTURE) == -1) { 67 | break; 68 | } 69 | temporal_seqnum = plm_buffer_read(plm->video_decoder->buffer, 10); 70 | picture_type = plm_buffer_read(plm->video_decoder->buffer, 3); 71 | if ((picture_type == PLM_VIDEO_PICTURE_TYPE_PREDICTIVE) || (picture_type == PLM_VIDEO_PICTURE_TYPE_B)) { 72 | plm_buffer_skip(plm->video_decoder->buffer, 16); // skip vbv_delay 73 | plm_buffer_skip(plm->video_decoder->buffer, 1); //skip full_px 74 | result = plm_buffer_read(plm->video_decoder->buffer, 3); //forward f_code 75 | if (plm_buffer_next_start_code(plm->video_decoder->buffer) == PLM_START_USER_DATA) { 76 | /* The Horde */ 77 | if (temporal_seqnum != 4) result = 0; 78 | } 79 | else { 80 | /* Return to Zork and Lord of the Rings */ 81 | if ((temporal_seqnum != 3) && (temporal_seqnum != 8)) result = 0; 82 | } 83 | } 84 | } while (result == 0); 85 | plm_rewind(plm); 86 | plm_destroy(plm); 87 | 88 | 89 | if (result) { 90 | printf("Found f_code: %u\n", result); 91 | return 0; 92 | } 93 | 94 | printf("Not Found\n"); 95 | return 1; 96 | } 97 | -------------------------------------------------------------------------------- /tools/is_magical_asset.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Jon Dennis 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | #include 20 | 21 | #define PL_MPEG_IMPLEMENTATION 22 | #include "./original_pl_mpeg.h" 23 | 24 | 25 | int 26 | main(int argc, char *argv[]) { 27 | unsigned frame_rate_code; 28 | unsigned format_ves; 29 | 30 | if (argc != 2) { 31 | fprintf(stderr, "Usage: %s INPUT_FILE\n", argv[0]); 32 | return 1; 33 | } 34 | 35 | plm_t *plm = plm_create_with_filename(argv[1]); 36 | if (!plm) { 37 | printf("Couldn't open file %s\n", argv[1]); 38 | return 1; 39 | } 40 | 41 | format_ves = 0; 42 | 43 | plm_set_audio_enabled(plm, FALSE); 44 | if (!plm->video_decoder) { 45 | format_ves = 1; 46 | if (plm->audio_decoder) { 47 | plm_audio_destroy(plm->audio_decoder); 48 | plm->audio_decoder = NULL; 49 | } 50 | plm_demux_rewind(plm->demux); 51 | plm->has_decoders = TRUE; 52 | plm->video_packet_type = PLM_DEMUX_PACKET_VIDEO_1; 53 | if (plm->video_decoder) plm_video_destroy(plm->video_decoder); 54 | plm->video_decoder = plm_video_create_with_buffer(plm->demux->buffer, FALSE); 55 | } 56 | plm_rewind(plm); 57 | 58 | if (plm_buffer_find_start_code(plm->video_decoder->buffer, PLM_START_SEQUENCE) == -1) { 59 | printf("Error likely not an MPEG-1 video!\n"); 60 | plm_destroy(plm); 61 | return 1; 62 | } 63 | 64 | plm_buffer_skip(plm->video_decoder->buffer, 12); //skip width 65 | plm_buffer_skip(plm->video_decoder->buffer, 12); //skip height 66 | plm_buffer_skip(plm->video_decoder->buffer, 4); //skip PAR 67 | frame_rate_code = plm_buffer_read(plm->video_decoder->buffer, 4); 68 | 69 | plm_destroy(plm); 70 | 71 | if (frame_rate_code & 0x8) { 72 | printf("Magical MPEG-1 %s asset detected. Frame rate code=0x%X\n", format_ves ? "ES" : "PS", frame_rate_code); 73 | return 0; 74 | } 75 | else if (frame_rate_code == 0) { 76 | printf("Bad MPEG-1 %s asset detected. Frame rate code=0x%X\n", format_ves ? "ES" : "PS", frame_rate_code); 77 | } 78 | else { 79 | printf("Normal MPEG-1 %s asset detected. Frame rate code=0x%X\n", format_ves ? "ES" : "PS", frame_rate_code); 80 | } 81 | 82 | return 1; 83 | } 84 | -------------------------------------------------------------------------------- /tools/superanalyze_mpeg_ps_f_code.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | 3 | ## Copyright (C) 2022 Jon Dennis 4 | ## 5 | ## This program is free software; you can redistribute it and/or modify 6 | ## it under the terms of the GNU General Public License as published by 7 | ## the Free Software Foundation; either version 2 of the License, or 8 | ## (at your option) any later version. 9 | ## 10 | ## This program is distributed in the hope that it will be useful, 11 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | ## GNU General Public License for more details. 14 | ## 15 | ## You should have received a copy of the GNU General Public License 16 | ## along with this program; if not, write to the Free Software 17 | ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | 20 | 21 | use strict; 22 | use FindBin; 23 | use IPC::Open2; 24 | 25 | 26 | my $filename = shift; 27 | die unless $filename; 28 | 29 | my $target_f_code = shift; 30 | $target_f_code += 0; 31 | 32 | my $sa_pid = open2(my $sa_stdout, my $sa_stdin, 33 | $FindBin::Bin . '/superanalyze_mpeg_ps', $filename); 34 | die unless $sa_pid; 35 | close($sa_stdin); 36 | 37 | my $current_picture_is_target = 0; 38 | my $gop_index = 0; 39 | my $picture_type = 'I'; 40 | my $picture_index = 0; 41 | my $picture_gop_index = 0; 42 | my $forward_f_code = 1; 43 | my $backward_f_code = 1; 44 | my $backward_f_code = 1; 45 | my $temporal_seqnum = 0; 46 | 47 | while (<$sa_stdout>) { 48 | if (/^\s*GOP #(\d+)/) { 49 | $gop_index = $1 + 0; 50 | $picture_gop_index = -1; 51 | next; 52 | } 53 | if (/^\s*(\w) Picture #(\d+)/) { 54 | ($picture_type, $picture_index) = ($1, $2 + 0); 55 | ++$picture_gop_index; 56 | $current_picture_is_target = is_target_picture(); 57 | next; 58 | } 59 | next unless $current_picture_is_target; 60 | if (/^\s*-\s*Forward F Code: (\d+)/) { 61 | $forward_f_code = $1 + 0; 62 | next; 63 | } 64 | if (/^\s*-\s*Backward F Code: (\d+)/) { 65 | $backward_f_code = $1 + 0; 66 | next; 67 | } 68 | if (/^\s*-\s*Temporal Sequence Number: (\d+)/) { 69 | $temporal_seqnum = $1 + 0; 70 | next; 71 | } 72 | if (/^\s*-\s*VBV Delay/) { #VBV delay is last 73 | my $bfcode = ($picture_type eq 'B') ? "bfcode=$backward_f_code" : ''; 74 | printf "tsn=%02u ffcode=$forward_f_code $bfcode", $temporal_seqnum; 75 | print_delta(); 76 | print "\n"; 77 | next; 78 | } 79 | } 80 | 81 | 82 | wait; 83 | 84 | 85 | sub is_target_picture { 86 | return 0 if $picture_type eq 'I'; 87 | return 1; 88 | } 89 | 90 | sub print_delta { 91 | return unless $target_f_code; 92 | 93 | if (abs($target_f_code - $forward_f_code) < abs($forward_f_code - $target_f_code)) { 94 | print ' delta=' . ($forward_f_code - $target_f_code); 95 | } 96 | else { 97 | print ' delta=' . ($target_f_code - $forward_f_code); 98 | } 99 | } 100 | 101 | ## my @sum_codes = ( 102 | ## -1, # tsn=0 103 | ## -2, # tsn=1 104 | ## +1, # tsn=2 105 | ## 0, # tsn=3 106 | ## +2, # tsn=4 107 | ## +1, # tsn=5 108 | ## -3, # tsn=6 109 | ## +3, # tsn=7 110 | ## 0, # tsn=8 111 | ## -1, # tsn=9 112 | ## +2, # tsn=10 113 | ## +1, # tsn=11 114 | ## +3, # tsn=12 115 | ## +2, # tsn=13 116 | ## -2, # tsn=14 117 | ## ); 118 | 119 | -------------------------------------------------------------------------------- /tools/wincompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Jon Dennis 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | */ 18 | 19 | 20 | #define __USE_MINGW_ANSI_STDIO 1 21 | 22 | #define bzero(PTR, SIZE) memset(PTR, 0, SIZE) 23 | 24 | #include 25 | #include 26 | 27 | /* from stackoverflow: https://stackoverflow.com/questions/52988769/writing-own-memmem-for-windows */ 28 | static inline void * 29 | memmem(void *haystack, size_t haystack_len, 30 | const void * const needle, const size_t needle_len) 31 | { 32 | if (haystack == NULL) return NULL; // or assert(haystack != NULL); 33 | if (haystack_len == 0) return NULL; 34 | if (needle == NULL) return NULL; // or assert(needle != NULL); 35 | if (needle_len == 0) return NULL; 36 | 37 | for (char *h = haystack; 38 | haystack_len >= needle_len; 39 | ++h, --haystack_len) { 40 | if (!memcmp(h, needle, needle_len)) { 41 | return h; 42 | } 43 | } 44 | return NULL; 45 | } 46 | 47 | --------------------------------------------------------------------------------