├── VERSION ├── Makefile ├── scripts ├── resetconf.bat ├── resetmapper.bat ├── captures.bat ├── dosbox-installer.nsi ├── editconf.bat ├── font-switch.pl └── ega-switch.pl ├── include ├── SDL_net.h ├── SDL_thread.h ├── Makefile.am ├── debug.h ├── mouse.h ├── timer.h ├── mapper.h ├── joystick.h ├── SDL.h ├── ipxserver.h ├── midi.h ├── support.h ├── hardware.h ├── pic.h ├── keyboard.h ├── dosbox.h ├── pci_bus.h ├── video.h ├── inout.h ├── control.h ├── bios_disk.h ├── render.h ├── logging.h ├── programs.h ├── dma.h ├── cross.h ├── callback.h ├── fpu.h └── mixer.h ├── src ├── libs │ ├── zmbv │ │ ├── Makefile.am │ │ ├── zmbv.def │ │ ├── resource.h │ │ ├── zmbv.sln │ │ ├── zmbv_vfw.h │ │ ├── zmbv_vfw.rc │ │ ├── zmbv.h │ │ └── zmbv.vcproj │ ├── Makefile.am │ └── gui_tk │ │ └── Makefile.am ├── platform │ ├── Makefile.am │ ├── visualc │ │ ├── Makefile.am │ │ ├── unistd.h │ │ └── config.h │ └── sdl-win32.diff ├── cpu │ ├── cpu.o │ ├── flags.o │ ├── modrm.o │ ├── paging.o │ ├── callback.o │ ├── core_full.o │ ├── core_dynrec.o │ ├── core_normal.o │ ├── core_simple.o │ ├── core_dyn_x86.o │ ├── core_prefetch.o │ ├── core_full │ │ ├── Makefile.am │ │ ├── loadwrite.h │ │ └── save.h │ ├── core_dyn_x86 │ │ ├── Makefile.am │ │ └── helpers.h │ ├── core_normal │ │ ├── Makefile.am │ │ └── support.h │ ├── core_dynrec │ │ ├── Makefile.am │ │ ├── risc_armv4le.h │ │ └── risc_armv4le-common.h │ ├── Makefile.am │ ├── modrm.h │ ├── core_full.cpp │ └── lazyflags.h ├── dos │ ├── dos.o │ ├── cdrom.o │ ├── drives.o │ ├── dos_files.o │ ├── dos_ioctl.o │ ├── dos_misc.o │ ├── drive_fat.o │ ├── drive_iso.o │ ├── cdrom_image.o │ ├── dos_classes.o │ ├── dos_devices.o │ ├── dos_execute.o │ ├── dos_memory.o │ ├── dos_mscdex.o │ ├── dos_tables.o │ ├── drive_cache.o │ ├── drive_local.o │ ├── dos_programs.o │ ├── drive_virtual.o │ ├── dos_keyboard_layout.o │ ├── Makefile.am │ └── cdrom_ioctl_linux.cpp ├── dosbox.ico ├── fpu │ ├── fpu.o │ └── Makefile.am ├── gui │ ├── midi.o │ ├── Makefile.am │ ├── midi_oss.h │ ├── render_templates_hq.h │ ├── midi_win32.h │ └── midi_coremidi.h ├── ints │ ├── ems.o │ ├── xms.o │ ├── bios.o │ ├── int10.o │ ├── mouse.o │ ├── bios_disk.o │ ├── int10_char.o │ ├── int10_misc.o │ ├── int10_pal.o │ ├── int10_vesa.o │ ├── bios_keyboard.o │ ├── int10_memory.o │ ├── int10_modes.o │ ├── int10_vptable.o │ ├── int10_put_pixel.o │ ├── int10_video_state.o │ ├── Makefile.am │ └── xms.h ├── winres.rc ├── misc │ ├── cross.o │ ├── setup.o │ ├── messages.o │ ├── programs.o │ ├── support.o │ └── Makefile.am ├── hardware │ ├── cmos.o │ ├── dma.o │ ├── gus.o │ ├── ipx.o │ ├── pic.o │ ├── vga.o │ ├── adlib.o │ ├── dbopl.o │ ├── disney.o │ ├── memory.o │ ├── mpu401.o │ ├── timer.o │ ├── vga_s3.o │ ├── hardware.o │ ├── iohandler.o │ ├── ipxserver.o │ ├── joystick.o │ ├── keyboard.o │ ├── pci_bus.o │ ├── pcspeaker.o │ ├── sblaster.o │ ├── vga_attr.o │ ├── vga_crtc.o │ ├── vga_dac.o │ ├── vga_draw.o │ ├── vga_gfx.o │ ├── vga_misc.o │ ├── vga_other.o │ ├── vga_seq.o │ ├── vga_tseng.o │ ├── vga_xga.o │ ├── gameblaster.o │ ├── tandy_sound.o │ ├── vga_memory.o │ ├── vga_paradise.o │ ├── serialport │ │ ├── libserial.o │ │ ├── misc_util.o │ │ ├── nullmodem.o │ │ ├── serialport.o │ │ ├── softmodem.o │ │ ├── directserial.o │ │ ├── serialdummy.o │ │ ├── Makefile.am │ │ ├── serialdummy.h │ │ ├── libserial.h │ │ ├── directserial.h │ │ ├── misc_util.h │ │ ├── serialdummy.cpp │ │ └── nullmodem.h │ ├── Makefile.am │ └── pci_devices.h ├── shell │ ├── shell.o │ ├── shell_batch.o │ ├── shell_cmds.o │ ├── shell_misc.o │ └── Makefile.am ├── debug │ ├── Makefile.am │ ├── debug_inc.h │ └── debug_win32.cpp └── Makefile.am ├── visualc_net ├── Makefile.am └── dosbox.sln ├── jni ├── Application.mk └── Android.mk ├── libretro ├── link.T ├── dos_gfx.o ├── dosbox.o ├── libretro.o ├── mapper.o ├── render.o ├── mixer-retro.o ├── render_scalers.o ├── dos_gfx.cpp ├── render_scalers.h └── retrodos.h ├── THANKS ├── AUTHORS ├── libco ├── libco.o ├── libco.h ├── libco.c ├── fiber.c ├── ucontext.c ├── armeabi.c ├── sjlj.c └── x86.c ├── Makefile.am ├── docs ├── Makefile.am ├── README.video └── PORTING ├── autogen.sh └── README /VERSION: -------------------------------------------------------------------------------- 1 | 0.74 2 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | include Makefile.libretro 2 | -------------------------------------------------------------------------------- /scripts/resetconf.bat: -------------------------------------------------------------------------------- 1 | DOSBox.exe -resetconf -------------------------------------------------------------------------------- /include/SDL_net.h: -------------------------------------------------------------------------------- 1 | // INTENTIONALLY BLANK 2 | -------------------------------------------------------------------------------- /include/SDL_thread.h: -------------------------------------------------------------------------------- 1 | // INTENTIONALLY BLANK 2 | -------------------------------------------------------------------------------- /scripts/resetmapper.bat: -------------------------------------------------------------------------------- 1 | DOSBox.exe -resetmapper -------------------------------------------------------------------------------- /scripts/captures.bat: -------------------------------------------------------------------------------- 1 | DOSBox.exe -opencaptures explorer.exe -------------------------------------------------------------------------------- /src/libs/zmbv/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = zmbv.cpp zmbv.h 2 | -------------------------------------------------------------------------------- /visualc_net/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = dosbox.sln dosbox.vcproj -------------------------------------------------------------------------------- /jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_STL := gnustl_static 2 | APP_ABI := all 3 | -------------------------------------------------------------------------------- /libretro/link.T: -------------------------------------------------------------------------------- 1 | { 2 | global: retro_*; 3 | local: *; 4 | }; 5 | 6 | -------------------------------------------------------------------------------- /src/platform/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = visualc 2 | 3 | EXTRA_DIST = sdl-win32.diff -------------------------------------------------------------------------------- /THANKS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/THANKS -------------------------------------------------------------------------------- /src/libs/zmbv/zmbv.def: -------------------------------------------------------------------------------- 1 | LIBRARY ZMBV 2 | 3 | EXPORTS 4 | DriverProc 5 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/AUTHORS -------------------------------------------------------------------------------- /src/libs/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | SUBDIRS = zmbv gui_tk 4 | -------------------------------------------------------------------------------- /src/platform/visualc/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = unistd.h config.h ntddscsi.h ntddcdrm.h 2 | -------------------------------------------------------------------------------- /libco/libco.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/libco/libco.o -------------------------------------------------------------------------------- /src/cpu/cpu.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/cpu/cpu.o -------------------------------------------------------------------------------- /src/dos/dos.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/dos.o -------------------------------------------------------------------------------- /src/dosbox.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dosbox.ico -------------------------------------------------------------------------------- /src/fpu/fpu.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/fpu/fpu.o -------------------------------------------------------------------------------- /src/gui/midi.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/gui/midi.o -------------------------------------------------------------------------------- /src/ints/ems.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/ems.o -------------------------------------------------------------------------------- /src/ints/xms.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/xms.o -------------------------------------------------------------------------------- /src/winres.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/winres.rc -------------------------------------------------------------------------------- /src/cpu/flags.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/cpu/flags.o -------------------------------------------------------------------------------- /src/cpu/modrm.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/cpu/modrm.o -------------------------------------------------------------------------------- /src/cpu/paging.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/cpu/paging.o -------------------------------------------------------------------------------- /src/dos/cdrom.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/cdrom.o -------------------------------------------------------------------------------- /src/dos/drives.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/drives.o -------------------------------------------------------------------------------- /src/ints/bios.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/bios.o -------------------------------------------------------------------------------- /src/ints/int10.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/int10.o -------------------------------------------------------------------------------- /src/ints/mouse.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/mouse.o -------------------------------------------------------------------------------- /src/misc/cross.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/misc/cross.o -------------------------------------------------------------------------------- /src/misc/setup.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/misc/setup.o -------------------------------------------------------------------------------- /libretro/dos_gfx.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/libretro/dos_gfx.o -------------------------------------------------------------------------------- /libretro/dosbox.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/libretro/dosbox.o -------------------------------------------------------------------------------- /libretro/libretro.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/libretro/libretro.o -------------------------------------------------------------------------------- /libretro/mapper.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/libretro/mapper.o -------------------------------------------------------------------------------- /libretro/render.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/libretro/render.o -------------------------------------------------------------------------------- /src/cpu/callback.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/cpu/callback.o -------------------------------------------------------------------------------- /src/cpu/core_full.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/cpu/core_full.o -------------------------------------------------------------------------------- /src/dos/dos_files.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/dos_files.o -------------------------------------------------------------------------------- /src/dos/dos_ioctl.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/dos_ioctl.o -------------------------------------------------------------------------------- /src/dos/dos_misc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/dos_misc.o -------------------------------------------------------------------------------- /src/dos/drive_fat.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/drive_fat.o -------------------------------------------------------------------------------- /src/dos/drive_iso.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/drive_iso.o -------------------------------------------------------------------------------- /src/hardware/cmos.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/cmos.o -------------------------------------------------------------------------------- /src/hardware/dma.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/dma.o -------------------------------------------------------------------------------- /src/hardware/gus.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/gus.o -------------------------------------------------------------------------------- /src/hardware/ipx.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/ipx.o -------------------------------------------------------------------------------- /src/hardware/pic.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/pic.o -------------------------------------------------------------------------------- /src/hardware/vga.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga.o -------------------------------------------------------------------------------- /src/misc/messages.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/misc/messages.o -------------------------------------------------------------------------------- /src/misc/programs.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/misc/programs.o -------------------------------------------------------------------------------- /src/misc/support.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/misc/support.o -------------------------------------------------------------------------------- /src/shell/shell.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/shell/shell.o -------------------------------------------------------------------------------- /src/cpu/core_dynrec.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/cpu/core_dynrec.o -------------------------------------------------------------------------------- /src/cpu/core_normal.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/cpu/core_normal.o -------------------------------------------------------------------------------- /src/cpu/core_simple.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/cpu/core_simple.o -------------------------------------------------------------------------------- /src/dos/cdrom_image.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/cdrom_image.o -------------------------------------------------------------------------------- /src/dos/dos_classes.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/dos_classes.o -------------------------------------------------------------------------------- /src/dos/dos_devices.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/dos_devices.o -------------------------------------------------------------------------------- /src/dos/dos_execute.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/dos_execute.o -------------------------------------------------------------------------------- /src/dos/dos_memory.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/dos_memory.o -------------------------------------------------------------------------------- /src/dos/dos_mscdex.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/dos_mscdex.o -------------------------------------------------------------------------------- /src/dos/dos_tables.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/dos_tables.o -------------------------------------------------------------------------------- /src/dos/drive_cache.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/drive_cache.o -------------------------------------------------------------------------------- /src/dos/drive_local.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/drive_local.o -------------------------------------------------------------------------------- /src/hardware/adlib.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/adlib.o -------------------------------------------------------------------------------- /src/hardware/dbopl.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/dbopl.o -------------------------------------------------------------------------------- /src/hardware/disney.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/disney.o -------------------------------------------------------------------------------- /src/hardware/memory.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/memory.o -------------------------------------------------------------------------------- /src/hardware/mpu401.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/mpu401.o -------------------------------------------------------------------------------- /src/hardware/timer.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/timer.o -------------------------------------------------------------------------------- /src/hardware/vga_s3.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga_s3.o -------------------------------------------------------------------------------- /src/ints/bios_disk.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/bios_disk.o -------------------------------------------------------------------------------- /src/ints/int10_char.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/int10_char.o -------------------------------------------------------------------------------- /src/ints/int10_misc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/int10_misc.o -------------------------------------------------------------------------------- /src/ints/int10_pal.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/int10_pal.o -------------------------------------------------------------------------------- /src/ints/int10_vesa.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/int10_vesa.o -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # Main Makefile for DOSBox 2 | 3 | EXTRA_DIST = autogen.sh 4 | SUBDIRS = src include docs visualc_net 5 | -------------------------------------------------------------------------------- /libretro/mixer-retro.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/libretro/mixer-retro.o -------------------------------------------------------------------------------- /src/cpu/core_dyn_x86.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/cpu/core_dyn_x86.o -------------------------------------------------------------------------------- /src/cpu/core_prefetch.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/cpu/core_prefetch.o -------------------------------------------------------------------------------- /src/dos/dos_programs.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/dos_programs.o -------------------------------------------------------------------------------- /src/dos/drive_virtual.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/drive_virtual.o -------------------------------------------------------------------------------- /src/hardware/hardware.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/hardware.o -------------------------------------------------------------------------------- /src/hardware/iohandler.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/iohandler.o -------------------------------------------------------------------------------- /src/hardware/ipxserver.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/ipxserver.o -------------------------------------------------------------------------------- /src/hardware/joystick.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/joystick.o -------------------------------------------------------------------------------- /src/hardware/keyboard.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/keyboard.o -------------------------------------------------------------------------------- /src/hardware/pci_bus.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/pci_bus.o -------------------------------------------------------------------------------- /src/hardware/pcspeaker.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/pcspeaker.o -------------------------------------------------------------------------------- /src/hardware/sblaster.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/sblaster.o -------------------------------------------------------------------------------- /src/hardware/vga_attr.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga_attr.o -------------------------------------------------------------------------------- /src/hardware/vga_crtc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga_crtc.o -------------------------------------------------------------------------------- /src/hardware/vga_dac.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga_dac.o -------------------------------------------------------------------------------- /src/hardware/vga_draw.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga_draw.o -------------------------------------------------------------------------------- /src/hardware/vga_gfx.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga_gfx.o -------------------------------------------------------------------------------- /src/hardware/vga_misc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga_misc.o -------------------------------------------------------------------------------- /src/hardware/vga_other.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga_other.o -------------------------------------------------------------------------------- /src/hardware/vga_seq.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga_seq.o -------------------------------------------------------------------------------- /src/hardware/vga_tseng.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga_tseng.o -------------------------------------------------------------------------------- /src/hardware/vga_xga.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga_xga.o -------------------------------------------------------------------------------- /src/ints/bios_keyboard.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/bios_keyboard.o -------------------------------------------------------------------------------- /src/ints/int10_memory.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/int10_memory.o -------------------------------------------------------------------------------- /src/ints/int10_modes.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/int10_modes.o -------------------------------------------------------------------------------- /src/ints/int10_vptable.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/int10_vptable.o -------------------------------------------------------------------------------- /src/shell/shell_batch.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/shell/shell_batch.o -------------------------------------------------------------------------------- /src/shell/shell_cmds.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/shell/shell_cmds.o -------------------------------------------------------------------------------- /src/shell/shell_misc.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/shell/shell_misc.o -------------------------------------------------------------------------------- /libretro/render_scalers.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/libretro/render_scalers.o -------------------------------------------------------------------------------- /src/hardware/gameblaster.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/gameblaster.o -------------------------------------------------------------------------------- /src/hardware/tandy_sound.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/tandy_sound.o -------------------------------------------------------------------------------- /src/hardware/vga_memory.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga_memory.o -------------------------------------------------------------------------------- /src/ints/int10_put_pixel.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/int10_put_pixel.o -------------------------------------------------------------------------------- /scripts/dosbox-installer.nsi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/scripts/dosbox-installer.nsi -------------------------------------------------------------------------------- /scripts/editconf.bat: -------------------------------------------------------------------------------- 1 | DOSBox.exe -editconf notepad.exe -editconf %SystemRoot%\system32\notepad.exe -editconf %WINDIR%\notepad.exe -------------------------------------------------------------------------------- /src/dos/dos_keyboard_layout.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/dos/dos_keyboard_layout.o -------------------------------------------------------------------------------- /src/hardware/vga_paradise.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/vga_paradise.o -------------------------------------------------------------------------------- /src/ints/int10_video_state.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/ints/int10_video_state.o -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /src/hardware/serialport/libserial.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/serialport/libserial.o -------------------------------------------------------------------------------- /src/hardware/serialport/misc_util.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/serialport/misc_util.o -------------------------------------------------------------------------------- /src/hardware/serialport/nullmodem.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/serialport/nullmodem.o -------------------------------------------------------------------------------- /src/hardware/serialport/serialport.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/serialport/serialport.o -------------------------------------------------------------------------------- /src/hardware/serialport/softmodem.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/serialport/softmodem.o -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/hardware/serialport/directserial.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/serialport/directserial.o -------------------------------------------------------------------------------- /src/hardware/serialport/serialdummy.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shutterbug2000/dosbox-libretro-3ds/HEAD/src/hardware/serialport/serialdummy.o -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-o3.h risc_armv4le-thumb.h \ 5 | risc_armv4le-thumb-iw.h risc_armv4le-thumb-niw.h 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /scripts/font-switch.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use integer; 3 | open (THEFILE,'>','../src/hardware/font-switch.h') 4 | or die "Can't open my file $!"; 5 | 6 | print THEFILE "switch (bit_mask) {\n"; 7 | for ($i = 0; $i < 256; $i++) { 8 | print THEFILE "\tcase $i:\n"; 9 | $b=128; 10 | $add=0; 11 | do { 12 | if ($i & $b) { 13 | print THEFILE "\t\t*(draw+$add)=fg;\n"; 14 | } else { 15 | print THEFILE "\t\t*(draw+$add)=bg;\n"; 16 | } 17 | $b=$b >> 1; 18 | $add=$add+1; 19 | } until ($b == 0); 20 | print THEFILE "\tbreak;\n"; 21 | } 22 | print THEFILE "}\n"; 23 | 24 | 25 | close (THEFILE); 26 | -------------------------------------------------------------------------------- /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/serialport/libserial.a libs/gui_tk/libgui_tk.a 17 | 18 | EXTRA_DIST = winres.rc dosbox.ico 19 | 20 | 21 | -------------------------------------------------------------------------------- /libco/libco.h: -------------------------------------------------------------------------------- 1 | /* 2 | libco 3 | version: 0.16 (2010-12-24) 4 | license: public domain 5 | */ 6 | 7 | #ifndef LIBCO_H 8 | #define LIBCO_H 9 | 10 | #ifdef LIBCO_C 11 | #ifdef LIBCO_MP 12 | #define thread_local __thread 13 | #else 14 | #define thread_local 15 | #endif 16 | #endif 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | typedef void* cothread_t; 23 | 24 | cothread_t co_active(); 25 | cothread_t co_create(unsigned int, void (*)(void)); 26 | void co_delete(cothread_t); 27 | void co_switch(cothread_t); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | 33 | /* ifndef LIBCO_H */ 34 | #endif 35 | -------------------------------------------------------------------------------- /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 | midi.h \ 24 | mixer.h \ 25 | modules.h \ 26 | mouse.h \ 27 | paging.h \ 28 | pci_bus.h \ 29 | pic.h \ 30 | programs.h \ 31 | render.h \ 32 | regs.h \ 33 | render.h \ 34 | serialport.h \ 35 | setup.h \ 36 | shell.h \ 37 | support.h \ 38 | timer.h \ 39 | vga.h \ 40 | video.h 41 | 42 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libco/libco.c: -------------------------------------------------------------------------------- 1 | /* 2 | libco 3 | auto-selection module 4 | license: public domain 5 | */ 6 | 7 | #if defined(__GNUC__) && defined(__i386__) || (defined(_MSC_VER) && defined(_M_IX86)) 8 | #include "x86.c" 9 | #elif defined(__GNUC__) && defined(__amd64__) || (defined(_MSC_VER) && defined(_M_AMD64)) 10 | #include "amd64.c" 11 | #elif defined(__GNUC__) && defined(_ARCH_PPC) 12 | #include "ppc.c" 13 | #elif defined(__GNUC__) && (defined(__ARM_EABI__) || defined(__arm__)) 14 | #include "armeabi.c" 15 | #elif defined(__GNUC__) 16 | #include "sjlj.c" 17 | #elif defined(_MSC_VER) 18 | #include "fiber.c" 19 | #else 20 | #error "libco: unsupported processor, compiler or operating system" 21 | #endif 22 | -------------------------------------------------------------------------------- /src/hardware/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CPPFLAGS = -I$(top_srcdir)/include 2 | 3 | SUBDIRS = serialport 4 | 5 | EXTRA_DIST = opl.cpp opl.h adlib.h dbopl.h pci_devices.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 pci_bus.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 | 15 | 16 | -------------------------------------------------------------------------------- /src/libs/zmbv/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by zmbv_vfw.rc 4 | // 5 | #define IDD_ABOUT 101 6 | #define IDD_CONFIGURE 102 7 | #define IDC_HOMEPAGE 1000 8 | #define IDC_EMAIL 1001 9 | #define IDC_SLIDER1 1008 10 | 11 | // Next default values for new objects 12 | // 13 | #ifdef APSTUDIO_INVOKED 14 | #ifndef APSTUDIO_READONLY_SYMBOLS 15 | #define _APS_NO_MFC 1 16 | #define _APS_NEXT_RESOURCE_VALUE 103 17 | #define _APS_NEXT_COMMAND_VALUE 40001 18 | #define _APS_NEXT_CONTROL_VALUE 1009 19 | #define _APS_NEXT_SYMED_VALUE 101 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /src/hardware/pci_devices.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | -------------------------------------------------------------------------------- /scripts/ega-switch.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | use integer; 3 | open (THEFILE,'>','../src/hardware/ega-switch.h') 4 | or die "Can't open my file $!"; 5 | 6 | print THEFILE "switch (bit_mask) {\n"; 7 | for ($i = 0; $i < 256; $i++) { 8 | print THEFILE "\tcase $i:\n"; 9 | $b=128; 10 | $add=0; 11 | do { 12 | if ($i & $b) { 13 | print THEFILE "\t{\n"; 14 | print THEFILE "\t\tBit8u color=0;\n"; 15 | print THEFILE "\t\tif (pixels.b[0] & $b) color|=1;\n"; 16 | print THEFILE "\t\tif (pixels.b[1] & $b) color|=2;\n"; 17 | print THEFILE "\t\tif (pixels.b[2] & $b) color|=4;\n"; 18 | print THEFILE "\t\tif (pixels.b[3] & $b) color|=8;\n"; 19 | print THEFILE "\t\t*(write_pixels+$add)=color;\n"; 20 | print THEFILE "\t\t*(write_pixels+$add+512*1024)=color;\n"; 21 | print THEFILE "\t}\n"; 22 | } 23 | 24 | $b=$b >> 1; 25 | $add=$add+1; 26 | } until ($b == 0); 27 | print THEFILE "\tbreak;\n"; 28 | } 29 | print THEFILE "}\n"; 30 | 31 | 32 | close (THEFILE); 33 | -------------------------------------------------------------------------------- /src/libs/zmbv/zmbv.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zmbv", "zmbv.vcproj", "{619CF3F9-C373-4BD5-93DA-025F5E16F8FA}" 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 | {619CF3F9-C373-4BD5-93DA-025F5E16F8FA}.Debug.ActiveCfg = Debug|Win32 13 | {619CF3F9-C373-4BD5-93DA-025F5E16F8FA}.Debug.Build.0 = Debug|Win32 14 | {619CF3F9-C373-4BD5-93DA-025F5E16F8FA}.Release.ActiveCfg = Release|Win32 15 | {619CF3F9-C373-4BD5-93DA-025F5E16F8FA}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | 3 | include $(CLEAR_VARS) 4 | 5 | LOCAL_MODULE := retro 6 | CPU_ARCH := 7 | 8 | ifeq ($(TARGET_ARCH),arm) 9 | LOCAL_CFLAGS += -DANDROID_ARM 10 | LOCAL_ARM_MODE := arm 11 | endif 12 | 13 | ifeq ($(TARGET_ARCH),x86) 14 | LOCAL_CFLAGS += -DANDROID_X86 15 | endif 16 | 17 | ifeq ($(TARGET_ARCH),mips) 18 | LOCAL_CFLAGS += -DANDROID_MIPS -D__mips__ -D__MIPSEL__ 19 | endif 20 | 21 | CORE_DIR := .. 22 | 23 | SOURCES_C := 24 | SOURCES_ASM := 25 | 26 | ifeq ($(HAVE_DYNAREC),1) 27 | LOCAL_CFLAGS += -DHAVE_DYNAREC 28 | endif 29 | 30 | ifeq ($(CPU_ARCH),arm) 31 | LOCAL_CFLAGS += -DARM_ARCH 32 | endif 33 | 34 | ifeq ($(DEBUG),1) 35 | APP_OPTIM := -O0 -g 36 | else 37 | APP_OPTIM := -O2 -DNDEBUG 38 | endif 39 | 40 | include $(CORE_DIR)/Makefile.common 41 | 42 | LOCAL_SRC_FILES := $(SOURCES_C) $(SOURCES_CXX) $(SOURCES_ASM) 43 | LOCAL_CFLAGS += $(APP_OPTIM) -D__LIBRETRO__ -DFRONTEND_SUPPORTS_RGB565 $(INCFLAGS) 44 | LOCAL_CPP_FEATURES += rtti exceptions 45 | 46 | include $(BUILD_SHARED_LIBRARY) 47 | -------------------------------------------------------------------------------- /libco/fiber.c: -------------------------------------------------------------------------------- 1 | /* 2 | libco.win (2008-01-28) 3 | authors: Nach, byuu 4 | license: public domain 5 | */ 6 | 7 | #define LIBCO_C 8 | #include 9 | #define WINVER 0x0400 10 | #define _WIN32_WINNT 0x0400 11 | #define WIN32_LEAN_AND_MEAN 12 | #include 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | static thread_local cothread_t co_active_ = 0; 19 | 20 | static void __stdcall co_thunk(void *coentry) 21 | { 22 | ((void (*)(void))coentry)(); 23 | } 24 | 25 | cothread_t co_active(void) 26 | { 27 | if(!co_active_) 28 | { 29 | ConvertThreadToFiber(0); 30 | co_active_ = GetCurrentFiber(); 31 | } 32 | return co_active_; 33 | } 34 | 35 | cothread_t co_create(unsigned int heapsize, void (*coentry)(void)) 36 | { 37 | if(!co_active_) 38 | { 39 | ConvertThreadToFiber(0); 40 | co_active_ = GetCurrentFiber(); 41 | } 42 | return (cothread_t)CreateFiber(heapsize, co_thunk, (void*)coentry); 43 | } 44 | 45 | void co_delete(cothread_t cothread) 46 | { 47 | DeleteFiber(cothread); 48 | } 49 | 50 | void co_switch(cothread_t cothread) 51 | { 52 | co_active_ = cothread; 53 | SwitchToFiber(cothread); 54 | } 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | -------------------------------------------------------------------------------- /src/cpu/core_dynrec/risc_armv4le.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | 21 | /* ARMv4/ARMv7 (little endian) backend (switcher) by M-HT */ 22 | 23 | #include "risc_armv4le-common.h" 24 | 25 | // choose your destiny: 26 | #if C_TARGETCPU == ARMV7LE 27 | #include "risc_armv4le-o3.h" 28 | #else 29 | #if defined(__THUMB_INTERWORK__) 30 | #include "risc_armv4le-thumb-iw.h" 31 | #else 32 | #include "risc_armv4le-o3.h" 33 | // #include "risc_armv4le-thumb-niw.h" 34 | // #include "risc_armv4le-thumb.h" 35 | #endif 36 | #endif 37 | -------------------------------------------------------------------------------- /include/debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | -------------------------------------------------------------------------------- /include/mouse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | 21 | #ifndef DOSBOX_MOUSE_H 22 | #define DOSBOX_MOUSE_H 23 | 24 | 25 | void Mouse_ShowCursor(void); 26 | void Mouse_HideCursor(void); 27 | 28 | bool Mouse_SetPS2State(bool use); 29 | 30 | void Mouse_ChangePS2Callback(Bit16u pseg, Bit16u pofs); 31 | 32 | 33 | void Mouse_CursorMoved(float xrel,float yrel,float x,float y,bool emulate); 34 | void Mouse_CursorSet(float x,float y); 35 | void Mouse_ButtonPressed(Bit8u button); 36 | void Mouse_ButtonReleased(Bit8u button); 37 | 38 | void Mouse_AutoLock(bool enable); 39 | void Mouse_NewVideoMode(void); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/ints/xms.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | -------------------------------------------------------------------------------- /include/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef __LIBRETRO__ // Don't use system version of SDL.h 24 | #include 25 | #else 26 | #include "SDL.h" 27 | #endif 28 | 29 | #define PIT_TICK_RATE 1193182 30 | 31 | #define GetTicks() SDL_GetTicks() 32 | 33 | typedef void (*TIMER_TickHandler)(void); 34 | 35 | /* Register a function that gets called everytime if 1 or more ticks pass */ 36 | void TIMER_AddTickHandler(TIMER_TickHandler handler); 37 | void TIMER_DelTickHandler(TIMER_TickHandler handler); 38 | 39 | /* This will add 1 milliscond to all timers */ 40 | void TIMER_AddTick(void); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/mapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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,MK_home 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 | -------------------------------------------------------------------------------- /include/joystick.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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_JOYSTICK_H 20 | #define DOSBOX_JOYSTICK_H 21 | void JOYSTICK_Enable(Bitu which,bool enabled); 22 | 23 | void JOYSTICK_Button(Bitu which,Bitu num,bool pressed); 24 | 25 | void JOYSTICK_Move_X(Bitu which,float x); 26 | 27 | void JOYSTICK_Move_Y(Bitu which,float y); 28 | 29 | bool JOYSTICK_IsEnabled(Bitu which); 30 | 31 | bool JOYSTICK_GetButton(Bitu which, Bitu num); 32 | 33 | float JOYSTICK_GetMove_X(Bitu which); 34 | 35 | float JOYSTICK_GetMove_Y(Bitu which); 36 | 37 | enum JoystickType { 38 | JOY_NONE, 39 | JOY_AUTO, 40 | JOY_2AXIS, 41 | JOY_4AXIS, 42 | JOY_4AXIS_2, 43 | JOY_FCS, 44 | JOY_CH 45 | }; 46 | 47 | extern JoystickType joytype; 48 | extern bool button_wrapping_enabled; 49 | #endif 50 | -------------------------------------------------------------------------------- /src/hardware/serialport/serialdummy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef INCLUDEGUARD_SERIALDUMMY_H 21 | #define INCLUDEGUARD_SERIALDUMMY_H 22 | 23 | #include "serialport.h" 24 | 25 | //#define CHECKIT_TESTPLUG 26 | 27 | class CSerialDummy : public CSerial { 28 | public: 29 | CSerialDummy(Bitu id, CommandLine* cmd); 30 | ~CSerialDummy(); 31 | 32 | void setRTSDTR(bool rts, bool dtr); 33 | void setRTS(bool val); 34 | void setDTR(bool val); 35 | 36 | void updatePortConfig(Bit16u, Bit8u lcr); 37 | void updateMSR(); 38 | void transmitByte(Bit8u val, bool first); 39 | void setBreak(bool value); 40 | void handleUpperEvent(Bit16u type); 41 | 42 | #ifdef CHECKIT_TESTPLUG 43 | Bit8u loopbackdata; 44 | #endif 45 | 46 | }; 47 | 48 | #endif // INCLUDEGUARD 49 | -------------------------------------------------------------------------------- /include/SDL.h: -------------------------------------------------------------------------------- 1 | #ifndef SDL_FAKE_ 2 | #define SDL_FAKE_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | typedef uint8_t Uint8; 10 | typedef uint16_t Uint16; 11 | typedef uint32_t Uint32; 12 | 13 | // This is used in src/ints/bios_keyboard.cpp as a workaround for caps/num lock on old SDL versions. 14 | #define SDL_VERSION_ATLEAST(...) 0 15 | 16 | // These are 'used' in src/dos/cdrom_image.cpp and src/dos/cdrom_ioctl_win32.cpp. 17 | // Really they are meant to synchronize with an audio thread, but 18 | // that isn't used in libreto so there is no need for these. 19 | typedef int SDL_mutex; 20 | #define SDL_CreateMutex() 0 21 | #define SDL_DestroyMutex(...) 22 | #define SDL_mutexV(...) 23 | #define SDL_mutexP(...) 24 | 25 | // TIMER 26 | inline void SDL_Delay(unsigned x) 27 | { 28 | usleep(x * 1000); 29 | } 30 | 31 | inline unsigned SDL_GetTicks() 32 | { 33 | struct timeval t; 34 | gettimeofday(&t, 0); 35 | 36 | return (t.tv_sec * 1000) + (t.tv_usec / 1000); 37 | } 38 | 39 | // CD 40 | #define SDL_CDNumDrives() 0 41 | #define SDL_CDName(x) "NONE" 42 | struct SDL_CD {int dummy;}; 43 | 44 | /** @name Frames / MSF Conversion Functions 45 | * Conversion functions from frames to Minute/Second/Frames and vice versa 46 | */ 47 | /*@{*/ 48 | #define CD_FPS 75 49 | #define FRAMES_TO_MSF(f, M,S,F) { \ 50 | int value = f; \ 51 | *(F) = value%CD_FPS; \ 52 | value /= CD_FPS; \ 53 | *(S) = value%60; \ 54 | value /= 60; \ 55 | *(M) = value; \ 56 | } 57 | #define MSF_TO_FRAMES(M, S, F) ((M)*60*CD_FPS+(S)*CD_FPS+(F)) 58 | /*@}*/ 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /include/ipxserver.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | -------------------------------------------------------------------------------- /include/midi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef DOSBOX_MIDI_H 21 | #define DOSBOX_MIDI_H 22 | 23 | #ifndef DOSBOX_PROGRAMS_H 24 | #include "programs.h" 25 | #endif 26 | 27 | class MidiHandler { 28 | public: 29 | MidiHandler(); 30 | virtual bool Open(const char * /*conf*/) { return true; }; 31 | virtual void Close(void) {}; 32 | virtual void PlayMsg(Bit8u * /*msg*/) {}; 33 | virtual void PlaySysex(Bit8u * /*sysex*/,Bitu /*len*/) {}; 34 | virtual const char * GetName(void) { return "none"; }; 35 | virtual void ListAll(Program * base) {}; 36 | virtual ~MidiHandler() { }; 37 | MidiHandler * next; 38 | }; 39 | 40 | 41 | #define SYSEX_SIZE 1024 42 | struct DB_Midi { 43 | Bitu status; 44 | Bitu cmd_len; 45 | Bitu cmd_pos; 46 | Bit8u cmd_buf[8]; 47 | Bit8u rt_buf[8]; 48 | struct { 49 | Bit8u buf[SYSEX_SIZE]; 50 | Bitu used; 51 | Bitu delay; 52 | Bit32u start; 53 | } sysex; 54 | bool available; 55 | MidiHandler * handler; 56 | }; 57 | 58 | extern DB_Midi midi; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /libretro/dos_gfx.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "libretro.h" 4 | 5 | #include "dosbox.h" 6 | #include "video.h" 7 | 8 | // GFX 9 | Bit8u RDOSGFXbuffer[1024*768*4]; 10 | Bitu RDOSGFXwidth, RDOSGFXheight, RDOSGFXpitch; 11 | unsigned RDOSGFXcolorMode = RETRO_PIXEL_FORMAT_0RGB1555; 12 | void* RDOSGFXhaveFrame; 13 | static Bitu (*getRGB)(Bit8u red, Bit8u green, Bit8u blue); 14 | 15 | // Color Getters 16 | template 17 | static Bitu getRGB_t(Bit8u red, Bit8u green, Bit8u blue) 18 | { 19 | return ((red >> RLOSS) << R) | ((green >> GLOSS) << G) | ((blue >> BLOSS) << B); 20 | } 21 | 22 | // GFX 23 | Bitu GFX_GetBestMode(Bitu flags) 24 | { 25 | getRGB = &getRGB_t<16, 8, 0, 0, 0, 0>; 26 | return GFX_CAN_32 | GFX_RGBONLY; 27 | } 28 | 29 | Bitu GFX_GetRGB(Bit8u red,Bit8u green,Bit8u blue) 30 | { 31 | return getRGB(red, green, blue); 32 | } 33 | 34 | Bitu GFX_SetSize(Bitu width,Bitu height,Bitu flags,double scalex,double scaley,GFX_CallBack_t cb) 35 | { 36 | memset(RDOSGFXbuffer, 0, sizeof(RDOSGFXbuffer)); 37 | 38 | RDOSGFXwidth = width; 39 | RDOSGFXheight = height; 40 | RDOSGFXpitch = width * 4; 41 | 42 | if(RDOSGFXwidth > 1024 || RDOSGFXheight > 768) 43 | return 0; 44 | 45 | return GFX_GetBestMode(0); 46 | } 47 | 48 | bool GFX_StartUpdate(Bit8u * & pixels,Bitu & pitch) 49 | { 50 | pixels = RDOSGFXbuffer; 51 | pitch = RDOSGFXpitch; 52 | 53 | return true; 54 | } 55 | 56 | void GFX_EndUpdate( const Bit16u *changedLines ) 57 | { 58 | RDOSGFXhaveFrame = RDOSGFXbuffer; 59 | } 60 | 61 | // Stubs 62 | void GFX_SetTitle(Bit32s cycles,Bits frameskip,bool paused){} 63 | void GFX_ShowMsg(char const* format,...){} 64 | void GFX_Events(){} 65 | void GFX_SetPalette(Bitu start,Bitu count,GFX_PalEntry * entries){} 66 | 67 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | libretro wrapper for DOSBox 2 | 3 | * To use you can either load an exe/com/bat file or a *.conf file. 4 | * If loading exe/com/bat the system directory will be searched for a 'dosbox.conf' file to load. If one isn't available default values will be used. This mode is equivalent to running a DOSBox binary with the specified file as the command line argument. 5 | * If loading a conf file DOSBox will be loaded with the options in the config file. This mode is useful if you just want to be dumped at a command prompt, but can also be used to load a game by putting commands in the autoexec section. 6 | * To be useful the frontend will need to have keyboard+mouse support, and all keyboard shortcuts need to be remapped. 7 | 8 | Unsupported features: 9 | 10 | * Physical CD-ROMs, CD images are supported. 11 | * The key mapper, key remapping does not work. 12 | 13 | TODO: 14 | 15 | * Explore more modern options for MIDI synth. Fluidsynth past 1.0.9 needs glib which isn't easy to build in non-standard build environments. 16 | * Joysticks need more testing. Flightsticks types are not implemented yet. 17 | 18 | Building: 19 | 20 | * To enable MIDI you must have fluidsynth 1.09 available. Add WANT_FLUIDSYNTH=1 to the end of the make command. 21 | * You must edit include/config.h to set options for build platform, the supplied version is for 64-bit OSX with latest xcode and clang. 22 | * Build with the command 'make -f Makefile.libretro' 23 | 24 | Notes: 25 | 26 | * There seems to be no trivial way to have the DOSBox core return periodically, so libco is used to enter/exit the emulator loop. This actually works better than one would expect. 27 | * There is no serialization support, it's not supported by DOSBox. 28 | * DOSBox uses 'wall time' for timing, frontend fast forward and slow motion features will have no effect. 29 | * To use MIDI an SF2 soundfont must be specified in the midi->midiconfig option in the config file. 30 | -------------------------------------------------------------------------------- /src/debug/debug_inc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | 22 | #include 23 | #include "mem.h" 24 | 25 | #define PAIR_BLACK_BLUE 1 26 | #define PAIR_BYELLOW_BLACK 2 27 | #define PAIR_GREEN_BLACK 3 28 | #define PAIR_BLACK_GREY 4 29 | #define PAIR_GREY_RED 5 30 | 31 | 32 | void DBGUI_StartUp(void); 33 | 34 | struct DBGBlock { 35 | WINDOW * win_main; /* The Main Window */ 36 | WINDOW * win_reg; /* Register Window */ 37 | WINDOW * win_data; /* Data Output window */ 38 | WINDOW * win_code; /* Disassembly/Debug point Window */ 39 | WINDOW * win_var; /* Variable Window */ 40 | WINDOW * win_out; /* Text Output Window */ 41 | Bit32u active_win; /* Current active window */ 42 | Bit32u input_y; 43 | Bit32u global_mask; /* Current msgmask */ 44 | }; 45 | 46 | 47 | struct DASMLine { 48 | Bit32u pc; 49 | char dasm[80]; 50 | PhysPt ea; 51 | Bit16u easeg; 52 | Bit32u eaoff; 53 | }; 54 | 55 | extern DBGBlock dbg; 56 | 57 | /* Local Debug Stuff */ 58 | Bitu DasmI386(char* buffer, PhysPt pc, Bitu cur_ip, bool bit32); 59 | int DasmLastOperandSize(void); 60 | 61 | -------------------------------------------------------------------------------- /include/support.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef DOSBOX_SUPPORT_H 21 | #define DOSBOX_SUPPORT_H 22 | 23 | #include 24 | #include 25 | #include 26 | #ifndef DOSBOX_DOSBOX_H 27 | #include "dosbox.h" 28 | #endif 29 | 30 | #if defined (_MSC_VER) /* MS Visual C++ */ 31 | #define strcasecmp(a,b) stricmp(a,b) 32 | #define strncasecmp(a,b,n) _strnicmp(a,b,n) 33 | #endif 34 | 35 | #define safe_strncpy(a,b,n) do { strncpy((a),(b),(n)-1); (a)[(n)-1] = 0; } while (0) 36 | 37 | #ifdef HAVE_STRINGS_H 38 | #include 39 | #endif 40 | 41 | void strreplace(char * str,char o,char n); 42 | char *ltrim(char *str); 43 | char *rtrim(char *str); 44 | char *trim(char * str); 45 | char * upcase(char * str); 46 | char * lowcase(char * str); 47 | 48 | bool ScanCMDBool(char * cmd,char const * const check); 49 | char * ScanCMDRemain(char * cmd); 50 | char * StripWord(char *&cmd); 51 | bool IsDecWord(char * word); 52 | bool IsHexWord(char * word); 53 | Bits ConvDecWord(char * word); 54 | Bits ConvHexWord(char * word); 55 | 56 | void upcase(std::string &str); 57 | void lowcase(std::string &str); 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/cpu/modrm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | -------------------------------------------------------------------------------- /src/cpu/core_full/loadwrite.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #define SaveIP() reg_eip=(Bit32u)(inst.cseip-SegBase(cs)); 20 | #define LoadIP() inst.cseip=SegBase(cs)+reg_eip; 21 | #define GetIP() (inst.cseip-SegBase(cs)) 22 | 23 | #define RunException() { \ 24 | CPU_Exception(cpu.exception.which,cpu.exception.error); \ 25 | continue; \ 26 | } 27 | 28 | static INLINE Bit8u the_Fetchb(EAPoint & loc) { 29 | Bit8u temp=LoadMb(loc); 30 | loc+=1; 31 | return temp; 32 | } 33 | 34 | static INLINE Bit16u the_Fetchw(EAPoint & loc) { 35 | Bit16u temp=LoadMw(loc); 36 | loc+=2; 37 | return temp; 38 | } 39 | static INLINE Bit32u the_Fetchd(EAPoint & loc) { 40 | Bit32u temp=LoadMd(loc); 41 | loc+=4; 42 | return temp; 43 | } 44 | 45 | #define Fetchb() the_Fetchb(inst.cseip) 46 | #define Fetchw() the_Fetchw(inst.cseip) 47 | #define Fetchd() the_Fetchd(inst.cseip) 48 | 49 | #define Fetchbs() (Bit8s)the_Fetchb(inst.cseip) 50 | #define Fetchws() (Bit16s)the_Fetchw(inst.cseip) 51 | #define Fetchds() (Bit32s)the_Fetchd(inst.cseip) 52 | 53 | #define Push_16 CPU_Push16 54 | #define Push_32 CPU_Push32 55 | #define Pop_16 CPU_Pop16 56 | #define Pop_32 CPU_Pop32 57 | 58 | -------------------------------------------------------------------------------- /src/hardware/serialport/libserial.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | typedef struct _COMPORT *COMPORT; 21 | 22 | bool SERIAL_open(const char* portname, COMPORT* port); 23 | void SERIAL_close(COMPORT port); 24 | void SERIAL_getErrorString(char* buffer, int length); 25 | 26 | #define SERIAL_1STOP 1 27 | #define SERIAL_2STOP 2 28 | #define SERIAL_15STOP 0 29 | 30 | // parity: n, o, e, m, s 31 | 32 | bool SERIAL_setCommParameters(COMPORT port, 33 | int baudrate, char parity, int stopbits, int length); 34 | 35 | void SERIAL_setDTR(COMPORT port, bool value); 36 | void SERIAL_setRTS(COMPORT port, bool value); 37 | void SERIAL_setBREAK(COMPORT port, bool value); 38 | 39 | #define SERIAL_CTS 0x10 40 | #define SERIAL_DSR 0x20 41 | #define SERIAL_RI 0x40 42 | #define SERIAL_CD 0x80 43 | 44 | int SERIAL_getmodemstatus(COMPORT port); 45 | bool SERIAL_setmodemcontrol(COMPORT port, int flags); 46 | 47 | bool SERIAL_sendchar(COMPORT port, char data); 48 | 49 | // 0-7 char data, higher=flags 50 | #define SERIAL_BREAK_ERR 0x10 51 | #define SERIAL_FRAMING_ERR 0x08 52 | #define SERIAL_PARITY_ERR 0x04 53 | #define SERIAL_OVERRUN_ERR 0x02 54 | 55 | int SERIAL_getextchar(COMPORT port); 56 | -------------------------------------------------------------------------------- /include/hardware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef DOSBOX_HARDWARE_H 21 | #define DOSBOX_HARDWARE_H 22 | 23 | #include 24 | 25 | class Section; 26 | enum OPL_Mode { 27 | OPL_none,OPL_cms,OPL_opl2,OPL_dualopl2,OPL_opl3 28 | }; 29 | #define CAPTURE_WAVE 0x01 30 | #define CAPTURE_OPL 0x02 31 | #define CAPTURE_MIDI 0x04 32 | #define CAPTURE_IMAGE 0x08 33 | #define CAPTURE_VIDEO 0x10 34 | 35 | extern Bitu CaptureState; 36 | 37 | void OPL_Init(Section* sec,OPL_Mode mode); 38 | void CMS_Init(Section* sec); 39 | void OPL_ShutDown(Section* sec); 40 | void CMS_ShutDown(Section* sec); 41 | 42 | bool SB_Get_Address(Bitu& sbaddr, Bitu& sbirq, Bitu& sbdma); 43 | bool TS_Get_Address(Bitu& tsaddr, Bitu& tsirq, Bitu& tsdma); 44 | 45 | extern Bit8u adlib_commandreg; 46 | FILE * OpenCaptureFile(const char * type,const char * ext); 47 | 48 | void CAPTURE_AddWave(Bit32u freq, Bit32u len, Bit16s * data); 49 | #define CAPTURE_FLAG_DBLW 0x1 50 | #define CAPTURE_FLAG_DBLH 0x2 51 | void CAPTURE_AddImage(Bitu width, Bitu height, Bitu bpp, Bitu pitch, Bitu flags, float fps, Bit8u * data, Bit8u * pal); 52 | void CAPTURE_AddMidi(bool sysex, Bitu len, Bit8u * data); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/libs/zmbv/zmbv_vfw.h: -------------------------------------------------------------------------------- 1 | // 2 | // Huffyuv v2.1.1, by Ben Rudiak-Gould. 3 | // http://www.math.berkeley.edu/~benrg/huffyuv.html 4 | // 5 | // This file is copyright 2000 Ben Rudiak-Gould, and distributed under 6 | // the terms of the GNU General Public License, v2 or later. See 7 | // http://www.gnu.org/copyleft/gpl.html. 8 | // 9 | // I edit these files in 10-point Verdana, a proportionally-spaced font. 10 | // You may notice formatting oddities if you use a monospaced font. 11 | // 12 | 13 | 14 | #include 15 | #include 16 | #include 17 | #include "zmbv.h" 18 | #pragma hdrstop 19 | 20 | extern HMODULE hmoduleCodec; 21 | 22 | 23 | // huffyuv.cpp 24 | 25 | class CodecInst { 26 | private: 27 | VideoCodec * codec; 28 | public: 29 | CodecInst(); 30 | ~CodecInst(); 31 | 32 | BOOL QueryAbout(); 33 | DWORD About(HWND hwnd); 34 | 35 | BOOL QueryConfigure(); 36 | DWORD Configure(HWND hwnd); 37 | 38 | DWORD GetState(LPVOID pv, DWORD dwSize); 39 | DWORD SetState(LPVOID pv, DWORD dwSize); 40 | 41 | DWORD GetInfo(ICINFO* icinfo, DWORD dwSize); 42 | 43 | DWORD CompressQuery(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); 44 | DWORD CompressGetFormat(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); 45 | DWORD CompressBegin(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); 46 | DWORD CompressGetSize(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); 47 | DWORD Compress(ICCOMPRESS* icinfo, DWORD dwSize); 48 | DWORD CompressEnd(); 49 | 50 | DWORD DecompressQuery(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); 51 | DWORD DecompressGetFormat(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); 52 | DWORD DecompressBegin(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); 53 | 54 | DWORD Decompress(ICDECOMPRESS* icinfo, DWORD dwSize); 55 | DWORD DecompressGetPalette(LPBITMAPINFOHEADER lpbiIn, LPBITMAPINFOHEADER lpbiOut); 56 | DWORD DecompressEnd(); 57 | }; 58 | 59 | CodecInst* Open(ICOPEN* icinfo); 60 | DWORD Close(CodecInst* pinst); 61 | 62 | -------------------------------------------------------------------------------- /include/pic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | extern Bitu PIC_IRQCheck; 33 | extern Bitu PIC_Ticks; 34 | 35 | static INLINE float PIC_TickIndex(void) { 36 | return (CPU_CycleMax-CPU_CycleLeft-CPU_Cycles)/(float)CPU_CycleMax; 37 | } 38 | 39 | static INLINE Bits PIC_TickIndexND(void) { 40 | return CPU_CycleMax-CPU_CycleLeft-CPU_Cycles; 41 | } 42 | 43 | static INLINE Bits PIC_MakeCycles(double amount) { 44 | return (Bits)(CPU_CycleMax*amount); 45 | } 46 | 47 | static INLINE double PIC_FullIndex(void) { 48 | return PIC_Ticks+(double)PIC_TickIndex(); 49 | } 50 | 51 | void PIC_ActivateIRQ(Bitu irq); 52 | void PIC_DeActivateIRQ(Bitu irq); 53 | 54 | void PIC_runIRQs(void); 55 | bool PIC_RunQueue(void); 56 | 57 | //Delay in milliseconds 58 | void PIC_AddEvent(PIC_EventHandler handler,float delay,Bitu val=0); 59 | void PIC_RemoveEvents(PIC_EventHandler handler); 60 | void PIC_RemoveSpecificEvents(PIC_EventHandler handler, Bitu val); 61 | 62 | void PIC_SetIRQMask(Bitu irq, bool masked); 63 | #endif 64 | -------------------------------------------------------------------------------- /src/hardware/serialport/directserial.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 guard 21 | #ifndef DOSBOX_DIRECTSERIAL_WIN32_H 22 | #define DOSBOX_DIRECTSERIAL_WIN32_H 23 | 24 | #include "dosbox.h" 25 | 26 | #if C_DIRECTSERIAL 27 | 28 | #define DIRECTSERIAL_AVAILIBLE 29 | #include "serialport.h" 30 | 31 | #include "libserial.h" 32 | 33 | class CDirectSerial : public CSerial { 34 | public: 35 | CDirectSerial(Bitu id, CommandLine* cmd); 36 | ~CDirectSerial(); 37 | 38 | void updatePortConfig(Bit16u divider, Bit8u lcr); 39 | void updateMSR(); 40 | void transmitByte(Bit8u val, bool first); 41 | void setBreak(bool value); 42 | 43 | void setRTSDTR(bool rts, bool dtr); 44 | void setRTS(bool val); 45 | void setDTR(bool val); 46 | void handleUpperEvent(Bit16u type); 47 | 48 | private: 49 | COMPORT comport; 50 | 51 | Bitu rx_state; 52 | #define D_RX_IDLE 0 53 | #define D_RX_WAIT 1 54 | #define D_RX_BLOCKED 2 55 | #define D_RX_FASTWAIT 3 56 | 57 | Bitu rx_retry; // counter of retries (every millisecond) 58 | Bitu rx_retry_max; // how many POLL_EVENTS to wait before causing 59 | // an overrun error. 60 | bool doReceive(); 61 | 62 | #if SERIAL_DEBUG 63 | bool dbgmsg_poll_block; 64 | bool dbgmsg_rx_block; 65 | #endif 66 | 67 | }; 68 | 69 | #endif // C_DIRECTSERIAL 70 | #endif // include guard 71 | -------------------------------------------------------------------------------- /libco/ucontext.c: -------------------------------------------------------------------------------- 1 | /* 2 | libco.ucontext (2008-01-28) 3 | author: Nach 4 | license: public domain 5 | */ 6 | 7 | /* 8 | * WARNING: the overhead of POSIX ucontext is very high, 9 | * assembly versions of libco or libco_sjlj should be much faster 10 | * 11 | * This library only exists for two reasons: 12 | * 1 - as an initial test for the viability of a ucontext implementation 13 | * 2 - to demonstrate the power and speed of libco over existing implementations, 14 | * such as pth (which defaults to wrapping ucontext on unix targets) 15 | * 16 | * Use this library only as a *last resort* 17 | */ 18 | 19 | #define LIBCO_C 20 | #include 21 | #include 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | static thread_local ucontext_t co_primary; 29 | static thread_local ucontext_t *co_running = 0; 30 | 31 | cothread_t co_active(void) 32 | { 33 | if (!co_running) 34 | co_running = &co_primary; 35 | return (cothread_t)co_running; 36 | } 37 | 38 | cothread_t co_create(unsigned int heapsize, void (*coentry)(void)) 39 | { 40 | if (!co_running) 41 | co_running = &co_primary; 42 | ucontext_t *thread = (ucontext_t*)malloc(sizeof(ucontext_t)); 43 | 44 | if(thread) 45 | { 46 | if((!getcontext(thread) && !(thread->uc_stack.ss_sp = 0)) && (thread->uc_stack.ss_sp = malloc(heapsize))) 47 | { 48 | thread->uc_link = co_running; 49 | thread->uc_stack.ss_size = heapsize; 50 | makecontext(thread, coentry, 0); 51 | } 52 | else 53 | { 54 | co_delete((cothread_t)thread); 55 | thread = 0; 56 | } 57 | } 58 | return (cothread_t)thread; 59 | } 60 | 61 | void co_delete(cothread_t cothread) 62 | { 63 | if (!cothread) 64 | return; 65 | 66 | if(((ucontext_t*)cothread)->uc_stack.ss_sp) 67 | free(((ucontext_t*)cothread)->uc_stack.ss_sp); 68 | free(cothread); 69 | } 70 | 71 | void co_switch(cothread_t cothread) 72 | { 73 | ucontext_t *old_thread = co_running; 74 | 75 | co_running = (ucontext_t*)cothread; 76 | swapcontext(old_thread, co_running); 77 | } 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | -------------------------------------------------------------------------------- /include/keyboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/platform/visualc/config.h: -------------------------------------------------------------------------------- 1 | #define VERSION "SVN" 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 | -------------------------------------------------------------------------------- /include/dosbox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef DOSBOX_DOSBOX_H 21 | #define DOSBOX_DOSBOX_H 22 | 23 | #include "config.h" 24 | 25 | GCC_ATTRIBUTE(noreturn) void E_Exit(const char * message,...) GCC_ATTRIBUTE( __format__(__printf__, 1, 2)); 26 | 27 | void MSG_Add(const char*,const char*); //add messages to the internal languagefile 28 | const char* MSG_Get(char const *); //get messages from the internal languagefile 29 | 30 | class Section; 31 | 32 | typedef Bitu (LoopHandler)(void); 33 | 34 | void DOSBOX_RunMachine(); 35 | void DOSBOX_SetLoop(LoopHandler * handler); 36 | void DOSBOX_SetNormalLoop(); 37 | 38 | void DOSBOX_Init(void); 39 | 40 | class Config; 41 | extern Config * control; 42 | 43 | enum MachineType { 44 | MCH_HERC, 45 | MCH_CGA, 46 | MCH_TANDY, 47 | MCH_PCJR, 48 | MCH_EGA, 49 | MCH_VGA 50 | }; 51 | 52 | enum SVGACards { 53 | SVGA_None, 54 | SVGA_S3Trio, 55 | SVGA_TsengET4K, 56 | SVGA_TsengET3K, 57 | SVGA_ParadisePVGA1A 58 | }; 59 | 60 | extern SVGACards svgaCard; 61 | extern MachineType machine; 62 | extern bool SDLNetInited; 63 | 64 | #define IS_TANDY_ARCH ((machine==MCH_TANDY) || (machine==MCH_PCJR)) 65 | #define IS_EGAVGA_ARCH ((machine==MCH_EGA) || (machine==MCH_VGA)) 66 | #define IS_VGA_ARCH (machine==MCH_VGA) 67 | #define TANDY_ARCH_CASE MCH_TANDY: case MCH_PCJR 68 | #define EGAVGA_ARCH_CASE MCH_EGA: case MCH_VGA 69 | #define VGA_ARCH_CASE MCH_VGA 70 | 71 | #ifndef DOSBOX_LOGGING_H 72 | #include "logging.h" 73 | #endif // the logging system. 74 | 75 | #endif /* DOSBOX_DOSBOX_H */ 76 | -------------------------------------------------------------------------------- /src/gui/midi_oss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | -------------------------------------------------------------------------------- /libco/armeabi.c: -------------------------------------------------------------------------------- 1 | /* 2 | libco.armeabi (2013-04-05) 3 | author: Themaister 4 | license: public domain 5 | */ 6 | 7 | #define LIBCO_C 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #ifndef IOS 15 | #include 16 | #endif 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | static thread_local uint32_t co_active_buffer[64]; 23 | static thread_local cothread_t co_active_handle; 24 | 25 | asm ( 26 | ".arm\n" 27 | ".align 4\n" 28 | ".globl co_switch_arm\n" 29 | ".globl _co_switch_arm\n" 30 | "co_switch_arm:\n" 31 | "_co_switch_arm:\n" 32 | " stmia r1!, {r4, r5, r6, r7, r8, r9, r10, r11, sp, lr}\n" 33 | " ldmia r0!, {r4, r5, r6, r7, r8, r9, r10, r11, sp, pc}\n" 34 | ); 35 | 36 | /* ASM */ 37 | void co_switch_arm(cothread_t handle, cothread_t current); 38 | 39 | static void crash(void) 40 | { 41 | /* Called only if cothread_t entrypoint returns. */ 42 | assert(0); 43 | } 44 | 45 | cothread_t co_create(unsigned int size, void (*entrypoint)(void)) 46 | { 47 | size = (size + 1023) & ~1023; 48 | cothread_t handle = 0; 49 | #if HAVE_POSIX_MEMALIGN >= 1 50 | if (posix_memalign(&handle, 1024, size + 256) < 0) 51 | return 0; 52 | #else 53 | handle = memalign(1024, size + 256); 54 | #endif 55 | 56 | if (!handle) 57 | return handle; 58 | 59 | uint32_t *ptr = (uint32_t*)handle; 60 | /* Non-volatiles. */ 61 | ptr[0] = 0; /* r4 */ 62 | ptr[1] = 0; /* r5 */ 63 | ptr[2] = 0; /* r6 */ 64 | ptr[3] = 0; /* r7 */ 65 | ptr[4] = 0; /* r8 */ 66 | ptr[5] = 0; /* r9 */ 67 | ptr[6] = 0; /* r10 */ 68 | ptr[7] = 0; /* r11 */ 69 | ptr[8] = (uintptr_t)ptr + size + 256 - 4; /* r13, stack pointer */ 70 | ptr[9] = (uintptr_t)entrypoint; /* r15, PC (link register r14 gets saved here). */ 71 | return handle; 72 | } 73 | 74 | cothread_t co_active(void) 75 | { 76 | if (!co_active_handle) 77 | co_active_handle = co_active_buffer; 78 | return co_active_handle; 79 | } 80 | 81 | void co_delete(cothread_t handle) 82 | { 83 | free(handle); 84 | } 85 | 86 | void co_switch(cothread_t handle) 87 | { 88 | cothread_t co_previous_handle = co_active(); 89 | co_switch_arm(co_active_handle = handle, co_previous_handle); 90 | } 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | -------------------------------------------------------------------------------- /libretro/render_scalers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | // reduced to save some memory 25 | #define SCALER_MAXWIDTH 800 26 | #define SCALER_MAXHEIGHT 600 27 | 28 | #define SCALER_BLOCKSIZE 16 29 | 30 | typedef enum { 31 | scalerMode8, scalerMode15, scalerMode16, scalerMode32 32 | } scalerMode_t; 33 | 34 | typedef enum scalerOperation { 35 | scalerOpNormal, 36 | scalerLast 37 | } scalerOperation_t; 38 | 39 | typedef void (*ScalerLineHandler_t)(const void *src); 40 | typedef void (*ScalerComplexHandler_t)(void); 41 | 42 | extern Bit8u Scaler_Aspect[]; 43 | extern Bit8u diff_table[]; 44 | extern Bitu Scaler_ChangedLineIndex; 45 | extern Bit16u Scaler_ChangedLines[]; 46 | typedef union { 47 | Bit32u b32 [SCALER_MAXHEIGHT] [SCALER_MAXWIDTH]; 48 | Bit16u b16 [SCALER_MAXHEIGHT] [SCALER_MAXWIDTH]; 49 | Bit8u b8 [SCALER_MAXHEIGHT] [SCALER_MAXWIDTH]; 50 | } scalerSourceCache_t; 51 | extern scalerSourceCache_t scalerSourceCache; 52 | typedef ScalerLineHandler_t ScalerLineBlock_t[5][4]; 53 | 54 | typedef struct { 55 | const char *name; 56 | Bitu gfxFlags; 57 | Bitu xscale,yscale; 58 | ScalerComplexHandler_t Linear[4]; 59 | ScalerComplexHandler_t Random[4]; 60 | } ScalerComplexBlock_t; 61 | 62 | typedef struct { 63 | const char *name; 64 | Bitu gfxFlags; 65 | Bitu xscale,yscale; 66 | ScalerLineBlock_t Linear; 67 | ScalerLineBlock_t Random; 68 | } ScalerSimpleBlock_t; 69 | 70 | 71 | #define SCALE_LEFT 0x1 72 | #define SCALE_RIGHT 0x2 73 | #define SCALE_FULL 0x4 74 | 75 | /* Simple scalers */ 76 | extern ScalerSimpleBlock_t ScaleNormal1x; 77 | extern ScalerSimpleBlock_t ScaleNormalDw; 78 | extern ScalerSimpleBlock_t ScaleNormalDh; 79 | /* Complex scalers */ 80 | #endif 81 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /include/pci_bus.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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_PCI_H 20 | #define DOSBOX_PCI_H 21 | 22 | //#define PCI_FUNCTIONALITY_ENABLED 0 23 | 24 | #if defined PCI_FUNCTIONALITY_ENABLED 25 | 26 | #define PCI_MAX_PCIDEVICES 10 27 | #define PCI_MAX_PCIFUNCTIONS 8 28 | 29 | 30 | class PCI_Device { 31 | private: 32 | Bits pci_id, pci_subfunction; 33 | Bit16u vendor_id, device_id; 34 | 35 | // subdevices declarations, they will respond to pci functions 1 to 7 36 | // (main device is attached to function 0) 37 | Bitu num_subdevices; 38 | PCI_Device* subdevices[PCI_MAX_PCIFUNCTIONS-1]; 39 | 40 | public: 41 | PCI_Device(Bit16u vendor, Bit16u device); 42 | 43 | Bits PCIId(void) { 44 | return pci_id; 45 | } 46 | Bits PCISubfunction(void) { 47 | return pci_subfunction; 48 | } 49 | Bit16u VendorID(void) { 50 | return vendor_id; 51 | } 52 | Bit16u DeviceID(void) { 53 | return device_id; 54 | } 55 | 56 | void SetPCIId(Bitu number, Bits subfct); 57 | 58 | bool AddSubdevice(PCI_Device* dev); 59 | void RemoveSubdevice(Bits subfct); 60 | 61 | PCI_Device* GetSubdevice(Bits subfct); 62 | 63 | Bit16u NumSubdevices(void) { 64 | if (num_subdevices>PCI_MAX_PCIFUNCTIONS-1) return (Bit16u)(PCI_MAX_PCIFUNCTIONS-1); 65 | return (Bit16u)num_subdevices; 66 | } 67 | 68 | Bits GetNextSubdeviceNumber(void) { 69 | if (num_subdevices>=PCI_MAX_PCIFUNCTIONS-1) return -1; 70 | return (Bits)num_subdevices+1; 71 | } 72 | 73 | virtual Bits ParseReadRegister(Bit8u regnum)=0; 74 | virtual bool OverrideReadRegister(Bit8u regnum, Bit8u* rval, Bit8u* rval_mask)=0; 75 | virtual Bits ParseWriteRegister(Bit8u regnum,Bit8u value)=0; 76 | virtual bool InitializeRegisters(Bit8u registers[256])=0; 77 | 78 | }; 79 | 80 | bool PCI_IsInitialized(); 81 | 82 | RealPt PCI_GetPModeInterface(void); 83 | 84 | #endif 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /include/video.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef DOSBOX_VIDEO_H 21 | #define DOSBOX_VIDEO_H 22 | 23 | #define REDUCE_JOYSTICK_POLLING 24 | 25 | typedef enum { 26 | GFX_CallBackReset, 27 | GFX_CallBackStop, 28 | GFX_CallBackRedraw 29 | } GFX_CallBackFunctions_t; 30 | 31 | typedef void (*GFX_CallBack_t)( GFX_CallBackFunctions_t function ); 32 | 33 | struct GFX_PalEntry { 34 | Bit8u r; 35 | Bit8u g; 36 | Bit8u b; 37 | Bit8u unused; 38 | }; 39 | 40 | #define GFX_CAN_8 0x0001 41 | #define GFX_CAN_15 0x0002 42 | #define GFX_CAN_16 0x0004 43 | #define GFX_CAN_32 0x0008 44 | 45 | #define GFX_LOVE_8 0x0010 46 | #define GFX_LOVE_15 0x0020 47 | #define GFX_LOVE_16 0x0040 48 | #define GFX_LOVE_32 0x0080 49 | 50 | #define GFX_RGBONLY 0x0100 51 | 52 | #define GFX_SCALING 0x1000 53 | #define GFX_HARDWARE 0x2000 54 | 55 | #define GFX_CAN_RANDOM 0x4000 //If the interface can also do random access surface 56 | 57 | void GFX_Events(void); 58 | void GFX_SetPalette(Bitu start,Bitu count,GFX_PalEntry * entries); 59 | Bitu GFX_GetBestMode(Bitu flags); 60 | Bitu GFX_GetRGB(Bit8u red,Bit8u green,Bit8u blue); 61 | Bitu GFX_SetSize(Bitu width,Bitu height,Bitu flags,double scalex,double scaley,GFX_CallBack_t cb); 62 | 63 | void GFX_ResetScreen(void); 64 | void GFX_Start(void); 65 | void GFX_Stop(void); 66 | void GFX_SwitchFullScreen(void); 67 | bool GFX_StartUpdate(Bit8u * & pixels,Bitu & pitch); 68 | void GFX_EndUpdate( const Bit16u *changedLines ); 69 | void GFX_GetSize(int &width, int &height, bool &fullscreen); 70 | void GFX_LosingFocus(void); 71 | 72 | #if defined (WIN32) 73 | bool GFX_SDLUsingWinDIB(void); 74 | #endif 75 | 76 | #if defined (REDUCE_JOYSTICK_POLLING) 77 | void MAPPER_UpdateJoysticks(void); 78 | #endif 79 | 80 | /* Mouse related */ 81 | void GFX_CaptureMouse(void); 82 | extern bool mouselocked; //true if mouse is confined to window 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /include/inout.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef DOSBOX_INOUT_H 21 | #define DOSBOX_INOUT_H 22 | 23 | #define IO_MAX (64*1024+3) 24 | 25 | #define IO_MB 0x1 26 | #define IO_MW 0x2 27 | #define IO_MD 0x4 28 | #define IO_MA (IO_MB | IO_MW | IO_MD ) 29 | 30 | typedef Bitu IO_ReadHandler(Bitu port,Bitu iolen); 31 | typedef void IO_WriteHandler(Bitu port,Bitu val,Bitu iolen); 32 | 33 | extern IO_WriteHandler * io_writehandlers[3][IO_MAX]; 34 | extern IO_ReadHandler * io_readhandlers[3][IO_MAX]; 35 | 36 | void IO_RegisterReadHandler(Bitu port,IO_ReadHandler * handler,Bitu mask,Bitu range=1); 37 | void IO_RegisterWriteHandler(Bitu port,IO_WriteHandler * handler,Bitu mask,Bitu range=1); 38 | 39 | void IO_FreeReadHandler(Bitu port,Bitu mask,Bitu range=1); 40 | void IO_FreeWriteHandler(Bitu port,Bitu mask,Bitu range=1); 41 | 42 | void IO_WriteB(Bitu port,Bitu val); 43 | void IO_WriteW(Bitu port,Bitu val); 44 | void IO_WriteD(Bitu port,Bitu val); 45 | 46 | Bitu IO_ReadB(Bitu port); 47 | Bitu IO_ReadW(Bitu port); 48 | Bitu IO_ReadD(Bitu port); 49 | 50 | /* Classes to manage the IO objects created by the various devices. 51 | * The io objects will remove itself on destruction.*/ 52 | class IO_Base{ 53 | protected: 54 | bool installed; 55 | Bitu m_port, m_mask,m_range; 56 | public: 57 | IO_Base():installed(false){}; 58 | }; 59 | class IO_ReadHandleObject: private IO_Base{ 60 | public: 61 | void Install(Bitu port,IO_ReadHandler * handler,Bitu mask,Bitu range=1); 62 | void Uninstall(); 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 | void Uninstall(); 69 | ~IO_WriteHandleObject(); 70 | }; 71 | 72 | static INLINE void IO_Write(Bitu port,Bit8u val) { 73 | IO_WriteB(port,val); 74 | } 75 | static INLINE Bit8u IO_Read(Bitu port){ 76 | return (Bit8u)IO_ReadB(port); 77 | } 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /src/cpu/core_normal/support.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | -------------------------------------------------------------------------------- /src/debug/debug_win32.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | -------------------------------------------------------------------------------- /src/cpu/core_full.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | -------------------------------------------------------------------------------- /src/dos/cdrom_ioctl_linux.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | -------------------------------------------------------------------------------- /libco/sjlj.c: -------------------------------------------------------------------------------- 1 | /* 2 | libco.sjlj (2008-01-28) 3 | author: Nach 4 | license: public domain 5 | */ 6 | 7 | /* 8 | * Note this was designed for UNIX systems. Based on ideas expressed in a paper 9 | * by Ralf Engelschall. 10 | * For SJLJ on other systems, one would want to rewrite springboard() and 11 | * co_create() and hack the jmb_buf stack pointer. 12 | */ 13 | 14 | #define LIBCO_C 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | typedef struct 25 | { 26 | sigjmp_buf context; 27 | void (*coentry)(void); 28 | void *stack; 29 | } cothread_struct; 30 | 31 | static thread_local cothread_struct co_primary; 32 | static thread_local cothread_struct *creating, *co_running = 0; 33 | 34 | static void springboard(int ignored) 35 | { 36 | if(sigsetjmp(creating->context, 0)) 37 | co_running->coentry(); 38 | } 39 | 40 | cothread_t co_active(void) 41 | { 42 | if (!co_running) 43 | co_running = &co_primary; 44 | return (cothread_t)co_running; 45 | } 46 | 47 | cothread_t co_create(unsigned int size, void (*coentry)(void)) 48 | { 49 | if(!co_running) 50 | co_running = &co_primary; 51 | 52 | cothread_struct *thread = (cothread_struct*)malloc(sizeof(cothread_struct)); 53 | 54 | if(thread) 55 | { 56 | struct sigaction handler; 57 | struct sigaction old_handler; 58 | 59 | stack_t stack; 60 | stack_t old_stack; 61 | 62 | thread->coentry = thread->stack = 0; 63 | 64 | stack.ss_flags = 0; 65 | stack.ss_size = size; 66 | thread->stack = stack.ss_sp = malloc(size); 67 | 68 | if(stack.ss_sp && !sigaltstack(&stack, &old_stack)) 69 | { 70 | handler.sa_handler = springboard; 71 | handler.sa_flags = SA_ONSTACK; 72 | sigemptyset(&handler.sa_mask); 73 | creating = thread; 74 | 75 | if(!sigaction(SIGUSR1, &handler, &old_handler)) 76 | { 77 | if(!raise(SIGUSR1)) 78 | thread->coentry = coentry; 79 | sigaltstack(&old_stack, 0); 80 | sigaction(SIGUSR1, &old_handler, 0); 81 | } 82 | } 83 | 84 | if(thread->coentry != coentry) 85 | { 86 | co_delete(thread); 87 | thread = 0; 88 | } 89 | } 90 | 91 | return (cothread_t)thread; 92 | } 93 | 94 | void co_delete(cothread_t cothread) 95 | { 96 | if(cothread) 97 | { 98 | if(((cothread_struct*)cothread)->stack) 99 | free(((cothread_struct*)cothread)->stack); 100 | free(cothread); 101 | } 102 | } 103 | 104 | void co_switch(cothread_t cothread) 105 | { 106 | if(!sigsetjmp(co_running->context, 0)) 107 | { 108 | co_running = (cothread_struct*)cothread; 109 | siglongjmp(co_running->context, 1); 110 | } 111 | } 112 | 113 | #ifdef __cplusplus 114 | } 115 | #endif 116 | -------------------------------------------------------------------------------- /src/cpu/core_dyn_x86/helpers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | static bool dyn_helper_divb(Bit8u val) { 20 | if (!val) return CPU_PrepareException(0,0); 21 | Bitu quo=reg_ax / val; 22 | Bit8u rem=(Bit8u)(reg_ax % val); 23 | Bit8u quo8=(Bit8u)(quo&0xff); 24 | if (quo>0xff) return CPU_PrepareException(0,0); 25 | reg_ah=rem; 26 | reg_al=quo8; 27 | return false; 28 | } 29 | 30 | static bool dyn_helper_idivb(Bit8s val) { 31 | if (!val) return CPU_PrepareException(0,0); 32 | Bits quo=(Bit16s)reg_ax / val; 33 | Bit8s rem=(Bit8s)((Bit16s)reg_ax % val); 34 | Bit8s quo8s=(Bit8s)(quo&0xff); 35 | if (quo!=(Bit16s)quo8s) return CPU_PrepareException(0,0); 36 | reg_ah=rem; 37 | reg_al=quo8s; 38 | return false; 39 | } 40 | 41 | static bool dyn_helper_divw(Bit16u val) { 42 | if (!val) return CPU_PrepareException(0,0); 43 | Bitu num=(reg_dx<<16)|reg_ax; 44 | Bitu quo=num/val; 45 | Bit16u rem=(Bit16u)(num % val); 46 | Bit16u quo16=(Bit16u)(quo&0xffff); 47 | if (quo!=(Bit32u)quo16) return CPU_PrepareException(0,0); 48 | reg_dx=rem; 49 | reg_ax=quo16; 50 | return false; 51 | } 52 | 53 | static bool dyn_helper_idivw(Bit16s val) { 54 | if (!val) return CPU_PrepareException(0,0); 55 | Bits num=(reg_dx<<16)|reg_ax; 56 | Bits quo=num/val; 57 | Bit16s rem=(Bit16s)(num % val); 58 | Bit16s quo16s=(Bit16s)quo; 59 | if (quo!=(Bit32s)quo16s) return CPU_PrepareException(0,0); 60 | reg_dx=rem; 61 | reg_ax=quo16s; 62 | return false; 63 | } 64 | 65 | static bool dyn_helper_divd(Bit32u val) { 66 | if (!val) return CPU_PrepareException(0,0); 67 | Bit64u num=(((Bit64u)reg_edx)<<32)|reg_eax; 68 | Bit64u quo=num/val; 69 | Bit32u rem=(Bit32u)(num % val); 70 | Bit32u quo32=(Bit32u)(quo&0xffffffff); 71 | if (quo!=(Bit64u)quo32) return CPU_PrepareException(0,0); 72 | reg_edx=rem; 73 | reg_eax=quo32; 74 | return false; 75 | } 76 | 77 | static bool dyn_helper_idivd(Bit32s val) { 78 | if (!val) return CPU_PrepareException(0,0); 79 | Bit64s num=(((Bit64u)reg_edx)<<32)|reg_eax; 80 | Bit64s quo=num/val; 81 | Bit32s rem=(Bit32s)(num % val); 82 | Bit32s quo32s=(Bit32s)(quo&0xffffffff); 83 | if (quo!=(Bit64s)quo32s) return CPU_PrepareException(0,0); 84 | reg_edx=rem; 85 | reg_eax=quo32s; 86 | return false; 87 | } 88 | -------------------------------------------------------------------------------- /include/control.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef DOSBOX_CONTROL_H 21 | #define DOSBOX_CONTROL_H 22 | 23 | #ifdef _MSC_VER 24 | #pragma warning ( disable : 4786 ) 25 | #pragma warning ( disable : 4290 ) 26 | #endif 27 | 28 | #ifndef DOSBOX_PROGRAMS_H 29 | #include "programs.h" 30 | #endif 31 | #ifndef DOSBOX_SETUP_H 32 | #include "setup.h" 33 | #endif 34 | 35 | #ifndef CH_LIST 36 | #define CH_LIST 37 | #include 38 | #endif 39 | 40 | #ifndef CH_VECTOR 41 | #define CH_VECTOR 42 | #include 43 | #endif 44 | 45 | #ifndef CH_STRING 46 | #define CH_STRING 47 | #include 48 | #endif 49 | 50 | 51 | 52 | 53 | class Config{ 54 | public: 55 | CommandLine * cmdline; 56 | private: 57 | std::list sectionlist; 58 | typedef std::list::iterator it; 59 | typedef std::list::reverse_iterator reverse_it; 60 | typedef std::list::const_iterator const_it; 61 | typedef std::list::const_reverse_iterator const_reverse_it; 62 | void (* _start_function)(void); 63 | bool secure_mode; //Sandbox mode 64 | public: 65 | bool initialised; 66 | std::vector startup_params; 67 | std::vector configfiles; 68 | Config(CommandLine * cmd):cmdline(cmd),secure_mode(false) { 69 | startup_params.push_back(cmdline->GetFileName()); 70 | cmdline->FillVector(startup_params); 71 | initialised=false; 72 | } 73 | ~Config(); 74 | 75 | Section_line * AddSection_line(char const * const _name,void (*_initfunction)(Section*)); 76 | Section_prop * AddSection_prop(char const * const _name,void (*_initfunction)(Section*),bool canchange=false); 77 | 78 | Section* GetSection(int index); 79 | Section* GetSection(std::string const&_sectionname) const; 80 | Section* GetSectionFromProperty(char const * const prop) const; 81 | 82 | void SetStartUp(void (*_function)(void)); 83 | void Init(); 84 | void ShutDown(); 85 | void StartUp(); 86 | bool PrintConfig(char const * const configfilename) const; 87 | bool ParseConfigFile(char const * const configfilename); 88 | void ParseEnv(char ** envp); 89 | bool SecureMode() const { return secure_mode; } 90 | void SwitchToSecureMode() { secure_mode = true; }//can't be undone 91 | }; 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /src/gui/render_templates_hq.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 = diff >> 31; // -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 = diff >> 31; // -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 = diff >> 31; // -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 | -------------------------------------------------------------------------------- /include/bios_disk.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | Bit32u current_fpos; 69 | }; 70 | 71 | void updateDPT(void); 72 | void incrementFDD(void); 73 | 74 | #define MAX_HDD_IMAGES 2 75 | 76 | extern imageDisk *imageDiskList[2 + MAX_HDD_IMAGES]; 77 | extern imageDisk *diskSwap[20]; 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 | -------------------------------------------------------------------------------- /libretro/retrodos.h: -------------------------------------------------------------------------------- 1 | #ifndef _LIBRETRO_DOSBOX_H 2 | #define _LIBRETRO_DOSBOX_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "libretro.h" 8 | 9 | #if 1 10 | # define RETROLOG(msg) printf("%s\n", msg) 11 | #else 12 | # define RETROLOG(msg) 13 | #endif 14 | 15 | extern retro_video_refresh_t video_cb; 16 | extern retro_audio_sample_batch_t audio_batch_cb; 17 | extern retro_input_poll_t poll_cb; 18 | extern retro_input_state_t input_cb; 19 | extern retro_environment_t environ_cb; 20 | 21 | #if 0 22 | struct RetroFrame 23 | { 24 | uint8_t* data; 25 | uint32_t width; 26 | uint32_t height; 27 | uint32_t pitch; 28 | }; 29 | 30 | struct lr_event_t 31 | { 32 | void (*fn)(void* data); 33 | void* data; 34 | 35 | lr_event_t() : fn(0), data(0) { } 36 | lr_event_t(void (*fn_)(void*), void* data_) : fn(fn_), data(data_) { } 37 | }; 38 | 39 | struct lr_queue_t 40 | { 41 | std::queue queue; 42 | pthread_mutex_t lock; 43 | pthread_cond_t cond; 44 | 45 | lr_queue_t() 46 | { 47 | if (pthread_mutex_init(&lock, 0)) 48 | RETROLOG("Could not create queue mutex."); 49 | 50 | if (pthread_cond_init(&cond, 0)) 51 | RETROLOG("Could not create queue condition."); 52 | } 53 | 54 | ~lr_queue_t() 55 | { 56 | if (pthread_mutex_destroy(&lock)) 57 | RETROLOG("Could not destroy queue mutex."); 58 | 59 | if (pthread_cond_destroy(&cond)) 60 | RETROLOG("Could not destory queue condition."); 61 | } 62 | 63 | void add_event(void (*fn)(void*), void* data) 64 | { 65 | if (pthread_mutex_lock(&lock)) 66 | RETROLOG("Could not lock queue mutex."); 67 | 68 | queue.push(lr_event_t(fn, data)); 69 | 70 | if (pthread_mutex_unlock(&lock)) 71 | RETROLOG("Could not unlock queue mutex."); 72 | 73 | if (pthread_cond_signal(&cond)) 74 | RETROLOG("Could not signal the condition."); 75 | } 76 | 77 | bool process_event() 78 | { 79 | if (pthread_mutex_lock(&lock)) 80 | RETROLOG("Could not lock queue mutex."); 81 | 82 | while (queue.empty()) 83 | if (pthread_cond_wait(&cond, &lock)) 84 | RETROLOG("Could not wait for condition."); 85 | 86 | lr_event_t event = queue.front(); 87 | queue.pop(); 88 | 89 | if (pthread_mutex_unlock(&lock)) 90 | RETROLOG("Could not unlock queue mutex."); 91 | 92 | event.fn(event.data); 93 | 94 | return true; 95 | } 96 | }; 97 | 98 | extern lr_queue_t libretro_queue; // Commands to run on libretro thread 99 | extern lr_queue_t dosbox_queue; // Commands to run on dosbox thread 100 | 101 | // 102 | 103 | extern volatile bool have_frame; 104 | 105 | void RETRO_PostFrameEvent(void* data); 106 | void RETRO_PostAudioEvent(void* data); 107 | 108 | void GFX_GetRetroColorFormat(); 109 | 110 | #endif 111 | #endif -------------------------------------------------------------------------------- /include/render.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef __LIBRETRO__ // Don't need scalers with libretro 27 | #define RENDER_USE_ADVANCED_SCALERS 3 28 | #else 29 | #define RENDER_USE_ADVANCED_SCALERS 0 30 | #endif 31 | 32 | #include "../src/gui/render_scalers.h" 33 | 34 | #define RENDER_SKIP_CACHE 16 35 | //Enable this for scalers to support 0 input for empty lines 36 | //#define RENDER_NULL_INPUT 37 | 38 | typedef struct { 39 | struct { 40 | Bit8u red; 41 | Bit8u green; 42 | Bit8u blue; 43 | Bit8u unused; 44 | } rgb[256]; 45 | union { 46 | Bit16u b16[256]; 47 | Bit32u b32[256]; 48 | } lut; 49 | bool changed; 50 | Bit8u modified[256]; 51 | Bitu first; 52 | Bitu last; 53 | } RenderPal_t; 54 | 55 | typedef struct { 56 | struct { 57 | Bitu width, start; 58 | Bitu height; 59 | Bitu bpp; 60 | bool dblw,dblh; 61 | double ratio; 62 | float fps; 63 | } src; 64 | struct { 65 | Bitu count; 66 | Bitu max; 67 | Bitu index; 68 | Bit8u hadSkip[RENDER_SKIP_CACHE]; 69 | } frameskip; 70 | struct { 71 | Bitu size; 72 | scalerMode_t inMode; 73 | scalerMode_t outMode; 74 | scalerOperation_t op; 75 | bool clearCache; 76 | bool forced; 77 | ScalerLineHandler_t lineHandler; 78 | ScalerLineHandler_t linePalHandler; 79 | ScalerComplexHandler_t complexHandler; 80 | Bitu blocks, lastBlock; 81 | Bitu outPitch; 82 | Bit8u *outWrite; 83 | Bitu cachePitch; 84 | Bit8u *cacheRead; 85 | Bitu inHeight, inLine, outLine; 86 | } scale; 87 | RenderPal_t pal; 88 | bool updating; 89 | bool active; 90 | bool aspect; 91 | bool fullFrame; 92 | } Render_t; 93 | 94 | extern Render_t render; 95 | extern ScalerLineHandler_t RENDER_DrawLine; 96 | void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool dblw,bool dblh); 97 | bool RENDER_StartUpdate(void); 98 | void RENDER_EndUpdate(bool abort); 99 | void RENDER_SetPal(Bit8u entry,Bit8u red,Bit8u green,Bit8u blue); 100 | 101 | 102 | #endif 103 | -------------------------------------------------------------------------------- /include/logging.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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_LOGGING_H 20 | #define DOSBOX_LOGGING_H 21 | enum LOG_TYPES { 22 | LOG_ALL, 23 | LOG_VGA, LOG_VGAGFX,LOG_VGAMISC,LOG_INT10, 24 | LOG_SB,LOG_DMACONTROL, 25 | LOG_FPU,LOG_CPU,LOG_PAGING, 26 | LOG_FCB,LOG_FILES,LOG_IOCTL,LOG_EXEC,LOG_DOSMISC, 27 | LOG_PIT,LOG_KEYBOARD,LOG_PIC, 28 | LOG_MOUSE,LOG_BIOS,LOG_GUI,LOG_MISC, 29 | LOG_IO, 30 | LOG_PCI, 31 | LOG_MAX 32 | }; 33 | 34 | enum LOG_SEVERITIES { 35 | LOG_NORMAL, 36 | LOG_WARN, 37 | LOG_ERROR 38 | }; 39 | 40 | #if C_DEBUG 41 | class LOG 42 | { 43 | LOG_TYPES d_type; 44 | LOG_SEVERITIES d_severity; 45 | public: 46 | 47 | LOG (LOG_TYPES type , LOG_SEVERITIES severity): 48 | d_type(type), 49 | d_severity(severity) 50 | {} 51 | void operator() (char const* buf, ...) GCC_ATTRIBUTE(__format__(__printf__, 2, 3)); //../src/debug/debug_gui.cpp 52 | 53 | }; 54 | 55 | void DEBUG_ShowMsg(char const* format,...) GCC_ATTRIBUTE(__format__(__printf__, 1, 2)); 56 | #define LOG_MSG DEBUG_ShowMsg 57 | 58 | #else //C_DEBUG 59 | 60 | struct LOG 61 | { 62 | LOG(LOG_TYPES , LOG_SEVERITIES ) { } 63 | void operator()(char const* ) { } 64 | void operator()(char const* , double ) { } 65 | void operator()(char const* , double , double ) { } 66 | void operator()(char const* , double , double , double ) { } 67 | void operator()(char const* , double , double , double , double ) { } 68 | void operator()(char const* , double , double , double , double , double ) { } 69 | void operator()(char const* , double , double , double , double , double , double ) { } 70 | void operator()(char const* , double , double , double , double , double , double , double) { } 71 | 72 | 73 | 74 | void operator()(char const* , char const* ) { } 75 | void operator()(char const* , char const* , double ) { } 76 | void operator()(char const* , char const* , double ,double ) { } 77 | void operator()(char const* , double , char const* ) { } 78 | void operator()(char const* , double , double, char const* ) { } 79 | void operator()(char const* , char const*, char const*) { } 80 | 81 | void operator()(char const* , double , double , double , char const* ) { } 82 | }; //add missing operators to here 83 | //try to avoid anything smaller than bit32... 84 | void GFX_ShowMsg(char const* format,...) GCC_ATTRIBUTE(__format__(__printf__, 1, 2)); 85 | #define LOG_MSG GFX_ShowMsg 86 | 87 | #endif //C_DEBUG 88 | 89 | 90 | #endif //DOSBOX_LOGGING_H 91 | -------------------------------------------------------------------------------- /include/programs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef DOSBOX_PROGRAMS_H 21 | #define DOSBOX_PROGRAMS_H 22 | 23 | #ifndef DOSBOX_DOSBOX_H 24 | #include "dosbox.h" 25 | #endif 26 | #ifndef DOSBOX_DOS_INC_H 27 | #include "dos_inc.h" 28 | #endif 29 | 30 | #ifndef CH_LIST 31 | #define CH_LIST 32 | #include 33 | #endif 34 | 35 | #ifndef CH_STRING 36 | #define CH_STRING 37 | #include 38 | #endif 39 | 40 | class CommandLine { 41 | public: 42 | CommandLine(int argc,char const * const argv[]); 43 | CommandLine(char const * const name,char const * const cmdline); 44 | const char * GetFileName(){ return file_name.c_str();} 45 | 46 | bool FindExist(char const * const name,bool remove=false); 47 | bool FindHex(char const * const name,int & value,bool remove=false); 48 | bool FindInt(char const * const name,int & value,bool remove=false); 49 | bool FindString(char const * const name,std::string & value,bool remove=false); 50 | bool FindCommand(unsigned int which,std::string & value); 51 | bool FindStringBegin(char const * const begin,std::string & value, bool remove=false); 52 | bool FindStringRemain(char const * const name,std::string & value); 53 | bool FindStringRemainBegin(char const * const name,std::string & value); 54 | bool GetStringRemain(std::string & value); 55 | int GetParameterFromList(const char* const params[], std::vector & output); 56 | void FillVector(std::vector & vector); 57 | unsigned int GetCount(void); 58 | void Shift(unsigned int amount=1); 59 | Bit16u Get_arglength(); 60 | 61 | private: 62 | typedef std::list::iterator cmd_it; 63 | std::list cmds; 64 | std::string file_name; 65 | bool FindEntry(char const * const name,cmd_it & it,bool neednext=false); 66 | }; 67 | 68 | class Program { 69 | public: 70 | Program(); 71 | virtual ~Program(){ 72 | delete cmd; 73 | delete psp; 74 | } 75 | std::string temp_line; 76 | CommandLine * cmd; 77 | DOS_PSP * psp; 78 | virtual void Run(void)=0; 79 | bool GetEnvStr(const char * entry,std::string & result); 80 | bool GetEnvNum(Bitu num,std::string & result); 81 | Bitu GetEnvCount(void); 82 | bool SetEnv(const char * entry,const char * new_string); 83 | void WriteOut(const char * format,...); /* Write to standard output */ 84 | void WriteOut_NoParsing(const char * format); /* Write to standard output, no parsing */ 85 | void ChangeToLongCmd(); 86 | 87 | }; 88 | 89 | typedef void (PROGRAMS_Main)(Program * * make); 90 | void PROGRAMS_MakeFile(char const * const name,PROGRAMS_Main * main); 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /include/dma.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef DOSBOX_DMA_H 21 | #define DOSBOX_DMA_H 22 | 23 | enum DMAEvent { 24 | DMA_REACHED_TC, 25 | DMA_MASKED, 26 | DMA_UNMASKED, 27 | DMA_TRANSFEREND 28 | }; 29 | 30 | class DmaChannel; 31 | typedef void (* DMA_CallBack)(DmaChannel * chan,DMAEvent event); 32 | 33 | class DmaChannel { 34 | public: 35 | Bit32u pagebase; 36 | Bit16u baseaddr; 37 | Bit32u curraddr; 38 | Bit16u basecnt; 39 | Bit16u currcnt; 40 | Bit8u channum; 41 | Bit8u pagenum; 42 | Bit8u DMA16; 43 | bool increment; 44 | bool autoinit; 45 | Bit8u trantype; 46 | bool masked; 47 | bool tcount; 48 | bool request; 49 | DMA_CallBack callback; 50 | 51 | DmaChannel(Bit8u num, bool dma16); 52 | void DoCallBack(DMAEvent event) { 53 | if (callback) (*callback)(this,event); 54 | } 55 | void SetMask(bool _mask) { 56 | masked=_mask; 57 | DoCallBack(masked ? DMA_MASKED : DMA_UNMASKED); 58 | } 59 | void Register_Callback(DMA_CallBack _cb) { 60 | callback = _cb; 61 | SetMask(masked); 62 | if (callback) Raise_Request(); 63 | else Clear_Request(); 64 | } 65 | void ReachedTC(void) { 66 | tcount=true; 67 | DoCallBack(DMA_REACHED_TC); 68 | } 69 | void SetPage(Bit8u val) { 70 | pagenum=val; 71 | pagebase=(pagenum >> DMA16) << (16+DMA16); 72 | } 73 | void Raise_Request(void) { 74 | request=true; 75 | } 76 | void Clear_Request(void) { 77 | request=false; 78 | } 79 | Bitu Read(Bitu size, Bit8u * buffer); 80 | Bitu Write(Bitu size, Bit8u * buffer); 81 | }; 82 | 83 | class DmaController { 84 | private: 85 | Bit8u ctrlnum; 86 | bool flipflop; 87 | DmaChannel *DmaChannels[4]; 88 | public: 89 | IO_ReadHandleObject DMA_ReadHandler[0x11]; 90 | IO_WriteHandleObject DMA_WriteHandler[0x11]; 91 | DmaController(Bit8u num) { 92 | flipflop = false; 93 | ctrlnum = num; /* first or second DMA controller */ 94 | for(Bit8u i=0;i<4;i++) { 95 | DmaChannels[i] = new DmaChannel(i+ctrlnum*4,ctrlnum==1); 96 | } 97 | } 98 | ~DmaController(void) { 99 | for(Bit8u i=0;i<4;i++) { 100 | delete DmaChannels[i]; 101 | } 102 | } 103 | DmaChannel * GetChannel(Bit8u chan) { 104 | if (chan<4) return DmaChannels[chan]; 105 | else return NULL; 106 | } 107 | void WriteControllerReg(Bitu reg,Bitu val,Bitu len); 108 | Bitu ReadControllerReg(Bitu reg,Bitu len); 109 | }; 110 | 111 | DmaChannel * GetDMAChannel(Bit8u chan); 112 | 113 | void CloseSecondDMAController(void); 114 | bool SecondDMAControllerAvailable(void); 115 | 116 | void DMA_SetWrapping(Bitu wrap); 117 | 118 | #endif 119 | -------------------------------------------------------------------------------- /include/cross.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef DOSBOX_CROSS_H 21 | #define DOSBOX_CROSS_H 22 | 23 | #ifndef DOSBOX_DOSBOX_H 24 | #include "dosbox.h" 25 | #endif 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | #if defined (_MSC_VER) /* MS Visual C++ */ 33 | #include 34 | #include 35 | #define LONGTYPE(a) a##i64 36 | #define snprintf _snprintf 37 | #define vsnprintf _vsnprintf 38 | #else /* LINUX / GCC */ 39 | #include 40 | #include 41 | #define LONGTYPE(a) a##LL 42 | #endif 43 | 44 | #define CROSS_LEN 512 /* Maximum filename size */ 45 | 46 | 47 | #if defined (WIN32) || defined (OS2) /* Win 32 & OS/2*/ 48 | #define CROSS_FILENAME(blah) 49 | #define CROSS_FILESPLIT '\\' 50 | #define F_OK 0 51 | #else 52 | #define CROSS_FILENAME(blah) strreplace(blah,'\\','/') 53 | #define CROSS_FILESPLIT '/' 54 | #endif 55 | 56 | #define CROSS_NONE 0 57 | #define CROSS_FILE 1 58 | #define CROSS_DIR 2 59 | #if defined (WIN32) 60 | #define ftruncate(blah,blah2) chsize(blah,blah2) 61 | #endif 62 | 63 | //Solaris maybe others 64 | #if defined (DB_HAVE_NO_POWF) 65 | #include 66 | static inline float powf (float x, float y) { return (float) pow (x,y); } 67 | #endif 68 | 69 | class Cross { 70 | public: 71 | static void GetPlatformConfigDir(std::string& in); 72 | static void GetPlatformConfigName(std::string& in); 73 | static void CreatePlatformConfigDir(std::string& in); 74 | static void ResolveHomedir(std::string & temp_line); 75 | static void CreateDir(std::string const& temp); 76 | static bool IsPathAbsolute(std::string const& in); 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 | #endif 109 | -------------------------------------------------------------------------------- /src/hardware/serialport/misc_util.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef SDLNETWRAPPER_H 21 | #define SDLNETWRAPPER_H 22 | 23 | #ifndef DOSBOX_DOSBOX_H 24 | #include "dosbox.h" 25 | #endif 26 | 27 | #if C_MODEM 28 | 29 | # ifndef DOSBOX_SUPPORT_H 30 | #include "support.h" 31 | #endif 32 | 33 | // Netwrapper Capabilities 34 | #define NETWRAPPER_TCP 1 35 | #define NETWRAPPER_TCP_NATIVESOCKET 2 36 | 37 | #if defined WIN32 38 | #define NATIVESOCKETS 39 | #include 40 | #include //for socklen_t 41 | //typedef int socklen_t; 42 | 43 | //Tests for BSD/OS2/LINUX 44 | #elif defined HAVE_STDLIB_H && defined HAVE_SYS_TYPES_H && defined HAVE_SYS_SOCKET_H && defined HAVE_NETINET_IN_H 45 | #define NATIVESOCKETS 46 | #define SOCKET int 47 | #include //darwin 48 | #include //darwin 49 | #include 50 | #include 51 | #include 52 | //socklen_t should be handled by configure 53 | #endif 54 | 55 | #ifdef NATIVESOCKETS 56 | #define CAPWORD (NETWRAPPER_TCP|NETWRAPPER_TCP_NATIVESOCKET) 57 | #else 58 | #define CAPWORD NETWRAPPER_TCP 59 | #endif 60 | 61 | #include "SDL_net.h" 62 | 63 | 64 | 65 | Bit32u Netwrapper_GetCapabilities(); 66 | 67 | 68 | class TCPClientSocket { 69 | public: 70 | TCPClientSocket(TCPsocket source); 71 | TCPClientSocket(const char* destination, Bit16u port); 72 | #ifdef NATIVESOCKETS 73 | Bit8u* nativetcpstruct; 74 | TCPClientSocket(int platformsocket); 75 | #endif 76 | ~TCPClientSocket(); 77 | 78 | // return: 79 | // -1: no data 80 | // -2: socket closed 81 | // >0: data char 82 | Bits GetcharNonBlock(); 83 | 84 | 85 | bool Putchar(Bit8u data); 86 | bool SendArray(Bit8u* data, Bitu bufsize); 87 | bool ReceiveArray(Bit8u* data, Bitu* size); 88 | bool isopen; 89 | 90 | bool GetRemoteAddressString(Bit8u* buffer); 91 | 92 | void FlushBuffer(); 93 | void SetSendBufferSize(Bitu bufsize); 94 | 95 | // buffered send functions 96 | bool SendByteBuffered(Bit8u data); 97 | bool SendArrayBuffered(Bit8u* data, Bitu bufsize); 98 | 99 | private: 100 | TCPsocket mysock; 101 | SDLNet_SocketSet listensocketset; 102 | 103 | // Items for send buffering 104 | Bitu sendbuffersize; 105 | Bitu sendbufferindex; 106 | 107 | Bit8u* sendbuffer; 108 | }; 109 | 110 | class TCPServerSocket { 111 | public: 112 | bool isopen; 113 | TCPsocket mysock; 114 | TCPServerSocket(Bit16u port); 115 | ~TCPServerSocket(); 116 | TCPClientSocket* Accept(); 117 | }; 118 | 119 | 120 | #endif //C_MODEM 121 | 122 | #endif //# SDLNETWRAPPER_H 123 | -------------------------------------------------------------------------------- /libco/x86.c: -------------------------------------------------------------------------------- 1 | /* 2 | libco.x86 (2009-10-12) 3 | author: byuu 4 | license: public domain 5 | */ 6 | 7 | #define LIBCO_C 8 | #include 9 | #include 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #if defined(_MSC_VER) 17 | #define fastcall __fastcall 18 | #elif defined(__GNUC__) 19 | #define fastcall __attribute__((fastcall)) 20 | #else 21 | #error "libco: please define fastcall macro" 22 | #endif 23 | 24 | static thread_local long co_active_buffer[64]; 25 | static thread_local cothread_t co_active_handle = 0; 26 | static void (fastcall *co_swap)(cothread_t, cothread_t) = 0; 27 | 28 | //ABI: fastcall 29 | static unsigned char co_swap_function[] = { 30 | 0x89, 0x22, /* mov [edx],esp */ 31 | 0x8b, 0x21, /* mov esp,[ecx] */ 32 | 0x58, /* pop eax */ 33 | 0x89, 0x6a, 0x04, /* mov [edx+0x04],ebp */ 34 | 0x89, 0x72, 0x08, /* mov [edx+0x08],esi */ 35 | 0x89, 0x7a, 0x0c, /* mov [edx+0x0c],edi */ 36 | 0x89, 0x5a, 0x10, /* mov [edx+0x10],ebx */ 37 | 0x8b, 0x69, 0x04, /* mov ebp,[ecx+0x04] */ 38 | 0x8b, 0x71, 0x08, /* mov esi,[ecx+0x08] */ 39 | 0x8b, 0x79, 0x0c, /* mov edi,[ecx+0x0c] */ 40 | 0x8b, 0x59, 0x10, /* mov ebx,[ecx+0x10] */ 41 | 0xff, 0xe0, /* jmp eax */ 42 | }; 43 | 44 | #ifdef _WIN32 45 | #include 46 | 47 | void co_init(void) 48 | { 49 | DWORD old_privileges; 50 | VirtualProtect(co_swap_function, 51 | sizeof co_swap_function, PAGE_EXECUTE_READWRITE, &old_privileges); 52 | } 53 | #else 54 | #include 55 | #include 56 | 57 | void co_init(void) 58 | { 59 | unsigned long addr = (unsigned long)co_swap_function; 60 | unsigned long base = addr - (addr % sysconf(_SC_PAGESIZE)); 61 | unsigned long size = (addr - base) + sizeof co_swap_function; 62 | mprotect((void*)base, size, PROT_READ | PROT_WRITE | PROT_EXEC); 63 | } 64 | #endif 65 | 66 | static void crash(void) 67 | { 68 | assert(0); /* called only if cothread_t entrypoint returns */ 69 | } 70 | 71 | cothread_t co_active(void) 72 | { 73 | if(!co_active_handle) 74 | co_active_handle = &co_active_buffer; 75 | return co_active_handle; 76 | } 77 | 78 | cothread_t co_create(unsigned int size, void (*entrypoint)(void)) 79 | { 80 | cothread_t handle; 81 | if(!co_swap) 82 | { 83 | co_init(); 84 | co_swap = (void (fastcall*)(cothread_t, cothread_t))co_swap_function; 85 | } 86 | 87 | if(!co_active_handle) 88 | co_active_handle = &co_active_buffer; 89 | 90 | size += 256; /* allocate additional space for storage */ 91 | size &= ~15; /* align stack to 16-byte boundary */ 92 | 93 | if((handle = (cothread_t)malloc(size))) 94 | { 95 | long *p = (long*)((char*)handle + size); /* seek to top of stack */ 96 | *--p = (long)crash; /* crash if entrypoint returns */ 97 | *--p = (long)entrypoint; /* start of function */ 98 | *(long*)handle = (long)p; /* stack pointer */ 99 | } 100 | 101 | return handle; 102 | } 103 | 104 | void co_delete(cothread_t handle) 105 | { 106 | free(handle); 107 | } 108 | 109 | void co_switch(cothread_t handle) 110 | { 111 | register cothread_t co_previous_handle = co_active_handle; 112 | co_swap(co_active_handle = handle, co_previous_handle); 113 | } 114 | 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | -------------------------------------------------------------------------------- /src/gui/midi_win32.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef WIN32_LEAN_AND_MEAN 21 | #define WIN32_LEAN_AND_MEAN 22 | #endif 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | class MidiHandler_win32: public MidiHandler { 29 | private: 30 | HMIDIOUT m_out; 31 | MIDIHDR m_hdr; 32 | HANDLE m_event; 33 | bool isOpen; 34 | public: 35 | MidiHandler_win32() : MidiHandler(),isOpen(false) {}; 36 | const char * GetName(void) { return "win32";}; 37 | bool Open(const char * conf) { 38 | if (isOpen) return false; 39 | m_event = CreateEvent (NULL, true, true, NULL); 40 | MMRESULT res = MMSYSERR_NOERROR; 41 | if(conf && *conf) { 42 | std::string strconf(conf); 43 | std::istringstream configmidi(strconf); 44 | unsigned int nummer = midiOutGetNumDevs(); 45 | configmidi >> nummer; 46 | if(nummer < midiOutGetNumDevs()){ 47 | MIDIOUTCAPS mididev; 48 | midiOutGetDevCaps(nummer, &mididev, sizeof(MIDIOUTCAPS)); 49 | LOG_MSG("MIDI:win32 selected %s",mididev.szPname); 50 | res = midiOutOpen(&m_out, nummer, (DWORD_PTR)m_event, 0, CALLBACK_EVENT); 51 | } 52 | } else { 53 | res = midiOutOpen(&m_out, MIDI_MAPPER, (DWORD_PTR)m_event, 0, CALLBACK_EVENT); 54 | } 55 | if (res != MMSYSERR_NOERROR) return false; 56 | isOpen=true; 57 | return true; 58 | }; 59 | 60 | void Close(void) { 61 | if (!isOpen) return; 62 | isOpen=false; 63 | midiOutClose(m_out); 64 | CloseHandle (m_event); 65 | }; 66 | void PlayMsg(Bit8u * msg) { 67 | midiOutShortMsg(m_out, *(Bit32u*)msg); 68 | }; 69 | void PlaySysex(Bit8u * sysex,Bitu len) { 70 | if (WaitForSingleObject (m_event, 2000) == WAIT_TIMEOUT) { 71 | LOG(LOG_MISC,LOG_ERROR)("Can't send midi message"); 72 | return; 73 | } 74 | midiOutUnprepareHeader (m_out, &m_hdr, sizeof (m_hdr)); 75 | 76 | m_hdr.lpData = (char *) sysex; 77 | m_hdr.dwBufferLength = len ; 78 | m_hdr.dwBytesRecorded = len ; 79 | m_hdr.dwUser = 0; 80 | 81 | MMRESULT result = midiOutPrepareHeader (m_out, &m_hdr, sizeof (m_hdr)); 82 | if (result != MMSYSERR_NOERROR) return; 83 | ResetEvent (m_event); 84 | result = midiOutLongMsg (m_out,&m_hdr,sizeof(m_hdr)); 85 | if (result != MMSYSERR_NOERROR) { 86 | SetEvent (m_event); 87 | return; 88 | } 89 | } 90 | void ListAll(Program* base) { 91 | unsigned int total = midiOutGetNumDevs(); 92 | for(unsigned int i = 0;i < total;i++) { 93 | MIDIOUTCAPS mididev; 94 | midiOutGetDevCaps(i, &mididev, sizeof(MIDIOUTCAPS)); 95 | base->WriteOut("%2d\t \"%s\"\n",i,mididev.szPname); 96 | } 97 | } 98 | }; 99 | 100 | MidiHandler_win32 Midi_win32; 101 | 102 | 103 | -------------------------------------------------------------------------------- /src/libs/zmbv/zmbv_vfw.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "winres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | 30 | 1 TEXTINCLUDE 31 | BEGIN 32 | "resource.h\0" 33 | END 34 | 35 | 2 TEXTINCLUDE 36 | BEGIN 37 | "#include ""winres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE 42 | BEGIN 43 | "\r\n" 44 | "\0" 45 | END 46 | 47 | #endif // APSTUDIO_INVOKED 48 | 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | // 52 | // Dialog 53 | // 54 | 55 | IDD_ABOUT DIALOGEX 0, 0, 167, 55 56 | STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | 57 | WS_SYSMENU 58 | CAPTION "DOSBox Video Codec v0.1" 59 | FONT 8, "MS Sans Serif", 0, 0, 0x0 60 | BEGIN 61 | DEFPUSHBUTTON "OK",IDOK,131,34,29,14 62 | CTEXT "Zipped Motion Block Video v 0.1\nCopyright 2009-2013 DOSBox Team", 63 | IDC_STATIC,7,7,153,25,SS_NOPREFIX 64 | PUSHBUTTON "Email author",IDC_EMAIL,7,34,50,14 65 | PUSHBUTTON "Visit home page",IDC_HOMEPAGE,59,34,58,14 66 | END 67 | 68 | IDD_CONFIGURE DIALOGEX 0, 0, 213, 146 69 | STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | 70 | WS_SYSMENU 71 | CAPTION "ZMBV configuration dialog" 72 | FONT 8, "MS Sans Serif", 0, 0, 0x0 73 | BEGIN 74 | PUSHBUTTON "Email author",IDC_EMAIL,44,86,50,14 75 | PUSHBUTTON "Visit home page",IDC_HOMEPAGE,109,87,58,14 76 | DEFPUSHBUTTON "OK",IDOK,44,125,50,14 77 | PUSHBUTTON "Cancel",IDCANCEL,117,125,50,14 78 | CONTROL "",IDC_SLIDER1,"msctls_trackbar32",TBS_BOTH | 79 | TBS_NOTICKS | WS_TABSTOP,57,30,92,18 80 | END 81 | 82 | 83 | ///////////////////////////////////////////////////////////////////////////// 84 | // 85 | // DESIGNINFO 86 | // 87 | 88 | #ifdef APSTUDIO_INVOKED 89 | GUIDELINES DESIGNINFO 90 | BEGIN 91 | IDD_ABOUT, DIALOG 92 | BEGIN 93 | LEFTMARGIN, 7 94 | RIGHTMARGIN, 160 95 | TOPMARGIN, 7 96 | BOTTOMMARGIN, 48 97 | END 98 | 99 | IDD_CONFIGURE, DIALOG 100 | BEGIN 101 | LEFTMARGIN, 44 102 | RIGHTMARGIN, 167 103 | TOPMARGIN, 6 104 | BOTTOMMARGIN, 139 105 | END 106 | END 107 | #endif // APSTUDIO_INVOKED 108 | 109 | #endif // English (U.S.) resources 110 | ///////////////////////////////////////////////////////////////////////////// 111 | 112 | 113 | 114 | #ifndef APSTUDIO_INVOKED 115 | ///////////////////////////////////////////////////////////////////////////// 116 | // 117 | // Generated from the TEXTINCLUDE 3 resource. 118 | // 119 | 120 | 121 | ///////////////////////////////////////////////////////////////////////////// 122 | #endif // not APSTUDIO_INVOKED 123 | 124 | -------------------------------------------------------------------------------- /src/hardware/serialport/serialdummy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 "dosbox.h" 21 | 22 | #include "setup.h" 23 | #include "serialdummy.h" 24 | #include "serialport.h" 25 | 26 | CSerialDummy::CSerialDummy(Bitu id, CommandLine* cmd):CSerial(id, cmd) { 27 | CSerial::Init_Registers(); 28 | setRI(false); 29 | setDSR(false); 30 | setCD(false); 31 | setCTS(false); 32 | InstallationSuccessful=true; 33 | } 34 | 35 | CSerialDummy::~CSerialDummy() { 36 | // clear events 37 | removeEvent(SERIAL_TX_EVENT); 38 | } 39 | 40 | void CSerialDummy::handleUpperEvent(Bit16u type) { 41 | if(type==SERIAL_TX_EVENT) { 42 | //LOG_MSG("SERIAL_TX_EVENT"); 43 | #ifdef CHECKIT_TESTPLUG 44 | receiveByte(loopbackdata); 45 | #endif 46 | ByteTransmitted(); // tx timeout 47 | } 48 | else if(type==SERIAL_THR_EVENT){ 49 | //LOG_MSG("SERIAL_THR_EVENT"); 50 | ByteTransmitting(); 51 | setEvent(SERIAL_TX_EVENT,bytetime); 52 | } 53 | 54 | } 55 | 56 | /*****************************************************************************/ 57 | /* updatePortConfig is called when emulated app changes the serial port **/ 58 | /* parameters baudrate, stopbits, number of databits, parity. **/ 59 | /*****************************************************************************/ 60 | void CSerialDummy::updatePortConfig(Bit16u divider, Bit8u lcr) { 61 | //LOG_MSG("Serial port at 0x%x: Port params changed: %d Baud", base,dcb.BaudRate); 62 | } 63 | 64 | void CSerialDummy::updateMSR() { 65 | } 66 | void CSerialDummy::transmitByte(Bit8u val, bool first) { 67 | 68 | if(first) setEvent(SERIAL_THR_EVENT, bytetime/10); 69 | else setEvent(SERIAL_TX_EVENT, bytetime); 70 | 71 | #ifdef CHECKIT_TESTPLUG 72 | loopbackdata=val; 73 | #endif 74 | } 75 | 76 | /*****************************************************************************/ 77 | /* setBreak(val) switches break on or off **/ 78 | /*****************************************************************************/ 79 | 80 | void CSerialDummy::setBreak(bool value) { 81 | //LOG_MSG("UART 0x%x: Break toggeled: %d", base, value); 82 | } 83 | 84 | /*****************************************************************************/ 85 | /* setRTSDTR sets the modem control lines **/ 86 | /*****************************************************************************/ 87 | void CSerialDummy::setRTSDTR(bool rts, bool dtr) { 88 | setRTS(rts); 89 | setDTR(dtr); 90 | } 91 | void CSerialDummy::setRTS(bool val) { 92 | #ifdef CHECKIT_TESTPLUG 93 | setCTS(val); 94 | #endif 95 | } 96 | void CSerialDummy::setDTR(bool val) { 97 | #ifdef CHECKIT_TESTPLUG 98 | setDSR(val); 99 | setRI(val); 100 | setCD(val); 101 | #endif 102 | } 103 | -------------------------------------------------------------------------------- /include/callback.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef DOSBOX_CALLBACK_H 21 | #define DOSBOX_CALLBACK_H 22 | 23 | #ifndef DOSBOX_MEM_H 24 | #include "mem.h" 25 | #endif 26 | 27 | typedef Bitu (*CallBack_Handler)(void); 28 | extern CallBack_Handler CallBack_Handlers[]; 29 | 30 | enum { CB_RETN,CB_RETF,CB_RETF8,CB_IRET,CB_IRETD,CB_IRET_STI,CB_IRET_EOI_PIC1, 31 | CB_IRQ0,CB_IRQ1,CB_IRQ9,CB_IRQ12,CB_IRQ12_RET,CB_IRQ6_PCJR,CB_MOUSE, 32 | CB_INT29,CB_INT16,CB_HOOKABLE,CB_TDE_IRET,CB_IPXESR,CB_IPXESR_RET, 33 | CB_INT21,CB_INT13 }; 34 | 35 | #define CB_MAX 128 36 | #define CB_SIZE 32 37 | #define CB_SEG 0xF000 38 | #define CB_SOFFSET 0x1000 39 | 40 | enum { 41 | CBRET_NONE=0,CBRET_STOP=1 42 | }; 43 | 44 | extern Bit8u lastint; 45 | 46 | static INLINE RealPt CALLBACK_RealPointer(Bitu callback) { 47 | return RealMake(CB_SEG,(Bit16u)(CB_SOFFSET+callback*CB_SIZE)); 48 | } 49 | static INLINE PhysPt CALLBACK_PhysPointer(Bitu callback) { 50 | return PhysMake(CB_SEG,(Bit16u)(CB_SOFFSET+callback*CB_SIZE)); 51 | } 52 | 53 | static INLINE PhysPt CALLBACK_GetBase(void) { 54 | return (CB_SEG << 4) + CB_SOFFSET; 55 | } 56 | 57 | Bitu CALLBACK_Allocate(); 58 | 59 | void CALLBACK_Idle(void); 60 | 61 | 62 | void CALLBACK_RunRealInt(Bit8u intnum); 63 | void CALLBACK_RunRealFar(Bit16u seg,Bit16u off); 64 | 65 | bool CALLBACK_Setup(Bitu callback,CallBack_Handler handler,Bitu type,const char* descr); 66 | Bitu CALLBACK_Setup(Bitu callback,CallBack_Handler handler,Bitu type,PhysPt addr,const char* descr); 67 | 68 | const char* CALLBACK_GetDescription(Bitu callback); 69 | bool CALLBACK_Free(Bitu callback); 70 | 71 | void CALLBACK_SCF(bool val); 72 | void CALLBACK_SZF(bool val); 73 | void CALLBACK_SIF(bool val); 74 | 75 | extern Bitu call_priv_io; 76 | 77 | 78 | class CALLBACK_HandlerObject{ 79 | private: 80 | bool installed; 81 | Bitu m_callback; 82 | enum {NONE,SETUP,SETUPAT} m_type; 83 | struct { 84 | RealPt old_vector; 85 | Bit8u interrupt; 86 | bool installed; 87 | } vectorhandler; 88 | public: 89 | CALLBACK_HandlerObject():installed(false),m_type(NONE) { 90 | vectorhandler.installed=false; 91 | } 92 | ~CALLBACK_HandlerObject(); 93 | 94 | //Install and allocate a callback. 95 | void Install(CallBack_Handler handler,Bitu type,const char* description); 96 | void Install(CallBack_Handler handler,Bitu type,PhysPt addr,const char* description); 97 | 98 | void Uninstall(); 99 | 100 | //Only allocate a callback number 101 | void Allocate(CallBack_Handler handler,const char* description=0); 102 | Bit16u Get_callback() { 103 | return (Bit16u)m_callback; 104 | } 105 | RealPt Get_RealPointer() { 106 | return CALLBACK_RealPointer(m_callback); 107 | } 108 | void Set_RealVec(Bit8u vec); 109 | }; 110 | #endif 111 | -------------------------------------------------------------------------------- /src/libs/zmbv/zmbv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | -------------------------------------------------------------------------------- /src/cpu/core_full/save.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | /* Write the data from the opcode */ 20 | switch (inst.code.save) { 21 | /* Byte */ 22 | case S_C_Eb: 23 | inst_op1_b=inst.cond ? 1 : 0; 24 | case S_Eb: 25 | if (inst.rm<0xc0) SaveMb(inst.rm_eaa,inst_op1_b); 26 | else reg_8(inst.rm_eai)=inst_op1_b; 27 | break; 28 | case S_Gb: 29 | reg_8(inst.rm_index)=inst_op1_b; 30 | break; 31 | case S_EbGb: 32 | if (inst.rm<0xc0) SaveMb(inst.rm_eaa,inst_op1_b); 33 | else reg_8(inst.rm_eai)=inst_op1_b; 34 | reg_8(inst.rm_index)=inst_op2_b; 35 | break; 36 | /* Word */ 37 | case S_Ew: 38 | if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst_op1_w); 39 | else reg_16(inst.rm_eai)=inst_op1_w; 40 | break; 41 | case S_Gw: 42 | reg_16(inst.rm_index)=inst_op1_w; 43 | break; 44 | case S_EwGw: 45 | if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst_op1_w); 46 | else reg_16(inst.rm_eai)=inst_op1_w; 47 | reg_16(inst.rm_index)=inst_op2_w; 48 | break; 49 | /* Dword */ 50 | case S_Ed: 51 | if (inst.rm<0xc0) SaveMd(inst.rm_eaa,inst_op1_d); 52 | else reg_32(inst.rm_eai)=inst_op1_d; 53 | break; 54 | case S_EdMw: /* Special one 16 to memory, 32 zero extend to reg */ 55 | if (inst.rm<0xc0) SaveMw(inst.rm_eaa,inst_op1_w); 56 | else reg_32(inst.rm_eai)=inst_op1_d; 57 | break; 58 | case S_Gd: 59 | reg_32(inst.rm_index)=inst_op1_d; 60 | break; 61 | case S_EdGd: 62 | if (inst.rm<0xc0) SaveMd(inst.rm_eaa,inst_op1_d); 63 | else reg_32(inst.rm_eai)=inst_op1_d; 64 | reg_32(inst.rm_index)=inst_op2_d; 65 | break; 66 | 67 | case S_REGb: 68 | reg_8(inst.code.extra)=inst_op1_b; 69 | break; 70 | case S_REGw: 71 | reg_16(inst.code.extra)=inst_op1_w; 72 | break; 73 | case S_REGd: 74 | reg_32(inst.code.extra)=inst_op1_d; 75 | break; 76 | case S_SEGm: 77 | if (CPU_SetSegGeneral((SegNames)inst.rm_index,inst_op1_w)) RunException(); 78 | break; 79 | case S_SEGGw: 80 | if (CPU_SetSegGeneral((SegNames)inst.code.extra,inst_op2_w)) RunException(); 81 | reg_16(inst.rm_index)=inst_op1_w; 82 | break; 83 | case S_SEGGd: 84 | if (CPU_SetSegGeneral((SegNames)inst.code.extra,inst_op2_w)) RunException(); 85 | reg_32(inst.rm_index)=inst_op1_d; 86 | break; 87 | case S_PUSHw: 88 | Push_16(inst_op1_w); 89 | break; 90 | case S_PUSHd: 91 | Push_32(inst_op1_d); 92 | break; 93 | 94 | case S_C_AIPw: 95 | if (!inst.cond) goto nextopcode; 96 | case S_AIPw: 97 | SaveIP(); 98 | reg_eip+=inst_op1_d; 99 | reg_eip&=0xffff; 100 | continue; 101 | case S_C_AIPd: 102 | if (!inst.cond) goto nextopcode; 103 | case S_AIPd: 104 | SaveIP(); 105 | reg_eip+=inst_op1_d; 106 | continue; 107 | case S_IPIw: 108 | reg_esp+=Fetchw(); 109 | case S_IP: 110 | SaveIP(); 111 | reg_eip=inst_op1_d; 112 | continue; 113 | case 0: 114 | break; 115 | default: 116 | LOG(LOG_CPU,LOG_ERROR)("SAVE:Unhandled code %d entry %X",inst.code.save,inst.entry); 117 | } 118 | -------------------------------------------------------------------------------- /src/hardware/serialport/nullmodem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 guard 21 | #ifndef DOSBOX_NULLMODEM_WIN32_H 22 | #define DOSBOX_NULLMODEM_WIN32_H 23 | 24 | #include "dosbox.h" 25 | 26 | #if C_MODEM 27 | 28 | #include "misc_util.h" 29 | #include "serialport.h" 30 | 31 | #define SERIAL_SERVER_POLLING_EVENT SERIAL_BASE_EVENT_COUNT+1 32 | #define SERIAL_TX_REDUCTION SERIAL_BASE_EVENT_COUNT+2 33 | #define SERIAL_NULLMODEM_DTR_EVENT SERIAL_BASE_EVENT_COUNT+3 34 | #define SERIAL_NULLMODEM_EVENT_COUNT SERIAL_BASE_EVENT_COUNT+3 35 | 36 | class CNullModem : public CSerial { 37 | public: 38 | CNullModem(Bitu id, CommandLine* cmd); 39 | ~CNullModem(); 40 | 41 | void updatePortConfig(Bit16u divider, Bit8u lcr); 42 | void updateMSR(); 43 | void transmitByte(Bit8u val, bool first); 44 | void setBreak(bool value); 45 | 46 | void setRTSDTR(bool rts, bool dtr); 47 | void setRTS(bool val); 48 | void setDTR(bool val); 49 | void handleUpperEvent(Bit16u type); 50 | 51 | private: 52 | TCPServerSocket* serversocket; 53 | TCPClientSocket* clientsocket; 54 | 55 | bool receiveblock; // It's not a block of data it rather blocks 56 | Bit16u serverport; // we are a server if this is nonzero 57 | Bit16u clientport; 58 | 59 | Bit8u hostnamebuffer[128]; // the name passed to us by the user 60 | 61 | Bitu rx_state; 62 | #define N_RX_IDLE 0 63 | #define N_RX_WAIT 1 64 | #define N_RX_BLOCKED 2 65 | #define N_RX_FASTWAIT 3 66 | #define N_RX_DISC 4 67 | 68 | bool doReceive(); 69 | bool ClientConnect(TCPClientSocket* newsocket); 70 | bool ServerListen(); 71 | bool ServerConnect(); 72 | void Disconnect(); 73 | Bits readChar(); 74 | void WriteChar(Bit8u data); 75 | 76 | bool DTR_delta; // with dtrrespect, we try to establish a connection 77 | // whenever DTR switches to 1. This variable is 78 | // used to remember the old state. 79 | 80 | bool tx_block; // true while the SERIAL_TX_REDUCTION event 81 | // is pending 82 | 83 | Bitu rx_retry; // counter of retries 84 | 85 | Bitu rx_retry_max; // how many POLL_EVENTS to wait before causing 86 | // a overrun error. 87 | 88 | Bitu tx_gather; // how long to gather tx data before 89 | // sending all of them [milliseconds] 90 | 91 | 92 | bool dtrrespect; // dtr behavior - only send data to the serial 93 | // port when DTR is on 94 | 95 | bool transparent; // if true, don't send 0xff 0xXX to toggle 96 | // DSR/CTS. 97 | 98 | bool telnet; // Do Telnet parsing. 99 | 100 | // Telnet's brain 101 | #define TEL_CLIENT 0 102 | #define TEL_SERVER 1 103 | 104 | Bits TelnetEmulation(Bit8u data); 105 | 106 | // Telnet's memory 107 | struct { 108 | bool binary[2]; 109 | bool echo[2]; 110 | bool supressGA[2]; 111 | bool timingMark[2]; 112 | 113 | bool inIAC; 114 | bool recCommand; 115 | Bit8u command; 116 | } telClient; 117 | }; 118 | 119 | #endif // C_MODEM 120 | #endif // include guard 121 | -------------------------------------------------------------------------------- /src/cpu/core_dynrec/risc_armv4le-common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | 21 | /* ARMv4 (little endian) backend by M-HT (common data/functions) */ 22 | 23 | 24 | // some configuring defines that specify the capabilities of this architecture 25 | // or aspects of the recompiling 26 | 27 | // protect FC_ADDR over function calls if necessaray 28 | // #define DRC_PROTECT_ADDR_REG 29 | 30 | // try to use non-flags generating functions if possible 31 | #define DRC_FLAGS_INVALIDATION 32 | // try to replace _simple functions by code 33 | #define DRC_FLAGS_INVALIDATION_DCODE 34 | 35 | // type with the same size as a pointer 36 | #define DRC_PTR_SIZE_IM Bit32u 37 | 38 | // calling convention modifier 39 | #define DRC_CALL_CONV /* nothing */ 40 | #define DRC_FC /* nothing */ 41 | 42 | // use FC_REGS_ADDR to hold the address of "cpu_regs" and to access it using FC_REGS_ADDR 43 | #define DRC_USE_REGS_ADDR 44 | // use FC_SEGS_ADDR to hold the address of "Segs" and to access it using FC_SEGS_ADDR 45 | #define DRC_USE_SEGS_ADDR 46 | 47 | // register mapping 48 | typedef Bit8u HostReg; 49 | 50 | // "lo" registers 51 | #define HOST_r0 0 52 | #define HOST_r1 1 53 | #define HOST_r2 2 54 | #define HOST_r3 3 55 | #define HOST_r4 4 56 | #define HOST_r5 5 57 | #define HOST_r6 6 58 | #define HOST_r7 7 59 | // "hi" registers 60 | #define HOST_r8 8 61 | #define HOST_r9 9 62 | #define HOST_r10 10 63 | #define HOST_r11 11 64 | #define HOST_r12 12 65 | #define HOST_r13 13 66 | #define HOST_r14 14 67 | #define HOST_r15 15 68 | 69 | // register aliases 70 | // "lo" registers 71 | #define HOST_a1 HOST_r0 72 | #define HOST_a2 HOST_r1 73 | #define HOST_a3 HOST_r2 74 | #define HOST_a4 HOST_r3 75 | #define HOST_v1 HOST_r4 76 | #define HOST_v2 HOST_r5 77 | #define HOST_v3 HOST_r6 78 | #define HOST_v4 HOST_r7 79 | // "hi" registers 80 | #define HOST_v5 HOST_r8 81 | #define HOST_v6 HOST_r9 82 | #define HOST_v7 HOST_r10 83 | #define HOST_v8 HOST_r11 84 | #define HOST_ip HOST_r12 85 | #define HOST_sp HOST_r13 86 | #define HOST_lr HOST_r14 87 | #define HOST_pc HOST_r15 88 | 89 | 90 | static void cache_block_closing(Bit8u* block_start,Bitu block_size) { 91 | #if (__ARM_EABI__) 92 | //flush cache - eabi 93 | register unsigned long _beg __asm ("a1") = (unsigned long)(block_start); // block start 94 | register unsigned long _end __asm ("a2") = (unsigned long)(block_start+block_size); // block end 95 | register unsigned long _flg __asm ("a3") = 0; 96 | register unsigned long _par __asm ("r7") = 0xf0002; // sys_cacheflush 97 | __asm __volatile ("swi 0x0" 98 | : // no outputs 99 | : "r" (_beg), "r" (_end), "r" (_flg), "r" (_par) 100 | ); 101 | #else 102 | // GP2X BEGIN 103 | //flush cache - old abi 104 | register unsigned long _beg __asm ("a1") = (unsigned long)(block_start); // block start 105 | register unsigned long _end __asm ("a2") = (unsigned long)(block_start+block_size); // block end 106 | register unsigned long _flg __asm ("a3") = 0; 107 | __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" 108 | : // no outputs 109 | : "r" (_beg), "r" (_end), "r" (_flg) 110 | ); 111 | // GP2X END 112 | #endif 113 | } 114 | -------------------------------------------------------------------------------- /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 | // Get the MIDIEndPoint 30 | m_endpoint = 0; 31 | OSStatus result; 32 | Bitu numDests = MIDIGetNumberOfDestinations(); 33 | Bitu destId = 0; 34 | if(conf && conf[0]) destId = atoi(conf); 35 | 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 | // Not, as it is for Endpoints created by us 71 | // MIDIEndpointDispose(m_endpoint); 72 | } 73 | 74 | void PlayMsg(Bit8u * msg) { 75 | // Acquire a MIDIPacketList 76 | Byte packetBuf[128]; 77 | MIDIPacketList *packetList = (MIDIPacketList *)packetBuf; 78 | m_pCurPacket = MIDIPacketListInit(packetList); 79 | 80 | // Determine the length of msg 81 | Bitu len=MIDI_evt_len[*msg]; 82 | 83 | // Add msg to the MIDIPacketList 84 | MIDIPacketListAdd(packetList, (ByteCount)sizeof(packetBuf), m_pCurPacket, (MIDITimeStamp)0, len, msg); 85 | 86 | // Send the MIDIPacketList 87 | MIDISend(m_port,m_endpoint,packetList); 88 | } 89 | 90 | void PlaySysex(Bit8u * sysex, Bitu len) { 91 | // Acquire a MIDIPacketList 92 | Byte packetBuf[SYSEX_SIZE*4]; 93 | Bitu pos=0; 94 | MIDIPacketList *packetList = (MIDIPacketList *)packetBuf; 95 | m_pCurPacket = MIDIPacketListInit(packetList); 96 | 97 | // Add msg to the MIDIPacketList 98 | MIDIPacketListAdd(packetList, (ByteCount)sizeof(packetBuf), m_pCurPacket, (MIDITimeStamp)0, len, sysex); 99 | 100 | // Send the MIDIPacketList 101 | MIDISend(m_port,m_endpoint,packetList); 102 | } 103 | void ListAll(Program* base) { 104 | Bitu numDests = MIDIGetNumberOfDestinations(); 105 | for(Bitu i = 0; i < numDests; i++){ 106 | MIDIEndpointRef dest = MIDIGetDestination(i); 107 | if(!dest) continue; 108 | CFStringRef midiname = 0; 109 | if(MIDIObjectGetStringProperty(dest, kMIDIPropertyDisplayName, &midiname) == noErr) { 110 | const char * s = CFStringGetCStringPtr(midiname, kCFStringEncodingMacRoman); 111 | if(s) base->WriteOut("%02d\t%s\n",i,s); 112 | } 113 | //This is for EndPoints created by us. 114 | //MIDIEndpointDispose(dest); 115 | } 116 | 117 | } 118 | }; 119 | 120 | MidiHandler_coremidi Midi_coremidi; 121 | 122 | -------------------------------------------------------------------------------- /include/fpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | -------------------------------------------------------------------------------- /src/libs/zmbv/zmbv.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 11 | 12 | 13 | 19 | 31 | 33 | 43 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 61 | 63 | 64 | 70 | 78 | 80 | 92 | 94 | 96 | 98 | 100 | 102 | 104 | 106 | 108 | 110 | 112 | 113 | 114 | 115 | 116 | 117 | 119 | 120 | 122 | 123 | 125 | 126 | 128 | 129 | 131 | 132 | 134 | 135 | 137 | 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /src/cpu/lazyflags.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 __LAZYFLAG_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 | -------------------------------------------------------------------------------- /include/mixer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2002-2013 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 | #ifndef DOSBOX_MIXER_H 21 | #define DOSBOX_MIXER_H 22 | 23 | #ifndef DOSBOX_DOSBOX_H 24 | #include "dosbox.h" 25 | #endif 26 | 27 | typedef void (*MIXER_MixHandler)(Bit8u * sampdate,Bit32u len); 28 | typedef void (*MIXER_Handler)(Bitu len); 29 | 30 | enum BlahModes { 31 | MIXER_8MONO,MIXER_8STEREO, 32 | MIXER_16MONO,MIXER_16STEREO 33 | }; 34 | 35 | enum MixerModes { 36 | M_8M,M_8S, 37 | M_16M,M_16S 38 | }; 39 | 40 | #define MIXER_BUFSIZE (16*1024) 41 | #define MIXER_BUFMASK (MIXER_BUFSIZE-1) 42 | extern Bit8u MixTemp[MIXER_BUFSIZE]; 43 | 44 | #define MAX_AUDIO ((1<<(16-1))-1) 45 | #define MIN_AUDIO -(1<<(16-1)) 46 | 47 | class MixerChannel { 48 | public: 49 | void SetVolume(float _left,float _right); 50 | void SetScale( float f ); 51 | void UpdateVolume(void); 52 | void SetFreq(Bitu _freq); 53 | void Mix(Bitu _needed); 54 | void AddSilence(void); //Fill up until needed 55 | 56 | template 57 | void AddSamples(Bitu len, const Type* data); 58 | 59 | void AddSamples_m8(Bitu len, const Bit8u * data); 60 | void AddSamples_s8(Bitu len, const Bit8u * data); 61 | void AddSamples_m8s(Bitu len, const Bit8s * data); 62 | void AddSamples_s8s(Bitu len, const Bit8s * data); 63 | void AddSamples_m16(Bitu len, const Bit16s * data); 64 | void AddSamples_s16(Bitu len, const Bit16s * data); 65 | void AddSamples_m16u(Bitu len, const Bit16u * data); 66 | void AddSamples_s16u(Bitu len, const Bit16u * data); 67 | void AddSamples_m32(Bitu len, const Bit32s * data); 68 | void AddSamples_s32(Bitu len, const Bit32s * data); 69 | void AddSamples_m16_nonnative(Bitu len, const Bit16s * data); 70 | void AddSamples_s16_nonnative(Bitu len, const Bit16s * data); 71 | void AddSamples_m16u_nonnative(Bitu len, const Bit16u * data); 72 | void AddSamples_s16u_nonnative(Bitu len, const Bit16u * data); 73 | void AddSamples_m32_nonnative(Bitu len, const Bit32s * data); 74 | void AddSamples_s32_nonnative(Bitu len, const Bit32s * data); 75 | 76 | void AddStretched(Bitu len,Bit16s * data); //Strech block up into needed data 77 | void FillUp(void); 78 | void Enable(bool _yesno); 79 | MIXER_Handler handler; 80 | float volmain[2]; 81 | float scale; 82 | Bit32s volmul[2]; 83 | Bitu freq_add,freq_index; 84 | Bitu done,needed; 85 | Bits last[2]; 86 | const char * name; 87 | bool enabled; 88 | MixerChannel * next; 89 | }; 90 | 91 | MixerChannel * MIXER_AddChannel(MIXER_Handler handler,Bitu freq,const char * name); 92 | MixerChannel * MIXER_FindChannel(const char * name); 93 | /* Find the device you want to delete with findchannel "delchan gets deleted" */ 94 | void MIXER_DelChannel(MixerChannel* delchan); 95 | 96 | /* Object to maintain a mixerchannel; As all objects it registers itself with create 97 | * and removes itself when destroyed. */ 98 | class MixerObject{ 99 | private: 100 | bool installed; 101 | char m_name[32]; 102 | public: 103 | MixerObject():installed(false){}; 104 | MixerChannel* Install(MIXER_Handler handler,Bitu freq,const char * name); 105 | ~MixerObject(); 106 | }; 107 | 108 | 109 | /* PC Speakers functions, tightly related to the timer functions */ 110 | void PCSPEAKER_SetCounter(Bitu cntr,Bitu mode); 111 | void PCSPEAKER_SetType(Bitu mode); 112 | 113 | #endif 114 | --------------------------------------------------------------------------------